@kitsy/cnos 1.9.2 → 1.11.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 +523 -80
- package/dist/build/index.d.cts +1 -1
- package/dist/build/index.d.ts +1 -1
- package/dist/build/index.js +13 -15
- package/dist/{chunk-6QQPHDUI.js → chunk-2DMCB3PK.js} +1 -1
- package/dist/{chunk-LURQ4LAK.js → chunk-5JGNRADB.js} +1 -1
- package/dist/{chunk-2JBA2LXU.js → chunk-DPC2BV3S.js} +35 -6
- package/dist/{chunk-7JZO6XN3.js → chunk-KJ57PF47.js} +1 -1
- package/dist/{chunk-CPGRRZLP.js → chunk-NFGPS7VJ.js} +8 -8
- package/dist/{chunk-A2WG3ZKW.js → chunk-NU25VFA2.js} +1 -1
- package/dist/{chunk-L7JVECPE.js → chunk-RNTTPI5S.js} +1 -1
- package/dist/{chunk-NVFACB64.js → chunk-T3E57MSQ.js} +1 -1
- package/dist/{chunk-7KVM5PUW.js → chunk-WPB4HB2K.js} +478 -61
- package/dist/{chunk-QK7BMU47.js → chunk-XGK6DXQL.js} +157 -37
- package/dist/configure/index.cjs +521 -76
- 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/{core-zDTUSVx9.d.cts → core-BW8SLnRx.d.cts} +46 -7
- package/dist/{core-zDTUSVx9.d.ts → core-BW8SLnRx.d.ts} +46 -7
- package/dist/{envNaming-EFzezmB3.d.cts → envNaming-1rk7BR0e.d.cts} +1 -1
- package/dist/{envNaming-BkorOKW_.d.ts → envNaming-CjL28IeH.d.ts} +1 -1
- package/dist/index.cjs +672 -108
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +10 -10
- package/dist/internal.cjs +378 -54
- package/dist/internal.d.cts +32 -4
- package/dist/internal.d.ts +32 -4
- package/dist/internal.js +141 -23
- package/dist/plugin/basic-schema.cjs +13 -3
- 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 +4 -1
- 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 +40 -8
- 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 +5 -2
- 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 +13 -10
- 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 +4 -1
- 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 +672 -108
- package/dist/runtime/index.d.cts +13 -6
- package/dist/runtime/index.d.ts +13 -6
- package/dist/runtime/index.js +10 -10
- package/dist/{toPublicEnv-Ds1DRwCX.d.cts → toPublicEnv-CZzpvhGg.d.cts} +1 -1
- package/dist/{toPublicEnv-CT265rzS.d.ts → toPublicEnv-CmydGcxg.d.ts} +1 -1
- package/package.json +1 -1
package/dist/build/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CnosCreateOptions, S as ServerProjection } from '../core-
|
|
1
|
+
import { C as CnosCreateOptions, S as ServerProjection } from '../core-BW8SLnRx.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 '../core-
|
|
1
|
+
import { C as CnosCreateOptions, S as ServerProjection } from '../core-BW8SLnRx.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,17 +1,17 @@
|
|
|
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-
|
|
3
|
+
} from "../chunk-NFGPS7VJ.js";
|
|
4
|
+
import "../chunk-5JGNRADB.js";
|
|
5
|
+
import "../chunk-NU25VFA2.js";
|
|
6
|
+
import "../chunk-RNTTPI5S.js";
|
|
7
|
+
import "../chunk-2DMCB3PK.js";
|
|
8
|
+
import "../chunk-KJ57PF47.js";
|
|
9
|
+
import "../chunk-DPC2BV3S.js";
|
|
10
10
|
import {
|
|
11
11
|
CnosManifestError,
|
|
12
|
-
|
|
12
|
+
assertSecretRefVaultProviderCompatible,
|
|
13
13
|
isSecretReference
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-WPB4HB2K.js";
|
|
15
15
|
|
|
16
16
|
// src/build/index.ts
|
|
17
17
|
async function resolveBrowserData(options = {}) {
|
|
@@ -106,15 +106,13 @@ function validateServerProjectionSecretRefs(runtime) {
|
|
|
106
106
|
}
|
|
107
107
|
const vaultId = entry.value.vault ?? "default";
|
|
108
108
|
const definition = runtime.manifest.vaults[vaultId];
|
|
109
|
-
if (!definition) {
|
|
109
|
+
if (!definition && entry.value.vault) {
|
|
110
110
|
throw new CnosManifestError(`Unknown vault "${vaultId}" for secret ref "${entry.key}"`);
|
|
111
111
|
}
|
|
112
|
-
if (entry.value.provider
|
|
113
|
-
throw new CnosManifestError(
|
|
114
|
-
`Secret ref "${entry.key}" declares provider "${entry.value.provider}" but vault "${vaultId}" uses provider "${definition.provider}"`
|
|
115
|
-
);
|
|
112
|
+
if (!definition && !entry.value.provider) {
|
|
113
|
+
throw new CnosManifestError(`Secret ref "${entry.key}" must declare a provider or reference a configured vault`);
|
|
116
114
|
}
|
|
117
|
-
|
|
115
|
+
assertSecretRefVaultProviderCompatible(runtime.manifest, entry.value, entry.key);
|
|
118
116
|
}
|
|
119
117
|
}
|
|
120
118
|
export {
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
envVarToLogicalKey,
|
|
3
3
|
resolveWorkspaceScopedPath,
|
|
4
4
|
toPortablePath
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WPB4HB2K.js";
|
|
6
6
|
|
|
7
7
|
// ../../plugins/dotenv/src/index.ts
|
|
8
8
|
import { readFile } from "fs/promises";
|
|
@@ -11,9 +11,30 @@ var DOTENV_PLUGIN_ID = "@kitsy/cnos/plugins/dotenv";
|
|
|
11
11
|
function parseDoubleQuoted(value) {
|
|
12
12
|
return value.replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\t/g, " ").replace(/\\"/g, '"').replace(/\\\\/g, "\\");
|
|
13
13
|
}
|
|
14
|
+
function isEscapedCharacter(value, index) {
|
|
15
|
+
let slashCount = 0;
|
|
16
|
+
for (let cursor = index - 1; cursor >= 0 && value[cursor] === "\\"; cursor -= 1) {
|
|
17
|
+
slashCount += 1;
|
|
18
|
+
}
|
|
19
|
+
return slashCount % 2 === 1;
|
|
20
|
+
}
|
|
21
|
+
function findClosingQuote(value, quote) {
|
|
22
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
23
|
+
if (value[index] !== quote) {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
if (quote === '"' && isEscapedCharacter(value, index)) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
return index;
|
|
30
|
+
}
|
|
31
|
+
return -1;
|
|
32
|
+
}
|
|
14
33
|
function parseDotenv(document) {
|
|
15
34
|
const parsed = {};
|
|
16
|
-
|
|
35
|
+
const lines = document.split(/\r?\n/);
|
|
36
|
+
for (let lineIndex = 0; lineIndex < lines.length; lineIndex += 1) {
|
|
37
|
+
const rawLine = lines[lineIndex] ?? "";
|
|
17
38
|
const line = rawLine.trim();
|
|
18
39
|
if (!line || line.startsWith("#")) {
|
|
19
40
|
continue;
|
|
@@ -28,10 +49,18 @@ function parseDotenv(document) {
|
|
|
28
49
|
if (!envVar) {
|
|
29
50
|
continue;
|
|
30
51
|
}
|
|
31
|
-
if (value.startsWith('"')
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
52
|
+
if (value.startsWith('"') || value.startsWith("'")) {
|
|
53
|
+
const quote = value.startsWith('"') ? '"' : "'";
|
|
54
|
+
let quotedContent = value.slice(1);
|
|
55
|
+
let closingIndex = findClosingQuote(quotedContent, quote);
|
|
56
|
+
while (closingIndex === -1 && lineIndex < lines.length - 1) {
|
|
57
|
+
lineIndex += 1;
|
|
58
|
+
quotedContent = `${quotedContent}
|
|
59
|
+
${lines[lineIndex] ?? ""}`;
|
|
60
|
+
closingIndex = findClosingQuote(quotedContent, quote);
|
|
61
|
+
}
|
|
62
|
+
const rawQuotedValue = closingIndex === -1 ? quotedContent : quotedContent.slice(0, closingIndex);
|
|
63
|
+
value = quote === '"' ? parseDoubleQuoted(rawQuotedValue) : rawQuotedValue;
|
|
35
64
|
} else {
|
|
36
65
|
value = value.replace(/\s+#.*$/, "").trim();
|
|
37
66
|
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createEnvExportPlugin,
|
|
3
3
|
createPublicEnvExportPlugin
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5JGNRADB.js";
|
|
5
5
|
import {
|
|
6
6
|
createFilesystemSecretsPlugin,
|
|
7
7
|
createFilesystemValuesPlugin
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NU25VFA2.js";
|
|
9
9
|
import {
|
|
10
10
|
createProcessEnvPlugin
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-RNTTPI5S.js";
|
|
12
12
|
import {
|
|
13
13
|
createBasicSchemaPlugin
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-2DMCB3PK.js";
|
|
15
15
|
import {
|
|
16
16
|
createCliArgsPlugin
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-KJ57PF47.js";
|
|
18
18
|
import {
|
|
19
19
|
createDotenvPlugin
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-DPC2BV3S.js";
|
|
21
21
|
import {
|
|
22
22
|
createCnos,
|
|
23
23
|
createProvenanceInspector
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-WPB4HB2K.js";
|
|
25
25
|
|
|
26
26
|
// src/defaultPlugins.ts
|
|
27
27
|
function defaultPlugins() {
|
|
@@ -68,7 +68,7 @@ function setBootstrappedSecretHydrationRequired(value) {
|
|
|
68
68
|
// package.json
|
|
69
69
|
var package_default = {
|
|
70
70
|
name: "@kitsy/cnos",
|
|
71
|
-
version: "1.
|
|
71
|
+
version: "1.11.0",
|
|
72
72
|
description: "Batteries-included CNOS runtime package wired with the official plugins.",
|
|
73
73
|
type: "module",
|
|
74
74
|
main: "./dist/index.cjs",
|