nitro 3.0.260311-beta → 3.0.260415-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_build/common.mjs +630 -1602
- package/dist/_build/rolldown.mjs +0 -11
- package/dist/_build/rollup.mjs +0 -13
- package/dist/_build/vite.build.mjs +0 -2
- package/dist/_chunks/nitro.mjs +23 -216
- package/dist/_chunks/nitro2.mjs +0 -2
- package/dist/_chunks/nitro3.mjs +128 -121
- package/dist/_chunks/nitro4.mjs +127 -0
- package/dist/_chunks/utils.mjs +0 -7
- package/dist/_common.mjs +0 -2
- package/dist/_dev.d.mts +0 -3
- package/dist/_dev.mjs +0 -10
- package/dist/_libs/_.mjs +0 -1
- package/dist/_libs/_3.mjs +0 -1
- package/dist/_libs/_5.mjs +0 -1
- package/dist/_libs/_6.mjs +0 -2
- package/dist/_libs/_7.mjs +0 -3
- package/dist/_libs/c12+rc9.mjs +24 -22
- package/dist/_libs/c12+readdirp+chokidar.d.mts +0 -7
- package/dist/_libs/citty.mjs +134 -31
- package/dist/_libs/commondir+is-reference.mjs +2 -9
- package/dist/_libs/compatx.d.mts +0 -2
- package/dist/_libs/compatx.mjs +0 -2
- package/dist/_libs/esbuild.d.mts +0 -1
- package/dist/_libs/escape-string-regexp.mjs +0 -2
- package/dist/_libs/estree+pluginutils.d.mts +0 -5
- package/dist/_libs/estree-walker.mjs +3 -88
- package/dist/_libs/hasown+resolve+deepmerge.mjs +22 -85
- package/dist/_libs/httpxy.d.mts +9 -5
- package/dist/_libs/httpxy.mjs +284 -116
- package/dist/_libs/klona.mjs +0 -2
- package/dist/_libs/magic-string.d.mts +0 -2
- package/dist/_libs/mlly.d.mts +0 -2
- package/dist/_libs/nypm+tinyexec.mjs +111 -134
- package/dist/_libs/perfect-debounce.mjs +0 -20
- package/dist/_libs/pkg-types.d.mts +0 -3
- package/dist/_libs/plugin-alias.mjs +0 -2
- package/dist/_libs/plugin-inject.mjs +0 -2
- package/dist/_libs/plugin-json.mjs +0 -2
- package/dist/_libs/pluginutils.mjs +0 -26
- package/dist/_libs/readdirp+chokidar.mjs +0 -173
- package/dist/_libs/remapping.mjs +0 -2
- package/dist/_libs/resolve-uri+gen-mapping.mjs +0 -32
- package/dist/_libs/rou3.d.mts +0 -4
- package/dist/_libs/rou3.mjs +0 -29
- package/dist/_libs/std-env.d.mts +1 -3
- package/dist/_libs/tsconfck.mjs +0 -294
- package/dist/_libs/ultrahtml.mjs +0 -2
- package/dist/_libs/unimport+unplugin.mjs +1 -44
- package/dist/_libs/unplugin+unimport.d.mts +0 -7
- package/dist/_libs/unwasm.d.mts +0 -3
- package/dist/_presets.mjs +211 -80
- package/dist/builder.d.mts +1 -22
- package/dist/builder.mjs +0 -11
- package/dist/cli/_chunks/build.mjs +0 -2
- package/dist/cli/_chunks/common.mjs +0 -2
- package/dist/cli/_chunks/deploy.mjs +0 -3
- package/dist/cli/_chunks/dev.mjs +0 -5
- package/dist/cli/_chunks/docs.mjs +1 -3
- package/dist/cli/_chunks/list.mjs +0 -2
- package/dist/cli/_chunks/prepare.mjs +0 -2
- package/dist/cli/_chunks/preview.mjs +1 -4
- package/dist/cli/_chunks/run.mjs +0 -2
- package/dist/cli/_chunks/task.mjs +0 -2
- package/dist/cli/index.mjs +0 -2
- package/{skills/nitro/docs/docs/quick-start.md → dist/docs/0.docs/1.quick-start.md} +4 -4
- package/{skills/nitro/docs/docs/lifecycle.md → dist/docs/0.docs/10.lifecycle.md} +4 -4
- package/dist/docs/0.docs/11.openapi.md +291 -0
- package/{skills/nitro/docs/docs/plugins.md → dist/docs/0.docs/12.plugins.md} +2 -2
- package/{skills/nitro/docs/docs/tasks.md → dist/docs/0.docs/13.tasks.md} +6 -6
- package/dist/docs/0.docs/14.websocket.md +386 -0
- package/{skills/nitro/docs/docs/migration.md → dist/docs/0.docs/15.migration.md} +2 -4
- package/{skills/nitro/docs/docs/renderer.md → dist/docs/0.docs/2.renderer.md} +8 -8
- package/{skills/nitro/docs/docs/routing.md → dist/docs/0.docs/3.routing.md} +34 -34
- package/{skills/nitro/docs/docs/server-entry.md → dist/docs/0.docs/4.server-entry.md} +6 -6
- package/{skills/nitro/docs/docs/cache.md → dist/docs/0.docs/5.cache.md} +12 -12
- package/{skills/nitro/docs/docs/storage.md → dist/docs/0.docs/6.storage.md} +6 -6
- package/{skills/nitro/docs/docs/assets.md → dist/docs/0.docs/7.assets.md} +8 -8
- package/{skills/nitro/docs/docs/configuration.md → dist/docs/0.docs/8.configuration.md} +16 -16
- package/{skills/nitro/docs/docs/database.md → dist/docs/0.docs/9.database.md} +6 -6
- package/{skills/nitro/docs/deploy → dist/docs/1.deploy/0.index}/index.md +3 -3
- package/{skills/nitro/docs/deploy/providers/aws.md → dist/docs/1.deploy/2.providers/1.aws.md} +4 -4
- package/{skills/nitro/docs/deploy/providers/iis.md → dist/docs/1.deploy/2.providers/15.iis.md} +2 -2
- package/{skills/nitro/docs/deploy/providers/aws-amplify.md → dist/docs/1.deploy/2.providers/2.aws-amplify.md} +2 -2
- package/{skills/nitro/docs/deploy/providers/vercel.md → dist/docs/1.deploy/2.providers/21.vercel.md} +98 -7
- package/{skills/nitro/docs/deploy/providers/zephyr.md → dist/docs/1.deploy/2.providers/23.zephyr.md} +2 -2
- package/{skills/nitro/docs/deploy/providers/cloudflare.md → dist/docs/1.deploy/2.providers/5.cloudflare.md} +9 -15
- package/dist/docs/1.deploy/2.providers/8.edgeone.md +20 -0
- package/{skills/nitro/docs/config → dist/docs/2.config/0.index}/index.md +165 -91
- package/{skills/nitro/docs/examples/hono.md → dist/docs/3.examples/10.hono.md} +1 -1
- package/{skills/nitro/docs/examples/import-alias.md → dist/docs/3.examples/11.import-alias.md} +1 -4
- package/{skills/nitro/docs/examples/mono-jsx.md → dist/docs/3.examples/13.mono-jsx.md} +2 -2
- package/{skills/nitro/docs/examples/plugins.md → dist/docs/3.examples/15.plugins.md} +4 -4
- package/{skills/nitro/docs/examples/shiki.md → dist/docs/3.examples/19.shiki.md} +1 -1
- package/{skills/nitro/docs/examples/auto-imports.md → dist/docs/3.examples/2.auto-imports.md} +0 -1
- package/{skills/nitro/docs/examples/vite-nitro-plugin.md → dist/docs/3.examples/21.vite-nitro-plugin.md} +1 -1
- package/{skills/nitro/docs/examples/vite-rsc.md → dist/docs/3.examples/22.vite-rsc.md} +4 -4
- package/{skills/nitro/docs/examples/vite-ssr-html.md → dist/docs/3.examples/23.vite-ssr-html.md} +3 -3
- package/{skills/nitro/docs/examples/vite-ssr-preact.md → dist/docs/3.examples/24.vite-ssr-preact.md} +6 -6
- package/{skills/nitro/docs/examples/vite-ssr-react.md → dist/docs/3.examples/25.vite-ssr-react.md} +3 -3
- package/{skills/nitro/docs/examples/vite-ssr-solid.md → dist/docs/3.examples/26.vite-ssr-solid.md} +3 -3
- package/{skills/nitro/docs/examples/vite-ssr-tsr-react.md → dist/docs/3.examples/27.vite-ssr-tsr-react.md} +6 -6
- package/{skills/nitro/docs/examples/vite-ssr-tss-react.md → dist/docs/3.examples/28.vite-ssr-tss-react.md} +11 -11
- package/{skills/nitro/docs/examples/vite-ssr-vue-router.md → dist/docs/3.examples/29.vite-ssr-vue-router.md} +6 -5
- package/{skills/nitro/docs/examples/vite-trpc.md → dist/docs/3.examples/30.vite-trpc.md} +3 -3
- package/{skills/nitro/docs/examples/elysia.md → dist/docs/3.examples/6.elysia.md} +1 -1
- package/{skills/nitro/docs/examples/fastify.md → dist/docs/3.examples/8.fastify.md} +1 -1
- package/dist/docs/README.md +86 -0
- package/dist/node_modules/@speed-highlight/core/dist/index.js +4 -4
- package/dist/node_modules/@speed-highlight/core/dist/terminal.js +2 -2
- package/dist/node_modules/@speed-highlight/core/package.json +1 -1
- package/dist/node_modules/cookie-es/dist/index.mjs +299 -250
- package/dist/node_modules/cookie-es/package.json +26 -23
- package/dist/node_modules/defu/dist/defu.mjs +2 -2
- package/dist/node_modules/defu/package.json +33 -28
- package/dist/node_modules/rendu/dist/_chunks/libs/cookie-es.mjs +151 -0
- package/dist/node_modules/rendu/dist/index.mjs +5 -112
- package/dist/node_modules/rendu/package.json +25 -24
- package/dist/node_modules/youch/package.json +2 -2
- package/dist/presets/_nitro/runtime/nitro-dev.mjs +3 -1
- package/dist/presets/_nitro/runtime/service-worker.mjs +1 -1
- package/dist/presets/aws-lambda/runtime/_utils.mjs +6 -6
- package/dist/presets/azure/runtime/_utils.mjs +5 -5
- package/dist/presets/azure/runtime/azure-swa.mjs +5 -5
- package/dist/presets/bun/runtime/bun.mjs +5 -3
- package/dist/presets/cloudflare/runtime/_module-handler.mjs +1 -1
- package/dist/presets/cloudflare/runtime/cloudflare-durable.mjs +4 -4
- package/dist/presets/cloudflare/runtime/cloudflare-module.mjs +3 -3
- package/dist/presets/cloudflare/runtime/cloudflare-pages.mjs +2 -2
- package/dist/presets/cloudflare/runtime/plugin.dev.mjs +10 -21
- package/dist/presets/deno/runtime/deno-deploy.mjs +4 -4
- package/dist/presets/deno/runtime/deno-server.mjs +5 -3
- package/dist/presets/edgeone/runtime/edgeone.mjs +10 -0
- package/dist/presets/netlify/runtime/netlify-edge.mjs +2 -2
- package/dist/presets/node/runtime/node-cluster.mjs +2 -2
- package/dist/presets/node/runtime/node-middleware.mjs +1 -1
- package/dist/presets/node/runtime/node-server.mjs +5 -3
- package/dist/presets/stormkit/runtime/stormkit.mjs +1 -1
- package/dist/presets/vercel/runtime/cron-handler.mjs +1 -1
- package/dist/presets/vercel/runtime/queue-handler.mjs +21 -0
- package/dist/presets/vercel/runtime/vercel.node.mjs +3 -3
- package/dist/presets/vercel/runtime/vercel.web.mjs +1 -1
- package/dist/presets/winterjs/runtime/winterjs.mjs +10 -10
- package/dist/runtime/internal/app.mjs +12 -11
- package/dist/runtime/internal/context.mjs +1 -9
- package/dist/runtime/internal/error/dev.mjs +10 -10
- package/dist/runtime/internal/route-rules.d.mts +3 -1
- package/dist/runtime/internal/route-rules.mjs +9 -7
- package/dist/runtime/internal/routes/dev-tasks.mjs +13 -12
- package/dist/runtime/internal/routes/openapi.mjs +2 -2
- package/dist/runtime/internal/routes/scalar.mjs +3 -3
- package/dist/runtime/internal/routes/swagger.mjs +7 -4
- package/dist/runtime/internal/runtime-config.mjs +2 -2
- package/dist/runtime/internal/task.mjs +5 -5
- package/dist/runtime/meta.d.mts +1 -0
- package/dist/runtime/meta.mjs +1 -0
- package/dist/runtime/nitro.mjs +3 -3
- package/dist/runtime/virtual/renderer-template.mjs +1 -1
- package/dist/runtime/virtual/tracing.d.mts +5 -0
- package/dist/runtime/virtual/tracing.mjs +1 -0
- package/dist/types/index.d.mts +155 -86
- package/dist/vite.d.mts +0 -5
- package/dist/vite.mjs +57 -28
- package/lib/tsconfig.json +3 -5
- package/package.json +56 -54
- package/skills/nitro/SKILL.md +0 -10
- package/skills/nitro/docs/TOC.md +0 -83
- package/skills/nitro/docs/_navigation.json +0 -679
- /package/{skills/nitro/docs/docs → dist/docs/0.docs/0.index}/index.md +0 -0
- /package/{skills/nitro/docs/docs/nightly.md → dist/docs/0.docs/16.nightly.md} +0 -0
- /package/{skills/nitro/docs/deploy/runtimes/node.md → dist/docs/1.deploy/1.runtimes/0.node.md} +0 -0
- /package/{skills/nitro/docs/deploy/runtimes/bun.md → dist/docs/1.deploy/1.runtimes/1.bun.md} +0 -0
- /package/{skills/nitro/docs/deploy/runtimes/deno.md → dist/docs/1.deploy/1.runtimes/2.deno.md} +0 -0
- /package/{skills/nitro/docs/deploy/providers/alwaysdata.md → dist/docs/1.deploy/2.providers/0.alwaysdata.md} +0 -0
- /package/{skills/nitro/docs/deploy/providers/flightcontrol.md → dist/docs/1.deploy/2.providers/10.flightcontrol.md} +0 -0
- /package/{skills/nitro/docs/deploy/providers/genezio.md → dist/docs/1.deploy/2.providers/11.genezio.md} +0 -0
- /package/{skills/nitro/docs/deploy/providers/github-pages.md → dist/docs/1.deploy/2.providers/12.github-pages.md} +0 -0
- /package/{skills/nitro/docs/deploy/providers/gitlab-pages.md → dist/docs/1.deploy/2.providers/13.gitlab-pages.md} +0 -0
- /package/{skills/nitro/docs/deploy/providers/heroku.md → dist/docs/1.deploy/2.providers/14.heroku.md} +0 -0
- /package/{skills/nitro/docs/deploy/providers/koyeb.md → dist/docs/1.deploy/2.providers/16.koyeb.md} +0 -0
- /package/{skills/nitro/docs/deploy/providers/netlify.md → dist/docs/1.deploy/2.providers/17.netlify.md} +0 -0
- /package/{skills/nitro/docs/deploy/providers/platform-sh.md → dist/docs/1.deploy/2.providers/18.platform-sh.md} +0 -0
- /package/{skills/nitro/docs/deploy/providers/render.md → dist/docs/1.deploy/2.providers/19.render.md} +0 -0
- /package/{skills/nitro/docs/deploy/providers/stormkit.md → dist/docs/1.deploy/2.providers/20.stormkit.md} +0 -0
- /package/{skills/nitro/docs/deploy/providers/zeabur.md → dist/docs/1.deploy/2.providers/22.zeabur.md} +0 -0
- /package/{skills/nitro/docs/deploy/providers/zerops.md → dist/docs/1.deploy/2.providers/24.zerops.md} +0 -0
- /package/{skills/nitro/docs/deploy/providers/azure.md → dist/docs/1.deploy/2.providers/3.azure.md} +0 -0
- /package/{skills/nitro/docs/deploy/providers/cleavr.md → dist/docs/1.deploy/2.providers/4.cleavr.md} +0 -0
- /package/{skills/nitro/docs/deploy/providers/deno-deploy.md → dist/docs/1.deploy/2.providers/6.deno-deploy.md} +0 -0
- /package/{skills/nitro/docs/deploy/providers/digitalocean.md → dist/docs/1.deploy/2.providers/7.digitalocean.md} +0 -0
- /package/{skills/nitro/docs/deploy/providers/firebase.md → dist/docs/1.deploy/2.providers/9.firebase.md} +0 -0
- /package/{skills/nitro/docs/examples → dist/docs/3.examples/0.index}/index.md +0 -0
- /package/{skills/nitro/docs/examples/api-routes.md → dist/docs/3.examples/1.api-routes.md} +0 -0
- /package/{skills/nitro/docs/examples/middleware.md → dist/docs/3.examples/12.middleware.md} +0 -0
- /package/{skills/nitro/docs/examples/nano-jsx.md → dist/docs/3.examples/14.nano-jsx.md} +0 -0
- /package/{skills/nitro/docs/examples/renderer.md → dist/docs/3.examples/16.renderer.md} +0 -0
- /package/{skills/nitro/docs/examples/runtime-config.md → dist/docs/3.examples/17.runtime-config.md} +0 -0
- /package/{skills/nitro/docs/examples/server-fetch.md → dist/docs/3.examples/18.server-fetch.md} +0 -0
- /package/{skills/nitro/docs/examples/virtual-routes.md → dist/docs/3.examples/20.virtual-routes.md} +0 -0
- /package/{skills/nitro/docs/examples/cached-handler.md → dist/docs/3.examples/3.cached-handler.md} +0 -0
- /package/{skills/nitro/docs/examples/websocket.md → dist/docs/3.examples/31.websocket.md} +0 -0
- /package/{skills/nitro/docs/examples/custom-error-handler.md → dist/docs/3.examples/4.custom-error-handler.md} +0 -0
- /package/{skills/nitro/docs/examples/database.md → dist/docs/3.examples/5.database.md} +0 -0
- /package/{skills/nitro/docs/examples/express.md → dist/docs/3.examples/7.express.md} +0 -0
- /package/{skills/nitro/docs/examples/hello-world.md → dist/docs/3.examples/9.hello-world.md} +0 -0
- /package/{skills/nitro → dist}/docs/index.md +0 -0
package/dist/_libs/tsconfck.mjs
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import fs, { promises } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { createRequire } from "module";
|
|
4
|
-
//#region node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.3/node_modules/tsconfck/src/util.js
|
|
5
4
|
const POSIX_SEP_RE = new RegExp("\\" + path.posix.sep, "g");
|
|
6
5
|
const NATIVE_SEP_RE = new RegExp("\\" + path.sep, "g");
|
|
7
|
-
/** @type {Map<string,RegExp>}*/
|
|
8
6
|
const PATTERN_REGEX_CACHE = /* @__PURE__ */ new Map();
|
|
9
7
|
const GLOB_ALL_PATTERN = `**/*`;
|
|
10
8
|
const TS_EXTENSIONS = [
|
|
@@ -22,10 +20,6 @@ const TSJS_EXTENSIONS = TS_EXTENSIONS.concat([
|
|
|
22
20
|
const TS_EXTENSIONS_RE_GROUP = `\\.(?:${TS_EXTENSIONS.map((ext) => ext.substring(1)).join("|")})`;
|
|
23
21
|
const TSJS_EXTENSIONS_RE_GROUP = `\\.(?:${TSJS_EXTENSIONS.map((ext) => ext.substring(1)).join("|")})`;
|
|
24
22
|
const IS_POSIX = path.posix.sep === path.sep;
|
|
25
|
-
/**
|
|
26
|
-
* @template T
|
|
27
|
-
* @returns {{resolve:(result:T)=>void, reject:(error:any)=>void, promise: Promise<T>}}
|
|
28
|
-
*/
|
|
29
23
|
function makePromise() {
|
|
30
24
|
let resolve, reject;
|
|
31
25
|
return {
|
|
@@ -37,11 +31,6 @@ function makePromise() {
|
|
|
37
31
|
reject
|
|
38
32
|
};
|
|
39
33
|
}
|
|
40
|
-
/**
|
|
41
|
-
* @param {string} filename
|
|
42
|
-
* @param {import('./cache.js').TSConfckCache} [cache]
|
|
43
|
-
* @returns {Promise<string|void>}
|
|
44
|
-
*/
|
|
45
34
|
async function resolveTSConfigJson(filename, cache) {
|
|
46
35
|
if (path.extname(filename) !== ".json") return;
|
|
47
36
|
const tsconfig = path.resolve(filename);
|
|
@@ -51,61 +40,16 @@ async function resolveTSConfigJson(filename, cache) {
|
|
|
51
40
|
else throw new Error(`${filename} exists but is not a regular file.`);
|
|
52
41
|
});
|
|
53
42
|
}
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
* @param {string} dir an absolute directory path
|
|
57
|
-
* @returns {boolean} if dir path includes a node_modules segment
|
|
58
|
-
*/
|
|
59
43
|
const isInNodeModules = IS_POSIX ? (dir) => dir.includes("/node_modules/") : (dir) => dir.match(/[/\\]node_modules[/\\]/);
|
|
60
|
-
/**
|
|
61
|
-
* convert posix separator to native separator
|
|
62
|
-
*
|
|
63
|
-
* eg.
|
|
64
|
-
* windows: C:/foo/bar -> c:\foo\bar
|
|
65
|
-
* linux: /foo/bar -> /foo/bar
|
|
66
|
-
*
|
|
67
|
-
* @param {string} filename with posix separators
|
|
68
|
-
* @returns {string} filename with native separators
|
|
69
|
-
*/
|
|
70
44
|
const posix2native = IS_POSIX ? (filename) => filename : (filename) => filename.replace(POSIX_SEP_RE, path.sep);
|
|
71
|
-
/**
|
|
72
|
-
* convert native separator to posix separator
|
|
73
|
-
*
|
|
74
|
-
* eg.
|
|
75
|
-
* windows: C:\foo\bar -> c:/foo/bar
|
|
76
|
-
* linux: /foo/bar -> /foo/bar
|
|
77
|
-
*
|
|
78
|
-
* @param {string} filename - filename with native separators
|
|
79
|
-
* @returns {string} filename with posix separators
|
|
80
|
-
*/
|
|
81
45
|
const native2posix = IS_POSIX ? (filename) => filename : (filename) => filename.replace(NATIVE_SEP_RE, path.posix.sep);
|
|
82
|
-
/**
|
|
83
|
-
* converts params to native separator, resolves path and converts native back to posix
|
|
84
|
-
*
|
|
85
|
-
* needed on windows to handle posix paths in tsconfig
|
|
86
|
-
*
|
|
87
|
-
* @param dir {string|null} directory to resolve from
|
|
88
|
-
* @param filename {string} filename or pattern to resolve
|
|
89
|
-
* @returns string
|
|
90
|
-
*/
|
|
91
46
|
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)));
|
|
92
|
-
/**
|
|
93
|
-
*
|
|
94
|
-
* @param {import('./public.d.ts').TSConfckParseResult} result
|
|
95
|
-
* @param {import('./public.d.ts').TSConfckParseOptions} [options]
|
|
96
|
-
* @returns {string[]}
|
|
97
|
-
*/
|
|
98
47
|
function resolveReferencedTSConfigFiles(result, options) {
|
|
99
48
|
const dir = path.dirname(result.tsconfigFile);
|
|
100
49
|
return result.tsconfig.references.map((ref) => {
|
|
101
50
|
return resolve2posix(dir, ref.path.endsWith(".json") ? ref.path : path.join(ref.path, options?.configName ?? "tsconfig.json"));
|
|
102
51
|
});
|
|
103
52
|
}
|
|
104
|
-
/**
|
|
105
|
-
* @param {string} filename
|
|
106
|
-
* @param {import('./public.d.ts').TSConfckParseResult} result
|
|
107
|
-
* @returns {import('./public.d.ts').TSConfckParseResult}
|
|
108
|
-
*/
|
|
109
53
|
function resolveSolutionTSConfig(filename, result) {
|
|
110
54
|
const extensions = result.tsconfig.compilerOptions?.allowJs ? TSJS_EXTENSIONS : TS_EXTENSIONS;
|
|
111
55
|
if (result.referenced && extensions.some((ext) => filename.endsWith(ext)) && !isIncluded(filename, result)) {
|
|
@@ -114,12 +58,6 @@ function resolveSolutionTSConfig(filename, result) {
|
|
|
114
58
|
}
|
|
115
59
|
return result;
|
|
116
60
|
}
|
|
117
|
-
/**
|
|
118
|
-
*
|
|
119
|
-
* @param {string} filename
|
|
120
|
-
* @param {import('./public.d.ts').TSConfckParseResult} result
|
|
121
|
-
* @returns {boolean}
|
|
122
|
-
*/
|
|
123
61
|
function isIncluded(filename, result) {
|
|
124
62
|
const dir = native2posix(path.dirname(result.tsconfigFile));
|
|
125
63
|
const files = (result.tsconfig.files || []).map((file) => resolve2posix(dir, file));
|
|
@@ -129,15 +67,6 @@ function isIncluded(filename, result) {
|
|
|
129
67
|
if (isGlobMatch(absoluteFilename, dir, result.tsconfig.include || (result.tsconfig.files ? [] : [GLOB_ALL_PATTERN]), allowJs)) return !isGlobMatch(absoluteFilename, dir, result.tsconfig.exclude || [], allowJs);
|
|
130
68
|
return false;
|
|
131
69
|
}
|
|
132
|
-
/**
|
|
133
|
-
* test filenames agains glob patterns in tsconfig
|
|
134
|
-
*
|
|
135
|
-
* @param filename {string} posix style abolute path to filename to test
|
|
136
|
-
* @param dir {string} posix style absolute path to directory of tsconfig containing patterns
|
|
137
|
-
* @param patterns {string[]} glob patterns to match against
|
|
138
|
-
* @param allowJs {boolean} allowJs setting in tsconfig to include js extensions in checks
|
|
139
|
-
* @returns {boolean} true when at least one pattern matches filename
|
|
140
|
-
*/
|
|
141
70
|
function isGlobMatch(filename, dir, patterns, allowJs) {
|
|
142
71
|
const extensions = allowJs ? TSJS_EXTENSIONS : TS_EXTENSIONS;
|
|
143
72
|
return patterns.some((pattern) => {
|
|
@@ -187,11 +116,6 @@ function isGlobMatch(filename, dir, patterns, allowJs) {
|
|
|
187
116
|
return regex.test(filename);
|
|
188
117
|
});
|
|
189
118
|
}
|
|
190
|
-
/**
|
|
191
|
-
* @param {string} resolvedPattern
|
|
192
|
-
* @param {boolean} allowJs
|
|
193
|
-
* @returns {RegExp}
|
|
194
|
-
*/
|
|
195
119
|
function pattern2regex(resolvedPattern, allowJs) {
|
|
196
120
|
let regexStr = "^";
|
|
197
121
|
for (let i = 0; i < resolvedPattern.length; i++) {
|
|
@@ -216,22 +140,9 @@ function pattern2regex(resolvedPattern, allowJs) {
|
|
|
216
140
|
regexStr += "$";
|
|
217
141
|
return new RegExp(regexStr);
|
|
218
142
|
}
|
|
219
|
-
/**
|
|
220
|
-
* replace tokens like ${configDir}
|
|
221
|
-
* @param {import('./public.d.ts').TSConfckParseResult} result
|
|
222
|
-
*/
|
|
223
143
|
function replaceTokens(result) {
|
|
224
144
|
if (result.tsconfig) result.tsconfig = JSON.parse(JSON.stringify(result.tsconfig).replaceAll(/"\${configDir}/g, `"${native2posix(path.dirname(result.tsconfigFile))}`));
|
|
225
145
|
}
|
|
226
|
-
//#endregion
|
|
227
|
-
//#region node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.3/node_modules/tsconfck/src/find.js
|
|
228
|
-
/**
|
|
229
|
-
* find the closest tsconfig.json file
|
|
230
|
-
*
|
|
231
|
-
* @param {string} filename - path to file to find tsconfig for (absolute or relative to cwd)
|
|
232
|
-
* @param {import('./public.d.ts').TSConfckFindOptions} [options] - options
|
|
233
|
-
* @returns {Promise<string|null>} absolute path to closest tsconfig.json or null if not found
|
|
234
|
-
*/
|
|
235
146
|
async function find(filename, options) {
|
|
236
147
|
let dir = path.dirname(path.resolve(filename));
|
|
237
148
|
if (options?.ignoreNodeModules && isInNodeModules(dir)) return null;
|
|
@@ -247,12 +158,6 @@ async function find(filename, options) {
|
|
|
247
158
|
}, options);
|
|
248
159
|
return promise;
|
|
249
160
|
}
|
|
250
|
-
/**
|
|
251
|
-
*
|
|
252
|
-
* @param {string} dir
|
|
253
|
-
* @param {{promise:Promise<string|null>,resolve:(result:string|null)=>void,reject:(err:any)=>void}} madePromise
|
|
254
|
-
* @param {import('./public.d.ts').TSConfckFindOptions} [options] - options
|
|
255
|
-
*/
|
|
256
161
|
function findUp(dir, { resolve, reject, promise }, options) {
|
|
257
162
|
const { cache, root, configName } = options ?? {};
|
|
258
163
|
if (cache) if (cache.hasConfigPath(dir, configName)) {
|
|
@@ -282,26 +187,11 @@ function findUp(dir, { resolve, reject, promise }, options) {
|
|
|
282
187
|
});
|
|
283
188
|
}
|
|
284
189
|
path.sep;
|
|
285
|
-
//#endregion
|
|
286
|
-
//#region node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.3/node_modules/tsconfck/src/to-json.js
|
|
287
|
-
/**
|
|
288
|
-
* convert content of tsconfig.json to regular json
|
|
289
|
-
*
|
|
290
|
-
* @param {string} tsconfigJson - content of tsconfig.json
|
|
291
|
-
* @returns {string} content as regular json, comments and dangling commas have been replaced with whitespace
|
|
292
|
-
*/
|
|
293
190
|
function toJson(tsconfigJson) {
|
|
294
191
|
const stripped = stripDanglingComma(stripJsonComments(stripBom(tsconfigJson)));
|
|
295
192
|
if (stripped.trim() === "") return "{}";
|
|
296
193
|
else return stripped;
|
|
297
194
|
}
|
|
298
|
-
/**
|
|
299
|
-
* replace dangling commas from pseudo-json string with single space
|
|
300
|
-
* implementation heavily inspired by strip-json-comments
|
|
301
|
-
*
|
|
302
|
-
* @param {string} pseudoJson
|
|
303
|
-
* @returns {string}
|
|
304
|
-
*/
|
|
305
195
|
function stripDanglingComma(pseudoJson) {
|
|
306
196
|
let insideString = false;
|
|
307
197
|
let offset = 0;
|
|
@@ -330,12 +220,6 @@ function stripDanglingComma(pseudoJson) {
|
|
|
330
220
|
}
|
|
331
221
|
return result + pseudoJson.substring(offset);
|
|
332
222
|
}
|
|
333
|
-
/**
|
|
334
|
-
*
|
|
335
|
-
* @param {string} jsonString
|
|
336
|
-
* @param {number} quotePosition
|
|
337
|
-
* @returns {boolean}
|
|
338
|
-
*/
|
|
339
223
|
function isEscaped(jsonString, quotePosition) {
|
|
340
224
|
let index = quotePosition - 1;
|
|
341
225
|
let backslashCount = 0;
|
|
@@ -345,24 +229,13 @@ function isEscaped(jsonString, quotePosition) {
|
|
|
345
229
|
}
|
|
346
230
|
return Boolean(backslashCount % 2);
|
|
347
231
|
}
|
|
348
|
-
/**
|
|
349
|
-
*
|
|
350
|
-
* @param {string} string
|
|
351
|
-
* @param {number?} start
|
|
352
|
-
* @param {number?} end
|
|
353
|
-
*/
|
|
354
232
|
function strip(string, start, end) {
|
|
355
233
|
return string.slice(start, end).replace(/\S/g, " ");
|
|
356
234
|
}
|
|
357
235
|
const singleComment = Symbol("singleComment");
|
|
358
236
|
const multiComment = Symbol("multiComment");
|
|
359
|
-
/**
|
|
360
|
-
* @param {string} jsonString
|
|
361
|
-
* @returns {string}
|
|
362
|
-
*/
|
|
363
237
|
function stripJsonComments(jsonString) {
|
|
364
238
|
let isInsideString = false;
|
|
365
|
-
/** @type {false | symbol} */
|
|
366
239
|
let isInsideComment = false;
|
|
367
240
|
let offset = 0;
|
|
368
241
|
let result = "";
|
|
@@ -401,30 +274,15 @@ function stripJsonComments(jsonString) {
|
|
|
401
274
|
}
|
|
402
275
|
return result + (isInsideComment ? strip(jsonString.slice(offset)) : jsonString.slice(offset));
|
|
403
276
|
}
|
|
404
|
-
/**
|
|
405
|
-
* @param {string} string
|
|
406
|
-
* @returns {string}
|
|
407
|
-
*/
|
|
408
277
|
function stripBom(string) {
|
|
409
278
|
if (string.charCodeAt(0) === 65279) return string.slice(1);
|
|
410
279
|
return string;
|
|
411
280
|
}
|
|
412
|
-
//#endregion
|
|
413
|
-
//#region node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.3/node_modules/tsconfck/src/parse.js
|
|
414
281
|
const not_found_result = {
|
|
415
282
|
tsconfigFile: null,
|
|
416
283
|
tsconfig: {}
|
|
417
284
|
};
|
|
418
|
-
/**
|
|
419
|
-
* parse the closest tsconfig.json file
|
|
420
|
-
*
|
|
421
|
-
* @param {string} filename - path to a tsconfig .json or a source file or directory (absolute or relative to cwd)
|
|
422
|
-
* @param {import('./public.d.ts').TSConfckParseOptions} [options] - options
|
|
423
|
-
* @returns {Promise<import('./public.d.ts').TSConfckParseResult>}
|
|
424
|
-
* @throws {TSConfckParseError}
|
|
425
|
-
*/
|
|
426
285
|
async function parse(filename, options) {
|
|
427
|
-
/** @type {import('./cache.js').TSConfckCache} */
|
|
428
286
|
const cache = options?.cache;
|
|
429
287
|
if (cache?.hasParseResult(filename)) return getParsedDeep(filename, cache, options);
|
|
430
288
|
const { resolve, reject, promise } = makePromise();
|
|
@@ -448,13 +306,6 @@ async function parse(filename, options) {
|
|
|
448
306
|
}
|
|
449
307
|
return promise;
|
|
450
308
|
}
|
|
451
|
-
/**
|
|
452
|
-
* ensure extends and references are parsed
|
|
453
|
-
*
|
|
454
|
-
* @param {string} filename - cached file
|
|
455
|
-
* @param {import('./cache.js').TSConfckCache} cache - cache
|
|
456
|
-
* @param {import('./public.d.ts').TSConfckParseOptions} options - options
|
|
457
|
-
*/
|
|
458
309
|
async function getParsedDeep(filename, cache, options) {
|
|
459
310
|
const result = await cache.getParseResult(filename);
|
|
460
311
|
if (result.tsconfig.extends && !result.extended || result.tsconfig.references && !result.referenced) {
|
|
@@ -464,13 +315,6 @@ async function getParsedDeep(filename, cache, options) {
|
|
|
464
315
|
}
|
|
465
316
|
return result;
|
|
466
317
|
}
|
|
467
|
-
/**
|
|
468
|
-
*
|
|
469
|
-
* @param {string} tsconfigFile - path to tsconfig file
|
|
470
|
-
* @param {import('./cache.js').TSConfckCache} [cache] - cache
|
|
471
|
-
* @param {boolean} [skipCache] - skip cache
|
|
472
|
-
* @returns {Promise<import('./public.d.ts').TSConfckParseResult>}
|
|
473
|
-
*/
|
|
474
318
|
async function parseFile(tsconfigFile, cache, skipCache) {
|
|
475
319
|
if (!skipCache && cache?.hasParseResult(tsconfigFile) && !cache.getParseResult(tsconfigFile)._isRootFile_) return cache.getParseResult(tsconfigFile);
|
|
476
320
|
const promise = promises.readFile(tsconfigFile, "utf-8").then(toJson).then((json) => {
|
|
@@ -486,23 +330,11 @@ async function parseFile(tsconfigFile, cache, skipCache) {
|
|
|
486
330
|
if (!skipCache && (!cache?.hasParseResult(tsconfigFile) || !cache.getParseResult(tsconfigFile)._isRootFile_)) cache?.setParseResult(tsconfigFile, promise);
|
|
487
331
|
return promise;
|
|
488
332
|
}
|
|
489
|
-
/**
|
|
490
|
-
* normalize to match the output of ts.parseJsonConfigFileContent
|
|
491
|
-
*
|
|
492
|
-
* @param {any} tsconfig - typescript tsconfig output
|
|
493
|
-
* @param {string} dir - directory
|
|
494
|
-
*/
|
|
495
333
|
function normalizeTSConfig(tsconfig, dir) {
|
|
496
334
|
const baseUrl = tsconfig.compilerOptions?.baseUrl;
|
|
497
335
|
if (baseUrl && !baseUrl.startsWith("${") && !path.isAbsolute(baseUrl)) tsconfig.compilerOptions.baseUrl = resolve2posix(dir, baseUrl);
|
|
498
336
|
return tsconfig;
|
|
499
337
|
}
|
|
500
|
-
/**
|
|
501
|
-
*
|
|
502
|
-
* @param {import('./public.d.ts').TSConfckParseResult} result
|
|
503
|
-
* @param {import('./public.d.ts').TSConfckParseOptions} [options]
|
|
504
|
-
* @returns {Promise<void>}
|
|
505
|
-
*/
|
|
506
338
|
async function parseReferences(result, options) {
|
|
507
339
|
if (!result.tsconfig.references) return;
|
|
508
340
|
const referencedFiles = resolveReferencedTSConfigFiles(result, options);
|
|
@@ -514,20 +346,13 @@ async function parseReferences(result, options) {
|
|
|
514
346
|
});
|
|
515
347
|
result.referenced = referenced;
|
|
516
348
|
}
|
|
517
|
-
/**
|
|
518
|
-
* @param {import('./public.d.ts').TSConfckParseResult} result
|
|
519
|
-
* @param {import('./cache.js').TSConfckCache}[cache]
|
|
520
|
-
* @returns {Promise<void>}
|
|
521
|
-
*/
|
|
522
349
|
async function parseExtends(result, cache) {
|
|
523
350
|
if (!result.tsconfig.extends) return;
|
|
524
|
-
/** @type {import('./public.d.ts').TSConfckParseResult[]} */
|
|
525
351
|
const extended = [{
|
|
526
352
|
tsconfigFile: result.tsconfigFile,
|
|
527
353
|
tsconfig: JSON.parse(JSON.stringify(result.tsconfig))
|
|
528
354
|
}];
|
|
529
355
|
let pos = 0;
|
|
530
|
-
/** @type {string[]} */
|
|
531
356
|
const extendsPath = [];
|
|
532
357
|
let currentBranchDepth = 0;
|
|
533
358
|
while (pos < extended.length) {
|
|
@@ -535,7 +360,6 @@ async function parseExtends(result, cache) {
|
|
|
535
360
|
extendsPath.push(extending.tsconfigFile);
|
|
536
361
|
if (extending.tsconfig.extends) {
|
|
537
362
|
currentBranchDepth += 1;
|
|
538
|
-
/** @type {string[]} */
|
|
539
363
|
let resolvedExtends;
|
|
540
364
|
if (!Array.isArray(extending.tsconfig.extends)) resolvedExtends = [resolveExtends(extending.tsconfig.extends, extending.tsconfigFile)];
|
|
541
365
|
else resolvedExtends = extending.tsconfig.extends.reverse().map((ex) => resolveExtends(ex, extending.tsconfigFile));
|
|
@@ -551,12 +375,6 @@ async function parseExtends(result, cache) {
|
|
|
551
375
|
result.extended = extended;
|
|
552
376
|
for (const ext of result.extended.slice(1)) extendTSConfig(result, ext);
|
|
553
377
|
}
|
|
554
|
-
/**
|
|
555
|
-
*
|
|
556
|
-
* @param {string} extended
|
|
557
|
-
* @param {string} from
|
|
558
|
-
* @returns {string}
|
|
559
|
-
*/
|
|
560
378
|
function resolveExtends(extended, from) {
|
|
561
379
|
if ([".", ".."].includes(extended)) extended = extended + "/tsconfig.json";
|
|
562
380
|
const req = createRequire(from);
|
|
@@ -583,12 +401,6 @@ const EXTENDABLE_KEYS = [
|
|
|
583
401
|
"typeAcquisition",
|
|
584
402
|
"buildOptions"
|
|
585
403
|
];
|
|
586
|
-
/**
|
|
587
|
-
*
|
|
588
|
-
* @param {import('./public.d.ts').TSConfckParseResult} extending
|
|
589
|
-
* @param {import('./public.d.ts').TSConfckParseResult} extended
|
|
590
|
-
* @returns void
|
|
591
|
-
*/
|
|
592
404
|
function extendTSConfig(extending, extended) {
|
|
593
405
|
const extendingConfig = extending.tsconfig;
|
|
594
406
|
const extendedConfig = extended.tsconfig;
|
|
@@ -618,52 +430,19 @@ const REBASE_KEYS = [
|
|
|
618
430
|
"excludeDirectories",
|
|
619
431
|
"excludeFiles"
|
|
620
432
|
];
|
|
621
|
-
/** @typedef {string | string[]} PathValue */
|
|
622
|
-
/**
|
|
623
|
-
*
|
|
624
|
-
* @param {string} key
|
|
625
|
-
* @param {PathValue} value
|
|
626
|
-
* @param {string} prependPath
|
|
627
|
-
* @returns {PathValue}
|
|
628
|
-
*/
|
|
629
433
|
function rebaseRelative(key, value, prependPath) {
|
|
630
434
|
if (!REBASE_KEYS.includes(key)) return value;
|
|
631
435
|
if (Array.isArray(value)) return value.map((x) => rebasePath(x, prependPath));
|
|
632
436
|
else return rebasePath(value, prependPath);
|
|
633
437
|
}
|
|
634
|
-
/**
|
|
635
|
-
*
|
|
636
|
-
* @param {string} value
|
|
637
|
-
* @param {string} prependPath
|
|
638
|
-
* @returns {string}
|
|
639
|
-
*/
|
|
640
438
|
function rebasePath(value, prependPath) {
|
|
641
439
|
if (path.isAbsolute(value) || value.startsWith("${configDir}")) return value;
|
|
642
440
|
else return path.posix.normalize(path.posix.join(prependPath, value));
|
|
643
441
|
}
|
|
644
442
|
var TSConfckParseError = class TSConfckParseError extends Error {
|
|
645
|
-
/**
|
|
646
|
-
* error code
|
|
647
|
-
* @type {string}
|
|
648
|
-
*/
|
|
649
443
|
code;
|
|
650
|
-
/**
|
|
651
|
-
* error cause
|
|
652
|
-
* @type { Error | undefined}
|
|
653
|
-
*/
|
|
654
444
|
cause;
|
|
655
|
-
/**
|
|
656
|
-
* absolute path of tsconfig file where the error happened
|
|
657
|
-
* @type {string}
|
|
658
|
-
*/
|
|
659
445
|
tsconfigFile;
|
|
660
|
-
/**
|
|
661
|
-
*
|
|
662
|
-
* @param {string} message - error message
|
|
663
|
-
* @param {string} code - error code
|
|
664
|
-
* @param {string} tsconfigFile - path to tsconfig file
|
|
665
|
-
* @param {Error?} cause - cause of this error
|
|
666
|
-
*/
|
|
667
446
|
constructor(message, code, tsconfigFile, cause) {
|
|
668
447
|
super(message);
|
|
669
448
|
Object.setPrototypeOf(this, TSConfckParseError.prototype);
|
|
@@ -673,11 +452,6 @@ var TSConfckParseError = class TSConfckParseError extends Error {
|
|
|
673
452
|
this.tsconfigFile = tsconfigFile;
|
|
674
453
|
}
|
|
675
454
|
};
|
|
676
|
-
/**
|
|
677
|
-
*
|
|
678
|
-
* @param {any} tsconfig
|
|
679
|
-
* @param {string} tsconfigFile
|
|
680
|
-
*/
|
|
681
455
|
function applyDefaults(tsconfig, tsconfigFile) {
|
|
682
456
|
if (isJSConfig(tsconfigFile)) tsconfig.compilerOptions = {
|
|
683
457
|
...DEFAULT_JSCONFIG_COMPILER_OPTIONS,
|
|
@@ -691,79 +465,31 @@ const DEFAULT_JSCONFIG_COMPILER_OPTIONS = {
|
|
|
691
465
|
skipLibCheck: true,
|
|
692
466
|
noEmit: true
|
|
693
467
|
};
|
|
694
|
-
/**
|
|
695
|
-
* @param {string} configFileName
|
|
696
|
-
*/
|
|
697
468
|
function isJSConfig(configFileName) {
|
|
698
469
|
return path.basename(configFileName) === "jsconfig.json";
|
|
699
470
|
}
|
|
700
|
-
//#endregion
|
|
701
|
-
//#region node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.3/node_modules/tsconfck/src/parse-native.js
|
|
702
|
-
/** @typedef TSDiagnosticError {
|
|
703
|
-
code: number;
|
|
704
|
-
category: number;
|
|
705
|
-
messageText: string;
|
|
706
|
-
start?: number;
|
|
707
|
-
} TSDiagnosticError */
|
|
708
|
-
//#endregion
|
|
709
|
-
//#region node_modules/.pnpm/tsconfck@3.1.6_typescript@5.9.3/node_modules/tsconfck/src/cache.js
|
|
710
|
-
/** @template T */
|
|
711
471
|
var TSConfckCache = class {
|
|
712
|
-
/**
|
|
713
|
-
* clear cache, use this if you have a long running process and tsconfig files have been added,changed or deleted
|
|
714
|
-
*/
|
|
715
472
|
clear() {
|
|
716
473
|
this.#configPaths.clear();
|
|
717
474
|
this.#parsed.clear();
|
|
718
475
|
}
|
|
719
|
-
/**
|
|
720
|
-
* has cached closest config for files in dir
|
|
721
|
-
* @param {string} dir
|
|
722
|
-
* @param {string} [configName=tsconfig.json]
|
|
723
|
-
* @returns {boolean}
|
|
724
|
-
*/
|
|
725
476
|
hasConfigPath(dir, configName = "tsconfig.json") {
|
|
726
477
|
return this.#configPaths.has(`${dir}/${configName}`);
|
|
727
478
|
}
|
|
728
|
-
/**
|
|
729
|
-
* get cached closest tsconfig for files in dir
|
|
730
|
-
* @param {string} dir
|
|
731
|
-
* @param {string} [configName=tsconfig.json]
|
|
732
|
-
* @returns {Promise<string|null>|string|null}
|
|
733
|
-
* @throws {unknown} if cached value is an error
|
|
734
|
-
*/
|
|
735
479
|
getConfigPath(dir, configName = "tsconfig.json") {
|
|
736
480
|
const key = `${dir}/${configName}`;
|
|
737
481
|
const value = this.#configPaths.get(key);
|
|
738
482
|
if (value == null || value.length || value.then) return value;
|
|
739
483
|
else throw value;
|
|
740
484
|
}
|
|
741
|
-
/**
|
|
742
|
-
* has parsed tsconfig for file
|
|
743
|
-
* @param {string} file
|
|
744
|
-
* @returns {boolean}
|
|
745
|
-
*/
|
|
746
485
|
hasParseResult(file) {
|
|
747
486
|
return this.#parsed.has(file);
|
|
748
487
|
}
|
|
749
|
-
/**
|
|
750
|
-
* get parsed tsconfig for file
|
|
751
|
-
* @param {string} file
|
|
752
|
-
* @returns {Promise<T>|T}
|
|
753
|
-
* @throws {unknown} if cached value is an error
|
|
754
|
-
*/
|
|
755
488
|
getParseResult(file) {
|
|
756
489
|
const value = this.#parsed.get(file);
|
|
757
490
|
if (value.then || value.tsconfig) return value;
|
|
758
491
|
else throw value;
|
|
759
492
|
}
|
|
760
|
-
/**
|
|
761
|
-
* @internal
|
|
762
|
-
* @private
|
|
763
|
-
* @param file
|
|
764
|
-
* @param {boolean} isRootFile a flag to check if current file which involking the parse() api, used to distinguish the normal cache which only parsed by parseFile()
|
|
765
|
-
* @param {Promise<T>} result
|
|
766
|
-
*/
|
|
767
493
|
setParseResult(file, result, isRootFile = false) {
|
|
768
494
|
Object.defineProperty(result, "_isRootFile_", {
|
|
769
495
|
value: isRootFile,
|
|
@@ -778,13 +504,6 @@ var TSConfckCache = class {
|
|
|
778
504
|
if (this.#parsed.get(file) === result) this.#parsed.set(file, e);
|
|
779
505
|
});
|
|
780
506
|
}
|
|
781
|
-
/**
|
|
782
|
-
* @internal
|
|
783
|
-
* @private
|
|
784
|
-
* @param {string} dir
|
|
785
|
-
* @param {Promise<string|null>} configPath
|
|
786
|
-
* @param {string} [configName=tsconfig.json]
|
|
787
|
-
*/
|
|
788
507
|
setConfigPath(dir, configPath, configName = "tsconfig.json") {
|
|
789
508
|
const key = `${dir}/${configName}`;
|
|
790
509
|
this.#configPaths.set(key, configPath);
|
|
@@ -794,20 +513,7 @@ var TSConfckCache = class {
|
|
|
794
513
|
if (this.#configPaths.get(key) === configPath) this.#configPaths.set(key, e);
|
|
795
514
|
});
|
|
796
515
|
}
|
|
797
|
-
/**
|
|
798
|
-
* map directories to their closest tsconfig.json
|
|
799
|
-
* @internal
|
|
800
|
-
* @private
|
|
801
|
-
* @type{Map<string,(Promise<string|null>|string|null)>}
|
|
802
|
-
*/
|
|
803
516
|
#configPaths = /* @__PURE__ */ new Map();
|
|
804
|
-
/**
|
|
805
|
-
* map files to their parsed tsconfig result
|
|
806
|
-
* @internal
|
|
807
|
-
* @private
|
|
808
|
-
* @type {Map<string,(Promise<T>|T)> }
|
|
809
|
-
*/
|
|
810
517
|
#parsed = /* @__PURE__ */ new Map();
|
|
811
518
|
};
|
|
812
|
-
//#endregion
|
|
813
519
|
export { parse as n, TSConfckCache as t };
|
package/dist/_libs/ultrahtml.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region node_modules/.pnpm/ultrahtml@1.6.0/node_modules/ultrahtml/dist/index.js
|
|
2
1
|
var D = new Set([
|
|
3
2
|
"area",
|
|
4
3
|
"base",
|
|
@@ -123,5 +122,4 @@ var T = class {
|
|
|
123
122
|
function z(e, t) {
|
|
124
123
|
return new T(t).visit(e);
|
|
125
124
|
}
|
|
126
|
-
//#endregion
|
|
127
125
|
export { z as n, P as t };
|
|
@@ -8,7 +8,6 @@ import path, { basename, dirname, extname, isAbsolute, normalize, resolve } from
|
|
|
8
8
|
import process$1 from "node:process";
|
|
9
9
|
import { Buffer } from "node:buffer";
|
|
10
10
|
import * as querystring from "node:querystring";
|
|
11
|
-
//#region node_modules/.pnpm/unimport@6.0.1/node_modules/unimport/dist/chunks/detect-acorn.mjs
|
|
12
11
|
async function detectImportsAcorn(code, ctx, options) {
|
|
13
12
|
const s = getMagicString(code);
|
|
14
13
|
const map = await ctx.getImportMap();
|
|
@@ -61,7 +60,7 @@ function traveseScopes(ast, additionalWalk) {
|
|
|
61
60
|
}
|
|
62
61
|
function popScope(node) {
|
|
63
62
|
if (scopesStack.pop()?.node !== node) throw new Error("Scope mismatch");
|
|
64
|
-
scopeCurrent = scopesStack
|
|
63
|
+
scopeCurrent = scopesStack.at(-1);
|
|
65
64
|
}
|
|
66
65
|
pushScope(void 0);
|
|
67
66
|
walk(ast, {
|
|
@@ -191,8 +190,6 @@ function createVirtualImportsAcronWalker(importMap, virtualImports = []) {
|
|
|
191
190
|
} }
|
|
192
191
|
};
|
|
193
192
|
}
|
|
194
|
-
//#endregion
|
|
195
|
-
//#region node_modules/.pnpm/unplugin@3.0.0/node_modules/unplugin/dist/parse-DN2jPtpt.mjs
|
|
196
193
|
var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch(), 1);
|
|
197
194
|
function toArray$2(array) {
|
|
198
195
|
array = array || [];
|
|
@@ -295,8 +292,6 @@ function normalizeObjectHook(name, hook) {
|
|
|
295
292
|
function parse(code, opts = {}) {
|
|
296
293
|
throw new Error("Parse implementation is not set. Please call setParseImpl first.");
|
|
297
294
|
}
|
|
298
|
-
//#endregion
|
|
299
|
-
//#region node_modules/.pnpm/unplugin@3.0.0/node_modules/unplugin/dist/webpack-like-Djrmy9eu.mjs
|
|
300
295
|
function transformUse(data, plugin, transformLoader) {
|
|
301
296
|
if (data.resource == null) return [];
|
|
302
297
|
const id = normalizeAbsolutePath(data.resource + (data.resourceQuery || ""));
|
|
@@ -309,22 +304,10 @@ function transformUse(data, plugin, transformLoader) {
|
|
|
309
304
|
ident: plugin.name
|
|
310
305
|
}];
|
|
311
306
|
}
|
|
312
|
-
/**
|
|
313
|
-
* Normalizes a given path when it's absolute. Normalizing means returning a new path by converting
|
|
314
|
-
* the input path to the native os format. This is useful in cases where we want to normalize
|
|
315
|
-
* the `id` argument of a hook. Any absolute ids should be in the default format
|
|
316
|
-
* of the operating system. Any relative imports or node_module imports should remain
|
|
317
|
-
* untouched.
|
|
318
|
-
*
|
|
319
|
-
* @param path - Path to normalize.
|
|
320
|
-
* @returns a new normalized path.
|
|
321
|
-
*/
|
|
322
307
|
function normalizeAbsolutePath(path) {
|
|
323
308
|
if (isAbsolute(path)) return normalize(path);
|
|
324
309
|
else return path;
|
|
325
310
|
}
|
|
326
|
-
//#endregion
|
|
327
|
-
//#region node_modules/.pnpm/unplugin@3.0.0/node_modules/unplugin/dist/context-CKhLGGrj.mjs
|
|
328
311
|
function createBuildContext$3(compiler, compilation, loaderContext, inputSourceMap) {
|
|
329
312
|
return {
|
|
330
313
|
getNativeBuildContext() {
|
|
@@ -362,8 +345,6 @@ function normalizeMessage$2(error) {
|
|
|
362
345
|
}
|
|
363
346
|
return err;
|
|
364
347
|
}
|
|
365
|
-
//#endregion
|
|
366
|
-
//#region node_modules/.pnpm/unplugin@3.0.0/node_modules/unplugin/dist/utils-BMHLEWml.mjs
|
|
367
348
|
function encodeVirtualModuleId(id, plugin) {
|
|
368
349
|
return resolve(plugin.__virtualModulePrefix, encodeURIComponent(id));
|
|
369
350
|
}
|
|
@@ -411,8 +392,6 @@ var FakeVirtualModulesPlugin = class FakeVirtualModulesPlugin {
|
|
|
411
392
|
return fs.promises.writeFile(file, "");
|
|
412
393
|
}
|
|
413
394
|
};
|
|
414
|
-
//#endregion
|
|
415
|
-
//#region node_modules/.pnpm/unplugin@3.0.0/node_modules/unplugin/dist/context-MD-xQmYI.mjs
|
|
416
395
|
function contextOptionsFromCompilation(compilation) {
|
|
417
396
|
return {
|
|
418
397
|
addWatchFile(file) {
|
|
@@ -462,8 +441,6 @@ function normalizeMessage$1(error) {
|
|
|
462
441
|
}
|
|
463
442
|
return err;
|
|
464
443
|
}
|
|
465
|
-
//#endregion
|
|
466
|
-
//#region node_modules/.pnpm/unplugin@3.0.0/node_modules/unplugin/dist/index.mjs
|
|
467
444
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
468
445
|
const ExtToLoader$1 = {
|
|
469
446
|
".js": "js",
|
|
@@ -1588,11 +1565,6 @@ function createUnplugin(factory) {
|
|
|
1588
1565
|
}
|
|
1589
1566
|
};
|
|
1590
1567
|
}
|
|
1591
|
-
//#endregion
|
|
1592
|
-
//#region node_modules/.pnpm/unplugin-utils@0.3.1/node_modules/unplugin-utils/dist/index.js
|
|
1593
|
-
/**
|
|
1594
|
-
* Converts path separators to forward slash.
|
|
1595
|
-
*/
|
|
1596
1568
|
function normalizePath(filename) {
|
|
1597
1569
|
return filename.replaceAll("\\", "/");
|
|
1598
1570
|
}
|
|
@@ -1607,18 +1579,6 @@ function getMatcherString(id, resolutionBase) {
|
|
|
1607
1579
|
if (resolutionBase === false || isAbsolute$2(id) || id.startsWith("**")) return normalizePath(id);
|
|
1608
1580
|
return join$1(normalizePath(resolve$1(resolutionBase || "")).replaceAll(/[-^$*+?.()|[\]{}]/g, `${escapeMark}$&`), normalizePath(id)).replaceAll(escapeMark, "\\");
|
|
1609
1581
|
}
|
|
1610
|
-
/**
|
|
1611
|
-
* Constructs a filter function which can be used to determine whether or not
|
|
1612
|
-
* certain modules should be operated upon.
|
|
1613
|
-
* @param include If `include` is omitted or has zero length, filter will return `true` by default.
|
|
1614
|
-
* @param exclude ID must not match any of the `exclude` patterns.
|
|
1615
|
-
* @param options Additional options.
|
|
1616
|
-
* @param options.resolve Optionally resolves the patterns against a directory other than `process.cwd()`.
|
|
1617
|
-
* If a `string` is specified, then the value will be used as the base directory.
|
|
1618
|
-
* Relative paths will be resolved against `process.cwd()` first.
|
|
1619
|
-
* If `false`, then the patterns will not be resolved against any directory.
|
|
1620
|
-
* This can be useful if you want to create a filter for virtual module names.
|
|
1621
|
-
*/
|
|
1622
1582
|
function createFilter(include, exclude, options) {
|
|
1623
1583
|
const resolutionBase = options && options.resolve;
|
|
1624
1584
|
const getMatcher = (id) => id instanceof RegExp ? id : { test: (what) => {
|
|
@@ -1642,8 +1602,6 @@ function createFilter(include, exclude, options) {
|
|
|
1642
1602
|
return !includeMatchers.length;
|
|
1643
1603
|
};
|
|
1644
1604
|
}
|
|
1645
|
-
//#endregion
|
|
1646
|
-
//#region node_modules/.pnpm/unimport@6.0.1/node_modules/unimport/dist/unplugin.mjs
|
|
1647
1605
|
const defaultIncludes = [
|
|
1648
1606
|
/\.[jt]sx?$/,
|
|
1649
1607
|
/\.vue$/,
|
|
@@ -1680,5 +1638,4 @@ const unplugin = createUnplugin((options = {}) => {
|
|
|
1680
1638
|
}
|
|
1681
1639
|
};
|
|
1682
1640
|
});
|
|
1683
|
-
//#endregion
|
|
1684
1641
|
export { detectImportsAcorn as a, createVirtualImportsAcronWalker as i, defaultIncludes as n, traveseScopes as o, unplugin as r, defaultExcludes as t };
|