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
|
@@ -6,7 +6,6 @@ import * as sp from "node:path";
|
|
|
6
6
|
import { join, relative, resolve, sep } from "node:path";
|
|
7
7
|
import { EventEmitter } from "node:events";
|
|
8
8
|
import { Readable } from "node:stream";
|
|
9
|
-
//#region node_modules/.pnpm/readdirp@5.0.0/node_modules/readdirp/index.js
|
|
10
9
|
const EntryTypes = {
|
|
11
10
|
FILE_TYPE: "files",
|
|
12
11
|
DIR_TYPE: "directories",
|
|
@@ -64,7 +63,6 @@ const normalizeFilter = (filter) => {
|
|
|
64
63
|
}
|
|
65
64
|
return emptyFn;
|
|
66
65
|
};
|
|
67
|
-
/** Readable readdir stream, emitting new files as they're being listed. */
|
|
68
66
|
var ReaddirpStream = class extends Readable {
|
|
69
67
|
parents;
|
|
70
68
|
reading;
|
|
@@ -220,12 +218,6 @@ var ReaddirpStream = class extends Readable {
|
|
|
220
218
|
return stats && this._wantsEverything && !stats.isDirectory();
|
|
221
219
|
}
|
|
222
220
|
};
|
|
223
|
-
/**
|
|
224
|
-
* Streaming version: Reads all files and directories in given root recursively.
|
|
225
|
-
* Consumes ~constant small amount of RAM.
|
|
226
|
-
* @param root Root directory
|
|
227
|
-
* @param options Options to specify root (start directory), filters and recursion depth
|
|
228
|
-
*/
|
|
229
221
|
function readdirp(root, options = {}) {
|
|
230
222
|
let type = options.entryType || options.type;
|
|
231
223
|
if (type === "both") type = EntryTypes.FILE_DIR_TYPE;
|
|
@@ -236,8 +228,6 @@ function readdirp(root, options = {}) {
|
|
|
236
228
|
options.root = root;
|
|
237
229
|
return new ReaddirpStream(options);
|
|
238
230
|
}
|
|
239
|
-
//#endregion
|
|
240
|
-
//#region node_modules/.pnpm/chokidar@5.0.0/node_modules/chokidar/handler.js
|
|
241
231
|
const STR_DATA = "data";
|
|
242
232
|
const STR_CLOSE = "close";
|
|
243
233
|
const EMPTY_FN = () => {};
|
|
@@ -557,15 +547,6 @@ const delFromSet = (main, prop, item) => {
|
|
|
557
547
|
};
|
|
558
548
|
const isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
|
|
559
549
|
const FsWatchInstances = /* @__PURE__ */ new Map();
|
|
560
|
-
/**
|
|
561
|
-
* Instantiates the fs_watch interface
|
|
562
|
-
* @param path to be watched
|
|
563
|
-
* @param options to be passed to fs_watch
|
|
564
|
-
* @param listener main event handler
|
|
565
|
-
* @param errHandler emits info about errors
|
|
566
|
-
* @param emitRaw emits raw event data
|
|
567
|
-
* @returns {NativeFsWatcher}
|
|
568
|
-
*/
|
|
569
550
|
function createFsWatchInstance(path, options, listener, errHandler, emitRaw) {
|
|
570
551
|
const handleEvent = (rawEvent, evPath) => {
|
|
571
552
|
listener(path);
|
|
@@ -579,10 +560,6 @@ function createFsWatchInstance(path, options, listener, errHandler, emitRaw) {
|
|
|
579
560
|
return;
|
|
580
561
|
}
|
|
581
562
|
}
|
|
582
|
-
/**
|
|
583
|
-
* Helper for passing fs_watch event data to a collection of listeners
|
|
584
|
-
* @param fullPath absolute path bound to fs_watch instance
|
|
585
|
-
*/
|
|
586
563
|
const fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
|
|
587
564
|
const cont = FsWatchInstances.get(fullPath);
|
|
588
565
|
if (!cont) return;
|
|
@@ -590,14 +567,6 @@ const fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
|
|
|
590
567
|
listener(val1, val2, val3);
|
|
591
568
|
});
|
|
592
569
|
};
|
|
593
|
-
/**
|
|
594
|
-
* Instantiates the fs_watch interface or binds listeners
|
|
595
|
-
* to an existing one covering the same file system entry
|
|
596
|
-
* @param path
|
|
597
|
-
* @param fullPath absolute path
|
|
598
|
-
* @param options to be passed to fs_watch
|
|
599
|
-
* @param handlers container for event listener functions
|
|
600
|
-
*/
|
|
601
570
|
const setFsWatchListener = (path, fullPath, options, handlers) => {
|
|
602
571
|
const { listener, errHandler, rawEmitter } = handlers;
|
|
603
572
|
let cont = FsWatchInstances.get(fullPath);
|
|
@@ -645,15 +614,6 @@ const setFsWatchListener = (path, fullPath, options, handlers) => {
|
|
|
645
614
|
};
|
|
646
615
|
};
|
|
647
616
|
const FsWatchFileInstances = /* @__PURE__ */ new Map();
|
|
648
|
-
/**
|
|
649
|
-
* Instantiates the fs_watchFile interface or binds listeners
|
|
650
|
-
* to an existing one covering the same file system entry
|
|
651
|
-
* @param path to be watched
|
|
652
|
-
* @param fullPath absolute path
|
|
653
|
-
* @param options options to be passed to fs_watchFile
|
|
654
|
-
* @param handlers container for event listener functions
|
|
655
|
-
* @returns closer
|
|
656
|
-
*/
|
|
657
617
|
const setFsWatchFileListener = (path, fullPath, options, handlers) => {
|
|
658
618
|
const { listener, rawEmitter } = handlers;
|
|
659
619
|
let cont = FsWatchFileInstances.get(fullPath);
|
|
@@ -694,9 +654,6 @@ const setFsWatchFileListener = (path, fullPath, options, handlers) => {
|
|
|
694
654
|
}
|
|
695
655
|
};
|
|
696
656
|
};
|
|
697
|
-
/**
|
|
698
|
-
* @mixin
|
|
699
|
-
*/
|
|
700
657
|
var NodeFsHandler = class {
|
|
701
658
|
fsw;
|
|
702
659
|
_boundHandleError;
|
|
@@ -704,12 +661,6 @@ var NodeFsHandler = class {
|
|
|
704
661
|
this.fsw = fsW;
|
|
705
662
|
this._boundHandleError = (error) => fsW._handleError(error);
|
|
706
663
|
}
|
|
707
|
-
/**
|
|
708
|
-
* Watch file for changes with fs_watchFile or fs_watch.
|
|
709
|
-
* @param path to file or dir
|
|
710
|
-
* @param listener on fs change
|
|
711
|
-
* @returns closer for the watcher instance
|
|
712
|
-
*/
|
|
713
664
|
_watchWithNodeFs(path, listener) {
|
|
714
665
|
const opts = this.fsw.options;
|
|
715
666
|
const directory = sp.dirname(path);
|
|
@@ -732,10 +683,6 @@ var NodeFsHandler = class {
|
|
|
732
683
|
});
|
|
733
684
|
return closer;
|
|
734
685
|
}
|
|
735
|
-
/**
|
|
736
|
-
* Watch a file and emit add event if warranted.
|
|
737
|
-
* @returns closer for the watcher instance
|
|
738
|
-
*/
|
|
739
686
|
_handleFile(file, stats, initialAdd) {
|
|
740
687
|
if (this.fsw.closed) return;
|
|
741
688
|
const dirname = sp.dirname(file);
|
|
@@ -774,14 +721,6 @@ var NodeFsHandler = class {
|
|
|
774
721
|
}
|
|
775
722
|
return closer;
|
|
776
723
|
}
|
|
777
|
-
/**
|
|
778
|
-
* Handle symlinks encountered while reading a dir.
|
|
779
|
-
* @param entry returned by readdirp
|
|
780
|
-
* @param directory path of dir being read
|
|
781
|
-
* @param path of this item
|
|
782
|
-
* @param item basename of this item
|
|
783
|
-
* @returns true if no more processing is needed for this entry.
|
|
784
|
-
*/
|
|
785
724
|
async _handleSymlink(entry, directory, path, item) {
|
|
786
725
|
if (this.fsw.closed) return;
|
|
787
726
|
const full = entry.fullPath;
|
|
@@ -862,17 +801,6 @@ var NodeFsHandler = class {
|
|
|
862
801
|
});
|
|
863
802
|
});
|
|
864
803
|
}
|
|
865
|
-
/**
|
|
866
|
-
* Read directory to add / remove files from `@watched` list and re-read it on change.
|
|
867
|
-
* @param dir fs path
|
|
868
|
-
* @param stats
|
|
869
|
-
* @param initialAdd
|
|
870
|
-
* @param depth relative to user-supplied path
|
|
871
|
-
* @param target child path targeted for watch
|
|
872
|
-
* @param wh Common watch helpers for this path
|
|
873
|
-
* @param realpath
|
|
874
|
-
* @returns closer for the watcher instance.
|
|
875
|
-
*/
|
|
876
804
|
async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) {
|
|
877
805
|
const parentDir = this.fsw._getWatchedDir(sp.dirname(dir));
|
|
878
806
|
const tracked = parentDir.has(sp.basename(dir));
|
|
@@ -894,15 +822,6 @@ var NodeFsHandler = class {
|
|
|
894
822
|
}
|
|
895
823
|
return closer;
|
|
896
824
|
}
|
|
897
|
-
/**
|
|
898
|
-
* Handle added file, directory, or glob pattern.
|
|
899
|
-
* Delegates call to _handleFile / _handleDir after checks.
|
|
900
|
-
* @param path to file or ir
|
|
901
|
-
* @param initialAdd was the file added at watch instantiation?
|
|
902
|
-
* @param priorWh depth relative to user-supplied path
|
|
903
|
-
* @param depth Child path actually targeted for watch
|
|
904
|
-
* @param target Child path actually targeted for watch
|
|
905
|
-
*/
|
|
906
825
|
async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
|
|
907
826
|
const ready = this.fsw._emitReady;
|
|
908
827
|
if (this.fsw._isIgnored(path) || this.fsw.closed) {
|
|
@@ -951,9 +870,6 @@ var NodeFsHandler = class {
|
|
|
951
870
|
}
|
|
952
871
|
}
|
|
953
872
|
};
|
|
954
|
-
//#endregion
|
|
955
|
-
//#region node_modules/.pnpm/chokidar@5.0.0/node_modules/chokidar/index.js
|
|
956
|
-
/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
|
|
957
873
|
var chokidar_exports = /* @__PURE__ */ __exportAll({
|
|
958
874
|
FSWatcher: () => FSWatcher,
|
|
959
875
|
WatchHelper: () => WatchHelper,
|
|
@@ -1037,9 +953,6 @@ const getAbsolutePath = (path, cwd) => {
|
|
|
1037
953
|
return sp.join(cwd, path);
|
|
1038
954
|
};
|
|
1039
955
|
const EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
|
|
1040
|
-
/**
|
|
1041
|
-
* Directory entry.
|
|
1042
|
-
*/
|
|
1043
956
|
var DirEntry = class {
|
|
1044
957
|
path;
|
|
1045
958
|
_removeWatcher;
|
|
@@ -1120,14 +1033,6 @@ var WatchHelper = class {
|
|
|
1120
1033
|
return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
|
|
1121
1034
|
}
|
|
1122
1035
|
};
|
|
1123
|
-
/**
|
|
1124
|
-
* Watches files & directories for changes. Emitted events:
|
|
1125
|
-
* `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error`
|
|
1126
|
-
*
|
|
1127
|
-
* new FSWatcher()
|
|
1128
|
-
* .add(directories)
|
|
1129
|
-
* .on('add', path => log('File', path, 'was added'))
|
|
1130
|
-
*/
|
|
1131
1036
|
var FSWatcher = class extends EventEmitter {
|
|
1132
1037
|
closed;
|
|
1133
1038
|
options;
|
|
@@ -1219,10 +1124,6 @@ var FSWatcher = class extends EventEmitter {
|
|
|
1219
1124
|
for (const ignored of this._ignoredPaths) if (isMatcherObject(ignored) && ignored.path === matcher) this._ignoredPaths.delete(ignored);
|
|
1220
1125
|
}
|
|
1221
1126
|
}
|
|
1222
|
-
/**
|
|
1223
|
-
* Adds paths to be watched on an existing FSWatcher instance.
|
|
1224
|
-
* @param paths_ file or file list. Other arguments are unused
|
|
1225
|
-
*/
|
|
1226
1127
|
add(paths_, _origAdd, _internal) {
|
|
1227
1128
|
const { cwd } = this.options;
|
|
1228
1129
|
this.closed = false;
|
|
@@ -1249,9 +1150,6 @@ var FSWatcher = class extends EventEmitter {
|
|
|
1249
1150
|
});
|
|
1250
1151
|
return this;
|
|
1251
1152
|
}
|
|
1252
|
-
/**
|
|
1253
|
-
* Close watchers or start ignoring events from specified paths.
|
|
1254
|
-
*/
|
|
1255
1153
|
unwatch(paths_) {
|
|
1256
1154
|
if (this.closed) return this;
|
|
1257
1155
|
const paths = unifyPaths(paths_);
|
|
@@ -1271,9 +1169,6 @@ var FSWatcher = class extends EventEmitter {
|
|
|
1271
1169
|
});
|
|
1272
1170
|
return this;
|
|
1273
1171
|
}
|
|
1274
|
-
/**
|
|
1275
|
-
* Close watchers and remove all listeners from watched paths.
|
|
1276
|
-
*/
|
|
1277
1172
|
close() {
|
|
1278
1173
|
if (this._closePromise) return this._closePromise;
|
|
1279
1174
|
this.closed = true;
|
|
@@ -1296,10 +1191,6 @@ var FSWatcher = class extends EventEmitter {
|
|
|
1296
1191
|
this._closePromise = closers.length ? Promise.all(closers).then(() => void 0) : Promise.resolve();
|
|
1297
1192
|
return this._closePromise;
|
|
1298
1193
|
}
|
|
1299
|
-
/**
|
|
1300
|
-
* Expose list of watched paths
|
|
1301
|
-
* @returns for chaining
|
|
1302
|
-
*/
|
|
1303
1194
|
getWatched() {
|
|
1304
1195
|
const watchList = {};
|
|
1305
1196
|
this._watched.forEach((entry, dir) => {
|
|
@@ -1312,14 +1203,6 @@ var FSWatcher = class extends EventEmitter {
|
|
|
1312
1203
|
this.emit(event, ...args);
|
|
1313
1204
|
if (event !== EVENTS.ERROR) this.emit(EVENTS.ALL, event, ...args);
|
|
1314
1205
|
}
|
|
1315
|
-
/**
|
|
1316
|
-
* Normalize and emit events.
|
|
1317
|
-
* Calling _emit DOES NOT MEAN emit() would be called!
|
|
1318
|
-
* @param event Type of event
|
|
1319
|
-
* @param path File or directory path
|
|
1320
|
-
* @param stats arguments to be passed with event
|
|
1321
|
-
* @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
|
|
1322
|
-
*/
|
|
1323
1206
|
async _emit(event, path, stats) {
|
|
1324
1207
|
if (this.closed) return;
|
|
1325
1208
|
const opts = this.options;
|
|
@@ -1380,22 +1263,11 @@ var FSWatcher = class extends EventEmitter {
|
|
|
1380
1263
|
this.emitWithAll(event, args);
|
|
1381
1264
|
return this;
|
|
1382
1265
|
}
|
|
1383
|
-
/**
|
|
1384
|
-
* Common handler for errors
|
|
1385
|
-
* @returns The error if defined, otherwise the value of the FSWatcher instance's `closed` flag
|
|
1386
|
-
*/
|
|
1387
1266
|
_handleError(error) {
|
|
1388
1267
|
const code = error && error.code;
|
|
1389
1268
|
if (error && code !== "ENOENT" && code !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code !== "EPERM" && code !== "EACCES")) this.emit(EVENTS.ERROR, error);
|
|
1390
1269
|
return error || this.closed;
|
|
1391
1270
|
}
|
|
1392
|
-
/**
|
|
1393
|
-
* Helper utility for throttling
|
|
1394
|
-
* @param actionType type being throttled
|
|
1395
|
-
* @param path being acted upon
|
|
1396
|
-
* @param timeout duration of time to suppress duplicate actions
|
|
1397
|
-
* @returns tracking object or false if action should be suppressed
|
|
1398
|
-
*/
|
|
1399
1271
|
_throttle(actionType, path, timeout) {
|
|
1400
1272
|
if (!this._throttled.has(actionType)) this._throttled.set(actionType, /* @__PURE__ */ new Map());
|
|
1401
1273
|
const action = this._throttled.get(actionType);
|
|
@@ -1426,14 +1298,6 @@ var FSWatcher = class extends EventEmitter {
|
|
|
1426
1298
|
_incrReadyCount() {
|
|
1427
1299
|
return this._readyCount++;
|
|
1428
1300
|
}
|
|
1429
|
-
/**
|
|
1430
|
-
* Awaits write operation to finish.
|
|
1431
|
-
* Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback.
|
|
1432
|
-
* @param path being acted upon
|
|
1433
|
-
* @param threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished
|
|
1434
|
-
* @param event
|
|
1435
|
-
* @param awfEmit Callback to be called when ready for event to be emitted.
|
|
1436
|
-
*/
|
|
1437
1301
|
_awaitWriteFinish(path, threshold, event, awfEmit) {
|
|
1438
1302
|
const awf = this.options.awaitWriteFinish;
|
|
1439
1303
|
if (typeof awf !== "object") return;
|
|
@@ -1469,9 +1333,6 @@ var FSWatcher = class extends EventEmitter {
|
|
|
1469
1333
|
timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval);
|
|
1470
1334
|
}
|
|
1471
1335
|
}
|
|
1472
|
-
/**
|
|
1473
|
-
* Determines whether user has asked to ignore this path.
|
|
1474
|
-
*/
|
|
1475
1336
|
_isIgnored(path, stats) {
|
|
1476
1337
|
if (this.options.atomic && DOT_RE.test(path)) return true;
|
|
1477
1338
|
if (!this._userIgnored) {
|
|
@@ -1484,36 +1345,18 @@ var FSWatcher = class extends EventEmitter {
|
|
|
1484
1345
|
_isntIgnored(path, stat) {
|
|
1485
1346
|
return !this._isIgnored(path, stat);
|
|
1486
1347
|
}
|
|
1487
|
-
/**
|
|
1488
|
-
* Provides a set of common helpers and properties relating to symlink handling.
|
|
1489
|
-
* @param path file or directory pattern being watched
|
|
1490
|
-
*/
|
|
1491
1348
|
_getWatchHelpers(path) {
|
|
1492
1349
|
return new WatchHelper(path, this.options.followSymlinks, this);
|
|
1493
1350
|
}
|
|
1494
|
-
/**
|
|
1495
|
-
* Provides directory tracking objects
|
|
1496
|
-
* @param directory path of the directory
|
|
1497
|
-
*/
|
|
1498
1351
|
_getWatchedDir(directory) {
|
|
1499
1352
|
const dir = sp.resolve(directory);
|
|
1500
1353
|
if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove));
|
|
1501
1354
|
return this._watched.get(dir);
|
|
1502
1355
|
}
|
|
1503
|
-
/**
|
|
1504
|
-
* Check for read permissions: https://stackoverflow.com/a/11781404/1358405
|
|
1505
|
-
*/
|
|
1506
1356
|
_hasReadPermissions(stats) {
|
|
1507
1357
|
if (this.options.ignorePermissionErrors) return true;
|
|
1508
1358
|
return Boolean(Number(stats.mode) & 256);
|
|
1509
1359
|
}
|
|
1510
|
-
/**
|
|
1511
|
-
* Handles emitting unlink events for
|
|
1512
|
-
* files and directories, and via recursion, for
|
|
1513
|
-
* files and directories within directories that are unlinked
|
|
1514
|
-
* @param directory within which the following item is located
|
|
1515
|
-
* @param item base path of item/directory
|
|
1516
|
-
*/
|
|
1517
1360
|
_remove(directory, item, isDirectory) {
|
|
1518
1361
|
const path = sp.join(directory, item);
|
|
1519
1362
|
const fullPath = sp.resolve(path);
|
|
@@ -1536,17 +1379,11 @@ var FSWatcher = class extends EventEmitter {
|
|
|
1536
1379
|
if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path);
|
|
1537
1380
|
this._closePath(path);
|
|
1538
1381
|
}
|
|
1539
|
-
/**
|
|
1540
|
-
* Closes all watchers for a path
|
|
1541
|
-
*/
|
|
1542
1382
|
_closePath(path) {
|
|
1543
1383
|
this._closeFile(path);
|
|
1544
1384
|
const dir = sp.dirname(path);
|
|
1545
1385
|
this._getWatchedDir(dir).remove(sp.basename(path));
|
|
1546
1386
|
}
|
|
1547
|
-
/**
|
|
1548
|
-
* Closes only file-specific watchers
|
|
1549
|
-
*/
|
|
1550
1387
|
_closeFile(path) {
|
|
1551
1388
|
const closers = this._closers.get(path);
|
|
1552
1389
|
if (!closers) return;
|
|
@@ -1584,15 +1421,6 @@ var FSWatcher = class extends EventEmitter {
|
|
|
1584
1421
|
return stream;
|
|
1585
1422
|
}
|
|
1586
1423
|
};
|
|
1587
|
-
/**
|
|
1588
|
-
* Instantiates watcher with paths to be tracked.
|
|
1589
|
-
* @param paths file / directory paths
|
|
1590
|
-
* @param options opts, such as `atomic`, `awaitWriteFinish`, `ignored`, and others
|
|
1591
|
-
* @returns an instance of FSWatcher for chaining.
|
|
1592
|
-
* @example
|
|
1593
|
-
* const watcher = watch('.').on('all', (event, path) => { console.log(event, path); });
|
|
1594
|
-
* watch('.', { atomic: true, awaitWriteFinish: true, ignored: (f, stats) => stats?.isFile() && !f.endsWith('.js') })
|
|
1595
|
-
*/
|
|
1596
1424
|
function watch$1(paths, options = {}) {
|
|
1597
1425
|
const watcher = new FSWatcher(options);
|
|
1598
1426
|
watcher.add(paths);
|
|
@@ -1602,5 +1430,4 @@ var chokidar_default = {
|
|
|
1602
1430
|
watch: watch$1,
|
|
1603
1431
|
FSWatcher
|
|
1604
1432
|
};
|
|
1605
|
-
//#endregion
|
|
1606
1433
|
export { watch$1 as n, chokidar_exports as t };
|
package/dist/_libs/remapping.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { a as toDecodedMap, c as decodedMappings, i as setSourceContent, l as traceSegment, n as maybeAddSegment, o as toEncodedMap, r as setIgnore, s as TraceMap, t as GenMapping } from "./resolve-uri+gen-mapping.mjs";
|
|
2
|
-
//#region node_modules/.pnpm/@jridgewell+remapping@2.3.5/node_modules/@jridgewell/remapping/dist/remapping.mjs
|
|
3
2
|
var SOURCELESS_MAPPING = /* @__PURE__ */ SegmentObject("", -1, -1, "", null, false);
|
|
4
3
|
var EMPTY_SOURCES = [];
|
|
5
4
|
function SegmentObject(source, line, column, name, content, ignore) {
|
|
@@ -111,5 +110,4 @@ function remapping(input, loader, options) {
|
|
|
111
110
|
};
|
|
112
111
|
return new SourceMap(traceMappings(buildSourceMapTree(input, loader)), opts);
|
|
113
112
|
}
|
|
114
|
-
//#endregion
|
|
115
113
|
export { remapping as t };
|
|
@@ -1,26 +1,6 @@
|
|
|
1
1
|
import { C as decode, w as encode } from "../_build/common.mjs";
|
|
2
|
-
//#region node_modules/.pnpm/@jridgewell+resolve-uri@3.1.2/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs
|
|
3
2
|
const schemeRegex = /^[\w+.-]+:\/\//;
|
|
4
|
-
/**
|
|
5
|
-
* Matches the parts of a URL:
|
|
6
|
-
* 1. Scheme, including ":", guaranteed.
|
|
7
|
-
* 2. User/password, including "@", optional.
|
|
8
|
-
* 3. Host, guaranteed.
|
|
9
|
-
* 4. Port, including ":", optional.
|
|
10
|
-
* 5. Path, including "/", optional.
|
|
11
|
-
* 6. Query, including "?", optional.
|
|
12
|
-
* 7. Hash, including "#", optional.
|
|
13
|
-
*/
|
|
14
3
|
const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
|
|
15
|
-
/**
|
|
16
|
-
* File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start
|
|
17
|
-
* with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).
|
|
18
|
-
*
|
|
19
|
-
* 1. Host, optional.
|
|
20
|
-
* 2. Path, which may include "/", guaranteed.
|
|
21
|
-
* 3. Query, including "?", optional.
|
|
22
|
-
* 4. Hash, including "#", optional.
|
|
23
|
-
*/
|
|
24
4
|
const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
|
|
25
5
|
function isAbsoluteUrl(input) {
|
|
26
6
|
return schemeRegex.test(input);
|
|
@@ -90,10 +70,6 @@ function mergePaths(url, base) {
|
|
|
90
70
|
if (url.path === "/") url.path = base.path;
|
|
91
71
|
else url.path = stripPathFilename(base.path) + url.path;
|
|
92
72
|
}
|
|
93
|
-
/**
|
|
94
|
-
* The path can have empty directories "//", unneeded parents "foo/..", or current directory
|
|
95
|
-
* "foo/.". We need to normalize to a standard representation.
|
|
96
|
-
*/
|
|
97
73
|
function normalizePath(url, type) {
|
|
98
74
|
const rel = type <= 4;
|
|
99
75
|
const pieces = url.path.split("/");
|
|
@@ -124,9 +100,6 @@ function normalizePath(url, type) {
|
|
|
124
100
|
if (!path || addTrailingSlash && !path.endsWith("/..")) path += "/";
|
|
125
101
|
url.path = path;
|
|
126
102
|
}
|
|
127
|
-
/**
|
|
128
|
-
* Attempts to resolve `input` URL/path relative to `base`.
|
|
129
|
-
*/
|
|
130
103
|
function resolve(input, base) {
|
|
131
104
|
if (!input && !base) return "";
|
|
132
105
|
const url = parseUrl(input);
|
|
@@ -162,8 +135,6 @@ function resolve(input, base) {
|
|
|
162
135
|
default: return url.scheme + "//" + url.user + url.host + url.port + url.path + queryHash;
|
|
163
136
|
}
|
|
164
137
|
}
|
|
165
|
-
//#endregion
|
|
166
|
-
//#region node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
|
|
167
138
|
function stripFilename(path) {
|
|
168
139
|
if (!path) return "";
|
|
169
140
|
const index = path.lastIndexOf("/");
|
|
@@ -296,8 +267,6 @@ function traceSegmentInternal(segments, memo, line, column, bias) {
|
|
|
296
267
|
if (index === -1 || index === segments.length) return -1;
|
|
297
268
|
return index;
|
|
298
269
|
}
|
|
299
|
-
//#endregion
|
|
300
|
-
//#region node_modules/.pnpm/@jridgewell+gen-mapping@0.3.13/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs
|
|
301
270
|
var SetArray = class {
|
|
302
271
|
constructor() {
|
|
303
272
|
this._indexes = { __proto__: null };
|
|
@@ -438,5 +407,4 @@ function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIn
|
|
|
438
407
|
if (prev.length === 1) return false;
|
|
439
408
|
return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME);
|
|
440
409
|
}
|
|
441
|
-
//#endregion
|
|
442
410
|
export { toDecodedMap as a, decodedMappings as c, setSourceContent as i, traceSegment as l, maybeAddSegment as n, toEncodedMap as o, setIgnore as r, TraceMap as s, GenMapping as t };
|
package/dist/_libs/rou3.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region node_modules/.pnpm/rou3@0.8.1/node_modules/rou3/dist/index.d.mts
|
|
2
1
|
interface RouterContext<T = unknown> {
|
|
3
2
|
root: Node<T>;
|
|
4
3
|
static: Record<string, Node<T> | undefined>;
|
|
@@ -17,8 +16,6 @@ interface Node<T = unknown> {
|
|
|
17
16
|
hasRegexParam?: boolean;
|
|
18
17
|
methods?: Record<string, MethodData<T>[] | undefined>;
|
|
19
18
|
}
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region node_modules/.pnpm/rou3@0.8.1/node_modules/rou3/dist/compiler.d.mts
|
|
22
19
|
interface RouterCompilerOptions<T = any> {
|
|
23
20
|
matchAll?: boolean;
|
|
24
21
|
normalize?: boolean;
|
|
@@ -40,5 +37,4 @@ interface RouterCompilerOptions<T = any> {
|
|
|
40
37
|
*
|
|
41
38
|
* @param router - The router context to compile.
|
|
42
39
|
*/
|
|
43
|
-
//#endregion
|
|
44
40
|
export { RouterContext as n, RouterCompilerOptions as t };
|
package/dist/_libs/rou3.mjs
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
//#region node_modules/.pnpm/rou3@0.8.1/node_modules/rou3/dist/index.mjs
|
|
2
1
|
const NullProtoObj = /* @__PURE__ */ (() => {
|
|
3
2
|
const e = function() {};
|
|
4
3
|
return e.prototype = Object.create(null), Object.freeze(e.prototype), e;
|
|
5
4
|
})();
|
|
6
|
-
/**
|
|
7
|
-
* Create a new router context.
|
|
8
|
-
*/
|
|
9
5
|
function createRouter() {
|
|
10
6
|
return {
|
|
11
7
|
root: { key: "" },
|
|
@@ -165,9 +161,6 @@ function getMatchParams(segments, paramsMap) {
|
|
|
165
161
|
}
|
|
166
162
|
return params;
|
|
167
163
|
}
|
|
168
|
-
/**
|
|
169
|
-
* Add a route to the router context.
|
|
170
|
-
*/
|
|
171
164
|
function addRoute(ctx, method = "", path, data) {
|
|
172
165
|
method = method.toUpperCase();
|
|
173
166
|
if (path.charCodeAt(0) !== 47) path = `/${path}`;
|
|
@@ -267,9 +260,6 @@ function getParamRegexp(segment, unnamedStart = 0) {
|
|
|
267
260
|
const regex = _s.replace(/:([\w-]+)(?:\(([^)]*)\))?/g, (_, id, p) => `(?<${id}>${p || "[^/]+"})`).replace(/\((?![?<])/g, () => `(?<${toUnnamedGroupKey(_i++)}>`).replace(/\./g, "\\.").replace(/\uFFFE(.)/g, (_, c) => /[.*+?^${}()|[\]\\]/.test(c) ? `\\${c}` : c);
|
|
268
261
|
return [new RegExp(`^${regex}$`), _i];
|
|
269
262
|
}
|
|
270
|
-
/**
|
|
271
|
-
* Find a route by path.
|
|
272
|
-
*/
|
|
273
263
|
function findRoute(ctx, method = "", path, opts) {
|
|
274
264
|
if (opts?.normalize) path = normalizePath(path);
|
|
275
265
|
if (path.charCodeAt(path.length - 1) === 47) path = path.slice(0, -1);
|
|
@@ -329,9 +319,6 @@ function _lookupTree(node, method, segments, index) {
|
|
|
329
319
|
}
|
|
330
320
|
if (node.wildcard && node.wildcard.methods) return node.wildcard.methods[method] || node.wildcard.methods[""];
|
|
331
321
|
}
|
|
332
|
-
/**
|
|
333
|
-
* Find all route patterns that match the given path.
|
|
334
|
-
*/
|
|
335
322
|
function findAllRoutes(ctx, method = "", path, opts) {
|
|
336
323
|
if (opts?.normalize) path = normalizePath(path);
|
|
337
324
|
if (path.charCodeAt(path.length - 1) === 47) path = path.slice(0, -1);
|
|
@@ -369,22 +356,7 @@ function _findAll(node, method, segments, index, matches = []) {
|
|
|
369
356
|
}
|
|
370
357
|
return matches;
|
|
371
358
|
}
|
|
372
|
-
//#endregion
|
|
373
|
-
//#region node_modules/.pnpm/rou3@0.8.1/node_modules/rou3/dist/compiler.mjs
|
|
374
359
|
const UNNAMED_GROUP_PREFIX = "__rou3_unnamed_";
|
|
375
|
-
/**
|
|
376
|
-
* Compile the router instance into a compact runnable code.
|
|
377
|
-
*
|
|
378
|
-
* **IMPORTANT:** Route data must be serializable to JSON (i.e., no functions or classes) or implement the `toJSON()` method to render custom code or you can pass custom `serialize` function in options.
|
|
379
|
-
*
|
|
380
|
-
* @example
|
|
381
|
-
* import { createRouter, addRoute } from "rou3";
|
|
382
|
-
* import { compileRouterToString } from "rou3/compiler";
|
|
383
|
-
* const router = createRouter();
|
|
384
|
-
* // [add some routes with serializable data]
|
|
385
|
-
* const compilerCode = compileRouterToString(router, "findRoute");
|
|
386
|
-
* // "const findRoute=(m, p) => {}"
|
|
387
|
-
*/
|
|
388
360
|
function compileRouterToString(router, functionName, opts) {
|
|
389
361
|
const ctx = {
|
|
390
362
|
opts: opts || {},
|
|
@@ -492,5 +464,4 @@ function serializeData(ctx, value) {
|
|
|
492
464
|
}
|
|
493
465
|
return `$${index}`;
|
|
494
466
|
}
|
|
495
|
-
//#endregion
|
|
496
467
|
export { findRoute as a, findAllRoutes as i, addRoute as n, createRouter as r, compileRouterToString as t };
|
package/dist/_libs/std-env.d.mts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
//#region node_modules/.pnpm/std-env@4.0.0/node_modules/std-env/dist/index.d.mts
|
|
2
1
|
//#endregion
|
|
3
2
|
//#region src/providers.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Represents the name of a CI/CD or Deployment provider.
|
|
6
5
|
*/
|
|
7
|
-
type ProviderName = (string & {}) | "appveyor" | "aws_amplify" | "azure_pipelines" | "azure_static" | "appcircle" | "bamboo" | "bitbucket" | "bitrise" | "buddy" | "buildkite" | "circle" | "cirrus" | "cloudflare_pages" | "cloudflare_workers" | "google_cloudrun" | "google_cloudrun_job" | "codebuild" | "codefresh" | "drone" | "drone" | "dsari" | "github_actions" | "gitlab" | "gocd" | "layerci" | "hudson" | "jenkins" | "magnum" | "netlify" | "nevercode" | "render" | "sail" | "semaphore" | "screwdriver" | "shippable" | "solano" | "strider" | "teamcity" | "travis" | "vercel" | "appcenter" | "codesandbox" | "stackblitz" | "stormkit" | "cleavr" | "zeabur" | "codesphere" | "railway" | "deno-deploy" | "firebase_app_hosting";
|
|
6
|
+
type ProviderName = (string & {}) | "appveyor" | "aws_amplify" | "azure_pipelines" | "azure_static" | "appcircle" | "bamboo" | "bitbucket" | "bitrise" | "buddy" | "buildkite" | "circle" | "cirrus" | "cloudflare_pages" | "cloudflare_workers" | "google_cloudrun" | "google_cloudrun_job" | "codebuild" | "codefresh" | "drone" | "drone" | "dsari" | "github_actions" | "gitlab" | "gocd" | "layerci" | "hudson" | "jenkins" | "magnum" | "netlify" | "nevercode" | "render" | "sail" | "semaphore" | "screwdriver" | "shippable" | "solano" | "strider" | "teamcity" | "travis" | "vercel" | "appcenter" | "codesandbox" | "stackblitz" | "stormkit" | "cleavr" | "zeabur" | "codesphere" | "railway" | "deno-deploy" | "firebase_app_hosting" | "edgeone_pages";
|
|
8
7
|
/**
|
|
9
8
|
* Provides information about a CI/CD or Deployment provider, including its name and possibly other metadata.
|
|
10
9
|
*/
|
|
11
|
-
//#endregion
|
|
12
10
|
export { ProviderName as t };
|