From bc16527103281b65f26e21616479ff064f385340 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Thu, 3 Jun 2021 01:03:11 +0100 Subject: [PATCH 01/38] chore: Convert to Deno --- .eslintignore | 7 - .eslintrc.cjs | 177 - compile.ts | 175 + deps.ts | 3 + package-lock.json | 3157 ----------------- package.json | 15 +- src/_examples/components/app-root.ts | 4 +- src/_examples/components/array-demo.ts | 2 +- src/_examples/components/async-component.ts | 2 +- src/_examples/components/async-demo.ts | 6 +- src/_examples/components/forms/text-field.ts | 4 +- src/_examples/components/hash-router.ts | 2 +- src/_examples/components/inputStyles.ts | 2 +- src/_examples/components/tab-view.ts | 4 +- src/_examples/components/time-diff.ts | 4 +- src/_examples/components/to-do/_to-do.ts | 8 +- src/_examples/components/to-do/task-item.ts | 6 +- src/_examples/components/visitor-demo.ts | 4 +- .../components/window-manager/TWindow.ts | 2 +- .../window-manager/_window-manager.ts | 6 +- .../components/window-manager/window.ts | 4 +- src/_examples/main.ts | 4 +- src/componentLogic/Component.ts | 23 +- src/componentLogic/DestinyFallback.ts | 8 +- src/componentLogic/elementData.ts | 2 +- src/componentLogic/isComponent.ts | 2 +- src/componentLogic/register.ts | 6 +- src/globalThis.d.ts | 8 - src/globalTypes/CSSStyleSheet.ts | 7 + src/globalTypes/ShadowRoot.ts | 9 + src/mod.ts | 51 +- src/parsing/Slot.ts | 6 +- src/parsing/SlotArray.ts | 6 +- src/parsing/TemplateCache.ts | 2 +- src/parsing/TemplateResult.ts | 4 +- src/parsing/_xml.ts | 6 +- src/parsing/createTemplate.ts | 10 +- src/parsing/deferredElements.ts | 2 +- src/parsing/hookSlotsUp/_hookSlotsUp.ts | 4 +- .../hookAttributeSlotsUp/TElementData.ts | 2 +- .../hookAttributeSlotsUp/TNamespace.ts | 2 +- .../_hookAttributeSlotsUp.ts | 10 +- .../hookAttributeSlotsUp/doOrBind.ts | 8 +- .../elementData/_assignElementData.ts | 10 +- .../elementData/attribute.ts | 4 +- .../elementData/destiny.ts | 8 +- .../elementData/destinyRef.ts | 4 +- .../elementData/destinyUnmount.ts | 2 +- .../hookAttributeSlotsUp/elementData/on.ts | 2 +- .../hookAttributeSlotsUp/elementData/prop.ts | 4 +- .../hookAttributeSlotsUp/isValidNamespace.ts | 2 +- .../parseAttributeName.ts | 6 +- .../hookContentSlotsUp/_hookContentSlotsUp.ts | 8 +- .../toFragment/arrayToFragment.ts | 4 +- .../toFragment/valueToFragment.ts | 8 +- src/parsing/prepareContentSlots.ts | 2 +- src/parsing/resolveSlots.ts | 8 +- src/reactive/ReactiveArray/TMask.ts | 2 +- .../ReactiveArray/TUnwrapReactiveArray.ts | 2 +- src/reactive/ReactiveArray/_ReactiveArray.ts | 24 +- src/reactive/ReactiveArray/flatten.ts | 4 +- .../makeNonPrimitiveItemsReactive.ts | 10 +- .../ReactiveArray/updateFilteredArray.ts | 6 +- src/reactive/ReactivePrimitive.ts | 8 +- src/reactive/classNames.ts | 4 +- src/reactive/computed.ts | 4 +- src/reactive/reactive.ts | 14 +- src/reactive/reactiveObject/reactiveObject.ts | 8 +- .../reactiveObject/specialCaseObjects.ts | 2 +- src/reactive/types/IArrayValueType.ts | 6 +- src/reactive/types/IReactive.ts | 4 +- src/reactive/types/IReactiveEntity.ts | 2 +- src/reactive/types/IReactiveObject.ts | 4 +- src/reactive/types/IReactiveObjectFlag.ts | 2 +- src/reactive/types/IReactiveValueType.ts | 8 +- src/styling/CSSTemplate.ts | 2 + src/styling/attachCSSProperties.ts | 2 +- src/styling/css.ts | 6 +- src/typeChecks/isPrimitive.ts | 2 +- src/typeChecks/isReactive.ts | 6 +- src/utils/describeType.ts | 2 +- src/utils/id.ts | 2 +- tsconfig.json | 66 - 83 files changed, 417 insertions(+), 3633 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.cjs create mode 100644 compile.ts create mode 100644 deps.ts delete mode 100644 package-lock.json create mode 100644 src/globalTypes/CSSStyleSheet.ts create mode 100644 src/globalTypes/ShadowRoot.ts delete mode 100644 tsconfig.json diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index d4af343..0000000 --- a/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -# don't ever lint node_modules -node_modules -# don't lint build output (make sure it's set to your correct build folder name) -dist -# don't lint nyc coverage output -coverage -.eslintrc.cjs diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index b9c2acb..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,177 +0,0 @@ -module.exports = { - root: true, - parser: "@typescript-eslint/parser", - parserOptions: { - tsconfigRootDir: __dirname, - project: ["./tsconfig.json"], - }, - plugins: [ - "@typescript-eslint", - ], - extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", - ], - rules: { - // https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/docs/rules - "@typescript-eslint/adjacent-overload-signatures": ["warn"], - "@typescript-eslint/array-type": ["warn", { - "default": "generic", - }], - "@typescript-eslint/await-thenable": ["warn"], - "@typescript-eslint/ban-ts-comment": ["warn", { - "ts-expect-error": "allow-with-description", - "ts-ignore": "allow-with-description", - "ts-nocheck": "allow-with-description", - "ts-check": false, - "minimumDescriptionLength": 3, - }], - "brace-style": "off", - "@typescript-eslint/brace-style": ["warn", "1tbs"], - "@typescript-eslint/class-literal-property-style": ["warn", "getters"], - "comma-spacing": "off", - "@typescript-eslint/comma-spacing": ["warn"], - "@typescript-eslint/consistent-type-assertions": ["warn", { - "assertionStyle": "as", - "objectLiteralTypeAssertions": "allow-as-parameter", - }], - "@typescript-eslint/consistent-type-definitions": ["warn", "type"], - "default-param-last": "off", - "@typescript-eslint/default-param-last": ["warn"], - "@typescript-eslint/explicit-member-accessibility": ["warn", { - "accessibility": "no-public", - }], - "func-call-spacing": "off", - "@typescript-eslint/func-call-spacing": ["warn"], - "keyword-spacing": "off", - "@typescript-eslint/keyword-spacing": ["warn"], - "lines-between-class-members": "off", - "@typescript-eslint/member-delimiter-style": ["warn", { - "multiline": { - "delimiter": "comma", - "requireLast": true, - }, - "singleline": { - "delimiter": "comma", - "requireLast": false, - }, - }], - "@typescript-eslint/naming-convention": ["warn", - { - "selector": "default", - "format": ["camelCase"], - }, - { - "selector": "typeLike", - "format": ["PascalCase"], - }, - { - "selector": "memberLike", - "modifiers": ["private"], - "format": ["camelCase"], - "leadingUnderscore": "require", - }, - { - "selector": "parameter", - "format": ["camelCase"], - "leadingUnderscore": "allow", - }, - { - "selector": "memberLike", - "modifiers": ["private"], - "format": ["camelCase"], - "leadingUnderscore": "require", - }, - { - "selector": "class", - "format": ["PascalCase"], - }, - { - "selector": "typeAlias", - "format": ["PascalCase"], - "custom": { - "regex": "^T[A-Z]", - "match": true, - }, - }, - ], - "no-array-constructor": "off", - "@typescript-eslint/no-array-constructor": ["warn"], - "@typescript-eslint/no-confusing-non-null-assertion": ["warn"], - "no-dupe-class-members": "off", - "@typescript-eslint/no-dupe-class-members": ["error"], - "@typescript-eslint/no-dynamic-delete": ["warn"], - "@typescript-eslint/no-empty-function": ["warn", { - "allow": [ - "setters", // Required for custom elements - ], - }], - "@typescript-eslint/no-empty-interface": ["warn"], - "@typescript-eslint/no-explicit-any": ["off"], - "@typescript-eslint/no-extra-non-null-assertion": ["warn"], - "no-extra-semi": "off", - "@typescript-eslint/no-extra-semi": ["warn"], - "@typescript-eslint/no-extraneous-class": ["warn"], - "@typescript-eslint/no-floating-promises": ["warn"], - "@typescript-eslint/no-for-in-array": ["warn"], - "@typescript-eslint/no-inferrable-types": ["warn"], - "no-invalid-this": "off", - // Rule is buggy with instance fields. - // "@typescript-eslint/no-invalid-this": ["warn"], - "@typescript-eslint/no-invalid-void-type": ["warn", { - "allowInGenericTypeArguments": true, - }], - "no-loss-of-precision": "off", - "@typescript-eslint/no-loss-of-precision": ["error"], - "@typescript-eslint/no-misused-new": ["error"], - "@typescript-eslint/no-misused-promises": ["error"], - "@typescript-eslint/no-namespace": ["warn"], - "@typescript-eslint/no-non-null-asserted-optional-chain": ["warn"], - "@typescript-eslint/no-non-null-assertion": ["off"], - "@typescript-eslint/no-parameter-properties": ["warn"], - "@typescript-eslint/no-require-imports": ["error"], - "@typescript-eslint/no-this-alias": ["warn"], - "@typescript-eslint/no-throw-literal": ["error"], - "@typescript-eslint/no-unnecessary-boolean-literal-compare": ["warn"], - "@typescript-eslint/no-unnecessary-condition": ["warn", { - "allowConstantLoopConditions": true, - }], - "@typescript-eslint/no-unnecessary-type-arguments": ["warn"], - "@typescript-eslint/no-unnecessary-type-assertion": ["warn"], - "@typescript-eslint/no-unsafe-assignment": ["warn"], - "@typescript-eslint/no-unsafe-call": ["warn"], - "@typescript-eslint/no-unsafe-return": ["warn"], - "@typescript-eslint/no-unused-vars-experimental": ["warn"], - "@typescript-eslint/no-unused-vars": ["off"], - "no-useless-constructor": "off", - "@typescript-eslint/no-useless-constructor": ["warn"], - "@typescript-eslint/prefer-as-const": ["warn"], - "@typescript-eslint/prefer-for-of": ["warn"], - "@typescript-eslint/prefer-function-type": ["warn"], - "@typescript-eslint/prefer-nullish-coalescing": ["warn"], - "@typescript-eslint/prefer-optional-chain": ["warn"], - // "@typescript-eslint/prefer-readonly-parameter-types": ["warn"], - "@typescript-eslint/prefer-readonly": ["warn"], - "@typescript-eslint/prefer-reduce-type-parameter": ["warn"], - "@typescript-eslint/prefer-regexp-exec": ["warn"], - "@typescript-eslint/prefer-string-starts-ends-with": ["warn"], - "quotes": "off", - "@typescript-eslint/quotes": ["warn", "double"], - "@typescript-eslint/require-array-sort-compare": ["warn"], - "@typescript-eslint/require-await": ["warn"], - "@typescript-eslint/restrict-plus-operands": ["error"], - "no-return-await": "off", - "@typescript-eslint/return-await": ["warn", "always"], - "semi": "off", - "@typescript-eslint/semi": ["warn", "always"], - "space-before-function-paren": "off", - "@typescript-eslint/space-before-function-paren": ["warn"], - "@typescript-eslint/switch-exhaustiveness-check": ["warn"], - "@typescript-eslint/triple-slash-reference": ["error"], - "@typescript-eslint/type-annotation-spacing": ["warn"], - "@typescript-eslint/unbound-method": ["warn"], - "@typescript-eslint/unified-signatures": ["warn"], - }, -}; diff --git a/compile.ts b/compile.ts new file mode 100644 index 0000000..269ce10 --- /dev/null +++ b/compile.ts @@ -0,0 +1,175 @@ +import { ensureDirSync, fromFileUrlWin, relativeWin } from "./deps.ts"; + +const encoder = new TextEncoder(); + +function checkDiagnostics(diagnostics: Deno.Diagnostic[]): string | void { + // Check if there were errors when bundling the clients code + if (diagnostics && diagnostics.length) { + const diagnostic = diagnostics[0]; // we only really care about throwing the first error + const filename = diagnostic.fileName; + const start = diagnostic.start; + const messageText = diagnostic.messageText ?? + // @ts-ignore Deno tells us `messageText` does not exist on `messageChain`, but it 100% is (bug with deno) + diagnostic.messageChain!.messageText; + const sourceLine = diagnostic.sourceLine; + const brief = diagnostic.messageChain + ? // @ts-ignore Deno tells us `messageText` does not exist on `messageChain`, but it 100% is (bug with deno) + diagnostic.messageChain.next![0].messageText + : ""; + if (filename && start) { + return `${filename}:${start.line}:${start.character} - ${messageText}\n${brief}\n${sourceLine}\n`; + } else { + return `${messageText}\n${brief}\n`; + } + } +} + +async function emit(file: string): Promise<{ + diagnostics: Deno.Diagnostic[]; + files: Record; +}> { + const { diagnostics, files } = await Deno.emit(file, { + compilerOptions: { + declaration: true, + sourceMap: true, + target: "es2020", + module: "esnext", + lib: [ + "dom", + "DOM.Iterable", + "esnext", + ], + removeComments: true, + downlevelIteration: true, + useDefineForClassFields: true, + strict: true, + noImplicitReturns: true, + noFallthroughCasesInSwitch: true, + importsNotUsedAsValues: "error", + paths: { + "/dist/*": ["src/*"], + }, + baseUrl: "./", + }, + }); + return { + diagnostics, + files, + }; +} + +/** + * Write a file to the dist directory. Replaces the following in the `filename`: + * - `src` with `dist` + * - `.ts.d.ts` with `.d.ts` + * - `.ts.js` with `.js` + * + * @param filename The file url of an emitted file. Must be the result of `emit` + * @param fileContent - The file content associated with `files[filename]` + */ +function write(filename: string, fileContent: string): void { + const outPath = filename.replace("src", "dist").replace(".ts.js", ".js") + .replace(".ts.d.ts", ".d.ts"); + if (outPath.endsWith(".d.ts") || outPath.endsWith(".js")) { // ensure directory(s) file is in, exists + const pathSplit = outPath.split("/"); + pathSplit.pop(); + const parentDirOfFile = pathSplit.join("/"); + const validPath = Deno.build.os === "windows" + ? fromFileUrlWin(parentDirOfFile) + : parentDirOfFile; // because `ensureDirSync` will throw an error if the path is a file url on windows + ensureDirSync(validPath); + } + + // Because imports inside the files are still using a .ts extension, we're going to make them use .js: + fileContent = fileContent.replace( + /import { ([a-zA-Z].*) } from "(.*)";/gm, + (_str, importValues, fileImportedFrom) => { + const jsImport = fileImportedFrom.replace(".ts", ".js"); + return `import { ${importValues} } from \"${jsImport}\";`; + }, + ); + fileContent = fileContent.replace( + /export { ([a-zA-Z].*) } from "(.*)";/gm, + (_str, importValues, fileImportedFrom) => { + const jsImport = fileImportedFrom.replace(".ts", ".js"); + return `export { ${importValues} } from \"${jsImport}\";`; + }, + ); + fileContent = fileContent.replace( + /import \"(.*)\";/gm, + (_str, importValue) => { + const jsRef = importValue.replace(".ts", ".js"); + return `import \"${jsRef}\";`; + }, + ); + fileContent = fileContent.replace( + /import\(\"(.*)\"\)/gm, + (_str, importValue) => { + const jsRef = importValue.replace(".ts", ".js"); + return `import(\"${jsRef}\")`; + }, + ); + /// + + const validPath = Deno.build.os === "windows" + ? fromFileUrlWin(outPath) + : outPath; // Same again + Deno.writeFileSync( + validPath, + encoder.encode(fileContent), + ); +} + +async function compile(file: string): Promise { + const { diagnostics, files } = await emit(file); + + const errorMsg = checkDiagnostics(diagnostics); + if (errorMsg) { + return errorMsg; + } + + const fileKeys = Object.keys(files).filter((filename) => { + if (filename.includes(".map")) { + return false; + } + return true; + }); + + // Write file + for (const filename of fileKeys) { + write(filename, files[filename]); + } + console.log("Finished compilation"); +} + +// +// +// + +console.log("Starting compilation..."); + +const errorMsg = await compile("./src/mod.ts"); +if (errorMsg) { + throw new Error(errorMsg); +} + +const args = Deno.args; +if (args[0] === "--watch") { + console.log("Watching..."); + const watcher = Deno.watchFs("./src"); + for await (const event of watcher) { + if (event.kind !== "modify") { + continue; + } + const paths = event.paths; + const path = Deno.build.os === "windows" + ? relativeWin(".", paths[0]) + : paths[0]; + const msg = await compile(path); + if (msg) { + console.error(msg); + } else { + console.log("Compiled " + path); + } + } +} diff --git a/deps.ts b/deps.ts new file mode 100644 index 0000000..55256c1 --- /dev/null +++ b/deps.ts @@ -0,0 +1,3 @@ +export { ensureDirSync } from "https://deno.land/std@0.97.0/fs/ensure_dir.ts" +export { fromFileUrl as fromFileUrlUnix } from "https://deno.land/std@0.97.0/path/posix.ts" +export { fromFileUrl as fromFileUrlWin, relative as relativeWin } from "https://deno.land/std@0.97.0/path/win32.ts" \ No newline at end of file diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index e9e8514..0000000 --- a/package-lock.json +++ /dev/null @@ -1,3157 +0,0 @@ -{ - "name": "destiny", - "version": "0.6.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "destiny", - "version": "0.6.0", - "license": "OSL-3.0", - "devDependencies": { - "@typescript-eslint/eslint-plugin": "^4.26.0", - "@typescript-eslint/parser": "^4.26.0", - "eslint": "^7.27.0", - "typescript": "^4.3.2" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.10.4" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", - "dev": true - }, - "node_modules/@babel/highlight": { - "version": "7.13.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.10.tgz", - "integrity": "sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.12.11", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.1.tgz", - "integrity": "sha512-5v7TDE9plVhvxQeWLXDTvFvJBdH6pEsdnl2g/dAptmuFEPedQ4Erq5rsDsX+mvAM610IhNaO2W5V1dOOnDKxkQ==", - "dev": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "dev": true, - "dependencies": { - "type-fest": "^0.8.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@eslint/eslintrc/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", - "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.4", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", - "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", - "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.4", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@types/json-schema": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", - "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", - "dev": true - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.26.0.tgz", - "integrity": "sha512-yA7IWp+5Qqf+TLbd8b35ySFOFzUfL7i+4If50EqvjT6w35X8Lv0eBHb6rATeWmucks37w+zV+tWnOXI9JlG6Eg==", - "dev": true, - "dependencies": { - "@typescript-eslint/experimental-utils": "4.26.0", - "@typescript-eslint/scope-manager": "4.26.0", - "debug": "^4.3.1", - "functional-red-black-tree": "^1.0.1", - "lodash": "^4.17.21", - "regexpp": "^3.1.0", - "semver": "^7.3.5", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^4.0.0", - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/experimental-utils": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.26.0.tgz", - "integrity": "sha512-TH2FO2rdDm7AWfAVRB5RSlbUhWxGVuxPNzGT7W65zVfl8H/WeXTk1e69IrcEVsBslrQSTDKQSaJD89hwKrhdkw==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.26.0", - "@typescript-eslint/types": "4.26.0", - "@typescript-eslint/typescript-estree": "4.26.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "*" - } - }, - "node_modules/@typescript-eslint/experimental-utils/node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.26.0.tgz", - "integrity": "sha512-b4jekVJG9FfmjUfmM4VoOItQhPlnt6MPOBUL0AQbiTmm+SSpSdhHYlwayOm4IW9KLI/4/cRKtQCmDl1oE2OlPg==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "4.26.0", - "@typescript-eslint/types": "4.26.0", - "@typescript-eslint/typescript-estree": "4.26.0", - "debug": "^4.3.1" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.26.0.tgz", - "integrity": "sha512-G6xB6mMo4xVxwMt5lEsNTz3x4qGDt0NSGmTBNBPJxNsrTXJSm21c6raeYroS2OwQsOyIXqKZv266L/Gln1BWqg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "4.26.0", - "@typescript-eslint/visitor-keys": "4.26.0" - }, - "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/types": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.26.0.tgz", - "integrity": "sha512-rADNgXl1kS/EKnDr3G+m7fB9yeJNnR9kF7xMiXL6mSIWpr3Wg5MhxyfEXy/IlYthsqwBqHOr22boFbf/u6O88A==", - "dev": true, - "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.26.0.tgz", - "integrity": "sha512-GHUgahPcm9GfBuy3TzdsizCcPjKOAauG9xkz9TR8kOdssz2Iz9jRCSQm6+aVFa23d5NcSpo1GdHGSQKe0tlcbg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "4.26.0", - "@typescript-eslint/visitor-keys": "4.26.0", - "debug": "^4.3.1", - "globby": "^11.0.3", - "is-glob": "^4.0.1", - "semver": "^7.3.5", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.26.0.tgz", - "integrity": "sha512-cw4j8lH38V1ycGBbF+aFiLUls9Z0Bw8QschP3mkth50BbWzgFS33ISIgBzUMuQ2IdahoEv/rXstr8Zhlz4B1Zg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "4.26.0", - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", - "dev": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "dependencies": { - "ansi-colors": "^4.1.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/eslint": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.27.0.tgz", - "integrity": "sha512-JZuR6La2ZF0UD384lcbnd0Cgg6QJjiCwhMD6eU4h/VGPcVGwawNNzKU41tgokGXnfjOOyI6QIffthhJTPzzuRA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.1", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "dev": true, - "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-glob": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", - "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "node_modules/fastq": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", - "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", - "dev": true - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, - "node_modules/get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globals": { - "version": "13.7.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.7.0.tgz", - "integrity": "sha512-Aipsz6ZKRxa/xQkZhNg0qIWXT6x6rD46f6x/PCnBomlttdIyAPak4YD9jTmKpZ72uROSMU87qJtcgpgHaVchiA==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globby": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz", - "integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globby/node_modules/ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/has-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/is-boolean-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.0.tgz", - "integrity": "sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-number-object": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz", - "integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-string": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", - "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "node_modules/lodash.flatten": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", - "dev": true - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", - "dev": true - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", - "dev": true, - "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/table": { - "version": "6.0.9", - "resolved": "https://registry.npmjs.org/table/-/table-6.0.9.tgz", - "integrity": "sha512-F3cLs9a3hL1Z7N4+EkSscsel3z55XT950AvB05bwayrNg5T1/gykXtigioTAjbltvbMSJvvhFCbnf6mX+ntnJQ==", - "dev": true, - "dependencies": { - "ajv": "^8.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "lodash.clonedeep": "^4.5.0", - "lodash.flatten": "^4.4.0", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.0.2.tgz", - "integrity": "sha512-V0HGxJd0PiDF0ecHYIesTOqfd1gJguwQUOYfMfAWnRsWQEXfc5ifbUFhD3Wjc+O+y7VAqL+g07prq9gHQ/JOZQ==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/typescript": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.2.tgz", - "integrity": "sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", - "dev": true - }, - "@babel/highlight": { - "version": "7.13.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.10.tgz", - "integrity": "sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.12.11", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@eslint/eslintrc": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.1.tgz", - "integrity": "sha512-5v7TDE9plVhvxQeWLXDTvFvJBdH6pEsdnl2g/dAptmuFEPedQ4Erq5rsDsX+mvAM610IhNaO2W5V1dOOnDKxkQ==", - "dev": true, - "requires": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^12.1.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, - "dependencies": { - "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "dev": true, - "requires": { - "type-fest": "^0.8.1" - } - }, - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true - } - } - }, - "@nodelib/fs.scandir": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", - "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.4", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", - "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", - "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.4", - "fastq": "^1.6.0" - } - }, - "@types/json-schema": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", - "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", - "dev": true - }, - "@typescript-eslint/eslint-plugin": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.26.0.tgz", - "integrity": "sha512-yA7IWp+5Qqf+TLbd8b35ySFOFzUfL7i+4If50EqvjT6w35X8Lv0eBHb6rATeWmucks37w+zV+tWnOXI9JlG6Eg==", - "dev": true, - "requires": { - "@typescript-eslint/experimental-utils": "4.26.0", - "@typescript-eslint/scope-manager": "4.26.0", - "debug": "^4.3.1", - "functional-red-black-tree": "^1.0.1", - "lodash": "^4.17.21", - "regexpp": "^3.1.0", - "semver": "^7.3.5", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/experimental-utils": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.26.0.tgz", - "integrity": "sha512-TH2FO2rdDm7AWfAVRB5RSlbUhWxGVuxPNzGT7W65zVfl8H/WeXTk1e69IrcEVsBslrQSTDKQSaJD89hwKrhdkw==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.26.0", - "@typescript-eslint/types": "4.26.0", - "@typescript-eslint/typescript-estree": "4.26.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" - }, - "dependencies": { - "eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^2.0.0" - } - } - } - }, - "@typescript-eslint/parser": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.26.0.tgz", - "integrity": "sha512-b4jekVJG9FfmjUfmM4VoOItQhPlnt6MPOBUL0AQbiTmm+SSpSdhHYlwayOm4IW9KLI/4/cRKtQCmDl1oE2OlPg==", - "dev": true, - "requires": { - "@typescript-eslint/scope-manager": "4.26.0", - "@typescript-eslint/types": "4.26.0", - "@typescript-eslint/typescript-estree": "4.26.0", - "debug": "^4.3.1" - } - }, - "@typescript-eslint/scope-manager": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.26.0.tgz", - "integrity": "sha512-G6xB6mMo4xVxwMt5lEsNTz3x4qGDt0NSGmTBNBPJxNsrTXJSm21c6raeYroS2OwQsOyIXqKZv266L/Gln1BWqg==", - "dev": true, - "requires": { - "@typescript-eslint/types": "4.26.0", - "@typescript-eslint/visitor-keys": "4.26.0" - } - }, - "@typescript-eslint/types": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.26.0.tgz", - "integrity": "sha512-rADNgXl1kS/EKnDr3G+m7fB9yeJNnR9kF7xMiXL6mSIWpr3Wg5MhxyfEXy/IlYthsqwBqHOr22boFbf/u6O88A==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.26.0.tgz", - "integrity": "sha512-GHUgahPcm9GfBuy3TzdsizCcPjKOAauG9xkz9TR8kOdssz2Iz9jRCSQm6+aVFa23d5NcSpo1GdHGSQKe0tlcbg==", - "dev": true, - "requires": { - "@typescript-eslint/types": "4.26.0", - "@typescript-eslint/visitor-keys": "4.26.0", - "debug": "^4.3.1", - "globby": "^11.0.3", - "is-glob": "^4.0.1", - "semver": "^7.3.5", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "4.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.26.0.tgz", - "integrity": "sha512-cw4j8lH38V1ycGBbF+aFiLUls9Z0Bw8QschP3mkth50BbWzgFS33ISIgBzUMuQ2IdahoEv/rXstr8Zhlz4B1Zg==", - "dev": true, - "requires": { - "@typescript-eslint/types": "4.26.0", - "eslint-visitor-keys": "^2.0.0" - } - }, - "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true - }, - "acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", - "dev": true, - "requires": {} - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "requires": { - "ansi-colors": "^4.1.1" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "eslint": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.27.0.tgz", - "integrity": "sha512-JZuR6La2ZF0UD384lcbnd0Cgg6QJjiCwhMD6eU4h/VGPcVGwawNNzKU41tgokGXnfjOOyI6QIffthhJTPzzuRA==", - "dev": true, - "requires": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.1", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "dependencies": { - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - } - } - }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } - } - }, - "eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", - "dev": true - }, - "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "dev": true, - "requires": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, - "requires": { - "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - } - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "requires": { - "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - } - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "fast-glob": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", - "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "fastq": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", - "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "requires": { - "flat-cache": "^3.0.4" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - } - }, - "flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", - "dev": true - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, - "get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" - } - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "globals": { - "version": "13.7.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.7.0.tgz", - "integrity": "sha512-Aipsz6ZKRxa/xQkZhNg0qIWXT6x6rD46f6x/PCnBomlttdIyAPak4YD9jTmKpZ72uROSMU87qJtcgpgHaVchiA==", - "dev": true, - "requires": { - "type-fest": "^0.20.2" - } - }, - "globby": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz", - "integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" - }, - "dependencies": { - "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", - "dev": true - } - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "has-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", - "dev": true - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "is-boolean-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.0.tgz", - "integrity": "sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA==", - "dev": true, - "requires": { - "call-bind": "^1.0.0" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-number-object": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz", - "integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==", - "dev": true - }, - "is-string": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", - "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "lodash.flatten": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", - "dev": true - }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", - "dev": true - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - } - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "requires": { - "callsites": "^3.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", - "dev": true - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true - }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, - "regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", - "dev": true - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "table": { - "version": "6.0.9", - "resolved": "https://registry.npmjs.org/table/-/table-6.0.9.tgz", - "integrity": "sha512-F3cLs9a3hL1Z7N4+EkSscsel3z55XT950AvB05bwayrNg5T1/gykXtigioTAjbltvbMSJvvhFCbnf6mX+ntnJQ==", - "dev": true, - "requires": { - "ajv": "^8.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "lodash.clonedeep": "^4.5.0", - "lodash.flatten": "^4.4.0", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0" - }, - "dependencies": { - "ajv": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.0.2.tgz", - "integrity": "sha512-V0HGxJd0PiDF0ecHYIesTOqfd1gJguwQUOYfMfAWnRsWQEXfc5ifbUFhD3Wjc+O+y7VAqL+g07prq9gHQ/JOZQ==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - } - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1" - } - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true - }, - "typescript": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.2.tgz", - "integrity": "sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==", - "dev": true - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } - } -} diff --git a/package.json b/package.json index 3f16089..c627446 100644 --- a/package.json +++ b/package.json @@ -4,19 +4,12 @@ "version": "0.6.0", "main": "./dist/examples/main.js", "type": "module", - "devDependencies": { - "@typescript-eslint/eslint-plugin": "^4.26.0", - "@typescript-eslint/parser": "^4.26.0", - "eslint": "^7.27.0", - "typescript": "^4.3.2" - }, "scripts": { - "lint": "npm run lint:types && npm run lint:code", - "lint:code": "eslint src", - "lint:types": "tsc --noEmit", + "lint": "deno lint --ignore=dist", + "fmt": "deno fmt --ignore=dist", "test": "echo \"Error: no test specified\" && exit 1", - "compile": "tsc", - "watch": "tsc -w" + "compile": "deno run --allow-read=. --allow-write=dist --unstable compile.ts", + "watch": "deno run --allow-read=. --allow-write=dist --unstable compile.ts --watch" }, "keywords": [ "javascript", diff --git a/src/_examples/components/app-root.ts b/src/_examples/components/app-root.ts index 7c21aab..6528d80 100644 --- a/src/_examples/components/app-root.ts +++ b/src/_examples/components/app-root.ts @@ -1,6 +1,6 @@ -import { Component, xml, css } from "/dist/mod.js"; +import { Component, xml, css } from "../../mod.ts"; -import { TabView } from "./tab-view.js"; +import { TabView } from "./tab-view.ts"; export class AppRoot extends Component { static styles = css` diff --git a/src/_examples/components/array-demo.ts b/src/_examples/components/array-demo.ts index 2ec55d8..acfb5c3 100644 --- a/src/_examples/components/array-demo.ts +++ b/src/_examples/components/array-demo.ts @@ -1,4 +1,4 @@ -import { Component, reactive, xml, css, computed } from "/dist/mod.js"; +import { Component, reactive, xml, css, computed } from "../../mod.ts"; const randomColor = () => ( "#" + diff --git a/src/_examples/components/async-component.ts b/src/_examples/components/async-component.ts index 78d90fc..8fbcf56 100644 --- a/src/_examples/components/async-component.ts +++ b/src/_examples/components/async-component.ts @@ -1,4 +1,4 @@ -import { Component, xml } from "/dist/mod.js"; +import { Component, xml } from "../../mod.ts"; export class AsyncComponent extends Component { template = xml` diff --git a/src/_examples/components/async-demo.ts b/src/_examples/components/async-demo.ts index 6beaeea..b70a72d 100644 --- a/src/_examples/components/async-demo.ts +++ b/src/_examples/components/async-demo.ts @@ -1,12 +1,12 @@ -import { Component, xml } from "/dist/mod.js"; +import { Component, xml } from "../../mod.ts"; export class AsyncDemo extends Component { - #AsyncComponent = import("./async-component.js"); + #AsyncComponent = import("./async-component.ts"); template = xml` This is not a super exciting demo to look at — I'll cook up a nicer async demo later.
- <${import("./forms/text-field.js")} value="testing" /> + <${import("./forms/text-field.ts")} value="testing" />
<${this.#AsyncComponent}> Qux diff --git a/src/_examples/components/forms/text-field.ts b/src/_examples/components/forms/text-field.ts index 790c706..671f80f 100644 --- a/src/_examples/components/forms/text-field.ts +++ b/src/_examples/components/forms/text-field.ts @@ -1,5 +1,5 @@ -import { inputStyles } from "../inputStyles.js"; -import { Component, xml, Ref } from "/dist/mod.js"; +import { inputStyles } from "../inputStyles.ts"; +import { Component, xml, Ref } from "../../../mod.ts"; /** * An example of a component that forwards its props to a child. diff --git a/src/_examples/components/hash-router.ts b/src/_examples/components/hash-router.ts index 3071a3c..b2c3d77 100644 --- a/src/_examples/components/hash-router.ts +++ b/src/_examples/components/hash-router.ts @@ -1,4 +1,4 @@ -import { Component, reactive, xml, ReactivePrimitive } from "/dist/mod.js"; +import { Component, reactive, xml, ReactivePrimitive } from "../../mod.ts"; function getHashRoute ( url: string, diff --git a/src/_examples/components/inputStyles.ts b/src/_examples/components/inputStyles.ts index e71e3fe..a2dc6aa 100644 --- a/src/_examples/components/inputStyles.ts +++ b/src/_examples/components/inputStyles.ts @@ -1,4 +1,4 @@ -import { css } from "/dist/mod.js"; +import { css } from "../../mod.ts"; export const inputStyles = css` input:not([type=checkbox]) { diff --git a/src/_examples/components/tab-view.ts b/src/_examples/components/tab-view.ts index a91470a..6192684 100644 --- a/src/_examples/components/tab-view.ts +++ b/src/_examples/components/tab-view.ts @@ -1,6 +1,6 @@ -import { Component, computed, xml, css, classNames } from "/dist/mod.js"; +import { Component, computed, xml, css, classNames } from "../../mod.ts"; -import { route, HashRouter } from "./hash-router.js"; +import { route, HashRouter } from "./hash-router.ts"; export class TabView extends Component { #tabs = [ diff --git a/src/_examples/components/time-diff.ts b/src/_examples/components/time-diff.ts index 99b0921..cec8806 100644 --- a/src/_examples/components/time-diff.ts +++ b/src/_examples/components/time-diff.ts @@ -1,6 +1,6 @@ -import { Component, xml, reactive, computed } from "/dist/mod.js"; +import { Component, xml, reactive, computed } from "../../mod.ts"; -import { inputStyles } from "./inputStyles.js"; +import { inputStyles } from "./inputStyles.ts"; function formatTimeFragment ( input: number, diff --git a/src/_examples/components/to-do/_to-do.ts b/src/_examples/components/to-do/_to-do.ts index 4ac36c2..f658942 100644 --- a/src/_examples/components/to-do/_to-do.ts +++ b/src/_examples/components/to-do/_to-do.ts @@ -1,8 +1,8 @@ -import { Component, xml, css, reactive } from "/dist/mod.js"; +import { Component, xml, css, reactive } from "../../../mod.ts"; -import { animateIn, animateOut } from "./animations.js"; -import { TaskItem } from "./task-item.js"; -import { inputStyles } from "../inputStyles.js"; +import { animateIn, animateOut } from "./animations.ts"; +import { TaskItem } from "./task-item.ts"; +import { inputStyles } from "../inputStyles.ts"; type TInputChangeEvent = InputEvent & { currentTarget: HTMLInputElement, diff --git a/src/_examples/components/to-do/task-item.ts b/src/_examples/components/to-do/task-item.ts index 2efb4ab..966618b 100644 --- a/src/_examples/components/to-do/task-item.ts +++ b/src/_examples/components/to-do/task-item.ts @@ -1,7 +1,7 @@ -import { Component, xml, css } from "/dist/mod.js"; -import type { TReactiveObject } from "/dist/mod.js"; +import { Component, xml, css } from "../../../mod.ts"; +import type { TReactiveObject } from "../../../mod.ts"; -import { inputStyles } from "../inputStyles.js"; +import { inputStyles } from "../inputStyles.ts"; export class TaskItem extends Component<{ item: TReactiveObject<{ diff --git a/src/_examples/components/visitor-demo.ts b/src/_examples/components/visitor-demo.ts index 45aa3bc..eb71e4d 100644 --- a/src/_examples/components/visitor-demo.ts +++ b/src/_examples/components/visitor-demo.ts @@ -1,6 +1,6 @@ -import { Component, xml, reactive } from "/dist/mod.js"; +import { Component, xml, reactive } from "../../mod.ts"; -import { inputStyles } from "./inputStyles.js"; +import { inputStyles } from "./inputStyles.ts"; export class VisitorDemo extends Component { #who = reactive("visitor"); diff --git a/src/_examples/components/window-manager/TWindow.ts b/src/_examples/components/window-manager/TWindow.ts index 8cd816c..7e605b2 100644 --- a/src/_examples/components/window-manager/TWindow.ts +++ b/src/_examples/components/window-manager/TWindow.ts @@ -1,4 +1,4 @@ -import type { ReactivePrimitive, TemplateResult } from "/dist/mod.js"; +import type { ReactivePrimitive, TemplateResult } from "../../../mod.ts"; export type TWindow = { header: string, diff --git a/src/_examples/components/window-manager/_window-manager.ts b/src/_examples/components/window-manager/_window-manager.ts index 65a9e9f..ef0661d 100644 --- a/src/_examples/components/window-manager/_window-manager.ts +++ b/src/_examples/components/window-manager/_window-manager.ts @@ -1,7 +1,7 @@ -import { Component, xml, css, reactive, ReactivePrimitive } from "/dist/mod.js"; +import { Component, xml, css, reactive, ReactivePrimitive } from "../../../mod.ts"; -import { Window } from "./window.js"; -import type { TWindow } from "./TWindow.js"; +import { Window } from "./window.ts"; +import type { TWindow } from "./TWindow.ts"; type TDirection = "n" | "s" | "e" | "w" | "ne" | "se" | "sw" | "nw"; diff --git a/src/_examples/components/window-manager/window.ts b/src/_examples/components/window-manager/window.ts index b8bc495..70468bb 100644 --- a/src/_examples/components/window-manager/window.ts +++ b/src/_examples/components/window-manager/window.ts @@ -1,6 +1,6 @@ -import { Component, xml, css, computed } from "/dist/mod.js"; +import { Component, xml, css, computed } from "../../../mod.ts"; -import type { TWindow } from "./TWindow"; +import type { TWindow } from "./TWindow.ts"; export class Window extends Component<{ props: TWindow, diff --git a/src/_examples/main.ts b/src/_examples/main.ts index 64ac75e..db343bb 100644 --- a/src/_examples/main.ts +++ b/src/_examples/main.ts @@ -1,5 +1,5 @@ -import { register } from "/dist/mod.js"; +import { register } from "../mod.ts"; -import { AppRoot } from "./components/app-root.js"; +import { AppRoot } from "./components/app-root.ts"; register(AppRoot); diff --git a/src/componentLogic/Component.ts b/src/componentLogic/Component.ts index 3d0276c..d7fbca5 100644 --- a/src/componentLogic/Component.ts +++ b/src/componentLogic/Component.ts @@ -1,14 +1,14 @@ -import { register, xml, attachCSSProperties } from "../mod.js"; -import { deferredElements } from "../parsing/deferredElements.js"; -import { assignElementData } from "../parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/_assignElementData.js"; -import { supportsAdoptedStyleSheets } from "../styling/supportsAdoptedStyleSheets.js"; -import { arrayWrap } from "../utils/arrayWrap.js"; -import { getElementData } from "./elementData.js"; -import type { Ref, RefPromise } from "./Ref.js"; -import type { Renderable } from "../parsing/Renderable.js"; -import type { Slot } from "../parsing/Slot.js"; -import type { ReadonlyReactivePrimitive } from "../reactive/ReactivePrimitive.js"; -import type { CSSTemplate } from "../styling/CSSTemplate.js"; +import { register, xml, attachCSSProperties } from "../mod.ts"; +import { deferredElements } from "../parsing/deferredElements.ts"; +import { assignElementData } from "../parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/_assignElementData.ts"; +import { supportsAdoptedStyleSheets } from "../styling/supportsAdoptedStyleSheets.ts"; +import { arrayWrap } from "../utils/arrayWrap.ts"; +import { getElementData } from "./elementData.ts"; +import type { Ref, RefPromise } from "./Ref.ts"; +import type { Renderable } from "../parsing/Renderable.ts"; +import type { Slot } from "../parsing/Slot.ts"; +import type { ReadonlyReactivePrimitive } from "../reactive/ReactivePrimitive.ts"; +import type { CSSTemplate } from "../styling/CSSTemplate.ts"; // @ts-ignore I don't know how to describe this type correctly // eslint-disable-next-line @@ -45,6 +45,7 @@ export class Component extends HTMLElement { ); if (supportsAdoptedStyleSheets) { + // @ts-ignore This does exist, but lib doesn't contain the declaration yet. We also used `destiny/src/globalThis.d.ts` to provide the typings when using Node, but there doesn't seem to be a way to include this in the `emit` shadow.adoptedStyleSheets = arrayWrap(new.target.styles).map(v => v.styleSheet); } else { shadow.append(...arrayWrap(new.target.styles).map(v => v.styleElement)); diff --git a/src/componentLogic/DestinyFallback.ts b/src/componentLogic/DestinyFallback.ts index ed9d190..175ba7e 100644 --- a/src/componentLogic/DestinyFallback.ts +++ b/src/componentLogic/DestinyFallback.ts @@ -1,7 +1,7 @@ -import { isComponent } from "./isComponent.js"; -import { xml, Ref, Component } from "../mod.js"; -import { getElementData } from "./elementData.js"; -import { describeType } from "../utils/describeType.js"; +import { isComponent } from "./isComponent.ts"; +import { xml, Ref, Component } from "../mod.ts"; +import { getElementData } from "./elementData.ts"; +import { describeType } from "../utils/describeType.ts"; export class DestinyFallback extends Component { static captureProps = true; diff --git a/src/componentLogic/elementData.ts b/src/componentLogic/elementData.ts index 5eed065..90d120b 100644 --- a/src/componentLogic/elementData.ts +++ b/src/componentLogic/elementData.ts @@ -1,4 +1,4 @@ -import type { TElementData } from "../parsing/hookSlotsUp/hookAttributeSlotsUp/TElementData"; +import type { TElementData } from "../parsing/hookSlotsUp/hookAttributeSlotsUp/TElementData.ts"; export const elementData = new WeakMap(); diff --git a/src/componentLogic/isComponent.ts b/src/componentLogic/isComponent.ts index fe94a29..7326b4d 100644 --- a/src/componentLogic/isComponent.ts +++ b/src/componentLogic/isComponent.ts @@ -1,4 +1,4 @@ -import { Component } from "./Component.js"; +import { Component } from "./Component.ts"; export function isComponent ( input: unknown, diff --git a/src/componentLogic/register.ts b/src/componentLogic/register.ts index 5867da3..e9bd575 100644 --- a/src/componentLogic/register.ts +++ b/src/componentLogic/register.ts @@ -1,6 +1,6 @@ -import { pseudoRandomIdGenerator } from "../utils/id.js"; -import { pascalToKebab } from "../utils/pascalToKebab.js"; -import type { Component } from "./Component.js"; +import { pseudoRandomIdGenerator } from "../utils/id.ts"; +import { pascalToKebab } from "../utils/pascalToKebab.ts"; +import type { Component } from "./Component.ts"; const pseudoRandomId = pseudoRandomIdGenerator(); diff --git a/src/globalThis.d.ts b/src/globalThis.d.ts index 3c6bdd1..e076622 100644 --- a/src/globalThis.d.ts +++ b/src/globalThis.d.ts @@ -1,13 +1,5 @@ /* eslint-disable @typescript-eslint/consistent-type-definitions */ -interface CSSStyleSheet { - replace(cssText: string): void, -} - -interface ShadowRoot { - adoptedStyleSheets: ReadonlyArray, -} - interface ImportMeta { url: string, } diff --git a/src/globalTypes/CSSStyleSheet.ts b/src/globalTypes/CSSStyleSheet.ts new file mode 100644 index 0000000..e0c2b0b --- /dev/null +++ b/src/globalTypes/CSSStyleSheet.ts @@ -0,0 +1,7 @@ +export {} + +declare global { + interface CSSStyleSheet { + replace: (cssText: string) => void + } + } \ No newline at end of file diff --git a/src/globalTypes/ShadowRoot.ts b/src/globalTypes/ShadowRoot.ts new file mode 100644 index 0000000..2f70f60 --- /dev/null +++ b/src/globalTypes/ShadowRoot.ts @@ -0,0 +1,9 @@ +import "./CSSStyleSheet.ts" + +export {} + +declare global { + interface ShadowRoot { + adoptedStyleSheets: ReadonlyArray, + } +} \ No newline at end of file diff --git a/src/mod.ts b/src/mod.ts index c825568..304ac3e 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -1,22 +1,31 @@ -export { ReactivePrimitive } from "./reactive/ReactivePrimitive.js"; -export { ReadonlyReactivePrimitive } from "./reactive/ReactivePrimitive.js"; -export { ReactiveArray } from "./reactive/ReactiveArray/_ReactiveArray.js"; -export { ReadonlyReactiveArray } from "./reactive/ReactiveArray/_ReactiveArray.js"; -export { reactiveObject } from "./reactive/reactiveObject/reactiveObject.js"; -export { reactive } from "./reactive/reactive.js"; -export { computed } from "./reactive/computed.js"; -export { Component } from "./componentLogic/Component.js"; -export { getElementData } from "./componentLogic/elementData.js"; -export { register } from "./componentLogic/register.js"; -export { Ref } from "./componentLogic/Ref.js"; -export { classNames } from "./reactive/classNames.js"; -export { xml, xml as html } from "./parsing/_xml.js"; -export { css } from "./styling/css.js"; -export { CSSTemplate } from "./styling/CSSTemplate.js"; -export { attachCSSProperties } from "./styling/attachCSSProperties.js"; +export { ReactivePrimitive } from "./reactive/ReactivePrimitive.ts"; +export { ReadonlyReactivePrimitive } from "./reactive/ReactivePrimitive.ts"; +export { ReactiveArray } from "./reactive/ReactiveArray/_ReactiveArray.ts"; +export { ReadonlyReactiveArray } from "./reactive/ReactiveArray/_ReactiveArray.ts"; +export { reactiveObject } from "./reactive/reactiveObject/reactiveObject.ts"; +export { reactive } from "./reactive/reactive.ts"; +export { computed } from "./reactive/computed.ts"; +export { Component } from "./componentLogic/Component.ts"; +export { getElementData } from "./componentLogic/elementData.ts"; +export { register } from "./componentLogic/register.ts"; +export { Ref } from "./componentLogic/Ref.ts"; +export { classNames } from "./reactive/classNames.ts"; +export { xml, xml as html } from "./parsing/_xml.ts"; +export { css } from "./styling/css.ts"; +export { CSSTemplate } from "./styling/CSSTemplate.ts"; +export { attachCSSProperties } from "./styling/attachCSSProperties.ts"; -export type { TReactiveValueType } from "./reactive/types/IReactiveValueType.js"; -export type { TReactiveObject } from "./reactive/types/IReactiveObject.js"; -export type { TReactiveEntity } from "./reactive/types/IReactiveEntity.js"; -export type { TReactive } from "./reactive/types/IReactive.js"; -export type { TemplateResult } from "./parsing/TemplateResult.js"; +export type { TReactiveValueType } from "./reactive/types/IReactiveValueType.ts"; +export type { TReactiveObject } from "./reactive/types/IReactiveObject.ts"; +export type { TReactiveEntity } from "./reactive/types/IReactiveEntity.ts"; +export type { TReactive } from "./reactive/types/IReactive.ts"; +export type { TemplateResult } from "./parsing/TemplateResult.ts"; + +// purely so examples are included in the transpiling +import "./_examples/main.ts" +import "./_examples/components/visitor-demo.ts" +import "./_examples/components/to-do/_to-do.ts" +import "./_examples/components/array-demo.ts" +import "./_examples/components/time-diff.ts" +import "./_examples/components/async-demo.ts" +import "./_examples/components/window-manager/_window-manager.ts" \ No newline at end of file diff --git a/src/parsing/Slot.ts b/src/parsing/Slot.ts index 8683c09..3d06ab2 100644 --- a/src/parsing/Slot.ts +++ b/src/parsing/Slot.ts @@ -1,6 +1,6 @@ -import { deferredElements } from "./deferredElements.js"; -import { TemplateResult } from "./TemplateResult.js"; -import type { Component } from "../componentLogic/Component.js"; +import { deferredElements } from "./deferredElements.ts"; +import { TemplateResult } from "./TemplateResult.ts"; +import type { Component } from "../componentLogic/Component.ts"; /** A counter for labling `Comment`s for `Slot`s. */ let counter = 0; diff --git a/src/parsing/SlotArray.ts b/src/parsing/SlotArray.ts index 066bf3e..e52ffb8 100644 --- a/src/parsing/SlotArray.ts +++ b/src/parsing/SlotArray.ts @@ -1,6 +1,6 @@ -import { Slot } from "./Slot.js"; -import type { ReadonlyReactiveArray } from "../mod.js"; -import type { TemplateResult } from "./TemplateResult.js"; +import { Slot } from "./Slot.ts"; +import type { ReadonlyReactiveArray } from "../mod.ts"; +import type { TemplateResult } from "./TemplateResult.ts"; /** * Keeps track of `ReadonlyReactiveArray`s slotted into a template in the DOM. diff --git a/src/parsing/TemplateCache.ts b/src/parsing/TemplateCache.ts index b8bf3bd..79cb94d 100644 --- a/src/parsing/TemplateCache.ts +++ b/src/parsing/TemplateCache.ts @@ -1,4 +1,4 @@ -import type { TParseResult } from "./TParseResult.js"; +import type { TParseResult } from "./TParseResult.ts"; /** Used to cache parsed `DocumentFragment`s so looped templates don't need to be reparsed on each iteration. */ export class TemplateCache extends WeakMap< diff --git a/src/parsing/TemplateResult.ts b/src/parsing/TemplateResult.ts index 0b55c8e..877183f 100644 --- a/src/parsing/TemplateResult.ts +++ b/src/parsing/TemplateResult.ts @@ -1,5 +1,5 @@ -import { hookSlotsUp } from "./hookSlotsUp/_hookSlotsUp.js"; -import { Renderable } from "./Renderable.js"; +import { hookSlotsUp } from "./hookSlotsUp/_hookSlotsUp.ts"; +import { Renderable } from "./Renderable.ts"; export class TemplateResult extends Renderable { #template: HTMLTemplateElement; diff --git a/src/parsing/_xml.ts b/src/parsing/_xml.ts index 9305a53..232c64c 100644 --- a/src/parsing/_xml.ts +++ b/src/parsing/_xml.ts @@ -1,6 +1,6 @@ -import { createTemplate } from "./createTemplate.js"; -import { TemplateCache } from "./TemplateCache.js"; -import { TemplateResult } from "./TemplateResult.js"; +import { createTemplate } from "./createTemplate.ts"; +import { TemplateCache } from "./TemplateCache.ts"; +import { TemplateResult } from "./TemplateResult.ts"; const templateCache = new TemplateCache; diff --git a/src/parsing/createTemplate.ts b/src/parsing/createTemplate.ts index 0cdcceb..e634899 100644 --- a/src/parsing/createTemplate.ts +++ b/src/parsing/createTemplate.ts @@ -1,8 +1,8 @@ -import { parseString } from "./parseString.js"; -import { resolveSlots } from "./resolveSlots.js"; -import { isComponent } from "../componentLogic/isComponent.js"; -import { DestinyFallback } from "../componentLogic/DestinyFallback.js"; -import type { TParseResult } from "./TParseResult.js"; +import { parseString } from "./parseString.ts"; +import { resolveSlots } from "./resolveSlots.ts"; +import { isComponent } from "../componentLogic/isComponent.ts"; +import { DestinyFallback } from "../componentLogic/DestinyFallback.ts"; +import type { TParseResult } from "./TParseResult.ts"; /** * Parses and processes a `TemplateStringsArray` into a `DocumentFragment`. diff --git a/src/parsing/deferredElements.ts b/src/parsing/deferredElements.ts index 06ba8ed..779fbc5 100644 --- a/src/parsing/deferredElements.ts +++ b/src/parsing/deferredElements.ts @@ -1,5 +1,5 @@ /** - * Lists elements which are to be waited on before removal. See `attributeNamespaces/destiny.js` for details (`destiny:unmount`). + * Lists elements which are to be waited on before removal. See `attributeNamespaces/destiny.ts` for details (`destiny:unmount`). */ export const deferredElements = new Map< HTMLElement, diff --git a/src/parsing/hookSlotsUp/_hookSlotsUp.ts b/src/parsing/hookSlotsUp/_hookSlotsUp.ts index 1699e0c..98db5b2 100644 --- a/src/parsing/hookSlotsUp/_hookSlotsUp.ts +++ b/src/parsing/hookSlotsUp/_hookSlotsUp.ts @@ -1,5 +1,5 @@ -import { hookContentSlotsUp } from "./hookContentSlotsUp/_hookContentSlotsUp.js"; -import { hookAttributeSlotsUp } from "./hookAttributeSlotsUp/_hookAttributeSlotsUp.js"; +import { hookContentSlotsUp } from "./hookContentSlotsUp/_hookContentSlotsUp.ts"; +import { hookAttributeSlotsUp } from "./hookAttributeSlotsUp/_hookAttributeSlotsUp.ts"; export type TValueProps = { diff --git a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/TElementData.ts b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/TElementData.ts index 3adef13..71f3f2f 100644 --- a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/TElementData.ts +++ b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/TElementData.ts @@ -1,4 +1,4 @@ -import type { TNamespace } from "./TNamespace"; +import type { TNamespace } from "./TNamespace.ts"; export type TElementData = { readonly [Key in TNamespace]: Map diff --git a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/TNamespace.ts b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/TNamespace.ts index 686da32..08a191a 100644 --- a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/TNamespace.ts +++ b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/TNamespace.ts @@ -1,3 +1,3 @@ -import type { validNamespaces } from "./isValidNamespace.js"; +import type { validNamespaces } from "./isValidNamespace.ts"; export type TNamespace = typeof validNamespaces[number]; diff --git a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/_hookAttributeSlotsUp.ts b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/_hookAttributeSlotsUp.ts index fe2d229..54f15b5 100644 --- a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/_hookAttributeSlotsUp.ts +++ b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/_hookAttributeSlotsUp.ts @@ -1,8 +1,8 @@ -import { resolveSlotPropIndex } from "./resolveSlotPropIndex.js"; -import { parseAttributeName } from "./parseAttributeName.js"; -import { assignElementData } from "./elementData/_assignElementData.js"; -import { elementData } from "../../../componentLogic/elementData.js"; -import type { TElementData } from "./TElementData.js"; +import { resolveSlotPropIndex } from "./resolveSlotPropIndex.ts"; +import { parseAttributeName } from "./parseAttributeName.ts"; +import { assignElementData } from "./elementData/_assignElementData.ts"; +import { elementData } from "../../../componentLogic/elementData.ts"; +import type { TElementData } from "./TElementData.ts"; /** * Goes through all the elements in a template that are flagged with the `destiny::attr` attribute and figures out what events need to be listened to, and how the DOM needs to be updated if any of the given props are reactive. diff --git a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/doOrBind.ts b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/doOrBind.ts index 8572878..bb00a48 100644 --- a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/doOrBind.ts +++ b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/doOrBind.ts @@ -1,7 +1,7 @@ -import { ReactivePrimitive } from "../../../mod.js"; -import { matchChangeWatcher } from "./matchChangeWatcher.js"; -import { ReadonlyReactivePrimitive } from "../../../reactive/ReactivePrimitive.js"; -import type { TWatchedAttribute } from "./matchChangeWatcher.js"; +import { ReactivePrimitive } from "../../../mod.ts"; +import { matchChangeWatcher } from "./matchChangeWatcher.ts"; +import { ReadonlyReactivePrimitive } from "../../../reactive/ReactivePrimitive.ts"; +import type { TWatchedAttribute } from "./matchChangeWatcher.ts"; export function doOrBind ( element: HTMLElement, diff --git a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/_assignElementData.ts b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/_assignElementData.ts index 3083353..a63d4f4 100644 --- a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/_assignElementData.ts +++ b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/_assignElementData.ts @@ -1,8 +1,8 @@ -import { attribute } from "./attribute.js"; -import { destiny } from "./destiny.js"; -import { prop } from "./prop.js"; -import { on } from "./on.js"; -import type { TElementData } from "../TElementData.js"; +import { attribute } from "./attribute.ts"; +import { destiny } from "./destiny.ts"; +import { prop } from "./prop.ts"; +import { on } from "./on.ts"; +import type { TElementData } from "../TElementData.ts"; /** * Takes care of hooking up data to an element. diff --git a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/attribute.ts b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/attribute.ts index 6f606dd..42ea027 100644 --- a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/attribute.ts +++ b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/attribute.ts @@ -1,5 +1,5 @@ -import { doOrBind } from "../doOrBind.js"; -import type { TElementData } from "../TElementData.js"; +import { doOrBind } from "../doOrBind.ts"; +import type { TElementData } from "../TElementData.ts"; /** * Handler for normal non-namespaced attributes. Behaves like normal HTML. diff --git a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/destiny.ts b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/destiny.ts index a695952..0109cc4 100644 --- a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/destiny.ts +++ b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/destiny.ts @@ -1,7 +1,7 @@ -import { destinyUnmount } from "./destinyUnmount.js"; -import { destinyMount } from "./destinyMount.js"; -import { destinyRef } from "./destinyRef.js"; -import type { TElementData } from "../TElementData.js"; +import { destinyUnmount } from "./destinyUnmount.ts"; +import { destinyMount } from "./destinyMount.ts"; +import { destinyRef } from "./destinyRef.ts"; +import type { TElementData } from "../TElementData.ts"; /** * Handler for destiny-namespaced attributes. See referenced methods for details. diff --git a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/destinyRef.ts b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/destinyRef.ts index ea28015..b098dda 100644 --- a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/destinyRef.ts +++ b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/destinyRef.ts @@ -1,5 +1,5 @@ -import { Ref } from "../../../../mod.js"; -import { isObject } from "../../../../typeChecks/isObject.js"; +import { Ref } from "../../../../mod.ts"; +import { isObject } from "../../../../typeChecks/isObject.ts"; /** * `destiny:ref` prop allows you to to give a `ReactivePrimitive` to diff --git a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/destinyUnmount.ts b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/destinyUnmount.ts index e00c1c3..8a39dd4 100644 --- a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/destinyUnmount.ts +++ b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/destinyUnmount.ts @@ -1,4 +1,4 @@ -import { deferredElements } from "../../../deferredElements.js"; +import { deferredElements } from "../../../deferredElements.ts"; /** * `destiny:unmount` takes a callback function which will be called diff --git a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/on.ts b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/on.ts index 1b29c45..38bec7d 100644 --- a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/on.ts +++ b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/on.ts @@ -1,4 +1,4 @@ -import type { TElementData } from "../TElementData.js"; +import type { TElementData } from "../TElementData.ts"; /** * `on:` adds an event listener. It either takes a diff --git a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/prop.ts b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/prop.ts index 4c12d0a..eefc893 100644 --- a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/prop.ts +++ b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/prop.ts @@ -1,5 +1,5 @@ -import { doOrBind } from "../doOrBind.js"; -import type { TElementData } from "../TElementData.js"; +import { doOrBind } from "../doOrBind.ts"; +import type { TElementData } from "../TElementData.ts"; /** * `prop:` takes in any property and assigns it to the element in JS. diff --git a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/isValidNamespace.ts b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/isValidNamespace.ts index d6996f7..5e533b0 100644 --- a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/isValidNamespace.ts +++ b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/isValidNamespace.ts @@ -1,4 +1,4 @@ -import type { TNamespace } from "./TNamespace.js"; +import type { TNamespace } from "./TNamespace.ts"; export const validNamespaces = ["attribute", "prop", "on", "destiny"] as const; diff --git a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/parseAttributeName.ts b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/parseAttributeName.ts index 5775339..be3febe 100644 --- a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/parseAttributeName.ts +++ b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/parseAttributeName.ts @@ -1,6 +1,6 @@ -// import { kebabToCamel } from "../../../utils/kebabToCamel.js"; -import { isValidNamespace } from "./isValidNamespace.js"; -import type { TNamespace } from "./TNamespace.js"; +// import { kebabToCamel } from "../../../utils/kebabToCamel.ts"; +import { isValidNamespace } from "./isValidNamespace.ts"; +import type { TNamespace } from "./TNamespace.ts"; export function parseAttributeName ( input: string, diff --git a/src/parsing/hookSlotsUp/hookContentSlotsUp/_hookContentSlotsUp.ts b/src/parsing/hookSlotsUp/hookContentSlotsUp/_hookContentSlotsUp.ts index 0e7df80..c6d44a2 100644 --- a/src/parsing/hookSlotsUp/hookContentSlotsUp/_hookContentSlotsUp.ts +++ b/src/parsing/hookSlotsUp/hookContentSlotsUp/_hookContentSlotsUp.ts @@ -1,7 +1,7 @@ -import { ReadonlyReactivePrimitive, ReadonlyReactiveArray } from "../../../mod.js"; -import { valueToFragment } from "./toFragment/valueToFragment.js"; -import { Slot } from "../../Slot.js"; -import { SlotArray } from "../../SlotArray.js"; +import { ReadonlyReactivePrimitive, ReadonlyReactiveArray } from "../../../mod.ts"; +import { valueToFragment } from "./toFragment/valueToFragment.ts"; +import { Slot } from "../../Slot.ts"; +import { SlotArray } from "../../SlotArray.ts"; /** * Goes through all the elements in a template that are flagged with the `destiny:content` attribute and figures out how the DOM needs to be updated if any of the given props are reactive. diff --git a/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/arrayToFragment.ts b/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/arrayToFragment.ts index 916a4da..afc0e9f 100644 --- a/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/arrayToFragment.ts +++ b/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/arrayToFragment.ts @@ -1,5 +1,5 @@ -import { shouldBeRendered } from "../../stringifyValue.js"; -import { valueToFragment } from "./valueToFragment.js"; +import { shouldBeRendered } from "../../stringifyValue.ts"; +import { valueToFragment } from "./valueToFragment.ts"; /** * Converts an array of items into a `DocumentFragment`. diff --git a/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/valueToFragment.ts b/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/valueToFragment.ts index 995971f..f541aa4 100644 --- a/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/valueToFragment.ts +++ b/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/valueToFragment.ts @@ -1,7 +1,7 @@ -import { arrayToFragment } from "./arrayToFragment.js"; -import { nodeToFragment } from "./nodeToFragment.js"; -import { stringifyValue } from "../../stringifyValue.js"; -import { TemplateResult } from "../../../TemplateResult.js"; +import { arrayToFragment } from "./arrayToFragment.ts"; +import { nodeToFragment } from "./nodeToFragment.ts"; +import { stringifyValue } from "../../stringifyValue.ts"; +import { TemplateResult } from "../../../TemplateResult.ts"; /** * A polymorphic helper which figures out the type of the input and determines a suitable way to convert it into a `DocumentFragment`. diff --git a/src/parsing/prepareContentSlots.ts b/src/parsing/prepareContentSlots.ts index 5ad6c70..7c1ac5b 100644 --- a/src/parsing/prepareContentSlots.ts +++ b/src/parsing/prepareContentSlots.ts @@ -1,4 +1,4 @@ -import type { TUnpreparedContentSlot } from "./TUnpreparedContentSlot.js"; +import type { TUnpreparedContentSlot } from "./TUnpreparedContentSlot.ts"; function createPlaceholder ( index: number, diff --git a/src/parsing/resolveSlots.ts b/src/parsing/resolveSlots.ts index dc9643f..924f7f5 100644 --- a/src/parsing/resolveSlots.ts +++ b/src/parsing/resolveSlots.ts @@ -1,7 +1,7 @@ -import { isTextNode } from "../typeChecks/isTextNode.js"; -import { isElement } from "../typeChecks/isElement.js"; -import { prepareContentSlots } from "./prepareContentSlots.js"; -import type { TUnpreparedContentSlot } from "./TUnpreparedContentSlot.js"; +import { isTextNode } from "../typeChecks/isTextNode.ts"; +import { isElement } from "../typeChecks/isElement.ts"; +import { prepareContentSlots } from "./prepareContentSlots.ts"; +import type { TUnpreparedContentSlot } from "./TUnpreparedContentSlot.ts"; /** * Figures out from a freshly parsed `HTMLTemplate` where slots are located so they can be quickly hooked up with values. diff --git a/src/reactive/ReactiveArray/TMask.ts b/src/reactive/ReactiveArray/TMask.ts index 87cd2fb..db93396 100644 --- a/src/reactive/ReactiveArray/TMask.ts +++ b/src/reactive/ReactiveArray/TMask.ts @@ -1,3 +1,3 @@ -import type { TMaskEntry } from "./TMaskEntry.js"; +import type { TMaskEntry } from "./TMaskEntry.ts"; export type TMask = Array; diff --git a/src/reactive/ReactiveArray/TUnwrapReactiveArray.ts b/src/reactive/ReactiveArray/TUnwrapReactiveArray.ts index a3c23eb..3ae8025 100644 --- a/src/reactive/ReactiveArray/TUnwrapReactiveArray.ts +++ b/src/reactive/ReactiveArray/TUnwrapReactiveArray.ts @@ -1,4 +1,4 @@ -import type { ReadonlyReactiveArray } from "./_ReactiveArray.js"; +import type { ReadonlyReactiveArray } from "./_ReactiveArray.ts"; export type TUnwrapReactiveArray = ( Input extends ReadonlyReactiveArray diff --git a/src/reactive/ReactiveArray/_ReactiveArray.ts b/src/reactive/ReactiveArray/_ReactiveArray.ts index 81276af..8804ece 100644 --- a/src/reactive/ReactiveArray/_ReactiveArray.ts +++ b/src/reactive/ReactiveArray/_ReactiveArray.ts @@ -1,15 +1,15 @@ -import { ReactivePrimitive } from "../../mod.js"; -import { makeNonPrimitiveItemsReactive } from "./makeNonPrimitiveItemsReactive.js"; -import { updateFilteredArray } from "./updateFilteredArray.js"; -import { computed, computedConsumer } from "../computed.js"; -import { flatten } from "./flatten.js"; -import { ReadonlyReactivePrimitive } from "../ReactivePrimitive.js"; -import type { TReactiveArrayCallback } from "../types/IReactiveArrayCallback.js"; -import type { TArrayValueType } from "../types/IArrayValueType.js"; -import type { TReactiveEntity } from "../types/IReactiveEntity.js"; -import type { TUnwrapReactiveArray } from "./TUnwrapReactiveArray.js"; -import type { TArrayUpdateArguments } from "./TArrayUpdateArguments.js"; -import type { TMask } from "./TMask.js"; +import { ReactivePrimitive } from "../../mod.ts"; +import { makeNonPrimitiveItemsReactive } from "./makeNonPrimitiveItemsReactive.ts"; +import { updateFilteredArray } from "./updateFilteredArray.ts"; +import { computed, computedConsumer } from "../computed.ts"; +import { flatten } from "./flatten.ts"; +import { ReadonlyReactivePrimitive } from "../ReactivePrimitive.ts"; +import type { TReactiveArrayCallback } from "../types/IReactiveArrayCallback.ts"; +import type { TArrayValueType } from "../types/IArrayValueType.ts"; +import type { TReactiveEntity } from "../types/IReactiveEntity.ts"; +import type { TUnwrapReactiveArray } from "./TUnwrapReactiveArray.ts"; +import type { TArrayUpdateArguments } from "./TArrayUpdateArguments.ts"; +import type { TMask } from "./TMask.ts"; type TSplice = ( start: number, diff --git a/src/reactive/ReactiveArray/flatten.ts b/src/reactive/ReactiveArray/flatten.ts index b6da56e..dccf21f 100644 --- a/src/reactive/ReactiveArray/flatten.ts +++ b/src/reactive/ReactiveArray/flatten.ts @@ -1,5 +1,5 @@ -import { ReadonlyReactiveArray } from "./_ReactiveArray.js"; -import type { TUnwrapReactiveArray } from "./TUnwrapReactiveArray.js"; +import { ReadonlyReactiveArray } from "./_ReactiveArray.ts"; +import type { TUnwrapReactiveArray } from "./TUnwrapReactiveArray.ts"; type TUnwrapArray = ( Input extends ReadonlyArray diff --git a/src/reactive/ReactiveArray/makeNonPrimitiveItemsReactive.ts b/src/reactive/ReactiveArray/makeNonPrimitiveItemsReactive.ts index e45af35..fd1223c 100644 --- a/src/reactive/ReactiveArray/makeNonPrimitiveItemsReactive.ts +++ b/src/reactive/ReactiveArray/makeNonPrimitiveItemsReactive.ts @@ -1,8 +1,8 @@ -import { reactive, ReadonlyReactiveArray } from "../../mod.js"; -import { isSpecialCaseObject } from "../reactiveObject/specialCaseObjects.js"; -import { isReactive } from "../../typeChecks/isReactive.js"; -import { isObject } from "../../typeChecks/isObject.js"; -import type { TArrayValueType } from "../types/IArrayValueType.js"; +import { reactive, ReadonlyReactiveArray } from "../../mod.ts"; +import { isSpecialCaseObject } from "../reactiveObject/specialCaseObjects.ts"; +import { isReactive } from "../../typeChecks/isReactive.ts"; +import { isObject } from "../../typeChecks/isObject.ts"; +import type { TArrayValueType } from "../types/IArrayValueType.ts"; /** * Converts a given array of values into a reactive value recursively if it's not to be treated as a primitive. I.E. `Array`s and most `Object`s will be converted, but primitive values will not. This is useful for `ReactiveArrays`, whose direct children are managed directly by the class itself, but whose deeply nested descendants need to be tracked separately. diff --git a/src/reactive/ReactiveArray/updateFilteredArray.ts b/src/reactive/ReactiveArray/updateFilteredArray.ts index 4303771..51c533a 100644 --- a/src/reactive/ReactiveArray/updateFilteredArray.ts +++ b/src/reactive/ReactiveArray/updateFilteredArray.ts @@ -1,6 +1,6 @@ -import type { ReactiveArray } from "./_ReactiveArray.js"; -import type { TMask } from "./TMask.js"; -import type { TMaskEntry } from "./TMaskEntry.js"; +import type { ReactiveArray } from "./_ReactiveArray.ts"; +import type { TMask } from "./TMask.ts"; +import type { TMaskEntry } from "./TMaskEntry.ts"; type TUpdateQueueEntry = TMaskEntry & {value: T}; type TUpdateQueue = Array>; diff --git a/src/reactive/ReactivePrimitive.ts b/src/reactive/ReactivePrimitive.ts index b5dd651..1af645b 100644 --- a/src/reactive/ReactivePrimitive.ts +++ b/src/reactive/ReactivePrimitive.ts @@ -1,7 +1,7 @@ -import { IterableWeakMap } from "../utils/IterableWeakMap.js"; -import { WeakMultiRef } from "../utils/WeakMultiRef.js"; -import { computedConsumer } from "./computed.js"; -import { concatIterators } from "../utils/concatIterators.js"; +import { IterableWeakMap } from "../utils/IterableWeakMap.ts"; +import { WeakMultiRef } from "../utils/WeakMultiRef.ts"; +import { computedConsumer } from "./computed.ts"; +import { concatIterators } from "../utils/concatIterators.ts"; type TReactivePrimitiveCallback = (newValue: T) => void; diff --git a/src/reactive/classNames.ts b/src/reactive/classNames.ts index 5fdd662..9997a44 100644 --- a/src/reactive/classNames.ts +++ b/src/reactive/classNames.ts @@ -1,5 +1,5 @@ -import { computed } from "./computed.js"; -import { ReadonlyReactivePrimitive } from "./ReactivePrimitive.js"; +import { computed } from "./computed.ts"; +import { ReadonlyReactivePrimitive } from "./ReactivePrimitive.ts"; export function classNames ( input: Record>, diff --git a/src/reactive/computed.ts b/src/reactive/computed.ts index 8a8f47b..00f3af0 100644 --- a/src/reactive/computed.ts +++ b/src/reactive/computed.ts @@ -1,5 +1,5 @@ -import { composeTemplateString } from "../utils/composeTemplateString.js"; -import { ReactivePrimitive, ReadonlyReactivePrimitive } from "./ReactivePrimitive.js"; +import { composeTemplateString } from "../utils/composeTemplateString.ts"; +import { ReactivePrimitive, ReadonlyReactivePrimitive } from "./ReactivePrimitive.ts"; export let computedConsumer: { fn: VoidFunction, diff --git a/src/reactive/reactive.ts b/src/reactive/reactive.ts index 87bef1f..65c2bdb 100644 --- a/src/reactive/reactive.ts +++ b/src/reactive/reactive.ts @@ -1,10 +1,10 @@ -import { ReactiveArray, ReadonlyReactiveArray, ReactivePrimitive, reactiveObject } from "../mod.js"; -import { isSpecialCaseObject } from "./reactiveObject/specialCaseObjects.js"; -import { isReactive } from "../typeChecks/isReactive.js"; -import { isObject } from "../typeChecks/isObject.js"; -import type { TReactiveValueType } from "./types/IReactiveValueType.js"; -import type { TReactiveEntity } from "./types/IReactiveEntity.js"; -import type { TReactive } from "./types/IReactive.js"; +import { ReactiveArray, ReadonlyReactiveArray, ReactivePrimitive, reactiveObject } from "../mod.ts"; +import { isSpecialCaseObject } from "./reactiveObject/specialCaseObjects.ts"; +import { isReactive } from "../typeChecks/isReactive.ts"; +import { isObject } from "../typeChecks/isObject.ts"; +import type { TReactiveValueType } from "./types/IReactiveValueType.ts"; +import type { TReactiveEntity } from "./types/IReactiveEntity.ts"; +import type { TReactive } from "./types/IReactive.ts"; /** * A polymorphic convenience function that will convert any value into a reactive value recursively. `Array`s are converted into `ReactiveArray`s. Most `Object`s get their keys converted into reactive items using the same algorithm (see `reactiveObject.ts` for more details). Other values are converted into `ReactivePrimitive`s. diff --git a/src/reactive/reactiveObject/reactiveObject.ts b/src/reactive/reactiveObject/reactiveObject.ts index d76d789..4a03b9d 100644 --- a/src/reactive/reactiveObject/reactiveObject.ts +++ b/src/reactive/reactiveObject/reactiveObject.ts @@ -1,7 +1,7 @@ -import { reactive } from "../reactive.js"; -import { reactiveObjectFlag } from "./reactiveObjectFlag.js"; -import type { TReactiveEntity } from "../types/IReactiveEntity.js"; -import type { TReactiveObject } from "../types/IReactiveObject.js"; +import { reactive } from "../reactive.ts"; +import { reactiveObjectFlag } from "./reactiveObjectFlag.ts"; +import type { TReactiveEntity } from "../types/IReactiveEntity.ts"; +import type { TReactiveObject } from "../types/IReactiveObject.ts"; /** * Takes an object, and passes each of its enumerable properties to `reactive()`, which makes the entire structure reactive recursively. diff --git a/src/reactive/reactiveObject/specialCaseObjects.ts b/src/reactive/reactiveObject/specialCaseObjects.ts index 223a668..a62fd8a 100644 --- a/src/reactive/reactiveObject/specialCaseObjects.ts +++ b/src/reactive/reactiveObject/specialCaseObjects.ts @@ -1,4 +1,4 @@ -import { TemplateResult } from "../../parsing/TemplateResult.js"; +import { TemplateResult } from "../../parsing/TemplateResult.ts"; /** * Basically, because TS doesn't support nominal typing, we have to use this hack to exclude unwanted objects from our reactive methods. diff --git a/src/reactive/types/IArrayValueType.ts b/src/reactive/types/IArrayValueType.ts index 229d50f..565fb54 100644 --- a/src/reactive/types/IArrayValueType.ts +++ b/src/reactive/types/IArrayValueType.ts @@ -1,6 +1,6 @@ -import type { TSpecialCaseObject } from "../reactiveObject/specialCaseObjects.js"; -import type { TReactiveValueType } from "./IReactiveValueType.js"; -import type { TPrimitive } from "./IPrimitive.js"; +import type { TSpecialCaseObject } from "../reactiveObject/specialCaseObjects.ts"; +import type { TReactiveValueType } from "./IReactiveValueType.ts"; +import type { TPrimitive } from "./IPrimitive.ts"; export type TArrayValueType = ( T extends TPrimitive | TSpecialCaseObject diff --git a/src/reactive/types/IReactive.ts b/src/reactive/types/IReactive.ts index 64f0f86..fa2e090 100644 --- a/src/reactive/types/IReactive.ts +++ b/src/reactive/types/IReactive.ts @@ -1,5 +1,5 @@ -import type { ReadonlyReactiveArray, ReadonlyReactivePrimitive } from "../../mod.js"; -import type { TReactiveObject } from "./IReactiveObject.js"; +import type { ReadonlyReactiveArray, ReadonlyReactivePrimitive } from "../../mod.ts"; +import type { TReactiveObject } from "./IReactiveObject.ts"; export type TReactive = ( | ReadonlyReactiveArray diff --git a/src/reactive/types/IReactiveEntity.ts b/src/reactive/types/IReactiveEntity.ts index 406b097..9fb8d7c 100644 --- a/src/reactive/types/IReactiveEntity.ts +++ b/src/reactive/types/IReactiveEntity.ts @@ -1,4 +1,4 @@ -import type { ReadonlyReactiveArray, ReactivePrimitive } from "../../mod.js"; +import type { ReadonlyReactiveArray, ReactivePrimitive } from "../../mod.ts"; export type TReactiveEntity = ( | ReactivePrimitive diff --git a/src/reactive/types/IReactiveObject.ts b/src/reactive/types/IReactiveObject.ts index f4ab442..9eda723 100644 --- a/src/reactive/types/IReactiveObject.ts +++ b/src/reactive/types/IReactiveObject.ts @@ -1,5 +1,5 @@ -import type { TReactiveObjectFlag } from "./IReactiveObjectFlag.js"; -import type { TReactiveValueType } from "./IReactiveValueType.js"; +import type { TReactiveObjectFlag } from "./IReactiveObjectFlag.ts"; +import type { TReactiveValueType } from "./IReactiveValueType.ts"; export type TReactiveObject | unknown> = ( { diff --git a/src/reactive/types/IReactiveObjectFlag.ts b/src/reactive/types/IReactiveObjectFlag.ts index 1fcc6a7..0955e85 100644 --- a/src/reactive/types/IReactiveObjectFlag.ts +++ b/src/reactive/types/IReactiveObjectFlag.ts @@ -1,4 +1,4 @@ -import { reactiveObjectFlag } from "../reactiveObject/reactiveObjectFlag.js"; +import { reactiveObjectFlag } from "../reactiveObject/reactiveObjectFlag.ts"; export type TReactiveObjectFlag = { [reactiveObjectFlag]: true, diff --git a/src/reactive/types/IReactiveValueType.ts b/src/reactive/types/IReactiveValueType.ts index 46e88ec..840f915 100644 --- a/src/reactive/types/IReactiveValueType.ts +++ b/src/reactive/types/IReactiveValueType.ts @@ -1,7 +1,7 @@ -import type { ReactiveArray, ReactivePrimitive } from "../../mod.js"; -import type { TSpecialCaseObject } from "../reactiveObject/specialCaseObjects.js"; -import type { TReactiveObject } from "./IReactiveObject.js"; -import type { TReactive } from "./IReactive.js"; +import type { ReactiveArray, ReactivePrimitive } from "../../mod.ts"; +import type { TSpecialCaseObject } from "../reactiveObject/specialCaseObjects.ts"; +import type { TReactiveObject } from "./IReactiveObject.ts"; +import type { TReactive } from "./IReactive.ts"; export type TReactiveValueType = ( T extends TReactive ? T : diff --git a/src/styling/CSSTemplate.ts b/src/styling/CSSTemplate.ts index 15c346b..13fd964 100644 --- a/src/styling/CSSTemplate.ts +++ b/src/styling/CSSTemplate.ts @@ -1,3 +1,5 @@ +import "../globalTypes/CSSStyleSheet.ts" + export class CSSTemplate { readonly cssText: string; diff --git a/src/styling/attachCSSProperties.ts b/src/styling/attachCSSProperties.ts index 768d674..6415fbe 100644 --- a/src/styling/attachCSSProperties.ts +++ b/src/styling/attachCSSProperties.ts @@ -1,4 +1,4 @@ -import type { ReadonlyReactivePrimitive } from "../reactive/ReactivePrimitive.js"; +import type { ReadonlyReactivePrimitive } from "../reactive/ReactivePrimitive.ts"; /** * Synchonizes a CSS property of an element to a ReactivePrimitive. diff --git a/src/styling/css.ts b/src/styling/css.ts index 6a48c68..5bd9975 100644 --- a/src/styling/css.ts +++ b/src/styling/css.ts @@ -1,6 +1,6 @@ -import { isReactive } from "../typeChecks/isReactive.js"; -import { CSSTemplate } from "./CSSTemplate.js"; -import { composeTemplateString } from "../utils/composeTemplateString.js"; +import { isReactive } from "../typeChecks/isReactive.ts"; +import { CSSTemplate } from "./CSSTemplate.ts"; +import { composeTemplateString } from "../utils/composeTemplateString.ts"; export function css ( strings: TemplateStringsArray, diff --git a/src/typeChecks/isPrimitive.ts b/src/typeChecks/isPrimitive.ts index ad234e4..84cc116 100644 --- a/src/typeChecks/isPrimitive.ts +++ b/src/typeChecks/isPrimitive.ts @@ -1,4 +1,4 @@ -import type { TPrimitive } from "../reactive/types/IPrimitive.js"; +import type { TPrimitive } from "../reactive/types/IPrimitive.ts"; /** * Checks if a given value is one of the seven primitive types in JavaScript. diff --git a/src/typeChecks/isReactive.ts b/src/typeChecks/isReactive.ts index 464a71b..88ddac5 100644 --- a/src/typeChecks/isReactive.ts +++ b/src/typeChecks/isReactive.ts @@ -1,6 +1,6 @@ -import { ReadonlyReactiveArray, ReadonlyReactivePrimitive } from "../mod.js"; -import { reactiveObjectFlag } from "../reactive/reactiveObject/reactiveObjectFlag.js"; -import type { TReactive } from "../reactive/types/IReactive.js"; +import { ReadonlyReactiveArray, ReadonlyReactivePrimitive } from "../mod.ts"; +import { reactiveObjectFlag } from "../reactive/reactiveObject/reactiveObjectFlag.ts"; +import type { TReactive } from "../reactive/types/IReactive.ts"; /** * Checks if a given value is a reactive value; I.E. an instance of `ReadonlyReactivePrimitive` or `ReadonlyReactiveArray`, or a `reactiveObject` which is flagged by the `reacativeObjecetFlag` symbol. diff --git a/src/utils/describeType.ts b/src/utils/describeType.ts index e98d409..d81ac79 100644 --- a/src/utils/describeType.ts +++ b/src/utils/describeType.ts @@ -1,4 +1,4 @@ -import { safeStringifyObject } from "./safeStringifyObject.js"; +import { safeStringifyObject } from "./safeStringifyObject.ts"; export function describeType ( input: unknown, diff --git a/src/utils/id.ts b/src/utils/id.ts index 37b307f..73d9ada 100644 --- a/src/utils/id.ts +++ b/src/utils/id.ts @@ -1,4 +1,4 @@ -import { pseudoRandomEncode } from "./pseudoRandomEncode.js"; +import { pseudoRandomEncode } from "./pseudoRandomEncode.ts"; const idEncoder = pseudoRandomEncode(2n ** 20n, 387_420_489n); diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 17d1d07..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "compilerOptions": { - "plugins": [], - /* Basic Options */ - "target": "es2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ - "module": "ESNext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ - "lib": [ - "dom", - "DOM.Iterable", - // "es2020", - "esnext", - ], /* Specify library files to be included in the compilation. */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "declaration": true, /* Generates corresponding '.d.ts' file. */ - "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "./dist", /* Redirect output structure to the directory. */ - "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - "useDefineForClassFields": true, /* Defines class fields in a way that's compatible with the current spec. */ - - /* Strict Type-Checking Options */ - "strict": true, /* Enable all strict type-checking options. */ - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - "forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */ - - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - "paths": { - "/dist/*": ["src/*"], - }, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": false, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - // "esModuleInterop": false, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - - /* Source Map Options */ - // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - "importsNotUsedAsValues": "error", - // "noUncheckedIndexedAccess": true, - // "noImplicitOverride": true, - } -} \ No newline at end of file From 3198a151e81510cd6e0fc3c4dbd5beb9aba8c475 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Sun, 6 Jun 2021 14:45:21 +0100 Subject: [PATCH 02/38] Handle duplicate modify events for watcher --- compile.ts | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/compile.ts b/compile.ts index 269ce10..37439a2 100644 --- a/compile.ts +++ b/compile.ts @@ -139,7 +139,16 @@ async function compile(file: string): Promise { for (const filename of fileKeys) { write(filename, files[filename]); } - console.log("Finished compilation"); +} + +const watchTimeouts: Record = {}; +function debounce(context: string, fn: () => Promise) { + if (watchTimeouts[context]) { + clearTimeout(watchTimeouts[context]); + } + watchTimeouts[context] = setTimeout(function () { + fn(); + }, 100); } // @@ -152,6 +161,7 @@ const errorMsg = await compile("./src/mod.ts"); if (errorMsg) { throw new Error(errorMsg); } +console.log("Finished compilation"); const args = Deno.args; if (args[0] === "--watch") { @@ -165,11 +175,13 @@ if (args[0] === "--watch") { const path = Deno.build.os === "windows" ? relativeWin(".", paths[0]) : paths[0]; - const msg = await compile(path); - if (msg) { - console.error(msg); - } else { - console.log("Compiled " + path); - } + debounce(path, async () => { + const msg = await compile(path); + if (msg) { + console.error(msg); + } else { + console.log("Compiled " + path); + } + }); } } From 819868f9e3dd5dc942aebad3c331d83a644d79fe Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Sun, 6 Jun 2021 14:45:39 +0100 Subject: [PATCH 03/38] Remove fmt from scripts --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index c627446..e14b433 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "type": "module", "scripts": { "lint": "deno lint --ignore=dist", - "fmt": "deno fmt --ignore=dist", "test": "echo \"Error: no test specified\" && exit 1", "compile": "deno run --allow-read=. --allow-write=dist --unstable compile.ts", "watch": "deno run --allow-read=. --allow-write=dist --unstable compile.ts --watch" From 2f82977d7b2da4228d437a2b12fe69841fc13164 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Mon, 7 Jun 2021 22:35:04 +0100 Subject: [PATCH 04/38] Cast stylesheet in CSSTemplate.ts --- src/globalTypes/CSSStyleSheet.ts | 7 ------- src/styling/CSSTemplate.ts | 6 ++++-- 2 files changed, 4 insertions(+), 9 deletions(-) delete mode 100644 src/globalTypes/CSSStyleSheet.ts diff --git a/src/globalTypes/CSSStyleSheet.ts b/src/globalTypes/CSSStyleSheet.ts deleted file mode 100644 index e0c2b0b..0000000 --- a/src/globalTypes/CSSStyleSheet.ts +++ /dev/null @@ -1,7 +0,0 @@ -export {} - -declare global { - interface CSSStyleSheet { - replace: (cssText: string) => void - } - } \ No newline at end of file diff --git a/src/styling/CSSTemplate.ts b/src/styling/CSSTemplate.ts index 13fd964..e022621 100644 --- a/src/styling/CSSTemplate.ts +++ b/src/styling/CSSTemplate.ts @@ -1,4 +1,6 @@ -import "../globalTypes/CSSStyleSheet.ts" +interface ICSSStyleSheet extends CSSStyleSheet { + replace: (cssText: string) => void +} export class CSSTemplate { readonly cssText: string; @@ -20,7 +22,7 @@ export class CSSTemplate { get styleSheet (): CSSStyleSheet { if (!this.#stylesheet) { this.#stylesheet = new CSSStyleSheet; - this.#stylesheet.replace(this.cssText); + (this.#stylesheet as ICSSStyleSheet).replace(this.cssText); } return this.#stylesheet; } From 306eb484b4fe11791b0a9a1b4c0e0148ea516f0f Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Thu, 10 Jun 2021 17:05:58 +0100 Subject: [PATCH 05/38] Use native Deno way of formatting diagnostics --- compile.ts | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/compile.ts b/compile.ts index 37439a2..332b06a 100644 --- a/compile.ts +++ b/compile.ts @@ -2,30 +2,8 @@ import { ensureDirSync, fromFileUrlWin, relativeWin } from "./deps.ts"; const encoder = new TextEncoder(); -function checkDiagnostics(diagnostics: Deno.Diagnostic[]): string | void { - // Check if there were errors when bundling the clients code - if (diagnostics && diagnostics.length) { - const diagnostic = diagnostics[0]; // we only really care about throwing the first error - const filename = diagnostic.fileName; - const start = diagnostic.start; - const messageText = diagnostic.messageText ?? - // @ts-ignore Deno tells us `messageText` does not exist on `messageChain`, but it 100% is (bug with deno) - diagnostic.messageChain!.messageText; - const sourceLine = diagnostic.sourceLine; - const brief = diagnostic.messageChain - ? // @ts-ignore Deno tells us `messageText` does not exist on `messageChain`, but it 100% is (bug with deno) - diagnostic.messageChain.next![0].messageText - : ""; - if (filename && start) { - return `${filename}:${start.line}:${start.character} - ${messageText}\n${brief}\n${sourceLine}\n`; - } else { - return `${messageText}\n${brief}\n`; - } - } -} - async function emit(file: string): Promise<{ - diagnostics: Deno.Diagnostic[]; + diagnostics: string; files: Record; }> { const { diagnostics, files } = await Deno.emit(file, { @@ -52,8 +30,9 @@ async function emit(file: string): Promise<{ baseUrl: "./", }, }); + const formattedDiagnostics = Deno.formatDiagnostics(diagnostics); return { - diagnostics, + diagnostics: formattedDiagnostics, files, }; } @@ -123,9 +102,8 @@ function write(filename: string, fileContent: string): void { async function compile(file: string): Promise { const { diagnostics, files } = await emit(file); - const errorMsg = checkDiagnostics(diagnostics); - if (errorMsg) { - return errorMsg; + if (diagnostics !== "") { + return diagnostics; } const fileKeys = Object.keys(files).filter((filename) => { @@ -159,7 +137,8 @@ console.log("Starting compilation..."); const errorMsg = await compile("./src/mod.ts"); if (errorMsg) { - throw new Error(errorMsg); + console.error(errorMsg); + Deno.exit(1); } console.log("Finished compilation"); From c6a702250f2961286c85a1d3feb8ca81a46c98a8 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Wed, 30 Jun 2021 01:04:26 +0100 Subject: [PATCH 06/38] fix compile.ts and src imports --- compile.ts | 2 +- src/componentLogic/DestinyFallback.ts | 4 ++-- src/reactive/ReactiveValue/internalSetReactiveValue.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compile.ts b/compile.ts index 803f529..332b06a 100644 --- a/compile.ts +++ b/compile.ts @@ -10,7 +10,7 @@ async function emit(file: string): Promise<{ compilerOptions: { declaration: true, sourceMap: true, - target: "es2021", + target: "es2020", module: "esnext", lib: [ "dom", diff --git a/src/componentLogic/DestinyFallback.ts b/src/componentLogic/DestinyFallback.ts index 7f4991c..c29d09b 100644 --- a/src/componentLogic/DestinyFallback.ts +++ b/src/componentLogic/DestinyFallback.ts @@ -5,8 +5,8 @@ import { getElementData } from "./elementData.ts"; import { describeType } from "../utils/describeType.ts"; import { ReactiveValue } from "../reactive/ReactiveValue/_ReactiveValue.ts"; import { isRenderable } from "../typeChecks/isRenderable.ts"; -import { componentOrComponentModule } from "./componentOrComponentModule.jt"; -import type { Renderable } from "../parsing/Renderable.t"; +import { componentOrComponentModule } from "./componentOrComponentModule.ts"; +import type { Renderable } from "../parsing/Renderable.ts"; export class DestinyFallback extends Component { static override captureProps = true; diff --git a/src/reactive/ReactiveValue/internalSetReactiveValue.ts b/src/reactive/ReactiveValue/internalSetReactiveValue.ts index a4d9819..d75f1ab 100644 --- a/src/reactive/ReactiveValue/internalSetReactiveValue.ts +++ b/src/reactive/ReactiveValue/internalSetReactiveValue.ts @@ -1,5 +1,5 @@ import type { ReadonlyReactiveValue } from "./_ReadonlyReactiveValue.ts"; -import type { TReactiveValueUpdater } from "./TReactiveValueUpdater"; +import type { TReactiveValueUpdater } from "./TReactiveValueUpdater.ts"; export const internalSetReactiveValue = new class { #inner = new WeakMap< From 0423c8def0c0724ba26bbeecc71294f5a7e72ec2 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Thu, 1 Jul 2021 00:25:03 +0100 Subject: [PATCH 07/38] add example of using destiny with node TMP --- node-usage/.gitignore | 3 +++ node-usage/README.md | 33 +++++++++++++++++++++++++++++++ node-usage/compile.ts | 11 +++++++++++ node-usage/components/App.ts | 24 +++++++++++++++++++++++ node-usage/index.html | 9 +++++++++ node-usage/package.json | 19 ++++++++++++++++++ node-usage/tsconfig.json | 10 ++++++++++ node-usage/webpack.config.js | 38 ++++++++++++++++++++++++++++++++++++ 8 files changed, 147 insertions(+) create mode 100644 node-usage/.gitignore create mode 100644 node-usage/README.md create mode 100644 node-usage/compile.ts create mode 100644 node-usage/components/App.ts create mode 100644 node-usage/index.html create mode 100644 node-usage/package.json create mode 100644 node-usage/tsconfig.json create mode 100644 node-usage/webpack.config.js diff --git a/node-usage/.gitignore b/node-usage/.gitignore new file mode 100644 index 0000000..c12c288 --- /dev/null +++ b/node-usage/.gitignore @@ -0,0 +1,3 @@ +package-lock.json +public +node_modules \ No newline at end of file diff --git a/node-usage/README.md b/node-usage/README.md new file mode 100644 index 0000000..b5f38ef --- /dev/null +++ b/node-usage/README.md @@ -0,0 +1,33 @@ +## Usage with Deno + +Ensure you're on latest deno verion, 1.11.2 + +This setup uses: + + - `compile.ts` to transpile your component. This the exaxt same as using webpack/tsc + - `components/App.ts` - the component to use on your frontend + - `index.html` - the view to serve your bundled file + +```shell +# add .d.ts to globalthis import in dist/mod.d.ts +$ deno run -A --unstable compile.ts +$ npx serve-http +# go to browser +``` + +## Usage with Node + +This will work AS IS + +This setup uses: + + - `tsconfig.json` used in conjunction with webpack + - `webpack.config.js` - uses to tranpsile your component + - `components/App.ts` - the component to use on your frontend + - `index.html` - the view to serve your bundled file + +```shell +$ node_modules/.bin/webpack --config webpack.config.js +$ npx serve-http +# go to browser +``` \ No newline at end of file diff --git a/node-usage/compile.ts b/node-usage/compile.ts new file mode 100644 index 0000000..9ba1705 --- /dev/null +++ b/node-usage/compile.ts @@ -0,0 +1,11 @@ +const { diagnostics, files } = await Deno.emit("./components/App.ts", { + compilerOptions: { + "target": "es2020", + "module": "esnext", + "lib": ["dom", "DOM.Iterable", "ESNext"], + types: ["../src/mod.d.ts"] + } +}) +const fd = await Deno.formatDiagnostics(diagnostics) +console.log(fd) +// console.log(files) \ No newline at end of file diff --git a/node-usage/components/App.ts b/node-usage/components/App.ts new file mode 100644 index 0000000..7ca1ee5 --- /dev/null +++ b/node-usage/components/App.ts @@ -0,0 +1,24 @@ +import { Component, css, html } from "../../dist/mod.js"; + +class CustomP extends Component<{ + customText: string +}> { + static override styles = css` + p { + color: red; + } + ` + + template = html`

${this.customText}

` +} + +class AppRoot extends Component { + + override template = html` +
+ <${CustomP} prop:customText=${"hello"}> +
+ `; +} + +customElements.define("app-root", AppRoot) \ No newline at end of file diff --git a/node-usage/index.html b/node-usage/index.html new file mode 100644 index 0000000..5f28f21 --- /dev/null +++ b/node-usage/index.html @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/node-usage/package.json b/node-usage/package.json new file mode 100644 index 0000000..cd22aff --- /dev/null +++ b/node-usage/package.json @@ -0,0 +1,19 @@ +{ + "name": "usage", + "version": "1.0.0", + "description": "", + "main": "webpack.config.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "devDependencies": { + "css-loader": "^5.2.6", + "style-loader": "^3.0.0", + "ts-loader": "^9.2.3", + "typescript": "^4.3.4", + "webpack": "^5.41.1", + "webpack-cli": "^4.7.2" + } +} diff --git a/node-usage/tsconfig.json b/node-usage/tsconfig.json new file mode 100644 index 0000000..3fbc6c9 --- /dev/null +++ b/node-usage/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "target": "es2020", + "module": "esnext", + "lib": ["dom", "DOM.Iterable", "ESNext"], + }, + "include": [ + "components/App.ts" + ] + } \ No newline at end of file diff --git a/node-usage/webpack.config.js b/node-usage/webpack.config.js new file mode 100644 index 0000000..64035fb --- /dev/null +++ b/node-usage/webpack.config.js @@ -0,0 +1,38 @@ +module.exports = { + entry: { + app: "./components/App.ts", + }, + /* So having this makes it work, but if we remove this, bundle, then start server, we get error in console, this is because Webpack is minifying the class and it's trying to name the custom element after the class name*/ + // optimization: { + // minimize: false + // }, + output: { + filename: "[name].js", + path: __dirname + "/public/javascripts/", + }, + module: { + rules: [ + { + test: /\.css$/, + use: [ + "style-loader", + { + loader: "css-loader", + options: { + modules: true, + importLoaders: 1, + }, + }, + ], + }, + { + test: /\.ts?$/, + use: "ts-loader", + exclude: /node_modules/, + }, + ], + }, + resolve: { + extensions: [".js", ".jsx", ".css", ".tsx"], + }, +}; \ No newline at end of file From 85ebccdf82e4141c3d51c881d00620813e6a13cd Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Thu, 1 Jul 2021 00:46:58 +0100 Subject: [PATCH 08/38] im sorry ok okku --- node-usage/README.md | 4 ++++ node-usage/webpack.config.js | 15 +-------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/node-usage/README.md b/node-usage/README.md index b5f38ef..0199d18 100644 --- a/node-usage/README.md +++ b/node-usage/README.md @@ -8,6 +8,8 @@ This setup uses: - `components/App.ts` - the component to use on your frontend - `index.html` - the view to serve your bundled file +Change the import in components/App.ts to point to `../src/mod.ts` + ```shell # add .d.ts to globalthis import in dist/mod.d.ts $ deno run -A --unstable compile.ts @@ -15,6 +17,8 @@ $ npx serve-http # go to browser ``` +NOTE this doesnt work, because compile.ts doesnt write the transpiled files. Because we're using deno.emit, we aren't bundling + ## Usage with Node This will work AS IS diff --git a/node-usage/webpack.config.js b/node-usage/webpack.config.js index 64035fb..db65560 100644 --- a/node-usage/webpack.config.js +++ b/node-usage/webpack.config.js @@ -12,19 +12,6 @@ module.exports = { }, module: { rules: [ - { - test: /\.css$/, - use: [ - "style-loader", - { - loader: "css-loader", - options: { - modules: true, - importLoaders: 1, - }, - }, - ], - }, { test: /\.ts?$/, use: "ts-loader", @@ -33,6 +20,6 @@ module.exports = { ], }, resolve: { - extensions: [".js", ".jsx", ".css", ".tsx"], + extensions: [".ts"], }, }; \ No newline at end of file From c19747d39568539bbc086484b26b2b66fa7e515b Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Thu, 1 Jul 2021 15:01:48 +0100 Subject: [PATCH 09/38] update examples, add browser example --- examples/.gitignore | 3 ++ {node-usage => examples}/README.md | 21 +++++++++- examples/browser/components/App.js | 22 +++++++++++ examples/browser/index.html | 9 +++++ examples/deno/compile.ts | 21 ++++++++++ .../deno}/components/App.ts | 2 +- examples/deno/components/app.js | 38 +++++++++++++++++++ examples/deno/components/deps.js | 1 + examples/deno/components/deps.ts | 1 + examples/deno/index.html | 9 +++++ examples/node/components/App.ts | 24 ++++++++++++ {node-usage => examples/node}/index.html | 0 {node-usage => examples/node}/package.json | 0 {node-usage => examples/node}/tsconfig.json | 0 .../node}/webpack.config.js | 0 node-usage/.gitignore | 3 -- node-usage/compile.ts | 11 ------ 17 files changed, 148 insertions(+), 17 deletions(-) create mode 100644 examples/.gitignore rename {node-usage => examples}/README.md (65%) create mode 100644 examples/browser/components/App.js create mode 100644 examples/browser/index.html create mode 100644 examples/deno/compile.ts rename {node-usage => examples/deno}/components/App.ts (83%) create mode 100644 examples/deno/components/app.js create mode 100644 examples/deno/components/deps.js create mode 100644 examples/deno/components/deps.ts create mode 100644 examples/deno/index.html create mode 100644 examples/node/components/App.ts rename {node-usage => examples/node}/index.html (100%) rename {node-usage => examples/node}/package.json (100%) rename {node-usage => examples/node}/tsconfig.json (100%) rename {node-usage => examples/node}/webpack.config.js (100%) delete mode 100644 node-usage/.gitignore delete mode 100644 node-usage/compile.ts diff --git a/examples/.gitignore b/examples/.gitignore new file mode 100644 index 0000000..91e83a4 --- /dev/null +++ b/examples/.gitignore @@ -0,0 +1,3 @@ +node/package-lock.json +node/public +node/node_modules \ No newline at end of file diff --git a/node-usage/README.md b/examples/README.md similarity index 65% rename from node-usage/README.md rename to examples/README.md index 0199d18..05e58b2 100644 --- a/node-usage/README.md +++ b/examples/README.md @@ -1,5 +1,9 @@ +Make sure to create the dist firsT: npm run compile + ## Usage with Deno +NOTE: This *transpiles*, and DOES NOT *bundle* AND keeps the RAW LINKS to destiny + Ensure you're on latest deno verion, 1.11.2 This setup uses: @@ -8,10 +12,10 @@ This setup uses: - `components/App.ts` - the component to use on your frontend - `index.html` - the view to serve your bundled file -Change the import in components/App.ts to point to `../src/mod.ts` ```shell -# add .d.ts to globalthis import in dist/mod.d.ts +$ cd examples/deno +$ cp -r ../../dist . $ deno run -A --unstable compile.ts $ npx serve-http # go to browser @@ -34,4 +38,17 @@ This setup uses: $ node_modules/.bin/webpack --config webpack.config.js $ npx serve-http # go to browser +``` + +## Usage With Browser + +This setup uses: + + - `components/App.ts` - the component to use on your frontend + - `index.html` - the view to serve your bundled file + +```shell +$ cd examples/browser +$ cp -r ../../dist . +$ npx serve-http ``` \ No newline at end of file diff --git a/examples/browser/components/App.js b/examples/browser/components/App.js new file mode 100644 index 0000000..9f44770 --- /dev/null +++ b/examples/browser/components/App.js @@ -0,0 +1,22 @@ +import { Component, css, html } from "../../dist/mod.js"; + +class CustomP extends Component { + static styles = css` + p { + color: red; + } + ` + + template = html`

${this.customText}

` +} + +class AppRoot extends Component { + + template = html` +
+ <${CustomP} prop:customText=${"hello"}> +
+ `; +} + +customElements.define("app-root", AppRoot) \ No newline at end of file diff --git a/examples/browser/index.html b/examples/browser/index.html new file mode 100644 index 0000000..ad68015 --- /dev/null +++ b/examples/browser/index.html @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/examples/deno/compile.ts b/examples/deno/compile.ts new file mode 100644 index 0000000..70de270 --- /dev/null +++ b/examples/deno/compile.ts @@ -0,0 +1,21 @@ +/** + * This approach would be different given our component imports from a url. + * The user would use crumpets to transpile the files + */ + +const { diagnostics, files } = await Deno.emit("./components/App.ts", { + compilerOptions: { + "target": "es2020", + "module": "esnext", + "lib": ["dom", "DOM.Iterable", "ESNext"], + "sourceMap": false + }, +}) +const fd = await Deno.formatDiagnostics(diagnostics) +console.log(fd) +const key = Object.keys(files).find(f => f.includes("App.ts")) as string +files[key] = files[key].replace("deps.ts", "deps.js") +const key2 = Object.keys(files).find(f => f.includes("deps.ts")) as string +files[key2] = files[key2].replace("src/mod.ts", "dist/mod.js") +Deno.writeFileSync("./components/app.js", new TextEncoder().encode(files[key])) +Deno.writeFileSync("./components/deps.js", new TextEncoder().encode(files[key2])) \ No newline at end of file diff --git a/node-usage/components/App.ts b/examples/deno/components/App.ts similarity index 83% rename from node-usage/components/App.ts rename to examples/deno/components/App.ts index 7ca1ee5..1802599 100644 --- a/node-usage/components/App.ts +++ b/examples/deno/components/App.ts @@ -1,4 +1,4 @@ -import { Component, css, html } from "../../dist/mod.js"; +import { Component, css, html } from "./deps.ts"; class CustomP extends Component<{ customText: string diff --git a/examples/deno/components/app.js b/examples/deno/components/app.js new file mode 100644 index 0000000..77889e7 --- /dev/null +++ b/examples/deno/components/app.js @@ -0,0 +1,38 @@ +import { Component, css, html } from "./deps.js"; +class CustomP extends Component { + constructor() { + super(...arguments); + Object.defineProperty(this, "template", { + enumerable: true, + configurable: true, + writable: true, + value: html `

${this.customText}

` + }); + } +} +Object.defineProperty(CustomP, "styles", { + enumerable: true, + configurable: true, + writable: true, + value: css ` + p { + color: red; + } + ` +}); +class AppRoot extends Component { + constructor() { + super(...arguments); + Object.defineProperty(this, "template", { + enumerable: true, + configurable: true, + writable: true, + value: html ` +
+ <${CustomP} prop:customText=${"hello"}> +
+ ` + }); + } +} +customElements.define("app-root", AppRoot); diff --git a/examples/deno/components/deps.js b/examples/deno/components/deps.js new file mode 100644 index 0000000..310ab1e --- /dev/null +++ b/examples/deno/components/deps.js @@ -0,0 +1 @@ +export { Component, css, html } from "../../../dist/mod.js"; diff --git a/examples/deno/components/deps.ts b/examples/deno/components/deps.ts new file mode 100644 index 0000000..e2c2631 --- /dev/null +++ b/examples/deno/components/deps.ts @@ -0,0 +1 @@ +export { Component, css, html } from "../../../src/mod.ts"; diff --git a/examples/deno/index.html b/examples/deno/index.html new file mode 100644 index 0000000..cc44550 --- /dev/null +++ b/examples/deno/index.html @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/examples/node/components/App.ts b/examples/node/components/App.ts new file mode 100644 index 0000000..9a80859 --- /dev/null +++ b/examples/node/components/App.ts @@ -0,0 +1,24 @@ +import { Component, css, html } from "../../../dist/mod.js"; + +class CustomP extends Component<{ + customText: string +}> { + static override styles = css` + p { + color: red; + } + ` + + template = html`

${this.customText}

` +} + +class AppRoot extends Component { + + override template = html` +
+ <${CustomP} prop:customText=${"hello"}> +
+ `; +} + +customElements.define("app-root", AppRoot) \ No newline at end of file diff --git a/node-usage/index.html b/examples/node/index.html similarity index 100% rename from node-usage/index.html rename to examples/node/index.html diff --git a/node-usage/package.json b/examples/node/package.json similarity index 100% rename from node-usage/package.json rename to examples/node/package.json diff --git a/node-usage/tsconfig.json b/examples/node/tsconfig.json similarity index 100% rename from node-usage/tsconfig.json rename to examples/node/tsconfig.json diff --git a/node-usage/webpack.config.js b/examples/node/webpack.config.js similarity index 100% rename from node-usage/webpack.config.js rename to examples/node/webpack.config.js diff --git a/node-usage/.gitignore b/node-usage/.gitignore deleted file mode 100644 index c12c288..0000000 --- a/node-usage/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -package-lock.json -public -node_modules \ No newline at end of file diff --git a/node-usage/compile.ts b/node-usage/compile.ts deleted file mode 100644 index 9ba1705..0000000 --- a/node-usage/compile.ts +++ /dev/null @@ -1,11 +0,0 @@ -const { diagnostics, files } = await Deno.emit("./components/App.ts", { - compilerOptions: { - "target": "es2020", - "module": "esnext", - "lib": ["dom", "DOM.Iterable", "ESNext"], - types: ["../src/mod.d.ts"] - } -}) -const fd = await Deno.formatDiagnostics(diagnostics) -console.log(fd) -// console.log(files) \ No newline at end of file From 3360ced3a109f49b9856c0af781247d96d1e1d72 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Thu, 1 Jul 2021 15:27:58 +0100 Subject: [PATCH 10/38] use crumpets --- compile.ts | 162 ++++++----------------------------------------------- deps.ts | 6 +- 2 files changed, 20 insertions(+), 148 deletions(-) diff --git a/compile.ts b/compile.ts index 332b06a..42e12f7 100644 --- a/compile.ts +++ b/compile.ts @@ -1,14 +1,10 @@ -import { ensureDirSync, fromFileUrlWin, relativeWin } from "./deps.ts"; +// transpile.ts +import { fromFileUrlWin, fromFileUrlUnix, Crumpets } from "./deps.ts"; -const encoder = new TextEncoder(); - -async function emit(file: string): Promise<{ - diagnostics: string; - files: Record; -}> { - const { diagnostics, files } = await Deno.emit(file, { - compilerOptions: { - declaration: true, +const crumpet = new Crumpets({ + rootFile: "./src/mod.ts", + compilerOptions: { + declaration: true, sourceMap: true, target: "es2020", module: "esnext", @@ -28,139 +24,15 @@ async function emit(file: string): Promise<{ "/dist/*": ["src/*"], }, baseUrl: "./", - }, - }); - const formattedDiagnostics = Deno.formatDiagnostics(diagnostics); - return { - diagnostics: formattedDiagnostics, - files, - }; -} - -/** - * Write a file to the dist directory. Replaces the following in the `filename`: - * - `src` with `dist` - * - `.ts.d.ts` with `.d.ts` - * - `.ts.js` with `.js` - * - * @param filename The file url of an emitted file. Must be the result of `emit` - * @param fileContent - The file content associated with `files[filename]` - */ -function write(filename: string, fileContent: string): void { - const outPath = filename.replace("src", "dist").replace(".ts.js", ".js") - .replace(".ts.d.ts", ".d.ts"); - if (outPath.endsWith(".d.ts") || outPath.endsWith(".js")) { // ensure directory(s) file is in, exists - const pathSplit = outPath.split("/"); - pathSplit.pop(); - const parentDirOfFile = pathSplit.join("/"); - const validPath = Deno.build.os === "windows" - ? fromFileUrlWin(parentDirOfFile) - : parentDirOfFile; // because `ensureDirSync` will throw an error if the path is a file url on windows - ensureDirSync(validPath); - } - - // Because imports inside the files are still using a .ts extension, we're going to make them use .js: - fileContent = fileContent.replace( - /import { ([a-zA-Z].*) } from "(.*)";/gm, - (_str, importValues, fileImportedFrom) => { - const jsImport = fileImportedFrom.replace(".ts", ".js"); - return `import { ${importValues} } from \"${jsImport}\";`; - }, - ); - fileContent = fileContent.replace( - /export { ([a-zA-Z].*) } from "(.*)";/gm, - (_str, importValues, fileImportedFrom) => { - const jsImport = fileImportedFrom.replace(".ts", ".js"); - return `export { ${importValues} } from \"${jsImport}\";`; - }, - ); - fileContent = fileContent.replace( - /import \"(.*)\";/gm, - (_str, importValue) => { - const jsRef = importValue.replace(".ts", ".js"); - return `import \"${jsRef}\";`; - }, - ); - fileContent = fileContent.replace( - /import\(\"(.*)\"\)/gm, - (_str, importValue) => { - const jsRef = importValue.replace(".ts", ".js"); - return `import(\"${jsRef}\")`; - }, - ); - /// - - const validPath = Deno.build.os === "windows" - ? fromFileUrlWin(outPath) - : outPath; // Same again - Deno.writeFileSync( - validPath, - encoder.encode(fileContent), - ); -} - -async function compile(file: string): Promise { - const { diagnostics, files } = await emit(file); - - if (diagnostics !== "") { - return diagnostics; - } - - const fileKeys = Object.keys(files).filter((filename) => { - if (filename.includes(".map")) { - return false; - } - return true; - }); - - // Write file - for (const filename of fileKeys) { - write(filename, files[filename]); - } -} - -const watchTimeouts: Record = {}; -function debounce(context: string, fn: () => Promise) { - if (watchTimeouts[context]) { - clearTimeout(watchTimeouts[context]); - } - watchTimeouts[context] = setTimeout(function () { - fn(); - }, 100); -} - -// -// -// - -console.log("Starting compilation..."); - -const errorMsg = await compile("./src/mod.ts"); -if (errorMsg) { - console.error(errorMsg); - Deno.exit(1); -} -console.log("Finished compilation"); - -const args = Deno.args; -if (args[0] === "--watch") { - console.log("Watching..."); - const watcher = Deno.watchFs("./src"); - for await (const event of watcher) { - if (event.kind !== "modify") { - continue; - } - const paths = event.paths; - const path = Deno.build.os === "windows" - ? relativeWin(".", paths[0]) - : paths[0]; - debounce(path, async () => { - const msg = await compile(path); - if (msg) { - console.error(msg); - } else { - console.log("Compiled " + path); - } - }); - } + }, +}); +// Overrite `write` function so instead of placing the transpiled file besides the source, we can move it into dist +// TODO :: if the dist dir doesnt exist, this will throw an error, first we need to check if the filepath exists, if not then create it +Crumpets.write = (filename: string, content: string) => { + const distPath = filename.replace("/src/", "/dist/") + const validWritablePath = Deno.build.os === "windows" + ? fromFileUrlWin(distPath) + : fromFileUrlUnix(distPath); + Deno.writeFileSync(validWritablePath, new TextEncoder().encode(content)) } +await crumpet.run(); \ No newline at end of file diff --git a/deps.ts b/deps.ts index 55256c1..ca0b7cc 100644 --- a/deps.ts +++ b/deps.ts @@ -1,3 +1,3 @@ -export { ensureDirSync } from "https://deno.land/std@0.97.0/fs/ensure_dir.ts" -export { fromFileUrl as fromFileUrlUnix } from "https://deno.land/std@0.97.0/path/posix.ts" -export { fromFileUrl as fromFileUrlWin, relative as relativeWin } from "https://deno.land/std@0.97.0/path/win32.ts" \ No newline at end of file +export { Crumpets } from "https://deno.land/x/crumpets@v2.1.0/mod.ts"; +export { fromFileUrl as fromFileUrlWin } from "https://deno.land/std@0.99.0/path/win32.ts"; +export { fromFileUrl as fromFileUrlUnix } from "https://deno.land/std@0.99.0/path/posix.ts"; \ No newline at end of file From c24c3283df5c9ec1505c97784e7092146bd30834 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Thu, 1 Jul 2021 15:37:30 +0100 Subject: [PATCH 11/38] remove files that were added in the merge, but not present in master.. woopsie daisy --- src/reactive/ReactivePrimitive.ts | 293 ------------------ src/reactive/reactiveObject/reactiveObject.ts | 29 -- src/reactive/types/IArrayValueType.ts | 9 - src/reactive/types/IReactive.ts | 8 - src/reactive/types/IReactiveEntity.ts | 6 - src/reactive/types/IReactiveObject.ts | 8 - src/reactive/types/IReactiveObjectFlag.ts | 5 - src/reactive/types/IReactiveValueType.ts | 14 - 8 files changed, 372 deletions(-) delete mode 100644 src/reactive/ReactivePrimitive.ts delete mode 100644 src/reactive/reactiveObject/reactiveObject.ts delete mode 100644 src/reactive/types/IArrayValueType.ts delete mode 100644 src/reactive/types/IReactive.ts delete mode 100644 src/reactive/types/IReactiveEntity.ts delete mode 100644 src/reactive/types/IReactiveObject.ts delete mode 100644 src/reactive/types/IReactiveObjectFlag.ts delete mode 100644 src/reactive/types/IReactiveValueType.ts diff --git a/src/reactive/ReactivePrimitive.ts b/src/reactive/ReactivePrimitive.ts deleted file mode 100644 index 1af645b..0000000 --- a/src/reactive/ReactivePrimitive.ts +++ /dev/null @@ -1,293 +0,0 @@ -import { IterableWeakMap } from "../utils/IterableWeakMap.ts"; -import { WeakMultiRef } from "../utils/WeakMultiRef.ts"; -import { computedConsumer } from "./computed.ts"; -import { concatIterators } from "../utils/concatIterators.ts"; - -type TReactivePrimitiveCallback = (newValue: T) => void; - -type TReactivePrimitiveUpdaterOptions = { - noUpdate: ReadonlyArray>, - force: boolean, -}; - -type TReactivePrimitiveUpdater = ( - value: T, - options?: Partial>, -) => void; - -const setValue = new class { - #inner = new WeakMap< - ReadonlyReactivePrimitive - >(); - - get( - key: ReadonlyReactivePrimitive - ) { - return this.#inner.get(key) as TReactivePrimitiveUpdater; - } - - set( - key: ReadonlyReactivePrimitive, - value: TReactivePrimitiveUpdater, - ) { - this.#inner.set(key, value); - } -}; - - -const stronglyHeldDependencies = new Map< - TReactivePrimitiveCallback, - ReadonlyReactivePrimitive ->(); - -const weaklyHeldDependencies = new IterableWeakMap< - WeakMultiRef, - ReadonlyReactivePrimitive ->(); - -export class ReadonlyReactivePrimitive { - /** The current value of the `ReactivePrimitive`. */ - #value: T; - - /** All the callbacks added to the `ReactivePrimitive`, which are to be called when the `value` updates. */ - readonly #callbacks: Set> = new Set; - - // eslint-disable-next-line @typescript-eslint/ban-types - readonly #consumers = new IterableWeakMap>(); - - readonly dependencies = new Map, VoidFunction>(); - - constructor ( - initialValue: T, - ) { - this.#value = initialValue; - setValue.set( - this, - (...args) => this.#set(...args), - ); - } - - /** - * Can be used to functionally update the value. - * @param value New value to be set - * @param noUpdate One or more callback methods you don't want to be called on this update. This can be useful for example when responding to DOM events: you wouldn't want to update the DOM with the new value on the same element that caused the udpate in the first place. - */ - #set ( - value: T, - options?: Partial>, - ): this { - const { - noUpdate, - force, - }: TReactivePrimitiveUpdaterOptions = { - noUpdate: [], - force: false, - ...options, - }; - if (force || !Object.is(value, this.#value)) { - this.#value = value; - - const callbacks = concatIterators( - this.#callbacks.values(), - this.#consumers.values(), - ); - for (const callback of callbacks) { - if (!noUpdate.includes(callback)) { - callback(value); - } - } - } - return this; - } - - /** - * Same as `this.value`. The current value of the `ReactivePrimitive`. - */ - valueOf (): T { - return this.value; - } - - /** - * When the object is attempted to be cast to a primitive, the current value of `this.value` is used as a hint. Obviously, if you're trying to cast a `ReactivePrimitive` into a `number`, it'll just cast `this.value` from a `string` to a `number`. - */ - [Symbol.toPrimitive] (): T { - return this.value; - } - - /** - * When the object is attempted to be serialized using JSON.serialize(), the current value of `this.value` is returned. - */ - toJSON (): T { - return this.value; - } - - get [Symbol.toStringTag] (): string { - return `ReactivePrimitive<${typeof this.#value}>`; - } - - /** - * Instances of this class can be iterated over asynchronously; it will iterate over updates to the `value`. You can use this feature using `for-await-of`. - */ - async *[Symbol.asyncIterator] (): AsyncIterable { - while (true) { - yield await this.#nextUpdate(); - } - } - - /** - * Returns a Promise which will resolve the next time the `value` is updated. - */ - #nextUpdate (): Promise { - return new Promise(resolve => { - const cb = (v: T) => { - resolve(v); - this.#callbacks.delete(cb); - }; - this.#callbacks.add(cb); - }); - } - - /** - * Adds a callback to be called whenever the `value` of the `ReacativePrimitive` is updated. - * @param callback the function to be called on updates - * @param options.noFirstCall Set to true and the callback won't be fired right after being added. - * @param options.dependencies An array of objects that are modified by the callback provided. The callback will be garbage collected if all the provided objects are collected. If no dependencies are provided, the callback will never be automatically garbage collected and you have to unbind it yourself to avoid leaking memory. - */ - bind ( - callback: TReactivePrimitiveCallback, - options: { - noFirstCall?: boolean, - // eslint-disable-next-line @typescript-eslint/ban-types - dependents?: ReadonlyArray, - } = {}, - ): this { - if (!options.noFirstCall) callback(this.value); - - if (options.dependents?.length) { - const key = new WeakMultiRef(options.dependents); - this.#consumers.set(key, callback); - weaklyHeldDependencies.set(key, this); - } else { - this.#callbacks.add(callback); - stronglyHeldDependencies.set(callback, this); - } - - return this; - } - - unbind ( - callback: TReactivePrimitiveCallback, - ): void { - this.#callbacks.delete(callback); - stronglyHeldDependencies.delete(callback); - } - - /** The current value of the ReadonlyReactivePrimitive. */ - get value (): T { - if (computedConsumer) { - const {fn, consumer} = computedConsumer; - consumer.dependencies.set(this, fn); - this.#consumers.set( - consumer, - fn, - ); - } - - return this.#value; - } - - /** - * Creates a new `ReactivePrimitive` which is dependent on the `ReactivePrimitive` it's called on, and is updated as the original one is updated. The value of the original is tranformed by a callback function whose return value determines the value of the resulting `ReactivePrimitive`. - * @param callback A function which will be called whenever the original `ReactivePrimitive` is updated, and whose return value is assigned to the output `ReactivePrimitive` - */ - pipe ( - callback: (value: T) => K, - ): ReadonlyReactivePrimitive { - const reactor = new ReadonlyReactivePrimitive(callback(this.#value)); - const fn = () => setValue.get(reactor)(callback(this.#value)); - reactor.dependencies.set(this, fn); - this.#consumers.set( - reactor, - fn, - ); - return reactor; - } - - truthy ( - valueWhenTruthy: T, - valueWhenFalsy?: undefined, - ): ReadonlyReactivePrimitive - truthy ( - valueWhenTruthy: T, - valueWhenFalsy: K, - ): ReadonlyReactivePrimitive - truthy ( - valueWhenTruthy: T, - valueWhenFalsy: K, - ): ReadonlyReactivePrimitive { - return this.pipe(v => v ? valueWhenTruthy : valueWhenFalsy); - } - - falsy ( - valueWhenFalsy: T, - valueWhenTruthy?: undefined, - ): ReadonlyReactivePrimitive - falsy ( - valueWhenFalsy: T, - valueWhenTruthy: K, - ): ReadonlyReactivePrimitive - falsy ( - valueWhenFalsy: T, - valueWhenTruthy: K, - ): ReadonlyReactivePrimitive { - return this.pipe(v => v ? valueWhenTruthy : valueWhenFalsy); - } -} - -export class ReactivePrimitive extends ReadonlyReactivePrimitive { - /** - * Forces an update event to be dispatched. - */ - update (): this { - this.set( - this.value, - { force: true }, - ); - - return this; - } - - /** - * Can be used to functionally update the value. - * @param value New value to be set - * @param noUpdate One or more callback methods you don't want to be called on this update. This can be useful for example when responding to DOM events: you wouldn't want to update the DOM with the new value on the same element that caused the udpate in the first place. - */ - set ( - value: T, - options?: Partial>, - ): this { - setValue.get(this)(value, options); - - return this; - } - - /** The current value of the ReactivePrimitive. */ - get value (): T { - return super.value; - } - - /** The current `value` of the `ReactivePrimitive` */ - set value ( - value: T, - ) { - this.set(value); - } - - /** Cache for readonly getter */ - #readonly: ReadonlyReactivePrimitive | undefined; - - /** Readonly version of the instance that can't be mutated from the outside, but will be updated as the original instance updates. */ - get readonly (): ReadonlyReactivePrimitive { - return this.#readonly ?? (this.#readonly = this.pipe(v => v)); - } -} diff --git a/src/reactive/reactiveObject/reactiveObject.ts b/src/reactive/reactiveObject/reactiveObject.ts deleted file mode 100644 index 4a03b9d..0000000 --- a/src/reactive/reactiveObject/reactiveObject.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { reactive } from "../reactive.ts"; -import { reactiveObjectFlag } from "./reactiveObjectFlag.ts"; -import type { TReactiveEntity } from "../types/IReactiveEntity.ts"; -import type { TReactiveObject } from "../types/IReactiveObject.ts"; - -/** - * Takes an object, and passes each of its enumerable properties to `reactive()`, which makes the entire structure reactive recursively. - * - * @param input The object whose properties are to be made reactive - * @param parent Another reactive entity to which any reactive items created should report to when updating, so updates can correctly propagate to the highest level - */ -export function reactiveObject, K = unknown> ( - input: T, - parent?: TReactiveEntity, -): TReactiveObject { - // TS is incapable of figuring out the type correctly here, so it will throw a runtime error instead. - if (![null, Object].includes(input.constructor as ObjectConstructor)) { - throw new TypeError(`Illegal object passed to reactiveObject. Reactive objects must be made with objects that have \`Object\` or \`null\` as their prototype, but it was \`${input.constructor.name}\`. Alternatively, wrap the object using ReactivePrimitive.`); - } - - const result = Object.fromEntries( - Object - .entries(input) - .map(entry => (entry[1] = reactive(entry[1], {parent}), entry)) - ) as TReactiveObject; - result[reactiveObjectFlag] = true; - - return result; -} diff --git a/src/reactive/types/IArrayValueType.ts b/src/reactive/types/IArrayValueType.ts deleted file mode 100644 index 565fb54..0000000 --- a/src/reactive/types/IArrayValueType.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { TSpecialCaseObject } from "../reactiveObject/specialCaseObjects.ts"; -import type { TReactiveValueType } from "./IReactiveValueType.ts"; -import type { TPrimitive } from "./IPrimitive.ts"; - -export type TArrayValueType = ( - T extends TPrimitive | TSpecialCaseObject - ? T - : TReactiveValueType -); diff --git a/src/reactive/types/IReactive.ts b/src/reactive/types/IReactive.ts deleted file mode 100644 index fa2e090..0000000 --- a/src/reactive/types/IReactive.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { ReadonlyReactiveArray, ReadonlyReactivePrimitive } from "../../mod.ts"; -import type { TReactiveObject } from "./IReactiveObject.ts"; - -export type TReactive = ( - | ReadonlyReactiveArray - | ReadonlyReactivePrimitive - | TReactiveObject -); diff --git a/src/reactive/types/IReactiveEntity.ts b/src/reactive/types/IReactiveEntity.ts deleted file mode 100644 index 9fb8d7c..0000000 --- a/src/reactive/types/IReactiveEntity.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ReadonlyReactiveArray, ReactivePrimitive } from "../../mod.ts"; - -export type TReactiveEntity = ( - | ReactivePrimitive - | ReadonlyReactiveArray -); diff --git a/src/reactive/types/IReactiveObject.ts b/src/reactive/types/IReactiveObject.ts deleted file mode 100644 index 9eda723..0000000 --- a/src/reactive/types/IReactiveObject.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { TReactiveObjectFlag } from "./IReactiveObjectFlag.ts"; -import type { TReactiveValueType } from "./IReactiveValueType.ts"; - -export type TReactiveObject | unknown> = ( - { - [P in keyof T]: TReactiveValueType; - } & TReactiveObjectFlag -); diff --git a/src/reactive/types/IReactiveObjectFlag.ts b/src/reactive/types/IReactiveObjectFlag.ts deleted file mode 100644 index 0955e85..0000000 --- a/src/reactive/types/IReactiveObjectFlag.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { reactiveObjectFlag } from "../reactiveObject/reactiveObjectFlag.ts"; - -export type TReactiveObjectFlag = { - [reactiveObjectFlag]: true, -}; diff --git a/src/reactive/types/IReactiveValueType.ts b/src/reactive/types/IReactiveValueType.ts deleted file mode 100644 index 840f915..0000000 --- a/src/reactive/types/IReactiveValueType.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { ReactiveArray, ReactivePrimitive } from "../../mod.ts"; -import type { TSpecialCaseObject } from "../reactiveObject/specialCaseObjects.ts"; -import type { TReactiveObject } from "./IReactiveObject.ts"; -import type { TReactive } from "./IReactive.ts"; - -export type TReactiveValueType = ( - T extends TReactive ? T : - T extends TSpecialCaseObject ? ReactivePrimitive : - T extends Promise ? ReactivePrimitive : - T extends Array ? ReactiveArray : - T extends Record ? TReactiveObject : - T extends boolean ? ReactivePrimitive : - ReactivePrimitive -); From a8bba7dcba1e391c1269a0192fb743b22702ffb1 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Thu, 1 Jul 2021 21:04:01 +0100 Subject: [PATCH 12/38] few fixes --- compile.ts | 62 +++++++++++++++++++++------- deps.ts | 2 +- src/_examples/components/app-root.ts | 2 +- 3 files changed, 48 insertions(+), 18 deletions(-) diff --git a/compile.ts b/compile.ts index 42e12f7..a23ac5d 100644 --- a/compile.ts +++ b/compile.ts @@ -1,10 +1,22 @@ // transpile.ts -import { fromFileUrlWin, fromFileUrlUnix, Crumpets } from "./deps.ts"; +import { Crumpets, fromFileUrlUnix, fromFileUrlWin } from "./deps.ts"; -const crumpet = new Crumpets({ - rootFile: "./src/mod.ts", - compilerOptions: { - declaration: true, +const fromFileUrl = Deno.build.os === "windows" + ? fromFileUrlWin + : fromFileUrlUnix; +const encoder = new TextEncoder(); + +async function compile( + rootFile: string, + directoryToWatch: string, + watch: boolean, +) { + const crumpet = new Crumpets({ + rootFile, + startWebSocketServer: true, + directoryToWatch, + compilerOptions: { + declaration: true, sourceMap: true, target: "es2020", module: "esnext", @@ -24,15 +36,33 @@ const crumpet = new Crumpets({ "/dist/*": ["src/*"], }, baseUrl: "./", - }, -}); -// Overrite `write` function so instead of placing the transpiled file besides the source, we can move it into dist -// TODO :: if the dist dir doesnt exist, this will throw an error, first we need to check if the filepath exists, if not then create it -Crumpets.write = (filename: string, content: string) => { - const distPath = filename.replace("/src/", "/dist/") - const validWritablePath = Deno.build.os === "windows" - ? fromFileUrlWin(distPath) - : fromFileUrlUnix(distPath); - Deno.writeFileSync(validWritablePath, new TextEncoder().encode(content)) + }, + }); + + // Overrite `write` function so instead of placing the transpiled file besides the source, we can move it into dist + Crumpets.write = (filename: string, content: string) => { + console.log(filename); + const distPath = filename.replace("/src/", "/dist/"); + const validWritablePath = fromFileUrl(distPath); + try { + Deno.writeFileSync(validWritablePath, encoder.encode(content)); + } catch (e) { + if (e instanceof Deno.errors.NotFound) { + const dirPathSplit = distPath.split("/"); + dirPathSplit.pop(); + const dirPath = dirPathSplit.join("/"); + Deno.mkdirSync(fromFileUrl(dirPath), { recursive: true }); + Deno.writeFileSync(validWritablePath, encoder.encode(content)); + } + } + }; + + await crumpet.run(); + + if (watch) { + await crumpet.watch(); + } } -await crumpet.run(); \ No newline at end of file + +await compile("./src/mod.ts", "./src", false); +await compile("./src/_examples/main.ts", "./src", Deno.args[0] === "--watch"); diff --git a/deps.ts b/deps.ts index ca0b7cc..0b9ab2c 100644 --- a/deps.ts +++ b/deps.ts @@ -1,3 +1,3 @@ -export { Crumpets } from "https://deno.land/x/crumpets@v2.1.0/mod.ts"; +export { Crumpets } from "https://deno.land/x/crumpets@v2.1.2/mod.ts"; export { fromFileUrl as fromFileUrlWin } from "https://deno.land/std@0.99.0/path/win32.ts"; export { fromFileUrl as fromFileUrlUnix } from "https://deno.land/std@0.99.0/path/posix.ts"; \ No newline at end of file diff --git a/src/_examples/components/app-root.ts b/src/_examples/components/app-root.ts index 3604dc3..b55d5b7 100644 --- a/src/_examples/components/app-root.ts +++ b/src/_examples/components/app-root.ts @@ -1,4 +1,4 @@ -import { Component, html, css } from "../../../mod.ts"; +import { Component, html, css } from "../../mod.ts"; import TabView from "./tab-view.ts"; From 951a647ae415e024a8b4a5f6f9a5a19d556c60c7 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Thu, 1 Jul 2021 21:22:14 +0100 Subject: [PATCH 13/38] Fix examples and watch --- compile.ts | 4 ++-- package.json | 2 +- src/_examples/components/time-diff.ts | 2 +- src/mod.ts | 9 +++++++++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/compile.ts b/compile.ts index a23ac5d..731e971 100644 --- a/compile.ts +++ b/compile.ts @@ -64,5 +64,5 @@ async function compile( } } -await compile("./src/mod.ts", "./src", false); -await compile("./src/_examples/main.ts", "./src", Deno.args[0] === "--watch"); +const directoryToWatch = "./src" +await compile("./src/mod.ts", directoryToWatch, false); diff --git a/package.json b/package.json index 163d539..5ae555c 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint": "deno lint --ignore=dist", "test": "echo \"Error: no test specified\" && exit 1", "compile": "deno run --allow-read=. --allow-write=dist --unstable compile.ts", - "watch": "deno run --allow-read=. --allow-write=dist --unstable compile.ts --watch" + "watch": "deno run --allow-read=. --allow-write=dist --unstable --allow-net=deno.land,127.0.0.1:1777 compile.ts --watch" }, "keywords": [ "javascript", diff --git a/src/_examples/components/time-diff.ts b/src/_examples/components/time-diff.ts index 8c63e40..c107673 100644 --- a/src/_examples/components/time-diff.ts +++ b/src/_examples/components/time-diff.ts @@ -1,4 +1,4 @@ -import { Component, html, reactive, computed } from "../../../mod.ts"; +import { Component, html, reactive, computed } from "../../mod.ts"; import { inputStyles } from "./inputStyles.ts"; diff --git a/src/mod.ts b/src/mod.ts index 3328266..c67e9f1 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -23,3 +23,12 @@ export type { TMakeReactiveProperties } from "./reactive/reactiveProperties/TMak export type { TReactiveEntity } from "./reactive/types/TReactiveEntity.ts"; export type { TReactive } from "./reactive/types/TReactive.ts"; export type { TemplateResult } from "./parsing/TemplateResult.ts"; + +// Import some example files that aren't included in the dependency free, so we can compile them +import "./_examples/main.ts" +import "./_examples/components/visitor-demo.ts" +import "./_examples/components/to-do/_to-do.ts" +import "./_examples/components/array-demo.ts" +import "./_examples/components/time-diff.ts" +import "./_examples/components/async-demo.ts" +import "./_examples/components/window-manager/_window-manager.ts" From e80958e4976de12652e4c00c045dc12ac60302a4 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Thu, 1 Jul 2021 21:47:27 +0100 Subject: [PATCH 14/38] move examples imports into its own file to reduce dep tree --- compile.ts | 1 + src/examples_mod.ts | 8 ++++++++ src/mod.ts | 9 --------- 3 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 src/examples_mod.ts diff --git a/compile.ts b/compile.ts index 731e971..7ba6566 100644 --- a/compile.ts +++ b/compile.ts @@ -66,3 +66,4 @@ async function compile( const directoryToWatch = "./src" await compile("./src/mod.ts", directoryToWatch, false); +await compile("./src/examples_mod.ts", directoryToWatch, Deno.args[0] === "--watch") diff --git a/src/examples_mod.ts b/src/examples_mod.ts new file mode 100644 index 0000000..eafcca9 --- /dev/null +++ b/src/examples_mod.ts @@ -0,0 +1,8 @@ +// Import some example files that aren't included in the dependency free, so we can compile them +import "./_examples/main.ts" +import "./_examples/components/visitor-demo.ts" +import "./_examples/components/to-do/_to-do.ts" +import "./_examples/components/array-demo.ts" +import "./_examples/components/time-diff.ts" +import "./_examples/components/async-demo.ts" +import "./_examples/components/window-manager/_window-manager.ts" \ No newline at end of file diff --git a/src/mod.ts b/src/mod.ts index c67e9f1..3328266 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -23,12 +23,3 @@ export type { TMakeReactiveProperties } from "./reactive/reactiveProperties/TMak export type { TReactiveEntity } from "./reactive/types/TReactiveEntity.ts"; export type { TReactive } from "./reactive/types/TReactive.ts"; export type { TemplateResult } from "./parsing/TemplateResult.ts"; - -// Import some example files that aren't included in the dependency free, so we can compile them -import "./_examples/main.ts" -import "./_examples/components/visitor-demo.ts" -import "./_examples/components/to-do/_to-do.ts" -import "./_examples/components/array-demo.ts" -import "./_examples/components/time-diff.ts" -import "./_examples/components/async-demo.ts" -import "./_examples/components/window-manager/_window-manager.ts" From ab230c81f454c0c99a850dcf1d68a1b175c74602 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Thu, 1 Jul 2021 21:53:53 +0100 Subject: [PATCH 15/38] dont use ws server when watching --- compile.ts | 1 - package.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/compile.ts b/compile.ts index 7ba6566..5acaff7 100644 --- a/compile.ts +++ b/compile.ts @@ -13,7 +13,6 @@ async function compile( ) { const crumpet = new Crumpets({ rootFile, - startWebSocketServer: true, directoryToWatch, compilerOptions: { declaration: true, diff --git a/package.json b/package.json index 5ae555c..163d539 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint": "deno lint --ignore=dist", "test": "echo \"Error: no test specified\" && exit 1", "compile": "deno run --allow-read=. --allow-write=dist --unstable compile.ts", - "watch": "deno run --allow-read=. --allow-write=dist --unstable --allow-net=deno.land,127.0.0.1:1777 compile.ts --watch" + "watch": "deno run --allow-read=. --allow-write=dist --unstable compile.ts --watch" }, "keywords": [ "javascript", From ccaedba5a8bb03650efa5a8a5f42989ccb6447c6 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Tue, 6 Jul 2021 10:56:49 +0100 Subject: [PATCH 16/38] improve deno examples --- examples/README.md | 89 +++++++++++++++++++++++++++++--- examples/deno/compile.ts | 11 ++-- examples/deno/components/App.ts | 4 +- examples/deno/components/app.js | 38 -------------- examples/deno/components/deps.js | 1 - examples/deno/components/deps.ts | 1 - examples/deno/transpile.ts | 21 ++++++++ examples/deno/tsconfig.json | 9 ++++ 8 files changed, 119 insertions(+), 55 deletions(-) delete mode 100644 examples/deno/components/app.js delete mode 100644 examples/deno/components/deps.js delete mode 100644 examples/deno/components/deps.ts create mode 100644 examples/deno/transpile.ts create mode 100644 examples/deno/tsconfig.json diff --git a/examples/README.md b/examples/README.md index 05e58b2..dadfe08 100644 --- a/examples/README.md +++ b/examples/README.md @@ -2,27 +2,102 @@ Make sure to create the dist firsT: npm run compile ## Usage with Deno -NOTE: This *transpiles*, and DOES NOT *bundle* AND keeps the RAW LINKS to destiny +Note that this approach in this example uses the 1st method in the "Bundle" section, because from a user perspective, this is a lot simpler -Ensure you're on latest deno verion, 1.11.2 +### Bundle + +There is 2 ways you can bundle your client side scripts using Deno: + +#### 1 + +Use `deno bundle`: + +```shell +$ cd examples/deno +$ deno bundle --config tsconfig.json components/App.ts components/app.js +$ npx serve-http +``` + +Note that currently, there are multiple issues with this: + +https://github.com/denoland/deno/issues/11286 +https://github.com/denoland/deno/issues/11287 + +#### 2 + +Using `Deno.emit`: + +```ts +const { diagnostics, files } = await Deno.emit("./components/App.ts", { + bundle: "classic", + compilerOptions: { + "target": "es2020", + "module": "esnext", + "lib": ["dom", "DOM.Iterable", "ESNext"], + "sourceMap": false + }, +}) +const fd = await Deno.formatDiagnostics(diagnostics) +console.log(fd) +const fileKey = Object.keys(files)[0] +const content = files[fileKey] +const encoder = new TextEncoder() +Deno.writeFileSync("./components/app.js", encoder.encode(content)) +``` + +```shell +$ deno run -A --unstable compile.ts +$ npx serve-http +``` + +Note that currently, there are multiple issues with this: + +https://github.com/denoland/deno/issues/11286 +https://github.com/denoland/deno/issues/11287 + +## Transpile + +NOTE: This *transpiles*, and DOES NOT *bundle*, AND keeps the RAW LINKS to destiny. For example, everytime a user requests the js files, a new request will be made to the dependencies cdn. This setup uses: - - `compile.ts` to transpile your component. This the exaxt same as using webpack/tsc + - `compile.ts` to transpile your component. This the exact same as using webpack (without bundling) and tsc - `components/App.ts` - the component to use on your frontend - `index.html` - the view to serve your bundled file +Note that our source code files are slightly different this time, because as we are transpiling, it is going to generate a new file *per* dependency. Here's how you can do it: + +```ts +// components/App.ts +import { Component, css, html, register } from "./dist/mod.js"; // or the cdn +class CustomP extends Component<{ + customText: string +}> { + static override styles = css` + p { + color: red; + } + ` + template = html`

${this.customText}

` +} +class AppRoot extends Component { + override template = html` +
+ <${CustomP} prop:customText=${"hello"}> +
+ `; +} +register(AppRoot) +``` ```shell $ cd examples/deno -$ cp -r ../../dist . -$ deno run -A --unstable compile.ts +$ cp -r ../../dist . # only needed because npx cannot get files in parent directories +$ deno run -A --unstable transpile.ts $ npx serve-http # go to browser ``` -NOTE this doesnt work, because compile.ts doesnt write the transpiled files. Because we're using deno.emit, we aren't bundling - ## Usage with Node This will work AS IS diff --git a/examples/deno/compile.ts b/examples/deno/compile.ts index 70de270..cce5a20 100644 --- a/examples/deno/compile.ts +++ b/examples/deno/compile.ts @@ -4,6 +4,7 @@ */ const { diagnostics, files } = await Deno.emit("./components/App.ts", { + bundle: "classic", compilerOptions: { "target": "es2020", "module": "esnext", @@ -13,9 +14,7 @@ const { diagnostics, files } = await Deno.emit("./components/App.ts", { }) const fd = await Deno.formatDiagnostics(diagnostics) console.log(fd) -const key = Object.keys(files).find(f => f.includes("App.ts")) as string -files[key] = files[key].replace("deps.ts", "deps.js") -const key2 = Object.keys(files).find(f => f.includes("deps.ts")) as string -files[key2] = files[key2].replace("src/mod.ts", "dist/mod.js") -Deno.writeFileSync("./components/app.js", new TextEncoder().encode(files[key])) -Deno.writeFileSync("./components/deps.js", new TextEncoder().encode(files[key2])) \ No newline at end of file +const fileKey = Object.keys(files)[0] +const content = files[fileKey] +const encoder = new TextEncoder() +Deno.writeFileSync("./components/app.js", encoder.encode(content)) diff --git a/examples/deno/components/App.ts b/examples/deno/components/App.ts index 1802599..4ae89e3 100644 --- a/examples/deno/components/App.ts +++ b/examples/deno/components/App.ts @@ -1,4 +1,4 @@ -import { Component, css, html } from "./deps.ts"; +import { Component, css, html, register } from "../../../src/mod.ts"; class CustomP extends Component<{ customText: string @@ -21,4 +21,4 @@ class AppRoot extends Component { `; } -customElements.define("app-root", AppRoot) \ No newline at end of file +register(AppRoot) \ No newline at end of file diff --git a/examples/deno/components/app.js b/examples/deno/components/app.js deleted file mode 100644 index 77889e7..0000000 --- a/examples/deno/components/app.js +++ /dev/null @@ -1,38 +0,0 @@ -import { Component, css, html } from "./deps.js"; -class CustomP extends Component { - constructor() { - super(...arguments); - Object.defineProperty(this, "template", { - enumerable: true, - configurable: true, - writable: true, - value: html `

${this.customText}

` - }); - } -} -Object.defineProperty(CustomP, "styles", { - enumerable: true, - configurable: true, - writable: true, - value: css ` - p { - color: red; - } - ` -}); -class AppRoot extends Component { - constructor() { - super(...arguments); - Object.defineProperty(this, "template", { - enumerable: true, - configurable: true, - writable: true, - value: html ` -
- <${CustomP} prop:customText=${"hello"}> -
- ` - }); - } -} -customElements.define("app-root", AppRoot); diff --git a/examples/deno/components/deps.js b/examples/deno/components/deps.js deleted file mode 100644 index 310ab1e..0000000 --- a/examples/deno/components/deps.js +++ /dev/null @@ -1 +0,0 @@ -export { Component, css, html } from "../../../dist/mod.js"; diff --git a/examples/deno/components/deps.ts b/examples/deno/components/deps.ts deleted file mode 100644 index e2c2631..0000000 --- a/examples/deno/components/deps.ts +++ /dev/null @@ -1 +0,0 @@ -export { Component, css, html } from "../../../src/mod.ts"; diff --git a/examples/deno/transpile.ts b/examples/deno/transpile.ts new file mode 100644 index 0000000..70de270 --- /dev/null +++ b/examples/deno/transpile.ts @@ -0,0 +1,21 @@ +/** + * This approach would be different given our component imports from a url. + * The user would use crumpets to transpile the files + */ + +const { diagnostics, files } = await Deno.emit("./components/App.ts", { + compilerOptions: { + "target": "es2020", + "module": "esnext", + "lib": ["dom", "DOM.Iterable", "ESNext"], + "sourceMap": false + }, +}) +const fd = await Deno.formatDiagnostics(diagnostics) +console.log(fd) +const key = Object.keys(files).find(f => f.includes("App.ts")) as string +files[key] = files[key].replace("deps.ts", "deps.js") +const key2 = Object.keys(files).find(f => f.includes("deps.ts")) as string +files[key2] = files[key2].replace("src/mod.ts", "dist/mod.js") +Deno.writeFileSync("./components/app.js", new TextEncoder().encode(files[key])) +Deno.writeFileSync("./components/deps.js", new TextEncoder().encode(files[key2])) \ No newline at end of file diff --git a/examples/deno/tsconfig.json b/examples/deno/tsconfig.json new file mode 100644 index 0000000..2611c30 --- /dev/null +++ b/examples/deno/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "lib": [ + "dom", + "DOM.Iterable", + "esnext", + ], + } +} \ No newline at end of file From 3647b7fcaf10dd06f991a3e774aba3e7e08cd500 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Tue, 6 Jul 2021 12:10:35 +0100 Subject: [PATCH 17/38] make some internal code adjustments to account for some minor problems with bundle --- examples/deno/components/App.ts | 7 ++----- src/utils/IterableWeakMap.ts | 4 ++-- src/utils/WeakMultiRef.ts | 4 ++-- src/utils/id.ts | 3 +-- src/utils/pseudoRandomEncode.ts | 9 +++------ 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/examples/deno/components/App.ts b/examples/deno/components/App.ts index 4ae89e3..9f4235b 100644 --- a/examples/deno/components/App.ts +++ b/examples/deno/components/App.ts @@ -1,4 +1,4 @@ -import { Component, css, html, register } from "../../../src/mod.ts"; +import { Component, css, html } from "../../../src/mod.ts"; class CustomP extends Component<{ customText: string @@ -8,12 +8,9 @@ class CustomP extends Component<{ color: red; } ` - template = html`

${this.customText}

` } - class AppRoot extends Component { - override template = html`
<${CustomP} prop:customText=${"hello"}> @@ -21,4 +18,4 @@ class AppRoot extends Component { `; } -register(AppRoot) \ No newline at end of file +customElements.define("app-root", AppRoot) \ No newline at end of file diff --git a/src/utils/IterableWeakMap.ts b/src/utils/IterableWeakMap.ts index f497994..654ae87 100644 --- a/src/utils/IterableWeakMap.ts +++ b/src/utils/IterableWeakMap.ts @@ -9,7 +9,7 @@ export class IterableWeakMap< K extends object = object, V = unknown, > { - static #cleanup = ( + #cleanup = ( { set, ref }: { set: Set>, ref: WeakRef, @@ -20,7 +20,7 @@ export class IterableWeakMap< #weakMap = new WeakMap }>(); #refSet = new Set>(); - #finalizationGroup = new FinalizationRegistry(IterableWeakMap.#cleanup); + #finalizationGroup = new FinalizationRegistry(this.#cleanup); constructor ( iterable: Iterable<[K, V]> = [], diff --git a/src/utils/WeakMultiRef.ts b/src/utils/WeakMultiRef.ts index 0991cd6..c8e7ca0 100644 --- a/src/utils/WeakMultiRef.ts +++ b/src/utils/WeakMultiRef.ts @@ -3,7 +3,7 @@ const refs = new Set(); export class WeakMultiRef { - static #cleanup = ( + #cleanup = ( { set, ref, target }: { set: Set>, ref: WeakRef, @@ -17,7 +17,7 @@ export class WeakMultiRef { }; weakKeys = new Set>(); - #finalizationGroup = new FinalizationRegistry(WeakMultiRef.#cleanup); + #finalizationGroup = new FinalizationRegistry(this.#cleanup); constructor ( keys: ReadonlyArray, diff --git a/src/utils/id.ts b/src/utils/id.ts index 73d9ada..4179d31 100644 --- a/src/utils/id.ts +++ b/src/utils/id.ts @@ -1,11 +1,10 @@ import { pseudoRandomEncode } from "./pseudoRandomEncode.ts"; -const idEncoder = pseudoRandomEncode(2n ** 20n, 387_420_489n); - /** * Generates up to 2**20 (~1M) IDs that are unique across the session. */ export function* pseudoRandomIdGenerator (): Generator { + const idEncoder = pseudoRandomEncode(2n ** 20n, 387_420_489n); let i = 0n; while (true) { // Intentionally skip the first one because 0n converts to "0" diff --git a/src/utils/pseudoRandomEncode.ts b/src/utils/pseudoRandomEncode.ts index f02487f..5c95571 100644 --- a/src/utils/pseudoRandomEncode.ts +++ b/src/utils/pseudoRandomEncode.ts @@ -3,9 +3,6 @@ * @param count Maximum number of items * @param coprime A coperime of count which is also greater than count */ -export const pseudoRandomEncode = ( - count: bigint, - coprime: bigint, -) => ( - seed: bigint, -): bigint => seed * coprime % count; +export function pseudoRandomEncode (count: bigint, coprime: bigint): (seed: bigint) => bigint { + return (seed: bigint): bigint => seed * coprime % count +} \ No newline at end of file From f46807e9b1f43fee94ebbd3adf6e8e151d965f9e Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Tue, 6 Jul 2021 12:22:33 +0100 Subject: [PATCH 18/38] add workflow --- .github/workflows/master.yml | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/master.yml diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml new file mode 100644 index 0000000..27d8e75 --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,51 @@ +name: master + +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install Deno + uses: denolib/setup-deno@master + + - name: Deno version + run: echo deno --version + + - name: Check Any Type Errors + run: deno cache src/mod.ts + + - name: Can Compile To Dist + run: npm run compile # mainly to check if there are any errors when running this command + + - name: Basic Example Can Be Compiled + run: | + cd examples/deno + deno bundle --config tsconfig.json components/App.ts components/app.js + cd ../node + npm i + node_modules/.bin/webpack --config webpack.config.js + cd ../browser + echo "No build step so no testing here" + + linter: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install Deno + uses: denolib/setup-deno@master + + - name: Formatter + run: echo "Is this something we want?" #deno fmt --check --ignore=dist + + - name: Linter + run: npm run lint \ No newline at end of file From fd7a0dd3b3b511f87a57bc811cac42573d2f99cb Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Tue, 6 Jul 2021 12:25:08 +0100 Subject: [PATCH 19/38] add bumper workflow --- .github/workflows/bumper.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/bumper.yml diff --git a/.github/workflows/bumper.yml b/.github/workflows/bumper.yml new file mode 100644 index 0000000..e6758a3 --- /dev/null +++ b/.github/workflows/bumper.yml @@ -0,0 +1,26 @@ +name: bumper +on: + schedule: + - cron: '0 0 * * 0' + +jobs: + update-dep: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install Deno + uses: denolib/setup-deno@master + + - name: Update Build Deps + run: | + deno run --allow-net --allow-read --allow-write https://deno.land/x/dmm/mod.ts update + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.CI_USER_PAT }} # TODO This needs to be a personal access token on the GH user eg Okku + commit-message: Update dependencies + title: Update dependencies + body: This was auto-generated by GitHub Actions. + branch: update-dependencies \ No newline at end of file From c81cb90ff4e329d6419a02ca2fb554cbdb0a6cf3 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Tue, 6 Jul 2021 12:29:31 +0100 Subject: [PATCH 20/38] remove loggin --- compile.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/compile.ts b/compile.ts index 5acaff7..eed9dcf 100644 --- a/compile.ts +++ b/compile.ts @@ -40,7 +40,6 @@ async function compile( // Overrite `write` function so instead of placing the transpiled file besides the source, we can move it into dist Crumpets.write = (filename: string, content: string) => { - console.log(filename); const distPath = filename.replace("/src/", "/dist/"); const validWritablePath = fromFileUrl(distPath); try { From 2538f285e4ca6e3890fd445af4e902c9cfd2a98e Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Tue, 6 Jul 2021 15:06:13 +0100 Subject: [PATCH 21/38] deno lint --- src/componentLogic/Component.ts | 18 +++++++----------- src/componentLogic/Ref.ts | 1 - src/globalThis.d.ts | 4 +--- src/mod.ts | 1 - .../hookAttributeSlotsUp/matchChangeWatcher.ts | 1 - src/parsing/parseString.ts | 1 - .../ReactiveArray/TReactiveArrayCallback.ts | 1 - .../ReactiveArray/_ReadonlyReactiveArray.ts | 5 +++-- .../ReactiveArray/arrayDependencyCaches.ts | 3 +++ src/reactive/ReactiveArray/internalArrays.ts | 1 + src/reactive/ReactiveArray/splicers.ts | 1 + .../ReactiveValue/_ReadonlyReactiveValue.ts | 11 +++++------ .../ReactiveValue/internalSetReactiveValue.ts | 1 + .../ReactiveValue/valueDependencyCaches.ts | 3 +++ src/reactive/computed.ts | 2 ++ src/utils/IterableWeakMap.ts | 6 ++++-- src/utils/WeakMultiRef.ts | 8 +++++--- src/utils/safeStringifyObject.ts | 3 +-- src/utils/throwExpression.ts | 1 - 19 files changed, 37 insertions(+), 35 deletions(-) diff --git a/src/componentLogic/Component.ts b/src/componentLogic/Component.ts index ac48afb..9c7715a 100644 --- a/src/componentLogic/Component.ts +++ b/src/componentLogic/Component.ts @@ -15,7 +15,6 @@ import type { ReadonlyReactiveValue } from "../reactive/ReactiveValue/_ReadonlyR import type { ReadonlyReactiveArray } from "../reactive/ReactiveArray/_ReadonlyReactiveArray.ts"; import type { CSSTemplate } from "../styling/CSSTemplate.ts"; -// eslint-disable-next-line @typescript-eslint/consistent-type-definitions interface ComponentImplementation { destinySlot?: Slot, } @@ -26,9 +25,12 @@ interface ComponentImplementation { class ComponentImplementation extends HTMLElement { static captureProps = false; forwardProps?: Ref | RefPromise; + // TODO(@ebebbington): Why is `template` typed like this? Isn't it only ever assigned `xml`...`` eg `TemplateResult`? template: ( | Renderable + // deno-lint-ignore no-explicit-any | ReadonlyReactiveValue + // deno-lint-ignore no-explicit-any | ReadonlyReactiveArray ) = xml``; static styles: Array | CSSTemplate = []; @@ -55,8 +57,7 @@ class ComponentImplementation extends HTMLElement { // Upgrade values that have an associated setter but were assigned before the setters existed: if (data) { for (const [key, value] of data.prop) { - // eslint-disable-next-line @typescript-eslint/ban-types - let proto = this.constructor.prototype as Function | undefined; + let proto = this.constructor.prototype; let descriptor: PropertyDescriptor | undefined; while (!descriptor && proto && proto !== HTMLElement) { @@ -64,11 +65,9 @@ class ComponentImplementation extends HTMLElement { proto, key, ); - // eslint-disable-next-line @typescript-eslint/ban-types - proto = Object.getPrototypeOf(proto) as Function; + proto = Object.getPrototypeOf(proto); } if (!descriptor?.set) continue; - // eslint-disable-next-line @typescript-eslint/no-dynamic-delete delete this[key as keyof this]; this[key as keyof this] = value as this[keyof this]; } @@ -147,20 +146,17 @@ class ComponentImplementation extends HTMLElement { } } -// eslint-disable-next-line @typescript-eslint/naming-convention export type Component< - // eslint-disable-next-line @typescript-eslint/ban-types - TProperties extends Record = {} + TProperties extends Record = Record > = ( & ComponentImplementation & TProperties ); type TComponentConstructor = ( - // eslint-disable-next-line @typescript-eslint/ban-types + // deno-lint-ignore ban-types & (new = {}> () => Component) & typeof ComponentImplementation ); -// eslint-disable-next-line @typescript-eslint/naming-convention export const Component = ComponentImplementation as TComponentConstructor; diff --git a/src/componentLogic/Ref.ts b/src/componentLogic/Ref.ts index a5289ba..b563961 100644 --- a/src/componentLogic/Ref.ts +++ b/src/componentLogic/Ref.ts @@ -1,6 +1,5 @@ export abstract class RefPromise { // The rule is seemingly broken. Return type annotations are not allowed for setters. - // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types abstract set value ( element: T, ); diff --git a/src/globalThis.d.ts b/src/globalThis.d.ts index e076622..badcb9e 100644 --- a/src/globalThis.d.ts +++ b/src/globalThis.d.ts @@ -1,10 +1,8 @@ -/* eslint-disable @typescript-eslint/consistent-type-definitions */ - interface ImportMeta { url: string, } -declare function queueMicrotask (callback: VoidFunction | (() => Promise)): void; +declare funon queueMicrotask (callback: VoidFunction | (() => Promise)): void; interface HTMLElement { attachInternals(): ElementInternals, diff --git a/src/mod.ts b/src/mod.ts index 4da89cd..17ca138 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -1,4 +1,3 @@ -// eslint-disable-next-line @typescript-eslint/triple-slash-reference /// export { ReactiveValue } from "./reactive/ReactiveValue/_ReactiveValue.ts"; diff --git a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/matchChangeWatcher.ts b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/matchChangeWatcher.ts index cce830d..c8dd735 100644 --- a/src/parsing/hookSlotsUp/hookAttributeSlotsUp/matchChangeWatcher.ts +++ b/src/parsing/hookSlotsUp/hookAttributeSlotsUp/matchChangeWatcher.ts @@ -14,6 +14,5 @@ export type TWatchedAttribute = keyof typeof propToWatcherMap; export function matchChangeWatcher ( attributeName: string, ): typeof propToWatcherMap[TWatchedAttribute] | "" { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition return propToWatcherMap[attributeName as TWatchedAttribute] ?? ""; } diff --git a/src/parsing/parseString.ts b/src/parsing/parseString.ts index 11d4958..27c1ba7 100644 --- a/src/parsing/parseString.ts +++ b/src/parsing/parseString.ts @@ -2,7 +2,6 @@ import { getXmlErrorMessage } from "./getXmlErrorMessage.ts"; import { parseAsNewDocument } from "./parseAsNewDocument.ts"; import { parseInSafari } from "./parseInSafari.ts"; -// eslint-disable-next-line @typescript-eslint/quotes export const namespaces = `xmlns="http://www.w3.org/1999/xhtml" xmlns:on="p:u" xmlns:prop="p:u" xmlns:destiny="p:u"`; const xmlDocument = new DOMParser().parseFromString( diff --git a/src/reactive/ReactiveArray/TReactiveArrayCallback.ts b/src/reactive/ReactiveArray/TReactiveArrayCallback.ts index fbde277..fe3b61d 100644 --- a/src/reactive/ReactiveArray/TReactiveArrayCallback.ts +++ b/src/reactive/ReactiveArray/TReactiveArrayCallback.ts @@ -1,4 +1,3 @@ -// eslint-disable-next-line @typescript-eslint/no-invalid-void-type export type TReactiveArrayCallback = ( index: number, deleteCount: number, diff --git a/src/reactive/ReactiveArray/_ReadonlyReactiveArray.ts b/src/reactive/ReactiveArray/_ReadonlyReactiveArray.ts index f355d3d..ca3bc9f 100644 --- a/src/reactive/ReactiveArray/_ReadonlyReactiveArray.ts +++ b/src/reactive/ReactiveArray/_ReadonlyReactiveArray.ts @@ -48,7 +48,7 @@ import type { TMask } from "./TMask.ts"; /** A Set containing all the callbacks to be called whenever the ReadonlyReactiveArray is updated */ readonly #callbacks: Set>> = new Set; - // eslint-disable-next-line @typescript-eslint/ban-types + // deno-lint-ignore ban-types People can pass literally anything into ReactiveArray readonly #consumers = new IterableWeakMap>>(); /** Size of the ReactiveArray as a ReactiveValue */ @@ -204,7 +204,7 @@ import type { TMask } from "./TMask.ts"; callback: TReactiveArrayCallback>, options: { noFirstRun?: boolean, - // eslint-disable-next-line @typescript-eslint/ban-types + // deno-lint-ignore ban-types People can pass literally anything into ReactiveArray dependents?: ReadonlyArray, } = {}, ): this { @@ -323,6 +323,7 @@ import type { TMask } from "./TMask.ts"; index: number, array: Array>, ) => boolean, + // deno-lint-ignore no-explicit-any People can pass literally anything into ReactiveArray dependencies: ReadonlyArray> = [], ): ReadonlyReactiveArray> { diff --git a/src/reactive/ReactiveArray/arrayDependencyCaches.ts b/src/reactive/ReactiveArray/arrayDependencyCaches.ts index 058a8f8..368328e 100644 --- a/src/reactive/ReactiveArray/arrayDependencyCaches.ts +++ b/src/reactive/ReactiveArray/arrayDependencyCaches.ts @@ -5,11 +5,14 @@ import type { TReactiveArrayCallback } from "./TReactiveArrayCallback.ts"; import type { ReadonlyReactiveArray } from "./_ReadonlyReactiveArray.ts"; export const stronglyHeldDependencies = new Map< + // deno-lint-ignore no-explicit-any TReactiveArrayCallback>, + // deno-lint-ignore no-explicit-any People can pass literally anything into ReactiveArray ReadonlyReactiveArray >(); export const weaklyHeldDependencies = new IterableWeakMap< WeakMultiRef, + // deno-lint-ignore no-explicit-any ReadonlyReactiveArray >(); diff --git a/src/reactive/ReactiveArray/internalArrays.ts b/src/reactive/ReactiveArray/internalArrays.ts index 30574cb..5fcc6a9 100644 --- a/src/reactive/ReactiveArray/internalArrays.ts +++ b/src/reactive/ReactiveArray/internalArrays.ts @@ -4,6 +4,7 @@ import type { ReactiveArray } from "./_ReactiveArray.ts"; export const internalArrays = new class { #inner = new WeakMap< + // deno-lint-ignore no-explicit-any People can pass literally anything into ReactiveArray ReadonlyReactiveArray >(); diff --git a/src/reactive/ReactiveArray/splicers.ts b/src/reactive/ReactiveArray/splicers.ts index 0a86986..6372365 100644 --- a/src/reactive/ReactiveArray/splicers.ts +++ b/src/reactive/ReactiveArray/splicers.ts @@ -10,6 +10,7 @@ export type TSplice = ( export const splicers = new class { #inner = new WeakMap< + // deno-lint-ignore no-explicit-any People can pass literally anything into ReactiveArray ReadonlyReactiveArray >(); diff --git a/src/reactive/ReactiveValue/_ReadonlyReactiveValue.ts b/src/reactive/ReactiveValue/_ReadonlyReactiveValue.ts index cae8efa..58582f4 100644 --- a/src/reactive/ReactiveValue/_ReadonlyReactiveValue.ts +++ b/src/reactive/ReactiveValue/_ReadonlyReactiveValue.ts @@ -17,9 +17,10 @@ export class ReadonlyReactiveValue { /** All the callbacks added to the `ReactiveValue`, which are to be called when the `value` updates. */ readonly #callbacks: Set> = new Set; - // eslint-disable-next-line @typescript-eslint/ban-types + // deno-lint-ignore ban-types readonly #consumers = new IterableWeakMap>(); + // deno-lint-ignore no-explicit-any People can pass literally anything into ReactiveArray readonly dependencies = new Map | ReadonlyReactiveArray, VoidFunction>(); constructor ( @@ -75,10 +76,8 @@ export class ReadonlyReactiveValue { /** * When the object is attempted to be cast to a primitive, the current value of `this.value` is used as a hint. Obviously, if you're trying to cast a `ReactiveValue` into a `number`, it'll just cast `this.value` from a `string` to a `number`. Trying to cast `ReactiveValue` to a primitive will throw. */ - // eslint-disable-next-line @typescript-eslint/ban-types - [Symbol.toPrimitive] (): T extends object ? never : T { - // eslint-disable-next-line @typescript-eslint/ban-types - return this.value as T extends object ? never : T; + [Symbol.toPrimitive] (): T extends Record ? never : T { + return this.value as T extends Record ? never : T; } /** @@ -124,7 +123,7 @@ export class ReadonlyReactiveValue { callback: TReactiveValueCallback, options: { noFirstRun?: boolean, - // eslint-disable-next-line @typescript-eslint/ban-types + // deno-lint-ignore ban-types dependents?: ReadonlyArray, } = {}, ): this { diff --git a/src/reactive/ReactiveValue/internalSetReactiveValue.ts b/src/reactive/ReactiveValue/internalSetReactiveValue.ts index d75f1ab..2bab354 100644 --- a/src/reactive/ReactiveValue/internalSetReactiveValue.ts +++ b/src/reactive/ReactiveValue/internalSetReactiveValue.ts @@ -3,6 +3,7 @@ import type { TReactiveValueUpdater } from "./TReactiveValueUpdater.ts"; export const internalSetReactiveValue = new class { #inner = new WeakMap< + // deno-lint-ignore no-explicit-any People can pass literally anything into ReactiveArray ReadonlyReactiveValue >(); diff --git a/src/reactive/ReactiveValue/valueDependencyCaches.ts b/src/reactive/ReactiveValue/valueDependencyCaches.ts index 89e6b0a..c08f34f 100644 --- a/src/reactive/ReactiveValue/valueDependencyCaches.ts +++ b/src/reactive/ReactiveValue/valueDependencyCaches.ts @@ -4,11 +4,14 @@ import type { TReactiveValueCallback } from "./TReactiveValueCallback.ts"; import type { ReadonlyReactiveValue } from "./_ReadonlyReactiveValue.ts"; export const stronglyHeldDependencies = new Map< + // deno-lint-ignore no-explicit-any People can pass literally anything into ReactiveArray TReactiveValueCallback, + // deno-lint-ignore no-explicit-any People can pass literally anything into ReactiveArray ReadonlyReactiveValue >(); export const weaklyHeldDependencies = new IterableWeakMap< WeakMultiRef, + // deno-lint-ignore no-explicit-any People can pass literally anything into ReactiveArray ReadonlyReactiveValue >(); diff --git a/src/reactive/computed.ts b/src/reactive/computed.ts index 909bb29..1d1c67d 100644 --- a/src/reactive/computed.ts +++ b/src/reactive/computed.ts @@ -4,9 +4,11 @@ import type { ReadonlyReactiveValue } from "./ReactiveValue/_ReadonlyReactiveVal export let computedConsumer: { fn: VoidFunction, + // deno-lint-ignore no-explicit-any consumer: ReadonlyReactiveValue, } | undefined; +// deno-lint-ignore no-explicit-any const hold = new WeakMap, VoidFunction>(); /** diff --git a/src/utils/IterableWeakMap.ts b/src/utils/IterableWeakMap.ts index 654ae87..5236258 100644 --- a/src/utils/IterableWeakMap.ts +++ b/src/utils/IterableWeakMap.ts @@ -1,17 +1,19 @@ -/* eslint-disable @typescript-eslint/ban-types */ - +// deno-lint-ignore ban-types People can pass literally anything into ReactiveArray type TEmplaceOptions = { insert: (key: K, map: IterableWeakMap) => V, update: (oldValue: V, key: K, map: IterableWeakMap) => V, }; export class IterableWeakMap< + // deno-lint-ignore ban-types K extends object = object, V = unknown, > { #cleanup = ( { set, ref }: { + // deno-lint-ignore ban-types set: Set>, + // deno-lint-ignore ban-types ref: WeakRef, }, ): void => { diff --git a/src/utils/WeakMultiRef.ts b/src/utils/WeakMultiRef.ts index c8e7ca0..5427eb5 100644 --- a/src/utils/WeakMultiRef.ts +++ b/src/utils/WeakMultiRef.ts @@ -1,11 +1,11 @@ -/* eslint-disable @typescript-eslint/ban-types */ - -const refs = new Set(); +const refs = new Set(); export class WeakMultiRef { #cleanup = ( { set, ref, target }: { + // deno-lint-ignore ban-types set: Set>, + // deno-lint-ignore ban-types ref: WeakRef, target: WeakMultiRef, }, @@ -16,10 +16,12 @@ export class WeakMultiRef { } }; + // deno-lint-ignore ban-types People can pass literally anything into ReactiveArray weakKeys = new Set>(); #finalizationGroup = new FinalizationRegistry(this.#cleanup); constructor ( + // deno-lint-ignore ban-types People can pass literally anything into ReactiveArray keys: ReadonlyArray, ) { keys.forEach(key => { diff --git a/src/utils/safeStringifyObject.ts b/src/utils/safeStringifyObject.ts index acd973d..29d7016 100644 --- a/src/utils/safeStringifyObject.ts +++ b/src/utils/safeStringifyObject.ts @@ -1,6 +1,5 @@ export function safeStringifyObject ( - // eslint-disable-next-line @typescript-eslint/ban-types - input: object, + input: unknown & { constructor: { name: string } }, ): string { try { const string = String(input); diff --git a/src/utils/throwExpression.ts b/src/utils/throwExpression.ts index 4ff1e47..bccd21b 100644 --- a/src/utils/throwExpression.ts +++ b/src/utils/throwExpression.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ export function throwExpression ( message: string, ErrorType = Error, From 44619183ac9ec266f346f84fd426248f708ff8a4 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Tue, 6 Jul 2021 15:20:47 +0100 Subject: [PATCH 22/38] remove dead code --- src/componentLogic/register.ts | 2 +- src/globalThis.d.ts | 66 ---------------------------------- src/globalTypes/ShadowRoot.ts | 9 ----- src/mod.ts | 2 -- 4 files changed, 1 insertion(+), 78 deletions(-) delete mode 100644 src/globalThis.d.ts delete mode 100644 src/globalTypes/ShadowRoot.ts diff --git a/src/componentLogic/register.ts b/src/componentLogic/register.ts index e9bd575..4d1d8bb 100644 --- a/src/componentLogic/register.ts +++ b/src/componentLogic/register.ts @@ -15,7 +15,7 @@ const registeredComponents = new Map< * @param noHash Opt out of adding a unique hash to the name */ export function register ( - componentConstructor: new () => Component, + componentConstructor: typeof Component, noHash = true, ): string { const registeredName = registeredComponents.get(componentConstructor); diff --git a/src/globalThis.d.ts b/src/globalThis.d.ts deleted file mode 100644 index badcb9e..0000000 --- a/src/globalThis.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -interface ImportMeta { - url: string, -} - -declare funon queueMicrotask (callback: VoidFunction | (() => Promise)): void; - -interface HTMLElement { - attachInternals(): ElementInternals, -} - -// TODO: This interface needs a lot of work -interface ElementInternals { - ariaActiveDescendantElement: null, - ariaAtomic: null, - ariaAutoComplete: null, - ariaBusy: null, - ariaChecked: null, - ariaColCount: null, - ariaColIndex: null, - ariaColSpan: null, - ariaControlsElements: null, - ariaCurrent: null, - ariaDescribedByElements: null, - ariaDescription: null, - ariaDetailsElements: null, - ariaDisabled: null, - ariaErrorMessageElement: null, - ariaExpanded: null, - ariaFlowToElements: null, - ariaHasPopup: null, - ariaHidden: null, - ariaKeyShortcuts: null, - ariaLabel: null, - ariaLabelledByElements: null, - ariaLevel: null, - ariaLive: null, - ariaModal: null, - ariaMultiLine: null, - ariaMultiSelectable: null, - ariaOrientation: null, - ariaOwnsElements: null, - ariaPlaceholder: null, - ariaPosInSet: null, - ariaPressed: null, - ariaReadOnly: null, - ariaRelevant: null, - ariaRequired: null, - ariaRoleDescription: null, - ariaRowCount: null, - ariaRowIndex: null, - ariaRowSpan: null, - ariaSelected: null, - ariaSetSize: null, - ariaSort: null, - ariaValueMax: null, - ariaValueMin: null, - ariaValueNow: null, - ariaValueText: null, - form?: HTMLFormElement, - labels?: HTMLLabelElement, - role: null, - states: DOMTokenList, - validationMessage?: string, - validity?: boolean, - willValidate?: boolean, -} diff --git a/src/globalTypes/ShadowRoot.ts b/src/globalTypes/ShadowRoot.ts deleted file mode 100644 index 2f70f60..0000000 --- a/src/globalTypes/ShadowRoot.ts +++ /dev/null @@ -1,9 +0,0 @@ -import "./CSSStyleSheet.ts" - -export {} - -declare global { - interface ShadowRoot { - adoptedStyleSheets: ReadonlyArray, - } -} \ No newline at end of file diff --git a/src/mod.ts b/src/mod.ts index 17ca138..800f206 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -1,5 +1,3 @@ -/// - export { ReactiveValue } from "./reactive/ReactiveValue/_ReactiveValue.ts"; export { ReadonlyReactiveValue } from "./reactive/ReactiveValue/_ReadonlyReactiveValue.ts"; export { ReactiveArray } from "./reactive/ReactiveArray/_ReactiveArray.ts"; From 018454ffa53e0e7e25e8e665598302b49dfbe04c Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Tue, 6 Jul 2021 15:36:05 +0100 Subject: [PATCH 23/38] correct compile.ts --- compile.ts | 65 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/compile.ts b/compile.ts index eed9dcf..5744689 100644 --- a/compile.ts +++ b/compile.ts @@ -5,37 +5,33 @@ const fromFileUrl = Deno.build.os === "windows" ? fromFileUrlWin : fromFileUrlUnix; const encoder = new TextEncoder(); +const compilerOptions: { + [key: string]: string | boolean | string[] +} = { + declaration: true, + sourceMap: true, + target: "es2020", + module: "esnext", + lib: [ + "dom", + "DOM.Iterable", + "esnext", + ], + removeComments: true, + downlevelIteration: true, + useDefineForClassFields: true, + strict: true, + noImplicitReturns: true, + noFallthroughCasesInSwitch: true, + importsNotUsedAsValues: "error", +} async function compile( rootFile: string, - directoryToWatch: string, - watch: boolean, ) { const crumpet = new Crumpets({ rootFile, - directoryToWatch, - compilerOptions: { - declaration: true, - sourceMap: true, - target: "es2020", - module: "esnext", - lib: [ - "dom", - "DOM.Iterable", - "esnext", - ], - removeComments: true, - downlevelIteration: true, - useDefineForClassFields: true, - strict: true, - noImplicitReturns: true, - noFallthroughCasesInSwitch: true, - importsNotUsedAsValues: "error", - paths: { - "/dist/*": ["src/*"], - }, - baseUrl: "./", - }, + compilerOptions }); // Overrite `write` function so instead of placing the transpiled file besides the source, we can move it into dist @@ -56,12 +52,19 @@ async function compile( }; await crumpet.run(); +} - if (watch) { - await crumpet.watch(); - } +async function watch() { + const crumpets = new Crumpets({ + rootFile: "./src/mod.ts", + directoryToWatch: "./src", + compilerOptions + }) + await crumpets.watch() } -const directoryToWatch = "./src" -await compile("./src/mod.ts", directoryToWatch, false); -await compile("./src/examples_mod.ts", directoryToWatch, Deno.args[0] === "--watch") +await compile("./src/mod.ts"); +await compile("./src/examples_mod.ts") +if (Deno.args[0] === "--watch") { + await watch() +} From 8d5c29f067a1340ed5343abc0cac925c31b0ee4e Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Tue, 6 Jul 2021 15:49:54 +0100 Subject: [PATCH 24/38] correct examples readme --- examples/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/README.md b/examples/README.md index dadfe08..28567df 100644 --- a/examples/README.md +++ b/examples/README.md @@ -55,7 +55,7 @@ Note that currently, there are multiple issues with this: https://github.com/denoland/deno/issues/11286 https://github.com/denoland/deno/issues/11287 -## Transpile +### Transpile NOTE: This *transpiles*, and DOES NOT *bundle*, AND keeps the RAW LINKS to destiny. For example, everytime a user requests the js files, a new request will be made to the dependencies cdn. From ff241b1d31dcc6854fa10bd468bde48e21aeb977 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Sat, 10 Jul 2021 23:53:58 +0100 Subject: [PATCH 25/38] fix .d.ts file extensions --- compile.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compile.ts b/compile.ts index 5744689..c70df42 100644 --- a/compile.ts +++ b/compile.ts @@ -36,6 +36,9 @@ async function compile( // Overrite `write` function so instead of placing the transpiled file besides the source, we can move it into dist Crumpets.write = (filename: string, content: string) => { + if (filename.includes(".d.ts")) { + filename = filename.replace(".ts.d.ts", ".d.ts") + } const distPath = filename.replace("/src/", "/dist/"); const validWritablePath = fromFileUrl(distPath); try { From bf2ffaa619e5bb5a46c0c9cc8df1ce760ff73f35 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Sun, 11 Jul 2021 01:13:15 +0100 Subject: [PATCH 26/38] Update crumpets --- compile.ts | 32 ++++++-------------------------- deps.ts | 4 +--- 2 files changed, 7 insertions(+), 29 deletions(-) diff --git a/compile.ts b/compile.ts index c70df42..f375db7 100644 --- a/compile.ts +++ b/compile.ts @@ -1,10 +1,6 @@ // transpile.ts -import { Crumpets, fromFileUrlUnix, fromFileUrlWin } from "./deps.ts"; +import { Crumpets } from "./deps.ts"; -const fromFileUrl = Deno.build.os === "windows" - ? fromFileUrlWin - : fromFileUrlUnix; -const encoder = new TextEncoder(); const compilerOptions: { [key: string]: string | boolean | string[] } = { @@ -31,28 +27,12 @@ async function compile( ) { const crumpet = new Crumpets({ rootFile, - compilerOptions - }); - - // Overrite `write` function so instead of placing the transpiled file besides the source, we can move it into dist - Crumpets.write = (filename: string, content: string) => { - if (filename.includes(".d.ts")) { - filename = filename.replace(".ts.d.ts", ".d.ts") + compilerOptions, + filenameReplaceOptions: { + search: "/src/", + replacer: "/dist/" } - const distPath = filename.replace("/src/", "/dist/"); - const validWritablePath = fromFileUrl(distPath); - try { - Deno.writeFileSync(validWritablePath, encoder.encode(content)); - } catch (e) { - if (e instanceof Deno.errors.NotFound) { - const dirPathSplit = distPath.split("/"); - dirPathSplit.pop(); - const dirPath = dirPathSplit.join("/"); - Deno.mkdirSync(fromFileUrl(dirPath), { recursive: true }); - Deno.writeFileSync(validWritablePath, encoder.encode(content)); - } - } - }; + }); await crumpet.run(); } diff --git a/deps.ts b/deps.ts index 0b9ab2c..88885da 100644 --- a/deps.ts +++ b/deps.ts @@ -1,3 +1 @@ -export { Crumpets } from "https://deno.land/x/crumpets@v2.1.2/mod.ts"; -export { fromFileUrl as fromFileUrlWin } from "https://deno.land/std@0.99.0/path/win32.ts"; -export { fromFileUrl as fromFileUrlUnix } from "https://deno.land/std@0.99.0/path/posix.ts"; \ No newline at end of file +export { Crumpets } from "https://deno.land/x/crumpets@v2.1.4/mod.ts"; From ac08c06685486c7571563e8ed7902bda41c3199c Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Sun, 11 Jul 2021 02:00:31 +0100 Subject: [PATCH 27/38] once again, i am sorry okku --- compile.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/compile.ts b/compile.ts index f375db7..f807fcb 100644 --- a/compile.ts +++ b/compile.ts @@ -2,7 +2,7 @@ import { Crumpets } from "./deps.ts"; const compilerOptions: { - [key: string]: string | boolean | string[] + [key: string]: string | boolean | string[]; } = { declaration: true, sourceMap: true, @@ -20,7 +20,7 @@ const compilerOptions: { noImplicitReturns: true, noFallthroughCasesInSwitch: true, importsNotUsedAsValues: "error", -} +}; async function compile( rootFile: string, @@ -30,8 +30,8 @@ async function compile( compilerOptions, filenameReplaceOptions: { search: "/src/", - replacer: "/dist/" - } + replacer: "/dist/", + }, }); await crumpet.run(); @@ -41,13 +41,13 @@ async function watch() { const crumpets = new Crumpets({ rootFile: "./src/mod.ts", directoryToWatch: "./src", - compilerOptions - }) + compilerOptions, + }); await crumpets.watch() } await compile("./src/mod.ts"); -await compile("./src/examples_mod.ts") +await compile("./src/examples_mod.ts"); if (Deno.args[0] === "--watch") { - await watch() + await watch(); } From 7782dc01de0ac75d38eb08665e410c0660df07b6 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Sun, 11 Jul 2021 02:11:53 +0100 Subject: [PATCH 28/38] just for you okku --- compile.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compile.ts b/compile.ts index f807fcb..02bed0c 100644 --- a/compile.ts +++ b/compile.ts @@ -46,8 +46,10 @@ async function watch() { await crumpets.watch() } -await compile("./src/mod.ts"); -await compile("./src/examples_mod.ts"); +await Promise.all([ + "./src/mod.ts", + "./src/examples_mod.ts", +].map(compile)); if (Deno.args[0] === "--watch") { await watch(); } From 60525bd0494fe2f871cfd24af1c0b7e0677cdf28 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Sun, 11 Jul 2021 02:14:32 +0100 Subject: [PATCH 29/38] okku.includes(good suggestions) // true --- compile.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compile.ts b/compile.ts index 02bed0c..2f6dd0b 100644 --- a/compile.ts +++ b/compile.ts @@ -50,6 +50,6 @@ await Promise.all([ "./src/mod.ts", "./src/examples_mod.ts", ].map(compile)); -if (Deno.args[0] === "--watch") { +if (Deno.args.includes("--watch")) { await watch(); } From a947c7982a2e1b6fc6256cea65bcaf3272d9d443 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Sun, 11 Jul 2021 02:20:43 +0100 Subject: [PATCH 30/38] move tsconfig into its own file --- compile.ts | 21 +-------------------- tsconfig.json | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 20 deletions(-) create mode 100644 tsconfig.json diff --git a/compile.ts b/compile.ts index 2f6dd0b..4ce31bb 100644 --- a/compile.ts +++ b/compile.ts @@ -1,26 +1,7 @@ // transpile.ts import { Crumpets } from "./deps.ts"; -const compilerOptions: { - [key: string]: string | boolean | string[]; -} = { - declaration: true, - sourceMap: true, - target: "es2020", - module: "esnext", - lib: [ - "dom", - "DOM.Iterable", - "esnext", - ], - removeComments: true, - downlevelIteration: true, - useDefineForClassFields: true, - strict: true, - noImplicitReturns: true, - noFallthroughCasesInSwitch: true, - importsNotUsedAsValues: "error", -}; +const compilerOptions = (JSON.parse(Deno.readTextFileSync("./tsconfig.json"))).compilerOptions async function compile( rootFile: string, diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..4727783 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "declaration": true, + "sourceMap": true, + "target": "es2020", + "module": "esnext", + "lib": [ + "dom", + "DOM.Iterable", + "esnext" + ], + "removeComments": true, + "downlevelIteration": true, + "useDefineForClassFields": true, + "strict": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "importsNotUsedAsValues": "error" + } +} \ No newline at end of file From 2d0fbdffd52bbe3628c3ded2dbf2cabacd7d890e Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Sun, 11 Jul 2021 02:26:15 +0100 Subject: [PATCH 31/38] 1:1 with master --- tsconfig.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 4727783..4aa3342 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,5 @@ { "compilerOptions": { - "declaration": true, - "sourceMap": true, "target": "es2020", "module": "esnext", "lib": [ @@ -9,12 +7,20 @@ "DOM.Iterable", "esnext" ], + "declaration": true, + "sourceMap": true, "removeComments": true, "downlevelIteration": true, "useDefineForClassFields": true, "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, + "noPropertyAccessFromIndexSignature": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, + "forceConsistentCasingInFileNames": true, "importsNotUsedAsValues": "error" } } \ No newline at end of file From 56adfaa2276271b64021f2cd6582a1e3685db908 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Sun, 11 Jul 2021 02:26:40 +0100 Subject: [PATCH 32/38] remove package-lock.json --- package-lock.json | 2927 --------------------------------------------- 1 file changed, 2927 deletions(-) delete mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 3770f4a..0000000 --- a/package-lock.json +++ /dev/null @@ -1,2927 +0,0 @@ -{ - "name": "destiny-ui", - "version": "0.7.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "destiny-ui", - "version": "0.7.0", - "license": "OSL-3.0", - "devDependencies": { - "@typescript-eslint/eslint-plugin": "^4.28.1", - "@typescript-eslint/parser": "^4.28.1", - "eslint": "^7.29.0", - "typescript": "^4.3.4" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.10.4" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz", - "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", - "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", - "dev": true, - "dependencies": { - "@babel/helper-validator-identifier": "^7.14.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", - "integrity": "sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==", - "dev": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.7.tgz", - "integrity": "sha512-BTIhocbPBSrRmHxOAJFtR18oLhxTtAFDAvL8hY1S3iU8k+E60W/YFs4jrixGzQjMpF4qPXxIQHcjVD9dz1C2QA==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@types/json-schema": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", - "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", - "dev": true - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.28.1.tgz", - "integrity": "sha512-9yfcNpDaNGQ6/LQOX/KhUFTR1sCKH+PBr234k6hI9XJ0VP5UqGxap0AnNwBnWFk1MNyWBylJH9ZkzBXC+5akZQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/experimental-utils": "4.28.1", - "@typescript-eslint/scope-manager": "4.28.1", - "debug": "^4.3.1", - "functional-red-black-tree": "^1.0.1", - "regexpp": "^3.1.0", - "semver": "^7.3.5", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^4.0.0", - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/experimental-utils": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.28.1.tgz", - "integrity": "sha512-n8/ggadrZ+uyrfrSEchx3jgODdmcx7MzVM2sI3cTpI/YlfSm0+9HEUaWw3aQn2urL2KYlWYMDgn45iLfjDYB+Q==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.28.1", - "@typescript-eslint/types": "4.28.1", - "@typescript-eslint/typescript-estree": "4.28.1", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "*" - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.28.1.tgz", - "integrity": "sha512-UjrMsgnhQIIK82hXGaD+MCN8IfORS1CbMdu7VlZbYa8LCZtbZjJA26De4IPQB7XYZbL8gJ99KWNj0l6WD0guJg==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "4.28.1", - "@typescript-eslint/types": "4.28.1", - "@typescript-eslint/typescript-estree": "4.28.1", - "debug": "^4.3.1" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.28.1.tgz", - "integrity": "sha512-o95bvGKfss6705x7jFGDyS7trAORTy57lwJ+VsYwil/lOUxKQ9tA7Suuq+ciMhJc/1qPwB3XE2DKh9wubW8YYA==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "4.28.1", - "@typescript-eslint/visitor-keys": "4.28.1" - }, - "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/types": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.28.1.tgz", - "integrity": "sha512-4z+knEihcyX7blAGi7O3Fm3O6YRCP+r56NJFMNGsmtdw+NCdpG5SgNz427LS9nQkRVTswZLhz484hakQwB8RRg==", - "dev": true, - "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.28.1.tgz", - "integrity": "sha512-GhKxmC4sHXxHGJv8e8egAZeTZ6HI4mLU6S7FUzvFOtsk7ZIDN1ksA9r9DyOgNqowA9yAtZXV0Uiap61bIO81FQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "4.28.1", - "@typescript-eslint/visitor-keys": "4.28.1", - "debug": "^4.3.1", - "globby": "^11.0.3", - "is-glob": "^4.0.1", - "semver": "^7.3.5", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.28.1.tgz", - "integrity": "sha512-K4HMrdFqr9PFquPu178SaSb92CaWe2yErXyPumc8cYWxFmhgJsNY9eSePmO05j0JhBvf2Cdhptd6E6Yv9HVHcg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "4.28.1", - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", - "dev": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "dependencies": { - "ansi-colors": "^4.1.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.29.0.tgz", - "integrity": "sha512-82G/JToB9qIy/ArBzIWG9xvvwL3R86AlCjtGw+A29OMZDqhTybz/MByORSukGxeI+YPCR4coYyITKk8BFH9nDA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.2", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint/node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "dev": true, - "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-glob": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.6.tgz", - "integrity": "sha512-GnLuqj/pvQ7pX8/L4J84nijv6sAnlwvSDpMkJi9i7nPmPxGtRPkBSStfvDW5l6nMdX9VWe+pkKWFTgD+vF2QSQ==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "node_modules/fastq": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", - "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", - "dev": true - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, - "node_modules/glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globals": { - "version": "13.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", - "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globby": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", - "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globby/node_modules/ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", - "dev": true - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", - "dev": true, - "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/table": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.7.1.tgz", - "integrity": "sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg==", - "dev": true, - "dependencies": { - "ajv": "^8.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.0.tgz", - "integrity": "sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/typescript": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", - "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz", - "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==", - "dev": true - }, - "@babel/highlight": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", - "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.14.5", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@eslint/eslintrc": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", - "integrity": "sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==", - "dev": true, - "requires": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - } - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.7.tgz", - "integrity": "sha512-BTIhocbPBSrRmHxOAJFtR18oLhxTtAFDAvL8hY1S3iU8k+E60W/YFs4jrixGzQjMpF4qPXxIQHcjVD9dz1C2QA==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "@types/json-schema": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", - "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", - "dev": true - }, - "@typescript-eslint/eslint-plugin": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.28.1.tgz", - "integrity": "sha512-9yfcNpDaNGQ6/LQOX/KhUFTR1sCKH+PBr234k6hI9XJ0VP5UqGxap0AnNwBnWFk1MNyWBylJH9ZkzBXC+5akZQ==", - "dev": true, - "requires": { - "@typescript-eslint/experimental-utils": "4.28.1", - "@typescript-eslint/scope-manager": "4.28.1", - "debug": "^4.3.1", - "functional-red-black-tree": "^1.0.1", - "regexpp": "^3.1.0", - "semver": "^7.3.5", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/experimental-utils": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.28.1.tgz", - "integrity": "sha512-n8/ggadrZ+uyrfrSEchx3jgODdmcx7MzVM2sI3cTpI/YlfSm0+9HEUaWw3aQn2urL2KYlWYMDgn45iLfjDYB+Q==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.28.1", - "@typescript-eslint/types": "4.28.1", - "@typescript-eslint/typescript-estree": "4.28.1", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" - } - }, - "@typescript-eslint/parser": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.28.1.tgz", - "integrity": "sha512-UjrMsgnhQIIK82hXGaD+MCN8IfORS1CbMdu7VlZbYa8LCZtbZjJA26De4IPQB7XYZbL8gJ99KWNj0l6WD0guJg==", - "dev": true, - "requires": { - "@typescript-eslint/scope-manager": "4.28.1", - "@typescript-eslint/types": "4.28.1", - "@typescript-eslint/typescript-estree": "4.28.1", - "debug": "^4.3.1" - } - }, - "@typescript-eslint/scope-manager": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.28.1.tgz", - "integrity": "sha512-o95bvGKfss6705x7jFGDyS7trAORTy57lwJ+VsYwil/lOUxKQ9tA7Suuq+ciMhJc/1qPwB3XE2DKh9wubW8YYA==", - "dev": true, - "requires": { - "@typescript-eslint/types": "4.28.1", - "@typescript-eslint/visitor-keys": "4.28.1" - } - }, - "@typescript-eslint/types": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.28.1.tgz", - "integrity": "sha512-4z+knEihcyX7blAGi7O3Fm3O6YRCP+r56NJFMNGsmtdw+NCdpG5SgNz427LS9nQkRVTswZLhz484hakQwB8RRg==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.28.1.tgz", - "integrity": "sha512-GhKxmC4sHXxHGJv8e8egAZeTZ6HI4mLU6S7FUzvFOtsk7ZIDN1ksA9r9DyOgNqowA9yAtZXV0Uiap61bIO81FQ==", - "dev": true, - "requires": { - "@typescript-eslint/types": "4.28.1", - "@typescript-eslint/visitor-keys": "4.28.1", - "debug": "^4.3.1", - "globby": "^11.0.3", - "is-glob": "^4.0.1", - "semver": "^7.3.5", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "4.28.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.28.1.tgz", - "integrity": "sha512-K4HMrdFqr9PFquPu178SaSb92CaWe2yErXyPumc8cYWxFmhgJsNY9eSePmO05j0JhBvf2Cdhptd6E6Yv9HVHcg==", - "dev": true, - "requires": { - "@typescript-eslint/types": "4.28.1", - "eslint-visitor-keys": "^2.0.0" - } - }, - "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true - }, - "acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", - "dev": true, - "requires": {} - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - }, - "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "requires": { - "ansi-colors": "^4.1.1" - } - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - }, - "eslint": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.29.0.tgz", - "integrity": "sha512-82G/JToB9qIy/ArBzIWG9xvvwL3R86AlCjtGw+A29OMZDqhTybz/MByORSukGxeI+YPCR4coYyITKk8BFH9nDA==", - "dev": true, - "requires": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.2", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "dependencies": { - "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } - } - } - } - }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^2.0.0" - } - }, - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true - }, - "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "dev": true, - "requires": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, - "requires": { - "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - } - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "requires": { - "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - } - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "fast-glob": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.6.tgz", - "integrity": "sha512-GnLuqj/pvQ7pX8/L4J84nijv6sAnlwvSDpMkJi9i7nPmPxGtRPkBSStfvDW5l6nMdX9VWe+pkKWFTgD+vF2QSQ==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "fastq": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", - "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "requires": { - "flat-cache": "^3.0.4" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - } - }, - "flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", - "dev": true - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, - "glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "globals": { - "version": "13.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", - "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", - "dev": true, - "requires": { - "type-fest": "^0.20.2" - } - }, - "globby": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", - "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", - "slash": "^3.0.0" - }, - "dependencies": { - "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", - "dev": true - } - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", - "dev": true - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - } - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "requires": { - "callsites": "^3.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", - "dev": true - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true - }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "table": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.7.1.tgz", - "integrity": "sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg==", - "dev": true, - "requires": { - "ajv": "^8.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ajv": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.0.tgz", - "integrity": "sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - } - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1" - } - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true - }, - "typescript": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", - "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==", - "dev": true - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } - } -} From 93691848d4602c70f4f5818e0268e6305ebf34e4 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Fri, 15 Oct 2021 00:50:02 +0100 Subject: [PATCH 33/38] fixes nd remove hack --- src/_examples/components/hash-router.ts | 4 ++-- src/utils/IterableWeakMap.ts | 4 ++-- src/utils/WeakMultiRef.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/_examples/components/hash-router.ts b/src/_examples/components/hash-router.ts index 4c4796e..2f6abba 100644 --- a/src/_examples/components/hash-router.ts +++ b/src/_examples/components/hash-router.ts @@ -8,8 +8,8 @@ function getHashRoute ( export const route = reactive(getHashRoute(window.location.href)); -window.addEventListener("hashchange", e => { - route.value = getHashRoute(e.newURL); +window.addEventListener("hashchange", () => { + route.value = getHashRoute(window.location.href); }); export default class HashRouter extends Component<{ diff --git a/src/utils/IterableWeakMap.ts b/src/utils/IterableWeakMap.ts index 5236258..74ce6f9 100644 --- a/src/utils/IterableWeakMap.ts +++ b/src/utils/IterableWeakMap.ts @@ -9,7 +9,7 @@ export class IterableWeakMap< K extends object = object, V = unknown, > { - #cleanup = ( + static #cleanup = ( { set, ref }: { // deno-lint-ignore ban-types set: Set>, @@ -22,7 +22,7 @@ export class IterableWeakMap< #weakMap = new WeakMap }>(); #refSet = new Set>(); - #finalizationGroup = new FinalizationRegistry(this.#cleanup); + #finalizationGroup = new FinalizationRegistry(IterableWeakMap.#cleanup); constructor ( iterable: Iterable<[K, V]> = [], diff --git a/src/utils/WeakMultiRef.ts b/src/utils/WeakMultiRef.ts index 5427eb5..12e355b 100644 --- a/src/utils/WeakMultiRef.ts +++ b/src/utils/WeakMultiRef.ts @@ -1,7 +1,7 @@ const refs = new Set(); export class WeakMultiRef { - #cleanup = ( + static #cleanup = ( { set, ref, target }: { // deno-lint-ignore ban-types set: Set>, @@ -18,7 +18,7 @@ export class WeakMultiRef { // deno-lint-ignore ban-types People can pass literally anything into ReactiveArray weakKeys = new Set>(); - #finalizationGroup = new FinalizationRegistry(this.#cleanup); + #finalizationGroup = new FinalizationRegistry(WeakMultiRef.#cleanup); constructor ( // deno-lint-ignore ban-types People can pass literally anything into ReactiveArray From efe1455c053baf13e52c600f3b5eb9c23e8a661c Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Fri, 15 Oct 2021 00:54:18 +0100 Subject: [PATCH 34/38] cleanup readme --- examples/README.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/examples/README.md b/examples/README.md index 28567df..f31dff9 100644 --- a/examples/README.md +++ b/examples/README.md @@ -18,11 +18,6 @@ $ deno bundle --config tsconfig.json components/App.ts components/app.js $ npx serve-http ``` -Note that currently, there are multiple issues with this: - -https://github.com/denoland/deno/issues/11286 -https://github.com/denoland/deno/issues/11287 - #### 2 Using `Deno.emit`: @@ -50,11 +45,6 @@ $ deno run -A --unstable compile.ts $ npx serve-http ``` -Note that currently, there are multiple issues with this: - -https://github.com/denoland/deno/issues/11286 -https://github.com/denoland/deno/issues/11287 - ### Transpile NOTE: This *transpiles*, and DOES NOT *bundle*, AND keeps the RAW LINKS to destiny. For example, everytime a user requests the js files, a new request will be made to the dependencies cdn. From 6bf424e675dfa991362e6cc9cb1d0c4344b21c69 Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Fri, 13 May 2022 21:57:44 +0100 Subject: [PATCH 35/38] rm examples dir --- examples/.gitignore | 3 - examples/README.md | 119 --- examples/browser/components/App.js | 22 - examples/browser/index.html | 9 - examples/deno-router/components/App.js | 18 - examples/deno-router/components/bye.js | 14 - examples/deno-router/components/drash.js | 14 - examples/deno-router/components/hello.js | 14 - examples/deno-router/components/landing.js | 12 - examples/deno-router/main.js | 5 - .../src/_examples/components/app-root.ts | 23 - .../src/_examples/components/array-demo.ts | 58 -- .../_examples/components/async-component.ts | 9 - .../src/_examples/components/async-demo.ts | 16 - .../_examples/components/forms/text-field.ts | 14 - .../src/_examples/components/hash-router.ts | 41 - .../src/_examples/components/inputStyles.ts | 54 -- .../src/_examples/components/tab-view.ts | 107 --- .../src/_examples/components/time-diff.ts | 75 -- .../src/_examples/components/to-do/_to-do.ts | 117 --- .../_examples/components/to-do/animations.ts | 25 - .../_examples/components/to-do/task-item.ts | 106 --- .../src/_examples/components/visitor-demo.ts | 26 - .../components/window-manager/TWindow.ts | 14 - .../window-manager/_window-manager.ts | 175 ---- .../components/window-manager/window.ts | 110 --- examples/deno-router/src/_examples/main.ts | 5 - .../src/componentLogic/Component.ts | 153 ---- .../src/componentLogic/DestinyFallback.ts | 56 -- .../deno-router/src/componentLogic/Ref.ts | 51 -- .../componentOrComponentModule.ts | 19 - .../src/componentLogic/elementData.ts | 9 - .../src/componentLogic/isComponent.ts | 11 - .../src/componentLogic/register.ts | 41 - examples/deno-router/src/examples_mod.ts | 8 - examples/deno-router/src/mod.ts | 22 - .../deno-router/src/parsing/Renderable.ts | 3 - examples/deno-router/src/parsing/Slot.ts | 128 --- examples/deno-router/src/parsing/SlotArray.ts | 100 --- .../deno-router/src/parsing/TParseResult.ts | 4 - .../src/parsing/TUnpreparedContentSlot.ts | 8 - .../deno-router/src/parsing/TemplateCache.ts | 26 - .../deno-router/src/parsing/TemplateResult.ts | 27 - examples/deno-router/src/parsing/_xml.ts | 23 - .../deno-router/src/parsing/createTemplate.ts | 46 - .../src/parsing/deferredElements.ts | 7 - .../src/parsing/getXmlErrorMessage.ts | 10 - .../src/parsing/hookSlotsUp/_hookSlotsUp.ts | 24 - .../_hookAttributeSlotsUp.ts | 49 -- .../assignElementData/_assignElementData.ts | 43 - .../assignElementData/attribute.ts | 25 - .../assignElementData/destiny.ts | 31 - .../assignElementData/destinyData.ts | 19 - .../assignElementData/destinyMount.ts | 27 - .../assignElementData/destinyProps.ts | 27 - .../assignElementData/destinyRef.ts | 37 - .../assignElementData/destinyUnmount.ts | 31 - .../assignElementData/on.ts | 30 - .../assignElementData/prop.ts | 25 - .../hookAttributeSlotsUp/doOrBind.ts | 33 - .../elementData/ElementData.ts | 14 - .../elementData/TElementData.ts | 5 - .../elementData/TNamespace.ts | 3 - .../elementData/isValidNamespace.ts | 15 - .../matchChangeWatcher.ts | 18 - .../parseAttributeName.ts | 17 - .../resolveSlotPropIndex.ts | 9 - .../hookContentSlotsUp/_hookContentSlotsUp.ts | 36 - .../toFragment/arrayToFragment.ts | 20 - .../toFragment/nodeToFragment.ts | 11 - .../toFragment/valueToFragment.ts | 28 - .../src/parsing/hookSlotsUp/stringifyValue.ts | 22 - .../src/parsing/parseAsNewDocument.ts | 10 - .../deno-router/src/parsing/parseInSafari.ts | 19 - .../deno-router/src/parsing/parseString.ts | 47 - .../src/parsing/prepareContentSlots.ts | 30 - .../deno-router/src/parsing/resolveSlots.ts | 45 - .../ReactiveArray/TArrayUpdateArguments.ts | 5 - .../reactive/ReactiveArray/TArrayValueType.ts | 9 - .../src/reactive/ReactiveArray/TMask.ts | 3 - .../src/reactive/ReactiveArray/TMaskEntry.ts | 4 - .../ReactiveArray/TReactiveArrayCallback.ts | 5 - .../ReactiveArray/TUnwrapReactiveArray.ts | 7 - .../reactive/ReactiveArray/_ReactiveArray.ts | 216 ----- .../ReactiveArray/_ReadonlyReactiveArray.ts | 827 ------------------ .../ReactiveArray/arrayDependencyCaches.ts | 18 - .../src/reactive/ReactiveArray/flatten.ts | 21 - .../reactive/ReactiveArray/internalArrays.ts | 23 - .../makeNonPrimitiveItemsReactive.ts | 27 - .../src/reactive/ReactiveArray/splicers.ts | 29 - .../ReactiveArray/updateFilteredArray.ts | 63 -- .../ReactiveValue/PassReactiveValue.ts | 9 - .../ReactiveValue/TReactiveValueCallback.ts | 1 - .../ReactiveValue/TReactiveValueUpdater.ts | 6 - .../TReactiveValueUpdaterOptions.ts | 6 - .../reactive/ReactiveValue/_ReactiveValue.ts | 51 -- .../ReactiveValue/_ReadonlyReactiveValue.ts | 220 ----- .../ReactiveValue/internalSetReactiveValue.ts | 22 - .../ReactiveValue/valueDependencyCaches.ts | 17 - .../deno-router/src/reactive/classNames.ts | 44 - examples/deno-router/src/reactive/computed.ts | 58 -- examples/deno-router/src/reactive/reactive.ts | 78 -- .../reactiveProperties/TReactiveProperties.ts | 8 - .../TReactivePropertiesFlag.ts | 5 - .../reactiveProperties/_reactiveProperties.ts | 37 - .../reactivePropertiesFlag.ts | 1 - .../reactiveProperties/specialCaseObjects.ts | 24 - .../src/reactive/types/TPrimitive.ts | 9 - .../src/reactive/types/TReactive.ts | 9 - .../src/reactive/types/TReactiveEntity.ts | 7 - .../src/reactive/types/TReactiveValueType.ts | 15 - .../deno-router/src/styling/CSSTemplate.ts | 29 - .../src/styling/attachCSSProperties.ts | 22 - examples/deno-router/src/styling/css.ts | 14 - .../src/styling/supportsAdoptedStyleSheets.ts | 4 - .../deno-router/src/typeChecks/isElement.ts | 9 - .../deno-router/src/typeChecks/isObject.ts | 10 - .../deno-router/src/typeChecks/isPrimitive.ts | 14 - .../deno-router/src/typeChecks/isReactive.ts | 23 - .../src/typeChecks/isRenderable.ts | 10 - .../deno-router/src/typeChecks/isTextNode.ts | 9 - .../deno-router/src/utils/IterableWeakMap.ts | 159 ---- .../src/utils/NotImplementedError.ts | 6 - .../deno-router/src/utils/WeakMultiRef.ts | 43 - examples/deno-router/src/utils/arrayWrap.ts | 7 - .../src/utils/composeTemplateString.ts | 8 - .../deno-router/src/utils/concatIterators.ts | 7 - .../deno-router/src/utils/describeType.ts | 13 - examples/deno-router/src/utils/id.ts | 13 - examples/deno-router/src/utils/mapConcat.ts | 12 - examples/deno-router/src/utils/mapEmplace.ts | 45 - .../deno-router/src/utils/pascalToKebab.ts | 8 - .../src/utils/pseudoRandomEncode.ts | 8 - .../src/utils/safeStringifyObject.ts | 14 - .../deno-router/src/utils/throwExpression.ts | 6 - examples/deno-router/src/utils/toNumber.ts | 13 - examples/deno/compile.ts | 20 - examples/deno/components/App.ts | 21 - examples/deno/index.html | 9 - examples/deno/transpile.ts | 21 - examples/deno/tsconfig.json | 9 - examples/node/components/App.ts | 24 - examples/node/index.html | 9 - examples/node/package.json | 19 - examples/node/tsconfig.json | 10 - examples/node/webpack.config.js | 25 - 146 files changed, 5264 deletions(-) delete mode 100644 examples/.gitignore delete mode 100644 examples/README.md delete mode 100644 examples/browser/components/App.js delete mode 100644 examples/browser/index.html delete mode 100644 examples/deno-router/components/App.js delete mode 100644 examples/deno-router/components/bye.js delete mode 100644 examples/deno-router/components/drash.js delete mode 100644 examples/deno-router/components/hello.js delete mode 100644 examples/deno-router/components/landing.js delete mode 100644 examples/deno-router/main.js delete mode 100644 examples/deno-router/src/_examples/components/app-root.ts delete mode 100644 examples/deno-router/src/_examples/components/array-demo.ts delete mode 100644 examples/deno-router/src/_examples/components/async-component.ts delete mode 100644 examples/deno-router/src/_examples/components/async-demo.ts delete mode 100644 examples/deno-router/src/_examples/components/forms/text-field.ts delete mode 100644 examples/deno-router/src/_examples/components/hash-router.ts delete mode 100644 examples/deno-router/src/_examples/components/inputStyles.ts delete mode 100644 examples/deno-router/src/_examples/components/tab-view.ts delete mode 100644 examples/deno-router/src/_examples/components/time-diff.ts delete mode 100644 examples/deno-router/src/_examples/components/to-do/_to-do.ts delete mode 100644 examples/deno-router/src/_examples/components/to-do/animations.ts delete mode 100644 examples/deno-router/src/_examples/components/to-do/task-item.ts delete mode 100644 examples/deno-router/src/_examples/components/visitor-demo.ts delete mode 100644 examples/deno-router/src/_examples/components/window-manager/TWindow.ts delete mode 100644 examples/deno-router/src/_examples/components/window-manager/_window-manager.ts delete mode 100644 examples/deno-router/src/_examples/components/window-manager/window.ts delete mode 100644 examples/deno-router/src/_examples/main.ts delete mode 100644 examples/deno-router/src/componentLogic/Component.ts delete mode 100644 examples/deno-router/src/componentLogic/DestinyFallback.ts delete mode 100644 examples/deno-router/src/componentLogic/Ref.ts delete mode 100644 examples/deno-router/src/componentLogic/componentOrComponentModule.ts delete mode 100644 examples/deno-router/src/componentLogic/elementData.ts delete mode 100644 examples/deno-router/src/componentLogic/isComponent.ts delete mode 100644 examples/deno-router/src/componentLogic/register.ts delete mode 100644 examples/deno-router/src/examples_mod.ts delete mode 100644 examples/deno-router/src/mod.ts delete mode 100644 examples/deno-router/src/parsing/Renderable.ts delete mode 100644 examples/deno-router/src/parsing/Slot.ts delete mode 100644 examples/deno-router/src/parsing/SlotArray.ts delete mode 100644 examples/deno-router/src/parsing/TParseResult.ts delete mode 100644 examples/deno-router/src/parsing/TUnpreparedContentSlot.ts delete mode 100644 examples/deno-router/src/parsing/TemplateCache.ts delete mode 100644 examples/deno-router/src/parsing/TemplateResult.ts delete mode 100644 examples/deno-router/src/parsing/_xml.ts delete mode 100644 examples/deno-router/src/parsing/createTemplate.ts delete mode 100644 examples/deno-router/src/parsing/deferredElements.ts delete mode 100644 examples/deno-router/src/parsing/getXmlErrorMessage.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/_hookSlotsUp.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/_hookAttributeSlotsUp.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/_assignElementData.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/attribute.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destiny.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyData.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyMount.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyProps.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyRef.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyUnmount.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/on.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/prop.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/doOrBind.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/ElementData.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/TElementData.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/TNamespace.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/isValidNamespace.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/matchChangeWatcher.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/parseAttributeName.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/resolveSlotPropIndex.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookContentSlotsUp/_hookContentSlotsUp.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/arrayToFragment.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/nodeToFragment.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/valueToFragment.ts delete mode 100644 examples/deno-router/src/parsing/hookSlotsUp/stringifyValue.ts delete mode 100644 examples/deno-router/src/parsing/parseAsNewDocument.ts delete mode 100644 examples/deno-router/src/parsing/parseInSafari.ts delete mode 100644 examples/deno-router/src/parsing/parseString.ts delete mode 100644 examples/deno-router/src/parsing/prepareContentSlots.ts delete mode 100644 examples/deno-router/src/parsing/resolveSlots.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveArray/TArrayUpdateArguments.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveArray/TArrayValueType.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveArray/TMask.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveArray/TMaskEntry.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveArray/TReactiveArrayCallback.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveArray/TUnwrapReactiveArray.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveArray/_ReactiveArray.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveArray/_ReadonlyReactiveArray.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveArray/arrayDependencyCaches.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveArray/flatten.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveArray/internalArrays.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveArray/makeNonPrimitiveItemsReactive.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveArray/splicers.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveArray/updateFilteredArray.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveValue/PassReactiveValue.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveValue/TReactiveValueCallback.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveValue/TReactiveValueUpdater.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveValue/TReactiveValueUpdaterOptions.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveValue/_ReactiveValue.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveValue/_ReadonlyReactiveValue.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveValue/internalSetReactiveValue.ts delete mode 100644 examples/deno-router/src/reactive/ReactiveValue/valueDependencyCaches.ts delete mode 100644 examples/deno-router/src/reactive/classNames.ts delete mode 100644 examples/deno-router/src/reactive/computed.ts delete mode 100644 examples/deno-router/src/reactive/reactive.ts delete mode 100644 examples/deno-router/src/reactive/reactiveProperties/TReactiveProperties.ts delete mode 100644 examples/deno-router/src/reactive/reactiveProperties/TReactivePropertiesFlag.ts delete mode 100644 examples/deno-router/src/reactive/reactiveProperties/_reactiveProperties.ts delete mode 100644 examples/deno-router/src/reactive/reactiveProperties/reactivePropertiesFlag.ts delete mode 100644 examples/deno-router/src/reactive/reactiveProperties/specialCaseObjects.ts delete mode 100644 examples/deno-router/src/reactive/types/TPrimitive.ts delete mode 100644 examples/deno-router/src/reactive/types/TReactive.ts delete mode 100644 examples/deno-router/src/reactive/types/TReactiveEntity.ts delete mode 100644 examples/deno-router/src/reactive/types/TReactiveValueType.ts delete mode 100644 examples/deno-router/src/styling/CSSTemplate.ts delete mode 100644 examples/deno-router/src/styling/attachCSSProperties.ts delete mode 100644 examples/deno-router/src/styling/css.ts delete mode 100644 examples/deno-router/src/styling/supportsAdoptedStyleSheets.ts delete mode 100644 examples/deno-router/src/typeChecks/isElement.ts delete mode 100644 examples/deno-router/src/typeChecks/isObject.ts delete mode 100644 examples/deno-router/src/typeChecks/isPrimitive.ts delete mode 100644 examples/deno-router/src/typeChecks/isReactive.ts delete mode 100644 examples/deno-router/src/typeChecks/isRenderable.ts delete mode 100644 examples/deno-router/src/typeChecks/isTextNode.ts delete mode 100644 examples/deno-router/src/utils/IterableWeakMap.ts delete mode 100644 examples/deno-router/src/utils/NotImplementedError.ts delete mode 100644 examples/deno-router/src/utils/WeakMultiRef.ts delete mode 100644 examples/deno-router/src/utils/arrayWrap.ts delete mode 100644 examples/deno-router/src/utils/composeTemplateString.ts delete mode 100644 examples/deno-router/src/utils/concatIterators.ts delete mode 100644 examples/deno-router/src/utils/describeType.ts delete mode 100644 examples/deno-router/src/utils/id.ts delete mode 100644 examples/deno-router/src/utils/mapConcat.ts delete mode 100644 examples/deno-router/src/utils/mapEmplace.ts delete mode 100644 examples/deno-router/src/utils/pascalToKebab.ts delete mode 100644 examples/deno-router/src/utils/pseudoRandomEncode.ts delete mode 100644 examples/deno-router/src/utils/safeStringifyObject.ts delete mode 100644 examples/deno-router/src/utils/throwExpression.ts delete mode 100644 examples/deno-router/src/utils/toNumber.ts delete mode 100644 examples/deno/compile.ts delete mode 100644 examples/deno/components/App.ts delete mode 100644 examples/deno/index.html delete mode 100644 examples/deno/transpile.ts delete mode 100644 examples/deno/tsconfig.json delete mode 100644 examples/node/components/App.ts delete mode 100644 examples/node/index.html delete mode 100644 examples/node/package.json delete mode 100644 examples/node/tsconfig.json delete mode 100644 examples/node/webpack.config.js diff --git a/examples/.gitignore b/examples/.gitignore deleted file mode 100644 index 91e83a4..0000000 --- a/examples/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -node/package-lock.json -node/public -node/node_modules \ No newline at end of file diff --git a/examples/README.md b/examples/README.md deleted file mode 100644 index f31dff9..0000000 --- a/examples/README.md +++ /dev/null @@ -1,119 +0,0 @@ -Make sure to create the dist firsT: npm run compile - -## Usage with Deno - -Note that this approach in this example uses the 1st method in the "Bundle" section, because from a user perspective, this is a lot simpler - -### Bundle - -There is 2 ways you can bundle your client side scripts using Deno: - -#### 1 - -Use `deno bundle`: - -```shell -$ cd examples/deno -$ deno bundle --config tsconfig.json components/App.ts components/app.js -$ npx serve-http -``` - -#### 2 - -Using `Deno.emit`: - -```ts -const { diagnostics, files } = await Deno.emit("./components/App.ts", { - bundle: "classic", - compilerOptions: { - "target": "es2020", - "module": "esnext", - "lib": ["dom", "DOM.Iterable", "ESNext"], - "sourceMap": false - }, -}) -const fd = await Deno.formatDiagnostics(diagnostics) -console.log(fd) -const fileKey = Object.keys(files)[0] -const content = files[fileKey] -const encoder = new TextEncoder() -Deno.writeFileSync("./components/app.js", encoder.encode(content)) -``` - -```shell -$ deno run -A --unstable compile.ts -$ npx serve-http -``` - -### Transpile - -NOTE: This *transpiles*, and DOES NOT *bundle*, AND keeps the RAW LINKS to destiny. For example, everytime a user requests the js files, a new request will be made to the dependencies cdn. - -This setup uses: - - - `compile.ts` to transpile your component. This the exact same as using webpack (without bundling) and tsc - - `components/App.ts` - the component to use on your frontend - - `index.html` - the view to serve your bundled file - -Note that our source code files are slightly different this time, because as we are transpiling, it is going to generate a new file *per* dependency. Here's how you can do it: - -```ts -// components/App.ts -import { Component, css, html, register } from "./dist/mod.js"; // or the cdn -class CustomP extends Component<{ - customText: string -}> { - static override styles = css` - p { - color: red; - } - ` - template = html`

${this.customText}

` -} -class AppRoot extends Component { - override template = html` -
- <${CustomP} prop:customText=${"hello"}> -
- `; -} -register(AppRoot) -``` - -```shell -$ cd examples/deno -$ cp -r ../../dist . # only needed because npx cannot get files in parent directories -$ deno run -A --unstable transpile.ts -$ npx serve-http -# go to browser -``` - -## Usage with Node - -This will work AS IS - -This setup uses: - - - `tsconfig.json` used in conjunction with webpack - - `webpack.config.js` - uses to tranpsile your component - - `components/App.ts` - the component to use on your frontend - - `index.html` - the view to serve your bundled file - -```shell -$ node_modules/.bin/webpack --config webpack.config.js -$ npx serve-http -# go to browser -``` - -## Usage With Browser - -This setup uses: - - - `components/App.ts` - the component to use on your frontend - - `index.html` - the view to serve your bundled file - -```shell -$ cd examples/browser -$ cp -r ../../dist . -$ npx serve-http -``` \ No newline at end of file diff --git a/examples/browser/components/App.js b/examples/browser/components/App.js deleted file mode 100644 index 9f44770..0000000 --- a/examples/browser/components/App.js +++ /dev/null @@ -1,22 +0,0 @@ -import { Component, css, html } from "../../dist/mod.js"; - -class CustomP extends Component { - static styles = css` - p { - color: red; - } - ` - - template = html`

${this.customText}

` -} - -class AppRoot extends Component { - - template = html` -
- <${CustomP} prop:customText=${"hello"}> -
- `; -} - -customElements.define("app-root", AppRoot) \ No newline at end of file diff --git a/examples/browser/index.html b/examples/browser/index.html deleted file mode 100644 index ad68015..0000000 --- a/examples/browser/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/examples/deno-router/components/App.js b/examples/deno-router/components/App.js deleted file mode 100644 index ff3c774..0000000 --- a/examples/deno-router/components/App.js +++ /dev/null @@ -1,18 +0,0 @@ -import { Component, register, xml, Router, Route } from "../src/mod.js"; -class AppRoot extends Component { - constructor() { - super(...arguments); - Object.defineProperty(this, "template", { - enumerable: true, - configurable: true, - writable: true, - value: xml ` - <${Router}> - <${Route} prop:path=${"/"} prop:content=${"/components/landing.js"}> - <${Route} prop:path=${"/drash/:version?"} prop:content=${"/components/drash.js"}> - - ` - }); - } -} -register(AppRoot); diff --git a/examples/deno-router/components/bye.js b/examples/deno-router/components/bye.js deleted file mode 100644 index 4a87a03..0000000 --- a/examples/deno-router/components/bye.js +++ /dev/null @@ -1,14 +0,0 @@ -import { Component, xml } from "../src/mod.js"; -export default class Bye extends Component { - constructor() { - super(...arguments); - Object.defineProperty(this, "template", { - enumerable: true, - configurable: true, - writable: true, - value: xml ` -

bye

- ` - }); - } -} diff --git a/examples/deno-router/components/drash.js b/examples/deno-router/components/drash.js deleted file mode 100644 index 03e1b95..0000000 --- a/examples/deno-router/components/drash.js +++ /dev/null @@ -1,14 +0,0 @@ -import { Component, xml } from "../src/mod.js"; -export default class Drash extends Component { - constructor() { - super(...arguments); - Object.defineProperty(this, "template", { - enumerable: true, - configurable: true, - writable: true, - value: xml ` -

drash

- ` - }); - } -} diff --git a/examples/deno-router/components/hello.js b/examples/deno-router/components/hello.js deleted file mode 100644 index d2c6714..0000000 --- a/examples/deno-router/components/hello.js +++ /dev/null @@ -1,14 +0,0 @@ -import { Component, xml } from "../src/mod.js"; -export default class Hello extends Component { - constructor() { - super(...arguments); - Object.defineProperty(this, "template", { - enumerable: true, - configurable: true, - writable: true, - value: xml ` -

hello

- ` - }); - } -} diff --git a/examples/deno-router/components/landing.js b/examples/deno-router/components/landing.js deleted file mode 100644 index d1159c2..0000000 --- a/examples/deno-router/components/landing.js +++ /dev/null @@ -1,12 +0,0 @@ -import { Component, xml } from "../src/mod.js"; -export default class Landing extends Component { - constructor() { - super(...arguments); - Object.defineProperty(this, "template", { - enumerable: true, - configurable: true, - writable: true, - value: xml `

landing

` - }); - } -} diff --git a/examples/deno-router/main.js b/examples/deno-router/main.js deleted file mode 100644 index 9754458..0000000 --- a/examples/deno-router/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import "./components/landing.js"; -import "./components/drash.js"; -import "./components/hello.js"; -import "./components/bye.js"; -import "./components/App.js"; diff --git a/examples/deno-router/src/_examples/components/app-root.ts b/examples/deno-router/src/_examples/components/app-root.ts deleted file mode 100644 index b55d5b7..0000000 --- a/examples/deno-router/src/_examples/components/app-root.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Component, html, css } from "../../mod.ts"; - -import TabView from "./tab-view.ts"; - -export class AppRoot extends Component { - static override styles = css` - :host { - --element-color: #777; - --element-hover-color: #888; - --element-focus-color: #999; - --xl: 48px; - --l: 32px; - --m: 16px; - --s: 8px; - --xs: 4px; - --border-radius: 3px; - } - `; - - override template = html` - <${TabView} /> - `; -} diff --git a/examples/deno-router/src/_examples/components/array-demo.ts b/examples/deno-router/src/_examples/components/array-demo.ts deleted file mode 100644 index 7b7f6ec..0000000 --- a/examples/deno-router/src/_examples/components/array-demo.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { Component, reactive, html, css, computed } from "../../mod.ts"; - -const randomColor = () => ( - "#" + - Math - .floor(Math.random() * 2**24) - .toString(16) - .padStart(6, "0") -); - -export default class ArrayDemo extends Component { - #items = reactive(Array.from({length: 256}, randomColor)); - frame = (): void => { - const randomIndex = Math.floor( - Math.random() * this.#items.length.value, - ); - this.#items.set(randomIndex, randomColor()); - this.#timer = requestAnimationFrame(this.frame); - }; - #timer = requestAnimationFrame(this.frame); - - disconnectedCallback (): void { - cancelAnimationFrame(this.#timer); - } - - static override styles = css` - ul { - list-style: none; - padding: 0; - display: flex; - flex-direction: row; - flex-wrap: wrap; - } - - li { - display: block; - width: var(--l); - height: var(--l); - text-align: center; - line-height: var(--l); - margin: var(--xs); - border-radius: var(--border-radius); - text-shadow: 1px 1px 3px rgba(0, 0, 0, .5); - box-shadow: 1px 1px 3px rgba(0, 0, 0, .5); - font-family: monospace; - } - `; - - override template = html` -
    - ${this.#items.map((text, i) => html` -
  • - ${i} -
  • - `)} -
- `; -} diff --git a/examples/deno-router/src/_examples/components/async-component.ts b/examples/deno-router/src/_examples/components/async-component.ts deleted file mode 100644 index d0603c6..0000000 --- a/examples/deno-router/src/_examples/components/async-component.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Component, html } from "../../mod.ts"; - -export default class AsyncComponent extends Component { - override template = html` - foo - - bar - `; -} diff --git a/examples/deno-router/src/_examples/components/async-demo.ts b/examples/deno-router/src/_examples/components/async-demo.ts deleted file mode 100644 index daaec68..0000000 --- a/examples/deno-router/src/_examples/components/async-demo.ts +++ /dev/null @@ -1,16 +0,0 @@ - -import { Component, html } from "../../mod.ts"; - -export default class AsyncDemo extends Component { - #AsyncComponent = import("./async-component.ts"); - - override template = html` - This is not a super exciting demo to look at — I'll cook up a nicer async demo later. -
- <${import("./forms/text-field.ts")} value="testing" /> -
- <${this.#AsyncComponent}> - Qux - - `; -} diff --git a/examples/deno-router/src/_examples/components/forms/text-field.ts b/examples/deno-router/src/_examples/components/forms/text-field.ts deleted file mode 100644 index 0cdb562..0000000 --- a/examples/deno-router/src/_examples/components/forms/text-field.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Component, html } from "../../../mod.ts"; -import { inputStyles } from "../inputStyles.ts"; - -/** - * An example of a component that forwards its props to a child. - */ -export default class TextField extends Component { - static override captureProps = true; - static override styles = inputStyles; - - override template = html` - - `; -} diff --git a/examples/deno-router/src/_examples/components/hash-router.ts b/examples/deno-router/src/_examples/components/hash-router.ts deleted file mode 100644 index 2f6abba..0000000 --- a/examples/deno-router/src/_examples/components/hash-router.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Component, reactive, html, computed } from "../../mod.ts"; - -function getHashRoute ( - url: string, -) { - return "/" + new URL(url).hash.replace(/^#\//u, ""); -} - -export const route = reactive(getHashRoute(window.location.href)); - -window.addEventListener("hashchange", () => { - route.value = getHashRoute(window.location.href); -}); - -export default class HashRouter extends Component<{ - routes: Array<{ - path: string, - content: string, - }>, -}> { - #error404 = html` - - 404 — route "${route}" not found - - `; - - override template = computed(() => { - const routeInfo = this.routes.find(({path}) => path === route.value); - return ( - routeInfo - ? html` - <${import(routeInfo.content)} - prop:fallback=${html`Loading…`} - prop:catch=${(err: Error) => html` - Error loading page: ${err.message}` - } - />` - : this.#error404 - ); - }); -} diff --git a/examples/deno-router/src/_examples/components/inputStyles.ts b/examples/deno-router/src/_examples/components/inputStyles.ts deleted file mode 100644 index a2dc6aa..0000000 --- a/examples/deno-router/src/_examples/components/inputStyles.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { css } from "../../mod.ts"; - -export const inputStyles = css` - input:not([type=checkbox]) { - color: white; - vertical-align: top; - box-sizing: border-box; - min-width: var(--xl); - height: var(--l); - padding: 0 var(--s); - background: var(--element-color); - border-radius: var(--border-radius); - box-shadow: 0 1px 1px rgba(0,0,0,.4); - text-shadow: 1px 1px 1px rgba(0,0,0,.4); - outline: none; - transition: all .1s; - border: 1px solid transparent; - font-size: var(--m); - } - input:not([type=checkbox]):hover { - background: var(--element-hover-color); - } - input:not([type=checkbox]):active { - transform: translateY(1px); - } - input:not([type=checkbox]):focus { - border: 1px solid var(--element-focus-color); - } - - [type=text], [type=time] { - width: 200px; - border: none; - } - input[type=text]::placeholder { - font-style: italic; - color: #333; - text-shadow: none; - } - - input:not([type=text]), label { - cursor: pointer; - } - - label { - display: inline-block; - height: var(--l); - line-height: var(--l); - } - - label, [type=button], [type=submit] { - cursor: pointer; - color: white; - } -`; \ No newline at end of file diff --git a/examples/deno-router/src/_examples/components/tab-view.ts b/examples/deno-router/src/_examples/components/tab-view.ts deleted file mode 100644 index 00f01c6..0000000 --- a/examples/deno-router/src/_examples/components/tab-view.ts +++ /dev/null @@ -1,107 +0,0 @@ -import { Component, computed, html, css, classNames } from "../../mod.ts"; - -import HashRouter, { route } from "./hash-router.ts"; - -export default class TabView extends Component { - #tabs = [ - { - path: "/", - title: "Visitor demo", - content: "./visitor-demo.js", - }, - { - path: "/todo", - title: "Todo", - content: "./to-do/_to-do.js", - }, - { - path: "/array-demo", - title: "Array demo", - content: "./array-demo.js", - }, - { - path: "/time-difference", - title: "Time difference", - content: "./time-diff.js", - }, - { - path: "/async", - title: "Async", - content: "./async-demo.js", - }, - { - path: "/window-manager", - title: "Windowing demo", - content: "./window-manager/_window-manager.js", - }, - ].map(tab => (tab.content = new URL(tab.content, import.meta.url).href, tab)); - - connectedCallback (): void { - const original = document.title; - route.bind( - path => { - document.title = this.#tabs.find(v => v.path === path)?.title ?? original; - }, - { dependents: [this] }, - ); - } - - static override styles = css` - nav { - padding: 0; - padding-left: var(--m); - display: flex; - margin: 0; - } - a { - padding: var(--s) var(--m); - border-top-left-radius: var(--border-radius); - border-top-right-radius: var(--border-radius); - transition: background .2s; - user-select: none; - color: white; - text-decoration: none; - } - a:not(.selected):hover { - background: rgba(255, 255, 255, .06); - cursor: pointer; - } - a:not(.selected):active { - background: rgba(255, 255, 255, .03); - cursor: pointer; - } - - .selected, main { - background: rgba(255, 255, 255, .1); - } - - main { - padding: var(--m); - border-radius: var(--border-radius); - } - `; - - override template = html` - - -
- <${HashRouter} prop:routes=${this.#tabs}> -
- Couldn't find resource "${route}".
- Please check your spelling. -
- -
- `; -} diff --git a/examples/deno-router/src/_examples/components/time-diff.ts b/examples/deno-router/src/_examples/components/time-diff.ts deleted file mode 100644 index c107673..0000000 --- a/examples/deno-router/src/_examples/components/time-diff.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { Component, html, reactive, computed } from "../../mod.ts"; - -import { inputStyles } from "./inputStyles.ts"; - -function formatTimeFragment ( - input: number, -) { - return String(input).padStart(2, "0"); -} - -function formatTime ( - duration: number, -) { - const days = Math.floor(duration / 1000 / 60 / 60 / 24); - const hours = Math.floor(duration / 1000 / 60 / 60 % 24); - const minutes = Math.floor(duration / 1000 / 60 % 60); - const seconds = Math.floor(duration / 1000 % 60); - const daysString = days ? `${days}, ` : ""; - const hoursString = `${hours}:`; - const minutesString = formatTimeFragment(minutes); - const secondsString = seconds ? `:${formatTimeFragment(seconds)}`: ""; - return [daysString, hoursString, minutesString, secondsString].join(""); -} - -function createTask () { - return { - start: new Date(0), - end: new Date(0), - name: "new task", - }; -} - -export default class TimeDiff extends Component { - #tasks = reactive([createTask()]); //initialize an array of tasks, with one task in it - - static override styles = inputStyles; - - override template = html` - ${this.#tasks.map(task => html` -
- - - -

- Duration of "${task.name}": ${computed(() => - formatTime(Number(task.end.value) - Number(task.start.value)) - )} -

-
` - )} - this.#tasks.push(createTask())} - value="New task" - /> - `; -} diff --git a/examples/deno-router/src/_examples/components/to-do/_to-do.ts b/examples/deno-router/src/_examples/components/to-do/_to-do.ts deleted file mode 100644 index 5b8b29b..0000000 --- a/examples/deno-router/src/_examples/components/to-do/_to-do.ts +++ /dev/null @@ -1,117 +0,0 @@ -import { Component, html, css, reactive } from "../../../mod.ts"; - -import TaskItem from "./task-item.ts"; -import { animateIn, animateOut } from "./animations.ts"; -import { inputStyles } from "../inputStyles.ts"; - -type TInputChangeEvent = InputEvent & { - currentTarget: HTMLInputElement, -}; - -export default class Todo extends Component { - #newValue = reactive(""); - #items = reactive([ - { - title: "Pet a cat", - done: true, - editing: false, - }, - { - title: "Catch all Pokémon", - done: false, - editing: false, - }, - { - title: "Travel the world", - done: false, - editing: false, - }, - ]); - - static override styles = [ - inputStyles, - css` - ul { - list-style: none; - } - - li { - height: var(--l); - overflow: hidden; - font-size: var(--m); - padding-bottom: var(--xs); - } - - - ${TaskItem} { - display: block; - height: var(--l); - overflow: hidden; - } - `, - ]; - - override template = html` -

${this.#items.filter(v => v.done.value).length}/${this.#items.length} tasks compelete

-
    - ${this.#items.map((item, i) => html` - <${TaskItem} - prop:item=${item} - prop:removeItem=${() => this.#items.splice(i.value, 1)} - destiny:mount=${animateIn} - destiny:unmount=${animateOut} - /> - `)} - ${this.#items.length.falsy(html` -
  • - No items to show -
  • - `)} -
  • -
    { - e.preventDefault(); - this.#items.push({ - title: this.#newValue.value, - done: false, - editing: false, - }); - this.#newValue.value = ""; - }} - > - - -
    -
  • -
- - this.#items.mutFilter(v => !v.done.value)} - /> - `; -} diff --git a/examples/deno-router/src/_examples/components/to-do/animations.ts b/examples/deno-router/src/_examples/components/to-do/animations.ts deleted file mode 100644 index 8abf982..0000000 --- a/examples/deno-router/src/_examples/components/to-do/animations.ts +++ /dev/null @@ -1,25 +0,0 @@ -export function animateIn ( - element: HTMLElement, -): void { - element.animate( - [ - {height: "0px"}, - {height: "var(--l)"}, - ], - {duration: 300, easing: "ease"}, - ).play(); -} - -export async function animateOut ( - element: HTMLElement, -): Promise { - const animation = element.animate( - [ - {height: "var(--l)"}, - {height: "0px"}, - ], - {duration: 300, easing: "ease", fill: "forwards"}, - ); - animation.play(); - await animation.finished; -} diff --git a/examples/deno-router/src/_examples/components/to-do/task-item.ts b/examples/deno-router/src/_examples/components/to-do/task-item.ts deleted file mode 100644 index 57b0b47..0000000 --- a/examples/deno-router/src/_examples/components/to-do/task-item.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { Component, html, css } from "../../../mod.ts"; -import type { TReactiveValueType } from "../../../mod.ts"; - -import { inputStyles } from "../inputStyles.ts"; - -export default class TaskItem extends Component<{ - item: TReactiveValueType<{ - title: string, - done: boolean, - editing: boolean, - }>, - removeItem: () => void, -}> { - constructor () { - super(); - this.setAttribute("role", "listitem"); - } - - static override styles = [ - inputStyles, - css` - :host { - padding-bottom: var(--xs); - line-height: var(--l); - } - - label { - display: inline-flex; - align-items: center; - justify-content: space-between; - } - - form { - height: 100%; - font-size: var(--m); - } - - .task-checkbox { - width: 25px; - } - - .task-name { - display: inline-block; - box-sizing: border-box; - width: 175px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - `, - ]; - - override template = html` -
{ - e.preventDefault(); - this.item.editing.value = false; - }} - > - ${this.item.editing.pipe(editing => !editing - ? html` - - this.item.editing.value = true} - /> - ` - : html` - e.focus()} - /> - - ` - )} - -
- `; -} diff --git a/examples/deno-router/src/_examples/components/visitor-demo.ts b/examples/deno-router/src/_examples/components/visitor-demo.ts deleted file mode 100644 index 736b82d..0000000 --- a/examples/deno-router/src/_examples/components/visitor-demo.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Component, html, reactive } from "../../mod.ts"; - -import { inputStyles } from "./inputStyles.ts"; - -export default class VisitorDemo extends Component { - #who = reactive("visitor"); - #count = reactive(0); - #timer = setInterval(() => { - this.#count.value++; - }, 1e3); - - disconnectedCallback (): void { - clearInterval(this.#timer); - } - - static override styles = inputStyles; - - override template = html` - -

- Hello, ${this.#who}! You arrived ${this.#count} seconds ago. -

- `; -} diff --git a/examples/deno-router/src/_examples/components/window-manager/TWindow.ts b/examples/deno-router/src/_examples/components/window-manager/TWindow.ts deleted file mode 100644 index 4615bc2..0000000 --- a/examples/deno-router/src/_examples/components/window-manager/TWindow.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { ReactiveValue, TemplateResult } from "../../../mod.ts"; - -export type TWindow = { - header: string, - content: TemplateResult, - position: { - x: ReactiveValue, - y: ReactiveValue, - }, - size: { - x: ReactiveValue, - y: ReactiveValue, - }, -}; diff --git a/examples/deno-router/src/_examples/components/window-manager/_window-manager.ts b/examples/deno-router/src/_examples/components/window-manager/_window-manager.ts deleted file mode 100644 index b8a6497..0000000 --- a/examples/deno-router/src/_examples/components/window-manager/_window-manager.ts +++ /dev/null @@ -1,175 +0,0 @@ -import { Component, html, css, reactive, ReactiveValue } from "../../../mod.ts"; - -import Window from "./window.ts"; -import type { TWindow } from "./TWindow.ts"; - - -type TDirection = "n" | "s" | "e" | "w" | "ne" | "se" | "sw" | "nw"; -type TGrabType = TDirection | "move" | ""; -const directions = ["s", "n", "e", "w"] as const; - -function grabTypeToCursorType (v: TGrabType) { - switch (v) { - case "move": - return "grabbing"; - case "n": - case "s": - return "ns-resize"; - case "e": - case "w": - return "ew-resize"; - case "ne": - case "sw": - return "nesw-resize"; - case "nw": - case "se": - return "nwse-resize"; - default: - return "initial"; - } -} - -export default class WindowManager extends Component { - #windows: Array = [ - { - header: "Foo", - content: html`Hello, World!`, - position: { - x: reactive(0), - y: reactive(0), - }, - size: { - x: reactive(300), - y: reactive(200), - }, - }, - { - header: "Bar", - content: html`Lorem ipsum`, - position: { - x: reactive(400), - y: reactive(50), - }, - size: { - x: reactive(250), - y: reactive(350), - }, - }, - ]; - - #dragging = { - target: this.#windows[0]!, - type: new ReactiveValue(""), - positionStart: { - x: 0, - y: 0, - }, - sizeStart: { - x: 0, - y: 0, - }, - pointerStart: { - x: 0, - y: 0, - }, - }; - - connectedCallback (): void { - this.addEventListener("mousedown", e => { - const composed = e.composedPath() as Array; - const targetWindow = composed.find( - v => v.matches?.(String(Window)) - ) as Window | null; - if (!targetWindow) return; // event didn't trigger within a window - - const target = composed[0] as HTMLElement; - const type = - target.closest("header") ? "move" : - target.closest(".handle") ? directions.filter(c => target.classList.contains(c)).join() as TDirection - : undefined - ; - if (!type) return; // event didn't trigger on something draggable - - const {position, size} = targetWindow.props; - - this.#dragging.type.value = type; - Object.assign(this.#dragging, { - target: targetWindow.props, - positionStart: { - x: position.x.value, - y: position.y.value, - }, - sizeStart: { - x: size.x.value, - y: size.y.value, - }, - pointerStart: { - x: e.offsetX, - y: e.offsetY, - }, - }); - }); - - this.addEventListener("mousemove", e => { - const type = this.#dragging.type.value; - if (type) { - const {position, size} = this.#dragging.target; - const {positionStart, sizeStart, pointerStart} = this.#dragging; - const deltaPointer = { - x: pointerStart.x - e.offsetX, - y: pointerStart.y - e.offsetY, - }; - - if (type === "move") { - const {x, y} = position; - x.value = positionStart.x - deltaPointer.x; - y.value = positionStart.y - deltaPointer.y; - } else { - if (type.includes("s")) { - size.y.value = sizeStart.y - deltaPointer.y; - } - if (type.includes("n")) { - position.y.value = positionStart.y - deltaPointer.y; - size.y.value = sizeStart.y + deltaPointer.y; - } - if (type.includes("e")) { - size.x.value = sizeStart.x - deltaPointer.x; - } - if (type.includes("w")) { - position.x.value = positionStart.x - deltaPointer.x; - size.x.value = sizeStart.x + deltaPointer.x; - } - } - } - }); - - window.addEventListener("mouseup", () => this.#dragging.type.value = ""); - } - - constructor () { - super(); - - this.attachCSSProperties({ - "user-select": this.#dragging.type.truthy("none", "initial"), - cursor: this.#dragging.type.pipe(grabTypeToCursorType), - }); - } - - static override styles = css` - :host { - position: relative; - display: block; - height: 80vh; - overflow: hidden; - outline: 1px dashed red; - user-select: none; - cursor: initial; - } - `; - - override template = html` - ${this.#windows.map(win => html` - <${Window} prop:props=${win} /> - `)} - `; -} diff --git a/examples/deno-router/src/_examples/components/window-manager/window.ts b/examples/deno-router/src/_examples/components/window-manager/window.ts deleted file mode 100644 index eefa921..0000000 --- a/examples/deno-router/src/_examples/components/window-manager/window.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { Component, html, css, computed } from "../../../mod.ts"; - -import type { TWindow } from "./TWindow.ts"; - -export default class Window extends Component<{ - props: TWindow, -}> { - constructor () { - super(); - - this.attachCSSProperties({ - width: computed`${this.props.size.x}px`, - height: computed`${this.props.size.y}px`, - transform: computed`translate( - ${this.props.position.x}px, - ${this.props.position.y}px - )`, - }); - } - - static override styles = css` - :host { - background: #333; - display: block; - position: absolute; - top: 0; - left: 0; - border-radius: var(--border-radius); - overflow: hidden; - --header-height: 40px; - box-shadow: 1px 1px 5px #000C; - - outline: 1px dashed cyan; - } - - header { - height: var(--header-height); - line-height: var(--header-height); - padding: 0 var(--s); - background: #444; - } - - main { - width: 100%; - height: calc (100% - var(--header-height)); - overflow: auto; - padding: var(--s); - } - - .handle { - --thickness: 6px; - position: absolute; - width: 100%; - height: 100%; - top: 0; - left: 0; - outline: 1px dashed red; - } - - .e { - left: auto; - right: 0; - } - - .s { - top: auto; - bottom: 0; - } - - .n, .s { - height: var(--thickness); - cursor: ns-resize; - } - - .e, .w { - width: var(--thickness); - cursor: ew-resize; - } - - .n.e, .s.w { - cursor: nesw-resize; - width: 10px; - height: 10px; - outline: 1px dashed lime; - } - .n.w, .s.e { - cursor: nwse-resize; - width: 10px; - height: 10px; - outline: 1px dashed lime; - } - `; - - override template = html` -
- ${this.props.header} -
-
- ${this.props.content} -
-
-
-
-
-
-
-
-
- `; -} diff --git a/examples/deno-router/src/_examples/main.ts b/examples/deno-router/src/_examples/main.ts deleted file mode 100644 index db343bb..0000000 --- a/examples/deno-router/src/_examples/main.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { register } from "../mod.ts"; - -import { AppRoot } from "./components/app-root.ts"; - -register(AppRoot); diff --git a/examples/deno-router/src/componentLogic/Component.ts b/examples/deno-router/src/componentLogic/Component.ts deleted file mode 100644 index 7e158b4..0000000 --- a/examples/deno-router/src/componentLogic/Component.ts +++ /dev/null @@ -1,153 +0,0 @@ -import { xml } from "../parsing/_xml.ts"; -import { register } from "./register.ts"; -import { attachCSSProperties } from "../styling/attachCSSProperties.ts"; -import { deferredElements } from "../parsing/deferredElements.ts"; -import { supportsAdoptedStyleSheets } from "../styling/supportsAdoptedStyleSheets.ts"; -import { arrayWrap } from "../utils/arrayWrap.ts"; -import { getElementData } from "./elementData.ts"; -import { isReactive } from "../typeChecks/isReactive.ts"; -import type { Renderable } from "../parsing/Renderable.ts"; -import type { Slot } from "../parsing/Slot.ts"; -import type { ReadonlyReactiveValue } from "../reactive/ReactiveValue/_ReadonlyReactiveValue.ts"; -import type { ReadonlyReactiveArray } from "../reactive/ReactiveArray/_ReadonlyReactiveArray.ts"; -import type { CSSTemplate } from "../styling/CSSTemplate.ts"; -import type { TElementData } from "../parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/TElementData.ts"; - -interface ComponentImplementation { - destinySlot?: Slot, -} - -/** - * A class for creating new custom elements in Destiny UI. - */ -class ComponentImplementation extends HTMLElement { - static captureProps = false; - template: ( - | Renderable - // deno-lint-ignore no-explicit-any - | ReadonlyReactiveValue - // deno-lint-ignore no-explicit-any - | ReadonlyReactiveArray - ) = xml``; - static styles: Array | CSSTemplate = []; - - constructor () { - super(); - if (new.target === ComponentImplementation) { - throw new TypeError("Can't initialize abstract class."); - } - - const shadow = this.attachShadow({ mode: "open" }); - // Wait for subclasses to finish initialization: - queueMicrotask(() => { - // Upgrade values that have an associated setter but were assigned before the setters existed: - for (const [key, value] of this.elementData?.prop ?? []) { - // eslint-disable-next-line @typescript-eslint/ban-types - let proto = this.constructor.prototype as Function | undefined; - let descriptor: PropertyDescriptor | undefined; - - while (!descriptor && proto && proto !== HTMLElement) { - descriptor = Object.getOwnPropertyDescriptor( - proto, - key, - ); - // eslint-disable-next-line @typescript-eslint/ban-types - proto = Object.getPrototypeOf(proto) as Function; - } - if (!descriptor?.set) continue; - // eslint-disable-next-line @typescript-eslint/no-dynamic-delete - delete this[key as keyof this]; - this[key as keyof this] = value as this[keyof this]; - } - - shadow.appendChild( - isReactive(this.template) - ? xml`${this.template}`.content - : this.template.content, - ); - - if (supportsAdoptedStyleSheets) { - // @ts-ignore This does exist, but lib doesn't contain the declaration yet. We also used `destiny/src/globalThis.d.ts` to provide the typings when using Node, but there doesn't seem to be a way to include this in the `emit` - shadow.adoptedStyleSheets = arrayWrap(new.target.styles).map(v => v.styleSheet); - } else { - shadow.append(...arrayWrap(new.target.styles).map(v => v.styleElement)); - } - }); - - // Disabled for now due to lack of vendor support - // try { - // this.attachInternals(); - // } catch (e) { - // console.error("Element internals couldn't be attached due to lack of browser support. If you're using Firefox, the feature can be enabled in about:config by toggling the dom.webcomponents.elementInternals.enabled flag on. If you're using something other than Firefox or a Chromium based browser, consider switching to a better browser. Error message: ", e); - // } - } - - /** - * Synchonizes a CSS property of this element to a `ReactiveValue`. - * - * @param property CSS property to be synchronized - * @param source A ReactiveValue whose value is to be used for the CSS Property - */ - attachCSSProperties ( - styles: { - [Key: string]: ReadonlyReactiveValue, - }, - ): void { - attachCSSProperties(this, styles); - } - - override replaceWith ( - ...nodes: Array - ): void { - if (this.destinySlot) { - this.destinySlot.replaceItem(this, ...nodes); - } else { - super.replaceWith(...nodes); - } - } - - unmount ( - callback: (element: HTMLElement) => Promise | void, - ): this { - deferredElements.set( - this, - callback, - ); - - return this; - } - - get elementData (): TElementData | undefined{ - return getElementData(this); - } - - static register (): string { - return register( - this as typeof Component & (new () => Component), - false, - ); - } - - static get tagName (): string { - return this.register(); - } - - static [Symbol.toPrimitive] (): string { - return this.tagName; - } -} - -export type Component< - TProperties extends Record = Record -> = ( - & ComponentImplementation - & TProperties -); - -type TComponentConstructor = ( - // deno-lint-ignore ban-types - & (new = {}> () => Component) - & typeof ComponentImplementation -); - -export const Component = ComponentImplementation as TComponentConstructor; diff --git a/examples/deno-router/src/componentLogic/DestinyFallback.ts b/examples/deno-router/src/componentLogic/DestinyFallback.ts deleted file mode 100644 index 6a562d9..0000000 --- a/examples/deno-router/src/componentLogic/DestinyFallback.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { Component } from "./Component.ts"; -import { xml } from "../parsing/_xml.ts"; -import { getElementData } from "./elementData.ts"; -import { describeType } from "../utils/describeType.ts"; -import { ReactiveValue } from "../reactive/ReactiveValue/_ReactiveValue.ts"; -import { isRenderable } from "../typeChecks/isRenderable.ts"; -import { componentOrComponentModule } from "./componentOrComponentModule.ts"; -import type { Renderable } from "../parsing/Renderable.ts"; - -export class DestinyFallback extends Component { - static override captureProps = true; - - #view = new ReactiveValue(xml``); - - constructor () { - super(); - queueMicrotask(async () => { - const data = getElementData(this)!; - const props = data.prop; - const fallback = props.get("fallback"); - if (fallback) { - if (!isRenderable(fallback)) { - throw new TypeError(`Incorect type ${describeType(fallback)} for prop:fallback: Renderable expected`); - } - this.#view.value = fallback; - } - try { - const module = await props.get("for"); - const component = componentOrComponentModule(module); - - this.#view.value = xml` - <${component} - destiny:mount=${(element: HTMLElement) => element.append(...this.childNodes)} - destiny:data=${data} - /> - `; - } catch (error) { - const exceptionHandler = props.get("catch"); - if (exceptionHandler) { - if (typeof exceptionHandler !== "function") { - throw new TypeError(`Uncallable type ${describeType(exceptionHandler)} provided for prop:error as the exception handler. Expected type is (error: Error) => Renderable.`); - } - const template: unknown = exceptionHandler(error); - if (!isRenderable(template)) { - throw new TypeError(`Exception handler for prop:error retrned ${describeType(template)}, but Renderable was expected.`); - } - this.#view.value = template; - } else { - throw error; - } - } - }); - } - - override template = this.#view; -} diff --git a/examples/deno-router/src/componentLogic/Ref.ts b/examples/deno-router/src/componentLogic/Ref.ts deleted file mode 100644 index 3d8d87e..0000000 --- a/examples/deno-router/src/componentLogic/Ref.ts +++ /dev/null @@ -1,51 +0,0 @@ -export abstract class RefPromise { - // The rule is seemingly broken. Return type annotations are not allowed for setters. - abstract set value ( - element: T, - ); - - abstract then ( - callbackFn: (value: T) => R, - ): RefPromise; -} - -export class Ref { - #resolve!: (value: T) => void; - #promise = new Promise(resolve => { - this.#resolve = resolve; - }); - - constructor () { - console.warn("Refs are deprecated and will be removed in v0.8. Use a ReactiveValue instead."); - } - - set value ( - element: T, - ) { - this.#resolve(element); - } - - then ( - callbackFn: (value: T) => R, - ): RefPromise { - this.#promise = this.#promise.then(callbackFn) as unknown as Promise; - - return this as unknown as RefPromise; - } - - catch ( - callbackFn: (reason: unknown) => R, - ): RefPromise { - this.#promise = this.#promise.then(callbackFn) as unknown as Promise; - - return this as unknown as RefPromise; - } - - finally ( - callbackFn: () => void, - ): this { - this.#promise.finally(callbackFn); - - return this; - } -} diff --git a/examples/deno-router/src/componentLogic/componentOrComponentModule.ts b/examples/deno-router/src/componentLogic/componentOrComponentModule.ts deleted file mode 100644 index 5fab03e..0000000 --- a/examples/deno-router/src/componentLogic/componentOrComponentModule.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { isComponent } from "./isComponent.ts"; -import { describeType } from "../utils/describeType.ts"; -import type { Component } from "./Component.ts"; - -export function componentOrComponentModule ( - module: unknown, -): typeof Component & (new () => Component) { - if (isComponent(module)) { - return module; - } - if (typeof module !== "object" || !module) { - throw new TypeError(`Invalid type ${describeType(module)} supplied for prop:for`); - } - const component = (module as {default?: unknown}).default; - if (!isComponent(component)) { - throw new TypeError(`Invalid component constructor ${describeType(component)} supplied for asynchronously loaded element. Expected type is a Promise that resolves to a Component or to a module with a Component as the default export.`); - } - return component; -} diff --git a/examples/deno-router/src/componentLogic/elementData.ts b/examples/deno-router/src/componentLogic/elementData.ts deleted file mode 100644 index 8cc8160..0000000 --- a/examples/deno-router/src/componentLogic/elementData.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { TElementData } from "../parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/TElementData.ts"; - -export const elementDataStore = new WeakMap(); - -export function getElementData ( - element: Element, -): TElementData | undefined { - return elementDataStore.get(element); -} diff --git a/examples/deno-router/src/componentLogic/isComponent.ts b/examples/deno-router/src/componentLogic/isComponent.ts deleted file mode 100644 index 7326b4d..0000000 --- a/examples/deno-router/src/componentLogic/isComponent.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Component } from "./Component.ts"; - -export function isComponent ( - input: unknown, -): input is typeof Component & (new () => Component) { - return ( - Boolean(input) && - typeof input === "function" && - Object.prototype.isPrototypeOf.call(Component, input) - ); -} diff --git a/examples/deno-router/src/componentLogic/register.ts b/examples/deno-router/src/componentLogic/register.ts deleted file mode 100644 index 4d1d8bb..0000000 --- a/examples/deno-router/src/componentLogic/register.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { pseudoRandomIdGenerator } from "../utils/id.ts"; -import { pascalToKebab } from "../utils/pascalToKebab.ts"; -import type { Component } from "./Component.ts"; - -const pseudoRandomId = pseudoRandomIdGenerator(); - -const registeredComponents = new Map< - new () => Component, - string ->(); - -/** - * Registers a Component constructor as a Custom Element using its constructor name. - * @param componentConstructor A constructor for the element to be registered - * @param noHash Opt out of adding a unique hash to the name - */ -export function register ( - componentConstructor: typeof Component, - noHash = true, -): string { - const registeredName = registeredComponents.get(componentConstructor); - if (registeredName) { - return registeredName; - } - - const givenName = componentConstructor.name; - const name = `${( - givenName - ? pascalToKebab(givenName) - : "anonymous" - )}${ - noHash - ? "" - : `-${pseudoRandomId.next().value}` - }`; - - customElements.define(name, componentConstructor); - registeredComponents.set(componentConstructor, name); - - return name; -} diff --git a/examples/deno-router/src/examples_mod.ts b/examples/deno-router/src/examples_mod.ts deleted file mode 100644 index eafcca9..0000000 --- a/examples/deno-router/src/examples_mod.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Import some example files that aren't included in the dependency free, so we can compile them -import "./_examples/main.ts" -import "./_examples/components/visitor-demo.ts" -import "./_examples/components/to-do/_to-do.ts" -import "./_examples/components/array-demo.ts" -import "./_examples/components/time-diff.ts" -import "./_examples/components/async-demo.ts" -import "./_examples/components/window-manager/_window-manager.ts" \ No newline at end of file diff --git a/examples/deno-router/src/mod.ts b/examples/deno-router/src/mod.ts deleted file mode 100644 index 800f206..0000000 --- a/examples/deno-router/src/mod.ts +++ /dev/null @@ -1,22 +0,0 @@ -export { ReactiveValue } from "./reactive/ReactiveValue/_ReactiveValue.ts"; -export { ReadonlyReactiveValue } from "./reactive/ReactiveValue/_ReadonlyReactiveValue.ts"; -export { ReactiveArray } from "./reactive/ReactiveArray/_ReactiveArray.ts"; -export { ReadonlyReactiveArray } from "./reactive/ReactiveArray/_ReadonlyReactiveArray.ts"; -export { reactiveProperties } from "./reactive/reactiveProperties/_reactiveProperties.ts"; -export { reactive } from "./reactive/reactive.ts"; -export { computed } from "./reactive/computed.ts"; -export { xml, xml as html } from "./parsing/_xml.ts"; -export { Component } from "./componentLogic/Component.ts"; -export { getElementData } from "./componentLogic/elementData.ts"; -export { register } from "./componentLogic/register.ts"; -export { Ref } from "./componentLogic/Ref.ts"; -export { classNames } from "./reactive/classNames.ts"; -export { css } from "./styling/css.ts"; -export { CSSTemplate } from "./styling/CSSTemplate.ts"; -export { attachCSSProperties } from "./styling/attachCSSProperties.ts"; - -export type { TReactiveValueType } from "./reactive/types/TReactiveValueType.ts"; -export type { TReactiveProperties } from "./reactive/reactiveProperties/TReactiveProperties.ts"; -export type { TReactiveEntity } from "./reactive/types/TReactiveEntity.ts"; -export type { TReactive } from "./reactive/types/TReactive.ts"; -export type { TemplateResult } from "./parsing/TemplateResult.ts"; \ No newline at end of file diff --git a/examples/deno-router/src/parsing/Renderable.ts b/examples/deno-router/src/parsing/Renderable.ts deleted file mode 100644 index 69d9f56..0000000 --- a/examples/deno-router/src/parsing/Renderable.ts +++ /dev/null @@ -1,3 +0,0 @@ -export abstract class Renderable { - abstract get content (): Node; -} diff --git a/examples/deno-router/src/parsing/Slot.ts b/examples/deno-router/src/parsing/Slot.ts deleted file mode 100644 index 3d06ab2..0000000 --- a/examples/deno-router/src/parsing/Slot.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { deferredElements } from "./deferredElements.ts"; -import { TemplateResult } from "./TemplateResult.ts"; -import type { Component } from "../componentLogic/Component.ts"; - -/** A counter for labling `Comment`s for `Slot`s. */ -let counter = 0; - -/** - * Keeps track of sequences of DOM nodes that have been inserted into the document. For example, when a `DocumentFragment` is inserted, it may have multiple top-level elements which need to be prevented from merging with adjescent elements (in the case of `Text` nodes) and need to be removable when the state is updated. - */ -export class Slot { - #id = counter++; - #startAnchor = new Comment(``); - #endAnchor = new Comment(``); - #nodes: Array; - - /** - * @param placeholderNode A `Node` which is used as a "bookmark" of where in the DOM the `Slot`'s content should be inserted - * @param content Initial content to be inserted into the slot - */ - constructor ( - placeholderNode: ChildNode, - content?: TemplateResult | DocumentFragment, - ) { - this.#nodes = [placeholderNode]; - placeholderNode.replaceWith( - this.#startAnchor, - placeholderNode, - this.#endAnchor, - ); - if (content) { - this.update(content); - } - } - - replaceItem ( - whatToReplace: ChildNode, - ...nodes: Array - ): void { - const location = this.#nodes.indexOf(whatToReplace); - if (location < 0) throw new Error("Can't replace an item that isn't here."); - const newNodes = nodes.flatMap( - v => ( - typeof v === "string" ? new Text(v) : - v instanceof DocumentFragment ? [...v.childNodes] : - v - ), - ) as Array; - this.#brandNodes(newNodes); - whatToReplace.before(...newNodes); - void this.#disposeNodes([whatToReplace]); - - this.#nodes.splice( - location, - 1, - ...newNodes, - ); - } - - #brandNodes ( - nodes: Array, - ): void { - (nodes as Array) - .forEach(node => node.destinySlot = this); - } - - /** - * Updates the content of the slot with new content - * @param fragment New content for the slot - */ - update ( - input: TemplateResult | DocumentFragment, - ): void { - const fragment = input instanceof TemplateResult - ? input.content - : input; - void this.#disposeCurrentNodes(); - this.#nodes = Object.values(fragment.childNodes); - this.#brandNodes(this.#nodes); - this.#endAnchor.before(fragment); - } - - async #disposeNodes ( - nodesToDisposeOf: Array, - ): Promise { - await Promise.all( - (nodesToDisposeOf as Array).map( - node => deferredElements.get(node)?.(node), - ), - ); - for (const node of nodesToDisposeOf) { - node.remove(); - } - } - - /** - * First removes all the current nodes from this Slot's list of tracked nodes, then waits for any exit tasks (such as animations) these nodes might have, and removes each node once all the tasks have finished running. - */ - async #disposeCurrentNodes (): Promise { - await this.#disposeNodes( - this.#nodes.splice( - 0, - this.#nodes.length, - ), - ); - } - - /** - * Removes all the associated content from the DOM and destroys the `Slot`. Note: this is an async function and will wait for any exit animations or other tasks to finish before removing anything. Exit tasks for HTML elements are defined by the `destiny:unmount` attribute; if the callback function given to it returns a `Promise`, that's what's being awaited before removal. - */ - async remove (): Promise { - await this.#disposeCurrentNodes(); - this.#startAnchor.remove(); - this.#endAnchor.remove(); - } - - /** - * Inserts one or more `Node`s into the DOM before the start of the `Slot`. - * @param nodes - */ - insertBeforeThis ( - ...nodes: Array - ): void { - this.#startAnchor.before( - ...nodes, - ); - } -} diff --git a/examples/deno-router/src/parsing/SlotArray.ts b/examples/deno-router/src/parsing/SlotArray.ts deleted file mode 100644 index 82eb86e..0000000 --- a/examples/deno-router/src/parsing/SlotArray.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { Slot } from "./Slot.ts"; -import { throwExpression } from "../utils/throwExpression.ts"; -import type { TemplateResult } from "./TemplateResult.ts"; -import type { ReadonlyReactiveArray } from "../reactive/ReactiveArray/_ReadonlyReactiveArray.ts"; - -/** - * Keeps track of `ReadonlyReactiveArray`s slotted into a template in the DOM. - */ -export class SlotArray { - /** A "bookmark" for where in the DOM this `SlotArray` starts */ - #startAnchor = new Comment(""); - - /** A "bookmark" for where in the DOM this `SlotArray` ends */ - #endAnchor = new Comment(""); - - /** The original `ReadonlyReactiveArray` this instance is receiving updates from */ - #source: ReadonlyReactiveArray; - - /** All the `Slot`s being tracked by this instance */ - #domArray: Array = []; - - /** - * @param placeholderNode A `Node` which is used as a "bookmark" of where in the DOM the `SlotArray`'s content should be inserted - * @param source The `ReadonlyReactiveArray` which is being rendered - */ - constructor ( - placeholderNode: ChildNode, - source: ReadonlyReactiveArray, - ) { - placeholderNode.replaceWith( - this.#startAnchor, - this.#endAnchor, - ); - - this.#source = source; - this.#source.bind( - this.update, - { - dependents: [this], - }, - ); - } - - /** - * Inserts zero or more `DocumentFragment`s into the DOM, and creates `Slot`s out of them to track them. - * @param index Index at which to insert the items - * @param fragments the items to be inserted - */ - #insertToDom ( - index: number, - ...fragments: Array - ): void { - fragments.forEach((fragment, i) => { - const where = i + index; - const slotPlaceholder = new Comment("Destiny slot placeholder"); - if (!this.#domArray.length || where > this.#domArray.length - 1) { - this.#endAnchor.before(slotPlaceholder); - } else { - const target = this.#domArray[where]; - if (!target) throwExpression(`Tried to insert to DOM at an invalid position ${where} at an array of length ${this.#domArray.length}`, RangeError); - target.insertBeforeThis(slotPlaceholder); - } - this.#domArray.splice(where, 0, new Slot(slotPlaceholder, fragment)); - }); - } - - /** - * Removes zero or more `Slot`s from the DOM. - * @param from Index at which to start removing `Slot`s - * @param count How many `Slot`s to remove - */ - #removeFromDom ( - from: number, - count: number, - ): void { - const to = Math.min( - from + count, - this.#domArray.length, - ); - for (let i = from; i < to; i++) { - void this.#domArray[i]?.remove(); - } - this.#domArray.splice(from, count); - } - - /** - * Analogous to `ReactiveArray::splice()`. Removes zero or more `Slot`s from DOM, and inserts zero or more new ones. - * @param index Index at which to start modifying `Slots` - * @param deleteCount How many `Slot`s to remove - * @param items Any new items to be inserted into DOM - */ - update = ( - index: number, - deleteCount: number, - ...items: Array - ): void => { - this.#removeFromDom(index, deleteCount); - this.#insertToDom(index, ...items); - }; -} diff --git a/examples/deno-router/src/parsing/TParseResult.ts b/examples/deno-router/src/parsing/TParseResult.ts deleted file mode 100644 index 9120677..0000000 --- a/examples/deno-router/src/parsing/TParseResult.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type TParseResult = [ - template: HTMLTemplateElement, - tagNameSlots: Map, -]; diff --git a/examples/deno-router/src/parsing/TUnpreparedContentSlot.ts b/examples/deno-router/src/parsing/TUnpreparedContentSlot.ts deleted file mode 100644 index 09dab03..0000000 --- a/examples/deno-router/src/parsing/TUnpreparedContentSlot.ts +++ /dev/null @@ -1,8 +0,0 @@ -export type TUnpreparedContentSlot = { - node: Text, - slots: Array<{ - index: number, - start: number, - end: number, - }>, -}; diff --git a/examples/deno-router/src/parsing/TemplateCache.ts b/examples/deno-router/src/parsing/TemplateCache.ts deleted file mode 100644 index 79cb94d..0000000 --- a/examples/deno-router/src/parsing/TemplateCache.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { TParseResult } from "./TParseResult.ts"; - -/** Used to cache parsed `DocumentFragment`s so looped templates don't need to be reparsed on each iteration. */ -export class TemplateCache extends WeakMap< - TemplateStringsArray, - TParseResult -> { - computeIfAbsent ( - key: TemplateStringsArray, - set: () => TParseResult, - props: Array, - ): HTMLTemplateElement { - const template = this.get(key); - if (!template) { - const newTemplate = set(); - this.set(key, newTemplate); - return newTemplate[0]; - } else { - // Check if any of the tags differ from the cache, because they can't be slotted - for (const [k, v] of template[1]) { - if (props[k] !== v) return set()[0]; - } - return template[0]; - } - } -} diff --git a/examples/deno-router/src/parsing/TemplateResult.ts b/examples/deno-router/src/parsing/TemplateResult.ts deleted file mode 100644 index 877183f..0000000 --- a/examples/deno-router/src/parsing/TemplateResult.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { hookSlotsUp } from "./hookSlotsUp/_hookSlotsUp.ts"; -import { Renderable } from "./Renderable.ts"; - -export class TemplateResult extends Renderable { - #template: HTMLTemplateElement; - #props: Array; - - constructor ( - template: HTMLTemplateElement, - props: Array, - ) { - super(); - this.#template = template; - this.#props = props; - } - - get content (): DocumentFragment { - const content = this.#template.content.cloneNode(true) as DocumentFragment; - - hookSlotsUp( - content, - this.#props, - ); - - return content; - } -} diff --git a/examples/deno-router/src/parsing/_xml.ts b/examples/deno-router/src/parsing/_xml.ts deleted file mode 100644 index af38b2e..0000000 --- a/examples/deno-router/src/parsing/_xml.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { createTemplate } from "./createTemplate.ts"; -import { TemplateCache } from "./TemplateCache.ts"; -import { TemplateResult } from "./TemplateResult.ts"; - -const templateCache = new TemplateCache; - -/** - * Parses an XML template into a `TemplateResult` and hooks up reactivity logic to keep the view synchronized with the state of the reactive items prived in the slots. - * @param strings The string parts of the template - * @param props The slotted values in the template - */ -export function xml ( - strings: TemplateStringsArray, - ...props: Array -): TemplateResult { - const template = templateCache.computeIfAbsent( - strings, - () => createTemplate(strings, props), - props, - ); - - return new TemplateResult(template, props); -} diff --git a/examples/deno-router/src/parsing/createTemplate.ts b/examples/deno-router/src/parsing/createTemplate.ts deleted file mode 100644 index 4b18843..0000000 --- a/examples/deno-router/src/parsing/createTemplate.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { parseString } from "./parseString.ts"; -import { resolveSlots } from "./resolveSlots.ts"; -import { isComponent } from "../componentLogic/isComponent.ts"; -import { DestinyFallback } from "../componentLogic/DestinyFallback.ts"; -import type { TParseResult } from "./TParseResult.ts"; - -/** - * Parses and processes a `TemplateStringsArray` into a `DocumentFragment`. - * @param param0 The template strings to parse and process - */ -export function createTemplate ( - [first, ...strings]: TemplateStringsArray, - props: Array, -): TParseResult { - let string = first!; - const tagProps = new Map(); - for (const [i, fragment] of strings.entries()) { - const prop = props[i]; - - if (string.endsWith("<")) { - tagProps.set(i, prop); - if (isComponent(prop) && prop.captureProps) { - string += `${prop.register()} data-capture-props="true"${fragment}`; - } else if (prop instanceof Promise) { - string += `${DestinyFallback.register()} prop:for="__internal_${i}_" data-capture-props="true"${fragment}`; - } else { - string += String(prop) + fragment; - } - } else if (string.endsWith(" Promise | void ->(); diff --git a/examples/deno-router/src/parsing/getXmlErrorMessage.ts b/examples/deno-router/src/parsing/getXmlErrorMessage.ts deleted file mode 100644 index dbcc877..0000000 --- a/examples/deno-router/src/parsing/getXmlErrorMessage.ts +++ /dev/null @@ -1,10 +0,0 @@ -export function getXmlErrorMessage ( - doc: Document | Element | null, -): string { - return ( - doc - ?.firstElementChild - ?.textContent - ?? "unknown error" - ); -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/_hookSlotsUp.ts b/examples/deno-router/src/parsing/hookSlotsUp/_hookSlotsUp.ts deleted file mode 100644 index 98db5b2..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/_hookSlotsUp.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { hookContentSlotsUp } from "./hookContentSlotsUp/_hookContentSlotsUp.ts"; -import { hookAttributeSlotsUp } from "./hookAttributeSlotsUp/_hookAttributeSlotsUp.ts"; - - -export type TValueProps = { - element: HTMLElement & ChildNode, - attributeName: string, - valueStart: string, - valueSlot: unknown, - valueEnd: string, -}; - -/** - * Goes through the elements in a given `HTMLTemplateElement`, and adds reactivity to any slots that were given a reactive item to keep the view in sync with the application state. - * @param template A parsed `HTMLTemplateElement` which has been processed by `resolveSlots()` - * @param props Items that were originally slotted into the template prior to parsing - */ -export function hookSlotsUp ( - template: DocumentFragment, - props: Array, -): void { - hookAttributeSlotsUp(template, props); - hookContentSlotsUp(template, props); -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/_hookAttributeSlotsUp.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/_hookAttributeSlotsUp.ts deleted file mode 100644 index 2b69e78..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/_hookAttributeSlotsUp.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { resolveSlotPropIndex } from "./resolveSlotPropIndex.ts"; -import { parseAttributeName } from "./parseAttributeName.ts"; -import { assignElementData } from "./assignElementData/_assignElementData.ts"; -import { elementDataStore } from "../../../componentLogic/elementData.ts"; -import { ElementData } from "./elementData/ElementData.ts"; - -/** - * Goes through all the elements in a template that are flagged with the `destiny::attr` attribute and figures out what events need to be listened to, and how the DOM needs to be updated if any of the given props are reactive. - * @param templ A template element that has been processed by `resolveSlots()`. - * @param props Any items that were slotted into the HTML template - */ -export function hookAttributeSlotsUp ( - templ: DocumentFragment, - props: Array, -): void { - const attributeSlots = Object.values( - templ.querySelectorAll("[destiny\\:attr],[data-capture-props]"), - ) as unknown as Array; - - for (const element of attributeSlots) { - const { captureProps } = element.dataset; - const values = new ElementData; - for (const {name, value} of element.attributes) { - const propIndex = resolveSlotPropIndex(value); - - // skip if attribute wasn't slotted - if (propIndex === -1) { - if (captureProps && name !== "destiny:attr") { - const [namespace, attributeName] = parseAttributeName(name); - values[namespace].set(attributeName, value); - } - continue; - } - - const attrVal = props[propIndex]; - const [namespace, attributeName] = parseAttributeName(name); - values[namespace].set(attributeName, attrVal); - } - - elementDataStore.set(element, values); - if (!captureProps) { - assignElementData( - element, - values, - {elementDataAlreadySet: true}, - ); - } - } -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/_assignElementData.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/_assignElementData.ts deleted file mode 100644 index 7f28869..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/_assignElementData.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { attribute } from "./attribute.js"; -import { destiny } from "./destiny.js"; -import { prop } from "./prop.js"; -import { on } from "./on.js"; -import { elementDataStore } from "../../../../componentLogic/elementData.js"; -import { validNamespaces } from "../elementData/isValidNamespace.js"; -import { emplace } from "../../../../utils/mapEmplace.js"; -import { concat } from "../../../../utils/mapConcat.js"; -import type { TElementData } from "../elementData/TElementData.js"; - -/** - * Takes care of hooking up data to an element. - * - * @param element Element to assign it on - * @param data What to assign - */ -export function assignElementData ( - element: HTMLElement, - data: TElementData, - options: { - elementDataAlreadySet?: boolean, - } = {}, -): void { - if (!options.elementDataAlreadySet) { - emplace(elementDataStore, element, { - insert: () => data, - update: (oldData) => { - for (const namespace of validNamespaces) { - concat( - oldData[namespace], - data[namespace], - ); - } - return oldData; - } - }); - } - - attribute(data.attribute, element); - destiny(data.destiny, element); - prop(data.prop, element); - on(data.on, element); -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/attribute.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/attribute.ts deleted file mode 100644 index 5f40b2f..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/attribute.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { doOrBind } from "../doOrBind.ts"; -import type { TElementData } from "../elementData/TElementData.ts"; - -/** - * Handler for normal non-namespaced attributes. Behaves like normal HTML. - * - * Example usage: - * ```html - *
I'm red!
- * - * ``` - */ -export function attribute ( - attributes: TElementData["attribute"], - element: HTMLElement, -): void { - for (const [key, value] of attributes) { - doOrBind( - element, - key, - value, - value => element.setAttribute(key, String(value)), - ); - } -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destiny.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destiny.ts deleted file mode 100644 index 653c635..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destiny.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { destinyRef } from "./destinyRef.js"; -import { destinyUnmount } from "./destinyUnmount.js"; -import { destinyMount } from "./destinyMount.js"; -import { destinyProps } from "./destinyProps.js"; -import { destinyData } from "./destinyData.js"; -import { throwExpression } from "../../../../utils/throwExpression.js"; -import type { TElementData } from "../elementData/TElementData.js"; - -const opMap: { - readonly [key: string]: (element: HTMLElement, value: unknown) => void, -} = { - ref: destinyRef, - mount: destinyMount, - unmount: destinyUnmount, - props: destinyProps, - data: destinyData, -} as const; - -/** - * Handler for destiny-namespaced attributes. See referenced methods for details. - */ -export function destiny ( - data: TElementData["destiny"], - element: HTMLElement, -): void { - for (const [key, value] of data) { - const op = opMap[key] ?? throwExpression(`Invalid property "destiny:${key}" on element:\n${element.outerHTML}.`); - - op(element, value); - } -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyData.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyData.ts deleted file mode 100644 index bfae2db..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyData.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { describeType } from "../../../../utils/describeType.js"; -import { assignElementData } from "./_assignElementData.js"; -import { ElementData } from "../elementData/ElementData.js"; - -export function destinyData ( - element: HTMLElement, - input: unknown, -): void { - if (typeof input === "undefined") return; - - if (typeof input !== "object" || !input) { - throw new TypeError(`Invalid value ${describeType(input)} provided for destiny:data`); - } - - assignElementData( - element, - new ElementData(input), - ); -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyMount.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyMount.ts deleted file mode 100644 index a7e1512..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyMount.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * `destiny:mount` takes a callback function, which will be called - * once the element has been created. - * - * Example usage: - * ```html - *
element.animate( - * [{opacity: 0}, {height: 1}], - * {duration: 300, fill: "forwards"}, - * ).play() - * }> This will fade in!
- * ``` - */ -export function destinyMount ( - element: HTMLElement, - value: unknown, -): void { - if (!(value instanceof Function)) { - throw new TypeError("Value of destiny:mount must be a function"); - } - queueMicrotask( // wait for stack to clear - () => queueMicrotask( // let other microtasks run first - () => void value(element), - ), - ); -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyProps.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyProps.ts deleted file mode 100644 index 2fd5f92..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyProps.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { prop } from "./prop.js"; -import { describeType } from "../../../../utils/describeType.js"; -import { ElementData } from "../elementData/ElementData.js"; -import { elementDataStore } from "../../../../componentLogic/elementData.js"; -import { emplace } from "../../../../utils/mapEmplace.js"; -import { concat } from "../../../../utils/mapConcat.js"; - -export function destinyProps ( - element: HTMLElement, - input: unknown, -): void { - if (typeof input !== "object" || !input) { - throw new TypeError(`Incorrect attribute value type ${describeType(input)} provided for destiny:props`); - } - const map = ( - input instanceof Map - ? input - : new Map(Object.entries(input)) - ); - - emplace(elementDataStore, element, { - insert: () => new ElementData({prop: map}), - update: (oldData) => (concat(oldData.prop, map), oldData), - }); - - prop(map, element); -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyRef.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyRef.ts deleted file mode 100644 index 94d61a8..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyRef.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Ref } from "../../../../componentLogic/Ref.ts"; -import { ReactiveValue } from "../../../../reactive/ReactiveValue/_ReactiveValue.ts"; -import { isObject } from "../../../../typeChecks/isObject.ts"; - -/** - * `destiny:ref` prop allows you to to give a `ReactiveValue` to - * the templater, which will then store the created element into - * it once render is complete. - * - * Example usage: - * ```js - * const ref = new ReactiveValue; - * - * ref.pipe(element => { - * console.log(element.innerHTML); // "Hello!"; - * }); - * - * html` - *
Hello!
- * `; - * ``` - */ -export function destinyRef ( - element: HTMLElement, - value: unknown, -): void { - if (!((value instanceof ReactiveValue) || (value instanceof Ref))) { - throw new TypeError(`Attribute value for destiny:ref must be a ReactiveValue, but it was [${ - isObject(value) - ? `${value.constructor.name} (Object)` - : `${String(value)} (${typeof value})` - }] in \n${element.outerHTML}`); - } - queueMicrotask(() => { - value.value = element; - }); -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyUnmount.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyUnmount.ts deleted file mode 100644 index 8a39dd4..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/destinyUnmount.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { deferredElements } from "../../../deferredElements.ts"; - -/** - * `destiny:unmount` takes a callback function which will be called - * when the element is about to be removed from DOM. If the - * callback returns a promise, that promise will be awaited on - * and the element is removed once it resolves. - * - * Example usage: - * ```html - *
{ - * const anim = element.animate( - * [{opacity: 0}, {height: 1}], - * {duration: 300, fill: "forwards"}, - * ); - * anim.play(); - * return anim.finished; // Element is removed once the animation finishes - * } - * }> This will fade out!
- * ``` - */ -export function destinyUnmount ( - element: HTMLElement, - value: unknown, -): void { - deferredElements.set( - element, - value as () => Promise, - ); -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/on.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/on.ts deleted file mode 100644 index 9327e2b..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/on.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { TElementData } from "../elementData/TElementData.ts"; - -/** - * `on:` adds an event listener. It either takes a - * callback function, or an array containing a callback - * function and options. - * - * Example usage: - * ```html - * - * - * - * ``` - */ -export function on ( - eventListeners: TElementData["on"], - element: HTMLElement, -): void { - for (const [key, value] of eventListeners) { - if (Array.isArray(value)) { - //@ts-ignore TODO gotta figure out later if this can be resolved properly by TS - element.addEventListener(key, ...value); - } else { - //@ts-ignore TODO gotta figure out later if this can be resolved properly by TS - element.addEventListener(key, value); - } - } -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/prop.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/prop.ts deleted file mode 100644 index b6543f5..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/assignElementData/prop.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { doOrBind } from "../doOrBind.ts"; -import type { TElementData } from "../elementData/TElementData.ts"; - -/** - * `prop:` takes in any property and assigns it to the element in JS. - * - * For example, to assign a Date object to a date input (`input.valueAsDate = new Date`), you can do: - * ```html - * - * ``` - */ -export function prop ( - props: TElementData["prop"], - element: HTMLElement, -): void { - for (const [key, value] of props) { - doOrBind( - element, - key, - value, - //@ts-ignore TODO gotta figure out later if this can be resolved properly by TS - (item: unknown) => element[key] = item, - ); - } -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/doOrBind.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/doOrBind.ts deleted file mode 100644 index b4aaccc..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/doOrBind.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { matchChangeWatcher } from "./matchChangeWatcher.ts"; -import { ReactiveValue } from "../../../reactive/ReactiveValue/_ReactiveValue.ts"; -import { ReadonlyReactiveValue } from "../../../reactive/ReactiveValue/_ReadonlyReactiveValue.ts"; -import { PassReactiveValue } from "../../../reactive/ReactiveValue/PassReactiveValue.ts"; -import type { TWatchedAttribute } from "./matchChangeWatcher.ts"; - -export function doOrBind ( - element: HTMLElement, - key: string, - value: unknown, - whatToDo: (value: unknown) => void, -): void { - if (value instanceof ReactiveValue) { - const changeWatcher = matchChangeWatcher(key); - if (changeWatcher) { - element.addEventListener(changeWatcher, e => { - // Sets the value whilst excluding itself of callbacks to call after the change - value.set( - (e.currentTarget as HTMLInputElement | null) - ?.[key as TWatchedAttribute], - { noUpdate: [whatToDo] }, - ); - }); - } - value.bind(whatToDo, {dependents: [element]}); - } else if (value instanceof ReadonlyReactiveValue) { - value.bind(whatToDo, {dependents: [element]}); - } else if (value instanceof PassReactiveValue) { - whatToDo(value.deref); - } else { - whatToDo(value); - } -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/ElementData.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/ElementData.ts deleted file mode 100644 index 854a5ca..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/ElementData.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { TElementData } from "./TElementData.js"; - -export class ElementData { - prop = new Map(); - on = new Map(); - destiny = new Map(); - attribute = new Map(); - - constructor ( - data?: Partial, - ) { - if (data) Object.assign(this, data); - } -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/TElementData.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/TElementData.ts deleted file mode 100644 index 71f3f2f..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/TElementData.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { TNamespace } from "./TNamespace.ts"; - -export type TElementData = { - readonly [Key in TNamespace]: Map -}; diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/TNamespace.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/TNamespace.ts deleted file mode 100644 index 08a191a..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/TNamespace.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { validNamespaces } from "./isValidNamespace.ts"; - -export type TNamespace = typeof validNamespaces[number]; diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/isValidNamespace.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/isValidNamespace.ts deleted file mode 100644 index 267dde2..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/elementData/isValidNamespace.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { TNamespace } from "./TNamespace.ts"; - -export const validNamespaces = ["attribute", "prop", "on", "destiny"] as const; - -export function isValidNamespace ( - input: string, -): input is TNamespace { - return validNamespaces.includes(input as TNamespace); -} - -export function isValidAttributePair ( - input: ReadonlyArray, -): input is [TNamespace, string] { - return input.length === 2 && isValidNamespace(input[0]!); -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/matchChangeWatcher.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/matchChangeWatcher.ts deleted file mode 100644 index c8dd735..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/matchChangeWatcher.ts +++ /dev/null @@ -1,18 +0,0 @@ -const propToWatcherMap = { - value: "input", - checked: "change", - valueAsDate: "input", - valueAsNumber: "input", -} as const; - -export type TWatchedAttribute = keyof typeof propToWatcherMap; - -/** - * Figures out if and what event listener needs to be attached to a DOM element based on the name of an attribute. - * @param attributeName the attribute name to be used for determining the event listener type - */ -export function matchChangeWatcher ( - attributeName: string, -): typeof propToWatcherMap[TWatchedAttribute] | "" { - return propToWatcherMap[attributeName as TWatchedAttribute] ?? ""; -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/parseAttributeName.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/parseAttributeName.ts deleted file mode 100644 index f9e8d90..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/parseAttributeName.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { isValidAttributePair } from "./elementData/isValidNamespace.ts"; -import type { TNamespace } from "./elementData/TNamespace.ts"; - -export function parseAttributeName ( - input: string, -): [TNamespace, string] { - const split = input.split(":"); - if (split.length === 1) { - split.unshift("attribute"); - } - - if (!isValidAttributePair(split)) { - throw new Error("Invalid namespace"); - } - - return split; -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/resolveSlotPropIndex.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/resolveSlotPropIndex.ts deleted file mode 100644 index e12b16e..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookAttributeSlotsUp/resolveSlotPropIndex.ts +++ /dev/null @@ -1,9 +0,0 @@ -export function resolveSlotPropIndex ( - value: string, -): number { - return ( - value.startsWith("__internal_") - ? Number(value.slice(11, -1)) - : -1 - ); -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookContentSlotsUp/_hookContentSlotsUp.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookContentSlotsUp/_hookContentSlotsUp.ts deleted file mode 100644 index b140097..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookContentSlotsUp/_hookContentSlotsUp.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { valueToFragment } from "./toFragment/valueToFragment.ts"; -import { Slot } from "../../Slot.ts"; -import { SlotArray } from "../../SlotArray.ts"; -import { ReadonlyReactiveValue } from "../../../reactive/ReactiveValue/_ReadonlyReactiveValue.ts"; -import { ReadonlyReactiveArray } from "../../../reactive/ReactiveArray/_ReadonlyReactiveArray.ts"; - -/** - * Goes through all the elements in a template that are flagged with the `destiny:content` attribute and figures out how the DOM needs to be updated if any of the given props are reactive. - * @param templ A template element that has been processed by `resolveSlots()`. - * @param props Any items that were slotted into the HTML template - */ -export function hookContentSlotsUp ( - templ: DocumentFragment, - props: Array, -): void { - const contentSlots = Object.values( - templ.querySelectorAll("[destiny\\:content]") - ) as unknown as Array; - - for (const contentSlot of contentSlots) { - const index = contentSlot.getAttribute("destiny:content"); - const item = props[Number(index)]; - if (item instanceof ReadonlyReactiveValue) { - const slot = new Slot(contentSlot); - item.bind(value => { - slot.update(valueToFragment(value)); - }, { - dependents: [slot], - }); - } else if (item instanceof ReadonlyReactiveArray) { - new SlotArray(contentSlot, item); - } else { - new Slot(contentSlot, valueToFragment(item)); - } - } -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/arrayToFragment.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/arrayToFragment.ts deleted file mode 100644 index afc0e9f..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/arrayToFragment.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { shouldBeRendered } from "../../stringifyValue.ts"; -import { valueToFragment } from "./valueToFragment.ts"; - -/** - * Converts an array of items into a `DocumentFragment`. - * @param values The items to be converted - */ -export function arrayToFragment ( - values: Array, -): DocumentFragment { - const fragment = new DocumentFragment; - - fragment.append( - ...values - .filter(shouldBeRendered) - .map(valueToFragment), - ); - - return fragment; -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/nodeToFragment.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/nodeToFragment.ts deleted file mode 100644 index ede6eb3..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/nodeToFragment.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Converts a `Node` into a `DocumentFragment`. - * @param node The `Node` to be converted - */ -export function nodeToFragment ( - node: Node, -): DocumentFragment { - const fragment = new DocumentFragment; - fragment.append(node); - return fragment; -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/valueToFragment.ts b/examples/deno-router/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/valueToFragment.ts deleted file mode 100644 index f541aa4..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/hookContentSlotsUp/toFragment/valueToFragment.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { arrayToFragment } from "./arrayToFragment.ts"; -import { nodeToFragment } from "./nodeToFragment.ts"; -import { stringifyValue } from "../../stringifyValue.ts"; -import { TemplateResult } from "../../../TemplateResult.ts"; - -/** - * A polymorphic helper which figures out the type of the input and determines a suitable way to convert it into a `DocumentFragment`. - * @param value The item to be converted into a `DocumentFragment` - */ -export function valueToFragment ( - value: unknown, -): DocumentFragment { - if (value instanceof TemplateResult) { - return value.content; - } else if (value instanceof DocumentFragment) { - return value; - } else if (value instanceof Node) { - return nodeToFragment(value); - } else if (Array.isArray(value)) { - return arrayToFragment(value); - } else { - return nodeToFragment( - new Text( - stringifyValue(value), - ), - ); - } -} diff --git a/examples/deno-router/src/parsing/hookSlotsUp/stringifyValue.ts b/examples/deno-router/src/parsing/hookSlotsUp/stringifyValue.ts deleted file mode 100644 index d83a167..0000000 --- a/examples/deno-router/src/parsing/hookSlotsUp/stringifyValue.ts +++ /dev/null @@ -1,22 +0,0 @@ -const nonRenderedValues = new Set([ - undefined, - null, - true, - false, -]); - -export const shouldBeRendered = ( - input: unknown, -): boolean => !nonRenderedValues.has(input); - -/** - * Converts a value that is about to be rendered in DOM into a string representation. `boolean`s and _nullish_ values are not rendered by design. - * @param input - */ -export const stringifyValue = ( - input: unknown, -): string => ( - shouldBeRendered(input) - ? String(input) - : "" -); diff --git a/examples/deno-router/src/parsing/parseAsNewDocument.ts b/examples/deno-router/src/parsing/parseAsNewDocument.ts deleted file mode 100644 index 26d092e..0000000 --- a/examples/deno-router/src/parsing/parseAsNewDocument.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { namespaces } from "./parseString.ts"; - -export function parseAsNewDocument ( - string: string, -): Document { - return new DOMParser().parseFromString( - `${string}`, - "application/xml", - ); -} diff --git a/examples/deno-router/src/parsing/parseInSafari.ts b/examples/deno-router/src/parsing/parseInSafari.ts deleted file mode 100644 index ad3c161..0000000 --- a/examples/deno-router/src/parsing/parseInSafari.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { getXmlErrorMessage } from "./getXmlErrorMessage.ts"; -import { parseAsNewDocument } from "./parseAsNewDocument.ts"; - -export function parseInSafari ( - templateElement: HTMLTemplateElement, - string: string, -): void { - const parsed = parseAsNewDocument(string).firstElementChild; - - if (parsed?.firstElementChild?.nodeName.toLowerCase() === "parsererror") { - throw new SyntaxError(`An error occurred when parsing the following XML:\n${ - string - }\nwhich resulted in the following message:\n${ - getXmlErrorMessage(parsed) - }`); - } - - templateElement.content.append(...parsed?.childNodes ?? []); -} diff --git a/examples/deno-router/src/parsing/parseString.ts b/examples/deno-router/src/parsing/parseString.ts deleted file mode 100644 index 27c1ba7..0000000 --- a/examples/deno-router/src/parsing/parseString.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { getXmlErrorMessage } from "./getXmlErrorMessage.ts"; -import { parseAsNewDocument } from "./parseAsNewDocument.ts"; -import { parseInSafari } from "./parseInSafari.ts"; - -export const namespaces = `xmlns="http://www.w3.org/1999/xhtml" xmlns:on="p:u" xmlns:prop="p:u" xmlns:destiny="p:u"`; - -const xmlDocument = new DOMParser().parseFromString( - ``, - "application/xhtml+xml", -); -const xmlRange = xmlDocument.createRange(); -const xmlRoot = xmlDocument.querySelector("xml")!; -xmlRange.setStart(xmlRoot, 0); -xmlRange.setEnd(xmlRoot, 0); - -let notSafari = true; - -export function parseString ( - string: string, -): HTMLTemplateElement { - const templateElement = document.createElement("template"); - if (notSafari) { - try { - templateElement.content.append( - xmlRange.createContextualFragment(string), - ); - } catch (error) { - const { message } = error as Error; - if (message === "The string did not match the expected pattern.") { // Safari - notSafari = false; - parseInSafari(templateElement, string); - } else { // Not Safari - throw new SyntaxError(`${message}\nat\n${string}\nwhich resulted in the following message:\n${ - getXmlErrorMessage( - parseAsNewDocument( - string.replace(/^\n/, ""), - ), - ) - }`); - } - } - } else { // Safari - parseInSafari(templateElement, string); - } - - return templateElement; -} diff --git a/examples/deno-router/src/parsing/prepareContentSlots.ts b/examples/deno-router/src/parsing/prepareContentSlots.ts deleted file mode 100644 index 7c1ac5b..0000000 --- a/examples/deno-router/src/parsing/prepareContentSlots.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { TUnpreparedContentSlot } from "./TUnpreparedContentSlot.ts"; - -function createPlaceholder ( - index: number, -) { - const placeholder = document.createElement("template"); - placeholder.setAttribute("destiny:content", String(index)); - return placeholder; -} - -/** - * Replaces string markers marking content slots with placeholder elements that are marked with the `destiny:content` attribute so they can be easily replaced when hooking up content values. - * @param contentSlots Descriptions of where the string markers are located - */ -export function prepareContentSlots ( - contentSlots: Array, -): void { - type TSlot = TUnpreparedContentSlot["slots"][number] | undefined; - contentSlots.forEach(contentSlot => { - const raw = contentSlot.node.textContent ?? ""; - const nodes = contentSlot.slots.flatMap((slot, i, a) => [ - new Text(raw.slice((a[i - 1] as TSlot)?.end ?? 0, slot.start)), - createPlaceholder(slot.index), - ]); - contentSlot.node.replaceWith( - ...nodes, - new Text(raw.slice(contentSlot.slots.pop()?.end)), - ); - }); -} diff --git a/examples/deno-router/src/parsing/resolveSlots.ts b/examples/deno-router/src/parsing/resolveSlots.ts deleted file mode 100644 index 0bdcf4d..0000000 --- a/examples/deno-router/src/parsing/resolveSlots.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { isTextNode } from "../typeChecks/isTextNode.ts"; -import { isElement } from "../typeChecks/isElement.ts"; -import { prepareContentSlots } from "./prepareContentSlots.ts"; -import type { TUnpreparedContentSlot } from "./TUnpreparedContentSlot.ts"; - -/** - * Figures out from a freshly parsed `HTMLTemplate` where slots are located so they can be quickly hooked up with values. - * @param template the template element to be processed - */ -export function resolveSlots ( - template: HTMLTemplateElement, -): void { - const walker = document.createTreeWalker( - template.content, - NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, - ); - const contentSlots: Array = []; - while (walker.nextNode()) { - const node = walker.currentNode; - if (isTextNode(node)) { - const matches = node.wholeText.matchAll( - /"__internal_([0-9]+)_"/gu, - ) as IterableIterator; - const fragment = { - node, - slots: [...matches].map((match) => ({ - index: Number(match[1]), - start: match.index, - end: match.index + match[0]!.length, - })), - }; - if (fragment.slots.length) { - contentSlots.push(fragment); - } - } else if (isElement(node)) { - for (const {value} of node.attributes) { - if (value.includes("__internal_")) { - node.setAttribute("destiny:attr", ""); - } - } - } - } - - prepareContentSlots(contentSlots); -} diff --git a/examples/deno-router/src/reactive/ReactiveArray/TArrayUpdateArguments.ts b/examples/deno-router/src/reactive/ReactiveArray/TArrayUpdateArguments.ts deleted file mode 100644 index b7118ca..0000000 --- a/examples/deno-router/src/reactive/ReactiveArray/TArrayUpdateArguments.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type TArrayUpdateArguments = [ - startEditingAt: number, - deleteCount: number, - ...newElements: Array, -]; diff --git a/examples/deno-router/src/reactive/ReactiveArray/TArrayValueType.ts b/examples/deno-router/src/reactive/ReactiveArray/TArrayValueType.ts deleted file mode 100644 index 99b4d07..0000000 --- a/examples/deno-router/src/reactive/ReactiveArray/TArrayValueType.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { TSpecialCaseObject } from "../reactiveProperties/specialCaseObjects.ts"; -import type { TReactiveValueType } from "../types/TReactiveValueType.ts"; -import type { TPrimitive } from "../types/TPrimitive.ts"; - -export type TArrayValueType = ( - T extends TPrimitive | TSpecialCaseObject - ? T - : TReactiveValueType -); diff --git a/examples/deno-router/src/reactive/ReactiveArray/TMask.ts b/examples/deno-router/src/reactive/ReactiveArray/TMask.ts deleted file mode 100644 index db93396..0000000 --- a/examples/deno-router/src/reactive/ReactiveArray/TMask.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { TMaskEntry } from "./TMaskEntry.ts"; - -export type TMask = Array; diff --git a/examples/deno-router/src/reactive/ReactiveArray/TMaskEntry.ts b/examples/deno-router/src/reactive/ReactiveArray/TMaskEntry.ts deleted file mode 100644 index 43ab8d8..0000000 --- a/examples/deno-router/src/reactive/ReactiveArray/TMaskEntry.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type TMaskEntry = { - index: number, - show: boolean, -}; diff --git a/examples/deno-router/src/reactive/ReactiveArray/TReactiveArrayCallback.ts b/examples/deno-router/src/reactive/ReactiveArray/TReactiveArrayCallback.ts deleted file mode 100644 index fe3b61d..0000000 --- a/examples/deno-router/src/reactive/ReactiveArray/TReactiveArrayCallback.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type TReactiveArrayCallback = ( - index: number, - deleteCount: number, - ...values: Array -) => R; diff --git a/examples/deno-router/src/reactive/ReactiveArray/TUnwrapReactiveArray.ts b/examples/deno-router/src/reactive/ReactiveArray/TUnwrapReactiveArray.ts deleted file mode 100644 index 55b8a0d..0000000 --- a/examples/deno-router/src/reactive/ReactiveArray/TUnwrapReactiveArray.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ReadonlyReactiveArray } from "./_ReadonlyReactiveArray.ts"; - -export type TUnwrapReactiveArray = ( - Input extends ReadonlyReactiveArray - ? V - : Input -); diff --git a/examples/deno-router/src/reactive/ReactiveArray/_ReactiveArray.ts b/examples/deno-router/src/reactive/ReactiveArray/_ReactiveArray.ts deleted file mode 100644 index 57fd2f3..0000000 --- a/examples/deno-router/src/reactive/ReactiveArray/_ReactiveArray.ts +++ /dev/null @@ -1,216 +0,0 @@ -import { ReadonlyReactiveArray } from "./_ReadonlyReactiveArray.ts"; -import { splicers } from "./splicers.ts"; -import { internalArrays } from "./internalArrays.ts"; -import type { TArrayValueType } from "./TArrayValueType.ts"; -import type { ReadonlyReactiveValue } from "../ReactiveValue/_ReadonlyReactiveValue.ts"; - -/** - * `ReactiveArray`s are reactive values that contain multiple values which can be updated and whose updates can be listened to. In general, `ReactiveArray`s behave very similar to native `Array`s. The main difference is, that most primitive values are given as `ReactiveValue`s and any immutable methods will return a new `ReadonlyReactiveArray`, whose values are tied to the original `ReactiveArray`. The class also provides a few custom convenience methods. - */ -export class ReactiveArray extends ReadonlyReactiveArray { - #value: ReadonlyArray>; - - /** Cache for readonly getter */ - #readonly: ReadonlyReactiveArray | undefined = undefined; - - /** Readonly version of the instance that can't be mutated from the outside, but will be updated as the original instance updates. */ - get readonly (): ReadonlyReactiveArray { - return this.#readonly ?? (this.#readonly = (() => { - const newArray = new ReadonlyReactiveArray(); - this.bind( - (...args) => splicers.get(newArray)(...args), - { - dependents: [newArray], - }, - ); - - return newArray; - })()); - } - - constructor (...input: ReadonlyArray) { - super(...input); - - this.#value = internalArrays.get(this); - } - - - splice ( - start: number, - deleteCount?: number, - ...items: Array> - ): Array> { - return splicers.get(this)(start, deleteCount, ...items); - } - - /** - * Works just like `Array::copyWithin()`. Returns the this object after shallow-copying a section of the array identified by start and end to the same array starting at position target - * - * @param target Index where to start copying to. If target is negative, it is treated as length+target where length is the length of the array. - * @param start Where to start copying from. If start is negative, it is treated as length+start. Default: `0`. - * @param end Where to stop copying from. If end is negative, it is treated as length+end. Default: `this.length.value` - */ - copyWithin ( - target: number, - start = 0, - end = this.#value.length, - ): this { - const {length} = this.#value; - target = (target + length) % length; - start = (start + length) % length; - end = (end + length) % length; - const deleteCount = Math.min( - length - start, - end - start, - ); - this.splice( - target, - deleteCount, - ...this.#value.slice( - start, - deleteCount + start, - ), - ); - return this; - } - - /** - * Works similar to `Array::fill()`, except inserted values are made recursively reactive. The section identified by start and end is filled with `value`. **Note** that inserted object values are not cloned, which may cause unintended behavior. - * - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as length+end. - */ - fill ( - value: InputType | TArrayValueType, - start = 0, - end = this.#value.length, - ): this { - const length = end - start; - this.splice( - start, - length, - ...Array.from({length}, () => value), - ); - return this; - } - - /** - * Equivalent to Array::filter(), except that it mutates the array in place. Removes the elements of the array that don't meet the condition specified in the callback function. - * - * @param callback The filter method calls the callback function once for each element in the array to determine if it should be removed. - */ - mutFilter ( - callback: (value: TArrayValueType, index: number, array: Array>) => boolean, - ): this { - this.#value - .flatMap((v, i, a) => callback(v, i, a) ? [] : i) - .reduce>( - (acc, indexToDelete) => { - const [first] = acc; - if (!first || first[0] + first[1] !== indexToDelete) { - acc.unshift([indexToDelete, 1]); - } else { - first[1]++; - } - return acc; - }, - [], - ) - .forEach(args => { - this.splice(...args); - }); - return this; - } - - /** - * Similar to `Array::map`, except that it mutates the array in place. Calls a defined callback function on each element of an array, and assigns the resulting element if it's different from the old one. - * - * @param callback The map method calls the callback function one time for each element in the array. - */ - mutMap ( - callback: (value: TArrayValueType, index: number, array: Array>) => TArrayValueType, - ): this { - this.#value - .flatMap((v, i, a) => { - const newValue = callback(v, i, a); - return newValue === v - ? [] - : {index: i, value: newValue} - ; - }) - .reduce>]>>( - (acc, {index, value}) => { - if (!acc.length || acc[0]![0] + acc[0]![1] !== index) { - acc.unshift([index, 1, value]); - } else { - acc[0]![1]++; - acc[0]!.push(value); - } - return acc; - }, - [], - ) - .forEach(args => { - this.splice(...args); - }); - return this; - } - - /** - * Works just like `Array::pop()`. Removes the last element from an array and returns it. - */ - pop (): TArrayValueType | undefined { - return this.splice(-1, 1)[0]; - } - - /** - * Similar to `Array::push()`. Appends new element(s) to an array, and returns the new length of the array as a reactive number. - */ - push ( - ...items: Array - ): ReadonlyReactiveValue { - this.splice(this.#value.length, 0, ...items); - - return this.length; - } - - /** - * Works just like `Array::reverse()`. Reverses the elements of the array in place. - */ - reverse (): this { - this.value = this.value.reverse(); - - return this; - } - - /** - * Works just like `Array.shift()`. Removes the first element from an array and returns it. - */ - shift (): TArrayValueType | undefined { - return this.splice(0, 1)[0]; - } - - /** - * Works just like `Array::sort()`. Sorts the array. - * - * @param compareFn Specifies a function that defines the sort order. It is expected to return a negative value if first argument is less than second argument, zero if they're equal and a positive value otherwise. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. - */ - sort ( - compareFn?: ((a: TArrayValueType, b: TArrayValueType) => number), - ): this { - this.value = this.value.sort(compareFn); - - return this; - } - - /** - * Similar to `Array::unshift()`. Returns the new length after the item(s) have been inserted. - */ - unshift ( - ...items: Array - ): ReadonlyReactiveValue { - this.splice(0, 0, ...items); - return this.length; - } -} diff --git a/examples/deno-router/src/reactive/ReactiveArray/_ReadonlyReactiveArray.ts b/examples/deno-router/src/reactive/ReactiveArray/_ReadonlyReactiveArray.ts deleted file mode 100644 index ca3bc9f..0000000 --- a/examples/deno-router/src/reactive/ReactiveArray/_ReadonlyReactiveArray.ts +++ /dev/null @@ -1,827 +0,0 @@ -import { ReactiveArray } from "./_ReactiveArray.ts"; -import { weaklyHeldDependencies, stronglyHeldDependencies } from "./arrayDependencyCaches.ts"; -import { makeNonPrimitiveItemsReactive } from "./makeNonPrimitiveItemsReactive.ts"; -import { internalArrays } from "./internalArrays.ts"; -import { splicers } from "./splicers.ts"; -import { flatten } from "./flatten.ts"; -import { updateFilteredArray } from "./updateFilteredArray.ts"; -import { computed, computedConsumer } from "../computed.ts"; -import { ReactiveValue } from "../ReactiveValue/_ReactiveValue.ts"; -import { internalSetReactiveValue } from "../ReactiveValue/internalSetReactiveValue.ts"; -import { ReadonlyReactiveValue } from "../ReactiveValue/_ReadonlyReactiveValue.ts"; -import { concatIterators } from "../../utils/concatIterators.ts"; -import { throwExpression } from "../../utils/throwExpression.ts"; -import { IterableWeakMap } from "../../utils/IterableWeakMap.ts"; -import { WeakMultiRef } from "../../utils/WeakMultiRef.ts"; -import type { TReactiveArrayCallback } from "./TReactiveArrayCallback.ts"; -import type { TArrayUpdateArguments } from "./TArrayUpdateArguments.ts"; -import type { TUnwrapReactiveArray } from "./TUnwrapReactiveArray.ts"; -import type { TArrayValueType } from "./TArrayValueType.ts"; -import type { TReactiveEntity } from "../types/TReactiveEntity.ts"; -import type { TMask } from "./TMask.ts"; - -/** - * `ReadonlyReactiveArray`s are reactive values that contain multiple values and whose updates can be listened to. In general, `ReadonlyReactiveArray`s behave very similar to native `ReadonlyArray`s. The main difference is, that most primitive values are given as `ReactiveValue`s and methods will return a new `ReadonlyReactiveArray`, whose values are tied to the original `ReadonlyReactiveArray`. The class also provides a few custom convenience methods. - */ - export class ReadonlyReactiveArray { - /** An Array containing the current values of the ReactiveArray */ - readonly #__value: Array>; - /** A getter for an Array containing the current values of the ReactiveArray. Notifies computed values when it's being accessed. */ - get #value (): Array> { - if (computedConsumer) { - const {fn, consumer} = computedConsumer; - consumer.dependencies.set(this, fn); - this.#consumers.set( - consumer, - fn, - ); - - // this.#callbacks.add(computedConsumer.fn); - } - - return this.#__value; - } - - /** An Array containing ReactiveValues for each index of the ReadonlyReactiveArray */ - readonly #indices: Array>; - - /** A Set containing all the callbacks to be called whenever the ReadonlyReactiveArray is updated */ - readonly #callbacks: Set>> = new Set; - - // deno-lint-ignore ban-types People can pass literally anything into ReactiveArray - readonly #consumers = new IterableWeakMap>>(); - - /** Size of the ReactiveArray as a ReactiveValue */ - readonly #length: ReadonlyReactiveValue; - - constructor ( - ...input: Array - ) { - this.#__value = makeNonPrimitiveItemsReactive( - input, - this, - ); - this.#length = computed(() => this.#value.length); - this.#indices = input.map( - (_, i) => new ReactiveValue(i), - ); - splicers.set(this, (...args) => this.#splice(...args)); - internalArrays.set(this, this.#__value); - } - - /** - * When the object is attempted to be serialized using JSON.serialize(), the current value of `this.value` is returned. - */ - toJSON (): Array> { - return this.value; - } - - /** - * Iterates over the values of the array, similar to how regular Arrays can be iterated over. - */ - *[Symbol.iterator] (): Iterable> { - yield* this.#value; - } - - /** - * Iterates over the updates to the array. Can be used with for-await-of. - */ - async *[Symbol.asyncIterator] (): AsyncIterable>> { - while (true) { - yield await this.#nextUpdate(); - } - } - - /** - * Returns a promise that resolves when the next update fires, with the values the event fired with. - */ - #nextUpdate (): Promise>> { - return new Promise<[number, number, ...Array>]>(resolve => { - const cb: TReactiveArrayCallback> = (...props) => { - resolve(props); - this.#callbacks.delete(cb); - }; - this.#callbacks.add(cb); - }); - } - - /** - * The length of the ReactiveArray, as a ReactiveValue which updates as the array is modified. - */ - get length (): ReadonlyReactiveValue { - return this.#length; - } - - /** - * Returns the current values of the ReactiveArray as a regular Array. - */ - get value (): Array> { - return this.#value.slice(0); - } - - /** - * Replaces all the current values of the array with values of the provided array. - * - * @param items array of items to replace the current ones with. - */ - set value ( - items: ReadonlyArray>, - ) { - this.#splice( - 0, - this.#value.length, - ...items, - ); - } - - /** - * An alternative to using backet syntax `arr[index]` to access values. Bracket notation requires the Proxy, which slows down propety accesses, while this doesn't. - * - * @param index index at which you want to access a value - */ - get ( - index: number, - ): TArrayValueType | undefined { - const i = ( - index < 0 - ? this.#value.length + index - : index - ); - - return this.#value[i]; - } - - /** - * An alternative to using backet syntax `arr[index] = value` to set values. Bracket notation requires the Proxy, which slows down propety accesses, while this doesn't. - * - * @param index index at which you want to set a value - * @param value value you want to set at the specified index - */ - set ( - index: number, - value: InputType, - ): this { - this.#splice(index, 1, value); - - return this; - } - - /** - * Returns the arguments that a full, forced, update would for a callback. I.E. first item in the array is the index (`0`), second argument is delte count (current array length), and 3...n are the items currently in the array. - */ - #argsForFullUpdate (): Parameters>> { - return [0, this.#value.length, ...this.#value]; - } - - /** - * Creates a new `ReactiveValue` which is bound to the array it's called on. The value of the `ReactiveValue` is determined by the callback function provided, and is called every time theh array updates to update the value of the returned `ReactiveValue`. - * - * @param callback The function to be called when the array is updated. It's called with `(startIndex, deleteCount, ...addedItems)`. - */ - pipe < - F extends TReactiveArrayCallback, ReturnType>, - > ( - callback: F, - ): ReadonlyReactiveValue> { - const reactor = new ReadonlyReactiveValue(callback(...this.#argsForFullUpdate())); - const fn = () => internalSetReactiveValue.get(reactor)(callback(...this.#argsForFullUpdate())); - reactor.dependencies.set(this, fn); - this.#consumers.set( - reactor, - fn, - ); - - return reactor; - } - - /** - * Adds a listener to the array, which is called when the array is modified in some capacity. - * - * @param callback The function to be called when the array is updated. It's called with `(startIndex, deleteCount, ...addedItems)`. - * @param noFirstRun Default: false. Determines whether the callback function should be called once when the listener is first added. - */ - bind ( - callback: TReactiveArrayCallback>, - options: { - noFirstRun?: boolean, - // deno-lint-ignore ban-types People can pass literally anything into ReactiveArray - dependents?: ReadonlyArray, - } = {}, - ): this { - if (!options.noFirstRun) { - callback(0, 0, ...this.#value); - } - - if (options.dependents?.length) { - const key = new WeakMultiRef(options.dependents); - this.#consumers.set(key, callback); - weaklyHeldDependencies.set(key, this); - } else { - this.#callbacks.add(callback); - stronglyHeldDependencies.set(callback, this); - } - - return this; - } - - /** - * Removes a listener that was added using `ReactiveArray::bind()`. - * - * @param callback The callback function to be unbound (removed from the array's update callbacks). Similar to EventListeners, it needs to be a reference to the same callaback function that was previously added. - */ - unbind ( - callback: TReactiveArrayCallback>, - ): this { - this.#callbacks.delete(callback); - stronglyHeldDependencies.delete(callback); - - return this; - } - - /** - * Similar to `Array::splice()`. Added items are implicitly made recursively reactive. - * - * @param start Where to start modifying the array - * @param deleteCount How many items to remove - * @param items Items to add to the array - */ - #splice ( - start: number, - deleteCount: number = this.#value.length - start, - ...items: Array> - ): Array> { - if (start > this.#value.length) { - throw new RangeError(`Out of bounds assignment: tried to assign to index ${start}, but array length was only ${this.#value.length}. Sparse arrays are not allowed. Consider using .push() instead.`); - } - - this.#adjustIndices(start, deleteCount, items); - const reactiveItems = makeNonPrimitiveItemsReactive(items, this); - const deletedItems = this.#value.splice(start, deleteCount, ...reactiveItems); - this.#dispatchUpdateEvents(start, deleteCount, reactiveItems); - - return deletedItems; - } - - #dispatchUpdateEvents ( - start: number, - deleteCount: number, - newItems: ReadonlyArray> = [], - ): void { - const callbacks = concatIterators( - this.#callbacks.values(), - this.#consumers.values(), - ); - for (const callback of callbacks) { - callback(start, deleteCount, ...newItems); - } - } - - /** - * Updates the indices of each item whose index changed due to the update. Indices of removed items will become `-1`. Also inserts in new indices as `ReactiveValue` for any added items. - * - * @param start Index at which the ReactiveArray started changing - * @param deleteCount How many items were deleted - * @param items Items that were added - */ - #adjustIndices ( - start: number, - deleteCount: number, - items: ReadonlyArray>, - ): void { - const shiftedBy = items.length - deleteCount; - if (shiftedBy) { - for (let i = start + deleteCount; i < this.#indices.length; i++) { - this.#indices[i]!.value += shiftedBy; - } - } - - const removedIndices = this.#indices.splice( - start, - deleteCount, - ...items.map((_, i) => new ReactiveValue(i + start)), - ); - for (const removedIndex of removedIndices) { - removedIndex.value = -1; - } - } - - /** - * Force the the array to dispatch events to its callback. The event will simply say `0` items were removed at index `0`, with `0` items added. No equivalent on native Array prototype. - */ - update (): this { - this.#dispatchUpdateEvents(0, 0); - - return this; - } - - /** - * Similar to `Array::filter()`, except that it returns a `ReadonlyReactiveArray`, which is updated as the originating array is mutated. If you don't want this begavior, use `ReadonlyReactiveArray.prototype.value.filter()` instead. - */ - filter ( - callback: ( - value: TArrayValueType, - index: number, - array: Array>, - ) => boolean, - // deno-lint-ignore no-explicit-any People can pass literally anything into ReactiveArray - dependencies: ReadonlyArray> = [], - ): ReadonlyReactiveArray> { - - const filteredArray: ReactiveArray> = new ReactiveArray; - - const maskArray: TMask = []; - - dependencies.forEach(dependency => { - dependency.bind( - () => updateFilteredArray( - callback, - this.#value, - filteredArray, - maskArray, - ), - { - noFirstRun: true, - dependents: [filteredArray], - }, - ); - }); - - this.bind( - (start, deletes, ...items) => { - if (deletes === 0 && items.length === 0) { - updateFilteredArray( - callback, - this.#value, - filteredArray, - maskArray, - ); - } - - const lastInMask = maskArray.slice(0, start).reverse().find(v => v.show); - const newItems: Array> = []; - let currentIndex = (lastInMask?.index ?? -1); - const deletedMaskEntries = - deletes - ? maskArray.splice(start, deletes) - : [] - ; - for (const [i, item] of items.entries()) { - const sourceIndex = start + i; - const showThis = callback(item, sourceIndex, this.#value); - if (showThis) { - currentIndex++; - } - const current = { - index: currentIndex, - show: showThis, - }; - maskArray.splice(sourceIndex, 0, current); - if (showThis) { - newItems.push(item); - } - } - - const deletedItemCount = deletedMaskEntries.filter(v => v.show).length; - if (newItems.length || deletedItemCount) { - filteredArray.#splice( - (lastInMask?.index ?? -1) + 1, - deletedItemCount, - ...newItems, - ); - } - const shiftTailBy = newItems.length - deletedItemCount; - if (shiftTailBy) { - for (let i = start + items.length; i < maskArray.length; i++) { - maskArray[i]!.index += shiftTailBy; - } - } - }, - { - dependents: [filteredArray], - }, - ); - - return filteredArray.readonly; - } - - /** - * Similar to `Array::flat()`, except that it does **not** accept a depth parameter, and it returns a `ReadonlyReactiveArray` which gets gets updated with new values as the originating array is updated. - * - * ! This metod does not optimize changes. When source canges in any way, it recomputes every value, even when it theoretically wouldn't need to. - */ - flat (): ReadonlyReactiveArray>> { - const newArray = new ReactiveArray(...flatten(this.#value)); - this.bind( - () => newArray.value = flatten(this.#value), - { - noFirstRun: false, - dependents: [newArray], - }, - ); - return newArray.readonly; - } - - /** - * Similar to `Array::flatMap()`, except that it returns a `ReadonlyReactiveArray`, which gets gets updated with new values as the originating array is updated. If you don't want this behavior, use `ReadonlyReactiveArray.prototype.value.flatMap()` instead. - * - * ! This metod does not optimize changes. When source canges in any way, it recomputes every value, even when it theoretically wouldn't need to. - */ - flatMap ( - callback: ( - value: TArrayValueType, - index: number, - array: Array>, - ) => U | ReadonlyArray, - ): ReadonlyReactiveArray> { - const flatMap = () => flatten(this.#value.flatMap(callback)); - - const newArray = new ReactiveArray(...flatMap()); - this.bind( - () => newArray.value = flatMap(), - { - noFirstRun: false, - dependents: [newArray], - }, - ); - - return newArray.readonly; - } - - /** - * Similar to `Array::map()`, except that it returns a `ReadonlyReactiveArray`, which gets gets updated with mapped values as the originating array is updated. If you don't want this behavior, use `ReadonlyReactiveArray.prototype.value.map()` instead. - */ - map ( - callback: ( - value: TArrayValueType, - index: ReadonlyReactiveValue, - array: this, - ) => U, - ): ReadonlyReactiveArray { - const cb = ( - v: TArrayValueType, - i: number - ) => callback( - v, - this.#indices[i]?.readonly ?? throwExpression("Internal error: lost track of index"), - this, - ); - - const newArray = new ReadonlyReactiveArray( - ...this.#value.map(cb), - ); - this.#callbacks.add( - ( - index, - deleteCount, - ...values - ) => splicers.get(newArray)( - index, - deleteCount, - ...values.map( - (v, i) => cb(v, i + index), - ), - ), - ); - - return newArray; - } - - /** - * Returns a new reactive array with all the values of the array it's called on, without any of its callbacks. The new array is not tied to the original one in any capacity. This is a custom method, and an equivalent is not available in native Arrays. - */ - clone (): ReactiveArray> { - return new ReactiveArray(...this.#value); - } - - /** - * Similar to `Array::slice()`, except that it returns a `ReadonlyReactiveArray`, whose values are bound to the orignating array. Furthermore, if the orignating array gets items inserted or removed in the range of the spliced section (inclusive), those items will get inserted to the returned array as well. If you don't want this behavior, use `ReadonlyReactiveArray.prototype.value.slice()` instead. - * - * **Note:** `ReactiveArray::slice(0)` is not a suitable way to clone a reactive array. The output array is readonly, and values from the original array are piped into it. Use `ReactiveArray::clone()` instead. - */ - slice ( - start = 0, - end = this.#value.length - 1, - ): ReadonlyReactiveArray> { - const newArray = new ReactiveArray( - ...this.#value.slice(start, end), - ); - this.bind( - () => newArray.value = this.#value.slice(start, end), - { - dependents: [newArray], - }, - ); - return newArray.readonly; - } - - /** - * Similar to `Array::indexOf()`, except that it returns a `ReadonlyReactiveValue`, which is updated as the array changes. The array is not searched again when the array changes. If nothing is found, `ReadonlyReactiveValue<-1>` is returned, and it will never change. If something _is_ found, the index of that specific item will be kept up to date even when items are added or removed in a way that changes its index. If you don't want this behavior, use `ReadonlyReactiveArray.prototype.value.indexOf()` instead. - * - * **NOTE:** _This method should **not** be used for checking if an array includes something: use `ReactiveArray::includes()` instead._ - */ - indexOf ( - ...args: Parameters>["indexOf"]> - ): ReadonlyReactiveValue { - const index = this.#value.indexOf(...args); - return this.#indices[index]?.readonly ?? new ReadonlyReactiveValue(-1); - } - - /** - * Similar to `Array::lastIndexOf()`, except that it returns a `ReadonlyReactiveValue`, which is updated as the array changes. The array is not searched again when the array changes. If nothing is found, `ReadonlyReactiveValue<-1>` is returned, and it will never change. If something _is_ found, the index of that specific item will be kept up to date even when items are added or removed in a way that changes its index. If you don't want this behavior, use `ReadonlyReactiveArray.prototype.value.lastIndexOf()` instead. - */ - lastIndexOf ( - ...args: Parameters>["lastIndexOf"]> - ): ReadonlyReactiveValue { - const index = this.#value.lastIndexOf(...args); - return this.#indices[index]?.readonly ?? new ReadonlyReactiveValue(-1); - } - - /** - * Similar to `Array::join()`, except that it returns a `ReadonlyReactiveValue`, which is updated as the array changes. If you don't want this behavior, use `ReadonlyReactiveArray.prototype.value.join()` instead. - */ - join ( - ...args: Parameters>["join"]> - ): ReadonlyReactiveValue { - return this.pipe( - () => this.#value.join(...args), - ); - } - - /** - * Similar to `Array::every()`, except that it returns a `ReadonlyReactiveValue`, which is updated as the array changes. If you don't want this behavior, use `ReadonlyReactiveArray.prototype.value.every()` instead. - */ - every ( - ...args: Parameters>["every"]> - ): ReadonlyReactiveValue { - return this.pipe( - () => this.#value.every(...args), - ); - } - - /** - * Similar to `Array::some()`, except that it returns a `ReadonlyReactiveValue`, which is updated as the array changes. If you don't want this behavior, use `ReadonlyReactiveArray.prototype.value.some()` instead. - */ - some ( - ...args: Parameters>["some"]> - ): ReadonlyReactiveValue { - return this.pipe( - () => this.#value.some(...args), - ); - } - - /** - * Returns a `ReadonlyReactiveValue`, which is set to true when the callback returns true for some, but not all items in the array. Is updated as the array updates. This is a custom method, and a non-reactive variant is not available on the native Array prototype. - */ - exclusiveSome ( - cb: ( - value: TArrayValueType, - index: number, - array: Array>, - ) => boolean, - ): ReadonlyReactiveValue { - return this.pipe( - () => { - const mappedValues = this.#value.map(cb); - return ( - mappedValues.includes(false) && - mappedValues.includes(true) - ); - }, - ); - } - - /** - * Behaves akin to `Array::forEach()`, except will call the callback on newly added items as they're added. If you don't want this behavior, use `ReadonlyReactiveArray.prototype.value.forEach()` instead. - */ - forEach ( - ...args: Parameters>["forEach"]> - ): void { - this.bind( - ( - _index, - _deleteCount, - ...addedItems - ) => addedItems.forEach(...args), - ); - } - - /** - * Similar to `Array::reduce()`, except that its return value is a `ReadonlyReactiveValue` and will be reevaluated every time the array changes. If you don't want this behavior, use `ReadonlyReactiveArray.prototype.value.reduce()` for a non-reactive result. - */ - reduce ( - ...args: Parameters>["reduce"]> - ): ReadonlyReactiveValue>["reduce"]>> { - return this.pipe(() => this.#value.reduce(...args)); - } - - /** - * Similar to `Array::reduceRight()`, except that its return value is a `ReadonlyReactiveValue` and will be reevaluated every time the array changes. If you don't want this behavior, use `ReadonlyReactiveArray.prototype.value.reduceRight()` for a non-reactive result. - */ - reduceRight ( - ...args: Parameters>["reduceRight"]> - ): ReadonlyReactiveValue>["reduceRight"]>> { - return this.pipe(() => this.#value.reduceRight(...args)); - } - - /** - * Works just like `Array::find()`. Doesn't return a reactive value. - */ - find ( - ...args: Parameters>["find"]> - ): ReturnType>["find"]> { - return this.#value.find(...args); - } - - /** - * Similar to `Array::findIndex`, except that it returns a `ReactiveValue` whose value is updated if the index of the item changes as other items are added or removed from the array. The array is not searched again as it's mutated, however. If nothing is found, `ReadonlyReactiveValue<-1>` is returned, and its value will never be updated. If you don't want this behavior, use `ReadonlyReactiveArray.prototype.value.findIndex()` instead. - */ - findIndex ( - ...args: Parameters>["findIndex"]> - ): ReadonlyReactiveValue>["findIndex"]>> { - const index = this.#value.findIndex(...args); - - return index === -1 - ? new ReadonlyReactiveValue(-1) - : this.#indices[index]?.readonly ?? throwExpression("Internal error: lost track of index"); - } - - /** - * Works similar to `Array::entries()`. The difference is that it returns a `ReadonlyReactiveArray` containing the entries and is updated as the original array is updated. If you don't want this behavior, use `ReadonlyReactiveArray.prototype.value.entries()` for an iterator of non-reactive values instead. - */ - entries (): ReadonlyReactiveArray<[ - index: ReadonlyReactiveValue, - value: TArrayValueType, - ]> { - type TEntryType = [ - index: ReadonlyReactiveValue, - value: TArrayValueType, - ]; - - const newArray = new ReactiveArray( - ...this.#value.map((value, i): TEntryType => [ - this.#indices[i]?.readonly ?? throwExpression("Internal error: lost track of index"), - value, - ]), - ); - this.bind( - (index, deleteCount, ...addedItems) => { - newArray.#splice( - index, - deleteCount, - ...addedItems.map((value, i): TEntryType => [ - this.#indices[index + i]?.readonly ?? throwExpression("Internal error: lost track of index"), - value, - ]), - ); - }, - { - noFirstRun: true, - dependents: [newArray], - }, - ); - - return newArray.readonly; - } - - /** - * Works similar to `Array::keys()`. The difference is that it returns a `ReadonlyReactiveArray` containing the keys and is updated as the original array is updated. If you don't want this behavior, use `ReadonlyReactiveArray.prototype.value.keys()` for an iterator of non-reactive values instead. - */ - keys (): ReadonlyReactiveArray> { - const newArray = new ReactiveArray( - ...this.#indices.map(index => index.readonly), - ); - this.bind( - (index, deleteCount, ...addedItems) => { - newArray.#splice( - index, - deleteCount, - ...addedItems.map((_, i) => - this.#indices[index + i]?.readonly ?? throwExpression("Internal error: lost track of index") - ), - ); - }, - { - noFirstRun: true, - dependents: [newArray], - }, - ); - - return newArray.readonly; - } - - /** - * Works similar to `Array::values()`. The difference is that it returns a `ReadonlyReactiveArray` containing the values and is updated as the original array is updated. If you don't want this behavior, use `ReadonlyReactiveArray.prototype.value.values()` for an iterator of non-reactive values instead. - */ - values (): ReadonlyReactiveArray> { - const newArray = new ReactiveArray(...this.#value.values()); - this.bind( - (index, deleteCount, ...addedItems) => { - newArray.#splice(index, deleteCount, ...addedItems.values()); - }, - { - noFirstRun: true, - dependents: [newArray], - }, - ); - - return newArray.readonly; - } - - /** - * Works similar to `Array::includes()`. The difference is that it returns a `ReadonlyReactiveValue` containing the result and is updated as the original array is updated. If you don't want this behavior, use `ReadonlyReactiveArray.prototype.value.includes()` for a plain boolean instead. - */ - includes ( - ...args: Parameters>["includes"]> - ): ReadonlyReactiveValue { - return this.pipe( - () => this.#value.includes(...args), - ); - } - - /** - * Conbines the array with one or more other arrays, or other values. - * - * Similar to `Array::concat()`, except that it returns a `ReadonlyReactiveArray`. It accepts arrays, `ReactiveArray`s, `ReactiveValue`s, or other items as parameters. Any `ReactiveArray`s or `ReactiveValue`s will be tracked, and the resulting `ReadonlyReactiveArray` will be updated whenever they get updated. - * - * @param items The items to be tacked onto the original array. - */ - concat< - U, - K extends TArrayValueType | U, - > ( - ...items: Array | ReactiveValue | ReactiveArray> - ): ReadonlyReactiveArray> { - const newArray = this.clone() as ReactiveArray | U>; - this.bind( - (...args) => splicers.get(newArray)(...args), - { - dependents: [newArray], - }, - ); - const lengthTally: Array<{value: number}> = [ - this.length, - ]; - function currentOffset ( - cutoff: number, - index = 0, - ) { - let tally = index; - for (let i = 0; i < cutoff; i++) { - tally += lengthTally[i]?.value ?? throwExpression("Internal error: failed to concatenate", RangeError); - } - return tally; - } - for (const [i, item] of items.entries()) { - if (item instanceof ReadonlyReactiveArray) { - item.bind( - ( - index, - deleteCount, - ...values - ) => newArray.splice( - currentOffset(i, index), - deleteCount, - ...values - ), - { - dependents: [newArray], - } - ); - lengthTally.push(item.length); - } else if (item instanceof ReadonlyReactiveValue) { - item.bind( - value => newArray.splice( - currentOffset(i), - 1, - value, - ), - { - dependents: [newArray], - } - ); - lengthTally.push({ - value: 1, - }); - } else if (Array.isArray(item)) { - newArray.splice( - currentOffset(i), - 0, - ...item, - ); - lengthTally.push({ - value: item.length, - }); - } else { - newArray.splice( - currentOffset(i), - 0, - item, - ); - lengthTally.push({ - value: 1, - }); - } - } - return newArray; - } -} diff --git a/examples/deno-router/src/reactive/ReactiveArray/arrayDependencyCaches.ts b/examples/deno-router/src/reactive/ReactiveArray/arrayDependencyCaches.ts deleted file mode 100644 index 368328e..0000000 --- a/examples/deno-router/src/reactive/ReactiveArray/arrayDependencyCaches.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { IterableWeakMap } from "../../utils/IterableWeakMap.ts"; -import type { WeakMultiRef } from "../../utils/WeakMultiRef.ts"; -import type { TArrayValueType } from "./TArrayValueType.ts"; -import type { TReactiveArrayCallback } from "./TReactiveArrayCallback.ts"; -import type { ReadonlyReactiveArray } from "./_ReadonlyReactiveArray.ts"; - -export const stronglyHeldDependencies = new Map< - // deno-lint-ignore no-explicit-any - TReactiveArrayCallback>, - // deno-lint-ignore no-explicit-any People can pass literally anything into ReactiveArray - ReadonlyReactiveArray ->(); - -export const weaklyHeldDependencies = new IterableWeakMap< - WeakMultiRef, - // deno-lint-ignore no-explicit-any - ReadonlyReactiveArray ->(); diff --git a/examples/deno-router/src/reactive/ReactiveArray/flatten.ts b/examples/deno-router/src/reactive/ReactiveArray/flatten.ts deleted file mode 100644 index 485a73c..0000000 --- a/examples/deno-router/src/reactive/ReactiveArray/flatten.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ReadonlyReactiveArray } from "./_ReadonlyReactiveArray.ts"; -import type { TUnwrapReactiveArray } from "./TUnwrapReactiveArray.ts"; - -type TUnwrapArray = ( - Input extends ReadonlyArray - ? V - : never -); - -export const flatten = < - Input extends ReadonlyArray, ->( - input: Input, -): Array>> => { - return input.reduce((acc: Array>>, v) => { - v instanceof ReadonlyReactiveArray - ? acc.push(...v.value) - : acc.push(v as TUnwrapReactiveArray>); - return acc; - }, []); -}; diff --git a/examples/deno-router/src/reactive/ReactiveArray/internalArrays.ts b/examples/deno-router/src/reactive/ReactiveArray/internalArrays.ts deleted file mode 100644 index 5fcc6a9..0000000 --- a/examples/deno-router/src/reactive/ReactiveArray/internalArrays.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { ReadonlyReactiveArray } from "./_ReadonlyReactiveArray.ts"; -import type { TArrayValueType } from "./TArrayValueType.ts"; -import type { ReactiveArray } from "./_ReactiveArray.ts"; - -export const internalArrays = new class { - #inner = new WeakMap< - // deno-lint-ignore no-explicit-any People can pass literally anything into ReactiveArray - ReadonlyReactiveArray - >(); - - get( - key: ReadonlyReactiveArray | ReactiveArray - ) { - return this.#inner.get(key) as ReadonlyArray>; - } - - set( - key: ReadonlyReactiveArray, - value: ReadonlyArray>, - ) { - this.#inner.set(key, value); - } -}; diff --git a/examples/deno-router/src/reactive/ReactiveArray/makeNonPrimitiveItemsReactive.ts b/examples/deno-router/src/reactive/ReactiveArray/makeNonPrimitiveItemsReactive.ts deleted file mode 100644 index a29f2f1..0000000 --- a/examples/deno-router/src/reactive/ReactiveArray/makeNonPrimitiveItemsReactive.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { reactive } from "../reactive.ts"; -import { isSpecialCaseObject } from "../reactiveProperties/specialCaseObjects.ts"; -import { isReactive } from "../../typeChecks/isReactive.ts"; -import { isObject } from "../../typeChecks/isObject.ts"; -import type { TArrayValueType } from "./TArrayValueType.ts"; -import type { ReadonlyReactiveArray } from "./_ReadonlyReactiveArray.ts"; - -/** - * Converts a given array of values into a reactive entity recursively if it's not to be treated as a primitive. I.E. `Array`s and most `Object`s will be converted, but primitive values will not. This is useful for `ReactiveArrays`, whose direct children are managed directly by the class itself, but whose deeply nested descendants need to be tracked separately. - * @param items The items to be converted - * @param parent Another reactive entity to whom any reactive items created should report to when updating, so updates can correctly propagate to the highest level - */ -export function makeNonPrimitiveItemsReactive ( - items: Array>, - parent: ReadonlyReactiveArray, -): Array> { - return items.map((v: unknown) => { - return ( - isReactive(v) || !isObject(v) || isSpecialCaseObject(v) - ? v - : reactive( - v, - {parent: parent as ReadonlyReactiveArray}, - ) - ) as TArrayValueType; - }); -} diff --git a/examples/deno-router/src/reactive/ReactiveArray/splicers.ts b/examples/deno-router/src/reactive/ReactiveArray/splicers.ts deleted file mode 100644 index 6372365..0000000 --- a/examples/deno-router/src/reactive/ReactiveArray/splicers.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { ReadonlyReactiveArray } from "./_ReadonlyReactiveArray.ts"; -import type { ReactiveArray } from "./_ReactiveArray.ts"; -import type { TArrayValueType } from "./TArrayValueType.ts"; - -export type TSplice = ( - start: number, - deleteCount?: number, - ...items: ReadonlyArray> -) => Array>; - -export const splicers = new class { - #inner = new WeakMap< - // deno-lint-ignore no-explicit-any People can pass literally anything into ReactiveArray - ReadonlyReactiveArray - >(); - - get( - key: ReadonlyReactiveArray | ReactiveArray, - ) { - return this.#inner.get(key) as TSplice; - } - - set( - key: ReadonlyReactiveArray, - value: TSplice, - ) { - this.#inner.set(key, value); - } -}; diff --git a/examples/deno-router/src/reactive/ReactiveArray/updateFilteredArray.ts b/examples/deno-router/src/reactive/ReactiveArray/updateFilteredArray.ts deleted file mode 100644 index 4c1122f..0000000 --- a/examples/deno-router/src/reactive/ReactiveArray/updateFilteredArray.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { throwExpression } from "../../utils/throwExpression.ts"; -import type { ReactiveArray } from "./_ReactiveArray.ts"; -import type { TMask } from "./TMask.ts"; -import type { TMaskEntry } from "./TMaskEntry.ts"; - -type TUpdateQueueEntry = TMaskEntry & {value: T}; -type TUpdateQueue = Array>; - -const processUpdateQueue = ( - updateQueue: TUpdateQueue, - filteredArray: ReactiveArray, -) => { - if (!updateQueue.length) return; - - const addedItems: Array = []; - let deleteCount = 0; - for (const item of updateQueue) { - if (item.show) { - addedItems.push(item.value); - } else { - deleteCount++; - } - } - const startEditingAt = updateQueue.find(v => v.show)?.index ?? updateQueue[0]!.index + 1; - filteredArray.splice( - startEditingAt, - deleteCount, - ...addedItems, - ); - updateQueue.splice(0, updateQueue.length); -}; - -export const updateFilteredArray = ( - callback: ( - value: T, - index: number, - array: Array, - ) => boolean, - sourceArray: Array, - filteredArray: ReactiveArray, - maskArray: TMask, -): void => { - let newIndex = -1; - const updateQueue: TUpdateQueue = []; - for (const [i, item] of sourceArray.entries()) { - const showThis = callback(item, i, sourceArray); - if (showThis) { - newIndex++; - } - if (showThis !== (maskArray[i]?.show ?? throwExpression("Internal error: failed to filter", RangeError))) { - const current = { - index: newIndex, - show: showThis, - value: item, - }; - updateQueue.push(current); - maskArray[i] = current; - } else { - processUpdateQueue(updateQueue, filteredArray); - } - } - processUpdateQueue(updateQueue, filteredArray); -}; diff --git a/examples/deno-router/src/reactive/ReactiveValue/PassReactiveValue.ts b/examples/deno-router/src/reactive/ReactiveValue/PassReactiveValue.ts deleted file mode 100644 index 70f9387..0000000 --- a/examples/deno-router/src/reactive/ReactiveValue/PassReactiveValue.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ReadonlyReactiveValue } from "./_ReadonlyReactiveValue.ts"; - -export class PassReactiveValue { - deref: ReadonlyReactiveValue; - - constructor (ref: ReadonlyReactiveValue) { - this.deref = ref; - } -} diff --git a/examples/deno-router/src/reactive/ReactiveValue/TReactiveValueCallback.ts b/examples/deno-router/src/reactive/ReactiveValue/TReactiveValueCallback.ts deleted file mode 100644 index d16335d..0000000 --- a/examples/deno-router/src/reactive/ReactiveValue/TReactiveValueCallback.ts +++ /dev/null @@ -1 +0,0 @@ -export type TReactiveValueCallback = (newValue: T) => void; diff --git a/examples/deno-router/src/reactive/ReactiveValue/TReactiveValueUpdater.ts b/examples/deno-router/src/reactive/ReactiveValue/TReactiveValueUpdater.ts deleted file mode 100644 index cc2082b..0000000 --- a/examples/deno-router/src/reactive/ReactiveValue/TReactiveValueUpdater.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { TReactiveValueUpdaterOptions } from "./TReactiveValueUpdaterOptions.ts"; - -export type TReactiveValueUpdater = ( - value: T, - options?: Partial>, -) => void; diff --git a/examples/deno-router/src/reactive/ReactiveValue/TReactiveValueUpdaterOptions.ts b/examples/deno-router/src/reactive/ReactiveValue/TReactiveValueUpdaterOptions.ts deleted file mode 100644 index 5b954af..0000000 --- a/examples/deno-router/src/reactive/ReactiveValue/TReactiveValueUpdaterOptions.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { TReactiveValueCallback } from "./TReactiveValueCallback.ts"; - -export type TReactiveValueUpdaterOptions = { - noUpdate: ReadonlyArray>, - force: boolean, -}; diff --git a/examples/deno-router/src/reactive/ReactiveValue/_ReactiveValue.ts b/examples/deno-router/src/reactive/ReactiveValue/_ReactiveValue.ts deleted file mode 100644 index 72ec7eb..0000000 --- a/examples/deno-router/src/reactive/ReactiveValue/_ReactiveValue.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { internalSetReactiveValue } from "./internalSetReactiveValue.ts"; -import { ReadonlyReactiveValue } from "./_ReadonlyReactiveValue.ts"; -import type { TReactiveValueUpdaterOptions } from "./TReactiveValueUpdaterOptions.ts"; - -export class ReactiveValue extends ReadonlyReactiveValue { - /** - * Forces an update event to be dispatched. - */ - update (): this { - this.set( - this.value, - { force: true }, - ); - - return this; - } - - /** - * Can be used to functionally update the value. - * @param value New value to be set - * @param noUpdate One or more callback methods you don't want to be called on this update. This can be useful for example when responding to DOM events: you wouldn't want to update the DOM with the new value on the same element that caused the udpate in the first place. - */ - set ( - value: T, - options?: Partial>, - ): this { - internalSetReactiveValue.get(this)(value, options); - - return this; - } - - /** The current value of the ReactiveValue. */ - override get value (): T { - return super.value; - } - - /** The current `value` of the `ReactiveValue` */ - override set value ( - value: T, - ) { - this.set(value); - } - - /** Cache for readonly getter */ - #readonly: ReadonlyReactiveValue | undefined; - - /** Readonly version of the instance that can't be mutated from the outside, but will be updated as the original instance updates. */ - get readonly (): ReadonlyReactiveValue { - return this.#readonly ?? (this.#readonly = this.pipe(v => v)); - } -} diff --git a/examples/deno-router/src/reactive/ReactiveValue/_ReadonlyReactiveValue.ts b/examples/deno-router/src/reactive/ReactiveValue/_ReadonlyReactiveValue.ts deleted file mode 100644 index fa46363..0000000 --- a/examples/deno-router/src/reactive/ReactiveValue/_ReadonlyReactiveValue.ts +++ /dev/null @@ -1,220 +0,0 @@ -import { IterableWeakMap } from "../../utils/IterableWeakMap.ts"; -import { WeakMultiRef } from "../../utils/WeakMultiRef.ts"; -import { computedConsumer } from "../computed.ts"; -import { concatIterators } from "../../utils/concatIterators.ts"; -import { PassReactiveValue } from "./PassReactiveValue.ts"; -import { internalSetReactiveValue } from "./internalSetReactiveValue.ts"; -import { stronglyHeldDependencies, weaklyHeldDependencies } from "./valueDependencyCaches.ts"; -import type { TReactiveValueCallback } from "./TReactiveValueCallback.ts"; -import type { TReactiveValueUpdaterOptions } from "./TReactiveValueUpdaterOptions.ts"; -import type { ReadonlyReactiveArray } from "../ReactiveArray/_ReadonlyReactiveArray.ts"; - - -export class ReadonlyReactiveValue { - /** The current value of the `ReactiveValue`. */ - #value: T; - - /** All the callbacks added to the `ReactiveValue`, which are to be called when the `value` updates. */ - readonly #callbacks: Set> = new Set; - - // deno-lint-ignore ban-types - readonly #consumers = new IterableWeakMap>(); - - // deno-lint-ignore no-explicit-any People can pass literally anything into ReactiveArray - readonly dependencies = new Map | ReadonlyReactiveArray, VoidFunction>(); - - constructor ( - initialValue: T, - ) { - this.#value = initialValue; - internalSetReactiveValue.set( - this, - (...args) => this.#set(...args), - ); - } - - /** - * Can be used to functionally update the value. - * @param value New value to be set - * @param noUpdate One or more callback methods you don't want to be called on this update. This can be useful for example when responding to DOM events: you wouldn't want to update the DOM with the new value on the same element that caused the udpate in the first place. - */ - #set ( - value: T, - options?: Partial>, - ): this { - const { - noUpdate, - force, - }: TReactiveValueUpdaterOptions = { - noUpdate: [], - force: false, - ...options, - }; - if (force || !Object.is(value, this.#value)) { - this.#value = value; - - const callbacks = concatIterators( - this.#callbacks.values(), - this.#consumers.values(), - ); - for (const callback of callbacks) { - if (!noUpdate.includes(callback)) { - callback(value); - } - } - } - return this; - } - - /** - * Same as `this.value`. The current value of the `ReactiveValue`. - */ - valueOf (): T { - return this.value; - } - - /** - * When the object is attempted to be cast to a primitive, the current value of `this.value` is used as a hint. Obviously, if you're trying to cast a `ReactiveValue` into a `number`, it'll just cast `this.value` from a `string` to a `number`. Trying to cast `ReactiveValue` to a primitive will throw. - */ - [Symbol.toPrimitive] (): T extends Record ? never : T { - return this.value as T extends Record ? never : T; - } - - /** - * When the object is attempted to be serialized using JSON.serialize(), the current value of `this.value` is returned. - */ - toJSON (): T { - return this.value; - } - - get [Symbol.toStringTag] (): string { - return `${this.constructor.name}<${typeof this.#value}>`; - } - - /** - * Instances of this class can be iterated over asynchronously; it will iterate over updates to the `value`. You can use this feature using `for-await-of`. - */ - async *[Symbol.asyncIterator] (): AsyncIterable { - while (true) { - yield await this.nextUpdate; - } - } - - /** - * Returns a Promise which will resolve the next time the `value` is updated. - */ - get nextUpdate (): Promise { - return new Promise(resolve => { - const cb = (v: T) => { - resolve(v); - this.#callbacks.delete(cb); - }; - this.#callbacks.add(cb); - }); - } - - /** - * Adds a callback to be called whenever the `value` of the `ReacativeValue` is updated. - * @param callback the function to be called on updates - * @param options.noFirstRun Set to true and the callback won't be fired right after being added. - * @param options.dependencies An array of objects that are modified by the callback provided. The callback will be garbage collected if all the provided objects are collected. If no dependencies are provided, the callback will never be automatically garbage collected and you have to unbind it yourself to avoid leaking memory. - */ - bind ( - callback: TReactiveValueCallback, - options: { - noFirstRun?: boolean, - // deno-lint-ignore ban-types - dependents?: ReadonlyArray, - } = {}, - ): this { - if (!options.noFirstRun) callback(this.value); - - if (options.dependents?.length) { - const key = new WeakMultiRef(options.dependents); - this.#consumers.set(key, callback); - weaklyHeldDependencies.set(key, this); - } else { - this.#callbacks.add(callback); - stronglyHeldDependencies.set(callback, this); - } - - return this; - } - - unbind ( - callback: TReactiveValueCallback, - ): this { - this.#callbacks.delete(callback); - stronglyHeldDependencies.delete(callback); - - return this; - } - - /** The current value of the ReadonlyReactiveValue. */ - get value (): T { - if (computedConsumer) { - const {fn, consumer} = computedConsumer; - consumer.dependencies.set(this, fn); - this.#consumers.set( - consumer, - fn, - ); - } - - return this.#value; - } - - /** - * Creates a new `ReactiveValue` which is dependent on the `ReactiveValue` it's called on, and is updated as the original one is updated. The value of the original is tranformed by a callback function whose return value determines the value of the resulting `ReactiveValue`. - * @param callback A function which will be called whenever the original `ReactiveValue` is updated, and whose return value is assigned to the output `ReactiveValue` - */ - pipe ( - callback: (value: T) => K, - ): ReadonlyReactiveValue { - const reactor = new ReadonlyReactiveValue(callback(this.#value)); - const fn = () => internalSetReactiveValue.get(reactor)(callback(this.#value)); - reactor.dependencies.set(this, fn); - this.#consumers.set( - reactor, - fn, - ); - return reactor; - } - - truthy ( - valueWhenTruthy: T, - valueWhenFalsy?: undefined, - ): ReadonlyReactiveValue - truthy ( - valueWhenTruthy: T, - valueWhenFalsy: K, - ): ReadonlyReactiveValue - truthy ( - valueWhenTruthy: T, - valueWhenFalsy: K, - ): ReadonlyReactiveValue { - return this.pipe(v => v ? valueWhenTruthy : valueWhenFalsy); - } - - falsy ( - valueWhenFalsy: T, - valueWhenTruthy?: undefined, - ): ReadonlyReactiveValue - falsy ( - valueWhenFalsy: T, - valueWhenTruthy: K, - ): ReadonlyReactiveValue - falsy ( - valueWhenFalsy: T, - valueWhenTruthy: K, - ): ReadonlyReactiveValue { - return this.pipe(v => v ? valueWhenTruthy : valueWhenFalsy); - } - - /** - * Returns a reference to the reactive value, which can be used to pass it as a prop to a template without binding or unboxing. The reference gets unwrapped by the tempalte automatically, and you will receive the ReactiveValue itself on the other side. - */ - get pass (): PassReactiveValue { - return new PassReactiveValue(this); - } -} diff --git a/examples/deno-router/src/reactive/ReactiveValue/internalSetReactiveValue.ts b/examples/deno-router/src/reactive/ReactiveValue/internalSetReactiveValue.ts deleted file mode 100644 index 2bab354..0000000 --- a/examples/deno-router/src/reactive/ReactiveValue/internalSetReactiveValue.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { ReadonlyReactiveValue } from "./_ReadonlyReactiveValue.ts"; -import type { TReactiveValueUpdater } from "./TReactiveValueUpdater.ts"; - -export const internalSetReactiveValue = new class { - #inner = new WeakMap< - // deno-lint-ignore no-explicit-any People can pass literally anything into ReactiveArray - ReadonlyReactiveValue - >(); - - get( - key: ReadonlyReactiveValue - ) { - return this.#inner.get(key) as TReactiveValueUpdater; - } - - set( - key: ReadonlyReactiveValue, - value: TReactiveValueUpdater, - ) { - this.#inner.set(key, value); - } -}; diff --git a/examples/deno-router/src/reactive/ReactiveValue/valueDependencyCaches.ts b/examples/deno-router/src/reactive/ReactiveValue/valueDependencyCaches.ts deleted file mode 100644 index c08f34f..0000000 --- a/examples/deno-router/src/reactive/ReactiveValue/valueDependencyCaches.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { IterableWeakMap } from "../../utils/IterableWeakMap.ts"; -import type { WeakMultiRef } from "../../utils/WeakMultiRef.ts"; -import type { TReactiveValueCallback } from "./TReactiveValueCallback.ts"; -import type { ReadonlyReactiveValue } from "./_ReadonlyReactiveValue.ts"; - -export const stronglyHeldDependencies = new Map< - // deno-lint-ignore no-explicit-any People can pass literally anything into ReactiveArray - TReactiveValueCallback, - // deno-lint-ignore no-explicit-any People can pass literally anything into ReactiveArray - ReadonlyReactiveValue ->(); - -export const weaklyHeldDependencies = new IterableWeakMap< - WeakMultiRef, - // deno-lint-ignore no-explicit-any People can pass literally anything into ReactiveArray - ReadonlyReactiveValue ->(); diff --git a/examples/deno-router/src/reactive/classNames.ts b/examples/deno-router/src/reactive/classNames.ts deleted file mode 100644 index 3a3a667..0000000 --- a/examples/deno-router/src/reactive/classNames.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { computed } from "./computed.ts"; -import { ReadonlyReactiveValue } from "./ReactiveValue/_ReadonlyReactiveValue.ts"; - -/** - * This function can be used to create class name string for one or more class names controlled by static or reactive booleans. - * - * Example usage: - * ```js - * const foo = reactive(true); - * const bar = reactive(false); - * - * html` - *
- * `; - * ``` - * and the result will be: - * ```html - *
- * ``` - * - * @param input A record containing boolean values indicating if the key should be added in as a class name - * @returns A reactive string that updates when any of the inputs change - */ -export function classNames ( - input: Record>, -): ReadonlyReactiveValue { - return computed(() => - Object - .entries(input) - .filter(([, value]) => - value instanceof ReadonlyReactiveValue - ? value.value - : value - ) - .map(([key]) => key) - .join(" "), - ); -} diff --git a/examples/deno-router/src/reactive/computed.ts b/examples/deno-router/src/reactive/computed.ts deleted file mode 100644 index dd2fddb..0000000 --- a/examples/deno-router/src/reactive/computed.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { composeTemplateString } from "../utils/composeTemplateString.ts"; -import { WeakMultiRef } from "../utils/WeakMultiRef.ts"; -import { ReactiveValue } from "./ReactiveValue/_ReactiveValue.ts"; -import type { ReadonlyReactiveValue } from "./ReactiveValue/_ReadonlyReactiveValue.ts"; - -export let computedConsumer: { - fn: VoidFunction, - // deno-lint-ignore no-explicit-any - consumer: ReadonlyReactiveValue, -} | undefined; - -const hold = new WeakMap | WeakMultiRef, VoidFunction>(); - -type TComputedOptions = { - // eslint-disable-next-line @typescript-eslint/ban-types - dependents?: ReadonlyArray, -}; - -/** - * Takes a callback and returns a new `ReadonlyReactiveValue` whose value is updated with the return value of the callback whenever any of the reactive values used in the callback are updated. - * - * @param callback The function that computes the value - */ -export function computed ( - callback: TemplateStringsArray, - ...props: Array -): ReadonlyReactiveValue; -export function computed ( - callback: () => T, - options?: TComputedOptions, -): ReadonlyReactiveValue; -export function computed ( - callback: (() => T) | TemplateStringsArray, - ...props: Array | [TComputedOptions] -): ReadonlyReactiveValue | ReadonlyReactiveValue { - if ("raw" in callback) { - return computed(() => composeTemplateString(callback, props)); - } - const cb = callback; - const consumer = new ReactiveValue(undefined as unknown as T); - fn(); - - function fn () { - computedConsumer = {fn, consumer}; - const newValue = cb(); - computedConsumer = undefined; - consumer.value = newValue; - } - - const [options] = props as [TComputedOptions?]; - if (options?.dependents?.length) { - hold.set(new WeakMultiRef([consumer, ...options.dependents]), fn); - } else { - hold.set(consumer, fn); - } - - return consumer.readonly; -} diff --git a/examples/deno-router/src/reactive/reactive.ts b/examples/deno-router/src/reactive/reactive.ts deleted file mode 100644 index dd3c3be..0000000 --- a/examples/deno-router/src/reactive/reactive.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { ReactiveValue } from "./ReactiveValue/_ReactiveValue.ts"; -import { ReactiveArray } from "./ReactiveArray/_ReactiveArray.ts"; -import { reactiveProperties } from "./reactiveProperties/_reactiveProperties.ts"; -import { isSpecialCaseObject } from "./reactiveProperties/specialCaseObjects.ts"; -import { isReactive } from "../typeChecks/isReactive.ts"; -import { isObject } from "../typeChecks/isObject.ts"; -import type { TReactiveValueType } from "./types/TReactiveValueType.ts"; -import type { TReactiveEntity } from "./types/TReactiveEntity.ts"; -import type { TReactive } from "./types/TReactive.ts"; -import type { ReadonlyReactiveArray } from "./ReactiveArray/_ReadonlyReactiveArray.ts"; - -/** - * A polymorphic convenience function that will convert any value into a reactive entity recursively. `Array`s are converted into `ReactiveArray`s. `Object`s whose prototype is `Object` get their keys converted into reactive items using the same algorithm `ReactiveArray`s use (see `reactiveProperties.ts` for more details). Other values are converted into `ReactiveValue`s. - * - * @param initialValue The value to be made reactive - * @param options.fallback A fallback value to be displayed when the initial value is a pending `Promise` - * @param options.parent Another reactive entity to whom any reactive items created should report to when updating, so updates can correctly propagate to the highest level - */ -function reactive, K = unknown> ( - initialValue: T, - options: { - fallback: T extends Promise ? V : never, - parent?: ReactiveValue | ReadonlyReactiveArray, - }, -): ReactiveValue ? V : never>; -function reactive ( - initialValue: T, - options?: { - parent?: ReactiveValue | ReadonlyReactiveArray, - }, -): TReactiveValueType; -function reactive ( - initialValue: unknown, - options?: { - parent?: ReactiveValue | ReadonlyReactiveArray, - }, -): TReactive; -function reactive ( - initialValue: T, - options: { - fallback?: T, - parent?: ReactiveValue | ReadonlyReactiveArray, - } = {}, -): unknown { - if (isReactive(initialValue as unknown)) { - return initialValue; - } - - const {parent} = options; - let ref: TReactiveEntity; - - if (isObject(initialValue)) { - if (Array.isArray(initialValue)) { - ref = new ReactiveArray(...initialValue); - } else if (initialValue instanceof Promise) { - const temp = new ReactiveValue(options.fallback); - void initialValue.then(value => temp.value = value as T); - ref = temp as ReactiveValue; - } else if (isSpecialCaseObject(initialValue)) { - ref = new ReactiveValue(initialValue); - } else { - // objects passed to reactiveProperties don't get callbacks bound to them: the callbacks are attached to each field separately. - return reactiveProperties(initialValue, options.parent); - } - } else { - ref = new ReactiveValue(initialValue); - } - - if (parent) { - ref.bind( - () => parent.update(), - ); - } - - return ref; -} - -export {reactive}; diff --git a/examples/deno-router/src/reactive/reactiveProperties/TReactiveProperties.ts b/examples/deno-router/src/reactive/reactiveProperties/TReactiveProperties.ts deleted file mode 100644 index 66b9ff5..0000000 --- a/examples/deno-router/src/reactive/reactiveProperties/TReactiveProperties.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { TReactivePropertiesFlag } from "./TReactivePropertiesFlag.ts"; -import type { TReactiveValueType } from "../types/TReactiveValueType.ts"; - -export type TReactiveProperties | unknown> = ( - { - readonly [P in keyof T]: TReactiveValueType; - } & TReactivePropertiesFlag -); diff --git a/examples/deno-router/src/reactive/reactiveProperties/TReactivePropertiesFlag.ts b/examples/deno-router/src/reactive/reactiveProperties/TReactivePropertiesFlag.ts deleted file mode 100644 index f2b0634..0000000 --- a/examples/deno-router/src/reactive/reactiveProperties/TReactivePropertiesFlag.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { reactivePropertiesFlag } from "./reactivePropertiesFlag.ts"; - -export type TReactivePropertiesFlag = { - readonly [reactivePropertiesFlag]: true, -}; diff --git a/examples/deno-router/src/reactive/reactiveProperties/_reactiveProperties.ts b/examples/deno-router/src/reactive/reactiveProperties/_reactiveProperties.ts deleted file mode 100644 index 569d536..0000000 --- a/examples/deno-router/src/reactive/reactiveProperties/_reactiveProperties.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { reactive } from "../reactive.ts"; -import { reactivePropertiesFlag } from "./reactivePropertiesFlag.ts"; -import { describeType } from "../../utils/describeType.ts"; -import type { TReactiveProperties } from "./TReactiveProperties.ts"; -import type { ReactiveValue } from "../ReactiveValue/_ReactiveValue.ts"; -import type { ReadonlyReactiveArray } from "../ReactiveArray/_ReadonlyReactiveArray.ts"; - -/** - * Takes an object, and passes each of its enumerable properties to `reactive()`, which makes the entire structure reactive recursively. Returns a new object without mutating the original one. - * - * @param input The object whose properties are to be made reactive - * @param parent Another reactive entity to which any reactive items created should report to when updating, so updates can correctly propagate to the highest level - */ -export function reactiveProperties< - T extends Readonly>, - K = unknown, -> ( - input: T, - parent?: ReactiveValue | ReadonlyReactiveArray, -): TReactiveProperties { - // TS is incapable of figuring out the type correctly here, so it will throw a runtime error instead. - if (![null, Object].includes(input.constructor as ObjectConstructor)) { - throw new TypeError(`Illegal object ${describeType(input)} passed to \`reactiveProperties()\`. You must either pass in objects that have \`Object\` or \`null\` as their prototype, or wrap the objects using \`ReactiveValue\`.`); - } - - const result = Object.fromEntries( - Object - .entries(input) - .map(entry => (entry[1] = reactive(entry[1], {parent}), entry)) - ) as { - [key: string]: unknown, - [reactivePropertiesFlag]: true, - }; - result[reactivePropertiesFlag] = true; - - return Object.freeze(result) as TReactiveProperties; -} diff --git a/examples/deno-router/src/reactive/reactiveProperties/reactivePropertiesFlag.ts b/examples/deno-router/src/reactive/reactiveProperties/reactivePropertiesFlag.ts deleted file mode 100644 index 84f6b9f..0000000 --- a/examples/deno-router/src/reactive/reactiveProperties/reactivePropertiesFlag.ts +++ /dev/null @@ -1 +0,0 @@ -export const reactivePropertiesFlag = Symbol("reactivePropertiesFlag"); diff --git a/examples/deno-router/src/reactive/reactiveProperties/specialCaseObjects.ts b/examples/deno-router/src/reactive/reactiveProperties/specialCaseObjects.ts deleted file mode 100644 index 41bbf46..0000000 --- a/examples/deno-router/src/reactive/reactiveProperties/specialCaseObjects.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { TemplateResult } from "../../parsing/TemplateResult.ts"; - -/** - * Basically, because TS doesn't support nominal typing, we have to use this hack to exclude unwanted objects from our reactive methods. - */ -export const specialCaseObjects = [ - Function, - Date, - RegExp, - DocumentFragment, - TemplateResult, - Node, -] as const; - -export function isSpecialCaseObject ( - input: unknown, -): input is TSpecialCaseObject { - const type = typeof input; - if (type === "function") return true; - else if (type !== "object") return false; - else return specialCaseObjects.some(constr => input instanceof constr); -} - -export type TSpecialCaseObject = InstanceType; diff --git a/examples/deno-router/src/reactive/types/TPrimitive.ts b/examples/deno-router/src/reactive/types/TPrimitive.ts deleted file mode 100644 index 4af9cfe..0000000 --- a/examples/deno-router/src/reactive/types/TPrimitive.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type TPrimitive = ( - | undefined - | null - | boolean - | string - | number - | bigint - | symbol -); diff --git a/examples/deno-router/src/reactive/types/TReactive.ts b/examples/deno-router/src/reactive/types/TReactive.ts deleted file mode 100644 index beb8ae4..0000000 --- a/examples/deno-router/src/reactive/types/TReactive.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ReadonlyReactiveValue } from "../ReactiveValue/_ReadonlyReactiveValue.ts"; -import type { ReadonlyReactiveArray } from "../ReactiveArray/_ReadonlyReactiveArray.ts"; -import type { TReactiveProperties } from "../reactiveProperties/TReactiveProperties.ts"; - -export type TReactive = ( - | ReadonlyReactiveArray - | ReadonlyReactiveValue - | TReactiveProperties -); diff --git a/examples/deno-router/src/reactive/types/TReactiveEntity.ts b/examples/deno-router/src/reactive/types/TReactiveEntity.ts deleted file mode 100644 index df0083d..0000000 --- a/examples/deno-router/src/reactive/types/TReactiveEntity.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ReadonlyReactiveArray } from "../ReactiveArray/_ReadonlyReactiveArray.ts"; -import type { ReadonlyReactiveValue } from "../ReactiveValue/_ReadonlyReactiveValue.ts"; - -export type TReactiveEntity = ( - | ReadonlyReactiveValue - | ReadonlyReactiveArray -); diff --git a/examples/deno-router/src/reactive/types/TReactiveValueType.ts b/examples/deno-router/src/reactive/types/TReactiveValueType.ts deleted file mode 100644 index 9faf318..0000000 --- a/examples/deno-router/src/reactive/types/TReactiveValueType.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { ReactiveArray } from "../ReactiveArray/_ReactiveArray.ts"; -import type { TSpecialCaseObject } from "../reactiveProperties/specialCaseObjects.ts"; -import type { TReactiveProperties } from "../reactiveProperties/TReactiveProperties.ts"; -import type { ReactiveValue } from "../ReactiveValue/_ReactiveValue.ts"; -import type { TReactive } from "./TReactive.ts"; - -export type TReactiveValueType = ( - T extends TReactive ? T : - T extends TSpecialCaseObject ? ReactiveValue : - T extends Promise ? ReactiveValue : - T extends ReadonlyArray ? ReactiveArray : - T extends Readonly> ? TReactiveProperties : - T extends boolean ? ReactiveValue : - ReactiveValue -); diff --git a/examples/deno-router/src/styling/CSSTemplate.ts b/examples/deno-router/src/styling/CSSTemplate.ts deleted file mode 100644 index e022621..0000000 --- a/examples/deno-router/src/styling/CSSTemplate.ts +++ /dev/null @@ -1,29 +0,0 @@ -interface ICSSStyleSheet extends CSSStyleSheet { - replace: (cssText: string) => void -} - -export class CSSTemplate { - readonly cssText: string; - - constructor ( - cssText: string, - ) { - this.cssText = cssText; - } - - get styleElement (): HTMLStyleElement { - return Object.assign( - document.createElement("style"), - { textContent: this.cssText }, - ); - } - - #stylesheet: CSSStyleSheet | undefined; - get styleSheet (): CSSStyleSheet { - if (!this.#stylesheet) { - this.#stylesheet = new CSSStyleSheet; - (this.#stylesheet as ICSSStyleSheet).replace(this.cssText); - } - return this.#stylesheet; - } -} diff --git a/examples/deno-router/src/styling/attachCSSProperties.ts b/examples/deno-router/src/styling/attachCSSProperties.ts deleted file mode 100644 index dc9dce4..0000000 --- a/examples/deno-router/src/styling/attachCSSProperties.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { ReadonlyReactiveValue } from "../reactive/ReactiveValue/_ReadonlyReactiveValue.ts"; - -/** - * Synchonizes a CSS property of an element to a `ReadonlyReactiveValue`. - * - * @param element Target element - * @param property CSS property to be synchronized - * @param source A `ReadonlyReactiveValue` whose value is to be used for the CSS Property - */ -export function attachCSSProperties ( - element: HTMLElement, - styles: { - [Key: string]: ReadonlyReactiveValue, - }, -): void { - for (const [property, source] of Object.entries(styles)) { - source.bind( - value => element.style.setProperty(property, value), - { dependents: [element] }, - ); - } -} diff --git a/examples/deno-router/src/styling/css.ts b/examples/deno-router/src/styling/css.ts deleted file mode 100644 index 5bd9975..0000000 --- a/examples/deno-router/src/styling/css.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { isReactive } from "../typeChecks/isReactive.ts"; -import { CSSTemplate } from "./CSSTemplate.ts"; -import { composeTemplateString } from "../utils/composeTemplateString.ts"; - -export function css ( - strings: TemplateStringsArray, - ...props: Array -): CSSTemplate { - if (props.some(v => isReactive(v))) { - throw new TypeError("CSS templates are not reactive. Instead, use `attachCSSProperties()` to synchronize your CSS with your application state."); - } - - return new CSSTemplate(composeTemplateString(strings, props)); -} diff --git a/examples/deno-router/src/styling/supportsAdoptedStyleSheets.ts b/examples/deno-router/src/styling/supportsAdoptedStyleSheets.ts deleted file mode 100644 index c415ea4..0000000 --- a/examples/deno-router/src/styling/supportsAdoptedStyleSheets.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const supportsAdoptedStyleSheets = ( - "adoptedStyleSheets" in Document.prototype && - "replace" in CSSStyleSheet.prototype -); diff --git a/examples/deno-router/src/typeChecks/isElement.ts b/examples/deno-router/src/typeChecks/isElement.ts deleted file mode 100644 index b17559d..0000000 --- a/examples/deno-router/src/typeChecks/isElement.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Checks if a given node is a DOM HTMLElement. - * @param input The item to be checked - */ -export function isElement ( - input: Node, -): input is HTMLElement { - return input.nodeType === Node.ELEMENT_NODE; -} diff --git a/examples/deno-router/src/typeChecks/isObject.ts b/examples/deno-router/src/typeChecks/isObject.ts deleted file mode 100644 index 0aaa6c8..0000000 --- a/examples/deno-router/src/typeChecks/isObject.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Checks if input is a non-function Object. - * - * @param input The item to be checked - */ -export function isObject ( - input: unknown, -): input is Record & {constructor: {name: string}} { - return !!input && typeof input === "object"; -} diff --git a/examples/deno-router/src/typeChecks/isPrimitive.ts b/examples/deno-router/src/typeChecks/isPrimitive.ts deleted file mode 100644 index 8dd6e68..0000000 --- a/examples/deno-router/src/typeChecks/isPrimitive.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { TPrimitive } from "../reactive/types/TPrimitive.ts"; - -/** - * Checks if a given value is one of the primitive types in JavaScript. - * @param input The value to be checked - */ -export function isPrimitive ( - input: unknown, -): input is TPrimitive { - return ![ - "object", - "function", - ].includes(typeof input) || input === null; -} diff --git a/examples/deno-router/src/typeChecks/isReactive.ts b/examples/deno-router/src/typeChecks/isReactive.ts deleted file mode 100644 index 3b4024d..0000000 --- a/examples/deno-router/src/typeChecks/isReactive.ts +++ /dev/null @@ -1,23 +0,0 @@ - -import { ReadonlyReactiveValue } from "../reactive/ReactiveValue/_ReadonlyReactiveValue.ts"; -import { ReadonlyReactiveArray } from "../reactive/ReactiveArray/_ReadonlyReactiveArray.ts"; -import { reactivePropertiesFlag } from "../reactive/reactiveProperties/reactivePropertiesFlag.ts"; -import type { TReactive } from "../reactive/types/TReactive.ts"; - -/** - * Checks if a given value is a reactive entity; I.E. an instance of `ReadonlyReactiveValue` or `ReadonlyReactiveArray`, or an object returned by `reactiveProperties()` which is flagged by the `reactivePropertiesFlag` symbol. - * - * @param input The value to be checked - */ -export function isReactive ( - input: unknown, -): input is TReactive { - return [ - ReadonlyReactiveArray, - ReadonlyReactiveValue, - ].some(constr => input instanceof constr) || ( - !!input && - typeof input === "object" && - reactivePropertiesFlag in input! - ); -} diff --git a/examples/deno-router/src/typeChecks/isRenderable.ts b/examples/deno-router/src/typeChecks/isRenderable.ts deleted file mode 100644 index 164db54..0000000 --- a/examples/deno-router/src/typeChecks/isRenderable.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Renderable } from "../parsing/Renderable.ts"; - -export function isRenderable ( - input: unknown, -): input is Renderable { - return ( - Boolean(input) - && input instanceof Renderable - ); -} diff --git a/examples/deno-router/src/typeChecks/isTextNode.ts b/examples/deno-router/src/typeChecks/isTextNode.ts deleted file mode 100644 index 043fb90..0000000 --- a/examples/deno-router/src/typeChecks/isTextNode.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Checks if a given Node is a DOM Text node. - * @param input The item to be checked - */ -export function isTextNode ( - input: Node, -): input is Text { - return input.nodeType === Node.TEXT_NODE; -} diff --git a/examples/deno-router/src/utils/IterableWeakMap.ts b/examples/deno-router/src/utils/IterableWeakMap.ts deleted file mode 100644 index 74ce6f9..0000000 --- a/examples/deno-router/src/utils/IterableWeakMap.ts +++ /dev/null @@ -1,159 +0,0 @@ -// deno-lint-ignore ban-types People can pass literally anything into ReactiveArray -type TEmplaceOptions = { - insert: (key: K, map: IterableWeakMap) => V, - update: (oldValue: V, key: K, map: IterableWeakMap) => V, -}; - -export class IterableWeakMap< - // deno-lint-ignore ban-types - K extends object = object, - V = unknown, -> { - static #cleanup = ( - { set, ref }: { - // deno-lint-ignore ban-types - set: Set>, - // deno-lint-ignore ban-types - ref: WeakRef, - }, - ): void => { - set.delete(ref); - }; - - #weakMap = new WeakMap }>(); - #refSet = new Set>(); - #finalizationGroup = new FinalizationRegistry(IterableWeakMap.#cleanup); - - constructor ( - iterable: Iterable<[K, V]> = [], - ) { - for (const [key, value] of iterable) { - this.set(key, value); - } - } - - set ( - key: K, - value: V, - ): void { - const currentValue = this.#weakMap.get(key); - if (currentValue) { - currentValue.value = value; - return; - } - const ref = new WeakRef(key); - this.#weakMap.set(key, { value, ref }); - this.#refSet.add(ref); - this.#finalizationGroup.register( - key, - { - set: this.#refSet, - ref, - }, - ref, - ); - } - - get ( - key: K, - ): V | undefined { - return this.#weakMap.get(key)?.value; - } - - delete ( - key: K, - ): boolean { - const entry = this.#weakMap.get(key); - if (!entry) return false; - this.#weakMap.delete(key); - this.#refSet.delete(entry.ref); - this.#finalizationGroup.unregister(entry.ref); - return true; - } - - has ( - key: K, - ): boolean { - return this.#weakMap.has(key); - } - - forEach ( - cb: (value: V, key: K, map: this) => void, - ): void { - for (const [key, value] of this) { - cb(value, key, this); - } - } - - clear (): void { - for (const key of this.keys()) { - this.delete(key); - } - } - - emplace ( - key: K, - options: Pick, "insert"> | TEmplaceOptions, - ): V; - emplace ( - key: K, - options: Pick, "update">, - ): V | undefined; - emplace ( - key: K, - options: Partial>, - ): V | undefined { - const heldValue = this.#weakMap.get(key); - if (!heldValue && options.insert) { - const newValue = options.insert(key, this); - this.set(key, newValue); - return newValue; - } else if (heldValue && options.update) { - const newValue = options.update(heldValue.value, key, this); - this.set(key, newValue); - return newValue; - } else { - return heldValue?.value; - } - } - - get size (): number { - let size = 0; - for (const ref of this.#refSet) { - if (ref.deref()) size++; - } - return size; - } - - [Symbol.hasInstance] ( - instance: unknown, - ): boolean { - return instance instanceof IterableWeakMap || instance instanceof WeakMap; - } - - *[Symbol.iterator] (): Generator<[K, V], void> { - for (const key of this.keys()) { - const { value } = this.#weakMap.get(key)!; - yield [key, value]; - } - } - - entries (): Generator<[K, V], void> { - return this[Symbol.iterator](); - } - - *keys (): Generator { - for (const ref of this.#refSet) { - const key = ref.deref(); - if (!key) console.log("key", key); - if (!key) continue; - yield key; - } - } - - *values (): Generator { - for (const [, value] of this) { - yield value; - } - } -} diff --git a/examples/deno-router/src/utils/NotImplementedError.ts b/examples/deno-router/src/utils/NotImplementedError.ts deleted file mode 100644 index 9130f25..0000000 --- a/examples/deno-router/src/utils/NotImplementedError.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * An error that is thrown for features that are intended to be implemented, but are not implemented yet. - */ -export class NotImplementedError extends Error { - override name = "NotImplementedError"; -} diff --git a/examples/deno-router/src/utils/WeakMultiRef.ts b/examples/deno-router/src/utils/WeakMultiRef.ts deleted file mode 100644 index 12e355b..0000000 --- a/examples/deno-router/src/utils/WeakMultiRef.ts +++ /dev/null @@ -1,43 +0,0 @@ -const refs = new Set(); - -export class WeakMultiRef { - static #cleanup = ( - { set, ref, target }: { - // deno-lint-ignore ban-types - set: Set>, - // deno-lint-ignore ban-types - ref: WeakRef, - target: WeakMultiRef, - }, - ): void => { - set.delete(ref); - if (!set.size) { - refs.delete(target); - } - }; - - // deno-lint-ignore ban-types People can pass literally anything into ReactiveArray - weakKeys = new Set>(); - #finalizationGroup = new FinalizationRegistry(WeakMultiRef.#cleanup); - - constructor ( - // deno-lint-ignore ban-types People can pass literally anything into ReactiveArray - keys: ReadonlyArray, - ) { - keys.forEach(key => { - const ref = new WeakRef(key); - this.weakKeys.add(ref); - this.#finalizationGroup.register( - key, - { - set: this.weakKeys, - ref, - target: this, - }, - ref, - ); - }); - - refs.add(this); - } -} diff --git a/examples/deno-router/src/utils/arrayWrap.ts b/examples/deno-router/src/utils/arrayWrap.ts deleted file mode 100644 index 673ca06..0000000 --- a/examples/deno-router/src/utils/arrayWrap.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type TArrayWrap = T extends ReadonlyArray ? T : [T]; - -export function arrayWrap ( - input: T -): TArrayWrap { - return (Array.isArray(input) ? input : [input]) as TArrayWrap; -} diff --git a/examples/deno-router/src/utils/composeTemplateString.ts b/examples/deno-router/src/utils/composeTemplateString.ts deleted file mode 100644 index 3cb3b27..0000000 --- a/examples/deno-router/src/utils/composeTemplateString.ts +++ /dev/null @@ -1,8 +0,0 @@ -export function composeTemplateString ( - strings: TemplateStringsArray, - props: ReadonlyArray, -): string { - return strings.reduce( - (result, string, i) => `${result}${String(props[i - 1])}${string}`, - ); -} diff --git a/examples/deno-router/src/utils/concatIterators.ts b/examples/deno-router/src/utils/concatIterators.ts deleted file mode 100644 index f6fd620..0000000 --- a/examples/deno-router/src/utils/concatIterators.ts +++ /dev/null @@ -1,7 +0,0 @@ -export function* concatIterators ( - ...iterators: ReadonlyArray> -): Generator { - for (const iterator of iterators) { - yield* iterator; - } -} diff --git a/examples/deno-router/src/utils/describeType.ts b/examples/deno-router/src/utils/describeType.ts deleted file mode 100644 index d81ac79..0000000 --- a/examples/deno-router/src/utils/describeType.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { safeStringifyObject } from "./safeStringifyObject.ts"; - -export function describeType ( - input: unknown, -): string { - if (input === null || input === undefined) { - return `[${String(input)}]`; - } else if (typeof input === "object") { - return safeStringifyObject(input!); - } else { - return `[${typeof input} ${String(input)}]`; - } -} diff --git a/examples/deno-router/src/utils/id.ts b/examples/deno-router/src/utils/id.ts deleted file mode 100644 index 4179d31..0000000 --- a/examples/deno-router/src/utils/id.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { pseudoRandomEncode } from "./pseudoRandomEncode.ts"; - -/** - * Generates up to 2**20 (~1M) IDs that are unique across the session. - */ -export function* pseudoRandomIdGenerator (): Generator { - const idEncoder = pseudoRandomEncode(2n ** 20n, 387_420_489n); - let i = 0n; - while (true) { - // Intentionally skip the first one because 0n converts to "0" - yield idEncoder(++i).toString(36); - } -} diff --git a/examples/deno-router/src/utils/mapConcat.ts b/examples/deno-router/src/utils/mapConcat.ts deleted file mode 100644 index bb76d63..0000000 --- a/examples/deno-router/src/utils/mapConcat.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-types */ - -export function concat ( - mapTarget: Map, - mapSource: Map, -): Map { - for (const [key, value] of mapSource) { - mapTarget.set(key, value); - } - - return mapTarget; -} \ No newline at end of file diff --git a/examples/deno-router/src/utils/mapEmplace.ts b/examples/deno-router/src/utils/mapEmplace.ts deleted file mode 100644 index ed33ad0..0000000 --- a/examples/deno-router/src/utils/mapEmplace.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-types */ - -type TEmplaceOptions = { - insert: (key: K, map: Map | WeakMap) => V, - update: (oldValue: V, key: K, map: Map | WeakMap) => V, -}; - -export function emplace ( - map: Map, - key: K, - options: Pick, "insert"> | TEmplaceOptions, -): V; -export function emplace ( - map: WeakMap, - key: K, - options: Pick, "insert"> | TEmplaceOptions, -): V; -export function emplace ( - map: Map, - key: K, - options: Pick, "update">, -): V | undefined; -export function emplace ( - map: WeakMap, - key: K, - options: Pick, "update">, -): V | undefined; -export function emplace ( - map: Map | WeakMap, - key: K, - options: Partial>, -): V | undefined { - const heldValue = map.get(key as K & object); - if (!heldValue && options.insert) { - const newValue = options.insert(key, map); - map.set(key as K & object, newValue); - return newValue; - } else if (heldValue && options.update) { - const newValue = options.update(heldValue, key, map); - map.set(key as K & object, newValue); - return newValue; - } else { - return heldValue; - } -} diff --git a/examples/deno-router/src/utils/pascalToKebab.ts b/examples/deno-router/src/utils/pascalToKebab.ts deleted file mode 100644 index 68e423d..0000000 --- a/examples/deno-router/src/utils/pascalToKebab.ts +++ /dev/null @@ -1,8 +0,0 @@ -export function pascalToKebab ( - input: string, -): string { - return `${input[0] ?? ""}${input.slice(1).replace( - /([A-Z])/g, - "-$1", - )}`.toLowerCase(); -} diff --git a/examples/deno-router/src/utils/pseudoRandomEncode.ts b/examples/deno-router/src/utils/pseudoRandomEncode.ts deleted file mode 100644 index 5c95571..0000000 --- a/examples/deno-router/src/utils/pseudoRandomEncode.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Makes sequential numbers appear random. - * @param count Maximum number of items - * @param coprime A coperime of count which is also greater than count - */ -export function pseudoRandomEncode (count: bigint, coprime: bigint): (seed: bigint) => bigint { - return (seed: bigint): bigint => seed * coprime % count -} \ No newline at end of file diff --git a/examples/deno-router/src/utils/safeStringifyObject.ts b/examples/deno-router/src/utils/safeStringifyObject.ts deleted file mode 100644 index 29d7016..0000000 --- a/examples/deno-router/src/utils/safeStringifyObject.ts +++ /dev/null @@ -1,14 +0,0 @@ -export function safeStringifyObject ( - input: unknown & { constructor: { name: string } }, -): string { - try { - const string = String(input); - if (string.startsWith("[")) { - return string; - } else { - return `[object ${input.constructor.name} (${string})]`; - } - } catch { - return "[unstringifiable object]"; - } -} diff --git a/examples/deno-router/src/utils/throwExpression.ts b/examples/deno-router/src/utils/throwExpression.ts deleted file mode 100644 index bccd21b..0000000 --- a/examples/deno-router/src/utils/throwExpression.ts +++ /dev/null @@ -1,6 +0,0 @@ -export function throwExpression ( - message: string, - ErrorType = Error, -): never { - throw new ErrorType(message); -} diff --git a/examples/deno-router/src/utils/toNumber.ts b/examples/deno-router/src/utils/toNumber.ts deleted file mode 100644 index 43cc6ff..0000000 --- a/examples/deno-router/src/utils/toNumber.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Makes an attempt to convert any value to a `number`. Returns `NaN` if conversion fails. - * @param value Value to be converted to a number - */ -export function toNumber ( - value: unknown, -): number { - try { - return Number(value); - } catch { // Number(Symbol()) throws, but we just want to know if it can be converted to a number - return NaN; - } -} diff --git a/examples/deno/compile.ts b/examples/deno/compile.ts deleted file mode 100644 index cce5a20..0000000 --- a/examples/deno/compile.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This approach would be different given our component imports from a url. - * The user would use crumpets to transpile the files - */ - -const { diagnostics, files } = await Deno.emit("./components/App.ts", { - bundle: "classic", - compilerOptions: { - "target": "es2020", - "module": "esnext", - "lib": ["dom", "DOM.Iterable", "ESNext"], - "sourceMap": false - }, -}) -const fd = await Deno.formatDiagnostics(diagnostics) -console.log(fd) -const fileKey = Object.keys(files)[0] -const content = files[fileKey] -const encoder = new TextEncoder() -Deno.writeFileSync("./components/app.js", encoder.encode(content)) diff --git a/examples/deno/components/App.ts b/examples/deno/components/App.ts deleted file mode 100644 index 9f4235b..0000000 --- a/examples/deno/components/App.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Component, css, html } from "../../../src/mod.ts"; - -class CustomP extends Component<{ - customText: string -}> { - static override styles = css` - p { - color: red; - } - ` - template = html`

${this.customText}

` -} -class AppRoot extends Component { - override template = html` -
- <${CustomP} prop:customText=${"hello"}> -
- `; -} - -customElements.define("app-root", AppRoot) \ No newline at end of file diff --git a/examples/deno/index.html b/examples/deno/index.html deleted file mode 100644 index cc44550..0000000 --- a/examples/deno/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/examples/deno/transpile.ts b/examples/deno/transpile.ts deleted file mode 100644 index 70de270..0000000 --- a/examples/deno/transpile.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This approach would be different given our component imports from a url. - * The user would use crumpets to transpile the files - */ - -const { diagnostics, files } = await Deno.emit("./components/App.ts", { - compilerOptions: { - "target": "es2020", - "module": "esnext", - "lib": ["dom", "DOM.Iterable", "ESNext"], - "sourceMap": false - }, -}) -const fd = await Deno.formatDiagnostics(diagnostics) -console.log(fd) -const key = Object.keys(files).find(f => f.includes("App.ts")) as string -files[key] = files[key].replace("deps.ts", "deps.js") -const key2 = Object.keys(files).find(f => f.includes("deps.ts")) as string -files[key2] = files[key2].replace("src/mod.ts", "dist/mod.js") -Deno.writeFileSync("./components/app.js", new TextEncoder().encode(files[key])) -Deno.writeFileSync("./components/deps.js", new TextEncoder().encode(files[key2])) \ No newline at end of file diff --git a/examples/deno/tsconfig.json b/examples/deno/tsconfig.json deleted file mode 100644 index 2611c30..0000000 --- a/examples/deno/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "lib": [ - "dom", - "DOM.Iterable", - "esnext", - ], - } -} \ No newline at end of file diff --git a/examples/node/components/App.ts b/examples/node/components/App.ts deleted file mode 100644 index 9a80859..0000000 --- a/examples/node/components/App.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Component, css, html } from "../../../dist/mod.js"; - -class CustomP extends Component<{ - customText: string -}> { - static override styles = css` - p { - color: red; - } - ` - - template = html`

${this.customText}

` -} - -class AppRoot extends Component { - - override template = html` -
- <${CustomP} prop:customText=${"hello"}> -
- `; -} - -customElements.define("app-root", AppRoot) \ No newline at end of file diff --git a/examples/node/index.html b/examples/node/index.html deleted file mode 100644 index 5f28f21..0000000 --- a/examples/node/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/examples/node/package.json b/examples/node/package.json deleted file mode 100644 index cd22aff..0000000 --- a/examples/node/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "usage", - "version": "1.0.0", - "description": "", - "main": "webpack.config.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC", - "devDependencies": { - "css-loader": "^5.2.6", - "style-loader": "^3.0.0", - "ts-loader": "^9.2.3", - "typescript": "^4.3.4", - "webpack": "^5.41.1", - "webpack-cli": "^4.7.2" - } -} diff --git a/examples/node/tsconfig.json b/examples/node/tsconfig.json deleted file mode 100644 index 3fbc6c9..0000000 --- a/examples/node/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "compilerOptions": { - "target": "es2020", - "module": "esnext", - "lib": ["dom", "DOM.Iterable", "ESNext"], - }, - "include": [ - "components/App.ts" - ] - } \ No newline at end of file diff --git a/examples/node/webpack.config.js b/examples/node/webpack.config.js deleted file mode 100644 index db65560..0000000 --- a/examples/node/webpack.config.js +++ /dev/null @@ -1,25 +0,0 @@ -module.exports = { - entry: { - app: "./components/App.ts", - }, - /* So having this makes it work, but if we remove this, bundle, then start server, we get error in console, this is because Webpack is minifying the class and it's trying to name the custom element after the class name*/ - // optimization: { - // minimize: false - // }, - output: { - filename: "[name].js", - path: __dirname + "/public/javascripts/", - }, - module: { - rules: [ - { - test: /\.ts?$/, - use: "ts-loader", - exclude: /node_modules/, - }, - ], - }, - resolve: { - extensions: [".ts"], - }, -}; \ No newline at end of file From c034870417b358a4c9af8084ae95c352bed636fd Mon Sep 17 00:00:00 2001 From: Edward Bebbington Date: Fri, 13 May 2022 22:02:11 +0100 Subject: [PATCH 36/38] fmt --- README.md | 130 +++++-- compile.ts | 5 +- deps.ts | 2 +- src/_examples/components/app-root.ts | 2 +- src/_examples/components/array-demo.ts | 22 +- src/_examples/components/async-demo.ts | 1 - src/_examples/components/hash-router.ts | 22 +- src/_examples/components/inputStyles.ts | 2 +- src/_examples/components/tab-view.ts | 29 +- src/_examples/components/time-diff.ts | 29 +- src/_examples/components/to-do/_to-do.ts | 54 +-- src/_examples/components/to-do/animations.ts | 16 +- src/_examples/components/to-do/task-item.ts | 27 +- src/_examples/components/visitor-demo.ts | 2 +- .../components/window-manager/TWindow.ts | 16 +- .../window-manager/_window-manager.ts | 48 +-- .../components/window-manager/window.ts | 10 +- src/componentLogic/Component.ts | 40 ++- src/componentLogic/DestinyFallback.ts | 23 +- src/componentLogic/Ref.ts | 28 +- .../componentOrComponentModule.ts | 14 +- src/componentLogic/elementData.ts | 2 +- src/componentLogic/isComponent.ts | 2 +- src/componentLogic/register.ts | 14 +- src/examples_mod.ts | 16 +- src/mod.ts | 42 +-- src/parsing/Renderable.ts | 2 +- src/parsing/Slot.ts | 38 +- src/parsing/SlotArray.ts | 15 +- src/parsing/TUnpreparedContentSlot.ts | 10 +- src/parsing/TemplateCache.ts | 2 +- src/parsing/TemplateResult.ts | 4 +- src/parsing/_xml.ts | 4 +- src/parsing/createTemplate.ts | 7 +- src/parsing/getXmlErrorMessage.ts | 8 +- src/parsing/hookSlotsUp/_hookSlotsUp.ts | 13 +- .../_hookAttributeSlotsUp.ts | 10 +- .../assignElementData/_assignElementData.ts | 26 +- .../assignElementData/attribute.ts | 8 +- .../assignElementData/destiny.ts | 23 +- .../assignElementData/destinyData.ts | 12 +- .../assignElementData/destinyMount.ts | 15 +- .../assignElementData/destinyProps.ts | 26 +- .../assignElementData/destinyRef.ts | 16 +- .../assignElementData/destinyUnmount.ts | 10 +- .../assignElementData/on.ts | 6 +- .../assignElementData/prop.ts | 4 +- .../hookAttributeSlotsUp/doOrBind.ts | 10 +- .../elementData/ElementData.ts | 10 +- .../elementData/TElementData.ts | 2 +- .../elementData/isValidNamespace.ts | 4 +- .../matchChangeWatcher.ts | 2 +- .../parseAttributeName.ts | 4 +- .../resolveSlotPropIndex.ts | 6 +- .../hookContentSlotsUp/_hookContentSlotsUp.ts | 6 +- .../toFragment/arrayToFragment.ts | 8 +- .../toFragment/nodeToFragment.ts | 4 +- .../toFragment/valueToFragment.ts | 2 +- src/parsing/hookSlotsUp/stringifyValue.ts | 8 +- src/parsing/parseAsNewDocument.ts | 2 +- src/parsing/parseInSafari.ts | 12 +- src/parsing/parseString.ts | 21 +- src/parsing/prepareContentSlots.ts | 6 +- src/parsing/resolveSlots.ts | 6 +- src/reactive/ReactiveArray/TArrayValueType.ts | 5 +- src/reactive/ReactiveArray/TMaskEntry.ts | 4 +- .../ReactiveArray/TUnwrapReactiveArray.ts | 5 +- src/reactive/ReactiveArray/_ReactiveArray.ts | 97 ++--- .../ReactiveArray/_ReadonlyReactiveArray.ts | 336 ++++++++++-------- src/reactive/ReactiveArray/flatten.ts | 20 +- src/reactive/ReactiveArray/internalArrays.ts | 4 +- .../makeNonPrimitiveItemsReactive.ts | 8 +- src/reactive/ReactiveArray/splicers.ts | 2 +- .../ReactiveArray/updateFilteredArray.ts | 11 +- .../ReactiveValue/PassReactiveValue.ts | 2 +- .../TReactiveValueUpdaterOptions.ts | 4 +- src/reactive/ReactiveValue/_ReactiveValue.ts | 18 +- .../ReactiveValue/_ReadonlyReactiveValue.ts | 83 +++-- .../ReactiveValue/internalSetReactiveValue.ts | 4 +- src/reactive/classNames.ts | 26 +- src/reactive/computed.ts | 18 +- src/reactive/reactive.ts | 30 +- .../TReactivePropertiesFlag.ts | 2 +- .../reactiveProperties/_reactiveProperties.ts | 20 +- .../reactiveProperties/specialCaseObjects.ts | 8 +- src/reactive/types/TReactiveValueType.ts | 14 +- src/styling/CSSTemplate.ts | 10 +- src/styling/attachCSSProperties.ts | 8 +- src/styling/css.ts | 8 +- src/typeChecks/isElement.ts | 2 +- src/typeChecks/isObject.ts | 6 +- src/typeChecks/isPrimitive.ts | 2 +- src/typeChecks/isReactive.ts | 7 +- src/typeChecks/isRenderable.ts | 6 +- src/typeChecks/isTextNode.ts | 2 +- src/utils/IterableWeakMap.ts | 42 +-- src/utils/WeakMultiRef.ts | 12 +- src/utils/arrayWrap.ts | 4 +- src/utils/composeTemplateString.ts | 2 +- src/utils/concatIterators.ts | 2 +- src/utils/describeType.ts | 2 +- src/utils/id.ts | 2 +- src/utils/mapConcat.ts | 4 +- src/utils/mapEmplace.ts | 14 +- src/utils/pascalToKebab.ts | 12 +- src/utils/pseudoRandomEncode.ts | 9 +- src/utils/safeStringifyObject.ts | 2 +- src/utils/throwExpression.ts | 2 +- src/utils/toNumber.ts | 2 +- tsconfig.json | 52 +-- 110 files changed, 1056 insertions(+), 849 deletions(-) diff --git a/README.md b/README.md index 0232b52..dac036f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,9 @@ [![Chromium 82.0+](https://img.shields.io/badge/Chromium-82.0+-brightgreen?logo=google%20chrome&logoColor=white)](https://www.chromium.org/) [![Safari 14.1+](https://img.shields.io/badge/Safari-14.1+-brightgreen?logo=safari&logoColor=white)](https://www.apple.com/safari/) -An experimental reactive UI library for JavaScript and TypeScript. Uses standard JS/TS syntax; no compiling required. Built on top of the native Web Components API and uses the native HTML parser for the templates. No vDOM. +An experimental reactive UI library for JavaScript and TypeScript. Uses standard +JS/TS syntax; no compiling required. Built on top of the native Web Components +API and uses the native HTML parser for the templates. No vDOM. ## Goals @@ -21,70 +23,123 @@ An experimental reactive UI library for JavaScript and TypeScript. Uses standard ## Disclaimer -❗ _This is an experimental library. There **will** be breaking changes. Some parts are still heavily under construction or missing entirely. Use at your own risk._ +❗ _This is an experimental library. There **will** be breaking changes. Some +parts are still heavily under construction or missing entirely. Use at your own +risk._ ## How to run 1. install node 2. run `npm i` in root 3. run `npm run compile` in root -4. start a dev server (ex: `npx http-server .`) and open `/index.html` to view demo - -To get syntax-highlighting for HTML templates, you can use an extension called [`tobermory.es6-string-html`](https://marketplace.visualstudio.com/items?itemName=Tobermory.es6-string-html) on VSCode. Similar plugins are available for other editors too. Any extension that makes the editor treat template literals' tags as that block's file extension (ex. ``html`…`;`` is treated as an .html snippet) should also work. This only gives you syntax highlighting, though: slots are unfortunately not type checked; that would require a dedicated extension for this library, which does not yet exist. +4. start a dev server (ex: `npx http-server .`) and open `/index.html` to view + demo + +To get syntax-highlighting for HTML templates, you can use an extension called +[`tobermory.es6-string-html`](https://marketplace.visualstudio.com/items?itemName=Tobermory.es6-string-html) +on VSCode. Similar plugins are available for other editors too. Any extension +that makes the editor treat template literals' tags as that block's file +extension (ex. ``html`…`;`` is treated as an .html snippet) should also work. +This only gives you syntax highlighting, though: slots are unfortunately not +type checked; that would require a dedicated extension for this library, which +does not yet exist. ## Examples [Live demo (with source maps)](https://destiny.okku.dev/) -You can convert anything to be reactive using the `reactive()` function. Their unboxed value can be accessed via the `value` property. Setting `value` will cause the reactive item to dispatch events to all its listeners and dependents. - -The `html` template tag will parse the content as XHTML and returns a `TemplateResult` object containing a `DocumentFragment`. Any reactive items given to it via `${}` slots are bound both ways. This means that when the value of the reactive element is changed later, the relevant part of the DOM is automatically updated. If a reactive item is bound to something that may change from user input, the value of the reactive item will be automatically updated accordingly as user input comes in. - -In the below example, two reactive items `who` and `count` are defined. `who` is set as the value of an input element: the value of `who` is updated whenever the text field in question receives input. `who` is also rendered as text below, so as the user types, the text below will update in real time. `count` on the other hand is just a number which is incremented once a second; the seconds counter is automatically rerendered every time the count changes. +You can convert anything to be reactive using the `reactive()` function. Their +unboxed value can be accessed via the `value` property. Setting `value` will +cause the reactive item to dispatch events to all its listeners and dependents. + +The `html` template tag will parse the content as XHTML and returns a +`TemplateResult` object containing a `DocumentFragment`. Any reactive items +given to it via `${}` slots are bound both ways. This means that when the value +of the reactive element is changed later, the relevant part of the DOM is +automatically updated. If a reactive item is bound to something that may change +from user input, the value of the reactive item will be automatically updated +accordingly as user input comes in. + +In the below example, two reactive items `who` and `count` are defined. `who` is +set as the value of an input element: the value of `who` is updated whenever the +text field in question receives input. `who` is also rendered as text below, so +as the user types, the text below will update in real time. `count` on the other +hand is just a number which is incremented once a second; the seconds counter is +automatically rerendered every time the count changes. ```js -import { Component, html, reactive, register } from "https://code.okku.dev/destiny-ui/v0.7.0/dist/mod.js"; - -register(class ExampleComponent extends Component { - who = reactive("visitor"); - count = reactive(0); - timer = setInterval(() => { - this.count.value++; - }, 1e3); - - disconnectedCallback () { - clearInterval(this.timer); - } - - template = html` +import { + Component, + html, + reactive, + register, +} from "https://code.okku.dev/destiny-ui/v0.7.0/dist/mod.js"; + +register( + class ExampleComponent extends Component { + who = reactive("visitor"); + count = reactive(0); + timer = setInterval(() => { + this.count.value++; + }, 1e3); + + disconnectedCallback() { + clearInterval(this.timer); + } + + template = html`

Hello, ${this.who}! You arrived ${this.count} seconds ago.

`; -}); + }, +); ``` [👉 View on codepen.io](https://codepen.io/okku/pen/MWKXMVK?editors=1010) -The library figures out what the appropriate DOM operation for each slot is from the location of the slots and binds those as callbacks to each reactive item it receives. Non-reactive slots are not bound; they are simply stringified and inserted in. There is no vDOM and no diffing or reconciliation. When a reactive item is updated, the changes will automatically propagate correctly to each dependent reactive item in the chain. This means that performance of updates scales with the complexity of the update (how many things need to be rerendered because of the update) instead of the total complexity of the application (like you would have with vDOM based solutions). Parsed HTML templates are cached in a WeakMap, so rendering multiple elements with the same template is quick after the first render. - -You can also make arrays reactive. ReactiveArrays will behave generally akin to normal arrays, except that they will give you reactive properties instead of normal ones. You can manipulate the array like you would normal arrays and the DOM and other dependents will update with it; forget immutability! Here's an example of using a reactive array: +The library figures out what the appropriate DOM operation for each slot is from +the location of the slots and binds those as callbacks to each reactive item it +receives. Non-reactive slots are not bound; they are simply stringified and +inserted in. There is no vDOM and no diffing or reconciliation. When a reactive +item is updated, the changes will automatically propagate correctly to each +dependent reactive item in the chain. This means that performance of updates +scales with the complexity of the update (how many things need to be rerendered +because of the update) instead of the total complexity of the application (like +you would have with vDOM based solutions). Parsed HTML templates are cached in a +WeakMap, so rendering multiple elements with the same template is quick after +the first render. + +You can also make arrays reactive. ReactiveArrays will behave generally akin to +normal arrays, except that they will give you reactive properties instead of +normal ones. You can manipulate the array like you would normal arrays and the +DOM and other dependents will update with it; forget immutability! Here's an +example of using a reactive array: ```js -import { html, reactive } from "https://code.okku.dev/destiny-ui/v0.7.0/dist/mod.js"; +import { + html, + reactive, +} from "https://code.okku.dev/destiny-ui/v0.7.0/dist/mod.js"; const thingsILike = reactive(["cats", "JavaScript", "sleep"]); -document.body.append(html` +document.body.append( + html`

Things I like

    - ${thingsILike.map(value => html` + ${ + thingsILike.map((value) => + html`
  • ${value}
  • - `)} + ` + ) + }
-`.content); +`.content, +); // later update the list: setTimeout(() => { @@ -101,8 +156,11 @@ See [the wiki](https://github.com/0kku/destiny/wiki) for documentation. ## Supported platforms -Current versions target newest stable release of SpiderMonkey (Firefox), V8 (Chromium), and JavaScriptCore (Safari). +Current versions target newest stable release of SpiderMonkey (Firefox), V8 +(Chromium), and JavaScriptCore (Safari). -Versions ≥1.0 will target the latest two releases of Firefox and Chromium, and the latest release of Safari. +Versions ≥1.0 will target the latest two releases of Firefox and Chromium, and +the latest release of Safari. -Chakra (Internet Explorer & old Edge) will not be supported. Ever. New Edge uses V8, so it's supported. +Chakra (Internet Explorer & old Edge) will not be supported. Ever. New Edge uses +V8, so it's supported. diff --git a/compile.ts b/compile.ts index 4ce31bb..a65d951 100644 --- a/compile.ts +++ b/compile.ts @@ -1,7 +1,8 @@ // transpile.ts import { Crumpets } from "./deps.ts"; -const compilerOptions = (JSON.parse(Deno.readTextFileSync("./tsconfig.json"))).compilerOptions +const compilerOptions = + (JSON.parse(Deno.readTextFileSync("./tsconfig.json"))).compilerOptions; async function compile( rootFile: string, @@ -24,7 +25,7 @@ async function watch() { directoryToWatch: "./src", compilerOptions, }); - await crumpets.watch() + await crumpets.watch(); } await Promise.all([ diff --git a/deps.ts b/deps.ts index 88885da..ec5564f 100644 --- a/deps.ts +++ b/deps.ts @@ -1 +1 @@ -export { Crumpets } from "https://deno.land/x/crumpets@v2.1.4/mod.ts"; +export { Crumpets } from "https://deno.land/x/crumpets@v2.1.4/mod.ts"; diff --git a/src/_examples/components/app-root.ts b/src/_examples/components/app-root.ts index b55d5b7..7970a45 100644 --- a/src/_examples/components/app-root.ts +++ b/src/_examples/components/app-root.ts @@ -1,4 +1,4 @@ -import { Component, html, css } from "../../mod.ts"; +import { Component, css, html } from "../../mod.ts"; import TabView from "./tab-view.ts"; diff --git a/src/_examples/components/array-demo.ts b/src/_examples/components/array-demo.ts index 7b7f6ec..d86fcbc 100644 --- a/src/_examples/components/array-demo.ts +++ b/src/_examples/components/array-demo.ts @@ -1,15 +1,15 @@ -import { Component, reactive, html, css, computed } from "../../mod.ts"; +import { Component, computed, css, html, reactive } from "../../mod.ts"; const randomColor = () => ( - "#" + + "#" + Math - .floor(Math.random() * 2**24) - .toString(16) - .padStart(6, "0") + .floor(Math.random() * 2 ** 24) + .toString(16) + .padStart(6, "0") ); export default class ArrayDemo extends Component { - #items = reactive(Array.from({length: 256}, randomColor)); + #items = reactive(Array.from({ length: 256 }, randomColor)); frame = (): void => { const randomIndex = Math.floor( Math.random() * this.#items.length.value, @@ -19,7 +19,7 @@ export default class ArrayDemo extends Component { }; #timer = requestAnimationFrame(this.frame); - disconnectedCallback (): void { + disconnectedCallback(): void { cancelAnimationFrame(this.#timer); } @@ -48,11 +48,15 @@ export default class ArrayDemo extends Component { override template = html`
    - ${this.#items.map((text, i) => html` + ${ + this.#items.map((text, i) => + html`
  • ${i}
  • - `)} + ` + ) + }
`; } diff --git a/src/_examples/components/async-demo.ts b/src/_examples/components/async-demo.ts index daaec68..95a7e8b 100644 --- a/src/_examples/components/async-demo.ts +++ b/src/_examples/components/async-demo.ts @@ -1,4 +1,3 @@ - import { Component, html } from "../../mod.ts"; export default class AsyncDemo extends Component { diff --git a/src/_examples/components/hash-router.ts b/src/_examples/components/hash-router.ts index 2f6abba..3d38c9a 100644 --- a/src/_examples/components/hash-router.ts +++ b/src/_examples/components/hash-router.ts @@ -1,6 +1,6 @@ -import { Component, reactive, html, computed } from "../../mod.ts"; +import { Component, computed, html, reactive } from "../../mod.ts"; -function getHashRoute ( +function getHashRoute( url: string, ) { return "/" + new URL(url).hash.replace(/^#\//u, ""); @@ -14,9 +14,9 @@ window.addEventListener("hashchange", () => { export default class HashRouter extends Component<{ routes: Array<{ - path: string, - content: string, - }>, + path: string; + content: string; + }>; }> { #error404 = html` @@ -25,17 +25,17 @@ export default class HashRouter extends Component<{ `; override template = computed(() => { - const routeInfo = this.routes.find(({path}) => path === route.value); + const routeInfo = this.routes.find(({ path }) => path === route.value); return ( routeInfo - ? html` + ? html` <${import(routeInfo.content)} prop:fallback=${html`Loading…`} - prop:catch=${(err: Error) => html` - Error loading page: ${err.message}` - } + prop:catch=${(err: Error) => + html` + Error loading page: ${err.message}`} />` - : this.#error404 + : this.#error404 ); }); } diff --git a/src/_examples/components/inputStyles.ts b/src/_examples/components/inputStyles.ts index a2dc6aa..5659db8 100644 --- a/src/_examples/components/inputStyles.ts +++ b/src/_examples/components/inputStyles.ts @@ -51,4 +51,4 @@ export const inputStyles = css` cursor: pointer; color: white; } -`; \ No newline at end of file +`; diff --git a/src/_examples/components/tab-view.ts b/src/_examples/components/tab-view.ts index 00f01c6..e362826 100644 --- a/src/_examples/components/tab-view.ts +++ b/src/_examples/components/tab-view.ts @@ -1,4 +1,4 @@ -import { Component, computed, html, css, classNames } from "../../mod.ts"; +import { classNames, Component, computed, css, html } from "../../mod.ts"; import HashRouter, { route } from "./hash-router.ts"; @@ -34,13 +34,16 @@ export default class TabView extends Component { title: "Windowing demo", content: "./window-manager/_window-manager.js", }, - ].map(tab => (tab.content = new URL(tab.content, import.meta.url).href, tab)); + ].map( + (tab) => (tab.content = new URL(tab.content, import.meta.url).href, tab), + ); - connectedCallback (): void { + connectedCallback(): void { const original = document.title; route.bind( - path => { - document.title = this.#tabs.find(v => v.path === path)?.title ?? original; + (path) => { + document.title = this.#tabs.find((v) => v.path === path)?.title ?? + original; }, { dependents: [this] }, ); @@ -83,16 +86,22 @@ export default class TabView extends Component { override template = html`
diff --git a/src/_examples/components/time-diff.ts b/src/_examples/components/time-diff.ts index c107673..62b7fb9 100644 --- a/src/_examples/components/time-diff.ts +++ b/src/_examples/components/time-diff.ts @@ -1,28 +1,28 @@ -import { Component, html, reactive, computed } from "../../mod.ts"; +import { Component, computed, html, reactive } from "../../mod.ts"; import { inputStyles } from "./inputStyles.ts"; -function formatTimeFragment ( +function formatTimeFragment( input: number, ) { return String(input).padStart(2, "0"); } -function formatTime ( +function formatTime( duration: number, ) { - const days = Math.floor(duration / 1000 / 60 / 60 / 24); - const hours = Math.floor(duration / 1000 / 60 / 60 % 24); + const days = Math.floor(duration / 1000 / 60 / 60 / 24); + const hours = Math.floor(duration / 1000 / 60 / 60 % 24); const minutes = Math.floor(duration / 1000 / 60 % 60); const seconds = Math.floor(duration / 1000 % 60); const daysString = days ? `${days}, ` : ""; const hoursString = `${hours}:`; const minutesString = formatTimeFragment(minutes); - const secondsString = seconds ? `:${formatTimeFragment(seconds)}`: ""; + const secondsString = seconds ? `:${formatTimeFragment(seconds)}` : ""; return [daysString, hoursString, minutesString, secondsString].join(""); } -function createTask () { +function createTask() { return { start: new Date(0), end: new Date(0), @@ -36,7 +36,9 @@ export default class TimeDiff extends Component { static override styles = inputStyles; override template = html` - ${this.#tasks.map(task => html` + ${ + this.#tasks.map((task) => + html`

- Duration of "${task.name}": ${computed(() => - formatTime(Number(task.end.value) - Number(task.start.value)) - )} + Duration of "${task.name}": ${ + computed(() => + formatTime(Number(task.end.value) - Number(task.start.value)) + ) + }

` - )} + ) + } this.#tasks.push(createTask())} diff --git a/src/_examples/components/to-do/_to-do.ts b/src/_examples/components/to-do/_to-do.ts index 5b8b29b..2026bb6 100644 --- a/src/_examples/components/to-do/_to-do.ts +++ b/src/_examples/components/to-do/_to-do.ts @@ -1,11 +1,11 @@ -import { Component, html, css, reactive } from "../../../mod.ts"; +import { Component, css, html, reactive } from "../../../mod.ts"; import TaskItem from "./task-item.ts"; import { animateIn, animateOut } from "./animations.ts"; import { inputStyles } from "../inputStyles.ts"; type TInputChangeEvent = InputEvent & { - currentTarget: HTMLInputElement, + currentTarget: HTMLInputElement; }; export default class Todo extends Component { @@ -52,36 +52,44 @@ export default class Todo extends Component { ]; override template = html` -

${this.#items.filter(v => v.done.value).length}/${this.#items.length} tasks compelete

+

${ + this.#items.filter((v) => v.done.value).length + }/${this.#items.length} tasks compelete

    - ${this.#items.map((item, i) => html` + ${ + this.#items.map((item, i) => + html` <${TaskItem} prop:item=${item} prop:removeItem=${() => this.#items.splice(i.value, 1)} destiny:mount=${animateIn} destiny:unmount=${animateOut} /> - `)} - ${this.#items.length.falsy(html` + ` + ) + } + ${ + this.#items.length.falsy(html`
  • No items to show
  • - `)} + `) + }
  • { - e.preventDefault(); - this.#items.push({ - title: this.#newValue.value, - done: false, - editing: false, - }); - this.#newValue.value = ""; - }} + e.preventDefault(); + this.#items.push({ + title: this.#newValue.value, + done: false, + editing: false, + }); + this.#newValue.value = ""; + }} > item.done.value)} - prop:indeterminate=${this.#items.exclusiveSome(item => item.done.value)} + prop:checked=${this.#items.every((item) => item.done.value)} + prop:indeterminate=${ + this.#items.exclusiveSome((item) => item.done.value) + } on:change=${(e: TInputChangeEvent) => { - this.#items.value.forEach(item => { - item.done.value = e.currentTarget.checked; - }); - }} + this.#items.value.forEach((item) => { + item.done.value = e.currentTarget.checked; + }); + }} /> Check all this.#items.mutFilter(v => !v.done.value)} + on:click=${() => this.#items.mutFilter((v) => !v.done.value)} /> `; } diff --git a/src/_examples/components/to-do/animations.ts b/src/_examples/components/to-do/animations.ts index 8abf982..f8e9717 100644 --- a/src/_examples/components/to-do/animations.ts +++ b/src/_examples/components/to-do/animations.ts @@ -1,24 +1,24 @@ -export function animateIn ( +export function animateIn( element: HTMLElement, ): void { element.animate( [ - {height: "0px"}, - {height: "var(--l)"}, + { height: "0px" }, + { height: "var(--l)" }, ], - {duration: 300, easing: "ease"}, + { duration: 300, easing: "ease" }, ).play(); } -export async function animateOut ( +export async function animateOut( element: HTMLElement, ): Promise { const animation = element.animate( [ - {height: "var(--l)"}, - {height: "0px"}, + { height: "var(--l)" }, + { height: "0px" }, ], - {duration: 300, easing: "ease", fill: "forwards"}, + { duration: 300, easing: "ease", fill: "forwards" }, ); animation.play(); await animation.finished; diff --git a/src/_examples/components/to-do/task-item.ts b/src/_examples/components/to-do/task-item.ts index 57b0b47..1ed9e26 100644 --- a/src/_examples/components/to-do/task-item.ts +++ b/src/_examples/components/to-do/task-item.ts @@ -1,17 +1,17 @@ -import { Component, html, css } from "../../../mod.ts"; +import { Component, css, html } from "../../../mod.ts"; import type { TReactiveValueType } from "../../../mod.ts"; import { inputStyles } from "../inputStyles.ts"; export default class TaskItem extends Component<{ item: TReactiveValueType<{ - title: string, - done: boolean, - editing: boolean, - }>, - removeItem: () => void, + title: string; + done: boolean; + editing: boolean; + }>; + removeItem: () => void; }> { - constructor () { + constructor() { super(); this.setAttribute("role", "listitem"); } @@ -54,11 +54,13 @@ export default class TaskItem extends Component<{ { - e.preventDefault(); - this.item.editing.value = false; - }} + e.preventDefault(); + this.item.editing.value = false; + }} > - ${this.item.editing.pipe(editing => !editing + ${ + this.item.editing.pipe((editing) => + !editing ? html`