nitropack-nightly 0.0.0 → 2.7.0-28295301.f3f2acb
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/LICENSE +21 -0
- package/README.md +36 -0
- package/config.d.ts +1 -0
- package/dist/chunks/build.mjs +93 -0
- package/dist/chunks/dev.mjs +121 -0
- package/dist/chunks/prepare.mjs +74 -0
- package/dist/cli/index.d.mts +2 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.mjs +17 -0
- package/dist/config.d.mts +26 -0
- package/dist/config.d.ts +26 -0
- package/dist/config.mjs +5 -0
- package/dist/index.d.mts +111 -0
- package/dist/index.d.ts +111 -0
- package/dist/index.mjs +64 -0
- package/dist/runtime/app.d.ts +14 -0
- package/dist/runtime/app.mjs +152 -0
- package/dist/runtime/cache.d.ts +39 -0
- package/dist/runtime/cache.mjs +290 -0
- package/dist/runtime/client.d.ts +1 -0
- package/dist/runtime/client.mjs +4 -0
- package/dist/runtime/config.d.ts +6 -0
- package/dist/runtime/config.mjs +80 -0
- package/dist/runtime/context.d.ts +15 -0
- package/dist/runtime/context.mjs +17 -0
- package/dist/runtime/debug.d.ts +2 -0
- package/dist/runtime/debug.mjs +5 -0
- package/dist/runtime/entries/aws-lambda.d.ts +4 -0
- package/dist/runtime/entries/aws-lambda.mjs +44 -0
- package/dist/runtime/entries/azure-functions.d.ts +5 -0
- package/dist/runtime/entries/azure-functions.mjs +21 -0
- package/dist/runtime/entries/azure.d.ts +5 -0
- package/dist/runtime/entries/azure.mjs +28 -0
- package/dist/runtime/entries/bun.d.ts +1 -0
- package/dist/runtime/entries/bun.mjs +21 -0
- package/dist/runtime/entries/cli.d.ts +1 -0
- package/dist/runtime/entries/cli.mjs +20 -0
- package/dist/runtime/entries/cloudflare-module.d.ts +9 -0
- package/dist/runtime/entries/cloudflare-module.mjs +69 -0
- package/dist/runtime/entries/cloudflare-pages.d.ts +19 -0
- package/dist/runtime/entries/cloudflare-pages.mjs +33 -0
- package/dist/runtime/entries/cloudflare.d.ts +1 -0
- package/dist/runtime/entries/cloudflare.mjs +58 -0
- package/dist/runtime/entries/deno-deploy.d.ts +1 -0
- package/dist/runtime/entries/deno-deploy.mjs +21 -0
- package/dist/runtime/entries/deno-server.d.ts +3 -0
- package/dist/runtime/entries/deno-server.mjs +57 -0
- package/dist/runtime/entries/firebase-gen-1.d.ts +2 -0
- package/dist/runtime/entries/firebase-gen-1.mjs +7 -0
- package/dist/runtime/entries/firebase-gen-2.d.ts +2 -0
- package/dist/runtime/entries/firebase-gen-2.mjs +14 -0
- package/dist/runtime/entries/firebase-gen-default.d.ts +1 -0
- package/dist/runtime/entries/firebase-gen-default.mjs +1 -0
- package/dist/runtime/entries/lagon.d.ts +2 -0
- package/dist/runtime/entries/lagon.mjs +17 -0
- package/dist/runtime/entries/netlify-builder.d.ts +1 -0
- package/dist/runtime/entries/netlify-builder.mjs +3 -0
- package/dist/runtime/entries/netlify-edge.d.ts +2 -0
- package/dist/runtime/entries/netlify-edge.mjs +24 -0
- package/dist/runtime/entries/netlify-lambda.d.ts +3 -0
- package/dist/runtime/entries/netlify-lambda.mjs +38 -0
- package/dist/runtime/entries/netlify.d.ts +3 -0
- package/dist/runtime/entries/netlify.mjs +21 -0
- package/dist/runtime/entries/nitro-dev.d.ts +1 -0
- package/dist/runtime/entries/nitro-dev.mjs +42 -0
- package/dist/runtime/entries/nitro-prerenderer.d.ts +2 -0
- package/dist/runtime/entries/nitro-prerenderer.mjs +5 -0
- package/dist/runtime/entries/node-cluster.d.ts +1 -0
- package/dist/runtime/entries/node-cluster.mjs +58 -0
- package/dist/runtime/entries/node-server.d.ts +3 -0
- package/dist/runtime/entries/node-server.mjs +33 -0
- package/dist/runtime/entries/node.d.ts +4 -0
- package/dist/runtime/entries/node.mjs +7 -0
- package/dist/runtime/entries/service-worker.d.ts +1 -0
- package/dist/runtime/entries/service-worker.mjs +30 -0
- package/dist/runtime/entries/stormkit.d.ts +21 -0
- package/dist/runtime/entries/stormkit.mjs +31 -0
- package/dist/runtime/entries/vercel-edge.d.ts +2 -0
- package/dist/runtime/entries/vercel-edge.mjs +21 -0
- package/dist/runtime/entries/vercel.d.ts +4 -0
- package/dist/runtime/entries/vercel.mjs +15 -0
- package/dist/runtime/error.d.ts +3 -0
- package/dist/runtime/error.mjs +66 -0
- package/dist/runtime/index.d.ts +8 -0
- package/dist/runtime/index.mjs +8 -0
- package/dist/runtime/lib/http-graceful-shutdown.d.ts +16 -0
- package/dist/runtime/lib/http-graceful-shutdown.mjs +213 -0
- package/dist/runtime/plugin.d.ts +6 -0
- package/dist/runtime/plugin.mjs +4 -0
- package/dist/runtime/polyfill/deno-env.d.ts +0 -0
- package/dist/runtime/polyfill/deno-env.mjs +1 -0
- package/dist/runtime/renderer.d.ts +9 -0
- package/dist/runtime/renderer.mjs +38 -0
- package/dist/runtime/route-rules.d.ts +7 -0
- package/dist/runtime/route-rules.mjs +59 -0
- package/dist/runtime/routes/openapi.d.ts +3 -0
- package/dist/runtime/routes/openapi.mjs +70 -0
- package/dist/runtime/routes/swagger.d.ts +2 -0
- package/dist/runtime/routes/swagger.mjs +13 -0
- package/dist/runtime/shutdown.d.ts +10 -0
- package/dist/runtime/shutdown.mjs +34 -0
- package/dist/runtime/static.d.ts +2 -0
- package/dist/runtime/static.mjs +89 -0
- package/dist/runtime/storage.d.ts +2 -0
- package/dist/runtime/storage.mjs +5 -0
- package/dist/runtime/timing.d.ts +2 -0
- package/dist/runtime/timing.mjs +29 -0
- package/dist/runtime/types.d.ts +21 -0
- package/dist/runtime/types.mjs +0 -0
- package/dist/runtime/utils.azure.d.ts +2 -0
- package/dist/runtime/utils.azure.mjs +51 -0
- package/dist/runtime/utils.d.ts +19 -0
- package/dist/runtime/utils.lambda.d.ts +14 -0
- package/dist/runtime/utils.lambda.mjs +60 -0
- package/dist/runtime/utils.mjs +95 -0
- package/dist/runtime/virtual/app-config.d.ts +3 -0
- package/dist/runtime/virtual/error-handler.d.ts +5 -0
- package/dist/runtime/virtual/plugins.d.ts +3 -0
- package/dist/runtime/virtual/polyfills.d.ts +2 -0
- package/dist/runtime/virtual/polyfills.mjs +1 -0
- package/dist/runtime/virtual/public-assets.d.ts +14 -0
- package/dist/runtime/virtual/server-assets.d.ts +8 -0
- package/dist/runtime/virtual/server-handlers.d.ts +21 -0
- package/dist/runtime/virtual/storage.d.ts +3 -0
- package/dist/shared/nitro.1d09f0ca.mjs +13 -0
- package/dist/shared/nitro.59ad80f8.mjs +4783 -0
- package/dist/shared/nitro.99b3af2a.d.mts +823 -0
- package/dist/shared/nitro.99b3af2a.d.ts +823 -0
- package/dist/shared/nitro.b8baef9b.mjs +396 -0
- package/dist/shared/nitro.f9eb871d.mjs +197 -0
- package/dist/shared/nitro.fb9251de.mjs +316 -0
- package/package.json +175 -1
- package/types.d.ts +2 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Pooya Parsa <pooya@pi0.io> and Nitro contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<p>
|
|
2
|
+
<a href="https://nitro.unjs.io" target="_blank" rel="noopener noreferrer">
|
|
3
|
+
<img src="./docs/public/cover.png" alt="Nitro logo">
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
<p>
|
|
7
|
+
<a href="https://npmjs.com/package/nitropack"><img src="https://img.shields.io/npm/v/nitropack?style=flat&colorA=18181B&colorB=d8c449" alt="npm version"></a>
|
|
8
|
+
<a href="https://npmjs.com/package/nitropack"><img src="https://img.shields.io/npm/dm/nitropack?style=flat&colorA=18181B&colorB=d8c449" alt="npm downloads"></a>
|
|
9
|
+
<a href="https://github.com/unjs/nitro/blob/main/LICENSE"><img src="https://img.shields.io/github/license/unjs/nitro.svg?style=flat&colorA=18181B&colorB=d8c449" alt="License"></a>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
# Nitro
|
|
13
|
+
|
|
14
|
+
Create web servers that run *anywhere*. The open engine powering [Nuxt](https://nuxt.com) and [open to everyone](https://github.com/unjs/nitro/discussions/1015).
|
|
15
|
+
|
|
16
|
+
- 🐇 Rapid development with HMR
|
|
17
|
+
- 😌 Provider agnostic deployments with 15+ built-in presets
|
|
18
|
+
- 💼 Portable and compact output
|
|
19
|
+
- 📁 Directory structure conventions
|
|
20
|
+
- 🤏 Minimal design
|
|
21
|
+
- 🚀 Code-splitting
|
|
22
|
+
- 👕 TypeScript support
|
|
23
|
+
- 💾 Universal storage
|
|
24
|
+
- 💰 Route caching
|
|
25
|
+
- 🐱 Hackable
|
|
26
|
+
- ✨ Auto Imports
|
|
27
|
+
|
|
28
|
+
📖 Read [the documentation](https://nitro.unjs.io) to learn more or directly jump to the [getting started](https://nitro.unjs.io/guide/getting-started).
|
|
29
|
+
|
|
30
|
+
## Contribution
|
|
31
|
+
|
|
32
|
+
See [contribution guide](https://nitro.unjs.io/guide/community/contributing).
|
|
33
|
+
|
|
34
|
+
## License
|
|
35
|
+
|
|
36
|
+
Made with 💛 Published under the [MIT](./LICENSE) license.
|
package/config.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dist/config";
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { defineCommand } from 'citty';
|
|
2
|
+
import { resolve } from 'pathe';
|
|
3
|
+
import { a as createNitro, p as prepare, c as copyPublicAssets, b as build$1 } from '../shared/nitro.59ad80f8.mjs';
|
|
4
|
+
import { p as prerender } from '../shared/nitro.fb9251de.mjs';
|
|
5
|
+
import { c as commonArgs } from '../shared/nitro.1d09f0ca.mjs';
|
|
6
|
+
import 'node:fs';
|
|
7
|
+
import 'pathe/utils';
|
|
8
|
+
import 'rollup';
|
|
9
|
+
import 'fs-extra';
|
|
10
|
+
import 'defu';
|
|
11
|
+
import 'chokidar';
|
|
12
|
+
import 'knitwork';
|
|
13
|
+
import 'perfect-debounce';
|
|
14
|
+
import 'globby';
|
|
15
|
+
import 'mlly';
|
|
16
|
+
import 'pretty-bytes';
|
|
17
|
+
import 'gzip-size';
|
|
18
|
+
import 'chalk';
|
|
19
|
+
import 'std-env';
|
|
20
|
+
import 'node:url';
|
|
21
|
+
import 'node:module';
|
|
22
|
+
import '@rollup/plugin-commonjs';
|
|
23
|
+
import '@rollup/plugin-alias';
|
|
24
|
+
import '@rollup/plugin-json';
|
|
25
|
+
import '@rollup/plugin-inject';
|
|
26
|
+
import '@rollup/plugin-node-resolve';
|
|
27
|
+
import 'rollup-plugin-visualizer';
|
|
28
|
+
import 'unenv';
|
|
29
|
+
import 'unimport/unplugin';
|
|
30
|
+
import 'ohash';
|
|
31
|
+
import '../shared/nitro.f9eb871d.mjs';
|
|
32
|
+
import '@rollup/plugin-replace';
|
|
33
|
+
import 'node:crypto';
|
|
34
|
+
import 'node:path';
|
|
35
|
+
import '@rollup/plugin-wasm';
|
|
36
|
+
import 'node:os';
|
|
37
|
+
import 'pkg-types';
|
|
38
|
+
import '@vercel/nft';
|
|
39
|
+
import 'semver';
|
|
40
|
+
import 'consola';
|
|
41
|
+
import 'etag';
|
|
42
|
+
import 'mime';
|
|
43
|
+
import 'unstorage';
|
|
44
|
+
import 'esbuild';
|
|
45
|
+
import '@rollup/pluginutils';
|
|
46
|
+
import 'node:zlib';
|
|
47
|
+
import 'node:fs/promises';
|
|
48
|
+
import 'hookable';
|
|
49
|
+
import 'unimport';
|
|
50
|
+
import 'c12';
|
|
51
|
+
import 'klona/full';
|
|
52
|
+
import 'scule';
|
|
53
|
+
import 'escape-string-regexp';
|
|
54
|
+
import 'ufo';
|
|
55
|
+
import 'jiti';
|
|
56
|
+
import 'dot-prop';
|
|
57
|
+
import 'archiver';
|
|
58
|
+
import 'magic-string';
|
|
59
|
+
import 'radix3';
|
|
60
|
+
|
|
61
|
+
const build = defineCommand({
|
|
62
|
+
meta: {
|
|
63
|
+
name: "build",
|
|
64
|
+
description: "Build nitro project for production"
|
|
65
|
+
},
|
|
66
|
+
args: {
|
|
67
|
+
...commonArgs,
|
|
68
|
+
minify: {
|
|
69
|
+
type: "boolean",
|
|
70
|
+
description: "Minify the output (overides preset defaults you can also use `--no-minify` to disable)."
|
|
71
|
+
},
|
|
72
|
+
preset: {
|
|
73
|
+
type: "string",
|
|
74
|
+
description: "The build preset to use (you can also use `NITRO_PRESET` environment variable)."
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
async run({ args }) {
|
|
78
|
+
const rootDir = resolve(args.dir || args._dir || ".");
|
|
79
|
+
const nitro = await createNitro({
|
|
80
|
+
rootDir,
|
|
81
|
+
dev: false,
|
|
82
|
+
minify: args.minify,
|
|
83
|
+
preset: args.preset
|
|
84
|
+
});
|
|
85
|
+
await prepare(nitro);
|
|
86
|
+
await copyPublicAssets(nitro);
|
|
87
|
+
await prerender(nitro);
|
|
88
|
+
await build$1(nitro);
|
|
89
|
+
await nitro.close();
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
export { build as default };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { defineCommand } from 'citty';
|
|
2
|
+
import { resolve } from 'pathe';
|
|
3
|
+
import { consola } from 'consola';
|
|
4
|
+
import { getArgs, parseArgs } from 'listhen/cli';
|
|
5
|
+
import { a as createNitro, p as prepare, b as build } from '../shared/nitro.59ad80f8.mjs';
|
|
6
|
+
import { c as createDevServer } from '../shared/nitro.b8baef9b.mjs';
|
|
7
|
+
import { c as commonArgs } from '../shared/nitro.1d09f0ca.mjs';
|
|
8
|
+
import 'node:fs';
|
|
9
|
+
import 'pathe/utils';
|
|
10
|
+
import 'rollup';
|
|
11
|
+
import 'fs-extra';
|
|
12
|
+
import 'defu';
|
|
13
|
+
import 'chokidar';
|
|
14
|
+
import 'knitwork';
|
|
15
|
+
import 'perfect-debounce';
|
|
16
|
+
import 'globby';
|
|
17
|
+
import 'mlly';
|
|
18
|
+
import 'pretty-bytes';
|
|
19
|
+
import 'gzip-size';
|
|
20
|
+
import 'chalk';
|
|
21
|
+
import 'std-env';
|
|
22
|
+
import 'node:url';
|
|
23
|
+
import 'node:module';
|
|
24
|
+
import '@rollup/plugin-commonjs';
|
|
25
|
+
import '@rollup/plugin-alias';
|
|
26
|
+
import '@rollup/plugin-json';
|
|
27
|
+
import '@rollup/plugin-inject';
|
|
28
|
+
import '@rollup/plugin-node-resolve';
|
|
29
|
+
import 'rollup-plugin-visualizer';
|
|
30
|
+
import 'unenv';
|
|
31
|
+
import 'unimport/unplugin';
|
|
32
|
+
import 'ohash';
|
|
33
|
+
import '../shared/nitro.f9eb871d.mjs';
|
|
34
|
+
import '@rollup/plugin-replace';
|
|
35
|
+
import 'node:crypto';
|
|
36
|
+
import 'node:path';
|
|
37
|
+
import '@rollup/plugin-wasm';
|
|
38
|
+
import 'node:os';
|
|
39
|
+
import 'pkg-types';
|
|
40
|
+
import '@vercel/nft';
|
|
41
|
+
import 'semver';
|
|
42
|
+
import 'etag';
|
|
43
|
+
import 'mime';
|
|
44
|
+
import 'unstorage';
|
|
45
|
+
import 'esbuild';
|
|
46
|
+
import '@rollup/pluginutils';
|
|
47
|
+
import 'node:zlib';
|
|
48
|
+
import 'node:fs/promises';
|
|
49
|
+
import 'hookable';
|
|
50
|
+
import 'unimport';
|
|
51
|
+
import 'c12';
|
|
52
|
+
import 'klona/full';
|
|
53
|
+
import 'scule';
|
|
54
|
+
import 'escape-string-regexp';
|
|
55
|
+
import 'ufo';
|
|
56
|
+
import 'jiti';
|
|
57
|
+
import 'dot-prop';
|
|
58
|
+
import 'archiver';
|
|
59
|
+
import 'magic-string';
|
|
60
|
+
import 'node:worker_threads';
|
|
61
|
+
import 'h3';
|
|
62
|
+
import 'httpxy';
|
|
63
|
+
import 'listhen';
|
|
64
|
+
import 'serve-placeholder';
|
|
65
|
+
import 'serve-static';
|
|
66
|
+
|
|
67
|
+
const hmrKeyRe = /^runtimeConfig\.|routeRules\./;
|
|
68
|
+
const dev = defineCommand({
|
|
69
|
+
meta: {
|
|
70
|
+
name: "dev",
|
|
71
|
+
description: "Start the development server"
|
|
72
|
+
},
|
|
73
|
+
args: {
|
|
74
|
+
...commonArgs,
|
|
75
|
+
...getArgs()
|
|
76
|
+
},
|
|
77
|
+
async run({ args }) {
|
|
78
|
+
const rootDir = resolve(args.dir || args._dir || ".");
|
|
79
|
+
let nitro;
|
|
80
|
+
const reload = async () => {
|
|
81
|
+
if (nitro) {
|
|
82
|
+
consola.info("Restarting dev server...");
|
|
83
|
+
if ("unwatch" in nitro.options._c12) {
|
|
84
|
+
await nitro.options._c12.unwatch();
|
|
85
|
+
}
|
|
86
|
+
await nitro.close();
|
|
87
|
+
}
|
|
88
|
+
nitro = await createNitro(
|
|
89
|
+
{
|
|
90
|
+
rootDir,
|
|
91
|
+
dev: true,
|
|
92
|
+
preset: "nitro-dev"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
watch: true,
|
|
96
|
+
c12: {
|
|
97
|
+
async onUpdate({ getDiff, newConfig }) {
|
|
98
|
+
const diff = getDiff();
|
|
99
|
+
if (diff.length === 0) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
consola.info(
|
|
103
|
+
"Nitro config updated:\n" + diff.map((entry) => ` ${entry.toString()}`).join("\n")
|
|
104
|
+
);
|
|
105
|
+
await (diff.every((e) => hmrKeyRe.test(e.key)) ? nitro.updateConfig(newConfig.config) : reload());
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
nitro.hooks.hookOnce("restart", reload);
|
|
111
|
+
const server = createDevServer(nitro);
|
|
112
|
+
const listhenOptions = parseArgs(args);
|
|
113
|
+
await server.listen(listhenOptions.port, listhenOptions);
|
|
114
|
+
await prepare(nitro);
|
|
115
|
+
await build(nitro);
|
|
116
|
+
};
|
|
117
|
+
await reload();
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
export { dev as default };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { defineCommand } from 'citty';
|
|
2
|
+
import { resolve } from 'pathe';
|
|
3
|
+
import { a as createNitro, w as writeTypes } from '../shared/nitro.59ad80f8.mjs';
|
|
4
|
+
import { c as commonArgs } from '../shared/nitro.1d09f0ca.mjs';
|
|
5
|
+
import 'node:fs';
|
|
6
|
+
import 'pathe/utils';
|
|
7
|
+
import 'rollup';
|
|
8
|
+
import 'fs-extra';
|
|
9
|
+
import 'defu';
|
|
10
|
+
import 'chokidar';
|
|
11
|
+
import 'knitwork';
|
|
12
|
+
import 'perfect-debounce';
|
|
13
|
+
import 'globby';
|
|
14
|
+
import 'mlly';
|
|
15
|
+
import 'pretty-bytes';
|
|
16
|
+
import 'gzip-size';
|
|
17
|
+
import 'chalk';
|
|
18
|
+
import 'std-env';
|
|
19
|
+
import 'node:url';
|
|
20
|
+
import 'node:module';
|
|
21
|
+
import '@rollup/plugin-commonjs';
|
|
22
|
+
import '@rollup/plugin-alias';
|
|
23
|
+
import '@rollup/plugin-json';
|
|
24
|
+
import '@rollup/plugin-inject';
|
|
25
|
+
import '@rollup/plugin-node-resolve';
|
|
26
|
+
import 'rollup-plugin-visualizer';
|
|
27
|
+
import 'unenv';
|
|
28
|
+
import 'unimport/unplugin';
|
|
29
|
+
import 'ohash';
|
|
30
|
+
import '../shared/nitro.f9eb871d.mjs';
|
|
31
|
+
import '@rollup/plugin-replace';
|
|
32
|
+
import 'node:crypto';
|
|
33
|
+
import 'node:path';
|
|
34
|
+
import '@rollup/plugin-wasm';
|
|
35
|
+
import 'node:os';
|
|
36
|
+
import 'pkg-types';
|
|
37
|
+
import '@vercel/nft';
|
|
38
|
+
import 'semver';
|
|
39
|
+
import 'consola';
|
|
40
|
+
import 'etag';
|
|
41
|
+
import 'mime';
|
|
42
|
+
import 'unstorage';
|
|
43
|
+
import 'esbuild';
|
|
44
|
+
import '@rollup/pluginutils';
|
|
45
|
+
import 'node:zlib';
|
|
46
|
+
import 'node:fs/promises';
|
|
47
|
+
import 'hookable';
|
|
48
|
+
import 'unimport';
|
|
49
|
+
import 'c12';
|
|
50
|
+
import 'klona/full';
|
|
51
|
+
import 'scule';
|
|
52
|
+
import 'escape-string-regexp';
|
|
53
|
+
import 'ufo';
|
|
54
|
+
import 'jiti';
|
|
55
|
+
import 'dot-prop';
|
|
56
|
+
import 'archiver';
|
|
57
|
+
import 'magic-string';
|
|
58
|
+
|
|
59
|
+
const prepare = defineCommand({
|
|
60
|
+
meta: {
|
|
61
|
+
name: "prepare",
|
|
62
|
+
description: "Generate types for the project"
|
|
63
|
+
},
|
|
64
|
+
args: {
|
|
65
|
+
...commonArgs
|
|
66
|
+
},
|
|
67
|
+
async run({ args }) {
|
|
68
|
+
const rootDir = resolve(args.dir || args._dir || ".");
|
|
69
|
+
const nitro = await createNitro({ rootDir });
|
|
70
|
+
await writeTypes(nitro);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
export { prepare as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { defineCommand, runMain } from 'citty';
|
|
3
|
+
import { n as nitroPkg } from '../shared/nitro.f9eb871d.mjs';
|
|
4
|
+
|
|
5
|
+
const main = defineCommand({
|
|
6
|
+
meta: {
|
|
7
|
+
name: nitroPkg.name,
|
|
8
|
+
description: "Nitro CLI",
|
|
9
|
+
version: nitroPkg.version
|
|
10
|
+
},
|
|
11
|
+
subCommands: {
|
|
12
|
+
dev: () => import('../chunks/dev.mjs').then((r) => r.default),
|
|
13
|
+
build: () => import('../chunks/build.mjs').then((r) => r.default),
|
|
14
|
+
prepare: () => import('../chunks/prepare.mjs').then((r) => r.default)
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
runMain(main);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { N as NitroConfig } from './shared/nitro.99b3af2a.mjs';
|
|
2
|
+
import 'unenv';
|
|
3
|
+
import 'unimport';
|
|
4
|
+
import 'unimport/unplugin';
|
|
5
|
+
import 'rollup-plugin-visualizer';
|
|
6
|
+
import 'hookable';
|
|
7
|
+
import 'consola';
|
|
8
|
+
import 'chokidar';
|
|
9
|
+
import '@rollup/plugin-commonjs';
|
|
10
|
+
import '@rollup/plugin-wasm';
|
|
11
|
+
import 'unstorage';
|
|
12
|
+
import 'httpxy';
|
|
13
|
+
import 'h3';
|
|
14
|
+
import 'c12';
|
|
15
|
+
import 'pkg-types';
|
|
16
|
+
import '@vercel/nft';
|
|
17
|
+
import 'rollup';
|
|
18
|
+
import 'esbuild';
|
|
19
|
+
import '@rollup/pluginutils';
|
|
20
|
+
import 'firebase-functions/v2/https';
|
|
21
|
+
import 'firebase-functions';
|
|
22
|
+
import 'ofetch';
|
|
23
|
+
|
|
24
|
+
declare function defineNitroConfig(config: NitroConfig): NitroConfig;
|
|
25
|
+
|
|
26
|
+
export { defineNitroConfig };
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { N as NitroConfig } from './shared/nitro.99b3af2a.js';
|
|
2
|
+
import 'unenv';
|
|
3
|
+
import 'unimport';
|
|
4
|
+
import 'unimport/unplugin';
|
|
5
|
+
import 'rollup-plugin-visualizer';
|
|
6
|
+
import 'hookable';
|
|
7
|
+
import 'consola';
|
|
8
|
+
import 'chokidar';
|
|
9
|
+
import '@rollup/plugin-commonjs';
|
|
10
|
+
import '@rollup/plugin-wasm';
|
|
11
|
+
import 'unstorage';
|
|
12
|
+
import 'httpxy';
|
|
13
|
+
import 'h3';
|
|
14
|
+
import 'c12';
|
|
15
|
+
import 'pkg-types';
|
|
16
|
+
import '@vercel/nft';
|
|
17
|
+
import 'rollup';
|
|
18
|
+
import 'esbuild';
|
|
19
|
+
import '@rollup/pluginutils';
|
|
20
|
+
import 'firebase-functions/v2/https';
|
|
21
|
+
import 'firebase-functions';
|
|
22
|
+
import 'ofetch';
|
|
23
|
+
|
|
24
|
+
declare function defineNitroConfig(config: NitroConfig): NitroConfig;
|
|
25
|
+
|
|
26
|
+
export { defineNitroConfig };
|
package/dist/config.mjs
ADDED
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { a as Nitro, N as NitroConfig, b as NitroOptions, c as NitroPreset } from './shared/nitro.99b3af2a.mjs';
|
|
2
|
+
export { $ as $Fetch, m as AppConfig, A as AvailableRouterMethod, C as CompressOptions, D as DevServerOptions, E as ExtractedRouteMethod, g as H3Event$Fetch, H as H3EventFetch, I as InternalApi, K as KebabCase, u as MatchedRoutes, M as MiddlewareOf, s as NitroDevEventHandler, h as NitroDynamicConfig, t as NitroErrorHandler, r as NitroEventHandler, e as NitroFetchOptions, d as NitroFetchRequest, l as NitroHooks, p as NitroRouteConfig, q as NitroRouteRules, j as NitroRuntimeConfig, i as NitroRuntimeConfigApp, f as NitroStaticBuildFlags, k as PrerenderGenerateRoute, P as PrerenderRoute, n as PublicAssetDir, o as ServerAssetDir, S as StorageMounts, T as TypedInternalResponse, W as WasmOptions } from './shared/nitro.99b3af2a.mjs';
|
|
3
|
+
import { WatchConfigOptions } from 'c12';
|
|
4
|
+
import { Worker } from 'node:worker_threads';
|
|
5
|
+
import { App } from 'h3';
|
|
6
|
+
import { ListenOptions, Listener } from 'listhen';
|
|
7
|
+
import { FSWatcher } from 'chokidar';
|
|
8
|
+
import 'unenv';
|
|
9
|
+
import 'unimport';
|
|
10
|
+
import 'unimport/unplugin';
|
|
11
|
+
import 'rollup-plugin-visualizer';
|
|
12
|
+
import 'hookable';
|
|
13
|
+
import 'consola';
|
|
14
|
+
import '@rollup/plugin-commonjs';
|
|
15
|
+
import '@rollup/plugin-wasm';
|
|
16
|
+
import 'unstorage';
|
|
17
|
+
import 'httpxy';
|
|
18
|
+
import 'pkg-types';
|
|
19
|
+
import '@vercel/nft';
|
|
20
|
+
import 'rollup';
|
|
21
|
+
import 'esbuild';
|
|
22
|
+
import '@rollup/pluginutils';
|
|
23
|
+
import 'firebase-functions/v2/https';
|
|
24
|
+
import 'firebase-functions';
|
|
25
|
+
import 'ofetch';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @link https://github.com/remix-run/remix/blob/2248669ed59fd716e267ea41df5d665d4781f4a9/packages/remix-server-runtime/serialize.ts
|
|
29
|
+
*/
|
|
30
|
+
type JsonPrimitive = string | number | boolean | String | Number | Boolean | null;
|
|
31
|
+
type NonJsonPrimitive = undefined | Function | symbol;
|
|
32
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
33
|
+
type FilterKeys<TObj extends object, TFilter> = {
|
|
34
|
+
[TKey in keyof TObj]: TObj[TKey] extends TFilter ? TKey : never;
|
|
35
|
+
}[keyof TObj];
|
|
36
|
+
type Serialize<T> = IsAny<T> extends true ? any : T extends JsonPrimitive ? T : T extends Map<any, any> | Set<any> ? Record<string, never> : T extends NonJsonPrimitive ? never : T extends {
|
|
37
|
+
toJSON(): infer U;
|
|
38
|
+
} ? U : T extends [] ? [] : T extends [unknown, ...unknown[]] ? SerializeTuple<T> : T extends ReadonlyArray<infer U> ? (U extends NonJsonPrimitive ? null : Serialize<U>)[] : T extends object ? SerializeObject<T> : never;
|
|
39
|
+
/** JSON serialize [tuples](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) */
|
|
40
|
+
type SerializeTuple<T extends [unknown, ...unknown[]]> = {
|
|
41
|
+
[k in keyof T]: T[k] extends NonJsonPrimitive ? null : Serialize<T[k]>;
|
|
42
|
+
};
|
|
43
|
+
/** JSON serialize objects (not including arrays) and classes */
|
|
44
|
+
type SerializeObject<T extends object> = {
|
|
45
|
+
[k in keyof Omit<T, FilterKeys<T, NonJsonPrimitive>>]: Serialize<T[k]>;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* @see https://github.com/ianstormtaylor/superstruct/blob/7973400cd04d8ad92bbdc2b6f35acbfb3c934079/src/utils.ts#L323-L325
|
|
49
|
+
*/
|
|
50
|
+
type Simplify<TType> = TType extends any[] | Date ? TType : {
|
|
51
|
+
[K in keyof TType]: TType[K];
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
declare function prepare(nitro: Nitro): Promise<void>;
|
|
55
|
+
declare function copyPublicAssets(nitro: Nitro): Promise<void>;
|
|
56
|
+
declare function build(nitro: Nitro): Promise<void>;
|
|
57
|
+
declare function writeTypes(nitro: Nitro): Promise<void>;
|
|
58
|
+
|
|
59
|
+
interface LoadConfigOptions {
|
|
60
|
+
watch?: boolean;
|
|
61
|
+
c12?: WatchConfigOptions;
|
|
62
|
+
}
|
|
63
|
+
declare function loadOptions(configOverrides?: NitroConfig, opts?: LoadConfigOptions): Promise<NitroOptions>;
|
|
64
|
+
|
|
65
|
+
declare function createNitro(config?: NitroConfig, opts?: LoadConfigOptions): Promise<Nitro>;
|
|
66
|
+
|
|
67
|
+
declare const GLOB_SCAN_PATTERN = "**/*.{js,mjs,cjs,ts,mts,cts,tsx,jsx}";
|
|
68
|
+
declare function scanHandlers(nitro: Nitro): Promise<{
|
|
69
|
+
handler: string;
|
|
70
|
+
lazy: boolean;
|
|
71
|
+
middleware: boolean;
|
|
72
|
+
route: string;
|
|
73
|
+
method: any;
|
|
74
|
+
}[]>;
|
|
75
|
+
declare function scanMiddleware(nitro: Nitro): Promise<{
|
|
76
|
+
middleware: boolean;
|
|
77
|
+
handler: string;
|
|
78
|
+
}[]>;
|
|
79
|
+
declare function scanServerRoutes(nitro: Nitro, dir: "routes" | "api", prefix?: string): Promise<{
|
|
80
|
+
handler: string;
|
|
81
|
+
lazy: boolean;
|
|
82
|
+
middleware: boolean;
|
|
83
|
+
route: string;
|
|
84
|
+
method: any;
|
|
85
|
+
}[]>;
|
|
86
|
+
declare function scanPlugins(nitro: Nitro): Promise<string[]>;
|
|
87
|
+
|
|
88
|
+
interface NitroWorker {
|
|
89
|
+
worker: Worker;
|
|
90
|
+
address: {
|
|
91
|
+
host: string;
|
|
92
|
+
port: number;
|
|
93
|
+
socketPath?: string;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
interface NitroDevServer {
|
|
97
|
+
reload: () => void;
|
|
98
|
+
listen: (port: ListenOptions["port"], opts?: Partial<ListenOptions>) => Promise<Listener>;
|
|
99
|
+
app: App;
|
|
100
|
+
close: () => Promise<void>;
|
|
101
|
+
watcher?: FSWatcher;
|
|
102
|
+
}
|
|
103
|
+
declare function createDevServer(nitro: Nitro): NitroDevServer;
|
|
104
|
+
|
|
105
|
+
declare function prerender(nitro: Nitro): Promise<void>;
|
|
106
|
+
|
|
107
|
+
declare function defineNitroPreset(preset: NitroPreset): NitroPreset;
|
|
108
|
+
|
|
109
|
+
declare const nitroRuntimeDependencies: string[];
|
|
110
|
+
|
|
111
|
+
export { GLOB_SCAN_PATTERN, type LoadConfigOptions, Nitro, NitroConfig, type NitroDevServer, NitroOptions, NitroPreset, type NitroWorker, type Serialize, type Simplify, build, copyPublicAssets, createDevServer, createNitro, defineNitroPreset, loadOptions, nitroRuntimeDependencies, prepare, prerender, scanHandlers, scanMiddleware, scanPlugins, scanServerRoutes, writeTypes };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { a as Nitro, N as NitroConfig, b as NitroOptions, c as NitroPreset } from './shared/nitro.99b3af2a.js';
|
|
2
|
+
export { $ as $Fetch, m as AppConfig, A as AvailableRouterMethod, C as CompressOptions, D as DevServerOptions, E as ExtractedRouteMethod, g as H3Event$Fetch, H as H3EventFetch, I as InternalApi, K as KebabCase, u as MatchedRoutes, M as MiddlewareOf, s as NitroDevEventHandler, h as NitroDynamicConfig, t as NitroErrorHandler, r as NitroEventHandler, e as NitroFetchOptions, d as NitroFetchRequest, l as NitroHooks, p as NitroRouteConfig, q as NitroRouteRules, j as NitroRuntimeConfig, i as NitroRuntimeConfigApp, f as NitroStaticBuildFlags, k as PrerenderGenerateRoute, P as PrerenderRoute, n as PublicAssetDir, o as ServerAssetDir, S as StorageMounts, T as TypedInternalResponse, W as WasmOptions } from './shared/nitro.99b3af2a.js';
|
|
3
|
+
import { WatchConfigOptions } from 'c12';
|
|
4
|
+
import { Worker } from 'node:worker_threads';
|
|
5
|
+
import { App } from 'h3';
|
|
6
|
+
import { ListenOptions, Listener } from 'listhen';
|
|
7
|
+
import { FSWatcher } from 'chokidar';
|
|
8
|
+
import 'unenv';
|
|
9
|
+
import 'unimport';
|
|
10
|
+
import 'unimport/unplugin';
|
|
11
|
+
import 'rollup-plugin-visualizer';
|
|
12
|
+
import 'hookable';
|
|
13
|
+
import 'consola';
|
|
14
|
+
import '@rollup/plugin-commonjs';
|
|
15
|
+
import '@rollup/plugin-wasm';
|
|
16
|
+
import 'unstorage';
|
|
17
|
+
import 'httpxy';
|
|
18
|
+
import 'pkg-types';
|
|
19
|
+
import '@vercel/nft';
|
|
20
|
+
import 'rollup';
|
|
21
|
+
import 'esbuild';
|
|
22
|
+
import '@rollup/pluginutils';
|
|
23
|
+
import 'firebase-functions/v2/https';
|
|
24
|
+
import 'firebase-functions';
|
|
25
|
+
import 'ofetch';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @link https://github.com/remix-run/remix/blob/2248669ed59fd716e267ea41df5d665d4781f4a9/packages/remix-server-runtime/serialize.ts
|
|
29
|
+
*/
|
|
30
|
+
type JsonPrimitive = string | number | boolean | String | Number | Boolean | null;
|
|
31
|
+
type NonJsonPrimitive = undefined | Function | symbol;
|
|
32
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
33
|
+
type FilterKeys<TObj extends object, TFilter> = {
|
|
34
|
+
[TKey in keyof TObj]: TObj[TKey] extends TFilter ? TKey : never;
|
|
35
|
+
}[keyof TObj];
|
|
36
|
+
type Serialize<T> = IsAny<T> extends true ? any : T extends JsonPrimitive ? T : T extends Map<any, any> | Set<any> ? Record<string, never> : T extends NonJsonPrimitive ? never : T extends {
|
|
37
|
+
toJSON(): infer U;
|
|
38
|
+
} ? U : T extends [] ? [] : T extends [unknown, ...unknown[]] ? SerializeTuple<T> : T extends ReadonlyArray<infer U> ? (U extends NonJsonPrimitive ? null : Serialize<U>)[] : T extends object ? SerializeObject<T> : never;
|
|
39
|
+
/** JSON serialize [tuples](https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types) */
|
|
40
|
+
type SerializeTuple<T extends [unknown, ...unknown[]]> = {
|
|
41
|
+
[k in keyof T]: T[k] extends NonJsonPrimitive ? null : Serialize<T[k]>;
|
|
42
|
+
};
|
|
43
|
+
/** JSON serialize objects (not including arrays) and classes */
|
|
44
|
+
type SerializeObject<T extends object> = {
|
|
45
|
+
[k in keyof Omit<T, FilterKeys<T, NonJsonPrimitive>>]: Serialize<T[k]>;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* @see https://github.com/ianstormtaylor/superstruct/blob/7973400cd04d8ad92bbdc2b6f35acbfb3c934079/src/utils.ts#L323-L325
|
|
49
|
+
*/
|
|
50
|
+
type Simplify<TType> = TType extends any[] | Date ? TType : {
|
|
51
|
+
[K in keyof TType]: TType[K];
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
declare function prepare(nitro: Nitro): Promise<void>;
|
|
55
|
+
declare function copyPublicAssets(nitro: Nitro): Promise<void>;
|
|
56
|
+
declare function build(nitro: Nitro): Promise<void>;
|
|
57
|
+
declare function writeTypes(nitro: Nitro): Promise<void>;
|
|
58
|
+
|
|
59
|
+
interface LoadConfigOptions {
|
|
60
|
+
watch?: boolean;
|
|
61
|
+
c12?: WatchConfigOptions;
|
|
62
|
+
}
|
|
63
|
+
declare function loadOptions(configOverrides?: NitroConfig, opts?: LoadConfigOptions): Promise<NitroOptions>;
|
|
64
|
+
|
|
65
|
+
declare function createNitro(config?: NitroConfig, opts?: LoadConfigOptions): Promise<Nitro>;
|
|
66
|
+
|
|
67
|
+
declare const GLOB_SCAN_PATTERN = "**/*.{js,mjs,cjs,ts,mts,cts,tsx,jsx}";
|
|
68
|
+
declare function scanHandlers(nitro: Nitro): Promise<{
|
|
69
|
+
handler: string;
|
|
70
|
+
lazy: boolean;
|
|
71
|
+
middleware: boolean;
|
|
72
|
+
route: string;
|
|
73
|
+
method: any;
|
|
74
|
+
}[]>;
|
|
75
|
+
declare function scanMiddleware(nitro: Nitro): Promise<{
|
|
76
|
+
middleware: boolean;
|
|
77
|
+
handler: string;
|
|
78
|
+
}[]>;
|
|
79
|
+
declare function scanServerRoutes(nitro: Nitro, dir: "routes" | "api", prefix?: string): Promise<{
|
|
80
|
+
handler: string;
|
|
81
|
+
lazy: boolean;
|
|
82
|
+
middleware: boolean;
|
|
83
|
+
route: string;
|
|
84
|
+
method: any;
|
|
85
|
+
}[]>;
|
|
86
|
+
declare function scanPlugins(nitro: Nitro): Promise<string[]>;
|
|
87
|
+
|
|
88
|
+
interface NitroWorker {
|
|
89
|
+
worker: Worker;
|
|
90
|
+
address: {
|
|
91
|
+
host: string;
|
|
92
|
+
port: number;
|
|
93
|
+
socketPath?: string;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
interface NitroDevServer {
|
|
97
|
+
reload: () => void;
|
|
98
|
+
listen: (port: ListenOptions["port"], opts?: Partial<ListenOptions>) => Promise<Listener>;
|
|
99
|
+
app: App;
|
|
100
|
+
close: () => Promise<void>;
|
|
101
|
+
watcher?: FSWatcher;
|
|
102
|
+
}
|
|
103
|
+
declare function createDevServer(nitro: Nitro): NitroDevServer;
|
|
104
|
+
|
|
105
|
+
declare function prerender(nitro: Nitro): Promise<void>;
|
|
106
|
+
|
|
107
|
+
declare function defineNitroPreset(preset: NitroPreset): NitroPreset;
|
|
108
|
+
|
|
109
|
+
declare const nitroRuntimeDependencies: string[];
|
|
110
|
+
|
|
111
|
+
export { GLOB_SCAN_PATTERN, type LoadConfigOptions, Nitro, NitroConfig, type NitroDevServer, NitroOptions, NitroPreset, type NitroWorker, type Serialize, type Simplify, build, copyPublicAssets, createDevServer, createNitro, defineNitroPreset, loadOptions, nitroRuntimeDependencies, prepare, prerender, scanHandlers, scanMiddleware, scanPlugins, scanServerRoutes, writeTypes };
|