nitro-nightly 3.0.1-alpha.1 → 3.0.1-alpha.2
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/README.md +2 -0
- package/dist/_build/common.mjs +24924 -52
- package/dist/_build/rolldown.mjs +29 -63
- package/dist/_build/rollup.mjs +22 -110
- package/dist/_build/vite.build.mjs +3 -43
- package/dist/{_dev.mjs → _chunks/dev.mjs} +45 -43
- package/dist/_chunks/{B-D1JOIz.mjs → nitro.mjs} +144 -308
- package/dist/_chunks/nitro2.mjs +101 -0
- package/dist/_chunks/utils.mjs +254 -0
- package/dist/{_chunks/Bqks5huO.mjs → _common.mjs} +24 -10
- package/dist/_libs/c12+giget+readdirp+chokidar.d.mts +214 -0
- package/dist/_libs/citty.mjs +140 -110
- package/dist/_libs/{plugin-commonjs.mjs → commondir+is-reference.mjs} +59 -250
- package/dist/_libs/compatx.d.mts +47 -0
- package/dist/_libs/confbox.mjs +388 -799
- package/dist/_libs/esbuild.d.mts +20 -0
- package/dist/_libs/estree-walker.mjs +1 -144
- package/dist/_libs/{plugin-node-resolve.mjs → hasown+resolve+deepmerge.mjs} +497 -78
- package/dist/_libs/httpxy.d.mts +79 -0
- package/dist/_libs/httpxy.mjs +6 -1
- package/dist/_libs/magic-string.d.mts +220 -0
- package/dist/_libs/mlly.d.mts +57 -0
- package/dist/_libs/nypm+giget+tinyexec.mjs +3603 -0
- package/dist/_libs/pkg-types.d.mts +23 -0
- package/dist/_libs/plugin-alias.mjs +4 -2
- package/dist/_libs/plugin-inject.mjs +5 -5
- package/dist/_libs/plugin-json.mjs +2 -2
- package/dist/_libs/pluginutils+plugin-commonjs.d.mts +241 -0
- package/dist/_libs/{vite-plugin-fullstack.mjs → pluginutils.mjs} +244 -153
- package/dist/_libs/rc9+c12+dotenv.mjs +972 -0
- package/dist/_libs/{chokidar.mjs → readdirp+chokidar.mjs} +237 -187
- package/dist/_libs/remapping.mjs +1 -1
- package/dist/_libs/{gen-mapping.mjs → resolve-uri+gen-mapping.mjs} +2 -166
- package/dist/_libs/rou3.d.mts +43 -0
- package/dist/_libs/rou3.mjs +9 -6
- package/dist/_libs/std-env.d.mts +4 -0
- package/dist/_libs/tsconfck.mjs +3 -3
- package/dist/_libs/{unimport.mjs → unimport+unplugin.mjs} +226 -1961
- package/dist/_libs/unplugin+unimport.d.mts +426 -0
- package/dist/_libs/unwasm.d.mts +29 -0
- package/dist/_presets.mjs +130 -80
- package/dist/builder.d.mts +4 -4
- package/dist/builder.mjs +6 -30
- package/dist/cli/_chunks/build.mjs +1 -1
- package/dist/cli/_chunks/dev.mjs +5 -11
- package/dist/cli/_chunks/list.mjs +1 -1
- package/dist/cli/_chunks/prepare.mjs +1 -1
- package/dist/cli/_chunks/run.mjs +1 -1
- package/dist/node_modules/@poppinss/colors/build/index.js +130 -160
- package/dist/node_modules/@poppinss/colors/package.json +20 -18
- package/dist/node_modules/@poppinss/exception/build/index.js +36 -55
- package/dist/node_modules/@poppinss/exception/package.json +19 -16
- package/dist/node_modules/@sindresorhus/is/distribution/index.js +46 -5
- package/dist/node_modules/@sindresorhus/is/package.json +1 -1
- package/dist/node_modules/@speed-highlight/core/dist/index.js +1 -1
- package/dist/node_modules/@speed-highlight/core/dist/terminal.js +1 -1
- package/dist/node_modules/@speed-highlight/core/package.json +2 -2
- package/dist/node_modules/hookable/dist/index.mjs +5 -6
- package/dist/node_modules/hookable/package.json +13 -13
- package/dist/node_modules/ufo/dist/index.mjs +16 -9
- package/dist/node_modules/ufo/package.json +15 -14
- package/dist/node_modules/unctx/package.json +16 -16
- package/dist/node_modules/youch/build/{chunk-4XB2BYKC.js → chunk-7QV3D5YX.js} +2 -4
- package/dist/node_modules/youch/build/{chunk-PUHGL6HA.js → chunk-AUGPHE32.js} +2 -4
- package/dist/node_modules/youch/build/{chunk-F4I6KX4R.js → chunk-CM7DWJNZ.js} +2 -4
- package/dist/node_modules/youch/build/{chunk-YYEJ3AGB.js → chunk-EJH674NB.js} +2 -4
- package/dist/node_modules/youch/build/{chunk-EUJBVOYB.js → chunk-OIJ3WD7L.js} +2 -4
- package/dist/node_modules/youch/build/{chunk-HFSXRSKS.js → chunk-P36L72PL.js} +5 -3
- package/dist/node_modules/youch/build/{chunk-4YEN7HVQ.js → chunk-PE3GG3TN.js} +5 -1
- package/dist/node_modules/youch/build/{chunk-PINJDICN.js → chunk-X53OIOJH.js} +2 -4
- package/dist/node_modules/youch/build/index.js +8 -9
- package/dist/node_modules/youch/build/public/error_info/style.css +1 -0
- package/dist/node_modules/youch/build/public/error_metadata/style.css +3 -0
- package/dist/node_modules/youch/build/public/error_stack/style.css +2 -3
- package/dist/node_modules/youch/package.json +1 -1
- package/dist/presets/_nitro/runtime/nitro-dev.d.mts +1 -1
- package/dist/presets/_nitro/runtime/nitro-dev.mjs +5 -6
- package/dist/presets/_nitro/runtime/nitro-prerenderer.d.mts +1 -1
- package/dist/presets/_nitro/runtime/nitro-prerenderer.mjs +1 -1
- package/dist/presets/_nitro/runtime/service-worker.d.mts +1 -1
- package/dist/presets/_nitro/runtime/service-worker.mjs +2 -2
- package/dist/presets/aws-amplify/runtime/aws-amplify.d.mts +1 -1
- package/dist/presets/aws-amplify/runtime/aws-amplify.mjs +1 -1
- package/dist/presets/aws-lambda/runtime/_utils.d.mts +0 -5
- package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.d.mts +1 -1
- package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.mjs +9 -11
- package/dist/presets/aws-lambda/runtime/aws-lambda.d.mts +1 -1
- package/dist/presets/aws-lambda/runtime/aws-lambda.mjs +1 -1
- package/dist/presets/azure/runtime/azure-swa.d.mts +1 -1
- package/dist/presets/azure/runtime/azure-swa.mjs +1 -1
- package/dist/presets/bun/runtime/bun.d.mts +1 -1
- package/dist/presets/bun/runtime/bun.mjs +7 -8
- package/dist/presets/cloudflare/runtime/_module-handler.d.mts +3 -3
- package/dist/presets/cloudflare/runtime/_module-handler.mjs +19 -17
- package/dist/presets/cloudflare/runtime/cloudflare-durable.d.mts +1 -1
- package/dist/presets/cloudflare/runtime/cloudflare-durable.mjs +17 -16
- package/dist/presets/cloudflare/runtime/cloudflare-module.d.mts +1 -1
- package/dist/presets/cloudflare/runtime/cloudflare-module.mjs +8 -9
- package/dist/presets/cloudflare/runtime/cloudflare-pages.d.mts +1 -1
- package/dist/presets/cloudflare/runtime/cloudflare-pages.mjs +12 -18
- package/dist/presets/deno/runtime/deno-deploy.d.mts +1 -1
- package/dist/presets/deno/runtime/deno-deploy.mjs +4 -5
- package/dist/presets/deno/runtime/deno-server.d.mts +1 -1
- package/dist/presets/deno/runtime/deno-server.mjs +5 -6
- package/dist/presets/netlify/runtime/netlify-edge.d.mts +1 -2
- package/dist/presets/netlify/runtime/netlify-edge.mjs +3 -2
- package/dist/presets/netlify/runtime/netlify.d.mts +3 -2
- package/dist/presets/netlify/runtime/netlify.mjs +3 -1
- package/dist/presets/node/runtime/node-cluster.d.mts +1 -1
- package/dist/presets/node/runtime/node-cluster.mjs +5 -6
- package/dist/presets/node/runtime/node-middleware.d.mts +1 -1
- package/dist/presets/node/runtime/node-middleware.mjs +4 -5
- package/dist/presets/node/runtime/node-server.d.mts +1 -1
- package/dist/presets/node/runtime/node-server.mjs +5 -6
- package/dist/presets/standard/runtime/server.d.mts +1 -1
- package/dist/presets/standard/runtime/server.mjs +1 -1
- package/dist/presets/stormkit/runtime/stormkit.d.mts +1 -1
- package/dist/presets/stormkit/runtime/stormkit.mjs +1 -1
- package/dist/presets/vercel/runtime/isr.d.mts +2 -0
- package/dist/presets/vercel/runtime/isr.mjs +19 -0
- package/dist/presets/vercel/runtime/vercel.node.d.mts +1 -1
- package/dist/presets/vercel/runtime/vercel.node.mjs +16 -7
- package/dist/presets/vercel/runtime/vercel.web.d.mts +1 -1
- package/dist/presets/vercel/runtime/vercel.web.mjs +18 -13
- package/dist/presets/winterjs/runtime/winterjs.d.mts +1 -2
- package/dist/presets/winterjs/runtime/winterjs.mjs +1 -1
- package/dist/presets/zeabur/runtime/zeabur.d.mts +1 -1
- package/dist/presets/zeabur/runtime/zeabur.mjs +1 -1
- package/dist/runtime/app.d.mts +1 -1
- package/dist/runtime/app.mjs +1 -1
- package/dist/runtime/internal/app.d.mts +7 -3
- package/dist/runtime/internal/app.mjs +29 -22
- package/dist/runtime/internal/database.mjs +1 -1
- package/dist/runtime/internal/error/dev.d.mts +0 -1
- package/dist/runtime/internal/error/dev.mjs +1 -1
- package/dist/runtime/internal/route-rules.d.mts +0 -4
- package/dist/runtime/internal/routes/dev-tasks.mjs +1 -1
- package/dist/runtime/internal/routes/openapi.d.mts +0 -1
- package/dist/runtime/internal/routes/openapi.mjs +3 -3
- package/dist/runtime/internal/routes/renderer-template.dev.mjs +1 -1
- package/dist/runtime/internal/routes/renderer-template.mjs +1 -1
- package/dist/runtime/internal/routes/scalar.d.mts +0 -1
- package/dist/runtime/internal/routes/scalar.mjs +4 -4
- package/dist/runtime/internal/routes/swagger.d.mts +0 -1
- package/dist/runtime/internal/routes/swagger.mjs +3 -3
- package/dist/runtime/internal/runtime-config.mjs +8 -8
- package/dist/runtime/internal/static.mjs +1 -1
- package/dist/runtime/internal/storage.mjs +1 -1
- package/dist/runtime/internal/task.mjs +1 -1
- package/dist/runtime/internal/vite/dev-entry.mjs +3 -4
- package/dist/runtime/internal/vite/{dev-worker.mjs → node-runner.mjs} +51 -6
- package/dist/runtime/meta.d.mts +1 -1
- package/dist/runtime/meta.mjs +1 -1
- package/dist/runtime/nitro.d.mts +0 -3
- package/dist/runtime/nitro.mjs +1 -1
- package/dist/runtime/virtual/_runtime_warn.d.mts +1 -0
- package/dist/runtime/virtual/_runtime_warn.mjs +5 -0
- package/dist/runtime/virtual/database.d.mts +8 -0
- package/dist/runtime/virtual/database.mjs +2 -0
- package/dist/runtime/virtual/error-handler.d.mts +6 -0
- package/dist/runtime/virtual/error-handler.mjs +9 -0
- package/dist/runtime/virtual/feature-flags.d.mts +7 -0
- package/dist/runtime/virtual/feature-flags.mjs +7 -0
- package/dist/runtime/virtual/plugins.d.mts +3 -0
- package/dist/runtime/virtual/plugins.mjs +2 -0
- package/dist/runtime/virtual/polyfills.d.mts +3 -0
- package/dist/runtime/virtual/polyfills.mjs +2 -0
- package/dist/runtime/virtual/public-assets.d.mts +9 -0
- package/dist/runtime/virtual/public-assets.mjs +8 -0
- package/dist/runtime/virtual/renderer-template.d.mts +4 -0
- package/dist/runtime/virtual/renderer-template.mjs +7 -0
- package/dist/runtime/virtual/routing-meta.d.mts +7 -0
- package/dist/runtime/virtual/routing-meta.mjs +2 -0
- package/dist/runtime/virtual/routing.d.mts +8 -0
- package/dist/runtime/virtual/routing.mjs +11 -0
- package/dist/runtime/virtual/runtime-config.d.mts +3 -0
- package/dist/runtime/virtual/runtime-config.mjs +5 -0
- package/dist/runtime/virtual/server-assets.d.mts +6 -0
- package/dist/runtime/virtual/server-assets.mjs +12 -0
- package/dist/runtime/virtual/storage.d.mts +3 -0
- package/dist/runtime/virtual/storage.mjs +5 -0
- package/dist/runtime/virtual/tasks.d.mts +10 -0
- package/dist/runtime/virtual/tasks.mjs +3 -0
- package/dist/types/index.d.mts +292 -371
- package/dist/types/index.mjs +10 -0
- package/dist/vite.d.mts +7 -12
- package/dist/vite.mjs +734 -41
- package/lib/vite.types.d.mts +26 -0
- package/lib/vite.types.mjs +2 -0
- package/package.json +82 -53
- package/dist/_build/common2.mjs +0 -772
- package/dist/_build/vite.plugin.mjs +0 -768
- package/dist/_chunks/ANM1K1bE.mjs +0 -304
- package/dist/_chunks/BX9-zVkM.mjs +0 -59
- package/dist/_chunks/C7CbzoI1.mjs +0 -39
- package/dist/_libs/acorn.mjs +0 -5034
- package/dist/_libs/c12.mjs +0 -2858
- package/dist/_libs/commondir.mjs +0 -22
- package/dist/_libs/deepmerge.mjs +0 -86
- package/dist/_libs/dot-prop.mjs +0 -138
- package/dist/_libs/duplexer.mjs +0 -71
- package/dist/_libs/etag.mjs +0 -80
- package/dist/_libs/fdir.mjs +0 -514
- package/dist/_libs/function-bind.mjs +0 -63
- package/dist/_libs/giget.mjs +0 -19289
- package/dist/_libs/gzip-size.mjs +0 -21
- package/dist/_libs/hasown.mjs +0 -14
- package/dist/_libs/is-core-module.mjs +0 -220
- package/dist/_libs/is-module.mjs +0 -13
- package/dist/_libs/is-reference.mjs +0 -32
- package/dist/_libs/js-tokens.mjs +0 -382
- package/dist/_libs/knitwork.mjs +0 -124
- package/dist/_libs/local-pkg.mjs +0 -1686
- package/dist/_libs/magic-string.mjs +0 -939
- package/dist/_libs/mime.mjs +0 -1391
- package/dist/_libs/node-fetch-native.mjs +0 -173
- package/dist/_libs/path-parse.mjs +0 -47
- package/dist/_libs/pathe.mjs +0 -41
- package/dist/_libs/picomatch.mjs +0 -1673
- package/dist/_libs/plugin-replace.mjs +0 -104
- package/dist/_libs/pretty-bytes.mjs +0 -116
- package/dist/_libs/std-env.mjs +0 -158
- package/dist/_libs/strip-literal.mjs +0 -51
- package/dist/_libs/tinyglobby.mjs +0 -292
- package/dist/_libs/untyped.mjs +0 -271
- package/dist/_libs/unwasm.mjs +0 -5836
- package/dist/cli/_chunks/detect-acorn.mjs +0 -12
- package/dist/cli/_chunks/dist.mjs +0 -3
- package/dist/cli/_chunks/dist2.mjs +0 -3
- package/dist/cli/_chunks/dist3.mjs +0 -3
- package/dist/cli/_chunks/dist4.mjs +0 -4
- package/dist/cli/_chunks/dist5.mjs +0 -4
- package/dist/cli/_chunks/esm.mjs +0 -3
- package/dist/cli/_chunks/json5.mjs +0 -4
- package/dist/cli/_chunks/jsonc.mjs +0 -4
- package/dist/cli/_chunks/multipart-parser.mjs +0 -6
- package/dist/cli/_chunks/toml.mjs +0 -4
- package/dist/cli/_chunks/yaml.mjs +0 -4
- package/dist/node_modules/kleur/index.js +0 -110
- package/dist/node_modules/youch/build/chunk-OSUFJZHZ.js +0 -6
- package/lib/deps/ofetch.mjs +0 -1
- package/lib/deps/ofetch.mts +0 -1
- /package/dist/runtime/{vite-runtime.d.mts → vite.d.mts} +0 -0
- /package/dist/runtime/{vite-runtime.mjs → vite.mjs} +0 -0
- /package/lib/{deps/h3.d.mts → h3.d.mts} +0 -0
- /package/lib/{deps/h3.mjs → h3.mjs} +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import http, { IncomingMessage, OutgoingMessage } from "node:http";
|
|
2
|
+
import { EventEmitter } from "node:events";
|
|
3
|
+
import * as stream from "node:stream";
|
|
4
|
+
|
|
5
|
+
//#region node_modules/.pnpm/httpxy@0.1.7/node_modules/httpxy/dist/index.d.ts
|
|
6
|
+
interface ProxyTargetDetailed {
|
|
7
|
+
host: string;
|
|
8
|
+
port: number;
|
|
9
|
+
protocol?: string;
|
|
10
|
+
hostname?: string;
|
|
11
|
+
socketPath?: string;
|
|
12
|
+
key?: string;
|
|
13
|
+
passphrase?: string;
|
|
14
|
+
pfx?: Buffer | string;
|
|
15
|
+
cert?: string;
|
|
16
|
+
ca?: string;
|
|
17
|
+
ciphers?: string;
|
|
18
|
+
secureProtocol?: string;
|
|
19
|
+
}
|
|
20
|
+
type ProxyTarget = ProxyTargetUrl | ProxyTargetDetailed;
|
|
21
|
+
type ProxyTargetUrl = string | Partial<URL>;
|
|
22
|
+
interface ProxyServerOptions {
|
|
23
|
+
/** URL string to be parsed with the url module. */
|
|
24
|
+
target?: ProxyTarget;
|
|
25
|
+
/** URL string to be parsed with the url module. */
|
|
26
|
+
forward?: ProxyTargetUrl;
|
|
27
|
+
/** Object to be passed to http(s).request. */
|
|
28
|
+
agent?: any;
|
|
29
|
+
/** Object to be passed to https.createServer(). */
|
|
30
|
+
ssl?: any;
|
|
31
|
+
/** If you want to proxy websockets. */
|
|
32
|
+
ws?: boolean;
|
|
33
|
+
/** Adds x- forward headers. */
|
|
34
|
+
xfwd?: boolean;
|
|
35
|
+
/** Verify SSL certificate. */
|
|
36
|
+
secure?: boolean;
|
|
37
|
+
/** Explicitly specify if we are proxying to another proxy. */
|
|
38
|
+
toProxy?: boolean;
|
|
39
|
+
/** Specify whether you want to prepend the target's path to the proxy path. */
|
|
40
|
+
prependPath?: boolean;
|
|
41
|
+
/** Specify whether you want to ignore the proxy path of the incoming request. */
|
|
42
|
+
ignorePath?: boolean;
|
|
43
|
+
/** Local interface string to bind for outgoing connections. */
|
|
44
|
+
localAddress?: string;
|
|
45
|
+
/** Changes the origin of the host header to the target URL. */
|
|
46
|
+
changeOrigin?: boolean;
|
|
47
|
+
/** specify whether you want to keep letter case of response header key */
|
|
48
|
+
preserveHeaderKeyCase?: boolean;
|
|
49
|
+
/** Basic authentication i.e. 'user:password' to compute an Authorization header. */
|
|
50
|
+
auth?: string;
|
|
51
|
+
/** Rewrites the location hostname on (301 / 302 / 307 / 308) redirects, Default: null. */
|
|
52
|
+
hostRewrite?: string;
|
|
53
|
+
/** Rewrites the location host/ port on (301 / 302 / 307 / 308) redirects based on requested host/ port.Default: false. */
|
|
54
|
+
autoRewrite?: boolean;
|
|
55
|
+
/** Rewrites the location protocol on (301 / 302 / 307 / 308) redirects to 'http' or 'https'.Default: null. */
|
|
56
|
+
protocolRewrite?: string;
|
|
57
|
+
/** Rewrites domain of set-cookie headers. */
|
|
58
|
+
cookieDomainRewrite?: false | string | {
|
|
59
|
+
[oldDomain: string]: string;
|
|
60
|
+
};
|
|
61
|
+
/** Rewrites path of set-cookie headers. Default: false */
|
|
62
|
+
cookiePathRewrite?: false | string | {
|
|
63
|
+
[oldPath: string]: string;
|
|
64
|
+
};
|
|
65
|
+
/** Object with extra headers to be added to target requests. */
|
|
66
|
+
headers?: {
|
|
67
|
+
[header: string]: string;
|
|
68
|
+
};
|
|
69
|
+
/** Timeout (in milliseconds) when proxy receives no response from target. Default: 120000 (2 minutes) */
|
|
70
|
+
proxyTimeout?: number;
|
|
71
|
+
/** Timeout (in milliseconds) for incoming requests */
|
|
72
|
+
timeout?: number;
|
|
73
|
+
/** If set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the proxyRes event */
|
|
74
|
+
selfHandleResponse?: boolean;
|
|
75
|
+
/** Buffer */
|
|
76
|
+
buffer?: stream.Stream;
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
export { ProxyServerOptions as t };
|
package/dist/_libs/httpxy.mjs
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import { n as __exportAll } from "../_common.mjs";
|
|
1
2
|
import http from "node:http";
|
|
2
3
|
import https from "node:https";
|
|
3
4
|
import { EventEmitter } from "node:events";
|
|
4
5
|
|
|
5
6
|
//#region node_modules/.pnpm/httpxy@0.1.7/node_modules/httpxy/dist/index.mjs
|
|
7
|
+
var dist_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
ProxyServer: () => ProxyServer,
|
|
9
|
+
createProxyServer: () => createProxyServer
|
|
10
|
+
});
|
|
6
11
|
const upgradeHeader = /(^|,)\s*upgrade\s*($|,)/i;
|
|
7
12
|
const isSSL = /^https|wss/;
|
|
8
13
|
function setupOutgoing(outgoing, options, req, forward) {
|
|
@@ -407,4 +412,4 @@ function _createProxyFn(type, server) {
|
|
|
407
412
|
}
|
|
408
413
|
|
|
409
414
|
//#endregion
|
|
410
|
-
export {
|
|
415
|
+
export { dist_exports as n, createProxyServer as t };
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.d.mts
|
|
2
|
+
interface SourceMapOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the mapping should be high-resolution.
|
|
5
|
+
* Hi-res mappings map every single character, meaning (for example) your devtools will always
|
|
6
|
+
* be able to pinpoint the exact location of function calls and so on.
|
|
7
|
+
* With lo-res mappings, devtools may only be able to identify the correct
|
|
8
|
+
* line - but they're quicker to generate and less bulky.
|
|
9
|
+
* You can also set `"boundary"` to generate a semi-hi-res mappings segmented per word boundary
|
|
10
|
+
* instead of per character, suitable for string semantics that are separated by words.
|
|
11
|
+
* If sourcemap locations have been specified with s.addSourceMapLocation(), they will be used here.
|
|
12
|
+
*/
|
|
13
|
+
hires?: boolean | 'boundary';
|
|
14
|
+
/**
|
|
15
|
+
* The filename where you plan to write the sourcemap.
|
|
16
|
+
*/
|
|
17
|
+
file?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The filename of the file containing the original source.
|
|
20
|
+
*/
|
|
21
|
+
source?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Whether to include the original content in the map's sourcesContent array.
|
|
24
|
+
*/
|
|
25
|
+
includeContent?: boolean;
|
|
26
|
+
}
|
|
27
|
+
type SourceMapSegment = [number] | [number, number, number, number] | [number, number, number, number, number];
|
|
28
|
+
interface DecodedSourceMap {
|
|
29
|
+
file: string;
|
|
30
|
+
sources: string[];
|
|
31
|
+
sourcesContent?: string[];
|
|
32
|
+
names: string[];
|
|
33
|
+
mappings: SourceMapSegment[][];
|
|
34
|
+
x_google_ignoreList?: number[];
|
|
35
|
+
}
|
|
36
|
+
declare class SourceMap {
|
|
37
|
+
constructor(properties: DecodedSourceMap);
|
|
38
|
+
version: number;
|
|
39
|
+
file: string;
|
|
40
|
+
sources: string[];
|
|
41
|
+
sourcesContent?: string[];
|
|
42
|
+
names: string[];
|
|
43
|
+
mappings: string;
|
|
44
|
+
x_google_ignoreList?: number[];
|
|
45
|
+
debugId?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Returns the equivalent of `JSON.stringify(map)`
|
|
48
|
+
*/
|
|
49
|
+
toString(): string;
|
|
50
|
+
/**
|
|
51
|
+
* Returns a DataURI containing the sourcemap. Useful for doing this sort of thing:
|
|
52
|
+
* `generateMap(options?: SourceMapOptions): SourceMap;`
|
|
53
|
+
*/
|
|
54
|
+
toUrl(): string;
|
|
55
|
+
}
|
|
56
|
+
type ExclusionRange = [number, number];
|
|
57
|
+
interface MagicStringOptions {
|
|
58
|
+
filename?: string;
|
|
59
|
+
indentExclusionRanges?: ExclusionRange | Array<ExclusionRange>;
|
|
60
|
+
offset?: number;
|
|
61
|
+
}
|
|
62
|
+
interface IndentOptions {
|
|
63
|
+
exclude?: ExclusionRange | Array<ExclusionRange>;
|
|
64
|
+
indentStart?: boolean;
|
|
65
|
+
}
|
|
66
|
+
interface OverwriteOptions {
|
|
67
|
+
storeName?: boolean;
|
|
68
|
+
contentOnly?: boolean;
|
|
69
|
+
}
|
|
70
|
+
interface UpdateOptions {
|
|
71
|
+
storeName?: boolean;
|
|
72
|
+
overwrite?: boolean;
|
|
73
|
+
}
|
|
74
|
+
declare class MagicString {
|
|
75
|
+
constructor(str: string, options?: MagicStringOptions);
|
|
76
|
+
/**
|
|
77
|
+
* Adds the specified character index (with respect to the original string) to sourcemap mappings, if `hires` is false.
|
|
78
|
+
*/
|
|
79
|
+
addSourcemapLocation(char: number): void;
|
|
80
|
+
/**
|
|
81
|
+
* Appends the specified content to the end of the string.
|
|
82
|
+
*/
|
|
83
|
+
append(content: string): this;
|
|
84
|
+
/**
|
|
85
|
+
* Appends the specified content at the index in the original string.
|
|
86
|
+
* If a range *ending* with index is subsequently moved, the insert will be moved with it.
|
|
87
|
+
* See also `s.prependLeft(...)`.
|
|
88
|
+
*/
|
|
89
|
+
appendLeft(index: number, content: string): this;
|
|
90
|
+
/**
|
|
91
|
+
* Appends the specified content at the index in the original string.
|
|
92
|
+
* If a range *starting* with index is subsequently moved, the insert will be moved with it.
|
|
93
|
+
* See also `s.prependRight(...)`.
|
|
94
|
+
*/
|
|
95
|
+
appendRight(index: number, content: string): this;
|
|
96
|
+
/**
|
|
97
|
+
* Does what you'd expect.
|
|
98
|
+
*/
|
|
99
|
+
clone(): this;
|
|
100
|
+
/**
|
|
101
|
+
* Generates a version 3 sourcemap.
|
|
102
|
+
*/
|
|
103
|
+
generateMap(options?: SourceMapOptions): SourceMap;
|
|
104
|
+
/**
|
|
105
|
+
* Generates a sourcemap object with raw mappings in array form, rather than encoded as a string.
|
|
106
|
+
* Useful if you need to manipulate the sourcemap further, but most of the time you will use `generateMap` instead.
|
|
107
|
+
*/
|
|
108
|
+
generateDecodedMap(options?: SourceMapOptions): DecodedSourceMap;
|
|
109
|
+
getIndentString(): string;
|
|
110
|
+
/**
|
|
111
|
+
* Prefixes each line of the string with prefix.
|
|
112
|
+
* If prefix is not supplied, the indentation will be guessed from the original content, falling back to a single tab character.
|
|
113
|
+
*/
|
|
114
|
+
indent(options?: IndentOptions): this;
|
|
115
|
+
/**
|
|
116
|
+
* Prefixes each line of the string with prefix.
|
|
117
|
+
* If prefix is not supplied, the indentation will be guessed from the original content, falling back to a single tab character.
|
|
118
|
+
*
|
|
119
|
+
* The options argument can have an exclude property, which is an array of [start, end] character ranges.
|
|
120
|
+
* These ranges will be excluded from the indentation - useful for (e.g.) multiline strings.
|
|
121
|
+
*/
|
|
122
|
+
indent(indentStr?: string, options?: IndentOptions): this;
|
|
123
|
+
indentExclusionRanges: ExclusionRange | Array<ExclusionRange>;
|
|
124
|
+
/**
|
|
125
|
+
* Moves the characters from `start` and `end` to `index`.
|
|
126
|
+
*/
|
|
127
|
+
move(start: number, end: number, index: number): this;
|
|
128
|
+
/**
|
|
129
|
+
* Replaces the characters from `start` to `end` with `content`, along with the appended/prepended content in
|
|
130
|
+
* that range. The same restrictions as `s.remove()` apply.
|
|
131
|
+
*
|
|
132
|
+
* The fourth argument is optional. It can have a storeName property — if true, the original name will be stored
|
|
133
|
+
* for later inclusion in a sourcemap's names array — and a contentOnly property which determines whether only
|
|
134
|
+
* the content is overwritten, or anything that was appended/prepended to the range as well.
|
|
135
|
+
*
|
|
136
|
+
* It may be preferred to use `s.update(...)` instead if you wish to avoid overwriting the appended/prepended content.
|
|
137
|
+
*/
|
|
138
|
+
overwrite(start: number, end: number, content: string, options?: boolean | OverwriteOptions): this;
|
|
139
|
+
/**
|
|
140
|
+
* Replaces the characters from `start` to `end` with `content`. The same restrictions as `s.remove()` apply.
|
|
141
|
+
*
|
|
142
|
+
* The fourth argument is optional. It can have a storeName property — if true, the original name will be stored
|
|
143
|
+
* for later inclusion in a sourcemap's names array — and an overwrite property which determines whether only
|
|
144
|
+
* the content is overwritten, or anything that was appended/prepended to the range as well.
|
|
145
|
+
*/
|
|
146
|
+
update(start: number, end: number, content: string, options?: boolean | UpdateOptions): this;
|
|
147
|
+
/**
|
|
148
|
+
* Prepends the string with the specified content.
|
|
149
|
+
*/
|
|
150
|
+
prepend(content: string): this;
|
|
151
|
+
/**
|
|
152
|
+
* Same as `s.appendLeft(...)`, except that the inserted content will go *before* any previous appends or prepends at index
|
|
153
|
+
*/
|
|
154
|
+
prependLeft(index: number, content: string): this;
|
|
155
|
+
/**
|
|
156
|
+
* Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index`
|
|
157
|
+
*/
|
|
158
|
+
prependRight(index: number, content: string): this;
|
|
159
|
+
/**
|
|
160
|
+
* Removes the characters from `start` to `end` (of the original string, **not** the generated string).
|
|
161
|
+
* Removing the same content twice, or making removals that partially overlap, will cause an error.
|
|
162
|
+
*/
|
|
163
|
+
remove(start: number, end: number): this;
|
|
164
|
+
/**
|
|
165
|
+
* Reset the modified characters from `start` to `end` (of the original string, **not** the generated string).
|
|
166
|
+
*/
|
|
167
|
+
reset(start: number, end: number): this;
|
|
168
|
+
/**
|
|
169
|
+
* Returns the content of the generated string that corresponds to the slice between `start` and `end` of the original string.
|
|
170
|
+
* Throws error if the indices are for characters that were already removed.
|
|
171
|
+
*/
|
|
172
|
+
slice(start: number, end: number): string;
|
|
173
|
+
/**
|
|
174
|
+
* Returns a clone of `s`, with all content before the `start` and `end` characters of the original string removed.
|
|
175
|
+
*/
|
|
176
|
+
snip(start: number, end: number): this;
|
|
177
|
+
/**
|
|
178
|
+
* Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start and end.
|
|
179
|
+
*/
|
|
180
|
+
trim(charType?: string): this;
|
|
181
|
+
/**
|
|
182
|
+
* Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start.
|
|
183
|
+
*/
|
|
184
|
+
trimStart(charType?: string): this;
|
|
185
|
+
/**
|
|
186
|
+
* Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the end.
|
|
187
|
+
*/
|
|
188
|
+
trimEnd(charType?: string): this;
|
|
189
|
+
/**
|
|
190
|
+
* Removes empty lines from the start and end.
|
|
191
|
+
*/
|
|
192
|
+
trimLines(): this;
|
|
193
|
+
/**
|
|
194
|
+
* String replacement with RegExp or string.
|
|
195
|
+
*/
|
|
196
|
+
replace(regex: RegExp | string, replacement: string | ((substring: string, ...args: any[]) => string)): this;
|
|
197
|
+
/**
|
|
198
|
+
* Same as `s.replace`, but replace all matched strings instead of just one.
|
|
199
|
+
*/
|
|
200
|
+
replaceAll(regex: RegExp | string, replacement: string | ((substring: string, ...args: any[]) => string)): this;
|
|
201
|
+
lastChar(): string;
|
|
202
|
+
lastLine(): string;
|
|
203
|
+
/**
|
|
204
|
+
* Returns true if the resulting source is empty (disregarding white space).
|
|
205
|
+
*/
|
|
206
|
+
isEmpty(): boolean;
|
|
207
|
+
length(): number;
|
|
208
|
+
/**
|
|
209
|
+
* Indicates if the string has been changed.
|
|
210
|
+
*/
|
|
211
|
+
hasChanged(): boolean;
|
|
212
|
+
original: string;
|
|
213
|
+
/**
|
|
214
|
+
* Returns the generated string.
|
|
215
|
+
*/
|
|
216
|
+
toString(): string;
|
|
217
|
+
offset: number;
|
|
218
|
+
}
|
|
219
|
+
//#endregion
|
|
220
|
+
export { MagicString as t };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Represents a general structure for ECMAScript module exports.
|
|
4
|
+
*/
|
|
5
|
+
interface ESMExport {
|
|
6
|
+
/**
|
|
7
|
+
* Optional explicit type for complex scenarios, often used internally.
|
|
8
|
+
* @optional
|
|
9
|
+
*/
|
|
10
|
+
_type?: "declaration" | "named" | "default" | "star";
|
|
11
|
+
/**
|
|
12
|
+
* The type of export (declaration, named, default or star).
|
|
13
|
+
*/
|
|
14
|
+
type: "declaration" | "named" | "default" | "star";
|
|
15
|
+
/**
|
|
16
|
+
* The specific type of declaration being exported, if applicable.
|
|
17
|
+
* @optional
|
|
18
|
+
*/
|
|
19
|
+
declarationType?: "let" | "var" | "const" | "enum" | "const enum" | "class" | "function" | "async function";
|
|
20
|
+
/**
|
|
21
|
+
* The full code snippet of the export statement.
|
|
22
|
+
*/
|
|
23
|
+
code: string;
|
|
24
|
+
/**
|
|
25
|
+
* The starting position (index) of the export declaration in the source code.
|
|
26
|
+
*/
|
|
27
|
+
start: number;
|
|
28
|
+
/**
|
|
29
|
+
* The end position (index) of the export declaration in the source code.
|
|
30
|
+
*/
|
|
31
|
+
end: number;
|
|
32
|
+
/**
|
|
33
|
+
* The name of the variable, function or class being exported, if given explicitly.
|
|
34
|
+
* @optional
|
|
35
|
+
*/
|
|
36
|
+
name?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The name used for default exports when a specific identifier isn't given.
|
|
39
|
+
* @optional
|
|
40
|
+
*/
|
|
41
|
+
defaultName?: string;
|
|
42
|
+
/**
|
|
43
|
+
* An array of names to export, applicable to named and destructured exports.
|
|
44
|
+
*/
|
|
45
|
+
names: string[];
|
|
46
|
+
/**
|
|
47
|
+
* The module specifier, if any, from which exports are being re-exported.
|
|
48
|
+
* @optional
|
|
49
|
+
*/
|
|
50
|
+
specifier?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Represents a declaration export within an ECMAScript module.
|
|
54
|
+
* Extends {@link ESMExport}.
|
|
55
|
+
*/
|
|
56
|
+
//#endregion
|
|
57
|
+
export { ESMExport as t };
|