@kitsy/cnos 1.6.1 → 1.7.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/dist/build/index.cjs +1332 -156
- package/dist/build/index.d.cts +1 -1
- package/dist/build/index.d.ts +1 -1
- package/dist/build/index.js +36 -14
- package/dist/{chunk-JYWQFMW5.js → chunk-2DGT7N7E.js} +1 -1
- package/dist/{chunk-S7H2UULC.js → chunk-2TL42I6M.js} +1323 -139
- package/dist/{chunk-MW4OVAT3.js → chunk-5KIQCYFH.js} +1 -1
- package/dist/{chunk-N32UN66E.js → chunk-CV3SLBYZ.js} +8 -8
- package/dist/{chunk-XSUP7JKH.js → chunk-GHGJFRDL.js} +6 -2
- package/dist/{chunk-BMAD24KC.js → chunk-OA7FQGAG.js} +1 -1
- package/dist/{chunk-6FAX2VKQ.js → chunk-PFT56ID2.js} +195 -28
- package/dist/{chunk-VGZREX5D.js → chunk-RYIARE4M.js} +1 -1
- package/dist/{chunk-UR7CHHNN.js → chunk-TT4NV56Z.js} +3 -2
- package/dist/{chunk-UJBQS7CJ.js → chunk-UL63DFLS.js} +1 -1
- package/dist/configure/index.cjs +1309 -155
- package/dist/configure/index.d.cts +3 -3
- package/dist/configure/index.d.ts +3 -3
- package/dist/configure/index.js +8 -8
- package/dist/{plugin-CKrBlWGI.d.cts → core-BJ8xewez.d.cts} +142 -60
- package/dist/{plugin-CKrBlWGI.d.ts → core-BJ8xewez.d.ts} +142 -60
- package/dist/{envNaming-B7Mztkcf.d.ts → envNaming-BRyiuPoI.d.ts} +1 -1
- package/dist/{envNaming-gMVnPOfe.d.cts → envNaming-rx71gpi0.d.cts} +1 -1
- package/dist/index.cjs +1548 -227
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -10
- package/dist/internal.cjs +831 -122
- package/dist/internal.d.cts +56 -3
- package/dist/internal.d.ts +56 -3
- package/dist/internal.js +30 -3
- package/dist/plugin/basic-schema.cjs +49 -23
- package/dist/plugin/basic-schema.d.cts +1 -1
- package/dist/plugin/basic-schema.d.ts +1 -1
- package/dist/plugin/basic-schema.js +2 -2
- package/dist/plugin/cli-args.cjs +38 -23
- package/dist/plugin/cli-args.d.cts +1 -1
- package/dist/plugin/cli-args.d.ts +1 -1
- package/dist/plugin/cli-args.js +2 -2
- package/dist/plugin/dotenv.cjs +46 -31
- package/dist/plugin/dotenv.d.cts +2 -2
- package/dist/plugin/dotenv.d.ts +2 -2
- package/dist/plugin/dotenv.js +2 -2
- package/dist/plugin/env-export.cjs +56 -27
- package/dist/plugin/env-export.d.cts +2 -2
- package/dist/plugin/env-export.d.ts +2 -2
- package/dist/plugin/env-export.js +2 -2
- package/dist/plugin/filesystem.cjs +61 -39
- package/dist/plugin/filesystem.d.cts +1 -1
- package/dist/plugin/filesystem.d.ts +1 -1
- package/dist/plugin/filesystem.js +2 -2
- package/dist/plugin/process-env.cjs +40 -25
- package/dist/plugin/process-env.d.cts +2 -2
- package/dist/plugin/process-env.d.ts +2 -2
- package/dist/plugin/process-env.js +2 -2
- package/dist/runtime/index.cjs +1548 -227
- package/dist/runtime/index.d.cts +3 -1
- package/dist/runtime/index.d.ts +3 -1
- package/dist/runtime/index.js +10 -10
- package/dist/toPublicEnv-CCSgdvI9.d.ts +13 -0
- package/dist/toPublicEnv-ivRtLjcw.d.cts +13 -0
- package/package.json +1 -1
- package/dist/toPublicEnv-CmBsy53P.d.cts +0 -7
- package/dist/toPublicEnv-q6VwWxXZ.d.ts +0 -7
package/dist/build/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CnosCreateOptions, S as ServerProjection } from '../
|
|
1
|
+
import { C as CnosCreateOptions, S as ServerProjection } from '../core-BJ8xewez.cjs';
|
|
2
2
|
|
|
3
3
|
type BrowserDataMap = Record<string, unknown>;
|
|
4
4
|
type FrameworkEnvTarget = 'generic' | 'vite' | 'next' | 'webpack' | (string & {});
|
package/dist/build/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CnosCreateOptions, S as ServerProjection } from '../
|
|
1
|
+
import { C as CnosCreateOptions, S as ServerProjection } from '../core-BJ8xewez.js';
|
|
2
2
|
|
|
3
3
|
type BrowserDataMap = Record<string, unknown>;
|
|
4
4
|
type FrameworkEnvTarget = 'generic' | 'vite' | 'next' | 'webpack' | (string & {});
|
package/dist/build/index.js
CHANGED
|
@@ -1,23 +1,36 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCnos
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-CV3SLBYZ.js";
|
|
4
|
+
import "../chunk-RYIARE4M.js";
|
|
5
|
+
import "../chunk-TT4NV56Z.js";
|
|
6
|
+
import "../chunk-UL63DFLS.js";
|
|
7
|
+
import "../chunk-5KIQCYFH.js";
|
|
8
|
+
import "../chunk-2DGT7N7E.js";
|
|
9
|
+
import "../chunk-OA7FQGAG.js";
|
|
10
|
+
import "../chunk-2TL42I6M.js";
|
|
11
11
|
|
|
12
12
|
// src/build/index.ts
|
|
13
13
|
async function resolveBrowserData(options = {}) {
|
|
14
|
-
const runtime = await createCnos(
|
|
14
|
+
const runtime = await createCnos({
|
|
15
|
+
...options,
|
|
16
|
+
cacheMode: options.cacheMode ?? "build"
|
|
17
|
+
});
|
|
15
18
|
const browserData = {};
|
|
16
|
-
for (const [key
|
|
19
|
+
for (const [key] of runtime.graph.entries) {
|
|
17
20
|
if (!key.startsWith("public.")) {
|
|
18
21
|
continue;
|
|
19
22
|
}
|
|
20
|
-
|
|
23
|
+
const inspect = runtime.inspect(key);
|
|
24
|
+
if (inspect.derived?.runtimeDependent) {
|
|
25
|
+
throw new Error(
|
|
26
|
+
`Cannot build browser projection: ${key} depends on runtime namespaces ${inspect.derived.runtimeNamespaces.join(", ") || "runtime"}.`
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
const value = runtime.read(key);
|
|
30
|
+
if (value === void 0) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
browserData[key] = value;
|
|
21
34
|
}
|
|
22
35
|
return browserData;
|
|
23
36
|
}
|
|
@@ -57,17 +70,26 @@ function toFrameworkEnv(browserData, framework = "generic", options = {}) {
|
|
|
57
70
|
}
|
|
58
71
|
async function resolveFrameworkEnv(options = {}, framework = "generic", envOptions = {}) {
|
|
59
72
|
if (framework === "generic") {
|
|
60
|
-
const browserData = await resolveBrowserData(
|
|
73
|
+
const browserData = await resolveBrowserData({
|
|
74
|
+
...options,
|
|
75
|
+
cacheMode: options.cacheMode ?? "build"
|
|
76
|
+
});
|
|
61
77
|
return toFrameworkEnv(browserData, framework, envOptions);
|
|
62
78
|
}
|
|
63
|
-
const runtime = await createCnos(
|
|
79
|
+
const runtime = await createCnos({
|
|
80
|
+
...options,
|
|
81
|
+
cacheMode: options.cacheMode ?? "build"
|
|
82
|
+
});
|
|
64
83
|
return runtime.toPublicEnv({
|
|
65
84
|
framework,
|
|
66
85
|
...envOptions.prefix ? { prefix: envOptions.prefix } : {}
|
|
67
86
|
});
|
|
68
87
|
}
|
|
69
88
|
async function resolveServerProjection(options = {}) {
|
|
70
|
-
const runtime = await createCnos(
|
|
89
|
+
const runtime = await createCnos({
|
|
90
|
+
...options,
|
|
91
|
+
cacheMode: options.cacheMode ?? "build"
|
|
92
|
+
});
|
|
71
93
|
return runtime.toServerProjection();
|
|
72
94
|
}
|
|
73
95
|
export {
|