diff --git a/.eslintignore b/.eslintignore index 9c62828..450ea1c 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ node_modules coverage dist +vendor diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d35464e..b321fb0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,5 +21,6 @@ jobs: - run: pnpm install - run: pnpm build - run: pnpm lint - - run: pnpm vitest --coverage + - run: pnpm run test --coverage + - run: pnpm run test:build - uses: codecov/codecov-action@v3 diff --git a/.gitignore b/.gitignore index bb9eace..bace84d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ types *.env* .idea .history +vendor diff --git a/build.config.ts b/build.config.ts index f5c4377..6735827 100644 --- a/build.config.ts +++ b/build.config.ts @@ -1,3 +1,4 @@ +import { resolve } from "node:path"; import { defineBuildConfig } from "unbuild"; export default defineBuildConfig({ @@ -6,5 +7,24 @@ export default defineBuildConfig({ declaration: true, rollup: { emitCJS: true, + inlineDependencies: true, + dts: { + respectExternal: true, + } }, + alias: { + 'source-map': 'source-map-js', + // eslint-disable-next-line unicorn/prefer-module + recast: resolve(__dirname, 'vendor/recast/main.ts'), + // eslint-disable-next-line unicorn/prefer-module + 'ast-types': resolve(__dirname, 'vendor/ast-types/src/main.ts'), + }, + hooks: { + 'rollup:dts:options': (ctx, options) => { + // @ts-expect-error filter out commonjs plugin in dts build + options.plugins = options.plugins.filter((plugin) => { + return plugin && plugin.name !== 'commonjs' + }) + } + } }); diff --git a/package.json b/package.json index 32076ce..89716fd 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ ], "scripts": { "build": "unbuild", + "prepare": "esno ./scripts/vendor.ts", "dev": "vitest dev", "dev:ui": "vitest dev --ui", "lint": "eslint --cache --ext .ts,.js,.mjs,.cjs . && prettier -c src test", @@ -34,27 +35,38 @@ "prepack": "pnpm run build", "typecheck": "tsc --noEmit", "release": "pnpm run test run && changelogen --release && npm publish && git push --follow-tags", - "test": "vitest" + "test": "vitest", + "test:build": "TEST_BUILD=true vitest", + "test:full": "pnpm run test && pnpm run build && pnpm run test:build" }, "dependencies": { "@babel/parser": "^7.22.16", - "@babel/types": "^7.22.17", - "recast": "^0.23.4" + "@babel/types": "^7.22.19", + "source-map-js": "^1.0.2" }, "devDependencies": { "@types/node": "^20.6.0", "@vitest/coverage-v8": "^0.34.4", "@vitest/ui": "^0.34.4", + "ast-types": "^0.16.1", "changelogen": "^0.5.5", "eslint": "^8.49.0", "eslint-config-unjs": "^0.2.1", + "esno": "^0.17.0", + "giget": "^1.1.2", "lint-staged": "^14.0.1", + "magicast": "workspace:*", "prettier": "^3.0.3", + "recast": "^0.23.4", "simple-git-hooks": "^2.9.0", + "source-map": "npm:source-map-js@latest", "typescript": "^5.2.2", "unbuild": "^2.0.0", "vitest": "^0.34.4" }, + "resolutions": { + "source-map": "npm:source-map-js@latest" + }, "simple-git-hooks": { "pre-commit": "pnpm lint-staged" }, @@ -64,5 +76,24 @@ "prettier -w" ] }, - "packageManager": "pnpm@8.7.4" -} \ No newline at end of file + "packageManager": "pnpm@8.7.5", + "pnpm": { + "overrides": { + "array-includes": "npm:@nolyfill/array-includes@latest", + "array.prototype.flat": "npm:@nolyfill/array.prototype.flat@latest", + "array.prototype.flatmap": "npm:@nolyfill/array.prototype.flatmap@latest", + "available-typed-arrays": "npm:@nolyfill/available-typed-arrays@latest", + "define-properties": "npm:@nolyfill/define-properties@latest", + "function-bind": "npm:@nolyfill/function-bind@latest", + "gopd": "npm:@nolyfill/gopd@latest", + "has": "npm:@nolyfill/has@latest", + "has-symbols": "npm:@nolyfill/has-symbols@latest", + "has-tostringtag": "npm:@nolyfill/has-tostringtag@latest", + "is-arguments": "npm:@nolyfill/is-arguments@latest", + "is-generator-function": "npm:@nolyfill/is-generator-function@latest", + "object-is": "npm:@nolyfill/object-is@latest", + "object.values": "npm:@nolyfill/object.values@latest", + "which-typed-array": "npm:@nolyfill/which-typed-array@latest" + } + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a063ce2..27e4bf4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,54 +4,91 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false -dependencies: - '@babel/parser': - specifier: ^7.22.16 - version: 7.22.16 - '@babel/types': - specifier: ^7.22.17 - version: 7.22.17 - recast: - specifier: ^0.23.4 - version: 0.23.4 - -devDependencies: - '@types/node': - specifier: ^20.6.0 - version: 20.6.0 - '@vitest/coverage-v8': - specifier: ^0.34.4 - version: 0.34.4(vitest@0.34.4) - '@vitest/ui': - specifier: ^0.34.4 - version: 0.34.4(vitest@0.34.4) - changelogen: - specifier: ^0.5.5 - version: 0.5.5 - eslint: - specifier: ^8.49.0 - version: 8.49.0 - eslint-config-unjs: - specifier: ^0.2.1 - version: 0.2.1(eslint@8.49.0)(typescript@5.2.2) - lint-staged: - specifier: ^14.0.1 - version: 14.0.1 - prettier: - specifier: ^3.0.3 - version: 3.0.3 - simple-git-hooks: - specifier: ^2.9.0 - version: 2.9.0 - typescript: - specifier: ^5.2.2 - version: 5.2.2 - unbuild: - specifier: ^2.0.0 - version: 2.0.0(typescript@5.2.2) - vitest: - specifier: ^0.34.4 - version: 0.34.4(@vitest/ui@0.34.4) +overrides: + array-includes: npm:@nolyfill/array-includes@latest + array.prototype.flat: npm:@nolyfill/array.prototype.flat@latest + array.prototype.flatmap: npm:@nolyfill/array.prototype.flatmap@latest + available-typed-arrays: npm:@nolyfill/available-typed-arrays@latest + define-properties: npm:@nolyfill/define-properties@latest + function-bind: npm:@nolyfill/function-bind@latest + gopd: npm:@nolyfill/gopd@latest + has: npm:@nolyfill/has@latest + has-symbols: npm:@nolyfill/has-symbols@latest + has-tostringtag: npm:@nolyfill/has-tostringtag@latest + is-arguments: npm:@nolyfill/is-arguments@latest + is-generator-function: npm:@nolyfill/is-generator-function@latest + object-is: npm:@nolyfill/object-is@latest + object.values: npm:@nolyfill/object.values@latest + which-typed-array: npm:@nolyfill/which-typed-array@latest + +importers: + + .: + dependencies: + '@babel/parser': + specifier: ^7.22.16 + version: 7.22.16 + '@babel/types': + specifier: ^7.22.19 + version: 7.22.19 + source-map-js: + specifier: ^1.0.2 + version: 1.0.2 + devDependencies: + '@types/node': + specifier: ^20.6.0 + version: 20.6.0 + '@vitest/coverage-v8': + specifier: ^0.34.4 + version: 0.34.4(vitest@0.34.4) + '@vitest/ui': + specifier: ^0.34.4 + version: 0.34.4(vitest@0.34.4) + ast-types: + specifier: ^0.16.1 + version: 0.16.1 + changelogen: + specifier: ^0.5.5 + version: 0.5.5 + eslint: + specifier: ^8.49.0 + version: 8.49.0 + eslint-config-unjs: + specifier: ^0.2.1 + version: 0.2.1(eslint@8.49.0)(typescript@5.2.2) + esno: + specifier: ^0.17.0 + version: 0.17.0 + giget: + specifier: ^1.1.2 + version: 1.1.2 + lint-staged: + specifier: ^14.0.1 + version: 14.0.1 + magicast: + specifier: workspace:* + version: 'link:' + prettier: + specifier: ^3.0.3 + version: 3.0.3 + recast: + specifier: ^0.23.4 + version: 0.23.4 + simple-git-hooks: + specifier: ^2.9.0 + version: 2.9.0 + source-map: + specifier: npm:source-map-js@latest + version: /source-map-js@1.0.2 + typescript: + specifier: ^5.2.2 + version: 5.2.2 + unbuild: + specifier: ^2.0.0 + version: 2.0.0(typescript@5.2.2) + vitest: + specifier: ^0.34.4 + version: 0.34.4(@vitest/ui@0.34.4) packages: @@ -94,7 +131,7 @@ packages: '@babel/parser': 7.22.16 '@babel/template': 7.22.15 '@babel/traverse': 7.22.15 - '@babel/types': 7.22.17 + '@babel/types': 7.22.19 convert-source-map: 1.9.0 debug: 4.3.4 gensync: 1.0.0-beta.2 @@ -108,7 +145,7 @@ packages: resolution: {integrity: sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.17 + '@babel/types': 7.22.19 '@jridgewell/gen-mapping': 0.3.2 '@jridgewell/trace-mapping': 0.3.17 jsesc: 2.5.2 @@ -135,21 +172,21 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.22.15 - '@babel/types': 7.22.17 + '@babel/types': 7.22.19 dev: true /@babel/helper-hoist-variables@7.22.5: resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.17 + '@babel/types': 7.22.19 dev: true /@babel/helper-module-imports@7.22.15: resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.17 + '@babel/types': 7.22.19 dev: true /@babel/helper-module-transforms@7.22.15(@babel/core@7.22.15): @@ -163,29 +200,29 @@ packages: '@babel/helper-module-imports': 7.22.15 '@babel/helper-simple-access': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 - '@babel/helper-validator-identifier': 7.22.15 + '@babel/helper-validator-identifier': 7.22.19 dev: true /@babel/helper-simple-access@7.22.5: resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.17 + '@babel/types': 7.22.19 dev: true /@babel/helper-split-export-declaration@7.22.6: resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.17 + '@babel/types': 7.22.19 dev: true /@babel/helper-string-parser@7.22.5: resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} engines: {node: '>=6.9.0'} - /@babel/helper-validator-identifier@7.22.15: - resolution: {integrity: sha512-4E/F9IIEi8WR94324mbDUMo074YTheJmd7eZF5vITTeYchqAi6sYXRLHUVsmkdmY4QjfKTcB2jB7dVP3NaBElQ==} + /@babel/helper-validator-identifier@7.22.19: + resolution: {integrity: sha512-Tinq7ybnEPFFXhlYOYFiSjespWQk0dq2dRNAiMdRTOYQzEGqnnNyrTxPYHP5r6wGjlF1rFgABdDV0g8EwD6Qbg==} engines: {node: '>=6.9.0'} /@babel/helper-validator-option@7.22.15: @@ -199,7 +236,7 @@ packages: dependencies: '@babel/template': 7.22.15 '@babel/traverse': 7.22.15 - '@babel/types': 7.22.17 + '@babel/types': 7.22.19 transitivePeerDependencies: - supports-color dev: true @@ -209,7 +246,7 @@ packages: engines: {node: '>=6.9.0'} requiresBuild: true dependencies: - '@babel/helper-validator-identifier': 7.22.15 + '@babel/helper-validator-identifier': 7.22.19 chalk: 2.4.2 js-tokens: 4.0.0 dev: true @@ -219,7 +256,7 @@ packages: engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.22.17 + '@babel/types': 7.22.19 /@babel/standalone@7.22.15: resolution: {integrity: sha512-8qE83Gths6g29KOpYF9uaFPOXa3oaFF1/88ejKwgkGAZRIkdmoR/jPIzVviAsWNSaZdIdMLWwKSoXpuk9iNGmw==} @@ -232,7 +269,7 @@ packages: dependencies: '@babel/code-frame': 7.22.13 '@babel/parser': 7.22.16 - '@babel/types': 7.22.17 + '@babel/types': 7.22.19 dev: true /@babel/traverse@7.22.15: @@ -246,25 +283,46 @@ packages: '@babel/helper-hoist-variables': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.22.16 - '@babel/types': 7.22.17 + '@babel/types': 7.22.19 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color dev: true - /@babel/types@7.22.17: - resolution: {integrity: sha512-YSQPHLFtQNE5xN9tHuZnzu8vPr61wVTBZdfv1meex1NBosa4iT05k/Jw06ddJugi4bk7The/oSwQGFcksmEJQg==} + /@babel/types@7.22.19: + resolution: {integrity: sha512-P7LAw/LbojPzkgp5oznjE6tQEIWbp4PkkfrZDINTro9zgBRtI324/EYsiSI7lhPbpIQ+DCeR2NNmMWANGGfZsg==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-string-parser': 7.22.5 - '@babel/helper-validator-identifier': 7.22.15 + '@babel/helper-validator-identifier': 7.22.19 to-fast-properties: 2.0.0 /@bcoe/v8-coverage@0.2.3: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true + /@esbuild-kit/cjs-loader@2.4.4: + resolution: {integrity: sha512-NfsJX4PdzhwSkfJukczyUiZGc7zNNWZcEAyqeISpDnn0PTfzMJR1aR8xAIPskBejIxBJbIgCCMzbaYa9SXepIg==} + dependencies: + '@esbuild-kit/core-utils': 3.3.1 + get-tsconfig: 4.7.0 + dev: true + + /@esbuild-kit/core-utils@3.3.1: + resolution: {integrity: sha512-zg2aeGLgbZ/U8AnHRD6y085BkRqlw7jOsqpI/AFaQg6FhcCRycAe+aFLibs9okVVYTMqWANDC76UVSzd3qBoOw==} + dependencies: + esbuild: 0.18.20 + source-map-support: 0.5.21 + dev: true + + /@esbuild-kit/esm-loader@2.6.4: + resolution: {integrity: sha512-xcbyhN97xFFFEdDw6IC4EuzX9Ali3aV3cj2FIYragOQpbPM4X6QA2R5qaP3h7Tr0tuyI6dmJJdMw7oBHxBSXQA==} + dependencies: + '@esbuild-kit/core-utils': 3.3.1 + get-tsconfig: 4.7.0 + dev: true + /@esbuild/android-arm64@0.16.17: resolution: {integrity: sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==} engines: {node: '>=12'} @@ -983,6 +1041,101 @@ packages: fastq: 1.15.0 dev: true + /@nolyfill/array-includes@1.0.21: + resolution: {integrity: sha512-P+SLU5wuJmHnuo1Nhy/3l4yneHm6M+WmISz5tCVGLc0rytUBRfACmneLTryh4nlobAhUulDkBL+VoldU1g3zoA==} + engines: {node: '>=12.4.0'} + dependencies: + '@nolyfill/shared': 1.0.21 + dev: true + + /@nolyfill/array.prototype.flat@1.0.21: + resolution: {integrity: sha512-RoyB6qmcOSuflZH+XcZAkE1aBrYIV/3qdIGk6EG1afCdZSkUUCz0PAT8h3lHdtgVh+ge82hMK2SdCur2YeNj8A==} + engines: {node: '>=12.4.0'} + dependencies: + '@nolyfill/shared': 1.0.21 + dev: true + + /@nolyfill/array.prototype.flatmap@1.0.21: + resolution: {integrity: sha512-VWUiJBWk4qDgktkeQRzrtYlQdBRnEU3vfjoQxcBmdn3vSnq7ujKCBox4cdpZe9LZK9FU9Y1L4UteyW5THat2CQ==} + engines: {node: '>=12.4.0'} + dependencies: + '@nolyfill/shared': 1.0.21 + dev: true + + /@nolyfill/available-typed-arrays@1.0.21: + resolution: {integrity: sha512-JhNt/GI0AlGLhfpeh4H9eo71zvWbG6oRMzGaZiubR+9muc8vtACsoGD/Yv+dIx1D9ab2aXqxhP3A7Wc8Mu4u5w==} + engines: {node: '>=12.4.0'} + dev: true + + /@nolyfill/define-properties@1.0.21: + resolution: {integrity: sha512-q1xDIx9cYp6N1BjT8Kdq4GJwiJWxG1LV9jWDvz3hw/Q24m/DYSGXv+RTpB3rNZoorn4xweF2jklmxFFhhyKimA==} + engines: {node: '>=12.4.0'} + dependencies: + '@nolyfill/shared': 1.0.21 + dev: true + + /@nolyfill/function-bind@1.0.21: + resolution: {integrity: sha512-0Jsaoxp/9HJqCa3GzEzJcoi4+VfupD/o+1pBG0qJ0X3d+sKbbfSej2Faiyp0fTHH36mhsdAKi2TahEx9JV08ZA==} + engines: {node: '>=12.4.0'} + dev: true + + /@nolyfill/gopd@1.0.21: + resolution: {integrity: sha512-zSg1OEGXGcIfBWkq83frp/1LQD4NPxnNh8ECO05mcZtHjeSAtgq726gOOq3tsdlR8d696Gjq3Hw8wiaPmgafyg==} + engines: {node: '>=12.4.0'} + dev: true + + /@nolyfill/has-symbols@1.0.21: + resolution: {integrity: sha512-fx+nNcrPdXoPH+nKNlqRfeOOxCu7IqFAh6KqzVbuHdu5QHpPT74TmobOQzruTYq+nHeSsw3+9uc32aSa4jrkNw==} + engines: {node: '>=12.4.0'} + dev: true + + /@nolyfill/has-tostringtag@1.0.21: + resolution: {integrity: sha512-vcSJnah+I19svbYbOIQF/NK0S42rQLGDEWc67OEPXsZSy+VFlpsE42kVNZSykIecmZGuZ8iMlB0cpFii6Lfwhw==} + engines: {node: '>=12.4.0'} + dev: true + + /@nolyfill/has@1.0.21: + resolution: {integrity: sha512-Sf8iFaegjGp29hQVQjIc+nDR0uWqGkHsFC3jsUigFwGjpafgMaBtL++DpTU9jYAKDJEvslR1szl8qJjNGlhgcw==} + engines: {node: '>=12.4.0'} + dependencies: + '@nolyfill/shared': 1.0.21 + dev: true + + /@nolyfill/is-arguments@1.0.21: + resolution: {integrity: sha512-HRZGXP4Khz2W/Oma5TD0w2PMUNjFFCwc+GDQxX1/DfWFCewnVhdudjlUDH4/XOikYhGkxcG+YVJAXXsmcVWW7A==} + engines: {node: '>=12.4.0'} + dev: true + + /@nolyfill/is-generator-function@1.0.21: + resolution: {integrity: sha512-rxHlkx7kHiu7/nNgn/SV5cbuncZv52RzRJ+weVQsjj5xpLxsH298NGRLcHW48yYwPOdGvd3BnbpZe1kCo9QWaw==} + engines: {node: '>=12.4.0'} + dev: true + + /@nolyfill/object-is@1.0.21: + resolution: {integrity: sha512-iUQXK1Qvh6UjkcOd+xLY6ji/xBG6oSiStbc5Q73luWK3wNmwpIaO/FvZjE8OQFQzarSj6vI4EMUM8JKpwnZosg==} + engines: {node: '>=12.4.0'} + dependencies: + '@nolyfill/shared': 1.0.21 + dev: true + + /@nolyfill/object.values@1.0.21: + resolution: {integrity: sha512-5RPPiaknXoCnpwXZTy99Oo/sNega0wf5DsYQU6YOFa1kLhvwgc4x2/Np1F8zT7WwGE9C1POH3ZIuSMelpd79Ew==} + engines: {node: '>=12.4.0'} + dependencies: + '@nolyfill/shared': 1.0.21 + dev: true + + /@nolyfill/shared@1.0.21: + resolution: {integrity: sha512-qDc/NoaFU23E0hhiDPeUrvWzTXIPE+RbvRQtRWSeHHNmCIgYI9HS1jKzNYNJxv4jvZ/1VmM3L6rNVxbj+LBMNA==} + dev: true + + /@nolyfill/which-typed-array@1.0.21: + resolution: {integrity: sha512-/AqIVAAGLI6KH9idsre3pvup5H48fhtd2z4G2ACxEPCZVI1JycBMnuX6bcQTdOuYBm5ZzewZ1LNf/oGMiD9Jrg==} + engines: {node: '>=12.4.0'} + dependencies: + '@nolyfill/shared': 1.0.21 + dev: true + /@pkgr/utils@2.3.1: resolution: {integrity: sha512-wfzX8kc1PMyUILA+1Z/EqoE4UCXGy0iRGMhPwdfae1+f0OXlLqCk+By+aMzgJBzR9AzS4CDizioG6Ss1gvAFJw==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} @@ -1431,50 +1584,19 @@ packages: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} dev: true - /array-includes@3.1.6: - resolution: {integrity: sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.1 - get-intrinsic: 1.2.0 - is-string: 1.0.7 - dev: true - /array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} dev: true - /array.prototype.flat@1.3.1: - resolution: {integrity: sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.1 - es-shim-unscopables: 1.0.0 - dev: true - - /array.prototype.flatmap@1.3.1: - resolution: {integrity: sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.1 - es-shim-unscopables: 1.0.0 - dev: true - /assert@2.0.0: resolution: {integrity: sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==} dependencies: es6-object-assign: 1.1.0 is-nan: 1.3.2 - object-is: 1.1.5 + object-is: /@nolyfill/object-is@1.0.21 util: 0.12.5 - dev: false + dev: true /assertion-error@1.1.0: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} @@ -1485,11 +1607,7 @@ packages: engines: {node: '>=4'} dependencies: tslib: 2.5.0 - dev: false - - /available-typed-arrays@1.0.5: - resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} - engines: {node: '>= 0.4'} + dev: true /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -1543,6 +1661,10 @@ packages: update-browserslist-db: 1.0.11(browserslist@4.21.10) dev: true + /buffer-from@1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + dev: true + /builtin-modules@3.3.0: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} @@ -1587,8 +1709,9 @@ packages: /call-bind@1.0.2: resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} dependencies: - function-bind: 1.1.1 + function-bind: /@nolyfill/function-bind@1.0.21 get-intrinsic: 1.2.0 + dev: true /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} @@ -1844,13 +1967,6 @@ packages: engines: {node: '>=12'} dev: true - /define-properties@1.2.0: - resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==} - engines: {node: '>= 0.4'} - dependencies: - has-property-descriptors: 1.0.0 - object-keys: 1.1.1 - /defu@6.1.2: resolution: {integrity: sha512-+uO4+qr7msjNNWKYPHqN/3+Dx3NFkmIzayk2L1MyZQlvgZb/J1A0fo410dpKrN2SnqFjt8n4JL8fDJE0wIgjFQ==} dev: true @@ -1916,72 +2032,9 @@ packages: is-arrayish: 0.2.1 dev: true - /es-abstract@1.21.1: - resolution: {integrity: sha512-QudMsPOz86xYz/1dG1OuGBKOELjCh99IIWHLzy5znUB6j8xG2yMA7bfTV86VSqKF+Y/H08vQPR+9jyXpuC6hfg==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.5 - call-bind: 1.0.2 - es-set-tostringtag: 2.0.1 - es-to-primitive: 1.2.1 - function-bind: 1.1.1 - function.prototype.name: 1.1.5 - get-intrinsic: 1.2.0 - get-symbol-description: 1.0.0 - globalthis: 1.0.3 - gopd: 1.0.1 - has: 1.0.3 - has-property-descriptors: 1.0.0 - has-proto: 1.0.1 - has-symbols: 1.0.3 - internal-slot: 1.0.5 - is-array-buffer: 3.0.1 - is-callable: 1.2.7 - is-negative-zero: 2.0.2 - is-regex: 1.1.4 - is-shared-array-buffer: 1.0.2 - is-string: 1.0.7 - is-typed-array: 1.1.10 - is-weakref: 1.0.2 - object-inspect: 1.12.3 - object-keys: 1.1.1 - object.assign: 4.1.4 - regexp.prototype.flags: 1.4.3 - safe-regex-test: 1.0.0 - string.prototype.trimend: 1.0.6 - string.prototype.trimstart: 1.0.6 - typed-array-length: 1.0.4 - unbox-primitive: 1.0.2 - which-typed-array: 1.1.9 - dev: true - - /es-set-tostringtag@2.0.1: - resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==} - engines: {node: '>= 0.4'} - dependencies: - get-intrinsic: 1.2.0 - has: 1.0.3 - has-tostringtag: 1.0.0 - dev: true - - /es-shim-unscopables@1.0.0: - resolution: {integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==} - dependencies: - has: 1.0.3 - dev: true - - /es-to-primitive@1.2.1: - resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} - engines: {node: '>= 0.4'} - dependencies: - is-callable: 1.2.7 - is-date-object: 1.0.5 - is-symbol: 1.0.4 - dev: true - /es6-object-assign@1.1.0: resolution: {integrity: sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw==} - dev: false + dev: true /esbuild@0.16.17: resolution: {integrity: sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==} @@ -2158,7 +2211,7 @@ packages: eslint: 8.49.0 eslint-module-utils: 2.7.4(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.5)(eslint@8.49.0) eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-typescript@3.5.5)(eslint@8.49.0) - get-tsconfig: 4.6.0 + get-tsconfig: 4.7.0 globby: 13.2.2 is-core-module: 2.12.1 is-glob: 4.0.3 @@ -2233,19 +2286,19 @@ packages: optional: true dependencies: '@typescript-eslint/parser': 5.62.0(eslint@8.49.0)(typescript@5.2.2) - array-includes: 3.1.6 - array.prototype.flat: 1.3.1 - array.prototype.flatmap: 1.3.1 + array-includes: /@nolyfill/array-includes@1.0.21 + array.prototype.flat: /@nolyfill/array.prototype.flat@1.0.21 + array.prototype.flatmap: /@nolyfill/array.prototype.flatmap@1.0.21 debug: 3.2.7 doctrine: 2.1.0 eslint: 8.49.0 eslint-import-resolver-node: 0.3.7 eslint-module-utils: 2.7.4(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.5)(eslint@8.49.0) - has: 1.0.3 + has: /@nolyfill/has@1.0.21 is-core-module: 2.12.1 is-glob: 4.0.3 minimatch: 3.1.2 - object.values: 1.1.6 + object.values: /@nolyfill/object.values@1.0.21 resolve: 1.22.2 semver: 6.3.1 tsconfig-paths: 3.14.1 @@ -2302,7 +2355,7 @@ packages: peerDependencies: eslint: '>=8.38.0' dependencies: - '@babel/helper-validator-identifier': 7.22.15 + '@babel/helper-validator-identifier': 7.22.19 '@eslint-community/eslint-utils': 4.4.0(eslint@8.49.0) ci-info: 3.8.0 clean-regexp: 1.0.0 @@ -2400,6 +2453,13 @@ packages: - supports-color dev: true + /esno@0.17.0: + resolution: {integrity: sha512-w78cQGlptQfsBYfootUCitsKS+MD74uR5L6kNsvwVkJsfzEepIafbvWsx2xK4rcFP4IUftt4F6J8EhagUxX+Bg==} + hasBin: true + dependencies: + tsx: 3.12.10 + dev: true + /espree@9.6.1: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2413,7 +2473,7 @@ packages: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true - dev: false + dev: true /esquery@1.5.0: resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} @@ -2581,6 +2641,7 @@ packages: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} dependencies: is-callable: 1.2.7 + dev: true /fs-extra@11.1.1: resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==} @@ -2610,23 +2671,6 @@ packages: dev: true optional: true - /function-bind@1.1.1: - resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} - - /function.prototype.name@1.1.5: - resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.1 - functions-have-names: 1.2.3 - dev: true - - /functions-have-names@1.2.3: - resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} - dev: true - /gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} @@ -2639,9 +2683,10 @@ packages: /get-intrinsic@1.2.0: resolution: {integrity: sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==} dependencies: - function-bind: 1.1.1 - has: 1.0.3 - has-symbols: 1.0.3 + function-bind: /@nolyfill/function-bind@1.0.21 + has: /@nolyfill/has@1.0.21 + has-symbols: /@nolyfill/has-symbols@1.0.21 + dev: true /get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} @@ -2653,16 +2698,8 @@ packages: engines: {node: '>=16'} dev: true - /get-symbol-description@1.0.0: - resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - get-intrinsic: 1.2.0 - dev: true - - /get-tsconfig@4.6.0: - resolution: {integrity: sha512-lgbo68hHTQnFddybKbbs/RDRJnJT5YyGy2kQzVwbq+g67X73i+5MVTval34QxGkOe9X5Ujf1UYpCaphLyltjEg==} + /get-tsconfig@4.7.0: + resolution: {integrity: sha512-pmjiZ7xtB8URYm74PlGJozDNyhvsVLUcpBa8DZBG3bWHwaHa9bPiRpiSfovw+fjhwONSCWKRyk+JQHEGZmMrzw==} dependencies: resolve-pkg-maps: 1.0.0 dev: true @@ -2730,13 +2767,6 @@ packages: type-fest: 0.20.2 dev: true - /globalthis@1.0.3: - resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} - engines: {node: '>= 0.4'} - dependencies: - define-properties: 1.2.0 - dev: true - /globalyzer@0.1.0: resolution: {integrity: sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==} dev: true @@ -2768,11 +2798,6 @@ packages: resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} dev: true - /gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - dependencies: - get-intrinsic: 1.2.0 - /graceful-fs@4.2.10: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} dev: true @@ -2781,10 +2806,6 @@ packages: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} dev: true - /has-bigints@1.0.2: - resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} - dev: true - /has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} @@ -2796,32 +2817,6 @@ packages: engines: {node: '>=8'} dev: true - /has-property-descriptors@1.0.0: - resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} - dependencies: - get-intrinsic: 1.2.0 - - /has-proto@1.0.1: - resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} - engines: {node: '>= 0.4'} - dev: true - - /has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - /has-tostringtag@1.0.0: - resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} - engines: {node: '>= 0.4'} - dependencies: - has-symbols: 1.0.3 - - /has@1.0.3: - resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} - engines: {node: '>= 0.4.0'} - dependencies: - function-bind: 1.1.1 - /hookable@5.5.3: resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} dev: true @@ -2891,42 +2886,12 @@ packages: /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - /internal-slot@1.0.5: - resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==} - engines: {node: '>= 0.4'} - dependencies: - get-intrinsic: 1.2.0 - has: 1.0.3 - side-channel: 1.0.4 - dev: true - - /is-arguments@1.1.1: - resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - has-tostringtag: 1.0.0 - dev: false - - /is-array-buffer@3.0.1: - resolution: {integrity: sha512-ASfLknmY8Xa2XtB4wmbz13Wu202baeA18cJBCeCy0wXUHZF0IPyVEXqKEcd+t2fNSLLL1vC6k7lxZEojNbISXQ==} - dependencies: - call-bind: 1.0.2 - get-intrinsic: 1.2.0 - is-typed-array: 1.1.10 dev: true /is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} dev: true - /is-bigint@1.0.4: - resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} - dependencies: - has-bigints: 1.0.2 - dev: true - /is-binary-path@2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} @@ -2934,14 +2899,6 @@ packages: binary-extensions: 2.2.0 dev: true - /is-boolean-object@1.1.2: - resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - has-tostringtag: 1.0.0 - dev: true - /is-builtin-module@3.2.1: resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} engines: {node: '>=6'} @@ -2952,18 +2909,12 @@ packages: /is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} + dev: true /is-core-module@2.12.1: resolution: {integrity: sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==} dependencies: - has: 1.0.3 - dev: true - - /is-date-object@1.0.5: - resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.0 + has: /@nolyfill/has@1.0.21 dev: true /is-docker@2.2.1: @@ -2988,13 +2939,6 @@ packages: engines: {node: '>=12'} dev: true - /is-generator-function@1.0.10: - resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.0 - dev: false - /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -3019,19 +2963,7 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.2.0 - dev: false - - /is-negative-zero@2.0.2: - resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} - engines: {node: '>= 0.4'} - dev: true - - /is-number-object@1.0.7: - resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.0 + define-properties: /@nolyfill/define-properties@1.0.21 dev: true /is-number@7.0.0: @@ -3050,20 +2982,6 @@ packages: '@types/estree': 1.0.0 dev: true - /is-regex@1.1.4: - resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - has-tostringtag: 1.0.0 - dev: true - - /is-shared-array-buffer@1.0.2: - resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} - dependencies: - call-bind: 1.0.2 - dev: true - /is-stream@2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} @@ -3074,34 +2992,15 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true - /is-string@1.0.7: - resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.0 - dev: true - - /is-symbol@1.0.4: - resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} - engines: {node: '>= 0.4'} - dependencies: - has-symbols: 1.0.3 - dev: true - /is-typed-array@1.1.10: resolution: {integrity: sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==} engines: {node: '>= 0.4'} dependencies: - available-typed-arrays: 1.0.5 + available-typed-arrays: /@nolyfill/available-typed-arrays@1.0.21 call-bind: 1.0.2 for-each: 0.3.3 - gopd: 1.0.1 - has-tostringtag: 1.0.0 - - /is-weakref@1.0.2: - resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} - dependencies: - call-bind: 1.0.2 + gopd: /@nolyfill/gopd@1.0.21 + has-tostringtag: /@nolyfill/has-tostringtag@1.0.21 dev: true /is-wsl@2.2.0: @@ -3527,41 +3426,6 @@ packages: path-key: 4.0.0 dev: true - /object-inspect@1.12.3: - resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} - dev: true - - /object-is@1.1.5: - resolution: {integrity: sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - dev: false - - /object-keys@1.1.1: - resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} - engines: {node: '>= 0.4'} - - /object.assign@4.1.4: - resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - has-symbols: 1.0.3 - object-keys: 1.1.1 - dev: true - - /object.values@1.1.6: - resolution: {integrity: sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.1 - dev: true - /ofetch@1.1.1: resolution: {integrity: sha512-SSMoktrp9SNLi20BWfB/BnnKcL0RDigXThD/mZBeQxkIRv1xrd9183MtLdsqRYLYSqW0eTr5t8w8MqjNhvoOQQ==} dependencies: @@ -3841,22 +3705,13 @@ packages: esprima: 4.0.1 source-map: 0.6.1 tslib: 2.5.0 - dev: false + dev: true /regexp-tree@0.1.24: resolution: {integrity: sha512-s2aEVuLhvnVJW6s/iPgEGK6R+/xngd2jNQ+xy4bXNDKxZKJH6jpPHY6kVeVv1IeLCHgswRj+Kl3ELaDjG6V1iw==} hasBin: true dev: true - /regexp.prototype.flags@1.4.3: - resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - functions-have-names: 1.2.3 - dev: true - /regexpp@3.2.0: resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} engines: {node: '>=8'} @@ -3946,14 +3801,6 @@ packages: queue-microtask: 1.2.3 dev: true - /safe-regex-test@1.0.0: - resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} - dependencies: - call-bind: 1.0.2 - get-intrinsic: 1.2.0 - is-regex: 1.1.4 - dev: true - /safe-regex@2.1.1: resolution: {integrity: sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==} dependencies: @@ -3994,14 +3841,6 @@ packages: engines: {node: '>=8'} dev: true - /side-channel@1.0.4: - resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} - dependencies: - call-bind: 1.0.2 - get-intrinsic: 1.2.0 - object-inspect: 1.12.3 - dev: true - /siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} dev: true @@ -4051,11 +3890,18 @@ packages: /source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} + + /source-map-support@0.5.21: + resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 dev: true /source-map@0.6.1: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} + dev: true /spdx-correct@3.1.1: resolution: {integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==} @@ -4101,22 +3947,6 @@ packages: strip-ansi: 7.0.1 dev: true - /string.prototype.trimend@1.0.6: - resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.1 - dev: true - - /string.prototype.trimstart@1.0.6: - resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.21.1 - dev: true - /strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -4279,6 +4109,7 @@ packages: /tslib@2.5.0: resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} + dev: true /tsutils@3.21.0(typescript@5.2.2): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} @@ -4290,6 +4121,17 @@ packages: typescript: 5.2.2 dev: true + /tsx@3.12.10: + resolution: {integrity: sha512-2+46h4xvUt1aLDNvk5YBT8Uzw+b7BolGbn7iSMucYqCXZiDc+1IMghLVdw8kKjING32JFOeO+Am9posvjkeclA==} + hasBin: true + dependencies: + '@esbuild-kit/cjs-loader': 2.4.4 + '@esbuild-kit/core-utils': 3.3.1 + '@esbuild-kit/esm-loader': 2.6.4 + optionalDependencies: + fsevents: 2.3.2 + dev: true + /type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} @@ -4322,14 +4164,6 @@ packages: engines: {node: '>=10'} dev: true - /typed-array-length@1.0.4: - resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} - dependencies: - call-bind: 1.0.2 - for-each: 0.3.3 - is-typed-array: 1.1.10 - dev: true - /typescript@5.2.2: resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} engines: {node: '>=14.17'} @@ -4340,15 +4174,6 @@ packages: resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==} dev: true - /unbox-primitive@1.0.2: - resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} - dependencies: - call-bind: 1.0.2 - has-bigints: 1.0.2 - has-symbols: 1.0.3 - which-boxed-primitive: 1.0.2 - dev: true - /unbuild@2.0.0(typescript@5.2.2): resolution: {integrity: sha512-JWCUYx3Oxdzvw2J9kTAp+DKE8df/BnH/JTSj6JyA4SH40ECdFu7FoJJcrm8G92B7TjofQ6GZGjJs50TRxoH6Wg==} hasBin: true @@ -4404,7 +4229,7 @@ packages: dependencies: '@babel/core': 7.22.15 '@babel/standalone': 7.22.15 - '@babel/types': 7.22.17 + '@babel/types': 7.22.19 defu: 6.1.2 jiti: 1.19.3 mri: 1.2.0 @@ -4434,11 +4259,11 @@ packages: resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} dependencies: inherits: 2.0.4 - is-arguments: 1.1.1 - is-generator-function: 1.0.10 + is-arguments: /@nolyfill/is-arguments@1.0.21 + is-generator-function: /@nolyfill/is-generator-function@1.0.21 is-typed-array: 1.1.10 - which-typed-array: 1.1.9 - dev: false + which-typed-array: /@nolyfill/which-typed-array@1.0.21 + dev: true /v8-to-istanbul@9.1.0: resolution: {integrity: sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==} @@ -4576,27 +4401,6 @@ packages: - terser dev: true - /which-boxed-primitive@1.0.2: - resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} - dependencies: - is-bigint: 1.0.4 - is-boolean-object: 1.1.2 - is-number-object: 1.0.7 - is-string: 1.0.7 - is-symbol: 1.0.4 - dev: true - - /which-typed-array@1.1.9: - resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.5 - call-bind: 1.0.2 - for-each: 0.3.3 - gopd: 1.0.1 - has-tostringtag: 1.0.0 - is-typed-array: 1.1.10 - /which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..71ecba8 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - '!vendor/*' diff --git a/scripts/vendor.ts b/scripts/vendor.ts new file mode 100644 index 0000000..8919ea7 --- /dev/null +++ b/scripts/vendor.ts @@ -0,0 +1,104 @@ +/* eslint-disable unicorn/prefer-top-level-await */ +import fs from 'node:fs' +import fsp from 'node:fs/promises' +import { join } from 'node:path' +import { downloadTemplate } from 'giget' + +// This script clones recast and patches, and then re-bundle it so we get rid of the unnecessary polyfills + +async function cloneRecast() { + if (fs.existsSync('vendor/recast')) { + console.log('vendor/recast already exists') + } + else { + // Clone recast + await downloadTemplate('github:benjamn/recast#v0.23.4', { + dir: 'vendor/recast', + }) + + // Remove the tsconfig.json so it's targeting newer node versions + await fsp.rm('vendor/recast/tsconfig.json') + + // Remove the assert import and usage + await Promise.all(fs.readdirSync('vendor/recast/lib', { withFileTypes: true }).map(async (file) => { + if (!file.isFile()) { + return + } + return await filterLines(join(file.path, file.name), (line) => { + if (line.startsWith('import assert from')) { + return false + } + if (/^\s*assert\./.test(line)) { + if (line.endsWith(';')) { + return false + } + return `// @ts-ignore \n false && ` + line + } + return line + }) + })) + + // Remove the require(), and since we are providing our own parser anyway + await filterLines('vendor/recast/lib/options.ts', (line) => { + if (line.includes('parser: require("../parsers/esprima")')) { + return false + } + return line + }) + + await filterLines('vendor/recast/lib/parser.ts', (line) => { + return line.replace('require("esprima")', `false && require("")`) + }) + + await filterLines('vendor/recast/lib/util.ts', (line) => { + if (line.includes('isBrowser() ? "\\n"')) { return 'return "\\n"' } + return line + }) + + console.log('vendor/recast cloned') + } +} + + +async function cloneAstTypes() { + if (fs.existsSync('vendor/ast-types')) { + console.log('vendor/ast-types already exists') + } + else { + // Clone recast + await downloadTemplate('github:benjamn/ast-types#v0.16.1', { + dir: 'vendor/ast-types', + }) + + // Remove the tsconfig.json so it's targeting newer node versions + await fsp.rm('vendor/ast-types/tsconfig.json') + + // Add import type + await filterLines('vendor/ast-types/src/main.ts', (line) => { + if (/^import\s*{\s*(ASTNode|Visitor)/.test(line)) { + return line.replace(/^import /, 'import type ') + } + return line + }) + + console.log('vendor/ast-types cloned') + } +} + +async function filterLines(file: string, filter: (line: string, index: number) => boolean | string) { + const content = await fsp.readFile(file, 'utf8') + const lines = content.split('\n') + const newContent = lines + .map((i, idx) => filter(i, idx)) + .filter(i => i !== false) + .join('\n') + if (newContent !== content) { + await fsp.writeFile(file, newContent) + } +} + + +await Promise.all([ + cloneRecast(), + cloneAstTypes(), +]) diff --git a/test/array.test.ts b/test/array.test.ts index f9b40a9..5e20804 100644 --- a/test/array.test.ts +++ b/test/array.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "vitest"; -import { generate } from "./_utils"; import { parseModule } from "magicast"; +import { generate } from "./_utils"; describe("array", () => { it("array operations", async () => { diff --git a/test/builders/expression.test.ts b/test/builders/expression.test.ts index 153262d..9f24089 100644 --- a/test/builders/expression.test.ts +++ b/test/builders/expression.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "vitest"; -import { generate } from "../_utils"; import { builders, parseModule } from "magicast"; +import { generate } from "../_utils"; describe("builders/expression", () => { it("new expression", async () => { diff --git a/test/builders/function-call.test.ts b/test/builders/function-call.test.ts index 587a834..3f83b7f 100644 --- a/test/builders/function-call.test.ts +++ b/test/builders/function-call.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "vitest"; -import { generate } from "../_utils"; import { builders, parseModule } from "magicast"; +import { generate } from "../_utils"; describe("builders/functionCall", () => { it("new", async () => { diff --git a/test/builders/raw.test.ts b/test/builders/raw.test.ts index bf89a86..5f3d25f 100644 --- a/test/builders/raw.test.ts +++ b/test/builders/raw.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "vitest"; -import { generate } from "../_utils"; import { builders, parseModule } from "magicast"; +import { generate } from "../_utils"; describe("builders/raw", () => { it("object", async () => { diff --git a/test/errors.test.ts b/test/errors.test.ts index e15d53d..1e865da 100644 --- a/test/errors.test.ts +++ b/test/errors.test.ts @@ -1,6 +1,6 @@ import { expect, describe, it } from "vitest"; -import { generate } from "./_utils"; import { parseExpression, parseModule } from "magicast"; +import { generate } from "./_utils"; describe("errors", () => { it("ternary", () => { diff --git a/test/exports.test.ts b/test/exports.test.ts index fe9f301..69d8ae8 100644 --- a/test/exports.test.ts +++ b/test/exports.test.ts @@ -1,6 +1,6 @@ import { expect, it, describe } from "vitest"; -import { generate } from "./_utils"; import { parseModule } from "magicast"; +import { generate } from "./_utils"; describe("exports", () => { it("manipulate exports", async () => { diff --git a/test/function-call.test.ts b/test/function-call.test.ts index 80c2fac..fa467d4 100644 --- a/test/function-call.test.ts +++ b/test/function-call.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "vitest"; -import { generate } from "./_utils"; import { builders, parseModule, ProxifiedModule } from "magicast"; +import { generate } from "./_utils"; describe("function-calls", () => { it("function wrapper", async () => { diff --git a/test/general.test.ts b/test/general.test.ts index ec69a0d..8aa5af5 100644 --- a/test/general.test.ts +++ b/test/general.test.ts @@ -1,6 +1,6 @@ import { expect, it, describe } from "vitest"; -import { generate } from "./_utils"; import { generateCode, parseModule, parseExpression } from "magicast"; +import { generate } from "./_utils"; describe("general", () => { it("basic object and array", async () => { diff --git a/test/helpers/nuxt.test.ts b/test/helpers/nuxt.test.ts index 4fc6f96..810614a 100644 --- a/test/helpers/nuxt.test.ts +++ b/test/helpers/nuxt.test.ts @@ -1,6 +1,6 @@ import { it, describe, expect } from "vitest"; -import { generate } from "../_utils"; import { parseModule } from "magicast"; +import { generate } from "../_utils"; import { addNuxtModule } from "magicast/helpers"; describe("helpers > nuxt", () => { diff --git a/test/helpers/vite.test.ts b/test/helpers/vite.test.ts index 1e51d63..e912571 100644 --- a/test/helpers/vite.test.ts +++ b/test/helpers/vite.test.ts @@ -1,6 +1,6 @@ import { it, describe, expect } from "vitest"; -import { generate } from "../_utils"; import { parseModule } from "magicast"; +import { generate } from "../_utils"; import { addVitePlugin, updateVitePluginConfig } from "magicast/helpers"; describe("helpers > vite", () => { @@ -207,7 +207,7 @@ export default defineConfig({ expect(await generate(mod)).toMatchInlineSnapshot(` "import { VitePWA } from \\"vite-plugin-pwa\\"; import { somePlugin1, somePlugin2 } from \\"some-module\\"; - + import type { UserConfig } from \\"vite\\"; const myConfig = { @@ -243,7 +243,7 @@ export default defineConfig({ expect(await generate(mod)).toMatchInlineSnapshot(` "import { VitePWA } from \\"vite-plugin-pwa\\"; import { somePlugin1, somePlugin2 } from \\"some-module\\"; - + import type { UserConfig } from \\"vite\\"; const myConfig = defineConfig({ diff --git a/test/imports.test.ts b/test/imports.test.ts index a116e4f..caef742 100644 --- a/test/imports.test.ts +++ b/test/imports.test.ts @@ -1,6 +1,6 @@ import { expect, it, describe } from "vitest"; -import { generate } from "./_utils"; import { parseModule } from "magicast"; +import { generate } from "./_utils"; describe("imports", () => { it("manipulate imports", async () => { diff --git a/tsconfig.json b/tsconfig.json index 725c3cb..97757f9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,6 +16,7 @@ } }, "exclude": [ - "dist" + "dist", + "vendor" ] } diff --git a/vitest.config.ts b/vitest.config.ts index ecfbd53..7345d85 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -4,8 +4,23 @@ import { defineConfig } from 'vitest/config' export default defineConfig({ resolve: { alias: { - 'magicast/helpers': fileURLToPath(new URL('src/helpers/index.ts', import.meta.url)), - magicast: fileURLToPath(new URL('src/index.ts', import.meta.url)), + recast: fileURLToPath(new URL('vendor/recast/main.ts', import.meta.url)), + 'ast-types': fileURLToPath(new URL('vendor/ast-types/src/main.ts', import.meta.url)), + ...(process.env.TEST_BUILD === 'true' + ? {} + : { + 'magicast/helpers': fileURLToPath(new URL('src/helpers/index.ts', import.meta.url)), + magicast: fileURLToPath(new URL('src/index.ts', import.meta.url)), + } + ) + } + }, + test: { + name: (process.env.TEST_BUILD === 'true' ? 'build' : 'src'), + coverage: { + include: [ + "src/**/*.ts", + ] } } })