@srvkit/common 0.1.0
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 +7 -0
- package/dist/@types/node.d.ts +18 -0
- package/dist/@types/node.js +8 -0
- package/dist/@types/node.mjs +9 -0
- package/dist/@types/options/complete/build.d.ts +104 -0
- package/dist/@types/options/complete/build.js +8 -0
- package/dist/@types/options/complete/build.mjs +9 -0
- package/dist/@types/options/complete/dev.d.ts +42 -0
- package/dist/@types/options/complete/dev.js +8 -0
- package/dist/@types/options/complete/dev.mjs +9 -0
- package/dist/@types/options/complete/index.d.ts +52 -0
- package/dist/@types/options/complete/index.js +8 -0
- package/dist/@types/options/complete/index.mjs +9 -0
- package/dist/@types/options/default.d.ts +51 -0
- package/dist/@types/options/default.js +8 -0
- package/dist/@types/options/default.mjs +9 -0
- package/dist/@types/options/resolved.d.ts +52 -0
- package/dist/@types/options/resolved.js +8 -0
- package/dist/@types/options/resolved.mjs +9 -0
- package/dist/@types/server.d.ts +34 -0
- package/dist/@types/server.js +8 -0
- package/dist/@types/server.mjs +9 -0
- package/dist/_virtual/_rolldown/runtime.js +35 -0
- package/dist/configs/log.d.ts +6 -0
- package/dist/configs/log.js +15 -0
- package/dist/configs/log.js.map +1 -0
- package/dist/configs/log.mjs +14 -0
- package/dist/configs/log.mjs.map +1 -0
- package/dist/functions/build/virtual-entry.d.ts +9 -0
- package/dist/functions/build/virtual-entry.js +38 -0
- package/dist/functions/build/virtual-entry.js.map +1 -0
- package/dist/functions/build/virtual-entry.mjs +37 -0
- package/dist/functions/build/virtual-entry.mjs.map +1 -0
- package/dist/functions/http/request/header.d.ts +6 -0
- package/dist/functions/http/request/header.js +31 -0
- package/dist/functions/http/request/header.js.map +1 -0
- package/dist/functions/http/request/header.mjs +29 -0
- package/dist/functions/http/request/header.mjs.map +1 -0
- package/dist/functions/http/response/write.d.ts +13 -0
- package/dist/functions/http/response/write.js +42 -0
- package/dist/functions/http/response/write.js.map +1 -0
- package/dist/functions/http/response/write.mjs +40 -0
- package/dist/functions/http/response/write.mjs.map +1 -0
- package/dist/functions/options/resolve.d.ts +7 -0
- package/dist/functions/options/resolve.js +70 -0
- package/dist/functions/options/resolve.js.map +1 -0
- package/dist/functions/options/resolve.mjs +66 -0
- package/dist/functions/options/resolve.mjs.map +1 -0
- package/dist/functions/package/package-json.d.ts +14 -0
- package/dist/functions/package/package-json.js +24 -0
- package/dist/functions/package/package-json.js.map +1 -0
- package/dist/functions/package/package-json.mjs +20 -0
- package/dist/functions/package/package-json.mjs.map +1 -0
- package/dist/functions/path/posix.d.ts +5 -0
- package/dist/functions/path/posix.js +19 -0
- package/dist/functions/path/posix.js.map +1 -0
- package/dist/functions/path/posix.mjs +16 -0
- package/dist/functions/path/posix.mjs.map +1 -0
- package/dist/functions/server/define.d.ts +23 -0
- package/dist/functions/server/define.js +31 -0
- package/dist/functions/server/define.js.map +1 -0
- package/dist/functions/server/define.mjs +29 -0
- package/dist/functions/server/define.mjs.map +1 -0
- package/dist/functions/server/live.d.ts +12 -0
- package/dist/functions/server/live.js +55 -0
- package/dist/functions/server/live.js.map +1 -0
- package/dist/functions/server/live.mjs +54 -0
- package/dist/functions/server/live.mjs.map +1 -0
- package/dist/node.d.ts +4 -0
- package/dist/node.js +17 -0
- package/dist/node.mjs +11 -0
- package/dist/runtime.d.ts +4 -0
- package/dist/runtime.js +17 -0
- package/dist/runtime.mjs +11 -0
- package/package.json +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026-present, Alpheus
|
|
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,18 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { FetchHandler as FetchHandler$1, NodeHttpHandler as NodeHttpHandler$1 } from "srvx";
|
|
4
|
+
import { AdapterMeta as AdapterMeta$1 } from "srvx/node";
|
|
5
|
+
/**
|
|
6
|
+
* Node HTTP handler based on Node.js implementation.
|
|
7
|
+
*/
|
|
8
|
+
type NodeHttpHandler = NodeHttpHandler$1;
|
|
9
|
+
/**
|
|
10
|
+
* Fetch handler based on Web API.
|
|
11
|
+
*/
|
|
12
|
+
type FetchHandler = FetchHandler$1;
|
|
13
|
+
/**
|
|
14
|
+
* Adapter meta.
|
|
15
|
+
*/
|
|
16
|
+
type AdapterMeta = AdapterMeta$1;
|
|
17
|
+
export type { AdapterMeta, FetchHandler, NodeHttpHandler };
|
|
18
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
9
|
+
export { };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { CompleteHttpsOptions } from "./dev.js";
|
|
4
|
+
/**
|
|
5
|
+
* Build target.
|
|
6
|
+
*
|
|
7
|
+
* #### `server`
|
|
8
|
+
*
|
|
9
|
+
* Produces a self-starting server.
|
|
10
|
+
*
|
|
11
|
+
* It outputs `serve({ ... })` directly.
|
|
12
|
+
*
|
|
13
|
+
* #### `handler`
|
|
14
|
+
*
|
|
15
|
+
* Produces a handler for serverless platforms.
|
|
16
|
+
*
|
|
17
|
+
* It outputs `export default serve({ ... })` since the platform manages those.
|
|
18
|
+
*/
|
|
19
|
+
type BuildTarget = "server" | "handler";
|
|
20
|
+
/**
|
|
21
|
+
* Bundle mode.
|
|
22
|
+
*
|
|
23
|
+
* - `external` - keeps all dependencies external.
|
|
24
|
+
* - `standalone` - bundles all dependencies into the output file.
|
|
25
|
+
*/
|
|
26
|
+
type BundleMode = "external" | "standalone";
|
|
27
|
+
type CompleteBuildBaseOptions<T extends BuildTarget> = {
|
|
28
|
+
/**
|
|
29
|
+
* Build target.
|
|
30
|
+
*
|
|
31
|
+
* By default, it is `server`.
|
|
32
|
+
*/
|
|
33
|
+
target: T;
|
|
34
|
+
/**
|
|
35
|
+
* Whether to bundle all dependencies into the output file.
|
|
36
|
+
*
|
|
37
|
+
* By default, it is `external`.
|
|
38
|
+
*/
|
|
39
|
+
bundle: BundleMode;
|
|
40
|
+
/**
|
|
41
|
+
* The output directory for the application.
|
|
42
|
+
*
|
|
43
|
+
* By default, it is `./dist`.
|
|
44
|
+
*/
|
|
45
|
+
outputDir: string;
|
|
46
|
+
/**
|
|
47
|
+
* The output file name for the application.
|
|
48
|
+
*
|
|
49
|
+
* By default, it is `index.js`.
|
|
50
|
+
*/
|
|
51
|
+
outputFile: string;
|
|
52
|
+
/**
|
|
53
|
+
* Whether to minify the output.
|
|
54
|
+
*
|
|
55
|
+
* By default, it is `false`.
|
|
56
|
+
*/
|
|
57
|
+
minify: boolean;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Complete default build server options.
|
|
61
|
+
*/
|
|
62
|
+
type CompleteBuildServerOptions = CompleteBuildBaseOptions<"server"> & {
|
|
63
|
+
/**
|
|
64
|
+
* The host for the production server.
|
|
65
|
+
*
|
|
66
|
+
* By default, it is `localhost`.
|
|
67
|
+
*/
|
|
68
|
+
host: string;
|
|
69
|
+
/**
|
|
70
|
+
* The port number for the production server.
|
|
71
|
+
*
|
|
72
|
+
* By default, it is `3000`.
|
|
73
|
+
*/
|
|
74
|
+
port: number;
|
|
75
|
+
/**
|
|
76
|
+
* HTTPS server options.
|
|
77
|
+
*/
|
|
78
|
+
https: CompleteHttpsOptions;
|
|
79
|
+
/**
|
|
80
|
+
* The public directory for the application.
|
|
81
|
+
*
|
|
82
|
+
* By default, it is `./public`.
|
|
83
|
+
*/
|
|
84
|
+
publicDir: string;
|
|
85
|
+
/**
|
|
86
|
+
* Whether to copy the public directory to the output directory.
|
|
87
|
+
*
|
|
88
|
+
* When this is `true`, the public directory will be copied
|
|
89
|
+
* into the directory with same name inside the output directory.
|
|
90
|
+
*
|
|
91
|
+
* By default, it is `false`.
|
|
92
|
+
*/
|
|
93
|
+
copyPublicDir: boolean;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Complete build handler options.
|
|
97
|
+
*/
|
|
98
|
+
type CompleteBuildHandlerOptions = CompleteBuildBaseOptions<"handler">;
|
|
99
|
+
/**
|
|
100
|
+
* Complete build server options.
|
|
101
|
+
*/
|
|
102
|
+
type CompleteBuildOptions = CompleteBuildServerOptions | CompleteBuildHandlerOptions;
|
|
103
|
+
export type { BuildTarget, BundleMode, CompleteBuildBaseOptions, CompleteBuildHandlerOptions, CompleteBuildOptions, CompleteBuildServerOptions };
|
|
104
|
+
//# sourceMappingURL=build.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
9
|
+
export { };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
/**
|
|
4
|
+
* Complete HTTPS server options.
|
|
5
|
+
*/
|
|
6
|
+
type CompleteHttpsOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* File path or inlined TLS certificate in PEM format (required).
|
|
9
|
+
*/
|
|
10
|
+
cert: string;
|
|
11
|
+
/**
|
|
12
|
+
* File path or inlined TLS private key in PEM format (required).
|
|
13
|
+
*/
|
|
14
|
+
key: string;
|
|
15
|
+
/**
|
|
16
|
+
* Passphrase for the private key (optional).
|
|
17
|
+
*/
|
|
18
|
+
passphrase: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Complete development server options.
|
|
22
|
+
*/
|
|
23
|
+
type CompleteDevOptions = {
|
|
24
|
+
/**
|
|
25
|
+
* The host for the development server.
|
|
26
|
+
*
|
|
27
|
+
* By default, it is `localhost`.
|
|
28
|
+
*/
|
|
29
|
+
host: string;
|
|
30
|
+
/**
|
|
31
|
+
* The port number for the development server.
|
|
32
|
+
*
|
|
33
|
+
* By default, it is `3001`.
|
|
34
|
+
*/
|
|
35
|
+
port: number;
|
|
36
|
+
/**
|
|
37
|
+
* HTTPS server options.
|
|
38
|
+
*/
|
|
39
|
+
https: CompleteHttpsOptions;
|
|
40
|
+
};
|
|
41
|
+
export type { CompleteDevOptions, CompleteHttpsOptions };
|
|
42
|
+
//# sourceMappingURL=dev.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
9
|
+
export { };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { CompleteDevOptions } from "./dev.js";
|
|
4
|
+
import { CompleteBuildOptions } from "./build.js";
|
|
5
|
+
/**
|
|
6
|
+
* Runtime target for the application.
|
|
7
|
+
*
|
|
8
|
+
* - Node.js - `node`
|
|
9
|
+
* - Deno - `deno`
|
|
10
|
+
* - Bun - `bun`
|
|
11
|
+
* - Cloudflare Workers - `workerd`
|
|
12
|
+
*/
|
|
13
|
+
type Runtime = "node" | "deno" | "bun" | "workerd";
|
|
14
|
+
/**
|
|
15
|
+
* Complete options for the plugin.
|
|
16
|
+
*/
|
|
17
|
+
type CompleteOptions = {
|
|
18
|
+
/**
|
|
19
|
+
* The current working directory.
|
|
20
|
+
*
|
|
21
|
+
* By default, it is `process.cwd()`.
|
|
22
|
+
*/
|
|
23
|
+
cwd: string;
|
|
24
|
+
/**
|
|
25
|
+
* Runtime target for the application.
|
|
26
|
+
*
|
|
27
|
+
* By default, it is `node`.
|
|
28
|
+
*/
|
|
29
|
+
runtime: Runtime;
|
|
30
|
+
/**
|
|
31
|
+
* The entry file for the application.
|
|
32
|
+
*
|
|
33
|
+
* By default, it is `./src/index.ts` or `./src/index.js`.
|
|
34
|
+
*/
|
|
35
|
+
entry: string;
|
|
36
|
+
/**
|
|
37
|
+
* The options for the development server.
|
|
38
|
+
*/
|
|
39
|
+
dev: CompleteDevOptions;
|
|
40
|
+
/**
|
|
41
|
+
* The options for the production server.
|
|
42
|
+
*/
|
|
43
|
+
build: CompleteBuildOptions;
|
|
44
|
+
/**
|
|
45
|
+
* Whether to output log messages to the console.
|
|
46
|
+
*
|
|
47
|
+
* By default, it is `false`.
|
|
48
|
+
*/
|
|
49
|
+
verbose: boolean;
|
|
50
|
+
};
|
|
51
|
+
export type { CompleteOptions, Runtime };
|
|
52
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
9
|
+
export { };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { CompleteDevOptions, CompleteHttpsOptions } from "./complete/dev.js";
|
|
4
|
+
import { CompleteBuildHandlerOptions, CompleteBuildServerOptions } from "./complete/build.js";
|
|
5
|
+
import { CompleteOptions } from "./complete/index.js";
|
|
6
|
+
import { Format, Omit, Partial } from "ts-vista";
|
|
7
|
+
/**
|
|
8
|
+
* HTTPS server options.
|
|
9
|
+
*/
|
|
10
|
+
type HttpsOptions = Format<Partial<CompleteHttpsOptions>>;
|
|
11
|
+
/**
|
|
12
|
+
* Development server options.
|
|
13
|
+
*/
|
|
14
|
+
type DevOptions = Format<Partial<Omit<CompleteDevOptions, "https">> & {
|
|
15
|
+
/**
|
|
16
|
+
* HTTPS server options.
|
|
17
|
+
*/
|
|
18
|
+
https?: HttpsOptions;
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Build server options.
|
|
22
|
+
*/
|
|
23
|
+
type BuildServerOptions = Format<Partial<Omit<CompleteBuildServerOptions, "https">> & {
|
|
24
|
+
/**
|
|
25
|
+
* HTTPS server options.
|
|
26
|
+
*/
|
|
27
|
+
https?: HttpsOptions;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Build handler options.
|
|
31
|
+
*/
|
|
32
|
+
type BuildHandlerOptions = Format<Pick<CompleteBuildHandlerOptions, "target"> & Partial<Omit<CompleteBuildHandlerOptions, "target">>>;
|
|
33
|
+
/**
|
|
34
|
+
* Build options.
|
|
35
|
+
*/
|
|
36
|
+
type BuildOptions = BuildServerOptions | BuildHandlerOptions;
|
|
37
|
+
/**
|
|
38
|
+
* Options for the plugin.
|
|
39
|
+
*/
|
|
40
|
+
type Options = Format<Partial<Omit<CompleteOptions, "dev" | "build">> & {
|
|
41
|
+
/**
|
|
42
|
+
* The options for the development server.
|
|
43
|
+
*/
|
|
44
|
+
dev?: DevOptions;
|
|
45
|
+
/**
|
|
46
|
+
* The options for the production server.
|
|
47
|
+
*/
|
|
48
|
+
build?: BuildOptions;
|
|
49
|
+
}>;
|
|
50
|
+
export type { BuildHandlerOptions, BuildOptions, BuildServerOptions, DevOptions, HttpsOptions, Options };
|
|
51
|
+
//# sourceMappingURL=default.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
9
|
+
export { };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { CompleteDevOptions } from "./complete/dev.js";
|
|
4
|
+
import { CompleteBuildHandlerOptions, CompleteBuildServerOptions } from "./complete/build.js";
|
|
5
|
+
import { CompleteOptions } from "./complete/index.js";
|
|
6
|
+
import { HttpsOptions } from "./default.js";
|
|
7
|
+
import { Format, Omit } from "ts-vista";
|
|
8
|
+
/**
|
|
9
|
+
* Resolved HTTPS server options.
|
|
10
|
+
*/
|
|
11
|
+
type ResolvedHttpsOptions = HttpsOptions;
|
|
12
|
+
/**
|
|
13
|
+
* Resolved development server options.
|
|
14
|
+
*/
|
|
15
|
+
type ResolvedDevOptions = Format<Omit<CompleteDevOptions, "https"> & {
|
|
16
|
+
/**
|
|
17
|
+
* HTTPS server options.
|
|
18
|
+
*/
|
|
19
|
+
https?: HttpsOptions;
|
|
20
|
+
}>;
|
|
21
|
+
/**
|
|
22
|
+
* Resolved build server options.
|
|
23
|
+
*/
|
|
24
|
+
type ResolvedBuildServerOptions = Format<Omit<CompleteBuildServerOptions, "https"> & {
|
|
25
|
+
/**
|
|
26
|
+
* HTTPS server options.
|
|
27
|
+
*/
|
|
28
|
+
https?: HttpsOptions;
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Resolved build handler options.
|
|
32
|
+
*/
|
|
33
|
+
type ResolvedBuildHandlerOptions = Format<CompleteBuildHandlerOptions>;
|
|
34
|
+
/**
|
|
35
|
+
* Resolved build options.
|
|
36
|
+
*/
|
|
37
|
+
type ResolvedBuildOptions = ResolvedBuildServerOptions | ResolvedBuildHandlerOptions;
|
|
38
|
+
/**
|
|
39
|
+
* Resolved options.
|
|
40
|
+
*/
|
|
41
|
+
type ResolvedOptions = Format<Omit<CompleteOptions, "dev" | "build"> & {
|
|
42
|
+
/**
|
|
43
|
+
* Development server options.
|
|
44
|
+
*/
|
|
45
|
+
dev: ResolvedDevOptions;
|
|
46
|
+
/**
|
|
47
|
+
* Build server options.
|
|
48
|
+
*/
|
|
49
|
+
build: ResolvedBuildOptions;
|
|
50
|
+
}>;
|
|
51
|
+
export type { ResolvedBuildHandlerOptions, ResolvedBuildOptions, ResolvedBuildServerOptions, ResolvedDevOptions, ResolvedHttpsOptions, ResolvedOptions };
|
|
52
|
+
//# sourceMappingURL=resolved.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
9
|
+
export { };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { ErrorHandler as ErrorHandler$1, Server as Server$1, ServerHandler as ServerHandler$1, ServerMiddleware as ServerMiddleware$1, ServerOptions as ServerOptions$1, ServerPlugin as ServerPlugin$1, ServerRequest as ServerRequest$1 } from "srvx";
|
|
4
|
+
import { Format, Omit } from "ts-vista";
|
|
5
|
+
/**
|
|
6
|
+
* Server request extended from `Request`.
|
|
7
|
+
*/
|
|
8
|
+
type ServerRequest = ServerRequest$1;
|
|
9
|
+
/**
|
|
10
|
+
* Server handler based on Web API.
|
|
11
|
+
*/
|
|
12
|
+
type ServerHandler = ServerHandler$1;
|
|
13
|
+
/**
|
|
14
|
+
* Error handler for the server.
|
|
15
|
+
*/
|
|
16
|
+
type ErrorHandler = ErrorHandler$1;
|
|
17
|
+
/**
|
|
18
|
+
* Server middleware for extending the server.
|
|
19
|
+
*/
|
|
20
|
+
type ServerMiddleware = ServerMiddleware$1;
|
|
21
|
+
/**
|
|
22
|
+
* Server type.
|
|
23
|
+
*/
|
|
24
|
+
type Server<T extends ServerHandler = ServerHandler> = Server$1<T>;
|
|
25
|
+
/**
|
|
26
|
+
* Server plugin for extending the server.
|
|
27
|
+
*/
|
|
28
|
+
type ServerPlugin = ServerPlugin$1;
|
|
29
|
+
/**
|
|
30
|
+
* Server options.
|
|
31
|
+
*/
|
|
32
|
+
type ServerOptions = Format<Omit<ServerOptions$1, "manual" | "hostname" | "port" | "protocol" | "tls">>;
|
|
33
|
+
export type { ErrorHandler, Server, ServerHandler, ServerMiddleware, ServerOptions, ServerPlugin, ServerRequest };
|
|
34
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
9
|
+
export { };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
9
|
+
var __create = Object.create;
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
14
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
18
|
+
key = keys[i];
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
20
|
+
__defProp(to, key, {
|
|
21
|
+
get: ((k) => from[k]).bind(null, key),
|
|
22
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return to;
|
|
28
|
+
};
|
|
29
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
+
value: mod,
|
|
31
|
+
enumerable: true
|
|
32
|
+
}) : target, mod));
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
exports.__toESM = __toESM;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
10
|
+
let consola = require("consola");
|
|
11
|
+
|
|
12
|
+
const log = (0, consola.createConsola)({ formatOptions: { date: false } });
|
|
13
|
+
|
|
14
|
+
exports.log = log;
|
|
15
|
+
//# sourceMappingURL=log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.js","names":[],"sources":["../../src/configs/log.ts"],"sourcesContent":["import type { ConsolaInstance } from \"consola\";\n\nimport { createConsola } from \"consola\";\n\nconst log: ConsolaInstance = createConsola({\n formatOptions: {\n date: false,\n },\n});\n\nexport { log };\n"],"mappings":";;;;;;;;;;;AAIA,MAAM,iCAAqC,EACvC,eAAe,EACX,MAAM,MACV,EACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
9
|
+
import { createConsola } from "consola";
|
|
10
|
+
|
|
11
|
+
const log = createConsola({ formatOptions: { date: false } });
|
|
12
|
+
|
|
13
|
+
export { log };
|
|
14
|
+
//# sourceMappingURL=log.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.mjs","names":[],"sources":["../../src/configs/log.ts"],"sourcesContent":["import type { ConsolaInstance } from \"consola\";\n\nimport { createConsola } from \"consola\";\n\nconst log: ConsolaInstance = createConsola({\n formatOptions: {\n date: false,\n },\n});\n\nexport { log };\n"],"mappings":";;;;;;;;;;AAIA,MAAM,MAAuB,cAAc,EACvC,eAAe,EACX,MAAM,MACV,EACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { ResolvedOptions } from "../../@types/options/resolved.js";
|
|
4
|
+
type VirtualEntryOptions = ResolvedOptions & {
|
|
5
|
+
packageName: string;
|
|
6
|
+
};
|
|
7
|
+
declare const createVirtualEntryCode: (opts: VirtualEntryOptions) => string;
|
|
8
|
+
export { type VirtualEntryOptions, createVirtualEntryCode };
|
|
9
|
+
//# sourceMappingURL=virtual-entry.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import __tsdown_shims_path from 'node:path'
|
|
4
|
+
import __tsdown_shims_url from 'node:url'
|
|
5
|
+
|
|
6
|
+
const __TSDOWN_SHIM_FILENAME__ = /* @__PURE__ */ __tsdown_shims_url.fileURLToPath(import.meta.url)
|
|
7
|
+
const __TSDOWN_SHIM_DIRNAME__ = /* @__PURE__ */ __tsdown_shims_path.dirname(__TSDOWN_SHIM_FILENAME__)
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
10
|
+
const require_functions_path_posix = require('../path/posix.js');
|
|
11
|
+
|
|
12
|
+
const createVirtualEntryCode = (opts) => {
|
|
13
|
+
const build = opts.build;
|
|
14
|
+
let code = "";
|
|
15
|
+
code += `import options from "${require_functions_path_posix.toPosix(opts.entry)}";`;
|
|
16
|
+
code += `import { serve } from "${opts.packageName}/runtime";`;
|
|
17
|
+
if (build.target === "handler") {
|
|
18
|
+
code += `const server = serve({ ...options, manual: true });`;
|
|
19
|
+
code += `export default server;`;
|
|
20
|
+
return code;
|
|
21
|
+
}
|
|
22
|
+
code += `serve({`;
|
|
23
|
+
code += `...options,`;
|
|
24
|
+
if (build.host !== "localhost") code += `hostname: "${build.host}",`;
|
|
25
|
+
if (build.port !== 3e3) code += `port: ${build.port},`;
|
|
26
|
+
if (build.https) {
|
|
27
|
+
code += `tls: {`;
|
|
28
|
+
if (build.https.cert) code += `cert: "${require_functions_path_posix.toPosix(build.https.cert)}",`;
|
|
29
|
+
if (build.https.key) code += `key: "${require_functions_path_posix.toPosix(build.https.key)}",`;
|
|
30
|
+
if (build.https.passphrase) code += `passphrase: "${require_functions_path_posix.toPosix(build.https.passphrase)}",`;
|
|
31
|
+
code += `},`;
|
|
32
|
+
}
|
|
33
|
+
code += `});`;
|
|
34
|
+
return code;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
exports.createVirtualEntryCode = createVirtualEntryCode;
|
|
38
|
+
//# sourceMappingURL=virtual-entry.js.map
|