diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..801728e
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,55 @@
+# Contributing
+
+Thanks for your interest in contributing to this project! We welcome any contributions, including bug reports, feature requests, questions, discussions, code, documentation, tests, or anything else that you think would improve the project.
+
+PRs for bug fixes can be submitted directly, but PRs for new features should be discussed in an issue first.
+
+Before you get started, please read the following guidelines.
+
+## Setup
+
+1. Fork the repository on GitHub and clone your fork to your local machine.
+2. Run `corepack enable` at the repo root to enable Corepack and PNPM. This repo is a PNPM monorepo, so all package manager commands will be PNPM commands.
+3. Run `pnpm install` at the repo root to restore all dependencies.
+4. Run `pnpm build` at the repo root to build all packages.
+5. Run `pnpm test` at the repo root to run all tests.
+
+## Style
+
+Please use the following style guide when contributing to this project.
+
+- Use 2 spaces for indentation.
+- Use single quotes for strings.
+- Use `camelCase` for variable and function names.
+- Use `PascalCase` for class names.
+- Use `kebab-case` for filenames.
+ - Name the file after the class or function it exports.
+ - Export only one class or function per file.
+ - Exporting supporting types is also fine.
+- Wrap all code at 120 characters (max).
+- Use Expect (instead of Assert) syntax for tests.
+
+This project uses ESLint to check style, but not all rules are strictly enforced, and you should use your best judgment when contributing.
+
+If you use VSCode (recommended), you can install the [ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) to get real-time feedback on your code.
+
+Useful VSCode [Project Settings](.vscode/settings.json):
+
+```json
+{
+ "explorer.excludeGitIgnore": true,
+ "eslint.format.enable": true,
+ "editor.defaultFormatter": "dbaeumer.vscode-eslint",
+ "editor.tabSize": 2,
+}
+```
+
+## Test
+
+Please add/modify tests for any code changes you make. Generally, we want test files to be fairly self contained, so please keep any utilities, fixtures, or constants in the same file as the tests that use them. Test files should be placed in the `__tests__` directory.
+
+## Merge
+
+Once you open a PR, it will be reviewed by a maintainer. If the PR is approved, it will be merged. If the PR is not approved, the maintainer will leave a comment explaining why, and possible changes that could be made to get the PR approved.
+
+After the PR is merged, it will be released in the next version of the project. The next version may not be released immediately, and it may contain changes for several PRs. We will try to release new version in a timely manner.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..db74722
--- /dev/null
+++ b/README.md
@@ -0,0 +1,74 @@
+# Vite Plugin Auto Lib
+
+Vite plugin that configures sane defaults for building libraries.
+
+## Getting Started
+
+Install the plugin:
+
+```sh
+npm install vite-plugin-auto-lib --save-dev
+```
+
+Add the plugin to your `vite.config.js`:
+
+```ts
+import { defineConfig } from 'vite';
+import { lib } from 'vite-plugin-auto-lib';
+
+export default defineConfig({
+ plugins: [lib()]
+});
+```
+
+As long as you have a [common entrypoint](#common-entrypoints) (eg. `src/index.ts`), this should be a working configuration for most libraries.
+
+Only [defaults](#config-defaults) are provided, so any configuration set by earlier plugins or by the user will be left as-is.
+
+```ts
+export default defineConfig({
+ plugins: [lib()],
+ // Override the auto-detected lib entry.
+ build: {
+ lib: {
+ entry: 'src/foo.ts',
+ }
+ }
+});
+```
+
+## Common Entrypoints
+
+The plugin will auto detect entrypoints with the following prefixes and extensions:
+
+- Prefixes: `index`, `bin`, `main`, `src/index`, `src/bin`, `src/main`
+- Extensions: `.ts`, `.tsx`, `.mts`, `.cts`, `.js`, `.jsx`, `.mjs`, `.cjs`
+
+Multiple entrypoints can be detected. However, if the same prefix exists with multiple extensions, only one will be detected as an entrypoint. The extensions are listed in order of priority, with the highest priority first. Therefore, if `index.ts` and `index.tsx` both exist, then `index.ts` will be detected.
+
+## Config Defaults
+
+- `build.target`: `'esnext'`
+- `build.sourcemap`: `true`
+- `build.lib.formats`: Auto-detected from the `type` field in the nearest
+ `package.json` file.
+- `build.lib.fileName`: `'[name]'`
+- `build.lib.entry`: Auto-detected at the Vite `root` from a list of common
+ entry points.
+- `build.rollupOptions.treeshake`: `false`
+- `build.rollupOptions.external`: Externalizes NodeJS built-ins, native
+ modules, and production dependencies.
+- `build.rollupOptions.output.preserveModules`: `true`
+
+## Recommended Supplemental Plugins
+
+- [vite-plugin-checker](https://www.npmjs.com/package/vite-plugin-checker)
+ - Type checking.
+- [vite-plugin-dts](https://www.npmjs.com/package/vite-plugin-dts)
+ - Type declarations.
+- [vite-plugin-bin](https://www.npmjs.com/package/vite-plugin-bin)
+ - Bin script helper.
+- [vite-plugin-data](https://www.npmjs.com/package/vite-plugin-data)
+ - Build-time data injection.
+- [rollup-plugin-node-externals](https://www.npmjs.com/package/rollup-plugin-node-externals)
+ - More complete and configurable externalization.
\ No newline at end of file
diff --git a/index.html b/index.html
deleted file mode 100644
index 2ecc046..0000000
--- a/index.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
- UNTITLED
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/package.json b/package.json
index b3c3263..378219c 100644
--- a/package.json
+++ b/package.json
@@ -1,12 +1,12 @@
{
"private": true,
- "name": "UNTITLED",
- "description": "",
- "version": "0.0.0-prerelease",
+ "name": "vite-plugin-auto-lib",
+ "description": "Vite plugin that configures sane defaults for building libraries.",
+ "version": "0.0.1",
"license": "ISC",
"repository": {
"type": "git",
- "url": "https://github.com/Shakeskeyboarde/UNTITLED.git"
+ "url": "https://github.com/Shakeskeyboarde/vite-plugin-auto-lib.git"
},
"scripts": {
"start": "vite",
@@ -15,11 +15,10 @@
"open-coverage": "open out/coverage/index.html"
},
"files": [
- "lib"
+ "dist"
],
"publishConfig": {
- "access": "public",
- "tag": "prerelease"
+ "access": "public"
},
"type": "module",
"types": "./dist/index.d.ts",
@@ -35,9 +34,11 @@
"@vitest/coverage-v8": "^1.6.0",
"eslint": "^8",
"eslint-config-rational": "^5.0.13",
+ "rollup-plugin-node-externals": "^7.1.2",
"typescript": "^5.4.5",
"vite": "^5.2.11",
"vite-plugin-checker": "^0.6.4",
+ "vite-plugin-dts": "^3.9.1",
"vitest": "^1.6.0"
}
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 81a3cd6..915e6d4 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -20,6 +20,9 @@ importers:
eslint-config-rational:
specifier: ^5.0.13
version: 5.0.13(eslint@8.57.0)(typescript@5.4.5)
+ rollup-plugin-node-externals:
+ specifier: ^7.1.2
+ version: 7.1.2(rollup@4.17.2)
typescript:
specifier: ^5.4.5
version: 5.4.5
@@ -28,7 +31,10 @@ importers:
version: 5.2.11(@types/node@20.12.11)
vite-plugin-checker:
specifier: ^0.6.4
- version: 0.6.4(eslint@8.57.0)(optionator@0.9.4)(typescript@5.4.5)(vite@5.2.11(@types/node@20.12.11))
+ version: 0.6.4(eslint@8.57.0)(optionator@0.9.4)(typescript@5.4.5)(vite@5.2.11(@types/node@20.12.11))(vue-tsc@1.8.27(typescript@5.4.5))
+ vite-plugin-dts:
+ specifier: ^3.9.1
+ version: 3.9.1(@types/node@20.12.11)(rollup@4.17.2)(typescript@5.4.5)(vite@5.2.11(@types/node@20.12.11))
vitest:
specifier: ^1.6.0
version: 1.6.0(@types/node@20.12.11)
@@ -272,6 +278,19 @@ packages:
'@jridgewell/trace-mapping@0.3.25':
resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==}
+ '@microsoft/api-extractor-model@7.28.13':
+ resolution: {integrity: sha512-39v/JyldX4MS9uzHcdfmjjfS6cYGAoXV+io8B5a338pkHiSt+gy2eXQ0Q7cGFJ7quSa1VqqlMdlPrB6sLR/cAw==}
+
+ '@microsoft/api-extractor@7.43.0':
+ resolution: {integrity: sha512-GFhTcJpB+MI6FhvXEI9b2K0snulNLWHqC/BbcJtyNYcKUiw7l3Lgis5ApsYncJ0leALX7/of4XfmXk+maT111w==}
+ hasBin: true
+
+ '@microsoft/tsdoc-config@0.16.2':
+ resolution: {integrity: sha512-OGiIzzoBLgWWR0UdRJX98oYO+XKGf7tiK4Zk6tQ/E4IJqGCe7dvkTvgDZV5cFJUzLGDOjeAXrnZoA6QkVySuxw==}
+
+ '@microsoft/tsdoc@0.14.2':
+ resolution: {integrity: sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==}
+
'@nodelib/fs.scandir@2.1.5':
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
engines: {node: '>= 8'}
@@ -284,6 +303,15 @@ packages:
resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}
engines: {node: '>= 8'}
+ '@rollup/pluginutils@5.1.0':
+ resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==}
+ engines: {node: '>=14.0.0'}
+ peerDependencies:
+ rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
+ peerDependenciesMeta:
+ rollup:
+ optional: true
+
'@rollup/rollup-android-arm-eabi@4.17.2':
resolution: {integrity: sha512-NM0jFxY8bB8QLkoKxIQeObCaDlJKewVlIEkuyYKm5An1tdVZ966w2+MPQ2l8LBZLjR+SgyV+nRkTIunzOYBMLQ==}
cpu: [arm]
@@ -364,6 +392,28 @@ packages:
cpu: [x64]
os: [win32]
+ '@rushstack/node-core-library@4.0.2':
+ resolution: {integrity: sha512-hyES82QVpkfQMeBMteQUnrhASL/KHPhd7iJ8euduwNJG4mu2GSOKybf0rOEjOm1Wz7CwJEUm9y0yD7jg2C1bfg==}
+ peerDependencies:
+ '@types/node': '*'
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+
+ '@rushstack/rig-package@0.5.2':
+ resolution: {integrity: sha512-mUDecIJeH3yYGZs2a48k+pbhM6JYwWlgjs2Ca5f2n1G2/kgdgP9D/07oglEGf6mRyXEnazhEENeYTSNDRCwdqA==}
+
+ '@rushstack/terminal@0.10.0':
+ resolution: {integrity: sha512-UbELbXnUdc7EKwfH2sb8ChqNgapUOdqcCIdQP4NGxBpTZV2sQyeekuK3zmfQSa/MN+/7b4kBogl2wq0vpkpYGw==}
+ peerDependencies:
+ '@types/node': '*'
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+
+ '@rushstack/ts-command-line@4.19.1':
+ resolution: {integrity: sha512-J7H768dgcpG60d7skZ5uSSwyCZs/S2HrWP1Ds8d1qYAyaaeJmpmmLr9BVw97RjFzmQPOYnoXcKA4GkqDCkduQg==}
+
'@sinclair/typebox@0.27.8':
resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==}
@@ -396,6 +446,9 @@ packages:
peerDependencies:
eslint: '>=8.40.0'
+ '@types/argparse@1.0.38':
+ resolution: {integrity: sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==}
+
'@types/eslint@8.56.10':
resolution: {integrity: sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==}
@@ -522,6 +575,32 @@ packages:
'@vitest/utils@1.6.0':
resolution: {integrity: sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==}
+ '@volar/language-core@1.11.1':
+ resolution: {integrity: sha512-dOcNn3i9GgZAcJt43wuaEykSluAuOkQgzni1cuxLxTV0nJKanQztp7FxyswdRILaKH+P2XZMPRp2S4MV/pElCw==}
+
+ '@volar/source-map@1.11.1':
+ resolution: {integrity: sha512-hJnOnwZ4+WT5iupLRnuzbULZ42L7BWWPMmruzwtLhJfpDVoZLjNBxHDi2sY2bgZXCKlpU5XcsMFoYrsQmPhfZg==}
+
+ '@volar/typescript@1.11.1':
+ resolution: {integrity: sha512-iU+t2mas/4lYierSnoFOeRFQUhAEMgsFuQxoxvwn5EdQopw43j+J27a4lt9LMInx1gLJBC6qL14WYGlgymaSMQ==}
+
+ '@vue/compiler-core@3.4.27':
+ resolution: {integrity: sha512-E+RyqY24KnyDXsCuQrI+mlcdW3ALND6U7Gqa/+bVwbcpcR3BRRIckFoz7Qyd4TTlnugtwuI7YgjbvsLmxb+yvg==}
+
+ '@vue/compiler-dom@3.4.27':
+ resolution: {integrity: sha512-kUTvochG/oVgE1w5ViSr3KUBh9X7CWirebA3bezTbB5ZKBQZwR2Mwj9uoSKRMFcz4gSMzzLXBPD6KpCLb9nvWw==}
+
+ '@vue/language-core@1.8.27':
+ resolution: {integrity: sha512-L8Kc27VdQserNaCUNiSFdDl9LWT24ly8Hpwf1ECy3aFb9m6bDhBGQYOujDm21N7EW3moKIOKEanQwe1q5BK+mA==}
+ peerDependencies:
+ typescript: '*'
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+
+ '@vue/shared@3.4.27':
+ resolution: {integrity: sha512-DL3NmY2OFlqmYYrzp39yi3LDkKxa5vZVwxWdQ3rG0ekuWscHraeIbnI8t+aZK7qhYqEqWKTUdijadunb9pnrgA==}
+
acorn-jsx@5.3.2:
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
peerDependencies:
@@ -567,6 +646,9 @@ packages:
resolution: {integrity: sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==}
engines: {node: '>=14'}
+ argparse@1.0.10:
+ resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==}
+
argparse@2.0.1:
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
@@ -696,10 +778,17 @@ packages:
resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==}
engines: {node: '>= 12'}
+ commander@9.5.0:
+ resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==}
+ engines: {node: ^12.20.0 || >=14}
+
comment-parser@1.4.1:
resolution: {integrity: sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==}
engines: {node: '>= 12.0.0'}
+ computeds@0.0.1:
+ resolution: {integrity: sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==}
+
concat-map@0.0.1:
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
@@ -725,6 +814,9 @@ packages:
resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==}
engines: {node: '>= 0.4'}
+ de-indent@1.0.2:
+ resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==}
+
debug@3.2.7:
resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
peerDependencies:
@@ -780,6 +872,10 @@ packages:
resolution: {integrity: sha512-4U5pNsuDl0EhuZpq46M5xPslstkviJuhrdobaRDBk2Jy2KO37FDAJl4lb2KlNabxT0m4MTK2UHNrsAcphE8nyw==}
engines: {node: '>=10.13.0'}
+ entities@4.5.0:
+ resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
+ engines: {node: '>=0.12'}
+
error-ex@1.3.2:
resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==}
@@ -943,6 +1039,9 @@ packages:
resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==}
engines: {node: '>=4.0'}
+ estree-walker@2.0.2:
+ resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}
+
estree-walker@3.0.3:
resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}
@@ -1000,6 +1099,10 @@ packages:
resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==}
engines: {node: '>=14.14'}
+ fs-extra@7.0.1:
+ resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==}
+ engines: {node: '>=6 <7 || >=8'}
+
fs.realpath@1.0.0:
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
@@ -1102,6 +1205,10 @@ packages:
resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
engines: {node: '>= 0.4'}
+ he@1.2.0:
+ resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==}
+ hasBin: true
+
hosted-git-info@2.8.9:
resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==}
@@ -1120,6 +1227,10 @@ packages:
resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==}
engines: {node: '>=6'}
+ import-lazy@4.0.0:
+ resolution: {integrity: sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==}
+ engines: {node: '>=8'}
+
imurmurhash@0.1.4:
resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==}
engines: {node: '>=0.8.19'}
@@ -1278,6 +1389,9 @@ packages:
iterator.prototype@1.1.2:
resolution: {integrity: sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==}
+ jju@1.4.0:
+ resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==}
+
js-tokens@4.0.0:
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
@@ -1313,6 +1427,9 @@ packages:
json-stable-stringify-without-jsonify@1.0.1:
resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==}
+ jsonfile@4.0.0:
+ resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==}
+
jsonfile@6.1.0:
resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==}
@@ -1323,6 +1440,9 @@ packages:
keyv@4.5.4:
resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==}
+ kolorist@1.8.0:
+ resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==}
+
levn@0.4.1:
resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}
engines: {node: '>= 0.8.0'}
@@ -1342,9 +1462,18 @@ packages:
resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==}
engines: {node: '>=10'}
+ lodash.get@4.4.2:
+ resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==}
+
+ lodash.isequal@4.5.0:
+ resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==}
+
lodash.merge@4.6.2:
resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==}
+ lodash@4.17.21:
+ resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
+
loose-envify@1.4.0:
resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==}
hasBin: true
@@ -1352,6 +1481,10 @@ packages:
loupe@2.3.7:
resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==}
+ lru-cache@6.0.0:
+ resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
+ engines: {node: '>=10'}
+
magic-string@0.30.10:
resolution: {integrity: sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==}
@@ -1381,6 +1514,9 @@ packages:
resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==}
engines: {node: '>=4'}
+ minimatch@3.0.8:
+ resolution: {integrity: sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==}
+
minimatch@3.1.2:
resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
@@ -1401,6 +1537,9 @@ packages:
ms@2.1.3:
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
+ muggle-string@0.3.1:
+ resolution: {integrity: sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==}
+
nanoid@3.3.7:
resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==}
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
@@ -1501,6 +1640,9 @@ packages:
resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==}
engines: {node: '>=8'}
+ path-browserify@1.0.1:
+ resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==}
+
path-exists@4.0.0:
resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}
engines: {node: '>=8'}
@@ -1623,6 +1765,9 @@ packages:
resolve-pkg-maps@1.0.0:
resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==}
+ resolve@1.19.0:
+ resolution: {integrity: sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==}
+
resolve@1.22.8:
resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==}
hasBin: true
@@ -1639,6 +1784,12 @@ packages:
resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==}
hasBin: true
+ rollup-plugin-node-externals@7.1.2:
+ resolution: {integrity: sha512-cVJFKs+ulZxpMmn/s+oi431d93Jq5+G7Sc5ixWDrL2k+Gj+MqXg0KMNWgKf8Mw5qpaG4jVDpsvuqFfiCvRcGeA==}
+ engines: {node: '>= 21 || ^20.6.0 || ^18.19.0'}
+ peerDependencies:
+ rollup: ^3.0.0 || ^4.0.0
+
rollup@4.17.2:
resolution: {integrity: sha512-/9ClTJPByC0U4zNLowV1tMBe8yMEAxewtR3cUNX5BoEpGH3dQEWpJLr6CLp0fPdYRF/fzVOgvDb1zXuakwF5kQ==}
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
@@ -1667,6 +1818,11 @@ packages:
resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==}
hasBin: true
+ semver@7.5.4:
+ resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==}
+ engines: {node: '>=10'}
+ hasBin: true
+
semver@7.6.2:
resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==}
engines: {node: '>=10'}
@@ -1707,6 +1863,10 @@ packages:
resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==}
engines: {node: '>=0.10.0'}
+ source-map@0.6.1:
+ resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
+ engines: {node: '>=0.10.0'}
+
spdx-correct@3.2.0:
resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==}
@@ -1722,12 +1882,19 @@ packages:
spdx-license-ids@3.0.17:
resolution: {integrity: sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==}
+ sprintf-js@1.0.3:
+ resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==}
+
stackback@0.0.2:
resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}
std-env@3.7.0:
resolution: {integrity: sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==}
+ string-argv@0.3.2:
+ resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==}
+ engines: {node: '>=0.6.19'}
+
string.prototype.matchall@4.0.11:
resolution: {integrity: sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==}
engines: {node: '>= 0.4'}
@@ -1770,6 +1937,10 @@ packages:
resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
engines: {node: '>=8'}
+ supports-color@8.1.1:
+ resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==}
+ engines: {node: '>=10'}
+
supports-preserve-symlinks-flag@1.0.0:
resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
engines: {node: '>= 0.4'}
@@ -1853,6 +2024,11 @@ packages:
resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==}
engines: {node: '>= 0.4'}
+ typescript@5.4.2:
+ resolution: {integrity: sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==}
+ engines: {node: '>=14.17'}
+ hasBin: true
+
typescript@5.4.5:
resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==}
engines: {node: '>=14.17'}
@@ -1867,6 +2043,10 @@ packages:
undici-types@5.26.5:
resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
+ universalify@0.1.2:
+ resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==}
+ engines: {node: '>= 4.0.0'}
+
universalify@2.0.1:
resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==}
engines: {node: '>= 10.0.0'}
@@ -1883,6 +2063,10 @@ packages:
validate-npm-package-license@3.0.4:
resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==}
+ validator@13.12.0:
+ resolution: {integrity: sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==}
+ engines: {node: '>= 0.10'}
+
vite-node@1.6.0:
resolution: {integrity: sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==}
engines: {node: ^18.0.0 || >=20.0.0}
@@ -1919,6 +2103,16 @@ packages:
vue-tsc:
optional: true
+ vite-plugin-dts@3.9.1:
+ resolution: {integrity: sha512-rVp2KM9Ue22NGWB8dNtWEr+KekN3rIgz1tWD050QnRGlriUCmaDwa7qA5zDEjbXg5lAXhYMSBJtx3q3hQIJZSg==}
+ engines: {node: ^14.18.0 || >=16.0.0}
+ peerDependencies:
+ typescript: '*'
+ vite: '*'
+ peerDependenciesMeta:
+ vite:
+ optional: true
+
vite@5.2.11:
resolution: {integrity: sha512-HndV31LWW05i1BLPMUCE1B9E9GFbOu1MbenhS58FuK6owSO5qHm7GiCotrNY1YE5rMeQSFBGmT5ZaLEjFizgiQ==}
engines: {node: ^18.0.0 || >=20.0.0}
@@ -1996,6 +2190,15 @@ packages:
vscode-uri@3.0.8:
resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==}
+ vue-template-compiler@2.7.16:
+ resolution: {integrity: sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==}
+
+ vue-tsc@1.8.27:
+ resolution: {integrity: sha512-WesKCAZCRAbmmhuGl3+VrdWItEvfoFIPXOvUJkjULi+x+6G/Dy69yO3TBRJDr9eUlmsNAwVmxsNZxvHKzbkKdg==}
+ hasBin: true
+ peerDependencies:
+ typescript: '*'
+
which-boxed-primitive@1.0.2:
resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==}
@@ -2028,6 +2231,9 @@ packages:
wrappy@1.0.2:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
+ yallist@4.0.0:
+ resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
+
yocto-queue@0.1.0:
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
engines: {node: '>=10'}
@@ -2036,6 +2242,11 @@ packages:
resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==}
engines: {node: '>=12.20'}
+ z-schema@5.0.5:
+ resolution: {integrity: sha512-D7eujBWkLa3p2sIpJA0d1pr7es+a7m0vFAnZLlCEKq/Ij2k0MLi9Br2UPxoxdYystm5K1yeBGzub0FlYUEWj2Q==}
+ engines: {node: '>=8.0.0'}
+ hasBin: true
+
snapshots:
'@ampproject/remapping@2.3.0':
@@ -2223,6 +2434,41 @@ snapshots:
'@jridgewell/resolve-uri': 3.1.2
'@jridgewell/sourcemap-codec': 1.4.15
+ '@microsoft/api-extractor-model@7.28.13(@types/node@20.12.11)':
+ dependencies:
+ '@microsoft/tsdoc': 0.14.2
+ '@microsoft/tsdoc-config': 0.16.2
+ '@rushstack/node-core-library': 4.0.2(@types/node@20.12.11)
+ transitivePeerDependencies:
+ - '@types/node'
+
+ '@microsoft/api-extractor@7.43.0(@types/node@20.12.11)':
+ dependencies:
+ '@microsoft/api-extractor-model': 7.28.13(@types/node@20.12.11)
+ '@microsoft/tsdoc': 0.14.2
+ '@microsoft/tsdoc-config': 0.16.2
+ '@rushstack/node-core-library': 4.0.2(@types/node@20.12.11)
+ '@rushstack/rig-package': 0.5.2
+ '@rushstack/terminal': 0.10.0(@types/node@20.12.11)
+ '@rushstack/ts-command-line': 4.19.1(@types/node@20.12.11)
+ lodash: 4.17.21
+ minimatch: 3.0.8
+ resolve: 1.22.8
+ semver: 7.5.4
+ source-map: 0.6.1
+ typescript: 5.4.2
+ transitivePeerDependencies:
+ - '@types/node'
+
+ '@microsoft/tsdoc-config@0.16.2':
+ dependencies:
+ '@microsoft/tsdoc': 0.14.2
+ ajv: 6.12.6
+ jju: 1.4.0
+ resolve: 1.19.0
+
+ '@microsoft/tsdoc@0.14.2': {}
+
'@nodelib/fs.scandir@2.1.5':
dependencies:
'@nodelib/fs.stat': 2.0.5
@@ -2235,6 +2481,14 @@ snapshots:
'@nodelib/fs.scandir': 2.1.5
fastq: 1.17.1
+ '@rollup/pluginutils@5.1.0(rollup@4.17.2)':
+ dependencies:
+ '@types/estree': 1.0.5
+ estree-walker: 2.0.2
+ picomatch: 2.3.1
+ optionalDependencies:
+ rollup: 4.17.2
+
'@rollup/rollup-android-arm-eabi@4.17.2':
optional: true
@@ -2283,6 +2537,38 @@ snapshots:
'@rollup/rollup-win32-x64-msvc@4.17.2':
optional: true
+ '@rushstack/node-core-library@4.0.2(@types/node@20.12.11)':
+ dependencies:
+ fs-extra: 7.0.1
+ import-lazy: 4.0.0
+ jju: 1.4.0
+ resolve: 1.22.8
+ semver: 7.5.4
+ z-schema: 5.0.5
+ optionalDependencies:
+ '@types/node': 20.12.11
+
+ '@rushstack/rig-package@0.5.2':
+ dependencies:
+ resolve: 1.22.8
+ strip-json-comments: 3.1.1
+
+ '@rushstack/terminal@0.10.0(@types/node@20.12.11)':
+ dependencies:
+ '@rushstack/node-core-library': 4.0.2(@types/node@20.12.11)
+ supports-color: 8.1.1
+ optionalDependencies:
+ '@types/node': 20.12.11
+
+ '@rushstack/ts-command-line@4.19.1(@types/node@20.12.11)':
+ dependencies:
+ '@rushstack/terminal': 0.10.0(@types/node@20.12.11)
+ '@types/argparse': 1.0.38
+ argparse: 1.0.10
+ string-argv: 0.3.2
+ transitivePeerDependencies:
+ - '@types/node'
+
'@sinclair/typebox@0.27.8': {}
'@stylistic/eslint-plugin-js@1.8.1(eslint@8.57.0)':
@@ -2333,6 +2619,8 @@ snapshots:
- supports-color
- typescript
+ '@types/argparse@1.0.38': {}
+
'@types/eslint@8.56.10':
dependencies:
'@types/estree': 1.0.5
@@ -2527,6 +2815,48 @@ snapshots:
loupe: 2.3.7
pretty-format: 29.7.0
+ '@volar/language-core@1.11.1':
+ dependencies:
+ '@volar/source-map': 1.11.1
+
+ '@volar/source-map@1.11.1':
+ dependencies:
+ muggle-string: 0.3.1
+
+ '@volar/typescript@1.11.1':
+ dependencies:
+ '@volar/language-core': 1.11.1
+ path-browserify: 1.0.1
+
+ '@vue/compiler-core@3.4.27':
+ dependencies:
+ '@babel/parser': 7.24.5
+ '@vue/shared': 3.4.27
+ entities: 4.5.0
+ estree-walker: 2.0.2
+ source-map-js: 1.2.0
+
+ '@vue/compiler-dom@3.4.27':
+ dependencies:
+ '@vue/compiler-core': 3.4.27
+ '@vue/shared': 3.4.27
+
+ '@vue/language-core@1.8.27(typescript@5.4.5)':
+ dependencies:
+ '@volar/language-core': 1.11.1
+ '@volar/source-map': 1.11.1
+ '@vue/compiler-dom': 3.4.27
+ '@vue/shared': 3.4.27
+ computeds: 0.0.1
+ minimatch: 9.0.4
+ muggle-string: 0.3.1
+ path-browserify: 1.0.1
+ vue-template-compiler: 2.7.16
+ optionalDependencies:
+ typescript: 5.4.5
+
+ '@vue/shared@3.4.27': {}
+
acorn-jsx@5.3.2(acorn@8.11.3):
dependencies:
acorn: 8.11.3
@@ -2565,6 +2895,10 @@ snapshots:
are-docs-informative@0.0.2: {}
+ argparse@1.0.10:
+ dependencies:
+ sprintf-js: 1.0.3
+
argparse@2.0.1: {}
array-buffer-byte-length@1.0.1:
@@ -2735,8 +3069,13 @@ snapshots:
commander@8.3.0: {}
+ commander@9.5.0:
+ optional: true
+
comment-parser@1.4.1: {}
+ computeds@0.0.1: {}
+
concat-map@0.0.1: {}
confbox@0.1.7: {}
@@ -2769,6 +3108,8 @@ snapshots:
es-errors: 1.3.0
is-data-view: 1.0.1
+ de-indent@1.0.2: {}
+
debug@3.2.7:
dependencies:
ms: 2.1.3
@@ -2816,6 +3157,8 @@ snapshots:
graceful-fs: 4.2.11
tapable: 2.2.1
+ entities@4.5.0: {}
+
error-ex@1.3.2:
dependencies:
is-arrayish: 0.2.1
@@ -3171,6 +3514,8 @@ snapshots:
estraverse@5.3.0: {}
+ estree-walker@2.0.2: {}
+
estree-walker@3.0.3:
dependencies:
'@types/estree': 1.0.5
@@ -3243,6 +3588,12 @@ snapshots:
jsonfile: 6.1.0
universalify: 2.0.1
+ fs-extra@7.0.1:
+ dependencies:
+ graceful-fs: 4.2.11
+ jsonfile: 4.0.0
+ universalify: 0.1.2
+
fs.realpath@1.0.0: {}
fsevents@2.3.3:
@@ -3348,6 +3699,8 @@ snapshots:
dependencies:
function-bind: 1.1.2
+ he@1.2.0: {}
+
hosted-git-info@2.8.9: {}
html-escaper@2.0.2: {}
@@ -3361,6 +3714,8 @@ snapshots:
parent-module: 1.0.1
resolve-from: 4.0.0
+ import-lazy@4.0.0: {}
+
imurmurhash@0.1.4: {}
indent-string@4.0.0: {}
@@ -3515,6 +3870,8 @@ snapshots:
reflect.getprototypeof: 1.0.6
set-function-name: 2.0.2
+ jju@1.4.0: {}
+
js-tokens@4.0.0: {}
js-tokens@9.0.0: {}
@@ -3537,6 +3894,10 @@ snapshots:
json-stable-stringify-without-jsonify@1.0.1: {}
+ jsonfile@4.0.0:
+ optionalDependencies:
+ graceful-fs: 4.2.11
+
jsonfile@6.1.0:
dependencies:
universalify: 2.0.1
@@ -3554,6 +3915,8 @@ snapshots:
dependencies:
json-buffer: 3.0.1
+ kolorist@1.8.0: {}
+
levn@0.4.1:
dependencies:
prelude-ls: 1.2.1
@@ -3574,8 +3937,14 @@ snapshots:
dependencies:
p-locate: 5.0.0
+ lodash.get@4.4.2: {}
+
+ lodash.isequal@4.5.0: {}
+
lodash.merge@4.6.2: {}
+ lodash@4.17.21: {}
+
loose-envify@1.4.0:
dependencies:
js-tokens: 4.0.0
@@ -3584,6 +3953,10 @@ snapshots:
dependencies:
get-func-name: 2.0.2
+ lru-cache@6.0.0:
+ dependencies:
+ yallist: 4.0.0
+
magic-string@0.30.10:
dependencies:
'@jridgewell/sourcemap-codec': 1.4.15
@@ -3611,6 +3984,10 @@ snapshots:
min-indent@1.0.1: {}
+ minimatch@3.0.8:
+ dependencies:
+ brace-expansion: 1.1.11
+
minimatch@3.1.2:
dependencies:
brace-expansion: 1.1.11
@@ -3634,6 +4011,8 @@ snapshots:
ms@2.1.3: {}
+ muggle-string@0.3.1: {}
+
nanoid@3.3.7: {}
natural-compare@1.4.0: {}
@@ -3745,6 +4124,8 @@ snapshots:
json-parse-even-better-errors: 2.3.1
lines-and-columns: 1.2.4
+ path-browserify@1.0.1: {}
+
path-exists@4.0.0: {}
path-is-absolute@1.0.1: {}
@@ -3858,6 +4239,11 @@ snapshots:
resolve-pkg-maps@1.0.0: {}
+ resolve@1.19.0:
+ dependencies:
+ is-core-module: 2.13.1
+ path-parse: 1.0.7
+
resolve@1.22.8:
dependencies:
is-core-module: 2.13.1
@@ -3876,6 +4262,10 @@ snapshots:
dependencies:
glob: 7.2.3
+ rollup-plugin-node-externals@7.1.2(rollup@4.17.2):
+ dependencies:
+ rollup: 4.17.2
+
rollup@4.17.2:
dependencies:
'@types/estree': 1.0.5
@@ -3925,6 +4315,10 @@ snapshots:
semver@6.3.1: {}
+ semver@7.5.4:
+ dependencies:
+ lru-cache: 6.0.0
+
semver@7.6.2: {}
set-function-length@1.2.2:
@@ -3964,6 +4358,8 @@ snapshots:
source-map-js@1.2.0: {}
+ source-map@0.6.1: {}
+
spdx-correct@3.2.0:
dependencies:
spdx-expression-parse: 3.0.1
@@ -3983,10 +4379,14 @@ snapshots:
spdx-license-ids@3.0.17: {}
+ sprintf-js@1.0.3: {}
+
stackback@0.0.2: {}
std-env@3.7.0: {}
+ string-argv@0.3.2: {}
+
string.prototype.matchall@4.0.11:
dependencies:
call-bind: 1.0.7
@@ -4045,6 +4445,10 @@ snapshots:
dependencies:
has-flag: 4.0.0
+ supports-color@8.1.1:
+ dependencies:
+ has-flag: 4.0.0
+
supports-preserve-symlinks-flag@1.0.0: {}
tapable@2.2.1: {}
@@ -4121,6 +4525,8 @@ snapshots:
is-typed-array: 1.1.13
possible-typed-array-names: 1.0.0
+ typescript@5.4.2: {}
+
typescript@5.4.5: {}
ufo@1.5.3: {}
@@ -4134,6 +4540,8 @@ snapshots:
undici-types@5.26.5: {}
+ universalify@0.1.2: {}
+
universalify@2.0.1: {}
update-browserslist-db@1.0.15(browserslist@4.23.0):
@@ -4151,6 +4559,8 @@ snapshots:
spdx-correct: 3.2.0
spdx-expression-parse: 3.0.1
+ validator@13.12.0: {}
+
vite-node@1.6.0(@types/node@20.12.11):
dependencies:
cac: 6.7.14
@@ -4168,7 +4578,7 @@ snapshots:
- supports-color
- terser
- vite-plugin-checker@0.6.4(eslint@8.57.0)(optionator@0.9.4)(typescript@5.4.5)(vite@5.2.11(@types/node@20.12.11)):
+ vite-plugin-checker@0.6.4(eslint@8.57.0)(optionator@0.9.4)(typescript@5.4.5)(vite@5.2.11(@types/node@20.12.11))(vue-tsc@1.8.27(typescript@5.4.5)):
dependencies:
'@babel/code-frame': 7.24.2
ansi-escapes: 4.3.2
@@ -4190,6 +4600,24 @@ snapshots:
eslint: 8.57.0
optionator: 0.9.4
typescript: 5.4.5
+ vue-tsc: 1.8.27(typescript@5.4.5)
+
+ vite-plugin-dts@3.9.1(@types/node@20.12.11)(rollup@4.17.2)(typescript@5.4.5)(vite@5.2.11(@types/node@20.12.11)):
+ dependencies:
+ '@microsoft/api-extractor': 7.43.0(@types/node@20.12.11)
+ '@rollup/pluginutils': 5.1.0(rollup@4.17.2)
+ '@vue/language-core': 1.8.27(typescript@5.4.5)
+ debug: 4.3.4
+ kolorist: 1.8.0
+ magic-string: 0.30.10
+ typescript: 5.4.5
+ vue-tsc: 1.8.27(typescript@5.4.5)
+ optionalDependencies:
+ vite: 5.2.11(@types/node@20.12.11)
+ transitivePeerDependencies:
+ - '@types/node'
+ - rollup
+ - supports-color
vite@5.2.11(@types/node@20.12.11):
dependencies:
@@ -4256,6 +4684,18 @@ snapshots:
vscode-uri@3.0.8: {}
+ vue-template-compiler@2.7.16:
+ dependencies:
+ de-indent: 1.0.2
+ he: 1.2.0
+
+ vue-tsc@1.8.27(typescript@5.4.5):
+ dependencies:
+ '@volar/typescript': 1.11.1
+ '@vue/language-core': 1.8.27(typescript@5.4.5)
+ semver: 7.6.2
+ typescript: 5.4.5
+
which-boxed-primitive@1.0.2:
dependencies:
is-bigint: 1.0.4
@@ -4307,6 +4747,16 @@ snapshots:
wrappy@1.0.2: {}
+ yallist@4.0.0: {}
+
yocto-queue@0.1.0: {}
yocto-queue@1.0.0: {}
+
+ z-schema@5.0.5:
+ dependencies:
+ lodash.get: 4.4.2
+ lodash.isequal: 4.5.0
+ validator: 13.12.0
+ optionalDependencies:
+ commander: 9.5.0
diff --git a/src/index.ts b/src/index.ts
index cb0ff5c..1ff8298 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1 +1,119 @@
-export {};
+import fs from 'node:fs/promises';
+import module from 'node:module';
+import path from 'node:path';
+
+import { type Plugin, type UserConfig } from 'vite';
+
+/**
+ * Vite plugin that configures sane defaults for building libraries.
+ */
+export const lib = (): Plugin => {
+ return {
+ name: 'vite-plugin-auto-lib',
+ async config(current) {
+ const root = current.root ?? process.cwd();
+ const pkg = await getPackage(root);
+
+ Object.assign(current, {
+ root,
+ build: {
+ target: 'esnext',
+ sourcemap: true,
+ ...current.build,
+ lib: {
+ formats: pkg?.type === 'module' ? ['es'] : ['cjs'],
+ fileName: '[name]',
+ entry: await getDefaultEntry(root),
+ ...current.build?.lib || {},
+ },
+ rollupOptions: {
+ treeshake: false,
+ external: getExternal(pkg),
+ ...current.build?.rollupOptions,
+ output: {
+ preserveModules: true,
+ ...current.build?.rollupOptions?.output,
+ },
+ },
+ },
+ } satisfies UserConfig);
+ },
+ };
+};
+
+export default lib;
+
+const ENTRY_PREFIXES = ['index', 'bin', 'main', 'src/index', 'src/bin', 'src/main'];
+const ENTRY_EXTENSIONS = ['ts', 'tsx', 'mts', 'cts', 'js', 'jsx', 'mjs', 'cjs'];
+const ENTRY_PATHS = ENTRY_PREFIXES.flatMap((prefix) => ENTRY_EXTENSIONS.map((ext) => `${prefix}.${ext}`));
+
+const getDefaultEntry = async (root: string): Promise => {
+ const results = await Promise.allSettled(ENTRY_PATHS.map(async (entry) => {
+ const filename = path.resolve(root, entry);
+
+ await fs.access(filename);
+
+ return filename;
+ }));
+
+ const entry = results
+ .filter((result): result is PromiseFulfilledResult => result.status === 'fulfilled')
+ .map((result) => result.value);
+
+ if (entry.length === 0) {
+ throw new Error('lib entry is required');
+ }
+
+ return entry;
+};
+
+const getPackage = async (dir: string): Promise => {
+ dir = path.resolve(dir);
+
+ try {
+ const txt = await fs.readFile(path.join(dir, 'package.json'), 'utf-8');
+ const pkg = JSON.parse(txt);
+
+ return pkg;
+ }
+ catch (error: any) {
+ if (error?.code !== 'ENOENT') {
+ throw error;
+ }
+
+ const nextDir = path.dirname(dir);
+
+ if (nextDir !== dir) {
+ return await getPackage(nextDir);
+ }
+ }
+
+ return {};
+};
+
+const getExternal = (pkg: any): (id: string) => boolean | void => {
+ const deps = Array.from(new Set([
+ ...Object.keys(pkg?.dependencies ?? {}),
+ ...Object.keys(pkg?.peerDependencies ?? {}),
+ ...Object.keys(pkg?.optionalDependencies ?? {}),
+ ]));
+
+ return (id) => {
+ if (module.isBuiltin(id)) {
+ // Node built-ins are external.
+ return true;
+ }
+
+ if (path.isAbsolute(id) || /^\.{1,2}\//u.test(id)) {
+ // ID is an absolute path or relative path.
+ if (/\.node(?:\?|$)/u.test(id)) {
+ // Node native modules are external.
+ return true;
+ }
+ }
+ else if (deps.some((dep) => dep === id || id.startsWith(`${dep}/`))) {
+ // Package production dependencies are external.
+ return true;
+ }
+ };
+};
diff --git a/vite.config.ts b/vite.config.ts
index cc42cf0..dee6a04 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,11 +1,7 @@
+import externals from 'rollup-plugin-node-externals';
import { defineConfig } from 'vite';
import { checker } from 'vite-plugin-checker';
-
-// import { lib } from 'vite-plugin-auto-lib';
-// import externals from 'rollup-plugin-node-externals';
-// import dts from 'vite-plugin-dts';
-// import { data } from 'vite-plugin-data';
-// import bin from 'vite-plugin-bin';
+import dts from 'vite-plugin-dts';
const TEST_GLOBS = ['**/*.{test|spec}.*', '**/__{tests|mocks}__'];
@@ -14,12 +10,23 @@ process.chdir(__dirname);
export default defineConfig({
plugins: [
checker({ typescript: true }),
- // lib(),
- // externals(),
- // dts({ entryRoot: 'src', logLevel: 'error', exclude: TEST_GLOBS }),
- // data(),
- // bin(),
+ externals(),
+ dts({ entryRoot: 'src', logLevel: 'error', exclude: TEST_GLOBS }),
],
+ build: {
+ target: 'esnext',
+ sourcemap: true,
+ minify: false,
+ lib: {
+ entry: 'src/index.ts',
+ fileName: '[name]',
+ formats: ['es'],
+ },
+ rollupOptions: {
+ treeshake: false,
+ output: { preserveModules: true },
+ },
+ },
test: {
reporters: ['verbose'],
setupFiles: 'vitest.setup.ts',