diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index e019f3ca..00000000 --- a/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules/ - -main.js diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 4605e4ff..00000000 --- a/.eslintrc +++ /dev/null @@ -1,34 +0,0 @@ -{ - "root": true, - "parser": "@typescript-eslint/parser", - "env": { - "node": true - }, - "plugins": [ - "@typescript-eslint" - ], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" - ], - "parserOptions": { - "project": "./tsconfig.json" - }, - "rules": { - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": [ - "error", - { - "args": "none" - } - ], - "@typescript-eslint/ban-ts-comment": "off", - "no-prototype-builtins": "off", - "@typescript-eslint/no-empty-function": "off", - "semi": [ - "error", - "always" - ] - } -} diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index f660e90e..d5f053fc 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -4,7 +4,6 @@ about: Create a report to help us improve title: '' labels: bug assignees: '' - --- **Describe the bug** diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7d..2f28cead 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -4,7 +4,6 @@ about: Suggest an idea for this project title: '' labels: '' assignees: '' - --- **Is your feature request related to a problem? Please describe.** diff --git a/.github/auto_assign.yml b/.github/auto_assign.yml index cfd74378..08296899 100644 --- a/.github/auto_assign.yml +++ b/.github/auto_assign.yml @@ -11,7 +11,6 @@ reviewers: # A number of reviewers added to the pull request # Set 0 to add all the reviewers (default: 0) numberOfReviewers: 0 - # A list of assignees, overrides reviewers if set # assignees: # - assigneeA diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 31d18cdc..9d08dec6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,13 +5,13 @@ --- version: 2 updates: - - package-ecosystem: "npm" # See documentation for possible values - directory: "/" # Location of package manifests + - package-ecosystem: 'npm' # See documentation for possible values + directory: '/' # Location of package manifests schedule: - interval: "monthly" + interval: 'monthly' labels: - - "dependencies" + - 'dependencies' groups: dev-dependencies: patterns: - - "@type*" + - '@type*' diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 19765c26..bbead3c1 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -22,15 +22,14 @@ What kind of change does this PR introduce? - [ ] Other... Please describe: ## What is the current behavior? + Issue Number: N/A - ## What is the new behavior? - ## Does this PR introduce a breaking change? - [ ] Yes diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml index 38afaa9d..8fd49b12 100644 --- a/.github/workflows/auto-approve.yml +++ b/.github/workflows/auto-approve.yml @@ -16,7 +16,7 @@ jobs: id: metadata uses: dependabot/fetch-metadata@v1 with: - github-token: "${{ secrets.GITHUB_TOKEN }}" + github-token: '${{ secrets.GITHUB_TOKEN }}' - name: Approve a PR run: gh pr review --approve "$PR_URL" env: diff --git a/.github/workflows/auto-assign-action.yml b/.github/workflows/auto-assign-action.yml index b8e2c0d2..1d925b54 100644 --- a/.github/workflows/auto-assign-action.yml +++ b/.github/workflows/auto-assign-action.yml @@ -8,4 +8,3 @@ jobs: runs-on: ubuntu-latest steps: - uses: kentaro-m/auto-assign-action@v2.0.0 - diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index e9967cd0..690ad733 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -33,7 +33,7 @@ jobs: - name: Release id: release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: draft: false prerelease: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15dcd77d..25510133 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,20 +2,20 @@ name: CI on: push: - branches: [ "main" ] + branches: ['main'] pull_request: - branches: [ "main" ] + branches: ['main'] -permissions: { } +permissions: {} jobs: run: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Node 18 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 - name: Install dependencies @@ -26,9 +26,9 @@ jobs: - uses: actions/checkout@v4 - uses: codecov/codecov-action@v4 with: -# fail_ci_if_error: true # optional (default = false) -# files: ./coverage1.xml,./coverage2.xml # optional -# flags: unittests # optional -# name: codecov-umbrella # optional + # fail_ci_if_error: true # optional (default = false) + # files: ./coverage1.xml,./coverage2.xml # optional + # flags: unittests # optional + # name: codecov-umbrella # optional token: ${{ secrets.CODECOV_TOKEN }} # required verbose: true # optional (default = false) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index ab0c58ca..f1883d61 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -3,11 +3,11 @@ name: Lint Code Base on: push: - branches-ignore: [ main ] + branches-ignore: [main] pull_request: - branches: [ main ] + branches: [main] -permissions: { } +permissions: {} jobs: build: @@ -29,11 +29,10 @@ jobs: fetch-depth: 0 - name: Super-linter - uses: super-linter/super-linter@v6.6.0 # x-release-please-version + uses: super-linter/super-linter@v7.2.0 # x-release-please-version env: # To report GitHub Actions status checks GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VALIDATE_JAVASCRIPT_STANDARD: "false" - VALIDATE_TYPESCRIPT_STANDARD: "false" - VALIDATE_CHECKOV: "false" - + VALIDATE_JAVASCRIPT_STANDARD: 'false' + VALIDATE_TYPESCRIPT_STANDARD: 'false' + VALIDATE_CHECKOV: 'false' diff --git a/.prettierrc b/.prettierrc index 14885764..4e6bfaf9 100644 --- a/.prettierrc +++ b/.prettierrc @@ -5,7 +5,6 @@ "bracketSpacing": true, "endOfLine": "lf", "htmlWhitespaceSensitivity": "css", - "jsxBracketSameLine": false, "jsxSingleQuote": false, "printWidth": 80, "proseWrap": "preserve", diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 8f2b2d2d..93c4b784 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience -* Focusing on what is best not just for us as individuals, but for the +- Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or +- The use of sexualized language or imagery, and sexual attention or advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities diff --git a/README.md b/README.md index 035769c9..453eb193 100644 --- a/README.md +++ b/README.md @@ -70,4 +70,3 @@ This project is published under [MIT](https://choosealicense.com/licenses/mit/) If you ever want to buy me a coffee, don't hesitate. [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/V7V8KX38Q) - diff --git a/esbuild.config.mjs b/esbuild.config.mjs index dc2e9e80..bfa89245 100644 --- a/esbuild.config.mjs +++ b/esbuild.config.mjs @@ -1,48 +1,48 @@ -import esbuild from "esbuild"; -import process from "process"; -import builtins from "builtin-modules"; +import esbuild from 'esbuild'; +import process from 'process'; +import builtins from 'builtin-modules'; -const banner = -`/* +const banner = `/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ `; -const prod = (process.argv[2] === "production"); +const prod = process.argv[2] === 'production'; const context = await esbuild.context({ - banner: { - js: banner, - }, - entryPoints: ["src/main.ts"], - bundle: true, - external: [ - "obsidian", - "electron", - "@codemirror/autocomplete", - "@codemirror/collab", - "@codemirror/commands", - "@codemirror/language", - "@codemirror/lint", - "@codemirror/search", - "@codemirror/state", - "@codemirror/view", - "@lezer/common", - "@lezer/highlight", - "@lezer/lr", - ...builtins], - format: "cjs", - target: "es2018", - logLevel: "info", - sourcemap: prod ? false : "inline", - treeShaking: true, - outfile: "main.js", + banner: { + js: banner, + }, + entryPoints: ['src/main.ts'], + bundle: true, + external: [ + 'obsidian', + 'electron', + '@codemirror/autocomplete', + '@codemirror/collab', + '@codemirror/commands', + '@codemirror/language', + '@codemirror/lint', + '@codemirror/search', + '@codemirror/state', + '@codemirror/view', + '@lezer/common', + '@lezer/highlight', + '@lezer/lr', + ...builtins, + ], + format: 'cjs', + target: 'es2018', + logLevel: 'info', + sourcemap: prod ? false : 'inline', + treeShaking: true, + outfile: 'main.js', }); if (prod) { - await context.rebuild(); - process.exit(0); + await context.rebuild(); + process.exit(0); } else { - await context.watch(); + await context.watch(); } diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..7059e0a8 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,64 @@ +import typescriptEslint from '@typescript-eslint/eslint-plugin'; +import globals from 'globals'; +import tsParser from '@typescript-eslint/parser'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import js from '@eslint/js'; +import { FlatCompat } from '@eslint/eslintrc'; +import eslintPluginYml from 'eslint-plugin-yml'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, +}); + +export default [ + { + files: ['**/*.ts', '**/*.tsx', '**/*.json'], + ignores: ['**/node_modules/', '**/main.js'], + }, + ...eslintPluginYml.configs['flat/recommended'], + ...compat.extends( + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + ), + { + plugins: { + '@typescript-eslint': typescriptEslint, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: tsParser, + ecmaVersion: 2018, + sourceType: 'module', + + parserOptions: { + project: './tsconfig.json', + }, + }, + + rules: { + 'no-unused-vars': 'off', + + '@typescript-eslint/no-unused-vars': [ + 'error', + { + args: 'none', + }, + ], + + '@typescript-eslint/ban-ts-comment': 'off', + 'no-prototype-builtins': 'off', + '@typescript-eslint/no-empty-function': 'off', + semi: ['error', 'always'], + }, + }, +]; diff --git a/jest.config.js b/jest.config.js index 000703b9..13827a89 100644 --- a/jest.config.js +++ b/jest.config.js @@ -2,10 +2,10 @@ module.exports = { preset: 'ts-jest', testEnvironment: 'node', transform: { - '^.+\\.ts?$': 'ts-jest' + '^.+\\.ts?$': 'ts-jest', }, transformIgnorePatterns: ['/node_modules'], moduleDirectories: ['node_modules', 'src'], collectCoverage: true, - coverageReporters: ['text', 'cobertura'] + coverageReporters: ['text', 'cobertura'], }; diff --git a/manifest.json b/manifest.json index 7633e21e..b1d5ae84 100644 --- a/manifest.json +++ b/manifest.json @@ -1,11 +1,11 @@ { - "id": "o2", - "name": "O2", - "version": "2.1.0", - "minAppVersion": "0.15.0", - "description": "This is a plugin to make obsidian markdown syntax compatible with other markdown syntax.", - "author": "haril song", - "authorUrl": "https://github.com/songkg7", - "fundingUrl": "", - "isDesktopOnly": true -} \ No newline at end of file + "id": "o2", + "name": "O2", + "version": "2.1.0", + "minAppVersion": "0.15.0", + "description": "This is a plugin to make obsidian markdown syntax compatible with other markdown syntax.", + "author": "haril song", + "authorUrl": "https://github.com/songkg7", + "fundingUrl": "", + "isDesktopOnly": true +} diff --git a/package-lock.json b/package-lock.json index 970a28be..48f76937 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,15 +12,17 @@ "@js-temporal/polyfill": "^0.4.4", "@types/jest": "^29.5.14", "@types/js-yaml": "^4.0.9", - "@types/node": "^22.10.1", + "@types/node": "^22.10.2", "@typescript-eslint/eslint-plugin": "8.16.0", "@typescript-eslint/parser": "8.16.0", "builtin-modules": "4.0.0", "esbuild": "0.24.0", + "eslint": "^9.16.0", + "eslint-plugin-yml": "^1.16.0", "jest": "^29.7.0", - "obsidian": "*", + "obsidian": "^1.7.2", "process": "^0.11.10", - "ts-jest": "^29.1.4", + "ts-jest": "^29.2.5", "tslib": "2.8.1", "typescript": "5.7.2" } @@ -40,13 +42,14 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.7.tgz", - "integrity": "sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/highlight": "^7.25.7", + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", "picocolors": "^1.0.0" }, "engines": { @@ -54,9 +57,9 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.8.tgz", - "integrity": "sha512-ZsysZyXY4Tlx+Q53XdnOFmqwfB9QDTHYxaZYajWRoBLuLEAwI2UIbtxOjWh/cFaa9IKUlcB+DDuoskLuKu56JA==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.3.tgz", + "integrity": "sha512-nHIxvKPniQXpmQLb0vhY3VaFb3S0YrTAwpOWJZh1wn3oJPjJk9Asva204PsBdmAE8vpzfHudT8DB0scYvy9q0g==", "dev": true, "license": "MIT", "engines": { @@ -64,22 +67,22 @@ } }, "node_modules/@babel/core": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.8.tgz", - "integrity": "sha512-Oixnb+DzmRT30qu9d3tJSQkxuygWm32DFykT4bRoORPa9hZ/L4KhVB/XiRm6KG+roIEM7DBQlmg27kw2HZkdZg==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz", + "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", "dev": true, "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.25.7", - "@babel/generator": "^7.25.7", - "@babel/helper-compilation-targets": "^7.25.7", - "@babel/helper-module-transforms": "^7.25.7", - "@babel/helpers": "^7.25.7", - "@babel/parser": "^7.25.8", - "@babel/template": "^7.25.7", - "@babel/traverse": "^7.25.7", - "@babel/types": "^7.25.8", + "@babel/code-frame": "^7.26.0", + "@babel/generator": "^7.26.0", + "@babel/helper-compilation-targets": "^7.25.9", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.0", + "@babel/parser": "^7.26.0", + "@babel/template": "^7.25.9", + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.26.0", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -105,13 +108,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.7.tgz", - "integrity": "sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.3.tgz", + "integrity": "sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.25.7", + "@babel/parser": "^7.26.3", + "@babel/types": "^7.26.3", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" @@ -121,14 +125,14 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.7.tgz", - "integrity": "sha512-DniTEax0sv6isaw6qSQSfV4gVRNtw2rte8HHM45t9ZR0xILaufBRNkpMifCRiAPyvL4ACD6v0gfCwCmtOQaV4A==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz", + "integrity": "sha512-j9Db8Suy6yV/VHa4qzrj9yZfZxhLWQdVnRlXxmKLYlhWUVB1sB2G5sxuWYXk/whHD9iW76PmNzxZ4UCnTQTVEQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.25.7", - "@babel/helper-validator-option": "^7.25.7", + "@babel/compat-data": "^7.25.9", + "@babel/helper-validator-option": "^7.25.9", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" @@ -148,30 +152,29 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.7.tgz", - "integrity": "sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/traverse": "^7.25.7", - "@babel/types": "^7.25.7" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.7.tgz", - "integrity": "sha512-k/6f8dKG3yDz/qCwSM+RKovjMix563SLxQFo0UhRNo239SP6n9u5/eLtKD6EAjwta2JHJ49CsD8pms2HdNiMMQ==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.25.7", - "@babel/helper-simple-access": "^7.25.7", - "@babel/helper-validator-identifier": "^7.25.7", - "@babel/traverse": "^7.25.7" + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -181,33 +184,19 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.7.tgz", - "integrity": "sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-simple-access": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.25.7.tgz", - "integrity": "sha512-FPGAkJmyoChQeM+ruBGIDyrT2tKfZJO8NcxdC+CWNJi7N8/rZpSxK7yvBJ5O/nF1gfu5KzN7VKG3YVSLFfRSxQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz", + "integrity": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==", "dev": true, "license": "MIT", - "dependencies": { - "@babel/traverse": "^7.25.7", - "@babel/types": "^7.25.7" - }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz", - "integrity": "sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", "dev": true, "license": "MIT", "engines": { @@ -215,9 +204,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz", - "integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", "dev": true, "license": "MIT", "engines": { @@ -225,9 +214,9 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.7.tgz", - "integrity": "sha512-ytbPLsm+GjArDYXJ8Ydr1c/KJuutjF2besPNbIZnZ6MKUxi/uTA22t2ymmA4WFjZFpjiAMO0xuuJPqK2nvDVfQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", "dev": true, "license": "MIT", "engines": { @@ -235,121 +224,27 @@ } }, "node_modules/@babel/helpers": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.7.tgz", - "integrity": "sha512-Sv6pASx7Esm38KQpF/U/OXLwPPrdGHNKoeblRxgZRLXnAtnkEe4ptJPDtAZM7fBLadbc1Q07kQpSiGQ0Jg6tRA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/template": "^7.25.7", - "@babel/types": "^7.25.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.7.tgz", - "integrity": "sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.0.tgz", + "integrity": "sha512-tbhNuIxNcVb21pInl3ZSjksLCvgdZy9KwJ8brv993QtIVKJBBkYXz4q4ZbAv31GdnC+R90np23L5FbEBlthAEw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.25.7", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "@babel/template": "^7.25.9", + "@babel/types": "^7.26.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, - "license": "MIT", - "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, - "license": "MIT", - "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, - "license": "MIT", - "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": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "license": "MIT" - }, - "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": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "license": "MIT", - "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": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "license": "MIT", - "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, - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/parser": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.8.tgz", - "integrity": "sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz", + "integrity": "sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.25.8" + "@babel/types": "^7.26.3" }, "bin": { "parser": "bin/babel-parser.js" @@ -414,13 +309,13 @@ } }, "node_modules/@babel/plugin-syntax-import-attributes": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.25.7.tgz", - "integrity": "sha512-AqVo+dguCgmpi/3mYBdu9lkngOBlQ2w2vnNpa6gfiCxQZLzV4ZbhsXitJ2Yblkoe1VQwtHSaNmIaGll/26YWRw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz", + "integrity": "sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -456,13 +351,13 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.7.tgz", - "integrity": "sha512-ruZOnKO+ajVL/MVx+PwNBPOkrnXTXoWMtte1MBpegfCArhqOe3Bj52avVj1huLLxNKYKXYaSxZ2F+woK1ekXfw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz", + "integrity": "sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -582,13 +477,13 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.7.tgz", - "integrity": "sha512-rR+5FDjpCHqqZN2bzZm18bVYGaejGq5ZkpVCJLXor/+zlSrSoc4KWcHI0URVWjl/68Dyr1uwZUz/1njycEAv9g==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz", + "integrity": "sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -598,32 +493,32 @@ } }, "node_modules/@babel/template": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.7.tgz", - "integrity": "sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", + "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.7", - "@babel/parser": "^7.25.7", - "@babel/types": "^7.25.7" + "@babel/code-frame": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.7.tgz", - "integrity": "sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg==", + "version": "7.26.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.4.tgz", + "integrity": "sha512-fH+b7Y4p3yqvApJALCPJcwb0/XaOSgtK4pzV6WVjPR5GLFQBRI7pfoX2V2iM48NXvX07NUxxm1Vw98YjqTcU5w==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.7", - "@babel/generator": "^7.25.7", - "@babel/parser": "^7.25.7", - "@babel/template": "^7.25.7", - "@babel/types": "^7.25.7", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.3", + "@babel/parser": "^7.26.3", + "@babel/template": "^7.25.9", + "@babel/types": "^7.26.3", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -642,15 +537,14 @@ } }, "node_modules/@babel/types": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.8.tgz", - "integrity": "sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz", + "integrity": "sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.25.7", - "@babel/helper-validator-identifier": "^7.25.7", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -664,22 +558,25 @@ "license": "MIT" }, "node_modules/@codemirror/state": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.4.1.tgz", - "integrity": "sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.5.0.tgz", + "integrity": "sha512-MwBHVK60IiIHDcoMet78lxt6iw5gJOGSbNbOIVBHWVXIH4/Nq1+GQgLLGgI1KlnN86WDXsPudVaqYHKBIx7Eyw==", "dev": true, "license": "MIT", - "peer": true + "peer": true, + "dependencies": { + "@marijn/find-cluster-break": "^1.0.0" + } }, "node_modules/@codemirror/view": { - "version": "6.34.1", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.34.1.tgz", - "integrity": "sha512-t1zK/l9UiRqwUNPm+pdIT0qzJlzuVckbTEMVNFhfWkGiBQClstzg+78vedCvLSX0xJEZ6lwZbPpnljL7L6iwMQ==", + "version": "6.35.3", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.35.3.tgz", + "integrity": "sha512-ScY7L8+EGdPl4QtoBiOzE4FELp7JmNUsBvgBcCakXWM2uiv/K89VAzU3BMDscf0DsACLvTKePbd5+cFDTcei6g==", "dev": true, "license": "MIT", "peer": true, "dependencies": { - "@codemirror/state": "^6.4.0", + "@codemirror/state": "^6.5.0", "style-mod": "^4.1.0", "w3c-keyname": "^2.2.4" } @@ -1093,25 +990,28 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", "dev": true, "license": "MIT", "dependencies": { - "eslint-visitor-keys": "^3.3.0" + "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/regexpp": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", - "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true, "license": "MIT", "engines": { @@ -1119,14 +1019,13 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", - "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.1.tgz", + "integrity": "sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { - "@eslint/object-schema": "^2.1.4", + "@eslint/object-schema": "^2.1.5", "debug": "^4.3.1", "minimatch": "^3.1.2" }, @@ -1140,7 +1039,6 @@ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1152,7 +1050,6 @@ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1161,23 +1058,24 @@ } }, "node_modules/@eslint/core": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.7.0.tgz", - "integrity": "sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.1.tgz", + "integrity": "sha512-GuUdqkyyzQI5RMIWkHhvTWLCyLo1jNK3vzkSyaExH5kHPDHcuL2VOpHjmMY+y3+NC69qAKToBqldTBgYeLSr9Q==", "dev": true, "license": "Apache-2.0", - "peer": true, + "dependencies": { + "@types/json-schema": "^7.0.15" + }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/eslintrc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", - "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", + "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -1202,7 +1100,6 @@ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1214,7 +1111,6 @@ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1223,34 +1119,31 @@ } }, "node_modules/@eslint/js": { - "version": "9.13.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.13.0.tgz", - "integrity": "sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==", + "version": "9.16.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.16.0.tgz", + "integrity": "sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/object-schema": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", - "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.5.tgz", + "integrity": "sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==", "dev": true, "license": "Apache-2.0", - "peer": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.1.tgz", - "integrity": "sha512-HFZ4Mp26nbWk9d/BpvP0YNL6W4UoZF0VFcTw/aPPA8RpOxeFQgK+ClABGgAUXs9Y/RGX/l1vOmrqz1MQt9MNuw==", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.4.tgz", + "integrity": "sha512-zSkKow6H5Kdm0ZUQUB2kV5JIXqoG0+uH5YADhaEHswm664N9Db8dXSi0nMJpacpMf+MyyglF1vnZohpEg5yUtg==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "levn": "^0.4.1" }, @@ -1259,38 +1152,49 @@ } }, "node_modules/@humanfs/core": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.0.tgz", - "integrity": "sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw==", + "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", - "peer": true, "engines": { "node": ">=18.18.0" } }, "node_modules/@humanfs/node": { - "version": "0.16.5", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.5.tgz", - "integrity": "sha512-KSPA4umqSG4LHYRodq31VDwKAvaTF4xmVlzM8Aeh4PlU1JQ3IG0wiA8C25d3RQ9nJyM3mBHyI53K06VVL/oFFg==", + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { - "@humanfs/core": "^0.19.0", + "@humanfs/core": "^0.19.1", "@humanwhocodes/retry": "^0.3.0" }, "engines": { "node": ">=18.18.0" } }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "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", - "peer": true, "engines": { "node": ">=12.22" }, @@ -1300,12 +1204,11 @@ } }, "node_modules/@humanwhocodes/retry": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", - "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", + "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", "dev": true, "license": "Apache-2.0", - "peer": true, "engines": { "node": ">=18.18" }, @@ -1724,9 +1627,9 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", "dev": true, "license": "MIT", "dependencies": { @@ -1790,6 +1693,14 @@ "node": ">=12" } }, + "node_modules/@marijn/find-cluster-break": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.2.tgz", + "integrity": "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -1959,6 +1870,7 @@ "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", "dev": true, + "license": "MIT", "dependencies": { "expect": "^29.0.0", "pretty-format": "^29.0.0" @@ -1976,13 +1888,12 @@ "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@types/node": { - "version": "22.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", - "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", + "version": "22.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.2.tgz", + "integrity": "sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2235,12 +2146,11 @@ } }, "node_modules/acorn": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.13.0.tgz", - "integrity": "sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -2254,7 +2164,6 @@ "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "license": "MIT", - "peer": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -2265,7 +2174,6 @@ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -2338,8 +2246,7 @@ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true, - "license": "Python-2.0", - "peer": true + "license": "Python-2.0" }, "node_modules/async": { "version": "3.2.6", @@ -2505,9 +2412,9 @@ } }, "node_modules/browserslist": { - "version": "4.24.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.0.tgz", - "integrity": "sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A==", + "version": "4.24.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", + "integrity": "sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==", "dev": true, "funding": [ { @@ -2525,10 +2432,10 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001663", - "electron-to-chromium": "^1.5.28", + "caniuse-lite": "^1.0.30001669", + "electron-to-chromium": "^1.5.41", "node-releases": "^2.0.18", - "update-browserslist-db": "^1.1.0" + "update-browserslist-db": "^1.1.1" }, "bin": { "browserslist": "cli.js" @@ -2601,9 +2508,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001669", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz", - "integrity": "sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w==", + "version": "1.0.30001687", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001687.tgz", + "integrity": "sha512-0S/FDhf4ZiqrTUiQ39dKeUjYRjkv7lOZU1Dgif2rIqrTzX/1wV2hfKu9TOm1IHkdSijfLswxTFzl/cvir+SLSQ==", "dev": true, "funding": [ { @@ -2761,9 +2668,9 @@ } }, "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==", + "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": { @@ -2776,9 +2683,9 @@ } }, "node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -2813,8 +2720,7 @@ "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", - "peer": true + "license": "MIT" }, "node_modules/deepmerge": { "version": "4.3.1", @@ -2863,9 +2769,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.41", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.41.tgz", - "integrity": "sha512-dfdv/2xNjX0P8Vzme4cfzHqnPm5xsZXwsolTYr0eyW18IUmNyG08vL+fttvinTfhKfIKdRoqkDIC9e9iWQCNYQ==", + "version": "1.5.73", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.73.tgz", + "integrity": "sha512-8wGNxG9tAG5KhGd3eeA0o6ixhiNdgr0DcHWm85XPCphwZgD1lIEoi6t3VERayWao7SF7AAZTw6oARGJeVjH8Kg==", "dev": true, "license": "ISC" }, @@ -2955,7 +2861,6 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=10" }, @@ -2964,33 +2869,32 @@ } }, "node_modules/eslint": { - "version": "9.13.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.13.0.tgz", - "integrity": "sha512-EYZK6SX6zjFHST/HRytOdA/zE72Cq/bfw45LSyuwrdvcclb/gqV8RRQxywOBEWO2+WDpva6UZa4CcDeJKzUCFA==", + "version": "9.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.16.0.tgz", + "integrity": "sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.11.0", - "@eslint/config-array": "^0.18.0", - "@eslint/core": "^0.7.0", - "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.13.0", - "@eslint/plugin-kit": "^0.2.0", - "@humanfs/node": "^0.16.5", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.0", + "@eslint/core": "^0.9.0", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "9.16.0", + "@eslint/plugin-kit": "^0.2.3", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.3.1", + "@humanwhocodes/retry": "^0.4.1", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.5", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.1.0", - "eslint-visitor-keys": "^4.1.0", - "espree": "^10.2.0", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -3004,8 +2908,7 @@ "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" @@ -3025,13 +2928,51 @@ } } }, + "node_modules/eslint-compat-utils": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.6.4.tgz", + "integrity": "sha512-/u+GQt8NMfXO8w17QendT4gvO5acfxQsAKirAt0LVxDnr2N8YLCVbregaNc/Yhp7NM128DwCaRvr8PLDfeNkQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, + "node_modules/eslint-plugin-yml": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-yml/-/eslint-plugin-yml-1.16.0.tgz", + "integrity": "sha512-t4MNCetPjTn18/fUDlQ/wKkcYjnuLYKChBrZ0qUaNqRigVqChHWzTP8SrfFi5s4keX3vdlkWRSu8zHJMdKwxWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.2", + "eslint-compat-utils": "^0.6.0", + "lodash": "^4.17.21", + "natural-compare": "^1.4.0", + "yaml-eslint-parser": "^1.2.1" + }, + "engines": { + "node": "^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, "node_modules/eslint-scope": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.1.0.tgz", - "integrity": "sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -3062,19 +3003,17 @@ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", - "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, "license": "Apache-2.0", - "peer": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -3088,7 +3027,6 @@ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -3097,16 +3035,15 @@ } }, "node_modules/espree": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.2.0.tgz", - "integrity": "sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { - "acorn": "^8.12.0", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.1.0" + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3116,12 +3053,11 @@ } }, "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", - "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, "license": "Apache-2.0", - "peer": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -3149,7 +3085,6 @@ "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "estraverse": "^5.1.0" }, @@ -3163,7 +3098,6 @@ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "estraverse": "^5.2.0" }, @@ -3177,7 +3111,6 @@ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "engines": { "node": ">=4.0" } @@ -3188,7 +3121,6 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -3248,8 +3180,7 @@ "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", - "peer": true + "license": "MIT" }, "node_modules/fast-glob": { "version": "3.3.2", @@ -3293,8 +3224,7 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/fastq": { "version": "1.17.1", @@ -3322,7 +3252,6 @@ "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "flat-cache": "^4.0.0" }, @@ -3372,7 +3301,6 @@ "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -3390,7 +3318,6 @@ "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.4" @@ -3400,12 +3327,11 @@ } }, "node_modules/flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", "dev": true, - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/fs.realpath": { "version": "1.0.0", @@ -3510,7 +3436,6 @@ "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "is-glob": "^4.0.3" }, @@ -3548,7 +3473,6 @@ "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=18" }, @@ -3626,7 +3550,6 @@ "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -4493,7 +4416,6 @@ "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "argparse": "^2.0.1" }, @@ -4509,9 +4431,9 @@ "license": "Apache-2.0" }, "node_modules/jsesc": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", - "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "dev": true, "license": "MIT", "bin": { @@ -4526,8 +4448,7 @@ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", @@ -4541,16 +4462,14 @@ "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", - "peer": 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", - "peer": true + "license": "MIT" }, "node_modules/json5": { "version": "2.2.3", @@ -4571,7 +4490,6 @@ "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "json-buffer": "3.0.1" } @@ -4602,7 +4520,6 @@ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -4624,7 +4541,6 @@ "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "p-locate": "^5.0.0" }, @@ -4635,6 +4551,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "license": "MIT" + }, "node_modules/lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -4647,8 +4570,7 @@ "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/lru-cache": { "version": "5.1.1", @@ -4782,9 +4704,9 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", - "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", "dev": true, "license": "MIT" }, @@ -4858,7 +4780,6 @@ "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -4893,7 +4814,6 @@ "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "p-limit": "^3.0.2" }, @@ -4920,7 +4840,6 @@ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "callsites": "^3.0.0" }, @@ -5089,7 +5008,6 @@ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">= 0.8.0" } @@ -5152,7 +5070,6 @@ "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6" } @@ -5259,15 +5176,14 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=4" } }, "node_modules/resolve.exports": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", - "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", + "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", "dev": true, "license": "MIT", "engines": { @@ -5568,14 +5484,6 @@ "node": "*" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "license": "MIT", - "peer": true - }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -5583,16 +5491,6 @@ "dev": true, "license": "BSD-3-Clause" }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -5607,9 +5505,9 @@ } }, "node_modules/ts-api-utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", - "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", + "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", "dev": true, "license": "MIT", "engines": { @@ -5672,7 +5570,8 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "dev": true + "dev": true, + "license": "0BSD" }, "node_modules/type-check": { "version": "0.4.0", @@ -5680,7 +5579,6 @@ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "prelude-ls": "^1.2.1" }, @@ -5769,7 +5667,6 @@ "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "punycode": "^2.1.0" } @@ -5829,7 +5726,6 @@ "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -5890,6 +5786,37 @@ "dev": true, "license": "ISC" }, + "node_modules/yaml": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", + "integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/yaml-eslint-parser": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/yaml-eslint-parser/-/yaml-eslint-parser-1.2.3.tgz", + "integrity": "sha512-4wZWvE398hCP7O8n3nXKu/vdq1HcH01ixYlCREaJL5NUMwQ0g3MaGFUBNSlmBtKmhbtVG/Cm6lyYmSVTEVil8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.0.0", + "lodash": "^4.17.21", + "yaml": "^2.0.0" + }, + "engines": { + "node": "^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + } + }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", diff --git a/package.json b/package.json index f0d9bfd6..e39834da 100644 --- a/package.json +++ b/package.json @@ -19,17 +19,19 @@ "devDependencies": { "@js-temporal/polyfill": "^0.4.4", "@types/jest": "^29.5.14", - "@types/node": "^22.10.1", + "@types/js-yaml": "^4.0.9", + "@types/node": "^22.10.2", "@typescript-eslint/eslint-plugin": "8.16.0", "@typescript-eslint/parser": "8.16.0", "builtin-modules": "4.0.0", "esbuild": "0.24.0", + "eslint": "^9.16.0", + "eslint-plugin-yml": "^1.16.0", "jest": "^29.7.0", - "obsidian": "latest", + "obsidian": "^1.7.2", "process": "^0.11.10", - "ts-jest": "^29.1.4", + "ts-jest": "^29.2.5", "tslib": "2.8.1", - "typescript": "5.7.2", - "@types/js-yaml": "^4.0.9" + "typescript": "5.7.2" } } diff --git a/src/CalloutConverter.ts b/src/CalloutConverter.ts index 6e58c088..56049119 100644 --- a/src/CalloutConverter.ts +++ b/src/CalloutConverter.ts @@ -7,9 +7,11 @@ export class CalloutConverter implements Converter { } } -const jekyllReplacer = (match: string, p1: string, p2: string, p3: string) => `${p3}\n{: .prompt-${replaceKeyword(p1)}}`; +const jekyllReplacer = (match: string, p1: string, p2: string, p3: string) => + `${p3}\n{: .prompt-${replaceKeyword(p1)}}`; -const convertCalloutSyntaxToChirpy = (content: string) => content.replace(ObsidianRegex.CALLOUT, jekyllReplacer); +const convertCalloutSyntaxToChirpy = (content: string) => + content.replace(ObsidianRegex.CALLOUT, jekyllReplacer); const jekyllCalloutMap = new Map(); jekyllCalloutMap.set('note', 'info'); @@ -41,12 +43,18 @@ function replaceKeyword(target: string) { return jekyllCalloutMap.get(target.toLowerCase()) || 'info'; } -const docusaurusReplacer = (match: string, p1: string, p2: string, p3: string) => { +const docusaurusReplacer = ( + match: string, + p1: string, + p2: string, + p3: string, +) => { const title = p2 ? `[${p2.trim()}]` : ''; return `:::${replaceDocusaurusKeyword(p1)}${title}\n\n${replaceDocusaurusContents(p3)}\n\n:::`; }; -export const convertDocusaurusCallout = (input: string) => input.replace(ObsidianRegex.CALLOUT, docusaurusReplacer); +export const convertDocusaurusCallout = (input: string) => + input.replace(ObsidianRegex.CALLOUT, docusaurusReplacer); const replaceDocusaurusKeyword = (target: string) => docusaurusCalloutMap[target.toLowerCase()] || 'note'; diff --git a/src/CommentsConverter.ts b/src/CommentsConverter.ts index aa7b400c..f5958539 100644 --- a/src/CommentsConverter.ts +++ b/src/CommentsConverter.ts @@ -2,10 +2,16 @@ import { Converter } from './core/Converter'; import { ObsidianRegex } from './core/ObsidianRegex'; export class CommentsConverter implements Converter { - public convert(input: string): string { - return input.replace(ObsidianRegex.COMMENT, (match, comments) => ``); + return input.replace( + ObsidianRegex.COMMENT, + (match, comments) => ``, + ); } } -export const convertComments = (input: string) => input.replace(ObsidianRegex.COMMENT, (match, comments) => ``); +export const convertComments = (input: string) => + input.replace( + ObsidianRegex.COMMENT, + (match, comments) => ``, + ); diff --git a/src/CurlyBraceConverter.ts b/src/CurlyBraceConverter.ts index eda8de3b..0d78e2dd 100644 --- a/src/CurlyBraceConverter.ts +++ b/src/CurlyBraceConverter.ts @@ -2,7 +2,6 @@ import { Converter } from './core/Converter'; import { ObsidianRegex } from './core/ObsidianRegex'; export class CurlyBraceConverter implements Converter { - private readonly isEnable: boolean; constructor(isEnable = false) { @@ -13,7 +12,10 @@ export class CurlyBraceConverter implements Converter { if (!this.isEnable) { return input; } - return input.replace(ObsidianRegex.DOUBLE_CURLY_BRACES, (match, content) => `{% raw %}${match}{% endraw %}`); + return input.replace( + ObsidianRegex.DOUBLE_CURLY_BRACES, + (match, content) => `{% raw %}${match}{% endraw %}`, + ); } } @@ -21,5 +23,8 @@ export const convertCurlyBrace = (isEnable: boolean, input: string) => { if (!isEnable) { return input; } - return input.replace(ObsidianRegex.DOUBLE_CURLY_BRACES, (match, content) => `{% raw %}${match}{% endraw %}`); + return input.replace( + ObsidianRegex.DOUBLE_CURLY_BRACES, + (match, content) => `{% raw %}${match}{% endraw %}`, + ); }; diff --git a/src/FootnotesConverter.ts b/src/FootnotesConverter.ts index 1d2a37dd..4be934fb 100644 --- a/src/FootnotesConverter.ts +++ b/src/FootnotesConverter.ts @@ -2,7 +2,6 @@ import { ObsidianRegex } from './core/ObsidianRegex'; import { Converter } from './core/Converter'; export class FootnotesConverter implements Converter { - convert(input: string): string { return input.replace(ObsidianRegex.SIMPLE_FOOTNOTE, (match, key) => { return `[^fn-nth-${key}]`; diff --git a/src/FrontMatterConverter.ts b/src/FrontMatterConverter.ts index dd791d17..4bcfe5f4 100644 --- a/src/FrontMatterConverter.ts +++ b/src/FrontMatterConverter.ts @@ -46,25 +46,26 @@ const convert = (frontMatter: FrontMatter) => { if (fm.categories && JSON.stringify(fm.categories).startsWith('[')) { fm.categories = `${JSON.stringify(fm.categories) .replace(/,/g, ', ') - .replace(/"/g, '') - }`; + .replace(/"/g, '')}`; } if (fm.authors) { const authorList = fm.authors.split(',').map(author => author.trim()); - fm.authors = authorList.length > 1 ? `[${authorList.join(', ')}]` : authorList[0]; + fm.authors = + authorList.length > 1 ? `[${authorList.join(', ')}]` : authorList[0]; } // if fm.tags is array if (fm.tags) { - fm.tags = Array.isArray(fm.tags) ? `[${fm.tags.join(', ')}]` : `[${fm.tags}]`; + fm.tags = Array.isArray(fm.tags) + ? `[${fm.tags.join(', ')}]` + : `[${fm.tags}]`; } return fm; }; export class FrontMatterConverter implements Converter { - private readonly fileName: string; private readonly resourcePath: string; private readonly isEnableBanner: boolean; @@ -79,7 +80,8 @@ export class FrontMatterConverter implements Converter { this.fileName = fileName; this.resourcePath = resourcePath; this.isEnableBanner = isEnableBanner; - this.isEnableUpdateFrontmatterTimeOnEdit = isEnableUpdateFrontmatterTimeOnEdit; + this.isEnableUpdateFrontmatterTimeOnEdit = + isEnableUpdateFrontmatterTimeOnEdit; } parseFrontMatter(content: string): [FrontMatter, string] { @@ -111,7 +113,6 @@ export class FrontMatterConverter implements Converter { return join(result, body); } - } function convertImageFrontMatter( @@ -132,16 +133,26 @@ function convertImageFrontMatter( if (match) { frontMatter.image = `${match[1]}.${match[2]}`; } - frontMatter.image = convertImagePath(fileName, frontMatter.image, resourcePath); + frontMatter.image = convertImagePath( + fileName, + frontMatter.image, + resourcePath, + ); return frontMatter; } - -function convertImagePath(postTitle: string, imagePath: string, resourcePath: string): string { +function convertImagePath( + postTitle: string, + imagePath: string, + resourcePath: string, +): string { return `/${resourcePath}/${postTitle}/${imagePath}`; } -function replaceDateFrontMatter(frontMatter: FrontMatter, isEnable: boolean): FrontMatter { +function replaceDateFrontMatter( + frontMatter: FrontMatter, + isEnable: boolean, +): FrontMatter { if (!isEnable || frontMatter.updated === undefined) { return frontMatter; } @@ -172,8 +183,5 @@ export const convertFrontMatter = (input: string, authors?: string) => { frontMatter.authors = authors; } - return join( - convert({ ...frontMatter }), - body, - ); + return join(convert({ ...frontMatter }), body); }; diff --git a/src/ResourceLinkConverter.ts b/src/ResourceLinkConverter.ts index 5edb9940..c0f15d1f 100644 --- a/src/ResourceLinkConverter.ts +++ b/src/ResourceLinkConverter.ts @@ -10,13 +10,22 @@ export class ResourceLinkConverter implements Converter { private readonly absolutePath: string; private readonly attachmentsFolder: string; private readonly relativeResourcePath: string; + private readonly liquidFilterOptions: { useRelativeUrl: boolean }; - constructor(fileName: string, resourcePath: string, absolutePath: string, attachmentsFolder: string, relativeResourcePath: string) { + constructor( + fileName: string, + resourcePath: string, + absolutePath: string, + attachmentsFolder: string, + relativeResourcePath: string, + liquidFilterOptions?: { useRelativeUrl: boolean }, + ) { this.fileName = fileName; this.resourcePath = resourcePath; this.absolutePath = absolutePath; this.attachmentsFolder = attachmentsFolder; this.relativeResourcePath = relativeResourcePath; + this.liquidFilterOptions = liquidFilterOptions ?? { useRelativeUrl: false }; } convert(input: string): string { @@ -26,11 +35,11 @@ export class ResourceLinkConverter implements Converter { if (!(resourceNames === undefined || resourceNames.length === 0)) { fs.mkdirSync(resourcePath, { recursive: true }); } - resourceNames?.forEach((resourceName) => { + resourceNames?.forEach(resourceName => { fs.copyFile( `${this.absolutePath}/${this.attachmentsFolder}/${resourceName}`, - `${resourcePath}/${(resourceName.replace(/\s/g, '-'))}`, - (err) => { + `${resourcePath}/${resourceName.replace(/\s/g, '-')}`, + err => { if (err) { // ignore error console.error(err); @@ -40,16 +49,25 @@ export class ResourceLinkConverter implements Converter { ); }); - const replacer = (match: string, - contents: string, - suffix: string, - width: string | undefined, - height: string | undefined, - space: string | undefined, - caption: string | undefined) => - `![image](/${this.relativeResourcePath}/${sanitizedFileName}/${contents.replace(/\s/g, '-')}.${suffix})` - + `${convertImageSize(width, height)}` - + `${convertImageCaption(caption)}`; + const replacer = ( + match: string, + contents: string, + suffix: string, + width: string | undefined, + height: string | undefined, + space: string | undefined, + caption: string | undefined, + ) => { + const imagePath = `/${this.relativeResourcePath}/${sanitizedFileName}/${contents.replace(/\s/g, '-')}.${suffix}`; + const imageUrl = this.liquidFilterOptions.useRelativeUrl + ? `{{ "${imagePath}" | relative_url }}` + : imagePath; + return ( + `![image](${imageUrl})` + + `${convertImageSize(width, height)}` + + `${convertImageCaption(caption)}` + ); + }; return input.replace(ObsidianRegex.ATTACHMENT_LINK, replacer); } @@ -60,10 +78,15 @@ export function extractResourceNames(content: string) { if (result === null) { return undefined; } - return result.map((imageLink) => imageLink.replace(ObsidianRegex.ATTACHMENT_LINK, '$1.$2')); + return result.map(imageLink => + imageLink.replace(ObsidianRegex.ATTACHMENT_LINK, '$1.$2'), + ); } -function convertImageSize(width: string | undefined, height: string | undefined) { +function convertImageSize( + width: string | undefined, + height: string | undefined, +) { if (width === undefined || width.length === 0) { return ''; } diff --git a/src/WikiLinkConverter.ts b/src/WikiLinkConverter.ts index bf663c49..ed6e4482 100644 --- a/src/WikiLinkConverter.ts +++ b/src/WikiLinkConverter.ts @@ -3,12 +3,11 @@ import { Converter } from './core/Converter'; export class WikiLinkConverter implements Converter { convert(input: string): string { - return input.replace(ObsidianRegex.WIKI_LINK, (match, p1, p2) => (p2 ? p2 : p1)); + return input.replace(ObsidianRegex.WIKI_LINK, (match, p1, p2) => + p2 ? p2 : p1, + ); } } -export const convertWikiLink = - (input: string) => input.replace( - ObsidianRegex.WIKI_LINK, - (match, p1, p2) => (p2 ? p2 : p1), - ); +export const convertWikiLink = (input: string) => + input.replace(ObsidianRegex.WIKI_LINK, (match, p1, p2) => (p2 ? p2 : p1)); diff --git a/src/core/ConverterChain.ts b/src/core/ConverterChain.ts index 96bea690..da95b08d 100644 --- a/src/core/ConverterChain.ts +++ b/src/core/ConverterChain.ts @@ -3,8 +3,7 @@ import { Contents, Converter } from './Converter'; export class ConverterChain { private converters: Converter[] = []; - private constructor() { - } + private constructor() {} public static create(): ConverterChain { return new ConverterChain(); diff --git a/src/core/ObsidianRegex.ts b/src/core/ObsidianRegex.ts index 5c071f52..12e6a8d4 100644 --- a/src/core/ObsidianRegex.ts +++ b/src/core/ObsidianRegex.ts @@ -2,7 +2,7 @@ export const ObsidianRegex = { ATTACHMENT_LINK: /!\[\[([^|\]]+)\.(\w+)\|?(\d*)x?(\d*)]](\n{0,2}(_.*_))?/g, EMBEDDED_LINK: /!\[\[([\w\s-]+)[#^]*([\w\s]*)]]/g, WIKI_LINK: /(? \[!(.*)](.*)?\n(>.*)/ig, + CALLOUT: /> \[!(.*)](.*)?\n(>.*)/gi, SIMPLE_FOOTNOTE: /\[\^(\d+)]/g, COMMENT: /%%(.*?)%%/g, DOUBLE_CURLY_BRACES: /{{(.*?)}}/g, diff --git a/src/core/validation.ts b/src/core/validation.ts index bfa6ca09..04c4ea4b 100644 --- a/src/core/validation.ts +++ b/src/core/validation.ts @@ -3,32 +3,55 @@ import { Notice } from 'obsidian'; export default async (plugin: O2Plugin) => { const adapter = plugin.app.vault.adapter; - if (!await adapter.exists(plugin.obsidianPathSettings.attachmentsFolder)) { + if (!(await adapter.exists(plugin.obsidianPathSettings.attachmentsFolder))) { if (plugin.obsidianPathSettings.isAutoCreateFolder) { - new Notice(`Auto create attachments folder: ${plugin.obsidianPathSettings.attachmentsFolder}.`, 5000); + new Notice( + `Auto create attachments folder: ${plugin.obsidianPathSettings.attachmentsFolder}.`, + 5000, + ); await adapter.mkdir(plugin.obsidianPathSettings.attachmentsFolder); } else { - new Notice(`Attachments folder ${plugin.obsidianPathSettings.attachmentsFolder} does not exist.`, 5000); - throw new Error(`Attachments folder ${plugin.obsidianPathSettings.attachmentsFolder} does not exist.`); + new Notice( + `Attachments folder ${plugin.obsidianPathSettings.attachmentsFolder} does not exist.`, + 5000, + ); + throw new Error( + `Attachments folder ${plugin.obsidianPathSettings.attachmentsFolder} does not exist.`, + ); } } - if (!await adapter.exists(plugin.obsidianPathSettings.readyFolder)) { + if (!(await adapter.exists(plugin.obsidianPathSettings.readyFolder))) { if (plugin.obsidianPathSettings.isAutoCreateFolder) { - new Notice(`Auto create ready folder: ${plugin.obsidianPathSettings.readyFolder}.`, 5000); + new Notice( + `Auto create ready folder: ${plugin.obsidianPathSettings.readyFolder}.`, + 5000, + ); await adapter.mkdir(plugin.obsidianPathSettings.readyFolder); } else { - new Notice(`Ready folder ${plugin.obsidianPathSettings.readyFolder} does not exist.`, 5000); - throw new Error(`Ready folder ${plugin.obsidianPathSettings.readyFolder} does not exist.`); + new Notice( + `Ready folder ${plugin.obsidianPathSettings.readyFolder} does not exist.`, + 5000, + ); + throw new Error( + `Ready folder ${plugin.obsidianPathSettings.readyFolder} does not exist.`, + ); } } - if (!await adapter.exists(plugin.obsidianPathSettings.archiveFolder)) { + if (!(await adapter.exists(plugin.obsidianPathSettings.archiveFolder))) { if (plugin.obsidianPathSettings.isAutoCreateFolder) { - new Notice(`Auto create backup folder: ${plugin.obsidianPathSettings.archiveFolder}.`, 5000); + new Notice( + `Auto create backup folder: ${plugin.obsidianPathSettings.archiveFolder}.`, + 5000, + ); await adapter.mkdir(plugin.obsidianPathSettings.archiveFolder); } else { - new Notice(`Backup folder ${plugin.obsidianPathSettings.archiveFolder} does not exist.`, 5000); - throw new Error(`Backup folder ${plugin.obsidianPathSettings.archiveFolder} does not exist.`); + new Notice( + `Backup folder ${plugin.obsidianPathSettings.archiveFolder} does not exist.`, + 5000, + ); + throw new Error( + `Backup folder ${plugin.obsidianPathSettings.archiveFolder} does not exist.`, + ); } } }; - diff --git a/src/docusaurus/DateExtractionPattern.ts b/src/docusaurus/DateExtractionPattern.ts index a083e143..bb3d1672 100644 --- a/src/docusaurus/DateExtractionPattern.ts +++ b/src/docusaurus/DateExtractionPattern.ts @@ -8,7 +8,10 @@ * Nested folders + index.md: YYYY/MM/DD/my-blog-post-title/index.md * Date in the middle of path: category/YYYY/MM-DD-my-blog-post-title.md */ -export const DateExtractionPattern: Record = { +export const DateExtractionPattern: Record< + string, + DateExtractionPatternInterface +> = { // default pattern SINGLE: { pattern: 'YYYY-MM-DD-my-blog-post-title.md', diff --git a/src/docusaurus/docusaurus.ts b/src/docusaurus/docusaurus.ts index 78b438ed..d072dcca 100644 --- a/src/docusaurus/docusaurus.ts +++ b/src/docusaurus/docusaurus.ts @@ -1,5 +1,11 @@ import O2Plugin from '../main'; -import { copyMarkdownFile, getFilesInReady, moveFiles, parseLocalDate, vaultAbsolutePath } from '../utils'; +import { + copyMarkdownFile, + getFilesInReady, + moveFiles, + parseLocalDate, + vaultAbsolutePath, +} from '../utils'; import { Contents } from '../core/Converter'; import { convertWikiLink } from '../WikiLinkConverter'; import { convertFootnotes } from '../FootnotesConverter'; @@ -11,30 +17,24 @@ import { convertFrontMatter } from '../FrontMatterConverter'; const markPublished = async (plugin: O2Plugin) => { const filesInReady = getFilesInReady(plugin); for (const file of filesInReady) { - await plugin.app.fileManager.processFrontMatter( - file, - fm => { - if (fm.published) { - return fm; - } - fm.published = new Date().toISOString().split('T')[0]; + await plugin.app.fileManager.processFrontMatter(file, fm => { + if (fm.published) { return fm; - }, - ); + } + fm.published = new Date().toISOString().split('T')[0]; + return fm; + }); } }; const checkPublished = async (plugin: O2Plugin, file: TFile) => { let publishedDate = new Date().toISOString().split('T')[0]; - await plugin.app.fileManager.processFrontMatter( - file, - fm => { - if (fm.published) { - publishedDate = fm.published; - return fm; - } - }, - ); + await plugin.app.fileManager.processFrontMatter(file, fm => { + if (fm.published) { + publishedDate = fm.published; + return fm; + } + }); return publishedDate; }; @@ -46,24 +46,19 @@ export const convertToDocusaurus = async (plugin: O2Plugin) => { const publishedDate = await checkPublished(plugin, file); const contents: Contents = await plugin.app.vault.read(file); - const result = - convertComments( - convertDocusaurusCallout( - convertFootnotes( - convertWikiLink( - convertFrontMatter( - contents, - plugin.docusaurus.authors, - ), - ), + const result = convertComments( + convertDocusaurusCallout( + convertFootnotes( + convertWikiLink( + convertFrontMatter(contents, plugin.docusaurus.authors), ), ), - ); + ), + ); - await plugin.app.vault.modify(file, result) - .then(() => { - new Notice('Converted to Docusaurus successfully.', 5000); - }); + await plugin.app.vault.modify(file, result).then(() => { + new Notice('Converted to Docusaurus successfully.', 5000); + }); // move files to docusaurus folder await moveFiles( @@ -71,8 +66,7 @@ export const convertToDocusaurus = async (plugin: O2Plugin) => { plugin.docusaurus.targetPath(), plugin.docusaurus.pathReplacer, parseLocalDate(publishedDate), - ) - .then(async () => await markPublished(plugin)); + ).then(async () => await markPublished(plugin)); } new Notice('Moved files to Docusaurus successfully.', 5000); diff --git a/src/docusaurus/settings/DocusaurusSettings.ts b/src/docusaurus/settings/DocusaurusSettings.ts index dec4b76f..4f420ab8 100644 --- a/src/docusaurus/settings/DocusaurusSettings.ts +++ b/src/docusaurus/settings/DocusaurusSettings.ts @@ -15,10 +15,17 @@ export default class DocusaurusSettings implements O2PluginSettings { } afterPropertiesSet(): boolean { - return this.docusaurusPath !== undefined && this.docusaurusPath.length !== 0; + return ( + this.docusaurusPath !== undefined && this.docusaurusPath.length !== 0 + ); } - pathReplacer = (year: string, month: string, day: string, title: string): string => { + pathReplacer = ( + year: string, + month: string, + day: string, + title: string, + ): string => { const patternInterface = DateExtractionPattern[this.dateExtractionPattern]; return patternInterface.replacer(year, month, day, title); }; diff --git a/src/jekyll/chirpy.ts b/src/jekyll/chirpy.ts index bfd86ec4..2325f49a 100644 --- a/src/jekyll/chirpy.ts +++ b/src/jekyll/chirpy.ts @@ -13,6 +13,10 @@ import { CurlyBraceConverter } from '../CurlyBraceConverter'; import JekyllSettings from './settings/JekyllSettings'; import { convertFileName } from '../FilenameConverter'; +interface LiquidFilterOptions { + useRelativeUrl: boolean; +} + export async function convertToChirpy(plugin: O2Plugin) { const settings = plugin.jekyll as JekyllSettings; try { @@ -31,6 +35,7 @@ export async function convertToChirpy(plugin: O2Plugin) { vaultAbsolutePath(plugin), plugin.obsidianPathSettings.attachmentsFolder, settings.jekyllRelativeResourcePath, + { useRelativeUrl: false } as LiquidFilterOptions, ); const curlyBraceConverter = new CurlyBraceConverter( settings.isEnableCurlyBraceConvertMode, @@ -51,8 +56,7 @@ export async function convertToChirpy(plugin: O2Plugin) { `${vaultAbsolutePath(plugin)}/${plugin.obsidianPathSettings.readyFolder}`, settings.targetPath(), settings.pathReplacer, - ) - .then(() => new Notice('Moved files to Chirpy successfully.', 5000)); + ).then(() => new Notice('Moved files to Chirpy successfully.', 5000)); } } catch (e) { console.error(e); diff --git a/src/jekyll/settings/JekyllSettings.ts b/src/jekyll/settings/JekyllSettings.ts index 92125e0f..2bd4e3e7 100644 --- a/src/jekyll/settings/JekyllSettings.ts +++ b/src/jekyll/settings/JekyllSettings.ts @@ -3,7 +3,12 @@ import { O2PluginSettings } from '../../settings'; export default class JekyllSettings implements O2PluginSettings { private _jekyllPath: string; private _jekyllRelativeResourcePath: string; - pathReplacer(year: string, month: string, day: string, title: string): string { + pathReplacer( + year: string, + month: string, + day: string, + title: string, + ): string { return `${year}-${month}-${day}-${title}.md`; } @@ -11,10 +16,12 @@ export default class JekyllSettings implements O2PluginSettings { private _isEnableBanner: boolean; private _isEnableCurlyBraceConvertMode: boolean; private _isEnableUpdateFrontmatterTimeOnEdit: boolean; + private _isEnableRelativeUrl: boolean; constructor() { this._jekyllPath = ''; this._jekyllRelativeResourcePath = 'assets/img'; + this._isEnableRelativeUrl = false; } get jekyllPath(): string { @@ -57,6 +64,14 @@ export default class JekyllSettings implements O2PluginSettings { this._isEnableUpdateFrontmatterTimeOnEdit = value; } + get isEnableRelativeUrl(): boolean { + return this._isEnableRelativeUrl; + } + + set isEnableRelativeUrl(value: boolean) { + this._isEnableRelativeUrl = value; + } + targetPath(): string { return `${this._jekyllPath}/_posts`; } diff --git a/src/main.ts b/src/main.ts index 179c404f..f1ac9a25 100644 --- a/src/main.ts +++ b/src/main.ts @@ -19,7 +19,10 @@ export default class O2Plugin extends Plugin { id: 'grammar-transformation', name: 'Grammar Transformation', checkCallback: (checking: boolean) => { - if (this.jekyll.afterPropertiesSet() || this.docusaurus.afterPropertiesSet()) { + if ( + this.jekyll.afterPropertiesSet() || + this.docusaurus.afterPropertiesSet() + ) { if (checking) { return true; } @@ -37,14 +40,18 @@ export default class O2Plugin extends Plugin { this.addSettingTab(new O2SettingTab(this.app, this)); } - onunload() { - - } + onunload() {} async loadSettings() { - this.obsidianPathSettings = Object.assign(new ObsidianPathSettings(), await this.loadData()); + this.obsidianPathSettings = Object.assign( + new ObsidianPathSettings(), + await this.loadData(), + ); this.jekyll = Object.assign(new JekyllSettings(), await this.loadData()); - this.docusaurus = Object.assign(new DocusaurusSettings(), await this.loadData()); + this.docusaurus = Object.assign( + new DocusaurusSettings(), + await this.loadData(), + ); } async saveSettings() { @@ -59,12 +66,10 @@ export default class O2Plugin extends Plugin { const o2ConversionCommand = async (plugin: O2Plugin) => { await validateSettings(plugin); if (plugin.jekyll.afterPropertiesSet()) { - await convertToChirpy(plugin) - .finally(() => cleanUp(plugin)); + await convertToChirpy(plugin).finally(() => cleanUp(plugin)); } if (plugin.docusaurus.afterPropertiesSet()) { - await convertToDocusaurus(plugin) - .finally(() => cleanUp(plugin)); + await convertToDocusaurus(plugin).finally(() => cleanUp(plugin)); } }; diff --git a/src/settings.ts b/src/settings.ts index a73ecbe5..ecbf90b8 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -36,14 +36,14 @@ export class O2SettingTab extends PluginSettingTab { text: 'Settings for O2 plugin', }); - this.containerEl.createEl('h2', { + this.containerEl.createEl('h3', { text: 'Path Settings', }); this.addReadyFolderSetting(); this.addArchiveFolderSetting(); this.addAttachmentsFolderSetting(); - this.containerEl.createEl('h2', { + this.containerEl.createEl('h3', { text: 'Features', }); this.enableCurlyBraceSetting(); @@ -52,14 +52,19 @@ export class O2SettingTab extends PluginSettingTab { this.enableAutoArchiveSetting(); // jekyll settings - this.containerEl.createEl('h2', { + this.containerEl.createEl('h3', { text: 'Jekyll', }); this.addJekyllPathSetting(); this.addJekyllRelativeResourcePathSetting(); + //// liquidFilter; + this.containerEl.createEl('h5', { + text: 'Liquid Filter', + }); + this.addJekyllRelativeUrlSetting(); // docusaurus settings - this.containerEl.createEl('h2', { + this.containerEl.createEl('h3', { text: 'Docusaurus', }); this.addDocusaurusPathSetting(); @@ -71,39 +76,49 @@ export class O2SettingTab extends PluginSettingTab { const docusaurus = this.plugin.docusaurus as DocusaurusSettings; new Setting(this.containerEl) .setName('Docusaurus authors') - .setDesc('Author(s) for Docusaurus front matter. For multiple authors, separate with commas.') - .addText(text => text - .setPlaceholder('jmarcey, slorber') - .setValue(docusaurus.authors) - .onChange(async (value) => { - docusaurus.authors = value; - await this.plugin.saveSettings(); - })); + .setDesc( + 'Author(s) for Docusaurus front matter. For multiple authors, separate with commas.', + ) + .addText(text => + text + .setPlaceholder('jmarcey, slorber') + .setValue(docusaurus.authors) + .onChange(async value => { + docusaurus.authors = value; + await this.plugin.saveSettings(); + }), + ); } private enableUpdateFrontmatterTimeOnEditSetting() { const jekyllSetting = this.plugin.jekyll as JekyllSettings; new Setting(this.containerEl) .setName('Replace date frontmatter to updated time') - .setDesc('If \'updated\' frontmatter exists, replace the value of \'date\' frontmatter with the value of \'updated\' frontmatter.') - .addToggle(toggle => toggle - .setValue(jekyllSetting.isEnableUpdateFrontmatterTimeOnEdit) - .onChange(async (value) => { - jekyllSetting.isEnableUpdateFrontmatterTimeOnEdit = value; - await this.plugin.saveSettings(); - })); + .setDesc( + "If 'updated' frontmatter exists, replace the value of 'date' frontmatter with the value of 'updated' frontmatter.", + ) + .addToggle(toggle => + toggle + .setValue(jekyllSetting.isEnableUpdateFrontmatterTimeOnEdit) + .onChange(async value => { + jekyllSetting.isEnableUpdateFrontmatterTimeOnEdit = value; + await this.plugin.saveSettings(); + }), + ); } private enableAutoCreateFolderSetting() { new Setting(this.containerEl) .setName('Auto create folders') .setDesc('Automatically create necessary folders if they do not exist.') - .addToggle(toggle => toggle - .setValue(this.plugin.obsidianPathSettings.isAutoCreateFolder) - .onChange(async (value) => { - this.plugin.obsidianPathSettings.isAutoCreateFolder = value; - await this.plugin.saveSettings(); - })); + .addToggle(toggle => + toggle + .setValue(this.plugin.obsidianPathSettings.isAutoCreateFolder) + .onChange(async value => { + this.plugin.obsidianPathSettings.isAutoCreateFolder = value; + await this.plugin.saveSettings(); + }), + ); } private enableCurlyBraceSetting() { @@ -111,12 +126,14 @@ export class O2SettingTab extends PluginSettingTab { new Setting(this.containerEl) .setName('Curly Brace Conversion') .setDesc('Convert double curly braces to jekyll raw tag.') - .addToggle(toggle => toggle - .setValue(jekyllSetting.isEnableCurlyBraceConvertMode) - .onChange(async (value) => { - jekyllSetting.isEnableCurlyBraceConvertMode = value; - await this.plugin.saveSettings(); - })); + .addToggle(toggle => + toggle + .setValue(jekyllSetting.isEnableCurlyBraceConvertMode) + .onChange(async value => { + jekyllSetting.isEnableCurlyBraceConvertMode = value; + await this.plugin.saveSettings(); + }), + ); } private addJekyllPathSetting() { @@ -124,66 +141,78 @@ export class O2SettingTab extends PluginSettingTab { new Setting(this.containerEl) .setName('Jekyll path') .setDesc('The absolute path where Jekyll workspace is located.') - .addText(text => text - .setPlaceholder('Enter path') - .setValue(jekyllSetting.jekyllPath) - .onChange(async (value) => { - jekyllSetting.jekyllPath = value; - await this.plugin.saveSettings(); - })); + .addText(text => + text + .setPlaceholder('Enter path') + .setValue(jekyllSetting.jekyllPath) + .onChange(async value => { + jekyllSetting.jekyllPath = value; + await this.plugin.saveSettings(); + }), + ); } private addJekyllRelativeResourcePathSetting() { const jekyllSetting = this.plugin.jekyll as JekyllSettings; new Setting(this.containerEl) .setName('Relative resource path') - .setDesc('The relative path where resources are stored. (default: assets/img)') - .addText(text => text - .setPlaceholder('Enter path') - .setValue(jekyllSetting.jekyllRelativeResourcePath) - .onChange(async (value) => { - jekyllSetting.jekyllRelativeResourcePath = value; - await this.plugin.saveSettings(); - })); + .setDesc( + 'The relative path where resources are stored. (default: assets/img)', + ) + .addText(text => + text + .setPlaceholder('Enter path') + .setValue(jekyllSetting.jekyllRelativeResourcePath) + .onChange(async value => { + jekyllSetting.jekyllRelativeResourcePath = value; + await this.plugin.saveSettings(); + }), + ); } private addAttachmentsFolderSetting() { new Setting(this.containerEl) .setName('Folder to store attachments in') .setDesc('Where the attachments will be stored.') - .addText(text => text - .setPlaceholder('Enter folder name') - .setValue(this.plugin.obsidianPathSettings.attachmentsFolder) - .onChange(async (value) => { - this.plugin.obsidianPathSettings.attachmentsFolder = value; - await this.plugin.saveSettings(); - })); + .addText(text => + text + .setPlaceholder('Enter folder name') + .setValue(this.plugin.obsidianPathSettings.attachmentsFolder) + .onChange(async value => { + this.plugin.obsidianPathSettings.attachmentsFolder = value; + await this.plugin.saveSettings(); + }), + ); } private addReadyFolderSetting() { new Setting(this.containerEl) .setName('Folder to convert notes to another syntax in') .setDesc('Where the notes will be converted to another syntax.') - .addText(text => text - .setPlaceholder('Enter folder name') - .setValue(this.plugin.obsidianPathSettings.readyFolder) - .onChange(async (value) => { - this.plugin.obsidianPathSettings.readyFolder = value; - await this.plugin.saveSettings(); - })); + .addText(text => + text + .setPlaceholder('Enter folder name') + .setValue(this.plugin.obsidianPathSettings.readyFolder) + .onChange(async value => { + this.plugin.obsidianPathSettings.readyFolder = value; + await this.plugin.saveSettings(); + }), + ); } private addArchiveFolderSetting() { new Setting(this.containerEl) .setName('Folder to Archive notes in') .setDesc('Where the notes will be archived after conversion.') - .addText(text => text - .setPlaceholder('Enter folder name') - .setValue(this.plugin.obsidianPathSettings.archiveFolder) - .onChange(async (value) => { - this.plugin.obsidianPathSettings.archiveFolder = value; - await this.plugin.saveSettings(); - })); + .addText(text => + text + .setPlaceholder('Enter folder name') + .setValue(this.plugin.obsidianPathSettings.archiveFolder) + .onChange(async value => { + this.plugin.obsidianPathSettings.archiveFolder = value; + await this.plugin.saveSettings(); + }), + ); } private addDocusaurusPathSetting() { @@ -191,13 +220,15 @@ export class O2SettingTab extends PluginSettingTab { new Setting(this.containerEl) .setName('Docusaurus path') .setDesc('The absolute path where Docusaurus workspace is located.') - .addText(text => text - .setPlaceholder('Enter path') - .setValue(docusaurus.docusaurusPath) - .onChange(async (value) => { - docusaurus.docusaurusPath = value; - await this.plugin.saveSettings(); - })); + .addText(text => + text + .setPlaceholder('Enter path') + .setValue(docusaurus.docusaurusPath) + .onChange(async value => { + docusaurus.docusaurusPath = value; + await this.plugin.saveSettings(); + }), + ); } private dateExtractionPatternSetting() { @@ -210,7 +241,7 @@ export class O2SettingTab extends PluginSettingTab { dropdown.addOption(key, DateExtractionPattern[key].pattern); } dropdown.setValue(docusaurus.dateExtractionPattern); - dropdown.onChange(async (value) => { + dropdown.onChange(async value => { docusaurus.dateExtractionPattern = value; await this.plugin.saveSettings(); }); @@ -221,11 +252,30 @@ export class O2SettingTab extends PluginSettingTab { new Setting(this.containerEl) .setName('Auto archive') .setDesc('Automatically move files to archive folder after converting.') - .addToggle(toggle => toggle - .setValue(this.plugin.obsidianPathSettings.isAutoArchive) - .onChange(async (value) => { - this.plugin.obsidianPathSettings.isAutoArchive = value; - await this.plugin.saveSettings(); - })); + .addToggle(toggle => + toggle + .setValue(this.plugin.obsidianPathSettings.isAutoArchive) + .onChange(async value => { + this.plugin.obsidianPathSettings.isAutoArchive = value; + await this.plugin.saveSettings(); + }), + ); + } + + private addJekyllRelativeUrlSetting() { + const jekyllSetting = this.plugin.jekyll as JekyllSettings; + new Setting(this.containerEl) + .setName('Enable relative URL for images') + .setDesc( + "Use Jekyll's relative_url filter for image paths. Required when using baseurl.", + ) + .addToggle(toggle => + toggle + .setValue(jekyllSetting.isEnableRelativeUrl) + .onChange(async value => { + jekyllSetting.isEnableRelativeUrl = value; + await this.plugin.saveSettings(); + }), + ); } } diff --git a/src/tests/CalloutConverter.test.ts b/src/tests/CalloutConverter.test.ts index 9879216c..d06f322c 100644 --- a/src/tests/CalloutConverter.test.ts +++ b/src/tests/CalloutConverter.test.ts @@ -1,12 +1,28 @@ -import { CalloutConverter, convertDocusaurusCallout } from '../CalloutConverter'; +import { + CalloutConverter, + convertDocusaurusCallout, +} from '../CalloutConverter'; const calloutConverter = new CalloutConverter(); describe('Jekyll: convert callout syntax', () => { - it.each([ - ['note'], ['todo'], ['example'], ['quote'], ['cite'], ['success'], ['done'], ['check'], - ['NOTE'], ['TODO'], ['EXAMPLE'], ['QUOTE'], ['CITE'], ['SUCCESS'], ['DONE'], ['CHECK'], + ['note'], + ['todo'], + ['example'], + ['quote'], + ['cite'], + ['success'], + ['done'], + ['check'], + ['NOTE'], + ['TODO'], + ['EXAMPLE'], + ['QUOTE'], + ['CITE'], + ['SUCCESS'], + ['DONE'], + ['CHECK'], ])('%s => info', callout => { const context = `> [!${callout}] title\n> content`; @@ -15,8 +31,18 @@ describe('Jekyll: convert callout syntax', () => { }); it.each([ - ['tip'], ['hint'], ['important'], ['question'], ['help'], ['faq'], - ['TIP'], ['HINT'], ['IMPORTANT'], ['QUESTION'], ['HELP'], ['FAQ'], + ['tip'], + ['hint'], + ['important'], + ['question'], + ['help'], + ['faq'], + ['TIP'], + ['HINT'], + ['IMPORTANT'], + ['QUESTION'], + ['HELP'], + ['FAQ'], ])('%s => tip', callout => { const context = `> [!${callout}] title\n> content`; @@ -25,8 +51,12 @@ describe('Jekyll: convert callout syntax', () => { }); it.each([ - ['warning'], ['caution'], ['attention'], - ['WARNING'], ['CAUTION'], ['ATTENTION'], + ['warning'], + ['caution'], + ['attention'], + ['WARNING'], + ['CAUTION'], + ['ATTENTION'], ])('%s => warning', callout => { const context = `> [!${callout}] title\n> content`; @@ -34,14 +64,15 @@ describe('Jekyll: convert callout syntax', () => { expect(result).toBe(`> content\n{: .prompt-warning}`); }); - it.each([ - ['unknown'], - ])('Unregistered keywords should be converted to info keyword', callout => { - const context = `> [!${callout}] title\n> content`; + it.each([['unknown']])( + 'Unregistered keywords should be converted to info keyword', + callout => { + const context = `> [!${callout}] title\n> content`; - const result = calloutConverter.convert(context); - expect(result).toBe(`> content\n{: .prompt-info}`); - }); + const result = calloutConverter.convert(context); + expect(result).toBe(`> content\n{: .prompt-info}`); + }, + ); it('info => info, not exist custom title', () => { const context = `> [!INFO]\n> info content`; @@ -55,13 +86,24 @@ describe('Jekyll: convert callout syntax', () => { const result = calloutConverter.convert(context); expect(result).toBe(`> content\n{: .prompt-tip}`); }); - }); describe('Docusaurus: convert callout syntax', () => { it.each([ - ['todo'], ['example'], ['quote'], ['cite'], ['success'], ['done'], ['check'], - ['TODO'], ['EXAMPLE'], ['QUOTE'], ['CITE'], ['SUCCESS'], ['DONE'], ['CHECK'], + ['todo'], + ['example'], + ['quote'], + ['cite'], + ['success'], + ['done'], + ['check'], + ['TODO'], + ['EXAMPLE'], + ['QUOTE'], + ['CITE'], + ['SUCCESS'], + ['DONE'], + ['CHECK'], ])('%s => info', callout => { const context = `> [!${callout}] This is Title!\n> content`; @@ -69,10 +111,7 @@ describe('Docusaurus: convert callout syntax', () => { expect(result).toBe(`:::note[This is Title!]\n\ncontent\n\n:::`); }); - it.each([ - ['note'], - ['NOTE'], - ])('%s => note', callout => { + it.each([['note'], ['NOTE']])('%s => note', callout => { const context = `> [!${callout}] This is Title!\n> content`; const result = convertDocusaurusCallout(context); @@ -80,8 +119,16 @@ describe('Docusaurus: convert callout syntax', () => { }); it.each([ - ['tip'], ['hint'], ['important'], ['question'], ['help'], - ['TIP'], ['HINT'], ['IMPORTANT'], ['QUESTION'], ['HELP'], + ['tip'], + ['hint'], + ['important'], + ['question'], + ['help'], + ['TIP'], + ['HINT'], + ['IMPORTANT'], + ['QUESTION'], + ['HELP'], ])('%s => tip', callout => { const context = `> [!${callout}] This is Title!\n> content`; @@ -90,8 +137,12 @@ describe('Docusaurus: convert callout syntax', () => { }); it.each([ - ['warning'], ['caution'], ['attention'], - ['WARNING'], ['CAUTION'], ['ATTENTION'], + ['warning'], + ['caution'], + ['attention'], + ['WARNING'], + ['CAUTION'], + ['ATTENTION'], ])('%s => warning', callout => { const context = `> [!${callout}] This is Title!\n> content`; @@ -116,8 +167,18 @@ describe('Docusaurus: convert callout syntax', () => { describe('danger callout', () => { const dangerKeyword = [ - ['error'], ['danger'], ['bug'], ['failure'], ['fail'], ['missing'], - ['ERROR'], ['DANGER'], ['BUG'], ['FAILURE'], ['FAIL'], ['MISSING'], + ['error'], + ['danger'], + ['bug'], + ['failure'], + ['fail'], + ['missing'], + ['ERROR'], + ['DANGER'], + ['BUG'], + ['FAILURE'], + ['FAIL'], + ['MISSING'], ]; it.each(dangerKeyword)('%s => danger', callout => { diff --git a/src/tests/ConverterChain.test.ts b/src/tests/ConverterChain.test.ts index 9a96d615..c75dbea4 100644 --- a/src/tests/ConverterChain.test.ts +++ b/src/tests/ConverterChain.test.ts @@ -42,5 +42,4 @@ describe('ConverterChain', () => { .chaining(new TestRepeatConverter()); expect(chain.converting('test')).toEqual('TESTTEST'); }); - }); diff --git a/src/tests/DateExtractionPattern.test.ts b/src/tests/DateExtractionPattern.test.ts index 4cf1f304..bfd50b6a 100644 --- a/src/tests/DateExtractionPattern.test.ts +++ b/src/tests/DateExtractionPattern.test.ts @@ -17,7 +17,9 @@ describe('SINGLE', () => { it('should replace YYYY-MM-DD-my-blog-post-title.md', () => { const replacer = DateExtractionPattern['SINGLE'].replacer; - expect(replacer('2021', '02', '01', 'my-blog-post-title')).toBe('2021-02-01-my-blog-post-title.md'); + expect(replacer('2021', '02', '01', 'my-blog-post-title')).toBe( + '2021-02-01-my-blog-post-title.md', + ); }); }); @@ -29,7 +31,9 @@ describe('MDX', () => { it('should replace YYYY-MM-DD-my-blog-post-title.mdx', () => { const replacer = DateExtractionPattern['MDX'].replacer; - expect(replacer('2021', '02', '01', 'my-blog-post-title')).toBe('2021-02-01-my-blog-post-title.mdx'); + expect(replacer('2021', '02', '01', 'my-blog-post-title')).toBe( + '2021-02-01-my-blog-post-title.mdx', + ); }); }); @@ -41,7 +45,9 @@ describe('SINGLE_FOLDER_INDEX', () => { it('should replace YYYY-MM-DD-my-blog-post-title/index.md', () => { const replacer = DateExtractionPattern['SINGLE_FOLDER_INDEX'].replacer; - expect(replacer('2021', '02', '01', 'my-blog-post-title')).toBe('2021-02-01-my-blog-post-title/index.md'); + expect(replacer('2021', '02', '01', 'my-blog-post-title')).toBe( + '2021-02-01-my-blog-post-title/index.md', + ); }); }); @@ -53,7 +59,9 @@ describe('FOLDER_NAMED_BY_DATE', () => { it('should replace YYYY-MM-DD/my-blog-post-title.md', () => { const replacer = DateExtractionPattern['FOLDER_NAMED_BY_DATE'].replacer; - expect(replacer('2021', '02', '01', 'my-blog-post-title')).toBe('2021-02-01/my-blog-post-title.md'); + expect(replacer('2021', '02', '01', 'my-blog-post-title')).toBe( + '2021-02-01/my-blog-post-title.md', + ); }); }); @@ -65,19 +73,25 @@ describe('NESTED_FOLDERS_BY_DATE', () => { it('should replace YYYY/MM/DD/my-blog-post-title.md', () => { const replacer = DateExtractionPattern['NESTED_FOLDERS_BY_DATE'].replacer; - expect(replacer('2021', '02', '01', 'my-blog-post-title')).toBe('2021/02/01/my-blog-post-title.md'); + expect(replacer('2021', '02', '01', 'my-blog-post-title')).toBe( + '2021/02/01/my-blog-post-title.md', + ); }); }); describe('PARTIALLY_NESTED_FOLDERS_BY_DATE', () => { it('should match YYYY/MM-DD/my-blog-post-title.md', () => { - const regex = DateExtractionPattern['PARTIALLY_NESTED_FOLDERS_BY_DATE'].regexp; + const regex = + DateExtractionPattern['PARTIALLY_NESTED_FOLDERS_BY_DATE'].regexp; expect('o2-temp.2021/02-01/my-blog-post-title.md').toMatch(regex); }); it('should replace YYYY/MM-DD/my-blog-post-title.md', () => { - const replacer = DateExtractionPattern['PARTIALLY_NESTED_FOLDERS_BY_DATE'].replacer; - expect(replacer('2021', '02', '01', 'my-blog-post-title')).toBe('2021/02-01/my-blog-post-title.md'); + const replacer = + DateExtractionPattern['PARTIALLY_NESTED_FOLDERS_BY_DATE'].replacer; + expect(replacer('2021', '02', '01', 'my-blog-post-title')).toBe( + '2021/02-01/my-blog-post-title.md', + ); }); }); @@ -89,7 +103,9 @@ describe('NESTED_FOLDERS_INDEX', () => { it('should replace YYYY/MM/DD/my-blog-post-title/index.md', () => { const replacer = DateExtractionPattern['NESTED_FOLDERS_INDEX'].replacer; - expect(replacer('2021', '02', '01', 'my-blog-post-title')).toBe('2021/02/01/my-blog-post-title/index.md'); + expect(replacer('2021', '02', '01', 'my-blog-post-title')).toBe( + '2021/02/01/my-blog-post-title/index.md', + ); }); }); @@ -101,6 +117,8 @@ describe('DATE_IN_MIDDLE_OF_PATH', () => { it('should replace category/YYYY/MM-DD-my-blog-post-title.md', () => { const replacer = DateExtractionPattern['DATE_IN_MIDDLE_OF_PATH'].replacer; - expect(replacer('2021', '02', '01', 'my-blog-post-title')).toBe('category/2021/02-01-my-blog-post-title.md'); + expect(replacer('2021', '02', '01', 'my-blog-post-title')).toBe( + 'category/2021/02-01-my-blog-post-title.md', + ); }); }); diff --git a/src/tests/EmbedsConverter.test.ts b/src/tests/EmbedsConverter.test.ts index c90d82f2..14ebb4d0 100644 --- a/src/tests/EmbedsConverter.test.ts +++ b/src/tests/EmbedsConverter.test.ts @@ -3,14 +3,15 @@ import { EmbedsConverter } from '../EmbedsConverter'; const converter = new EmbedsConverter(); describe('convert called', () => { - it.each([ ['![[test]]', 'test'], ['![[Obsidian#What is Obsidian]]', 'Obsidian'], ['![[Obsidian#^asdf1234]]', 'Obsidian'], ['![[Obsidian#What is Obsidian]]', 'Obsidian'], - ])('should remove brackets if does not exist extension keyword', (input, expected) => { - expect(converter.convert(input)).toEqual(expected); - }); - + ])( + 'should remove brackets if does not exist extension keyword', + (input, expected) => { + expect(converter.convert(input)).toEqual(expected); + }, + ); }); diff --git a/src/tests/FrontMatterConverter.test.ts b/src/tests/FrontMatterConverter.test.ts index 58eb957c..3f0926cf 100644 --- a/src/tests/FrontMatterConverter.test.ts +++ b/src/tests/FrontMatterConverter.test.ts @@ -1,7 +1,18 @@ -import { convertFrontMatter, FrontMatterConverter } from '../FrontMatterConverter'; - -const frontMatterConverter = new FrontMatterConverter('2023-01-01-test-title', 'assets/img', true); -const disableImageConverter = new FrontMatterConverter('2023-01-01-test-title', 'assets/img', false); +import { + convertFrontMatter, + FrontMatterConverter, +} from '../FrontMatterConverter'; + +const frontMatterConverter = new FrontMatterConverter( + '2023-01-01-test-title', + 'assets/img', + true, +); +const disableImageConverter = new FrontMatterConverter( + '2023-01-01-test-title', + 'assets/img', + false, +); describe('convert front matter', () => { const contents = `--- title: "test" @@ -35,22 +46,23 @@ image: /assets/img/2023-01-01-test-title/test.png --- # test -`, - ); +`); }); describe('when isEnable option is false', () => { - const frontMatterConverter = new FrontMatterConverter('2023-01-01-test-title', 'assets/img', false); + const frontMatterConverter = new FrontMatterConverter( + '2023-01-01-test-title', + 'assets/img', + false, + ); it('should Nothing', () => { const result = frontMatterConverter.convert(contents); expect(result).toEqual(contents); }); }); - }); describe('mermaid front matter', () => { - it('should create mermaid key value if body contains mermaid block', () => { const contents = `--- title: "test" @@ -77,8 +89,7 @@ graph TD A-->B \`\`\` -`, - ); +`); }); it('should not create mermaid key value if body does not contain mermaid block', () => { @@ -96,8 +107,7 @@ title: "test" # test -`, - ); +`); }); it('should not create mermaid key value if body contains mermaid block but front matter already has mermaid key', () => { @@ -125,12 +135,10 @@ mermaid: true graph TD A-->B \`\`\` -`, - ); +`); }); }); - describe('if does not exist front matter', () => { const contents = `# test image: test.png @@ -162,8 +170,7 @@ image: /assets/img/2023-01-01-test-title/test.png # test --- -`, - ); +`); }); describe('when end of front matter is not exist', () => { @@ -181,7 +188,12 @@ image: test.png }); describe('updated front matter', () => { - const updatedConverter = new FrontMatterConverter('2023-01-01-test-title', 'assets/img', true, true); + const updatedConverter = new FrontMatterConverter( + '2023-01-01-test-title', + 'assets/img', + true, + true, + ); it('should be converted', () => { const contents = `--- title: "test" @@ -198,8 +210,7 @@ date: 2022-01-02 12:00:00 +0900 --- # test -`, - ); +`); }); it('should be not converted', () => { @@ -217,14 +228,11 @@ date: 2021-01-01 12:00:00 +0900 --- # test -`, - ); +`); }); - }); describe('tags', () => { - const expected = `--- title: "test" date: 2021-01-01 12:00:00 +0900 @@ -270,7 +278,7 @@ tags: test1, test2 describe('convertFrontMatter', () => { it('should passthroughs', () => { - const mockContents = `--- + const mockContents = `--- title: "test" date: 2021-01-01 12:00:00 +0900 categories: [test] @@ -278,10 +286,9 @@ categories: [test] # test `; - const result = convertFrontMatter(mockContents); - expect(result).toEqual(mockContents); - }, - ); + const result = convertFrontMatter(mockContents); + expect(result).toEqual(mockContents); + }); it('should converted tags', () => { const contents = `--- diff --git a/src/tests/ResourceLinkConverter.test.ts b/src/tests/ResourceLinkConverter.test.ts index 28818b84..2a02e85c 100644 --- a/src/tests/ResourceLinkConverter.test.ts +++ b/src/tests/ResourceLinkConverter.test.ts @@ -1,4 +1,7 @@ -import { extractResourceNames, ResourceLinkConverter } from '../ResourceLinkConverter'; +import { + extractResourceNames, + ResourceLinkConverter, +} from '../ResourceLinkConverter'; jest.mock('obsidian', () => ({}), { virtual: true }); jest.mock('fs', () => ({ @@ -7,7 +10,6 @@ jest.mock('fs', () => ({ })); describe('extract image name', () => { - it('should return image name array', () => { const context = `![[test.png]] @@ -23,7 +25,6 @@ describe('extract image name', () => { const result = extractResourceNames(context); expect(result).toBeUndefined(); }); - }); describe('convert called', () => { @@ -36,9 +37,10 @@ describe('convert called', () => { ); it('should return converted post', () => { - expect(converter.convert(`![[test.png]]`)).toEqual(`![image](/assets/2023-01-01-post-mock/test.png)`); + expect(converter.convert(`![[test.png]]`)).toEqual( + `![image](/assets/2023-01-01-post-mock/test.png)`, + ); }); - }); describe('resize image', () => { @@ -51,19 +53,22 @@ describe('resize image', () => { ); it('should return converted attachments with width', () => { - expect(converter.convert(`![[test.png|100]]`)).toEqual(`![image](/assets/2023-01-01-post-mock/test.png){: width="100" }`); + expect(converter.convert(`![[test.png|100]]`)).toEqual( + `![image](/assets/2023-01-01-post-mock/test.png){: width="100" }`, + ); }); it('should return converted attachments with width and height', () => { - expect(converter.convert(`![[test.png|100x200]]`)) - .toEqual(`![image](/assets/2023-01-01-post-mock/test.png){: width="100" height="200" }`); + expect(converter.convert(`![[test.png|100x200]]`)).toEqual( + `![image](/assets/2023-01-01-post-mock/test.png){: width="100" height="200" }`, + ); }); it('should ignore size when image resize syntax was invalid', () => { - expect(converter.convert(`![[test.png|x100]]`)) - .toEqual(`![image](/assets/2023-01-01-post-mock/test.png)`); + expect(converter.convert(`![[test.png|x100]]`)).toEqual( + `![image](/assets/2023-01-01-post-mock/test.png)`, + ); }); - }); describe('image caption', () => { @@ -130,5 +135,39 @@ _This is a test image._ `); }); +}); +describe('liquid filter with relative_url', () => { + const converter = new ResourceLinkConverter( + '2023-01-01-post-mock', + 'assets', + 'test', + 'attachments', + 'assets', + { useRelativeUrl: true }, + ); + + it('should wrap image path with relative_url filter', () => { + const context = `![[test.png]]`; + const result = converter.convert(context); + expect(result).toEqual( + `![image]({{ "/assets/2023-01-01-post-mock/test.png" | relative_url }})`, + ); + }); + + it('should handle images with size specifications', () => { + const context = `![[test.png|100x200]]`; + const result = converter.convert(context); + expect(result).toEqual( + `![image]({{ "/assets/2023-01-01-post-mock/test.png" | relative_url }}){: width="100" height="200" }`, + ); + }); + + it('should handle images with captions', () => { + const context = `![[test.png]]\n_Image caption_`; + const result = converter.convert(context); + expect(result).toEqual( + `![image]({{ "/assets/2023-01-01-post-mock/test.png" | relative_url }})\n_Image caption_`, + ); + }); }); diff --git a/src/tests/WikiLinkConverter.test.ts b/src/tests/WikiLinkConverter.test.ts index 9f940e9e..9e42f4b4 100644 --- a/src/tests/WikiLinkConverter.test.ts +++ b/src/tests/WikiLinkConverter.test.ts @@ -52,7 +52,6 @@ describe('WikiLinkConverter', () => { `); }); - it('should not match if string starts with !', () => { const input = '![[tests]]'; const result = converter.convert(input); diff --git a/src/utils.ts b/src/utils.ts index ebb05b7e..9ab4b109 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -26,21 +26,24 @@ export const copyMarkdownFile = async (plugin: O2Plugin): Promise => { .replace(/,+/g, '') .replace(/\s/g, '-'); - await plugin.app.vault.copy(file, newPath) - .catch((error) => { - console.error(error); - new Notice('Failed to copy file, see console for more information.'); - }); + await plugin.app.vault.copy(file, newPath).catch(error => { + console.error(error); + new Notice('Failed to copy file, see console for more information.'); + }); } // collect copied files - return plugin.app.vault.getMarkdownFiles() + return plugin.app.vault + .getMarkdownFiles() .filter((file: TFile) => file.path.includes(TEMP_PREFIX)); }; export const getFilesInReady = (plugin: O2Plugin): TFile[] => - plugin.app.vault.getMarkdownFiles() - .filter((file: TFile) => file.path.startsWith(plugin.obsidianPathSettings.readyFolder)); + plugin.app.vault + .getMarkdownFiles() + .filter((file: TFile) => + file.path.startsWith(plugin.obsidianPathSettings.readyFolder), + ); const copyFile = (sourceFilePath: string, targetFilePath: string) => { // if directory not exist create it @@ -59,7 +62,7 @@ export const copy = ( ) => { fs.readdirSync(sourceFolderPath) .filter(filename => filename.startsWith(TEMP_PREFIX)) - .forEach((filename) => { + .forEach(filename => { const transformedFileName = transformPath( filename, replacer, @@ -67,7 +70,10 @@ export const copy = ( ); const sourceFilePath = path.join(sourceFolderPath, filename); - const targetFilePath = path.join(targetFolderPath, transformedFileName.replace(TEMP_PREFIX, '').replace(/\s/g, '-')); + const targetFilePath = path.join( + targetFolderPath, + transformedFileName.replace(TEMP_PREFIX, '').replace(/\s/g, '-'), + ); copyFile(sourceFilePath, targetFilePath); }); @@ -81,36 +87,40 @@ export const archiving = async (plugin: O2Plugin) => { // move files to archive folder const readyFiles = getFilesInReady(plugin); readyFiles.forEach((file: TFile) => { - plugin.app.fileManager.renameFile(file, file.path.replace(plugin.obsidianPathSettings.readyFolder, plugin.obsidianPathSettings.archiveFolder)); + plugin.app.fileManager.renameFile( + file, + file.path.replace( + plugin.obsidianPathSettings.readyFolder, + plugin.obsidianPathSettings.archiveFolder, + ), + ); }); }; export const moveFiles = async ( sourceFolderPath: string, targetFolderPath: string, - pathReplacer: (year: string, month: string, day: string, title: string) => string, + pathReplacer: ( + year: string, + month: string, + day: string, + title: string, + ) => string, publishedDate?: LocalDate, ) => { - - copy( - sourceFolderPath, - targetFolderPath, - pathReplacer, - publishedDate, - ); + copy(sourceFolderPath, targetFolderPath, pathReplacer, publishedDate); }; - export const cleanUp = async (plugin: O2Plugin) => { // remove temp files - const markdownFiles = plugin.app.vault.getMarkdownFiles() - .filter((file) => file.path.includes(TEMP_PREFIX)); + const markdownFiles = plugin.app.vault + .getMarkdownFiles() + .filter(file => file.path.includes(TEMP_PREFIX)); for (const file of markdownFiles) { - await plugin.app.vault.delete(file) - .then(() => { - console.log(`Deleted temp file: ${file.path}`); - }); + await plugin.app.vault.delete(file).then(() => { + console.log(`Deleted temp file: ${file.path}`); + }); } }; @@ -119,7 +129,12 @@ export const cleanUp = async (plugin: O2Plugin) => { // return path to be created, and this path is target path const transformPath = ( input: string, - replacer: (year: string | number, month: string | number, day: string | number, title: string) => string, + replacer: ( + year: string | number, + month: string | number, + day: string | number, + title: string, + ) => string, date?: LocalDate, ): string => { const match = input.match(DateExtractionPattern['SINGLE'].regexp); diff --git a/sweep.yaml b/sweep.yaml index 4f98c727..d46d7571 100644 --- a/sweep.yaml +++ b/sweep.yaml @@ -8,5 +8,4 @@ gha_enabled: True # This is the description of your project. It will be used by sweep when creating PRs. You can tell Sweep what's unique about your project, what frameworks you use, or anything else you want. # Here's an example: sweepai/sweep is a python project. The main api endpoints are in sweepai/api.py. Write code that adheres to PEP8. description: '' - # Default Values: https://github.com/sweepai/sweep/blob/main/sweep.yaml diff --git a/tsconfig.json b/tsconfig.json index 6897b914..da7633a2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,9 +2,7 @@ "compilerOptions": { "esModuleInterop": true, "paths": { - "src": [ - "src/*" - ] + "src": ["src/*"] }, "baseUrl": ".", "inlineSourceMap": true, @@ -17,18 +15,8 @@ "importHelpers": true, "isolatedModules": true, "strictNullChecks": true, - "lib": [ - "DOM", - "ES5", - "ES6", - "ES7" - ] + "lib": ["DOM", "ES5", "ES6", "ES7"] }, - "include": [ - "src/**/*" - ], - "exclude": [ - "node_modules", - "**/*.spec.ts" - ] + "include": ["src/**/*"], + "exclude": ["node_modules", "**/*.spec.ts"] } diff --git a/version-bump.mjs b/version-bump.mjs index d409fa0e..3f6c9058 100644 --- a/version-bump.mjs +++ b/version-bump.mjs @@ -1,14 +1,14 @@ -import { readFileSync, writeFileSync } from "fs"; +import { readFileSync, writeFileSync } from 'fs'; const targetVersion = process.env.npm_package_version; // read minAppVersion from manifest.json and bump version to target version -let manifest = JSON.parse(readFileSync("manifest.json", "utf8")); +let manifest = JSON.parse(readFileSync('manifest.json', 'utf8')); const { minAppVersion } = manifest; manifest.version = targetVersion; -writeFileSync("manifest.json", JSON.stringify(manifest, null, "\t")); +writeFileSync('manifest.json', JSON.stringify(manifest, null, '\t')); // update versions.json with target version and minAppVersion from manifest.json -let versions = JSON.parse(readFileSync("versions.json", "utf8")); +let versions = JSON.parse(readFileSync('versions.json', 'utf8')); versions[targetVersion] = minAppVersion; -writeFileSync("versions.json", JSON.stringify(versions, null, "\t")); +writeFileSync('versions.json', JSON.stringify(versions, null, '\t')); diff --git a/versions.json b/versions.json index 5660925c..7cf71996 100644 --- a/versions.json +++ b/versions.json @@ -1,28 +1,28 @@ { - "1.0.0": "0.15.0", - "1.0.1": "0.15.0", - "1.1.0": "0.15.0", - "1.1.1": "0.15.0", - "1.2.0": "0.15.0", - "1.2.1": "0.15.0", - "1.3.0": "0.15.0", - "1.4.0": "0.15.0", - "1.4.1": "0.15.0", - "1.5.0": "0.15.0", - "1.6.0": "0.15.0", - "1.6.1": "0.15.0", - "1.6.2": "0.15.0", - "1.7.0": "0.15.0", - "1.7.1": "0.15.0", - "1.8.0": "0.15.0", - "1.8.1": "0.15.0", - "1.9.0": "0.15.0", - "1.9.1": "0.15.0", - "1.9.2": "0.15.0", - "1.9.3": "0.15.0", - "2.0.0": "0.15.0", - "2.0.1": "0.15.0", - "2.0.2": "0.15.0", - "2.0.3": "0.15.0", - "2.1.0": "0.15.0" -} \ No newline at end of file + "1.0.0": "0.15.0", + "1.0.1": "0.15.0", + "1.1.0": "0.15.0", + "1.1.1": "0.15.0", + "1.2.0": "0.15.0", + "1.2.1": "0.15.0", + "1.3.0": "0.15.0", + "1.4.0": "0.15.0", + "1.4.1": "0.15.0", + "1.5.0": "0.15.0", + "1.6.0": "0.15.0", + "1.6.1": "0.15.0", + "1.6.2": "0.15.0", + "1.7.0": "0.15.0", + "1.7.1": "0.15.0", + "1.8.0": "0.15.0", + "1.8.1": "0.15.0", + "1.9.0": "0.15.0", + "1.9.1": "0.15.0", + "1.9.2": "0.15.0", + "1.9.3": "0.15.0", + "2.0.0": "0.15.0", + "2.0.1": "0.15.0", + "2.0.2": "0.15.0", + "2.0.3": "0.15.0", + "2.1.0": "0.15.0" +}