From 42f2dd6f57c4b053f7773081ea7f1e07f73a513d Mon Sep 17 00:00:00 2001 From: JounQin Date: Tue, 19 Jul 2022 23:23:00 +0800 Subject: [PATCH] feat: add `externsionAlias` option support (#154) --- .changeset/khaki-lemons-sort.md | 5 + .changeset/shiny-kiwis-kiss.md | 7 + .changeset/stale-eggs-mate.md | 7 + .changeset/two-tables-study.md | 5 + package.json | 8 +- pnpm-lock.yaml | 452 ++++++++++++++++---------------- src/index.ts | 175 ++++++------- tests/withJsExtension/test.js | 2 +- 8 files changed, 331 insertions(+), 330 deletions(-) create mode 100644 .changeset/khaki-lemons-sort.md create mode 100644 .changeset/shiny-kiwis-kiss.md create mode 100644 .changeset/stale-eggs-mate.md create mode 100644 .changeset/two-tables-study.md diff --git a/.changeset/khaki-lemons-sort.md b/.changeset/khaki-lemons-sort.md new file mode 100644 index 0000000..8eb78a8 --- /dev/null +++ b/.changeset/khaki-lemons-sort.md @@ -0,0 +1,5 @@ +--- +"eslint-import-resolver-typescript": patch +--- + +perf: cache `options` and `resolver` diff --git a/.changeset/shiny-kiwis-kiss.md b/.changeset/shiny-kiwis-kiss.md new file mode 100644 index 0000000..44e7d8d --- /dev/null +++ b/.changeset/shiny-kiwis-kiss.md @@ -0,0 +1,7 @@ +--- +"eslint-import-resolver-typescript": patch +--- + +chore: align with Angular Package Format correctly + +reference: https://angular.io/guide/angular-package-format diff --git a/.changeset/stale-eggs-mate.md b/.changeset/stale-eggs-mate.md new file mode 100644 index 0000000..0f2492b --- /dev/null +++ b/.changeset/stale-eggs-mate.md @@ -0,0 +1,7 @@ +--- +"eslint-import-resolver-typescript": minor +--- + +feat: add `externsionAlias` option support, `.d.([cm]?ts|tsx)` are always preferred than `.([cm]?js|jsx)` + +`typescript` resolves `typescript/lib/typescript.d.ts` instead of `typescript/lib/typescript.js` by default diff --git a/.changeset/two-tables-study.md b/.changeset/two-tables-study.md new file mode 100644 index 0000000..eb8b2fa --- /dev/null +++ b/.changeset/two-tables-study.md @@ -0,0 +1,5 @@ +--- +"eslint-import-resolver-typescript": minor +--- + +feat: exports `globSync`, `defaultExtensions`, `defaultMainFields`, `defaultConditionNames` and `defaultExtensionAlias` for reusing diff --git a/package.json b/package.json index 5178056..480edd1 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ }, "funding": "https://opencollective.com/unts", "license": "ISC", - "packageManager": "pnpm@7.5.1", + "packageManager": "pnpm@7.5.2", "engines": { "node": "^12.20.0 || ^14.18.0 || >=16.0.0" }, @@ -103,16 +103,16 @@ "synckit": "^0.8.1" }, "devDependencies": { - "@1stg/lib-config": "^9.0.0", + "@1stg/lib-config": "^9.0.1", "@changesets/changelog-github": "^0.4.5", "@changesets/cli": "^2.23.2", - "@mozilla/glean": "^1.0.0", + "@mozilla/glean": "^1.1.0", "@size-limit/preset-small-lib": "^7.0.8", "@types/debug": "^4.1.7", "@types/enhanced-resolve": "^3.0.7", "@types/is-core-module": "^2.2.0", "@types/is-glob": "^4.0.2", - "@types/node": "^18.0.5", + "@types/node": "^18.0.6", "@types/unist": "^2.0.6", "dummy.js": "link:dummy.js", "eslint-import-resolver-typescript": "link:.", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a635e98..74d61d0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,16 +9,16 @@ patchedDependencies: path: patches/@size-limit__esbuild@7.0.8.patch specifiers: - '@1stg/lib-config': ^9.0.0 + '@1stg/lib-config': ^9.0.1 '@changesets/changelog-github': ^0.4.5 '@changesets/cli': ^2.23.2 - '@mozilla/glean': ^1.0.0 + '@mozilla/glean': ^1.1.0 '@size-limit/preset-small-lib': ^7.0.8 '@types/debug': ^4.1.7 '@types/enhanced-resolve': ^3.0.7 '@types/is-core-module': ^2.2.0 '@types/is-glob': ^4.0.2 - '@types/node': ^18.0.5 + '@types/node': ^18.0.6 '@types/unist': ^2.0.6 debug: ^4.3.4 dummy.js: link:dummy.js @@ -44,16 +44,16 @@ dependencies: synckit: 0.8.1 devDependencies: - '@1stg/lib-config': 9.0.0_typescript@4.7.4 + '@1stg/lib-config': 9.0.1_typescript@4.7.4 '@changesets/changelog-github': 0.4.5 '@changesets/cli': 2.23.2 - '@mozilla/glean': 1.0.0 + '@mozilla/glean': 1.1.0 '@size-limit/preset-small-lib': 7.0.8_size-limit@7.0.8 '@types/debug': 4.1.7 '@types/enhanced-resolve': 3.0.7 '@types/is-core-module': 2.2.0 '@types/is-glob': 4.0.2 - '@types/node': 18.0.5 + '@types/node': 18.0.6 '@types/unist': 2.0.6 dummy.js: link:dummy.js eslint-import-resolver-typescript: 'link:' @@ -106,22 +106,22 @@ packages: - lerna dev: true - /@1stg/common-config/6.1.2_typescript@4.7.4: - resolution: {integrity: sha512-AqpbFkUfJ3uJ0ZVkuGUmOXZDFEmXp3otXymsYZN6Q1WaKYLv8Ed8VPTOVeIJyvFY5Wr+YI6vIE8C6MNGzlqTBQ==} + /@1stg/common-config/6.1.3_typescript@4.7.4: + resolution: {integrity: sha512-x/ahljqYFL5hfEXkK0onMAFrhvM899Am1JUFIC9maKwyb247/c2pkoz0aOclQpWnLmRXqpppRXpTMBOXGj2ChQ==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} dependencies: '@1stg/babel-preset': 3.1.4_u4pnq6aitzjyryj6xisyu635ni '@1stg/commitlint-config': 3.1.4 - '@1stg/eslint-config': 5.4.2_nurj2ki7wbzsiovgmisqahnkwe + '@1stg/eslint-config': 5.4.3_2otc4ovstvej36ots2wfvlftti '@1stg/lint-staged': 3.3.0_asgeq5zd7vvotyh6rucet6xqam - '@1stg/markuplint-config': 2.2.0_eslint@8.19.0 + '@1stg/markuplint-config': 2.2.0_eslint@8.20.0 '@1stg/prettier-config': 3.7.0_prettier@2.7.1 '@1stg/remark-config': 4.0.3_prettier@2.7.1 '@1stg/simple-git-hooks': 0.2.1_3a74o2bqahvqfivah2vltmaou4 - '@1stg/tsconfig': 2.2.3_typescript@4.7.4 + '@1stg/tsconfig': 2.2.5_typescript@4.7.4 '@babel/core': 7.18.6 '@commitlint/cli': 17.0.3 - eslint: 8.19.0 + eslint: 8.20.0 lint-staged: 13.0.3 npm-run-all: 4.1.5 prettier: 2.7.1 @@ -146,53 +146,53 @@ packages: resolution: {integrity: sha512-7PPr6ZCIh0KqbQSePoVtTO/apo3gjPkrWeM7EAJ8YwN4LJE3CDtYQ0bvF2t0c0zLhNYmGxqe64Z+8c98wzuqaw==} dev: true - /@1stg/eslint-config/5.4.2_nurj2ki7wbzsiovgmisqahnkwe: - resolution: {integrity: sha512-2IukGkNxsCnj6JeKhJmjFTf/R7YIZQ1cfJ84eiVHiEB7rOkIaV6To2bMxyZ51QgTltohf6KloxsMOP+EG1LASA==} + /@1stg/eslint-config/5.4.3_2otc4ovstvej36ots2wfvlftti: + resolution: {integrity: sha512-KVF1YMXdEcp2v4vGQ56XR+BLI1Y4YufxzHkF6B3c5JAwQPDQfY8vOXQUN3vjTpZpJ1M3c74ozn5todCzuZTfUA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} peerDependencies: eslint: '>=6.0.0' dependencies: '@1stg/config': 0.2.0 - '@angular-eslint/eslint-plugin': 14.0.2_4x5o4skxv6sl53vpwefgt23khm - '@angular-eslint/eslint-plugin-template': 14.0.2_4x5o4skxv6sl53vpwefgt23khm - '@angular-eslint/template-parser': 14.0.2_4x5o4skxv6sl53vpwefgt23khm - '@babel/eslint-parser': 7.18.2_ygqbvsyswrl2cmipz2mlfqys74 - '@babel/eslint-plugin': 7.17.7_jwguzmoycsnla6dhqn6hwzoboq + '@angular-eslint/eslint-plugin': 14.0.2_he2ccbldppg44uulnyq4rwocfa + '@angular-eslint/eslint-plugin-template': 14.0.2_he2ccbldppg44uulnyq4rwocfa + '@angular-eslint/template-parser': 14.0.2_he2ccbldppg44uulnyq4rwocfa + '@babel/eslint-parser': 7.18.2_qfqwgqrbldst3lett5sigxr6tq + '@babel/eslint-plugin': 7.17.7_ju23do6a2u3wo33ijsni5s6twy '@pkgr/utils': 2.3.0 - '@typescript-eslint/eslint-plugin': 5.30.6_2vt5mtrqleafs33qg2bhpmbaqm - '@typescript-eslint/parser': 5.30.6_4x5o4skxv6sl53vpwefgt23khm + '@typescript-eslint/eslint-plugin': 5.30.6_b7n364ggt6o4xlkgyoaww3ph3q + '@typescript-eslint/parser': 5.30.6_he2ccbldppg44uulnyq4rwocfa angular-eslint-template-parser: 0.1.1_lscoefpp2xo4h6652u3xspi3ma - eslint: 8.19.0 - eslint-config-prettier: 8.5.0_eslint@8.19.0 - eslint-config-standard: 17.0.0_3y77imf4oat3akor274t4exgn4 - eslint-config-standard-jsx: 11.0.0_ooux7wugi57bhcgmnuegj2mmva - eslint-config-standard-react: 11.0.1_ooux7wugi57bhcgmnuegj2mmva + eslint: 8.20.0 + eslint-config-prettier: 8.5.0_eslint@8.20.0 + eslint-config-standard: 17.0.0_aabay5xq26dqolh67bnodxi5n4 + eslint-config-standard-jsx: 11.0.0_d6b2yfc7lkeycvhlikcoxofgwu + eslint-config-standard-react: 11.0.1_d6b2yfc7lkeycvhlikcoxofgwu eslint-formatter-friendly: 7.0.0 - eslint-import-resolver-typescript: 3.2.5_q2xwze32dd33a2fc2qubwr4ie4 - eslint-plugin-css: 0.6.0_eslint@8.19.0 - eslint-plugin-es-x: 5.2.1_eslint@8.19.0 - eslint-plugin-eslint-comments: 3.2.0_eslint@8.19.0 - eslint-plugin-import: 2.26.0_txgtzxbwwbsdf6liwdfp2zycdy - eslint-plugin-jest: 26.5.3_fkhxoq6cnoqtqyxhht22jt34c4 - eslint-plugin-jsdoc: 39.3.3_eslint@8.19.0 - eslint-plugin-json-schema-validator: 3.2.3_eslint@8.19.0 - eslint-plugin-jsonc: 2.3.1_eslint@8.19.0 - eslint-plugin-markup: 0.10.0_eslint@8.19.0 - eslint-plugin-mdx: 2.0.1_eslint@8.19.0 - eslint-plugin-n: 15.2.4_eslint@8.19.0 - eslint-plugin-prettier: 4.2.1_7uxdfn2xinezdgvmbammh6ev5i - eslint-plugin-promise: 6.0.0_eslint@8.19.0 - eslint-plugin-react: 7.30.1_eslint@8.19.0 - eslint-plugin-react-hooks: 4.6.0_eslint@8.19.0 - eslint-plugin-regexp: 1.7.0_eslint@8.19.0 - eslint-plugin-simple-import-sort: 7.0.0_eslint@8.19.0 - eslint-plugin-sonar: 0.8.0_2l6pd2z6wpkfvxik46nihypw3e - eslint-plugin-sonarjs: 0.13.0_eslint@8.19.0 - eslint-plugin-svelte: 2.2.0_eslint@8.19.0 - eslint-plugin-toml: 0.3.1_eslint@8.19.0 - eslint-plugin-unicorn: 43.0.1_eslint@8.19.0 - eslint-plugin-vue: 9.2.0_eslint@8.19.0 - eslint-plugin-yml: 1.0.0_eslint@8.19.0 + eslint-import-resolver-typescript: 3.2.7_afl3vkhn63baibzal45igheroq + eslint-plugin-css: 0.6.0_eslint@8.20.0 + eslint-plugin-es-x: 5.2.1_eslint@8.20.0 + eslint-plugin-eslint-comments: 3.2.0_eslint@8.20.0 + eslint-plugin-import: 2.26.0_3qg32nwux7jppjlumnyephfuiu + eslint-plugin-jest: 26.6.0_44kxnblsrltnc6st4trmesnede + eslint-plugin-jsdoc: 39.3.3_eslint@8.20.0 + eslint-plugin-json-schema-validator: 3.2.6_eslint@8.20.0 + eslint-plugin-jsonc: 2.3.1_eslint@8.20.0 + eslint-plugin-markup: 0.10.0_eslint@8.20.0 + eslint-plugin-mdx: 2.0.1_eslint@8.20.0 + eslint-plugin-n: 15.2.4_eslint@8.20.0 + eslint-plugin-prettier: 4.2.1_g4fztgbwjyq2fvmcscny2sj6fy + eslint-plugin-promise: 6.0.0_eslint@8.20.0 + eslint-plugin-react: 7.30.1_eslint@8.20.0 + eslint-plugin-react-hooks: 4.6.0_eslint@8.20.0 + eslint-plugin-regexp: 1.7.0_eslint@8.20.0 + eslint-plugin-simple-import-sort: 7.0.0_eslint@8.20.0 + eslint-plugin-sonar: 0.8.0_lx6jkr3ccqxuww6wnfj7rroswu + eslint-plugin-sonarjs: 0.13.0_eslint@8.20.0 + eslint-plugin-svelte: 2.2.0_eslint@8.20.0 + eslint-plugin-toml: 0.3.1_eslint@8.20.0 + eslint-plugin-unicorn: 43.0.1_eslint@8.20.0 + eslint-plugin-vue: 9.2.0_eslint@8.20.0 + eslint-plugin-yml: 1.0.0_eslint@8.20.0 transitivePeerDependencies: - '@babel/core' - eslint-import-resolver-webpack @@ -204,11 +204,11 @@ packages: - typescript dev: true - /@1stg/lib-config/9.0.0_typescript@4.7.4: - resolution: {integrity: sha512-r45lRRFgXMIN3N5nNq3SS/VD9J30PHHKrITJihovVdgzpP5q42T12SlL+fYp31U/TLWtQBcdRbujLQTwMQdLGA==} + /@1stg/lib-config/9.0.1_typescript@4.7.4: + resolution: {integrity: sha512-JhnzAwP6ePwCOdvMu+DmwJ1S75S7JbMwjhydBTYvnDBqcj/QNv+Neg8P9KhoGL2/ktbzUTjfcxlr0NhkMx8WQQ==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} dependencies: - '@1stg/common-config': 6.1.2_typescript@4.7.4 + '@1stg/common-config': 6.1.3_typescript@4.7.4 '@pkgr/rollup': 3.1.4 transitivePeerDependencies: - '@swc/core' @@ -235,7 +235,7 @@ packages: dependencies: '@1stg/config': 0.2.0 '@1stg/prettier-config': 3.7.0_prettier@2.7.1 - '@1stg/tsconfig': 2.2.3_typescript@4.7.4 + '@1stg/tsconfig': 2.2.5_typescript@4.7.4 '@pkgr/utils': 2.3.0 lint-staged: 13.0.3 prettier: 2.7.1 @@ -245,14 +245,14 @@ packages: - typescript dev: true - /@1stg/markuplint-config/2.2.0_eslint@8.19.0: + /@1stg/markuplint-config/2.2.0_eslint@8.20.0: resolution: {integrity: sha512-SFIB3oa5RAZ7Tfql/O+TpQKqC6sO4BEy1EzU5ZOaUzJz9U192gnyDNEu0DPU9Oc4T4kTulSqNMAK3hyfdsDTJg==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} peerDependencies: markuplint: ^2.0.0 dependencies: '@markuplint/svelte-parser': 2.2.3 - '@markuplint/vue-parser': 2.3.2_eslint@8.19.0 + '@markuplint/vue-parser': 2.3.2_eslint@8.20.0 '@markuplint/vue-spec': 2.1.1 markuplint-angular-parser: 1.1.3 transitivePeerDependencies: @@ -314,8 +314,8 @@ packages: simple-git-hooks: 2.8.0 dev: true - /@1stg/tsconfig/2.2.3_typescript@4.7.4: - resolution: {integrity: sha512-nyFRZsB4Adf0OaAnzopXgKxSNfx7VomECiSCFXCPZ2Fe7/m39/PS+vQXTzO4VfiyJqLsuNWiR9mMMubTfXe8lQ==} + /@1stg/tsconfig/2.2.5_typescript@4.7.4: + resolution: {integrity: sha512-HGu7fJHp+5vLeXH7R/AozA2VtjtE/KACv2bhAA0Hrtk2fX2OE0xNynb/tg31kTRU8cStEmlMLKxAexdv7BPYPA==} peerDependencies: typescript: '>=3.0.0' dependencies: @@ -334,57 +334,57 @@ packages: resolution: {integrity: sha512-Ev001tGwBfy6lFd1IDrAHfW87VUqDmMQY5KWY+LM3dn0PY2XZv1RsBM16tBFbi7EaDeaxeFZg/G8PN5x+anNbg==} dev: true - /@angular-eslint/eslint-plugin-template/14.0.2_4x5o4skxv6sl53vpwefgt23khm: + /@angular-eslint/eslint-plugin-template/14.0.2_he2ccbldppg44uulnyq4rwocfa: resolution: {integrity: sha512-egan0a2GVkubST4H7x2mPMTz3Ee9QXeLEchJyWXdFBZ6Nrpfjaki5dOQYhLU7KyxqhrSW4XugMWPGj2KW2gMxQ==} peerDependencies: eslint: ^7.0.0 || ^8.0.0 typescript: '*' dependencies: '@angular-eslint/bundled-angular-compiler': 14.0.2 - '@typescript-eslint/utils': 5.29.0_4x5o4skxv6sl53vpwefgt23khm + '@typescript-eslint/utils': 5.29.0_he2ccbldppg44uulnyq4rwocfa aria-query: 5.0.0 axobject-query: 3.0.1 - eslint: 8.19.0 + eslint: 8.20.0 typescript: 4.7.4 transitivePeerDependencies: - supports-color dev: true - /@angular-eslint/eslint-plugin/14.0.2_4x5o4skxv6sl53vpwefgt23khm: + /@angular-eslint/eslint-plugin/14.0.2_he2ccbldppg44uulnyq4rwocfa: resolution: {integrity: sha512-TfiXWqaWGysnPB6JstZouvA9tNwIsCLvSIGqniE1U90kX6p5nL8Z09JOiv/9jlYfgAIEgUD48BGMZzDi86voGA==} peerDependencies: eslint: ^7.0.0 || ^8.0.0 typescript: '*' dependencies: - '@angular-eslint/utils': 14.0.2_4x5o4skxv6sl53vpwefgt23khm - '@typescript-eslint/utils': 5.29.0_4x5o4skxv6sl53vpwefgt23khm - eslint: 8.19.0 + '@angular-eslint/utils': 14.0.2_he2ccbldppg44uulnyq4rwocfa + '@typescript-eslint/utils': 5.29.0_he2ccbldppg44uulnyq4rwocfa + eslint: 8.20.0 typescript: 4.7.4 transitivePeerDependencies: - supports-color dev: true - /@angular-eslint/template-parser/14.0.2_4x5o4skxv6sl53vpwefgt23khm: + /@angular-eslint/template-parser/14.0.2_he2ccbldppg44uulnyq4rwocfa: resolution: {integrity: sha512-NTXSfL97WVs4GTKPtPcRZfWtvNbhgcIZUvKUTk5ieYiVLqsHF9Y+NlAKBh44AGldM5oCNO4HUfnvOedtqkQ+MA==} peerDependencies: eslint: ^7.0.0 || ^8.0.0 typescript: '*' dependencies: '@angular-eslint/bundled-angular-compiler': 14.0.2 - eslint: 8.19.0 + eslint: 8.20.0 eslint-scope: 5.1.1 typescript: 4.7.4 dev: true - /@angular-eslint/utils/14.0.2_4x5o4skxv6sl53vpwefgt23khm: + /@angular-eslint/utils/14.0.2_he2ccbldppg44uulnyq4rwocfa: resolution: {integrity: sha512-8cHyQFG3jIHMHBjlqMU9ExAgOFGqbvxUa5EUvdc8wJUXtwhYx5NCQupdSpy/qG8gHiXjxvxinEtACZJQ9/SOwQ==} peerDependencies: eslint: ^7.0.0 || ^8.0.0 typescript: '*' dependencies: '@angular-eslint/bundled-angular-compiler': 14.0.2 - '@typescript-eslint/utils': 5.29.0_4x5o4skxv6sl53vpwefgt23khm - eslint: 8.19.0 + '@typescript-eslint/utils': 5.29.0_he2ccbldppg44uulnyq4rwocfa + eslint: 8.20.0 typescript: 4.7.4 transitivePeerDependencies: - supports-color @@ -431,7 +431,7 @@ packages: - supports-color dev: true - /@babel/eslint-parser/7.18.2_ygqbvsyswrl2cmipz2mlfqys74: + /@babel/eslint-parser/7.18.2_qfqwgqrbldst3lett5sigxr6tq: resolution: {integrity: sha512-oFQYkE8SuH14+uR51JVAmdqwKYXGRjEXx7s+WiagVjqQ+HPE+nnwyF2qlVG8evUsUHmPcA+6YXMEDbIhEyQc5A==} engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0} peerDependencies: @@ -439,21 +439,21 @@ packages: eslint: ^7.5.0 || ^8.0.0 dependencies: '@babel/core': 7.18.6 - eslint: 8.19.0 + eslint: 8.20.0 eslint-scope: 5.1.1 eslint-visitor-keys: 2.1.0 semver: 6.3.0 dev: true - /@babel/eslint-plugin/7.17.7_jwguzmoycsnla6dhqn6hwzoboq: + /@babel/eslint-plugin/7.17.7_ju23do6a2u3wo33ijsni5s6twy: resolution: {integrity: sha512-JATUoJJXSgwI0T8juxWYtK1JSgoLpIGUsCHIv+NMXcUDA2vIe6nvAHR9vnuJgs/P1hOFw7vPwibixzfqBBLIVw==} engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0} peerDependencies: '@babel/eslint-parser': '>=7.11.0' eslint: '>=7.5.0' dependencies: - '@babel/eslint-parser': 7.18.2_ygqbvsyswrl2cmipz2mlfqys74 - eslint: 8.19.0 + '@babel/eslint-parser': 7.18.2_qfqwgqrbldst3lett5sigxr6tq + eslint: 8.20.0 eslint-rule-composer: 0.3.0 dev: true @@ -2168,10 +2168,10 @@ packages: '@commitlint/execute-rule': 17.0.0 '@commitlint/resolve-extends': 17.0.3 '@commitlint/types': 17.0.0 - '@types/node': 18.0.5 + '@types/node': 18.0.6 chalk: 4.1.2 cosmiconfig: 7.0.1 - cosmiconfig-typescript-loader: 2.0.2_47blntjhuqtdxyxfczkfdvsynq + cosmiconfig-typescript-loader: 2.0.2_tdn3ypgnfy6bmey2q4hu5jonwi lodash: 4.17.21 resolve-from: 5.0.0 typescript: 4.7.4 @@ -2503,14 +2503,14 @@ packages: - supports-color dev: true - /@markuplint/vue-parser/2.3.2_eslint@8.19.0: + /@markuplint/vue-parser/2.3.2_eslint@8.20.0: resolution: {integrity: sha512-9c4GetUNLE/q4d2G2jGwkoVSTAr8iM4om/cpGs2rjKRdczTgIADeTzjx2a88wEkWlBlVojdovR7t532mufomPA==} dependencies: '@markuplint/html-parser': 2.2.2 '@markuplint/ml-ast': 2.0.1-dev.20220307.0 '@markuplint/parser-utils': 2.2.1 tslib: 2.4.0 - vue-eslint-parser: 8.3.0_eslint@8.19.0 + vue-eslint-parser: 8.3.0_eslint@8.20.0 transitivePeerDependencies: - eslint - supports-color @@ -2522,8 +2522,8 @@ packages: '@markuplint/ml-spec': 2.1.1 dev: true - /@mozilla/glean/1.0.0: - resolution: {integrity: sha512-2RzkubrxaCV7mkmCXgBmD16XbDuK4SVqlMdLv3zez2lb3WXnLo6j+C+IKIgBke/f/iGgz6O4SISjTAhkaPvgNQ==} + /@mozilla/glean/1.1.0: + resolution: {integrity: sha512-wpYQbzDeEfkvR2EO7xwamFu0Qasz8dWUon8VT+ErcYmeocPbflar6WYiAkt7gV9f4LJQGWVFSiDM1etpzEi4ug==} engines: {node: '>=12.20.0', npm: '>=7.0.0'} hasBin: true dependencies: @@ -2851,7 +2851,7 @@ packages: /@types/concat-stream/2.0.0: resolution: {integrity: sha512-t3YCerNM7NTVjLuICZo5gYAXYoDvpuuTceCcFQWcDQz26kxUR5uIWolxbIR5jRNIXpMqhOpW/b8imCR1LEmuJw==} dependencies: - '@types/node': 18.0.5 + '@types/node': 18.0.6 dev: true /@types/debug/4.1.7: @@ -2863,7 +2863,7 @@ packages: /@types/enhanced-resolve/3.0.7: resolution: {integrity: sha512-H23Fzk0BCz4LoKq1ricnLSRQuzoXTv57bGUwC+Cn84kKPaoHIS7bhFhfy4DzMeSBxoXc6jFziYoqpCab1U511w==} dependencies: - '@types/node': 18.0.5 + '@types/node': 18.0.6 '@types/tapable': 0.2.5 dev: true @@ -2888,14 +2888,14 @@ packages: /@types/fs-extra/8.1.2: resolution: {integrity: sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==} dependencies: - '@types/node': 18.0.5 + '@types/node': 18.0.6 dev: true /@types/glob/7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 3.0.5 - '@types/node': 18.0.5 + '@types/node': 18.0.6 dev: true /@types/hast/2.3.4: @@ -2952,8 +2952,8 @@ packages: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} dev: true - /@types/node/18.0.5: - resolution: {integrity: sha512-En7tneq+j0qAiVwysBD79y86MT3ModuoIJbe7JXp+sb5UAjInSShmK3nXXMioBzfF7rXC12hv12d4IyCVwN4dA==} + /@types/node/18.0.6: + resolution: {integrity: sha512-/xUq6H2aQm261exT6iZTMifUySEt4GR5KX8eYyY+C4MSNPqSh9oNIP7tz2GLKTlFaiBbgZNxffoR3CVRG+cljw==} dev: true /@types/normalize-package-data/2.4.1: @@ -2967,7 +2967,7 @@ packages: /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 18.0.5 + '@types/node': 18.0.6 dev: true /@types/semver/6.2.3: @@ -2986,7 +2986,7 @@ packages: resolution: {integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==} dev: true - /@typescript-eslint/eslint-plugin/5.30.6_2vt5mtrqleafs33qg2bhpmbaqm: + /@typescript-eslint/eslint-plugin/5.30.6_b7n364ggt6o4xlkgyoaww3ph3q: resolution: {integrity: sha512-J4zYMIhgrx4MgnZrSDD7sEnQp7FmhKNOaqaOpaoQ/SfdMfRB/0yvK74hTnvH+VQxndZynqs5/Hn4t+2/j9bADg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2997,12 +2997,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.30.6_4x5o4skxv6sl53vpwefgt23khm + '@typescript-eslint/parser': 5.30.6_he2ccbldppg44uulnyq4rwocfa '@typescript-eslint/scope-manager': 5.30.6 - '@typescript-eslint/type-utils': 5.30.6_4x5o4skxv6sl53vpwefgt23khm - '@typescript-eslint/utils': 5.30.6_4x5o4skxv6sl53vpwefgt23khm + '@typescript-eslint/type-utils': 5.30.6_he2ccbldppg44uulnyq4rwocfa + '@typescript-eslint/utils': 5.30.6_he2ccbldppg44uulnyq4rwocfa debug: 4.3.4 - eslint: 8.19.0 + eslint: 8.20.0 functional-red-black-tree: 1.0.1 ignore: 5.2.0 regexpp: 3.2.0 @@ -3013,7 +3013,7 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.30.6_4x5o4skxv6sl53vpwefgt23khm: + /@typescript-eslint/parser/5.30.6_he2ccbldppg44uulnyq4rwocfa: resolution: {integrity: sha512-gfF9lZjT0p2ZSdxO70Xbw8w9sPPJGfAdjK7WikEjB3fcUI/yr9maUVEdqigBjKincUYNKOmf7QBMiTf719kbrA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -3027,7 +3027,7 @@ packages: '@typescript-eslint/types': 5.30.6 '@typescript-eslint/typescript-estree': 5.30.6_typescript@4.7.4 debug: 4.3.4 - eslint: 8.19.0 + eslint: 8.20.0 typescript: 4.7.4 transitivePeerDependencies: - supports-color @@ -3049,7 +3049,7 @@ packages: '@typescript-eslint/visitor-keys': 5.30.6 dev: true - /@typescript-eslint/type-utils/5.30.6_4x5o4skxv6sl53vpwefgt23khm: + /@typescript-eslint/type-utils/5.30.6_he2ccbldppg44uulnyq4rwocfa: resolution: {integrity: sha512-GFVVzs2j0QPpM+NTDMXtNmJKlF842lkZKDSanIxf+ArJsGeZUIaeT4jGg+gAgHt7AcQSFwW7htzF/rbAh2jaVA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -3059,9 +3059,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/utils': 5.30.6_4x5o4skxv6sl53vpwefgt23khm + '@typescript-eslint/utils': 5.30.6_he2ccbldppg44uulnyq4rwocfa debug: 4.3.4 - eslint: 8.19.0 + eslint: 8.20.0 tsutils: 3.21.0_typescript@4.7.4 typescript: 4.7.4 transitivePeerDependencies: @@ -3120,7 +3120,7 @@ packages: - supports-color dev: true - /@typescript-eslint/utils/5.29.0_4x5o4skxv6sl53vpwefgt23khm: + /@typescript-eslint/utils/5.29.0_he2ccbldppg44uulnyq4rwocfa: resolution: {integrity: sha512-3Eos6uP1nyLOBayc/VUdKZikV90HahXE5Dx9L5YlSd/7ylQPXhLk1BYb29SDgnBnTp+jmSZUU0QxUiyHgW4p7A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -3130,15 +3130,15 @@ packages: '@typescript-eslint/scope-manager': 5.29.0 '@typescript-eslint/types': 5.29.0 '@typescript-eslint/typescript-estree': 5.29.0_typescript@4.7.4 - eslint: 8.19.0 + eslint: 8.20.0 eslint-scope: 5.1.1 - eslint-utils: 3.0.0_eslint@8.19.0 + eslint-utils: 3.0.0_eslint@8.20.0 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/utils/5.30.6_4x5o4skxv6sl53vpwefgt23khm: + /@typescript-eslint/utils/5.30.6_he2ccbldppg44uulnyq4rwocfa: resolution: {integrity: sha512-xFBLc/esUbLOJLk9jKv0E9gD/OH966M40aY9jJ8GiqpSkP2xOV908cokJqqhVd85WoIvHVHYXxSFE4cCSDzVvA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -3148,9 +3148,9 @@ packages: '@typescript-eslint/scope-manager': 5.30.6 '@typescript-eslint/types': 5.30.6 '@typescript-eslint/typescript-estree': 5.30.6_typescript@4.7.4 - eslint: 8.19.0 + eslint: 8.20.0 eslint-scope: 5.1.1 - eslint-utils: 3.0.0_eslint@8.19.0 + eslint-utils: 3.0.0_eslint@8.20.0 transitivePeerDependencies: - supports-color - typescript @@ -3172,10 +3172,6 @@ packages: eslint-visitor-keys: 3.3.0 dev: true - /@unts/get-tsconfig/4.1.1: - resolution: {integrity: sha512-8mPf1bBzF2S+fyuyYOQWjDcaJTTgJ14UAnXW9I3KwrqioRWG1byRXHwciYdqXpbdOiu7Fg4WJbymBIakGk+aMA==} - dev: true - /@vue/babel-helper-vue-jsx-merge-props/1.2.1: resolution: {integrity: sha512-QOi5OW45e2R20VygMSNhyQHvpdUwQZqGPc748JLGCYEy+yp8fNFNdbNIGAgZmi9e+2JHPd6i6idRuqivyicIkA==} dev: true @@ -3375,7 +3371,7 @@ packages: peerDependencies: '@angular-eslint/template-parser': '*' dependencies: - '@angular-eslint/template-parser': 14.0.2_4x5o4skxv6sl53vpwefgt23khm + '@angular-eslint/template-parser': 14.0.2_he2ccbldppg44uulnyq4rwocfa dev: true /angular-html-parser/1.8.0: @@ -4072,16 +4068,16 @@ packages: requiresBuild: true dev: true - /cosmiconfig-typescript-loader/2.0.2_47blntjhuqtdxyxfczkfdvsynq: + /cosmiconfig-typescript-loader/2.0.2_tdn3ypgnfy6bmey2q4hu5jonwi: resolution: {integrity: sha512-KmE+bMjWMXJbkWCeY4FJX/npHuZPNr9XF9q9CIQ/bpFwi1qHfCmSiKarrCcRa0LO4fWjk93pVoeRtJAkTGcYNw==} engines: {node: '>=12', npm: '>=6'} peerDependencies: '@types/node': '*' typescript: '>=3' dependencies: - '@types/node': 18.0.5 + '@types/node': 18.0.6 cosmiconfig: 7.0.1 - ts-node: 10.9.1_47blntjhuqtdxyxfczkfdvsynq + ts-node: 10.9.1_tdn3ypgnfy6bmey2q4hu5jonwi typescript: 4.7.4 transitivePeerDependencies: - '@swc/core' @@ -4838,36 +4834,36 @@ packages: source-map: 0.6.1 dev: true - /eslint-config-prettier/8.5.0_eslint@8.19.0: + /eslint-config-prettier/8.5.0_eslint@8.20.0: resolution: {integrity: sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.19.0 + eslint: 8.20.0 dev: true - /eslint-config-standard-jsx/11.0.0_ooux7wugi57bhcgmnuegj2mmva: + /eslint-config-standard-jsx/11.0.0_d6b2yfc7lkeycvhlikcoxofgwu: resolution: {integrity: sha512-+1EV/R0JxEK1L0NGolAr8Iktm3Rgotx3BKwgaX+eAuSX8D952LULKtjgZD3F+e6SvibONnhLwoTi9DPxN5LvvQ==} peerDependencies: eslint: ^8.8.0 eslint-plugin-react: ^7.28.0 dependencies: - eslint: 8.19.0 - eslint-plugin-react: 7.30.1_eslint@8.19.0 + eslint: 8.20.0 + eslint-plugin-react: 7.30.1_eslint@8.20.0 dev: true - /eslint-config-standard-react/11.0.1_ooux7wugi57bhcgmnuegj2mmva: + /eslint-config-standard-react/11.0.1_d6b2yfc7lkeycvhlikcoxofgwu: resolution: {integrity: sha512-4WlBynOqBZJRaX81CBcIGDHqUiqxvw4j/DbEIICz8QkMs3xEncoPgAoysiqCSsg71X92uhaBc8sgqB96smaMmg==} peerDependencies: eslint: ^7.12.1 eslint-plugin-react: ^7.21.5 dependencies: - eslint: 8.19.0 - eslint-plugin-react: 7.30.1_eslint@8.19.0 + eslint: 8.20.0 + eslint-plugin-react: 7.30.1_eslint@8.20.0 dev: true - /eslint-config-standard/17.0.0_3y77imf4oat3akor274t4exgn4: + /eslint-config-standard/17.0.0_aabay5xq26dqolh67bnodxi5n4: resolution: {integrity: sha512-/2ks1GKyqSOkH7JFvXJicu0iMpoojkwB+f5Du/1SC0PtBL+s8v30k9njRZ21pm2drKYm2342jFnGWzttxPmZVg==} peerDependencies: eslint: ^8.0.1 @@ -4875,10 +4871,10 @@ packages: eslint-plugin-n: ^15.0.0 eslint-plugin-promise: ^6.0.0 dependencies: - eslint: 8.19.0 - eslint-plugin-import: 2.26.0_txgtzxbwwbsdf6liwdfp2zycdy - eslint-plugin-n: 15.2.4_eslint@8.19.0 - eslint-plugin-promise: 6.0.0_eslint@8.19.0 + eslint: 8.20.0 + eslint-plugin-import: 2.26.0_3qg32nwux7jppjlumnyephfuiu + eslint-plugin-n: 15.2.4_eslint@8.20.0 + eslint-plugin-promise: 6.0.0_eslint@8.20.0 dev: true /eslint-formatter-friendly/7.0.0: @@ -4901,8 +4897,8 @@ packages: - supports-color dev: true - /eslint-import-resolver-typescript/3.2.5_q2xwze32dd33a2fc2qubwr4ie4: - resolution: {integrity: sha512-yEBi/EWxFFMjcZTBxrgdu5cFAXB2atOhYDhp0P0yHqjZa5YiPNqQVt4/lNNVWwW7Kf8IIZmyeBboWOgsfffe7w==} + /eslint-import-resolver-typescript/3.2.7_afl3vkhn63baibzal45igheroq: + resolution: {integrity: sha512-WvcsRy3aPmwVsuS/XVliAJWpIdTlaFXXZPZk3TCbvvF8RtaAkjAhcLL5bl5VEoTmE+XnTHjIbWMzNZcOQpK/DA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -4910,25 +4906,25 @@ packages: dependencies: debug: 4.3.4 enhanced-resolve: 5.10.0 - eslint: 8.19.0 - eslint-plugin-import: 2.26.0_txgtzxbwwbsdf6liwdfp2zycdy - get-tsconfig: /@unts/get-tsconfig/4.1.1 + eslint: 8.20.0 + eslint-plugin-import: 2.26.0_3qg32nwux7jppjlumnyephfuiu + get-tsconfig: 4.2.0 globby: 13.1.2 is-core-module: 2.9.0 is-glob: 4.0.3 - synckit: 0.7.2 + synckit: 0.8.1 transitivePeerDependencies: - supports-color dev: true - /eslint-mdx/2.0.1_eslint@8.19.0: + /eslint-mdx/2.0.1_eslint@8.20.0: resolution: {integrity: sha512-25qjdxWQGDX0zXxnZGfqwEbWjUuY1eCnK7CIq3fNE+5rWSAeleJ/i0nLKcgh6XrvmxKn6ZYcJ9msdeqmL4kPMQ==} engines: {node: '>=12.20'} peerDependencies: eslint: '>=8.0.0' dependencies: cosmiconfig: 7.0.1 - eslint: 8.19.0 + eslint: 8.20.0 estree-util-visit: 1.1.0 remark-mdx: 2.1.2 remark-parse: 10.0.1 @@ -4942,7 +4938,7 @@ packages: - supports-color dev: true - /eslint-module-utils/2.7.3_adcwpkg4usihyvzg6ysrflevky: + /eslint-module-utils/2.7.3_2q2z6tayalivbsvwghbmod3pby: resolution: {integrity: sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==} engines: {node: '>=4'} peerDependencies: @@ -4960,62 +4956,62 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.30.6_4x5o4skxv6sl53vpwefgt23khm + '@typescript-eslint/parser': 5.30.6_he2ccbldppg44uulnyq4rwocfa debug: 3.2.7 eslint-import-resolver-node: 0.3.6 - eslint-import-resolver-typescript: 3.2.5_q2xwze32dd33a2fc2qubwr4ie4 + eslint-import-resolver-typescript: 3.2.7_afl3vkhn63baibzal45igheroq find-up: 2.1.0 transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-css/0.6.0_eslint@8.19.0: + /eslint-plugin-css/0.6.0_eslint@8.20.0: resolution: {integrity: sha512-cQ+FsHNmVVSfMhiZnhhBvvdmzNF2oDvuY9oSpfGGMJctwDQiKtZ1rdALb0psHfobg8nBPwkgHg4i8JQhI8lXJQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '>=7.0.0' dependencies: colord: 2.9.2 - eslint: 8.19.0 - eslint-utils: 3.0.0_eslint@8.19.0 + eslint: 8.20.0 + eslint-utils: 3.0.0_eslint@8.20.0 known-css-properties: 0.24.0 postcss-value-parser: 4.2.0 dev: true - /eslint-plugin-es-x/5.2.1_eslint@8.19.0: + /eslint-plugin-es-x/5.2.1_eslint@8.20.0: resolution: {integrity: sha512-NRNKsXjFwfgm11seplh8OiJ/2nbklD5ya72dbOOjURGZxpl8fzjRtQcErvl1UT306GtIoEEeG4OZqnwwsRABqg==} engines: {node: '>=8.10.0'} peerDependencies: eslint: '>=4.19.1' dependencies: - eslint: 8.19.0 - eslint-utils: 3.0.0_eslint@8.19.0 + eslint: 8.20.0 + eslint-utils: 3.0.0_eslint@8.20.0 regexpp: 3.2.0 dev: true - /eslint-plugin-es/4.1.0_eslint@8.19.0: + /eslint-plugin-es/4.1.0_eslint@8.20.0: resolution: {integrity: sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==} engines: {node: '>=8.10.0'} peerDependencies: eslint: '>=4.19.1' dependencies: - eslint: 8.19.0 + eslint: 8.20.0 eslint-utils: 2.1.0 regexpp: 3.2.0 dev: true - /eslint-plugin-eslint-comments/3.2.0_eslint@8.19.0: + /eslint-plugin-eslint-comments/3.2.0_eslint@8.20.0: resolution: {integrity: sha512-0jkOl0hfojIHHmEHgmNdqv4fmh7300NdpA9FFpF7zaoLvB/QeXOGNLIo86oAveJFrfB1p05kC8hpEMHM8DwWVQ==} engines: {node: '>=6.5.0'} peerDependencies: eslint: '>=4.19.1' dependencies: escape-string-regexp: 1.0.5 - eslint: 8.19.0 + eslint: 8.20.0 ignore: 5.2.0 dev: true - /eslint-plugin-import/2.26.0_txgtzxbwwbsdf6liwdfp2zycdy: + /eslint-plugin-import/2.26.0_3qg32nwux7jppjlumnyephfuiu: resolution: {integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==} engines: {node: '>=4'} peerDependencies: @@ -5025,14 +5021,14 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.30.6_4x5o4skxv6sl53vpwefgt23khm + '@typescript-eslint/parser': 5.30.6_he2ccbldppg44uulnyq4rwocfa array-includes: 3.1.5 array.prototype.flat: 1.3.0 debug: 2.6.9 doctrine: 2.1.0 - eslint: 8.19.0 + eslint: 8.20.0 eslint-import-resolver-node: 0.3.6 - eslint-module-utils: 2.7.3_adcwpkg4usihyvzg6ysrflevky + eslint-module-utils: 2.7.3_2q2z6tayalivbsvwghbmod3pby has: 1.0.3 is-core-module: 2.9.0 is-glob: 4.0.3 @@ -5046,8 +5042,8 @@ packages: - supports-color dev: true - /eslint-plugin-jest/26.5.3_fkhxoq6cnoqtqyxhht22jt34c4: - resolution: {integrity: sha512-sICclUqJQnR1bFRZGLN2jnSVsYOsmPYYnroGCIMVSvTS3y8XR3yjzy1EcTQmk6typ5pRgyIWzbjqxK6cZHEZuQ==} + /eslint-plugin-jest/26.6.0_44kxnblsrltnc6st4trmesnede: + resolution: {integrity: sha512-f8n46/97ZFdU4KqeQYqO8AEVGIhHWvkpgNBWHH3jrM28/y8llnbf3IjfIKv6p2pZIMinK1PCqbbROxs9Eud02Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/eslint-plugin': ^5.0.0 @@ -5059,15 +5055,15 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 5.30.6_2vt5mtrqleafs33qg2bhpmbaqm - '@typescript-eslint/utils': 5.30.6_4x5o4skxv6sl53vpwefgt23khm - eslint: 8.19.0 + '@typescript-eslint/eslint-plugin': 5.30.6_b7n364ggt6o4xlkgyoaww3ph3q + '@typescript-eslint/utils': 5.30.6_he2ccbldppg44uulnyq4rwocfa + eslint: 8.20.0 transitivePeerDependencies: - supports-color - typescript dev: true - /eslint-plugin-jsdoc/39.3.3_eslint@8.19.0: + /eslint-plugin-jsdoc/39.3.3_eslint@8.20.0: resolution: {integrity: sha512-K/DAjKRUNaUTf0KQhI9PvsF+Y3mGDx/j0pofXsJCQe/tmRsRweBIXR353c8nAro0lytZYEf7l0PluBpzKDiHxw==} engines: {node: ^14 || ^16 || ^17 || ^18} peerDependencies: @@ -5077,7 +5073,7 @@ packages: comment-parser: 1.3.1 debug: 4.3.4 escape-string-regexp: 4.0.0 - eslint: 8.19.0 + eslint: 8.20.0 esquery: 1.4.0 semver: 7.3.7 spdx-expression-parse: 3.0.1 @@ -5085,16 +5081,16 @@ packages: - supports-color dev: true - /eslint-plugin-json-schema-validator/3.2.3_eslint@8.19.0: - resolution: {integrity: sha512-WCYpIyWnxpXdCut2D8EfTpfL5JgBanPSMkeLk9HHCFAOoe0aImAj5NdcvYquyR8DcfjG9ODD1j/o6S0HWhdBtA==} + /eslint-plugin-json-schema-validator/3.2.6_eslint@8.20.0: + resolution: {integrity: sha512-MSoO6LI6AVD6FaAG/i5iyiorJMHPfyW0nmO5BIZBSQQMQBpkEwrmWYrm5OS7TDZ3y23mDPpN4Zw9b653wMtaIg==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: '>=6.0.0' dependencies: ajv: 8.11.0 debug: 4.3.4 - eslint: 8.19.0 - eslint-utils: 3.0.0_eslint@8.19.0 + eslint: 8.20.0 + eslint-utils: 3.0.0_eslint@8.20.0 json-schema-migrate: 2.0.0 jsonc-eslint-parser: 2.1.0 minimatch: 5.1.0 @@ -5106,39 +5102,39 @@ packages: - supports-color dev: true - /eslint-plugin-jsonc/2.3.1_eslint@8.19.0: + /eslint-plugin-jsonc/2.3.1_eslint@8.20.0: resolution: {integrity: sha512-8sgWGWiVRMFL6xGawRymrE4RjZJgiU0rXYgFFb71wvdwuUkPgWSvfFtc8jfwcgjjqFjis8vzCUFsg7SciMEDWw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '>=6.0.0' dependencies: - eslint: 8.19.0 - eslint-utils: 3.0.0_eslint@8.19.0 + eslint: 8.20.0 + eslint-utils: 3.0.0_eslint@8.20.0 jsonc-eslint-parser: 2.1.0 natural-compare: 1.4.0 dev: true - /eslint-plugin-markdown/2.2.1_eslint@8.19.0: + /eslint-plugin-markdown/2.2.1_eslint@8.20.0: resolution: {integrity: sha512-FgWp4iyYvTFxPwfbxofTvXxgzPsDuSKHQy2S+a8Ve6savbujey+lgrFFbXQA0HPygISpRYWYBjooPzhYSF81iA==} engines: {node: ^8.10.0 || ^10.12.0 || >= 12.0.0} peerDependencies: eslint: '>=6.0.0' dependencies: - eslint: 8.19.0 + eslint: 8.20.0 mdast-util-from-markdown: 0.8.5 transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-markup/0.10.0_eslint@8.19.0: + /eslint-plugin-markup/0.10.0_eslint@8.20.0: resolution: {integrity: sha512-vC7b3HJldGSb10utUC+cPm2xdsrLz+caKMsHVweOKcBTvyt7tl3wZEXl85gCFjBFsZRraDPZ9qpZlzWd2RvLww==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} peerDependencies: eslint: '>=5.0.0' dependencies: cosmiconfig: 7.0.1 - eslint: 8.19.0 - eslint-plugin-utils: 0.3.1_eslint@8.19.0 + eslint: 8.20.0 + eslint-plugin-utils: 0.3.1_eslint@8.20.0 markuplint: 2.9.0 synckit: 0.7.2 tslib: 2.4.0 @@ -5146,15 +5142,15 @@ packages: - supports-color dev: true - /eslint-plugin-mdx/2.0.1_eslint@8.19.0: + /eslint-plugin-mdx/2.0.1_eslint@8.20.0: resolution: {integrity: sha512-BKPKX6+KxOkvKe+ASxZJeBGdrWemM8NtgJrzxzS30/hwxcEo86jsQi9SJmSrWLUs0P9KAAnM2/iW5ry/oRos8g==} engines: {node: '>=12.20'} peerDependencies: eslint: '>=8.0.0' dependencies: - eslint: 8.19.0 - eslint-mdx: 2.0.1_eslint@8.19.0 - eslint-plugin-markdown: 2.2.1_eslint@8.19.0 + eslint: 8.20.0 + eslint-mdx: 2.0.1_eslint@8.20.0 + eslint-plugin-markdown: 2.2.1_eslint@8.20.0 remark-mdx: 2.1.2 remark-parse: 10.0.1 remark-stringify: 10.0.2 @@ -5165,16 +5161,16 @@ packages: - supports-color dev: true - /eslint-plugin-n/15.2.4_eslint@8.19.0: + /eslint-plugin-n/15.2.4_eslint@8.20.0: resolution: {integrity: sha512-tjnVMv2fiXYMnuiIFI8QMtyUFI42SckEEWvi8h68SWGWshfqO6SSCASy24dGMGAiy7NUk6DZt90DM0iNUsmQ5w==} engines: {node: '>=12.22.0'} peerDependencies: eslint: '>=7.0.0' dependencies: builtins: 5.0.1 - eslint: 8.19.0 - eslint-plugin-es: 4.1.0_eslint@8.19.0 - eslint-utils: 3.0.0_eslint@8.19.0 + eslint: 8.20.0 + eslint-plugin-es: 4.1.0_eslint@8.20.0 + eslint-utils: 3.0.0_eslint@8.20.0 ignore: 5.2.0 is-core-module: 2.9.0 minimatch: 3.1.2 @@ -5182,7 +5178,7 @@ packages: semver: 7.3.7 dev: true - /eslint-plugin-prettier/4.2.1_7uxdfn2xinezdgvmbammh6ev5i: + /eslint-plugin-prettier/4.2.1_g4fztgbwjyq2fvmcscny2sj6fy: resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -5193,31 +5189,31 @@ packages: eslint-config-prettier: optional: true dependencies: - eslint: 8.19.0 - eslint-config-prettier: 8.5.0_eslint@8.19.0 + eslint: 8.20.0 + eslint-config-prettier: 8.5.0_eslint@8.20.0 prettier: 2.7.1 prettier-linter-helpers: 1.0.0 dev: true - /eslint-plugin-promise/6.0.0_eslint@8.19.0: + /eslint-plugin-promise/6.0.0_eslint@8.20.0: resolution: {integrity: sha512-7GPezalm5Bfi/E22PnQxDWH2iW9GTvAlUNTztemeHb6c1BniSyoeTrM87JkC0wYdi6aQrZX9p2qEiAno8aTcbw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 dependencies: - eslint: 8.19.0 + eslint: 8.20.0 dev: true - /eslint-plugin-react-hooks/4.6.0_eslint@8.19.0: + /eslint-plugin-react-hooks/4.6.0_eslint@8.20.0: resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==} engines: {node: '>=10'} peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 dependencies: - eslint: 8.19.0 + eslint: 8.20.0 dev: true - /eslint-plugin-react/7.30.1_eslint@8.19.0: + /eslint-plugin-react/7.30.1_eslint@8.20.0: resolution: {integrity: sha512-NbEvI9jtqO46yJA3wcRF9Mo0lF9T/jhdHqhCHXiXtD+Zcb98812wvokjWpU7Q4QH5edo6dmqrukxVvWWXHlsUg==} engines: {node: '>=4'} peerDependencies: @@ -5226,7 +5222,7 @@ packages: array-includes: 3.1.5 array.prototype.flatmap: 1.3.0 doctrine: 2.1.0 - eslint: 8.19.0 + eslint: 8.20.0 estraverse: 5.3.0 jsx-ast-utils: 3.3.2 minimatch: 3.1.2 @@ -5240,15 +5236,15 @@ packages: string.prototype.matchall: 4.0.7 dev: true - /eslint-plugin-regexp/1.7.0_eslint@8.19.0: + /eslint-plugin-regexp/1.7.0_eslint@8.20.0: resolution: {integrity: sha512-nmhXqrEP+O+dz2z5MSkc41u/4fA8oakweoCUdfYwox7DBhzadEqZz8T+s6/UiY0NIU0kv+3UrzBfhPp4wUxbaA==} engines: {node: ^12 || >=14} peerDependencies: eslint: '>=6.0.0' dependencies: comment-parser: 1.3.1 - eslint: 8.19.0 - eslint-utils: 3.0.0_eslint@8.19.0 + eslint: 8.20.0 + eslint-utils: 3.0.0_eslint@8.20.0 grapheme-splitter: 1.0.4 jsdoctypeparser: 9.0.0 refa: 0.9.1 @@ -5257,42 +5253,42 @@ packages: scslre: 0.1.6 dev: true - /eslint-plugin-simple-import-sort/7.0.0_eslint@8.19.0: + /eslint-plugin-simple-import-sort/7.0.0_eslint@8.20.0: resolution: {integrity: sha512-U3vEDB5zhYPNfxT5TYR7u01dboFZp+HNpnGhkDB2g/2E4wZ/g1Q9Ton8UwCLfRV9yAKyYqDh62oHOamvkFxsvw==} peerDependencies: eslint: '>=5.0.0' dependencies: - eslint: 8.19.0 + eslint: 8.20.0 dev: true - /eslint-plugin-sonar/0.8.0_2l6pd2z6wpkfvxik46nihypw3e: + /eslint-plugin-sonar/0.8.0_lx6jkr3ccqxuww6wnfj7rroswu: resolution: {integrity: sha512-5ZqgYIY1NSyR80v9RXbgwaK/jkHuGmuBa7ybsDEhwPydGplYvoj4zx8ahR8II7SoIOXPuzeh8HifEvKQSxu0iQ==} engines: {node: '>=12.20'} peerDependencies: eslint: ^7.0.0 || ^8.0.0 typescript: ^4.0.0 dependencies: - '@babel/eslint-parser': 7.18.2_ygqbvsyswrl2cmipz2mlfqys74 + '@babel/eslint-parser': 7.18.2_qfqwgqrbldst3lett5sigxr6tq builtin-modules: 3.3.0 bytes: 3.1.2 - eslint: 8.19.0 - eslint-plugin-sonarjs: 0.13.0_eslint@8.19.0 + eslint: 8.20.0 + eslint-plugin-sonarjs: 0.13.0_eslint@8.20.0 scslre: 0.1.6 typescript: 4.7.4 transitivePeerDependencies: - '@babel/core' dev: true - /eslint-plugin-sonarjs/0.13.0_eslint@8.19.0: + /eslint-plugin-sonarjs/0.13.0_eslint@8.20.0: resolution: {integrity: sha512-t3m7ta0EspzDxSOZh3cEOJIJVZgN/TlJYaBGnQlK6W/PZNbWep8q4RQskkJkA7/zwNpX0BaoEOSUUrqaADVoqA==} engines: {node: '>=12'} peerDependencies: eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - eslint: 8.19.0 + eslint: 8.20.0 dev: true - /eslint-plugin-svelte/2.2.0_eslint@8.19.0: + /eslint-plugin-svelte/2.2.0_eslint@8.20.0: resolution: {integrity: sha512-V7LwA2lEzGqQ1/Cor3uZS/dL3ff6kdHX44TNYViXyHifIEsFiN2TJWdnH+n6NewjCQ93KVI4cWeZI0Pl7ET/hA==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: @@ -5303,8 +5299,8 @@ packages: optional: true dependencies: debug: 4.3.4 - eslint: 8.19.0 - eslint-utils: 3.0.0_eslint@8.19.0 + eslint: 8.20.0 + eslint-utils: 3.0.0_eslint@8.20.0 known-css-properties: 0.25.0 postcss: 8.4.14 postcss-load-config: 3.1.4_postcss@8.4.14 @@ -5316,21 +5312,21 @@ packages: - ts-node dev: true - /eslint-plugin-toml/0.3.1_eslint@8.19.0: + /eslint-plugin-toml/0.3.1_eslint@8.20.0: resolution: {integrity: sha512-glaDFIEeDUYb9VrNdKGiSOmeRQ+jAFJVV5xhu3chYOF8+YfMYiUQhpCwzgYYiFTR2Hv5TYlO02oRwKxjMIw17Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '>=6.0.0' dependencies: debug: 4.3.4 - eslint: 8.19.0 + eslint: 8.20.0 lodash: 4.17.21 toml-eslint-parser: 0.4.0 transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-unicorn/43.0.1_eslint@8.19.0: + /eslint-plugin-unicorn/43.0.1_eslint@8.20.0: resolution: {integrity: sha512-wYvF6q0RRTKw6gzbKy5bbazWUrBEPIto2S9U6eSF+tsHgtgE+CwQ6Bww1W2Ie9TRED01QkZRN79c5aVMFgrFYw==} engines: {node: '>=14.18'} peerDependencies: @@ -5339,8 +5335,8 @@ packages: '@babel/helper-validator-identifier': 7.18.6 ci-info: 3.3.2 clean-regexp: 1.0.0 - eslint: 8.19.0 - eslint-utils: 3.0.0_eslint@8.19.0 + eslint: 8.20.0 + eslint-utils: 3.0.0_eslint@8.20.0 esquery: 1.4.0 indent-string: 4.0.0 is-builtin-module: 3.1.0 @@ -5353,41 +5349,41 @@ packages: strip-indent: 3.0.0 dev: true - /eslint-plugin-utils/0.3.1_eslint@8.19.0: + /eslint-plugin-utils/0.3.1_eslint@8.20.0: resolution: {integrity: sha512-bomAAoDLoAZ54eu2+fTOMl02q+fhGlQkU9LqIbsADFiTaaWWpfozbeX70I9RxwwkzZdFpfG+n06yeKlWv7s8dQ==} engines: {node: '>=10'} peerDependencies: eslint: '>=5.0.0' dependencies: - eslint: 8.19.0 + eslint: 8.20.0 dev: true - /eslint-plugin-vue/9.2.0_eslint@8.19.0: + /eslint-plugin-vue/9.2.0_eslint@8.20.0: resolution: {integrity: sha512-W2hc+NUXoce8sZtWgZ45miQTy6jNyuSdub5aZ1IBune4JDeAyzucYX0TzkrQ1jMO52sNUDYlCIHDoaNePe0p5g==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.2.0 || ^7.0.0 || ^8.0.0 dependencies: - eslint: 8.19.0 - eslint-utils: 3.0.0_eslint@8.19.0 + eslint: 8.20.0 + eslint-utils: 3.0.0_eslint@8.20.0 natural-compare: 1.4.0 nth-check: 2.1.1 postcss-selector-parser: 6.0.10 semver: 7.3.7 - vue-eslint-parser: 9.0.3_eslint@8.19.0 + vue-eslint-parser: 9.0.3_eslint@8.20.0 xml-name-validator: 4.0.0 transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-yml/1.0.0_eslint@8.19.0: + /eslint-plugin-yml/1.0.0_eslint@8.20.0: resolution: {integrity: sha512-0RVoUFh5vpznE2DIP5agSpWO/nU8GgAWwoTAHWopU2X+1SCB5ykHU6DwS0GrZ5Hvejtk6CcADQllpQQJB4C5QA==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: '>=6.0.0' dependencies: debug: 4.3.4 - eslint: 8.19.0 + eslint: 8.20.0 lodash: 4.17.21 natural-compare: 1.4.0 yaml-eslint-parser: 1.0.1 @@ -5423,13 +5419,13 @@ packages: eslint-visitor-keys: 1.3.0 dev: true - /eslint-utils/3.0.0_eslint@8.19.0: + /eslint-utils/3.0.0_eslint@8.20.0: resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} peerDependencies: eslint: '>=5' dependencies: - eslint: 8.19.0 + eslint: 8.20.0 eslint-visitor-keys: 2.1.0 dev: true @@ -5448,8 +5444,8 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint/8.19.0: - resolution: {integrity: sha512-SXOPj3x9VKvPe81TjjUJCYlV4oJjQw68Uek+AM0X4p+33dj2HY5bpTZOgnQHcG2eAm1mtCU9uNMnJi7exU/kYw==} + /eslint/8.20.0: + resolution: {integrity: sha512-d4ixhz5SKCa1D6SCPrivP7yYVi7nyD6A4vs6HIAul9ujBzcEmZVM3/0NN/yu5nKhmO1wjp5xQ46iRfmDGlOviA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: @@ -5462,7 +5458,7 @@ packages: doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.1.1 - eslint-utils: 3.0.0_eslint@8.19.0 + eslint-utils: 3.0.0_eslint@8.20.0 eslint-visitor-keys: 3.3.0 espree: 9.3.2 esquery: 1.4.0 @@ -5886,7 +5882,6 @@ packages: /get-tsconfig/4.2.0: resolution: {integrity: sha512-X8u8fREiYOE6S8hLbq99PeykTDoLVnxvF4DjWKJmz9xy2nNRdUcV8ZN9tniJFeKyTU3qnC9lL8n4Chd6LmVKHg==} - dev: false /git-raw-commits/2.0.11: resolution: {integrity: sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A==} @@ -6516,7 +6511,7 @@ packages: resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.0.5 + '@types/node': 18.0.6 merge-stream: 2.0.0 supports-color: 7.2.0 dev: true @@ -10530,7 +10525,6 @@ packages: dependencies: '@pkgr/utils': 2.3.0 tslib: 2.4.0 - dev: false /tapable/2.2.1: resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} @@ -10629,7 +10623,7 @@ packages: resolution: {integrity: sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==} dev: true - /ts-node/10.9.1_47blntjhuqtdxyxfczkfdvsynq: + /ts-node/10.9.1_tdn3ypgnfy6bmey2q4hu5jonwi: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -10648,7 +10642,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.3 - '@types/node': 18.0.5 + '@types/node': 18.0.6 acorn: 8.7.1 acorn-walk: 8.2.0 arg: 4.1.3 @@ -10841,7 +10835,7 @@ packages: '@types/concat-stream': 2.0.0 '@types/debug': 4.1.7 '@types/is-empty': 1.2.1 - '@types/node': 18.0.5 + '@types/node': 18.0.6 '@types/unist': 2.0.6 concat-stream: 2.0.0 debug: 4.3.4 @@ -11135,14 +11129,14 @@ packages: vfile-message: 3.1.2 dev: true - /vue-eslint-parser/8.3.0_eslint@8.19.0: + /vue-eslint-parser/8.3.0_eslint@8.20.0: resolution: {integrity: sha512-dzHGG3+sYwSf6zFBa0Gi9ZDshD7+ad14DGOdTLjruRVgZXe2J+DcZ9iUhyR48z5g1PqRa20yt3Njna/veLJL/g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '>=6.0.0' dependencies: debug: 4.3.4 - eslint: 8.19.0 + eslint: 8.20.0 eslint-scope: 7.1.1 eslint-visitor-keys: 3.3.0 espree: 9.3.2 @@ -11153,14 +11147,14 @@ packages: - supports-color dev: true - /vue-eslint-parser/9.0.3_eslint@8.19.0: + /vue-eslint-parser/9.0.3_eslint@8.20.0: resolution: {integrity: sha512-yL+ZDb+9T0ELG4VIFo/2anAOz8SvBdlqEnQnvJ3M7Scq56DvtjY0VY88bByRZB0D4J0u8olBcfrXTVONXsh4og==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: '>=6.0.0' dependencies: debug: 4.3.4 - eslint: 8.19.0 + eslint: 8.20.0 eslint-scope: 7.1.1 eslint-visitor-keys: 3.3.0 espree: 9.3.2 diff --git a/src/index.ts b/src/index.ts index eeb0f27..fdcd212 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,14 +23,14 @@ const _dirname = ? path.dirname(fileURLToPath(import.meta.url)) : __dirname -const globSync = createSyncFn( +export const globSync = createSyncFn( path.resolve(_dirname, 'worker.mjs'), ) /** * .mts, .cts, .d.mts, .d.cts, .mjs, .cjs are not included because .cjs and .mjs must be used explicitly. */ -const defaultExtensions = [ +export const defaultExtensions = [ '.ts', '.tsx', '.d.ts', @@ -40,24 +40,31 @@ const defaultExtensions = [ '.node', ] -const defaultMainFields = [ +export const defaultMainFields = [ 'types', 'typings', - 'module', - 'jsnext:main', - // https://angular.io/guide/angular-package-format - 'esm2020', - 'es2020', + // APF: https://angular.io/guide/angular-package-format 'fesm2020', 'fesm2015', + 'esm2020', + 'es2020', + + 'module', + 'jsnext:main', 'main', ] -const defaultConditionNames = [ +export const defaultConditionNames = [ 'types', 'import', + + // APF + 'esm2020', + 'es2020', + 'es2015', + 'require', 'node', 'node-addons', @@ -65,6 +72,19 @@ const defaultConditionNames = [ 'default', ] +export const defaultExtensionAlias = { + '.js': [ + '.ts', + // `.tsx` can also be compiled as `.js` + '.tsx', + '.d.ts', + '.js', + ], + '.jsx': ['.tsx', '.d.ts', '.jsx'], + '.cjs': ['.cts', '.d.cts', '.cjs'], + '.mjs': ['.mts', '.d.mts', '.mjs'], +} + export const interfaceVersion = 2 export interface TsResolverOptions @@ -72,24 +92,40 @@ export interface TsResolverOptions alwaysTryTypes?: boolean project?: string[] | string extensions?: string[] - packageFilter?: (pkg: Record) => Record - conditionNamesMapper?: Record } +type InternalResolverOptions = Required< + Pick< + ResolveOptions, + | 'conditionNames' + | 'extensionAlias' + | 'extensions' + | 'mainFields' + | 'useSyncFileSystemCalls' + > +> & + ResolveOptions & + TsResolverOptions + const fileSystem = fs as FileSystem const JS_EXT_PATTERN = /\.(?:[cm]js|jsx?)$/ const RELATIVE_PATH_PATTERN = /^\.{1,2}(?:\/.*)?$/ -let mappersBuildForOptions: TsResolverOptions +let cachedOptions: InternalResolverOptions | undefined + +let mappersCachedOptions: InternalResolverOptions let mappers: Array<((specifier: string) => string[]) | null> | undefined -let resolver: Resolver + +let resolverCachedOptions: InternalResolverOptions +let resolver: Resolver | undefined /** - * @param {string} source the module to resolve; i.e './some-module' - * @param {string} file the importing file's full path; i.e. '/usr/local/bin/file.js' - * @param {TsResolverOptions} options + * @param source the module to resolve; i.e './some-module' + * @param file the importing file's full path; i.e. '/usr/local/bin/file.js' + * @param options */ +// eslint-disable-next-line sonarjs/cognitive-complexity export function resolve( source: string, file: string, @@ -98,23 +134,22 @@ export function resolve( found: boolean path?: string | null } { - const opts: Required< - Pick< - ResolveOptions, - 'conditionNames' | 'extensions' | 'mainFields' | 'useSyncFileSystemCalls' - > - > & - ResolveOptions & - TsResolverOptions = { - ...options, - extensions: options?.extensions ?? defaultExtensions, - mainFields: options?.mainFields ?? defaultMainFields, - conditionNames: options?.conditionNames ?? defaultConditionNames, - fileSystem, - useSyncFileSystemCalls: true, + if (!cachedOptions || cachedOptions !== options) { + cachedOptions = { + ...options, + conditionNames: options?.conditionNames ?? defaultConditionNames, + extensions: options?.extensions ?? defaultExtensions, + extensionAlias: options?.extensionAlias ?? defaultExtensionAlias, + mainFields: options?.mainFields ?? defaultMainFields, + fileSystem, + useSyncFileSystemCalls: true, + } } - resolver = ResolverFactory.createResolver(opts) + if (!resolver || resolverCachedOptions !== cachedOptions) { + resolver = ResolverFactory.createResolver(cachedOptions) + resolverCachedOptions = cachedOptions + } log('looking for:', source) @@ -130,28 +165,31 @@ export function resolve( } } - initMappers(opts) + initMappers(cachedOptions) - const mappedPath = getMappedPath(source, file, opts.extensions, true) + const mappedPath = getMappedPath(source, file, cachedOptions.extensions, true) if (mappedPath) { log('matched ts path:', mappedPath) } // note that even if we map the path, we still need to do a final resolve - let foundNodePath: string | null | undefined + let foundNodePath: string | null try { foundNodePath = - tsResolve(mappedPath ?? source, path.dirname(path.resolve(file)), opts) || - null + resolver.resolveSync( + {}, + path.dirname(path.resolve(file)), + mappedPath ?? source, + ) || null } catch { foundNodePath = null } - // naive attempt at @types/* resolution, + // naive attempt at `@types/*` resolution, // if path is neither absolute nor relative if ( (JS_EXT_PATTERN.test(foundNodePath!) || - (opts.alwaysTryTypes && !foundNodePath)) && + (cachedOptions.alwaysTryTypes && !foundNodePath)) && !/^@types[/\\]/.test(source) && !path.isAbsolute(source) && !source.startsWith('.') @@ -182,56 +220,6 @@ export function resolve( } } -function resolveExtension(id: string) { - const idWithoutJsExt = removeJsExtension(id) - - if (idWithoutJsExt === id) { - return - } - - if (id.endsWith('.cjs')) { - return { - path: idWithoutJsExt, - extensions: ['.cts', '.d.cts'], - } - } - - if (id.endsWith('.mjs')) { - return { - path: idWithoutJsExt, - extensions: ['.mts', '.d.mts'], - } - } - - return { - path: idWithoutJsExt, - } -} - -/** - * Like `sync` from `resolve` package, but considers that the module id - * could have a .cjs, .mjs, .js or .jsx extension. - */ -function tsResolve( - source: string, - base: string, - options: ResolveOptions, -): string | false { - try { - return resolver.resolveSync({}, base, source) - } catch (error) { - const resolved = resolveExtension(source) - if (resolved) { - const resolver = ResolverFactory.createResolver({ - ...options, - extensions: resolved.extensions ?? options.extensions, - }) - return resolver.resolveSync({}, base, resolved.path) - } - throw error - } -} - /** Remove any trailing querystring from module id. */ function removeQuerystring(id: string) { const querystringIndex = id.lastIndexOf('?') @@ -241,11 +229,6 @@ function removeQuerystring(id: string) { return id } -/** Remove .cjs, .mjs, .js or .jsx extension from module id. */ -function removeJsExtension(id: string) { - return id.replace(JS_EXT_PATTERN, '') -} - const isFile = (path?: string | undefined): path is string => { try { return !!path && fs.statSync(path).isFile() @@ -327,8 +310,8 @@ function getMappedPath( return paths[0] } -function initMappers(options: TsResolverOptions) { - if (mappers && mappersBuildForOptions === options) { +function initMappers(options: InternalResolverOptions) { + if (mappers && mappersCachedOptions === options) { return } @@ -354,7 +337,7 @@ function initMappers(options: TsResolverOptions) { return tsconfigResult && createPathsMatcher(tsconfigResult) }) - mappersBuildForOptions = options + mappersCachedOptions = options } /** diff --git a/tests/withJsExtension/test.js b/tests/withJsExtension/test.js index 7b8b402..fd76548 100644 --- a/tests/withJsExtension/test.js +++ b/tests/withJsExtension/test.js @@ -124,7 +124,7 @@ assertResolve('bar', 'bar/index.tsx') assertResolve( 'typescript/lib/typescript.js', - path.relative(__dirname, require.resolve('typescript/lib/typescript.js')), + path.relative(__dirname, require.resolve('typescript/lib/typescript.d.ts')), ) // resolves symlinks by default