diff --git a/.changeset/chatty-garlics-call.md b/.changeset/chatty-garlics-call.md new file mode 100644 index 0000000..4b1c4ac --- /dev/null +++ b/.changeset/chatty-garlics-call.md @@ -0,0 +1,5 @@ +--- +'tsconfck': patch +--- + +fix(parseNative): return empty result for not found to align with parse diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 0000000..a2b82b9 --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@1.5.0/schema.json", + "changelog": ["@svitejs/changesets-changelog-github-compact", { "repo": "dominikg/tsconfck" }], + "commit": false, + "linked": [], + "access": "public", + "baseBranch": "main", + "bumpVersionsWithWorkspaceProtocolOnly": true +} diff --git a/.changeset/fair-ads-kick.md b/.changeset/fair-ads-kick.md new file mode 100644 index 0000000..c068914 --- /dev/null +++ b/.changeset/fair-ads-kick.md @@ -0,0 +1,5 @@ +--- +'tsconfck': patch +--- + +fix(errors): cache errors instead of evicting cache value on error diff --git a/.changeset/five-geckos-wonder.md b/.changeset/five-geckos-wonder.md new file mode 100644 index 0000000..55e334a --- /dev/null +++ b/.changeset/five-geckos-wonder.md @@ -0,0 +1,5 @@ +--- +'tsconfck': patch +--- + +fix(types): use [] for optional parameter jsdoc to ensure dts-buddy emits them as optional diff --git a/.changeset/fresh-lions-cough.md b/.changeset/fresh-lions-cough.md new file mode 100644 index 0000000..473e6b2 --- /dev/null +++ b/.changeset/fresh-lions-cough.md @@ -0,0 +1,5 @@ +--- +'tsconfck': major +--- + +breaking: include js extensions with allowJs: true diff --git a/.changeset/gold-singers-cheer.md b/.changeset/gold-singers-cheer.md new file mode 100644 index 0000000..a220136 --- /dev/null +++ b/.changeset/gold-singers-cheer.md @@ -0,0 +1,5 @@ +--- +'tsconfck': major +--- + +breaking(exports): remove package.json export diff --git a/.changeset/good-taxis-teach.md b/.changeset/good-taxis-teach.md new file mode 100644 index 0000000..9210f3b --- /dev/null +++ b/.changeset/good-taxis-teach.md @@ -0,0 +1,5 @@ +--- +'tsconfck': minor +--- + +feat(exports): export unbundled esm js diff --git a/.changeset/lazy-geckos-hide.md b/.changeset/lazy-geckos-hide.md new file mode 100644 index 0000000..97e6b23 --- /dev/null +++ b/.changeset/lazy-geckos-hide.md @@ -0,0 +1,5 @@ +--- +'tsconfck': minor +--- + +feat(exports): export types as module declaration, including a .d.ts.map diff --git a/.changeset/mighty-dogs-argue.md b/.changeset/mighty-dogs-argue.md new file mode 100644 index 0000000..831cc75 --- /dev/null +++ b/.changeset/mighty-dogs-argue.md @@ -0,0 +1,5 @@ +--- +'tsconfck': minor +--- + +perf(find): switch to fs.stat callback for async and increase cache usage diff --git a/.changeset/olive-readers-cover.md b/.changeset/olive-readers-cover.md new file mode 100644 index 0000000..2fbfbed --- /dev/null +++ b/.changeset/olive-readers-cover.md @@ -0,0 +1,5 @@ +--- +'tsconfck': major +--- + +breaking(parse): resolve with empty result for missing tsconfig file, remove option resolveWithEmptyIfConfigNotFound diff --git a/.changeset/perfect-dryers-smile.md b/.changeset/perfect-dryers-smile.md new file mode 100644 index 0000000..b99e08b --- /dev/null +++ b/.changeset/perfect-dryers-smile.md @@ -0,0 +1,5 @@ +--- +'tsconfck': major +--- + +breaking(find): rename option tsConfigPaths to tsconfigPaths to ensure consistent use of tsconfig spelling diff --git a/.changeset/pink-points-hide.md b/.changeset/pink-points-hide.md new file mode 100644 index 0000000..91e2af3 --- /dev/null +++ b/.changeset/pink-points-hide.md @@ -0,0 +1,5 @@ +--- +'tsconfck': patch +--- + +fix(types): use import condition for types to avoid masquerading as cjs diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 0000000..888d3bc --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,32 @@ +{ + "mode": "pre", + "tag": "next", + "initialVersions": { + "tsconfck": "3.0.0-next.0" + }, + "changesets": [ + "chatty-garlics-call", + "fair-ads-kick", + "five-geckos-wonder", + "fresh-lions-cough", + "gold-singers-cheer", + "good-taxis-teach", + "lazy-geckos-hide", + "mighty-dogs-argue", + "olive-readers-cover", + "perfect-dryers-smile", + "pink-points-hide", + "shaggy-cows-look", + "shy-lamps-sleep", + "six-pillows-return", + "sour-gorillas-smash", + "sweet-onions-carry", + "tall-chicken-chew", + "tasty-icons-prove", + "tricky-frogs-pull", + "tricky-trees-tell", + "twelve-rings-bow", + "wise-hairs-clean", + "witty-dolls-relax" + ] +} diff --git a/.changeset/shaggy-cows-look.md b/.changeset/shaggy-cows-look.md new file mode 100644 index 0000000..92fca01 --- /dev/null +++ b/.changeset/shaggy-cows-look.md @@ -0,0 +1,5 @@ +--- +'tsconfck': minor +--- + +feat: add configName option to support jsconfig.json diff --git a/.changeset/shy-lamps-sleep.md b/.changeset/shy-lamps-sleep.md new file mode 100644 index 0000000..cfd0936 --- /dev/null +++ b/.changeset/shy-lamps-sleep.md @@ -0,0 +1,5 @@ +--- +'tsconfck': major +--- + +breaking(errors): throw ENOENT from parse if input .json filename does not exist. throw custom error if exists but is no file diff --git a/.changeset/six-pillows-return.md b/.changeset/six-pillows-return.md new file mode 100644 index 0000000..b4c348a --- /dev/null +++ b/.changeset/six-pillows-return.md @@ -0,0 +1,5 @@ +--- +'tsconfck': minor +--- + +feat(findNative): add find options (cache, root) diff --git a/.changeset/sour-gorillas-smash.md b/.changeset/sour-gorillas-smash.md new file mode 100644 index 0000000..300efca --- /dev/null +++ b/.changeset/sour-gorillas-smash.md @@ -0,0 +1,5 @@ +--- +'tsconfck': major +--- + +breaking(types): remove Awaitable type and add result type generic to cache diff --git a/.changeset/sweet-onions-carry.md b/.changeset/sweet-onions-carry.md new file mode 100644 index 0000000..210df55 --- /dev/null +++ b/.changeset/sweet-onions-carry.md @@ -0,0 +1,5 @@ +--- +'tsconfck': major +--- + +breaking(node): minimum supported node version is node18 diff --git a/.changeset/tall-chicken-chew.md b/.changeset/tall-chicken-chew.md new file mode 100644 index 0000000..506f0ea --- /dev/null +++ b/.changeset/tall-chicken-chew.md @@ -0,0 +1,5 @@ +--- +'tsconfck': major +--- + +breaking: enable caching paths for multiple configNames in one TSConfckCache, changed cache.getTSConfigPath(dir) to cache.getConfigPath(dir,configName) diff --git a/.changeset/tasty-icons-prove.md b/.changeset/tasty-icons-prove.md new file mode 100644 index 0000000..cf8c080 --- /dev/null +++ b/.changeset/tasty-icons-prove.md @@ -0,0 +1,5 @@ +--- +'tsconfck': major +--- + +breaking(peerDependencies): minimum supported typescript version for parseNative and findNative is 5.0 diff --git a/.changeset/tricky-frogs-pull.md b/.changeset/tricky-frogs-pull.md new file mode 100644 index 0000000..0e55388 --- /dev/null +++ b/.changeset/tricky-frogs-pull.md @@ -0,0 +1,5 @@ +--- +'tsconfck': major +--- + +breaking(exports): remove cjs export diff --git a/.changeset/tricky-trees-tell.md b/.changeset/tricky-trees-tell.md new file mode 100644 index 0000000..3ccb8b7 --- /dev/null +++ b/.changeset/tricky-trees-tell.md @@ -0,0 +1,5 @@ +--- +'tsconfck': major +--- + +breaking(find): ignore tsconfig files inside node_modules diff --git a/.changeset/twelve-rings-bow.md b/.changeset/twelve-rings-bow.md new file mode 100644 index 0000000..c015b27 --- /dev/null +++ b/.changeset/twelve-rings-bow.md @@ -0,0 +1,5 @@ +--- +'tsconfck': major +--- + +breaking(cache): remove tsconfigPaths option from find, add cache option that lazily caches found tsconfig paths. diff --git a/.changeset/wise-hairs-clean.md b/.changeset/wise-hairs-clean.md new file mode 100644 index 0000000..5076fcb --- /dev/null +++ b/.changeset/wise-hairs-clean.md @@ -0,0 +1,5 @@ +--- +'tsconfck': patch +--- + +fix(find): only call then on promise in cache" diff --git a/.changeset/witty-dolls-relax.md b/.changeset/witty-dolls-relax.md new file mode 100644 index 0000000..9f54e5f --- /dev/null +++ b/.changeset/witty-dolls-relax.md @@ -0,0 +1,5 @@ +--- +'tsconfck': major +--- + +breaking(find): replace scanNodeModules with ignoreNodeModules diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..d63aec1 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,52 @@ +{ + "ignorePatterns": [ + "**/tests/fixtures/parse/invalid/**/*", + "**/tests/fixtures/find-all/recursive-symlink/**/*", + "**/tests/snapshots/**/*.js" + ], + "root": true, + "extends": ["eslint:recommended", "plugin:n/recommended", "prettier"], + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parserOptions": { + "ecmaVersion": 2022 + }, + "plugins": ["n", "markdown"], + "rules": { + "no-debugger": ["error"] + }, + "overrides": [ + { + "files": ["**/*.md"], + "processor": "markdown/markdown", + "rules": { + "no-undef": "off", + "no-unused-vars": "off", + "no-console": "off", + "padded-blocks": "off", + "n/no-missing-import": "off", + "n/no-extraneous-require": "off", + "import/no-unresolved": "off" + } + }, + { + "files": ["**/*.md/*.**"], + "rules": { + "no-undef": "off", + "no-unused-vars": "off", + "no-console": "off", + "padded-blocks": "off", + "n/no-missing-import": "off", + "import/no-unresolved": "off" + } + }, + { + "files": ["**/tests/fixtures/**/*"], + "rules": { + "no-unused-vars": "off" + } + } + ] +} diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 4a05013..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,63 +0,0 @@ -module.exports = { - ignorePatterns: ['tests/fixtures/find-all/recursive-symlink/**/*'], - root: true, - extends: [ - 'eslint:recommended', - 'plugin:node/recommended', - 'plugin:@typescript-eslint/eslint-recommended', - 'prettier' - ], - globals: { - Atomics: 'readonly', - SharedArrayBuffer: 'readonly' - }, - plugins: ['@typescript-eslint', 'markdown'], - parser: '@typescript-eslint/parser', - parserOptions: { - sourceType: 'module', - ecmaVersion: 2020 - }, - rules: { - 'no-debugger': ['error'], - 'node/no-missing-import': 'off', // doesn't work with typescript's "import from 'src/foo.js'" for src/foo.ts - 'node/no-extraneous-import': ['error'], - 'node/no-deprecated-api': ['warn'], - 'node/no-unpublished-import': 'off', - 'node/no-unsupported-features/es-syntax': 'off' - }, - overrides: [ - { - files: ['**/*.md'], - processor: 'markdown/markdown', - rules: { - 'no-undef': 'off', - 'no-unused-vars': 'off', - 'no-console': 'off', - 'padded-blocks': 'off', - 'node/no-missing-import': 'off', - 'node/no-extraneous-require': 'off', - 'import/no-unresolved': 'off', - 'node/no-missing-require': 'off' - } - }, - { - files: ['**/*.md/*.**'], - rules: { - 'no-undef': 'off', - 'no-unused-vars': 'off', - 'no-console': 'off', - 'padded-blocks': 'off', - 'node/no-missing-import': 'off', - 'node/no-extraneous-require': 'off', - 'import/no-unresolved': 'off', - 'node/no-missing-require': 'off' - } - }, - { - files: ['tests/fixtures/**/*'], - rules: { - 'no-unused-vars': 'off' - } - } - ] -}; diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 09037b5..53614b2 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -1,16 +1,16 @@ { - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["config:base","group:allNonMajor",":semanticCommits"], - "schedule": ["before 5am on the 3rd day of the month"], - "labels": ["dependencies"], - "rangeStrategy": "bump", - "packageRules": [ + $schema: 'https://docs.renovatebot.com/renovate-schema.json', + extends: ['config:base', 'group:allNonMajor', ':semanticCommits'], + schedule: ['before 5am on the 3rd day of the month'], + labels: ['dependencies'], + rangeStrategy: 'bump', + packageRules: [ { - "matchDepTypes": ["peerDependencies","engines"], - "enabled": false + matchDepTypes: ['peerDependencies', 'engines'], + enabled: false } ], - "ignoreDeps": [ + ignoreDeps: [ // add deps that need manual attention here ] } diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ba1e037 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,68 @@ +name: Release + +on: + push: + branches: + - main + +permissions: {} + +jobs: + release: + permissions: + contents: write # to create release (changesets/action) + pull-requests: write # to create pull request (changesets/action) + # prevents this action from running on forks + if: github.repository == 'dominikg/tsconfck' + name: Release + runs-on: ${{ matrix.os }} + strategy: + matrix: + # pseudo-matrix for convenience, NEVER use more than a single combination + node: [18] + os: [ubuntu-latest] + steps: + - name: checkout + uses: actions/checkout@v4 + with: + # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits + fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + - name: install pnpm + shell: bash + run: | + PNPM_VER=$(jq -r '.packageManager | if .[0:5] == "pnpm@" then .[5:] else "packageManager in package.json does not start with pnpm@\n" | halt_error(1) end' package.json) + echo installing pnpm version $PNPM_VER + npm i -g pnpm@$PNPM_VER + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + cache: 'pnpm' + cache-dependency-path: '**/pnpm-lock.yaml' + - name: install + run: pnpm install --frozen-lockfile --prefer-offline --ignore-scripts + - name: publint + run: pnpm check:publint + - name: generated files are up to date + run: pnpm generate && [ "`git status --porcelain=v1`" == "" ] + - name: Creating .npmrc + run: | + cat << EOF > "$HOME/.npmrc" + //registry.npmjs.org/:_authToken=$NPM_TOKEN + EOF + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Create Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@v1 + with: + # This expects you to have a script called release which does a build for your packages and calls changeset publish + publish: pnpm release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: remove generated .npmrc + if: ${{ always() }} + run: rm -f "$HOME/.npmrc" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1607e1e..f6bff66 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,3 @@ -# build and test on linux, windows, mac with node 14, 16, 18 name: CI on: @@ -8,22 +7,17 @@ on: pull_request: branches: - main - jobs: - # "checks" job runs on linux + node16 only and checks that install, build, lint, format work - # it also primes the pnpm store cache for linux, important for downstream tests checks: timeout-minutes: 5 runs-on: ${{ matrix.os }} strategy: matrix: # pseudo-matrix for convenience, NEVER use more than a single combination - node: [16] + node: [18] os: [ubuntu-latest] - outputs: - build_successful: ${{ steps.build.outcome == 'success' }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} @@ -41,56 +35,44 @@ jobs: - name: install run: | pnpm install --frozen-lockfile --prefer-offline --ignore-scripts - node node_modules/esbuild/install.js - - name: build - id: build - run: pnpm build - - name: lint - if: (${{ success() }} || ${{ failure() }}) - run: pnpm lint - name: format - if: (${{ success() }} || ${{ failure() }}) - run: pnpm format - + run: pnpm check:format + - name: lint + if: ${{ !cancelled() }} + run: pnpm check:lint + - name: types + if: ${{ !cancelled() }} + run: pnpm check:types + - name: publint + if: ${{ !cancelled() }} + run: pnpm check:publint + - name: generated files are up to date + if: ${{ !cancelled() }} + run: pnpm generate && [ "`git status --porcelain=v1`" == "" ] - # this is the test matrix, it runs with node16 on linux,windows,macos + node14,18 on linux - # it is skipped if the build step of the checks job wasn't successful (still runs if lint or audit fail) + # this is the test matrix, it runs with node18 and 20 test: - needs: checks - if: (${{ success() }} || ${{ failure() }}) && (${{ needs.checks.output.build_successful }}) timeout-minutes: 10 runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - node: [16] + node: [18] os: [ubuntu-latest, macos-latest, windows-latest] include: - - node: 14 - os: ubuntu-latest - - node: 18 - os: ubuntu-latest - node: 20 os: ubuntu-latest steps: - - run: git config --global core.autocrlf false # prevent crlf on windows - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - name: install pnpm - if: matrix.node != 14 shell: bash run: | PNPM_VER=$(jq -r '.packageManager | if .[0:5] == "pnpm@" then .[5:] else "packageManager in package.json does not start with pnpm@\n" | halt_error(1) end' package.json) echo installing pnpm version $PNPM_VER npm i -g pnpm@$PNPM_VER - - name: install legacy pnpm for node14 - if: matrix.node == 14 - run: | - npm i -g pnpm@^7.32.0 - tmppkg="$(jq '.engines.pnpm = "^7.32.0"' package.json)" && echo -E "${tmppkg}" > package.json && tmppkg="" - sed -i 's/engine-strict=true/engine-strict=false/' .npmrc - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} @@ -99,10 +81,5 @@ jobs: - name: install run: | pnpm install --frozen-lockfile --prefer-offline --ignore-scripts - node node_modules/esbuild/install.js - - name: build - run: pnpm build:ci - name: run tests run: pnpm test - - diff --git a/.gitignore b/.gitignore index d4add4a..79bf794 100644 --- a/.gitignore +++ b/.gitignore @@ -3,13 +3,10 @@ *.cpuprofile temp *.tmp - -# build and dist -build -dist +.eslintcache # test coverage -/coverage +coverage *.lcov # env and local @@ -30,3 +27,6 @@ node_modules # macos .DS_Store ._.DS_Store + +# benchmark +.bench diff --git a/.husky/commit-msg b/.husky/commit-msg deleted file mode 100755 index 782e1ce..0000000 --- a/.husky/commit-msg +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -pnpm exec commitlint -g commitlint.config.cjs --edit $1 diff --git a/.npmrc b/.npmrc index 036bd2f..16720db 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,2 @@ -engine-strict=false +engine-strict=true auto-install-peers=false diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs deleted file mode 100644 index 790de1a..0000000 --- a/.pnpmfile.cjs +++ /dev/null @@ -1,23 +0,0 @@ -const { esbuild } = require('./package.json').devDependencies; - -function readPackage(pkg) { - for (const section of [ - 'dependencies', - 'devDependencies', - 'peerDependencies', - 'optionalDependencies' - ]) { - // enforce use of workspace esbuild - // to ensure a single version is used - if (pkg[section]['esbuild']) { - pkg[section]['esbuild'] = esbuild; - } - } - return pkg; -} - -module.exports = { - hooks: { - readPackage - } -}; diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..9649f99 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,7 @@ +fixtures +snapshots +pnpm-lock.yaml +CHANGELOG.md +**/docs/api.md +packages/tsconfck/types/index.d.* +.changeset/pre.json diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..8ba4ff1 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "$schema": "http://json.schemastore.org/prettierrc", + "useTabs": true, + "singleQuote": true, + "trailingComma": "none", + "printWidth": 100 +} diff --git a/.prettierrc.cjs b/.prettierrc.cjs deleted file mode 100644 index 6db055c..0000000 --- a/.prettierrc.cjs +++ /dev/null @@ -1,31 +0,0 @@ -module.exports = { - useTabs: true, - singleQuote: true, - trailingComma: 'none', - printWidth: 100, - overrides: [ - { - files: '**/*.ts', - options: { parser: 'typescript' } - }, - { - files: ['**/CHANGELOG.md', '**/docs/api.md'], - options: { - requirePragma: true - } - }, - { - files: '**/package.json', - options: { - useTabs: false, - tabWidth: 2 - } - }, - { - files: '**/fixtures/**/*.json', - options: { - requirePragma: true - } - } - ] -}; diff --git a/README.md b/README.md index 8416200..35e780c 100644 --- a/README.md +++ b/README.md @@ -7,17 +7,28 @@ A utility to find and parse tsconfig files without depending on typescript # Why -Because no simple official api exists and tsconfig.json isn't actual json. +Because no simple official api exists and tsconfig isn't actual json. # Features -- [x] find closest tsconfig.json -- [x] convert tsconfig.json to actual json and parse it +- [x] find closest tsconfig (tsconfig.json or jsconfig.json) +- [x] convert tsconfig to actual json and parse it - [x] resolve "extends" - [x] resolve "references" of solution-style tsconfig +- [x] optional caching for improved performance - [x] optional findNative and parseNative to use official typescript api - [x] zero dependencies (typescript optional) - [x] extensive testsuite +- [x] completely async and optimized (it's [fast](https://github.com/dominikg/tsconfck/blob/main/docs/benchmark.md)) +- [x] tiny [4.7KB gzip](https://pkg-size.dev/tsconfck@%5E3.0.0-next.0) +- [x] unbundled esm js, no sourcemaps needed +- [x] [types](./packages/tsconfck/types/index.d.ts) generated with [dts-buddy](https://github.com/Rich-Harris/dts-buddy) + +# Users + +Used by [vite](https://github.com/vitejs/vite)\*, [vite-tsconfig-paths](https://github.com/aleclarson/vite-tsconfig-paths), [astro](https://github.com/withastro/astro) and [many more](https://github.com/dominikg/tsconfck/network/dependents) + +> (\*) vite bundles tsconfck so it is listed as a devDependency # Install @@ -27,8 +38,6 @@ npm install --save-dev tsconfck # or pnpm, yarn # Usage -## without typescript installed - ```js import { parse } from 'tsconfck'; const { @@ -40,147 +49,21 @@ const { } = await parse('foo/bar.ts'); ``` -## with typescript - -```js -import { parseNative } from 'tsconfck'; -const { - tsconfigFile, // full path to found tsconfig - tsconfig, // tsconfig object including merged values from extended configs, normalized - result, // output of ts.parseJsonConfigFileContent - solution, // solution result if tsconfig is part of a solution - referenced // referenced tsconfig results if tsconfig is a solution -} = await parseNative('foo/bar.ts'); -``` - -## API - -see [API-DOCS](docs/api.md) - -## Advanced - -### caching - -You can use a map to cache results and avoid reparsing if you process multiple ts files that share few tsconfig files - -```js -import { parse } from 'tsconfck'; -// 1. create cache instance -const cache = new Map(); -// 2. pass cache instance in options -const fooResult = await parse('src/foo.ts', { cache }); -// 3. profit (if they share the same tsconfig.json, it is not parsed again) -const barResult = await parse('src/bar.ts', { cache }); -``` - -> You are responsible for clearing the cache if tsconfig files change on disk during its lifetime. -> -> Always clear the whole cache if anything changes as objects in the cache can ref each other - -> Returned results are direct cache objects. -> -> If you want to modify them, deep-clone first. - -### reduce fs.stat overhead - -You can specify a root directory and provide a set of known tsconfig locations to improve performance in large projects - -```js -import { parse, findAll } from 'tsconfck'; -const root = '.'; -const tsConfigPaths = new Set([ - ...(await findAll(root, { skip: (dir) => dir === 'node_modules' || dir === '.git' })) -]); -const cache = new Map(); -const parseOptions = { cache, root, tsConfigPaths }; -// these calls use minimal fs -const fooResult = await parse('src/foo.ts', parseOptions); -const barResult = await parse('src/bar.ts', parseOptions); -``` - -> Using the root option can lead to errors if there is no tsconfig inside root. - -> You are responsible for updating tsConfigPaths if tsconfig files are added/removed on disk during its lifetime. - -### error handling - -find and parse reject for all errors they encounter. - -For parse, you can choose to resolve with an empty result instead if no tsconfig file was found - -```js -import { parse } from 'tsconfck'; -const result = await parse('some/path/without/tsconfig/foo.ts', { - resolveWithEmptyIfConfigNotFound: true -}); -// result = { tsconfigFile: 'no_tsconfig_file_found',tsconfig: {} } -``` - -### TSConfig type (optional, requires typescript as devDependency) - -```ts -import type { TSConfig } from 'pkg-types'; -``` - -Check out https://github.com/unjs/pkg-types - -### cli - -A simple cli wrapper is included, you can use it like this - -#### find - -```shell -# prints /path/to/tsconfig.json on stdout -tsconfck find src/index.ts -``` - -#### find-all - -```shell -# prints all tsconfig.json in dir on stdout -tsconfck find-all src/ -``` - -#### parse - -```shell -# print content of ParseResult.tsconfig on stdout -tsconfck parse src/index.ts - -# print to file -tsconfck parse src/index.ts > output.json -``` - -#### parse-result - -```shell -# print content of ParseResult on stdout -tsconfck parse-result src/index.ts - -# print to file -tsconfck parse-result src/index.ts > output.json -``` - -#### help - -```shell -# print usage -tsconfck -h # or --help, -?, help -``` - # Links -- [changelog](CHANGELOG.md) +[package readme](./packages/tsconfck/README.md) +[api](./docs/api.md) +[changelog](./packages/tsconfck/CHANGELOG.md) # Develop This repo uses - [pnpm](https://pnpm.io) -- [conventional-changelog/commitlint](https://github.com/conventional-changelog/commitlint#what-is-commitlint) +- [changesets](https://github.com/changesets/changesets) + +In every PR you have to add a changeset by running `pnpm changeset` and following the prompts -In addition to default commit-msg prefixes you can use 'wip: ' for commit messages in branches. PRs are going to be squash-merged ```shell @@ -188,10 +71,8 @@ PRs are going to be squash-merged pnpm install # run tests pnpm test -#run tests in watch mode (doesn't require dev in parallel) -pnpm test:watch ``` # License -[MIT](./LICENSE) +[MIT](./packages/tsconfck/LICENSE) diff --git a/bin/tsconfck.js b/bin/tsconfck.js deleted file mode 100755 index 23bbdfb..0000000 --- a/bin/tsconfck.js +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env node -import { parse, find, findAll } from '../dist/index.js'; -import * as process from 'process'; - -const HELP_TEXT = ` -Usage: tsconfck - -Commands: find, find-all, parse, parse-result - -Examples: -> tsconfck find src/index.ts -> /path/to/tsconfig.json - -> tsconfck find-all src/ -> /src/foo/tsconfig.json -> /src/bar/tsconfig.json -> /src/tsconfig.json - -> tsconfck parse src/index.ts ->{ -> ... tsconfig json ->} - -> tsconfck parse src/index.ts > parsed.tsconfig.json - -> tsconfck parse-result src/index.ts ->{ -> ... TSConfckParseResult json ->} -`; - -const HELP_ARGS = ['-h', '--help', '-?', 'help']; -const COMMANDS = ['find', 'find-all', 'parse', 'parse-result']; -function needsHelp(args) { - if (args.some((arg) => HELP_ARGS.includes(arg))) { - return HELP_TEXT; - } - if (args.length !== 2) { - return 'invalid number of arguments\n' + HELP_TEXT; - } else if (!COMMANDS.includes(args[0])) { - return 'invalid command ' + args[0] + '\n' + HELP_TEXT; - } -} -async function main() { - const args = process.argv.slice(2); - const help = needsHelp(args); - if (help) { - return help; - } - const command = args[0]; - const file = args[1]; - if (command === 'find') { - return find(file); - } else if (command === 'parse') { - return JSON.stringify((await parse(file)).tsconfig, null, 2); - } else if (command === 'parse-result') { - return JSON.stringify(await parse(file), null, 2); - } else if (command === 'find-all') { - return (await findAll(file || '.')).join('\n'); - } -} - -main().then( - (result) => { - process.stdout.write(result); - process.stdout.write('\n'); - }, - (err) => { - console.error(err.message, err); - // eslint-disable-next-line no-process-exit - process.exit(1); - } -); diff --git a/commitlint.config.cjs b/commitlint.config.cjs deleted file mode 100644 index 2e84622..0000000 --- a/commitlint.config.cjs +++ /dev/null @@ -1,3 +0,0 @@ -const configConventional = require('@commitlint/config-conventional'); -configConventional.rules['type-enum'][2].push('release', 'wip'); -module.exports = configConventional; diff --git a/docs/api.md b/docs/api.md index 659da1c..d348f64 100644 --- a/docs/api.md +++ b/docs/api.md @@ -7,125 +7,128 @@ /** * find the closest tsconfig.json file * - * @param {string} filename - path to file to find tsconfig for (absolute or relative to cwd) - * @param {TSConfckFindOptions} options - options - * @returns {Promise} absolute path to closest tsconfig.json + * @param filename - path to file to find tsconfig for (absolute or relative to cwd) + * @param options - options + * @returns absolute path to closest tsconfig.json or null if not found */ -declare function find(filename: string, options?: TSConfckFindOptions): Promise; -interface TSConfckFindOptions { - /** - * Set of known tsconfig file locations to use instead of scanning the file system - * - * This is better for performance in projects like vite where find is called frequently but tsconfig locations rarely change - * You can use `findAll` to build this - */ - tsConfigPaths?: Set; - /** - * project root dir, does not continue scanning outside of this directory. - * - * Improves performance but may lead to different results from native typescript when no tsconfig is found inside root - */ - root?: string; -} +export function find(filename: string, options?: TSConfckFindOptions | undefined): Promise; ``` -### findAll +#### TSConfckFindOptions ```ts -/** - * find all tsconfig.json files in dir - * - * @param {string} dir - path to dir (absolute or relative to cwd) - * @param {TSConfckFindAllOptions} options - options - * @returns {Promise} list of absolute paths to all found tsconfig.json files - */ -declare function findAll(dir: string, options?: TSConfckFindAllOptions): Promise; -interface TSConfckFindAllOptions { - /** - * helper to skip subdirectories when scanning for tsconfig.json - * - * eg ` dir => dir === 'node_modules' || dir === '.git'` - */ skip?: (dir: string) => boolean; +interface TSConfckFindOptions { + /** + * A cache to improve performance for multiple calls in the same project + * + * Warning: You must clear this cache in case tsconfig files are added/removed during it's lifetime + */ + cache?: TSConfckCache; + + /** + * project root dir, does not continue scanning outside of this directory. + * + * Improves performance but may lead to different results from native typescript when no tsconfig is found inside root + */ + root?: string; + + /** + * set to true if you don't want to find tsconfig for files inside node_modules + * + * This is useful if you want to use the output with esbuild.transform as esbuild itself also ignores node_modules + * + * @default false + */ + ignoreNodeModules?: boolean; + + /** + * Override the default name of the config file to find. + * + * Use `jsconfig.json` in projects that have typechecking for js files with jsconfig.json + * + * @default tsconfig.json + */ + configName?: string; } ``` -### toJson +### parse ```ts /** - * convert content of tsconfig.json to regular json + * parse the closest tsconfig.json file * - * @param {string} tsconfigJson - content of tsconfig.json - * @returns {string} content as regular json, comments and dangling commas have been replaced with whitespace - */ -declare function toJson(tsconfigJson: string): string; + * @param filename - path to a tsconfig .json or a source file or directory (absolute or relative to cwd) + * @param options - options + * */ +export function parse(filename: string, options?: TSConfckParseOptions | undefined): Promise; ``` -### parse +#### TSConfckParseOptions ```ts -/** - * parse the closest tsconfig.json file - * - * @param {string} filename - path to a tsconfig.json or a .ts source file (absolute or relative to cwd) - * @param {TSConfckParseOptions} options - options - * @returns {Promise} - * @throws {TSConfckParseError} - */ -declare function parse(filename: string, options?: TSConfckParseOptions): Promise; interface TSConfckParseOptions extends TSConfckFindOptions { - /** - * optional cache map to speed up repeated parsing with multiple files - * it is your own responsibility to clear the cache if tsconfig files change during its lifetime - * cache keys are input `filename` and absolute paths to tsconfig.json files - * - * You must not modify cached values. - */ - cache?: Map; - /** - * treat missing tsconfig as empty result instead of an error - * parse resolves with { filename: 'no_tsconfig_file_found',tsconfig:{}} instead of reject with error - */ - resolveWithEmptyIfConfigNotFound?: boolean; + // same as find options } +``` + +#### TSConfckParseResult + +```ts interface TSConfckParseResult { - /** - * absolute path to parsed tsconfig.json - */ - tsconfigFile: string; - /** - * parsed result, including merged values from extended - */ - tsconfig: any; - /** - * ParseResult for parent solution - */ - solution?: TSConfckParseResult; - /** - * ParseResults for all tsconfig files referenced in a solution - */ - referenced?: TSConfckParseResult[]; - /** - * ParseResult for all tsconfig files - * - * [a,b,c] where a extends b and b extends c - */ - extended?: TSConfckParseResult[]; + /** + * absolute path to parsed tsconfig.json + */ + tsconfigFile: string; + + /** + * parsed result, including merged values from extended + */ + tsconfig: any; + + /** + * ParseResult for parent solution + */ + solution?: TSConfckParseResult; + + /** + * ParseResults for all tsconfig files referenced in a solution + */ + referenced?: TSConfckParseResult[]; + + /** + * ParseResult for all tsconfig files + * + * [a,b,c] where a extends b and b extends c + */ + extended?: TSConfckParseResult[]; } -declare class TSConfckParseError extends Error { - constructor(message: string, code: string, tsconfigFile: string, cause?: Error); - /** - * error code - */ - code: string; - /** - * the cause of this error - */ - cause: Error | undefined; - /** - * absolute path of tsconfig file where the error happened - */ - tsconfigFile: string; +``` + +#### TSConfckParseError + +```ts +export class TSConfckParseError extends Error { + /** + * + * @param message - error message + * @param code - error code + * @param tsconfigFile - path to tsconfig file + * @param cause - cause of this error + */ + constructor(message: string, code: string, tsconfigFile: string, cause: Error | null); + /** + * error code + * */ + code: string; + /** + * error cause + * */ + cause: Error | undefined; + /** + * absolute path of tsconfig file where the error happened + * */ + tsconfigFile: string; } ``` @@ -137,10 +140,11 @@ declare class TSConfckParseError extends Error { * * You must have `typescript` installed to use this * - * @param {string} filename - path to file to find tsconfig for (absolute or relative to cwd) - * @returns {Promise} absolute path to closest tsconfig.json + * @param filename - path to file to find tsconfig for (absolute or relative to cwd) + * @param options - options + * @returns absolute path to closest tsconfig.json */ -declare function findNative(filename: string): Promise; +export function findNative(filename: string, options?: TSConfckFindOptions | undefined): Promise; ``` ### parseNative @@ -151,81 +155,158 @@ declare function findNative(filename: string): Promise; * * You need to have `typescript` installed to use this * - * @param {string} filename - path to a tsconfig.json or a .ts source file (absolute or relative to cwd) - * @param {TSConfckParseNativeOptions} options - options - * @returns {Promise} - * @throws {TSConfckParseNativeError} - */ -declare function parseNative(filename: string, options?: TSConfckParseNativeOptions): Promise; -interface TSConfckParseNativeOptions { - /** - * optional cache map to speed up repeated parsing with multiple files - * it is your own responsibility to clear the cache if tsconfig files change during its lifetime - * cache keys are input `filename` and absolute paths to tsconfig.json files - * - * You must not modify cached values. - */ - cache?: Map; - /** - * treat missing tsconfig as empty result instead of an error - * parseNative resolves with { filename: 'no_tsconfig_file_found',tsconfig:{}, result: null} instead of reject with error - */ - resolveWithEmptyIfConfigNotFound?: boolean; - /** - * Set this option to true to force typescript to ignore all source files. - * - * This is faster - especially for large projects - but comes with 2 caveats - * - * 1) output tsconfig always has `files: [],include: []` instead of any real values configured. - * 2) as a result of 1), it won't be able to resolve solution-style references and always return the closest tsconfig - */ - ignoreSourceFiles?: boolean; + * @param filename - path to a tsconfig .json or a source file (absolute or relative to cwd) + * @param options - options + * */ +export function parseNative(filename: string, options?: TSConfckParseNativeOptions | undefined): Promise; +``` + +#### TSConfckParseNativeOptions + +```ts +interface TSConfckParseNativeOptions extends TSConfckParseOptions { + /** + * Set this option to true to force typescript to ignore all source files. + * + * This is faster - especially for large projects - but comes with 2 caveats + * + * 1) output tsconfig always has `files: [],include: []` instead of any real values configured. + * 2) as a result of 1), it won't be able to resolve solution-style references and always return the closest tsconfig + */ + ignoreSourceFiles?: boolean; } +``` + +#### TSConfckParseNativeResult + +```ts interface TSConfckParseNativeResult { - /** - * absolute path to parsed tsconfig.json - */ - tsconfigFile: string; - /** - * parsed result, including merged values from extended and normalized - */ - tsconfig: any; - /** - * ParseResult for parent solution - */ - solution?: TSConfckParseNativeResult; - /** - * ParseNativeResults for all tsconfig files referenced in a solution - */ - referenced?: TSConfckParseNativeResult[]; - /** - * full output of ts.parseJsonConfigFileContent - */ - result: any; + /** + * absolute path to parsed tsconfig.json + */ + tsconfigFile: string; + + /** + * parsed result, including merged values from extended and normalized + */ + tsconfig: any; + + /** + * ParseResult for parent solution + */ + solution?: TSConfckParseNativeResult; + + /** + * ParseNativeResults for all tsconfig files referenced in a solution + */ + referenced?: TSConfckParseNativeResult[]; + + /** + * full output of ts.parseJsonConfigFileContent + */ + result: any; } -declare class TSConfckParseNativeError extends Error { - constructor(diagnostic: TSDiagnosticError, tsconfigFile: string, result?: any); - /** - * code of typescript diagnostic, prefixed with "TS " - */ - code: string; - /** - * full ts diagnostic that caused this error - */ - diagnostic: any; - /** - * absolute path of tsconfig file where the error happened - */ - tsconfigFile: string; - /** - * native result if present, contains all errors in result.errors - */ - result: any | undefined; +``` + +#### TSConfckParseNativeError + +```ts +export class TSConfckParseNativeError extends Error { + /** + * + * @param diagnostic - diagnostics of ts + * @param tsconfigFile - file that errored + * @param result - parsed result, if any + */ + constructor(diagnostic: any, tsconfigFile: string, result: any | null); + /** + * code of typescript diagnostic, prefixed with "TS " + * */ + code: string; + /** + * full ts diagnostic that caused this error + * */ + diagnostic: any; + /** + * native result if present, contains all errors in result.errors + * */ + result: any | undefined; + /** + * absolute path of tsconfig file where the error happened + * */ + tsconfigFile: string; } -interface TSDiagnosticError { - code: number; - category: number; - messageText: string; - start?: number; +``` + +### findAll + +```ts +/** + * find all tsconfig.json files in dir + * + * @param dir - path to dir (absolute or relative to cwd) + * @param options - options + * @returns list of absolute paths to all found tsconfig.json files + */ +export function findAll(dir: string, options?: TSConfckFindAllOptions | undefined): Promise; +``` + +#### TSConfckFindAllOptions + +```ts +interface TSConfckFindAllOptions { + /** + * helper to skip subdirectories when scanning for tsconfig.json + * + * eg ` dir => dir === 'node_modules' || dir === '.git'` + */ // eslint-disable-next-line no-unused-vars + skip?: (dir: string) => boolean; + /** + * list of config filenames to include, use ["tsconfig.json","jsconfig.json"] if you need both + * + * @default ["tsconfig.json"] + */ + configNames?: string[]; +} +``` + +### toJson + +```ts +/** + * convert content of tsconfig.json to regular json + * + * @param tsconfigJson - content of tsconfig.json + * @returns content as regular json, comments and dangling commas have been replaced with whitespace + */ +export function toJson(tsconfigJson: string): string; +``` + +### TSConfckCache + +```ts +export class TSConfckCache { + /** + * clear cache, use this if you have a long running process and tsconfig files have been added,changed or deleted + */ + clear(): void; + /** + * has cached closest config for files in dir + * */ + hasConfigPath(dir: string, configName?: string | undefined): boolean; + /** + * get cached closest tsconfig for files in dir + * @throws if cached value is an error + */ + getConfigPath(dir: string, configName?: string | undefined): Promise | string | null; + /** + * has parsed tsconfig for file + * */ + hasParseResult(file: string): boolean; + /** + * get parsed tsconfig for file + * @throws if cached value is an error + */ + getParseResult(file: string): Promise | T; } ``` diff --git a/docs/benchmark.md b/docs/benchmark.md new file mode 100644 index 0000000..c97c59d --- /dev/null +++ b/docs/benchmark.md @@ -0,0 +1,94 @@ +# benchmark + +## about + +tsconfck is fully async to ensure best performance in high pressure situations like vite dev-server startup where many files are read and cpu heavy work is going on in parallel. + +This [benchmark](../scripts/bench.js) transpiles [microsoft/TypeScript](https://github.com/microsoft/TypeScript) /src with [esbuild.transform](https://esbuild.github.io/api/#transform) after asyncrounusly reading the files and parsing the config in one huge Promise.all. +Each task is run in sequence (1 warmup 20 samples) followed by gc and a 5 second wait to ensure they don't interact with each others timings. + +Due to the highly async nature of the tasks, it is hard to measure the exact timings for config parsing alone. +To better approxmimate the impact, a baseline task is used that executes everything but parsing the config and the resulting time is substracted from the other tasks times. + +The `Relative` columns show how much time the task took relative to the fastest one. + +Note: get-tsconfig is included because it also has a cache but is synchronous. In a different benchmark setting with less pressure and more synchronous work, the results would likely look different. + +To run it yourself, clone this repo and run `pnpm i && pnpm bench`. Note you need `curl` and `tar` installed and it'll download a ~29MB tgz file on first run. + +## modes + +- `no load` runs only config parse +- `io load` runs config parse and file read (with fs.promises) +- `io and cpu load` runs config parse, file read and esbuild.transform + +## data + + + +### no load + +| Task Name | Margin | Avg(total) | Relative(total) | Avg(\*) | Relative(\*) | +| ----------------------------------- | -----: | ---------: | --------------: | -------: | -----------: | +| tsconfck@3.0.0-next.9 parse | ±0.55% | 4.48ms | 1.00 | 4.12ms | 1.00 | +| get-tsconfig@4.7.2 | ±1.04% | 28.78ms | 6.43 | 28.42ms | 6.90 | +| tsconfck@3.0.0-next.9 parseNative | ±8.63% | 136.17ms | 30.40 | 135.81ms | 32.98 | +| tsconfck@2.1.2 parse with findAll | ±2.84% | 415.02ms | 92.65 | 414.66ms | 100.70 | +| tsconfck@2.1.2 parse | ±2.61% | 432.65ms | 96.59 | 432.29ms | 104.98 | +| tsconfck@3.0.0-next.9 without cache | ±2.62% | 657.76ms | 146.84 | 657.40ms | 159.65 | + +| Task Name | Margin | Avg total | +| --------- | -----: | --------: | +| baseline | ±0.63% | 0.36ms | + +### io load + +| Task Name | Margin | Avg(total) | Relative(total) | Avg(\*) | Relative(\*) | +| ----------------------------------- | -----: | ---------: | --------------: | -------: | -----------: | +| tsconfck@3.0.0-next.9 parse | ±2.91% | 36.83ms | 1.00 | 6.83ms | 1.00 | +| get-tsconfig@4.7.2 | ±2.96% | 66.57ms | 1.81 | 36.57ms | 5.35 | +| tsconfck@3.0.0-next.9 parseNative | ±2.50% | 166.67ms | 4.52 | 136.67ms | 20.00 | +| tsconfck@2.1.2 parse with findAll | ±2.67% | 454.37ms | 12.34 | 424.37ms | 62.11 | +| tsconfck@2.1.2 parse | ±3.32% | 466.26ms | 12.66 | 436.26ms | 63.85 | +| tsconfck@3.0.0-next.9 without cache | ±2.51% | 699.39ms | 18.99 | 669.39ms | 97.97 | + +| Task Name | Margin | Avg total | +| --------- | -----: | --------: | +| baseline | ±2.75% | 30.00ms | + +### io and cpu load + +| Task Name | Margin | Avg(total) | Relative(total) | Avg(\*) | Relative(\*) | +| ----------------------------------- | -----: | ---------: | --------------: | -------: | -----------: | +| tsconfck@3.0.0-next.9 parse | ±1.36% | 273.98ms | 1.00 | 4.60ms | 1.00 | +| get-tsconfig@4.7.2 | ±0.98% | 302.51ms | 1.10 | 33.13ms | 7.21 | +| tsconfck@3.0.0-next.9 parseNative | ±1.65% | 408.75ms | 1.49 | 139.37ms | 30.32 | +| tsconfck@2.1.2 parse with findAll | ±1.69% | 705.30ms | 2.57 | 435.91ms | 94.85 | +| tsconfck@2.1.2 parse | ±1.80% | 714.11ms | 2.61 | 444.72ms | 96.76 | +| tsconfck@3.0.0-next.9 without cache | ±1.50% | 922.85ms | 3.37 | 653.46ms | 142.18 | + +| Task Name | Margin | Avg total | +| --------- | -----: | --------: | +| baseline | ±2.53% | 269.39ms | + +> (\*) total values include time spent reading and transforming files. For a more realistic comparison of these config parse performance, these values have been calculated by subtracting the average duration of the baseline run that does not parse config files. + + + +> This data has been recorded on Linux 6.1, node20, 8c/16t ryzen cpu, pcie-3 nvme SSD. (duration ~4.5 min) + +## Observations + +### tsconfck@3 is a lot faster than tsconfck@2 + +This is great news and most likely attributed to the rework of the cache and using callbacks instead of adding more promises to the mix. +The impact on vite however remains to be seen as it isn't clear if it had much of a negative influence before + +### tsconfck@3 is within margin of baseline under load + +One could say it's background noise. Not completely true but for sure it doesn't get in the way. + +### parseNative with caching is surprisingly competitive + +TypeScripts own parse does a lot extra work with all files matched by the configs and it is synchronous too. +But with caching ensuring work is only ever done once, it's almost ok. diff --git a/package.json b/package.json index fb0f946..1387ef6 100644 --- a/package.json +++ b/package.json @@ -1,110 +1,52 @@ { - "name": "tsconfck", - "version": "2.1.2", - "description": "A utility to work with tsconfig.json without typescript", - "license": "MIT", - "author": "dominikg", - "files": [ - "dist", - "bin", - "src", - "README.md", - "LICENSE", - "package.json" - ], - "type": "module", - "main": "dist/index.cjs", - "module": "dist/index.js", - "bin": "bin/tsconfck.js", - "types": "dist/index.d.ts", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.js", - "require": "./dist/index.cjs" - }, - "./package.json": "./package.json" - }, - "scripts": { - "dev": "pnpm build:ci --watch src", - "build:ci": "rimraf dist && tsup-node src/index.ts --format esm,cjs --no-splitting --target node14.13.1", - "build": "pnpm build:ci --dts --sourcemap && node scripts/generate-api-docs.js", - "test": "node --experimental-loader tsm node_modules/uvu/bin.js tests -i fixtures -i temp -i util/", - "test:watch": "pnpm test; watchlist tests src -- pnpm test", - "test:coverage": "c8 --include=src --clean pnpm test", - "test:report": "c8 report --reporter=text-lcov > coverage/coverage.lcov", - "lint": "eslint --ignore-path .gitignore '**/*.{cjs,js,ts,md}'", - "lint:fix": "pnpm lint --fix", - "format": "prettier --ignore-path .gitignore '**/*.{cjs,js,ts,md}' --check", - "format:fix": "pnpm format --write", - "fixup": "run-s lint:fix format:fix", - "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -l tsconfck", - "release": "node scripts/release.js", - "release:dry": "pnpm release --dry", - "release:next": "pnpm release --next", - "prepare": "husky install" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/dominikg/tsconfck.git" - }, - "keywords": [ - "typescript", - "tsconfig", - "tsconfig.json" - ], - "bugs": { - "url": "https://github.com/dominikg/tsconfck/issues" - }, - "homepage": "https://github.com/dominikg/tsconfck/tree/main/#readme", - "peerDependencies": { - "typescript": "^4.3.5 || ^5.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - }, - "devDependencies": { - "@commitlint/cli": "^17.6.7", - "@commitlint/config-conventional": "^17.6.7", - "@tsconfig/node14": "^14.1.0", - "@types/node": "^20.4.8", - "@typescript-eslint/eslint-plugin": "^6.2.1", - "@typescript-eslint/parser": "^6.2.1", - "c8": "^8.0.1", - "chalk": "^5.3.0", - "conventional-changelog-cli": "^3.0.0", - "enquirer": "^2.4.1", - "esbuild": "^0.18.18", - "eslint": "^8.46.0", - "eslint-config-prettier": "^9.0.0", - "eslint-plugin-markdown": "^3.0.1", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-prettier": "^5.0.0", - "execa": "^7.2.0", - "husky": "^8.0.3", - "lint-staged": "^13.2.3", - "minimist": "^1.2.8", - "npm-run-all": "^4.1.5", - "prettier": "^3.0.1", - "rimraf": "^5.0.1", - "semver": "^7.5.4", - "tiny-glob": "^0.2.9", - "tsm": "^2.3.0", - "tsup": "^7.2.0", - "typescript": "^5.1.6", - "uvu": "^0.5.6", - "watchlist": "^0.3.1" - }, - "lint-staged": { - "*.{cjs,js,ts,md}": [ - "eslint --fix", - "prettier --write" - ] - }, - "packageManager": "pnpm@8.6.12", - "engines": { - "node": "^14.13.1 || ^16 || >=18" - } + "name": "tsconfck-monorepo", + "private": true, + "type": "module", + "scripts": { + "test": "pnpm -r test", + "check": "run-p -c check:*", + "check:publint": "pnpm --filter \"./packages/*\" --parallel check:publint", + "check:types": "pnpm --filter \"./packages/*\" --parallel check:types", + "check:lint": "eslint --cache --ignore-path .gitignore '**/*.{js,md}'", + "check:format": "prettier --cache --ignore-path .gitignore --ignore-path .prettierignore --ignore-unknown --check .", + "lint": "pnpm check:lint --fix", + "format": "pnpm check:format --write", + "fixup": "run-s generate lint format", + "generate": "run-s generate:types generate:docs", + "generate:types": "pnpm --dir packages/tsconfck run dts-buddy", + "generate:docs": "node scripts/generate-api-docs.js", + "release": "pnpm changeset publish", + "prepare": "husky install", + "bench": "node --expose-gc -max-old-space-size=4096 scripts/bench.js" + }, + "devDependencies": { + "@changesets/cli": "^2.26.2", + "@svitejs/changesets-changelog-github-compact": "^1.1.0", + "dts-buddy": "^0.2.5", + "esbuild": "^0.19.4", + "eslint": "^8.51.0", + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-markdown": "^3.0.1", + "eslint-plugin-n": "^16.1.0", + "eslint-plugin-prettier": "^5.0.0", + "get-tsconfig": "^4.7.2", + "husky": "^8.0.3", + "lint-staged": "^14.0.1", + "npm-run-all": "^4.1.5", + "prettier": "^3.0.3", + "publint": "^0.2.3", + "tiny-glob": "^0.2.9", + "tinybench": "^2.5.1", + "tsconfck-2": "npm:tsconfck@^2.0.0", + "tsconfck-3": "npm:tsconfck@^3.0.0-next.9", + "vitest": "^0.34.6" + }, + "lint-staged": { + "*.{js,md}": "eslint --cache --fix", + "*": "prettier --cache --ignore-path .prettierignore --ignore-unknown --write" + }, + "packageManager": "pnpm@8.9.0", + "engines": { + "node": "^18 || >=20" + } } diff --git a/packages/tsconfck/CHANGELOG.md b/packages/tsconfck/CHANGELOG.md new file mode 100644 index 0000000..caf4b1d --- /dev/null +++ b/packages/tsconfck/CHANGELOG.md @@ -0,0 +1,107 @@ +# tsconfck + +## 3.0.0-next.9 + +### Major Changes + +- breaking: include js extensions with allowJs: true ([#132](https://github.com/dominikg/tsconfck/pull/132)) + +- breaking: enable caching paths for multiple configNames in one TSConfckCache, changed cache.getTSConfigPath(dir) to cache.getConfigPath(dir,configName) ([#132](https://github.com/dominikg/tsconfck/pull/132)) + +### Minor Changes + +- feat: add configName option to support jsconfig.json ([#132](https://github.com/dominikg/tsconfck/pull/132)) + +### Patch Changes + +- fix(types): use import condition for types to avoid masquerading as cjs ([#130](https://github.com/dominikg/tsconfck/pull/130)) + +## 3.0.0-next.8 + +### Major Changes + +- breaking(find): replace scanNodeModules with ignoreNodeModules ([#128](https://github.com/dominikg/tsconfck/pull/128)) + +### Patch Changes + +- fix(errors): cache errors instead of evicting cache value on error ([#125](https://github.com/dominikg/tsconfck/pull/125)) + +## 3.0.0-next.7 + +### Major Changes + +- breaking(find): ignore tsconfig files inside node_modules ([#123](https://github.com/dominikg/tsconfck/pull/123)) + +## 3.0.0-next.6 + +### Major Changes + +- breaking(errors): throw ENOENT from parse if input .json filename does not exist. throw custom error if exists but is no file ([#121](https://github.com/dominikg/tsconfck/pull/121)) + +### Patch Changes + +- fix(parseNative): return empty result for not found to align with parse ([#121](https://github.com/dominikg/tsconfck/pull/121)) + +## 3.0.0-next.5 + +### Patch Changes + +- fix(find): only call then on promise in cache" ([#117](https://github.com/dominikg/tsconfck/pull/117)) + +## 3.0.0-next.4 + +### Major Changes + +- breaking(parse): resolve with empty result for missing tsconfig file, remove option resolveWithEmptyIfConfigNotFound ([#115](https://github.com/dominikg/tsconfck/pull/115)) + +- breaking(types): remove Awaitable type and add result type generic to cache ([#115](https://github.com/dominikg/tsconfck/pull/115)) + +### Minor Changes + +- perf(find): switch to fs.stat callback for async and increase cache usage ([#115](https://github.com/dominikg/tsconfck/pull/115)) + +## 3.0.0-next.3 + +### Major Changes + +- breaking(cache): remove tsconfigPaths option from find, add cache option that lazily caches found tsconfig paths. ([#112](https://github.com/dominikg/tsconfck/pull/112)) + +### Minor Changes + +- feat(findNative): add find options (cache, root) ([#112](https://github.com/dominikg/tsconfck/pull/112)) + +## 3.0.0-next.2 + +### Patch Changes + +- fix(types): use [] for optional parameter jsdoc to ensure dts-buddy emits them as optional ([#110](https://github.com/dominikg/tsconfck/pull/110)) + +## 3.0.0-next.1 + +### Major Changes + +- breaking(exports): remove package.json export ([#107](https://github.com/dominikg/tsconfck/pull/107)) + +- breaking(find): rename option tsConfigPaths to tsconfigPaths to ensure consistent use of tsconfig spelling ([#109](https://github.com/dominikg/tsconfck/pull/109)) + +- breaking(node): minimum supported node version is node18 ([#107](https://github.com/dominikg/tsconfck/pull/107)) + +- breaking(peerDependencies): minimum supported typescript version for parseNative and findNative is 5.0 ([#107](https://github.com/dominikg/tsconfck/pull/107)) + +- breaking(exports): remove cjs export ([#107](https://github.com/dominikg/tsconfck/pull/107)) + +### Minor Changes + +- feat(exports): export unbundled esm js ([#107](https://github.com/dominikg/tsconfck/pull/107)) + +- feat(exports): export types as module declaration, including a .d.ts.map ([#107](https://github.com/dominikg/tsconfck/pull/107)) + +## 2.1.2 + +### Patch Changes + +- fix(find-all): ignore inaccessible directory error on windows ([#96](https://github.com/dominikg/tsconfck/issues/96)) + +--- + +see [changelog archive](./CHANGELOG_archive.md) for older versions diff --git a/CHANGELOG.md b/packages/tsconfck/CHANGELOG_archive.md similarity index 70% rename from CHANGELOG.md rename to packages/tsconfck/CHANGELOG_archive.md index 5da4352..ad26068 100644 --- a/CHANGELOG.md +++ b/packages/tsconfck/CHANGELOG_archive.md @@ -1,267 +1,183 @@ ## [2.1.2](https://github.com/dominikg/tsconfck/compare/tsconfck@2.1.1...tsconfck@2.1.2) (2023-07-15) - ### Bug Fixes -* **find-all:** ignore inaccessible directory error on windows ([#96](https://github.com/dominikg/tsconfck/issues/96)) ([760b84c](https://github.com/dominikg/tsconfck/commit/760b84c8e432a962f917e0c168ca845e0bddf156)) - - +- **find-all:** ignore inaccessible directory error on windows ([#96](https://github.com/dominikg/tsconfck/issues/96)) ([760b84c](https://github.com/dominikg/tsconfck/commit/760b84c8e432a962f917e0c168ca845e0bddf156)) ## [2.1.1](https://github.com/dominikg/tsconfck/compare/tsconfck@2.1.0...tsconfck@2.1.1) (2023-03-22) - ### Bug Fixes -* **find-all:** improve performance for larger trees by using traditional callbacks instead of yield ([#84](https://github.com/dominikg/tsconfck/issues/84)) ([1324d21](https://github.com/dominikg/tsconfck/commit/1324d2154a8c6fbc0d353a43a14bb661519f4e02)) - - +- **find-all:** improve performance for larger trees by using traditional callbacks instead of yield ([#84](https://github.com/dominikg/tsconfck/issues/84)) ([1324d21](https://github.com/dominikg/tsconfck/commit/1324d2154a8c6fbc0d353a43a14bb661519f4e02)) # [2.1.0](https://github.com/dominikg/tsconfck/compare/tsconfck@2.1.0-next.0...tsconfck@2.1.0) (2023-03-13) - - # [2.1.0-next.0](https://github.com/dominikg/tsconfck/compare/tsconfck@2.0.3...tsconfck@2.1.0-next.0) (2023-03-02) - ### Features -* add support for ts 5 ([#80](https://github.com/dominikg/tsconfck/issues/80)) ([1026f90](https://github.com/dominikg/tsconfck/commit/1026f90851ab904ca09e943df64d8a8ce7eecfd4)) - - +- add support for ts 5 ([#80](https://github.com/dominikg/tsconfck/issues/80)) ([1026f90](https://github.com/dominikg/tsconfck/commit/1026f90851ab904ca09e943df64d8a8ce7eecfd4)) ## [2.0.3](https://github.com/dominikg/tsconfck/compare/tsconfck@2.0.2...tsconfck@2.0.3) (2023-02-22) - ### Bug Fixes -* relax pnpm ([#79](https://github.com/dominikg/tsconfck/issues/79)) ([7f9fee0](https://github.com/dominikg/tsconfck/commit/7f9fee013fc2a86e11962b81572e671935a2c8ff)) - - +- relax pnpm ([#79](https://github.com/dominikg/tsconfck/issues/79)) ([7f9fee0](https://github.com/dominikg/tsconfck/commit/7f9fee013fc2a86e11962b81572e671935a2c8ff)) ## [2.0.2](https://github.com/dominikg/tsconfck/compare/tsconfck@2.0.1...tsconfck@2.0.2) (2022-12-21) - ### Bug Fixes -* **parseNative:** support Node16 and NodeNext resolution ([#73](https://github.com/dominikg/tsconfck/issues/73)) ([4683947](https://github.com/dominikg/tsconfck/commit/4683947a78876b0543e60559336952b85a5bf30d)) - - +- **parseNative:** support Node16 and NodeNext resolution ([#73](https://github.com/dominikg/tsconfck/issues/73)) ([4683947](https://github.com/dominikg/tsconfck/commit/4683947a78876b0543e60559336952b85a5bf30d)) ## [2.0.1](https://github.com/dominikg/tsconfck/compare/tsconfck@2.0.0...tsconfck@2.0.1) (2022-05-25) - ### Bug Fixes -* **parse-native:** prevent target: esnext getting converted to latest ([#60](https://github.com/dominikg/tsconfck/issues/60)) ([d77d648](https://github.com/dominikg/tsconfck/commit/d77d6485b7b8f16939e527c2ab1395bc30d755e4)) - +- **parse-native:** prevent target: esnext getting converted to latest ([#60](https://github.com/dominikg/tsconfck/issues/60)) ([d77d648](https://github.com/dominikg/tsconfck/commit/d77d6485b7b8f16939e527c2ab1395bc30d755e4)) # [2.0.0](https://github.com/dominikg/tsconfck/compare/tsconfck@1.2.2...tsconfck@2.0.0) (2022-05-12) - ### Features -* update build to target node14 ([#59](https://github.com/dominikg/tsconfck/issues/59)) ([6f0c385](https://github.com/dominikg/tsconfck/commit/6f0c385f1a42622b59f3a7946656b9a9a9d7f2da)) - +- update build to target node14 ([#59](https://github.com/dominikg/tsconfck/issues/59)) ([6f0c385](https://github.com/dominikg/tsconfck/commit/6f0c385f1a42622b59f3a7946656b9a9a9d7f2da)) ### BREAKING CHANGES -* Removed support for node12. Minimum supported version is now 14.13.1 - - +- Removed support for node12. Minimum supported version is now 14.13.1 ## [1.2.2](https://github.com/dominikg/tsconfck/compare/tsconfck@1.2.1...tsconfck@1.2.2) (2022-04-04) - ### Bug Fixes -* **find-all:** prevent errors for inaccessible or deleted directories ([#52](https://github.com/dominikg/tsconfck/issues/52)) ([e1e9b28](https://github.com/dominikg/tsconfck/commit/e1e9b28dfae2960817cc5cba59545860e3c656a6)) - - +- **find-all:** prevent errors for inaccessible or deleted directories ([#52](https://github.com/dominikg/tsconfck/issues/52)) ([e1e9b28](https://github.com/dominikg/tsconfck/commit/e1e9b28dfae2960817cc5cba59545860e3c656a6)) ## [1.2.1](https://github.com/dominikg/tsconfck/compare/tsconfck@1.2.0...tsconfck@1.2.1) (2022-03-23) - ### Bug Fixes -* resolve `extends` where value is missing the filename part. eg `"extends": "@tsconfig/node14"` ([#48](https://github.com/dominikg/tsconfck/issues/48)) ([9364456](https://github.com/dominikg/tsconfck/commit/93644567ea60b156b58a91390ad3ae02e1599f91)) - - +- resolve `extends` where value is missing the filename part. eg `"extends": "@tsconfig/node14"` ([#48](https://github.com/dominikg/tsconfck/issues/48)) ([9364456](https://github.com/dominikg/tsconfck/commit/93644567ea60b156b58a91390ad3ae02e1599f91)) # [1.2.0](https://github.com/dominikg/tsconfck/compare/tsconfck@1.1.2...tsconfck@1.2.0) (2022-02-23) - ### Features -* add findAll and performance improving options to find and parse ([#41](https://github.com/dominikg/tsconfck/issues/41)) ([a0834c8](https://github.com/dominikg/tsconfck/commit/a0834c89904e5a6b9e6f7c8985994fb79012b960)) - - +- add findAll and performance improving options to find and parse ([#41](https://github.com/dominikg/tsconfck/issues/41)) ([a0834c8](https://github.com/dominikg/tsconfck/commit/a0834c89904e5a6b9e6f7c8985994fb79012b960)) ## [1.1.2](https://github.com/dominikg/tsconfck/compare/tsconfck@1.1.1...tsconfck@1.1.2) (2022-01-26) - ### Bug Fixes -* allow parsing solution files such as `tsconfig.test.json` with parse directly ([#35](https://github.com/dominikg/tsconfck/issues/35)) ([a12cebe](https://github.com/dominikg/tsconfck/commit/a12cebefbd4c114583dadf8a010e8c23ed386e5f)) - - +- allow parsing solution files such as `tsconfig.test.json` with parse directly ([#35](https://github.com/dominikg/tsconfck/issues/35)) ([a12cebe](https://github.com/dominikg/tsconfck/commit/a12cebefbd4c114583dadf8a010e8c23ed386e5f)) ## [1.1.1](https://github.com/dominikg/tsconfck/compare/tsconfck@1.1.0...tsconfck@1.1.1) (2021-10-31) - ### Bug Fixes -* remove 'node:' prefix to avoid require(node:xxx) in cjs build for node12 compatibility ([e95b6cb](https://github.com/dominikg/tsconfck/commit/e95b6cb27936179e48f592eadc6a642b39a69b0d)) - - +- remove 'node:' prefix to avoid require(node:xxx) in cjs build for node12 compatibility ([e95b6cb](https://github.com/dominikg/tsconfck/commit/e95b6cb27936179e48f592eadc6a642b39a69b0d)) # [1.1.0](https://github.com/dominikg/tsconfck/compare/tsconfck@1.0.0...tsconfck@1.1.0) (2021-10-06) - ### Features -* add .mts and .cts to default extensions for typescript 4.5 support ([#13](https://github.com/dominikg/tsconfck/issues/13)) ([87ecc07](https://github.com/dominikg/tsconfck/commit/87ecc076088b8974bb6d69932d471c2b4fcf2d58)) - - +- add .mts and .cts to default extensions for typescript 4.5 support ([#13](https://github.com/dominikg/tsconfck/issues/13)) ([87ecc07](https://github.com/dominikg/tsconfck/commit/87ecc076088b8974bb6d69932d471c2b4fcf2d58)) # [1.0.0](https://github.com/dominikg/tsconfck/compare/tsconfck@1.0.0-10...tsconfck@1.0.0) (2021-09-15) - - # [1.0.0-10](https://github.com/dominikg/tsconfck/compare/tsconfck@1.0.0-9...tsconfck@1.0.0-10) (2021-09-14) - ### Features -* add tsconfigFile to parse error ([#9](https://github.com/dominikg/tsconfck/issues/9)) ([38c13b6](https://github.com/dominikg/tsconfck/commit/38c13b685e3b2a967a864b692ca14e518f449aec)) - - +- add tsconfigFile to parse error ([#9](https://github.com/dominikg/tsconfck/issues/9)) ([38c13b6](https://github.com/dominikg/tsconfck/commit/38c13b685e3b2a967a864b692ca14e518f449aec)) # [1.0.0-9](https://github.com/dominikg/tsconfck/compare/tsconfck@1.0.0-8...tsconfck@1.0.0-9) (2021-09-14) - ### Features -* rename filename to tsconfigFile to avoid confusion with filename argument ([#8](https://github.com/dominikg/tsconfck/issues/8)) ([9752114](https://github.com/dominikg/tsconfck/commit/9752114deb8439968a80d86f2f0d35ca8c4478fd)) - +- rename filename to tsconfigFile to avoid confusion with filename argument ([#8](https://github.com/dominikg/tsconfck/issues/8)) ([9752114](https://github.com/dominikg/tsconfck/commit/9752114deb8439968a80d86f2f0d35ca8c4478fd)) ### BREAKING CHANGES -* rename `filename` of TSConfckParseResult and TSConfckParseNativeResult to `tsconfigFile` - - +- rename `filename` of TSConfckParseResult and TSConfckParseNativeResult to `tsconfigFile` # [1.0.0-8](https://github.com/dominikg/tsconfck/compare/tsconfck@1.0.0-7...tsconfck@1.0.0-8) (2021-09-12) - ### Features -* add option 'ignoreSourceFiles' for parseNative ([#7](https://github.com/dominikg/tsconfck/issues/7)) ([33d966c](https://github.com/dominikg/tsconfck/commit/33d966c478bd778494d42a5b5e69c9861a15301e)) - - +- add option 'ignoreSourceFiles' for parseNative ([#7](https://github.com/dominikg/tsconfck/issues/7)) ([33d966c](https://github.com/dominikg/tsconfck/commit/33d966c478bd778494d42a5b5e69c9861a15301e)) # [1.0.0-7](https://github.com/dominikg/tsconfck/compare/tsconfck@1.0.0-6...tsconfck@1.0.0-7) (2021-09-09) - ### Features -* add parse option resolveWithEmptyIfConfigNotFound ([8b02ca8](https://github.com/dominikg/tsconfck/commit/8b02ca8d6e9e26b1391935d10262890d6da4e1cd)) - +- add parse option resolveWithEmptyIfConfigNotFound ([8b02ca8](https://github.com/dominikg/tsconfck/commit/8b02ca8d6e9e26b1391935d10262890d6da4e1cd)) ### BREAKING CHANGES -* prefix types with TSConfck to avoid confusion - - +- prefix types with TSConfck to avoid confusion # [1.0.0-6](https://github.com/dominikg/tsconfck/compare/tsconfck@1.0.0-5...tsconfck@1.0.0-6) (2021-09-08) - ### Bug Fixes -* extend compilerOptions when it is only set in extended tsconfig ([e51959a](https://github.com/dominikg/tsconfck/commit/e51959a1bc026a4e439f6dca8c740b7e6b71dcc9)) -* remove engines restriction for yarn and npm ([2079ccc](https://github.com/dominikg/tsconfck/commit/2079ccc5a2e895dd19819c82a818ba7167878f2a)) - - +- extend compilerOptions when it is only set in extended tsconfig ([e51959a](https://github.com/dominikg/tsconfck/commit/e51959a1bc026a4e439f6dca8c740b7e6b71dcc9)) +- remove engines restriction for yarn and npm ([2079ccc](https://github.com/dominikg/tsconfck/commit/2079ccc5a2e895dd19819c82a818ba7167878f2a)) # [1.0.0-5](https://github.com/dominikg/tsconfck/compare/tsconfck@1.0.0-4...tsconfck@1.0.0-5) (2021-09-07) - ### Features -* add option to cache ParseResult ([#6](https://github.com/dominikg/tsconfck/issues/6)) ([ecef987](https://github.com/dominikg/tsconfck/commit/ecef987b3f2196fd896aeb9f193a981490902660)) - - +- add option to cache ParseResult ([#6](https://github.com/dominikg/tsconfck/issues/6)) ([ecef987](https://github.com/dominikg/tsconfck/commit/ecef987b3f2196fd896aeb9f193a981490902660)) # [1.0.0-4](https://github.com/dominikg/tsconfck/compare/tsconfck@1.0.0-3...tsconfck@1.0.0-4) (2021-09-07) - ### Bug Fixes -* improve test coverage and error handling; fixed issues with baseUrl, paths and extends ([#5](https://github.com/dominikg/tsconfck/issues/5)) ([55a0d39](https://github.com/dominikg/tsconfck/commit/55a0d391f17680bcdeb78da9acefef8517514cb8)) - +- improve test coverage and error handling; fixed issues with baseUrl, paths and extends ([#5](https://github.com/dominikg/tsconfck/issues/5)) ([55a0d39](https://github.com/dominikg/tsconfck/commit/55a0d391f17680bcdeb78da9acefef8517514cb8)) ### Features -* support for solution-style tsconfig ([#3](https://github.com/dominikg/tsconfck/issues/3)) ([0d54b84](https://github.com/dominikg/tsconfck/commit/0d54b84c7e2754c4ce6344b737e7630964897190)) - - +- support for solution-style tsconfig ([#3](https://github.com/dominikg/tsconfck/issues/3)) ([0d54b84](https://github.com/dominikg/tsconfck/commit/0d54b84c7e2754c4ce6344b737e7630964897190)) # [1.0.0-3](https://github.com/dominikg/tsconfck/compare/tsconfck@1.0.0-2...tsconfck@1.0.0-3) (2021-08-28) - ### Features -* cli ([5fa828f](https://github.com/dominikg/tsconfck/commit/5fa828f7994e2feb04589c2728189b183aac26ed)) - - +- cli ([5fa828f](https://github.com/dominikg/tsconfck/commit/5fa828f7994e2feb04589c2728189b183aac26ed)) # [1.0.0-2](https://github.com/dominikg/tsconfck/compare/tsconfck@1.0.0-1...tsconfck@1.0.0-2) (2021-08-28) - ### Bug Fixes -* inline strip-bom and strip-json-comments to get cjs build working ([f64d4c7](https://github.com/dominikg/tsconfck/commit/f64d4c7cdbcb619b46bc9a70bf8ab4f671959f76)) -* prevent dynamic import to require transform in build ([4dfa25c](https://github.com/dominikg/tsconfck/commit/4dfa25c4abf6ba80535f48255a6bfe88b10a775b)) - - +- inline strip-bom and strip-json-comments to get cjs build working ([f64d4c7](https://github.com/dominikg/tsconfck/commit/f64d4c7cdbcb619b46bc9a70bf8ab4f671959f76)) +- prevent dynamic import to require transform in build ([4dfa25c](https://github.com/dominikg/tsconfck/commit/4dfa25c4abf6ba80535f48255a6bfe88b10a775b)) # 1.0.0-1 (2021-08-26) - ### Bug Fixes -* return empty object when tsconfig.json is empty ([5a4abaf](https://github.com/dominikg/tsconfck/commit/5a4abaf1d690786b3c7e3946f4e66637b36fa9f0)) - - +- return empty object when tsconfig.json is empty ([5a4abaf](https://github.com/dominikg/tsconfck/commit/5a4abaf1d690786b3c7e3946f4e66637b36fa9f0)) # 1.0.0-0 (2021-08-26) - - ### Bug Fixes -* add tsconfig to ParseNativeResult with merged compilerOptions. Include a simple testcase ([0b7efdb](https://github.com/dominikg/tsconfck/commit/0b7efdbcd1d2f1003d8f529e4777767ae1c692c6)) -* convert found filename to native path separator in parseNative ([21ebd8e](https://github.com/dominikg/tsconfck/commit/21ebd8eb22f5dfb8751cef4b7e1df5138b296009)) -* convert found filename to native path separator in parseNative ([671eca8](https://github.com/dominikg/tsconfck/commit/671eca8b4cbb4f2f6f5f91dad79d38bbe3201c3b)) -* convert output of ts parser to be parsable again, improve error handling, more tests ([e9b28a2](https://github.com/dominikg/tsconfck/commit/e9b28a2bbc27db7ae48cf44b6d7d0f9e7e2f27bc)) -* convert windows path separators correctly for native ts functions ([504158b](https://github.com/dominikg/tsconfck/commit/504158ba8efbe00758b0d07b022894352b2ff4bd)) -* don't call posix2native in findNative ([8d2b125](https://github.com/dominikg/tsconfck/commit/8d2b125eb5b2ebf9c9cc8dbc203d0d7c77cda296)) -* don't use find if parse is called with a tsconfig.json; refactor tests for isomorphic result ([ff34eb5](https://github.com/dominikg/tsconfck/commit/ff34eb5697a84b4a52b01774cf39accb0544b92b)) -* use native find function in parseNative ([041dd8e](https://github.com/dominikg/tsconfck/commit/041dd8eabf2d99188628ab046a8b28c13fd31453)) -* use node12 compatible rmdir ([a464db0](https://github.com/dominikg/tsconfck/commit/a464db0d95481fde6bf685e29a6757fefb597f21)) -* use node12 compatible way to import fs/promises ([433092d](https://github.com/dominikg/tsconfck/commit/433092d019a57d495f6711be4e8852bedf6ab742)) - +- add tsconfig to ParseNativeResult with merged compilerOptions. Include a simple testcase ([0b7efdb](https://github.com/dominikg/tsconfck/commit/0b7efdbcd1d2f1003d8f529e4777767ae1c692c6)) +- convert found filename to native path separator in parseNative ([21ebd8e](https://github.com/dominikg/tsconfck/commit/21ebd8eb22f5dfb8751cef4b7e1df5138b296009)) +- convert found filename to native path separator in parseNative ([671eca8](https://github.com/dominikg/tsconfck/commit/671eca8b4cbb4f2f6f5f91dad79d38bbe3201c3b)) +- convert output of ts parser to be parsable again, improve error handling, more tests ([e9b28a2](https://github.com/dominikg/tsconfck/commit/e9b28a2bbc27db7ae48cf44b6d7d0f9e7e2f27bc)) +- convert windows path separators correctly for native ts functions ([504158b](https://github.com/dominikg/tsconfck/commit/504158ba8efbe00758b0d07b022894352b2ff4bd)) +- don't call posix2native in findNative ([8d2b125](https://github.com/dominikg/tsconfck/commit/8d2b125eb5b2ebf9c9cc8dbc203d0d7c77cda296)) +- don't use find if parse is called with a tsconfig.json; refactor tests for isomorphic result ([ff34eb5](https://github.com/dominikg/tsconfck/commit/ff34eb5697a84b4a52b01774cf39accb0544b92b)) +- use native find function in parseNative ([041dd8e](https://github.com/dominikg/tsconfck/commit/041dd8eabf2d99188628ab046a8b28c13fd31453)) +- use node12 compatible rmdir ([a464db0](https://github.com/dominikg/tsconfck/commit/a464db0d95481fde6bf685e29a6757fefb597f21)) +- use node12 compatible way to import fs/promises ([433092d](https://github.com/dominikg/tsconfck/commit/433092d019a57d495f6711be4e8852bedf6ab742)) ### Features -* advanced parse with extends ([bf0db8e](https://github.com/dominikg/tsconfck/commit/bf0db8e80ef15b7bcd80c9ad584eda80fdce2a01)) -* implement findTSConfig ([6d57501](https://github.com/dominikg/tsconfck/commit/6d575015b43d6408b7e04427a33b1dbec183781e)) -* implement native parse with optional peer dependency on typescript ([5ade70b](https://github.com/dominikg/tsconfck/commit/5ade70bdbafddb0666496537cf135d7fadd7a6d8)) -* implement simple parse ([2715b45](https://github.com/dominikg/tsconfck/commit/2715b45e64331a9390f29041d39e5dc23deee129)) -* implement toJson ([96d3bfc](https://github.com/dominikg/tsconfck/commit/96d3bfc90c837a970e6ab08d3896ffe1978aaa34)) -* separate findNative function ([4000586](https://github.com/dominikg/tsconfck/commit/40005863e9c68db3284c62bca6dd5155ec439cf6)) - - - - - +- advanced parse with extends ([bf0db8e](https://github.com/dominikg/tsconfck/commit/bf0db8e80ef15b7bcd80c9ad584eda80fdce2a01)) +- implement findTSConfig ([6d57501](https://github.com/dominikg/tsconfck/commit/6d575015b43d6408b7e04427a33b1dbec183781e)) +- implement native parse with optional peer dependency on typescript ([5ade70b](https://github.com/dominikg/tsconfck/commit/5ade70bdbafddb0666496537cf135d7fadd7a6d8)) +- implement simple parse ([2715b45](https://github.com/dominikg/tsconfck/commit/2715b45e64331a9390f29041d39e5dc23deee129)) +- implement toJson ([96d3bfc](https://github.com/dominikg/tsconfck/commit/96d3bfc90c837a970e6ab08d3896ffe1978aaa34)) +- separate findNative function ([4000586](https://github.com/dominikg/tsconfck/commit/40005863e9c68db3284c62bca6dd5155ec439cf6)) diff --git a/LICENSE b/packages/tsconfck/LICENSE similarity index 100% rename from LICENSE rename to packages/tsconfck/LICENSE diff --git a/packages/tsconfck/README.md b/packages/tsconfck/README.md new file mode 100644 index 0000000..1489623 --- /dev/null +++ b/packages/tsconfck/README.md @@ -0,0 +1,237 @@ +# tsconfck + +[![npm version](https://img.shields.io/npm/v/tsconfck)](https://www.npmjs.com/package/tsconfck) +[![CI](https://github.com/dominikg/tsconfck/actions/workflows/test.yml/badge.svg)](https://github.com/dominikg/tsconfck/actions/workflows/test.yml) + +A utility to find and parse tsconfig files without depending on typescript + +# Why + +Because no simple official api exists and tsconfig isn't actual json. + +# Features + +- [x] find closest tsconfig (tsconfig.json or jsconfig.json) +- [x] convert tsconfig to actual json and parse it +- [x] resolve "extends" +- [x] resolve "references" of solution-style tsconfig +- [x] optional caching for improved performance +- [x] optional findNative and parseNative to use official typescript api +- [x] zero dependencies (typescript optional) +- [x] extensive testsuite +- [x] completely async and optimized (it's [fast](https://github.com/dominikg/tsconfck/blob/main/docs/benchmark.md)) +- [x] tiny [4.7KB gzip](https://pkg-size.dev/tsconfck@%5E3.0.0-next.0) +- [x] unbundled esm js, no sourcemaps needed +- [x] [types](https://github.com/dominikg/tsconfck/blob/main//packages/tsconfck/types/index.d.ts) generated with [dts-buddy](https://github.com/Rich-Harris/dts-buddy) + +# Users + +Used by [vite](https://github.com/vitejs/vite)\*, [vite-tsconfig-paths](https://github.com/aleclarson/vite-tsconfig-paths), [astro](https://github.com/withastro/astro) and [many more](https://github.com/dominikg/tsconfck/network/dependents) + +> (\*) vite bundles tsconfck so it is listed as a devDependency + +# Install + +```shell +npm install --save-dev tsconfck # or pnpm, yarn +``` + +# Usage + +## without typescript installed + +```js +import { parse } from 'tsconfck'; +const { + tsconfigFile, // full path to found tsconfig + tsconfig, // tsconfig object including merged values from extended configs + extended, // separate unmerged results of all tsconfig files that contributed to tsconfig + solution, // solution result if tsconfig is part of a solution + referenced // referenced tsconfig results if tsconfig is a solution +} = await parse('foo/bar.ts'); +``` + +## with typescript + +```js +import { parseNative } from 'tsconfck'; +const { + tsconfigFile, // full path to found tsconfig + tsconfig, // tsconfig object including merged values from extended configs, normalized + result, // output of ts.parseJsonConfigFileContent + solution, // solution result if tsconfig is part of a solution + referenced // referenced tsconfig results if tsconfig is a solution +} = await parseNative('foo/bar.ts'); +``` + +## API + +see [API-DOCS](docs/api.md) + +## Advanced + +### ignoring tsconfig for files inside node_modules + +esbuild ignores node_modules so when you want to use tsconfck with esbuild, you can set `ignoreNodeModules: true` + +```js +import { find, parse } from 'tsconfck'; +// returns some-lib/tsconfig.json +const fooTSConfig = await find('node_modules/some-lib/src/foo.ts'); + +// returns null +const fooTSConfigIgnored = await find('node_modules/some-lib/src/foo.ts', { + ignoreNodeModules: true +}); + +// returns empty config +const { tsconfig } = await parse('node_modules/some-lib/src/foo.ts', { ignoreNodeModules: true }); +``` + +### caching + +a TSConfckCache instance can be created and passed to find and parse functions to reduce overhead when they are called often within the same project + +```js +import { find, parse, TSCOnfckCache } from 'tsconfck'; +// 1. create cache instance +const cache = new TSCOnfckCache(); +// 2. pass cache instance in options +const fooTSConfig = await find(('src/foo.ts', { cache })); // stores tsconfig for src in cache +const barTSConfig = await find(('src/bar.ts', { cache })); // reuses tsconfig result for src without fs call + +const fooResult = await parse('src/foo.ts', { cache }); // uses cached path for tsconfig, stores parse result in cache +const barResult = await parse('src/bar.ts', { cache }); // uses cached parse result without fs call or resolving +``` + +#### cache invalidation + +You are responsible for clearing the cache if tsconfig files are added/removed/changed after reading them during the cache lifetime. + +Call `cache.clear()` and also discard all previous compilation results based previously cached configs. + +#### cache mutation + +Returned results are direct cache objects. If you want to modify them, deep-clone first. + +#### cache reuse + +Never use the same cache instance for mixed calls of find/findNative or parse/parseNative as result structures are different + +### root + +This option can be used to limit finding tsconfig files outside of a root directory + +```js +import { parse, TSConfckCache } from 'tsconfck'; +const root = '.'; +const parseOptions = { root }; +// these calls are not going to look for tsconfig files outside root +const fooResult = await find('src/foo.ts', parseOptions); +const barResult = await parse('src/bar.ts', parseOptions); +``` + +> Using the root option can lead to errors if there is no tsconfig found inside root. + +### error handling + +find and parse reject for errors they encounter, but return null or empty result if no config was found + +If you want them to error instead, test the result and throw + +```js +import { parse } from 'tsconfck'; +find('some/path/without/tsconfig/foo.ts').then((result) => { + if (result === null) { + throw new Error('not found'); + } + return result; +}); +parse('some/path/without/tsconfig/foo.ts').then((result) => { + if (result.tsconfigFile === null) { + throw new Error('not found'); + } + return result; +}); +``` + +### TSConfig type (optional, requires typescript as devDependency) + +```ts +import type { TSConfig } from 'pkg-types'; +``` + +Check out https://github.com/unjs/pkg-types + +### cli + +A simple cli wrapper is included, you can use it like this + +#### find + +```shell +# prints /path/to/tsconfig.json on stdout +tsconfck find src/index.ts +``` + +#### find-all + +```shell +# prints all tsconfig.json in dir on stdout +tsconfck find-all src/ +``` + +#### parse + +```shell +# print content of ParseResult.tsconfig on stdout +tsconfck parse src/index.ts + +# print to file +tsconfck parse src/index.ts > output.json +``` + +#### parse-result + +```shell +# print content of ParseResult on stdout +tsconfck parse-result src/index.ts + +# print to file +tsconfck parse-result src/index.ts > output.json +``` + +#### help + +```shell +# print usage +tsconfck -h # or --help, -?, help +``` + +# Links + +- [changelog](CHANGELOG.md) + +# Develop + +This repo uses + +- [pnpm](https://pnpm.io) +- [changesets](https://github.com/changesets/changesets) + +In every PR you have to add a changeset by running `pnpm changeset` and following the prompts + +PRs are going to be squash-merged + +```shell +# install dependencies +pnpm install +# run tests +pnpm test +#run tests in watch mode (doesn't require dev in parallel) +pnpm test:watch +``` + +# License + +[MIT](./LICENSE) diff --git a/packages/tsconfck/bin/tsconfck.js b/packages/tsconfck/bin/tsconfck.js new file mode 100755 index 0000000..e68fd0e --- /dev/null +++ b/packages/tsconfck/bin/tsconfck.js @@ -0,0 +1,76 @@ +#!/usr/bin/env node +import { parse, find, findAll } from '../src/index.js'; +import * as process from 'node:process'; + +const HELP_TEXT = ` +Usage: tsconfck [args] + +Commands: find, find-all, parse, parse-result +Args: + -js : find/parse jsconfig.json instead of tsconfig.json + +Examples: +find tsconfig.json for a file +> tsconfck find src/index.ts + +find all tsconfig files in current dir +> tsconfck find-all . + +parse tsconfig for a file +> tsconfck parse src/index.ts +`; + +const HELP_ARGS = ['-h', '--help', '-?', 'help']; +const JS_ARG = '-js'; +const COMMANDS = ['find', 'find-all', 'find-all', 'parse', 'parse-result']; +function needsHelp(args) { + if (args.some((arg) => HELP_ARGS.includes(arg))) { + return HELP_TEXT; + } + const expectedLength = args.includes(JS_ARG) ? 3 : 2; + if (args.length !== expectedLength) { + return 'invalid number of arguments\n' + HELP_TEXT; + } else if (!COMMANDS.includes(args[0])) { + return 'invalid command ' + args[0] + '\n' + HELP_TEXT; + } +} +async function main() { + const args = process.argv.slice(2); + const help = needsHelp(args); + if (help) { + return help; + } + + const command = args[0]; + const file = args[1]; + const isJS = args[2] === JS_ARG; + const findOptions = isJS ? { configName: 'jsconfig.json' } : undefined; + if (command === 'find') { + return find(file, findOptions).then((found) => { + if (!found) { + throw new Error(`no tsconfig found for ${file}`); + } + return found; + }); + } else if (command === 'parse') { + return JSON.stringify((await parse(file, findOptions)).tsconfig, null, 2); + } else if (command === 'parse-result') { + return JSON.stringify(await parse(file, findOptions), null, 2); + } else if (command === 'find-all') { + return ( + await findAll(file || '.', { configNames: [isJS ? 'jsconfig.json' : 'tsconfig.json'] }) + ).join('\n'); + } +} + +main().then( + (result) => { + process.stdout.write(result); + process.stdout.write('\n'); + }, + (err) => { + console.error(err.message, err); + // eslint-disable-next-line n/no-process-exit + process.exit(1); + } +); diff --git a/packages/tsconfck/package.json b/packages/tsconfck/package.json new file mode 100644 index 0000000..7a94a23 --- /dev/null +++ b/packages/tsconfck/package.json @@ -0,0 +1,69 @@ +{ + "name": "tsconfck", + "version": "3.0.0-next.9", + "description": "A utility to work with tsconfig.json without typescript", + "license": "MIT", + "author": "dominikg", + "files": [ + "bin", + "src", + "types", + "README.md", + "LICENSE", + "package.json" + ], + "type": "module", + "bin": "bin/tsconfck.js", + "types": "types/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./types/index.d.ts", + "default": "./src/index.js" + } + } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/dominikg/tsconfck.git", + "directory": "packages/tsconfck" + }, + "keywords": [ + "typescript", + "tsconfig", + "tsconfig.json", + "jsconfig", + "jsconfig.json" + ], + "bugs": { + "url": "https://github.com/dominikg/tsconfck/issues" + }, + "homepage": "https://github.com/dominikg/tsconfck/tree/main/packages/tsconfck#readme", + "peerDependencies": { + "typescript": "^5.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + }, + "devDependencies": { + "@tsconfig/node18": "^18.2.2", + "@vitest/coverage-v8": "^0.34.6", + "esbuild": "^0.19.4", + "tiny-glob": "^0.2.9", + "typescript": "^5.2.2", + "vitest": "^0.34.6" + }, + "engines": { + "node": "^18 || >=20" + }, + "scripts": { + "check:publint": "publint --strict", + "check:types": "tsc --noEmit", + "test": "vitest run", + "test:coverage": "vitest run --coverage", + "test:watch": "vitest", + "dts-buddy": "dts-buddy -m \"tsconfck:src/index.js\"" + } +} diff --git a/packages/tsconfck/src/cache.js b/packages/tsconfck/src/cache.js new file mode 100644 index 0000000..1560b34 --- /dev/null +++ b/packages/tsconfck/src/cache.js @@ -0,0 +1,121 @@ +/** @template T */ +export class TSConfckCache { + /** + * clear cache, use this if you have a long running process and tsconfig files have been added,changed or deleted + */ + clear() { + this.#configPaths.clear(); + this.#parsed.clear(); + } + + /** + * has cached closest config for files in dir + * @param {string} dir + * @param {string} [configName=tsconfig.json] + * @returns {boolean} + */ + hasConfigPath(dir, configName = 'tsconfig.json') { + return this.#configPaths.has(`${dir}/${configName}`); + } + + /** + * get cached closest tsconfig for files in dir + * @param {string} dir + * @param {string} [configName=tsconfig.json] + * @returns {Promise|string|null} + * @throws {unknown} if cached value is an error + */ + getConfigPath(dir, configName = 'tsconfig.json') { + const key = `${dir}/${configName}`; + const value = this.#configPaths.get(key); + if (value == null || value.length || value.then) { + return value; + } else { + throw value; + } + } + + /** + * has parsed tsconfig for file + * @param {string} file + * @returns {boolean} + */ + hasParseResult(file) { + return this.#parsed.has(file); + } + + /** + * get parsed tsconfig for file + * @param {string} file + * @returns {Promise|T} + * @throws {unknown} if cached value is an error + */ + getParseResult(file) { + const value = this.#parsed.get(file); + if (value.then || value.tsconfig) { + return value; + } else { + throw value; // cached error, rethrow + } + } + + /** + * @internal + * @private + * @param file + * @param {Promise} result + */ + setParseResult(file, result) { + this.#parsed.set(file, result); + result + .then((parsed) => { + if (this.#parsed.get(file) === result) { + this.#parsed.set(file, parsed); + } + }) + .catch((e) => { + if (this.#parsed.get(file) === result) { + this.#parsed.set(file, e); + } + }); + } + + /** + * @internal + * @private + * @param {string} dir + * @param {Promise} configPath + * @param {string} [configName=tsconfig.json] + */ + setConfigPath(dir, configPath, configName = 'tsconfig.json') { + const key = `${dir}/${configName}`; + this.#configPaths.set(key, configPath); + configPath + .then((path) => { + if (this.#configPaths.get(key) === configPath) { + this.#configPaths.set(key, path); + } + }) + .catch((e) => { + if (this.#configPaths.get(key) === configPath) { + this.#configPaths.set(key, e); + } + }); + } + + /** + * map directories to their closest tsconfig.json + * @internal + * @private + * @type{Map|string|null)>} + */ + #configPaths = new Map(); + + /** + * map files to their parsed tsconfig result + * @internal + * @private + * @type {Map|T)> } + */ + #parsed = new Map(); +} diff --git a/packages/tsconfck/src/find-all.js b/packages/tsconfck/src/find-all.js new file mode 100644 index 0000000..f9cf89b --- /dev/null +++ b/packages/tsconfck/src/find-all.js @@ -0,0 +1,71 @@ +import path from 'node:path'; +import { readdir } from 'node:fs'; + +/** + * @typedef WalkState + * @interface + * @property {string[]} files - files + * @property {number} calls - number of ongoing calls + * @property {(dir: string)=>boolean} skip - function to skip dirs + * @property {boolean} err - error flag + * @property {string[]} configNames - config file names + */ + +const sep = path.sep; + +/** + * find all tsconfig.json files in dir + * + * @param {string} dir - path to dir (absolute or relative to cwd) + * @param {import('./public.d.ts').TSConfckFindAllOptions} [options] - options + * @returns {Promise} list of absolute paths to all found tsconfig.json files + */ +export async function findAll(dir, options) { + /** @type WalkState */ + const state = { + files: [], + calls: 0, + skip: options?.skip, + err: false, + configNames: options?.configNames ?? ['tsconfig.json'] + }; + return new Promise((resolve, reject) => { + walk(path.resolve(dir), state, (err, files) => (err ? reject(err) : resolve(files))); + }); +} + +/** + * + * @param {string} dir + * @param {WalkState} state + * @param {(err: NodeJS.ErrnoException | null, files?: string[]) => void} done + */ +function walk(dir, state, done) { + if (state.err) { + return; + } + state.calls++; + readdir(dir, { withFileTypes: true }, (err, entries = []) => { + if (state.err) { + return; + } + // skip deleted or inaccessible directories + if (err && !(err.code === 'ENOENT' || err.code === 'EACCES' || err.code === 'EPERM')) { + state.err = true; + done(err); + } else { + for (const ent of entries) { + if (ent.isDirectory() && !state.skip?.(ent.name)) { + walk(`${dir}${sep}${ent.name}`, state, done); + } else if (ent.isFile() && state.configNames.includes(ent.name)) { + state.files.push(`${dir}${sep}${ent.name}`); + } + } + if (--state.calls === 0) { + if (!state.err) { + done(null, state.files); + } + } + } + }); +} diff --git a/packages/tsconfck/src/find-native.js b/packages/tsconfck/src/find-native.js new file mode 100644 index 0000000..2db74c5 --- /dev/null +++ b/packages/tsconfck/src/find-native.js @@ -0,0 +1,70 @@ +import path from 'node:path'; +import { isInNodeModules, loadTS, native2posix } from './util.js'; + +/** + * find the closest tsconfig.json file using native ts.findConfigFile + * + * You must have `typescript` installed to use this + * + * @param {string} filename - path to file to find tsconfig for (absolute or relative to cwd) + * @param {import('./public.d.ts').TSConfckFindOptions} [options] - options + * @returns {Promise} absolute path to closest tsconfig.json + */ +export async function findNative(filename, options) { + let dir = native2posix(path.dirname(path.resolve(filename))); + if (options?.ignoreNodeModules && isInNodeModules(dir)) { + return null; + } + const cache = options?.cache; + const root = options?.root ? native2posix(path.resolve(options.root)) : undefined; + const configName = options?.configName ?? 'tsconfig.json'; + if (cache?.hasConfigPath(dir, configName)) { + return cache.getConfigPath(dir, configName); + } + const ts = await loadTS(); + const { findConfigFile, sys } = ts; + let tsconfigFile = findConfigFile(dir, sys.fileExists, configName); + if (!tsconfigFile || is_out_of_root(tsconfigFile, root)) { + tsconfigFile = null; + } + if (cache) { + cache_result(tsconfigFile, dir, cache, root, configName); + } + return tsconfigFile; +} + +/** + * + * @param {string} tsconfigFile + * @param {string} root + */ +function is_out_of_root(tsconfigFile, root) { + return root && !tsconfigFile.startsWith(root); +} + +/** + * add all intermediate directories between fileDir and tsconfigFile to cache + * if no tsconfig was found, go up until root + * @param {string|null} tsconfigFile + * @param {string} fileDir + * @param {import('./cache.js').TSConfckCache} cache + * @param {string|undefined} root + * @param {string} configName + */ +function cache_result(tsconfigFile, fileDir, cache, root, configName) { + const tsconfigDir = tsconfigFile ? path.dirname(tsconfigFile) : root; + const directories = []; + let dir = fileDir; + while (dir) { + directories.push(dir); + const parent = path.dirname(dir); + if (tsconfigDir === dir || parent === dir) { + break; + } else { + dir = parent; + } + } + directories.forEach((d) => { + cache.setConfigPath(d, Promise.resolve(tsconfigFile), configName); + }); +} diff --git a/packages/tsconfck/src/find.js b/packages/tsconfck/src/find.js new file mode 100644 index 0000000..8094ec1 --- /dev/null +++ b/packages/tsconfck/src/find.js @@ -0,0 +1,70 @@ +import path from 'node:path'; +import fs from 'node:fs'; +import { isInNodeModules, makePromise } from './util.js'; +/** + * find the closest tsconfig.json file + * + * @param {string} filename - path to file to find tsconfig for (absolute or relative to cwd) + * @param {import('./public.d.ts').TSConfckFindOptions} [options] - options + * @returns {Promise} absolute path to closest tsconfig.json or null if not found + */ +export async function find(filename, options) { + let dir = path.dirname(path.resolve(filename)); + if (options?.ignoreNodeModules && isInNodeModules(dir)) { + return null; + } + const cache = options?.cache; + const configName = options?.configName ?? 'tsconfig.json'; + if (cache?.hasConfigPath(dir, configName)) { + return cache.getConfigPath(dir, configName); + } + const { /** @type {Promise} */ promise, resolve, reject } = makePromise(); + if (options?.root && !path.isAbsolute(options.root)) { + options.root = path.resolve(options.root); + } + findUp(dir, { promise, resolve, reject }, options); + return promise; +} + +/** + * + * @param {string} dir + * @param {{promise:Promise,resolve:(result:string|null)=>void,reject:(err:any)=>void}} madePromise + * @param {import('./public.d.ts').TSConfckFindOptions} [options] - options + */ +function findUp(dir, { resolve, reject, promise }, options) { + const { cache, root, configName } = options ?? {}; + if (cache) { + if (cache.hasConfigPath(dir, configName)) { + let cached; + try { + cached = cache.getConfigPath(dir, configName); + } catch (e) { + reject(e); + return; + } + if (cached?.then) { + cached.then(resolve).catch(reject); + } else { + resolve(cached); + } + } else { + cache.setConfigPath(dir, promise, configName); + } + } + const tsconfig = path.join(dir, options?.configName ?? 'tsconfig.json'); + fs.stat(tsconfig, (err, stats) => { + if (stats && (stats.isFile() || stats.isFIFO())) { + resolve(tsconfig); + } else if (err?.code !== 'ENOENT') { + reject(err); + } else { + let parent; + if (root === dir || (parent = path.dirname(dir)) === dir) { + resolve(null); + } else { + findUp(parent, { promise, resolve, reject }, options); + } + } + }); +} diff --git a/packages/tsconfck/src/index.js b/packages/tsconfck/src/index.js new file mode 100644 index 0000000..5aafbc1 --- /dev/null +++ b/packages/tsconfck/src/index.js @@ -0,0 +1,7 @@ +export { find } from './find.js'; +export { findAll } from './find-all.js'; +export { toJson } from './to-json.js'; +export { parse, TSConfckParseError } from './parse.js'; +export { findNative } from './find-native.js'; +export { parseNative, TSConfckParseNativeError } from './parse-native.js'; +export { TSConfckCache } from './cache.js'; diff --git a/src/parse-native.ts b/packages/tsconfck/src/parse-native.js similarity index 58% rename from src/parse-native.ts rename to packages/tsconfck/src/parse-native.js index 70fb720..fcac7a0 100644 --- a/src/parse-native.ts +++ b/packages/tsconfck/src/parse-native.js @@ -1,80 +1,81 @@ -import path from 'path'; +import path from 'node:path'; import { + makePromise, loadTS, native2posix, resolveReferencedTSConfigFiles, resolveSolutionTSConfig, - resolveTSConfig -} from './util'; -import { findNative } from './find-native'; + resolveTSConfigJson +} from './util.js'; +import { findNative } from './find-native.js'; + +const notFoundResult = { + tsconfigFile: null, + tsconfig: {}, + result: null +}; /** * parse the closest tsconfig.json file with typescript native functions * * You need to have `typescript` installed to use this * - * @param {string} filename - path to a tsconfig.json or a .ts source file (absolute or relative to cwd) - * @param {TSConfckParseNativeOptions} options - options - * @returns {Promise} + * @param {string} filename - path to a tsconfig .json or a source file (absolute or relative to cwd) + * @param {import('./public.d.ts').TSConfckParseNativeOptions} [options] - options + * @returns {Promise} * @throws {TSConfckParseNativeError} */ -export async function parseNative( - filename: string, - options?: TSConfckParseNativeOptions -): Promise { +export async function parseNative(filename, options) { + /** @type {import('./cache.js').TSConfckCache} */ const cache = options?.cache; - if (cache?.has(filename)) { - return cache.get(filename)!; + if (cache?.hasParseResult(filename)) { + return cache.getParseResult(filename); } - let tsconfigFile; - - if (options?.resolveWithEmptyIfConfigNotFound) { - try { - tsconfigFile = await resolveTSConfig(filename); - if (!tsconfigFile) { - tsconfigFile = await findNative(filename); - } - } catch (e) { - const notFoundResult = { - tsconfigFile: 'no_tsconfig_file_found', - tsconfig: {}, - result: null - }; - cache?.set(filename, notFoundResult); - return notFoundResult; - } - } else { - tsconfigFile = await resolveTSConfig(filename); + const { + resolve, + reject, + /** @type {Promise}*/ + promise + } = makePromise(); + cache?.setParseResult(filename, promise); + try { + const tsconfigFile = + (await resolveTSConfigJson(filename, cache)) || (await findNative(filename, options)); if (!tsconfigFile) { - tsconfigFile = await findNative(filename); + resolve(notFoundResult); + return promise; } + /** @type {import('./public.d.ts').TSConfckParseNativeResult} */ + let result; + if (filename !== tsconfigFile && cache?.hasParseResult(tsconfigFile)) { + result = await cache.getParseResult(tsconfigFile); + } else { + const ts = await loadTS(); + result = await parseFile(tsconfigFile, ts, options, filename === tsconfigFile); + await parseReferences(result, ts, options); + cache?.setParseResult(tsconfigFile, Promise.resolve(result)); + } + //@ts-ignore + resolve(resolveSolutionTSConfig(filename, result)); + return promise; + } catch (e) { + reject(e); + return promise; } - - let result: TSConfckParseNativeResult; - if (cache?.has(tsconfigFile)) { - result = cache.get(tsconfigFile)!; - } else { - const ts = await loadTS(); - result = await parseFile(tsconfigFile, ts, options); - await parseReferences(result, ts, options); - cache?.set(tsconfigFile, result); - } - - //@ts-ignore - result = resolveSolutionTSConfig(filename, result); - //@ts-ignore - cache?.set(filename, result); - return result; } -async function parseFile( - tsconfigFile: string, - ts: any, - options?: TSConfckParseNativeOptions -): Promise { +/** + * + * @param {string} tsconfigFile + * @param {any} ts + * @param {import('./public.d.ts').TSConfckParseNativeOptions} [options] + * @param {boolean} [skipCache] + * @returns {import('./public.d.ts').TSConfckParseNativeResult} + */ +function parseFile(tsconfigFile, ts, options, skipCache) { const cache = options?.cache; - if (cache?.has(tsconfigFile)) { - return cache.get(tsconfigFile)!; + if (!skipCache && cache?.hasParseResult(tsconfigFile)) { + return cache.getParseResult(tsconfigFile); } const posixTSConfigFile = native2posix(tsconfigFile); const { parseJsonConfigFileContent, readConfigFile, sys } = ts; @@ -103,27 +104,33 @@ async function parseFile( ); checkErrors(nativeResult, tsconfigFile); - const result: TSConfckParseNativeResult = { + /** @type {import('./public.d.ts').TSConfckParseNativeResult} */ + const result = { tsconfigFile, tsconfig: result2tsconfig(nativeResult, ts), result: nativeResult }; - cache?.set(tsconfigFile, result); + if (!skipCache) { + cache?.setParseResult(tsconfigFile, Promise.resolve(result)); + } return result; } -async function parseReferences( - result: TSConfckParseNativeResult, - ts: any, - options?: TSConfckParseNativeOptions -) { +/** + * + * @param {import('./public.d.ts').TSConfckParseNativeResult} result + * @param {any} ts + * @param {import('./public.d.ts').TSConfckParseNativeOptions} [options] + */ +async function parseReferences(result, ts, options) { if (!result.tsconfig.references) { return; } - const referencedFiles = resolveReferencedTSConfigFiles(result); + const referencedFiles = resolveReferencedTSConfigFiles(result, options); result.referenced = await Promise.all( referencedFiles.map((file) => parseFile(file, ts, options)) ); + result.referenced.forEach((ref) => (ref.solution = result)); } /** @@ -132,17 +139,18 @@ async function parseReferences( * ignores errors related to missing input files as these may happen regularly in programmatic use * and do not affect the config itself * - * @param {nativeResult} any - native typescript parse result to check for errors + * @param {any} nativeResult - native typescript parse result to check for errors + * @param {string} tsconfigFile * @throws {TSConfckParseNativeError} for critical error */ -function checkErrors(nativeResult: any, tsconfigFile: string) { +function checkErrors(nativeResult, tsconfigFile) { const ignoredErrorCodes = [ // see https://github.com/microsoft/TypeScript/blob/main/src/compiler/diagnosticMessages.json 18002, // empty files list 18003 // no inputs ]; const criticalError = nativeResult.errors?.find( - (error: TSDiagnosticError) => error.category === 1 && !ignoredErrorCodes.includes(error.code) + (error) => error.category === 1 && !ignoredErrorCodes.includes(error.code) ); if (criticalError) { throw new TSConfckParseNativeError(criticalError, tsconfigFile, nativeResult); @@ -156,11 +164,11 @@ function checkErrors(nativeResult: any, tsconfigFile: string) { * - strip prefix and postfix of compilerOptions.lib * - convert enum values back to string * - * @param result - * @param ts typescript + * @param {any} result + * @param {any} ts typescript * @returns {object} tsconfig with merged compilerOptions and enums restored to their string form */ -function result2tsconfig(result: any, ts: any) { +function result2tsconfig(result, ts) { // dereference result.raw so changes below don't modify original const tsconfig = JSON.parse(JSON.stringify(result.raw)); // for some reason the extended compilerOptions are not available in result.raw but only in result.options @@ -179,7 +187,7 @@ function result2tsconfig(result: any, ts: any) { if (compilerOptions) { if (compilerOptions.lib != null) { // remove lib. and .dts from lib.es2019.d.ts etc - compilerOptions.lib = compilerOptions.lib.map((x: string) => + compilerOptions.lib = compilerOptions.lib.map((x) => x.replace(/^lib\./, '').replace(/\.d\.ts$/, '') ); } @@ -238,62 +246,14 @@ function result2tsconfig(result: any, ts: any) { return tsconfig; } -export interface TSConfckParseNativeOptions { - /** - * optional cache map to speed up repeated parsing with multiple files - * it is your own responsibility to clear the cache if tsconfig files change during its lifetime - * cache keys are input `filename` and absolute paths to tsconfig.json files - * - * You must not modify cached values. - */ - cache?: Map; - - /** - * treat missing tsconfig as empty result instead of an error - * parseNative resolves with { filename: 'no_tsconfig_file_found',tsconfig:{}, result: null} instead of reject with error - */ - resolveWithEmptyIfConfigNotFound?: boolean; - +export class TSConfckParseNativeError extends Error { /** - * Set this option to true to force typescript to ignore all source files. - * - * This is faster - especially for large projects - but comes with 2 caveats * - * 1) output tsconfig always has `files: [],include: []` instead of any real values configured. - * 2) as a result of 1), it won't be able to resolve solution-style references and always return the closest tsconfig - */ - ignoreSourceFiles?: boolean; -} - -export interface TSConfckParseNativeResult { - /** - * absolute path to parsed tsconfig.json - */ - tsconfigFile: string; - - /** - * parsed result, including merged values from extended and normalized - */ - tsconfig: any; - - /** - * ParseResult for parent solution - */ - solution?: TSConfckParseNativeResult; - - /** - * ParseNativeResults for all tsconfig files referenced in a solution + * @param {TSDiagnosticError} diagnostic - diagnostics of ts + * @param {string} tsconfigFile - file that errored + * @param {any?} result - parsed result, if any */ - referenced?: TSConfckParseNativeResult[]; - - /** - * full output of ts.parseJsonConfigFileContent - */ - result: any; -} - -export class TSConfckParseNativeError extends Error { - constructor(diagnostic: TSDiagnosticError, tsconfigFile: string, result?: any) { + constructor(diagnostic, tsconfigFile, result) { super(diagnostic.messageText); // Set the prototype explicitly. Object.setPrototypeOf(this, TSConfckParseNativeError.prototype); @@ -306,28 +266,32 @@ export class TSConfckParseNativeError extends Error { /** * code of typescript diagnostic, prefixed with "TS " + * @type {string} */ - code: string; + code; /** * full ts diagnostic that caused this error + * @type {TSDiagnosticError} */ - diagnostic: any; + diagnostic; /** * absolute path of tsconfig file where the error happened + * @type {string} */ - tsconfigFile: string; + tsconfigFile; /** * native result if present, contains all errors in result.errors + * @type {any|undefined} */ - result: any | undefined; + result; } -interface TSDiagnosticError { +/** @typedef TSDiagnosticError { code: number; category: number; messageText: string; start?: number; -} +} TSDiagnosticError */ diff --git a/src/parse.ts b/packages/tsconfck/src/parse.js similarity index 51% rename from src/parse.ts rename to packages/tsconfck/src/parse.js index 4e59e3c..bbd32c1 100644 --- a/src/parse.ts +++ b/packages/tsconfck/src/parse.js @@ -1,92 +1,108 @@ -import path from 'path'; -import { promises as fs } from 'fs'; +import path from 'node:path'; +import { promises as fs } from 'node:fs'; import { createRequire } from 'module'; -import { find, TSConfckFindOptions } from './find.js'; +import { find } from './find.js'; import { toJson } from './to-json.js'; import { + makePromise, native2posix, resolve2posix, resolveReferencedTSConfigFiles, resolveSolutionTSConfig, - resolveTSConfig -} from './util'; + resolveTSConfigJson +} from './util.js'; + +const not_found_result = { + tsconfigFile: null, + tsconfig: {} +}; /** * parse the closest tsconfig.json file * - * @param {string} filename - path to a tsconfig.json or a .ts source file (absolute or relative to cwd) - * @param {TSConfckParseOptions} options - options - * @returns {Promise} + * @param {string} filename - path to a tsconfig .json or a source file or directory (absolute or relative to cwd) + * @param {import('./public.d.ts').TSConfckParseOptions} [options] - options + * @returns {Promise} * @throws {TSConfckParseError} */ -export async function parse( - filename: string, - options?: TSConfckParseOptions -): Promise { +export async function parse(filename, options) { + /** @type {import('./cache.js').TSConfckCache} */ const cache = options?.cache; - if (cache?.has(filename)) { - return cache.get(filename)!; + if (cache?.hasParseResult(filename)) { + return cache.getParseResult(filename); } - let tsconfigFile; - if (options?.resolveWithEmptyIfConfigNotFound) { - try { - tsconfigFile = (await resolveTSConfig(filename)) || (await find(filename, options)); - } catch (e) { - const notFoundResult = { - tsconfigFile: 'no_tsconfig_file_found', - tsconfig: {} - }; - cache?.set(filename, notFoundResult); - return notFoundResult; + const { + resolve, + reject, + /** @type {Promise}*/ + promise + } = makePromise(); + cache?.setParseResult(filename, promise); + try { + let tsconfigFile = + (await resolveTSConfigJson(filename, cache)) || (await find(filename, options)); + if (!tsconfigFile) { + resolve(not_found_result); + return promise; } - } else { - tsconfigFile = (await resolveTSConfig(filename)) || (await find(filename, options)); - } - let result; - if (cache?.has(tsconfigFile)) { - result = cache.get(tsconfigFile)!; - } else { - result = await parseFile(tsconfigFile, cache); - await Promise.all([parseExtends(result, cache), parseReferences(result, cache)]); - cache?.set(tsconfigFile, result); + let result; + if (filename !== tsconfigFile && cache?.hasParseResult(tsconfigFile)) { + result = await cache.getParseResult(tsconfigFile); + } else { + result = await parseFile(tsconfigFile, cache, filename === tsconfigFile); + await Promise.all([parseExtends(result, cache), parseReferences(result, options)]); + } + resolve(resolveSolutionTSConfig(filename, result)); + return promise; + } catch (e) { + reject(e); + return promise; } - result = resolveSolutionTSConfig(filename, result); - cache?.set(filename, result); - return result; } -async function parseFile( - tsconfigFile: string, - cache?: Map -): Promise { - if (cache?.has(tsconfigFile)) { - return cache.get(tsconfigFile)!; +/** + * + * @param {string} tsconfigFile - path to tsconfig file + * @param {import('./cache.js').TSConfckCache} [cache] - cache + * @param {boolean} [skipCache] - skip cache + * @returns {Promise} + */ +async function parseFile(tsconfigFile, cache, skipCache) { + if (!skipCache && cache?.hasParseResult(tsconfigFile)) { + return cache.getParseResult(tsconfigFile); } - try { - const tsconfigJson = await fs.readFile(tsconfigFile, 'utf-8'); - const json = toJson(tsconfigJson); - const result = { - tsconfigFile, - tsconfig: normalizeTSConfig(JSON.parse(json), path.dirname(tsconfigFile)) - }; - cache?.set(tsconfigFile, result); - return result; - } catch (e) { - throw new TSConfckParseError( - `parsing ${tsconfigFile} failed: ${e}`, - 'PARSE_FILE', - tsconfigFile, - e - ); + const promise = fs + .readFile(tsconfigFile, 'utf-8') + .then(toJson) + .then((json) => { + const parsed = JSON.parse(json); + applyDefaults(parsed, tsconfigFile); + return { + tsconfigFile, + tsconfig: normalizeTSConfig(parsed, path.dirname(tsconfigFile)) + }; + }) + .catch((e) => { + throw new TSConfckParseError( + `parsing ${tsconfigFile} failed: ${e}`, + 'PARSE_FILE', + tsconfigFile, + e + ); + }); + if (!skipCache) { + cache?.setParseResult(tsconfigFile, promise); } + return promise; } /** * normalize to match the output of ts.parseJsonConfigFileContent * - * @param tsconfig + * @param {any} tsconfig - typescript tsconfig output + * @param {string} dir - directory */ -function normalizeTSConfig(tsconfig: any, dir: string) { +function normalizeTSConfig(tsconfig, dir) { // set baseUrl to absolute path if (tsconfig.compilerOptions?.baseUrl && !path.isAbsolute(tsconfig.compilerOptions.baseUrl)) { tsconfig.compilerOptions.baseUrl = resolve2posix(dir, tsconfig.compilerOptions.baseUrl); @@ -94,32 +110,47 @@ function normalizeTSConfig(tsconfig: any, dir: string) { return tsconfig; } -async function parseReferences( - result: TSConfckParseResult, - cache?: Map -) { +/** + * + * @param {import('./public.d.ts').TSConfckParseResult} result + * @param {import('./public.d.ts').TSConfckParseOptions} [options] + * @returns {Promise} + */ +async function parseReferences(result, options) { if (!result.tsconfig.references) { return; } - const referencedFiles = resolveReferencedTSConfigFiles(result); - const referenced = await Promise.all(referencedFiles.map((file) => parseFile(file, cache))); - await Promise.all(referenced.map((ref) => parseExtends(ref, cache))); + const referencedFiles = resolveReferencedTSConfigFiles(result, options); + const referenced = await Promise.all( + referencedFiles.map((file) => parseFile(file, options?.cache)) + ); + await Promise.all(referenced.map((ref) => parseExtends(ref, options?.cache))); + referenced.forEach((ref) => { + ref.solution = result; + }); result.referenced = referenced; } -async function parseExtends(result: TSConfckParseResult, cache?: Map) { +/** + * @param {import('./public.d.ts').TSConfckParseResult} result + * @param {import('./cache.js').TSConfckCache}[cache] + * @returns {Promise} + */ +async function parseExtends(result, cache) { if (!result.tsconfig.extends) { return; } // use result as first element in extended // but dereference tsconfig so that mergeExtended can modify the original without affecting extended[0] - const extended: TSConfckParseResult[] = [ + /** @type {import('./public.d.ts').TSConfckParseResult[]} */ + const extended = [ { tsconfigFile: result.tsconfigFile, tsconfig: JSON.parse(JSON.stringify(result.tsconfig)) } ]; // flatten extends graph into extended let pos = 0; - const extendsPath: string[] = []; + /** @type {string[]} */ + const extendsPath = []; let currentBranchDepth = 0; while (pos < extended.length) { const extending = extended[pos]; @@ -127,14 +158,15 @@ async function parseExtends(result: TSConfckParseResult, cache?: Map resolveExtends(ex, extending.tsconfigFile)); + .map((ex) => resolveExtends(ex, extending.tsconfigFile)); } const circularExtends = resolvedExtends.find((tsconfigFile) => @@ -163,13 +195,19 @@ async function parseExtends(result: TSConfckParseResult, cache?: Map rebasePath(x, prependPath)); } else { - return rebasePath(value as string, prependPath); + return rebasePath(value, prependPath); } } -function rebasePath(value: string, prependPath: string): string { +/** + * + * @param {string} value + * @param {string} prependPath + * @returns {string} + */ +function rebasePath(value, prependPath) { if (path.isAbsolute(value)) { return value; } else { @@ -283,54 +341,31 @@ function rebasePath(value: string, prependPath: string): string { } } -export interface TSConfckParseOptions extends TSConfckFindOptions { - /** - * optional cache map to speed up repeated parsing with multiple files - * it is your own responsibility to clear the cache if tsconfig files change during its lifetime - * cache keys are input `filename` and absolute paths to tsconfig.json files - * - * You must not modify cached values. - */ - cache?: Map; - - /** - * treat missing tsconfig as empty result instead of an error - * parse resolves with { filename: 'no_tsconfig_file_found',tsconfig:{}} instead of reject with error - */ - resolveWithEmptyIfConfigNotFound?: boolean; -} - -export interface TSConfckParseResult { - /** - * absolute path to parsed tsconfig.json - */ - tsconfigFile: string; - +export class TSConfckParseError extends Error { /** - * parsed result, including merged values from extended + * error code + * @type {string} */ - tsconfig: any; - + code; /** - * ParseResult for parent solution + * error cause + * @type { Error | undefined} */ - solution?: TSConfckParseResult; + cause; /** - * ParseResults for all tsconfig files referenced in a solution + * absolute path of tsconfig file where the error happened + * @type {string} */ - referenced?: TSConfckParseResult[]; - + tsconfigFile; /** - * ParseResult for all tsconfig files * - * [a,b,c] where a extends b and b extends c + * @param {string} message - error message + * @param {string} code - error code + * @param {string} tsconfigFile - path to tsconfig file + * @param {Error?} cause - cause of this error */ - extended?: TSConfckParseResult[]; -} - -export class TSConfckParseError extends Error { - constructor(message: string, code: string, tsconfigFile: string, cause?: Error) { + constructor(message, code, tsconfigFile, cause) { super(message); // Set the prototype explicitly. Object.setPrototypeOf(this, TSConfckParseError.prototype); @@ -339,18 +374,33 @@ export class TSConfckParseError extends Error { this.cause = cause; this.tsconfigFile = tsconfigFile; } +} - /** - * error code - */ - code: string; - /** - * the cause of this error - */ - cause: Error | undefined; +/** + * + * @param {any} tsconfig + * @param {string} tsconfigFile + */ +function applyDefaults(tsconfig, tsconfigFile) { + if (isJSConfig(tsconfigFile)) { + tsconfig.compilerOptions = { + ...DEFAULT_JSCONFIG_COMPILER_OPTIONS, + ...tsconfig.compilerOptions + }; + } +} - /** - * absolute path of tsconfig file where the error happened - */ - tsconfigFile: string; +const DEFAULT_JSCONFIG_COMPILER_OPTIONS = { + allowJs: true, + maxNodeModuleJsDepth: 2, + allowSyntheticDefaultImports: true, + skipLibCheck: true, + noEmit: true +}; + +/** + * @param {string} configFileName + */ +function isJSConfig(configFileName) { + return path.basename(configFileName) === 'jsconfig.json'; } diff --git a/packages/tsconfck/src/public.d.ts b/packages/tsconfck/src/public.d.ts new file mode 100644 index 0000000..8d825ff --- /dev/null +++ b/packages/tsconfck/src/public.d.ts @@ -0,0 +1,122 @@ +import { TSConfckCache } from './cache.js'; + +export interface TSConfckFindOptions { + /** + * A cache to improve performance for multiple calls in the same project + * + * Warning: You must clear this cache in case tsconfig files are added/removed during it's lifetime + */ + cache?: TSConfckCache; + + /** + * project root dir, does not continue scanning outside of this directory. + * + * Improves performance but may lead to different results from native typescript when no tsconfig is found inside root + */ + root?: string; + + /** + * set to true if you don't want to find tsconfig for files inside node_modules + * + * This is useful if you want to use the output with esbuild.transform as esbuild itself also ignores node_modules + * + * @default false + */ + ignoreNodeModules?: boolean; + + /** + * Override the default name of the config file to find. + * + * Use `jsconfig.json` in projects that have typechecking for js files with jsconfig.json + * + * @default tsconfig.json + */ + configName?: string; +} + +export interface TSConfckParseOptions extends TSConfckFindOptions { + // same as find options +} + +export interface TSConfckFindAllOptions { + /** + * helper to skip subdirectories when scanning for tsconfig.json + * + * eg ` dir => dir === 'node_modules' || dir === '.git'` + */ // eslint-disable-next-line no-unused-vars + skip?: (dir: string) => boolean; + /** + * list of config filenames to include, use ["tsconfig.json","jsconfig.json"] if you need both + * + * @default ["tsconfig.json"] + */ + configNames?: string[]; +} + +export interface TSConfckParseResult { + /** + * absolute path to parsed tsconfig.json + */ + tsconfigFile: string; + + /** + * parsed result, including merged values from extended + */ + tsconfig: any; + + /** + * ParseResult for parent solution + */ + solution?: TSConfckParseResult; + + /** + * ParseResults for all tsconfig files referenced in a solution + */ + referenced?: TSConfckParseResult[]; + + /** + * ParseResult for all tsconfig files + * + * [a,b,c] where a extends b and b extends c + */ + extended?: TSConfckParseResult[]; +} + +export interface TSConfckParseNativeOptions extends TSConfckParseOptions { + /** + * Set this option to true to force typescript to ignore all source files. + * + * This is faster - especially for large projects - but comes with 2 caveats + * + * 1) output tsconfig always has `files: [],include: []` instead of any real values configured. + * 2) as a result of 1), it won't be able to resolve solution-style references and always return the closest tsconfig + */ + ignoreSourceFiles?: boolean; +} + +export interface TSConfckParseNativeResult { + /** + * absolute path to parsed tsconfig.json + */ + tsconfigFile: string; + + /** + * parsed result, including merged values from extended and normalized + */ + tsconfig: any; + + /** + * ParseResult for parent solution + */ + solution?: TSConfckParseNativeResult; + + /** + * ParseNativeResults for all tsconfig files referenced in a solution + */ + referenced?: TSConfckParseNativeResult[]; + + /** + * full output of ts.parseJsonConfigFileContent + */ + result: any; +} diff --git a/src/to-json.ts b/packages/tsconfck/src/to-json.js similarity index 85% rename from src/to-json.ts rename to packages/tsconfck/src/to-json.js index a7aaa64..cd381ca 100644 --- a/src/to-json.ts +++ b/packages/tsconfck/src/to-json.js @@ -11,7 +11,7 @@ * @param {string} tsconfigJson - content of tsconfig.json * @returns {string} content as regular json, comments and dangling commas have been replaced with whitespace */ -export function toJson(tsconfigJson: string): string { +export function toJson(tsconfigJson) { const stripped = stripDanglingComma(stripJsonComments(stripBom(tsconfigJson))); if (stripped.trim() === '') { // only whitespace left after stripping, return empty object so that JSON.parse still works @@ -24,8 +24,11 @@ export function toJson(tsconfigJson: string): string { /** * replace dangling commas from pseudo-json string with single space * implementation heavily inspired by strip-json-comments + * + * @param {string} pseudoJson + * @returns {string} */ -function stripDanglingComma(pseudoJson: string) { +function stripDanglingComma(pseudoJson) { let insideString = false; let offset = 0; let result = ''; @@ -60,7 +63,13 @@ function stripDanglingComma(pseudoJson: string) { } // start strip-json-comments -function isEscaped(jsonString: string, quotePosition: number) { +/** + * + * @param {string} jsonString + * @param {number} quotePosition + * @returns {boolean} + */ +function isEscaped(jsonString, quotePosition) { let index = quotePosition - 1; let backslashCount = 0; @@ -72,16 +81,27 @@ function isEscaped(jsonString: string, quotePosition: number) { return Boolean(backslashCount % 2); } -function strip(string: string, start?: number, end?: number) { +/** + * + * @param {string} string + * @param {number?} start + * @param {number?} end + */ +function strip(string, start, end) { return string.slice(start, end).replace(/\S/g, ' '); } const singleComment = Symbol('singleComment'); const multiComment = Symbol('multiComment'); -function stripJsonComments(jsonString: string) { +/** + * @param {string} jsonString + * @returns {string} + */ +function stripJsonComments(jsonString) { let isInsideString = false; - let isInsideComment: false | symbol = false; + /** @type {false | symbol} */ + let isInsideComment = false; let offset = 0; let result = ''; @@ -132,7 +152,11 @@ function stripJsonComments(jsonString: string) { // end strip-json-comments // start strip-bom -function stripBom(string: string) { +/** + * @param {string} string + * @returns {string} + */ +function stripBom(string) { // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string // conversion translates it to FEFF (UTF-16 BOM). if (string.charCodeAt(0) === 0xfeff) { diff --git a/src/util.ts b/packages/tsconfck/src/util.js similarity index 50% rename from src/util.ts rename to packages/tsconfck/src/util.js index 929d390..4ff3175 100644 --- a/src/util.ts +++ b/packages/tsconfck/src/util.js @@ -1,47 +1,77 @@ -import path from 'path'; -import { promises as fs } from 'fs'; -import { TSConfckParseResult } from './parse.js'; +import path from 'node:path'; +import { promises as fs } from 'node:fs'; const POSIX_SEP_RE = new RegExp('\\' + path.posix.sep, 'g'); const NATIVE_SEP_RE = new RegExp('\\' + path.sep, 'g'); -const PATTERN_REGEX_CACHE = new Map(); +/** @type {Map}*/ +const PATTERN_REGEX_CACHE = new Map(); const GLOB_ALL_PATTERN = `**/*`; -const DEFAULT_EXTENSIONS = ['.ts', '.tsx', '.mts', '.cts']; -const DEFAULT_EXTENSIONS_RE_GROUP = `\\.(?:${DEFAULT_EXTENSIONS.map((ext) => ext.substring(1)).join( +const TS_EXTENSIONS = ['.ts', '.tsx', '.mts', '.cts']; +const JS_EXTENSIONS = ['.js', '.jsx', '.mjs', '.cjs']; +const TSJS_EXTENSIONS = TS_EXTENSIONS.concat(JS_EXTENSIONS); +const TS_EXTENSIONS_RE_GROUP = `\\.(?:${TS_EXTENSIONS.map((ext) => ext.substring(1)).join('|')})`; +const TSJS_EXTENSIONS_RE_GROUP = `\\.(?:${TSJS_EXTENSIONS.map((ext) => ext.substring(1)).join( '|' )})`; -// hide dynamic import from ts transform to prevent it turning into a require -// see https://github.com/microsoft/TypeScript/issues/43329#issuecomment-811606238 -const dynamicImportDefault = new Function('path', 'return import(path).then(m => m.default)'); +const IS_POSIX = path.posix.sep === path.sep; -export async function loadTS(): Promise { +/** + * @template T + * @returns {{resolve:(result:T)=>void, reject:(error:any)=>void, promise: Promise}} + */ +export function makePromise() { + let resolve, reject; + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + return { promise, resolve, reject }; +} + +/** + * loads typescript async to avoid direct dependency + * @returns {Promise} + */ +export async function loadTS() { try { - return dynamicImportDefault('typescript'); + return import('typescript').then((m) => m.default); } catch (e) { console.error('typescript must be installed to use "native" functions'); throw e; } } -export async function resolveTSConfig(filename: string): Promise { +/** + * @param {string} filename + * @param {import('./cache.js').TSConfckCache} [cache] + * @returns {Promise} + */ +export async function resolveTSConfigJson(filename, cache) { if (path.extname(filename) !== '.json') { - return; + return; // ignore files that are not json } const tsconfig = path.resolve(filename); - try { - const stat = await fs.stat(tsconfig); + if (cache && (cache.hasParseResult(tsconfig) || cache.hasParseResult(filename))) { + return tsconfig; + } + return fs.stat(tsconfig).then((stat) => { if (stat.isFile() || stat.isFIFO()) { return tsconfig; + } else { + throw new Error(`${filename} exists but is not a regular file.`); } - } catch (e) { - // ignore does not exist error - if (e.code !== 'ENOENT') { - throw e; - } - } - throw new Error(`no tsconfig file found for ${filename}`); + }); } +/** + * + * @param {string} dir an absolute directory path + * @returns {boolean} if dir path includes a node_modules segment + */ +export const isInNodeModules = IS_POSIX + ? (dir) => dir.includes('/node_modules/') + : (dir) => dir.match(/[/\\]node_modules[/\\]/); + /** * convert posix separator to native separator * @@ -49,14 +79,12 @@ export async function resolveTSConfig(filename: string): Promise * windows: C:/foo/bar -> c:\foo\bar * linux: /foo/bar -> /foo/bar * - * @param filename {string} filename with posix separators + * @param {string} filename with posix separators * @returns {string} filename with native separators */ -export function posix2native(filename: string) { - return path.posix.sep !== path.sep && filename.includes(path.posix.sep) - ? filename.replace(POSIX_SEP_RE, path.sep) - : filename; -} +export const posix2native = IS_POSIX + ? (filename) => filename + : (filename) => filename.replace(POSIX_SEP_RE, path.sep); /** * convert native separator to posix separator @@ -65,78 +93,92 @@ export function posix2native(filename: string) { * windows: C:\foo\bar -> c:/foo/bar * linux: /foo/bar -> /foo/bar * - * @param filename {string} filename with native separators + * @param {string} filename - filename with native separators * @returns {string} filename with posix separators */ -export function native2posix(filename: string) { - return path.posix.sep !== path.sep && filename.includes(path.sep) - ? filename.replace(NATIVE_SEP_RE, path.posix.sep) - : filename; -} +export const native2posix = IS_POSIX + ? (filename) => filename + : (filename) => filename.replace(NATIVE_SEP_RE, path.posix.sep); /** * converts params to native separator, resolves path and converts native back to posix * * needed on windows to handle posix paths in tsconfig * - * @param dir {string} directory to resolve from + * @param dir {string|null} directory to resolve from * @param filename {string} filename or pattern to resolve + * @returns string */ -export function resolve2posix(dir: string | null, filename: string) { - if (path.sep === path.posix.sep) { - return dir ? path.resolve(dir, filename) : path.resolve(filename); - } - return native2posix( - dir - ? path.resolve(posix2native(dir), posix2native(filename)) - : path.resolve(posix2native(filename)) - ); -} +export const resolve2posix = IS_POSIX + ? (dir, filename) => (dir ? path.resolve(dir, filename) : path.resolve(filename)) + : (dir, filename) => + native2posix( + dir + ? path.resolve(posix2native(dir), posix2native(filename)) + : path.resolve(posix2native(filename)) + ); -export function resolveReferencedTSConfigFiles(result: TSConfckParseResult): string[] { +/** + * + * @param {import('./public.d.ts').TSConfckParseResult} result + * @param {import('./public.d.ts').TSConfckParseOptions} [options] + * @returns {string[]} + */ +export function resolveReferencedTSConfigFiles(result, options) { const dir = path.dirname(result.tsconfigFile); - return result.tsconfig.references.map((ref: { path: string }) => { - const refPath = ref.path.endsWith('.json') ? ref.path : path.join(ref.path, 'tsconfig.json'); + return result.tsconfig.references.map((ref) => { + const refPath = ref.path.endsWith('.json') + ? ref.path + : path.join(ref.path, options?.configName ?? 'tsconfig.json'); return resolve2posix(dir, refPath); }); } -export function resolveSolutionTSConfig( - filename: string, - result: TSConfckParseResult -): TSConfckParseResult { +/** + * @param {string} filename + * @param {import('./public.d.ts').TSConfckParseResult} result + * @returns {import('./public.d.ts').TSConfckParseResult} + */ +export function resolveSolutionTSConfig(filename, result) { + const allowJs = result.tsconfig.compilerOptions?.allowJs; + const extensions = allowJs ? TSJS_EXTENSIONS : TS_EXTENSIONS; if ( result.referenced && - DEFAULT_EXTENSIONS.some((ext) => filename.endsWith(ext)) && + extensions.some((ext) => filename.endsWith(ext)) && !isIncluded(filename, result) ) { const solutionTSConfig = result.referenced.find((referenced) => isIncluded(filename, referenced) ); if (solutionTSConfig) { - return { - ...solutionTSConfig, - solution: result - }; + return solutionTSConfig; } } return result; } -function isIncluded(filename: string, result: TSConfckParseResult): boolean { +/** + * + * @param {string} filename + * @param {import('./public.d.ts').TSConfckParseResult} result + * @returns {boolean} + */ +function isIncluded(filename, result) { const dir = native2posix(path.dirname(result.tsconfigFile)); - const files = (result.tsconfig.files || []).map((file: string) => resolve2posix(dir, file)); + const files = (result.tsconfig.files || []).map((file) => resolve2posix(dir, file)); const absoluteFilename = resolve2posix(null, filename); if (files.includes(filename)) { return true; } + const allowJs = result.tsconfig.compilerOptions?.allowJs; const isIncluded = isGlobMatch( absoluteFilename, dir, - result.tsconfig.include || (result.tsconfig.files ? [] : [GLOB_ALL_PATTERN]) + result.tsconfig.include || (result.tsconfig.files ? [] : [GLOB_ALL_PATTERN]), + allowJs ); if (isIncluded) { - const isExcluded = isGlobMatch(absoluteFilename, dir, result.tsconfig.exclude || []); + const isExcluded = isGlobMatch(absoluteFilename, dir, result.tsconfig.exclude || [], allowJs); return !isExcluded; } return false; @@ -148,9 +190,11 @@ function isIncluded(filename: string, result: TSConfckParseResult): boolean { * @param filename {string} posix style abolute path to filename to test * @param dir {string} posix style absolute path to directory of tsconfig containing patterns * @param patterns {string[]} glob patterns to match against + * @param allowJs {boolean} allowJs setting in tsconfig to include js extensions in checks * @returns {boolean} true when at least one pattern matches filename */ -export function isGlobMatch(filename: string, dir: string, patterns: string[]): boolean { +export function isGlobMatch(filename, dir, patterns, allowJs) { + const extensions = allowJs ? TSJS_EXTENSIONS : TS_EXTENSIONS; return patterns.some((pattern) => { // filename must end with part of pattern that comes after last wildcard let lastWildcardIndex = pattern.length; @@ -172,7 +216,7 @@ export function isGlobMatch(filename: string, dir: string, patterns: string[]): } // if pattern ends with *, filename must end with a default extension - if (pattern.endsWith('*') && !DEFAULT_EXTENSIONS.some((ext) => filename.endsWith(ext))) { + if (pattern.endsWith('*') && !extensions.some((ext) => filename.endsWith(ext))) { return false; } @@ -206,15 +250,20 @@ export function isGlobMatch(filename: string, dir: string, patterns: string[]): // complex pattern, use regex to check it if (PATTERN_REGEX_CACHE.has(resolvedPattern)) { - return PATTERN_REGEX_CACHE.get(resolvedPattern)!.test(filename); + return PATTERN_REGEX_CACHE.get(resolvedPattern).test(filename); } - const regex = pattern2regex(resolvedPattern); + const regex = pattern2regex(resolvedPattern, allowJs); PATTERN_REGEX_CACHE.set(resolvedPattern, regex); return regex.test(filename); }); } -function pattern2regex(resolvedPattern: string): RegExp { +/** + * @param {string} resolvedPattern + * @param {boolean} allowJs + * @returns {RegExp} + */ +function pattern2regex(resolvedPattern, allowJs) { let regexStr = '^'; for (let i = 0; i < resolvedPattern.length; i++) { const char = resolvedPattern[i]; @@ -239,7 +288,7 @@ function pattern2regex(resolvedPattern: string): RegExp { // add known file endings if pattern ends on * if (resolvedPattern.endsWith('*')) { - regexStr += DEFAULT_EXTENSIONS_RE_GROUP; + regexStr += allowJs ? TSJS_EXTENSIONS_RE_GROUP : TS_EXTENSIONS_RE_GROUP; } regexStr += '$'; diff --git a/packages/tsconfck/tests/cache.js b/packages/tsconfck/tests/cache.js new file mode 100644 index 0000000..0e4f404 --- /dev/null +++ b/packages/tsconfck/tests/cache.js @@ -0,0 +1,19 @@ +import { describe, it, expect } from 'vitest'; +import { TSConfckCache } from '../src/cache.js'; + +describe('cache', () => { + describe('clear', () => { + it('should remove all data', async () => { + const cache = new TSConfckCache(); + const result = Promise.resolve(/**@type TSConfckParseResult */ ({})); + expect(cache.hasParseResult('file')).toBe(false); + cache.setParseResult('file', result); + cache.setConfigPath('bar', Promise.resolve('bar')); + expect(cache.hasParseResult('file')).toBe(true); + expect(cache.hasConfigPath('bar')).toBe(true); + await cache.clear(); + expect(cache.hasParseResult('file')).toBe(false); + expect(cache.hasConfigPath('bar')).toBe(false); + }); + }); +}); diff --git a/packages/tsconfck/tests/find-all.js b/packages/tsconfck/tests/find-all.js new file mode 100644 index 0000000..35368fe --- /dev/null +++ b/packages/tsconfck/tests/find-all.js @@ -0,0 +1,63 @@ +import path from 'node:path'; +import { describe, it, expect } from 'vitest'; +import { findAll } from '../src/find-all.js'; +import { absFixture, globFixtures } from './util/fixture-paths.js'; + +describe('find-all', () => { + it('should be a function', () => { + expect(findAll).toBeTypeOf('function'); + }); + + it('should return a Promise', () => { + expect(findAll('str')).toBeInstanceOf(Promise); + }); + + it('should reject for invalid dir arg', async () => { + for (const dir of [{}, [], 0, null, undefined]) { + await expect(findAll(dir), `dir type: ${typeof dir}`).rejects.toThrow(); + } + await expect(findAll(), 'no dir arg').rejects.toThrow(); + await expect(findAll('doesnotexist'), `filename string arg`).resolves.toEqual([]); + }); + + it('should find tsconfig in same directory', async () => { + const fixtureDir = 'find/a'; + const expected = absFixture(`${fixtureDir}/tsconfig.json`); + const found = await findAll(absFixture(fixtureDir), { skip: (dir) => dir === 'node_modules' }); + expect(found).toEqual([expected]); + }); + + it('should find tsconfig in child directory', async () => { + const fixtureDir = 'find'; + const expected = absFixture(`${fixtureDir}/a/tsconfig.json`); + const found = await findAll(absFixture(fixtureDir), { skip: (dir) => dir === 'node_modules' }); + expect(found).toEqual([expected]); + }); + + it('should find multiple tsconfig in child directories', async () => { + const fixtureDir = absFixture('find-all/multiple'); + const expected = await globFixtures('find-all/multiple/**/tsconfig.json'); + const found = (await findAll(fixtureDir)).sort(); + expect(found, `found all tsconfig in ${fixtureDir}`).toEqual(expected); + }); + + it('should find jsconfig with configNames=["tsconfig.json","jsconfig.json"]', async () => { + const fixtureDir = absFixture('find-all/multiple'); + const expected = await globFixtures('find-all/multiple/**/{t,j}sconfig.json'); + const found = ( + await findAll(fixtureDir, { configNames: ['tsconfig.json', 'jsconfig.json'] }) + ).sort(); + expect(found, `found all tsconfig and jsconfig in ${fixtureDir}`).toEqual(expected); + }); + + it('should handle directories with recursive symlinks', async () => { + const fixtureDir = absFixture('find-all/recursive-symlink'); + + const expected = [ + path.join(fixtureDir, 'tsconfig.json'), + path.join(fixtureDir, 'child', 'tsconfig.json') + ].sort(); + const found = (await findAll(fixtureDir)).sort(); + expect(found, `found all tsconfig in ${fixtureDir}`).toEqual(expected); + }); +}); diff --git a/packages/tsconfck/tests/find-native.js b/packages/tsconfck/tests/find-native.js new file mode 100644 index 0000000..1c16ce1 --- /dev/null +++ b/packages/tsconfck/tests/find-native.js @@ -0,0 +1,208 @@ +import { describe, it, expect } from 'vitest'; +import path from 'node:path'; +import os from 'os'; +import { findNative } from '../src/find-native.js'; +import { absFixture, absRoot, posixAbsFix, relFixture } from './util/fixture-paths.js'; +import { native2posix } from '../src/util.js'; +import { TSConfckCache } from '../src/cache.js'; + +describe('find-native', () => { + it('should be a function', () => { + expect(findNative).toBeTypeOf('function'); + }); + + it('should return a Promise', () => { + expect(findNative('str')).toBeInstanceOf(Promise); + }); + + it('should reject for invalid filename arg', async () => { + for (const filename of [{}, [], 0, null, undefined]) { + await expect(findNative(filename), `filename type: ${typeof filename}`).rejects.toThrow(); + } + await expect(findNative(), 'no filename arg').rejects.toThrow(); + await expect(findNative('str'), `filename string arg`).resolves.toEqual( + native2posix(absRoot('tsconfig.json')) + ); + }); + + it('should find tsconfig in same directory', async () => { + const fixtureDir = 'find/a'; + const expected = posixAbsFix(`${fixtureDir}/tsconfig.json`); + const relativeTS = relFixture(`${fixtureDir}/foo.ts`); + const absoluteTS = absFixture(`${fixtureDir}/foo.ts`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + for (const input of inputs) { + expect(await findNative(input), `input: ${input}`).toBe(expected); + } + }); + + it('should find tsconfig in parent directory', async () => { + const fixtureDir = 'find/a'; + const expected = posixAbsFix(`${fixtureDir}/tsconfig.json`); + const relativeTS = relFixture(`${fixtureDir}/b/foo.ts`); + const absoluteTS = absFixture(`${fixtureDir}/b/foo.ts`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + for (const input of inputs) { + expect(await findNative(input), `input: ${input}`).toBe(expected); + } + }); + + it('should find jsconfig with configName=jsconfig.json', async () => { + const fixtureDir = 'find/a/b/c'; + const expected = posixAbsFix(`${fixtureDir}/jsconfig.json`); + const relativeTS = relFixture(`${fixtureDir}/y.js`); + const absoluteTS = absFixture(`${fixtureDir}/y.js`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + for (const input of inputs) { + expect(await findNative(input, { configName: 'jsconfig.json' }), `input: ${input}`).toBe( + expected + ); + } + }); + + it('should find jsconfig in parent directory with configName=jsconfig.json', async () => { + const fixtureDir = 'find/a'; + const expected = posixAbsFix(`${fixtureDir}/jsconfig.json`); + const relativeTS = relFixture(`${fixtureDir}/b/qoox.js`); + const absoluteTS = absFixture(`${fixtureDir}/b/qoox.js`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + for (const input of inputs) { + expect(await findNative(input, { configName: 'jsconfig.json' }), `input: ${input}`).toBe( + expected + ); + } + }); + + it('should ignore jsconfig without configName=jsconfig.json', async () => { + const fixtureDir = 'find/a/b/c'; + const expected = posixAbsFix(`find/a/tsconfig.json`); + const relativeTS = relFixture(`${fixtureDir}/x.ts`); + const absoluteTS = absFixture(`${fixtureDir}/x.ts`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + for (const input of inputs) { + expect(await findNative(input), `input: ${input}`).toBe(expected); + } + }); + + it('should ignore files in node_modules directory with ignoreNodeModules=true', async () => { + const fixtureDir = 'find/a'; + const relativeTS = relFixture(`${fixtureDir}/node_modules/some-lib/src/foo.ts`); + const absoluteTS = absFixture(`${fixtureDir}/node_modules/some-lib/src/foo.ts`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + for (const input of inputs) { + expect(await findNative(input, { ignoreNodeModules: true }), `input: ${input}`).toBe(null); + } + }); + + it('should ignore files in node_modules directory with ignoreNodeModules=true and configName=jsconfig.json', async () => { + const fixtureDir = 'find/a'; + const relativeTS = relFixture(`${fixtureDir}/node_modules/some-js-lib/src/foo.js`); + const absoluteTS = absFixture(`${fixtureDir}/node_modules/some-js-lib/src/foo.js`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + for (const input of inputs) { + expect( + await findNative(input, { ignoreNodeModules: true, configName: 'jsconfig.json' }), + `input: ${input}` + ).toBe(null); + } + }); + + it('should find tsconfig in node_modules', async () => { + const fixtureDir = 'find/a'; + const expected = posixAbsFix(`${fixtureDir}/node_modules/some-lib/tsconfig.json`); + const relativeTS = relFixture(`${fixtureDir}/node_modules/some-lib/src/foo.ts`); + const absoluteTS = absFixture(`${fixtureDir}/node_modules/some-lib/src/foo.ts`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + for (const input of inputs) { + expect(await findNative(input), `input: ${input}`).toBe(expected); + } + }); + + it('should find jsconfig in node_modules with configName=jsconfig.json', async () => { + const fixtureDir = 'find/a'; + const expected = posixAbsFix(`${fixtureDir}/node_modules/some-js-lib/jsconfig.json`); + const relativeTS = relFixture(`${fixtureDir}/node_modules/some-js-lib/src/foo.js`); + const absoluteTS = absFixture(`${fixtureDir}/node_modules/some-js-lib/src/foo.js`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + for (const input of inputs) { + expect(await findNative(input, { configName: 'jsconfig.json' }), `input: ${input}`).toBe( + expected + ); + } + }); + + it('should stop searching at root', async () => { + const fixtureDir = 'find-root/a'; + const relativeTS = relFixture(`${fixtureDir}/b/foo.ts`); + const absoluteTS = absFixture(`${fixtureDir}/b/foo.ts`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + + for (const input of inputs) { + expect(await findNative(input, { root: absFixture(fixtureDir) })).toBe(null); + } + }); + + it('should use provided cache', async () => { + const fixtureDir = 'find-root'; + const relativeTS = relFixture(`${fixtureDir}/a/b/foo.ts`); + const absoluteTS = absFixture(`${fixtureDir}/a/b/foo.ts`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + const real = absFixture(`${fixtureDir}/tsconfig.json`); + const expected = native2posix(real); + const cache = new TSConfckCache(); + for (const input of inputs) { + expect(await findNative(input, { cache }), `input: ${input}`).toBe(expected); + } + const dir = native2posix(path.dirname(absoluteTS)); + expect(cache.hasConfigPath(dir)).toBe(true); + expect(await cache.getConfigPath(dir)).toBe(expected); + const parent = native2posix(path.dirname(dir)); + expect(cache.hasConfigPath(parent)).toBe(true); + expect(await cache.getConfigPath(parent)).toBe(expected); + const root = native2posix(path.dirname(real)); + expect(cache.hasConfigPath(root)).toBe(true); + expect(await cache.getConfigPath(root)).toBe(expected); + [dir, parent, root].forEach((d) => { + cache.setConfigPath(d, Promise.resolve('fake')); + }); + for (const input of inputs) { + expect(await findNative(input, { cache }), `input: ${input}`).toBe('fake'); + } + }); + + it('should return null when no tsconfig file was found', async () => { + const doesntExist = path.resolve(os.homedir(), '..', 'foo.ts'); // outside of user home there should not be a tsconfig + expect(await findNative(doesntExist)).toBe(null); + }); + + it('should cache and return null when no tsconfig file was found', async () => { + const doesntExist = native2posix(path.resolve(os.homedir(), '..', 'foo.ts')); // outside of user home there should not be a tsconfig + const cache = new TSConfckCache(); + expect(await findNative(doesntExist, { cache })).toBe(null); + const parent = native2posix(path.dirname(doesntExist)); + expect(cache.hasConfigPath(parent)).toBe(true); + expect(await cache.getConfigPath(parent)).toBe(null); + expect(await findNative(doesntExist, { cache })).toBe(null); + }); + + it('should work with different configNames in the same cache', async () => { + const fixtureDir = 'find/a'; + const jsFile = relFixture(`${fixtureDir}/b/c/y.js`); + const expectedJSConfig = posixAbsFix(`${fixtureDir}/b/c/jsconfig.json`); + const tsFile = relFixture(`${fixtureDir}/b/c/x.ts`); + const expectedTSConfig = posixAbsFix(`${fixtureDir}/tsconfig.json`); + const cache = new TSConfckCache(); + const actualJSConfig = await findNative(jsFile, { cache, configName: 'jsconfig.json' }); + const actualTSConfig = await findNative(tsFile, { cache }); + expect(actualJSConfig).toBe(expectedJSConfig); + expect(actualTSConfig).toBe(expectedTSConfig); + expect(cache.getConfigPath(posixAbsFix(`${fixtureDir}`))).toBe(expectedTSConfig); + expect(cache.getConfigPath(posixAbsFix(`${fixtureDir}/b`))).toBe(expectedTSConfig); + expect(cache.getConfigPath(posixAbsFix(`${fixtureDir}/b/c`))).toBe(expectedTSConfig); + expect(cache.getConfigPath(posixAbsFix(`${fixtureDir}`), 'jsconfig.json')).toBe(undefined); + expect(cache.getConfigPath(posixAbsFix(`${fixtureDir}/b`), 'jsconfig.json')).toBe(undefined); + expect(cache.getConfigPath(posixAbsFix(`${fixtureDir}/b/c`), 'jsconfig.json')).toBe( + expectedJSConfig + ); + }); +}); diff --git a/packages/tsconfck/tests/find.js b/packages/tsconfck/tests/find.js new file mode 100644 index 0000000..392b6dc --- /dev/null +++ b/packages/tsconfck/tests/find.js @@ -0,0 +1,194 @@ +import { describe, it, expect } from 'vitest'; +import path from 'node:path'; +import os from 'os'; +import { find } from '../src/find.js'; +import { absFixture, absRoot, relFixture } from './util/fixture-paths.js'; +import { TSConfckCache } from '../src/cache.js'; + +describe('find', () => { + it('should be a function', () => { + expect(find).toBeTypeOf('function'); + }); + + it('should return a Promise', () => { + expect(find('str')).toBeInstanceOf(Promise); + }); + + it('should reject for invalid filename arg', async () => { + for (const filename of [{}, [], 0, null, undefined]) { + await expect(find(filename), `filename type: ${typeof filename}`).rejects.toThrow(); + } + await expect(find(), 'no filename arg').rejects.toThrow(); + await expect(find('str'), `filename string arg`).resolves.toEqual(absRoot('tsconfig.json')); + }); + + it('should find tsconfig in same directory', async () => { + const fixtureDir = 'find/a'; + const expected = absFixture(`${fixtureDir}/tsconfig.json`); + const relativeTS = relFixture(`${fixtureDir}/foo.ts`); + const absoluteTS = absFixture(`${fixtureDir}/foo.ts`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + for (const input of inputs) { + expect(await find(input), `input: ${input}`).toBe(expected); + } + }); + + it('should find tsconfig in parent directory', async () => { + const fixtureDir = 'find/a'; + const expected = absFixture(`${fixtureDir}/tsconfig.json`); + const relativeTS = relFixture(`${fixtureDir}/b/foo.ts`); + const absoluteTS = absFixture(`${fixtureDir}/b/foo.ts`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + for (const input of inputs) { + expect(await find(input), `input: ${input}`).toBe(expected); + } + }); + + it('should find jsconfig with configName=jsconfig.json', async () => { + const fixtureDir = 'find/a/b/c'; + const expected = absFixture(`${fixtureDir}/jsconfig.json`); + const relativeTS = relFixture(`${fixtureDir}/y.js`); + const absoluteTS = absFixture(`${fixtureDir}/y.js`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + for (const input of inputs) { + expect(await find(input, { configName: 'jsconfig.json' }), `input: ${input}`).toBe(expected); + } + }); + + it('should find jsconfig in parent directory with configName=jsconfig.json', async () => { + const fixtureDir = 'find/a'; + const expected = absFixture(`${fixtureDir}/jsconfig.json`); + const relativeTS = relFixture(`${fixtureDir}/b/qoox.js`); + const absoluteTS = absFixture(`${fixtureDir}/b/qoox.js`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + for (const input of inputs) { + expect(await find(input, { configName: 'jsconfig.json' }), `input: ${input}`).toBe(expected); + } + }); + + it('should ignore jsconfig without configName=jsconfig.json', async () => { + const fixtureDir = 'find/a/b/c'; + const expected = absFixture(`find/a/tsconfig.json`); + const relativeTS = relFixture(`${fixtureDir}/x.ts`); + const absoluteTS = absFixture(`${fixtureDir}/x.ts`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + for (const input of inputs) { + expect(await find(input), `input: ${input}`).toBe(expected); + } + }); + + it('should ignore files in node_modules directory with ignoreNodeModules=true', async () => { + const fixtureDir = 'find/a'; + const relativeTS = relFixture(`${fixtureDir}/node_modules/some-lib/src/foo.ts`); + const absoluteTS = absFixture(`${fixtureDir}/node_modules/some-lib/src/foo.ts`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + for (const input of inputs) { + expect(await find(input, { ignoreNodeModules: true }), `input: ${input}`).toBe(null); + } + }); + + it('should ignore files in node_modules directory with ignoreNodeModules=true and configName=jsconfig.json', async () => { + const fixtureDir = 'find/a'; + const relativeTS = relFixture(`${fixtureDir}/node_modules/some-js-lib/src/foo.js`); + const absoluteTS = absFixture(`${fixtureDir}/node_modules/some-js-lib/src/foo.js`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + for (const input of inputs) { + expect( + await find(input, { ignoreNodeModules: true, configName: 'jsconfig.json' }), + `input: ${input}` + ).toBe(null); + } + }); + + it('should find tsconfig in node_modules', async () => { + const fixtureDir = 'find/a'; + const expected = absFixture(`${fixtureDir}/node_modules/some-lib/tsconfig.json`); + const relativeTS = relFixture(`${fixtureDir}/node_modules/some-lib/src/foo.ts`); + const absoluteTS = absFixture(`${fixtureDir}/node_modules/some-lib/src/foo.ts`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + for (const input of inputs) { + expect(await find(input), `input: ${input}`).toBe(expected); + } + }); + + it('should find jsconfig in node_modules with configName=jsconfig.json', async () => { + const fixtureDir = 'find/a'; + const expected = absFixture(`${fixtureDir}/node_modules/some-js-lib/jsconfig.json`); + const relativeTS = relFixture(`${fixtureDir}/node_modules/some-js-lib/src/foo.js`); + const absoluteTS = absFixture(`${fixtureDir}/node_modules/some-js-lib/src/foo.js`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + for (const input of inputs) { + expect(await find(input, { configName: 'jsconfig.json' }), `input: ${input}`).toBe(expected); + } + }); + + it('should stop searching at root', async () => { + const fixtureDir = 'find-root/a'; + const relativeTS = relFixture(`${fixtureDir}/b/foo.ts`); + const absoluteTS = absFixture(`${fixtureDir}/b/foo.ts`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + + for (const input of inputs) { + expect(await find(input, { root: absFixture(fixtureDir) })).toBe(null); + } + for (const input of inputs) { + expect(await find(input, { root: relFixture(fixtureDir) })).toBe(null); + } + }); + + it('should use provided cache', async () => { + const fixtureDir = 'find-root'; + const relativeTS = relFixture(`${fixtureDir}/a/b/foo.ts`); + const absoluteTS = absFixture(`${fixtureDir}/a/b/foo.ts`); + const inputs = [relativeTS, `./${relativeTS}`, absoluteTS]; + const real = absFixture(`${fixtureDir}/tsconfig.json`); + const fake = absFixture(`${fixtureDir}/a/tsconfig.json`); + + const cache = new TSConfckCache(); + cache.setConfigPath(path.dirname(fake), Promise.resolve(fake)); + + for (const input of inputs) { + expect(await find(input), `input: ${input}`).toBe(real); + expect(await find(input, { cache }), `input: ${input}`).toBe(fake); + } + const added_key = path.dirname(absoluteTS); + expect(cache.hasConfigPath(added_key)).toBe(true); + expect(await cache.getConfigPath(added_key)).toBe(fake); + }); + + it('should return null when no tsconfig file was found', async () => { + const doesntExist = path.resolve(os.homedir(), '..', 'foo.ts'); // outside of user home there should not be a tsconfig + expect(await find(doesntExist)).toBe(null); + }); + + it('should cache and return null when no tsconfig file was found', async () => { + const doesntExist = path.resolve(os.homedir(), '..', 'foo.ts'); // outside of user home there should not be a tsconfig + const cache = new TSConfckCache(); + expect(await find(doesntExist, { cache })).toBe(null); + const parent = path.dirname(doesntExist); + expect(cache.hasConfigPath(parent)).toBe(true); + expect(await cache.getConfigPath(parent)).toBe(null); + expect(await find(doesntExist, { cache })).toBe(null); + }); + + it('should work with different configNames in the same cache', async () => { + const fixtureDir = 'find/a'; + const jsFile = relFixture(`${fixtureDir}/b/c/y.js`); + const expectedJSConfig = absFixture(`${fixtureDir}/b/c/jsconfig.json`); + const tsFile = relFixture(`${fixtureDir}/b/c/x.ts`); + const expectedTSConfig = absFixture(`${fixtureDir}/tsconfig.json`); + const cache = new TSConfckCache(); + const actualJSConfig = await find(jsFile, { cache, configName: 'jsconfig.json' }); + const actualTSConfig = await find(tsFile, { cache }); + expect(actualJSConfig).toBe(expectedJSConfig); + expect(actualTSConfig).toBe(expectedTSConfig); + expect(cache.getConfigPath(absFixture(`${fixtureDir}`))).toBe(expectedTSConfig); + expect(cache.getConfigPath(absFixture(`${fixtureDir}/b`))).toBe(expectedTSConfig); + expect(cache.getConfigPath(absFixture(`${fixtureDir}/b/c`))).toBe(expectedTSConfig); + expect(cache.getConfigPath(absFixture(`${fixtureDir}`), 'jsconfig.json')).toBe(undefined); + expect(cache.getConfigPath(absFixture(`${fixtureDir}/b`), 'jsconfig.json')).toBe(undefined); + expect(cache.getConfigPath(absFixture(`${fixtureDir}/b/c`), 'jsconfig.json')).toBe( + expectedJSConfig + ); + }); +}); diff --git a/tests/fixtures/.editorconfig b/packages/tsconfck/tests/fixtures/.editorconfig similarity index 100% rename from tests/fixtures/.editorconfig rename to packages/tsconfck/tests/fixtures/.editorconfig diff --git a/tests/fixtures/find-all/inaccessible-dir/.gitignore b/packages/tsconfck/tests/fixtures/find-all/inaccessible-dir/.gitignore similarity index 100% rename from tests/fixtures/find-all/inaccessible-dir/.gitignore rename to packages/tsconfck/tests/fixtures/find-all/inaccessible-dir/.gitignore diff --git a/tests/fixtures/find-all/inaccessible-dir/tsconfig.json b/packages/tsconfck/tests/fixtures/find-all/inaccessible-dir/tsconfig.json similarity index 100% rename from tests/fixtures/find-all/inaccessible-dir/tsconfig.json rename to packages/tsconfck/tests/fixtures/find-all/inaccessible-dir/tsconfig.json diff --git a/tests/fixtures/find-all/multiple/a/tsconfig.json b/packages/tsconfck/tests/fixtures/find-all/multiple/a/tsconfig.json similarity index 100% rename from tests/fixtures/find-all/multiple/a/tsconfig.json rename to packages/tsconfck/tests/fixtures/find-all/multiple/a/tsconfig.json diff --git a/tests/fixtures/find-all/multiple/b/tsconfig.json b/packages/tsconfck/tests/fixtures/find-all/multiple/b/tsconfig.json similarity index 100% rename from tests/fixtures/find-all/multiple/b/tsconfig.json rename to packages/tsconfck/tests/fixtures/find-all/multiple/b/tsconfig.json diff --git a/tests/fixtures/find-all/multiple/c/d/tsconfig.json b/packages/tsconfck/tests/fixtures/find-all/multiple/c/d/jsconfig.json similarity index 100% rename from tests/fixtures/find-all/multiple/c/d/tsconfig.json rename to packages/tsconfck/tests/fixtures/find-all/multiple/c/d/jsconfig.json diff --git a/tests/fixtures/find-all/multiple/tsconfig.json b/packages/tsconfck/tests/fixtures/find-all/multiple/c/d/tsconfig.json similarity index 100% rename from tests/fixtures/find-all/multiple/tsconfig.json rename to packages/tsconfck/tests/fixtures/find-all/multiple/c/d/tsconfig.json diff --git a/tests/fixtures/find-all/recursive-symlink/child/tsconfig.json b/packages/tsconfck/tests/fixtures/find-all/multiple/e/jsconfig.json similarity index 100% rename from tests/fixtures/find-all/recursive-symlink/child/tsconfig.json rename to packages/tsconfck/tests/fixtures/find-all/multiple/e/jsconfig.json diff --git a/tests/fixtures/find-all/recursive-symlink/tsconfig.json b/packages/tsconfck/tests/fixtures/find-all/multiple/tsconfig.json similarity index 100% rename from tests/fixtures/find-all/recursive-symlink/tsconfig.json rename to packages/tsconfck/tests/fixtures/find-all/multiple/tsconfig.json diff --git a/tests/fixtures/find-all/recursive-symlink/child/parent b/packages/tsconfck/tests/fixtures/find-all/recursive-symlink/child/parent similarity index 100% rename from tests/fixtures/find-all/recursive-symlink/child/parent rename to packages/tsconfck/tests/fixtures/find-all/recursive-symlink/child/parent diff --git a/tests/fixtures/find-root/tsconfig.json b/packages/tsconfck/tests/fixtures/find-all/recursive-symlink/child/tsconfig.json similarity index 100% rename from tests/fixtures/find-root/tsconfig.json rename to packages/tsconfck/tests/fixtures/find-all/recursive-symlink/child/tsconfig.json diff --git a/tests/fixtures/parse/valid/empty/tsconfig.json b/packages/tsconfck/tests/fixtures/find-all/recursive-symlink/tsconfig.json similarity index 100% rename from tests/fixtures/parse/valid/empty/tsconfig.json rename to packages/tsconfck/tests/fixtures/find-all/recursive-symlink/tsconfig.json diff --git a/tests/fixtures/find-root/a/b/foo.ts b/packages/tsconfck/tests/fixtures/find-root/a/b/foo.ts similarity index 100% rename from tests/fixtures/find-root/a/b/foo.ts rename to packages/tsconfck/tests/fixtures/find-root/a/b/foo.ts diff --git a/packages/tsconfck/tests/fixtures/find-root/tsconfig.json b/packages/tsconfck/tests/fixtures/find-root/tsconfig.json new file mode 100644 index 0000000..e69de29 diff --git a/packages/tsconfck/tests/fixtures/find/a/.gitignore b/packages/tsconfck/tests/fixtures/find/a/.gitignore new file mode 100644 index 0000000..cf4bab9 --- /dev/null +++ b/packages/tsconfck/tests/fixtures/find/a/.gitignore @@ -0,0 +1 @@ +!node_modules diff --git a/tests/fixtures/find/a/b/bar.ts b/packages/tsconfck/tests/fixtures/find/a/b/bar.ts similarity index 100% rename from tests/fixtures/find/a/b/bar.ts rename to packages/tsconfck/tests/fixtures/find/a/b/bar.ts diff --git a/packages/tsconfck/tests/fixtures/find/a/b/c/jsconfig.json b/packages/tsconfck/tests/fixtures/find/a/b/c/jsconfig.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/packages/tsconfck/tests/fixtures/find/a/b/c/jsconfig.json @@ -0,0 +1 @@ +{} diff --git a/packages/tsconfck/tests/fixtures/find/a/b/c/x.ts b/packages/tsconfck/tests/fixtures/find/a/b/c/x.ts new file mode 100644 index 0000000..e69de29 diff --git a/packages/tsconfck/tests/fixtures/find/a/b/c/y.js b/packages/tsconfck/tests/fixtures/find/a/b/c/y.js new file mode 100644 index 0000000..e69de29 diff --git a/packages/tsconfck/tests/fixtures/find/a/b/qoox.js b/packages/tsconfck/tests/fixtures/find/a/b/qoox.js new file mode 100644 index 0000000..a215de8 --- /dev/null +++ b/packages/tsconfck/tests/fixtures/find/a/b/qoox.js @@ -0,0 +1 @@ +export const qoox = "qoox"; diff --git a/packages/tsconfck/tests/fixtures/find/a/baz.js b/packages/tsconfck/tests/fixtures/find/a/baz.js new file mode 100644 index 0000000..6061cf0 --- /dev/null +++ b/packages/tsconfck/tests/fixtures/find/a/baz.js @@ -0,0 +1 @@ +export const baz = 'baz'; diff --git a/tests/fixtures/find/a/foo.ts b/packages/tsconfck/tests/fixtures/find/a/foo.ts similarity index 100% rename from tests/fixtures/find/a/foo.ts rename to packages/tsconfck/tests/fixtures/find/a/foo.ts diff --git a/packages/tsconfck/tests/fixtures/find/a/jsconfig.json b/packages/tsconfck/tests/fixtures/find/a/jsconfig.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/packages/tsconfck/tests/fixtures/find/a/jsconfig.json @@ -0,0 +1 @@ +{} diff --git a/packages/tsconfck/tests/fixtures/find/a/node_modules/some-js-lib/jsconfig.json b/packages/tsconfck/tests/fixtures/find/a/node_modules/some-js-lib/jsconfig.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/packages/tsconfck/tests/fixtures/find/a/node_modules/some-js-lib/jsconfig.json @@ -0,0 +1 @@ +{} diff --git a/packages/tsconfck/tests/fixtures/find/a/node_modules/some-js-lib/src/foo.js b/packages/tsconfck/tests/fixtures/find/a/node_modules/some-js-lib/src/foo.js new file mode 100644 index 0000000..e69de29 diff --git a/packages/tsconfck/tests/fixtures/find/a/node_modules/some-lib/src/foo.ts b/packages/tsconfck/tests/fixtures/find/a/node_modules/some-lib/src/foo.ts new file mode 100644 index 0000000..e69de29 diff --git a/packages/tsconfck/tests/fixtures/find/a/node_modules/some-lib/tsconfig.json b/packages/tsconfck/tests/fixtures/find/a/node_modules/some-lib/tsconfig.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/packages/tsconfck/tests/fixtures/find/a/node_modules/some-lib/tsconfig.json @@ -0,0 +1 @@ +{} diff --git a/packages/tsconfck/tests/fixtures/find/a/node_modules/tsconfig.json b/packages/tsconfck/tests/fixtures/find/a/node_modules/tsconfig.json new file mode 100644 index 0000000..e69de29 diff --git a/packages/tsconfck/tests/fixtures/find/a/tsconfig.json b/packages/tsconfck/tests/fixtures/find/a/tsconfig.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/packages/tsconfck/tests/fixtures/find/a/tsconfig.json @@ -0,0 +1 @@ +{} diff --git a/tests/fixtures/parse/invalid/bom/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/invalid/bom/tsconfig.json similarity index 100% rename from tests/fixtures/parse/invalid/bom/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/invalid/bom/tsconfig.json diff --git a/tests/fixtures/parse/invalid/comma/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/invalid/comma/tsconfig.json similarity index 100% rename from tests/fixtures/parse/invalid/comma/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/invalid/comma/tsconfig.json diff --git a/tests/fixtures/parse/invalid/comments/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/invalid/comments/tsconfig.json similarity index 100% rename from tests/fixtures/parse/invalid/comments/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/invalid/comments/tsconfig.json diff --git a/tests/fixtures/parse/invalid/extends-array-circular/src/foo.ts b/packages/tsconfck/tests/fixtures/parse/invalid/extends-array-circular/src/foo.ts similarity index 100% rename from tests/fixtures/parse/invalid/extends-array-circular/src/foo.ts rename to packages/tsconfck/tests/fixtures/parse/invalid/extends-array-circular/src/foo.ts diff --git a/tests/fixtures/parse/invalid/extends-array-circular/tsconfig.a.b.json b/packages/tsconfck/tests/fixtures/parse/invalid/extends-array-circular/tsconfig.a.b.json similarity index 100% rename from tests/fixtures/parse/invalid/extends-array-circular/tsconfig.a.b.json rename to packages/tsconfck/tests/fixtures/parse/invalid/extends-array-circular/tsconfig.a.b.json diff --git a/tests/fixtures/parse/invalid/extends-array-circular/tsconfig.a.json b/packages/tsconfck/tests/fixtures/parse/invalid/extends-array-circular/tsconfig.a.json similarity index 100% rename from tests/fixtures/parse/invalid/extends-array-circular/tsconfig.a.json rename to packages/tsconfck/tests/fixtures/parse/invalid/extends-array-circular/tsconfig.a.json diff --git a/tests/fixtures/parse/invalid/extends-array-circular/tsconfig.b.json b/packages/tsconfck/tests/fixtures/parse/invalid/extends-array-circular/tsconfig.b.json similarity index 100% rename from tests/fixtures/parse/invalid/extends-array-circular/tsconfig.b.json rename to packages/tsconfck/tests/fixtures/parse/invalid/extends-array-circular/tsconfig.b.json diff --git a/tests/fixtures/parse/invalid/extends-array-circular/tsconfig.c.json b/packages/tsconfck/tests/fixtures/parse/invalid/extends-array-circular/tsconfig.c.json similarity index 100% rename from tests/fixtures/parse/invalid/extends-array-circular/tsconfig.c.json rename to packages/tsconfck/tests/fixtures/parse/invalid/extends-array-circular/tsconfig.c.json diff --git a/tests/fixtures/parse/invalid/extends-array-circular/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/invalid/extends-array-circular/tsconfig.json similarity index 100% rename from tests/fixtures/parse/invalid/extends-array-circular/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/invalid/extends-array-circular/tsconfig.json diff --git a/tests/fixtures/parse/invalid/extends-circular/deep/tsconfig.circular2.json b/packages/tsconfck/tests/fixtures/parse/invalid/extends-circular/deep/tsconfig.circular2.json similarity index 100% rename from tests/fixtures/parse/invalid/extends-circular/deep/tsconfig.circular2.json rename to packages/tsconfck/tests/fixtures/parse/invalid/extends-circular/deep/tsconfig.circular2.json diff --git a/tests/fixtures/parse/invalid/extends-circular/tsconfig.circular.json b/packages/tsconfck/tests/fixtures/parse/invalid/extends-circular/tsconfig.circular.json similarity index 100% rename from tests/fixtures/parse/invalid/extends-circular/tsconfig.circular.json rename to packages/tsconfck/tests/fixtures/parse/invalid/extends-circular/tsconfig.circular.json diff --git a/tests/fixtures/parse/invalid/extends-circular/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/invalid/extends-circular/tsconfig.json similarity index 100% rename from tests/fixtures/parse/invalid/extends-circular/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/invalid/extends-circular/tsconfig.json diff --git a/tests/fixtures/parse/invalid/extends-fallback-not-found/dir/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/invalid/extends-fallback-not-found/dir/tsconfig.json similarity index 100% rename from tests/fixtures/parse/invalid/extends-fallback-not-found/dir/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/invalid/extends-fallback-not-found/dir/tsconfig.json diff --git a/tests/fixtures/parse/invalid/extends-fallback-not-found/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/invalid/extends-fallback-not-found/tsconfig.json similarity index 100% rename from tests/fixtures/parse/invalid/extends-fallback-not-found/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/invalid/extends-fallback-not-found/tsconfig.json diff --git a/tests/fixtures/parse/invalid/extends-not-found/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/invalid/extends-not-found/tsconfig.json similarity index 100% rename from tests/fixtures/parse/invalid/extends-not-found/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/invalid/extends-not-found/tsconfig.json diff --git a/tests/fixtures/parse/invalid/mixed/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/invalid/mixed/tsconfig.json similarity index 100% rename from tests/fixtures/parse/invalid/mixed/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/invalid/mixed/tsconfig.json diff --git a/packages/tsconfck/tests/fixtures/parse/invalid/tsconfig.json/.gitkeep b/packages/tsconfck/tests/fixtures/parse/invalid/tsconfig.json/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/fixtures/parse/solution/mixed/tsconfig.base.json.expected.json b/packages/tsconfck/tests/fixtures/parse/solution/jsconfig/jsconfig.base.json similarity index 50% rename from tests/fixtures/parse/solution/mixed/tsconfig.base.json.expected.json rename to packages/tsconfck/tests/fixtures/parse/solution/jsconfig/jsconfig.base.json index 39e4936..b47146f 100644 --- a/tests/fixtures/parse/solution/mixed/tsconfig.base.json.expected.json +++ b/packages/tsconfck/tests/fixtures/parse/solution/jsconfig/jsconfig.base.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "allowJs": true, //must be true so that js extensions are globbed correctly "composite": true, "strictNullChecks": true } diff --git a/packages/tsconfck/tests/fixtures/parse/solution/jsconfig/jsconfig.json b/packages/tsconfck/tests/fixtures/parse/solution/jsconfig/jsconfig.json new file mode 100644 index 0000000..74ddb41 --- /dev/null +++ b/packages/tsconfck/tests/fixtures/parse/solution/jsconfig/jsconfig.json @@ -0,0 +1,8 @@ +{ + "files": [], + "include": [], + "references": [ + {"path": "./jsconfig.src.json"}, + {"path": "./jsconfig.test.json"} + ] +} diff --git a/packages/tsconfck/tests/fixtures/parse/solution/jsconfig/jsconfig.src.json b/packages/tsconfck/tests/fixtures/parse/solution/jsconfig/jsconfig.src.json new file mode 100644 index 0000000..4ccf852 --- /dev/null +++ b/packages/tsconfck/tests/fixtures/parse/solution/jsconfig/jsconfig.src.json @@ -0,0 +1,8 @@ +{ + "extends": "./jsconfig.base", + "include": ["src/**/*"], + "exclude": ["src/**/*.spec.js"], + "compilerOptions": { + "strict": true + } +} diff --git a/packages/tsconfck/tests/fixtures/parse/solution/jsconfig/jsconfig.test.json b/packages/tsconfck/tests/fixtures/parse/solution/jsconfig/jsconfig.test.json new file mode 100644 index 0000000..414d5ef --- /dev/null +++ b/packages/tsconfck/tests/fixtures/parse/solution/jsconfig/jsconfig.test.json @@ -0,0 +1,7 @@ +{ + "extends": "./jsconfig.base", + "include": ["src/**/*.spec.js"], + "compilerOptions": { + "strict": false + } +} diff --git a/tests/fixtures/parse/solution/mixed/src/bar.mts b/packages/tsconfck/tests/fixtures/parse/solution/jsconfig/src/bar.mjs similarity index 100% rename from tests/fixtures/parse/solution/mixed/src/bar.mts rename to packages/tsconfck/tests/fixtures/parse/solution/jsconfig/src/bar.mjs diff --git a/tests/fixtures/parse/solution/mixed/src/baz.cts b/packages/tsconfck/tests/fixtures/parse/solution/jsconfig/src/baz.cjs similarity index 100% rename from tests/fixtures/parse/solution/mixed/src/baz.cts rename to packages/tsconfck/tests/fixtures/parse/solution/jsconfig/src/baz.cjs diff --git a/tests/fixtures/parse/solution/mixed/src/foo.ts b/packages/tsconfck/tests/fixtures/parse/solution/jsconfig/src/foo.js similarity index 100% rename from tests/fixtures/parse/solution/mixed/src/foo.ts rename to packages/tsconfck/tests/fixtures/parse/solution/jsconfig/src/foo.js diff --git a/packages/tsconfck/tests/fixtures/parse/solution/jsconfig/src/foo.spec.js b/packages/tsconfck/tests/fixtures/parse/solution/jsconfig/src/foo.spec.js new file mode 100644 index 0000000..e400a53 --- /dev/null +++ b/packages/tsconfck/tests/fixtures/parse/solution/jsconfig/src/foo.spec.js @@ -0,0 +1,9 @@ +import { foo } from './foo.js'; +import * as assert from 'assert'; + +function test() { + const actual = foo(); + const expected = 'foo'; + assert.strictEqual(actual, expected); +} +test(); diff --git a/packages/tsconfck/tests/fixtures/parse/solution/mixed/src/bar.mts b/packages/tsconfck/tests/fixtures/parse/solution/mixed/src/bar.mts new file mode 100644 index 0000000..808dbfe --- /dev/null +++ b/packages/tsconfck/tests/fixtures/parse/solution/mixed/src/bar.mts @@ -0,0 +1,3 @@ +export function bar() { + return 'bar'; +} diff --git a/packages/tsconfck/tests/fixtures/parse/solution/mixed/src/baz.cts b/packages/tsconfck/tests/fixtures/parse/solution/mixed/src/baz.cts new file mode 100644 index 0000000..0753644 --- /dev/null +++ b/packages/tsconfck/tests/fixtures/parse/solution/mixed/src/baz.cts @@ -0,0 +1,4 @@ +function baz() { + return 'baz'; +} +module.exports = {baz} diff --git a/tests/fixtures/parse/solution/mixed/src/foo.spec.ts b/packages/tsconfck/tests/fixtures/parse/solution/mixed/src/foo.spec.ts similarity index 82% rename from tests/fixtures/parse/solution/mixed/src/foo.spec.ts rename to packages/tsconfck/tests/fixtures/parse/solution/mixed/src/foo.spec.ts index fd30bba..e400a53 100644 --- a/tests/fixtures/parse/solution/mixed/src/foo.spec.ts +++ b/packages/tsconfck/tests/fixtures/parse/solution/mixed/src/foo.spec.ts @@ -1,4 +1,4 @@ -import { foo } from './foo'; +import { foo } from './foo.js'; import * as assert from 'assert'; function test() { diff --git a/tests/fixtures/parse/solution/simple/src/foo.ts b/packages/tsconfck/tests/fixtures/parse/solution/mixed/src/foo.ts similarity index 100% rename from tests/fixtures/parse/solution/simple/src/foo.ts rename to packages/tsconfck/tests/fixtures/parse/solution/mixed/src/foo.ts diff --git a/tests/fixtures/parse/solution/mixed/tsconfig.base.json b/packages/tsconfck/tests/fixtures/parse/solution/mixed/tsconfig.base.json similarity index 100% rename from tests/fixtures/parse/solution/mixed/tsconfig.base.json rename to packages/tsconfck/tests/fixtures/parse/solution/mixed/tsconfig.base.json diff --git a/tests/fixtures/parse/solution/mixed/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/solution/mixed/tsconfig.json similarity index 100% rename from tests/fixtures/parse/solution/mixed/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/solution/mixed/tsconfig.json diff --git a/tests/fixtures/parse/solution/mixed/tsconfig.src.json b/packages/tsconfck/tests/fixtures/parse/solution/mixed/tsconfig.src.json similarity index 100% rename from tests/fixtures/parse/solution/mixed/tsconfig.src.json rename to packages/tsconfck/tests/fixtures/parse/solution/mixed/tsconfig.src.json diff --git a/tests/fixtures/parse/solution/mixed/tsconfig.test.json b/packages/tsconfck/tests/fixtures/parse/solution/mixed/tsconfig.test.json similarity index 100% rename from tests/fixtures/parse/solution/mixed/tsconfig.test.json rename to packages/tsconfck/tests/fixtures/parse/solution/mixed/tsconfig.test.json diff --git a/packages/tsconfck/tests/fixtures/parse/solution/simple/src/foo.ts b/packages/tsconfck/tests/fixtures/parse/solution/simple/src/foo.ts new file mode 100644 index 0000000..b071191 --- /dev/null +++ b/packages/tsconfck/tests/fixtures/parse/solution/simple/src/foo.ts @@ -0,0 +1,3 @@ +export function foo() { + return 'foo'; +} diff --git a/tests/fixtures/parse/solution/simple/src/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/solution/simple/src/tsconfig.json similarity index 100% rename from tests/fixtures/parse/solution/simple/src/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/solution/simple/src/tsconfig.json diff --git a/tests/fixtures/parse/solution/simple/tests/foo.ts b/packages/tsconfck/tests/fixtures/parse/solution/simple/tests/foo.ts similarity index 100% rename from tests/fixtures/parse/solution/simple/tests/foo.ts rename to packages/tsconfck/tests/fixtures/parse/solution/simple/tests/foo.ts diff --git a/tests/fixtures/parse/solution/simple/tests/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/solution/simple/tests/tsconfig.json similarity index 100% rename from tests/fixtures/parse/solution/simple/tests/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/solution/simple/tests/tsconfig.json diff --git a/tests/fixtures/parse/solution/simple/tsconfig.base.json b/packages/tsconfck/tests/fixtures/parse/solution/simple/tsconfig.base.json similarity index 100% rename from tests/fixtures/parse/solution/simple/tsconfig.base.json rename to packages/tsconfck/tests/fixtures/parse/solution/simple/tsconfig.base.json diff --git a/tests/fixtures/parse/solution/simple/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/solution/simple/tsconfig.json similarity index 100% rename from tests/fixtures/parse/solution/simple/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/solution/simple/tsconfig.json diff --git a/tests/fixtures/parse/valid/bom/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/bom/tsconfig.json similarity index 100% rename from tests/fixtures/parse/valid/bom/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/valid/bom/tsconfig.json diff --git a/tests/fixtures/parse/valid/comma/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/comma/tsconfig.json similarity index 100% rename from tests/fixtures/parse/valid/comma/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/valid/comma/tsconfig.json diff --git a/tests/fixtures/parse/valid/comments/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/comments/tsconfig.json similarity index 100% rename from tests/fixtures/parse/valid/comments/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/valid/comments/tsconfig.json diff --git a/packages/tsconfck/tests/fixtures/parse/valid/empty/jsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/empty/jsconfig.json new file mode 100644 index 0000000..e69de29 diff --git a/packages/tsconfck/tests/fixtures/parse/valid/empty/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/empty/tsconfig.json new file mode 100644 index 0000000..e69de29 diff --git a/packages/tsconfck/tests/fixtures/parse/valid/lib/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/lib/tsconfig.json new file mode 100644 index 0000000..9342e92 --- /dev/null +++ b/packages/tsconfck/tests/fixtures/parse/valid/lib/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "lib": [ + "ES2020", + "ES2021.Promise" + ] + } +} diff --git a/tests/fixtures/parse/valid/mixed/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/mixed/tsconfig.json similarity index 100% rename from tests/fixtures/parse/valid/mixed/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/valid/mixed/tsconfig.json diff --git a/tests/fixtures/parse/valid/moduleResolution/bundler/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/moduleResolution/bundler/tsconfig.json similarity index 100% rename from tests/fixtures/parse/valid/moduleResolution/bundler/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/valid/moduleResolution/bundler/tsconfig.json diff --git a/tests/fixtures/parse/valid/moduleResolution/classic/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/moduleResolution/classic/tsconfig.json similarity index 100% rename from tests/fixtures/parse/valid/moduleResolution/classic/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/valid/moduleResolution/classic/tsconfig.json diff --git a/tests/fixtures/parse/valid/moduleResolution/node16/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/moduleResolution/node16/tsconfig.json similarity index 100% rename from tests/fixtures/parse/valid/moduleResolution/node16/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/valid/moduleResolution/node16/tsconfig.json diff --git a/tests/fixtures/parse/valid/moduleResolution/nodenext/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/moduleResolution/nodenext/tsconfig.json similarity index 100% rename from tests/fixtures/parse/valid/moduleResolution/nodenext/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/valid/moduleResolution/nodenext/tsconfig.json diff --git a/tests/fixtures/parse/valid/regular/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/regular/tsconfig.json similarity index 100% rename from tests/fixtures/parse/valid/regular/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/valid/regular/tsconfig.json diff --git a/tests/fixtures/parse/valid/ts_node/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/ts_node/tsconfig.json similarity index 100% rename from tests/fixtures/parse/valid/ts_node/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/valid/ts_node/tsconfig.json diff --git a/tests/fixtures/parse/valid/with_extends/array/src/foo.ts b/packages/tsconfck/tests/fixtures/parse/valid/with_extends/array/src/foo.ts similarity index 100% rename from tests/fixtures/parse/valid/with_extends/array/src/foo.ts rename to packages/tsconfck/tests/fixtures/parse/valid/with_extends/array/src/foo.ts diff --git a/tests/fixtures/parse/valid/with_extends/array/tsconfig.a.b.json b/packages/tsconfck/tests/fixtures/parse/valid/with_extends/array/tsconfig.a.b.json similarity index 100% rename from tests/fixtures/parse/valid/with_extends/array/tsconfig.a.b.json rename to packages/tsconfck/tests/fixtures/parse/valid/with_extends/array/tsconfig.a.b.json diff --git a/tests/fixtures/parse/valid/with_extends/array/tsconfig.a.json b/packages/tsconfck/tests/fixtures/parse/valid/with_extends/array/tsconfig.a.json similarity index 100% rename from tests/fixtures/parse/valid/with_extends/array/tsconfig.a.json rename to packages/tsconfck/tests/fixtures/parse/valid/with_extends/array/tsconfig.a.json diff --git a/tests/fixtures/parse/valid/with_extends/array/tsconfig.b.json b/packages/tsconfck/tests/fixtures/parse/valid/with_extends/array/tsconfig.b.json similarity index 100% rename from tests/fixtures/parse/valid/with_extends/array/tsconfig.b.json rename to packages/tsconfck/tests/fixtures/parse/valid/with_extends/array/tsconfig.b.json diff --git a/tests/fixtures/parse/valid/with_extends/array/tsconfig.c.json b/packages/tsconfck/tests/fixtures/parse/valid/with_extends/array/tsconfig.c.json similarity index 100% rename from tests/fixtures/parse/valid/with_extends/array/tsconfig.c.json rename to packages/tsconfck/tests/fixtures/parse/valid/with_extends/array/tsconfig.c.json diff --git a/tests/fixtures/parse/valid/with_extends/array/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/with_extends/array/tsconfig.json similarity index 100% rename from tests/fixtures/parse/valid/with_extends/array/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/valid/with_extends/array/tsconfig.json diff --git a/tests/fixtures/parse/valid/with_extends/no_compileroptions/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/with_extends/no_compileroptions/tsconfig.json similarity index 100% rename from tests/fixtures/parse/valid/with_extends/no_compileroptions/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/valid/with_extends/no_compileroptions/tsconfig.json diff --git a/tests/fixtures/parse/valid/with_extends/node/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/with_extends/node/tsconfig.json similarity index 69% rename from tests/fixtures/parse/valid/with_extends/node/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/valid/with_extends/node/tsconfig.json index d640c1d..7e6625d 100644 --- a/tests/fixtures/parse/valid/with_extends/node/tsconfig.json +++ b/packages/tsconfck/tests/fixtures/parse/valid/with_extends/node/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@tsconfig/node14/tsconfig.json", + "extends": "@tsconfig/node18/tsconfig.json", "compilerOptions": { "types": ["foo"], "strictNullChecks": true diff --git a/tests/fixtures/parse/valid/with_extends/node_fallback/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/with_extends/node_fallback/tsconfig.json similarity index 76% rename from tests/fixtures/parse/valid/with_extends/node_fallback/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/valid/with_extends/node_fallback/tsconfig.json index efe5869..e9460d9 100644 --- a/tests/fixtures/parse/valid/with_extends/node_fallback/tsconfig.json +++ b/packages/tsconfck/tests/fixtures/parse/valid/with_extends/node_fallback/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@tsconfig/node14", + "extends": "@tsconfig/node18", "compilerOptions": { "types": ["foo"], "strictNullChecks": true diff --git a/tests/fixtures/parse/valid/with_extends/paths/lib/foo.ts b/packages/tsconfck/tests/fixtures/parse/valid/with_extends/paths/lib/foo.ts similarity index 100% rename from tests/fixtures/parse/valid/with_extends/paths/lib/foo.ts rename to packages/tsconfck/tests/fixtures/parse/valid/with_extends/paths/lib/foo.ts diff --git a/tests/fixtures/parse/valid/with_extends/paths/src/import-foo.ts b/packages/tsconfck/tests/fixtures/parse/valid/with_extends/paths/src/import-foo.ts similarity index 100% rename from tests/fixtures/parse/valid/with_extends/paths/src/import-foo.ts rename to packages/tsconfck/tests/fixtures/parse/valid/with_extends/paths/src/import-foo.ts diff --git a/tests/fixtures/parse/valid/with_extends/paths/src/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/with_extends/paths/src/tsconfig.json similarity index 100% rename from tests/fixtures/parse/valid/with_extends/paths/src/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/valid/with_extends/paths/src/tsconfig.json diff --git a/tests/fixtures/parse/valid/with_extends/paths/tsconfig.base.json b/packages/tsconfck/tests/fixtures/parse/valid/with_extends/paths/tsconfig.base.json similarity index 100% rename from tests/fixtures/parse/valid/with_extends/paths/tsconfig.base.json rename to packages/tsconfck/tests/fixtures/parse/valid/with_extends/paths/tsconfig.base.json diff --git a/tests/fixtures/parse/valid/with_extends/simple/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/with_extends/simple/tsconfig.json similarity index 100% rename from tests/fixtures/parse/valid/with_extends/simple/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/valid/with_extends/simple/tsconfig.json diff --git a/tests/fixtures/parse/valid/with_extends/tsconfig.parent.json b/packages/tsconfck/tests/fixtures/parse/valid/with_extends/tsconfig.parent.json similarity index 100% rename from tests/fixtures/parse/valid/with_extends/tsconfig.parent.json rename to packages/tsconfck/tests/fixtures/parse/valid/with_extends/tsconfig.parent.json diff --git a/tests/fixtures/parse/valid/with_extends/without_json_extension/tsconfig.json b/packages/tsconfck/tests/fixtures/parse/valid/with_extends/without_json_extension/tsconfig.json similarity index 100% rename from tests/fixtures/parse/valid/with_extends/without_json_extension/tsconfig.json rename to packages/tsconfck/tests/fixtures/parse/valid/with_extends/without_json_extension/tsconfig.json diff --git a/tests/fixtures/transpile/simple/input.ts b/packages/tsconfck/tests/fixtures/transpile/simple/input.ts similarity index 100% rename from tests/fixtures/transpile/simple/input.ts rename to packages/tsconfck/tests/fixtures/transpile/simple/input.ts diff --git a/tests/fixtures/transpile/simple/tsconfig.json b/packages/tsconfck/tests/fixtures/transpile/simple/tsconfig.json similarity index 100% rename from tests/fixtures/transpile/simple/tsconfig.json rename to packages/tsconfck/tests/fixtures/transpile/simple/tsconfig.json diff --git a/packages/tsconfck/tests/parse-native.js b/packages/tsconfck/tests/parse-native.js new file mode 100644 index 0000000..3a5f79c --- /dev/null +++ b/packages/tsconfck/tests/parse-native.js @@ -0,0 +1,280 @@ +import { describe, it, expect } from 'vitest'; +import path from 'node:path'; +import { parseNative, TSConfckParseNativeError } from '../src/parse-native.js'; +import os from 'os'; + +import { absFixture, globFixtures } from './util/fixture-paths.js'; +import { expectToMatchErrorSnap, expectToMatchSnap } from './util/expect.js'; +import { copyFixtures } from './util/copy-fixtures.js'; +import glob from 'tiny-glob'; +import { promises as fs } from 'node:fs'; +import { transform as esbuildTransform } from 'esbuild'; +import ts from 'typescript'; +import { TSConfckCache } from '../src/cache.js'; + +describe('parse', () => { + it('should be a function', () => { + expect(parseNative).toBeTypeOf('function'); + }); + + it('should return a Promise', () => { + expect(parseNative('str')).toBeInstanceOf(Promise); + }); + + it('should reject for invalid filename arg', async () => { + for (const filename of [{}, [], 0, null, undefined]) { + await expect(parseNative(filename), `filename type: ${typeof filename}`).rejects.toThrow(); + } + await expect(parseNative(), 'no filename arg').rejects.toThrow(); + await expect(parseNative('str'), `filename string arg`).resolves.toHaveProperty('tsconfigFile'); + }); + + it('should reject for not existing json file', async () => { + await expect(parseNative('doesntexist.json')).rejects.toThrow(); + }); + + it('should reject for directory named tsconfig.json', async () => { + await expect(parseNative(absFixture('parse/invalid/tsconfig.json'))).rejects.toThrow( + /exists but is not a regular file/ + ); + }); + + it('should resolve with empty result when no tsconfig is found', async () => { + const doesntExist = path.resolve(os.homedir(), '..', 'foo.ts'); // outside of user home there should not be a tsconfig + expect(await parseNative(doesntExist)).toEqual({ + tsconfigFile: null, + tsconfig: {}, + result: null + }); + }); + + it('should resolve with expected valid tsconfig.json', async () => { + const samples = await globFixtures('parse/valid/**/tsconfig.json'); + for (const filename of samples) { + const actual = await parseNative(filename); + expect(actual.tsconfigFile).toBe(filename); + await expectToMatchSnap(actual.tsconfig, `input: ${filename}`, filename, 'parse-native'); + } + }); + + it('should resolve with expected valid jsconfig.json with configName=jsconfig.json', async () => { + const samples = await globFixtures('parse/valid/**/jsconfig.json'); + for (const filename of samples) { + const actual = await parseNative(filename, { configName: 'jsconfig.json' }); + expect(actual.tsconfigFile).toBe(filename); + await expectToMatchSnap(actual.tsconfig, `input: ${filename}`, filename, 'parse-native'); + } + }); + + it('should resolve with expected tsconfig.json for valid tsconfig that is part of a solution', async () => { + const samples = await globFixtures('parse/solution/**/tsconfig.json'); + for (const filename of samples) { + const actual = await parseNative(filename); + expect(actual.tsconfigFile).toBe(filename); + await expectToMatchSnap(actual.tsconfig, `input: ${filename}`, filename, 'parse-native'); + } + }); + + it('should resolve with expected jsconfig.json for valid jsconfig that is part of a solution', async () => { + const samples = await globFixtures('parse/solution/jsconfig/**/jsconfig.json'); + for (const filename of samples) { + const actual = await parseNative(filename, { configName: 'jsconfig.json' }); + expect(actual.tsconfigFile).toBe(filename); + await expectToMatchSnap(actual.tsconfig, `input: ${filename}`, filename, 'parse-native'); + } + }); + + it('should resolve with expected tsconfig.json for ts file that is part of a solution', async () => { + const samples = await globFixtures('/parse/solution/**/*.{ts,mts,cts}'); + for (const filename of samples) { + const actual = await parseNative(filename); + await expectToMatchSnap( + actual.tsconfig, + `input: ${filename}`, + filename, + 'tsconfig.parse-native.json' + ); + } + }); + + it('should resolve with expected tsconfig.json for ts file that is part of a solution', async () => { + const samples = await globFixtures('/parse/solution/jsconfig/**/*.{js,mjs,cjs}'); + for (const filename of samples) { + const actual = await parseNative(filename, { configName: 'jsconfig.json' }); + await expectToMatchSnap( + actual.tsconfig, + `input: ${filename}`, + filename, + 'jsconfig.parse-native.json' + ); + } + }); + + it('should work with cache', async () => { + // use the more interesting samples with extensions and solution-style + const samples = [ + ...(await globFixtures('parse/valid/with_extends/**/tsconfig.json')), + ...(await globFixtures('parse/solution/**/*.ts')) + ]; + const cache = new TSConfckCache(); + for (const filename of samples) { + expect(cache.hasParseResult(filename), `cache does not exist for ${filename}`).toBe(false); + const actual = await parseNative(filename, { cache }); + await expectToMatchSnap( + actual.tsconfig, + `input: ${filename}`, + filename, + filename.endsWith('tsconfig.json') ? 'parse-native' : '.tsconfig.parse-native.json' + ); + expect(cache.hasParseResult(filename), `cache exists for ${filename}`).toBe(true); + const cached = cache.getParseResult(filename); + expect(cached.tsconfig, `input: ${filename} cached tsconfig is equal`).toEqual( + actual.tsconfig + ); + const reparsedResult = await parseNative(filename, { cache }); + expect(reparsedResult, `reparsedResult was returned from cache for ${filename}`).toBe(cached); + + if (filename.endsWith('.ts')) { + expect( + cache.hasParseResult(actual.tsconfigFile), + `cache exists for ${actual.tsconfigFile}` + ).toBe(true); + const cachedByResultFilename = cache.getParseResult(actual.tsconfigFile); + expect( + cachedByResultFilename.tsconfig, + `cache of ${actual.tsconfigFile} matches for: ${filename}` + ).toBe(actual.tsconfig); + const reparsedByResultFilename = await parseNative(actual.tsconfigFile, { cache }); + expect( + reparsedByResultFilename, + `reparsedByResultFilename was returned from cache for ${actual.tsconfigFile}` + ).toBe(cachedByResultFilename); + } + await cache.clear(); + const newParse = await parseNative(filename, { cache }); + expect(newParse, `input: ${filename} new parse is different object from old cached`).not.toBe( + cached + ); + expect(cache.hasParseResult(filename), `cache exists again after clear for ${filename}`).toBe( + true + ); + const newCached = cache.getParseResult(filename); + expect(newCached, `input: ${filename} new cache different object from old cached`).not.toBe( + cached + ); + expect(newParse, `input: ${filename} cached again`).toBe(newCached); + } + }); + + it('should resolve with tsconfig that is isomorphic', async () => { + const tempDir = await copyFixtures( + 'parse/valid', + 'parse-isomorphic-native', + (x) => x.isDirectory() || x.name.startsWith('tsconfig') + ); + const samples = await glob(`${tempDir}/**/tsconfig.json`); + for (const filename of samples) { + const result = await parseNative(filename); + await fs.copyFile(filename, `${filename}.orig`); + await fs.writeFile(filename, JSON.stringify(result.tsconfig, null, 2)); + const result2 = await parseNative(filename); + expect(result2.tsconfig, `filename: ${filename}`).toEqual(result.tsconfig); + } + }); + + it('should resolve with tsconfig that works when transpiling', async () => { + const samples = await globFixtures('transpile/**/tsconfig.json'); + for (const filename of samples) { + const { tsconfig } = await parseNative(filename); + const inputFiles = await glob(filename.replace('tsconfig.json', '**/input.ts')); + for (const inputFile of inputFiles) { + const input = await fs.readFile(inputFile, 'utf-8'); + const esbuildResult = ( + await esbuildTransform(input, { loader: 'ts', tsconfigRaw: tsconfig }) + ).code; + await expectToMatchSnap( + esbuildResult, + `esbuild transpile result for ${inputFile} with ${filename}`, + inputFile, + '.esbuild.parse-native.js' + ); + const tsResult = ts.transpile(input, tsconfig.compilerOptions); + await expectToMatchSnap( + tsResult, + `ts transpile result for ${inputFile} with ${filename}`, + inputFile, + '.typescript.parse-native.js' + ); + } + } + }); + + it('should reject with correct error for invalid tsconfig.json', async () => { + let samples = await globFixtures('parse/invalid/**/tsconfig.json'); + const excluded = [ + path.join('extends-fallback-not-found', 'dir'), + path.join('invalid', 'tsconfig.json') // directory, not a file, does + ]; + samples = samples.filter((sample) => !excluded.some((excluded) => sample.includes(excluded))); + for (const filename of samples) { + try { + await parseNative(filename); + expect.unreachable(`parse for ${filename} did not reject`); + } catch (e) { + expect(e).toBeInstanceOf(TSConfckParseNativeError); + expect(e.tsconfigFile).toBe(filename); + await expectToMatchErrorSnap(`${e.code}: ${e.message}`, filename, 'parse-native'); + } + } + }); + + it('should cache error for invalid tsconfig.json', async () => { + let samples = await globFixtures('parse/invalid/**/tsconfig.json'); + const excluded = [ + path.join('extends-fallback-not-found', 'dir'), + path.join('invalid', 'tsconfig.json') // directory, not a file, does + ]; + samples = samples.filter((sample) => !excluded.some((excluded) => sample.includes(excluded))); + const cache = new TSConfckCache(); + for (const filename of samples) { + expect(cache.hasParseResult(filename)).toBe(false); + let error; + try { + await parseNative(filename, { cache }); + expect.unreachable(`parse for ${filename} did not reject`); + } catch (e) { + expect(e).toBeInstanceOf(TSConfckParseNativeError); + expect(e.tsconfigFile).toBe(filename); + error = e; + } + expect(cache.hasParseResult(filename)).toBe(true); + try { + await cache.getParseResult(filename); + expect.unreachable(`cache.getParseResult for ${filename} did not reject`); + } catch (e) { + expect(e).toBe(error); + } + } + }); + + it('should prevent typescript file scanning when ignoreSourceFiles: true is set', async () => { + // use the more interesting samples with extensions and solution-style + const samples = [ + ...(await globFixtures('parse/valid/with_extends/**/tsconfig.json')), + ...(await globFixtures('parse/solution/**/*.ts')) + ]; + + for (const filename of samples) { + const actual = await parseNative(filename, { ignoreSourceFiles: true }); + await expectToMatchSnap( + actual.tsconfig, + `ignoreSourceFiles with ${filename}`, + filename, + filename.endsWith('tsconfig.json') + ? 'parse-native.ignore-files' + : '.tsconfig.parse-native.ignore-files.json' + ); + expect(actual.result.fileNames.length, `ignoreSourceFiles with ${filename}`).toBe(0); + } + }); +}); diff --git a/packages/tsconfck/tests/parse.js b/packages/tsconfck/tests/parse.js new file mode 100644 index 0000000..754ce63 --- /dev/null +++ b/packages/tsconfck/tests/parse.js @@ -0,0 +1,258 @@ +import { describe, it, expect } from 'vitest'; +import path from 'node:path'; +import { parse, TSConfckParseError } from '../src/parse.js'; +import os from 'os'; + +import { absFixture, globFixtures } from './util/fixture-paths.js'; +import { expectToMatchErrorSnap, expectToMatchSnap } from './util/expect.js'; +import { copyFixtures } from './util/copy-fixtures.js'; +import glob from 'tiny-glob'; +import { promises as fs } from 'node:fs'; +import { transform as esbuildTransform } from 'esbuild'; +import ts from 'typescript'; +import { TSConfckCache } from '../src/cache.js'; + +describe('parse', () => { + it('should be a function', () => { + expect(parse).toBeTypeOf('function'); + }); + + it('should return a Promise', () => { + expect(parse('str')).toBeInstanceOf(Promise); + }); + + it('should reject for invalid filename arg', async () => { + for (const filename of [{}, [], 0, null, undefined]) { + await expect(parse(filename), `filename type: ${typeof filename}`).rejects.toThrow(); + } + await expect(parse(), 'no filename arg').rejects.toThrow(); + await expect(parse('str'), `filename string arg`).resolves.toHaveProperty('tsconfigFile'); + }); + + it('should reject for not existing json file', async () => { + await expect(parse('doesntexist.json')).rejects.toThrow(); + }); + + it('should reject for directory named tsconfig.json', async () => { + await expect(parse(absFixture('parse/invalid/tsconfig.json'))).rejects.toThrow( + /exists but is not a regular file/ + ); + }); + + it('should resolve with empty result when no tsconfig is found', async () => { + const doesntExist = path.resolve(os.homedir(), '..', 'foo.ts'); // outside of user home there should not be a tsconfig + await expect(parse(doesntExist)).resolves.toEqual({ + tsconfigFile: null, + tsconfig: {} + }); + }); + + it('should resolve with expected valid tsconfig.json', async () => { + const samples = await globFixtures('parse/valid/**/tsconfig.json'); + for (const filename of samples) { + const actual = await parse(filename); + expect(actual.tsconfigFile).toBe(filename); + await expectToMatchSnap(actual.tsconfig, `input: ${filename}`, filename, 'parse'); + } + }); + + it('should resolve with expected valid jsconfig.json with configName=jsconfig.json', async () => { + const samples = await globFixtures('parse/valid/**/jsconfig.json'); + for (const filename of samples) { + const actual = await parse(filename, { configName: 'jsconfig.json' }); + expect(actual.tsconfigFile).toBe(filename); + await expectToMatchSnap(actual.tsconfig, `input: ${filename}`, filename, 'parse'); + } + }); + + it('should resolve with expected tsconfig.json for valid tsconfig that is part of a solution', async () => { + const samples = await globFixtures('parse/solution/**/tsconfig.json'); + for (const filename of samples) { + const actual = await parse(filename); + expect(actual.tsconfigFile).toBe(filename); + await expectToMatchSnap(actual.tsconfig, `input: ${filename}`, filename, 'parse'); + } + }); + + it('should resolve with expected tsconfig.json for valid jsconfig that is part of a solution', async () => { + const samples = await globFixtures('parse/solution/jsconfig/**/jsconfig.json'); + for (const filename of samples) { + const actual = await parse(filename, { configName: 'jsconfig.json' }); + expect(actual.tsconfigFile).toBe(filename); + await expectToMatchSnap(actual.tsconfig, `input: ${filename}`, filename, 'parse'); + } + }); + + it('should resolve with expected tsconfig.json for ts file that is part of a solution', async () => { + const samples = await globFixtures('/parse/solution/**/*.{ts,mts,cts}'); + for (const filename of samples) { + const actual = await parse(filename); + await expectToMatchSnap( + actual.tsconfig, + `input: ${filename}`, + filename, + '.tsconfig.parse.json' + ); + } + }); + + it('should resolve with expected jsconfig.json for js file that is part of a solution', async () => { + const samples = await globFixtures('/parse/solution/jsconfig/**/*.{js,mjs,cjs}'); + for (const filename of samples) { + const actual = await parse(filename, { configName: 'jsconfig.json' }); + await expectToMatchSnap( + actual.tsconfig, + `input: ${filename}`, + filename, + '.jsconfig.parse.json' + ); + } + }); + + it('should work with cache', async () => { + // use the more interesting samples with extensions and solution-style + const samples = [ + ...(await globFixtures('parse/valid/with_extends/**/tsconfig.json')), + ...(await globFixtures('parse/solution/**/*.ts')) + ]; + const cache = new TSConfckCache(); + for (const filename of samples) { + expect(cache.hasParseResult(filename), `cache does not exist for ${filename}`).toBe(false); + const actual = await parse(filename, { cache }); + await expectToMatchSnap( + actual.tsconfig, + `input: ${filename}`, + filename, + filename.endsWith('tsconfig.json') ? 'parse' : '.tsconfig.parse.json' + ); + expect(cache.hasParseResult(filename), `cache exists for ${filename}`).toBe(true); + const cached = await cache.getParseResult(filename); + expect(cached.tsconfig, `input: ${filename} cached tsconfig is equal`).toEqual( + actual.tsconfig + ); + const reparsedResult = await parse(filename, { cache }); + expect(reparsedResult, `reparsedResult was returned from cache for ${filename}`).toBe(cached); + + if (filename.endsWith('.ts')) { + expect( + cache.hasParseResult(actual.tsconfigFile), + `cache exists for ${actual.tsconfigFile}` + ).toBe(true); + const cachedByResultFilename = await cache.getParseResult(actual.tsconfigFile); + expect( + cachedByResultFilename.tsconfig, + `cache of ${actual.tsconfigFile} matches for: ${filename}` + ).toBe(actual.tsconfig); + const reparsedByResultFilename = await parse(actual.tsconfigFile, { cache }); + expect( + reparsedByResultFilename, + `reparsedByResultFilename was returned from cache for ${actual.tsconfigFile}` + ).toBe(cachedByResultFilename); + } + await cache.clear(); + const newParse = await parse(filename, { cache }); + expect(newParse, `input: ${filename} new parse is different object from old cached`).not.toBe( + cached + ); + expect(cache.hasParseResult(filename), `cache exists again after clear for ${filename}`).toBe( + true + ); + const newCached = await cache.getParseResult(filename); + expect(newCached, `input: ${filename} new cache different object from old cached`).not.toBe( + cached + ); + expect(newParse, `input: ${filename} cached again`).toBe(newCached); + } + }); + + it('should resolve with tsconfig that is isomorphic', async () => { + const tempDir = await copyFixtures( + 'parse/valid', + 'parse-isomorphic', + (x) => x.isDirectory() || x.name.startsWith('tsconfig') + ); + const samples = await glob(`${tempDir}/**/tsconfig.json`); + for (const filename of samples) { + const result = await parse(filename); + await fs.copyFile(filename, `${filename}.orig`); + await fs.writeFile(filename, JSON.stringify(result.tsconfig, null, 2)); + const result2 = await parse(filename); + expect(result2.tsconfig, `filename: ${filename}`).toEqual(result.tsconfig); + } + }); + + it('should resolve with tsconfig that works when transpiling', async () => { + const samples = await globFixtures('transpile/**/tsconfig.json'); + for (const filename of samples) { + const { tsconfig } = await parse(filename); + const inputFiles = await glob(filename.replace('tsconfig.json', '**/input.ts')); + for (const inputFile of inputFiles) { + const input = await fs.readFile(inputFile, 'utf-8'); + const esbuildResult = ( + await esbuildTransform(input, { loader: 'ts', tsconfigRaw: tsconfig }) + ).code; + await expectToMatchSnap( + esbuildResult, + `esbuild transpile result for ${inputFile} with ${filename}`, + inputFile, + '.esbuild.parse.js' + ); + const tsResult = ts.transpile(input, tsconfig.compilerOptions); + await expectToMatchSnap( + tsResult, + `ts transpile result for ${inputFile} with ${filename}`, + inputFile, + '.typescript.parse.js' + ); + } + } + }); + + it('should reject with correct error for invalid tsconfig.json', async () => { + let samples = await globFixtures('parse/invalid/**/tsconfig.json'); + const excluded = [ + path.join('extends-fallback-not-found', 'dir'), + path.join('invalid', 'tsconfig.json') // directory, not a file, does + ]; + samples = samples.filter((sample) => !excluded.some((excluded) => sample.includes(excluded))); + for (const filename of samples) { + try { + await parse(filename); + expect.unreachable(`parse for ${filename} did not reject`); + } catch (e) { + expect(e).toBeInstanceOf(TSConfckParseError); + expect(e.tsconfigFile).toBe(filename); + await expectToMatchErrorSnap(e.message, filename, 'parse'); + } + } + }); + + it('should cache error for invalid tsconfig.json', async () => { + let samples = await globFixtures('parse/invalid/**/tsconfig.json'); + const excluded = [ + path.join('extends-fallback-not-found', 'dir'), + path.join('invalid', 'tsconfig.json') // directory, not a file, does + ]; + samples = samples.filter((sample) => !excluded.some((excluded) => sample.includes(excluded))); + const cache = new TSConfckCache(); + for (const filename of samples) { + expect(cache.hasParseResult(filename)).toBe(false); + let error; + try { + await parse(filename, { cache }); + expect.unreachable(`parse for ${filename} did not reject`); + } catch (e) { + expect(e).toBeInstanceOf(TSConfckParseError); + expect(e.tsconfigFile).toBe(filename); + error = e; + } + expect(cache.hasParseResult(filename)).toBe(true); + try { + await cache.getParseResult(filename); + expect.unreachable(`cache.getParseResult for ${filename} did not reject`); + } catch (e) { + expect(e).toBe(error); + } + } + }); +}); diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/bom/tsconfig.json.error.node18.parse-native.txt b/packages/tsconfck/tests/snapshots/parse/invalid/bom/tsconfig.json.error.node18.parse-native.txt new file mode 100644 index 0000000..d5d81fe --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/bom/tsconfig.json.error.node18.parse-native.txt @@ -0,0 +1 @@ +TS 1005: ',' expected. \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/bom/tsconfig.json.error.node18.parse.txt b/packages/tsconfck/tests/snapshots/parse/invalid/bom/tsconfig.json.error.node18.parse.txt new file mode 100644 index 0000000..b366f89 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/bom/tsconfig.json.error.node18.parse.txt @@ -0,0 +1 @@ +parsing /parse/invalid/bom/tsconfig.json failed: SyntaxError: Unexpected token x in JSON at position 14 \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/bom/tsconfig.json.error.node20.parse-native.txt b/packages/tsconfck/tests/snapshots/parse/invalid/bom/tsconfig.json.error.node20.parse-native.txt new file mode 100644 index 0000000..d5d81fe --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/bom/tsconfig.json.error.node20.parse-native.txt @@ -0,0 +1 @@ +TS 1005: ',' expected. \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/bom/tsconfig.json.error.node20.parse.txt b/packages/tsconfck/tests/snapshots/parse/invalid/bom/tsconfig.json.error.node20.parse.txt new file mode 100644 index 0000000..aa587eb --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/bom/tsconfig.json.error.node20.parse.txt @@ -0,0 +1,4 @@ +parsing /parse/invalid/bom/tsconfig.json failed: SyntaxError: Unexpected token 'x', "{ + "extends": x"" +} +" is not valid JSON \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/comma/tsconfig.json.error.node18.parse-native.txt b/packages/tsconfck/tests/snapshots/parse/invalid/comma/tsconfig.json.error.node18.parse-native.txt new file mode 100644 index 0000000..4816a75 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/comma/tsconfig.json.error.node18.parse-native.txt @@ -0,0 +1 @@ +TS 1136: Property assignment expected. \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/comma/tsconfig.json.error.node18.parse.txt b/packages/tsconfck/tests/snapshots/parse/invalid/comma/tsconfig.json.error.node18.parse.txt new file mode 100644 index 0000000..788d2d7 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/comma/tsconfig.json.error.node18.parse.txt @@ -0,0 +1 @@ +parsing /parse/invalid/comma/tsconfig.json failed: SyntaxError: Unexpected token x in JSON at position 69 \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/comma/tsconfig.json.error.node20.parse-native.txt b/packages/tsconfck/tests/snapshots/parse/invalid/comma/tsconfig.json.error.node20.parse-native.txt new file mode 100644 index 0000000..4816a75 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/comma/tsconfig.json.error.node20.parse-native.txt @@ -0,0 +1 @@ +TS 1136: Property assignment expected. \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/comma/tsconfig.json.error.node20.parse.txt b/packages/tsconfck/tests/snapshots/parse/invalid/comma/tsconfig.json.error.node20.parse.txt new file mode 100644 index 0000000..453f67d --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/comma/tsconfig.json.error.node20.parse.txt @@ -0,0 +1 @@ +parsing /parse/invalid/comma/tsconfig.json failed: SyntaxError: Expected double-quoted property name in JSON at position 69 \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/comments/tsconfig.json.error.node18.parse-native.txt b/packages/tsconfck/tests/snapshots/parse/invalid/comments/tsconfig.json.error.node18.parse-native.txt new file mode 100644 index 0000000..d5d81fe --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/comments/tsconfig.json.error.node18.parse-native.txt @@ -0,0 +1 @@ +TS 1005: ',' expected. \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/comments/tsconfig.json.error.node18.parse.txt b/packages/tsconfck/tests/snapshots/parse/invalid/comments/tsconfig.json.error.node18.parse.txt new file mode 100644 index 0000000..1dfc0c0 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/comments/tsconfig.json.error.node18.parse.txt @@ -0,0 +1 @@ +parsing /parse/invalid/comments/tsconfig.json failed: SyntaxError: Unexpected token x in JSON at position 236 \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/comments/tsconfig.json.error.node20.parse-native.txt b/packages/tsconfck/tests/snapshots/parse/invalid/comments/tsconfig.json.error.node20.parse-native.txt new file mode 100644 index 0000000..d5d81fe --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/comments/tsconfig.json.error.node20.parse-native.txt @@ -0,0 +1 @@ +TS 1005: ',' expected. \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/comments/tsconfig.json.error.node20.parse.txt b/packages/tsconfck/tests/snapshots/parse/invalid/comments/tsconfig.json.error.node20.parse.txt new file mode 100644 index 0000000..fb77e27 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/comments/tsconfig.json.error.node20.parse.txt @@ -0,0 +1 @@ +parsing /parse/invalid/comments/tsconfig.json failed: SyntaxError: Expected ',' or '}' after property value in JSON at position 236 \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/extends-array-circular/tsconfig.json.error.node18.parse-native.txt b/packages/tsconfck/tests/snapshots/parse/invalid/extends-array-circular/tsconfig.json.error.node18.parse-native.txt new file mode 100644 index 0000000..a1029cc --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/extends-array-circular/tsconfig.json.error.node18.parse-native.txt @@ -0,0 +1 @@ +TS 18000: Circularity detected while resolving configuration: /parse/invalid/extends-array-circular/tsconfig.json -> /parse/invalid/extends-array-circular/tsconfig.a.json -> /parse/invalid/extends-array-circular/tsconfig.a.b.json -> /parse/invalid/extends-array-circular/tsconfig.a.json \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/extends-array-circular/tsconfig.json.error.node18.parse.txt b/packages/tsconfck/tests/snapshots/parse/invalid/extends-array-circular/tsconfig.json.error.node18.parse.txt new file mode 100644 index 0000000..046ed16 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/extends-array-circular/tsconfig.json.error.node18.parse.txt @@ -0,0 +1 @@ +Circular dependency in "extends": /parse/invalid/extends-array-circular/tsconfig.json -> /parse/invalid/extends-array-circular/tsconfig.b.json -> /parse/invalid/extends-array-circular/tsconfig.a.b.json -> /parse/invalid/extends-array-circular/tsconfig.a.json -> /parse/invalid/extends-array-circular/tsconfig.a.b.json \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/extends-array-circular/tsconfig.json.error.node20.parse-native.txt b/packages/tsconfck/tests/snapshots/parse/invalid/extends-array-circular/tsconfig.json.error.node20.parse-native.txt new file mode 100644 index 0000000..a1029cc --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/extends-array-circular/tsconfig.json.error.node20.parse-native.txt @@ -0,0 +1 @@ +TS 18000: Circularity detected while resolving configuration: /parse/invalid/extends-array-circular/tsconfig.json -> /parse/invalid/extends-array-circular/tsconfig.a.json -> /parse/invalid/extends-array-circular/tsconfig.a.b.json -> /parse/invalid/extends-array-circular/tsconfig.a.json \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/extends-array-circular/tsconfig.json.error.node20.parse.txt b/packages/tsconfck/tests/snapshots/parse/invalid/extends-array-circular/tsconfig.json.error.node20.parse.txt new file mode 100644 index 0000000..046ed16 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/extends-array-circular/tsconfig.json.error.node20.parse.txt @@ -0,0 +1 @@ +Circular dependency in "extends": /parse/invalid/extends-array-circular/tsconfig.json -> /parse/invalid/extends-array-circular/tsconfig.b.json -> /parse/invalid/extends-array-circular/tsconfig.a.b.json -> /parse/invalid/extends-array-circular/tsconfig.a.json -> /parse/invalid/extends-array-circular/tsconfig.a.b.json \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/extends-circular/tsconfig.json.error.node18.parse-native.txt b/packages/tsconfck/tests/snapshots/parse/invalid/extends-circular/tsconfig.json.error.node18.parse-native.txt new file mode 100644 index 0000000..bb748d5 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/extends-circular/tsconfig.json.error.node18.parse-native.txt @@ -0,0 +1 @@ +TS 18000: Circularity detected while resolving configuration: /parse/invalid/extends-circular/tsconfig.json -> /parse/invalid/extends-circular/tsconfig.circular.json -> /parse/invalid/extends-circular/deep/tsconfig.circular2.json -> /parse/invalid/extends-circular/tsconfig.json \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/extends-circular/tsconfig.json.error.node18.parse.txt b/packages/tsconfck/tests/snapshots/parse/invalid/extends-circular/tsconfig.json.error.node18.parse.txt new file mode 100644 index 0000000..d5acc88 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/extends-circular/tsconfig.json.error.node18.parse.txt @@ -0,0 +1 @@ +Circular dependency in "extends": /parse/invalid/extends-circular/tsconfig.json -> /parse/invalid/extends-circular/tsconfig.circular.json -> /parse/invalid/extends-circular/deep/tsconfig.circular2.json -> /parse/invalid/extends-circular/tsconfig.json \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/extends-circular/tsconfig.json.error.node20.parse-native.txt b/packages/tsconfck/tests/snapshots/parse/invalid/extends-circular/tsconfig.json.error.node20.parse-native.txt new file mode 100644 index 0000000..bb748d5 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/extends-circular/tsconfig.json.error.node20.parse-native.txt @@ -0,0 +1 @@ +TS 18000: Circularity detected while resolving configuration: /parse/invalid/extends-circular/tsconfig.json -> /parse/invalid/extends-circular/tsconfig.circular.json -> /parse/invalid/extends-circular/deep/tsconfig.circular2.json -> /parse/invalid/extends-circular/tsconfig.json \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/extends-circular/tsconfig.json.error.node20.parse.txt b/packages/tsconfck/tests/snapshots/parse/invalid/extends-circular/tsconfig.json.error.node20.parse.txt new file mode 100644 index 0000000..d5acc88 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/extends-circular/tsconfig.json.error.node20.parse.txt @@ -0,0 +1 @@ +Circular dependency in "extends": /parse/invalid/extends-circular/tsconfig.json -> /parse/invalid/extends-circular/tsconfig.circular.json -> /parse/invalid/extends-circular/deep/tsconfig.circular2.json -> /parse/invalid/extends-circular/tsconfig.json \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/extends-fallback-not-found/tsconfig.json.error.node18.parse-native.txt b/packages/tsconfck/tests/snapshots/parse/invalid/extends-fallback-not-found/tsconfig.json.error.node18.parse-native.txt new file mode 100644 index 0000000..9fcd2b2 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/extends-fallback-not-found/tsconfig.json.error.node18.parse-native.txt @@ -0,0 +1 @@ +TS 6053: File './dir' not found. \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/extends-fallback-not-found/tsconfig.json.error.node18.parse.txt b/packages/tsconfck/tests/snapshots/parse/invalid/extends-fallback-not-found/tsconfig.json.error.node18.parse.txt new file mode 100644 index 0000000..ed44ca0 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/extends-fallback-not-found/tsconfig.json.error.node18.parse.txt @@ -0,0 +1 @@ +failed to resolve "extends":"./dir" in /parse/invalid/extends-fallback-not-found/tsconfig.json \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/extends-fallback-not-found/tsconfig.json.error.node20.parse-native.txt b/packages/tsconfck/tests/snapshots/parse/invalid/extends-fallback-not-found/tsconfig.json.error.node20.parse-native.txt new file mode 100644 index 0000000..9fcd2b2 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/extends-fallback-not-found/tsconfig.json.error.node20.parse-native.txt @@ -0,0 +1 @@ +TS 6053: File './dir' not found. \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/extends-fallback-not-found/tsconfig.json.error.node20.parse.txt b/packages/tsconfck/tests/snapshots/parse/invalid/extends-fallback-not-found/tsconfig.json.error.node20.parse.txt new file mode 100644 index 0000000..ed44ca0 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/extends-fallback-not-found/tsconfig.json.error.node20.parse.txt @@ -0,0 +1 @@ +failed to resolve "extends":"./dir" in /parse/invalid/extends-fallback-not-found/tsconfig.json \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/extends-not-found/tsconfig.json.error.node18.parse-native.txt b/packages/tsconfck/tests/snapshots/parse/invalid/extends-not-found/tsconfig.json.error.node18.parse-native.txt new file mode 100644 index 0000000..ab236e5 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/extends-not-found/tsconfig.json.error.node18.parse-native.txt @@ -0,0 +1 @@ +TS 5083: Cannot read file '/parse/invalid/tsconfig.doesnotexist.json'. \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/extends-not-found/tsconfig.json.error.node18.parse.txt b/packages/tsconfck/tests/snapshots/parse/invalid/extends-not-found/tsconfig.json.error.node18.parse.txt new file mode 100644 index 0000000..9112231 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/extends-not-found/tsconfig.json.error.node18.parse.txt @@ -0,0 +1 @@ +failed to resolve "extends":"../tsconfig.doesnotexist.json" in /parse/invalid/extends-not-found/tsconfig.json \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/extends-not-found/tsconfig.json.error.node20.parse-native.txt b/packages/tsconfck/tests/snapshots/parse/invalid/extends-not-found/tsconfig.json.error.node20.parse-native.txt new file mode 100644 index 0000000..ab236e5 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/extends-not-found/tsconfig.json.error.node20.parse-native.txt @@ -0,0 +1 @@ +TS 5083: Cannot read file '/parse/invalid/tsconfig.doesnotexist.json'. \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/extends-not-found/tsconfig.json.error.node20.parse.txt b/packages/tsconfck/tests/snapshots/parse/invalid/extends-not-found/tsconfig.json.error.node20.parse.txt new file mode 100644 index 0000000..9112231 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/extends-not-found/tsconfig.json.error.node20.parse.txt @@ -0,0 +1 @@ +failed to resolve "extends":"../tsconfig.doesnotexist.json" in /parse/invalid/extends-not-found/tsconfig.json \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/mixed/tsconfig.json.error.node18.parse-native.txt b/packages/tsconfck/tests/snapshots/parse/invalid/mixed/tsconfig.json.error.node18.parse-native.txt new file mode 100644 index 0000000..d5d81fe --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/mixed/tsconfig.json.error.node18.parse-native.txt @@ -0,0 +1 @@ +TS 1005: ',' expected. \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/mixed/tsconfig.json.error.node18.parse.txt b/packages/tsconfck/tests/snapshots/parse/invalid/mixed/tsconfig.json.error.node18.parse.txt new file mode 100644 index 0000000..bda123e --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/mixed/tsconfig.json.error.node18.parse.txt @@ -0,0 +1 @@ +parsing /parse/invalid/mixed/tsconfig.json failed: SyntaxError: Unexpected token x in JSON at position 297 \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/mixed/tsconfig.json.error.node20.parse-native.txt b/packages/tsconfck/tests/snapshots/parse/invalid/mixed/tsconfig.json.error.node20.parse-native.txt new file mode 100644 index 0000000..d5d81fe --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/mixed/tsconfig.json.error.node20.parse-native.txt @@ -0,0 +1 @@ +TS 1005: ',' expected. \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/invalid/mixed/tsconfig.json.error.node20.parse.txt b/packages/tsconfck/tests/snapshots/parse/invalid/mixed/tsconfig.json.error.node20.parse.txt new file mode 100644 index 0000000..b05901e --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/invalid/mixed/tsconfig.json.error.node20.parse.txt @@ -0,0 +1 @@ +parsing /parse/invalid/mixed/tsconfig.json failed: SyntaxError: Expected ',' or '}' after property value in JSON at position 297 \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/jsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/jsconfig.json.parse-native.json new file mode 100644 index 0000000..fb1040c --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/jsconfig.json.parse-native.json @@ -0,0 +1,19 @@ +{ + "files": [], + "include": [], + "references": [ + { + "path": "./jsconfig.src.json" + }, + { + "path": "./jsconfig.test.json" + } + ], + "compilerOptions": { + "allowJs": true, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/jsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/jsconfig.json.parse.json new file mode 100644 index 0000000..fb1040c --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/jsconfig.json.parse.json @@ -0,0 +1,19 @@ +{ + "files": [], + "include": [], + "references": [ + { + "path": "./jsconfig.src.json" + }, + { + "path": "./jsconfig.test.json" + } + ], + "compilerOptions": { + "allowJs": true, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/bar.mjs.jsconfig.parse-native.json b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/bar.mjs.jsconfig.parse-native.json new file mode 100644 index 0000000..bed91ad --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/bar.mjs.jsconfig.parse-native.json @@ -0,0 +1,15 @@ +{ + "extends": "./jsconfig.base", + "include": [ + "src/**/*" + ], + "exclude": [ + "src/**/*.spec.js" + ], + "compilerOptions": { + "allowJs": true, + "composite": true, + "strictNullChecks": true, + "strict": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/bar.mjs.jsconfig.parse.json b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/bar.mjs.jsconfig.parse.json new file mode 100644 index 0000000..64eff74 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/bar.mjs.jsconfig.parse.json @@ -0,0 +1,15 @@ +{ + "extends": "./jsconfig.base", + "include": [ + "src/**/*" + ], + "exclude": [ + "src/**/*.spec.js" + ], + "compilerOptions": { + "strict": true, + "allowJs": true, + "composite": true, + "strictNullChecks": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/baz.cjs.jsconfig.parse-native.json b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/baz.cjs.jsconfig.parse-native.json new file mode 100644 index 0000000..bed91ad --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/baz.cjs.jsconfig.parse-native.json @@ -0,0 +1,15 @@ +{ + "extends": "./jsconfig.base", + "include": [ + "src/**/*" + ], + "exclude": [ + "src/**/*.spec.js" + ], + "compilerOptions": { + "allowJs": true, + "composite": true, + "strictNullChecks": true, + "strict": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/baz.cjs.jsconfig.parse.json b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/baz.cjs.jsconfig.parse.json new file mode 100644 index 0000000..64eff74 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/baz.cjs.jsconfig.parse.json @@ -0,0 +1,15 @@ +{ + "extends": "./jsconfig.base", + "include": [ + "src/**/*" + ], + "exclude": [ + "src/**/*.spec.js" + ], + "compilerOptions": { + "strict": true, + "allowJs": true, + "composite": true, + "strictNullChecks": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/foo.js.jsconfig.parse-native.json b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/foo.js.jsconfig.parse-native.json new file mode 100644 index 0000000..bed91ad --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/foo.js.jsconfig.parse-native.json @@ -0,0 +1,15 @@ +{ + "extends": "./jsconfig.base", + "include": [ + "src/**/*" + ], + "exclude": [ + "src/**/*.spec.js" + ], + "compilerOptions": { + "allowJs": true, + "composite": true, + "strictNullChecks": true, + "strict": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/foo.js.jsconfig.parse.json b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/foo.js.jsconfig.parse.json new file mode 100644 index 0000000..64eff74 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/foo.js.jsconfig.parse.json @@ -0,0 +1,15 @@ +{ + "extends": "./jsconfig.base", + "include": [ + "src/**/*" + ], + "exclude": [ + "src/**/*.spec.js" + ], + "compilerOptions": { + "strict": true, + "allowJs": true, + "composite": true, + "strictNullChecks": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/foo.spec.js.jsconfig.parse-native.json b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/foo.spec.js.jsconfig.parse-native.json new file mode 100644 index 0000000..f15c3ea --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/foo.spec.js.jsconfig.parse-native.json @@ -0,0 +1,12 @@ +{ + "extends": "./jsconfig.base", + "include": [ + "src/**/*.spec.js" + ], + "compilerOptions": { + "allowJs": true, + "composite": true, + "strictNullChecks": true, + "strict": false + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/foo.spec.js.jsconfig.parse.json b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/foo.spec.js.jsconfig.parse.json new file mode 100644 index 0000000..b3f4f79 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/jsconfig/src/foo.spec.js.jsconfig.parse.json @@ -0,0 +1,12 @@ +{ + "extends": "./jsconfig.base", + "include": [ + "src/**/*.spec.js" + ], + "compilerOptions": { + "strict": false, + "allowJs": true, + "composite": true, + "strictNullChecks": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/bar.mts.tsconfig.parse-native.json b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/bar.mts.tsconfig.parse-native.json new file mode 100644 index 0000000..0d29065 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/bar.mts.tsconfig.parse-native.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.base", + "include": [ + "src/**/*" + ], + "exclude": [ + "src/**/*.spec.ts" + ], + "compilerOptions": { + "composite": true, + "strictNullChecks": true, + "strict": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/bar.mts.tsconfig.parse.json b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/bar.mts.tsconfig.parse.json new file mode 100644 index 0000000..ccb1020 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/bar.mts.tsconfig.parse.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.base", + "include": [ + "src/**/*" + ], + "exclude": [ + "src/**/*.spec.ts" + ], + "compilerOptions": { + "strict": true, + "composite": true, + "strictNullChecks": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/baz.cts.tsconfig.parse-native.json b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/baz.cts.tsconfig.parse-native.json new file mode 100644 index 0000000..0d29065 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/baz.cts.tsconfig.parse-native.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.base", + "include": [ + "src/**/*" + ], + "exclude": [ + "src/**/*.spec.ts" + ], + "compilerOptions": { + "composite": true, + "strictNullChecks": true, + "strict": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/baz.cts.tsconfig.parse.json b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/baz.cts.tsconfig.parse.json new file mode 100644 index 0000000..ccb1020 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/baz.cts.tsconfig.parse.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.base", + "include": [ + "src/**/*" + ], + "exclude": [ + "src/**/*.spec.ts" + ], + "compilerOptions": { + "strict": true, + "composite": true, + "strictNullChecks": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/foo.spec.ts.tsconfig.parse-native.ignore-files.json b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/foo.spec.ts.tsconfig.parse-native.ignore-files.json new file mode 100644 index 0000000..b6f5a9b --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/foo.spec.ts.tsconfig.parse-native.ignore-files.json @@ -0,0 +1,12 @@ +{ + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.src.json" + }, + { + "path": "./tsconfig.test.json" + } + ] +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/foo.spec.ts.tsconfig.parse-native.json b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/foo.spec.ts.tsconfig.parse-native.json new file mode 100644 index 0000000..366cecc --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/foo.spec.ts.tsconfig.parse-native.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.base", + "include": [ + "src/**/*.spec.ts" + ], + "compilerOptions": { + "composite": true, + "strictNullChecks": true, + "strict": false + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/foo.spec.ts.tsconfig.parse.json b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/foo.spec.ts.tsconfig.parse.json new file mode 100644 index 0000000..3869a8e --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/foo.spec.ts.tsconfig.parse.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.base", + "include": [ + "src/**/*.spec.ts" + ], + "compilerOptions": { + "strict": false, + "composite": true, + "strictNullChecks": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/foo.ts.tsconfig.parse-native.ignore-files.json b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/foo.ts.tsconfig.parse-native.ignore-files.json new file mode 100644 index 0000000..b6f5a9b --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/foo.ts.tsconfig.parse-native.ignore-files.json @@ -0,0 +1,12 @@ +{ + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.src.json" + }, + { + "path": "./tsconfig.test.json" + } + ] +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/foo.ts.tsconfig.parse-native.json b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/foo.ts.tsconfig.parse-native.json new file mode 100644 index 0000000..0d29065 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/foo.ts.tsconfig.parse-native.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.base", + "include": [ + "src/**/*" + ], + "exclude": [ + "src/**/*.spec.ts" + ], + "compilerOptions": { + "composite": true, + "strictNullChecks": true, + "strict": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/foo.ts.tsconfig.parse.json b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/foo.ts.tsconfig.parse.json new file mode 100644 index 0000000..ccb1020 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/mixed/src/foo.ts.tsconfig.parse.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.base", + "include": [ + "src/**/*" + ], + "exclude": [ + "src/**/*.spec.ts" + ], + "compilerOptions": { + "strict": true, + "composite": true, + "strictNullChecks": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/mixed/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/solution/mixed/tsconfig.json.parse-native.json new file mode 100644 index 0000000..b6f5a9b --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/mixed/tsconfig.json.parse-native.json @@ -0,0 +1,12 @@ +{ + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.src.json" + }, + { + "path": "./tsconfig.test.json" + } + ] +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/mixed/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/solution/mixed/tsconfig.json.parse.json new file mode 100644 index 0000000..b6f5a9b --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/mixed/tsconfig.json.parse.json @@ -0,0 +1,12 @@ +{ + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.src.json" + }, + { + "path": "./tsconfig.test.json" + } + ] +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/simple/src/foo.ts.tsconfig.parse-native.ignore-files.json b/packages/tsconfck/tests/snapshots/parse/solution/simple/src/foo.ts.tsconfig.parse-native.ignore-files.json new file mode 100644 index 0000000..3d64e23 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/simple/src/foo.ts.tsconfig.parse-native.ignore-files.json @@ -0,0 +1,10 @@ +{ + "include": [], + "extends": "../tsconfig.base", + "compilerOptions": { + "composite": true, + "strictNullChecks": true, + "strict": true + }, + "files": [] +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/simple/src/foo.ts.tsconfig.parse-native.json b/packages/tsconfck/tests/snapshots/parse/solution/simple/src/foo.ts.tsconfig.parse-native.json new file mode 100644 index 0000000..89d9a4f --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/simple/src/foo.ts.tsconfig.parse-native.json @@ -0,0 +1,11 @@ +{ + "include": [ + "./foo.ts" + ], + "extends": "../tsconfig.base", + "compilerOptions": { + "composite": true, + "strictNullChecks": true, + "strict": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/simple/src/foo.ts.tsconfig.parse.json b/packages/tsconfck/tests/snapshots/parse/solution/simple/src/foo.ts.tsconfig.parse.json new file mode 100644 index 0000000..2e20b13 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/simple/src/foo.ts.tsconfig.parse.json @@ -0,0 +1,11 @@ +{ + "include": [ + "./foo.ts" + ], + "extends": "../tsconfig.base", + "compilerOptions": { + "strict": true, + "composite": true, + "strictNullChecks": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/simple/src/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/solution/simple/src/tsconfig.json.parse-native.json new file mode 100644 index 0000000..89d9a4f --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/simple/src/tsconfig.json.parse-native.json @@ -0,0 +1,11 @@ +{ + "include": [ + "./foo.ts" + ], + "extends": "../tsconfig.base", + "compilerOptions": { + "composite": true, + "strictNullChecks": true, + "strict": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/simple/src/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/solution/simple/src/tsconfig.json.parse.json new file mode 100644 index 0000000..2e20b13 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/simple/src/tsconfig.json.parse.json @@ -0,0 +1,11 @@ +{ + "include": [ + "./foo.ts" + ], + "extends": "../tsconfig.base", + "compilerOptions": { + "strict": true, + "composite": true, + "strictNullChecks": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/simple/tests/foo.ts.tsconfig.parse-native.ignore-files.json b/packages/tsconfck/tests/snapshots/parse/solution/simple/tests/foo.ts.tsconfig.parse-native.ignore-files.json new file mode 100644 index 0000000..07f362f --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/simple/tests/foo.ts.tsconfig.parse-native.ignore-files.json @@ -0,0 +1,10 @@ +{ + "extends": "../tsconfig.base", + "compilerOptions": { + "composite": true, + "strictNullChecks": true, + "strict": false + }, + "files": [], + "include": [] +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/simple/tests/foo.ts.tsconfig.parse-native.json b/packages/tsconfck/tests/snapshots/parse/solution/simple/tests/foo.ts.tsconfig.parse-native.json new file mode 100644 index 0000000..9a9f2d4 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/simple/tests/foo.ts.tsconfig.parse-native.json @@ -0,0 +1,8 @@ +{ + "extends": "../tsconfig.base", + "compilerOptions": { + "composite": true, + "strictNullChecks": true, + "strict": false + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/simple/tests/foo.ts.tsconfig.parse.json b/packages/tsconfck/tests/snapshots/parse/solution/simple/tests/foo.ts.tsconfig.parse.json new file mode 100644 index 0000000..c39ea92 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/simple/tests/foo.ts.tsconfig.parse.json @@ -0,0 +1,8 @@ +{ + "extends": "../tsconfig.base", + "compilerOptions": { + "strict": false, + "composite": true, + "strictNullChecks": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/simple/tests/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/solution/simple/tests/tsconfig.json.parse-native.json new file mode 100644 index 0000000..9a9f2d4 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/simple/tests/tsconfig.json.parse-native.json @@ -0,0 +1,8 @@ +{ + "extends": "../tsconfig.base", + "compilerOptions": { + "composite": true, + "strictNullChecks": true, + "strict": false + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/simple/tests/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/solution/simple/tests/tsconfig.json.parse.json new file mode 100644 index 0000000..c39ea92 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/simple/tests/tsconfig.json.parse.json @@ -0,0 +1,8 @@ +{ + "extends": "../tsconfig.base", + "compilerOptions": { + "strict": false, + "composite": true, + "strictNullChecks": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/simple/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/solution/simple/tsconfig.json.parse-native.json new file mode 100644 index 0000000..6cbe37d --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/simple/tsconfig.json.parse-native.json @@ -0,0 +1,12 @@ +{ + "files": [], + "include": [], + "references": [ + { + "path": "./src" + }, + { + "path": "./tests" + } + ] +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/solution/simple/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/solution/simple/tsconfig.json.parse.json new file mode 100644 index 0000000..6cbe37d --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/solution/simple/tsconfig.json.parse.json @@ -0,0 +1,12 @@ +{ + "files": [], + "include": [], + "references": [ + { + "path": "./src" + }, + { + "path": "./tests" + } + ] +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/bom/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/bom/tsconfig.json.parse-native.json new file mode 100644 index 0000000..4fb79c4 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/bom/tsconfig.json.parse-native.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "strictNullChecks": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/bom/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/bom/tsconfig.json.parse.json new file mode 100644 index 0000000..4fb79c4 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/bom/tsconfig.json.parse.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "strictNullChecks": true + } +} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/bom/expected.json b/packages/tsconfck/tests/snapshots/parse/valid/bom/tsconfig.json.to-json.json similarity index 100% rename from tests/fixtures/parse/valid/bom/expected.json rename to packages/tsconfck/tests/snapshots/parse/valid/bom/tsconfig.json.to-json.json diff --git a/packages/tsconfck/tests/snapshots/parse/valid/comma/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/comma/tsconfig.json.parse-native.json new file mode 100644 index 0000000..0503d5a --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/comma/tsconfig.json.parse-native.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "types": [ + "foo" + ] + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/comma/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/comma/tsconfig.json.parse.json new file mode 100644 index 0000000..0503d5a --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/comma/tsconfig.json.parse.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "types": [ + "foo" + ] + } +} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/comma/expected.json b/packages/tsconfck/tests/snapshots/parse/valid/comma/tsconfig.json.to-json.json similarity index 100% rename from tests/fixtures/parse/valid/comma/expected.json rename to packages/tsconfck/tests/snapshots/parse/valid/comma/tsconfig.json.to-json.json diff --git a/packages/tsconfck/tests/snapshots/parse/valid/comments/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/comments/tsconfig.json.parse-native.json new file mode 100644 index 0000000..1200ed8 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/comments/tsconfig.json.parse-native.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "types": [ + "//keep \"this", + "/*", + "*/", + "/* this too */" + ] + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/comments/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/comments/tsconfig.json.parse.json new file mode 100644 index 0000000..1200ed8 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/comments/tsconfig.json.parse.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "types": [ + "//keep \"this", + "/*", + "*/", + "/* this too */" + ] + } +} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/comments/expected.json b/packages/tsconfck/tests/snapshots/parse/valid/comments/tsconfig.json.to-json.json similarity index 100% rename from tests/fixtures/parse/valid/comments/expected.json rename to packages/tsconfck/tests/snapshots/parse/valid/comments/tsconfig.json.to-json.json diff --git a/packages/tsconfck/tests/snapshots/parse/valid/empty/jsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/empty/jsconfig.json.parse-native.json new file mode 100644 index 0000000..49ea5d3 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/empty/jsconfig.json.parse-native.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "allowJs": true, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/empty/jsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/empty/jsconfig.json.parse.json new file mode 100644 index 0000000..49ea5d3 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/empty/jsconfig.json.parse.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "allowJs": true, + "maxNodeModuleJsDepth": 2, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "noEmit": true + } +} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/empty/expected.json b/packages/tsconfck/tests/snapshots/parse/valid/empty/tsconfig.json.parse-native.json similarity index 100% rename from tests/fixtures/parse/valid/empty/expected.json rename to packages/tsconfck/tests/snapshots/parse/valid/empty/tsconfig.json.parse-native.json diff --git a/tests/fixtures/parse/valid/empty/expected.native.json b/packages/tsconfck/tests/snapshots/parse/valid/empty/tsconfig.json.parse.json similarity index 100% rename from tests/fixtures/parse/valid/empty/expected.native.json rename to packages/tsconfck/tests/snapshots/parse/valid/empty/tsconfig.json.parse.json diff --git a/packages/tsconfck/tests/snapshots/parse/valid/empty/tsconfig.json.to-json.json b/packages/tsconfck/tests/snapshots/parse/valid/empty/tsconfig.json.to-json.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/empty/tsconfig.json.to-json.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/lib/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/lib/tsconfig.json.parse-native.json new file mode 100644 index 0000000..119eae7 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/lib/tsconfig.json.parse-native.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "lib": [ + "es2020", + "es2021.promise" + ] + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/lib/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/lib/tsconfig.json.parse.json new file mode 100644 index 0000000..5fd3dfb --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/lib/tsconfig.json.parse.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "lib": [ + "ES2020", + "ES2021.Promise" + ] + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/lib/tsconfig.json.to-json.json b/packages/tsconfck/tests/snapshots/parse/valid/lib/tsconfig.json.to-json.json new file mode 100644 index 0000000..9342e92 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/lib/tsconfig.json.to-json.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "lib": [ + "ES2020", + "ES2021.Promise" + ] + } +} diff --git a/packages/tsconfck/tests/snapshots/parse/valid/mixed/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/mixed/tsconfig.json.parse-native.json new file mode 100644 index 0000000..9de5867 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/mixed/tsconfig.json.parse-native.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "types": [ + "//keep this", + "/*", + "*/", + "/* this too */" + ] + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/mixed/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/mixed/tsconfig.json.parse.json new file mode 100644 index 0000000..9de5867 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/mixed/tsconfig.json.parse.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "types": [ + "//keep this", + "/*", + "*/", + "/* this too */" + ] + } +} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/mixed/expected.json b/packages/tsconfck/tests/snapshots/parse/valid/mixed/tsconfig.json.to-json.json similarity index 100% rename from tests/fixtures/parse/valid/mixed/expected.json rename to packages/tsconfck/tests/snapshots/parse/valid/mixed/tsconfig.json.to-json.json diff --git a/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/bundler/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/bundler/tsconfig.json.parse-native.json new file mode 100644 index 0000000..6e5042c --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/bundler/tsconfig.json.parse-native.json @@ -0,0 +1,20 @@ +{ + "files": [ + "foo.ts" + ], + "compilerOptions": { + "types": [ + "foo" + ], + "importsNotUsedAsValues": "error", + "module": "node16", + "moduleResolution": "bundler", + "newLine": "lf", + "target": "esnext" + }, + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/bundler/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/bundler/tsconfig.json.parse.json new file mode 100644 index 0000000..6e5042c --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/bundler/tsconfig.json.parse.json @@ -0,0 +1,20 @@ +{ + "files": [ + "foo.ts" + ], + "compilerOptions": { + "types": [ + "foo" + ], + "importsNotUsedAsValues": "error", + "module": "node16", + "moduleResolution": "bundler", + "newLine": "lf", + "target": "esnext" + }, + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + } +} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/moduleResolution/bundler/expected.json b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/bundler/tsconfig.json.to-json.json similarity index 100% rename from tests/fixtures/parse/valid/moduleResolution/bundler/expected.json rename to packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/bundler/tsconfig.json.to-json.json diff --git a/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/classic/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/classic/tsconfig.json.parse-native.json new file mode 100644 index 0000000..ebcb2ef --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/classic/tsconfig.json.parse-native.json @@ -0,0 +1,20 @@ +{ + "files": [ + "foo.ts" + ], + "compilerOptions": { + "types": [ + "foo" + ], + "importsNotUsedAsValues": "error", + "module": "node16", + "moduleResolution": "classic", + "newLine": "lf", + "target": "esnext" + }, + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/classic/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/classic/tsconfig.json.parse.json new file mode 100644 index 0000000..ebcb2ef --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/classic/tsconfig.json.parse.json @@ -0,0 +1,20 @@ +{ + "files": [ + "foo.ts" + ], + "compilerOptions": { + "types": [ + "foo" + ], + "importsNotUsedAsValues": "error", + "module": "node16", + "moduleResolution": "classic", + "newLine": "lf", + "target": "esnext" + }, + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + } +} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/moduleResolution/classic/expected.json b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/classic/tsconfig.json.to-json.json similarity index 100% rename from tests/fixtures/parse/valid/moduleResolution/classic/expected.json rename to packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/classic/tsconfig.json.to-json.json diff --git a/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/node16/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/node16/tsconfig.json.parse-native.json new file mode 100644 index 0000000..370c787 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/node16/tsconfig.json.parse-native.json @@ -0,0 +1,20 @@ +{ + "files": [ + "foo.ts" + ], + "compilerOptions": { + "types": [ + "foo" + ], + "importsNotUsedAsValues": "error", + "module": "node16", + "moduleResolution": "node16", + "newLine": "lf", + "target": "esnext" + }, + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/node16/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/node16/tsconfig.json.parse.json new file mode 100644 index 0000000..370c787 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/node16/tsconfig.json.parse.json @@ -0,0 +1,20 @@ +{ + "files": [ + "foo.ts" + ], + "compilerOptions": { + "types": [ + "foo" + ], + "importsNotUsedAsValues": "error", + "module": "node16", + "moduleResolution": "node16", + "newLine": "lf", + "target": "esnext" + }, + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + } +} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/moduleResolution/node16/expected.json b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/node16/tsconfig.json.to-json.json similarity index 100% rename from tests/fixtures/parse/valid/moduleResolution/node16/expected.json rename to packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/node16/tsconfig.json.to-json.json diff --git a/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/nodenext/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/nodenext/tsconfig.json.parse-native.json new file mode 100644 index 0000000..d418078 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/nodenext/tsconfig.json.parse-native.json @@ -0,0 +1,20 @@ +{ + "files": [ + "foo.ts" + ], + "compilerOptions": { + "types": [ + "foo" + ], + "importsNotUsedAsValues": "error", + "module": "nodenext", + "moduleResolution": "nodenext", + "newLine": "lf", + "target": "esnext" + }, + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/nodenext/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/nodenext/tsconfig.json.parse.json new file mode 100644 index 0000000..d418078 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/nodenext/tsconfig.json.parse.json @@ -0,0 +1,20 @@ +{ + "files": [ + "foo.ts" + ], + "compilerOptions": { + "types": [ + "foo" + ], + "importsNotUsedAsValues": "error", + "module": "nodenext", + "moduleResolution": "nodenext", + "newLine": "lf", + "target": "esnext" + }, + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + } +} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/moduleResolution/nodenext/expected.json b/packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/nodenext/tsconfig.json.to-json.json similarity index 100% rename from tests/fixtures/parse/valid/moduleResolution/nodenext/expected.json rename to packages/tsconfck/tests/snapshots/parse/valid/moduleResolution/nodenext/tsconfig.json.to-json.json diff --git a/packages/tsconfck/tests/snapshots/parse/valid/regular/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/regular/tsconfig.json.parse-native.json new file mode 100644 index 0000000..7fed50d --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/regular/tsconfig.json.parse-native.json @@ -0,0 +1,20 @@ +{ + "files": [ + "foo.ts" + ], + "compilerOptions": { + "types": [ + "foo" + ], + "importsNotUsedAsValues": "error", + "module": "es2020", + "moduleResolution": "node", + "newLine": "lf", + "target": "esnext" + }, + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/regular/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/regular/tsconfig.json.parse.json new file mode 100644 index 0000000..7fed50d --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/regular/tsconfig.json.parse.json @@ -0,0 +1,20 @@ +{ + "files": [ + "foo.ts" + ], + "compilerOptions": { + "types": [ + "foo" + ], + "importsNotUsedAsValues": "error", + "module": "es2020", + "moduleResolution": "node", + "newLine": "lf", + "target": "esnext" + }, + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + } +} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/regular/expected.json b/packages/tsconfck/tests/snapshots/parse/valid/regular/tsconfig.json.to-json.json similarity index 100% rename from tests/fixtures/parse/valid/regular/expected.json rename to packages/tsconfck/tests/snapshots/parse/valid/regular/tsconfig.json.to-json.json diff --git a/packages/tsconfck/tests/snapshots/parse/valid/ts_node/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/ts_node/tsconfig.json.parse-native.json new file mode 100644 index 0000000..902cca2 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/ts_node/tsconfig.json.parse-native.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "noLib": false + }, + "ts-node": { + "preferTsExts": true, + "compilerOptions": { + "noLib": true + } + }, + "something": "bla" +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/ts_node/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/ts_node/tsconfig.json.parse.json new file mode 100644 index 0000000..902cca2 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/ts_node/tsconfig.json.parse.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "noLib": false + }, + "ts-node": { + "preferTsExts": true, + "compilerOptions": { + "noLib": true + } + }, + "something": "bla" +} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/ts_node/expected.json b/packages/tsconfck/tests/snapshots/parse/valid/ts_node/tsconfig.json.to-json.json similarity index 100% rename from tests/fixtures/parse/valid/ts_node/expected.json rename to packages/tsconfck/tests/snapshots/parse/valid/ts_node/tsconfig.json.to-json.json diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/array/tsconfig.json.parse-native.ignore-files.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/array/tsconfig.json.parse-native.ignore-files.json new file mode 100644 index 0000000..22068f0 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/array/tsconfig.json.parse-native.ignore-files.json @@ -0,0 +1,14 @@ +{ + "extends": [ + "./tsconfig.a.json", + "./tsconfig.b.json", + "./tsconfig.c.json" + ], + "files": [], + "include": [], + "compilerOptions": { + "strictNullChecks": true, + "disableSizeLimit": true, + "noImplicitAny": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/array/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/array/tsconfig.json.parse-native.json new file mode 100644 index 0000000..e9ed41a --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/array/tsconfig.json.parse-native.json @@ -0,0 +1,15 @@ +{ + "extends": [ + "./tsconfig.a.json", + "./tsconfig.b.json", + "./tsconfig.c.json" + ], + "files": [ + "src/**" + ], + "compilerOptions": { + "strictNullChecks": true, + "disableSizeLimit": true, + "noImplicitAny": true + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/array/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/array/tsconfig.json.parse.json new file mode 100644 index 0000000..d142059 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/array/tsconfig.json.parse.json @@ -0,0 +1,15 @@ +{ + "extends": [ + "./tsconfig.a.json", + "./tsconfig.b.json", + "./tsconfig.c.json" + ], + "compilerOptions": { + "strictNullChecks": true, + "noImplicitAny": true, + "disableSizeLimit": true + }, + "files": [ + "src/**" + ] +} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/with_extends/array/expected.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/array/tsconfig.json.to-json.json similarity index 100% rename from tests/fixtures/parse/valid/with_extends/array/expected.json rename to packages/tsconfck/tests/snapshots/parse/valid/with_extends/array/tsconfig.json.to-json.json diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/no_compileroptions/tsconfig.json.parse-native.ignore-files.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/no_compileroptions/tsconfig.json.parse-native.ignore-files.json new file mode 100644 index 0000000..f4f0f8d --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/no_compileroptions/tsconfig.json.parse-native.ignore-files.json @@ -0,0 +1,20 @@ +{ + "extends": "../tsconfig.parent.json", + "include": [], + "files": [], + "exclude": [ + "../**/foo/*" + ], + "compilerOptions": { + "types": [ + "bar" + ], + "strictNullChecks": false, + "noImplicitAny": true + }, + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/no_compileroptions/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/no_compileroptions/tsconfig.json.parse-native.json new file mode 100644 index 0000000..9f8a96e --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/no_compileroptions/tsconfig.json.parse-native.json @@ -0,0 +1,22 @@ +{ + "extends": "../tsconfig.parent.json", + "include": [ + "src/**/*", + "foo.ts" + ], + "exclude": [ + "../**/foo/*" + ], + "compilerOptions": { + "types": [ + "bar" + ], + "strictNullChecks": false, + "noImplicitAny": true + }, + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/no_compileroptions/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/no_compileroptions/tsconfig.json.parse.json new file mode 100644 index 0000000..a0a4fc7 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/no_compileroptions/tsconfig.json.parse.json @@ -0,0 +1,22 @@ +{ + "extends": "../tsconfig.parent.json", + "include": [ + "src/**/*", + "foo.ts" + ], + "compilerOptions": { + "types": [ + "bar" + ], + "strictNullChecks": false, + "noImplicitAny": true + }, + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + }, + "exclude": [ + "../**/foo/*" + ] +} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/with_extends/no_compileroptions/expected.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/no_compileroptions/tsconfig.json.to-json.json similarity index 100% rename from tests/fixtures/parse/valid/with_extends/no_compileroptions/expected.json rename to packages/tsconfck/tests/snapshots/parse/valid/with_extends/no_compileroptions/tsconfig.json.to-json.json diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node/tsconfig.json.parse-native.ignore-files.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node/tsconfig.json.parse-native.ignore-files.json new file mode 100644 index 0000000..644264b --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node/tsconfig.json.parse-native.ignore-files.json @@ -0,0 +1,21 @@ +{ + "extends": "@tsconfig/node18/tsconfig.json", + "compilerOptions": { + "lib": [ + "es2023" + ], + "module": "node16", + "target": "es2022", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "moduleResolution": "node16", + "types": [ + "foo" + ], + "strictNullChecks": true + }, + "include": [], + "files": [] +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node/tsconfig.json.parse-native.json new file mode 100644 index 0000000..1dc30c9 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node/tsconfig.json.parse-native.json @@ -0,0 +1,22 @@ +{ + "extends": "@tsconfig/node18/tsconfig.json", + "compilerOptions": { + "lib": [ + "es2023" + ], + "module": "node16", + "target": "es2022", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "moduleResolution": "node16", + "types": [ + "foo" + ], + "strictNullChecks": true + }, + "include": [ + "src/**/*" + ] +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node/tsconfig.json.parse.json new file mode 100644 index 0000000..45c577f --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node/tsconfig.json.parse.json @@ -0,0 +1,22 @@ +{ + "extends": "@tsconfig/node18/tsconfig.json", + "compilerOptions": { + "types": [ + "foo" + ], + "strictNullChecks": true, + "lib": [ + "es2023" + ], + "module": "node16", + "target": "es2022", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "moduleResolution": "node16" + }, + "include": [ + "src/**/*" + ] +} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/with_extends/node/expected.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node/tsconfig.json.to-json.json similarity index 69% rename from tests/fixtures/parse/valid/with_extends/node/expected.json rename to packages/tsconfck/tests/snapshots/parse/valid/with_extends/node/tsconfig.json.to-json.json index d640c1d..7e6625d 100644 --- a/tests/fixtures/parse/valid/with_extends/node/expected.json +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node/tsconfig.json.to-json.json @@ -1,5 +1,5 @@ { - "extends": "@tsconfig/node14/tsconfig.json", + "extends": "@tsconfig/node18/tsconfig.json", "compilerOptions": { "types": ["foo"], "strictNullChecks": true diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node_fallback/tsconfig.json.parse-native.ignore-files.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node_fallback/tsconfig.json.parse-native.ignore-files.json new file mode 100644 index 0000000..9e61ee2 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node_fallback/tsconfig.json.parse-native.ignore-files.json @@ -0,0 +1,21 @@ +{ + "extends": "@tsconfig/node18", + "compilerOptions": { + "lib": [ + "es2023" + ], + "module": "node16", + "target": "es2022", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "moduleResolution": "node16", + "types": [ + "foo" + ], + "strictNullChecks": true + }, + "include": [], + "files": [] +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node_fallback/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node_fallback/tsconfig.json.parse-native.json new file mode 100644 index 0000000..2ef02b0 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node_fallback/tsconfig.json.parse-native.json @@ -0,0 +1,22 @@ +{ + "extends": "@tsconfig/node18", + "compilerOptions": { + "lib": [ + "es2023" + ], + "module": "node16", + "target": "es2022", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "moduleResolution": "node16", + "types": [ + "foo" + ], + "strictNullChecks": true + }, + "include": [ + "src/**/*" + ] +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node_fallback/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node_fallback/tsconfig.json.parse.json new file mode 100644 index 0000000..e2509d8 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node_fallback/tsconfig.json.parse.json @@ -0,0 +1,22 @@ +{ + "extends": "@tsconfig/node18", + "compilerOptions": { + "types": [ + "foo" + ], + "strictNullChecks": true, + "lib": [ + "es2023" + ], + "module": "node16", + "target": "es2022", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "moduleResolution": "node16" + }, + "include": [ + "src/**/*" + ] +} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/with_extends/node_fallback/expected.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node_fallback/tsconfig.json.to-json.json similarity index 76% rename from tests/fixtures/parse/valid/with_extends/node_fallback/expected.json rename to packages/tsconfck/tests/snapshots/parse/valid/with_extends/node_fallback/tsconfig.json.to-json.json index efe5869..e9460d9 100644 --- a/tests/fixtures/parse/valid/with_extends/node_fallback/expected.json +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/node_fallback/tsconfig.json.to-json.json @@ -1,5 +1,5 @@ { - "extends": "@tsconfig/node14", + "extends": "@tsconfig/node18", "compilerOptions": { "types": ["foo"], "strictNullChecks": true diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/paths/src/tsconfig.json.parse-native.ignore-files.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/paths/src/tsconfig.json.parse-native.ignore-files.json new file mode 100644 index 0000000..339def7 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/paths/src/tsconfig.json.parse-native.ignore-files.json @@ -0,0 +1,30 @@ +{ + "extends": "../tsconfig.base", + "compilerOptions": { + "types": [ + "foo" + ], + "strictNullChecks": true, + "noImplicitAny": true, + "baseUrl": "/parse/valid/with_extends/paths", + "paths": { + "$lib": [ + "*", + "./lib" + ], + "$src": [ + "./src" + ] + } + }, + "files": [], + "include": [], + "exclude": [ + "../../**/foo/*" + ], + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/paths/src/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/paths/src/tsconfig.json.parse-native.json new file mode 100644 index 0000000..5519b97 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/paths/src/tsconfig.json.parse-native.json @@ -0,0 +1,32 @@ +{ + "extends": "../tsconfig.base", + "compilerOptions": { + "types": [ + "foo" + ], + "strictNullChecks": true, + "noImplicitAny": true, + "baseUrl": "/parse/valid/with_extends/paths", + "paths": { + "$lib": [ + "*", + "./lib" + ], + "$src": [ + "./src" + ] + } + }, + "include": [ + "../src/**/*", + "../lib/**/*" + ], + "exclude": [ + "../../**/foo/*" + ], + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/paths/src/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/paths/src/tsconfig.json.parse.json new file mode 100644 index 0000000..1caf258 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/paths/src/tsconfig.json.parse.json @@ -0,0 +1,32 @@ +{ + "extends": "../tsconfig.base", + "compilerOptions": { + "types": [ + "foo" + ], + "strictNullChecks": true, + "baseUrl": "/parse/valid/with_extends/paths", + "paths": { + "$lib": [ + "*", + "./lib" + ], + "$src": [ + "./src" + ] + }, + "noImplicitAny": true + }, + "include": [ + "../src/**/*", + "../lib/**/*" + ], + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + }, + "exclude": [ + "../../**/foo/*" + ] +} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/with_extends/paths/src/expected.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/paths/src/tsconfig.json.to-json.json similarity index 100% rename from tests/fixtures/parse/valid/with_extends/paths/src/expected.json rename to packages/tsconfck/tests/snapshots/parse/valid/with_extends/paths/src/tsconfig.json.to-json.json diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/simple/tsconfig.json.parse-native.ignore-files.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/simple/tsconfig.json.parse-native.ignore-files.json new file mode 100644 index 0000000..ac36221 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/simple/tsconfig.json.parse-native.ignore-files.json @@ -0,0 +1,20 @@ +{ + "extends": "../tsconfig.parent.json", + "compilerOptions": { + "types": [ + "foo" + ], + "strictNullChecks": true, + "noImplicitAny": true + }, + "include": [], + "files": [], + "exclude": [ + "../**/foo/*" + ], + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/simple/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/simple/tsconfig.json.parse-native.json new file mode 100644 index 0000000..8dd8a0c --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/simple/tsconfig.json.parse-native.json @@ -0,0 +1,22 @@ +{ + "extends": "../tsconfig.parent.json", + "compilerOptions": { + "types": [ + "foo" + ], + "strictNullChecks": true, + "noImplicitAny": true + }, + "include": [ + "src/**/*", + "foo.ts" + ], + "exclude": [ + "../**/foo/*" + ], + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/simple/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/simple/tsconfig.json.parse.json new file mode 100644 index 0000000..78a234d --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/simple/tsconfig.json.parse.json @@ -0,0 +1,22 @@ +{ + "extends": "../tsconfig.parent.json", + "compilerOptions": { + "types": [ + "foo" + ], + "strictNullChecks": true, + "noImplicitAny": true + }, + "include": [ + "src/**/*", + "foo.ts" + ], + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + }, + "exclude": [ + "../**/foo/*" + ] +} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/with_extends/simple/expected.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/simple/tsconfig.json.to-json.json similarity index 100% rename from tests/fixtures/parse/valid/with_extends/simple/expected.json rename to packages/tsconfck/tests/snapshots/parse/valid/with_extends/simple/tsconfig.json.to-json.json diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/without_json_extension/tsconfig.json.parse-native.ignore-files.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/without_json_extension/tsconfig.json.parse-native.ignore-files.json new file mode 100644 index 0000000..c3d781f --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/without_json_extension/tsconfig.json.parse-native.ignore-files.json @@ -0,0 +1,20 @@ +{ + "extends": "../tsconfig.parent", + "compilerOptions": { + "types": [ + "foo" + ], + "strictNullChecks": true, + "noImplicitAny": true + }, + "include": [], + "files": [], + "exclude": [ + "../**/foo/*" + ], + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/without_json_extension/tsconfig.json.parse-native.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/without_json_extension/tsconfig.json.parse-native.json new file mode 100644 index 0000000..90ba5f8 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/without_json_extension/tsconfig.json.parse-native.json @@ -0,0 +1,22 @@ +{ + "extends": "../tsconfig.parent", + "compilerOptions": { + "types": [ + "foo" + ], + "strictNullChecks": true, + "noImplicitAny": true + }, + "include": [ + "src/**/*", + "foo.ts" + ], + "exclude": [ + "../**/foo/*" + ], + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + } +} \ No newline at end of file diff --git a/packages/tsconfck/tests/snapshots/parse/valid/with_extends/without_json_extension/tsconfig.json.parse.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/without_json_extension/tsconfig.json.parse.json new file mode 100644 index 0000000..605d20b --- /dev/null +++ b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/without_json_extension/tsconfig.json.parse.json @@ -0,0 +1,22 @@ +{ + "extends": "../tsconfig.parent", + "compilerOptions": { + "types": [ + "foo" + ], + "strictNullChecks": true, + "noImplicitAny": true + }, + "include": [ + "src/**/*", + "foo.ts" + ], + "watchOptions": { + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + "fallbackPolling": "dynamicPriority" + }, + "exclude": [ + "../**/foo/*" + ] +} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/with_extends/without_json_extension/expected.json b/packages/tsconfck/tests/snapshots/parse/valid/with_extends/without_json_extension/tsconfig.json.to-json.json similarity index 100% rename from tests/fixtures/parse/valid/with_extends/without_json_extension/expected.json rename to packages/tsconfck/tests/snapshots/parse/valid/with_extends/without_json_extension/tsconfig.json.to-json.json diff --git a/tests/fixtures/transpile/simple/expected.esbuild.txt b/packages/tsconfck/tests/snapshots/transpile/simple/input.ts.esbuild.parse-native.js similarity index 100% rename from tests/fixtures/transpile/simple/expected.esbuild.txt rename to packages/tsconfck/tests/snapshots/transpile/simple/input.ts.esbuild.parse-native.js diff --git a/packages/tsconfck/tests/snapshots/transpile/simple/input.ts.esbuild.parse.js b/packages/tsconfck/tests/snapshots/transpile/simple/input.ts.esbuild.parse.js new file mode 100644 index 0000000..4f16716 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/transpile/simple/input.ts.esbuild.parse.js @@ -0,0 +1,3 @@ +class Foo { + foo; +} diff --git a/tests/fixtures/transpile/simple/expected.typescript.txt b/packages/tsconfck/tests/snapshots/transpile/simple/input.ts.typescript.parse-native.js similarity index 100% rename from tests/fixtures/transpile/simple/expected.typescript.txt rename to packages/tsconfck/tests/snapshots/transpile/simple/input.ts.typescript.parse-native.js diff --git a/packages/tsconfck/tests/snapshots/transpile/simple/input.ts.typescript.parse.js b/packages/tsconfck/tests/snapshots/transpile/simple/input.ts.typescript.parse.js new file mode 100644 index 0000000..316a073 --- /dev/null +++ b/packages/tsconfck/tests/snapshots/transpile/simple/input.ts.typescript.parse.js @@ -0,0 +1,11 @@ +var Foo = /** @class */ (function () { + function Foo() { + Object.defineProperty(this, "foo", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + } + return Foo; +}()); diff --git a/packages/tsconfck/tests/to-json.js b/packages/tsconfck/tests/to-json.js new file mode 100644 index 0000000..758fc0f --- /dev/null +++ b/packages/tsconfck/tests/to-json.js @@ -0,0 +1,35 @@ +import { describe, it, expect } from 'vitest'; +import { promises as fs } from 'node:fs'; +import { toJson } from '../src/to-json.js'; +import { globFixtures } from './util/fixture-paths.js'; +import { expectToMatchSnap } from './util/expect.js'; + +describe('toJson', () => { + it('should be a function', () => { + expect(toJson).toBeTypeOf('function'); + }); + + it('should return a string', () => { + expect(toJson('str')).toBeTypeOf('string'); + }); + + it('should throw for invalid tsconfigJson arg', async () => { + for (const tsconfigJson of [{}, [], 0, null, undefined]) { + expect(() => toJson(tsconfigJson), `toJson with arg type ${typeof tsconfigJson}`).toThrow(); + } + expect(() => toJson(), `toJson without arg`).toThrow(); + }); + + it('should convert tsconfig.json to regular json', async () => { + const samples = await globFixtures('parse/valid/**/tsconfig.json'); + for (const filename of samples) { + const tsconfigJson = await fs.readFile(filename, 'utf-8'); + const actual = toJson(tsconfigJson); + expect( + () => JSON.parse(actual), + `toJSON returns parsable json for ${filename}` + ).not.toThrow(); + expectToMatchSnap(actual, `toJSON for content of ${filename}`, filename, 'to-json.json'); + } + }); +}); diff --git a/packages/tsconfck/tests/util.js b/packages/tsconfck/tests/util.js new file mode 100644 index 0000000..543d87f --- /dev/null +++ b/packages/tsconfck/tests/util.js @@ -0,0 +1,114 @@ +import { describe, it, expect } from 'vitest'; +import path from 'node:path'; +import os from 'os'; +import { isGlobMatch, native2posix, resolve2posix } from '../src/util.js'; + +const GLOBMATCH_TEST_DATA = [ + { + files: [ + { name: 'bar.ts', expected: true }, + { name: 'baz.tsx', expected: true }, + { name: 'foo/bar.ts', expected: true }, + { name: 'foo/bar/baz.tsx', expected: true }, + { name: '../qoox.txt', expected: false }, + { name: '../xxx/qoox.txt', expected: false }, + { name: '../xxx/bar.ts', expected: false }, + { name: '../xxx/bar.tsx', expected: false }, + { name: '../bar.ts', expected: false }, + { name: '../bar.tsx', expected: false } + ], + patterns: ['**/*'], + allowJs: false + }, + { + files: [ + { name: 'a/bar.ts', expected: true }, + { name: 'foo/a/bar/baz.tsx', expected: true }, + { name: 'foo/a/bar.ts', expected: true }, + { name: 'foo/bar/a/baz.tsx', expected: true }, + { name: 'a/bar.txt', expected: false }, + { name: 'foo/abar/baz.tsx', expected: false }, + { name: 'foo/abar.ts', expected: false }, + { name: 'foo/bar/a/baz.txt', expected: false }, + { name: 'not-a/bar.ts', expected: false } + ], + patterns: ['**/a/**/*'], + allowJs: false + }, + { + files: [ + { name: 'bar.ts', expected: true }, + { name: 'foo/a/bar/baz.tsx', expected: false }, + { name: 'foo/a/bar.ts', expected: false }, + { name: '../foo/bar.ts', expected: false } + ], + patterns: ['*.ts'], + allowJs: false + }, + { + files: [ + { name: 'foo/bar.ts', expected: true }, + { name: '../foo/bar.ts', expected: false }, + { name: 'bar.ts', expected: false }, + { name: 'foo/a/bar.ts', expected: false } + ], + patterns: ['*/*'], + allowJs: false + }, + { + files: [ + { name: 'a/bar.ts', expected: true }, + { name: 'b/bar.ts', expected: true }, + { name: 'cc/bar.ts', expected: false }, + { name: '../foo/bar.ts', expected: false }, + { name: 'bar.ts', expected: false }, + { name: 'a/b/bar.ts', expected: false } + ], + patterns: ['?/*'], + allowJs: false + }, + { + files: [ + { name: 'bar.ts', expected: true }, + { name: 'bar.mts', expected: true }, + { name: 'bar.cts', expected: true }, + { name: 'baz.tsx', expected: true }, + { name: 'foo/bar.ts', expected: true }, + { name: 'foo/bar/baz.tsx', expected: true }, + { name: '../qoox.txt', expected: false }, + { name: '../xxx/qoox.txt', expected: false }, + { name: '../xxx/bar.ts', expected: false }, + { name: '../xxx/bar.tsx', expected: false }, + { name: '../bar.ts', expected: false }, + { name: '../bar.tsx', expected: false }, + { name: 'bar.js', expected: true }, + { name: 'bar.mjs', expected: true }, + { name: 'bar.cjs', expected: true }, + { name: 'baz.jsx', expected: true }, + { name: 'foo/bar.js', expected: true }, + { name: 'foo/bar/baz.jsx', expected: true }, + { name: '../xxx/bar.js', expected: false }, + { name: '../xxx/bar.jsx', expected: false }, + { name: '../bar.js', expected: false }, + { name: '../bar.jsx', expected: false } + ], + patterns: ['**/*'], + allowJs: true + } +]; +describe('util', () => { + describe('isGlobMatch', () => { + it('should work', () => { + const dir = native2posix(path.join(os.homedir(), 'foo', 'src')); + for (const { files, patterns, allowJs } of GLOBMATCH_TEST_DATA) { + for (const { name, expected } of files) { + const absName = resolve2posix(dir, name); + const actual = isGlobMatch(absName, dir, patterns, allowJs); + expect(actual, `isGlobMatch("${absName}","${dir}",${JSON.stringify(patterns)})`).toBe( + expected + ); + } + } + }); + }); +}); diff --git a/tests/util/copy-fixtures.ts b/packages/tsconfck/tests/util/copy-fixtures.js similarity index 57% rename from tests/util/copy-fixtures.ts rename to packages/tsconfck/tests/util/copy-fixtures.js index 8118902..57f706d 100644 --- a/tests/util/copy-fixtures.ts +++ b/packages/tsconfck/tests/util/copy-fixtures.js @@ -1,12 +1,18 @@ -import { promises as fs, Dirent } from 'fs'; -import path from 'path'; +import { promises as fs } from 'node:fs'; +import path from 'node:path'; -// eslint-disable-next-line no-unused-vars -export async function copyFixtures(from: string, to: string, filter?: (x: Dirent) => boolean) { +/** + * + * @param {string} from + * @param {string} to + * @param {(x:Dirent)=>boolean?}filter + * @returns {Promise} + */ +export async function copyFixtures(from, to, filter) { const src = path.join('tests', 'fixtures', from); const dest = path.join('tests', 'temp', to); try { - await fs.rmdir(dest, { recursive: true }); + await fs.rm(dest, { recursive: true }); } catch (e) { // ignore } @@ -14,8 +20,14 @@ export async function copyFixtures(from: string, to: string, filter?: (x: Dirent return dest; } -// eslint-disable-next-line no-unused-vars -async function copy(src: string, dest: string, filter?: (x: Dirent) => boolean) { +/** + * + * @param {string} src + * @param {string} dest + * @param {(x:Dirent)=>boolean?}filter + * @return {Promise} + */ +async function copy(src, dest, filter) { const [entries] = await Promise.all([ fs.readdir(src, { withFileTypes: true }), fs.mkdir(dest, { recursive: true }) diff --git a/packages/tsconfck/tests/util/expect.js b/packages/tsconfck/tests/util/expect.js new file mode 100644 index 0000000..95acf63 --- /dev/null +++ b/packages/tsconfck/tests/util/expect.js @@ -0,0 +1,56 @@ +import { expect } from 'vitest'; +import { fixtures, snapName } from './fixture-paths.js'; + +const fixtureDirRegex = new RegExp( + fixtures.replace(/[.*+?^${}()|[\]]/g, '\\$&').replace(/[/\\]/g, '[/\\\\]'), + 'g' +); +function normalizeSnapshot(str) { + return str + .replace(fixtureDirRegex, '') + .replace(/(\\[^\\ ]+)+/g, (m) => m.replace(/\\/g, '/')); +} +// TODO refactor after vitest is able to print regular json for toMatchFileSnapshot calls +/** + * + * @param {any} actual data to snapshot + * @param {string} message message to pass to expect + * @param inputFile file that is used as input for the test, used to build the snapshot output dir + * @param suffix suffix to append to the file to avoid snapshot collisions, use foo.bar.baz notation for multiple values, must end with extension that matches data + * @return {Promise} + */ +export async function expectToMatchSnap(actual, message, inputFile, suffix) { + const toJSON = typeof actual !== 'string'; + if (!suffix) { + throw new Error('suffix required'); + } + if (toJSON) { + if (!suffix.endsWith('.json')) { + suffix = suffix + '.json'; + } + } else { + if (!['.js', '.ts', '.json', '.txt'].some((ext) => suffix.endsWith(ext))) { + suffix = suffix + '.txt'; + } + } + const normalizedValue = normalizeSnapshot(toJSON ? JSON.stringify(actual, null, '\t') : actual); + + await expect(normalizedValue, message).toMatchFileSnapshot(snapName(inputFile, suffix), message); +} + +/** + * + * @param {string} errormessage + * @param {string} inputFile + * @param {string} suffix + * @return {Promise} + */ +export async function expectToMatchErrorSnap(errormessage, inputFile, suffix) { + const nodeMajor = process?.versions.node.split('.', 1)[0]; + const suffixes = ['error', `node${nodeMajor}`]; + if (suffix) { + suffixes.push(suffix); + } + suffixes.push('txt'); + await expectToMatchSnap(errormessage, `error for ${inputFile}`, inputFile, suffixes.join('.')); +} diff --git a/packages/tsconfck/tests/util/fixture-paths.js b/packages/tsconfck/tests/util/fixture-paths.js new file mode 100644 index 0000000..7301e02 --- /dev/null +++ b/packages/tsconfck/tests/util/fixture-paths.js @@ -0,0 +1,29 @@ +import { fileURLToPath } from 'node:url'; +import path from 'node:path'; +import glob from 'tiny-glob'; +import { native2posix } from '../../src/util.js'; +const cwd = process.cwd(); +const root = fileURLToPath(new URL('../..', import.meta.url)); +export const fixtures = fileURLToPath(new URL('../fixtures', import.meta.url)); +export const absRoot = (relative) => path.resolve(root, relative); +export const absFixture = (fixture) => path.resolve(fixtures, fixture); +export const posixAbsFix = (fixture) => native2posix(absFixture(fixture)); +export const relFixture = (fixture) => path.relative(cwd, absFixture(fixture)); +export const relFromFixtures = (fixture) => path.relative(fixtures, path.resolve(fixture)); +export const globFixtures = async (pattern) => + (await glob(`${fixtures}/${pattern}`)).map((file) => path.resolve(file)).sort(); +/** + * + * @param {string} file + * @param {string} suffix + * @return {string} + */ +export const snapName = (file, suffix) => { + const relPath = relFromFixtures(file); + const base = path.basename(relPath); + const dir = path.dirname(relPath); + const fileParts = base.split('.'); + const suffixParts = suffix?.split('.') ?? []; + const joined = [...fileParts, ...suffixParts].filter((s) => !!s); + return `snapshots/${dir}/${joined.join('.')}`; +}; diff --git a/packages/tsconfck/tsconfig.json b/packages/tsconfck/tsconfig.json new file mode 100644 index 0000000..2d093a3 --- /dev/null +++ b/packages/tsconfck/tsconfig.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "compilerOptions": { + "lib": ["es2023"], + "module": "esnext", + "target": "es2022", + "moduleResolution": "bundler", + "strict": true, + "forceConsistentCasingInFileNames": true, + "allowJs": true + }, + "include": ["bin/**/*", "src/**/*", "types/**/*"], + "exclude": ["node_modules"] +} diff --git a/packages/tsconfck/types/index.d.ts b/packages/tsconfck/types/index.d.ts new file mode 100644 index 0000000..9a0a484 --- /dev/null +++ b/packages/tsconfck/types/index.d.ts @@ -0,0 +1,249 @@ +declare module 'tsconfck' { + /** + * find the closest tsconfig.json file + * + * @param filename - path to file to find tsconfig for (absolute or relative to cwd) + * @param options - options + * @returns absolute path to closest tsconfig.json or null if not found + */ + export function find(filename: string, options?: TSConfckFindOptions | undefined): Promise; + /** + * find all tsconfig.json files in dir + * + * @param dir - path to dir (absolute or relative to cwd) + * @param options - options + * @returns list of absolute paths to all found tsconfig.json files + */ + export function findAll(dir: string, options?: TSConfckFindAllOptions | undefined): Promise; + /** + * convert content of tsconfig.json to regular json + * + * @param tsconfigJson - content of tsconfig.json + * @returns content as regular json, comments and dangling commas have been replaced with whitespace + */ + export function toJson(tsconfigJson: string): string; + /** + * find the closest tsconfig.json file using native ts.findConfigFile + * + * You must have `typescript` installed to use this + * + * @param filename - path to file to find tsconfig for (absolute or relative to cwd) + * @param options - options + * @returns absolute path to closest tsconfig.json + */ + export function findNative(filename: string, options?: TSConfckFindOptions | undefined): Promise; + export class TSConfckCache { + /** + * clear cache, use this if you have a long running process and tsconfig files have been added,changed or deleted + */ + clear(): void; + /** + * has cached closest config for files in dir + * */ + hasConfigPath(dir: string, configName?: string | undefined): boolean; + /** + * get cached closest tsconfig for files in dir + * @throws if cached value is an error + */ + getConfigPath(dir: string, configName?: string | undefined): Promise | string | null; + /** + * has parsed tsconfig for file + * */ + hasParseResult(file: string): boolean; + /** + * get parsed tsconfig for file + * @throws if cached value is an error + */ + getParseResult(file: string): Promise | T; + + private setParseResult; + + private setConfigPath; + #private; + } + /** + * parse the closest tsconfig.json file + * + * @param filename - path to a tsconfig .json or a source file or directory (absolute or relative to cwd) + * @param options - options + * */ + export function parse(filename: string, options?: TSConfckParseOptions | undefined): Promise; + export class TSConfckParseError extends Error { + /** + * + * @param message - error message + * @param code - error code + * @param tsconfigFile - path to tsconfig file + * @param cause - cause of this error + */ + constructor(message: string, code: string, tsconfigFile: string, cause: Error | null); + /** + * error code + * */ + code: string; + /** + * error cause + * */ + cause: Error | undefined; + /** + * absolute path of tsconfig file where the error happened + * */ + tsconfigFile: string; + } + /** + * parse the closest tsconfig.json file with typescript native functions + * + * You need to have `typescript` installed to use this + * + * @param filename - path to a tsconfig .json or a source file (absolute or relative to cwd) + * @param options - options + * */ + export function parseNative(filename: string, options?: TSConfckParseNativeOptions | undefined): Promise; + export class TSConfckParseNativeError extends Error { + /** + * + * @param diagnostic - diagnostics of ts + * @param tsconfigFile - file that errored + * @param result - parsed result, if any + */ + constructor(diagnostic: any, tsconfigFile: string, result: any | null); + /** + * code of typescript diagnostic, prefixed with "TS " + * */ + code: string; + /** + * full ts diagnostic that caused this error + * */ + diagnostic: any; + /** + * native result if present, contains all errors in result.errors + * */ + result: any | undefined; + /** + * absolute path of tsconfig file where the error happened + * */ + tsconfigFile: string; + } + interface TSConfckFindOptions { + /** + * A cache to improve performance for multiple calls in the same project + * + * Warning: You must clear this cache in case tsconfig files are added/removed during it's lifetime + */ + cache?: TSConfckCache; + + /** + * project root dir, does not continue scanning outside of this directory. + * + * Improves performance but may lead to different results from native typescript when no tsconfig is found inside root + */ + root?: string; + + /** + * set to true if you don't want to find tsconfig for files inside node_modules + * + * This is useful if you want to use the output with esbuild.transform as esbuild itself also ignores node_modules + * + * @default false + */ + ignoreNodeModules?: boolean; + + /** + * Override the default name of the config file to find. + * + * Use `jsconfig.json` in projects that have typechecking for js files with jsconfig.json + * + * @default tsconfig.json + */ + configName?: string; + } + + interface TSConfckParseOptions extends TSConfckFindOptions { + // same as find options + } + + interface TSConfckFindAllOptions { + /** + * helper to skip subdirectories when scanning for tsconfig.json + * + * eg ` dir => dir === 'node_modules' || dir === '.git'` + */ // eslint-disable-next-line no-unused-vars + skip?: (dir: string) => boolean; + /** + * list of config filenames to include, use ["tsconfig.json","jsconfig.json"] if you need both + * + * @default ["tsconfig.json"] + */ + configNames?: string[]; + } + + interface TSConfckParseResult { + /** + * absolute path to parsed tsconfig.json + */ + tsconfigFile: string; + + /** + * parsed result, including merged values from extended + */ + tsconfig: any; + + /** + * ParseResult for parent solution + */ + solution?: TSConfckParseResult; + + /** + * ParseResults for all tsconfig files referenced in a solution + */ + referenced?: TSConfckParseResult[]; + + /** + * ParseResult for all tsconfig files + * + * [a,b,c] where a extends b and b extends c + */ + extended?: TSConfckParseResult[]; + } + + interface TSConfckParseNativeOptions extends TSConfckParseOptions { + /** + * Set this option to true to force typescript to ignore all source files. + * + * This is faster - especially for large projects - but comes with 2 caveats + * + * 1) output tsconfig always has `files: [],include: []` instead of any real values configured. + * 2) as a result of 1), it won't be able to resolve solution-style references and always return the closest tsconfig + */ + ignoreSourceFiles?: boolean; + } + + interface TSConfckParseNativeResult { + /** + * absolute path to parsed tsconfig.json + */ + tsconfigFile: string; + + /** + * parsed result, including merged values from extended and normalized + */ + tsconfig: any; + + /** + * ParseResult for parent solution + */ + solution?: TSConfckParseNativeResult; + + /** + * ParseNativeResults for all tsconfig files referenced in a solution + */ + referenced?: TSConfckParseNativeResult[]; + + /** + * full output of ts.parseJsonConfigFileContent + */ + result: any; + } +} + +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/tsconfck/types/index.d.ts.map b/packages/tsconfck/types/index.d.ts.map new file mode 100644 index 0000000..1e15257 --- /dev/null +++ b/packages/tsconfck/types/index.d.ts.map @@ -0,0 +1,42 @@ +{ + "version": 3, + "file": "index.d.ts", + "names": [ + "find", + "findAll", + "toJson", + "findNative", + "TSConfckCache", + "parse", + "TSConfckParseError", + "parseNative", + "TSConfckParseNativeError", + "TSConfckFindOptions", + "TSConfckParseOptions", + "TSConfckFindAllOptions", + "TSConfckParseResult", + "TSConfckParseNativeOptions", + "TSConfckParseNativeResult" + ], + "sources": [ + "../src/find.js", + "../src/find-all.js", + "../src/to-json.js", + "../src/find-native.js", + "../src/cache.js", + "../src/parse.js", + "../src/parse-native.js", + "../src/public.d.ts" + ], + "sourcesContent": [ + null, + null, + null, + null, + null, + null, + null, + null + ], + "mappings": ";;;;;;;;iBAUsBA,IAAIA;;;;;;;;iBCYJC,OAAOA;;;;;;;iBCTbC,MAAMA;;;;;;;;;;iBCDAC,UAAUA;cCXnBC,aAAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC0BJC,KAAKA;cA4TdC,kBAAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC5TTC,WAAWA;cA6NpBC,wBAAwBA;;;;;;;;;;;;;;;;;;;;;;;;;WCtPpBC,mBAAmBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAkCnBC,oBAAoBA;;;;WAIpBC,sBAAsBA;;;;;;;;;;;;;;;WAetBC,mBAAmBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA6BnBC,0BAA0BA;;;;;;;;;;;;WAY1BC,yBAAyBA" +} \ No newline at end of file diff --git a/packages/tsconfck/vitest.config.js b/packages/tsconfck/vitest.config.js new file mode 100644 index 0000000..a656b91 --- /dev/null +++ b/packages/tsconfck/vitest.config.js @@ -0,0 +1,17 @@ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + globals: false, + include: ['tests/*.js'], + exclude: ['**/fixtures/**', '**/util/**', '**/node_modules/**', '**/temp/**'], + testTimeout: 20000, + reporters: 'dot', + maxThreads: process.env.CI ? 1 : undefined, + minThreads: process.env.CI ? 1 : undefined + }, + coverage: 'v8', + esbuild: { + target: 'node18' + } +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f3094bc..6b6c6f2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,97 +4,91 @@ settings: autoInstallPeers: false excludeLinksFromLockfile: false -devDependencies: - '@commitlint/cli': - specifier: ^17.6.7 - version: 17.6.7 - '@commitlint/config-conventional': - specifier: ^17.6.7 - version: 17.6.7 - '@tsconfig/node14': - specifier: ^14.1.0 - version: 14.1.0 - '@types/node': - specifier: ^20.4.8 - version: 20.4.8 - '@typescript-eslint/eslint-plugin': - specifier: ^6.2.1 - version: 6.2.1(@typescript-eslint/parser@6.2.1)(eslint@8.46.0)(typescript@5.1.6) - '@typescript-eslint/parser': - specifier: ^6.2.1 - version: 6.2.1(eslint@8.46.0)(typescript@5.1.6) - c8: - specifier: ^8.0.1 - version: 8.0.1 - chalk: - specifier: ^5.3.0 - version: 5.3.0 - conventional-changelog-cli: - specifier: ^3.0.0 - version: 3.0.0 - enquirer: - specifier: ^2.4.1 - version: 2.4.1 - esbuild: - specifier: ^0.18.18 - version: 0.18.18 - eslint: - specifier: ^8.46.0 - version: 8.46.0 - eslint-config-prettier: - specifier: ^9.0.0 - version: 9.0.0(eslint@8.46.0) - eslint-plugin-markdown: - specifier: ^3.0.1 - version: 3.0.1(eslint@8.46.0) - eslint-plugin-node: - specifier: ^11.1.0 - version: 11.1.0(eslint@8.46.0) - eslint-plugin-prettier: - specifier: ^5.0.0 - version: 5.0.0(eslint-config-prettier@9.0.0)(eslint@8.46.0)(prettier@3.0.1) - execa: - specifier: ^7.2.0 - version: 7.2.0 - husky: - specifier: ^8.0.3 - version: 8.0.3 - lint-staged: - specifier: ^13.2.3 - version: 13.2.3(enquirer@2.4.1) - minimist: - specifier: ^1.2.8 - version: 1.2.8 - npm-run-all: - specifier: ^4.1.5 - version: 4.1.5 - prettier: - specifier: ^3.0.1 - version: 3.0.1 - rimraf: - specifier: ^5.0.1 - version: 5.0.1 - semver: - specifier: ^7.5.4 - version: 7.5.4 - tiny-glob: - specifier: ^0.2.9 - version: 0.2.9 - tsm: - specifier: ^2.3.0 - version: 2.3.0 - tsup: - specifier: ^7.2.0 - version: 7.2.0(typescript@5.1.6) - typescript: - specifier: ^5.1.6 - version: 5.1.6 - uvu: - specifier: ^0.5.6 - version: 0.5.6 - watchlist: - specifier: ^0.3.1 - version: 0.3.1 +importers: + + .: + devDependencies: + '@changesets/cli': + specifier: ^2.26.2 + version: 2.26.2 + '@svitejs/changesets-changelog-github-compact': + specifier: ^1.1.0 + version: 1.1.0 + dts-buddy: + specifier: ^0.2.5 + version: 0.2.5 + esbuild: + specifier: ^0.19.4 + version: 0.19.4 + eslint: + specifier: ^8.51.0 + version: 8.51.0 + eslint-config-prettier: + specifier: ^9.0.0 + version: 9.0.0(eslint@8.51.0) + eslint-plugin-markdown: + specifier: ^3.0.1 + version: 3.0.1(eslint@8.51.0) + eslint-plugin-n: + specifier: ^16.1.0 + version: 16.1.0(eslint@8.51.0) + eslint-plugin-prettier: + specifier: ^5.0.0 + version: 5.0.0(eslint-config-prettier@9.0.0)(eslint@8.51.0)(prettier@3.0.3) + get-tsconfig: + specifier: ^4.7.2 + version: 4.7.2 + husky: + specifier: ^8.0.3 + version: 8.0.3 + lint-staged: + specifier: ^14.0.1 + version: 14.0.1 + npm-run-all: + specifier: ^4.1.5 + version: 4.1.5 + prettier: + specifier: ^3.0.3 + version: 3.0.3 + publint: + specifier: ^0.2.3 + version: 0.2.3 + tiny-glob: + specifier: ^0.2.9 + version: 0.2.9 + tinybench: + specifier: ^2.5.1 + version: 2.5.1 + tsconfck-2: + specifier: npm:tsconfck@^2.0.0 + version: /tsconfck@2.1.2 + tsconfck-3: + specifier: npm:tsconfck@^3.0.0-next.9 + version: link:packages/tsconfck + vitest: + specifier: ^0.34.6 + version: 0.34.6 + + packages/tsconfck: + devDependencies: + '@tsconfig/node18': + specifier: ^18.2.2 + version: 18.2.2 + '@vitest/coverage-v8': + specifier: ^0.34.6 + version: 0.34.6(vitest@0.34.6) + esbuild: + specifier: ^0.19.4 + version: 0.19.4 + tiny-glob: + specifier: ^0.2.9 + version: 0.2.9 + typescript: + specifier: ^5.2.2 + version: 5.2.2 + vitest: + specifier: ^0.34.6 + version: 0.34.6 packages: @@ -103,208 +97,251 @@ packages: engines: {node: '>=0.10.0'} dev: true - /@babel/code-frame@7.22.5: - resolution: {integrity: sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==} + /@ampproject/remapping@2.2.1: + resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.19 + dev: true + + /@babel/code-frame@7.22.13: + resolution: {integrity: sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/highlight': 7.22.5 + '@babel/highlight': 7.22.20 + chalk: 2.4.2 dev: true - /@babel/helper-validator-identifier@7.22.5: - resolution: {integrity: sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==} + /@babel/helper-validator-identifier@7.22.20: + resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} engines: {node: '>=6.9.0'} dev: true - /@babel/highlight@7.22.5: - resolution: {integrity: sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==} + /@babel/highlight@7.22.20: + resolution: {integrity: sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-validator-identifier': 7.22.5 + '@babel/helper-validator-identifier': 7.22.20 chalk: 2.4.2 js-tokens: 4.0.0 dev: true + /@babel/runtime@7.23.1: + resolution: {integrity: sha512-hC2v6p8ZSI/W0HUzh3V8C5g+NwSKzKPtJwSpTjwl0o297GP9+ZLQSkdvHz46CM3LqyoXxq+5G9komY+eSqSO0g==} + engines: {node: '>=6.9.0'} + dependencies: + regenerator-runtime: 0.14.0 + dev: true + /@bcoe/v8-coverage@0.2.3: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true - /@commitlint/cli@17.6.7: - resolution: {integrity: sha512-nzZmfO5KIOupYppn1MsnYX/80I+KDlxiwkks3CJT0XT+t34UgqGi3eSyEuzgcIjPlORk5/GMaAEiys78iLfGMg==} - engines: {node: '>=v14'} - hasBin: true + /@changesets/apply-release-plan@6.1.4: + resolution: {integrity: sha512-FMpKF1fRlJyCZVYHr3CbinpZZ+6MwvOtWUuO8uo+svcATEoc1zRDcj23pAurJ2TZ/uVz1wFHH6K3NlACy0PLew==} dependencies: - '@commitlint/format': 17.4.4 - '@commitlint/lint': 17.6.7 - '@commitlint/load': 17.6.7 - '@commitlint/read': 17.5.1 - '@commitlint/types': 17.4.4 - execa: 5.1.1 - lodash.isfunction: 3.0.9 + '@babel/runtime': 7.23.1 + '@changesets/config': 2.3.1 + '@changesets/get-version-range-type': 0.3.2 + '@changesets/git': 2.0.0 + '@changesets/types': 5.2.1 + '@manypkg/get-packages': 1.1.3 + detect-indent: 6.1.0 + fs-extra: 7.0.1 + lodash.startcase: 4.4.0 + outdent: 0.5.0 + prettier: 2.8.8 resolve-from: 5.0.0 - resolve-global: 1.0.0 - yargs: 17.7.2 - transitivePeerDependencies: - - '@swc/core' - - '@swc/wasm' + semver: 7.5.4 dev: true - /@commitlint/config-conventional@17.6.7: - resolution: {integrity: sha512-4oTpEUC0HRM54QRHBPMOJW1pETp7usxXn9RuNYNWHcmu8wi1mpws95hvS20u2n6HtIkTn0jfn7vHioCm4AGUTw==} - engines: {node: '>=v14'} + /@changesets/assemble-release-plan@5.2.4: + resolution: {integrity: sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==} dependencies: - conventional-changelog-conventionalcommits: 5.0.0 + '@babel/runtime': 7.23.1 + '@changesets/errors': 0.1.4 + '@changesets/get-dependents-graph': 1.3.6 + '@changesets/types': 5.2.1 + '@manypkg/get-packages': 1.1.3 + semver: 7.5.4 dev: true - /@commitlint/config-validator@17.6.7: - resolution: {integrity: sha512-vJSncmnzwMvpr3lIcm0I8YVVDJTzyjy7NZAeXbTXy+MPUdAr9pKyyg7Tx/ebOQ9kqzE6O9WT6jg2164br5UdsQ==} - engines: {node: '>=v14'} + /@changesets/changelog-git@0.1.14: + resolution: {integrity: sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA==} dependencies: - '@commitlint/types': 17.4.4 - ajv: 8.12.0 + '@changesets/types': 5.2.1 dev: true - /@commitlint/ensure@17.6.7: - resolution: {integrity: sha512-mfDJOd1/O/eIb/h4qwXzUxkmskXDL9vNPnZ4AKYKiZALz4vHzwMxBSYtyL2mUIDeU9DRSpEUins8SeKtFkYHSw==} - engines: {node: '>=v14'} + /@changesets/cli@2.26.2: + resolution: {integrity: sha512-dnWrJTmRR8bCHikJHl9b9HW3gXACCehz4OasrXpMp7sx97ECuBGGNjJhjPhdZNCvMy9mn4BWdplI323IbqsRig==} + hasBin: true dependencies: - '@commitlint/types': 17.4.4 - lodash.camelcase: 4.3.0 - lodash.kebabcase: 4.1.1 - lodash.snakecase: 4.1.1 - lodash.startcase: 4.4.0 - lodash.upperfirst: 4.3.1 + '@babel/runtime': 7.23.1 + '@changesets/apply-release-plan': 6.1.4 + '@changesets/assemble-release-plan': 5.2.4 + '@changesets/changelog-git': 0.1.14 + '@changesets/config': 2.3.1 + '@changesets/errors': 0.1.4 + '@changesets/get-dependents-graph': 1.3.6 + '@changesets/get-release-plan': 3.0.17 + '@changesets/git': 2.0.0 + '@changesets/logger': 0.0.5 + '@changesets/pre': 1.0.14 + '@changesets/read': 0.5.9 + '@changesets/types': 5.2.1 + '@changesets/write': 0.2.3 + '@manypkg/get-packages': 1.1.3 + '@types/is-ci': 3.0.1 + '@types/semver': 7.5.3 + ansi-colors: 4.1.3 + chalk: 2.4.2 + enquirer: 2.4.1 + external-editor: 3.1.0 + fs-extra: 7.0.1 + human-id: 1.0.2 + is-ci: 3.0.1 + meow: 6.1.1 + outdent: 0.5.0 + p-limit: 2.3.0 + preferred-pm: 3.1.2 + resolve-from: 5.0.0 + semver: 7.5.4 + spawndamnit: 2.0.0 + term-size: 2.2.1 + tty-table: 4.2.2 dev: true - /@commitlint/execute-rule@17.4.0: - resolution: {integrity: sha512-LIgYXuCSO5Gvtc0t9bebAMSwd68ewzmqLypqI2Kke1rqOqqDbMpYcYfoPfFlv9eyLIh4jocHWwCK5FS7z9icUA==} - engines: {node: '>=v14'} + /@changesets/config@2.3.1: + resolution: {integrity: sha512-PQXaJl82CfIXddUOppj4zWu+987GCw2M+eQcOepxN5s+kvnsZOwjEJO3DH9eVy+OP6Pg/KFEWdsECFEYTtbg6w==} + dependencies: + '@changesets/errors': 0.1.4 + '@changesets/get-dependents-graph': 1.3.6 + '@changesets/logger': 0.0.5 + '@changesets/types': 5.2.1 + '@manypkg/get-packages': 1.1.3 + fs-extra: 7.0.1 + micromatch: 4.0.5 dev: true - /@commitlint/format@17.4.4: - resolution: {integrity: sha512-+IS7vpC4Gd/x+uyQPTAt3hXs5NxnkqAZ3aqrHd5Bx/R9skyCAWusNlNbw3InDbAK6j166D9asQM8fnmYIa+CXQ==} - engines: {node: '>=v14'} + /@changesets/errors@0.1.4: + resolution: {integrity: sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==} dependencies: - '@commitlint/types': 17.4.4 - chalk: 4.1.2 + extendable-error: 0.1.7 dev: true - /@commitlint/is-ignored@17.6.7: - resolution: {integrity: sha512-vqyNRqtbq72P2JadaoWiuoLtXIs9SaAWDqdtef6G2zsoXqKFc7vqj1f+thzVgosXG3X/5K9jNp+iYijmvOfc/g==} - engines: {node: '>=v14'} + /@changesets/get-dependents-graph@1.3.6: + resolution: {integrity: sha512-Q/sLgBANmkvUm09GgRsAvEtY3p1/5OCzgBE5vX3vgb5CvW0j7CEljocx5oPXeQSNph6FXulJlXV3Re/v3K3P3Q==} dependencies: - '@commitlint/types': 17.4.4 - semver: 7.5.2 + '@changesets/types': 5.2.1 + '@manypkg/get-packages': 1.1.3 + chalk: 2.4.2 + fs-extra: 7.0.1 + semver: 7.5.4 dev: true - /@commitlint/lint@17.6.7: - resolution: {integrity: sha512-TW+AozfuOFMrHn+jdwtz0IWu8REKFp0eryOvoBp2r8IXNc4KihKB1spAiUB6SFyHD6hVVeolz12aHnJ3Mb+xVQ==} - engines: {node: '>=v14'} + /@changesets/get-github-info@0.5.2: + resolution: {integrity: sha512-JppheLu7S114aEs157fOZDjFqUDpm7eHdq5E8SSR0gUBTEK0cNSHsrSR5a66xs0z3RWuo46QvA3vawp8BxDHvg==} dependencies: - '@commitlint/is-ignored': 17.6.7 - '@commitlint/parse': 17.6.7 - '@commitlint/rules': 17.6.7 - '@commitlint/types': 17.4.4 + dataloader: 1.4.0 + node-fetch: 2.7.0 + transitivePeerDependencies: + - encoding dev: true - /@commitlint/load@17.6.7: - resolution: {integrity: sha512-QZ2rJTbX55BQdYrCm/p6+hh/pFBgC9nTJxfsrK6xRPe2thiQzHN0AQDBqBwAirn6gIkHrjIbCbtAE6kiDYLjrw==} - engines: {node: '>=v14'} + /@changesets/get-release-plan@3.0.17: + resolution: {integrity: sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==} dependencies: - '@commitlint/config-validator': 17.6.7 - '@commitlint/execute-rule': 17.4.0 - '@commitlint/resolve-extends': 17.6.7 - '@commitlint/types': 17.4.4 - '@types/node': 20.4.8 - chalk: 4.1.2 - cosmiconfig: 8.2.0 - cosmiconfig-typescript-loader: 4.4.0(@types/node@20.4.8)(cosmiconfig@8.2.0)(ts-node@10.9.1)(typescript@5.1.6) - lodash.isplainobject: 4.0.6 - lodash.merge: 4.6.2 - lodash.uniq: 4.5.0 - resolve-from: 5.0.0 - ts-node: 10.9.1(@types/node@20.4.8)(typescript@5.1.6) - typescript: 5.1.6 - transitivePeerDependencies: - - '@swc/core' - - '@swc/wasm' + '@babel/runtime': 7.23.1 + '@changesets/assemble-release-plan': 5.2.4 + '@changesets/config': 2.3.1 + '@changesets/pre': 1.0.14 + '@changesets/read': 0.5.9 + '@changesets/types': 5.2.1 + '@manypkg/get-packages': 1.1.3 dev: true - /@commitlint/message@17.4.2: - resolution: {integrity: sha512-3XMNbzB+3bhKA1hSAWPCQA3lNxR4zaeQAQcHj0Hx5sVdO6ryXtgUBGGv+1ZCLMgAPRixuc6en+iNAzZ4NzAa8Q==} - engines: {node: '>=v14'} + /@changesets/get-version-range-type@0.3.2: + resolution: {integrity: sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==} dev: true - /@commitlint/parse@17.6.7: - resolution: {integrity: sha512-ibO03BgEns+JJpohpBZYD49mCdSNMg6fTv7vA5yqzEFWkBQk5NWhEBw2yG+Z1UClStIRkMkAYyI2HzoQG9tCQQ==} - engines: {node: '>=v14'} + /@changesets/git@2.0.0: + resolution: {integrity: sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==} dependencies: - '@commitlint/types': 17.4.4 - conventional-changelog-angular: 5.0.13 - conventional-commits-parser: 3.2.4 + '@babel/runtime': 7.23.1 + '@changesets/errors': 0.1.4 + '@changesets/types': 5.2.1 + '@manypkg/get-packages': 1.1.3 + is-subdir: 1.2.0 + micromatch: 4.0.5 + spawndamnit: 2.0.0 dev: true - /@commitlint/read@17.5.1: - resolution: {integrity: sha512-7IhfvEvB//p9aYW09YVclHbdf1u7g7QhxeYW9ZHSO8Huzp8Rz7m05aCO1mFG7G8M+7yfFnXB5xOmG18brqQIBg==} - engines: {node: '>=v14'} + /@changesets/logger@0.0.5: + resolution: {integrity: sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==} dependencies: - '@commitlint/top-level': 17.4.0 - '@commitlint/types': 17.4.4 - fs-extra: 11.1.1 - git-raw-commits: 2.0.11 - minimist: 1.2.8 + chalk: 2.4.2 dev: true - /@commitlint/resolve-extends@17.6.7: - resolution: {integrity: sha512-PfeoAwLHtbOaC9bGn/FADN156CqkFz6ZKiVDMjuC2N5N0740Ke56rKU7Wxdwya8R8xzLK9vZzHgNbuGhaOVKIg==} - engines: {node: '>=v14'} + /@changesets/parse@0.3.16: + resolution: {integrity: sha512-127JKNd167ayAuBjUggZBkmDS5fIKsthnr9jr6bdnuUljroiERW7FBTDNnNVyJ4l69PzR57pk6mXQdtJyBCJKg==} dependencies: - '@commitlint/config-validator': 17.6.7 - '@commitlint/types': 17.4.4 - import-fresh: 3.3.0 - lodash.mergewith: 4.6.2 - resolve-from: 5.0.0 - resolve-global: 1.0.0 + '@changesets/types': 5.2.1 + js-yaml: 3.14.1 dev: true - /@commitlint/rules@17.6.7: - resolution: {integrity: sha512-x/SDwDTN3w3Gr5xkhrIORu96rlKCc8ZLYEMXRqi9+MB33st2mKcGvKa5uJuigHlbl3xm75bAAubATrodVrjguQ==} - engines: {node: '>=v14'} + /@changesets/pre@1.0.14: + resolution: {integrity: sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==} dependencies: - '@commitlint/ensure': 17.6.7 - '@commitlint/message': 17.4.2 - '@commitlint/to-lines': 17.4.0 - '@commitlint/types': 17.4.4 - execa: 5.1.1 + '@babel/runtime': 7.23.1 + '@changesets/errors': 0.1.4 + '@changesets/types': 5.2.1 + '@manypkg/get-packages': 1.1.3 + fs-extra: 7.0.1 dev: true - /@commitlint/to-lines@17.4.0: - resolution: {integrity: sha512-LcIy/6ZZolsfwDUWfN1mJ+co09soSuNASfKEU5sCmgFCvX5iHwRYLiIuoqXzOVDYOy7E7IcHilr/KS0e5T+0Hg==} - engines: {node: '>=v14'} + /@changesets/read@0.5.9: + resolution: {integrity: sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==} + dependencies: + '@babel/runtime': 7.23.1 + '@changesets/git': 2.0.0 + '@changesets/logger': 0.0.5 + '@changesets/parse': 0.3.16 + '@changesets/types': 5.2.1 + chalk: 2.4.2 + fs-extra: 7.0.1 + p-filter: 2.1.0 dev: true - /@commitlint/top-level@17.4.0: - resolution: {integrity: sha512-/1loE/g+dTTQgHnjoCy0AexKAEFyHsR2zRB4NWrZ6lZSMIxAhBJnmCqwao7b4H8888PsfoTBCLBYIw8vGnej8g==} - engines: {node: '>=v14'} - dependencies: - find-up: 5.0.0 + /@changesets/types@4.1.0: + resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==} dev: true - /@commitlint/types@17.4.4: - resolution: {integrity: sha512-amRN8tRLYOsxRr6mTnGGGvB5EmW/4DDjLMgiwK3CCVEmN6Sr/6xePGEpWaspKkckILuUORCwe6VfDBw6uj4axQ==} - engines: {node: '>=v14'} + /@changesets/types@5.2.1: + resolution: {integrity: sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==} + dev: true + + /@changesets/write@0.2.3: + resolution: {integrity: sha512-Dbamr7AIMvslKnNYsLFafaVORx4H0pvCA2MHqgtNCySMe1blImEyAEOzDmcgKAkgz4+uwoLz7demIrX+JBr/Xw==} dependencies: - chalk: 4.1.2 + '@babel/runtime': 7.23.1 + '@changesets/types': 5.2.1 + fs-extra: 7.0.1 + human-id: 1.0.2 + prettier: 2.8.8 dev: true - /@cspotcode/source-map-support@0.8.1: - resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + /@esbuild/android-arm64@0.18.20: + resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} engines: {node: '>=12'} - dependencies: - '@jridgewell/trace-mapping': 0.3.9 + cpu: [arm64] + os: [android] + requiresBuild: true dev: true + optional: true - /@esbuild/android-arm64@0.18.18: - resolution: {integrity: sha512-dkAPYzRHq3dNXIzOyAknYOzsx8o3KWaNiuu56B2rP9IFPmFWMS58WQcTlUQi6iloku8ZyHHMluCe5sTWhKq/Yw==} + /@esbuild/android-arm64@0.19.4: + resolution: {integrity: sha512-mRsi2vJsk4Bx/AFsNBqOH2fqedxn5L/moT58xgg51DjX1la64Z3Npicut2VbhvDFO26qjWtPMsVxCd80YTFVeg==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -312,8 +349,17 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.18.18: - resolution: {integrity: sha512-oBymf7ZwplAawSxmiSlBCf+FMcY0f4bs5QP2jn43JKUf0M9DnrUTjqa5RvFPl1elw+sMfcpfBRPK+rb+E1q7zg==} + /@esbuild/android-arm@0.18.20: + resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm@0.19.4: + resolution: {integrity: sha512-uBIbiYMeSsy2U0XQoOGVVcpIktjLMEKa7ryz2RLr7L/vTnANNEsPVAh4xOv7ondGz6ac1zVb0F8Jx20rQikffQ==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -321,8 +367,8 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.18.18: - resolution: {integrity: sha512-r7/pVcrUQMYkjvtE/1/n6BxhWM+/9tvLxDG1ev1ce4z3YsqoxMK9bbOM6bFcj0BowMeGQvOZWcBV182lFFKmrw==} + /@esbuild/android-x64@0.18.20: + resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -330,8 +376,26 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.18.18: - resolution: {integrity: sha512-MSe2iV9MAH3wfP0g+vzN9bp36rtPPuCSk+bT5E2vv/d8krvW5uB/Pi/Q5+txUZuxsG3GcO8dhygjnFq0wJU9hQ==} + /@esbuild/android-x64@0.19.4: + resolution: {integrity: sha512-4iPufZ1TMOD3oBlGFqHXBpa3KFT46aLl6Vy7gwed0ZSYgHaZ/mihbYb4t7Z9etjkC9Al3ZYIoOaHrU60gcMy7g==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64@0.18.20: + resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64@0.19.4: + resolution: {integrity: sha512-Lviw8EzxsVQKpbS+rSt6/6zjn9ashUZ7Tbuvc2YENgRl0yZTktGlachZ9KMJUsVjZEGFVu336kl5lBgDN6PmpA==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -339,8 +403,17 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.18.18: - resolution: {integrity: sha512-ARFYISOWkaifjcr48YtO70gcDNeOf1H2RnmOj6ip3xHIj66f3dAbhcd5Nph5np6oHI7DhHIcr9MWO18RvUL1bw==} + /@esbuild/darwin-x64@0.18.20: + resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64@0.19.4: + resolution: {integrity: sha512-YHbSFlLgDwglFn0lAO3Zsdrife9jcQXQhgRp77YiTDja23FrC2uwnhXMNkAucthsf+Psr7sTwYEryxz6FPAVqw==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -348,8 +421,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.18.18: - resolution: {integrity: sha512-BHnXmexzEWRU2ZySJosU0Ts0NRnJnNrMB6t4EiIaOSel73I8iLsNiTPLH0rJulAh19cYZutsB5XHK6N8fi5eMg==} + /@esbuild/freebsd-arm64@0.18.20: + resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -357,8 +430,17 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.18.18: - resolution: {integrity: sha512-n823w35wm0ZOobbuE//0sJjuz1Qj619+AwjgOcAJMN2pomZhH9BONCtn+KlfrmM/NWZ+27yB/eGVFzUIWLeh3w==} + /@esbuild/freebsd-arm64@0.19.4: + resolution: {integrity: sha512-vz59ijyrTG22Hshaj620e5yhs2dU1WJy723ofc+KUgxVCM6zxQESmWdMuVmUzxtGqtj5heHyB44PjV/HKsEmuQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-x64@0.18.20: + resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -366,8 +448,17 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.18.18: - resolution: {integrity: sha512-zANxnwF0sCinDcAqoMohGoWBK9QaFJ65Vgh0ZE+RXtURaMwx+RfmfLElqtnn7X8OYNckMoIXSg7u+tZ3tqTlrA==} + /@esbuild/freebsd-x64@0.19.4: + resolution: {integrity: sha512-3sRbQ6W5kAiVQRBWREGJNd1YE7OgzS0AmOGjDmX/qZZecq8NFlQsQH0IfXjjmD0XtUYqr64e0EKNFjMUlPL3Cw==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64@0.18.20: + resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -375,8 +466,26 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.18.18: - resolution: {integrity: sha512-Kck3jxPLQU4VeAGwe8Q4NU+IWIx+suULYOFUI9T0C2J1+UQlOHJ08ITN+MaJJ+2youzJOmKmcphH/t3SJxQ1Tw==} + /@esbuild/linux-arm64@0.19.4: + resolution: {integrity: sha512-ZWmWORaPbsPwmyu7eIEATFlaqm0QGt+joRE9sKcnVUG3oBbr/KYdNE2TnkzdQwX6EDRdg/x8Q4EZQTXoClUqqA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm@0.18.20: + resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm@0.19.4: + resolution: {integrity: sha512-z/4ArqOo9EImzTi4b6Vq+pthLnepFzJ92BnofU1jgNlcVb+UqynVFdoXMCFreTK7FdhqAzH0vmdwW5373Hm9pg==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -384,8 +493,17 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.18.18: - resolution: {integrity: sha512-+VHz2sIRlY5u8IlaLJpdf5TL2kM76yx186pW7bpTB+vLWpzcFQVP04L842ZB2Ty13A1VXUvy3DbU1jV65P2skg==} + /@esbuild/linux-ia32@0.18.20: + resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ia32@0.19.4: + resolution: {integrity: sha512-EGc4vYM7i1GRUIMqRZNCTzJh25MHePYsnQfKDexD8uPTCm9mK56NIL04LUfX2aaJ+C9vyEp2fJ7jbqFEYgO9lQ==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -393,8 +511,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.18.18: - resolution: {integrity: sha512-fXPEPdeGBvguo/1+Na8OIWz3667BN1cwbGtTEZWTd0qdyTsk5gGf9jVX8MblElbDb/Cpw6y5JiaQuL96YmvBwQ==} + /@esbuild/linux-loong64@0.18.20: + resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -402,8 +520,26 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.18.18: - resolution: {integrity: sha512-dLvRB87pIBIRnEIC32LIcgwK1JzlIuADIRjLKdUIpxauKwMuS/xMpN+cFl+0nN4RHNYOZ57DmXFFmQAcdlFOmw==} + /@esbuild/linux-loong64@0.19.4: + resolution: {integrity: sha512-WVhIKO26kmm8lPmNrUikxSpXcgd6HDog0cx12BUfA2PkmURHSgx9G6vA19lrlQOMw+UjMZ+l3PpbtzffCxFDRg==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-mips64el@0.18.20: + resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-mips64el@0.19.4: + resolution: {integrity: sha512-keYY+Hlj5w86hNp5JJPuZNbvW4jql7c1eXdBUHIJGTeN/+0QFutU3GrS+c27L+NTmzi73yhtojHk+lr2+502Mw==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -411,8 +547,17 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.18.18: - resolution: {integrity: sha512-fRChqIJZ7hLkXSKfBLYgsX9Ssb5OGCjk3dzCETF5QSS1qjTgayLv0ALUdJDB9QOh/nbWwp+qfLZU6md4XcjL7w==} + /@esbuild/linux-ppc64@0.18.20: + resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ppc64@0.19.4: + resolution: {integrity: sha512-tQ92n0WMXyEsCH4m32S21fND8VxNiVazUbU4IUGVXQpWiaAxOBvtOtbEt3cXIV3GEBydYsY8pyeRMJx9kn3rvw==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -420,8 +565,17 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.18.18: - resolution: {integrity: sha512-ALK/BT3u7Hoa/vHjow6W6+MKF0ohYcVcVA1EpskI4bkBPVuDLrUDqt2YFifg5UcZc8qup0CwQqWmFUd6VMNgaA==} + /@esbuild/linux-riscv64@0.18.20: + resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-riscv64@0.19.4: + resolution: {integrity: sha512-tRRBey6fG9tqGH6V75xH3lFPpj9E8BH+N+zjSUCnFOX93kEzqS0WdyJHkta/mmJHn7MBaa++9P4ARiU4ykjhig==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -429,8 +583,17 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.18.18: - resolution: {integrity: sha512-crT7jtOXd9iirY65B+mJQ6W0HWdNy8dtkZqKGWNcBnunpLcTCfne5y5bKic9bhyYzKpQEsO+C/VBPD8iF0RhRw==} + /@esbuild/linux-s390x@0.18.20: + resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-s390x@0.19.4: + resolution: {integrity: sha512-152aLpQqKZYhThiJ+uAM4PcuLCAOxDsCekIbnGzPKVBRUDlgaaAfaUl5NYkB1hgY6WN4sPkejxKlANgVcGl9Qg==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -438,8 +601,8 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.18.18: - resolution: {integrity: sha512-/NSgghjBOW9ELqjXDYxOCCIsvQUZpvua1/6NdnA9Vnrp9UzEydyDdFXljUjMMS9p5KxMzbMO9frjHYGVHBfCHg==} + /@esbuild/linux-x64@0.18.20: + resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -447,8 +610,26 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.18.18: - resolution: {integrity: sha512-8Otf05Vx5sZjLLDulgr5QS5lsWXMplKZEyHMArH9/S4olLlhzmdhQBPhzhJTNwaL2FJNdWcUPNGAcoD5zDTfUA==} + /@esbuild/linux-x64@0.19.4: + resolution: {integrity: sha512-Mi4aNA3rz1BNFtB7aGadMD0MavmzuuXNTaYL6/uiYIs08U7YMPETpgNn5oue3ICr+inKwItOwSsJDYkrE9ekVg==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64@0.18.20: + resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64@0.19.4: + resolution: {integrity: sha512-9+Wxx1i5N/CYo505CTT7T+ix4lVzEdz0uCoYGxM5JDVlP2YdDC1Bdz+Khv6IbqmisT0Si928eAxbmGkcbiuM/A==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -456,8 +637,17 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.18.18: - resolution: {integrity: sha512-tFiFF4kT5L5qhVrWJUNxEXWvvX8nK/UX9ZrB7apuTwY3f6+Xy4aFMBPwAVrBYtBd5MOUuyOVHK6HBZCAHkwUlw==} + /@esbuild/openbsd-x64@0.18.20: + resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-x64@0.19.4: + resolution: {integrity: sha512-MFsHleM5/rWRW9EivFssop+OulYVUoVcqkyOkjiynKBCGBj9Lihl7kh9IzrreDyXa4sNkquei5/DTP4uCk25xw==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -465,8 +655,8 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.18.18: - resolution: {integrity: sha512-MPogVV8Bzh8os4OM+YDGGsSzCzmNRiyKGtHoJyZLtI4BMmd6EcxmGlcEGK1uM46h1BiOyi7Z7teUtzzQhvkC+w==} + /@esbuild/sunos-x64@0.18.20: + resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -474,8 +664,17 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.18.18: - resolution: {integrity: sha512-YKD6LF/XXY9REu+ZL5RAsusiG48n602qxsMVh/E8FFD9hp4OyTQaL9fpE1ovxwQXqFio+tT0ITUGjDSSSPN13w==} + /@esbuild/sunos-x64@0.19.4: + resolution: {integrity: sha512-6Xq8SpK46yLvrGxjp6HftkDwPP49puU4OF0hEL4dTxqCbfx09LyrbUj/D7tmIRMj5D5FCUPksBbxyQhp8tmHzw==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-arm64@0.18.20: + resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -483,8 +682,26 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.18.18: - resolution: {integrity: sha512-NjSBmBsyZBTsZB6ga6rA6PfG/RHnwruUz/9YEVXcm4STGauFWvhYhOMhEyw1yU5NVgYYm8CH5AltCm77TS21/Q==} + /@esbuild/win32-arm64@0.19.4: + resolution: {integrity: sha512-PkIl7Jq4mP6ke7QKwyg4fD4Xvn8PXisagV/+HntWoDEdmerB2LTukRZg728Yd1Fj+LuEX75t/hKXE2Ppk8Hh1w==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32@0.18.20: + resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32@0.19.4: + resolution: {integrity: sha512-ga676Hnvw7/ycdKB53qPusvsKdwrWzEyJ+AtItHGoARszIqvjffTwaaW3b2L6l90i7MO9i+dlAW415INuRhSGg==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -492,8 +709,17 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.18.18: - resolution: {integrity: sha512-eTSg/gC3p3tdjj4roDhe5xu94l1s2jMazP8u2FsYO8SEKvSpPOO71EucprDn/IuErDPvTFUhV9lTw5z5WJCRKQ==} + /@esbuild/win32-x64@0.18.20: + resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-x64@0.19.4: + resolution: {integrity: sha512-HP0GDNla1T3ZL8Ko/SHAS2GgtjOg+VmWnnYLhuTksr++EnduYB0f3Y2LzHsUwb2iQ13JGoY6G3R8h6Du/WG6uA==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -501,29 +727,29 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.46.0): + /@eslint-community/eslint-utils@4.4.0(eslint@8.51.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: - eslint: 8.46.0 - eslint-visitor-keys: 3.4.2 + eslint: 8.51.0 + eslint-visitor-keys: 3.4.3 dev: true - /@eslint-community/regexpp@4.6.2: - resolution: {integrity: sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==} + /@eslint-community/regexpp@4.9.0: + resolution: {integrity: sha512-zJmuCWj2VLBt4c25CfBIbMZLGLyhkvs7LznyVX5HfpzeocThgIj5XQK4L+g3U36mMcx8bPMhGyPpwCATamC4jQ==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true - /@eslint/eslintrc@2.1.1: - resolution: {integrity: sha512-9t7ZA7NGGK8ckelF0PQCfcxIUzs1Md5rrO6U/c+FIQNanea5UZC0wqKXH4vHBccmu4ZJgZ2idtPeW7+Q2npOEA==} + /@eslint/eslintrc@2.1.2: + resolution: {integrity: sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 debug: 4.3.4 espree: 9.6.1 - globals: 13.20.0 + globals: 13.22.0 ignore: 5.2.4 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -533,13 +759,13 @@ packages: - supports-color dev: true - /@eslint/js@8.46.0: - resolution: {integrity: sha512-a8TLtmPi8xzPkCbp/OGFUo5yhRkHM2Ko9kOWP4znJr0WAhWyThaw3PnwX4vOTWOAMsV2uRt32PPDcEz63esSaA==} + /@eslint/js@8.51.0: + resolution: {integrity: sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@humanwhocodes/config-array@0.11.10: - resolution: {integrity: sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==} + /@humanwhocodes/config-array@0.11.11: + resolution: {integrity: sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==} engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.1 @@ -558,40 +784,25 @@ packages: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} dev: true - /@hutson/parse-repository-url@3.0.2: - resolution: {integrity: sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q==} - engines: {node: '>=6.9.0'} - dev: true - - /@isaacs/cliui@8.0.2: - resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} - engines: {node: '>=12'} - dependencies: - string-width: 5.1.2 - string-width-cjs: /string-width@4.2.3 - strip-ansi: 7.1.0 - strip-ansi-cjs: /strip-ansi@6.0.1 - wrap-ansi: 8.1.0 - wrap-ansi-cjs: /wrap-ansi@7.0.0 - dev: true - /@istanbuljs/schema@0.1.3: resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} engines: {node: '>=8'} dev: true + /@jest/schemas@29.6.3: + resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@sinclair/typebox': 0.27.8 + dev: true + /@jridgewell/gen-mapping@0.3.3: resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} engines: {node: '>=6.0.0'} dependencies: '@jridgewell/set-array': 1.1.2 '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.18 - dev: true - - /@jridgewell/resolve-uri@3.1.0: - resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} - engines: {node: '>=6.0.0'} + '@jridgewell/trace-mapping': 0.3.19 dev: true /@jridgewell/resolve-uri@3.1.1: @@ -604,26 +815,42 @@ packages: engines: {node: '>=6.0.0'} dev: true - /@jridgewell/sourcemap-codec@1.4.14: - resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} + /@jridgewell/source-map@0.3.5: + resolution: {integrity: sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==} + dependencies: + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.19 dev: true /@jridgewell/sourcemap-codec@1.4.15: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} dev: true - /@jridgewell/trace-mapping@0.3.18: - resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==} + /@jridgewell/trace-mapping@0.3.19: + resolution: {integrity: sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==} dependencies: - '@jridgewell/resolve-uri': 3.1.0 - '@jridgewell/sourcemap-codec': 1.4.14 + '@jridgewell/resolve-uri': 3.1.1 + '@jridgewell/sourcemap-codec': 1.4.15 dev: true - /@jridgewell/trace-mapping@0.3.9: - resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + /@manypkg/find-root@1.1.0: + resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} dependencies: - '@jridgewell/resolve-uri': 3.1.1 - '@jridgewell/sourcemap-codec': 1.4.15 + '@babel/runtime': 7.23.1 + '@types/node': 12.20.55 + find-up: 4.1.0 + fs-extra: 8.1.0 + dev: true + + /@manypkg/get-packages@1.1.3: + resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} + dependencies: + '@babel/runtime': 7.23.1 + '@changesets/types': 4.1.0 + '@manypkg/find-root': 1.1.0 + fs-extra: 8.1.0 + globby: 11.1.0 + read-yaml-file: 1.1.0 dev: true /@nodelib/fs.scandir@2.1.5: @@ -647,13 +874,6 @@ packages: fastq: 1.15.0 dev: true - /@pkgjs/parseargs@0.11.0: - resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} - engines: {node: '>=14'} - requiresBuild: true - dev: true - optional: true - /@pkgr/utils@2.4.2: resolution: {integrity: sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} @@ -663,201 +883,134 @@ packages: is-glob: 4.0.3 open: 9.1.0 picocolors: 1.0.0 - tslib: 2.6.1 + tslib: 2.6.2 dev: true - /@tsconfig/node10@1.0.9: - resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} + /@sinclair/typebox@0.27.8: + resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: true - /@tsconfig/node12@1.0.11: - resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + /@svitejs/changesets-changelog-github-compact@1.1.0: + resolution: {integrity: sha512-qhUGGDHcpbY2zpjW3SwqchuW8J/5EzlPFud7xNntHKA7f3a/mx5+g+ruJKFHSAiVZYo30PALt+AyhmPUNKH/Og==} + engines: {node: ^14.13.1 || ^16.0.0 || >=18} + dependencies: + '@changesets/get-github-info': 0.5.2 + dotenv: 16.3.1 + transitivePeerDependencies: + - encoding dev: true - /@tsconfig/node14@1.0.3: - resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + /@tsconfig/node18@18.2.2: + resolution: {integrity: sha512-d6McJeGsuoRlwWZmVIeE8CUA27lu6jLjvv1JzqmpsytOYYbVi1tHZEnwCNVOXnj4pyLvneZlFlpXUK+X9wBWyw==} dev: true - /@tsconfig/node14@14.1.0: - resolution: {integrity: sha512-VmsCG04YR58ciHBeJKBDNMWWfYbyP8FekWVuTlpstaUPlat1D0x/tXzkWP7yCMU0eSz9V4OZU0LBWTFJ3xZf6w==} + /@types/chai-subset@1.3.3: + resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==} + dependencies: + '@types/chai': 4.3.6 dev: true - /@tsconfig/node16@1.0.4: - resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + /@types/chai@4.3.6: + resolution: {integrity: sha512-VOVRLM1mBxIRxydiViqPcKn6MIxZytrbMpd6RJLIWKxUNr3zux8no0Oc7kJx0WAPIitgZ0gkrDS+btlqQpubpw==} dev: true - /@types/istanbul-lib-coverage@2.0.4: - resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} + /@types/is-ci@3.0.1: + resolution: {integrity: sha512-mnb1ngaGQPm6LFZaNdh3xPOoQMkrQb/KBPhPPN2p2Wk8XgeUqWj6xPnvyQ8rvcK/VFritVmQG8tvQuy7g+9/nQ==} + dependencies: + ci-info: 3.8.0 dev: true - /@types/json-schema@7.0.12: - resolution: {integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==} + /@types/istanbul-lib-coverage@2.0.4: + resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} dev: true - /@types/mdast@3.0.12: - resolution: {integrity: sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==} + /@types/mdast@3.0.13: + resolution: {integrity: sha512-HjiGiWedR0DVFkeNljpa6Lv4/IZU1+30VY5d747K7lBudFc3R0Ibr6yJ9lN3BE28VnZyDfLF/VB1Ql1ZIbKrmg==} dependencies: - '@types/unist': 2.0.7 + '@types/unist': 2.0.8 dev: true - /@types/minimist@1.2.2: - resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} + /@types/minimist@1.2.3: + resolution: {integrity: sha512-ZYFzrvyWUNhaPomn80dsMNgMeXxNWZBdkuG/hWlUvXvbdUH8ZERNBGXnU87McuGcWDsyzX2aChCv/SVN348k3A==} dev: true - /@types/node@20.4.8: - resolution: {integrity: sha512-0mHckf6D2DiIAzh8fM8f3HQCvMKDpK94YQ0DSVkfWTG9BZleYIWudw9cJxX8oCk9bM+vAkDyujDV6dmKHbvQpg==} + /@types/node@12.20.55: + resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} dev: true - /@types/normalize-package-data@2.4.1: - resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} + /@types/node@20.8.0: + resolution: {integrity: sha512-LzcWltT83s1bthcvjBmiBvGJiiUe84NWRHkw+ZV6Fr41z2FbIzvc815dk2nQ3RAKMuN2fkenM/z3Xv2QzEpYxQ==} dev: true - /@types/semver@7.5.0: - resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} + /@types/normalize-package-data@2.4.2: + resolution: {integrity: sha512-lqa4UEhhv/2sjjIQgjX8B+RBjj47eo0mzGasklVJ78UKGQY1r0VpB9XHDaZZO9qzEFDdy4MrXLuEaSmPrPSe/A==} dev: true - /@types/unist@2.0.7: - resolution: {integrity: sha512-cputDpIbFgLUaGQn6Vqg3/YsJwxUwHLO13v3i5ouxT4lat0khip9AEWxtERujXV9wxIB1EyF97BSJFt6vpdI8g==} + /@types/semver@7.5.3: + resolution: {integrity: sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw==} dev: true - /@typescript-eslint/eslint-plugin@6.2.1(@typescript-eslint/parser@6.2.1)(eslint@8.46.0)(typescript@5.1.6): - resolution: {integrity: sha512-iZVM/ALid9kO0+I81pnp1xmYiFyqibAHzrqX4q5YvvVEyJqY+e6rfTXSCsc2jUxGNqJqTfFSSij/NFkZBiBzLw==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha - eslint: ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@eslint-community/regexpp': 4.6.2 - '@typescript-eslint/parser': 6.2.1(eslint@8.46.0)(typescript@5.1.6) - '@typescript-eslint/scope-manager': 6.2.1 - '@typescript-eslint/type-utils': 6.2.1(eslint@8.46.0)(typescript@5.1.6) - '@typescript-eslint/utils': 6.2.1(eslint@8.46.0)(typescript@5.1.6) - '@typescript-eslint/visitor-keys': 6.2.1 - debug: 4.3.4 - eslint: 8.46.0 - graphemer: 1.4.0 - ignore: 5.2.4 - natural-compare: 1.4.0 - natural-compare-lite: 1.4.0 - semver: 7.5.4 - ts-api-utils: 1.0.1(typescript@5.1.6) - typescript: 5.1.6 - transitivePeerDependencies: - - supports-color + /@types/unist@2.0.8: + resolution: {integrity: sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw==} dev: true - /@typescript-eslint/parser@6.2.1(eslint@8.46.0)(typescript@5.1.6): - resolution: {integrity: sha512-Ld+uL1kYFU8e6btqBFpsHkwQ35rw30IWpdQxgOqOh4NfxSDH6uCkah1ks8R/RgQqI5hHPXMaLy9fbFseIe+dIg==} - engines: {node: ^16.0.0 || >=18.0.0} + /@vitest/coverage-v8@0.34.6(vitest@0.34.6): + resolution: {integrity: sha512-fivy/OK2d/EsJFoEoxHFEnNGTg+MmdZBAVK9Ka4qhXR2K3J0DS08vcGVwzDtXSuUMabLv4KtPcpSKkcMXFDViw==} peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + vitest: '>=0.32.0 <1' dependencies: - '@typescript-eslint/scope-manager': 6.2.1 - '@typescript-eslint/types': 6.2.1 - '@typescript-eslint/typescript-estree': 6.2.1(typescript@5.1.6) - '@typescript-eslint/visitor-keys': 6.2.1 - debug: 4.3.4 - eslint: 8.46.0 - typescript: 5.1.6 + '@ampproject/remapping': 2.2.1 + '@bcoe/v8-coverage': 0.2.3 + istanbul-lib-coverage: 3.2.0 + istanbul-lib-report: 3.0.1 + istanbul-lib-source-maps: 4.0.1 + istanbul-reports: 3.1.6 + magic-string: 0.30.4 + picocolors: 1.0.0 + std-env: 3.4.3 + test-exclude: 6.0.0 + v8-to-istanbul: 9.1.0 + vitest: 0.34.6 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager@6.2.1: - resolution: {integrity: sha512-UCqBF9WFqv64xNsIEPfBtenbfodPXsJ3nPAr55mGPkQIkiQvgoWNo+astj9ZUfJfVKiYgAZDMnM6dIpsxUMp3Q==} - engines: {node: ^16.0.0 || >=18.0.0} + /@vitest/expect@0.34.6: + resolution: {integrity: sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw==} dependencies: - '@typescript-eslint/types': 6.2.1 - '@typescript-eslint/visitor-keys': 6.2.1 + '@vitest/spy': 0.34.6 + '@vitest/utils': 0.34.6 + chai: 4.3.10 dev: true - /@typescript-eslint/type-utils@6.2.1(eslint@8.46.0)(typescript@5.1.6): - resolution: {integrity: sha512-fTfCgomBMIgu2Dh2Or3gMYgoNAnQm3RLtRp+jP7A8fY+LJ2+9PNpi5p6QB5C4RSP+U3cjI0vDlI3mspAkpPVbQ==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + /@vitest/runner@0.34.6: + resolution: {integrity: sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ==} dependencies: - '@typescript-eslint/typescript-estree': 6.2.1(typescript@5.1.6) - '@typescript-eslint/utils': 6.2.1(eslint@8.46.0)(typescript@5.1.6) - debug: 4.3.4 - eslint: 8.46.0 - ts-api-utils: 1.0.1(typescript@5.1.6) - typescript: 5.1.6 - transitivePeerDependencies: - - supports-color + '@vitest/utils': 0.34.6 + p-limit: 4.0.0 + pathe: 1.1.1 dev: true - /@typescript-eslint/types@6.2.1: - resolution: {integrity: sha512-528bGcoelrpw+sETlyM91k51Arl2ajbNT9L4JwoXE2dvRe1yd8Q64E4OL7vHYw31mlnVsf+BeeLyAZUEQtqahQ==} - engines: {node: ^16.0.0 || >=18.0.0} - dev: true - - /@typescript-eslint/typescript-estree@6.2.1(typescript@5.1.6): - resolution: {integrity: sha512-G+UJeQx9AKBHRQBpmvr8T/3K5bJa485eu+4tQBxFq0KoT22+jJyzo1B50JDT9QdC1DEmWQfdKsa8ybiNWYsi0Q==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + /@vitest/snapshot@0.34.6: + resolution: {integrity: sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w==} dependencies: - '@typescript-eslint/types': 6.2.1 - '@typescript-eslint/visitor-keys': 6.2.1 - debug: 4.3.4 - globby: 11.1.0 - is-glob: 4.0.3 - semver: 7.5.4 - ts-api-utils: 1.0.1(typescript@5.1.6) - typescript: 5.1.6 - transitivePeerDependencies: - - supports-color + magic-string: 0.30.4 + pathe: 1.1.1 + pretty-format: 29.7.0 dev: true - /@typescript-eslint/utils@6.2.1(eslint@8.46.0)(typescript@5.1.6): - resolution: {integrity: sha512-eBIXQeupYmxVB6S7x+B9SdBeB6qIdXKjgQBge2J+Ouv8h9Cxm5dHf/gfAZA6dkMaag+03HdbVInuXMmqFB/lKQ==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.46.0) - '@types/json-schema': 7.0.12 - '@types/semver': 7.5.0 - '@typescript-eslint/scope-manager': 6.2.1 - '@typescript-eslint/types': 6.2.1 - '@typescript-eslint/typescript-estree': 6.2.1(typescript@5.1.6) - eslint: 8.46.0 - semver: 7.5.4 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /@typescript-eslint/visitor-keys@6.2.1: - resolution: {integrity: sha512-iTN6w3k2JEZ7cyVdZJTVJx2Lv7t6zFA8DCrJEHD2mwfc16AEvvBWVhbFh34XyG2NORCd0viIgQY1+u7kPI0WpA==} - engines: {node: ^16.0.0 || >=18.0.0} + /@vitest/spy@0.34.6: + resolution: {integrity: sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ==} dependencies: - '@typescript-eslint/types': 6.2.1 - eslint-visitor-keys: 3.4.2 + tinyspy: 2.1.1 dev: true - /JSONStream@1.3.5: - resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} - hasBin: true + /@vitest/utils@0.34.6: + resolution: {integrity: sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==} dependencies: - jsonparse: 1.3.1 - through: 2.3.8 + diff-sequences: 29.6.3 + loupe: 2.3.6 + pretty-format: 29.7.0 dev: true /acorn-jsx@5.3.2(acorn@8.10.0): @@ -879,18 +1032,6 @@ packages: hasBin: true dev: true - /add-stream@1.0.0: - resolution: {integrity: sha512-qQLMr+8o0WC4FZGQTcJiKBVC59JylcPSrTtk6usvmIDFUOCKegapy1VHQwRbFMOFyb/inzUVqHs+eMYKDM1YeQ==} - dev: true - - /aggregate-error@3.1.0: - resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} - engines: {node: '>=8'} - dependencies: - clean-stack: 2.2.0 - indent-string: 4.0.0 - dev: true - /ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} dependencies: @@ -900,25 +1041,16 @@ packages: uri-js: 4.4.1 dev: true - /ajv@8.12.0: - resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} - dependencies: - fast-deep-equal: 3.1.3 - json-schema-traverse: 1.0.0 - require-from-string: 2.0.2 - uri-js: 4.4.1 - dev: true - /ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} dev: true - /ansi-escapes@4.3.2: - resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} - engines: {node: '>=8'} + /ansi-escapes@5.0.0: + resolution: {integrity: sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==} + engines: {node: '>=12'} dependencies: - type-fest: 0.21.3 + type-fest: 1.4.0 dev: true /ansi-regex@5.0.1: @@ -945,25 +1077,20 @@ packages: color-convert: 2.0.1 dev: true + /ansi-styles@5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + dev: true + /ansi-styles@6.2.1: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} dev: true - /any-promise@1.3.0: - resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} - dev: true - - /anymatch@3.1.3: - resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} - engines: {node: '>= 8'} + /argparse@1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: - normalize-path: 3.0.0 - picomatch: 2.3.1 - dev: true - - /arg@4.1.3: - resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + sprintf-js: 1.0.3 dev: true /argparse@2.0.1: @@ -977,22 +1104,29 @@ packages: is-array-buffer: 3.0.2 dev: true - /array-ify@1.0.0: - resolution: {integrity: sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==} - dev: true - /array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} dev: true - /arraybuffer.prototype.slice@1.0.1: - resolution: {integrity: sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==} + /array.prototype.flat@1.3.2: + resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.1 + es-abstract: 1.22.2 + es-shim-unscopables: 1.0.0 + dev: true + + /arraybuffer.prototype.slice@1.0.2: + resolution: {integrity: sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==} engines: {node: '>= 0.4'} dependencies: array-buffer-byte-length: 1.0.0 call-bind: 1.0.2 - define-properties: 1.2.0 + define-properties: 1.2.1 + es-abstract: 1.22.2 get-intrinsic: 1.2.1 is-array-buffer: 3.0.2 is-shared-array-buffer: 1.0.2 @@ -1003,9 +1137,8 @@ packages: engines: {node: '>=0.10.0'} dev: true - /astral-regex@2.0.0: - resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} - engines: {node: '>=8'} + /assertion-error@1.1.0: + resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} dev: true /available-typed-arrays@1.0.5: @@ -1017,16 +1150,18 @@ packages: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} dev: true + /better-path-resolve@1.0.0: + resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} + engines: {node: '>=4'} + dependencies: + is-windows: 1.0.2 + dev: true + /big-integer@1.6.51: resolution: {integrity: sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==} engines: {node: '>=0.6'} dev: true - /binary-extensions@2.2.0: - resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} - engines: {node: '>=8'} - dev: true - /bplist-parser@0.2.0: resolution: {integrity: sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==} engines: {node: '>= 5.10.0'} @@ -1054,40 +1189,23 @@ packages: fill-range: 7.0.1 dev: true - /bundle-name@3.0.0: - resolution: {integrity: sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==} - engines: {node: '>=12'} + /breakword@1.0.6: + resolution: {integrity: sha512-yjxDAYyK/pBvws9H4xKYpLDpYKEH6CzrBPAuXq3x18I+c/2MkVtT3qAr7Oloi6Dss9qNhPVueAAVU1CSeNDIXw==} dependencies: - run-applescript: 5.0.0 + wcwidth: 1.0.1 dev: true - /bundle-require@4.0.1(esbuild@0.18.18): - resolution: {integrity: sha512-9NQkRHlNdNpDBGmLpngF3EFDcwodhMUuLz9PaWYciVcQF9SE4LFjM2DB/xV1Li5JiuDMv7ZUWuC3rGbqR0MAXQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - peerDependencies: - esbuild: ^0.18.18 + /builtins@5.0.1: + resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==} dependencies: - esbuild: 0.18.18 - load-tsconfig: 0.2.5 + semver: 7.5.4 dev: true - /c8@8.0.1: - resolution: {integrity: sha512-EINpopxZNH1mETuI0DzRA4MZpAUH+IFiRhnmFD3vFr3vdrgxqi3VfE3KL0AIL+zDq8rC9bZqwM/VDmmoe04y7w==} + /bundle-name@3.0.0: + resolution: {integrity: sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==} engines: {node: '>=12'} - hasBin: true dependencies: - '@bcoe/v8-coverage': 0.2.3 - '@istanbuljs/schema': 0.1.3 - find-up: 5.0.0 - foreground-child: 2.0.0 - istanbul-lib-coverage: 3.2.0 - istanbul-lib-report: 3.0.1 - istanbul-reports: 3.1.6 - rimraf: 3.0.2 - test-exclude: 6.0.0 - v8-to-istanbul: 9.1.0 - yargs: 17.7.2 - yargs-parser: 21.1.1 + run-applescript: 5.0.0 dev: true /cac@6.7.14: @@ -1121,6 +1239,19 @@ packages: engines: {node: '>=6'} dev: true + /chai@4.3.10: + resolution: {integrity: sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==} + engines: {node: '>=4'} + dependencies: + assertion-error: 1.1.0 + check-error: 1.0.3 + deep-eql: 4.1.3 + get-func-name: 2.0.2 + loupe: 2.3.6 + pathval: 1.1.1 + type-detect: 4.0.8 + dev: true + /chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -1138,11 +1269,6 @@ packages: supports-color: 7.2.0 dev: true - /chalk@5.2.0: - resolution: {integrity: sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - dev: true - /chalk@5.3.0: resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} @@ -1160,39 +1286,26 @@ packages: resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==} dev: true - /chokidar@3.5.3: - resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} - engines: {node: '>= 8.10.0'} - dependencies: - anymatch: 3.1.3 - braces: 3.0.2 - glob-parent: 5.1.2 - is-binary-path: 2.1.0 - is-glob: 4.0.3 - normalize-path: 3.0.0 - readdirp: 3.6.0 - optionalDependencies: - fsevents: 2.3.2 + /chardet@0.7.0: + resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} dev: true - /clean-stack@2.2.0: - resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} - engines: {node: '>=6'} + /check-error@1.0.3: + resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} + dependencies: + get-func-name: 2.0.2 dev: true - /cli-cursor@3.1.0: - resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} + /ci-info@3.8.0: + resolution: {integrity: sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==} engines: {node: '>=8'} - dependencies: - restore-cursor: 3.1.0 dev: true - /cli-truncate@2.1.0: - resolution: {integrity: sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==} - engines: {node: '>=8'} + /cli-cursor@4.0.0: + resolution: {integrity: sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: - slice-ansi: 3.0.0 - string-width: 4.2.3 + restore-cursor: 4.0.0 dev: true /cli-truncate@3.1.0: @@ -1203,12 +1316,12 @@ packages: string-width: 5.1.2 dev: true - /cliui@7.0.4: - resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + /cliui@6.0.0: + resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} dependencies: string-width: 4.2.3 strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 + wrap-ansi: 6.2.0 dev: true /cliui@8.0.1: @@ -1220,6 +1333,11 @@ packages: wrap-ansi: 7.0.0 dev: true + /clone@1.0.4: + resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} + engines: {node: '>=0.8'} + dev: true + /color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} dependencies: @@ -1245,226 +1363,25 @@ packages: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} dev: true - /commander@10.0.1: - resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} - engines: {node: '>=14'} - dev: true - - /commander@4.1.1: - resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} - engines: {node: '>= 6'} - dev: true - - /compare-func@2.0.0: - resolution: {integrity: sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==} - dependencies: - array-ify: 1.0.0 - dot-prop: 5.3.0 + /commander@11.0.0: + resolution: {integrity: sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==} + engines: {node: '>=16'} dev: true /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} dev: true - /conventional-changelog-angular@5.0.13: - resolution: {integrity: sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA==} - engines: {node: '>=10'} - dependencies: - compare-func: 2.0.0 - q: 1.5.1 - dev: true - - /conventional-changelog-angular@6.0.0: - resolution: {integrity: sha512-6qLgrBF4gueoC7AFVHu51nHL9pF9FRjXrH+ceVf7WmAfH3gs+gEYOkvxhjMPjZu57I4AGUGoNTY8V7Hrgf1uqg==} - engines: {node: '>=14'} - dependencies: - compare-func: 2.0.0 - dev: true - - /conventional-changelog-atom@3.0.0: - resolution: {integrity: sha512-pnN5bWpH+iTUWU3FaYdw5lJmfWeqSyrUkG+wyHBI9tC1dLNnHkbAOg1SzTQ7zBqiFrfo55h40VsGXWMdopwc5g==} - engines: {node: '>=14'} - dev: true - - /conventional-changelog-cli@3.0.0: - resolution: {integrity: sha512-3zMYi0IrfNd6AAHdPMrcgCg5DbcffiqNaEBf8cYrlntXPbBIXaELTbnRmUy5TQAe0Hkgi0J6+/VmRCkkJQflcQ==} - engines: {node: '>=14'} - hasBin: true - dependencies: - add-stream: 1.0.0 - conventional-changelog: 4.0.0 - meow: 8.1.2 - tempfile: 3.0.0 - dev: true - - /conventional-changelog-codemirror@3.0.0: - resolution: {integrity: sha512-wzchZt9HEaAZrenZAUUHMCFcuYzGoZ1wG/kTRMICxsnW5AXohYMRxnyecP9ob42Gvn5TilhC0q66AtTPRSNMfw==} - engines: {node: '>=14'} - dev: true - - /conventional-changelog-conventionalcommits@5.0.0: - resolution: {integrity: sha512-lCDbA+ZqVFQGUj7h9QBKoIpLhl8iihkO0nCTyRNzuXtcd7ubODpYB04IFy31JloiJgG0Uovu8ot8oxRzn7Nwtw==} - engines: {node: '>=10'} - dependencies: - compare-func: 2.0.0 - lodash: 4.17.21 - q: 1.5.1 - dev: true - - /conventional-changelog-conventionalcommits@6.1.0: - resolution: {integrity: sha512-3cS3GEtR78zTfMzk0AizXKKIdN4OvSh7ibNz6/DPbhWWQu7LqE/8+/GqSodV+sywUR2gpJAdP/1JFf4XtN7Zpw==} - engines: {node: '>=14'} - dependencies: - compare-func: 2.0.0 - dev: true - - /conventional-changelog-core@5.0.2: - resolution: {integrity: sha512-RhQOcDweXNWvlRwUDCpaqXzbZemKPKncCWZG50Alth72WITVd6nhVk9MJ6w1k9PFNBcZ3YwkdkChE+8+ZwtUug==} - engines: {node: '>=14'} - dependencies: - add-stream: 1.0.0 - conventional-changelog-writer: 6.0.1 - conventional-commits-parser: 4.0.0 - dateformat: 3.0.3 - get-pkg-repo: 4.2.1 - git-raw-commits: 3.0.0 - git-remote-origin-url: 2.0.0 - git-semver-tags: 5.0.1 - normalize-package-data: 3.0.3 - read-pkg: 3.0.0 - read-pkg-up: 3.0.0 - dev: true - - /conventional-changelog-ember@3.0.0: - resolution: {integrity: sha512-7PYthCoSxIS98vWhVcSphMYM322OxptpKAuHYdVspryI0ooLDehRXWeRWgN+zWSBXKl/pwdgAg8IpLNSM1/61A==} - engines: {node: '>=14'} - dev: true - - /conventional-changelog-eslint@4.0.0: - resolution: {integrity: sha512-nEZ9byP89hIU0dMx37JXQkE1IpMmqKtsaR24X7aM3L6Yy/uAtbb+ogqthuNYJkeO1HyvK7JsX84z8649hvp43Q==} - engines: {node: '>=14'} - dev: true - - /conventional-changelog-express@3.0.0: - resolution: {integrity: sha512-HqxihpUMfIuxvlPvC6HltA4ZktQEUan/v3XQ77+/zbu8No/fqK3rxSZaYeHYant7zRxQNIIli7S+qLS9tX9zQA==} - engines: {node: '>=14'} - dev: true - - /conventional-changelog-jquery@4.0.0: - resolution: {integrity: sha512-TTIN5CyzRMf8PUwyy4IOLmLV2DFmPtasKN+x7EQKzwSX8086XYwo+NeaeA3VUT8bvKaIy5z/JoWUvi7huUOgaw==} - engines: {node: '>=14'} - dev: true - - /conventional-changelog-jshint@3.0.0: - resolution: {integrity: sha512-bQof4byF4q+n+dwFRkJ/jGf9dCNUv4/kCDcjeCizBvfF81TeimPZBB6fT4HYbXgxxfxWXNl/i+J6T0nI4by6DA==} - engines: {node: '>=14'} - dependencies: - compare-func: 2.0.0 - dev: true - - /conventional-changelog-preset-loader@3.0.0: - resolution: {integrity: sha512-qy9XbdSLmVnwnvzEisjxdDiLA4OmV3o8db+Zdg4WiFw14fP3B6XNz98X0swPPpkTd/pc1K7+adKgEDM1JCUMiA==} - engines: {node: '>=14'} - dev: true - - /conventional-changelog-writer@6.0.1: - resolution: {integrity: sha512-359t9aHorPw+U+nHzUXHS5ZnPBOizRxfQsWT5ZDHBfvfxQOAik+yfuhKXG66CN5LEWPpMNnIMHUTCKeYNprvHQ==} - engines: {node: '>=14'} - hasBin: true - dependencies: - conventional-commits-filter: 3.0.0 - dateformat: 3.0.3 - handlebars: 4.7.8 - json-stringify-safe: 5.0.1 - meow: 8.1.2 - semver: 7.5.4 - split: 1.0.1 - dev: true - - /conventional-changelog@4.0.0: - resolution: {integrity: sha512-JbZjwE1PzxQCvm+HUTIr+pbSekS8qdOZzMakdFyPtdkEWwFvwEJYONzjgMm0txCb2yBcIcfKDmg8xtCKTdecNQ==} - engines: {node: '>=14'} - dependencies: - conventional-changelog-angular: 6.0.0 - conventional-changelog-atom: 3.0.0 - conventional-changelog-codemirror: 3.0.0 - conventional-changelog-conventionalcommits: 6.1.0 - conventional-changelog-core: 5.0.2 - conventional-changelog-ember: 3.0.0 - conventional-changelog-eslint: 4.0.0 - conventional-changelog-express: 3.0.0 - conventional-changelog-jquery: 4.0.0 - conventional-changelog-jshint: 3.0.0 - conventional-changelog-preset-loader: 3.0.0 - dev: true - - /conventional-commits-filter@3.0.0: - resolution: {integrity: sha512-1ymej8b5LouPx9Ox0Dw/qAO2dVdfpRFq28e5Y0jJEU8ZrLdy0vOSkkIInwmxErFGhg6SALro60ZrwYFVTUDo4Q==} - engines: {node: '>=14'} - dependencies: - lodash.ismatch: 4.4.0 - modify-values: 1.0.1 - dev: true - - /conventional-commits-parser@3.2.4: - resolution: {integrity: sha512-nK7sAtfi+QXbxHCYfhpZsfRtaitZLIA6889kFIouLvz6repszQDgxBu7wf2WbU+Dco7sAnNCJYERCwt54WPC2Q==} - engines: {node: '>=10'} - hasBin: true - dependencies: - JSONStream: 1.3.5 - is-text-path: 1.0.1 - lodash: 4.17.21 - meow: 8.1.2 - split2: 3.2.2 - through2: 4.0.2 - dev: true - - /conventional-commits-parser@4.0.0: - resolution: {integrity: sha512-WRv5j1FsVM5FISJkoYMR6tPk07fkKT0UodruX4je86V4owk451yjXAKzKAPOs9l7y59E2viHUS9eQ+dfUA9NSg==} - engines: {node: '>=14'} - hasBin: true - dependencies: - JSONStream: 1.3.5 - is-text-path: 1.0.1 - meow: 8.1.2 - split2: 3.2.2 - dev: true - /convert-source-map@1.9.0: resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} dev: true - /core-util-is@1.0.3: - resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} - dev: true - - /cosmiconfig-typescript-loader@4.4.0(@types/node@20.4.8)(cosmiconfig@8.2.0)(ts-node@10.9.1)(typescript@5.1.6): - resolution: {integrity: sha512-BabizFdC3wBHhbI4kJh0VkQP9GkBfoHPydD0COMce1nJ1kJAB3F2TmJ/I7diULBKtmEWSwEbuN/KDtgnmUUVmw==} - engines: {node: '>=v14.21.3'} - peerDependencies: - '@types/node': '*' - cosmiconfig: '>=7' - ts-node: '>=10' - typescript: '>=4' - dependencies: - '@types/node': 20.4.8 - cosmiconfig: 8.2.0 - ts-node: 10.9.1(@types/node@20.4.8)(typescript@5.1.6) - typescript: 5.1.6 - dev: true - - /cosmiconfig@8.2.0: - resolution: {integrity: sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==} - engines: {node: '>=14'} + /cross-spawn@5.1.0: + resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} dependencies: - import-fresh: 3.3.0 - js-yaml: 4.1.0 - parse-json: 5.2.0 - path-type: 4.0.0 - dev: true - - /create-require@1.1.1: - resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + lru-cache: 4.1.5 + shebang-command: 1.2.0 + which: 1.3.1 dev: true /cross-spawn@6.0.5: @@ -1487,13 +1404,30 @@ packages: which: 2.0.2 dev: true - /dargs@7.0.0: - resolution: {integrity: sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==} - engines: {node: '>=8'} + /csv-generate@3.4.3: + resolution: {integrity: sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==} + dev: true + + /csv-parse@4.16.3: + resolution: {integrity: sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==} + dev: true + + /csv-stringify@5.6.5: + resolution: {integrity: sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A==} + dev: true + + /csv@5.5.3: + resolution: {integrity: sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g==} + engines: {node: '>= 0.1.90'} + dependencies: + csv-generate: 3.4.3 + csv-parse: 4.16.3 + csv-stringify: 5.6.5 + stream-transform: 2.1.3 dev: true - /dateformat@3.0.3: - resolution: {integrity: sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==} + /dataloader@1.4.0: + resolution: {integrity: sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==} dev: true /debug@4.3.4: @@ -1521,6 +1455,13 @@ packages: engines: {node: '>=0.10.0'} dev: true + /deep-eql@4.1.3: + resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} + engines: {node: '>=6'} + dependencies: + type-detect: 4.0.8 + dev: true + /deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} dev: true @@ -1543,32 +1484,43 @@ packages: titleize: 3.0.0 dev: true + /defaults@1.0.4: + resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} + dependencies: + clone: 1.0.4 + dev: true + + /define-data-property@1.1.0: + resolution: {integrity: sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.1 + gopd: 1.0.1 + has-property-descriptors: 1.0.0 + dev: true + /define-lazy-prop@3.0.0: resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} engines: {node: '>=12'} dev: true - /define-properties@1.2.0: - resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==} + /define-properties@1.2.1: + resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} engines: {node: '>= 0.4'} dependencies: + define-data-property: 1.1.0 has-property-descriptors: 1.0.0 object-keys: 1.1.1 dev: true - /dequal@2.0.3: - resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} - engines: {node: '>=6'} - dev: true - - /diff@4.0.2: - resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} - engines: {node: '>=0.3.1'} + /detect-indent@6.1.0: + resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} + engines: {node: '>=8'} dev: true - /diff@5.1.0: - resolution: {integrity: sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==} - engines: {node: '>=0.3.1'} + /diff-sequences@29.6.3: + resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true /dir-glob@3.0.1: @@ -1585,11 +1537,25 @@ packages: esutils: 2.0.3 dev: true - /dot-prop@5.3.0: - resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} - engines: {node: '>=8'} + /dotenv@16.3.1: + resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==} + engines: {node: '>=12'} + dev: true + + /dts-buddy@0.2.5: + resolution: {integrity: sha512-66HTWHyXS3JwgpRwcu88rsDyZfPUb0oPYmiNg5f4BgCAFTVorJXpygf339QyXOXX1PuqHpvB+qo7O+8Ni1vXUQ==} + hasBin: true dependencies: - is-obj: 2.0.0 + '@jridgewell/source-map': 0.3.5 + '@jridgewell/sourcemap-codec': 1.4.15 + globrex: 0.1.2 + kleur: 4.1.5 + locate-character: 3.0.0 + magic-string: 0.30.4 + sade: 1.8.1 + tiny-glob: 0.2.9 + ts-api-utils: 1.0.3(typescript@5.0.4) + typescript: 5.0.4 dev: true /eastasianwidth@0.2.0: @@ -1618,17 +1584,17 @@ packages: is-arrayish: 0.2.1 dev: true - /es-abstract@1.22.1: - resolution: {integrity: sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==} + /es-abstract@1.22.2: + resolution: {integrity: sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA==} engines: {node: '>= 0.4'} dependencies: array-buffer-byte-length: 1.0.0 - arraybuffer.prototype.slice: 1.0.1 + arraybuffer.prototype.slice: 1.0.2 available-typed-arrays: 1.0.5 call-bind: 1.0.2 es-set-tostringtag: 2.0.1 es-to-primitive: 1.2.1 - function.prototype.name: 1.1.5 + function.prototype.name: 1.1.6 get-intrinsic: 1.2.1 get-symbol-description: 1.0.0 globalthis: 1.0.3 @@ -1649,12 +1615,12 @@ packages: object-inspect: 1.12.3 object-keys: 1.1.1 object.assign: 4.1.4 - regexp.prototype.flags: 1.5.0 - safe-array-concat: 1.0.0 + regexp.prototype.flags: 1.5.1 + safe-array-concat: 1.0.1 safe-regex-test: 1.0.0 - string.prototype.trim: 1.2.7 - string.prototype.trimend: 1.0.6 - string.prototype.trimstart: 1.0.6 + string.prototype.trim: 1.2.8 + string.prototype.trimend: 1.0.7 + string.prototype.trimstart: 1.0.7 typed-array-buffer: 1.0.0 typed-array-byte-length: 1.0.0 typed-array-byte-offset: 1.0.0 @@ -1672,6 +1638,12 @@ packages: 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'} @@ -1681,34 +1653,64 @@ packages: is-symbol: 1.0.4 dev: true - /esbuild@0.18.18: - resolution: {integrity: sha512-UckDPWvdVJLNT0npk5AMTpVwGRQhS76rWFLmHwEtgNvWlR9sgVV1eyc/oeBtM86q9s8ABBLMmm0CwNxhVemOiw==} + /esbuild@0.18.20: + resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/android-arm': 0.18.20 + '@esbuild/android-arm64': 0.18.20 + '@esbuild/android-x64': 0.18.20 + '@esbuild/darwin-arm64': 0.18.20 + '@esbuild/darwin-x64': 0.18.20 + '@esbuild/freebsd-arm64': 0.18.20 + '@esbuild/freebsd-x64': 0.18.20 + '@esbuild/linux-arm': 0.18.20 + '@esbuild/linux-arm64': 0.18.20 + '@esbuild/linux-ia32': 0.18.20 + '@esbuild/linux-loong64': 0.18.20 + '@esbuild/linux-mips64el': 0.18.20 + '@esbuild/linux-ppc64': 0.18.20 + '@esbuild/linux-riscv64': 0.18.20 + '@esbuild/linux-s390x': 0.18.20 + '@esbuild/linux-x64': 0.18.20 + '@esbuild/netbsd-x64': 0.18.20 + '@esbuild/openbsd-x64': 0.18.20 + '@esbuild/sunos-x64': 0.18.20 + '@esbuild/win32-arm64': 0.18.20 + '@esbuild/win32-ia32': 0.18.20 + '@esbuild/win32-x64': 0.18.20 + dev: true + + /esbuild@0.19.4: + resolution: {integrity: sha512-x7jL0tbRRpv4QUyuDMjONtWFciygUxWaUM1kMX2zWxI0X2YWOt7MSA0g4UdeSiHM8fcYVzpQhKYOycZwxTdZkA==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.18.18 - '@esbuild/android-arm64': 0.18.18 - '@esbuild/android-x64': 0.18.18 - '@esbuild/darwin-arm64': 0.18.18 - '@esbuild/darwin-x64': 0.18.18 - '@esbuild/freebsd-arm64': 0.18.18 - '@esbuild/freebsd-x64': 0.18.18 - '@esbuild/linux-arm': 0.18.18 - '@esbuild/linux-arm64': 0.18.18 - '@esbuild/linux-ia32': 0.18.18 - '@esbuild/linux-loong64': 0.18.18 - '@esbuild/linux-mips64el': 0.18.18 - '@esbuild/linux-ppc64': 0.18.18 - '@esbuild/linux-riscv64': 0.18.18 - '@esbuild/linux-s390x': 0.18.18 - '@esbuild/linux-x64': 0.18.18 - '@esbuild/netbsd-x64': 0.18.18 - '@esbuild/openbsd-x64': 0.18.18 - '@esbuild/sunos-x64': 0.18.18 - '@esbuild/win32-arm64': 0.18.18 - '@esbuild/win32-ia32': 0.18.18 - '@esbuild/win32-x64': 0.18.18 + '@esbuild/android-arm': 0.19.4 + '@esbuild/android-arm64': 0.19.4 + '@esbuild/android-x64': 0.19.4 + '@esbuild/darwin-arm64': 0.19.4 + '@esbuild/darwin-x64': 0.19.4 + '@esbuild/freebsd-arm64': 0.19.4 + '@esbuild/freebsd-x64': 0.19.4 + '@esbuild/linux-arm': 0.19.4 + '@esbuild/linux-arm64': 0.19.4 + '@esbuild/linux-ia32': 0.19.4 + '@esbuild/linux-loong64': 0.19.4 + '@esbuild/linux-mips64el': 0.19.4 + '@esbuild/linux-ppc64': 0.19.4 + '@esbuild/linux-riscv64': 0.19.4 + '@esbuild/linux-s390x': 0.19.4 + '@esbuild/linux-x64': 0.19.4 + '@esbuild/netbsd-x64': 0.19.4 + '@esbuild/openbsd-x64': 0.19.4 + '@esbuild/sunos-x64': 0.19.4 + '@esbuild/win32-arm64': 0.19.4 + '@esbuild/win32-ia32': 0.19.4 + '@esbuild/win32-x64': 0.19.4 dev: true /escalade@3.1.1: @@ -1726,54 +1728,57 @@ packages: engines: {node: '>=10'} dev: true - /eslint-config-prettier@9.0.0(eslint@8.46.0): + /eslint-config-prettier@9.0.0(eslint@8.51.0): resolution: {integrity: sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.46.0 + eslint: 8.51.0 dev: true - /eslint-plugin-es@3.0.1(eslint@8.46.0): - resolution: {integrity: sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==} - engines: {node: '>=8.10.0'} + /eslint-plugin-es-x@7.2.0(eslint@8.51.0): + resolution: {integrity: sha512-9dvv5CcvNjSJPqnS5uZkqb3xmbeqRLnvXKK7iI5+oK/yTusyc46zbBZKENGsOfojm/mKfszyZb+wNqNPAPeGXA==} + engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: - eslint: '>=4.19.1' + eslint: '>=8' dependencies: - eslint: 8.46.0 - eslint-utils: 2.1.0 - regexpp: 3.2.0 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.51.0) + '@eslint-community/regexpp': 4.9.0 + eslint: 8.51.0 dev: true - /eslint-plugin-markdown@3.0.1(eslint@8.46.0): + /eslint-plugin-markdown@3.0.1(eslint@8.51.0): resolution: {integrity: sha512-8rqoc148DWdGdmYF6WSQFT3uQ6PO7zXYgeBpHAOAakX/zpq+NvFYbDA/H7PYzHajwtmaOzAwfxyl++x0g1/N9A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - eslint: 8.46.0 + eslint: 8.51.0 mdast-util-from-markdown: 0.8.5 transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-node@11.1.0(eslint@8.46.0): - resolution: {integrity: sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==} - engines: {node: '>=8.10.0'} + /eslint-plugin-n@16.1.0(eslint@8.51.0): + resolution: {integrity: sha512-3wv/TooBst0N4ND+pnvffHuz9gNPmk/NkLwAxOt2JykTl/hcuECe6yhTtLJcZjIxtZwN+GX92ACp/QTLpHA3Hg==} + engines: {node: '>=16.0.0'} peerDependencies: - eslint: '>=5.16.0' + eslint: '>=7.0.0' dependencies: - eslint: 8.46.0 - eslint-plugin-es: 3.0.1(eslint@8.46.0) - eslint-utils: 2.1.0 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.51.0) + builtins: 5.0.1 + eslint: 8.51.0 + eslint-plugin-es-x: 7.2.0(eslint@8.51.0) + get-tsconfig: 4.7.2 ignore: 5.2.4 + is-core-module: 2.13.0 minimatch: 3.1.2 - resolve: 1.22.4 - semver: 6.3.1 + resolve: 1.22.6 + semver: 7.5.4 dev: true - /eslint-plugin-prettier@5.0.0(eslint-config-prettier@9.0.0)(eslint@8.46.0)(prettier@3.0.1): + /eslint-plugin-prettier@5.0.0(eslint-config-prettier@9.0.0)(eslint@8.51.0)(prettier@3.0.3): resolution: {integrity: sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -1787,9 +1792,9 @@ packages: eslint-config-prettier: optional: true dependencies: - eslint: 8.46.0 - eslint-config-prettier: 9.0.0(eslint@8.46.0) - prettier: 3.0.1 + eslint: 8.51.0 + eslint-config-prettier: 9.0.0(eslint@8.51.0) + prettier: 3.0.3 prettier-linter-helpers: 1.0.0 synckit: 0.8.5 dev: true @@ -1802,33 +1807,21 @@ packages: estraverse: 5.3.0 dev: true - /eslint-utils@2.1.0: - resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==} - engines: {node: '>=6'} - dependencies: - eslint-visitor-keys: 1.3.0 - dev: true - - /eslint-visitor-keys@1.3.0: - resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} - engines: {node: '>=4'} - dev: true - - /eslint-visitor-keys@3.4.2: - resolution: {integrity: sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw==} + /eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint@8.46.0: - resolution: {integrity: sha512-cIO74PvbW0qU8e0mIvk5IV3ToWdCq5FYG6gWPHHkx6gNdjlbAYvtfHmlCMXxjcoVaIdwy/IAt3+mDkZkfvb2Dg==} + /eslint@8.51.0: + resolution: {integrity: sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.46.0) - '@eslint-community/regexpp': 4.6.2 - '@eslint/eslintrc': 2.1.1 - '@eslint/js': 8.46.0 - '@humanwhocodes/config-array': 0.11.10 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.51.0) + '@eslint-community/regexpp': 4.9.0 + '@eslint/eslintrc': 2.1.2 + '@eslint/js': 8.51.0 + '@humanwhocodes/config-array': 0.11.11 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 ajv: 6.12.6 @@ -1838,7 +1831,7 @@ packages: doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.2 + eslint-visitor-keys: 3.4.3 espree: 9.6.1 esquery: 1.5.0 esutils: 2.0.3 @@ -1846,7 +1839,7 @@ packages: file-entry-cache: 6.0.1 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.20.0 + globals: 13.22.0 graphemer: 1.4.0 ignore: 5.2.4 imurmurhash: 0.1.4 @@ -1871,7 +1864,13 @@ packages: dependencies: acorn: 8.10.0 acorn-jsx: 5.3.2(acorn@8.10.0) - eslint-visitor-keys: 3.4.2 + eslint-visitor-keys: 3.4.3 + dev: true + + /esprima@4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true dev: true /esquery@1.5.0: @@ -1898,6 +1897,10 @@ packages: engines: {node: '>=0.10.0'} dev: true + /eventemitter3@5.0.1: + resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} + dev: true + /execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -1928,6 +1931,19 @@ packages: strip-final-newline: 3.0.0 dev: true + /extendable-error@0.1.7: + resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} + dev: true + + /external-editor@3.1.0: + resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} + engines: {node: '>=4'} + dependencies: + chardet: 0.7.0 + iconv-lite: 0.4.24 + tmp: 0.0.33 + dev: true + /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true @@ -1965,7 +1981,7 @@ packages: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} engines: {node: ^10.12.0 || >=12.0.0} dependencies: - flat-cache: 3.0.4 + flat-cache: 3.1.0 dev: true /fill-range@7.0.1: @@ -1975,13 +1991,6 @@ packages: to-regex-range: 5.0.1 dev: true - /find-up@2.1.0: - resolution: {integrity: sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==} - engines: {node: '>=4'} - dependencies: - locate-path: 2.0.0 - dev: true - /find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -1998,16 +2007,24 @@ packages: path-exists: 4.0.0 dev: true - /flat-cache@3.0.4: - resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} - engines: {node: ^10.12.0 || >=12.0.0} + /find-yarn-workspace-root2@1.2.16: + resolution: {integrity: sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==} + dependencies: + micromatch: 4.0.5 + pkg-dir: 4.2.0 + dev: true + + /flat-cache@3.1.0: + resolution: {integrity: sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==} + engines: {node: '>=12.0.0'} dependencies: - flatted: 3.2.7 + flatted: 3.2.9 + keyv: 4.5.3 rimraf: 3.0.2 dev: true - /flatted@3.2.7: - resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} + /flatted@3.2.9: + resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==} dev: true /for-each@0.3.3: @@ -2016,37 +2033,30 @@ packages: is-callable: 1.2.7 dev: true - /foreground-child@2.0.0: - resolution: {integrity: sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==} - engines: {node: '>=8.0.0'} - dependencies: - cross-spawn: 7.0.3 - signal-exit: 3.0.7 - dev: true - - /foreground-child@3.1.1: - resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} - engines: {node: '>=14'} + /fs-extra@7.0.1: + resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} + engines: {node: '>=6 <7 || >=8'} dependencies: - cross-spawn: 7.0.3 - signal-exit: 4.1.0 + graceful-fs: 4.2.11 + jsonfile: 4.0.0 + universalify: 0.1.2 dev: true - /fs-extra@11.1.1: - resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==} - engines: {node: '>=14.14'} + /fs-extra@8.1.0: + resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} + engines: {node: '>=6 <7 || >=8'} dependencies: graceful-fs: 4.2.11 - jsonfile: 6.1.0 - universalify: 2.0.0 + jsonfile: 4.0.0 + universalify: 0.1.2 dev: true /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} dev: true - /fsevents@2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true @@ -2057,13 +2067,13 @@ packages: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} dev: true - /function.prototype.name@1.1.5: - resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} + /function.prototype.name@1.1.6: + resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.22.1 + define-properties: 1.2.1 + es-abstract: 1.22.2 functions-have-names: 1.2.3 dev: true @@ -2076,6 +2086,10 @@ packages: engines: {node: 6.* || 8.* || >= 10.*} dev: true + /get-func-name@2.0.2: + resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} + dev: true + /get-intrinsic@1.2.1: resolution: {integrity: sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==} dependencies: @@ -2085,17 +2099,6 @@ packages: has-symbols: 1.0.3 dev: true - /get-pkg-repo@4.2.1: - resolution: {integrity: sha512-2+QbHjFRfGB74v/pYWjd5OhU3TDIC2Gv/YKUTk/tCvAz0pkn/Mz6P3uByuBimLOcPvN2jYdScl3xGFSrx0jEcA==} - engines: {node: '>=6.9.0'} - hasBin: true - dependencies: - '@hutson/parse-repository-url': 3.0.2 - hosted-git-info: 4.1.0 - through2: 2.0.5 - yargs: 16.2.0 - dev: true - /get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} @@ -2106,52 +2109,13 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - get-intrinsic: 1.2.1 - dev: true - - /git-raw-commits@2.0.11: - resolution: {integrity: sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A==} - engines: {node: '>=10'} - hasBin: true - dependencies: - dargs: 7.0.0 - lodash: 4.17.21 - meow: 8.1.2 - split2: 3.2.2 - through2: 4.0.2 - dev: true - - /git-raw-commits@3.0.0: - resolution: {integrity: sha512-b5OHmZ3vAgGrDn/X0kS+9qCfNKWe4K/jFnhwzVWWg0/k5eLa3060tZShrRg8Dja5kPc+YjS0Gc6y7cRr44Lpjw==} - engines: {node: '>=14'} - hasBin: true - dependencies: - dargs: 7.0.0 - meow: 8.1.2 - split2: 3.2.2 - dev: true - - /git-remote-origin-url@2.0.0: - resolution: {integrity: sha512-eU+GGrZgccNJcsDH5LkXR3PB9M958hxc7sbA8DFJjrv9j4L2P/eZfKhM+QD6wyzpiv+b1BpK0XrYCxkovtjSLw==} - engines: {node: '>=4'} - dependencies: - gitconfiglocal: 1.0.0 - pify: 2.3.0 - dev: true - - /git-semver-tags@5.0.1: - resolution: {integrity: sha512-hIvOeZwRbQ+7YEUmCkHqo8FOLQZCEn18yevLHADlFPZY02KJGsu5FZt9YW/lybfK2uhWFI7Qg/07LekJiTv7iA==} - engines: {node: '>=14'} - hasBin: true - dependencies: - meow: 8.1.2 - semver: 7.5.4 + get-intrinsic: 1.2.1 dev: true - /gitconfiglocal@1.0.0: - resolution: {integrity: sha512-spLUXeTAVHxDtKsJc8FkFVgFtMdEN9qPGpL23VfSHx4fP4+Ds097IXLvymbnDH8FnmxX5Nr9bPw3A+AQ6mWEaQ==} + /get-tsconfig@4.7.2: + resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==} dependencies: - ini: 1.3.8 + resolve-pkg-maps: 1.0.0 dev: true /glob-parent@5.1.2: @@ -2168,20 +2132,8 @@ packages: is-glob: 4.0.3 dev: true - /glob@10.3.3: - resolution: {integrity: sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw==} - engines: {node: '>=16 || 14 >=14.17'} - hasBin: true - dependencies: - foreground-child: 3.1.1 - jackspeak: 2.2.2 - minimatch: 9.0.3 - minipass: 7.0.2 - path-scurry: 1.10.1 - dev: true - - /glob@7.1.6: - resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} + /glob@7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -2191,26 +2143,19 @@ packages: path-is-absolute: 1.0.1 dev: true - /glob@7.2.3: - resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + /glob@8.1.0: + resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} + engines: {node: '>=12'} dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.1.2 + minimatch: 5.1.6 once: 1.4.0 - path-is-absolute: 1.0.1 - dev: true - - /global-dirs@0.1.1: - resolution: {integrity: sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==} - engines: {node: '>=4'} - dependencies: - ini: 1.3.8 dev: true - /globals@13.20.0: - resolution: {integrity: sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==} + /globals@13.22.0: + resolution: {integrity: sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 @@ -2220,7 +2165,7 @@ packages: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} engines: {node: '>= 0.4'} dependencies: - define-properties: 1.2.0 + define-properties: 1.2.1 dev: true /globalyzer@0.1.0: @@ -2253,21 +2198,12 @@ packages: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} dev: true - /graphemer@1.4.0: - resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + /grapheme-splitter@1.0.4: + resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} dev: true - /handlebars@4.7.8: - resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} - engines: {node: '>=0.4.7'} - hasBin: true - dependencies: - minimist: 1.2.8 - neo-async: 2.6.2 - source-map: 0.6.1 - wordwrap: 1.0.0 - optionalDependencies: - uglify-js: 3.17.4 + /graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} dev: true /hard-rejection@2.1.0: @@ -2323,17 +2259,14 @@ packages: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} dev: true - /hosted-git-info@4.1.0: - resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==} - engines: {node: '>=10'} - dependencies: - lru-cache: 6.0.0 - dev: true - /html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} dev: true + /human-id@1.0.2: + resolution: {integrity: sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==} + dev: true + /human-signals@2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} @@ -2350,6 +2283,20 @@ packages: hasBin: true dev: true + /iconv-lite@0.4.24: + resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 + dev: true + + /ignore-walk@5.0.1: + resolution: {integrity: sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + minimatch: 5.1.6 + dev: true + /ignore@5.2.4: resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} engines: {node: '>= 4'} @@ -2384,10 +2331,6 @@ packages: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} dev: true - /ini@1.3.8: - resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} - dev: true - /internal-slot@1.0.5: resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==} engines: {node: '>= 0.4'} @@ -2426,13 +2369,6 @@ packages: has-bigints: 1.0.2 dev: true - /is-binary-path@2.1.0: - resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} - engines: {node: '>=8'} - dependencies: - binary-extensions: 2.2.0 - dev: true - /is-boolean-object@1.1.2: resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} engines: {node: '>= 0.4'} @@ -2446,6 +2382,13 @@ packages: engines: {node: '>= 0.4'} dev: true + /is-ci@3.0.1: + resolution: {integrity: sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==} + hasBin: true + dependencies: + ci-info: 3.8.0 + dev: true + /is-core-module@2.13.0: resolution: {integrity: sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==} dependencies: @@ -2526,11 +2469,6 @@ packages: engines: {node: '>=0.12.0'} dev: true - /is-obj@2.0.0: - resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} - engines: {node: '>=8'} - dev: true - /is-path-inside@3.0.3: resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} engines: {node: '>=8'} @@ -2572,6 +2510,13 @@ packages: has-tostringtag: 1.0.0 dev: true + /is-subdir@1.2.0: + resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==} + engines: {node: '>=4'} + dependencies: + better-path-resolve: 1.0.0 + dev: true + /is-symbol@1.0.4: resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} engines: {node: '>= 0.4'} @@ -2579,13 +2524,6 @@ packages: has-symbols: 1.0.3 dev: true - /is-text-path@1.0.1: - resolution: {integrity: sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w==} - engines: {node: '>=0.10.0'} - dependencies: - text-extensions: 1.9.0 - dev: true - /is-typed-array@1.1.12: resolution: {integrity: sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==} engines: {node: '>= 0.4'} @@ -2599,6 +2537,11 @@ packages: call-bind: 1.0.2 dev: true + /is-windows@1.0.2: + resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} + engines: {node: '>=0.10.0'} + dev: true + /is-wsl@2.2.0: resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} engines: {node: '>=8'} @@ -2606,10 +2549,6 @@ packages: is-docker: 2.2.1 dev: true - /isarray@1.0.0: - resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} - dev: true - /isarray@2.0.5: resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} dev: true @@ -2632,6 +2571,17 @@ packages: supports-color: 7.2.0 dev: true + /istanbul-lib-source-maps@4.0.1: + resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} + engines: {node: '>=10'} + dependencies: + debug: 4.3.4 + istanbul-lib-coverage: 3.2.0 + source-map: 0.6.1 + transitivePeerDependencies: + - supports-color + dev: true + /istanbul-reports@3.1.6: resolution: {integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==} engines: {node: '>=8'} @@ -2640,24 +2590,18 @@ packages: istanbul-lib-report: 3.0.1 dev: true - /jackspeak@2.2.2: - resolution: {integrity: sha512-mgNtVv4vUuaKA97yxUHoA3+FkuhtxkjdXEWOyB/N76fjy0FjezEt34oy3epBtvCvS+7DyKwqCFWx/oJLV5+kCg==} - engines: {node: '>=14'} - dependencies: - '@isaacs/cliui': 8.0.2 - optionalDependencies: - '@pkgjs/parseargs': 0.11.0 - dev: true - - /joycon@3.1.1: - resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} - engines: {node: '>=10'} - dev: true - /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} dev: true + /js-yaml@3.14.1: + resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} + hasBin: true + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + dev: true + /js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true @@ -2665,6 +2609,10 @@ packages: argparse: 2.0.1 dev: true + /json-buffer@3.0.1: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + dev: true + /json-parse-better-errors@1.0.2: resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} dev: true @@ -2677,29 +2625,24 @@ packages: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} dev: true - /json-schema-traverse@1.0.0: - resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} - dev: true - /json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} dev: true - /json-stringify-safe@5.0.1: - resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} + /jsonc-parser@3.2.0: + resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} dev: true - /jsonfile@6.1.0: - resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} - dependencies: - universalify: 2.0.0 + /jsonfile@4.0.0: + resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} optionalDependencies: graceful-fs: 4.2.11 dev: true - /jsonparse@1.3.1: - resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} - engines: {'0': node >= 0.2.0} + /keyv@4.5.3: + resolution: {integrity: sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==} + dependencies: + json-buffer: 3.0.1 dev: true /kind-of@6.0.3: @@ -2729,21 +2672,18 @@ packages: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} dev: true - /lint-staged@13.2.3(enquirer@2.4.1): - resolution: {integrity: sha512-zVVEXLuQIhr1Y7R7YAWx4TZLdvuzk7DnmrsTNL0fax6Z3jrpFcas+vKbzxhhvp6TA55m1SQuWkpzI1qbfDZbAg==} - engines: {node: ^14.13.1 || >=16.0.0} + /lint-staged@14.0.1: + resolution: {integrity: sha512-Mw0cL6HXnHN1ag0mN/Dg4g6sr8uf8sn98w2Oc1ECtFto9tvRF7nkXGJRbx8gPlHyoR0pLyBr2lQHbWwmUHe1Sw==} + engines: {node: ^16.14.0 || >=18.0.0} hasBin: true dependencies: - chalk: 5.2.0 - cli-truncate: 3.1.0 - commander: 10.0.1 + chalk: 5.3.0 + commander: 11.0.0 debug: 4.3.4 execa: 7.2.0 lilconfig: 2.1.0 - listr2: 5.0.8(enquirer@2.4.1) + listr2: 6.6.1 micromatch: 4.0.5 - normalize-path: 3.0.0 - object-inspect: 1.12.3 pidtree: 0.6.0 string-argv: 0.3.2 yaml: 2.3.1 @@ -2752,24 +2692,21 @@ packages: - supports-color dev: true - /listr2@5.0.8(enquirer@2.4.1): - resolution: {integrity: sha512-mC73LitKHj9w6v30nLNGPetZIlfpUniNSsxxrbaPcWOjDb92SHPzJPi/t+v1YC/lxKz/AJ9egOjww0qUuFxBpA==} - engines: {node: ^14.13.1 || >=16.0.0} + /listr2@6.6.1: + resolution: {integrity: sha512-+rAXGHh0fkEWdXBmX+L6mmfmXmXvDGEKzkjxO+8mP3+nI/r/CWznVBvsibXdxda9Zz0OW2e2ikphN3OwCT/jSg==} + engines: {node: '>=16.0.0'} peerDependencies: enquirer: '>= 2.3.0 < 3' peerDependenciesMeta: enquirer: optional: true dependencies: - cli-truncate: 2.1.0 + cli-truncate: 3.1.0 colorette: 2.0.20 - enquirer: 2.4.1 - log-update: 4.0.0 - p-map: 4.0.0 + eventemitter3: 5.0.1 + log-update: 5.0.1 rfdc: 1.3.0 - rxjs: 7.8.1 - through: 2.3.8 - wrap-ansi: 7.0.0 + wrap-ansi: 8.1.0 dev: true /load-json-file@4.0.0: @@ -2782,17 +2719,23 @@ packages: strip-bom: 3.0.0 dev: true - /load-tsconfig@0.2.5: - resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + /load-yaml-file@0.2.0: + resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==} + engines: {node: '>=6'} + dependencies: + graceful-fs: 4.2.11 + js-yaml: 3.14.1 + pify: 4.0.1 + strip-bom: 3.0.0 dev: true - /locate-path@2.0.0: - resolution: {integrity: sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==} - engines: {node: '>=4'} - dependencies: - p-locate: 2.0.0 - path-exists: 3.0.0 + /local-pkg@0.4.3: + resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} + engines: {node: '>=14'} + dev: true + + /locate-character@3.0.0: + resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} dev: true /locate-path@5.0.0: @@ -2809,71 +2752,36 @@ packages: p-locate: 5.0.0 dev: true - /lodash.camelcase@4.3.0: - resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} - dev: true - - /lodash.isfunction@3.0.9: - resolution: {integrity: sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==} - dev: true - - /lodash.ismatch@4.4.0: - resolution: {integrity: sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==} - dev: true - - /lodash.isplainobject@4.0.6: - resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} - dev: true - - /lodash.kebabcase@4.1.1: - resolution: {integrity: sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==} - dev: true - /lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} dev: true - /lodash.mergewith@4.6.2: - resolution: {integrity: sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==} - dev: true - - /lodash.snakecase@4.1.1: - resolution: {integrity: sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==} - dev: true - - /lodash.sortby@4.7.0: - resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} - dev: true - /lodash.startcase@4.4.0: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} dev: true - /lodash.uniq@4.5.0: - resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==} - dev: true - - /lodash.upperfirst@4.3.1: - resolution: {integrity: sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==} - dev: true - - /lodash@4.17.21: - resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + /log-update@5.0.1: + resolution: {integrity: sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + ansi-escapes: 5.0.0 + cli-cursor: 4.0.0 + slice-ansi: 5.0.0 + strip-ansi: 7.1.0 + wrap-ansi: 8.1.0 dev: true - /log-update@4.0.0: - resolution: {integrity: sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==} - engines: {node: '>=10'} + /loupe@2.3.6: + resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==} dependencies: - ansi-escapes: 4.3.2 - cli-cursor: 3.1.0 - slice-ansi: 4.0.0 - wrap-ansi: 6.2.0 + get-func-name: 2.0.2 dev: true - /lru-cache@10.0.0: - resolution: {integrity: sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw==} - engines: {node: 14 || >=16.14} + /lru-cache@4.1.5: + resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} + dependencies: + pseudomap: 1.0.2 + yallist: 2.1.2 dev: true /lru-cache@6.0.0: @@ -2883,6 +2791,13 @@ packages: yallist: 4.0.0 dev: true + /magic-string@0.30.4: + resolution: {integrity: sha512-Q/TKtsC5BPm0kGqgBIF9oXAs/xEf2vRKiIB4wCRQTJOQIByZ1d+NnUOotvJOvNpi5RNIgVOMC3pOuaP1ZTDlVg==} + engines: {node: '>=12'} + dependencies: + '@jridgewell/sourcemap-codec': 1.4.15 + dev: true + /make-dir@4.0.0: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} @@ -2890,10 +2805,6 @@ packages: semver: 7.5.4 dev: true - /make-error@1.3.6: - resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} - dev: true - /map-obj@1.0.1: resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} engines: {node: '>=0.10.0'} @@ -2907,7 +2818,7 @@ packages: /mdast-util-from-markdown@0.8.5: resolution: {integrity: sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==} dependencies: - '@types/mdast': 3.0.12 + '@types/mdast': 3.0.13 mdast-util-to-string: 2.0.0 micromark: 2.11.4 parse-entities: 2.0.0 @@ -2925,21 +2836,21 @@ packages: engines: {node: '>= 0.10.0'} dev: true - /meow@8.1.2: - resolution: {integrity: sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==} - engines: {node: '>=10'} + /meow@6.1.1: + resolution: {integrity: sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==} + engines: {node: '>=8'} dependencies: - '@types/minimist': 1.2.2 + '@types/minimist': 1.2.3 camelcase-keys: 6.2.2 decamelize-keys: 1.1.1 hard-rejection: 2.1.0 minimist-options: 4.1.0 - normalize-package-data: 3.0.3 + normalize-package-data: 2.5.0 read-pkg-up: 7.0.1 redent: 3.0.0 trim-newlines: 3.0.1 - type-fest: 0.18.1 - yargs-parser: 20.2.9 + type-fest: 0.13.1 + yargs-parser: 18.1.3 dev: true /merge-stream@2.0.0: @@ -2989,9 +2900,9 @@ packages: brace-expansion: 1.1.11 dev: true - /minimatch@9.0.3: - resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} - engines: {node: '>=16 || 14 >=14.17'} + /minimatch@5.1.6: + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} + engines: {node: '>=10'} dependencies: brace-expansion: 2.0.1 dev: true @@ -3005,18 +2916,18 @@ packages: kind-of: 6.0.3 dev: true - /minimist@1.2.8: - resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - dev: true - - /minipass@7.0.2: - resolution: {integrity: sha512-eL79dXrE1q9dBbDCLg7xfn/vl7MS4F1gvJAgjJrQli/jbQWdUttuVawphqpffoIYfRdq78LHx6GP4bU/EQ2ATA==} - engines: {node: '>=16 || 14 >=14.17'} + /mixme@0.5.9: + resolution: {integrity: sha512-VC5fg6ySUscaWUpI4gxCBTQMH2RdUpNrk+MsbpCYtIvf9SBJdiUey4qE7BXviJsJR4nDQxCZ+3yaYNW3guz/Pw==} + engines: {node: '>= 8.0.0'} dev: true - /modify-values@1.0.1: - resolution: {integrity: sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==} - engines: {node: '>=0.10.0'} + /mlly@1.4.2: + resolution: {integrity: sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==} + dependencies: + acorn: 8.10.0 + pathe: 1.1.1 + pkg-types: 1.0.3 + ufo: 1.3.1 dev: true /mri@1.2.0: @@ -3028,52 +2939,62 @@ packages: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true - /mz@2.7.0: - resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} - dependencies: - any-promise: 1.3.0 - object-assign: 4.1.1 - thenify-all: 1.6.0 - dev: true - - /natural-compare-lite@1.4.0: - resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} + /nanoid@3.3.6: + resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true dev: true /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true - /neo-async@2.6.2: - resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - dev: true - /nice-try@1.0.5: resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} dev: true + /node-fetch@2.7.0: + resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + dependencies: + whatwg-url: 5.0.0 + dev: true + /normalize-package-data@2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: hosted-git-info: 2.8.9 - resolve: 1.22.4 + resolve: 1.22.6 semver: 5.7.2 validate-npm-package-license: 3.0.4 dev: true - /normalize-package-data@3.0.3: - resolution: {integrity: sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==} - engines: {node: '>=10'} + /npm-bundled@2.0.1: + resolution: {integrity: sha512-gZLxXdjEzE/+mOstGDqR6b0EkhJ+kM6fxM6vUuckuctuVPh80Q6pw/rSZj9s4Gex9GxWtIicO1pc8DB9KZWudw==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} dependencies: - hosted-git-info: 4.1.0 - is-core-module: 2.13.0 - semver: 7.5.4 - validate-npm-package-license: 3.0.4 + npm-normalize-package-bin: 2.0.0 dev: true - /normalize-path@3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} + /npm-normalize-package-bin@2.0.0: + resolution: {integrity: sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dev: true + + /npm-packlist@5.1.3: + resolution: {integrity: sha512-263/0NGrn32YFYi4J533qzrQ/krmmrWwhKkzwTuM4f/07ug51odoaNjUexxO4vxlzURHcmYMH1QjvHjsNDKLVg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + hasBin: true + dependencies: + glob: 8.1.0 + ignore-walk: 5.0.1 + npm-bundled: 2.0.1 + npm-normalize-package-bin: 2.0.0 dev: true /npm-run-all@4.1.5: @@ -3089,7 +3010,7 @@ packages: pidtree: 0.3.1 read-pkg: 3.0.0 shell-quote: 1.8.1 - string.prototype.padend: 3.1.4 + string.prototype.padend: 3.1.5 dev: true /npm-run-path@4.0.1: @@ -3106,11 +3027,6 @@ packages: path-key: 4.0.0 dev: true - /object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - dev: true - /object-inspect@1.12.3: resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} dev: true @@ -3125,7 +3041,7 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.2.0 + define-properties: 1.2.1 has-symbols: 1.0.3 object-keys: 1.1.1 dev: true @@ -3172,11 +3088,20 @@ packages: type-check: 0.4.0 dev: true - /p-limit@1.3.0: - resolution: {integrity: sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==} - engines: {node: '>=4'} + /os-tmpdir@1.0.2: + resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} + engines: {node: '>=0.10.0'} + dev: true + + /outdent@0.5.0: + resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} + dev: true + + /p-filter@2.1.0: + resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==} + engines: {node: '>=8'} dependencies: - p-try: 1.0.0 + p-map: 2.1.0 dev: true /p-limit@2.3.0: @@ -3193,11 +3118,11 @@ packages: yocto-queue: 0.1.0 dev: true - /p-locate@2.0.0: - resolution: {integrity: sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==} - engines: {node: '>=4'} + /p-limit@4.0.0: + resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: - p-limit: 1.3.0 + yocto-queue: 1.0.0 dev: true /p-locate@4.1.0: @@ -3214,16 +3139,9 @@ packages: p-limit: 3.1.0 dev: true - /p-map@4.0.0: - resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} - engines: {node: '>=10'} - dependencies: - aggregate-error: 3.1.0 - dev: true - - /p-try@1.0.0: - resolution: {integrity: sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==} - engines: {node: '>=4'} + /p-map@2.1.0: + resolution: {integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==} + engines: {node: '>=6'} dev: true /p-try@2.2.0: @@ -3261,17 +3179,12 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} dependencies: - '@babel/code-frame': 7.22.5 + '@babel/code-frame': 7.22.13 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 dev: true - /path-exists@3.0.0: - resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} - engines: {node: '>=4'} - dev: true - /path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -3301,14 +3214,6 @@ packages: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: true - /path-scurry@1.10.1: - resolution: {integrity: sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==} - engines: {node: '>=16 || 14 >=14.17'} - dependencies: - lru-cache: 10.0.0 - minipass: 7.0.2 - dev: true - /path-type@3.0.0: resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==} engines: {node: '>=4'} @@ -3321,6 +3226,14 @@ packages: engines: {node: '>=8'} dev: true + /pathe@1.1.1: + resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==} + dev: true + + /pathval@1.1.1: + resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} + dev: true + /picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} dev: true @@ -3342,35 +3255,48 @@ packages: hasBin: true dev: true - /pify@2.3.0: - resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} - engines: {node: '>=0.10.0'} - dev: true - /pify@3.0.0: resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==} engines: {node: '>=4'} dev: true - /pirates@4.0.6: - resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} - engines: {node: '>= 6'} + /pify@4.0.1: + resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} + engines: {node: '>=6'} dev: true - /postcss-load-config@4.0.1: - resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} - engines: {node: '>= 14'} - peerDependencies: - postcss: '>=8.0.9' - ts-node: '>=9.0.0' - peerDependenciesMeta: - postcss: - optional: true - ts-node: - optional: true + /pkg-dir@4.2.0: + resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} + engines: {node: '>=8'} dependencies: - lilconfig: 2.1.0 - yaml: 2.3.1 + find-up: 4.1.0 + dev: true + + /pkg-types@1.0.3: + resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} + dependencies: + jsonc-parser: 3.2.0 + mlly: 1.4.2 + pathe: 1.1.1 + dev: true + + /postcss@8.4.31: + resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.6 + picocolors: 1.0.0 + source-map-js: 1.0.2 + dev: true + + /preferred-pm@3.1.2: + resolution: {integrity: sha512-nk7dKrcW8hfCZ4H6klWcdRknBOXWzNQByJ0oJyX97BOupsYD+FzLS4hflgEu/uPUEHZCuRfMxzCBsuWd7OzT8Q==} + engines: {node: '>=10'} + dependencies: + find-up: 5.0.0 + find-yarn-workspace-root2: 1.2.16 + path-exists: 4.0.0 + which-pm: 2.0.0 dev: true /prelude-ls@1.2.1: @@ -3385,14 +3311,39 @@ packages: fast-diff: 1.3.0 dev: true - /prettier@3.0.1: - resolution: {integrity: sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ==} + /prettier@2.8.8: + resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} + engines: {node: '>=10.13.0'} + hasBin: true + dev: true + + /prettier@3.0.3: + resolution: {integrity: sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==} engines: {node: '>=14'} hasBin: true dev: true - /process-nextick-args@2.0.1: - resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + /pretty-format@29.7.0: + resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.6.3 + ansi-styles: 5.2.0 + react-is: 18.2.0 + dev: true + + /pseudomap@1.0.2: + resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} + dev: true + + /publint@0.2.3: + resolution: {integrity: sha512-Ml/rLotRiRTCbqL8CtWURiWDPzHtjv1SKU2E91R0ZG4mDJS3/rNQXYttM+Wt5t0JZ09MyAXIa/TYOt5OVUlYAQ==} + engines: {node: '>=16'} + hasBin: true + dependencies: + npm-packlist: 5.1.3 + picocolors: 1.0.0 + sade: 1.8.1 dev: true /punycode@2.3.0: @@ -3400,11 +3351,6 @@ packages: engines: {node: '>=6'} dev: true - /q@1.5.1: - resolution: {integrity: sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==} - engines: {node: '>=0.6.0', teleport: '>=0.2.0'} - dev: true - /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true @@ -3414,12 +3360,8 @@ packages: engines: {node: '>=8'} dev: true - /read-pkg-up@3.0.0: - resolution: {integrity: sha512-YFzFrVvpC6frF1sz8psoHDBGF7fLPc+llq/8NB43oagqWkx8ar5zYtsTORtOjw9W2RHLpWP+zTWwBvf1bCmcSw==} - engines: {node: '>=4'} - dependencies: - find-up: 2.1.0 - read-pkg: 3.0.0 + /react-is@18.2.0: + resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: true /read-pkg-up@7.0.1: @@ -3444,38 +3386,20 @@ packages: resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} engines: {node: '>=8'} dependencies: - '@types/normalize-package-data': 2.4.1 + '@types/normalize-package-data': 2.4.2 normalize-package-data: 2.5.0 - parse-json: 5.2.0 - type-fest: 0.6.0 - dev: true - - /readable-stream@2.3.8: - resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} - dependencies: - core-util-is: 1.0.3 - inherits: 2.0.4 - isarray: 1.0.0 - process-nextick-args: 2.0.1 - safe-buffer: 5.1.2 - string_decoder: 1.1.1 - util-deprecate: 1.0.2 - dev: true - - /readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 + parse-json: 5.2.0 + type-fest: 0.6.0 dev: true - /readdirp@3.6.0: - resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} - engines: {node: '>=8.10.0'} + /read-yaml-file@1.1.0: + resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} + engines: {node: '>=6'} dependencies: - picomatch: 2.3.1 + graceful-fs: 4.2.11 + js-yaml: 3.14.1 + pify: 4.0.1 + strip-bom: 3.0.0 dev: true /redent@3.0.0: @@ -3486,18 +3410,17 @@ packages: strip-indent: 3.0.0 dev: true - /regexp.prototype.flags@1.5.0: - resolution: {integrity: sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==} + /regenerator-runtime@0.14.0: + resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==} + dev: true + + /regexp.prototype.flags@1.5.1: + resolution: {integrity: sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==} 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'} + define-properties: 1.2.1 + set-function-name: 2.0.1 dev: true /require-directory@2.1.1: @@ -3505,9 +3428,8 @@ packages: engines: {node: '>=0.10.0'} dev: true - /require-from-string@2.0.2: - resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} - engines: {node: '>=0.10.0'} + /require-main-filename@2.0.0: + resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} dev: true /resolve-from@4.0.0: @@ -3520,15 +3442,12 @@ packages: engines: {node: '>=8'} dev: true - /resolve-global@1.0.0: - resolution: {integrity: sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw==} - engines: {node: '>=8'} - dependencies: - global-dirs: 0.1.1 + /resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} dev: true - /resolve@1.22.4: - resolution: {integrity: sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==} + /resolve@1.22.6: + resolution: {integrity: sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==} hasBin: true dependencies: is-core-module: 2.13.0 @@ -3536,9 +3455,9 @@ packages: supports-preserve-symlinks-flag: 1.0.0 dev: true - /restore-cursor@3.1.0: - resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} - engines: {node: '>=8'} + /restore-cursor@4.0.0: + resolution: {integrity: sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: onetime: 5.1.2 signal-exit: 3.0.7 @@ -3560,20 +3479,12 @@ packages: glob: 7.2.3 dev: true - /rimraf@5.0.1: - resolution: {integrity: sha512-OfFZdwtd3lZ+XZzYP/6gTACubwFcHdLRqS9UX3UwpU2dnGQYkPFISRwvM3w9IiB2w7bW5qGo/uAwE4SmXXSKvg==} - engines: {node: '>=14'} - hasBin: true - dependencies: - glob: 10.3.3 - dev: true - - /rollup@3.27.2: - resolution: {integrity: sha512-YGwmHf7h2oUHkVBT248x0yt6vZkYQ3/rvE5iQuVBh3WO8GcJ6BNeOkpoX1yMHIiBm18EMLjBPIoUDkhgnyxGOQ==} + /rollup@3.29.4: + resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /run-applescript@5.0.0: @@ -3589,12 +3500,6 @@ packages: queue-microtask: 1.2.3 dev: true - /rxjs@7.8.1: - resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} - dependencies: - tslib: 2.6.1 - dev: true - /sade@1.8.1: resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} engines: {node: '>=6'} @@ -3602,8 +3507,8 @@ packages: mri: 1.2.0 dev: true - /safe-array-concat@1.0.0: - resolution: {integrity: sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==} + /safe-array-concat@1.0.1: + resolution: {integrity: sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==} engines: {node: '>=0.4'} dependencies: call-bind: 1.0.2 @@ -3612,14 +3517,6 @@ packages: isarray: 2.0.5 dev: true - /safe-buffer@5.1.2: - resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} - dev: true - - /safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - dev: true - /safe-regex-test@1.0.0: resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} dependencies: @@ -3628,30 +3525,34 @@ packages: is-regex: 1.1.4 dev: true - /semver@5.7.2: - resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} - hasBin: true + /safer-buffer@2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} dev: true - /semver@6.3.1: - resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + /semver@5.7.2: + resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} hasBin: true dev: true - /semver@7.5.2: - resolution: {integrity: sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==} + /semver@7.5.4: + resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} engines: {node: '>=10'} hasBin: true dependencies: lru-cache: 6.0.0 dev: true - /semver@7.5.4: - resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} - engines: {node: '>=10'} - hasBin: true + /set-blocking@2.0.0: + resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + dev: true + + /set-function-name@2.0.1: + resolution: {integrity: sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==} + engines: {node: '>= 0.4'} dependencies: - lru-cache: 6.0.0 + define-data-property: 1.1.0 + functions-have-names: 1.2.3 + has-property-descriptors: 1.0.0 dev: true /shebang-command@1.2.0: @@ -3690,13 +3591,12 @@ packages: object-inspect: 1.12.3 dev: true - /signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + /siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} dev: true - /signal-exit@4.1.0: - resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} - engines: {node: '>=14'} + /signal-exit@3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} dev: true /slash@3.0.0: @@ -3704,24 +3604,6 @@ packages: engines: {node: '>=8'} dev: true - /slice-ansi@3.0.0: - resolution: {integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==} - engines: {node: '>=8'} - dependencies: - ansi-styles: 4.3.0 - astral-regex: 2.0.0 - is-fullwidth-code-point: 3.0.0 - dev: true - - /slice-ansi@4.0.0: - resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} - engines: {node: '>=10'} - dependencies: - ansi-styles: 4.3.0 - astral-regex: 2.0.0 - is-fullwidth-code-point: 3.0.0 - dev: true - /slice-ansi@5.0.0: resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} engines: {node: '>=12'} @@ -3730,23 +3612,41 @@ packages: is-fullwidth-code-point: 4.0.0 dev: true + /smartwrap@2.0.2: + resolution: {integrity: sha512-vCsKNQxb7PnCNd2wY1WClWifAc2lwqsG8OaswpJkVJsvMGcnEntdTCDajZCkk93Ay1U3t/9puJmb525Rg5MZBA==} + engines: {node: '>=6'} + hasBin: true + dependencies: + array.prototype.flat: 1.3.2 + breakword: 1.0.6 + grapheme-splitter: 1.0.4 + strip-ansi: 6.0.1 + wcwidth: 1.0.1 + yargs: 15.4.1 + dev: true + + /source-map-js@1.0.2: + resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} + engines: {node: '>=0.10.0'} + dev: true + /source-map@0.6.1: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} dev: true - /source-map@0.8.0-beta.0: - resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} - engines: {node: '>= 8'} + /spawndamnit@2.0.0: + resolution: {integrity: sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==} dependencies: - whatwg-url: 7.1.0 + cross-spawn: 5.1.0 + signal-exit: 3.0.7 dev: true /spdx-correct@3.2.0: resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} dependencies: spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.13 + spdx-license-ids: 3.0.15 dev: true /spdx-exceptions@2.3.0: @@ -3757,23 +3657,29 @@ packages: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} dependencies: spdx-exceptions: 2.3.0 - spdx-license-ids: 3.0.13 + spdx-license-ids: 3.0.15 dev: true - /spdx-license-ids@3.0.13: - resolution: {integrity: sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==} + /spdx-license-ids@3.0.15: + resolution: {integrity: sha512-lpT8hSQp9jAKp9mhtBU4Xjon8LPGBvLIuBiSVhMEtmLecTh2mO0tlqrAMp47tBXzMr13NJMQ2lf7RpQGLJ3HsQ==} dev: true - /split2@3.2.2: - resolution: {integrity: sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==} - dependencies: - readable-stream: 3.6.2 + /sprintf-js@1.0.3: + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + dev: true + + /stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + dev: true + + /std-env@3.4.3: + resolution: {integrity: sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==} dev: true - /split@1.0.1: - resolution: {integrity: sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==} + /stream-transform@2.1.3: + resolution: {integrity: sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==} dependencies: - through: 2.3.8 + mixme: 0.5.9 dev: true /string-argv@0.3.2: @@ -3799,50 +3705,38 @@ packages: strip-ansi: 7.1.0 dev: true - /string.prototype.padend@3.1.4: - resolution: {integrity: sha512-67otBXoksdjsnXXRUq+KMVTdlVRZ2af422Y0aTyTjVaoQkGr3mxl2Bc5emi7dOQ3OGVVQQskmLEWwFXwommpNw==} + /string.prototype.padend@3.1.5: + resolution: {integrity: sha512-DOB27b/2UTTD+4myKUFh+/fXWcu/UDyASIXfg+7VzoCNNGOfWvoyU/x5pvVHr++ztyt/oSYI1BcWBBG/hmlNjA==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.22.1 + define-properties: 1.2.1 + es-abstract: 1.22.2 dev: true - /string.prototype.trim@1.2.7: - resolution: {integrity: sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==} + /string.prototype.trim@1.2.8: + resolution: {integrity: sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.22.1 + define-properties: 1.2.1 + es-abstract: 1.22.2 dev: true - /string.prototype.trimend@1.0.6: - resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} + /string.prototype.trimend@1.0.7: + resolution: {integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==} dependencies: call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.22.1 + define-properties: 1.2.1 + es-abstract: 1.22.2 dev: true - /string.prototype.trimstart@1.0.6: - resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==} + /string.prototype.trimstart@1.0.7: + resolution: {integrity: sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==} dependencies: call-bind: 1.0.2 - define-properties: 1.2.0 - es-abstract: 1.22.1 - dev: true - - /string_decoder@1.1.1: - resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} - dependencies: - safe-buffer: 5.1.2 - dev: true - - /string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - dependencies: - safe-buffer: 5.2.1 + define-properties: 1.2.1 + es-abstract: 1.22.2 dev: true /strip-ansi@6.0.1: @@ -3886,18 +3780,10 @@ packages: engines: {node: '>=8'} dev: true - /sucrase@3.34.0: - resolution: {integrity: sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==} - engines: {node: '>=8'} - hasBin: true + /strip-literal@1.3.0: + resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==} dependencies: - '@jridgewell/gen-mapping': 0.3.3 - commander: 4.1.1 - glob: 7.1.6 - lines-and-columns: 1.2.4 - mz: 2.7.0 - pirates: 4.0.6 - ts-interface-checker: 0.1.13 + acorn: 8.10.0 dev: true /supports-color@5.5.0: @@ -3924,20 +3810,12 @@ packages: engines: {node: ^14.18.0 || >=16.0.0} dependencies: '@pkgr/utils': 2.4.2 - tslib: 2.6.1 - dev: true - - /temp-dir@2.0.0: - resolution: {integrity: sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==} - engines: {node: '>=8'} + tslib: 2.6.2 dev: true - /tempfile@3.0.0: - resolution: {integrity: sha512-uNFCg478XovRi85iD42egu+eSFUmmka750Jy7L5tfHI5hQKKtbPnxaSaXAbBqCDYrw3wx4tXjKwci4/QmsZJxw==} + /term-size@2.2.1: + resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} engines: {node: '>=8'} - dependencies: - temp-dir: 2.0.0 - uuid: 3.4.0 dev: true /test-exclude@6.0.0: @@ -3949,50 +3827,29 @@ packages: minimatch: 3.1.2 dev: true - /text-extensions@1.9.0: - resolution: {integrity: sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==} - engines: {node: '>=0.10'} - dev: true - /text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true - /thenify-all@1.6.0: - resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} - engines: {node: '>=0.8'} - dependencies: - thenify: 3.3.1 - dev: true - - /thenify@3.3.1: - resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} - dependencies: - any-promise: 1.3.0 - dev: true - - /through2@2.0.5: - resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==} + /tiny-glob@0.2.9: + resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==} dependencies: - readable-stream: 2.3.8 - xtend: 4.0.2 + globalyzer: 0.1.0 + globrex: 0.1.2 dev: true - /through2@4.0.2: - resolution: {integrity: sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==} - dependencies: - readable-stream: 3.6.2 + /tinybench@2.5.1: + resolution: {integrity: sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==} dev: true - /through@2.3.8: - resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} + /tinypool@0.7.0: + resolution: {integrity: sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==} + engines: {node: '>=14.0.0'} dev: true - /tiny-glob@0.2.9: - resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==} - dependencies: - globalyzer: 0.1.0 - globrex: 0.1.2 + /tinyspy@2.1.1: + resolution: {integrity: sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w==} + engines: {node: '>=14.0.0'} dev: true /titleize@3.0.0: @@ -4000,6 +3857,13 @@ packages: engines: {node: '>=12'} dev: true + /tmp@0.0.33: + resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} + engines: {node: '>=0.6.0'} + dependencies: + os-tmpdir: 1.0.2 + dev: true + /to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -4007,15 +3871,8 @@ packages: is-number: 7.0.0 dev: true - /tr46@1.0.1: - resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} - dependencies: - punycode: 2.3.0 - dev: true - - /tree-kill@1.2.2: - resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} - hasBin: true + /tr46@0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} dev: true /trim-newlines@3.0.1: @@ -4023,96 +3880,42 @@ packages: engines: {node: '>=8'} dev: true - /ts-api-utils@1.0.1(typescript@5.1.6): - resolution: {integrity: sha512-lC/RGlPmwdrIBFTX59wwNzqh7aR2otPNPR/5brHZm/XKFYKsfqxihXUe9pU3JI+3vGkl+vyCoNNnPhJn3aLK1A==} + /ts-api-utils@1.0.3(typescript@5.0.4): + resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} engines: {node: '>=16.13.0'} peerDependencies: typescript: '>=4.2.0' dependencies: - typescript: 5.1.6 - dev: true - - /ts-interface-checker@0.1.13: - resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + typescript: 5.0.4 dev: true - /ts-node@10.9.1(@types/node@20.4.8)(typescript@5.1.6): - resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + /tsconfck@2.1.2: + resolution: {integrity: sha512-ghqN1b0puy3MhhviwO2kGF8SeMDNhEbnKxjK7h6+fvY9JAxqvXi8y5NAHSQv687OVboS2uZIByzGd45/YxrRHg==} + engines: {node: ^14.13.1 || ^16 || >=18} hasBin: true peerDependencies: - '@swc/core': '>=1.2.50' - '@swc/wasm': '>=1.2.50' - '@types/node': '*' - typescript: '>=2.7' + typescript: ^4.3.5 || ^5.0.0 peerDependenciesMeta: - '@swc/core': - optional: true - '@swc/wasm': + typescript: optional: true - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.9 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.4 - '@types/node': 20.4.8 - acorn: 8.10.0 - acorn-walk: 8.2.0 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.2 - make-error: 1.3.6 - typescript: 5.1.6 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - dev: true - - /tslib@2.6.1: - resolution: {integrity: sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==} dev: true - /tsm@2.3.0: - resolution: {integrity: sha512-++0HFnmmR+gMpDtKTnW3XJ4yv9kVGi20n+NfyQWB9qwJvTaIWY9kBmzek2YUQK5APTQ/1DTrXmm4QtFPmW9Rzw==} - engines: {node: '>=12'} - hasBin: true - dependencies: - esbuild: 0.18.18 + /tslib@2.6.2: + resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} dev: true - /tsup@7.2.0(typescript@5.1.6): - resolution: {integrity: sha512-vDHlczXbgUvY3rWvqFEbSqmC1L7woozbzngMqTtL2PGBODTtWlRwGDDawhvWzr5c1QjKe4OAKqJGfE1xeXUvtQ==} - engines: {node: '>=16.14'} + /tty-table@4.2.2: + resolution: {integrity: sha512-2gvCArMZLxgvpZ2NvQKdnYWIFLe7I/z5JClMuhrDXunmKgSZcQKcZRjN9XjAFiToMz2pUo1dEIXyrm0AwgV5Tw==} + engines: {node: '>=8.0.0'} hasBin: true - peerDependencies: - '@swc/core': ^1 - postcss: ^8.4.12 - typescript: '>=4.1.0' - peerDependenciesMeta: - '@swc/core': - optional: true - postcss: - optional: true - typescript: - optional: true dependencies: - bundle-require: 4.0.1(esbuild@0.18.18) - cac: 6.7.14 - chokidar: 3.5.3 - debug: 4.3.4 - esbuild: 0.18.18 - execa: 5.1.1 - globby: 11.1.0 - joycon: 3.1.1 - postcss-load-config: 4.0.1 - resolve-from: 5.0.0 - rollup: 3.27.2 - source-map: 0.8.0-beta.0 - sucrase: 3.34.0 - tree-kill: 1.2.2 - typescript: 5.1.6 - transitivePeerDependencies: - - supports-color - - ts-node + chalk: 4.1.2 + csv: 5.5.3 + kleur: 4.1.5 + smartwrap: 2.0.2 + strip-ansi: 6.0.1 + wcwidth: 1.0.1 + yargs: 17.7.2 dev: true /type-check@0.4.0: @@ -4122,18 +3925,18 @@ packages: prelude-ls: 1.2.1 dev: true - /type-fest@0.18.1: - resolution: {integrity: sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==} - engines: {node: '>=10'} + /type-detect@4.0.8: + resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} + engines: {node: '>=4'} dev: true - /type-fest@0.20.2: - resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + /type-fest@0.13.1: + resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} engines: {node: '>=10'} dev: true - /type-fest@0.21.3: - resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + /type-fest@0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} dev: true @@ -4147,6 +3950,11 @@ packages: engines: {node: '>=8'} dev: true + /type-fest@1.4.0: + resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==} + engines: {node: '>=10'} + dev: true + /typed-array-buffer@1.0.0: resolution: {integrity: sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==} engines: {node: '>= 0.4'} @@ -4185,19 +3993,21 @@ packages: is-typed-array: 1.1.12 dev: true - /typescript@5.1.6: - resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} - engines: {node: '>=14.17'} + /typescript@5.0.4: + resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==} + engines: {node: '>=12.20'} hasBin: true dev: true - /uglify-js@3.17.4: - resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} - engines: {node: '>=0.8.0'} + /typescript@5.2.2: + resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} + engines: {node: '>=14.17'} hasBin: true - requiresBuild: true dev: true - optional: true + + /ufo@1.3.1: + resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==} + dev: true /unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} @@ -4211,12 +4021,12 @@ packages: /unist-util-stringify-position@2.0.3: resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} dependencies: - '@types/unist': 2.0.7 + '@types/unist': 2.0.8 dev: true - /universalify@2.0.0: - resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==} - engines: {node: '>= 10.0.0'} + /universalify@0.1.2: + resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} + engines: {node: '>= 4.0.0'} dev: true /untildify@4.0.0: @@ -4230,36 +4040,11 @@ packages: punycode: 2.3.0 dev: true - /util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - dev: true - - /uuid@3.4.0: - resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==} - deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. - hasBin: true - dev: true - - /uvu@0.5.6: - resolution: {integrity: sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==} - engines: {node: '>=8'} - hasBin: true - dependencies: - dequal: 2.0.3 - diff: 5.1.0 - kleur: 4.1.5 - sade: 1.8.1 - dev: true - - /v8-compile-cache-lib@3.0.1: - resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} - dev: true - /v8-to-istanbul@9.1.0: resolution: {integrity: sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==} engines: {node: '>=10.12.0'} dependencies: - '@jridgewell/trace-mapping': 0.3.18 + '@jridgewell/trace-mapping': 0.3.19 '@types/istanbul-lib-coverage': 2.0.4 convert-source-map: 1.9.0 dev: true @@ -4271,24 +4056,144 @@ packages: spdx-expression-parse: 3.0.1 dev: true - /watchlist@0.3.1: - resolution: {integrity: sha512-m5r4bzxJ9eg07TT/O0Q49imFPD45ZTuQ3kaHwSpUJj1QwVd3pzit4UYOmySdmAP5Egkz6mB6hcAPuPfhIbNo0g==} - engines: {node: '>=8'} + /vite-node@0.34.6(@types/node@20.8.0): + resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==} + engines: {node: '>=v14.18.0'} hasBin: true dependencies: - mri: 1.2.0 + cac: 6.7.14 + debug: 4.3.4 + mlly: 1.4.2 + pathe: 1.1.1 + picocolors: 1.0.0 + vite: 4.4.9(@types/node@20.8.0) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + dev: true + + /vite@4.4.9(@types/node@20.8.0): + resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==} + engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true + peerDependencies: + '@types/node': '>= 14' + less: '*' + lightningcss: ^1.21.0 + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 20.8.0 + esbuild: 0.18.20 + postcss: 8.4.31 + rollup: 3.29.4 + optionalDependencies: + fsevents: 2.3.3 + dev: true + + /vitest@0.34.6: + resolution: {integrity: sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==} + engines: {node: '>=v14.18.0'} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@vitest/browser': '*' + '@vitest/ui': '*' + happy-dom: '*' + jsdom: '*' + playwright: '*' + safaridriver: '*' + webdriverio: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + playwright: + optional: true + safaridriver: + optional: true + webdriverio: + optional: true + dependencies: + '@types/chai': 4.3.6 + '@types/chai-subset': 1.3.3 + '@types/node': 20.8.0 + '@vitest/expect': 0.34.6 + '@vitest/runner': 0.34.6 + '@vitest/snapshot': 0.34.6 + '@vitest/spy': 0.34.6 + '@vitest/utils': 0.34.6 + acorn: 8.10.0 + acorn-walk: 8.2.0 + cac: 6.7.14 + chai: 4.3.10 + debug: 4.3.4 + local-pkg: 0.4.3 + magic-string: 0.30.4 + pathe: 1.1.1 + picocolors: 1.0.0 + std-env: 3.4.3 + strip-literal: 1.3.0 + tinybench: 2.5.1 + tinypool: 0.7.0 + vite: 4.4.9(@types/node@20.8.0) + vite-node: 0.34.6(@types/node@20.8.0) + why-is-node-running: 2.2.2 + transitivePeerDependencies: + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + dev: true + + /wcwidth@1.0.1: + resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} + dependencies: + defaults: 1.0.4 dev: true - /webidl-conversions@4.0.2: - resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} + /webidl-conversions@3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} dev: true - /whatwg-url@7.1.0: - resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} + /whatwg-url@5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} dependencies: - lodash.sortby: 4.7.0 - tr46: 1.0.1 - webidl-conversions: 4.0.2 + tr46: 0.0.3 + webidl-conversions: 3.0.1 dev: true /which-boxed-primitive@1.0.2: @@ -4301,6 +4206,18 @@ packages: is-symbol: 1.0.4 dev: true + /which-module@2.0.1: + resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} + dev: true + + /which-pm@2.0.0: + resolution: {integrity: sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==} + engines: {node: '>=8.15'} + dependencies: + load-yaml-file: 0.2.0 + path-exists: 4.0.0 + dev: true + /which-typed-array@1.1.11: resolution: {integrity: sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==} engines: {node: '>= 0.4'} @@ -4327,8 +4244,13 @@ packages: isexe: 2.0.0 dev: true - /wordwrap@1.0.0: - resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} + /why-is-node-running@2.2.2: + resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==} + engines: {node: '>=8'} + hasBin: true + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 dev: true /wrap-ansi@6.2.0: @@ -4362,9 +4284,8 @@ packages: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} dev: true - /xtend@4.0.2: - resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} - engines: {node: '>=0.4'} + /y18n@4.0.3: + resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} dev: true /y18n@5.0.8: @@ -4372,6 +4293,10 @@ packages: engines: {node: '>=10'} dev: true + /yallist@2.1.2: + resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} + dev: true + /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: true @@ -4381,9 +4306,12 @@ packages: engines: {node: '>= 14'} dev: true - /yargs-parser@20.2.9: - resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} - engines: {node: '>=10'} + /yargs-parser@18.1.3: + resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} + engines: {node: '>=6'} + dependencies: + camelcase: 5.3.1 + decamelize: 1.2.0 dev: true /yargs-parser@21.1.1: @@ -4391,17 +4319,21 @@ packages: engines: {node: '>=12'} dev: true - /yargs@16.2.0: - resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} - engines: {node: '>=10'} + /yargs@15.4.1: + resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} + engines: {node: '>=8'} dependencies: - cliui: 7.0.4 - escalade: 3.1.1 + cliui: 6.0.0 + decamelize: 1.2.0 + find-up: 4.1.0 get-caller-file: 2.0.5 require-directory: 2.1.1 + require-main-filename: 2.0.0 + set-blocking: 2.0.0 string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 20.2.9 + which-module: 2.0.1 + y18n: 4.0.3 + yargs-parser: 18.1.3 dev: true /yargs@17.7.2: @@ -4417,12 +4349,12 @@ packages: yargs-parser: 21.1.1 dev: true - /yn@3.1.1: - resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} - engines: {node: '>=6'} - dev: true - /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} dev: true + + /yocto-queue@1.0.0: + resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} + engines: {node: '>=12.20'} + dev: true diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..18ec407 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - 'packages/*' diff --git a/scripts/bench.js b/scripts/bench.js new file mode 100644 index 0000000..91bd67c --- /dev/null +++ b/scripts/bench.js @@ -0,0 +1,257 @@ +import { Bench } from 'tinybench'; +import * as tsconfck2 from 'tsconfck-2'; +import * as tsconfck3 from 'tsconfck-3'; +import { hrtimeNow } from 'tinybench'; +import { execSync } from 'node:child_process'; + +import { getTsconfig } from 'get-tsconfig'; +import glob from 'tiny-glob/sync.js'; +import { transform } from 'esbuild'; + +import fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; +// version of typescript source to download. must be an existing release version +// downloaded and extracted with curl + tar -xzf +const TS_VERSION = '5.2.2'; + +const args = process.argv.slice(2); +const forceInit = args.includes('--init'); +const updateDocs = args.includes('--write'); +const benchDir = fileURLToPath(new URL('../.bench', import.meta.url)); +const srcDir = `${benchDir}/src`; + +async function prepare() { + if (forceInit && fs.existsSync(benchDir)) { + fs.rmSync(benchDir, { recursive: true }); + } + if (!fs.existsSync(benchDir)) { + console.log(`preparing ${srcDir}: download and extract typescript ${TS_VERSION} src`); + fs.mkdirSync(benchDir); + execSync( + `curl https://github.com/microsoft/TypeScript/archive/refs/tags/v${TS_VERSION}.tar.gz -L -o ${benchDir}/ts.tgz` + ); + try { + execSync( + `tar --transform s/TypeScript-${TS_VERSION}// -xzf ts.tgz TypeScript-${TS_VERSION}/src`, + { cwd: benchDir } + ); + } catch (e) { + if (!fs.existsSync(srcDir)) { + throw e; // on windows git-bash tar might still error even after successfully extracting it + } + } + + if (!fs.existsSync(srcDir)) { + throw new Error( + `failed to extract ${benchDir}/ts.tgz TypeScript-${TS_VERSION}/src to ${srcDir}` + ); + } + if (fs.existsSync(`${benchDir}/ts.tgz`)) { + fs.rmSync(`${benchDir}/ts.tgz`); + } + if (fs.existsSync(`${srcDir}/loc`)) { + fs.rmSync(`${srcDir}/loc`, { recursive: true }); // localization data + } + console.log('preparation done'); + } +} + +function getPackageVersions() { + const pnpmLS = JSON.parse(execSync('pnpm ls -r --json')); + const tsconfckData = pnpmLS.find((x) => x.name === 'tsconfck'); + const monoRepoData = pnpmLS.find((x) => x.name === 'tsconfck-monorepo'); + const tsconfck3 = tsconfckData.version; + const tsconfck2 = monoRepoData.devDependencies['tsconfck-2'].version; + const getTSConfig = monoRepoData.devDependencies['get-tsconfig'].version; + return { + tsconfck2, + tsconfck3, + getTSConfig + }; +} + +await prepare(); +const versions = getPackageVersions(); +const allTSFiles = glob(`${srcDir}/**/*.ts`); + +async function benchParse({ parseConfig = false, readFiles = false, transformFiles = false }) { + const results = []; + + async function bench(name, executor) { + const bench = new Bench({ warmupIterations: 1, iterations: 20, time: 5000, now: hrtimeNow }); + bench.add(name.padEnd(35, ' '), executor); + await bench.run(); + results.push(bench.table()[0]); + if (global.gc) { + global.gc(); + await new Promise((r) => setTimeout(r, 5000)); + } + } + + async function work(parser, parserOptions) { + return Promise.all( + allTSFiles.map((f) => + Promise.all([ + (parseConfig ? parser(f, parserOptions) : Promise.resolve({ tsconfig: {} })) + .then((r) => r.tsconfig) + .catch((e) => { + console.log(`parse for ${f} failed`, e); + return {}; + }), + readFiles ? fs.promises.readFile(f, 'utf-8') : Promise.resolve('') + ]).then(([config, input]) => { + if (config) { + config.compilerOptions = { ...config.compilerOptions }; // make sure it's used + } + return transformFiles + ? transform(input, { + loader: 'ts', + tsconfigRaw: { compilerOptions: {} } + // don't use parsed config to ensure baseline and actual do the same amount of work + }).catch((e) => { + console.log(`transform for ${f} failed`, e); + }) + : Promise.resolve({ code: '' }); + }) + ) + ); + } + + await bench(`baseline`, async () => { + // parser not doing anything + await work(async () => Promise.resolve({ tsconfig: {} })); + }); + + await bench(`get-tsconfig@${versions.getTSConfig}`, async () => { + const cache = new Map(); + await work(async (f, c) => { + return { tsconfig: getTsconfig(f, 'tsconfig.json', c).config }; + }, cache); + }); + + await bench(`tsconfck@${versions.tsconfck3} without cache`, async () => { + await work(tsconfck3.parse, {}); + }); + + await bench(`tsconfck@${versions.tsconfck3} parseNative`, async () => { + const cache = new tsconfck3.TSConfckCache(); + await work(tsconfck3.parseNative, { cache }); + }); + + await bench(`tsconfck@${versions.tsconfck3} parse`, async () => { + const cache = new tsconfck3.TSConfckCache(); + await work(tsconfck3.parse, { cache }); + }); + + await bench(`tsconfck@${versions.tsconfck2} parse`, async () => { + const cache = new Map(); + await work(tsconfck2.parse, { cache }); + }); + + await bench(`tsconfck@${versions.tsconfck2} parse with findAll`, async () => { + const root = '.'; + const tsConfigPaths = new Set([ + ...(await tsconfck2.findAll(root, { + skip: (dir) => dir === 'node_modules' || dir === '.git' + })) + ]); + const cache = new Map(); + await work(tsconfck2.parse, { cache, root, tsConfigPaths }); + }); + + return results; +} + +async function executeBenchParse(name, params) { + const results = await benchParse(params); + const avgKey = 'Average Time (ns)'; + const baselineIdx = results.findIndex((r) => r['Task Name'].startsWith('baseline')); + const baselineResult = results[baselineIdx]; + const baselineAvg = baselineResult[avgKey]; + results.splice(baselineIdx, 1); + results.sort((a, b) => a[avgKey] - b[avgKey]); + results.forEach((r) => { + r['z_' + avgKey] = r[avgKey] - baselineAvg; + }); + const fastest = results[0][avgKey]; + const z_fastest = results[0]['z_' + avgKey]; + results.forEach((r) => { + r['Avg(total)'] = (r[avgKey] / 1_000_000).toFixed(2).padStart(6, ' ') + 'ms'; + r['Relative(total)'] = (1 + (r[avgKey] - fastest) / fastest).toFixed(2).padStart(6, ' '); + r['Avg(*)'] = (r['z_' + avgKey] / 1_000_000).toFixed(2).padStart(6, ' ') + 'ms'; + r['Relative(*)'] = (1 + (r['z_' + avgKey] - z_fastest) / z_fastest).toFixed(2).padStart(6, ' '); + r['Margin'] = r['Margin'].padStart(7, ' '); + delete r[avgKey]; + delete r['z_' + avgKey]; + delete r['ops/sec']; + delete r['Samples']; + }); + console.log(name); + console.table(results); + + const baselineTable = [baselineResult]; + baselineTable.forEach((r) => { + r['Avg total'] = (r[avgKey] / 1_000_000).toFixed(2).padStart(6, ' ') + 'ms'; + r['Margin'] = r['Margin'].padStart(7, ' '); + delete r[avgKey]; + delete r['z_' + avgKey]; + delete r['ops/sec']; + delete r['Samples']; + }); + console.table(baselineTable); + return { results, baselineTable }; +} + +const noLoad = await executeBenchParse('no load', { + parseConfig: true, + readFiles: false, + transformFiles: false +}); +const ioLoad = await executeBenchParse('io load', { + parseConfig: true, + readFiles: true, + transformFiles: false +}); +const ioCpuLoad = await executeBenchParse('io and cpu load', { + parseConfig: true, + readFiles: true, + transformFiles: true +}); + +const adjustMessage = `(*) total values include time spent reading and transforming files. For a more realistic comparison of these config parse performance, these values have been calculated by subtracting the average duration of the baseline run that does not parse config files.`; +console.log(adjustMessage); + +function renderMDTable(data) { + const keys = Object.keys(data[0]); + const tr = (row) => `| ${row.join(' | ')} |\n`; + const header = tr(keys); + const sep = tr(keys.map((k) => '-'.repeat(k.length))) + .split(' | ') + .join(':| ') + .replace(':| ', ' | ') + .replace(' |\n', ':|\n'); + return header + sep + data.map((d) => tr(Object.values(d))).join(''); +} + +if (updateDocs) { + const docFile = fileURLToPath(new URL('../docs/benchmark.md', import.meta.url)); + let docContent = fs.readFileSync(docFile, 'utf-8'); + let mdContent = ''; + for (const [name, data] of Object.entries({ + 'no load': noLoad, + 'io load': ioLoad, + 'io and cpu load': ioCpuLoad + })) { + mdContent += `\n### ${name}\n\n`; + mdContent += renderMDTable(data.results); + mdContent += '\n'; + mdContent += renderMDTable(data.baselineTable); + } + + mdContent += '\n> ' + adjustMessage + '\n\n'; + docContent = docContent.replace( + /[\s\S]*/gm, + `\n${mdContent}\n` + ); + fs.writeFileSync(docFile, docContent); +} diff --git a/scripts/generate-api-docs.js b/scripts/generate-api-docs.js index c63e1ec..1e293c0 100644 --- a/scripts/generate-api-docs.js +++ b/scripts/generate-api-docs.js @@ -5,12 +5,74 @@ import fs from 'fs'; const header = '\n## API \n\n'; -function toMD(block) { - const title = block.match(/declare function ([^(]+)/)[1]; - return '### ' + title + '\n\n```ts\n' + block + '\n```'; +function parseBlock(block) { + // eslint-disable-next-line no-unused-vars + const [_, kind, title] = block.match(/(function|class|interface|type) ([a-zA-Z]+)/); + const heading = '#'.repeat(blockHeadings[title] || 3); + return { + kind, + title, + md: heading + ' ' + title + '\n\n```ts\n' + stripPrivate(block) + '\n```' + }; } -const dts = fs.readFileSync('dist/index.d.ts', 'utf-8'); -const blocks = dts.split('\n\n').slice(0, -1); -const md = header + blocks.map((block) => toMD(block)).join('\n\n') + '\n'; + +function stripPrivate(str) { + return str.replace(/^\s*#?private[; ].*\n?/gm, ''); +} + +const typesFile = 'packages/tsconfck/types/index.d.ts'; +const blockSeparator = '\n-- cut here --\n'; +let dts = fs + .readFileSync(typesFile, 'utf-8') + .replace("declare module 'tsconfck' {\n", '') + .replace('}\n\n//# sourceMappingURL=index.d.ts.map', '') + .replace(/^\s+export function [a-zA-Z]+\(.*$/gm, `$&${blockSeparator}`) + .replace(/^\s*}\s*$/gm, `$&${blockSeparator}`) + .replace(/^\t/gm, ''); + +const blocks = dts + .split(blockSeparator) + .map((b) => b.trim()) + .filter(Boolean); + +const blockHeadings = { + find: 3, + TSConfckFindOptions: 4, + parse: 3, + TSConfckParseOptions: 4, + TSConfckParseResult: 4, + TSConfckParseError: 4, + findNative: 3, + parseNative: 3, + TSConfckParseNativeOptions: 4, + TSConfckParseNativeResult: 4, + TSConfckParseNativeError: 4, + findAll: 3, + TSConfckFindAllOptions: 4, + toJson: 3, + TSConfckCache: 3 +}; +const order = Object.keys(blockHeadings); + +function sortBlocks(a, b) { + const aIndex = order.indexOf(a.title); + const bIndex = order.indexOf(b.title); + if (aIndex < 0) { + console.log('misssing title order: ', a.title); + } + if (bIndex < 0) { + console.log('misssing title order: ', b.title); + } + return aIndex - bIndex; +} + +const md = + header + + blocks + .map((block) => parseBlock(block)) + .sort(sortBlocks) + .map((b) => b.md) + .join('\n\n') + + '\n'; fs.writeFileSync('docs/api.md', md); -console.log('generated docs/api.md from dist/index.d.ts'); +console.log(`generated docs/api.md from ${typesFile}`); diff --git a/scripts/release.js b/scripts/release.js deleted file mode 100644 index e954204..0000000 --- a/scripts/release.js +++ /dev/null @@ -1,187 +0,0 @@ -// @ts-check -/** - * pretty verbatim copy of vites release script. https://github.com/vitejs/vite/blob/main/scripts/release.js - */ -import { execa } from 'execa'; -import path from 'path'; -import fs from 'fs'; -import minimist from 'minimist'; -import semver from 'semver'; -import chalk from 'chalk'; -import enquirer from 'enquirer'; -const { prompt } = enquirer; -const args = minimist(process.argv.slice(2)); - -const pkgDir = process.cwd(); -const pkgPath = path.resolve(pkgDir, 'package.json'); -/** - * @type {{ name: string, version: string }} - */ -const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8')); -const pkgName = pkg.name; -const currentVersion = pkg.version; -/** - * @type {boolean} - */ -const isDryRun = args.dry; -/** - * @type {boolean} - */ -const skipBuild = args.skipBuild; - -/** - * @type {import('semver').ReleaseType[]} - */ -const versionIncrements = args.next - ? ['prepatch', 'preminor', 'premajor', 'prerelease'] - : ['patch', 'minor', 'major']; - -/** - * @param {import('semver').ReleaseType} i - */ -const inc = (i) => semver.inc(currentVersion, i, i.startsWith('pre') ? 'next' : undefined); - -/** - * @param {string} bin - * @param {string[]} args - * @param {object} opts - */ -const run = (bin, args, opts = {}) => execa(bin, args, { stdio: 'inherit', ...opts }); - -/** - * @param {string} bin - * @param {string[]} args - * @param {object} opts - */ -const dryRun = (bin, args, opts = {}) => - console.log(chalk.blue(`[dryrun] ${bin} ${args.join(' ')}`), opts); - -const runIfNotDry = isDryRun ? dryRun : run; - -/** - * @param {string} msg - */ -const step = (msg) => console.log(chalk.cyan(msg)); - -async function main() { - let targetVersion = args._[0]; - - if (!targetVersion) { - // no explicit version, offer suggestions - /** - * @type {{ release: string }} - */ - const { release } = await prompt({ - type: 'select', - name: 'release', - message: 'Select release type', - choices: versionIncrements.map((i) => `${i} (${inc(i)})`).concat(['custom']) - }); - - if (release === 'custom') { - /** - * @type {{ version: string }} - */ - const res = await prompt({ - type: 'input', - name: 'version', - message: 'Input custom version', - initial: currentVersion - }); - targetVersion = res.version; - } else { - targetVersion = release.match(/\((.*)\)/)[1]; - } - } - - if (!semver.valid(targetVersion)) { - throw new Error(`invalid target version: ${targetVersion}`); - } - - const tag = `${pkgName}@${targetVersion}`; - - /** - * @type {{ yes: boolean }} - */ - const { yes } = await prompt({ - type: 'confirm', - name: 'yes', - message: `Releasing ${tag}. Confirm?` - }); - - if (!yes) { - return; - } - - step('\nUpdating package version...'); - updateVersion(targetVersion); - - step('\nBuilding package...'); - if (!skipBuild && !isDryRun) { - await run('pnpm', ['build']); - } else { - console.log(`(skipped)`); - } - - step('\nGenerating changelog...'); - await run('pnpm', ['run', 'changelog']); - - const { stdout } = await run('git', ['diff'], { stdio: 'pipe' }); - if (stdout) { - step('\nCommitting changes...'); - await runIfNotDry('git', ['add', '-A']); - await runIfNotDry('git', ['commit', '-m', `release: ${tag}`]); - } else { - console.log('No changes to commit.'); - } - - step('\nPublishing package...'); - await publishPackage(targetVersion, runIfNotDry); - - step('\nPushing to GitHub...'); - await runIfNotDry('git', ['tag', tag]); - await runIfNotDry('git', ['push', 'origin', `refs/tags/${tag}`]); - await runIfNotDry('git', ['push']); - - if (isDryRun) { - console.log(`\nDry run finished - run git diff to see package changes.`); - } - - console.log(); -} - -/** - * @param {string} version - */ -function updateVersion(version) { - const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8')); - pkg.version = version; - fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n'); -} - -/** - * @param {string} version - * @param {Function} runIfNotDry - */ -async function publishPackage(version, runIfNotDry) { - const publishArgs = ['publish', '--publish-branch', 'main', '--access', 'public']; - if (args.next) { - publishArgs.push('--tag', 'next'); - } - try { - await runIfNotDry('pnpm', publishArgs, { - stdio: 'inherit' - }); - console.log(chalk.green(`Successfully published ${pkgName}@${version}`)); - } catch (e) { - if (e.stderr.match(/previously published/)) { - console.log(chalk.red(`Skipping already published: ${pkgName}`)); - } else { - throw e; - } - } -} - -main().catch((err) => { - console.error(err); -}); diff --git a/src/find-all.ts b/src/find-all.ts deleted file mode 100644 index 11f0e00..0000000 --- a/src/find-all.ts +++ /dev/null @@ -1,75 +0,0 @@ -import path from 'path'; -import { Dirent, readdir } from 'fs'; - -interface WalkState { - files: string[]; - calls: number; - // eslint-disable-next-line no-unused-vars - skip?: (dir: string) => boolean; - err: boolean; -} - -const sep = path.sep; - -/** - * find all tsconfig.json files in dir - * - * @param {string} dir - path to dir (absolute or relative to cwd) - * @param {TSConfckFindAllOptions} options - options - * @returns {Promise} list of absolute paths to all found tsconfig.json files - */ -export async function findAll(dir: string, options?: TSConfckFindAllOptions): Promise { - const state: WalkState = { - files: [], - calls: 0, - skip: options?.skip, - err: false - }; - return new Promise((resolve, reject) => { - walk(path.resolve(dir), state, (err, files) => (err ? reject(err) : resolve(files!))); - }); -} - -function walk( - dir: string, - state: WalkState, - // eslint-disable-next-line no-unused-vars - done: (err: NodeJS.ErrnoException | null, files?: string[]) => void -) { - if (state.err) { - return; - } - state.calls++; - readdir(dir, { withFileTypes: true }, (err, entries: Dirent[] = []) => { - if (state.err) { - return; - } - // skip deleted or inaccessible directories - if (err && !(err.code === 'ENOENT' || err.code === 'EACCES' || err.code === 'EPERM')) { - state.err = true; - done(err); - } else { - for (const ent of entries) { - if (ent.isDirectory() && !state.skip?.(ent.name)) { - walk(`${dir}${sep}${ent.name}`, state, done); - } else if (ent.isFile() && ent.name === 'tsconfig.json') { - state.files.push(`${dir}${sep}tsconfig.json`); - } - } - if (--state.calls === 0) { - if (!state.err) { - done(null, state.files); - } - } - } - }); -} - -export interface TSConfckFindAllOptions { - /** - * helper to skip subdirectories when scanning for tsconfig.json - * - * eg ` dir => dir === 'node_modules' || dir === '.git'` - */ // eslint-disable-next-line no-unused-vars - skip?: (dir: string) => boolean; -} diff --git a/src/find-native.ts b/src/find-native.ts deleted file mode 100644 index 0f3a808..0000000 --- a/src/find-native.ts +++ /dev/null @@ -1,20 +0,0 @@ -import path from 'path'; -import { loadTS } from './util.js'; - -/** - * find the closest tsconfig.json file using native ts.findConfigFile - * - * You must have `typescript` installed to use this - * - * @param {string} filename - path to file to find tsconfig for (absolute or relative to cwd) - * @returns {Promise} absolute path to closest tsconfig.json - */ -export async function findNative(filename: string): Promise { - const ts = await loadTS(); - const { findConfigFile, sys } = ts; - const tsconfigFile = findConfigFile(path.dirname(path.resolve(filename)), sys.fileExists); - if (!tsconfigFile) { - throw new Error(`no tsconfig file found for ${filename}`); - } - return tsconfigFile; -} diff --git a/src/find.ts b/src/find.ts deleted file mode 100644 index d42a9b7..0000000 --- a/src/find.ts +++ /dev/null @@ -1,66 +0,0 @@ -import path from 'path'; -import { promises as fs } from 'fs'; - -/** - * find the closest tsconfig.json file - * - * @param {string} filename - path to file to find tsconfig for (absolute or relative to cwd) - * @param {TSConfckFindOptions} options - options - * @returns {Promise} absolute path to closest tsconfig.json - */ -export async function find(filename: string, options?: TSConfckFindOptions) { - let dir = path.dirname(path.resolve(filename)); - const root = options?.root ? path.resolve(options.root) : null; - while (dir) { - const tsconfig = await tsconfigInDir(dir, options); - if (tsconfig) { - return tsconfig; - } else { - if (root === dir) { - break; - } - const parent = path.dirname(dir); - if (parent === dir) { - break; - } else { - dir = parent; - } - } - } - throw new Error(`no tsconfig file found for ${filename}`); -} - -async function tsconfigInDir(dir: string, options?: TSConfckFindOptions): Promise { - const tsconfig = path.join(dir, 'tsconfig.json'); - if (options?.tsConfigPaths) { - return options.tsConfigPaths.has(tsconfig) ? tsconfig : undefined; - } - try { - const stat = await fs.stat(tsconfig); - if (stat.isFile() || stat.isFIFO()) { - return tsconfig; - } - } catch (e) { - // ignore does not exist error - if (e.code !== 'ENOENT') { - throw e; - } - } -} - -export interface TSConfckFindOptions { - /** - * Set of known tsconfig file locations to use instead of scanning the file system - * - * This is better for performance in projects like vite where find is called frequently but tsconfig locations rarely change - * You can use `findAll` to build this - */ - tsConfigPaths?: Set; - - /** - * project root dir, does not continue scanning outside of this directory. - * - * Improves performance but may lead to different results from native typescript when no tsconfig is found inside root - */ - root?: string; -} diff --git a/src/index.ts b/src/index.ts deleted file mode 100644 index 4f0e8a3..0000000 --- a/src/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -export { find } from './find.js'; -export { findAll } from './find-all.js'; -export { toJson } from './to-json.js'; -export { parse, TSConfckParseOptions, TSConfckParseResult, TSConfckParseError } from './parse.js'; -export { findNative } from './find-native.js'; -export { - parseNative, - TSConfckParseNativeOptions, - TSConfckParseNativeResult, - TSConfckParseNativeError -} from './parse-native.js'; diff --git a/tests/find-all.ts b/tests/find-all.ts deleted file mode 100644 index fc40e8f..0000000 --- a/tests/find-all.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { suite } from 'uvu'; -import * as assert from 'uvu/assert'; -import path from 'path'; -import { findAll } from '../src/find-all.js'; -import * as fs from 'fs'; -import glob from 'tiny-glob'; -const test = suite('findAll'); - -test('should be a function', () => { - assert.type(findAll, 'function'); -}); - -test('should return a Promise', () => { - assert.instance(findAll('scripts'), Promise); -}); - -test('should reject for invalid dir arg', async () => { - // TODO rewrite to assert.rejects once https://github.com/lukeed/uvu/pull/132 landed - for (const dir of [{}, [], 0, null, undefined]) { - // @ts-ignore - const result = await findAll(dir).then( - () => 'resolved', - () => 'rejected' - ); - assert.is(result, 'rejected', `dir type: ${typeof dir}`); - } - // @ts-ignore - const notSetResult = await findAll().then( - () => 'resolved', - () => 'rejected' - ); - assert.is(notSetResult, 'rejected', `dir not set`); - - const strResult = await findAll('scripts').then( - () => 'resolved', - () => 'rejected' - ); - assert.is(strResult, 'resolved', `dir type: string`); -}); - -test('should find tsconfig in same directory', async () => { - const expected = path.resolve('tests', 'fixtures', 'find', 'a', 'tsconfig.json'); - const found = await findAll(path.join('tests', 'fixtures', 'find', 'a')); - assert.is(found.length, 1, 'found 1 tsconfig'); - assert.is(found[0], expected, 'found expected'); -}); - -test('should find tsconfig in child directory', async () => { - const expected = path.resolve('tests', 'fixtures', 'find', 'a', 'tsconfig.json'); - const found = await findAll(path.join('tests', 'fixtures', 'find')); - assert.is(found.length, 1, 'found 1 tsconfig'); - assert.is(found[0], expected, 'found expected'); -}); - -test('should find multiple tsconfig in child directories', async () => { - const expected = (await glob('tests/fixtures/find-all/multiple/**/tsconfig.json')).map((file) => - path.resolve(file) - ); - expected.sort(); - - const found = await findAll(path.join('tests', 'fixtures', 'find-all', 'multiple')); - found.sort(); - assert.equal(found, expected, 'found all tsconfig in test/fixtures/find-all/multiple'); -}); - -test('should handle directories with recursive symlinks', async () => { - const expected = [ - path.resolve('tests', 'fixtures', 'find-all', 'recursive-symlink', 'tsconfig.json'), - path.resolve('tests', 'fixtures', 'find-all', 'recursive-symlink', 'child', 'tsconfig.json') - ]; - expected.sort(); - const found = await findAll(path.join('tests', 'fixtures', 'find-all', 'recursive-symlink')); - found.sort(); - assert.equal(found, expected, 'found all tsconfig in test/fixtures/find-all/recursive-symlink'); -}); - -test('should exclude skipped directories', async () => { - const expected = [ - path.resolve('tests', 'fixtures', 'find-all', 'recursive-symlink', 'tsconfig.json') - ]; - expected.sort(); - const found = await findAll(path.join('tests', 'fixtures', 'find-all', 'recursive-symlink'), { - skip: (dir) => dir === 'child' - }); - found.sort(); - assert.equal( - found, - expected, - 'found filtered tsconfig in test/fixtures/find-all/recursive-symlink' - ); -}); -test.run(); - -const test_inaccessible = suite('findAll inaccessible'); -const inaccessible = path.resolve( - 'tests', - 'fixtures', - 'find-all', - 'inaccessible-dir', - '_inaccessible' -); -test_inaccessible.before(() => { - fs.mkdirSync(inaccessible); - fs.chmodSync(inaccessible, 0o000); -}); - -test_inaccessible.after(() => { - fs.chmodSync(inaccessible, 0o777); - fs.rmdirSync(inaccessible); -}); -test_inaccessible('should handle directories with inaccessible children', async () => { - assert.equal(true, fs.existsSync(inaccessible)); - const expected = [ - path.resolve('tests', 'fixtures', 'find-all', 'inaccessible-dir', 'tsconfig.json') - ]; - expected.sort(); - const found = await findAll(path.join('tests', 'fixtures', 'find-all', 'inaccessible-dir')); - found.sort(); - assert.equal(found, expected, 'found all tsconfig in test/fixtures/find-all/inaccessible-dir'); -}); - -test_inaccessible.run(); diff --git a/tests/find-native.ts b/tests/find-native.ts deleted file mode 100644 index 558dda3..0000000 --- a/tests/find-native.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { suite } from 'uvu'; -import * as assert from 'uvu/assert'; -import path from 'path'; -import os from 'os'; -import { findNative } from '../src/find-native.js'; -import { native2posix } from '../src/util.js'; -const test = suite('findNative'); - -test('should be a function', () => { - assert.type(findNative, 'function'); -}); - -test('should return a Promise', () => { - assert.instance(findNative('str'), Promise); -}); - -test('should reject for invalid filename arg', async () => { - // TODO rewrite to assert.rejects once https://github.com/lukeed/uvu/pull/132 landed - for (const filename of [{}, [], 0, null, undefined]) { - // @ts-ignore - const result = await findNative(filename).then( - () => 'resolved', - () => 'rejected' - ); - assert.is(result, 'rejected', `filename type: ${typeof filename}`); - } - // @ts-ignore - const notSetResult = await findNative().then( - () => 'resolved', - () => 'rejected' - ); - assert.is(notSetResult, 'rejected', `filename not set`); - - const strResult = await findNative('str').then( - () => 'resolved', - () => 'rejected' - ); - assert.is(strResult, 'resolved', `filename type: string`); -}); - -test('should find tsconfig in same directory', async () => { - const expected = native2posix(path.resolve('tests', 'fixtures', 'find', 'a', 'tsconfig.json')); - const inputs = [ - path.join('tests', 'fixtures', 'find', 'a', 'foo.ts'), - path.join('.', 'tests', 'fixtures', 'find', 'a', 'foo.ts'), - path.resolve('tests', 'fixtures', 'find', 'a', 'foo.ts') - ]; - for (const input of inputs) { - const tsconfig = await findNative(input); - assert.is(tsconfig, expected, `input: ${input}`); - } -}); - -test('should find tsconfig in parent directory', async () => { - const expected = native2posix(path.resolve('tests', 'fixtures', 'find', 'a', 'tsconfig.json')); - const inputs = [ - path.join('tests', 'fixtures', 'find', 'a', 'b', 'bar.ts'), - path.join('.', 'tests', 'fixtures', 'find', 'a', 'b', 'bar.ts'), - path.resolve('tests', 'fixtures', 'find', 'a', 'b', 'bar.ts') - ]; - for (const input of inputs) { - const tsconfig = await findNative(input); - assert.is(tsconfig, expected, `input: ${input}`); - } -}); - -test('should reject when no tsconfig file was found', async () => { - const input = path.resolve(os.homedir(), '..', 'foo.ts'); // outside of user home there should not be a tsconfig - try { - await findNative(input); - assert.unreachable(`unexpectedly found tsconfig for ${input}`); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.equal(e.message, 'no tsconfig file found for ' + input); - } -}); - -test.run(); diff --git a/tests/find.ts b/tests/find.ts deleted file mode 100644 index 9ad2413..0000000 --- a/tests/find.ts +++ /dev/null @@ -1,116 +0,0 @@ -import { suite } from 'uvu'; -import * as assert from 'uvu/assert'; -import path from 'path'; -import os from 'os'; -import { find } from '../src/find.js'; -const test = suite('find'); - -test('should be a function', () => { - assert.type(find, 'function'); -}); - -test('should return a Promise', () => { - assert.instance(find('str'), Promise); -}); - -test('should reject for invalid filename arg', async () => { - // TODO rewrite to assert.rejects once https://github.com/lukeed/uvu/pull/132 landed - for (const filename of [{}, [], 0, null, undefined]) { - // @ts-ignore - const result = await find(filename).then( - () => 'resolved', - () => 'rejected' - ); - assert.is(result, 'rejected', `filename type: ${typeof filename}`); - } - // @ts-ignore - const notSetResult = await find().then( - () => 'resolved', - () => 'rejected' - ); - assert.is(notSetResult, 'rejected', `filename not set`); - - const strResult = await find('str').then( - () => 'resolved', - () => 'rejected' - ); - assert.is(strResult, 'resolved', `filename type: string`); -}); - -test('should find tsconfig in same directory', async () => { - const expected = path.resolve('tests', 'fixtures', 'find', 'a', 'tsconfig.json'); - const inputs = [ - path.join('tests', 'fixtures', 'find', 'a', 'foo.ts'), - path.join('.', 'tests', 'fixtures', 'find', 'a', 'foo.ts'), - path.resolve('tests', 'fixtures', 'find', 'a', 'foo.ts') - ]; - for (const input of inputs) { - const tsconfig = await find(input); - assert.is(tsconfig, expected, `input: ${input}`); - } -}); - -test('should find tsconfig in parent directory', async () => { - const expected = path.resolve('tests', 'fixtures', 'find', 'a', 'tsconfig.json'); - const inputs = [ - path.join('tests', 'fixtures', 'find', 'a', 'b', 'bar.ts'), - path.join('.', 'tests', 'fixtures', 'find', 'a', 'b', 'bar.ts'), - path.resolve('tests', 'fixtures', 'find', 'a', 'b', 'bar.ts') - ]; - for (const input of inputs) { - const tsconfig = await find(input); - assert.is(tsconfig, expected, `input: ${input}`); - } -}); - -test('should stop searching at root', async () => { - const inputs = [ - path.join('tests', 'fixtures', 'find-root', 'a', 'b', 'bar.ts'), - path.join('.', 'tests', 'fixtures', 'find-root', 'a', 'b', 'bar.ts'), - path.resolve('tests', 'fixtures', 'find-root', 'a', 'b', 'bar.ts') - ]; - for (const input of inputs) { - try { - await find(input, { root: path.resolve('tests', 'fixtures', 'find-root', 'a') }); - assert.unreachable(`unexpectedly found tsconfig for ${input}`); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.equal(e.message, 'no tsconfig file found for ' + input); - } - } -}); - -test('should use provided tsConfigPaths', async () => { - const real = path.resolve('tests', 'fixtures', 'find-root', 'tsconfig.json'); - const fake = path.resolve('tests', 'fixtures', 'find-root', 'a', 'tsconfig.json'); - const inputs = [ - path.join('tests', 'fixtures', 'find-root', 'a', 'b', 'foo.ts'), - path.join('.', 'tests', 'fixtures', 'find-root', 'a', 'b', 'foo.ts'), - path.resolve('tests', 'fixtures', 'find-root', 'a', 'b', 'foo.ts') - ]; - const tsConfigPaths = new Set([fake]); - - for (const input of inputs) { - const tsconfig = await find(input); - assert.is(tsconfig, real, `input: ${input}`); - const tsconfigWithPaths = await find(input, { tsConfigPaths }); - assert.is(tsconfigWithPaths, fake, `input: ${input}`); - } -}); - -test('should reject when no tsconfig file was found', async () => { - const input = path.resolve(os.homedir(), '..', 'foo.ts'); // outside of user home there should not be a tsconfig - try { - await find(input); - assert.unreachable(`unexpectedly found tsconfig for ${input}`); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.equal(e.message, 'no tsconfig file found for ' + input); - } -}); - -test.run(); diff --git a/tests/fixtures/find/a/tsconfig.json b/tests/fixtures/find/a/tsconfig.json deleted file mode 100644 index 0db3279..0000000 --- a/tests/fixtures/find/a/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - -} diff --git a/tests/fixtures/parse/invalid/bom/expected.native.json b/tests/fixtures/parse/invalid/bom/expected.native.json deleted file mode 100644 index d314fff..0000000 --- a/tests/fixtures/parse/invalid/bom/expected.native.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "start": 15, - "message": "',' expected.", - "code": "TS 1005" -} diff --git a/tests/fixtures/parse/invalid/bom/expected.node20.txt b/tests/fixtures/parse/invalid/bom/expected.node20.txt deleted file mode 100644 index 2150806..0000000 --- a/tests/fixtures/parse/invalid/bom/expected.node20.txt +++ /dev/null @@ -1 +0,0 @@ -parsing /tsconfig.json failed: SyntaxError: Unexpected token 'x', "{ diff --git a/tests/fixtures/parse/invalid/bom/expected.txt b/tests/fixtures/parse/invalid/bom/expected.txt deleted file mode 100644 index e2d9c03..0000000 --- a/tests/fixtures/parse/invalid/bom/expected.txt +++ /dev/null @@ -1 +0,0 @@ -Unexpected token x in JSON at position 14 \ No newline at end of file diff --git a/tests/fixtures/parse/invalid/comma/expected.native.json b/tests/fixtures/parse/invalid/comma/expected.native.json deleted file mode 100644 index 04a53b2..0000000 --- a/tests/fixtures/parse/invalid/comma/expected.native.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "start": 69, - "message": "Property assignment expected.", - "code": "TS 1136" -} diff --git a/tests/fixtures/parse/invalid/comma/expected.node20.txt b/tests/fixtures/parse/invalid/comma/expected.node20.txt deleted file mode 100644 index 6e335e7..0000000 --- a/tests/fixtures/parse/invalid/comma/expected.node20.txt +++ /dev/null @@ -1 +0,0 @@ -parsing /tsconfig.json failed: SyntaxError: Expected double-quoted property name in JSON at position 69 diff --git a/tests/fixtures/parse/invalid/comma/expected.txt b/tests/fixtures/parse/invalid/comma/expected.txt deleted file mode 100644 index a98ecaf..0000000 --- a/tests/fixtures/parse/invalid/comma/expected.txt +++ /dev/null @@ -1 +0,0 @@ -Unexpected token x in JSON at position 69 \ No newline at end of file diff --git a/tests/fixtures/parse/invalid/comments/expected.native.json b/tests/fixtures/parse/invalid/comments/expected.native.json deleted file mode 100644 index 38e5ddc..0000000 --- a/tests/fixtures/parse/invalid/comments/expected.native.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "start": 236, - "message": "',' expected.", - "code": "TS 1005" -} diff --git a/tests/fixtures/parse/invalid/comments/expected.node20.txt b/tests/fixtures/parse/invalid/comments/expected.node20.txt deleted file mode 100644 index 12bc1b7..0000000 --- a/tests/fixtures/parse/invalid/comments/expected.node20.txt +++ /dev/null @@ -1 +0,0 @@ -parsing /tsconfig.json failed: SyntaxError: Expected ',' or '}' after property value in JSON at position 236 diff --git a/tests/fixtures/parse/invalid/comments/expected.txt b/tests/fixtures/parse/invalid/comments/expected.txt deleted file mode 100644 index 063db3c..0000000 --- a/tests/fixtures/parse/invalid/comments/expected.txt +++ /dev/null @@ -1 +0,0 @@ -Unexpected token x in JSON at position 236 \ No newline at end of file diff --git a/tests/fixtures/parse/invalid/extends-array-circular/expected.native.json b/tests/fixtures/parse/invalid/extends-array-circular/expected.native.json deleted file mode 100644 index e107f73..0000000 --- a/tests/fixtures/parse/invalid/extends-array-circular/expected.native.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "message": "Circularity detected while resolving configuration: ", - "code": "TS 18000" -} diff --git a/tests/fixtures/parse/invalid/extends-array-circular/expected.txt b/tests/fixtures/parse/invalid/extends-array-circular/expected.txt deleted file mode 100644 index dd7524a..0000000 --- a/tests/fixtures/parse/invalid/extends-array-circular/expected.txt +++ /dev/null @@ -1 +0,0 @@ -Circular dependency in "extends": \ No newline at end of file diff --git a/tests/fixtures/parse/invalid/extends-circular/expected.native.json b/tests/fixtures/parse/invalid/extends-circular/expected.native.json deleted file mode 100644 index e107f73..0000000 --- a/tests/fixtures/parse/invalid/extends-circular/expected.native.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "message": "Circularity detected while resolving configuration: ", - "code": "TS 18000" -} diff --git a/tests/fixtures/parse/invalid/extends-circular/expected.txt b/tests/fixtures/parse/invalid/extends-circular/expected.txt deleted file mode 100644 index dd7524a..0000000 --- a/tests/fixtures/parse/invalid/extends-circular/expected.txt +++ /dev/null @@ -1 +0,0 @@ -Circular dependency in "extends": \ No newline at end of file diff --git a/tests/fixtures/parse/invalid/extends-fallback-not-found/expected.native.json b/tests/fixtures/parse/invalid/extends-fallback-not-found/expected.native.json deleted file mode 100644 index 9e85c9b..0000000 --- a/tests/fixtures/parse/invalid/extends-fallback-not-found/expected.native.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "message": "File './dir' not found.", - "code": "TS 6053" -} diff --git a/tests/fixtures/parse/invalid/extends-fallback-not-found/expected.txt b/tests/fixtures/parse/invalid/extends-fallback-not-found/expected.txt deleted file mode 100644 index f14a0b6..0000000 --- a/tests/fixtures/parse/invalid/extends-fallback-not-found/expected.txt +++ /dev/null @@ -1 +0,0 @@ -failed to resolve "extends":"./dir" in \ No newline at end of file diff --git a/tests/fixtures/parse/invalid/extends-not-found/expected.native.json b/tests/fixtures/parse/invalid/extends-not-found/expected.native.json deleted file mode 100644 index fedb276..0000000 --- a/tests/fixtures/parse/invalid/extends-not-found/expected.native.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "message": "Cannot read file ", - "code": "TS 5083" -} diff --git a/tests/fixtures/parse/invalid/extends-not-found/expected.txt b/tests/fixtures/parse/invalid/extends-not-found/expected.txt deleted file mode 100644 index 79d6146..0000000 --- a/tests/fixtures/parse/invalid/extends-not-found/expected.txt +++ /dev/null @@ -1 +0,0 @@ -failed to resolve "extends":"../tsconfig.doesnotexist.json" in \ No newline at end of file diff --git a/tests/fixtures/parse/invalid/mixed/expected.native.json b/tests/fixtures/parse/invalid/mixed/expected.native.json deleted file mode 100644 index 693cf40..0000000 --- a/tests/fixtures/parse/invalid/mixed/expected.native.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "start": 297, - "message": "',' expected.", - "code": "TS 1005" -} diff --git a/tests/fixtures/parse/invalid/mixed/expected.node20.txt b/tests/fixtures/parse/invalid/mixed/expected.node20.txt deleted file mode 100644 index 59769d2..0000000 --- a/tests/fixtures/parse/invalid/mixed/expected.node20.txt +++ /dev/null @@ -1 +0,0 @@ -parsing /tsconfig.json failed: SyntaxError: Expected ',' or '}' after property value in JSON at position 297 diff --git a/tests/fixtures/parse/invalid/mixed/expected.txt b/tests/fixtures/parse/invalid/mixed/expected.txt deleted file mode 100644 index 185f2da..0000000 --- a/tests/fixtures/parse/invalid/mixed/expected.txt +++ /dev/null @@ -1 +0,0 @@ -Unexpected token x in JSON at position 297 \ No newline at end of file diff --git a/tests/fixtures/parse/solution/mixed/src/bar.mts.expected.json b/tests/fixtures/parse/solution/mixed/src/bar.mts.expected.json deleted file mode 100644 index 4b2b79b..0000000 --- a/tests/fixtures/parse/solution/mixed/src/bar.mts.expected.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "./tsconfig.base", - "include": ["src/**/*"], - "exclude": ["src/**/*.spec.ts"], - "compilerOptions": { - "composite": true, - "strict": true, - "strictNullChecks": true - } -} diff --git a/tests/fixtures/parse/solution/mixed/src/baz.cts.expected.json b/tests/fixtures/parse/solution/mixed/src/baz.cts.expected.json deleted file mode 100644 index 4b2b79b..0000000 --- a/tests/fixtures/parse/solution/mixed/src/baz.cts.expected.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "./tsconfig.base", - "include": ["src/**/*"], - "exclude": ["src/**/*.spec.ts"], - "compilerOptions": { - "composite": true, - "strict": true, - "strictNullChecks": true - } -} diff --git a/tests/fixtures/parse/solution/mixed/src/foo.spec.ts.expected.json b/tests/fixtures/parse/solution/mixed/src/foo.spec.ts.expected.json deleted file mode 100644 index c8f46ec..0000000 --- a/tests/fixtures/parse/solution/mixed/src/foo.spec.ts.expected.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./tsconfig.base", - "include": ["src/**/*.spec.ts"], - "compilerOptions": { - "composite": true, - "strict": false, - "strictNullChecks": true - } -} diff --git a/tests/fixtures/parse/solution/mixed/src/foo.ts.expected.json b/tests/fixtures/parse/solution/mixed/src/foo.ts.expected.json deleted file mode 100644 index 4b2b79b..0000000 --- a/tests/fixtures/parse/solution/mixed/src/foo.ts.expected.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "./tsconfig.base", - "include": ["src/**/*"], - "exclude": ["src/**/*.spec.ts"], - "compilerOptions": { - "composite": true, - "strict": true, - "strictNullChecks": true - } -} diff --git a/tests/fixtures/parse/solution/mixed/tsconfig.json.expected.json b/tests/fixtures/parse/solution/mixed/tsconfig.json.expected.json deleted file mode 100644 index b97aa02..0000000 --- a/tests/fixtures/parse/solution/mixed/tsconfig.json.expected.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "files": [], - "include": [], - "references": [ - {"path": "./tsconfig.src.json"}, - {"path": "./tsconfig.test.json"} - ] -} diff --git a/tests/fixtures/parse/solution/mixed/tsconfig.src.json.expected.json b/tests/fixtures/parse/solution/mixed/tsconfig.src.json.expected.json deleted file mode 100644 index fa6d4e9..0000000 --- a/tests/fixtures/parse/solution/mixed/tsconfig.src.json.expected.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "./tsconfig.base", - "include": [ - "src/**/*" - ], - "exclude": [ - "src/**/*.spec.ts" - ], - "compilerOptions": { - "strict": true, - "composite": true, - "strictNullChecks": true - } -} diff --git a/tests/fixtures/parse/solution/mixed/tsconfig.test.json.expected.json b/tests/fixtures/parse/solution/mixed/tsconfig.test.json.expected.json deleted file mode 100644 index d8011a5..0000000 --- a/tests/fixtures/parse/solution/mixed/tsconfig.test.json.expected.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "./tsconfig.base", - "include": [ - "src/**/*.spec.ts" - ], - "compilerOptions": { - "strict": false, - "composite": true, - "strictNullChecks": true - } -} diff --git a/tests/fixtures/parse/solution/simple/src/foo.ts.expected.json b/tests/fixtures/parse/solution/simple/src/foo.ts.expected.json deleted file mode 100644 index c2e0b16..0000000 --- a/tests/fixtures/parse/solution/simple/src/foo.ts.expected.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../tsconfig.base", - "include": ["./foo.ts"], - "compilerOptions": { - "composite": true, - "strict": true, - "strictNullChecks": true - } -} diff --git a/tests/fixtures/parse/solution/simple/src/tsconfig.json.expected.json b/tests/fixtures/parse/solution/simple/src/tsconfig.json.expected.json deleted file mode 100644 index 34ff2c2..0000000 --- a/tests/fixtures/parse/solution/simple/src/tsconfig.json.expected.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "include": [ - "./foo.ts" - ], - "extends": "../tsconfig.base", - "compilerOptions": { - "strict": true, - "composite": true, - "strictNullChecks": true - } -} diff --git a/tests/fixtures/parse/solution/simple/tests/foo.ts.expected.json b/tests/fixtures/parse/solution/simple/tests/foo.ts.expected.json deleted file mode 100644 index 03ee273..0000000 --- a/tests/fixtures/parse/solution/simple/tests/foo.ts.expected.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../tsconfig.base", - "compilerOptions": { - "composite": true, - "strict": false, - "strictNullChecks": true - } -} diff --git a/tests/fixtures/parse/solution/simple/tests/tsconfig.json.expected.json b/tests/fixtures/parse/solution/simple/tests/tsconfig.json.expected.json deleted file mode 100644 index 66cbe7d..0000000 --- a/tests/fixtures/parse/solution/simple/tests/tsconfig.json.expected.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../tsconfig.base", - "compilerOptions": { - "strict": false, - "composite": true, - "strictNullChecks": true - } -} diff --git a/tests/fixtures/parse/solution/simple/tsconfig.base.json.expected.json b/tests/fixtures/parse/solution/simple/tsconfig.base.json.expected.json deleted file mode 100644 index 39e4936..0000000 --- a/tests/fixtures/parse/solution/simple/tsconfig.base.json.expected.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "strictNullChecks": true - } -} diff --git a/tests/fixtures/parse/solution/simple/tsconfig.json.expected.json b/tests/fixtures/parse/solution/simple/tsconfig.json.expected.json deleted file mode 100644 index 9541678..0000000 --- a/tests/fixtures/parse/solution/simple/tsconfig.json.expected.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "files": [], - "include": [], - "references": [ - {"path": "./src"}, - {"path": "./tests"} - ] -} diff --git a/tests/fixtures/parse/valid/bom/expected.native.json b/tests/fixtures/parse/valid/bom/expected.native.json deleted file mode 100644 index 6360d8f..0000000 --- a/tests/fixtures/parse/valid/bom/expected.native.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "strictNullChecks": true - } -} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/comma/expected.native.json b/tests/fixtures/parse/valid/comma/expected.native.json deleted file mode 100644 index bb8e8a2..0000000 --- a/tests/fixtures/parse/valid/comma/expected.native.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "types": [ - "foo" - ] - } -} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/comments/expected.native.json b/tests/fixtures/parse/valid/comments/expected.native.json deleted file mode 100644 index 55e0c23..0000000 --- a/tests/fixtures/parse/valid/comments/expected.native.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "compilerOptions": { - "types": [ - "//keep \"this", - "/*", - "*/", - "/* this too */" - ] - } -} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/mixed/expected.native.json b/tests/fixtures/parse/valid/mixed/expected.native.json deleted file mode 100644 index 0a555a5..0000000 --- a/tests/fixtures/parse/valid/mixed/expected.native.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "compilerOptions": { - "types": [ - "//keep this", - "/*", - "*/", - "/* this too */" - ] - } -} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/moduleResolution/bundler/expected.native.json b/tests/fixtures/parse/valid/moduleResolution/bundler/expected.native.json deleted file mode 100644 index 9e5d662..0000000 --- a/tests/fixtures/parse/valid/moduleResolution/bundler/expected.native.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "files": ["foo.ts"], - "compilerOptions": { - "types": ["foo"], - "importsNotUsedAsValues": "error", - "module": "node16", - "moduleResolution": "bundler", - "newLine": "lf", - "target": "esnext" - }, - "watchOptions": { - "watchFile": "useFsEvents", - "watchDirectory": "useFsEvents", - "fallbackPolling": "dynamicPriority" - } -} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/moduleResolution/classic/expected.native.json b/tests/fixtures/parse/valid/moduleResolution/classic/expected.native.json deleted file mode 100644 index 37aac1c..0000000 --- a/tests/fixtures/parse/valid/moduleResolution/classic/expected.native.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "files": ["foo.ts"], - "compilerOptions": { - "types": ["foo"], - "importsNotUsedAsValues": "error", - "module": "node16", - "moduleResolution": "classic", - "newLine": "lf", - "target": "esnext" - }, - "watchOptions": { - "watchFile": "useFsEvents", - "watchDirectory": "useFsEvents", - "fallbackPolling": "dynamicPriority" - } -} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/moduleResolution/node16/expected.native.json b/tests/fixtures/parse/valid/moduleResolution/node16/expected.native.json deleted file mode 100644 index f1eb35d..0000000 --- a/tests/fixtures/parse/valid/moduleResolution/node16/expected.native.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "files": ["foo.ts"], - "compilerOptions": { - "types": ["foo"], - "importsNotUsedAsValues": "error", - "module": "node16", - "moduleResolution": "node16", - "newLine": "lf", - "target": "esnext" - }, - "watchOptions": { - "watchFile": "useFsEvents", - "watchDirectory": "useFsEvents", - "fallbackPolling": "dynamicPriority" - } -} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/moduleResolution/nodenext/expected.native.json b/tests/fixtures/parse/valid/moduleResolution/nodenext/expected.native.json deleted file mode 100644 index 2f56cdc..0000000 --- a/tests/fixtures/parse/valid/moduleResolution/nodenext/expected.native.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "files": ["foo.ts"], - "compilerOptions": { - "types": ["foo"], - "importsNotUsedAsValues": "error", - "module": "nodenext", - "moduleResolution": "nodenext", - "newLine": "lf", - "target": "esnext" - }, - "watchOptions": { - "watchFile": "useFsEvents", - "watchDirectory": "useFsEvents", - "fallbackPolling": "dynamicPriority" - } -} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/regular/expected.native.json b/tests/fixtures/parse/valid/regular/expected.native.json deleted file mode 100644 index 1e56d7d..0000000 --- a/tests/fixtures/parse/valid/regular/expected.native.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "files": ["foo.ts"], - "compilerOptions": { - "types": ["foo"], - "importsNotUsedAsValues": "error", - "module": "es2020", - "moduleResolution": "node", - "newLine": "lf", - "target": "esnext" - }, - "watchOptions": { - "watchFile": "useFsEvents", - "watchDirectory": "useFsEvents", - "fallbackPolling": "dynamicPriority" - } -} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/ts_node/expected.native.json b/tests/fixtures/parse/valid/ts_node/expected.native.json deleted file mode 100644 index 311b63e..0000000 --- a/tests/fixtures/parse/valid/ts_node/expected.native.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "noLib": false - }, - "ts-node": { - "preferTsExts": true, - "compilerOptions": { - "noLib": true - } - }, - "something": "bla" -} \ No newline at end of file diff --git a/tests/fixtures/parse/valid/with_extends/array/expected.native.json b/tests/fixtures/parse/valid/with_extends/array/expected.native.json deleted file mode 100644 index e85397d..0000000 --- a/tests/fixtures/parse/valid/with_extends/array/expected.native.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": ["./tsconfig.a.json","./tsconfig.b.json","./tsconfig.c.json"], - "compilerOptions": { - "strictNullChecks": true, - "noImplicitAny": true, - "disableSizeLimit": true - }, - "files": ["src/**"] -} diff --git a/tests/fixtures/parse/valid/with_extends/no_compileroptions/expected.native.json b/tests/fixtures/parse/valid/with_extends/no_compileroptions/expected.native.json deleted file mode 100644 index 154b7ea..0000000 --- a/tests/fixtures/parse/valid/with_extends/no_compileroptions/expected.native.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../tsconfig.parent.json", - "compilerOptions": { - "types": ["bar"], - "strictNullChecks": false, - "noImplicitAny": true - }, - "include": ["src/**/*", "foo.ts"], - "exclude": ["../**/foo/*"], - "watchOptions": { - "watchFile": "useFsEvents", - "watchDirectory": "useFsEvents", - "fallbackPolling": "dynamicPriority" - } -} diff --git a/tests/fixtures/parse/valid/with_extends/node/expected.native.json b/tests/fixtures/parse/valid/with_extends/node/expected.native.json deleted file mode 100644 index 7ac9924..0000000 --- a/tests/fixtures/parse/valid/with_extends/node/expected.native.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "extends": "@tsconfig/node14/tsconfig.json", - "compilerOptions": { - "lib": ["es2020"], - "module": "node16", - "target": "es2020", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "types": ["foo"], - "strictNullChecks": true, - "moduleResolution": "node16" - }, - "include": ["src/**/*"] -} diff --git a/tests/fixtures/parse/valid/with_extends/node_fallback/expected.native.json b/tests/fixtures/parse/valid/with_extends/node_fallback/expected.native.json deleted file mode 100644 index c9d8190..0000000 --- a/tests/fixtures/parse/valid/with_extends/node_fallback/expected.native.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "extends": "@tsconfig/node14", - "compilerOptions": { - "lib": ["es2020"], - "module": "node16", - "target": "es2020", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "types": ["foo"], - "strictNullChecks": true, - "moduleResolution": "node16" - }, - "include": ["src/**/*"] -} diff --git a/tests/fixtures/parse/valid/with_extends/paths/src/expected.native.json b/tests/fixtures/parse/valid/with_extends/paths/src/expected.native.json deleted file mode 100644 index 4a453ec..0000000 --- a/tests/fixtures/parse/valid/with_extends/paths/src/expected.native.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "extends": "../tsconfig.base", - "compilerOptions": { - "strictNullChecks": true, - "types": [ - "foo" - ], - "noImplicitAny": true, - "baseUrl": "..", - "paths": { - "$lib": ["*","./lib"], - "$src": ["./src"] - } - }, - "include": [ - "../src/**/*", - "../lib/**/*" - ], - "exclude": [ - "../../**/foo/*" - ], - - "watchOptions": { - "watchFile": "useFsEvents", - "watchDirectory": "useFsEvents", - "fallbackPolling": "dynamicPriority" - } -} diff --git a/tests/fixtures/parse/valid/with_extends/simple/expected.native.json b/tests/fixtures/parse/valid/with_extends/simple/expected.native.json deleted file mode 100644 index 0ece897..0000000 --- a/tests/fixtures/parse/valid/with_extends/simple/expected.native.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../tsconfig.parent.json", - "compilerOptions": { - "strictNullChecks": true, - "types": ["foo"], - "noImplicitAny": true - }, - "include": ["src/**/*", "foo.ts"], - "exclude": ["../**/foo/*"], - "watchOptions": { - "watchFile": "useFsEvents", - "watchDirectory": "useFsEvents", - "fallbackPolling": "dynamicPriority" - } -} diff --git a/tests/fixtures/parse/valid/with_extends/without_json_extension/expected.native.json b/tests/fixtures/parse/valid/with_extends/without_json_extension/expected.native.json deleted file mode 100644 index c124342..0000000 --- a/tests/fixtures/parse/valid/with_extends/without_json_extension/expected.native.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../tsconfig.parent", - "compilerOptions": { - "strictNullChecks": true, - "types": ["foo"], - "noImplicitAny": true - }, - "include": ["src/**/*", "foo.ts"], - "exclude": ["../**/foo/*"], - "watchOptions": { - "watchFile": "useFsEvents", - "watchDirectory": "useFsEvents", - "fallbackPolling": "dynamicPriority" - } -} diff --git a/tests/parse-native.ts b/tests/parse-native.ts deleted file mode 100644 index cb72b98..0000000 --- a/tests/parse-native.ts +++ /dev/null @@ -1,300 +0,0 @@ -import { suite } from 'uvu'; -import * as assert from 'uvu/assert'; -import glob from 'tiny-glob'; -import { promises as fs } from 'fs'; -import path from 'path'; -import { - parseNative, - TSConfckParseNativeError, - TSConfckParseNativeResult -} from '../src/parse-native.js'; -import os from 'os'; -import { copyFixtures } from './util/copy-fixtures'; -import { transform as esbuildTransform } from 'esbuild'; -import ts from 'typescript'; -import { loadExpectedJSON, loadExpectedTXT } from './util/load-expected'; -const test = suite('parse-native'); - -test('should be a function', () => { - assert.type(parseNative, 'function'); -}); - -test('should return a Promise', () => { - assert.instance(parseNative('str'), Promise); -}); - -test('should reject for invalid filename arg', async () => { - // TODO rewrite to assert.rejects once https://github.com/lukeed/uvu/pull/132 landed - for (const filename of [{}, [], 0, null, undefined]) { - // @ts-ignore - const result = await parseNative(filename).then( - () => 'resolved', - () => 'rejected' - ); - assert.is(result, 'rejected', `filename type: ${typeof filename}`); - } - // @ts-ignore - const notSetResult = await parseNative().then( - () => 'resolved', - () => 'rejected' - ); - assert.is(notSetResult, 'rejected', `filename not set`); - - const strResult = await parseNative('str').then( - () => 'resolved', - () => 'rejected' - ); - assert.is(strResult, 'resolved', `filename type: string`); -}); - -test('should reject when filename is a tsconfig.json that does not exist', async () => { - const notExisting = path.resolve(os.homedir(), '..', 'tsconfig.json'); // outside of user home there should not be a tsconfig - try { - await parseNative(notExisting); - assert.unreachable(`parseNative("${notExisting}") did not reject`); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.equal(e.message, `no tsconfig file found for ${notExisting}`); - } -}); - -test('should resolve with empty result when filename is a tsconfig.json that does not exist and option is set', async () => { - const notExisting = path.resolve(os.homedir(), '..', 'tsconfig.json'); // outside of user home there should not be a tsconfig - try { - const result = await parseNative(notExisting, { resolveWithEmptyIfConfigNotFound: true }); - assert.equal( - result, - { tsconfigFile: 'no_tsconfig_file_found', tsconfig: {}, result: null }, - 'empty result' - ); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.unreachable( - `parseNative("${notExisting}",{resolveWithEmptyIfConfigNotFound: true}) did reject` - ); - } -}); - -test('should resolve with expected for valid tsconfig.json', async () => { - const samples = await glob('tests/fixtures/parse/valid/**/tsconfig.json'); - for (const filename of samples) { - const expected = await loadExpectedJSON(filename, 'expected.native.json'); - try { - const actual = await parseNative(filename); - assert.equal(actual.tsconfig, expected, `testfile: ${filename}`); - assert.equal(actual.tsconfigFile, path.resolve(filename)); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.unreachable(`parsing ${filename} failed: ${e}`); - } - } -}); - -test('should resolve with expected tsconfig.json for valid tsconfig that is part of a solution', async () => { - const samples = await glob('tests/fixtures/parse/solution/**/tsconfig?(!(*.expected)).json'); - for (const filename of samples) { - const expectedFilename = `${path.basename(filename)}.expected.json`; - const expected = await loadExpectedJSON(filename, expectedFilename); - try { - const actual = await parseNative(filename); - assert.equal(actual.tsconfig, expected, `testfile: ${filename}`); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.unreachable(`parsing ${filename} failed: ${e}`); - } - } -}); - -test('should resolve with expected tsconfig.json for ts file that is part of a solution', async () => { - const samples = await glob('tests/fixtures/parse/solution/**/*.{ts,mts,cts}'); - for (const filename of samples) { - const expectedFilename = `${path.basename(filename)}.expected.json`; - const expected = await loadExpectedJSON(filename, expectedFilename); - try { - const actual = await parseNative(filename); - assert.equal(actual.tsconfig, expected, `testfile: ${filename}`); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.unreachable(`parsing ${filename} failed: ${e}`); - } - } -}); - -test('should work with cache', async () => { - // use the more interesting samples with extensions and solution-style - const samples = [ - ...(await glob('tests/fixtures/parse/valid/with_extends/**/tsconfig.json')), - ...(await glob('tests/fixtures/parse/solution/**/*.ts')) - ]; - const cache = new Map(); - for (const filename of samples) { - try { - const expectedFilename = filename.endsWith('.ts') - ? `${path.basename(filename)}.expected.json` - : 'expected.native.json'; - const expected = await loadExpectedJSON(filename, expectedFilename); - assert.is(cache.has(filename), false, `cache does not exist for ${filename}`); - const actual = await parseNative(filename, { cache }); - assert.equal(actual.tsconfig, expected, `expected for testfile: ${filename}`); - assert.is(cache.has(filename), true, `cache exists for ${filename}`); - const cached = cache.get(filename)!; - assert.equal(cached.tsconfig, expected, `cached for testfile: ${filename}`); - const reparsedResult = await parseNative(filename, { cache }); - assert.is(reparsedResult, cached, `reparsedResult was returned from cache for ${filename}`); - if (filename.endsWith('.ts')) { - assert.is(cache.has(actual.tsconfigFile), true, `cache exists for ${actual.tsconfigFile}`); - const cachedByResultFilename = cache.get(actual.tsconfigFile)!; - assert.equal( - cachedByResultFilename.tsconfig, - expected, - `cache of ${actual.tsconfigFile} matches for: ${filename}` - ); - const reparsedByResultFilename = await parseNative(actual.tsconfigFile, { cache }); - assert.is( - reparsedByResultFilename, - cachedByResultFilename, - `reparsedByResultFilename was returned from cache for ${actual.tsconfigFile}` - ); - } - cache.clear(); - const afterClear = await parseNative(filename, { cache }); - assert.equal(afterClear.tsconfig, expected, `expected after clear for testfile: ${filename}`); - assert.is(cache.has(filename), true, `cache exists again after clear for ${filename}`); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.unreachable(`unexpected error when testing cache with ${filename}: ${e}`); - } - } -}); - -test('should resolve with tsconfig that is isomorphic', async () => { - const tempDir = await copyFixtures( - 'parse/valid', - 'parse-native-isomorphic', - (x) => x.isDirectory() || x.name.startsWith('tsconfig') - ); - const samples = await glob(`${tempDir}/**/tsconfig.json`); - for (const filename of samples) { - try { - const result = await parseNative(filename); - await fs.copyFile(filename, `${filename}.orig`); - await fs.writeFile(filename, JSON.stringify(result.tsconfig, null, 2)); - const result2 = await parseNative(filename); - assert.equal(result.tsconfig, result2.tsconfig, `filename: ${filename}`); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.unreachable(`parsing ${filename} failed: ${e}`); - } - } -}); - -test('should resolve with tsconfig that works when transpiling', async () => { - const samples = await glob('tests/fixtures/transpile/**/tsconfig.json'); - for (const filename of samples) { - try { - const { tsconfig } = await parseNative(filename); - const inputFiles = await glob(filename.replace('tsconfig.json', '**/input.ts')); - for (const inputFile of inputFiles) { - const input = await fs.readFile(inputFile, 'utf-8'); - const esbuildExpected = await loadExpectedTXT(inputFile, 'expected.esbuild.txt'); - const esbuildResult = ( - await esbuildTransform(input, { loader: 'ts', tsconfigRaw: tsconfig }) - ).code; - assert.fixture( - esbuildResult, - esbuildExpected, - `esbuild result with config: ${filename} and input ${inputFile}` - ); - const tsExpected = await loadExpectedTXT(inputFile, 'expected.typescript.txt'); - const tsResult = ts.transpile(input, tsconfig.compilerOptions); - assert.fixture( - tsResult, - tsExpected, - `typescript result with config: ${filename} and input ${inputFile}` - ); - } - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.unreachable(`compiling parse result of ${filename} failed: ${e}`); - } - } -}); - -test('should reject with correct error position for invalid tsconfig.json', async () => { - let samples = await glob('tests/fixtures/parse/invalid/**/tsconfig.json'); - samples = samples.filter( - (sample) => !sample.includes(path.join('extends-fallback-not-found', 'dir')) - ); - for (const filename of samples) { - const expected = await loadExpectedJSON(filename, 'expected.native.json'); - try { - await parseNative(filename); - assert.unreachable(`${filename} did not reject`); - } catch (err) { - if (err.code === 'ERR_ASSERTION') { - throw err; - } - assert.instance(err, TSConfckParseNativeError); - - assert.equal(err.code, expected.code, `filename: ${filename}, err: ${err}`); - if (expected.start != null) { - assert.equal(err.diagnostic.start, expected.start, `filename: ${filename}, err: ${err}`); - } - assert.match( - err.message, - expected.message, - `expected "${expected.message}" for filename: ${filename}, got "${err.message}", err: ${err}` - ); - - assert.is(err.tsconfigFile, path.resolve(filename)); - } - } -}); - -test('should prevent typescript file scanning when ignoreSourceFiles: true is set', async () => { - // use the more interesting samples with extensions and solution-style - const samples = [ - ...(await glob('tests/fixtures/parse/valid/with_extends/**/tsconfig.json')), - ...(await glob('tests/fixtures/parse/solution/**/*.ts')) - ]; - - for (const filename of samples) { - try { - let expectedFilename = filename.endsWith('.ts') - ? `${path.basename(filename)}.expected.json` - : 'expected.native.json'; - if (filename.endsWith('.ts') && filename.includes(path.join('solution', 'mixed', 'src'))) { - expectedFilename = path.join('..', 'tsconfig.json'); // mixed solution resolve does not work without files and returns parent - } - const expected = await loadExpectedJSON(filename, expectedFilename); - expected.files = []; - expected.include = []; - const actual = await parseNative(filename, { ignoreSourceFiles: true }); - assert.equal(actual.tsconfig, expected, `testing ignoreSourceFiles with ${filename}`); - assert.is(actual.result.fileNames.length, 0, `testing ignoreSourceFiles with ${filename}`); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.unreachable(`unexpected error when testing ignoreSourceFiles with ${filename}: ${e}`); - } - } -}); - -test.run(); diff --git a/tests/parse.ts b/tests/parse.ts deleted file mode 100644 index 5b7efbf..0000000 --- a/tests/parse.ts +++ /dev/null @@ -1,258 +0,0 @@ -import { suite } from 'uvu'; -import * as assert from 'uvu/assert'; -import glob from 'tiny-glob'; -import { promises as fs } from 'fs'; -import path from 'path'; -import { parse, TSConfckParseError, TSConfckParseResult } from '../src/parse.js'; -import os from 'os'; -import { copyFixtures } from './util/copy-fixtures.js'; -import { transform as esbuildTransform } from 'esbuild'; -import ts from 'typescript'; -import { loadExpectedJSON, loadExpectedTXT } from './util/load-expected.js'; - -const test = suite('parse'); - -test('should be a function', () => { - assert.type(parse, 'function'); -}); - -test('should return a Promise', () => { - assert.instance(parse('str'), Promise); -}); - -test('should reject for invalid filename arg', async () => { - // TODO rewrite to assert.rejects once https://github.com/lukeed/uvu/pull/132 landed - for (const filename of [{}, [], 0, null, undefined]) { - // @ts-ignore - const result = await parse(filename).then( - () => 'resolved', - () => 'rejected' - ); - assert.is(result, 'rejected', `filename type: ${typeof filename}`); - } - // @ts-ignore - const notSetResult = await parse().then( - () => 'resolved', - () => 'rejected' - ); - assert.is(notSetResult, 'rejected', `filename not set`); - - const strResult = await parse('str').then( - () => 'resolved', - () => 'rejected' - ); - assert.is(strResult, 'resolved', `filename type: string`); -}); - -test('should reject when filename is a tsconfig.json that does not exist', async () => { - const notExisting = path.resolve(os.homedir(), '..', 'tsconfig.json'); // outside of user home there should not be a tsconfig - try { - await parse(notExisting); - assert.unreachable(`parse("${notExisting}") did not reject`); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.equal(e.message, `no tsconfig file found for ${notExisting}`); - } -}); - -test('should resolve with empty result when filename is a tsconfig.json that does not exist and option is set', async () => { - const notExisting = path.resolve(os.homedir(), '..', 'tsconfig.json'); // outside of user home there should not be a tsconfig - try { - const result = await parse(notExisting, { resolveWithEmptyIfConfigNotFound: true }); - assert.equal(result, { tsconfigFile: 'no_tsconfig_file_found', tsconfig: {} }, 'empty result'); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.unreachable( - `parse("${notExisting}",{resolveWithEmptyIfConfigNotFound: true}) did reject` - ); - } -}); - -test('should resolve with expected for valid tsconfig.json', async () => { - const samples = await glob('tests/fixtures/parse/valid/**/tsconfig.json'); - for (const filename of samples) { - const expected = await loadExpectedJSON(filename, 'expected.native.json'); - try { - const actual = await parse(filename); - assert.equal(actual.tsconfig, expected, `testfile: ${filename}`); - assert.equal(actual.tsconfigFile, path.resolve(filename)); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.unreachable(`parsing ${filename} failed: ${e}`); - } - } -}); - -test('should resolve with expected tsconfig.json for valid tsconfig that is part of a solution', async () => { - const samples = await glob('tests/fixtures/parse/solution/**/tsconfig?(!(*.expected)).json'); - for (const filename of samples) { - const expectedFilename = `${path.basename(filename)}.expected.json`; - const expected = await loadExpectedJSON(filename, expectedFilename); - try { - const actual = await parse(filename); - assert.equal(actual.tsconfig, expected, `testfile: ${filename}`); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.unreachable(`parsing ${filename} failed: ${e}`); - } - } -}); - -test('should resolve with expected tsconfig.json for ts file that is part of a solution', async () => { - const samples = await glob('tests/fixtures/parse/solution/**/*.{ts,mts,cts}'); - for (const filename of samples) { - const expectedFilename = `${path.basename(filename)}.expected.json`; - const expected = await loadExpectedJSON(filename, expectedFilename); - try { - const actual = await parse(filename); - assert.equal(actual.tsconfig, expected, `testfile: ${filename}`); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.unreachable(`parsing ${filename} failed: ${e}`); - } - } -}); - -test('should work with cache', async () => { - // use the more interesting samples with extensions and solution-style - const samples = [ - ...(await glob('tests/fixtures/parse/valid/with_extends/**/tsconfig.json')), - ...(await glob('tests/fixtures/parse/solution/**/*.ts')) - ]; - const cache = new Map(); - for (const filename of samples) { - try { - const expectedFilename = filename.endsWith('.ts') - ? `${path.basename(filename)}.expected.json` - : 'expected.native.json'; - const expected = await loadExpectedJSON(filename, expectedFilename); - assert.is(cache.has(filename), false, `cache does not exist for ${filename}`); - const actual = await parse(filename, { cache }); - assert.equal(actual.tsconfig, expected, `expected for testfile: ${filename}`); - assert.is(cache.has(filename), true, `cache exists for ${filename}`); - const cached = cache.get(filename)!; - assert.equal(cached.tsconfig, expected, `cached for testfile: ${filename}`); - const reparsedResult = await parse(filename, { cache }); - assert.is(reparsedResult, cached, `reparsedResult was returned from cache for ${filename}`); - if (filename.endsWith('.ts')) { - assert.is(cache.has(actual.tsconfigFile), true, `cache exists for ${actual.tsconfigFile}`); - const cachedByResultFilename = cache.get(actual.tsconfigFile)!; - assert.equal( - cachedByResultFilename.tsconfig, - expected, - `cache of ${actual.tsconfigFile} matches for: ${filename}` - ); - const reparsedByResultFilename = await parse(actual.tsconfigFile, { cache }); - assert.is( - reparsedByResultFilename, - cachedByResultFilename, - `reparsedByResultFilename was returned from cache for ${actual.tsconfigFile}` - ); - } - cache.clear(); - const afterClear = await parse(filename, { cache }); - assert.equal(afterClear.tsconfig, expected, `expected after clear for testfile: ${filename}`); - assert.is(cache.has(filename), true, `cache exists again after clear for ${filename}`); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.unreachable(`unexpected error when testing cache with ${filename}: ${e}`); - } - } -}); - -test('should resolve with tsconfig that is isomorphic', async () => { - const tempDir = await copyFixtures( - 'parse/valid', - 'parse-isomorphic', - (x) => x.isDirectory() || x.name.startsWith('tsconfig') - ); - const samples = await glob(`${tempDir}/**/tsconfig.json`); - for (const filename of samples) { - try { - const result = await parse(filename); - await fs.copyFile(filename, `${filename}.orig`); - await fs.writeFile(filename, JSON.stringify(result.tsconfig, null, 2)); - const result2 = await parse(filename); - assert.equal(result.tsconfig, result2.tsconfig, `filename: ${filename}`); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.unreachable(`parsing ${filename} failed: ${e}`); - } - } -}); - -test('should resolve with tsconfig that works when transpiling', async () => { - const samples = await glob('tests/fixtures/transpile/**/tsconfig.json'); - for (const filename of samples) { - try { - const { tsconfig } = await parse(filename); - const inputFiles = await glob(filename.replace('tsconfig.json', '**/input.ts')); - for (const inputFile of inputFiles) { - const input = await fs.readFile(inputFile, 'utf-8'); - const esbuildExpected = await loadExpectedTXT(inputFile, 'expected.esbuild.txt'); - const esbuildResult = ( - await esbuildTransform(input, { loader: 'ts', tsconfigRaw: tsconfig }) - ).code; - assert.fixture( - esbuildResult, - esbuildExpected, - `esbuild result with config: ${filename} and input ${inputFile}` - ); - const tsExpected = await loadExpectedTXT(inputFile, 'expected.typescript.txt'); - const tsResult = ts.transpile(input, tsconfig.compilerOptions); - assert.fixture( - tsResult, - tsExpected, - `typescript result with config: ${filename} and input ${inputFile}` - ); - } - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.unreachable(`compiling parse result of ${filename} failed: ${e}`); - } - } -}); - -test('should reject with correct error for invalid tsconfig.json', async () => { - let samples = await glob('tests/fixtures/parse/invalid/**/tsconfig.json'); - samples = samples.filter( - (sample) => !sample.includes(path.join('extends-fallback-not-found', 'dir')) - ); - for (const filename of samples) { - const expected = loadExpectedTXT(filename).trim(); - try { - await parse(filename); - assert.unreachable(`${filename} did not reject`); - } catch (e) { - if (e.code === 'ERR_ASSERTION') { - throw e; - } - assert.instance(e, TSConfckParseError); - const actual = e.message; - assert.is( - actual.includes(expected), - true, - `expected "${actual}" for filename: ${filename}, to include "${expected}"` - ); - assert.is(e.tsconfigFile, path.resolve(filename)); - } - } -}); - -test.run(); diff --git a/tests/to-json.ts b/tests/to-json.ts deleted file mode 100644 index cca42ba..0000000 --- a/tests/to-json.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { suite } from 'uvu'; -import * as assert from 'uvu/assert'; -import glob from 'tiny-glob'; -import { promises as fs } from 'fs'; -import path from 'path'; -import { toJson } from '../src/to-json.js'; -const test = suite('toJson'); - -test('should be a function', () => { - assert.type(toJson, 'function'); -}); - -test('should return a String', () => { - assert.is(typeof toJson('str'), 'string'); -}); - -test('should throw for invalid tsconfigJson arg', () => { - for (const tsconfigJson of [{}, [], 0, null, undefined]) { - assert.throws( - // @ts-ignore - () => toJson(tsconfigJson), - TypeError, - `tsconfigJson type: ${typeof tsconfigJson}` - ); - } - // @ts-ignore - assert.throws(() => toJson(), TypeError, 'tsConfigJson not set'); - assert.not.throws(() => toJson('str')); -}); - -test('should convert tsconfig.json to regular json', async () => { - const samples = (await glob('tests/fixtures/parse/valid/**/tsconfig.json')).map((file) => - path.resolve(file) - ); - for (const filename of samples) { - const tsconfigJson = await fs.readFile(filename, 'utf-8'); - const expected = await fs.readFile( - filename.replace(/tsconfig.json$/, 'expected.json'), - 'utf-8' - ); - const actual = toJson(tsconfigJson); - assert.fixture(actual, expected, `testfile: ${filename}`); - assert.not.throws( - () => { - JSON.parse(actual); - }, - undefined, - `testfile: ${filename}` - ); - } -}); - -test.run(); diff --git a/tests/util.ts b/tests/util.ts deleted file mode 100644 index a6b9e89..0000000 --- a/tests/util.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { suite } from 'uvu'; -import * as assert from 'uvu/assert'; -import path from 'path'; -import os from 'os'; -import { isGlobMatch, native2posix, resolve2posix } from '../src/util.js'; -const test_isGlobMatch = suite('isGlobMatch'); - -const GLOBMATCH_TEST_DATA = [ - { - files: [ - { name: 'bar.ts', expected: true }, - { name: 'baz.tsx', expected: true }, - { name: 'foo/bar.ts', expected: true }, - { name: 'foo/bar/baz.tsx', expected: true }, - { name: '../qoox.txt', expected: false }, - { name: '../xxx/qoox.txt', expected: false }, - { name: '../xxx/bar.ts', expected: false }, - { name: '../xxx/bar.tsx', expected: false }, - { name: '../bar.ts', expected: false }, - { name: '../bar.tsx', expected: false } - ], - patterns: ['**/*'] - }, - { - files: [ - { name: 'a/bar.ts', expected: true }, - { name: 'foo/a/bar/baz.tsx', expected: true }, - { name: 'foo/a/bar.ts', expected: true }, - { name: 'foo/bar/a/baz.tsx', expected: true }, - { name: 'a/bar.txt', expected: false }, - { name: 'foo/abar/baz.tsx', expected: false }, - { name: 'foo/abar.ts', expected: false }, - { name: 'foo/bar/a/baz.txt', expected: false }, - { name: 'not-a/bar.ts', expected: false } - ], - patterns: ['**/a/**/*'] - }, - { - files: [ - { name: 'bar.ts', expected: true }, - { name: 'foo/a/bar/baz.tsx', expected: false }, - { name: 'foo/a/bar.ts', expected: false }, - { name: '../foo/bar.ts', expected: false } - ], - patterns: ['*.ts'] - }, - { - files: [ - { name: 'foo/bar.ts', expected: true }, - { name: '../foo/bar.ts', expected: false }, - { name: 'bar.ts', expected: false }, - { name: 'foo/a/bar.ts', expected: false } - ], - patterns: ['*/*'] - }, - { - files: [ - { name: 'a/bar.ts', expected: true }, - { name: 'b/bar.ts', expected: true }, - { name: 'cc/bar.ts', expected: false }, - { name: '../foo/bar.ts', expected: false }, - { name: 'bar.ts', expected: false }, - { name: 'a/b/bar.ts', expected: false } - ], - patterns: ['?/*'] - } -]; -test_isGlobMatch(`should work`, () => { - const dir = native2posix(path.join(os.homedir(), 'foo', 'src')); - for (const { files, patterns } of GLOBMATCH_TEST_DATA) { - for (const { name, expected } of files) { - const absName = resolve2posix(dir, name); - const actual = isGlobMatch(absName, dir, patterns); - assert.is(actual, expected, `isGlobMatch("${absName}","${dir}",${JSON.stringify(patterns)})`); - } - } -}); -test_isGlobMatch.run(); diff --git a/tests/util/load-expected.ts b/tests/util/load-expected.ts deleted file mode 100644 index a315c2b..0000000 --- a/tests/util/load-expected.ts +++ /dev/null @@ -1,50 +0,0 @@ -import path from 'path'; -import fs from 'fs'; -import { resolve2posix } from '../../src/util.js'; -import { versions } from 'process'; - -const nodeVersion = versions.node.split('.', 1)[0]; - -function findExpectedFile(filename: string) { - const lastDot = filename.lastIndexOf('.'); - const fileWithNode = `${filename.slice(0, lastDot)}.node${nodeVersion}.${filename.slice( - lastDot + 1 - )}`; - return fs.existsSync(fileWithNode) ? fileWithNode : filename; -} - -export function loadExpectedJSON( - inputFile: string, - expectedFile = 'expected.native.json' -): Promise { - return loadExpected(inputFile, expectedFile, 'json'); -} - -export function loadExpectedTXT(inputFile: string, expectedFile = 'expected.txt'): string { - return loadExpected(inputFile, expectedFile, 'txt'); -} - -function loadExpected(inputFile: string, expectedName: string, mode: 'txt' | 'json'): string | any { - const dir = path.resolve(path.dirname(inputFile)); - const expectedFilename = findExpectedFile(path.join(dir, expectedName)); - - try { - const content = fs.readFileSync(expectedFilename, 'utf-8'); - if (mode === 'txt') { - return content.replace(//g, dir); - } else if (mode === 'json') { - return JSON.parse(content, (k, v) => { - if (v && typeof v === 'string' && v.startsWith('')) { - return resolve2posix(dir, v.substring(8)); - } - return v; - }); - } else { - throw new Error('invalid mode: ' + mode); - } - } catch (e) { - const msg = `unexpected exception parsing ${expectedFilename}: ${e}`; - console.error(msg, e); - throw new Error(`unexpected exception parsing ${expectedFilename}: ${e}`); - } -} diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index a41653b..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": "@tsconfig/node14/tsconfig.json", - "compilerOptions": { - "module": "esnext", - "noImplicitAny": true, - "moduleResolution": "node", - "allowSyntheticDefaultImports": true, - // see https://devblogs.microsoft.com/typescript/announcing-typescript-4-4-beta/#use-unknown-catch-variables - "useUnknownInCatchVariables": false - }, - "include": [ - "@types/**/*", - "src/**/*" - ], - "exclude": [ - "node_modules" - ], -}