diff --git a/eslint.config.ts b/eslint.config.ts new file mode 100644 index 0000000..67ef61f --- /dev/null +++ b/eslint.config.ts @@ -0,0 +1,22 @@ +import js from "@eslint/js"; +import globals from "globals"; +import tseslint from "typescript-eslint"; +import { defineConfig } from "eslint/config"; + +export default defineConfig([ + { + files: + ["**/*.{js,mjs,cjs,ts,mts,cts}"], + plugins: { + js + }, + extends: ["js/recommended"], + languageOptions: { + globals: globals.browser + }, + rules: { + "indent": ["error", "tab"] + } + }, + tseslint.configs.recommended, +]); diff --git a/package-lock.json b/package-lock.json index 62c52b1..8ab3148 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,11 +12,15 @@ "packages/@zblog/toolchain" ], "devDependencies": { + "@eslint/js": "^10.0.1", "@types/node": "^20.11.5", "browser-sync": "^3.0.4", "concurrently": "^8.2.1", + "eslint": "^10.0.3", + "globals": "^17.4.0", "nodemon": "^3.0.1", - "typescript": "^5.3.3" + "typescript": "^5.3.3", + "typescript-eslint": "^8.57.0" } }, "node_modules/@babel/runtime": { @@ -31,6 +35,198 @@ "node": ">=6.9.0" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.23.3", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.3.tgz", + "integrity": "sha512-j+eEWmB6YYLwcNOdlwQ6L2OsptI/LO6lNBuLIqe5R7RetD658HLoF+Mn7LzYmAWWNNzdC6cqP+L6r8ujeYXWLw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^3.0.3", + "debug": "^4.3.1", + "minimatch": "^10.2.4" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/config-array/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@eslint/config-array/node_modules/brace-expansion": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz", + "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@eslint/config-array/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@eslint/config-array/node_modules/minimatch": { + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@eslint/config-array/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@eslint/config-helpers": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.5.3.tgz", + "integrity": "sha512-lzGN0onllOZCGroKJmRwY6QcEHxbjBw1gwB8SgRSqK8YbbtEXMvKynsXc3553ckIEBxsbMBU7oOZXKIPGZNeZw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.1.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/core": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.1.1.tgz", + "integrity": "sha512-QUPblTtE51/7/Zhfv8BDwO0qkkzQL7P/aWWbqcf4xWLEYn1oKjdO0gglQBB4GAsu7u6wjijbCmzsUTy6mnk6oQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/js": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", + "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "eslint": "^10.0.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/@eslint/object-schema": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.3.tgz", + "integrity": "sha512-iM869Pugn9Nsxbh/YHRqYiqd23AmIbxJOcpUMOuWCVNdoQJ5ZtwL6h3t0bcZzJUlC3Dq9jCFCESBZnX0GTv7iQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.6.1.tgz", + "integrity": "sha512-iH1B076HoAshH1mLpHMgwdGeTs0CYwL0SPMkGuSebZrwBp16v415e9NZXg2jtrqPVQjf6IANe2Vtlr5KswtcZQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.1.1", + "levn": "^0.4.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, "node_modules/@ffmpeg-installer/darwin-arm64": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@ffmpeg-installer/darwin-arm64/-/darwin-arm64-4.1.5.tgz", @@ -157,6 +353,58 @@ "win32" ] }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@socket.io/component-emitter": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", @@ -174,6 +422,20 @@ "@types/node": "*" } }, + "node_modules/@types/esrecurse": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz", + "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/fluent-ffmpeg": { "version": "2.1.27", "resolved": "https://registry.npmjs.org/@types/fluent-ffmpeg/-/fluent-ffmpeg-2.1.27.tgz", @@ -183,6 +445,13 @@ "@types/node": "*" } }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/node": { "version": "20.11.5", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.5.tgz", @@ -192,6 +461,375 @@ "undici-types": "~5.26.4" } }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.57.0.tgz", + "integrity": "sha512-qeu4rTHR3/IaFORbD16gmjq9+rEs9fGKdX0kF6BKSfi+gCuG3RCKLlSBYzn/bGsY9Tj7KE/DAQStbp8AHJGHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.57.0", + "@typescript-eslint/type-utils": "8.57.0", + "@typescript-eslint/utils": "8.57.0", + "@typescript-eslint/visitor-keys": "8.57.0", + "ignore": "^7.0.5", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.4.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.57.0", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.57.0.tgz", + "integrity": "sha512-XZzOmihLIr8AD1b9hL9ccNMzEMWt/dE2u7NyTY9jJG6YNiNthaD5XtUHVF2uCXZ15ng+z2hT3MVuxnUYhq6k1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.57.0", + "@typescript-eslint/types": "8.57.0", + "@typescript-eslint/typescript-estree": "8.57.0", + "@typescript-eslint/visitor-keys": "8.57.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.57.0.tgz", + "integrity": "sha512-pR+dK0BlxCLxtWfaKQWtYr7MhKmzqZxuii+ZjuFlZlIGRZm22HnXFqa2eY+90MUz8/i80YJmzFGDUsi8dMOV5w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.57.0", + "@typescript-eslint/types": "^8.57.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/project-service/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/project-service/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.57.0.tgz", + "integrity": "sha512-nvExQqAHF01lUM66MskSaZulpPL5pgy5hI5RfrxviLgzZVffB5yYzw27uK/ft8QnKXI2X0LBrHJFr1TaZtAibw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.57.0", + "@typescript-eslint/visitor-keys": "8.57.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.57.0.tgz", + "integrity": "sha512-LtXRihc5ytjJIQEH+xqjB0+YgsV4/tW35XKX3GTZHpWtcC8SPkT/d4tqdf1cKtesryHm2bgp6l555NYcT2NLvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.57.0.tgz", + "integrity": "sha512-yjgh7gmDcJ1+TcEg8x3uWQmn8ifvSupnPfjP21twPKrDP/pTHlEQgmKcitzF/rzPSmv7QjJ90vRpN4U+zoUjwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.57.0", + "@typescript-eslint/typescript-estree": "8.57.0", + "@typescript-eslint/utils": "8.57.0", + "debug": "^4.4.3", + "ts-api-utils": "^2.4.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/types": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.57.0.tgz", + "integrity": "sha512-dTLI8PEXhjUC7B9Kre+u0XznO696BhXcTlOn0/6kf1fHaQW8+VjJAVHJ3eTI14ZapTxdkOmc80HblPQLaEeJdg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.57.0.tgz", + "integrity": "sha512-m7faHcyVg0BT3VdYTlX8GdJEM7COexXxS6KqGopxdtkQRvBanK377QDHr4W/vIPAR+ah9+B/RclSW5ldVniO1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.57.0", + "@typescript-eslint/tsconfig-utils": "8.57.0", + "@typescript-eslint/types": "8.57.0", + "@typescript-eslint/visitor-keys": "8.57.0", + "debug": "^4.4.3", + "minimatch": "^10.2.2", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.4.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz", + "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.57.0.tgz", + "integrity": "sha512-5iIHvpD3CZe06riAsbNxxreP+MuYgVUsV0n4bwLH//VJmgtt54sQeY2GszntJ4BjYCpMzrfVh2SBnUQTtys2lQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.57.0", + "@typescript-eslint/types": "8.57.0", + "@typescript-eslint/typescript-estree": "8.57.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.57.0.tgz", + "integrity": "sha512-zm6xx8UT/Xy2oSr2ZXD0pZo7Jx2XsCoID2IUh9YSTFRu7z+WdwYTRk6LhUftm1crwqbuoF6I8zAFeCMw0YjwDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.57.0", + "eslint-visitor-keys": "^5.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@zblog/toolchain": { "resolved": "packages/@zblog/toolchain", "link": true @@ -215,6 +853,46 @@ "node": ">= 0.6" } }, + "node_modules/acorn": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz", + "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==", + "dev": true, + "license": "MIT", + "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/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -887,6 +1565,21 @@ "node": ">= 0.10" } }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/date-fns": { "version": "2.30.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", @@ -912,6 +1605,13 @@ "ms": "2.0.0" } }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -1130,6 +1830,248 @@ "dev": true, "license": "MIT" }, + "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, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.0.3.tgz", + "integrity": "sha512-COV33RzXZkqhG9P2rZCFl9ZmJ7WL+gQSCRzE7RhkbclbQPtLAWReL7ysA0Sh4c8Im2U9ynybdR56PV0XcKvqaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.2", + "@eslint/config-array": "^0.23.3", + "@eslint/config-helpers": "^0.5.2", + "@eslint/core": "^1.1.1", + "@eslint/plugin-kit": "^0.6.1", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^9.1.2", + "eslint-visitor-keys": "^5.0.1", + "espree": "^11.1.1", + "esquery": "^1.7.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "minimatch": "^10.2.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz", + "integrity": "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@types/esrecurse": "^4.3.1", + "@types/estree": "^1.0.8", + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz", + "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/eslint/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/eslint/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/espree": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", + "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.16.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^5.0.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "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, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "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, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -1147,6 +2089,40 @@ "dev": true, "license": "MIT" }, + "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, + "license": "MIT" + }, + "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, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -1160,6 +2136,44 @@ "node": ">=8" } }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.1.tgz", + "integrity": "sha512-IxfVbRFVlV8V/yRaGzk0UVIcsKKHMSfYw66T/u4nTwlWteQePsxe//LjudR1AMX4tZW3WFCh3Zqa/sjlqpbURQ==", + "dev": true, + "license": "ISC" + }, "node_modules/fluent-ffmpeg": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/fluent-ffmpeg/-/fluent-ffmpeg-2.1.3.tgz", @@ -1253,6 +2267,19 @@ "node": ">= 6" } }, + "node_modules/globals": { + "version": "17.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.4.0.tgz", + "integrity": "sha512-hjrNztw/VajQwOLsMNT1cbJiH2muO3OROCHnbehc8eY5JyD2gqz4AcMHPqgaOR59DjgUjYAYLeH699g/eWi2jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -1324,6 +2351,16 @@ "node": ">=0.10.0" } }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, "node_modules/ignore-by-default": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", @@ -1340,6 +2377,16 @@ "node": ">=0.10.0" } }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -1415,6 +2462,27 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "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, + "license": "MIT" + }, + "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": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, "node_modules/jsonfile": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz", @@ -1425,12 +2493,52 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "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, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/limiter": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz", "integrity": "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==", "dev": true }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -1444,18 +2552,6 @@ "dev": true, "license": "MIT" }, - "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/mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", @@ -1515,6 +2611,13 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -1635,6 +2738,56 @@ "node": ">= 0.8" } }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "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.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -1645,6 +2798,26 @@ "node": ">= 0.8" } }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "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, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -1682,12 +2855,32 @@ "lodash": "^4.17.14" } }, + "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, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/pstree.remy": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", "dev": true }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/raw-body": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", @@ -1785,13 +2978,11 @@ "license": "MIT" }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -1983,6 +3174,29 @@ "dev": true, "license": "ISC" }, + "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, + "license": "MIT", + "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, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/shell-quote": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", @@ -2209,6 +3423,54 @@ "node": ">=8" } }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -2253,12 +3515,38 @@ "tree-kill": "cli.js" } }, + "node_modules/ts-api-utils": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.4.0.tgz", + "integrity": "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", "dev": true }, + "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, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/typescript": { "version": "5.3.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", @@ -2272,6 +3560,30 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.57.0.tgz", + "integrity": "sha512-W8GcigEMEeB07xEZol8oJ26rigm3+bfPHxHvwbYUlu1fUDsGuQ7Hiskx5xGW/xM4USc9Ephe3jtv7ZYPQntHeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.57.0", + "@typescript-eslint/parser": "8.57.0", + "@typescript-eslint/typescript-estree": "8.57.0", + "@typescript-eslint/utils": "8.57.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, "node_modules/ua-parser-js": { "version": "1.0.41", "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.41.tgz", @@ -2331,6 +3643,16 @@ "node": ">= 0.8" } }, + "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, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -2350,6 +3672,32 @@ "node": ">= 0.8" } }, + "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, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/ws": { "version": "8.17.1", "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", @@ -2390,12 +3738,6 @@ "node": ">=10" } }, - "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 - }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", @@ -2464,6 +3806,19 @@ "node": ">=8" } }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "packages/@zblog/toolchain": { "version": "1.0.0", "license": "ISC", diff --git a/package.json b/package.json index 52249cf..be45b38 100644 --- a/package.json +++ b/package.json @@ -19,10 +19,14 @@ "author": "Wholteza (Zackarias Montell)", "license": "ISC", "devDependencies": { + "@eslint/js": "^10.0.1", "@types/node": "^20.11.5", "browser-sync": "^3.0.4", "concurrently": "^8.2.1", + "eslint": "^10.0.3", + "globals": "^17.4.0", "nodemon": "^3.0.1", - "typescript": "^5.3.3" + "typescript": "^5.3.3", + "typescript-eslint": "^8.57.0" } } diff --git a/packages/@zblog/toolchain/src/markdown-parser.ts b/packages/@zblog/toolchain/src/markdown-parser.ts index 9a7e36c..c3e90cc 100644 --- a/packages/@zblog/toolchain/src/markdown-parser.ts +++ b/packages/@zblog/toolchain/src/markdown-parser.ts @@ -1,791 +1,797 @@ class LineFeed { - originalText: string | undefined = undefined; - /** - * @type {string[]} - */ - feed: string[] | undefined = undefined; - /** - * - * @param {string} markdown - */ - constructor(markdown: string) { - this.originalText = markdown; - // TODO: Need to identify line endings - this.feed = markdown.split("\n"); - } + originalText: string | undefined = undefined; + /** + * @type {string[]} + */ + feed: string[] | undefined = undefined; + /** + * + * @param {string} markdown + */ + constructor(markdown: string) { + this.originalText = markdown; + // TODO: Need to identify line endings + this.feed = markdown.split("\n"); + } - /** - * @returns {string} - */ - peek(): string { - return this.feed?.[0] ?? ""; - } + /** + * @returns {string} + */ + peek(): string { + return this.feed?.[0] ?? ""; + } - /** - * - * @returns {string} - */ - claim(): string { - const line = this.feed?.shift(); - if (line === undefined) throw new Error("Feed is empty"); - return line; - } + /** + * + * @returns {string} + */ + claim(): string { + const line = this.feed?.shift(); + if (line === undefined) throw new Error("Feed is empty"); + return line; + } - /** - * - * @param {string} line - */ - push(line: string | null | undefined) { - if (line === undefined || line === null) return; - this.feed = [line, ...(this.feed ?? [])]; - } + /** + * + * @param {string} line + */ + push(line: string | null | undefined) { + if (line === undefined || line === null) return; + this.feed = [line, ...(this.feed ?? [])]; + } - /** - * - * @returns {boolean} - */ - isEmpty(): boolean { - return this.feed?.length === 0; - } + /** + * + * @returns {boolean} + */ + isEmpty(): boolean { + return this.feed?.length === 0; + } } class Symbol { - static canParse(line: string) { - throw new Error("Not implemented"); - } - static create(lineFeed: LineFeed, assetDirectory: string): Symbol { - throw new Error("Not implemented"); - } - /** - * - * @param {string} assetDirectory - * @returns {void} - */ - process(assetDirectory: string): void { - throw new Error("Not Implemented"); - } - render() { - throw new Error("Not implemented"); - } + static canParse(line: string) { + throw new Error("Not implemented"); + } + static create(lineFeed: LineFeed, assetDirectory: string): Symbol { + throw new Error("Not implemented"); + } + /** + * + * @param {string} assetDirectory + * @returns {void} + */ + process(assetDirectory: string): void { + throw new Error("Not Implemented"); + } + render() { + throw new Error("Not implemented"); + } } class Heading extends Symbol { - /** - * @type {string} - */ - text: string = ""; - /** - * @type {number} - */ - level: number = 1; - /** - * - * @param {string} line - * @returns {boolean} - */ - static canParse(line: string): boolean { - return line.trim().startsWith("#"); - } + /** + * @type {string} + */ + text: string = ""; + /** + * @type {number} + */ + level: number = 1; + /** + * + * @param {string} line + * @returns {boolean} + */ + static canParse(line: string): boolean { + return line.trim().startsWith("#"); + } - /** - * - * @param {LineFeed} lineFeed - * @returns {Symbol} - */ - static create(lineFeed: LineFeed): Symbol { - const instance = new Heading(); - const line = lineFeed.claim(); - instance.text = line.replaceAll("#", "").trim(); - instance.level = line.split("").reduce((aggregate, current) => { - return current === "#" ? aggregate + 1 : aggregate; - }, 0); - return instance; - } + /** + * + * @param {LineFeed} lineFeed + * @returns {Symbol} + */ + static create(lineFeed: LineFeed): Symbol { + const instance = new Heading(); + const line = lineFeed.claim(); + instance.text = line.replaceAll("#", "").trim(); + instance.level = line.split("").reduce((aggregate, current) => { + return current === "#" ? aggregate + 1 : aggregate; + }, 0); + return instance; + } - /** - * - * @param {string} assetDirectory - * @returns {void} - */ - process(assetDirectory: string): void { - return; - } + /** + * + * @param {string} assetDirectory + * @returns {void} + */ + process(assetDirectory: string): void { + return; + } - render() { - return `${this.text}`; - } + render() { + return `${this.text}`; + } } class JustALineBreak extends Symbol { - /** - * - * @param {string} line - * @returns {boolean} - */ - static canParse(line: string): boolean { - return line === ""; - } + /** + * + * @param {string} line + * @returns {boolean} + */ + static canParse(line: string): boolean { + return line === ""; + } - /** - * - * @param {LineFeed} lineFeed - * @returns {Symbol} - */ - static create(lineFeed: LineFeed): Symbol { - const instance = new JustALineBreak(); - lineFeed.claim(); - return instance; - } + /** + * + * @param {LineFeed} lineFeed + * @returns {Symbol} + */ + static create(lineFeed: LineFeed): Symbol { + const instance = new JustALineBreak(); + lineFeed.claim(); + return instance; + } - /** - * - * @param {string} assetDirectory - * @returns {void} - */ - process(assetDirectory: string): void { - return; - } + /** + * + * @param {string} assetDirectory + * @returns {void} + */ + process(assetDirectory: string): void { + return; + } - render() { - throw new Error("Symbol cannot be rendered directly"); - } + render() { + throw new Error("Symbol cannot be rendered directly"); + } } class Paragraph extends Symbol { - /** - * @type {string[]} - */ - lines: string[] = []; - /** - * @type {Symbol[]} - */ - children: Symbol[] = []; - /** - * - * @param {string} line - * @returns {boolean} - */ - static canParse(line: string): boolean { - return line === ""; - } + /** + * @type {string[]} + */ + lines: string[] = []; + /** + * @type {Symbol[]} + */ + children: Symbol[] = []; + /** + * + * @param {string} line + * @returns {boolean} + */ + static canParse(line: string): boolean { + return false; + return line === ""; + } - /** - * - * @param {LineFeed} lineFeed - * @returns {Symbol} - */ - static create(lineFeed: LineFeed): Symbol { - const instance = new Paragraph(); - lineFeed.claim(); + /** + * + * @param {LineFeed} lineFeed + * @returns {Symbol} + */ + static create(lineFeed: LineFeed): Symbol { + const instance = new Paragraph(); + lineFeed.claim(); - const lines = []; - let endOfParagraph = false; - while (!endOfParagraph && !lineFeed.isEmpty()) { - const line = lineFeed.peek(); - if (line === "") { - endOfParagraph = true; - continue; - } - lines.push(lineFeed.claim()); - } + const lines = []; + let endOfParagraph = false; + while (!endOfParagraph && !lineFeed.isEmpty()) { + const line = lineFeed.peek(); + if (line === "") { + endOfParagraph = true; + continue; + } + lines.push(lineFeed.claim()); + } - instance.lines = lines; - return instance; - } + instance.lines = lines; + return instance; + } - /** - * - * @param {string} assetDirectory - * @returns {void} - */ - process(assetDirectory: string): void { - return; - } + /** + * + * @param {string} assetDirectory + * @returns {void} + */ + process(assetDirectory: string): void { + return; + } - render() { - return `

