From b3342f09281c409e7809c3f44895a76e63c45fb5 Mon Sep 17 00:00:00 2001 From: Marcus Date: Thu, 20 May 2021 00:19:25 -0400 Subject: [PATCH 1/6] lots of shit, okay? --- Instance.js | 109 --------------- package.json | 9 +- src/Instance.js | 109 +++++++++++++++ src/Module.js | 183 +++++++++++++++++++++++++ Module.js => src/Module.ts | 65 +++++---- Serializable.js => src/Serializable.js | 0 src/System.js | 99 +++++++++++++ System.js => src/System.ts | 37 +++-- src/createAst.js | 75 ++++++++++ createAst.js => src/createAst.ts | 63 ++++++++- extensions.js => src/extensions.js | 0 grammar.ne => src/grammar.ne | 10 +- src/minify.js | 14 ++ minify.js => src/minify.ts | 2 +- src/run.js | 96 +++++++++++++ run.js => src/run.ts | 23 ++-- src/tokens.js | 27 ++++ tokens.js => src/tokens.ts | 0 test/pawn.v | 6 + test/places/forest.v | 11 -- test/places/population.v | 1 - test/world.v | 26 +--- tsconfig.json | 11 ++ yarn.lock | 30 ++++ 24 files changed, 800 insertions(+), 206 deletions(-) delete mode 100644 Instance.js create mode 100644 src/Instance.js create mode 100644 src/Module.js rename Module.js => src/Module.ts (61%) rename Serializable.js => src/Serializable.js (100%) create mode 100644 src/System.js rename System.js => src/System.ts (74%) create mode 100644 src/createAst.js rename createAst.js => src/createAst.ts (68%) rename extensions.js => src/extensions.js (100%) rename grammar.ne => src/grammar.ne (84%) create mode 100644 src/minify.js rename minify.js => src/minify.ts (81%) create mode 100644 src/run.js rename run.js => src/run.ts (74%) mode change 100755 => 100644 create mode 100644 src/tokens.js rename tokens.js => src/tokens.ts (100%) create mode 100644 test/pawn.v delete mode 100644 test/places/forest.v delete mode 100644 test/places/population.v create mode 100644 tsconfig.json diff --git a/Instance.js b/Instance.js deleted file mode 100644 index 8b9e282..0000000 --- a/Instance.js +++ /dev/null @@ -1,109 +0,0 @@ - -import Serializable from './Serializable.js'; -import minify from './minify.js'; -import debug from 'debug'; -import _ from 'lodash'; -const log = debug('vogue:instance'); - - -export default class Instance extends Serializable { - module = null; - links = {} - system = null; - context = null; - locals = []; - internalFunctions = {}; - - // reconstruct context when we need it... - createContext() { - let ctx = {}; - for(const name in this.links) { - ctx[name] = this.links[name]; - } - for(const name in this.module.imports) { - ctx[name] = this.module.imports[name]; - this.locals.push(name); - } - ctx = { - ...ctx, - ...this.system.staticInstances, - ...this.internalFunctions - } - for(const identifier in this.system.staticInstances) { - this.locals.push(identifier); - } - ctx.create = this.system.newInstance.bind(this.system); - this.locals.push('create'); - this.context = ctx; - }; - - ready = false; - - constructor(module, location, parameters, system) { - super(); - this.module = module; - this.location = location; - this.system = system; - for(const name of this.module.links.optional.arrays) this.links[name] = []; - for(const name of this.module.links.optional.single) this.links[name] = null; - - for(const fnName in this.module.functions) { - this.internalFunctions[fnName] = - this.invokeInternal.bind(this, fnName); - } - this.createContext(); - - this._link = new Proxy(this, { - get(target, prop, receiver) { - if(prop === 'restore') return undefined; - if(prop in target.module.functions) { - return target.invokeInternal.bind(target, prop); - } - return undefined; - } - }); - } - - hasPublicFunction(name) { - return (name in this.module.functions); - } - - invokeInternal(name, ...args) { - log('invoking', this.module.name.full + '.' + name, 'with args', args); - const content = this.module.functions[name].code; - const passingArguments = _.zipObject(this.module.functions[name].parameters, args); - if(!content) throw new TypeError(name + ' is not a function!'); - return evalInContext(content, this.context, this.locals, passingArguments); - } - - get link () { - return this._link; - } -} - -function evalInContext(js, context, locals, passingArguments) { - //# Return the results of the in-line anonymous function we .call with the passed context - // log('='.repeat(80) + 'OG Block'); - // log(js); - // log('='.repeat(80) + 'Arguments'); - // log(passingArguments); - const that = this; - return function() { - const preminJs = -`'use strict'; -(() => { - ${locals.map((k) => `const ${k} = this.${k};`).join('\n\t')} - ${Object.keys(passingArguments).map(name => `let ${name} = passingArguments.${name};`).join('\n\t')} - ${js} -})();`; - // log('='.repeat(80) + 'preminjs'); - // log(preminJs); - const newJs = minify(preminJs); - // log('='.repeat(80) + 'minjs'); - // log(newJs); - // newJs should inject into result... - let result; - eval(newJs); - return result; - }.call(context); -} \ No newline at end of file diff --git a/package.json b/package.json index 4f9dd4f..f07eb7a 100644 --- a/package.json +++ b/package.json @@ -11,15 +11,22 @@ "c": "nearleyc", "test": "node run.js test", "debug": "cross-env DEBUG=vogue:* yarn test", - "postinstall": "cd test && yarn" + "postinstall": "cd test && yarn", + "tsc": "tsc" }, "dependencies": { + "@types/debug": "^4.1.5", + "@types/lodash": "^4.14.169", + "@types/nearley": "^2.11.1", + "@types/node": "^15.3.0", + "@types/uglify-js": "^3.13.0", "cross-env": "^7.0.3", "debug": "^4.3.1", "lodash": "^4.17.21", "moo": "^0.5.1", "nearley": "^2.20.1", "nedb": "^1.8.0", + "typescript": "^4.2.4", "uglify-js": "^3.13.5", "yarn": "^1.22.10" } diff --git a/src/Instance.js b/src/Instance.js new file mode 100644 index 0000000..21a3d23 --- /dev/null +++ b/src/Instance.js @@ -0,0 +1,109 @@ + +import Serializable from './Serializable.js'; +import minify from './minify.js'; +import debug from 'debug'; +import _ from 'lodash'; +const log = debug('vogue:instance'); +import vm from 'vm'; +/** + * @typedef {import('./System.js').default} System + * @typedef {import('./Module.js').default} Module + */ + + +export default class Instance extends Serializable { + /** @type {Module} */ + module = null; + links = {} + system = null; + context = null; + locals = []; + internalFunctions = {}; + /** @type {Proxy} */ + _link = null; + + createContext() { + const initialContext = {}; + + // system globals! + // TODO turn this into its own vogue module! system.create/instance.create + // TODO request context from system... + initialContext.create = this.system.create.bind(this.system); + for(const name of this.system.staticInstances) + initialContext[name] = this.system.staticInstances[name]; + + // local links! + // optional arrays + // TODO maybe make these property accessors to allow for some automation + for(const name of this.module.links.optional.arrays) + initialContext[name] = []; + for(const name of this.module.links.optional.single) + initialContext[name] = null; + + // local functions time! + // for(const name of this.module.functions) + + + + // let ctx = vm.createContext({ + // create: this.system.newInstance.bind(this.system), + // ...this.system.staticInstances, + // ...this.internalFunctions + // }); + + + // for(const name in this.module.imports) { + // ctx[name] = this.module.imports[name]; + // this.locals.push(name); + // } + // ctx = { + // ...ctx, + + // } + // for(const identifier in this.system.staticInstances) { + // this.locals.push(identifier); + // } + // // ctx.create = + // this.locals.push('create'); + this.context = ctx; + }; + + /** + * + * @param {Module} module + * @param {string} location + * @param {Object} parameters + * @param {System} system + */ + constructor(module, location, parameters, system) { + super(); + this.module = module; + this.location = location; + this.system = system; + + this.createContext(); + + this._link = new Proxy(this, { + get(target, prop, receiver) { + if(prop === 'restore') return undefined; + if(prop in target.module.functions) { + // TODO return the fn + return + } + return undefined; + } + }); + } + + hasPublicFunction(name) { + return (name in this.module.functions); + } + + invokeInternal(name, ...args) { + log('invoking', this.module.name.full + '.' + name, 'with args', args); + } + + get link () { + return this._link; + } +} \ No newline at end of file diff --git a/src/Module.js b/src/Module.js new file mode 100644 index 0000000..924a0c1 --- /dev/null +++ b/src/Module.js @@ -0,0 +1,183 @@ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +import { createAst } from './createAst'; +import path from 'path'; +import debug from 'debug'; +import { createRequire } from 'module'; +var log = debug('vogue:module'); +var Module = /** @class */ (function () { + function Module() { + this.links = { + required: { + single: [], + arrays: [] + }, + optional: { + single: [], + arrays: [] + } + }; + this.globals = []; + this.functions = []; + this.identifiers = {}; + this.name = { + space: '', + last: '', + full: '' + }; + this.imports = {}; + this.variables = { + cold: [], + warm: [] + }; + this.directives = { + 'singleton': false, + 'keepalive': false, + 'static': '' + }; + } + Module.prototype.directive = function (_a) { + var directive = _a.directive, value = _a.value; + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_b) { + this.directives[directive] = value; + return [2 /*return*/]; + }); + }); + }; + Module.prototype.link = function (_a) { + var required = _a.required, array = _a.array, name = _a.name; + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_b) { + this.links[required ? 'required' : 'optional'][array ? 'arrays' : 'single'] + .push(name); + return [2 /*return*/]; + }); + }); + }; + Module.prototype.namespace = function (_a) { + var namespace = _a.namespace; + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_b) { + this.name.space = namespace; + this.name.full = this.name.space + '.' + this.name.last; + return [2 /*return*/]; + }); + }); + }; + Module.prototype["function"] = function (_a) { + var name = _a.name, block = _a.block, parameters = _a.parameters; + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_b) { + this.functions[name] = { + code: block, + parameters: parameters + }; + return [2 /*return*/]; + }); + }); + }; + Module.prototype["import"] = function (_a) { + var importName = _a.importName, name = _a.name; + return __awaiter(this, void 0, void 0, function () { + var nodePath, __require__, imported; + return __generator(this, function (_b) { + nodePath = path.resolve(this.rootDir, 'node_module'); + log('#'.repeat(80)); + log(nodePath); + __require__ = createRequire(nodePath); + imported = __require__(importName); + if ('default' in imported) + this.imports[name] = imported["default"]; + else + this.imports[name] = imported; + return [2 /*return*/]; + }); + }); + }; + Module.prototype.variable = function (_a) { + var persist = _a.persist, name = _a.name; + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_b) { + this.variables[persist ? 'cold' : 'warm'].push(name); + return [2 /*return*/]; + }); + }); + }; + Module.create = function (location, rootDir) { + return __awaiter(this, void 0, void 0, function () { + var module, ast, name, _i, ast_1, item; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + module = new Module(); + ast = createAst(location); + name = path.parse(location).name; + module.name.last = name; + module.name.full = name; + module.rootDir = rootDir; + _i = 0, ast_1 = ast; + _a.label = 1; + case 1: + if (!(_i < ast_1.length)) return [3 /*break*/, 4]; + item = ast_1[_i]; + if ('name' in item) { + if (item.name in module.identifiers) + throw new Error('Identifier ' + item.name + ' already declared!'); + else + module.identifiers[item.name] = item.type; + } + if (!(item.type in module)) return [3 /*break*/, 3]; + return [4 /*yield*/, module[item.type](item)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: + _i++; + return [3 /*break*/, 1]; + case 4: + log('='.repeat(80)); + log(location); + log(module); + return [2 /*return*/, module]; + } + }); + }); + }; + return Module; +}()); +export default Module; diff --git a/Module.js b/src/Module.ts similarity index 61% rename from Module.js rename to src/Module.ts index ca08df7..ecb6752 100644 --- a/Module.js +++ b/src/Module.ts @@ -1,23 +1,25 @@ -import createAst from './createAst.js' +import { createAst, DirectiveRule, DirectiveValue, FunctionRule, ImportRule, LinkRule, NamespaceRule, VariableRule } from './createAst' import path from 'path'; import debug from 'debug'; import { createRequire } from 'module'; import { pathToFileURL } from 'url'; const log = debug('vogue:module'); +type Link = { + name: string, + array: boolean, + required: boolean +} + export default class Module { - links = { - required: { - single: [], - arrays: [] - }, - optional: { - single: [], - arrays: [] - } - }; + links: Link[] = []; globals = []; - functions = []; + functions: { + [name: string]: { + code: string, + parameters: string[] + } + } = {}; identifiers = {}; name = { space: '', @@ -28,35 +30,42 @@ export default class Module { variables = { cold: [], warm: [] - } - singleton = false; - keepalive = false; - 'static' = null; + }; + directives: { + [key: string]: DirectiveValue + } = { + 'singleton': false, + 'keepalive': false, + 'static': '' + }; + rootDir: string = ''; + - async directive({directive, value}) { - this[directive] = value ?? true; + async directive({directive, value}: DirectiveRule) { + this.directives[directive] = value; } - async link({required, array, name}) { - this.links - [required ? 'required' : 'optional'] - [array ? 'arrays' : 'single'] - .push(name); + async link({required, array, name}: LinkRule) { + this.links.push({ + name, + required, + array + }); } - async namespace({namespace}) { + async namespace({namespace}: NamespaceRule) { this.name.space = namespace; this.name.full = this.name.space + '.' + this.name.last; } - async function({name, block, parameters}) { + async function({name, block, parameters}: FunctionRule) { this.functions[name] = { code: block, parameters }; } - async import({importName, name}) { + async import({importName, name}: ImportRule) { const nodePath = path.resolve(this.rootDir, 'node_module'); log('#'.repeat(80)); log(nodePath); @@ -66,11 +75,11 @@ export default class Module { else this.imports[name] = imported; } - async variable({persist, name}) { + async variable({persist, name}: VariableRule) { this.variables[persist ? 'cold' : 'warm'].push(name); } - static async create(location, rootDir) { + static async create(location: string, rootDir: string) { const module = new Module(); const ast = createAst(location); const name = path.parse(location).name; diff --git a/Serializable.js b/src/Serializable.js similarity index 100% rename from Serializable.js rename to src/Serializable.js diff --git a/src/System.js b/src/System.js new file mode 100644 index 0000000..1e2d293 --- /dev/null +++ b/src/System.js @@ -0,0 +1,99 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import Instance from './Instance'; +import Serializable from './Serializable'; +import _ from 'lodash'; +import Module from './Module'; +import debug from 'debug'; +var log = debug('vogue:system'); +var get = _.get, set = _.set; +var System = /** @class */ (function (_super) { + __extends(System, _super); + function System(modules, rootDir) { + var _this = _super.call(this) || this; + _this.instances = []; + _this.namespace = {}; + _this.staticInstances = {}; + _this.modules = modules; + _this.createNamespace(); + var bootModules = _this.deriveBootModules(); + _this.createStaticInstances(); + _this.rootDir = rootDir; + log('instantiating boot modules...'); + for (var _i = 0, bootModules_1 = bootModules; _i < bootModules_1.length; _i++) { + var name_1 = bootModules_1[_i]; + log(' ' + name_1); + _this.newInstance(name_1); + } + return _this; + } + System.prototype.createStaticInstances = function () { + log('deriving static modules...'); + var staticModules = this.modules.filter(function (module) { + return !!module.static; + }).map(function (module) { + log(' ' + module.name.full); + return module; + }); + log('instantiating static modules...'); + for (var _i = 0, staticModules_1 = staticModules; _i < staticModules_1.length; _i++) { + var module_1 = staticModules_1[_i]; + log(' ' + module_1.static + ': ' + module_1.name.full); + this.staticInstances[module_1.static] = + this.newInstance(module_1.name.full, {}); + } + }; + System.prototype.deriveBootModules = function () { + log('deriving boot modules...'); + var bootModules = this.modules.filter(function (module) { + return module.singleton; + }).map(function (module) { + return module.name.full; + }); + for (var _i = 0, bootModules_2 = bootModules; _i < bootModules_2.length; _i++) { + var name_2 = bootModules_2[_i]; + log(' ' + name_2); + } + return bootModules; + }; + System.prototype.createNamespace = function () { + log('creating namespace map...'); + this.namespace = this.modules.reduce(function (acc, val) { + if (get(acc, val.name.full) instanceof Module) + throw new Error('Duplicate module "' + val.name.full + '"'); + set(acc, val.name.full, val); + log(' ' + val.name.full); + return acc; + }, {}); + }; + System.prototype.getModule = function (name) { + return get(this.namespace, name); + }; + System.prototype.createInstance = function (name, args) { + if (args === void 0) { args = {}; } + return new Instance(this.getModule(name), null, args, this); + }; + System.prototype.newInstance = function (name, args) { + if (args === void 0) { args = {}; } + var instance = this.createInstance(name, args); + var link = instance.link; + if (instance.hasPublicFunction('restore')) + instance.invokeInternal('restore'); + return link; + }; + return System; +}(Serializable)); +export default System; diff --git a/System.js b/src/System.ts similarity index 74% rename from System.js rename to src/System.ts index 7ab0862..131c190 100644 --- a/System.js +++ b/src/System.ts @@ -1,19 +1,28 @@ -import Instance from './Instance.js'; -import Serializable from './Serializable.js'; +import Instance from './Instance'; +import Serializable from './Serializable'; import _ from 'lodash'; -import Module from './Module.js'; +import Module from './Module'; import debug from 'debug'; const log = debug('vogue:system') const {get, set} = _; -export default class System extends Serializable { - instances = []; - modules = null; - namespace = null; - staticInstances = {}; +type ModuleNamespaceMap = { + [key: string]: ModuleNamespaceMap | Module +}; - constructor(modules, rootDir) { +type ModuleName = string; + +class System extends Serializable { + instances: Instance[] = []; + modules: Module[]; + namespace: ModuleNamespaceMap = {}; + staticInstances: { + [key: string]: Instance + } = {}; + rootDir: string; + + constructor(modules: Module[], rootDir: string) { super(); this.modules = modules; this.createNamespace(); @@ -70,19 +79,21 @@ export default class System extends Serializable { }, {}); } - getModule(name) { + getModule(name: ModuleName) { return get(this.namespace, name); } - createInstance(name, args = {}) { + createInstance(name: ModuleName, args = {}) { return new Instance(this.getModule(name), null, args, this); } - newInstance(name, args = {}) { + newInstance(name: ModuleName, args = {}) { const instance = this.createInstance(name, args); const link = instance.link; if(instance.hasPublicFunction('restore')) instance.invokeInternal('restore'); return link; } -} \ No newline at end of file +} + +export default System; \ No newline at end of file diff --git a/src/createAst.js b/src/createAst.js new file mode 100644 index 0000000..b1f6965 --- /dev/null +++ b/src/createAst.js @@ -0,0 +1,75 @@ +import nearley from 'nearley'; +// TODO none of these shits have typings, but its OKAY +// @ts-ignore +import compile from 'nearley/lib/compile.js'; +// @ts-ignore +import generate from 'nearley/lib/generate.js'; +// @ts-ignore +import nearleyGrammar from 'nearley/lib/nearley-language-bootstrapped.js'; +// @ts-ignore +import moo from 'moo'; +import tokens from './tokens'; +import { readFileSync } from 'fs'; +import debug from 'debug'; +import { resolve, dirname } from 'path'; +import { fileURLToPath } from 'url'; +var log = debug('vogue:ast'); +var grammarFile = resolve(fileURLToPath(dirname(import.meta.url)), 'grammar.ne'); +log('grammarFile:', grammarFile); +function createParser() { + // Parse the grammar source into an AST + var grammarParser = new nearley.Parser(nearleyGrammar); + grammarParser.feed(readFileSync(grammarFile).toString()); + var grammarAst = grammarParser.results[0]; // TODO check for errors + // Compile the AST into a set of rules + var grammarInfoObject = compile(grammarAst, {}); + // Generate JavaScript code from the rules + var grammarJs = generate(grammarInfoObject, "grammar"); + var lexer = moo.compile(tokens); + // lexer.__proto__.formatError = function(token, message) { + // if (token == null) { + // // An undefined token indicates EOF + // var text = this.buffer.slice(this.index) + // var token = { + // text: text, + // offset: this.index, + // lineBreaks: text.indexOf('\n') === -1 ? 0 : 1, + // line: this.line, + // col: this.col, + // } + // } + // var start = Math.max(0, token.offset - token.col + 1) + // var eol = token.lineBreaks ? token.text.indexOf('\n') : token.text.length + // var firstLine = this.buffer.substring(start, token.offset + eol) + // message += " at line " + token.line + " col " + token.col + ":\n\n" + // message += " " + firstLine + "\n" + // message += " " + Array(token.col).join(" ") + "^" + // return message + // } + // Pretend this is a CommonJS environment to catch exports from the grammar. + var module = { exports: {} }; + eval(grammarJs); + var grammar = module.exports; + // THESE IS COMPLICATED SHITS, IDK MAN WHAT ARE TYPINGS + // @ts-ignore + return new nearley.Parser(nearley.Grammar.fromCompiled(grammar)); +} +export function createAst(location) { + var parser = createParser(); + var contents = readFileSync(location).toString(); + // parser.reportError = function(token) { + // return JSON.stringify(token, null, 2); + // var message = this.lexer.formatError(token, 'invalid syntax') + '\n'; + // message += 'Unexpected ' + (token.type ? token.type + ' token: ' : ''); + // message += + // JSON.stringify(token.value !== undefined ? token.value : token) + '\n'; + // return message; + // }; + parser.feed(contents); + parser.finish(); + var ast = parser.results[0]; + log('='.repeat(80)); + log(location); + log(ast); + return ast || []; +} diff --git a/createAst.js b/src/createAst.ts similarity index 68% rename from createAst.js rename to src/createAst.ts index 466508f..14b20eb 100644 --- a/createAst.js +++ b/src/createAst.ts @@ -1,14 +1,20 @@ import nearley from 'nearley'; +// TODO none of these shits have typings, but its OKAY +// @ts-ignore import compile from 'nearley/lib/compile.js'; +// @ts-ignore import generate from 'nearley/lib/generate.js'; +// @ts-ignore import nearleyGrammar from 'nearley/lib/nearley-language-bootstrapped.js'; +// @ts-ignore import moo from 'moo'; -import tokens from './tokens.js'; + +import tokens from './tokens'; import { readFileSync } from 'fs'; import debug from 'debug'; import { resolve, dirname } from 'path'; import { fileURLToPath } from 'url'; -import minify from './minify.js'; +import minify from './minify'; const log = debug('vogue:ast'); const grammarFile = resolve(fileURLToPath(dirname(import.meta.url)), 'grammar.ne'); @@ -53,10 +59,61 @@ function createParser() { eval(grammarJs); const grammar = module.exports; + // THESE IS COMPLICATED SHITS, IDK MAN WHAT ARE TYPINGS + // @ts-ignore return new nearley.Parser(nearley.Grammar.fromCompiled(grammar)) } -export default function createAst(location) { + +export type FunctionRule = { + type: 'function', + name: string + block: string, + parameters: string[] +}; + +export type VariableRule = { + type: 'variable', + persist: boolean, + name: string +}; + +export type NamespaceRule = { + type: 'namesapce', + namespace: string +}; + +export type ImportRule = { + type: 'import', + name: string, + importName: string +}; + +export type LinkRule = { + type: 'link', + array: boolean, + required: boolean, + name: string +} + +export type DirectiveValue = string | boolean; + +export type DirectiveRule = { + type: 'directive', + directive: 'static' | 'singleton' | 'keepalive', + value: DirectiveValue +} + +export type Rule = FunctionRule + | VariableRule + | ImportRule + | DirectiveRule + | LinkRule + | NamespaceRule; + +export type AST = Rule[]; + +export function createAst(location: string): AST { const parser = createParser(); const contents = readFileSync(location).toString(); diff --git a/extensions.js b/src/extensions.js similarity index 100% rename from extensions.js rename to src/extensions.js diff --git a/grammar.ne b/src/grammar.ne similarity index 84% rename from grammar.ne rename to src/grammar.ne index ba7cfdb..5211d59 100644 --- a/grammar.ne +++ b/src/grammar.ne @@ -17,7 +17,7 @@ FUNCTION_DECLARATION -> _ IDENTIFIER _ PARAMETERS:? _ JS_BLOCK EOL {% ([,name,,p | _ %ASYNC __ IDENTIFIER _ PARAMETERS:? _ JS_BLOCK_ASYNC EOL {% ([,,,name,,params,,block]) => { return { type: 'function', name: name, block, parameters: params } } %} DIRECTIVE_STATEMENT -> DIRECTIVE __ IDENTIFIER EOL {% ([directive,,identifier]) => { return { type: 'directive', directive, value: identifier }} %} - | DIRECTIVE EOL {% ([directive]) => { return { type: 'directive', directive }} %} + | DIRECTIVE EOL {% ([directive]) => { return { type: 'directive', directive, value: true }} %} DIRECTIVE -> %SINGLETON {% () => 'singleton' %} | %KEEPALIVE {% () => 'keepalive' %} @@ -42,10 +42,10 @@ EOL -> _ %SEMICOLON:? STRING -> %STRING {% ([d]) => d.value.substring(1, d.value.length - 1) %} SEMICOLON -> %SEMICOLON IDENTIFIER -> %IDENTIFIER {% ([id]) => id.value %} -JS_BLOCK -> %JS_BLOCK {% ([block]) => minify(`result = (() => {${block.value.substring(2, block.value.length - 2)}})();`) %} - | %JS_BLOCK2 {% ([block]) => minify(`result = (() => {${block.value.substring(1, block.value.length - 1)}})();`) %} -JS_BLOCK_ASYNC -> %JS_BLOCK {% ([block]) => minify(`result = (async () => {${block.value.substring(2, block.value.length - 2)}})();`) %} - | %JS_BLOCK2 {% ([block]) => minify(`result = (async () => {${block.value.substring(1, block.value.length - 1)}})();`) %} +JS_BLOCK -> %JS_BLOCK {% ([block]) => (`(() => {${block.value.substring(2, block.value.length - 2)}});`) %} + | %JS_BLOCK2 {% ([block]) => (`(() => {${block.value.substring(1, block.value.length - 1)}});`) %} +JS_BLOCK_ASYNC -> %JS_BLOCK {% ([block]) => (`(async () => {${block.value.substring(2, block.value.length - 2)}});`) %} + | %JS_BLOCK2 {% ([block]) => (`(async () => {${block.value.substring(1, block.value.length - 1)}});`) %} SPREAD_OPERATOR -> %SPREAD_OPERATOR _ -> null | %SPACE {% () => undefined %} __ -> %SPACE {% () => undefined %} \ No newline at end of file diff --git a/src/minify.js b/src/minify.js new file mode 100644 index 0000000..bbaa4ce --- /dev/null +++ b/src/minify.js @@ -0,0 +1,14 @@ +import uglify from 'uglify-js'; +export default (function (code) { + return uglify.minify(code, { + compress: { + dead_code: true, + global_defs: { + DEBUG: false + } + }, + sourceMap: { + content: 'inline' + } + }).code; +}); diff --git a/minify.js b/src/minify.ts similarity index 81% rename from minify.js rename to src/minify.ts index e2ea8d8..20535d1 100644 --- a/minify.js +++ b/src/minify.ts @@ -1,7 +1,7 @@ import uglify from 'uglify-js'; -export default (code) => { +export default (code: string): string => { return uglify.minify(code, { compress: { dead_code: true, diff --git a/src/run.js b/src/run.js new file mode 100644 index 0000000..38460fc --- /dev/null +++ b/src/run.js @@ -0,0 +1,96 @@ +#!/usr/bin/env node +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from) { + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) + to[j] = from[i]; + return to; +}; +import debug from 'debug'; +var log = debug('vogue:cli'); +var systemLocation = resolve(process.argv[2]); +import { parse, resolve, dirname } from 'path'; +import { readdirSync, lstatSync } from 'fs'; +import _ from 'lodash'; +import Module from './Module'; +import System from './System'; +import './extensions.js'; +import { fileURLToPath } from 'url'; +var get = _.get, set = _.set; +var standardLibrary = resolve(fileURLToPath(dirname(import.meta.url)), 'lib'); +(function () { return __awaiter(void 0, void 0, void 0, function () { + var ignoreDeps, files, fullpaths, modules, sys; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + ignoreDeps = function (path) { return parse(path).name !== 'node_modules'; }; + files = __spreadArray(__spreadArray([], walkdirSync(systemLocation, ignoreDeps)), walkdirSync(standardLibrary, ignoreDeps)); + fullpaths = files + .filter(function (v) { return lstatSync(v).isFile(); }) + .filter(function (v) { return parse(v).ext === '.v'; }); + log('included modules'); + log(files); + log('parsing modules...'); + return [4 /*yield*/, Promise.all(fullpaths.map(function (loc) { return Module.create(loc, systemLocation); }))]; + case 1: + modules = _a.sent(); + sys = new System(modules, systemLocation); + return [2 /*return*/]; + } + }); +}); })(); +function walkdirSync(root, filter) { + if (filter === void 0) { filter = function () { return true; }; } + log('reading', root, '...'); + var paths = readdirSync(root).map(function (v) { return resolve(root, v); }); + var _a = sift(paths.filter(filter), function (v) { return lstatSync(v).isFile(); }), files = _a[0], dirs = _a[1]; + log("files: " + files.length + " | dirs: " + dirs.length); + var rfiles = dirs.map(function (v) { return walkdirSync(v, filter); }).reduce(function (a, v) { return __spreadArray(__spreadArray([], a), v); }, []); + return __spreadArray(__spreadArray([], files), rfiles); +} +function sift(a, fn) { + var left = [], right = []; + for (var i = 0; i < a.length; i++) { + var v = a[i]; + var lr = !!fn(v, i, a); + if (lr) + left = __spreadArray(__spreadArray([], left), [v]); + else + right = __spreadArray(__spreadArray([], right), [v]); + } + return [left, right]; +} diff --git a/run.js b/src/run.ts old mode 100755 new mode 100644 similarity index 74% rename from run.js rename to src/run.ts index 8372f30..b22aef7 --- a/run.js +++ b/src/run.ts @@ -7,19 +7,19 @@ import { parse, resolve, dirname } from 'path'; import { readdirSync, lstatSync } from 'fs'; import _ from 'lodash'; -import Module from './Module.js'; -import System from './System.js'; +import Module from './Module'; +import System from './System'; import './extensions.js'; import { fileURLToPath } from 'url'; // globals inside grammar context -import minify from './minify.js'; +import minify from './minify'; const { get, set } = _; const standardLibrary = resolve(fileURLToPath(dirname(import.meta.url)), 'lib'); (async () => { // TODO simplify this line gaddam - const ignoreDeps = (path) => parse(path).name !== 'node_modules'; + const ignoreDeps = (path: string) => parse(path).name !== 'node_modules'; const files = [ ...walkdirSync(systemLocation, ignoreDeps), @@ -37,10 +37,10 @@ const standardLibrary = resolve(fileURLToPath(dirname(import.meta.url)), 'lib'); const sys = new System(modules, systemLocation); })() -function walkdirSync(root, filter = () => true) { +function walkdirSync(root: string, filter: ((path: string) => boolean) = () => true): string[] { log('reading', root, '...'); const paths = readdirSync(root).map(v => resolve(root, v)); - const [ files, dirs ] = sift(paths.filter(filter), (v) => lstatSync(v).isFile()); + const [ files, dirs ] = sift(paths.filter(filter), (v: string) => lstatSync(v).isFile()); log(`files: ${files.length} | dirs: ${dirs.length}`); const rfiles = dirs.map(v => walkdirSync(v, filter)).reduce((a, v) => [...a, ...v], []); @@ -50,15 +50,8 @@ function walkdirSync(root, filter = () => true) { ]; } -/** - * - * @param {T[]} a - * @param {(v: T, i: number, a: T[]) => string} fn - * - * @returns {Object} - */ -function sift(a, fn) { - let left = [], right = []; +function sift(a: T[], fn: (v: T, i: number, a: T[]) => boolean): [T[], T[]] { + let left: T[] = [], right: T[] = []; for(let i = 0; i < a.length; i ++) { const v = a[i] const lr = !!fn(v, i, a); diff --git a/src/tokens.js b/src/tokens.js new file mode 100644 index 0000000..2f86c26 --- /dev/null +++ b/src/tokens.js @@ -0,0 +1,27 @@ +export default { + LINK: 'link', + NAMESPACE: 'namespace', + REQUIRED: 'required', + SINGLETON: 'singleton', + KEEPALIVE: 'keepalive', + STATIC: 'static', + MEMBER: 'member', + RUNTIME: 'runtime', + IMPORT: 'import', + ASYNC: 'async', + AS: 'as', + FROM: 'from', + COMMA: ',', + STRING: /'(?:\\['\\]|[^\n'\\])*'/, + LSQBRACKET: '[', + RSQBRACKET: ']', + LPAREN: '(', + RPAREN: ')', + SPREAD_OPERATOR: '...', + DOTOP: '.', + JS_BLOCK: /\[\[[^]*?\n\]\]$/, + JS_BLOCK2: /{[^]*?\n}$/, + IDENTIFIER: /[a-zA-Z][a-zA-Z0-9]*/, + SPACE: { match: /\s+/, lineBreaks: true }, + SEMICOLON: ';' +}; diff --git a/tokens.js b/src/tokens.ts similarity index 100% rename from tokens.js rename to src/tokens.ts diff --git a/test/pawn.v b/test/pawn.v new file mode 100644 index 0000000..72a7433 --- /dev/null +++ b/test/pawn.v @@ -0,0 +1,6 @@ + + + +restore { + +} \ No newline at end of file diff --git a/test/places/forest.v b/test/places/forest.v deleted file mode 100644 index ccfc12c..0000000 --- a/test/places/forest.v +++ /dev/null @@ -1,11 +0,0 @@ -namespace places; - -required link world; -link[] roads; - -member nitrogen; - -restore { - this.nitrogen ??= Math.floor(Math.random() * 50); -} - diff --git a/test/places/population.v b/test/places/population.v deleted file mode 100644 index 8aff8b4..0000000 --- a/test/places/population.v +++ /dev/null @@ -1 +0,0 @@ -namespace places \ No newline at end of file diff --git a/test/world.v b/test/world.v index c59b7b4..2625b35 100644 --- a/test/world.v +++ b/test/world.v @@ -1,28 +1,16 @@ -link[] places; -link place; -link character; +link[] pawns; -import random from 'random-world'; +member map; +member size; restore { - if(this.places.empty) - this.createPlaces(); + for(let i = 0; i < 3; i ++) { - this.character ??= create('') + } + + this.size ??= 64; } async render() { -} - -createPlaces() { - for(let i = 0; i < 10; i ++) { - const name = random.city(); - const valid = !!name.match(/^[A-Za-z ]*$/); - if(!valid) { - i --; - continue; - } - console.log(name); - } } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..32485d6 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "module": "esnext", + "moduleResolution": "node", + "strict": true, + "allowSyntheticDefaultImports": true + }, + "include": [ + "src/**/*.ts" + ] +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 9c2a0bd..709555e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,28 @@ # yarn lockfile v1 +"@types/debug@^4.1.5": + version "4.1.5" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd" + +"@types/lodash@^4.14.169": + version "4.14.169" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.169.tgz#83c217688f07a4d9ef8f28a3ebd1d318f6ff4cbb" + +"@types/nearley@^2.11.1": + version "2.11.1" + resolved "https://registry.yarnpkg.com/@types/nearley/-/nearley-2.11.1.tgz#6ac3f57c00ca28071a1774ec72d2e45750f21420" + +"@types/node@^15.3.0": + version "15.3.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-15.3.0.tgz#d6fed7d6bc6854306da3dea1af9f874b00783e26" + +"@types/uglify-js@^3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.13.0.tgz#1cad8df1fb0b143c5aba08de5712ea9d1ff71124" + dependencies: + source-map "^0.6.1" + async@0.2.10: version "0.2.10" resolved "https://registry.npmjs.org/async/-/async-0.2.10.tgz" @@ -130,6 +152,14 @@ shebang-regex@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" +source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + +typescript@^4.2.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961" + uglify-js@^3.13.5: version "3.13.5" resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.5.tgz" From c347189e4b40708e5a77a7ae9daf6d2faebd3e64 Mon Sep 17 00:00:00 2001 From: Valerie Date: Thu, 20 May 2021 20:34:50 -0400 Subject: [PATCH 2/6] converted to tyescript for memes --- .gitignore | 3 +- .npmignore | 5 + {src => lib}/grammar.ne | 12 +- lib/{ => vogue}/console.v | 0 package.json | 13 +- src/{Instance.js => Instance.ts} | 67 +++++---- src/KV.ts | 3 + src/Module.js | 183 ----------------------- src/Module.ts | 71 +++++---- src/{Serializable.js => Serializable.ts} | 68 +++++---- src/System.js | 99 ------------ src/System.ts | 14 +- src/createAst.js | 75 ---------- src/createAst.ts | 11 +- src/{extensions.js => extensions.ts} | 0 src/minify.js | 14 -- src/run.js | 96 ------------ src/run.ts | 6 +- src/tokens.js | 27 ---- tsconfig.json | 6 +- vogue-0.0.1.tgz | Bin 0 -> 30409 bytes yarn.lock | 4 + 22 files changed, 177 insertions(+), 600 deletions(-) create mode 100644 .npmignore rename {src => lib}/grammar.ne (83%) rename lib/{ => vogue}/console.v (100%) rename src/{Instance.js => Instance.ts} (54%) create mode 100644 src/KV.ts delete mode 100644 src/Module.js rename src/{Serializable.js => Serializable.ts} (70%) delete mode 100644 src/System.js delete mode 100644 src/createAst.js rename src/{extensions.js => extensions.ts} (100%) delete mode 100644 src/minify.js delete mode 100644 src/run.js delete mode 100644 src/tokens.js create mode 100644 vogue-0.0.1.tgz diff --git a/.gitignore b/.gitignore index b512c09..884a4d8 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -node_modules \ No newline at end of file +node_modules +out diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..ff53e28 --- /dev/null +++ b/.npmignore @@ -0,0 +1,5 @@ +node_modules +src +test +.editorconfig +tsconfig.json \ No newline at end of file diff --git a/src/grammar.ne b/lib/grammar.ne similarity index 83% rename from src/grammar.ne rename to lib/grammar.ne index 5211d59..2b93d0a 100644 --- a/src/grammar.ne +++ b/lib/grammar.ne @@ -13,8 +13,8 @@ STATEMENT -> _ LINK_DECLARATION EOL {% ([,stuff]) => { return stuff } %} IMPORT_STATMENT -> %IMPORT __ STRING __ %AS __ IDENTIFIER {% ([,,moduleName,,,,identifier]) => { return { type: 'import', name: identifier, importName: moduleName }} %} | %IMPORT __ IDENTIFIER __ %FROM __ STRING {% ([,,identifier,,,,moduleName]) => { return { type: 'import', name: identifier, importName: moduleName }} %} -FUNCTION_DECLARATION -> _ IDENTIFIER _ PARAMETERS:? _ JS_BLOCK EOL {% ([,name,,params,,block]) => { return { type: 'function', name: name, block, parameters: params } } %} - | _ %ASYNC __ IDENTIFIER _ PARAMETERS:? _ JS_BLOCK_ASYNC EOL {% ([,,,name,,params,,block]) => { return { type: 'function', name: name, block, parameters: params } } %} +FUNCTION_DECLARATION -> _ IDENTIFIER _ PARAMETERS:? _ JS_BLOCK EOL {% ([,name,,params,,block]) => { return { type: 'function', name: name, block, parameters: params ?? [], async: false } } %} + | _ %ASYNC __ IDENTIFIER _ PARAMETERS:? _ JS_BLOCK_ASYNC EOL {% ([,,,name,,params,,block]) => { return { type: 'function', name: name, block, parameters: params ?? [], async: true } } %} DIRECTIVE_STATEMENT -> DIRECTIVE __ IDENTIFIER EOL {% ([directive,,identifier]) => { return { type: 'directive', directive, value: identifier }} %} | DIRECTIVE EOL {% ([directive]) => { return { type: 'directive', directive, value: true }} %} @@ -42,10 +42,10 @@ EOL -> _ %SEMICOLON:? STRING -> %STRING {% ([d]) => d.value.substring(1, d.value.length - 1) %} SEMICOLON -> %SEMICOLON IDENTIFIER -> %IDENTIFIER {% ([id]) => id.value %} -JS_BLOCK -> %JS_BLOCK {% ([block]) => (`(() => {${block.value.substring(2, block.value.length - 2)}});`) %} - | %JS_BLOCK2 {% ([block]) => (`(() => {${block.value.substring(1, block.value.length - 1)}});`) %} -JS_BLOCK_ASYNC -> %JS_BLOCK {% ([block]) => (`(async () => {${block.value.substring(2, block.value.length - 2)}});`) %} - | %JS_BLOCK2 {% ([block]) => (`(async () => {${block.value.substring(1, block.value.length - 1)}});`) %} +JS_BLOCK -> %JS_BLOCK {% ([block]) => (`{${block.value.substring(2, block.value.length - 2)}}`) %} + | %JS_BLOCK2 {% ([block]) => (`{${block.value.substring(1, block.value.length - 1)}}`) %} +JS_BLOCK_ASYNC -> %JS_BLOCK {% ([block]) => (`{${block.value.substring(2, block.value.length - 2)}}`) %} + | %JS_BLOCK2 {% ([block]) => (`{${block.value.substring(1, block.value.length - 1)}}`) %} SPREAD_OPERATOR -> %SPREAD_OPERATOR _ -> null | %SPACE {% () => undefined %} __ -> %SPACE {% () => undefined %} \ No newline at end of file diff --git a/lib/console.v b/lib/vogue/console.v similarity index 100% rename from lib/console.v rename to lib/vogue/console.v diff --git a/package.json b/package.json index f07eb7a..1274a54 100644 --- a/package.json +++ b/package.json @@ -5,14 +5,16 @@ "license": "MIT", "type": "module", "bin": { - "vogue": "run.js" + "vogue": "out/run.js" }, "scripts": { - "c": "nearleyc", - "test": "node run.js test", + "test": "node --enable-source-maps --unhandled-rejections=strict out/run.js test", "debug": "cross-env DEBUG=vogue:* yarn test", - "postinstall": "cd test && yarn", - "tsc": "tsc" + "debug:watch": "cross-env DEBUG=vogue:* supervisor -w out -n exit --exec yarn -- test", + "postinstall": "yarn compile && cd test && yarn", + "postcompile:watch": "echo DONE", + "compile": "tsc", + "compile:watch": "tsc --watch" }, "dependencies": { "@types/debug": "^4.1.5", @@ -26,6 +28,7 @@ "moo": "^0.5.1", "nearley": "^2.20.1", "nedb": "^1.8.0", + "supervisor": "^0.12.0", "typescript": "^4.2.4", "uglify-js": "^3.13.5", "yarn": "^1.22.10" diff --git a/src/Instance.js b/src/Instance.ts similarity index 54% rename from src/Instance.js rename to src/Instance.ts index 21a3d23..38402a6 100644 --- a/src/Instance.js +++ b/src/Instance.ts @@ -5,6 +5,9 @@ import debug from 'debug'; import _ from 'lodash'; const log = debug('vogue:instance'); import vm from 'vm'; +import Module, { Link } from './Module.js'; +import System from './System.js'; +import { KV } from './KV.js'; /** * @typedef {import('./System.js').default} System * @typedef {import('./Module.js').default} Module @@ -12,33 +15,45 @@ import vm from 'vm'; export default class Instance extends Serializable { - /** @type {Module} */ - module = null; + module: Module; links = {} - system = null; - context = null; + system: System; + context: vm.Context; locals = []; internalFunctions = {}; - /** @type {Proxy} */ - _link = null; + _link: Instance; + location: string; - createContext() { - const initialContext = {}; + createContext(): vm.Context { + if(this.context) return this.context; + + const initialContext: KV = {}; // system globals! // TODO turn this into its own vogue module! system.create/instance.create // TODO request context from system... - initialContext.create = this.system.create.bind(this.system); - for(const name of this.system.staticInstances) + initialContext.create = this.system.createInstance.bind(this.system); + for(const name in this.system.staticInstances) initialContext[name] = this.system.staticInstances[name]; // local links! // optional arrays // TODO maybe make these property accessors to allow for some automation - for(const name of this.module.links.optional.arrays) - initialContext[name] = []; - for(const name of this.module.links.optional.single) - initialContext[name] = null; + for(const link of this.module.links.filter((v: Link) => v.array && !v.required)) + initialContext[link.name] = []; + for(const link of this.module.links.filter((v: Link) => !v.array && !v.required)) + initialContext[link.name] = null; + + const context = vm.createContext(initialContext); + + for(const name in this.module.functions) { + const { code, parameters, async } = this.module.functions[name]; + const injectedScript = +` +var ${name} = ${async ? 'async' : ''} function ${name}(${parameters.join(', ')}) ${code} +`; + vm.runInContext(injectedScript, context); + } // local functions time! // for(const name of this.module.functions) @@ -65,26 +80,18 @@ export default class Instance extends Serializable { // } // // ctx.create = // this.locals.push('create'); - this.context = ctx; + return context; }; - /** - * - * @param {Module} module - * @param {string} location - * @param {Object} parameters - * @param {System} system - */ - constructor(module, location, parameters, system) { + constructor(module: Module, location: string, parameters: {[name: string]: any}, system: System) { super(); this.module = module; this.location = location; this.system = system; - - this.createContext(); + this.context = this.createContext(); this._link = new Proxy(this, { - get(target, prop, receiver) { + get(target: Instance, prop, receiver) { if(prop === 'restore') return undefined; if(prop in target.module.functions) { // TODO return the fn @@ -95,12 +102,16 @@ export default class Instance extends Serializable { }); } - hasPublicFunction(name) { + hasPublicFunction(name: string) { return (name in this.module.functions); } - invokeInternal(name, ...args) { + invokeInternal(name: string, ...args: any[]): any { log('invoking', this.module.name.full + '.' + name, 'with args', args); + + if(typeof this.context[name] === 'function') { + this.context[name](...args); + } else throw new Error(`${name} is not a function in ${this.module.name.full}`) } get link () { diff --git a/src/KV.ts b/src/KV.ts new file mode 100644 index 0000000..795fc4d --- /dev/null +++ b/src/KV.ts @@ -0,0 +1,3 @@ +export type KV = { + [key: string]: any +}; \ No newline at end of file diff --git a/src/Module.js b/src/Module.js deleted file mode 100644 index 924a0c1..0000000 --- a/src/Module.js +++ /dev/null @@ -1,183 +0,0 @@ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -import { createAst } from './createAst'; -import path from 'path'; -import debug from 'debug'; -import { createRequire } from 'module'; -var log = debug('vogue:module'); -var Module = /** @class */ (function () { - function Module() { - this.links = { - required: { - single: [], - arrays: [] - }, - optional: { - single: [], - arrays: [] - } - }; - this.globals = []; - this.functions = []; - this.identifiers = {}; - this.name = { - space: '', - last: '', - full: '' - }; - this.imports = {}; - this.variables = { - cold: [], - warm: [] - }; - this.directives = { - 'singleton': false, - 'keepalive': false, - 'static': '' - }; - } - Module.prototype.directive = function (_a) { - var directive = _a.directive, value = _a.value; - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_b) { - this.directives[directive] = value; - return [2 /*return*/]; - }); - }); - }; - Module.prototype.link = function (_a) { - var required = _a.required, array = _a.array, name = _a.name; - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_b) { - this.links[required ? 'required' : 'optional'][array ? 'arrays' : 'single'] - .push(name); - return [2 /*return*/]; - }); - }); - }; - Module.prototype.namespace = function (_a) { - var namespace = _a.namespace; - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_b) { - this.name.space = namespace; - this.name.full = this.name.space + '.' + this.name.last; - return [2 /*return*/]; - }); - }); - }; - Module.prototype["function"] = function (_a) { - var name = _a.name, block = _a.block, parameters = _a.parameters; - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_b) { - this.functions[name] = { - code: block, - parameters: parameters - }; - return [2 /*return*/]; - }); - }); - }; - Module.prototype["import"] = function (_a) { - var importName = _a.importName, name = _a.name; - return __awaiter(this, void 0, void 0, function () { - var nodePath, __require__, imported; - return __generator(this, function (_b) { - nodePath = path.resolve(this.rootDir, 'node_module'); - log('#'.repeat(80)); - log(nodePath); - __require__ = createRequire(nodePath); - imported = __require__(importName); - if ('default' in imported) - this.imports[name] = imported["default"]; - else - this.imports[name] = imported; - return [2 /*return*/]; - }); - }); - }; - Module.prototype.variable = function (_a) { - var persist = _a.persist, name = _a.name; - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_b) { - this.variables[persist ? 'cold' : 'warm'].push(name); - return [2 /*return*/]; - }); - }); - }; - Module.create = function (location, rootDir) { - return __awaiter(this, void 0, void 0, function () { - var module, ast, name, _i, ast_1, item; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - module = new Module(); - ast = createAst(location); - name = path.parse(location).name; - module.name.last = name; - module.name.full = name; - module.rootDir = rootDir; - _i = 0, ast_1 = ast; - _a.label = 1; - case 1: - if (!(_i < ast_1.length)) return [3 /*break*/, 4]; - item = ast_1[_i]; - if ('name' in item) { - if (item.name in module.identifiers) - throw new Error('Identifier ' + item.name + ' already declared!'); - else - module.identifiers[item.name] = item.type; - } - if (!(item.type in module)) return [3 /*break*/, 3]; - return [4 /*yield*/, module[item.type](item)]; - case 2: - _a.sent(); - _a.label = 3; - case 3: - _i++; - return [3 /*break*/, 1]; - case 4: - log('='.repeat(80)); - log(location); - log(module); - return [2 /*return*/, module]; - } - }); - }); - }; - return Module; -}()); -export default Module; diff --git a/src/Module.ts b/src/Module.ts index ecb6752..634963e 100644 --- a/src/Module.ts +++ b/src/Module.ts @@ -1,11 +1,20 @@ -import { createAst, DirectiveRule, DirectiveValue, FunctionRule, ImportRule, LinkRule, NamespaceRule, VariableRule } from './createAst' +import { + createAst, + DirectiveRule, + FunctionRule, + ImportRule, + LinkRule, + NamespaceRule, + Rule, + VariableRule +} from './createAst.js' import path from 'path'; import debug from 'debug'; import { createRequire } from 'module'; import { pathToFileURL } from 'url'; const log = debug('vogue:module'); -type Link = { +export type Link = { name: string, array: boolean, required: boolean @@ -17,35 +26,41 @@ export default class Module { functions: { [name: string]: { code: string, + async: boolean, parameters: string[] } } = {}; - identifiers = {}; + identifiers: { + [name: string]: Rule["type"] + } = {}; name = { space: '', last: '', full: '' }; - imports = {}; - variables = { + imports: { + [key: string]: any + } = {}; + variables: any = { cold: [], warm: [] }; - directives: { - [key: string]: DirectiveValue - } = { - 'singleton': false, - 'keepalive': false, - 'static': '' - }; + // directives + 'singleton': boolean = false; + 'keepalive': boolean = false; + 'static': string = ''; + // other stuff rootDir: string = ''; - - async directive({directive, value}: DirectiveRule) { - this.directives[directive] = value; + async directive({ directive, value }: DirectiveRule): Promise { + if (typeof this[directive] === 'boolean') + (this[directive] as boolean) = value as boolean; + else if (typeof this[directive] === 'string') + (this[directive] as string) = value as string; + // = value as string; } - async link({required, array, name}: LinkRule) { + async link({ required, array, name }: LinkRule): Promise { this.links.push({ name, required, @@ -53,29 +68,30 @@ export default class Module { }); } - async namespace({namespace}: NamespaceRule) { + async namespace({ namespace }: NamespaceRule): Promise { this.name.space = namespace; this.name.full = this.name.space + '.' + this.name.last; } - async function({name, block, parameters}: FunctionRule) { + async function({ name, block, parameters, async }: FunctionRule): Promise { this.functions[name] = { code: block, - parameters + parameters, + async }; } - async import({importName, name}: ImportRule) { + async import({ importName, name }: ImportRule): Promise { const nodePath = path.resolve(this.rootDir, 'node_module'); log('#'.repeat(80)); log(nodePath); const __require__ = createRequire(nodePath); const imported = __require__(importName); - if('default' in imported) this.imports[name] = imported.default; + if ('default' in imported) this.imports[name] = imported.default; else this.imports[name] = imported; } - async variable({persist, name}: VariableRule) { + async variable({ persist, name }: VariableRule): Promise { this.variables[persist ? 'cold' : 'warm'].push(name); } @@ -90,13 +106,16 @@ export default class Module { for (const item of ast) { if ('name' in item) { - if(item.name in module.identifiers) + if (item.name in module.identifiers) throw new Error('Identifier ' + item.name + ' already declared!'); - else module.identifiers[item.name] = item.type; + else { + module.identifiers[item.name] = item.type; + } } - if(item.type in module) { - await module[item.type](item); + if (item.type in module) { + const func = module[item.type] as ((arg0: Rule) => Promise) + func.call(module, item); } } diff --git a/src/Serializable.js b/src/Serializable.ts similarity index 70% rename from src/Serializable.js rename to src/Serializable.ts index f58882e..c410650 100644 --- a/src/Serializable.js +++ b/src/Serializable.ts @@ -1,7 +1,11 @@ // import { Ubjson } from '@shelacek/ubjson'; import { existsSync, readFileSync, writeFileSync } from 'fs'; +import { KV } from './KV'; export default class Serializable { + + constructor(...args: any[]) {} + // things that need to be stored only in cold // storage are keyed with a special prefix static CLASS_REFERENCE = '$$CLASS_NAME'; @@ -13,25 +17,29 @@ export default class Serializable { start() {} - toUbj() { - return Ubjson.encode(this.toSerializableObject()); - } + // toUbj() { + // return Ubjson.encode(this.toSerializableObject()); + // } - static fromUbj(buffer) { - return this.fromSerializableObject(Ubjson.decode(buffer)); - } + // static fromUbj(buffer) { + // return this.fromSerializableObject(Ubjson.decode(buffer)); + // } toJson() { return JSON.stringify(this.toSerializableObject(), null, 2); } - static fromJson(str) { + static serializationDependencies(): any[] { + return []; + } + + static fromJson(str: string) { return this.fromSerializableObject(JSON.parse(str)); } toSerializableObject() { - const transformValue = (val) => { + const transformValue = (val: any): any => { if(Array.isArray(val)) { return transformArray(val); } else if (val === null || val === undefined) { @@ -43,8 +51,8 @@ export default class Serializable { } } - const transformObject = (obj) => { - const clone = {}; + const transformObject = (obj: KV): KV => { + const clone: KV = {}; for(const prop of Object.keys(obj)) { if(prop.startsWith('_')) continue; @@ -56,7 +64,7 @@ export default class Serializable { return clone; } - const transformArray = (arr) => { + const transformArray = (arr: any[]): any[] => { const clone = []; for(const item of arr) { clone.push(transformValue(item)); @@ -67,10 +75,10 @@ export default class Serializable { return transformObject(this); } - static fromSerializableObject(obj) { + static fromSerializableObject(obj: KV) { if(obj[Serializable.CLASS_REFERENCE] !== this.name) return null; - const transformValue = (val) => { + const transformValue = (val: any): any => { if(Array.isArray(val)) { return transformArray(val); } else if(val === null || val === undefined) { @@ -78,7 +86,9 @@ export default class Serializable { } else if(typeof val === 'object') { if(Serializable.CLASS_REFERENCE in val) { const classes = this.serializationDependencies(); - const matchingClasses = classes.filter(classObject => classObject.name === val[Serializable.CLASS_REFERENCE]); + const matchingClasses = classes.filter((classObject) => { + classObject.name === val[Serializable.CLASS_REFERENCE] + }); if(matchingClasses.length === 1) { return matchingClasses[0].fromSerializableObject(val); } else { @@ -91,8 +101,8 @@ export default class Serializable { } } - const transformObject = (obj) => { - const clone = {}; + const transformObject = (obj: KV): KV => { + const clone: KV = {}; for(const prop of Object.keys(obj)) { if(prop.startsWith('_')) continue; @@ -101,7 +111,7 @@ export default class Serializable { return clone; } - const transformArray = (arr) => { + const transformArray = (arr: any[]): any[] => { const clone = []; for(const item of arr) { clone.push(transformValue(item)); @@ -125,7 +135,7 @@ export default class Serializable { switch(encoding) { case 'json': return this.toJson(); case 'ubjson': - case 'ubj': return this.toUbj(); + // case 'ubj': return this.toUbj(); default: { throw new TypeError('Unknown encoding: ' + encoding); } @@ -133,14 +143,14 @@ export default class Serializable { } - static deserialize(obj, { + static deserialize(obj: any, { encoding = 'json' } = {}) { switch(encoding) { case 'json': return this.fromJson(obj); case 'ubjson': - case 'ubj': return this.fromUbj(obj); + // case 'ubj': return this.fromUbj(obj); default: { throw new TypeError('Unknown encoding: ' + encoding); } @@ -149,32 +159,40 @@ export default class Serializable { async restore() {} - static createFromDisk(filename, ...args) { + static createFromDisk(filename: string, ...args: any[]) { if(existsSync(filename)) { const instance = this.deserialize(readFileSync(createFilepath(filename))); + // TS is plain and simply wrong... symbols can be used to index object... + // @ts-ignore instance[Serializable.PERSIST_LOCATION] = createFilepath(filename); - instance.restore(); + instance?.restore(); return instance; } else { const instance = new this(...args); + // again... TS is wrong... + // @ts-ignore instance[Serializable.PERSIST_LOCATION] = createFilepath(filename); - instance.updateDisk(); + instance?.updateDisk(); return instance; } } - updateDisk(filepath) { + updateDisk(filepath?: string) { // if it hasnt yet been written to disk... // this can happen if the contrustor // was called outside of createFromDisk if(filepath) { + // see above... TS7053 is just _wrong_. incorrect. thats not how JS works. + // @ts-ignore this[Serializable.PERSIST_LOCATION] = createFilepath(filepath); } const data = this.serialize(); + // this is getting annoying... + // @ts-ignore writeFileSync(this[Serializable.PERSIST_LOCATION], data); } } -function createFilepath(path) { +function createFilepath(path: string) { return `data/${path}`; } \ No newline at end of file diff --git a/src/System.js b/src/System.js deleted file mode 100644 index 1e2d293..0000000 --- a/src/System.js +++ /dev/null @@ -1,99 +0,0 @@ -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -import Instance from './Instance'; -import Serializable from './Serializable'; -import _ from 'lodash'; -import Module from './Module'; -import debug from 'debug'; -var log = debug('vogue:system'); -var get = _.get, set = _.set; -var System = /** @class */ (function (_super) { - __extends(System, _super); - function System(modules, rootDir) { - var _this = _super.call(this) || this; - _this.instances = []; - _this.namespace = {}; - _this.staticInstances = {}; - _this.modules = modules; - _this.createNamespace(); - var bootModules = _this.deriveBootModules(); - _this.createStaticInstances(); - _this.rootDir = rootDir; - log('instantiating boot modules...'); - for (var _i = 0, bootModules_1 = bootModules; _i < bootModules_1.length; _i++) { - var name_1 = bootModules_1[_i]; - log(' ' + name_1); - _this.newInstance(name_1); - } - return _this; - } - System.prototype.createStaticInstances = function () { - log('deriving static modules...'); - var staticModules = this.modules.filter(function (module) { - return !!module.static; - }).map(function (module) { - log(' ' + module.name.full); - return module; - }); - log('instantiating static modules...'); - for (var _i = 0, staticModules_1 = staticModules; _i < staticModules_1.length; _i++) { - var module_1 = staticModules_1[_i]; - log(' ' + module_1.static + ': ' + module_1.name.full); - this.staticInstances[module_1.static] = - this.newInstance(module_1.name.full, {}); - } - }; - System.prototype.deriveBootModules = function () { - log('deriving boot modules...'); - var bootModules = this.modules.filter(function (module) { - return module.singleton; - }).map(function (module) { - return module.name.full; - }); - for (var _i = 0, bootModules_2 = bootModules; _i < bootModules_2.length; _i++) { - var name_2 = bootModules_2[_i]; - log(' ' + name_2); - } - return bootModules; - }; - System.prototype.createNamespace = function () { - log('creating namespace map...'); - this.namespace = this.modules.reduce(function (acc, val) { - if (get(acc, val.name.full) instanceof Module) - throw new Error('Duplicate module "' + val.name.full + '"'); - set(acc, val.name.full, val); - log(' ' + val.name.full); - return acc; - }, {}); - }; - System.prototype.getModule = function (name) { - return get(this.namespace, name); - }; - System.prototype.createInstance = function (name, args) { - if (args === void 0) { args = {}; } - return new Instance(this.getModule(name), null, args, this); - }; - System.prototype.newInstance = function (name, args) { - if (args === void 0) { args = {}; } - var instance = this.createInstance(name, args); - var link = instance.link; - if (instance.hasPublicFunction('restore')) - instance.invokeInternal('restore'); - return link; - }; - return System; -}(Serializable)); -export default System; diff --git a/src/System.ts b/src/System.ts index 131c190..bf1d4f2 100644 --- a/src/System.ts +++ b/src/System.ts @@ -1,7 +1,7 @@ -import Instance from './Instance'; -import Serializable from './Serializable'; +import Instance from './Instance.js'; +import Serializable from './Serializable.js'; import _ from 'lodash'; -import Module from './Module'; +import Module from './Module.js'; import debug from 'debug'; const log = debug('vogue:system') @@ -79,12 +79,14 @@ class System extends Serializable { }, {}); } - getModule(name: ModuleName) { - return get(this.namespace, name); + getModule(name: ModuleName): Module { + const module = get(this.namespace, name); + if(module instanceof Module) return module; + else throw Error(`${name} is not a module`); } createInstance(name: ModuleName, args = {}) { - return new Instance(this.getModule(name), null, args, this); + return new Instance(this.getModule(name), '', args, this); } newInstance(name: ModuleName, args = {}) { diff --git a/src/createAst.js b/src/createAst.js deleted file mode 100644 index b1f6965..0000000 --- a/src/createAst.js +++ /dev/null @@ -1,75 +0,0 @@ -import nearley from 'nearley'; -// TODO none of these shits have typings, but its OKAY -// @ts-ignore -import compile from 'nearley/lib/compile.js'; -// @ts-ignore -import generate from 'nearley/lib/generate.js'; -// @ts-ignore -import nearleyGrammar from 'nearley/lib/nearley-language-bootstrapped.js'; -// @ts-ignore -import moo from 'moo'; -import tokens from './tokens'; -import { readFileSync } from 'fs'; -import debug from 'debug'; -import { resolve, dirname } from 'path'; -import { fileURLToPath } from 'url'; -var log = debug('vogue:ast'); -var grammarFile = resolve(fileURLToPath(dirname(import.meta.url)), 'grammar.ne'); -log('grammarFile:', grammarFile); -function createParser() { - // Parse the grammar source into an AST - var grammarParser = new nearley.Parser(nearleyGrammar); - grammarParser.feed(readFileSync(grammarFile).toString()); - var grammarAst = grammarParser.results[0]; // TODO check for errors - // Compile the AST into a set of rules - var grammarInfoObject = compile(grammarAst, {}); - // Generate JavaScript code from the rules - var grammarJs = generate(grammarInfoObject, "grammar"); - var lexer = moo.compile(tokens); - // lexer.__proto__.formatError = function(token, message) { - // if (token == null) { - // // An undefined token indicates EOF - // var text = this.buffer.slice(this.index) - // var token = { - // text: text, - // offset: this.index, - // lineBreaks: text.indexOf('\n') === -1 ? 0 : 1, - // line: this.line, - // col: this.col, - // } - // } - // var start = Math.max(0, token.offset - token.col + 1) - // var eol = token.lineBreaks ? token.text.indexOf('\n') : token.text.length - // var firstLine = this.buffer.substring(start, token.offset + eol) - // message += " at line " + token.line + " col " + token.col + ":\n\n" - // message += " " + firstLine + "\n" - // message += " " + Array(token.col).join(" ") + "^" - // return message - // } - // Pretend this is a CommonJS environment to catch exports from the grammar. - var module = { exports: {} }; - eval(grammarJs); - var grammar = module.exports; - // THESE IS COMPLICATED SHITS, IDK MAN WHAT ARE TYPINGS - // @ts-ignore - return new nearley.Parser(nearley.Grammar.fromCompiled(grammar)); -} -export function createAst(location) { - var parser = createParser(); - var contents = readFileSync(location).toString(); - // parser.reportError = function(token) { - // return JSON.stringify(token, null, 2); - // var message = this.lexer.formatError(token, 'invalid syntax') + '\n'; - // message += 'Unexpected ' + (token.type ? token.type + ' token: ' : ''); - // message += - // JSON.stringify(token.value !== undefined ? token.value : token) + '\n'; - // return message; - // }; - parser.feed(contents); - parser.finish(); - var ast = parser.results[0]; - log('='.repeat(80)); - log(location); - log(ast); - return ast || []; -} diff --git a/src/createAst.ts b/src/createAst.ts index 14b20eb..e527371 100644 --- a/src/createAst.ts +++ b/src/createAst.ts @@ -9,15 +9,15 @@ import nearleyGrammar from 'nearley/lib/nearley-language-bootstrapped.js'; // @ts-ignore import moo from 'moo'; -import tokens from './tokens'; +import tokens from './tokens.js'; import { readFileSync } from 'fs'; import debug from 'debug'; import { resolve, dirname } from 'path'; import { fileURLToPath } from 'url'; -import minify from './minify'; +import minify from './minify.js'; const log = debug('vogue:ast'); -const grammarFile = resolve(fileURLToPath(dirname(import.meta.url)), 'grammar.ne'); +const grammarFile = resolve(fileURLToPath(dirname(import.meta.url)), '..', 'lib', 'grammar.ne'); log('grammarFile:', grammarFile); function createParser() { @@ -69,7 +69,8 @@ export type FunctionRule = { type: 'function', name: string block: string, - parameters: string[] + parameters: string[], + async: boolean }; export type VariableRule = { @@ -79,7 +80,7 @@ export type VariableRule = { }; export type NamespaceRule = { - type: 'namesapce', + type: 'namespace', namespace: string }; diff --git a/src/extensions.js b/src/extensions.ts similarity index 100% rename from src/extensions.js rename to src/extensions.ts diff --git a/src/minify.js b/src/minify.js deleted file mode 100644 index bbaa4ce..0000000 --- a/src/minify.js +++ /dev/null @@ -1,14 +0,0 @@ -import uglify from 'uglify-js'; -export default (function (code) { - return uglify.minify(code, { - compress: { - dead_code: true, - global_defs: { - DEBUG: false - } - }, - sourceMap: { - content: 'inline' - } - }).code; -}); diff --git a/src/run.js b/src/run.js deleted file mode 100644 index 38460fc..0000000 --- a/src/run.js +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env node -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __spreadArray = (this && this.__spreadArray) || function (to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; -}; -import debug from 'debug'; -var log = debug('vogue:cli'); -var systemLocation = resolve(process.argv[2]); -import { parse, resolve, dirname } from 'path'; -import { readdirSync, lstatSync } from 'fs'; -import _ from 'lodash'; -import Module from './Module'; -import System from './System'; -import './extensions.js'; -import { fileURLToPath } from 'url'; -var get = _.get, set = _.set; -var standardLibrary = resolve(fileURLToPath(dirname(import.meta.url)), 'lib'); -(function () { return __awaiter(void 0, void 0, void 0, function () { - var ignoreDeps, files, fullpaths, modules, sys; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - ignoreDeps = function (path) { return parse(path).name !== 'node_modules'; }; - files = __spreadArray(__spreadArray([], walkdirSync(systemLocation, ignoreDeps)), walkdirSync(standardLibrary, ignoreDeps)); - fullpaths = files - .filter(function (v) { return lstatSync(v).isFile(); }) - .filter(function (v) { return parse(v).ext === '.v'; }); - log('included modules'); - log(files); - log('parsing modules...'); - return [4 /*yield*/, Promise.all(fullpaths.map(function (loc) { return Module.create(loc, systemLocation); }))]; - case 1: - modules = _a.sent(); - sys = new System(modules, systemLocation); - return [2 /*return*/]; - } - }); -}); })(); -function walkdirSync(root, filter) { - if (filter === void 0) { filter = function () { return true; }; } - log('reading', root, '...'); - var paths = readdirSync(root).map(function (v) { return resolve(root, v); }); - var _a = sift(paths.filter(filter), function (v) { return lstatSync(v).isFile(); }), files = _a[0], dirs = _a[1]; - log("files: " + files.length + " | dirs: " + dirs.length); - var rfiles = dirs.map(function (v) { return walkdirSync(v, filter); }).reduce(function (a, v) { return __spreadArray(__spreadArray([], a), v); }, []); - return __spreadArray(__spreadArray([], files), rfiles); -} -function sift(a, fn) { - var left = [], right = []; - for (var i = 0; i < a.length; i++) { - var v = a[i]; - var lr = !!fn(v, i, a); - if (lr) - left = __spreadArray(__spreadArray([], left), [v]); - else - right = __spreadArray(__spreadArray([], right), [v]); - } - return [left, right]; -} diff --git a/src/run.ts b/src/run.ts index b22aef7..ed37cc7 100644 --- a/src/run.ts +++ b/src/run.ts @@ -7,15 +7,15 @@ import { parse, resolve, dirname } from 'path'; import { readdirSync, lstatSync } from 'fs'; import _ from 'lodash'; -import Module from './Module'; -import System from './System'; +import Module from './Module.js'; +import System from './System.js'; import './extensions.js'; import { fileURLToPath } from 'url'; // globals inside grammar context import minify from './minify'; const { get, set } = _; -const standardLibrary = resolve(fileURLToPath(dirname(import.meta.url)), 'lib'); +const standardLibrary = resolve(fileURLToPath(dirname(import.meta.url)), '..', 'lib', 'vogue'); (async () => { // TODO simplify this line gaddam diff --git a/src/tokens.js b/src/tokens.js deleted file mode 100644 index 2f86c26..0000000 --- a/src/tokens.js +++ /dev/null @@ -1,27 +0,0 @@ -export default { - LINK: 'link', - NAMESPACE: 'namespace', - REQUIRED: 'required', - SINGLETON: 'singleton', - KEEPALIVE: 'keepalive', - STATIC: 'static', - MEMBER: 'member', - RUNTIME: 'runtime', - IMPORT: 'import', - ASYNC: 'async', - AS: 'as', - FROM: 'from', - COMMA: ',', - STRING: /'(?:\\['\\]|[^\n'\\])*'/, - LSQBRACKET: '[', - RSQBRACKET: ']', - LPAREN: '(', - RPAREN: ')', - SPREAD_OPERATOR: '...', - DOTOP: '.', - JS_BLOCK: /\[\[[^]*?\n\]\]$/, - JS_BLOCK2: /{[^]*?\n}$/, - IDENTIFIER: /[a-zA-Z][a-zA-Z0-9]*/, - SPACE: { match: /\s+/, lineBreaks: true }, - SEMICOLON: ';' -}; diff --git a/tsconfig.json b/tsconfig.json index 32485d6..8dd7b2a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,11 @@ "module": "esnext", "moduleResolution": "node", "strict": true, - "allowSyntheticDefaultImports": true + "allowSyntheticDefaultImports": true, + "target": "esnext", + "outDir": "out", + "sourceMap": true, + "declaration": true }, "include": [ "src/**/*.ts" diff --git a/vogue-0.0.1.tgz b/vogue-0.0.1.tgz new file mode 100644 index 0000000000000000000000000000000000000000..7b94f1e2e2771997cf2f16b5084a4d7e24f60eef GIT binary patch literal 30409 zcmV(#K;*w4iwFP!00002|Lna9Je1$}I4;VTT}3F5bw-V`tE}1gElWz4!C*3G#w;Ys zl0sS2BB`VjDN(7EN|8c~_C!P~N=d6q{GaEU#SEkO=ks0O|KIofeb1}++wgS&bGR7p%p|0VR)7E0@yYSOS&|N+_4&%&b3_ zXB4m_W1^xkWG+}3&zg7)A)E$kg=R33NTpE87!nB^`bX4JL?Qzp_ymD5(y7EqEP=wv zLTk}q8JHL#@c^iHp|)V-J>v)=Kmr3ej2$Kv8%zslWWdjp%2SB=7%U11#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?~k3KK_<_=;Ye zf~3A&W%d0TOPZ>LGao@Lw0#6t8w5ZSY&nP}vFNWe_t*35`StvI{x3ZL0i&rdssIoH E08u|%{r~^~ literal 0 HcmV?d00001 diff --git a/yarn.lock b/yarn.lock index 709555e..a55de19 100644 --- a/yarn.lock +++ b/yarn.lock @@ -156,6 +156,10 @@ source-map@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" +supervisor@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/supervisor/-/supervisor-0.12.0.tgz#de7e6337015b291851c10f3538c4a7f04917ecc1" + typescript@^4.2.4: version "4.2.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961" From 624ac70b8c196a218a289a25ae77bd8eb7b99d2f Mon Sep 17 00:00:00 2001 From: Valerie Date: Fri, 21 May 2021 01:04:38 -0400 Subject: [PATCH 3/6] all globals in a vm, typescript done? added travis. --- .travis.yml | 7 + examples/valyria/main.v | 6 + examples/valyria/package.json | 12 + examples/valyria/yarn.lock | 554 +++++++++++++++++++++++++++++ lib/vogue/console.v | 8 + lib/vogue/window.v | 33 ++ package.json | 3 +- src/Instance.ts | 60 +--- src/Module.ts | 20 +- src/System.ts | 3 +- test/counter.v | 9 + test/main.v | 16 +- yarn.lock | 638 +++++++++++++++++++++++++++------- 13 files changed, 1181 insertions(+), 188 deletions(-) create mode 100644 .travis.yml create mode 100644 examples/valyria/main.v create mode 100644 examples/valyria/package.json create mode 100644 examples/valyria/yarn.lock create mode 100644 lib/vogue/window.v create mode 100644 test/counter.v diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..ba8e41f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +node_js: + - "16.2.0" +os: + - windows + - linux + - osx \ No newline at end of file diff --git a/examples/valyria/main.v b/examples/valyria/main.v new file mode 100644 index 0000000..c2e4461 --- /dev/null +++ b/examples/valyria/main.v @@ -0,0 +1,6 @@ +singleton; +link window + +restore { + window ??= create('SDL.window'); +} \ No newline at end of file diff --git a/examples/valyria/package.json b/examples/valyria/package.json new file mode 100644 index 0000000..0a233a9 --- /dev/null +++ b/examples/valyria/package.json @@ -0,0 +1,12 @@ +{ + "name": "valyria", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "dependencies": { + "@kmamal/sdl": "^0.0.13", + "chalk": "^4.1.1", + "sisteransi": "^1.0.5", + "terminal-kit": "^2.1.2" + } +} diff --git a/examples/valyria/yarn.lock b/examples/valyria/yarn.lock new file mode 100644 index 0000000..e5e646d --- /dev/null +++ b/examples/valyria/yarn.lock @@ -0,0 +1,554 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@cronvel/get-pixels@^3.4.0": + version "3.4.0" + resolved "https://registry.yarnpkg.com/@cronvel/get-pixels/-/get-pixels-3.4.0.tgz#697cd691c16bbb8b29ed596da73fd6a7e9a2f34d" + dependencies: + jpeg-js "^0.4.1" + ndarray "^1.0.19" + ndarray-pack "^1.1.1" + node-bitmap "0.0.1" + omggif "^1.0.10" + pngjs "^5.0.0" + +"@kmamal/sdl@^0.0.13": + version "0.0.13" + resolved "https://registry.yarnpkg.com/@kmamal/sdl/-/sdl-0.0.13.tgz#20524ee00bc6fc427a2cc3c2d79ada1c34c7c338" + dependencies: + bindings "*" + prebuild-install "^6.0.1" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + +ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + dependencies: + color-convert "^2.0.1" + +aproba@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + +bindings@*: + version "1.5.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + dependencies: + file-uri-to-path "1.0.0" + +bl@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" + dependencies: + buffer "^5.5.0" + inherits "^2.0.4" + readable-stream "^3.4.0" + +buffer@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + +chalk@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad" + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chownr@^1.1.1: + version "1.1.4" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" + +chroma-js@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/chroma-js/-/chroma-js-2.1.2.tgz#1075cb9ae25bcb2017c109394168b5cf3aa500ec" + dependencies: + cross-env "^6.0.3" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +cross-env@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-6.0.3.tgz#4256b71e49b3a40637a0ce70768a6ef5c72ae941" + dependencies: + cross-spawn "^7.0.0" + +cross-spawn@^7.0.0: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +cwise-compiler@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/cwise-compiler/-/cwise-compiler-1.1.3.tgz#f4d667410e850d3a313a7d2db7b1e505bb034cc5" + dependencies: + uniq "^1.0.0" + +decompress-response@^4.2.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-4.2.1.tgz#414023cc7a302da25ce2ec82d0d5238ccafd8986" + dependencies: + mimic-response "^2.0.0" + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + +detect-libc@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + +end-of-stream@^1.1.0, end-of-stream@^1.4.1: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + dependencies: + once "^1.4.0" + +expand-template@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c" + +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + +fs-constants@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +github-from-package@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + +ieee754@^1.1.13: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + +inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + +ini@~1.3.0: + version "1.3.8" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" + +iota-array@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/iota-array/-/iota-array-1.0.0.tgz#81ef57fe5d05814cd58c2483632a99c30a0e8087" + +is-buffer@^1.0.2: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +jpeg-js@^0.4.1: + version "0.4.3" + resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.4.3.tgz#6158e09f1983ad773813704be80680550eff977b" + +lazyness@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/lazyness/-/lazyness-1.2.0.tgz#5dc0f02c37280436b21f0e4918ce6e72a109c657" + +mimic-response@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-2.1.0.tgz#d13763d35f613d09ec37ebb30bac0469c0ee8f43" + +minimist@^1.2.0, minimist@^1.2.3: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + +mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" + +napi-build-utils@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806" + +ndarray-pack@^1.1.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ndarray-pack/-/ndarray-pack-1.2.1.tgz#8caebeaaa24d5ecf70ff86020637977da8ee585a" + dependencies: + cwise-compiler "^1.1.2" + ndarray "^1.0.13" + +ndarray@^1.0.13, ndarray@^1.0.19: + version "1.0.19" + resolved "https://registry.yarnpkg.com/ndarray/-/ndarray-1.0.19.tgz#6785b5f5dfa58b83e31ae5b2a058cfd1ab3f694e" + dependencies: + iota-array "^1.0.0" + is-buffer "^1.0.2" + +nextgen-events@^1.3.4: + version "1.4.0" + resolved "https://registry.yarnpkg.com/nextgen-events/-/nextgen-events-1.4.0.tgz#82e7201e4d8421f1cb4dcfce973c10b455fdc2be" + +node-abi@^2.21.0: + version "2.26.0" + resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-2.26.0.tgz#355d5d4bc603e856f74197adbf3f5117a396ba40" + dependencies: + semver "^5.4.1" + +node-bitmap@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/node-bitmap/-/node-bitmap-0.0.1.tgz#180eac7003e0c707618ef31368f62f84b2a69091" + +noop-logger@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/noop-logger/-/noop-logger-0.1.1.tgz#94a2b1633c4f1317553007d8966fd0e841b6a4c2" + +npmlog@^4.0.1: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +omggif@^1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/omggif/-/omggif-1.0.10.tgz#ddaaf90d4a42f532e9e7cb3a95ecdd47f17c7b19" + +once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + +pngjs@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-5.0.0.tgz#e79dd2b215767fd9c04561c01236df960bce7fbb" + +prebuild-install@^6.0.1: + version "6.1.2" + resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-6.1.2.tgz#6ce5fc5978feba5d3cbffedca0682b136a0b5bff" + dependencies: + detect-libc "^1.0.3" + expand-template "^2.0.3" + github-from-package "0.0.0" + minimist "^1.2.3" + mkdirp-classic "^0.5.3" + napi-build-utils "^1.0.1" + node-abi "^2.21.0" + noop-logger "^0.1.1" + npmlog "^4.0.1" + pump "^3.0.0" + rc "^1.2.7" + simple-get "^3.0.3" + tar-fs "^2.0.0" + tunnel-agent "^0.6.0" + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +rc@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +readable-stream@^2.0.6: + version "2.3.7" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.1.1, readable-stream@^3.4.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +safe-buffer@^5.0.1, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + +semver@^5.4.1: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + +set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + +seventh@^0.7.40: + version "0.7.40" + resolved "https://registry.yarnpkg.com/seventh/-/seventh-0.7.40.tgz#a5a010496cb84421bb81f524840484a5aa473be9" + dependencies: + setimmediate "^1.0.5" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + +signal-exit@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" + +simple-concat@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" + +simple-get@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-3.1.0.tgz#b45be062435e50d159540b576202ceec40b9c6b3" + dependencies: + decompress-response "^4.2.0" + once "^1.3.1" + simple-concat "^1.0.0" + +sisteransi@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" + +string-kit@^0.12.5: + version "0.12.5" + resolved "https://registry.yarnpkg.com/string-kit/-/string-kit-0.12.5.tgz#e7f646e7740e54b7ecae6cf67b73bb616aa16652" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2": + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^3.0.0" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + dependencies: + has-flag "^4.0.0" + +tar-fs@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784" + dependencies: + chownr "^1.1.1" + mkdirp-classic "^0.5.2" + pump "^3.0.0" + tar-stream "^2.1.4" + +tar-stream@^2.1.4: + version "2.2.0" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287" + dependencies: + bl "^4.0.3" + end-of-stream "^1.4.1" + fs-constants "^1.0.0" + inherits "^2.0.3" + readable-stream "^3.1.1" + +terminal-kit@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/terminal-kit/-/terminal-kit-2.1.2.tgz#08689ff9f8efc6614d34d4cc7be916a91742b896" + dependencies: + "@cronvel/get-pixels" "^3.4.0" + chroma-js "^2.1.1" + lazyness "^1.2.0" + ndarray "^1.0.19" + nextgen-events "^1.3.4" + seventh "^0.7.40" + string-kit "^0.12.5" + tree-kit "^0.7.0" + +tree-kit@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/tree-kit/-/tree-kit-0.7.0.tgz#f677b10f79d9b4442ba20e0d87c8a12ecabe5fbb" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" + +uniq@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + dependencies: + isexe "^2.0.0" + +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + dependencies: + string-width "^1.0.2 || 2" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" diff --git a/lib/vogue/console.v b/lib/vogue/console.v index 6f428e2..8ea7c01 100644 --- a/lib/vogue/console.v +++ b/lib/vogue/console.v @@ -3,6 +3,10 @@ static console; import chalk from 'chalk'; import tk from 'terminal-kit'; import ansi from 'sisteransi'; +import debugFactory from 'debug'; +import util from 'util'; + +runtime member debug; restore { const {terminal} = tk; @@ -11,12 +15,16 @@ restore { process.exit(2); } }); + + debug ??= debugFactory('vogue:console'); this.write(ansi.cursor.hide); + debug('Booted console plugin!'); } log(a) { if(typeof a === 'number') a = chalk.yellow(a); + if(typeof a === 'object') a = util.formatWithOptions({ colors: true }, '%o', a) // const string = a.toString(); diff --git a/lib/vogue/window.v b/lib/vogue/window.v new file mode 100644 index 0000000..11cf894 --- /dev/null +++ b/lib/vogue/window.v @@ -0,0 +1,33 @@ +namespace SDL; + +keepalive; + +import sdl from '@kmamal/sdl'; +import util from 'util'; + +runtime member window; + +async restore { + // console.log('he...hello?') + window = sdl.video.createWindow({ + // borderless: true, + height: 200, + width: 300, + resizable: true + }); + + main_loop: + for (;;) { + let event + while ((event = sdl.events.poll())) { + console.log(event); + if (event.type === 'quit') { + window.destroy() + break main_loop + } + } + + + + } +} \ No newline at end of file diff --git a/package.json b/package.json index 1274a54..a6aeb34 100644 --- a/package.json +++ b/package.json @@ -10,13 +10,14 @@ "scripts": { "test": "node --enable-source-maps --unhandled-rejections=strict out/run.js test", "debug": "cross-env DEBUG=vogue:* yarn test", - "debug:watch": "cross-env DEBUG=vogue:* supervisor -w out -n exit --exec yarn -- test", + "debug:watch": "cross-env DEBUG=vogue:* supervisor -w out,test,lib -n exit --exec yarn -- test", "postinstall": "yarn compile && cd test && yarn", "postcompile:watch": "echo DONE", "compile": "tsc", "compile:watch": "tsc --watch" }, "dependencies": { + "@kmamal/sdl": "^0.0.13", "@types/debug": "^4.1.5", "@types/lodash": "^4.14.169", "@types/nearley": "^2.11.1", diff --git a/src/Instance.ts b/src/Instance.ts index 38402a6..b9b5cb4 100644 --- a/src/Instance.ts +++ b/src/Instance.ts @@ -32,7 +32,8 @@ export default class Instance extends Serializable { // system globals! // TODO turn this into its own vogue module! system.create/instance.create // TODO request context from system... - initialContext.create = this.system.createInstance.bind(this.system); + initialContext.create = this.system.newInstance.bind(this.system); + initialContext.process = process; for(const name in this.system.staticInstances) initialContext[name] = this.system.staticInstances[name]; @@ -43,6 +44,10 @@ export default class Instance extends Serializable { initialContext[link.name] = []; for(const link of this.module.links.filter((v: Link) => !v.array && !v.required)) initialContext[link.name] = null; + for(const variable of this.module.variables) + initialContext[variable.name] = null; + for(const name in this.module.imports) + initialContext[name] = this.module.imports[name]; const context = vm.createContext(initialContext); @@ -52,34 +57,11 @@ export default class Instance extends Serializable { ` var ${name} = ${async ? 'async' : ''} function ${name}(${parameters.join(', ')}) ${code} `; - vm.runInContext(injectedScript, context); + vm.runInContext(injectedScript, context, { + + }); } - // local functions time! - // for(const name of this.module.functions) - - - - // let ctx = vm.createContext({ - // create: this.system.newInstance.bind(this.system), - // ...this.system.staticInstances, - // ...this.internalFunctions - // }); - - - // for(const name in this.module.imports) { - // ctx[name] = this.module.imports[name]; - // this.locals.push(name); - // } - // ctx = { - // ...ctx, - - // } - // for(const identifier in this.system.staticInstances) { - // this.locals.push(identifier); - // } - // // ctx.create = - // this.locals.push('create'); return context; }; @@ -91,27 +73,21 @@ var ${name} = ${async ? 'async' : ''} function ${name}(${parameters.join(', ')}) this.context = this.createContext(); this._link = new Proxy(this, { - get(target: Instance, prop, receiver) { - if(prop === 'restore') return undefined; + get(target: Instance, prop: string, receiver) { + log(`getting ${target.module.name.full}.${prop}: (${target.module.identifiers[prop]}|${typeof target.context[prop]})`); + const DNEText = `${target.module.name.full}.${prop.toString()} either does not exist, or is not accessible`; + if(prop === 'restore') throw new Error(DNEText); + if(prop in target.module.functions) { - // TODO return the fn - return + return target.context[prop]; } - return undefined; + throw new Error(DNEText); } }); } - hasPublicFunction(name: string) { - return (name in this.module.functions); - } - - invokeInternal(name: string, ...args: any[]): any { - log('invoking', this.module.name.full + '.' + name, 'with args', args); - - if(typeof this.context[name] === 'function') { - this.context[name](...args); - } else throw new Error(`${name} is not a function in ${this.module.name.full}`) + restore() { + return this.context.restore?.(); } get link () { diff --git a/src/Module.ts b/src/Module.ts index 634963e..5e9f3a7 100644 --- a/src/Module.ts +++ b/src/Module.ts @@ -18,6 +18,11 @@ export type Link = { name: string, array: boolean, required: boolean +}; + +export type Variable = { + name: string, + persist: boolean } export default class Module { @@ -41,10 +46,7 @@ export default class Module { imports: { [key: string]: any } = {}; - variables: any = { - cold: [], - warm: [] - }; + variables: Variable[] = []; // directives 'singleton': boolean = false; 'keepalive': boolean = false; @@ -83,8 +85,6 @@ export default class Module { async import({ importName, name }: ImportRule): Promise { const nodePath = path.resolve(this.rootDir, 'node_module'); - log('#'.repeat(80)); - log(nodePath); const __require__ = createRequire(nodePath); const imported = __require__(importName); if ('default' in imported) this.imports[name] = imported.default; @@ -92,7 +92,10 @@ export default class Module { } async variable({ persist, name }: VariableRule): Promise { - this.variables[persist ? 'cold' : 'warm'].push(name); + this.variables.push({ + name, + persist + }); } static async create(location: string, rootDir: string) { @@ -113,6 +116,9 @@ export default class Module { } } + log(`processing AST Rule (${'name' in item ? name + '|' : '' }${item.type})`); + // log(item); + if (item.type in module) { const func = module[item.type] as ((arg0: Rule) => Promise) func.call(module, item); diff --git a/src/System.ts b/src/System.ts index bf1d4f2..0d51240 100644 --- a/src/System.ts +++ b/src/System.ts @@ -92,8 +92,7 @@ class System extends Serializable { newInstance(name: ModuleName, args = {}) { const instance = this.createInstance(name, args); const link = instance.link; - if(instance.hasPublicFunction('restore')) - instance.invokeInternal('restore'); + instance.restore(); return link; } } diff --git a/test/counter.v b/test/counter.v new file mode 100644 index 0000000..3e04bf3 --- /dev/null +++ b/test/counter.v @@ -0,0 +1,9 @@ +member count; + +increment() { + count ++; +} + +getCount() { + return count; +} \ No newline at end of file diff --git a/test/main.v b/test/main.v index 8db8958..a901312 100644 --- a/test/main.v +++ b/test/main.v @@ -1,12 +1,22 @@ singleton; -link currentSave; +link counter; +link window; async restore { + // process.stdout.write(typeof console._link + '\n'); console.log('~ Welcome to Vogue ~'); // process.stdout.write(JSON.stringify(console, null, 2)) - this.currentSave ??= create('world', {}); + counter ??= create('counter', {}); + for(let i = 0; i < 10; i ++) + counter.increment(); // const choice = await console.choice('select a thing', ['a', 'b', 'c', 'd']); - await this.currentSave.render(); + console.log(counter.getCount()); + + // window ??= create('SDL.window', {}); + + // window.setScene() + + // await counter.render(); } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index a55de19..412c8b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,182 +2,554 @@ # yarn lockfile v1 +"@kmamal/sdl@^0.0.13": + "resolved" "https://registry.npmjs.org/@kmamal/sdl/-/sdl-0.0.13.tgz" + "version" "0.0.13" + dependencies: + "bindings" "*" + "prebuild-install" "^6.0.1" + "@types/debug@^4.1.5": - version "4.1.5" - resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd" + "resolved" "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz" + "version" "4.1.5" "@types/lodash@^4.14.169": - version "4.14.169" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.169.tgz#83c217688f07a4d9ef8f28a3ebd1d318f6ff4cbb" + "resolved" "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.169.tgz" + "version" "4.14.169" "@types/nearley@^2.11.1": - version "2.11.1" - resolved "https://registry.yarnpkg.com/@types/nearley/-/nearley-2.11.1.tgz#6ac3f57c00ca28071a1774ec72d2e45750f21420" + "resolved" "https://registry.npmjs.org/@types/nearley/-/nearley-2.11.1.tgz" + "version" "2.11.1" "@types/node@^15.3.0": - version "15.3.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.3.0.tgz#d6fed7d6bc6854306da3dea1af9f874b00783e26" + "resolved" "https://registry.npmjs.org/@types/node/-/node-15.3.0.tgz" + "version" "15.3.0" "@types/uglify-js@^3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.13.0.tgz#1cad8df1fb0b143c5aba08de5712ea9d1ff71124" + "resolved" "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.13.0.tgz" + "version" "3.13.0" dependencies: - source-map "^0.6.1" + "source-map" "^0.6.1" -async@0.2.10: - version "0.2.10" - resolved "https://registry.npmjs.org/async/-/async-0.2.10.tgz" +"ansi-regex@^2.0.0": + "resolved" "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" + "version" "2.1.1" -binary-search-tree@0.2.5: - version "0.2.5" - resolved "https://registry.npmjs.org/binary-search-tree/-/binary-search-tree-0.2.5.tgz" +"ansi-regex@^3.0.0": + "resolved" "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz" + "version" "3.0.0" + +"aproba@^1.0.3": + "resolved" "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz" + "version" "1.2.0" + +"are-we-there-yet@~1.1.2": + "resolved" "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz" + "version" "1.1.5" dependencies: - underscore "~1.4.4" + "delegates" "^1.0.0" + "readable-stream" "^2.0.6" -commander@^2.19.0: - version "2.20.3" - resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" +"async@0.2.10": + "resolved" "https://registry.npmjs.org/async/-/async-0.2.10.tgz" + "version" "0.2.10" -cross-env@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" +"base64-js@^1.3.1": + "resolved" "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" + "version" "1.5.1" + +"binary-search-tree@0.2.5": + "resolved" "https://registry.npmjs.org/binary-search-tree/-/binary-search-tree-0.2.5.tgz" + "version" "0.2.5" dependencies: - cross-spawn "^7.0.1" + "underscore" "~1.4.4" -cross-spawn@^7.0.1: - version "7.0.3" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" +"bindings@*": + "resolved" "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz" + "version" "1.5.0" dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" + "file-uri-to-path" "1.0.0" -debug@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" +"bl@^4.0.3": + "resolved" "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz" + "version" "4.1.0" dependencies: - ms "2.1.2" + "buffer" "^5.5.0" + "inherits" "^2.0.4" + "readable-stream" "^3.4.0" -discontinuous-range@1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz" - -immediate@~3.0.5: - version "3.0.6" - resolved "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz" - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" - -lie@3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz" +"buffer@^5.5.0": + "resolved" "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz" + "version" "5.7.1" dependencies: - immediate "~3.0.5" + "base64-js" "^1.3.1" + "ieee754" "^1.1.13" -localforage@^1.3.0: - version "1.9.0" - resolved "https://registry.npmjs.org/localforage/-/localforage-1.9.0.tgz" +"chownr@^1.1.1": + "resolved" "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz" + "version" "1.1.4" + +"code-point-at@^1.0.0": + "resolved" "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz" + "version" "1.1.0" + +"commander@^2.19.0": + "resolved" "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" + "version" "2.20.3" + +"console-control-strings@^1.0.0", "console-control-strings@~1.1.0": + "resolved" "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz" + "version" "1.1.0" + +"core-util-is@~1.0.0": + "resolved" "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" + "version" "1.0.2" + +"cross-env@^7.0.3": + "resolved" "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz" + "version" "7.0.3" dependencies: - lie "3.1.1" + "cross-spawn" "^7.0.1" -lodash@^4.17.21: - version "4.17.21" - resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" - -minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz" - -mkdirp@~0.5.1: - version "0.5.5" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz" +"cross-spawn@^7.0.1": + "resolved" "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" + "version" "7.0.3" dependencies: - minimist "^1.2.5" + "path-key" "^3.1.0" + "shebang-command" "^2.0.0" + "which" "^2.0.1" -moo@^0.5.0, moo@^0.5.1: - version "0.5.1" - resolved "https://registry.npmjs.org/moo/-/moo-0.5.1.tgz" - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - -nearley@^2.20.1: - version "2.20.1" - resolved "https://registry.npmjs.org/nearley/-/nearley-2.20.1.tgz" +"debug@^4.3.1": + "resolved" "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz" + "version" "4.3.1" dependencies: - commander "^2.19.0" - moo "^0.5.0" - railroad-diagrams "^1.0.0" - randexp "0.4.6" + "ms" "2.1.2" -nedb@^1.8.0: - version "1.8.0" - resolved "https://registry.npmjs.org/nedb/-/nedb-1.8.0.tgz" +"decompress-response@^4.2.0": + "resolved" "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz" + "version" "4.2.1" dependencies: - async "0.2.10" - binary-search-tree "0.2.5" - localforage "^1.3.0" - mkdirp "~0.5.1" - underscore "~1.4.4" + "mimic-response" "^2.0.0" -path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" +"deep-extend@^0.6.0": + "resolved" "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz" + "version" "0.6.0" -railroad-diagrams@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz" +"delegates@^1.0.0": + "resolved" "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz" + "version" "1.0.0" -randexp@0.4.6: - version "0.4.6" - resolved "https://registry.npmjs.org/randexp/-/randexp-0.4.6.tgz" +"detect-libc@^1.0.3": + "resolved" "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz" + "version" "1.0.3" + +"discontinuous-range@1.0.0": + "resolved" "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz" + "version" "1.0.0" + +"end-of-stream@^1.1.0", "end-of-stream@^1.4.1": + "resolved" "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz" + "version" "1.4.4" dependencies: - discontinuous-range "1.0.0" - ret "~0.1.10" + "once" "^1.4.0" -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz" +"expand-template@^2.0.3": + "resolved" "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz" + "version" "2.0.3" -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" +"file-uri-to-path@1.0.0": + "resolved" "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz" + "version" "1.0.0" + +"fs-constants@^1.0.0": + "resolved" "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz" + "version" "1.0.0" + +"gauge@~2.7.3": + "resolved" "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz" + "version" "2.7.4" dependencies: - shebang-regex "^3.0.0" + "aproba" "^1.0.3" + "console-control-strings" "^1.0.0" + "has-unicode" "^2.0.0" + "object-assign" "^4.1.0" + "signal-exit" "^3.0.0" + "string-width" "^1.0.1" + "strip-ansi" "^3.0.1" + "wide-align" "^1.1.0" -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" +"github-from-package@0.0.0": + "resolved" "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz" + "version" "0.0.0" -source-map@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" +"has-unicode@^2.0.0": + "resolved" "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz" + "version" "2.0.1" -supervisor@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/supervisor/-/supervisor-0.12.0.tgz#de7e6337015b291851c10f3538c4a7f04917ecc1" +"ieee754@^1.1.13": + "resolved" "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" + "version" "1.2.1" -typescript@^4.2.4: - version "4.2.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961" +"immediate@~3.0.5": + "resolved" "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz" + "version" "3.0.6" -uglify-js@^3.13.5: - version "3.13.5" - resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.5.tgz" +"inherits@^2.0.3", "inherits@^2.0.4", "inherits@~2.0.3": + "resolved" "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" + "version" "2.0.4" -underscore@~1.4.4: - version "1.4.4" - resolved "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz" +"ini@~1.3.0": + "resolved" "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz" + "version" "1.3.8" -which@^2.0.1: - version "2.0.2" - resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" +"is-fullwidth-code-point@^1.0.0": + "resolved" "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz" + "version" "1.0.0" dependencies: - isexe "^2.0.0" + "number-is-nan" "^1.0.0" -yarn@^1.22.10: - version "1.22.10" - resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.10.tgz#c99daa06257c80f8fa2c3f1490724e394c26b18c" +"is-fullwidth-code-point@^2.0.0": + "resolved" "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz" + "version" "2.0.0" + +"isarray@~1.0.0": + "resolved" "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + "version" "1.0.0" + +"isexe@^2.0.0": + "resolved" "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" + "version" "2.0.0" + +"lie@3.1.1": + "resolved" "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz" + "version" "3.1.1" + dependencies: + "immediate" "~3.0.5" + +"localforage@^1.3.0": + "resolved" "https://registry.npmjs.org/localforage/-/localforage-1.9.0.tgz" + "version" "1.9.0" + dependencies: + "lie" "3.1.1" + +"lodash@^4.17.21": + "resolved" "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" + "version" "4.17.21" + +"mimic-response@^2.0.0": + "resolved" "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz" + "version" "2.1.0" + +"minimist@^1.2.0", "minimist@^1.2.3", "minimist@^1.2.5": + "resolved" "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz" + "version" "1.2.5" + +"mkdirp-classic@^0.5.2", "mkdirp-classic@^0.5.3": + "resolved" "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz" + "version" "0.5.3" + +"mkdirp@~0.5.1": + "resolved" "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz" + "version" "0.5.5" + dependencies: + "minimist" "^1.2.5" + +"moo@^0.5.0", "moo@^0.5.1": + "resolved" "https://registry.npmjs.org/moo/-/moo-0.5.1.tgz" + "version" "0.5.1" + +"ms@2.1.2": + "resolved" "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" + "version" "2.1.2" + +"napi-build-utils@^1.0.1": + "resolved" "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz" + "version" "1.0.2" + +"nearley@^2.20.1": + "resolved" "https://registry.npmjs.org/nearley/-/nearley-2.20.1.tgz" + "version" "2.20.1" + dependencies: + "commander" "^2.19.0" + "moo" "^0.5.0" + "railroad-diagrams" "^1.0.0" + "randexp" "0.4.6" + +"nedb@^1.8.0": + "resolved" "https://registry.npmjs.org/nedb/-/nedb-1.8.0.tgz" + "version" "1.8.0" + dependencies: + "async" "0.2.10" + "binary-search-tree" "0.2.5" + "localforage" "^1.3.0" + "mkdirp" "~0.5.1" + "underscore" "~1.4.4" + +"node-abi@^2.21.0": + "resolved" "https://registry.npmjs.org/node-abi/-/node-abi-2.26.0.tgz" + "version" "2.26.0" + dependencies: + "semver" "^5.4.1" + +"noop-logger@^0.1.1": + "resolved" "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz" + "version" "0.1.1" + +"npmlog@^4.0.1": + "resolved" "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz" + "version" "4.1.2" + dependencies: + "are-we-there-yet" "~1.1.2" + "console-control-strings" "~1.1.0" + "gauge" "~2.7.3" + "set-blocking" "~2.0.0" + +"number-is-nan@^1.0.0": + "resolved" "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" + "version" "1.0.1" + +"object-assign@^4.1.0": + "resolved" "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" + "version" "4.1.1" + +"once@^1.3.1", "once@^1.4.0": + "resolved" "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + "version" "1.4.0" + dependencies: + "wrappy" "1" + +"path-key@^3.1.0": + "resolved" "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" + "version" "3.1.1" + +"prebuild-install@^6.0.1": + "resolved" "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.2.tgz" + "version" "6.1.2" + dependencies: + "detect-libc" "^1.0.3" + "expand-template" "^2.0.3" + "github-from-package" "0.0.0" + "minimist" "^1.2.3" + "mkdirp-classic" "^0.5.3" + "napi-build-utils" "^1.0.1" + "node-abi" "^2.21.0" + "noop-logger" "^0.1.1" + "npmlog" "^4.0.1" + "pump" "^3.0.0" + "rc" "^1.2.7" + "simple-get" "^3.0.3" + "tar-fs" "^2.0.0" + "tunnel-agent" "^0.6.0" + +"process-nextick-args@~2.0.0": + "resolved" "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" + "version" "2.0.1" + +"pump@^3.0.0": + "resolved" "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz" + "version" "3.0.0" + dependencies: + "end-of-stream" "^1.1.0" + "once" "^1.3.1" + +"railroad-diagrams@^1.0.0": + "resolved" "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz" + "version" "1.0.0" + +"randexp@0.4.6": + "resolved" "https://registry.npmjs.org/randexp/-/randexp-0.4.6.tgz" + "version" "0.4.6" + dependencies: + "discontinuous-range" "1.0.0" + "ret" "~0.1.10" + +"rc@^1.2.7": + "resolved" "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz" + "version" "1.2.8" + dependencies: + "deep-extend" "^0.6.0" + "ini" "~1.3.0" + "minimist" "^1.2.0" + "strip-json-comments" "~2.0.1" + +"readable-stream@^2.0.6": + "resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz" + "version" "2.3.7" + dependencies: + "core-util-is" "~1.0.0" + "inherits" "~2.0.3" + "isarray" "~1.0.0" + "process-nextick-args" "~2.0.0" + "safe-buffer" "~5.1.1" + "string_decoder" "~1.1.1" + "util-deprecate" "~1.0.1" + +"readable-stream@^3.1.1", "readable-stream@^3.4.0": + "resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz" + "version" "3.6.0" + dependencies: + "inherits" "^2.0.3" + "string_decoder" "^1.1.1" + "util-deprecate" "^1.0.1" + +"ret@~0.1.10": + "resolved" "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz" + "version" "0.1.15" + +"safe-buffer@^5.0.1": + "resolved" "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" + "version" "5.2.1" + +"safe-buffer@~5.1.0", "safe-buffer@~5.1.1": + "resolved" "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" + "version" "5.1.2" + +"safe-buffer@~5.2.0": + "resolved" "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" + "version" "5.2.1" + +"semver@^5.4.1": + "resolved" "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" + "version" "5.7.1" + +"set-blocking@~2.0.0": + "resolved" "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" + "version" "2.0.0" + +"shebang-command@^2.0.0": + "resolved" "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" + "version" "2.0.0" + dependencies: + "shebang-regex" "^3.0.0" + +"shebang-regex@^3.0.0": + "resolved" "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" + "version" "3.0.0" + +"signal-exit@^3.0.0": + "resolved" "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz" + "version" "3.0.3" + +"simple-concat@^1.0.0": + "resolved" "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz" + "version" "1.0.1" + +"simple-get@^3.0.3": + "resolved" "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz" + "version" "3.1.0" + dependencies: + "decompress-response" "^4.2.0" + "once" "^1.3.1" + "simple-concat" "^1.0.0" + +"source-map@^0.6.1": + "resolved" "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" + "version" "0.6.1" + +"string_decoder@^1.1.1": + "resolved" "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" + "version" "1.3.0" + dependencies: + "safe-buffer" "~5.2.0" + +"string_decoder@~1.1.1": + "resolved" "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" + "version" "1.1.1" + dependencies: + "safe-buffer" "~5.1.0" + +"string-width@^1.0.1": + "resolved" "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" + "version" "1.0.2" + dependencies: + "code-point-at" "^1.0.0" + "is-fullwidth-code-point" "^1.0.0" + "strip-ansi" "^3.0.0" + +"string-width@^1.0.2 || 2": + "resolved" "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz" + "version" "2.1.1" + dependencies: + "is-fullwidth-code-point" "^2.0.0" + "strip-ansi" "^4.0.0" + +"strip-ansi@^3.0.0", "strip-ansi@^3.0.1": + "resolved" "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + "version" "3.0.1" + dependencies: + "ansi-regex" "^2.0.0" + +"strip-ansi@^4.0.0": + "resolved" "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz" + "version" "4.0.0" + dependencies: + "ansi-regex" "^3.0.0" + +"strip-json-comments@~2.0.1": + "resolved" "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz" + "version" "2.0.1" + +"supervisor@^0.12.0": + "resolved" "https://registry.npmjs.org/supervisor/-/supervisor-0.12.0.tgz" + "version" "0.12.0" + +"tar-fs@^2.0.0": + "resolved" "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz" + "version" "2.1.1" + dependencies: + "chownr" "^1.1.1" + "mkdirp-classic" "^0.5.2" + "pump" "^3.0.0" + "tar-stream" "^2.1.4" + +"tar-stream@^2.1.4": + "resolved" "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz" + "version" "2.2.0" + dependencies: + "bl" "^4.0.3" + "end-of-stream" "^1.4.1" + "fs-constants" "^1.0.0" + "inherits" "^2.0.3" + "readable-stream" "^3.1.1" + +"tunnel-agent@^0.6.0": + "resolved" "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz" + "version" "0.6.0" + dependencies: + "safe-buffer" "^5.0.1" + +"typescript@^4.2.4": + "resolved" "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz" + "version" "4.2.4" + +"uglify-js@^3.13.5": + "resolved" "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.5.tgz" + "version" "3.13.5" + +"underscore@~1.4.4": + "resolved" "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz" + "version" "1.4.4" + +"util-deprecate@^1.0.1", "util-deprecate@~1.0.1": + "resolved" "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + "version" "1.0.2" + +"which@^2.0.1": + "resolved" "https://registry.npmjs.org/which/-/which-2.0.2.tgz" + "version" "2.0.2" + dependencies: + "isexe" "^2.0.0" + +"wide-align@^1.1.0": + "resolved" "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz" + "version" "1.1.3" + dependencies: + "string-width" "^1.0.2 || 2" + +"wrappy@1": + "resolved" "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + "version" "1.0.2" + +"yarn@^1.22.10": + "resolved" "https://registry.npmjs.org/yarn/-/yarn-1.22.10.tgz" + "version" "1.22.10" From f1037a0e7acf85d7d42b944eb4a31efb04fd978f Mon Sep 17 00:00:00 2001 From: Valerie Date: Fri, 21 May 2021 01:11:11 -0400 Subject: [PATCH 4/6] remove @kmamal/sdl for now --- package.json | 1 - yarn.lock | 638 +++++++++++---------------------------------------- 2 files changed, 133 insertions(+), 506 deletions(-) diff --git a/package.json b/package.json index a6aeb34..3eb38b9 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,6 @@ "compile:watch": "tsc --watch" }, "dependencies": { - "@kmamal/sdl": "^0.0.13", "@types/debug": "^4.1.5", "@types/lodash": "^4.14.169", "@types/nearley": "^2.11.1", diff --git a/yarn.lock b/yarn.lock index 412c8b3..3bfd784 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,554 +2,182 @@ # yarn lockfile v1 -"@kmamal/sdl@^0.0.13": - "resolved" "https://registry.npmjs.org/@kmamal/sdl/-/sdl-0.0.13.tgz" - "version" "0.0.13" - dependencies: - "bindings" "*" - "prebuild-install" "^6.0.1" - "@types/debug@^4.1.5": - "resolved" "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz" - "version" "4.1.5" + version "4.1.5" + resolved "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz" "@types/lodash@^4.14.169": - "resolved" "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.169.tgz" - "version" "4.14.169" + version "4.14.169" + resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.169.tgz" "@types/nearley@^2.11.1": - "resolved" "https://registry.npmjs.org/@types/nearley/-/nearley-2.11.1.tgz" - "version" "2.11.1" + version "2.11.1" + resolved "https://registry.npmjs.org/@types/nearley/-/nearley-2.11.1.tgz" "@types/node@^15.3.0": - "resolved" "https://registry.npmjs.org/@types/node/-/node-15.3.0.tgz" - "version" "15.3.0" + version "15.3.0" + resolved "https://registry.npmjs.org/@types/node/-/node-15.3.0.tgz" "@types/uglify-js@^3.13.0": - "resolved" "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.13.0.tgz" - "version" "3.13.0" + version "3.13.0" + resolved "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.13.0.tgz" dependencies: - "source-map" "^0.6.1" + source-map "^0.6.1" -"ansi-regex@^2.0.0": - "resolved" "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" - "version" "2.1.1" +async@0.2.10: + version "0.2.10" + resolved "https://registry.npmjs.org/async/-/async-0.2.10.tgz" -"ansi-regex@^3.0.0": - "resolved" "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz" - "version" "3.0.0" - -"aproba@^1.0.3": - "resolved" "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz" - "version" "1.2.0" - -"are-we-there-yet@~1.1.2": - "resolved" "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz" - "version" "1.1.5" +binary-search-tree@0.2.5: + version "0.2.5" + resolved "https://registry.npmjs.org/binary-search-tree/-/binary-search-tree-0.2.5.tgz" dependencies: - "delegates" "^1.0.0" - "readable-stream" "^2.0.6" + underscore "~1.4.4" -"async@0.2.10": - "resolved" "https://registry.npmjs.org/async/-/async-0.2.10.tgz" - "version" "0.2.10" +commander@^2.19.0: + version "2.20.3" + resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" -"base64-js@^1.3.1": - "resolved" "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" - "version" "1.5.1" - -"binary-search-tree@0.2.5": - "resolved" "https://registry.npmjs.org/binary-search-tree/-/binary-search-tree-0.2.5.tgz" - "version" "0.2.5" +cross-env@^7.0.3: + version "7.0.3" + resolved "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz" dependencies: - "underscore" "~1.4.4" + cross-spawn "^7.0.1" -"bindings@*": - "resolved" "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz" - "version" "1.5.0" +cross-spawn@^7.0.1: + version "7.0.3" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" dependencies: - "file-uri-to-path" "1.0.0" + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" -"bl@^4.0.3": - "resolved" "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz" - "version" "4.1.0" +debug@^4.3.1: + version "4.3.1" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz" dependencies: - "buffer" "^5.5.0" - "inherits" "^2.0.4" - "readable-stream" "^3.4.0" + ms "2.1.2" -"buffer@^5.5.0": - "resolved" "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz" - "version" "5.7.1" +discontinuous-range@1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz" + +immediate@~3.0.5: + version "3.0.6" + resolved "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" + +lie@3.1.1: + version "3.1.1" + resolved "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz" dependencies: - "base64-js" "^1.3.1" - "ieee754" "^1.1.13" + immediate "~3.0.5" -"chownr@^1.1.1": - "resolved" "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz" - "version" "1.1.4" - -"code-point-at@^1.0.0": - "resolved" "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz" - "version" "1.1.0" - -"commander@^2.19.0": - "resolved" "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" - "version" "2.20.3" - -"console-control-strings@^1.0.0", "console-control-strings@~1.1.0": - "resolved" "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz" - "version" "1.1.0" - -"core-util-is@~1.0.0": - "resolved" "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" - "version" "1.0.2" - -"cross-env@^7.0.3": - "resolved" "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz" - "version" "7.0.3" +localforage@^1.3.0: + version "1.9.0" + resolved "https://registry.npmjs.org/localforage/-/localforage-1.9.0.tgz" dependencies: - "cross-spawn" "^7.0.1" + lie "3.1.1" -"cross-spawn@^7.0.1": - "resolved" "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" - "version" "7.0.3" +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" + +minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz" + +mkdirp@~0.5.1: + version "0.5.5" + resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz" dependencies: - "path-key" "^3.1.0" - "shebang-command" "^2.0.0" - "which" "^2.0.1" + minimist "^1.2.5" -"debug@^4.3.1": - "resolved" "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz" - "version" "4.3.1" +moo@^0.5.0, moo@^0.5.1: + version "0.5.1" + resolved "https://registry.npmjs.org/moo/-/moo-0.5.1.tgz" + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" + +nearley@^2.20.1: + version "2.20.1" + resolved "https://registry.npmjs.org/nearley/-/nearley-2.20.1.tgz" dependencies: - "ms" "2.1.2" + commander "^2.19.0" + moo "^0.5.0" + railroad-diagrams "^1.0.0" + randexp "0.4.6" -"decompress-response@^4.2.0": - "resolved" "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz" - "version" "4.2.1" +nedb@^1.8.0: + version "1.8.0" + resolved "https://registry.npmjs.org/nedb/-/nedb-1.8.0.tgz" dependencies: - "mimic-response" "^2.0.0" + async "0.2.10" + binary-search-tree "0.2.5" + localforage "^1.3.0" + mkdirp "~0.5.1" + underscore "~1.4.4" -"deep-extend@^0.6.0": - "resolved" "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz" - "version" "0.6.0" +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" -"delegates@^1.0.0": - "resolved" "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz" - "version" "1.0.0" +railroad-diagrams@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz" -"detect-libc@^1.0.3": - "resolved" "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz" - "version" "1.0.3" - -"discontinuous-range@1.0.0": - "resolved" "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz" - "version" "1.0.0" - -"end-of-stream@^1.1.0", "end-of-stream@^1.4.1": - "resolved" "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz" - "version" "1.4.4" +randexp@0.4.6: + version "0.4.6" + resolved "https://registry.npmjs.org/randexp/-/randexp-0.4.6.tgz" dependencies: - "once" "^1.4.0" + discontinuous-range "1.0.0" + ret "~0.1.10" -"expand-template@^2.0.3": - "resolved" "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz" - "version" "2.0.3" +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz" -"file-uri-to-path@1.0.0": - "resolved" "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz" - "version" "1.0.0" - -"fs-constants@^1.0.0": - "resolved" "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz" - "version" "1.0.0" - -"gauge@~2.7.3": - "resolved" "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz" - "version" "2.7.4" +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" dependencies: - "aproba" "^1.0.3" - "console-control-strings" "^1.0.0" - "has-unicode" "^2.0.0" - "object-assign" "^4.1.0" - "signal-exit" "^3.0.0" - "string-width" "^1.0.1" - "strip-ansi" "^3.0.1" - "wide-align" "^1.1.0" + shebang-regex "^3.0.0" -"github-from-package@0.0.0": - "resolved" "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz" - "version" "0.0.0" +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" -"has-unicode@^2.0.0": - "resolved" "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz" - "version" "2.0.1" +source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" -"ieee754@^1.1.13": - "resolved" "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" - "version" "1.2.1" +supervisor@^0.12.0: + version "0.12.0" + resolved "https://registry.npmjs.org/supervisor/-/supervisor-0.12.0.tgz" -"immediate@~3.0.5": - "resolved" "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz" - "version" "3.0.6" +typescript@^4.2.4: + version "4.2.4" + resolved "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz" -"inherits@^2.0.3", "inherits@^2.0.4", "inherits@~2.0.3": - "resolved" "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" - "version" "2.0.4" +uglify-js@^3.13.5: + version "3.13.5" + resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.5.tgz" -"ini@~1.3.0": - "resolved" "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz" - "version" "1.3.8" +underscore@~1.4.4: + version "1.4.4" + resolved "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz" -"is-fullwidth-code-point@^1.0.0": - "resolved" "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz" - "version" "1.0.0" +which@^2.0.1: + version "2.0.2" + resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" dependencies: - "number-is-nan" "^1.0.0" + isexe "^2.0.0" -"is-fullwidth-code-point@^2.0.0": - "resolved" "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz" - "version" "2.0.0" - -"isarray@~1.0.0": - "resolved" "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - "version" "1.0.0" - -"isexe@^2.0.0": - "resolved" "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" - "version" "2.0.0" - -"lie@3.1.1": - "resolved" "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz" - "version" "3.1.1" - dependencies: - "immediate" "~3.0.5" - -"localforage@^1.3.0": - "resolved" "https://registry.npmjs.org/localforage/-/localforage-1.9.0.tgz" - "version" "1.9.0" - dependencies: - "lie" "3.1.1" - -"lodash@^4.17.21": - "resolved" "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" - "version" "4.17.21" - -"mimic-response@^2.0.0": - "resolved" "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz" - "version" "2.1.0" - -"minimist@^1.2.0", "minimist@^1.2.3", "minimist@^1.2.5": - "resolved" "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz" - "version" "1.2.5" - -"mkdirp-classic@^0.5.2", "mkdirp-classic@^0.5.3": - "resolved" "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz" - "version" "0.5.3" - -"mkdirp@~0.5.1": - "resolved" "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz" - "version" "0.5.5" - dependencies: - "minimist" "^1.2.5" - -"moo@^0.5.0", "moo@^0.5.1": - "resolved" "https://registry.npmjs.org/moo/-/moo-0.5.1.tgz" - "version" "0.5.1" - -"ms@2.1.2": - "resolved" "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" - "version" "2.1.2" - -"napi-build-utils@^1.0.1": - "resolved" "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz" - "version" "1.0.2" - -"nearley@^2.20.1": - "resolved" "https://registry.npmjs.org/nearley/-/nearley-2.20.1.tgz" - "version" "2.20.1" - dependencies: - "commander" "^2.19.0" - "moo" "^0.5.0" - "railroad-diagrams" "^1.0.0" - "randexp" "0.4.6" - -"nedb@^1.8.0": - "resolved" "https://registry.npmjs.org/nedb/-/nedb-1.8.0.tgz" - "version" "1.8.0" - dependencies: - "async" "0.2.10" - "binary-search-tree" "0.2.5" - "localforage" "^1.3.0" - "mkdirp" "~0.5.1" - "underscore" "~1.4.4" - -"node-abi@^2.21.0": - "resolved" "https://registry.npmjs.org/node-abi/-/node-abi-2.26.0.tgz" - "version" "2.26.0" - dependencies: - "semver" "^5.4.1" - -"noop-logger@^0.1.1": - "resolved" "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz" - "version" "0.1.1" - -"npmlog@^4.0.1": - "resolved" "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz" - "version" "4.1.2" - dependencies: - "are-we-there-yet" "~1.1.2" - "console-control-strings" "~1.1.0" - "gauge" "~2.7.3" - "set-blocking" "~2.0.0" - -"number-is-nan@^1.0.0": - "resolved" "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" - "version" "1.0.1" - -"object-assign@^4.1.0": - "resolved" "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" - "version" "4.1.1" - -"once@^1.3.1", "once@^1.4.0": - "resolved" "https://registry.npmjs.org/once/-/once-1.4.0.tgz" - "version" "1.4.0" - dependencies: - "wrappy" "1" - -"path-key@^3.1.0": - "resolved" "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" - "version" "3.1.1" - -"prebuild-install@^6.0.1": - "resolved" "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.2.tgz" - "version" "6.1.2" - dependencies: - "detect-libc" "^1.0.3" - "expand-template" "^2.0.3" - "github-from-package" "0.0.0" - "minimist" "^1.2.3" - "mkdirp-classic" "^0.5.3" - "napi-build-utils" "^1.0.1" - "node-abi" "^2.21.0" - "noop-logger" "^0.1.1" - "npmlog" "^4.0.1" - "pump" "^3.0.0" - "rc" "^1.2.7" - "simple-get" "^3.0.3" - "tar-fs" "^2.0.0" - "tunnel-agent" "^0.6.0" - -"process-nextick-args@~2.0.0": - "resolved" "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" - "version" "2.0.1" - -"pump@^3.0.0": - "resolved" "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz" - "version" "3.0.0" - dependencies: - "end-of-stream" "^1.1.0" - "once" "^1.3.1" - -"railroad-diagrams@^1.0.0": - "resolved" "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz" - "version" "1.0.0" - -"randexp@0.4.6": - "resolved" "https://registry.npmjs.org/randexp/-/randexp-0.4.6.tgz" - "version" "0.4.6" - dependencies: - "discontinuous-range" "1.0.0" - "ret" "~0.1.10" - -"rc@^1.2.7": - "resolved" "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz" - "version" "1.2.8" - dependencies: - "deep-extend" "^0.6.0" - "ini" "~1.3.0" - "minimist" "^1.2.0" - "strip-json-comments" "~2.0.1" - -"readable-stream@^2.0.6": - "resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz" - "version" "2.3.7" - dependencies: - "core-util-is" "~1.0.0" - "inherits" "~2.0.3" - "isarray" "~1.0.0" - "process-nextick-args" "~2.0.0" - "safe-buffer" "~5.1.1" - "string_decoder" "~1.1.1" - "util-deprecate" "~1.0.1" - -"readable-stream@^3.1.1", "readable-stream@^3.4.0": - "resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz" - "version" "3.6.0" - dependencies: - "inherits" "^2.0.3" - "string_decoder" "^1.1.1" - "util-deprecate" "^1.0.1" - -"ret@~0.1.10": - "resolved" "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz" - "version" "0.1.15" - -"safe-buffer@^5.0.1": - "resolved" "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" - "version" "5.2.1" - -"safe-buffer@~5.1.0", "safe-buffer@~5.1.1": - "resolved" "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" - "version" "5.1.2" - -"safe-buffer@~5.2.0": - "resolved" "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" - "version" "5.2.1" - -"semver@^5.4.1": - "resolved" "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" - "version" "5.7.1" - -"set-blocking@~2.0.0": - "resolved" "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" - "version" "2.0.0" - -"shebang-command@^2.0.0": - "resolved" "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" - "version" "2.0.0" - dependencies: - "shebang-regex" "^3.0.0" - -"shebang-regex@^3.0.0": - "resolved" "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" - "version" "3.0.0" - -"signal-exit@^3.0.0": - "resolved" "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz" - "version" "3.0.3" - -"simple-concat@^1.0.0": - "resolved" "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz" - "version" "1.0.1" - -"simple-get@^3.0.3": - "resolved" "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz" - "version" "3.1.0" - dependencies: - "decompress-response" "^4.2.0" - "once" "^1.3.1" - "simple-concat" "^1.0.0" - -"source-map@^0.6.1": - "resolved" "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" - "version" "0.6.1" - -"string_decoder@^1.1.1": - "resolved" "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" - "version" "1.3.0" - dependencies: - "safe-buffer" "~5.2.0" - -"string_decoder@~1.1.1": - "resolved" "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" - "version" "1.1.1" - dependencies: - "safe-buffer" "~5.1.0" - -"string-width@^1.0.1": - "resolved" "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" - "version" "1.0.2" - dependencies: - "code-point-at" "^1.0.0" - "is-fullwidth-code-point" "^1.0.0" - "strip-ansi" "^3.0.0" - -"string-width@^1.0.2 || 2": - "resolved" "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz" - "version" "2.1.1" - dependencies: - "is-fullwidth-code-point" "^2.0.0" - "strip-ansi" "^4.0.0" - -"strip-ansi@^3.0.0", "strip-ansi@^3.0.1": - "resolved" "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" - "version" "3.0.1" - dependencies: - "ansi-regex" "^2.0.0" - -"strip-ansi@^4.0.0": - "resolved" "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz" - "version" "4.0.0" - dependencies: - "ansi-regex" "^3.0.0" - -"strip-json-comments@~2.0.1": - "resolved" "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz" - "version" "2.0.1" - -"supervisor@^0.12.0": - "resolved" "https://registry.npmjs.org/supervisor/-/supervisor-0.12.0.tgz" - "version" "0.12.0" - -"tar-fs@^2.0.0": - "resolved" "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz" - "version" "2.1.1" - dependencies: - "chownr" "^1.1.1" - "mkdirp-classic" "^0.5.2" - "pump" "^3.0.0" - "tar-stream" "^2.1.4" - -"tar-stream@^2.1.4": - "resolved" "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz" - "version" "2.2.0" - dependencies: - "bl" "^4.0.3" - "end-of-stream" "^1.4.1" - "fs-constants" "^1.0.0" - "inherits" "^2.0.3" - "readable-stream" "^3.1.1" - -"tunnel-agent@^0.6.0": - "resolved" "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz" - "version" "0.6.0" - dependencies: - "safe-buffer" "^5.0.1" - -"typescript@^4.2.4": - "resolved" "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz" - "version" "4.2.4" - -"uglify-js@^3.13.5": - "resolved" "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.5.tgz" - "version" "3.13.5" - -"underscore@~1.4.4": - "resolved" "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz" - "version" "1.4.4" - -"util-deprecate@^1.0.1", "util-deprecate@~1.0.1": - "resolved" "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" - "version" "1.0.2" - -"which@^2.0.1": - "resolved" "https://registry.npmjs.org/which/-/which-2.0.2.tgz" - "version" "2.0.2" - dependencies: - "isexe" "^2.0.0" - -"wide-align@^1.1.0": - "resolved" "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz" - "version" "1.1.3" - dependencies: - "string-width" "^1.0.2 || 2" - -"wrappy@1": - "resolved" "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" - "version" "1.0.2" - -"yarn@^1.22.10": - "resolved" "https://registry.npmjs.org/yarn/-/yarn-1.22.10.tgz" - "version" "1.22.10" +yarn@^1.22.10: + version "1.22.10" + resolved "https://registry.npmjs.org/yarn/-/yarn-1.22.10.tgz" From c3c339a084dfcd8f0aaa6de657899f31382a3e64 Mon Sep 17 00:00:00 2001 From: Valerie Date: Fri, 21 May 2021 01:14:04 -0400 Subject: [PATCH 5/6] forget window exists at all for now... --- lib/vogue/window.v | 50 +++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/vogue/window.v b/lib/vogue/window.v index 11cf894..9666dff 100644 --- a/lib/vogue/window.v +++ b/lib/vogue/window.v @@ -1,33 +1,33 @@ -namespace SDL; +// namespace SDL; -keepalive; +// keepalive; -import sdl from '@kmamal/sdl'; -import util from 'util'; +// import sdl from '@kmamal/sdl'; +// import util from 'util'; -runtime member window; +// runtime member window; -async restore { - // console.log('he...hello?') - window = sdl.video.createWindow({ - // borderless: true, - height: 200, - width: 300, - resizable: true - }); +// async restore { +// // console.log('he...hello?') +// window = sdl.video.createWindow({ +// // borderless: true, +// height: 200, +// width: 300, +// resizable: true +// }); - main_loop: - for (;;) { - let event - while ((event = sdl.events.poll())) { - console.log(event); - if (event.type === 'quit') { - window.destroy() - break main_loop - } - } +// main_loop: +// for (;;) { +// let event +// while ((event = sdl.events.poll())) { +// console.log(event); +// if (event.type === 'quit') { +// window.destroy() +// break main_loop +// } +// } - } -} \ No newline at end of file +// } +// } \ No newline at end of file From 5ac2096303181fb31404a7606ff53f8f43de7ddf Mon Sep 17 00:00:00 2001 From: Valerie Date: Fri, 21 May 2021 01:14:59 -0400 Subject: [PATCH 6/6] quarantine window --- lib/vogue/window.v | 33 --------------------------------- testinglib/window.v | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 33 deletions(-) delete mode 100644 lib/vogue/window.v create mode 100644 testinglib/window.v diff --git a/lib/vogue/window.v b/lib/vogue/window.v deleted file mode 100644 index 9666dff..0000000 --- a/lib/vogue/window.v +++ /dev/null @@ -1,33 +0,0 @@ -// namespace SDL; - -// keepalive; - -// import sdl from '@kmamal/sdl'; -// import util from 'util'; - -// runtime member window; - -// async restore { -// // console.log('he...hello?') -// window = sdl.video.createWindow({ -// // borderless: true, -// height: 200, -// width: 300, -// resizable: true -// }); - -// main_loop: -// for (;;) { -// let event -// while ((event = sdl.events.poll())) { -// console.log(event); -// if (event.type === 'quit') { -// window.destroy() -// break main_loop -// } -// } - - - -// } -// } \ No newline at end of file diff --git a/testinglib/window.v b/testinglib/window.v new file mode 100644 index 0000000..11cf894 --- /dev/null +++ b/testinglib/window.v @@ -0,0 +1,33 @@ +namespace SDL; + +keepalive; + +import sdl from '@kmamal/sdl'; +import util from 'util'; + +runtime member window; + +async restore { + // console.log('he...hello?') + window = sdl.video.createWindow({ + // borderless: true, + height: 200, + width: 300, + resizable: true + }); + + main_loop: + for (;;) { + let event + while ((event = sdl.events.poll())) { + console.log(event); + if (event.type === 'quit') { + window.destroy() + break main_loop + } + } + + + + } +} \ No newline at end of file