${this.children.map((c) => c.render()).join("")}

`; - } + render() { + return `

${this.children.map((c) => c.render()).join("")}

`; + } } class UnorderedListItem extends Symbol { - /** - * @type {string} - */ - text: string = ""; - /** - * @type {number} - */ - level: number = 0; - /** - * - * @param {string} line - * @returns {boolean} - */ - static canParse(line: string): boolean { - return line.trim().startsWith("- "); - } + /** + * @type {string} + */ + innerHtml: string = ""; + /** + * @type {string} + */ + innerMarkdown: string = ""; + /** + * @type {number} + */ + level: number = 0; + /** + * + * @param {string} line + * @returns {boolean} + */ + static canParse(line: string): boolean { + return line.trim().startsWith("- "); + } - /** - * - * @param {LineFeed} lineFeed - * @returns {Symbol} - */ - static create(lineFeed: LineFeed): Symbol { - const instance = new UnorderedListItem(); - const line = lineFeed.claim(); - instance.text = line.replaceAll("-", "").trim(); - instance.level = getAmountOfTokenInBeginningOfFile(" ", line); - return instance; - } + /** + * + * @param {LineFeed} lineFeed + * @returns {Symbol} + */ + static create(lineFeed: LineFeed): Symbol { + const instance = new UnorderedListItem(); + const line = lineFeed.claim(); + instance.innerMarkdown = line.replace("-", "").trim(); + instance.level = getAmountOfTokenInBeginningOfFile(" ", line); + return instance; + } - /** - * - * @param {string} assetDirectory - * @returns {void} - */ - process(assetDirectory: string): void { - return; - } + /** + * + * @param {string} assetDirectory + * @returns {void} + */ + process(assetDirectory: string): void { + if (this.innerMarkdown.length === 0) return; + this.innerHtml = toHtml(this.innerMarkdown, assetDirectory) + } - render() { - return `
  • ${this.text} indentation level ${this.level}
  • `; - } + render() { + return `
  • ${this.innerHtml}
  • `; + } } class OrderedListItem extends Symbol { - /** - * @type {string} - */ - text: string = ""; - /** - * @type {number} - */ - level: number = 0; - /** - * - * @param {string} line - * @returns {boolean} - */ - static canParse(line: string): boolean { - return new RegExp(/^\d\. /).test(line.trim()); - } + /** + * @type {string} + */ + text: string = ""; + /** + * @type {number} + */ + level: number = 0; + /** + * + * @param {string} line + * @returns {boolean} + */ + static canParse(line: string): boolean { + return new RegExp(/^\d\. /).test(line.trim()); + } - /** - * - * @param {LineFeed} lineFeed - * @returns {Symbol} - */ - static create(lineFeed: LineFeed): Symbol { - const instance = new UnorderedListItem(); - const line = lineFeed.claim(); - instance.text = line.trim().replace(/^\d\. /, ""); - instance.level = getAmountOfTokenInBeginningOfFile(" ", line); - return instance; - } + /** + * + * @param {LineFeed} lineFeed + * @returns {Symbol} + */ + static create(lineFeed: LineFeed): Symbol { + const instance = new OrderedListItem(); + const line = lineFeed.claim(); + instance.text = line.trim().replace(/^\d\. /, ""); + instance.level = getAmountOfTokenInBeginningOfFile(" ", line); + return instance; + } - /** - * - * @param {string} assetDirectory - * @returns {void} - */ - process(assetDirectory: string): void { - return; - } + /** + * + * @param {string} assetDirectory + * @returns {void} + */ + process(assetDirectory: string): void { + return; + } - render() { - return `
  • ${this.text} indentation level ${this.level}
  • `; - } + render() { + return `
  • ${this.text} indentation level ${this.level}
  • `; + } } class Link extends Symbol { - /** - * @type {RegExp} - */ - static canParseRegExp: RegExp = new RegExp(/^\[.*\]\(.*\)/); - /** - * @type {RegExp} - */ - static textAndLinkRegExp: RegExp = new RegExp - ( - /\[(?[^\]]+)\]\((?[^)]+)\)/ - ); - /** - * @type {string} - */ - text: string = ""; - /** - * @type {string} - */ - link: string = ""; - /** - * - * @param {string} line - * @returns {boolean} - */ - static canParse(line: string): boolean { - return Link.canParseRegExp.test(line.trim()); - } + /** + * @type {RegExp} + */ + static canParseRegExp: RegExp = new RegExp(/^\[.*\]\(.*\)/); + /** + * @type {RegExp} + */ + static textAndLinkRegExp: RegExp = new RegExp + ( + /\[(?[^\]]+)\]\((?[^)]+)\)/ + ); + /** + * @type {string} + */ + text: string = ""; + /** + * @type {string} + */ + link: string = ""; + /** + * + * @param {string} line + * @returns {boolean} + */ + static canParse(line: string): boolean { + return Link.canParseRegExp.test(line.trim()); + } - /** - * - * @param {LineFeed} lineFeed - * @returns {Symbol} - */ - static create(lineFeed: LineFeed): Symbol { - const instance = new Link(); - const line = lineFeed.claim().trim(); - const [linkLine, rest] = extractTokenAndRest(Link.textAndLinkRegExp, line); - lineFeed.push(rest); - const { text, link } = Link.textAndLinkRegExp.exec(linkLine)?.groups ?? {}; - instance.link = link ?? ""; - instance.text = text ?? ""; - return instance; - } + /** + * + * @param {LineFeed} lineFeed + * @returns {Symbol} + */ + static create(lineFeed: LineFeed): Symbol { + const instance = new Link(); + const line = lineFeed.claim().trim(); + const [linkLine, rest] = extractTokenAndRest(Link.textAndLinkRegExp, line); + lineFeed.push(rest); + const { text, link } = Link.textAndLinkRegExp.exec(linkLine)?.groups ?? {}; + instance.link = link ?? ""; + instance.text = text ?? ""; + return instance; + } - /** - * - * @param {string} assetDirectory - * @returns {void} - */ - process(assetDirectory: string): void { - return; - } + /** + * + * @param {string} assetDirectory + * @returns {void} + */ + process(assetDirectory: string): void { + return; + } - render() { - // TODO: This leading space should probably be somewhere else. - return ` ${this.text}`; - } + render() { + // TODO: This leading space should probably be somewhere else. + return ` ${this.text}`; + } } class ImageLink extends Symbol { - /** - * @type {RegExp} - */ - static canParseRegExp: RegExp = new RegExp(/^!\[.*\]\(.*\)/); - /** - * @type {RegExp} - */ - static textAndLinkRegExp: RegExp = new RegExp( - /!\[(?.*)\]\((?.*)\)/ - ); - /** - * @type {string} - */ - static assetDirectoryToken: string = "@asset/"; - /** - * @type {string} - */ - alt: string = ""; - /** - * @type {string} - */ - link: string = ""; - /** - * - * @param {string} line - * @returns {boolean} - */ - static canParse(line: string): boolean { - return ImageLink.canParseRegExp.test(line.trim()); - } + /** + * @type {RegExp} + */ + static canParseRegExp: RegExp = new RegExp(/^!\[.*\]\(.*\)/); + /** + * @type {RegExp} + */ + static textAndLinkRegExp: RegExp = new RegExp( + /!\[(?.*)\]\((?.*)\)/ + ); + /** + * @type {string} + */ + static assetDirectoryToken: string = "@asset/"; + /** + * @type {string} + */ + alt: string = ""; + /** + * @type {string} + */ + link: string = ""; + /** + * + * @param {string} line + * @returns {boolean} + */ + static canParse(line: string): boolean { + return ImageLink.canParseRegExp.test(line.trim()); + } - /** - * - * @param {LineFeed} lineFeed - * @returns {Symbol} - */ - static create(lineFeed: LineFeed, assetDirectory: string): Symbol { - const instance = new ImageLink(); - const line = lineFeed.claim().trim(); - const [linkLine, rest] = extractTokenAndRest( - ImageLink.textAndLinkRegExp, - line - ); - lineFeed.push(rest); - const { text, link } = - ImageLink.textAndLinkRegExp.exec(linkLine)?.groups ?? {}; - instance.link = - link.replace(ImageLink.assetDirectoryToken, assetDirectory) ?? ""; - instance.alt = text ?? ""; - return instance; - } + /** + * + * @param {LineFeed} lineFeed + * @returns {Symbol} + */ + static create(lineFeed: LineFeed, assetDirectory: string): Symbol { + const instance = new ImageLink(); + const line = lineFeed.claim().trim(); + const [linkLine, rest] = extractTokenAndRest( + ImageLink.textAndLinkRegExp, + line + ); + lineFeed.push(rest); + const { text, link } = + ImageLink.textAndLinkRegExp.exec(linkLine)?.groups ?? {}; + instance.link = + link.replace(ImageLink.assetDirectoryToken, assetDirectory) ?? ""; + instance.alt = text ?? ""; + return instance; + } - /** - * - * @param {string} assetDirectory - * @returns {void} - */ - process(assetDirectory: string): void { - return; - } + /** + * + * @param {string} assetDirectory + * @returns {void} + */ + process(assetDirectory: string): void { + return; + } - render() { - return `${this.alt}`; - } + render() { + return `${this.alt}`; + } } class Italic extends Symbol { - /** - * @type {string} - */ - text: string = ""; - /** - * - * @param {string} line - * @returns {boolean} - */ - static canParse(line: string): boolean { - return line.startsWith("_"); - } + /** + * @type {string} + */ + text: string = ""; + /** + * + * @param {string} line + * @returns {boolean} + */ + static canParse(line: string): boolean { + return line.startsWith("_"); + } - /** - * - * @param {LineFeed} lineFeed - * @returns {Symbol} - */ - static create(lineFeed: LineFeed): Symbol { - const instance = new Italic(); - const line = lineFeed.claim().trim(); - const lineWithoutStartingUnderscore = line.slice(1, line.length); - const lineEndsWithUnderscore = lineWithoutStartingUnderscore.endsWith("_"); - if (lineEndsWithUnderscore) { - const lineWithoutUnderscores = lineWithoutStartingUnderscore.slice( - 0, - lineWithoutStartingUnderscore.length - 1 - ); - instance.text = lineWithoutUnderscores; - return instance; - } - const endOfItalicString = lineWithoutStartingUnderscore.indexOf("_"); - const lineWithoutUnderscores = lineWithoutStartingUnderscore.slice( - 0, - endOfItalicString - ); - const rest = lineWithoutStartingUnderscore.slice(endOfItalicString + 1); - lineFeed.push(rest); - instance.text = lineWithoutUnderscores; - return instance; - } + /** + * + * @param {LineFeed} lineFeed + * @returns {Symbol} + */ + static create(lineFeed: LineFeed): Symbol { + const instance = new Italic(); + const line = lineFeed.claim().trim(); + const lineWithoutStartingUnderscore = line.slice(1, line.length); + const lineEndsWithUnderscore = lineWithoutStartingUnderscore.endsWith("_"); + if (lineEndsWithUnderscore) { + const lineWithoutUnderscores = lineWithoutStartingUnderscore.slice( + 0, + lineWithoutStartingUnderscore.length - 1 + ); + instance.text = lineWithoutUnderscores; + return instance; + } + const endOfItalicString = lineWithoutStartingUnderscore.indexOf("_"); + const lineWithoutUnderscores = lineWithoutStartingUnderscore.slice( + 0, + endOfItalicString + ); + const rest = lineWithoutStartingUnderscore.slice(endOfItalicString + 1); + lineFeed.push(rest); + instance.text = lineWithoutUnderscores; + return instance; + } - /** - * - * @param {string} assetDirectory - * @returns {void} - */ - process(assetDirectory: string): void { - return; - } + /** + * + * @param {string} assetDirectory + * @returns {void} + */ + process(assetDirectory: string): void { + return; + } - render() { - return `${this.text}`; - } + render() { + return `${this.text}`; + } } class Bold extends Symbol { - /** - * @type {string} - */ - text: string = ""; - /** - * - * @param {string} line - * @returns {boolean} - */ - static canParse(line: string): boolean { - return line.startsWith("**"); - } + /** + * @type {string} + */ + text: string = ""; + /** + * + * @param {string} line + * @returns {boolean} + */ + static canParse(line: string): boolean { + return line.startsWith("**"); + } - /** - * - * @param {LineFeed} lineFeed - * @returns {Symbol} - */ - static create(lineFeed: LineFeed): Symbol { - const instance = new Bold(); - const line = lineFeed.claim().trim(); - const lineWithoutStartingUnderscore = line.slice(2, line.length); - const lineEndsWithStars = lineWithoutStartingUnderscore.endsWith("**"); - if (lineEndsWithStars) { - const lineWithoutUnderscores = lineWithoutStartingUnderscore.slice( - 0, - lineWithoutStartingUnderscore.length - 2 - ); - instance.text = lineWithoutUnderscores; - return instance; - } - const endOfBoldString = lineWithoutStartingUnderscore.indexOf("**"); - const lineWithoutUnderscores = lineWithoutStartingUnderscore.slice( - 0, - endOfBoldString - ); - const rest = lineWithoutStartingUnderscore.slice(endOfBoldString + 2); - lineFeed.push(rest); - instance.text = lineWithoutUnderscores; - return instance; - } + /** + * + * @param {LineFeed} lineFeed + * @returns {Symbol} + */ + static create(lineFeed: LineFeed): Symbol { + const instance = new Bold(); + const line = lineFeed.claim().trim(); + const lineWithoutStartingUnderscore = line.slice(2, line.length); + const lineEndsWithStars = lineWithoutStartingUnderscore.endsWith("**"); + if (lineEndsWithStars) { + const lineWithoutUnderscores = lineWithoutStartingUnderscore.slice( + 0, + lineWithoutStartingUnderscore.length - 2 + ); + instance.text = lineWithoutUnderscores; + return instance; + } + const endOfBoldString = lineWithoutStartingUnderscore.indexOf("**"); + const lineWithoutUnderscores = lineWithoutStartingUnderscore.slice( + 0, + endOfBoldString + ); + const rest = lineWithoutStartingUnderscore.slice(endOfBoldString + 2); + lineFeed.push(rest); + instance.text = lineWithoutUnderscores; + return instance; + } - /** - * - * @param {string} assetDirectory - * @returns {void} - */ - process(assetDirectory: string): void { - return; - } + /** + * + * @param {string} assetDirectory + * @returns {void} + */ + process(assetDirectory: string): void { + return; + } - render() { - return `${this.text}`; - } + render() { + return `${this.text}`; + } } class SingleLineCode extends Symbol { - /** - * @type {string} - */ - text: string = ""; - /** - * - * @param {string} line - * @returns {boolean} - */ - static canParse(line: string): boolean { - return line.startsWith("`"); - } + /** + * @type {string} + */ + text: string = ""; + /** + * + * @param {string} line + * @returns {boolean} + */ + static canParse(line: string): boolean { + return line.startsWith("`"); + } - /** - * - * @param {LineFeed} lineFeed - * @returns {Symbol} - */ - static create(lineFeed: LineFeed): Symbol { - const instance = new SingleLineCode(); - const line = lineFeed.claim().trim(); - const lineWithoutStartingUnderscore = line.slice(1, line.length); - const lineEndsWithUnderscore = lineWithoutStartingUnderscore.endsWith("`"); - if (lineEndsWithUnderscore) { - const lineWithoutUnderscores = lineWithoutStartingUnderscore.slice( - 0, - lineWithoutStartingUnderscore.length - 1 - ); - instance.text = lineWithoutUnderscores; - return instance; - } - const endOfItalicString = lineWithoutStartingUnderscore.indexOf("`"); - const lineWithoutUnderscores = lineWithoutStartingUnderscore.slice( - 0, - endOfItalicString - ); - const rest = lineWithoutStartingUnderscore.slice(endOfItalicString + 1); - lineFeed.push(rest); - instance.text = lineWithoutUnderscores; - return instance; - } + /** + * + * @param {LineFeed} lineFeed + * @returns {Symbol} + */ + static create(lineFeed: LineFeed): Symbol { + const instance = new SingleLineCode(); + const line = lineFeed.claim().trim(); + const lineWithoutStartingUnderscore = line.slice(1, line.length); + const lineEndsWithUnderscore = lineWithoutStartingUnderscore.endsWith("`"); + if (lineEndsWithUnderscore) { + const lineWithoutUnderscores = lineWithoutStartingUnderscore.slice( + 0, + lineWithoutStartingUnderscore.length - 1 + ); + instance.text = lineWithoutUnderscores; + return instance; + } + const endOfItalicString = lineWithoutStartingUnderscore.indexOf("`"); + const lineWithoutUnderscores = lineWithoutStartingUnderscore.slice( + 0, + endOfItalicString + ); + const rest = lineWithoutStartingUnderscore.slice(endOfItalicString + 1); + lineFeed.push(rest); + instance.text = lineWithoutUnderscores; + return instance; + } - /** - * - * @param {string} assetDirectory - * @returns {void} - */ - process(assetDirectory: string): void { - return; - } + /** + * + * @param {string} assetDirectory + * @returns {void} + */ + process(assetDirectory: string): void { + return; + } - render() { - return `${this.text}`; - } + render() { + return `${this.text}`; + } } class MultiLineCode extends Symbol { - /** - * @type {string} - */ - text: string = ""; - /** - * - * @param {string} line - * @returns {boolean} - */ - static canParse(line: string): boolean { - const trimmedLine = line.trim(); - return trimmedLine.startsWith("```"); - } + /** + * @type {string} + */ + text: string = ""; + /** + * + * @param {string} line + * @returns {boolean} + */ + static canParse(line: string): boolean { + const trimmedLine = line.trim(); + return trimmedLine.startsWith("```"); + } - /** - * - * @param {LineFeed} lineFeed - * @returns {Symbol} - */ - static create(lineFeed: LineFeed): Symbol { - const instance = new MultiLineCode(); - const line = lineFeed.claim().trim(); - const lineWithoutStartTag = line.slice(3, line.length); + /** + * + * @param {LineFeed} lineFeed + * @returns {Symbol} + */ + static create(lineFeed: LineFeed): Symbol { + const instance = new MultiLineCode(); + const line = lineFeed.claim().trim(); + const lineWithoutStartTag = line.slice(3, line.length); - const sameLineContainsEnding = lineWithoutStartTag.includes("```"); - if (sameLineContainsEnding) { - const endsWithTag = lineWithoutStartTag.endsWith("```"); - if (endsWithTag) { - instance.text = lineWithoutStartTag.slice( - 0, - lineWithoutStartTag.length - 3 - ); - return instance; - } - const [text, rest] = splitStringAtToken("```", lineWithoutStartTag); - lineFeed.push(rest); - instance.text = text; - return instance; - } - const lines = [lineWithoutStartTag]; + const sameLineContainsEnding = lineWithoutStartTag.includes("```"); + if (sameLineContainsEnding) { + const endsWithTag = lineWithoutStartTag.endsWith("```"); + if (endsWithTag) { + instance.text = lineWithoutStartTag.slice( + 0, + lineWithoutStartTag.length - 3 + ); + return instance; + } + const [text, rest] = splitStringAtToken("```", lineWithoutStartTag); + lineFeed.push(rest); + instance.text = text; + return instance; + } + const lines = [lineWithoutStartTag]; - let endTokenFound = false; - while (!endTokenFound && !lineFeed.isEmpty()) { - const nextLine = lineFeed.claim(); - if (!nextLine.includes("```")) { - lines.push(nextLine); - continue; - } - if (nextLine.endsWith("```")) { - lines.push(nextLine.slice(0, nextLine.length - 3)); - break; - } - const [lastLine, rest] = splitStringAtToken("```", nextLine); - lineFeed.push(rest); - lines.push(lastLine); - break; - } + const endTokenFound = false; + while (!endTokenFound && !lineFeed.isEmpty()) { + const nextLine = lineFeed.claim(); + if (!nextLine.includes("```")) { + lines.push(nextLine); + continue; + } + if (nextLine.endsWith("```")) { + lines.push(nextLine.slice(0, nextLine.length - 3)); + break; + } + const [lastLine, rest] = splitStringAtToken("```", nextLine); + lineFeed.push(rest); + lines.push(lastLine); + break; + } - instance.text = lines.join("\n"); - return instance; - } + instance.text = lines.join("\n"); + return instance; + } - /** - * - * @param {string} assetDirectory - * @returns {void} - */ - process(assetDirectory: string): void { - return; - } + /** + * + * @param {string} assetDirectory + * @returns {void} + */ + process(assetDirectory: string): void { + return; + } - render() { - return `
    ${this.text}
    `; - } + render() { + return `
    ${this.text}
    `; + } } class TextRow extends Symbol { - /** - * @type {string} - */ - text: string = ""; - /** - * @type {Symbol[]} - */ - children: Symbol[] = []; - /** - * @type {Symbol[]} - */ - allowedChildren: (typeof Symbol)[] = [ - Bold, - Italic, - ImageLink, - Link, - MultiLineCode, - SingleLineCode, - TextRow, - ]; - /** - * - * @param {string} line - * @returns {boolean} - */ - static canParse(line: string): boolean { - return true; - } + /** + * @type {string} + */ + text: string = ""; + /** + * @type {Symbol[]} + */ + children: Symbol[] = []; + /** + * @type {Symbol[]} + */ + allowedChildren: (typeof Symbol)[] = [ + Bold, + Italic, + ImageLink, + Link, + MultiLineCode, + SingleLineCode, + TextRow, + ]; + /** + * + * @param {string} line + * @returns {boolean} + */ + static canParse(line: string): boolean { + return true; + } - /** - * - * @param {LineFeed} lineFeed - * @returns {Symbol} - */ - static create(lineFeed: LineFeed): Symbol { - const instance = new TextRow(); - instance.text = lineFeed.claim(); - return instance; - } + /** + * + * @param {LineFeed} lineFeed + * @returns {Symbol} + */ + static create(lineFeed: LineFeed): Symbol { + const instance = new TextRow(); + instance.text = lineFeed.claim(); + return instance; + } - /** - * - * @param {string} assetDirectory - * @returns {void} - */ - process(assetDirectory: string): void { - for (let i = 0; i < this.text.length; i++) { - if (i === this.text.length - 1) { - const plainText = new PlainText(); - plainText.text = this.text; - this.children = [plainText]; - break; - } - const line = this.text.slice(i); - const symbols = toSymbols(line, assetDirectory, this.allowedChildren); - const symbolsIsOnlyOneTextRow = - symbols.length === 1 && symbols[0] instanceof TextRow; - if (!symbols.length || symbolsIsOnlyOneTextRow) { - continue; - } - const plainText = new PlainText(); - plainText.text = this.text.slice(0, i); - this.children = [plainText, ...symbols]; - break; - } - this.children.forEach((c) => c.process(assetDirectory)); - } + /** + * + * @param {string} assetDirectory + * @returns {void} + */ + process(assetDirectory: string): void { + for (let i = 0; i < this.text.length; i++) { + if (i === this.text.length - 1) { + const plainText = new PlainText(); + plainText.text = this.text; + this.children = [plainText]; + break; + } + const line = this.text.slice(i); + const symbols = toSymbols(line, assetDirectory, this.allowedChildren); + const symbolsIsOnlyOneTextRow = + symbols.length === 1 && symbols[0] instanceof TextRow; + if (!symbols.length || symbolsIsOnlyOneTextRow) { + continue; + } + const plainText = new PlainText(); + plainText.text = this.text.slice(0, i); + this.children = [plainText, ...symbols]; + break; + } + this.children.forEach((c) => c.process(assetDirectory)); + } - render() { - return this.children.map((c) => c.render()).join(""); - } + render() { + return this.children.map((c) => c.render()).join(""); + } } class PlainText extends Symbol { - /** - * @type {string} - */ - text: string = ""; - /** - * @type {Symbol[]} - */ - children: Symbol[] = []; - /** - * - * @param {string} line - * @returns {boolean} - */ - static canParse(line: string): boolean { - return true; - } + /** + * @type {string} + */ + text: string = ""; + /** + * @type {Symbol[]} + */ + children: Symbol[] = []; + /** + * + * @param {string} line + * @returns {boolean} + */ + static canParse(line: string): boolean { + return true; + } - /** - * - * @param {LineFeed} lineFeed - * @returns {Symbol} - */ - static create(lineFeed: LineFeed): Symbol { - const instance = new PlainText(); - instance.text = lineFeed.claim(); - return instance; - } + /** + * + * @param {LineFeed} lineFeed + * @returns {Symbol} + */ + static create(lineFeed: LineFeed): Symbol { + const instance = new PlainText(); + instance.text = lineFeed.claim(); + return instance; + } - /** - * - * @param {string} assetDirectory - * @returns {void} - */ - process(assetDirectory: string): void { - return; - } + /** + * + * @param {string} assetDirectory + * @returns {void} + */ + process(assetDirectory: string): void { + return; + } - render() { - return `${this.text}`; - } + render() { + return `${this.text}`; + } } const isRegExp = (value: unknown): value is RegExp => value instanceof RegExp; @@ -797,24 +803,24 @@ const isRegExp = (value: unknown): value is RegExp => value instanceof RegExp; * @returns {string[]} */ const splitStringAtToken = ( - token: string | RegExp, - string: string + token: string | RegExp, + string: string ): string[] => { - let index = 0; - let length = 0; - if (isRegExp(token)) { - const exp = new RegExp(token); - const match = exp.exec(string); - index = match?.index ?? -1; - length = match?.[0].length ?? 0; - } else { - index = string.indexOf(token); - length = token.length; - } + let index = 0; + let length = 0; + if (isRegExp(token)) { + const exp = new RegExp(token); + const match = exp.exec(string); + index = match?.index ?? -1; + length = match?.[0].length ?? 0; + } else { + index = string.indexOf(token); + length = token.length; + } - const splitTokenNotFound = index === -1; - if (splitTokenNotFound) return [string, ""]; - return [string.slice(0, index), string.slice(index + length)]; + const splitTokenNotFound = index === -1; + if (splitTokenNotFound) return [string, ""]; + return [string.slice(0, index), string.slice(index + length)]; }; /** @@ -824,24 +830,24 @@ const splitStringAtToken = ( * @returns {string[]} */ const extractTokenAndRest = ( - token: string | RegExp, - string: string + token: string | RegExp, + string: string ): string[] => { - let index = 0; - let length = 0; - if (isRegExp(token)) { - const exp = new RegExp(token); - const match = exp.exec(string); - index = match?.index ?? -1; - length = match?.[0].length ?? 0; - } else { - index = string.indexOf(token); - length = token.length; - } + let index = 0; + let length = 0; + if (isRegExp(token)) { + const exp = new RegExp(token); + const match = exp.exec(string); + index = match?.index ?? -1; + length = match?.[0].length ?? 0; + } else { + index = string.indexOf(token); + length = token.length; + } - const splitTokenNotFound = index === -1; - if (splitTokenNotFound) return [string, ""]; - return [string.slice(0, index + length), string.slice(index + length)]; + const splitTokenNotFound = index === -1; + if (splitTokenNotFound) return [string, ""]; + return [string.slice(0, index + length), string.slice(index + length)]; }; /** @@ -850,35 +856,35 @@ const extractTokenAndRest = ( * @param {string} string */ const getAmountOfTokenInBeginningOfFile = (token: string, string: string) => { - let count = 0; - let searchIndex = 0; - while (true) { - if (searchIndex + (token.length - 1) > string.length) return count; + let count = 0; + let searchIndex = 0; + while (true) { + if (searchIndex + (token.length - 1) > string.length) return count; - const index = string.slice(searchIndex).indexOf(token); - const indexNotAtStartOfString = index !== 0; - if (indexNotAtStartOfString) return count; + const index = string.slice(searchIndex).indexOf(token); + const indexNotAtStartOfString = index !== 0; + if (indexNotAtStartOfString) return count; - count++; - searchIndex += token.length; - } + count++; + searchIndex += token.length; + } }; /** * @type {Symbol[]} */ const AllSymbols: (typeof Symbol)[] = [ - JustALineBreak, - Heading, - UnorderedListItem, - OrderedListItem, - Bold, - Italic, - ImageLink, - Link, - MultiLineCode, - SingleLineCode, - TextRow, + JustALineBreak, + Heading, + UnorderedListItem, + OrderedListItem, + Bold, + Italic, + ImageLink, + Link, + MultiLineCode, + SingleLineCode, + TextRow, ]; /** @@ -888,20 +894,23 @@ const AllSymbols: (typeof Symbol)[] = [ * @returns {string} */ export const toHtml = (markdown: string, assetDirectory: string): string => { - // Stage one, markdown to symbols - const symbols = toSymbols(markdown, assetDirectory); + // Stage one, markdown to symbols + const symbols = toSymbols(markdown, assetDirectory); + console.log(symbols) - // Stage two, expanding symbols - symbols.forEach((s) => s.process(assetDirectory)); + // Stage two, expanding symbols + symbols.forEach((s) => s.process(assetDirectory)); + console.log(symbols) - // Stage three, operations based on symbol relationship - const stageThree = stageThreeProcessing(symbols); - // Stage four, rendering - const html = stageThree - // .filter((s) => !(s instanceof JustALineBreak)) - .map((s) => s.render()) - .join(""); - return `
    ${html}
    `; + // Stage three, operations based on symbol relationship + const stageThree = stageThreeProcessing(symbols); + // Stage four, rendering + const html = stageThree + //.filter((s) => !(s instanceof JustALineBreak)) + .map((s) => s.render()) + .join(""); + + return html; }; /** @@ -910,30 +919,34 @@ export const toHtml = (markdown: string, assetDirectory: string): string => { * @returns {Symbol[]} */ const stageThreeProcessing = (symbols: Symbol[]): Symbol[] => { - const localSymbols = [...symbols]; - // Turn line break pairs into paragraphs - while (localSymbols.filter((s) => s instanceof JustALineBreak).length !== 0) { - const startIndex = localSymbols.findIndex( - (s) => s instanceof JustALineBreak - ); - const subEndIndex = localSymbols - .slice(startIndex + 1) - .findIndex((s) => s instanceof JustALineBreak); - const endIndex = - subEndIndex === -1 - ? localSymbols.length - 1 - : startIndex + 1 + subEndIndex; - const lastItemIsNotLineBreak = subEndIndex === -1; - const children = localSymbols.slice( - startIndex + 1, - lastItemIsNotLineBreak ? localSymbols.length : endIndex - ); - const paragraph = new Paragraph(); - paragraph.children = children; - localSymbols.splice(startIndex, children.length + 1, paragraph); - } - // Fix indentation of bullet elements - return localSymbols; + const localSymbols = [...symbols]; + // Turn line break pairs into paragraphs + while (localSymbols.filter((s) => s instanceof JustALineBreak).length !== 0) { + const startIndex = localSymbols.findIndex( + (s) => s instanceof JustALineBreak + ); + const subEndIndex = localSymbols + .slice(startIndex + 1) + .findIndex((s) => s instanceof JustALineBreak); + if (subEndIndex === -1) { + localSymbols.splice(startIndex); + break; + } + const endIndex = + subEndIndex === -1 + ? localSymbols.length - 1 + : startIndex + 1 + subEndIndex; + const lastItemIsNotLineBreak = subEndIndex === -1; + const children = localSymbols.slice( + startIndex + 1, + lastItemIsNotLineBreak ? localSymbols.length : endIndex + ); + const paragraph = new Paragraph(); + paragraph.children = children; + localSymbols.splice(startIndex, children.length + 1, paragraph); + } + // Fix indentation of bullet elements + return localSymbols; }; /** @@ -944,24 +957,24 @@ const stageThreeProcessing = (symbols: Symbol[]): Symbol[] => { * @returns {Symbol[]} */ const toSymbols = ( - markdown: string, - assetDirectory: string, - allowedSymbols: (typeof Symbol)[] = AllSymbols + markdown: string, + assetDirectory: string, + allowedSymbols: (typeof Symbol)[] = AllSymbols ): Symbol[] => { - const lineFeed = new LineFeed(markdown); - const symbols: Symbol[] = []; + const lineFeed = new LineFeed(markdown); + const symbols: Symbol[] = []; - while (!lineFeed.isEmpty()) { - const line = lineFeed.peek(); - const factory = allowedSymbols.find((factory) => factory.canParse(line)); - if (factory === undefined) { - const textRow = TextRow.create(lineFeed); - symbols.push(textRow); - continue; - } - const symbol = factory.create(lineFeed, assetDirectory); - symbols.push(symbol); - } + while (!lineFeed.isEmpty()) { + const line = lineFeed.peek(); + const factory = allowedSymbols.find((factory) => factory.canParse(line)); + if (factory === undefined) { + const textRow = TextRow.create(lineFeed); + symbols.push(textRow); + continue; + } + const symbol = factory.create(lineFeed, assetDirectory); + symbols.push(symbol); + } - return symbols; + return symbols; }; diff --git a/src/assets/base.css b/src/assets/base.css index a6e6280..6f1446b 100644 --- a/src/assets/base.css +++ b/src/assets/base.css @@ -11,6 +11,28 @@ --space-base: 1rem; } +.indent-0 { + margin-left: 1rem; +} +.indent-1 { + margin-left: 2rem; +} +.indent-2 { + margin-left: 3rem; +} +.indent-3 { + margin-left: 4rem; +} +.indent-4 { + margin-left: 5rem; +} +.indent-5 { + margin-left: 6rem; +} +.indent-6 { + margin-left: 7rem; +} + .banner { margin-top: 1rem; diff --git a/src/notes/10-neovim-0.12-configuration/note.md b/src/notes/10-neovim-0.12-configuration/note.md index bcde5ce..49f176d 100644 --- a/src/notes/10-neovim-0.12-configuration/note.md +++ b/src/notes/10-neovim-0.12-configuration/note.md @@ -19,7 +19,7 @@ require('todo-comments').setup({ }) ``` -[vim.pack.add()](https://neovim.io/doc/user/pack/#vim.pack.add()) +[Neovim pack](https://neovim.io/doc/user/pack) I wiped my current 0.11 configuration and started fresh with this new package manger. I try to keep it lean to reduce startup time, but i do work in a couple of different environments so language support is vital. [This is what i ended up with so far](https://git.zacke.dev/wholteza/dotfiles/src/commit/2b2ce07edc5e8eb5b9e4cffc234abe4cdc8512f6/.config/nvim/init.lua): diff --git a/src/templates/note.html b/src/templates/note.html index 9b8657b..cd43f38 100644 --- a/src/templates/note.html +++ b/src/templates/note.html @@ -102,7 +102,7 @@ - {{markdown}} +
    {{markdown}}