@kitsy/cnos 0.0.1 → 1.0.1

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.
Files changed (47) hide show
  1. package/README.md +3 -1
  2. package/dist/chunk-44JOQPSN.js +109 -0
  3. package/dist/chunk-ASZ7I3JJ.js +35 -0
  4. package/dist/chunk-CGTFH4QQ.js +49 -0
  5. package/dist/chunk-GGYIRIGU.js +83 -0
  6. package/dist/chunk-H65FPTDM.js +23 -0
  7. package/dist/chunk-K2T4R5WH.js +1565 -0
  8. package/dist/chunk-KG6OZX5C.js +202 -0
  9. package/dist/envNaming-BrOk5ndZ.d.cts +8 -0
  10. package/dist/envNaming-DCaNdnrF.d.ts +8 -0
  11. package/dist/index.cjs +1942 -28
  12. package/dist/index.d.cts +7 -3
  13. package/dist/index.d.ts +7 -3
  14. package/dist/index.js +112 -23
  15. package/dist/internal.cjs +288 -0
  16. package/dist/internal.d.cts +20 -0
  17. package/dist/internal.d.ts +20 -0
  18. package/dist/internal.js +18 -0
  19. package/dist/plugin/basic-schema.cjs +214 -3
  20. package/dist/plugin/basic-schema.d.cts +5 -6
  21. package/dist/plugin/basic-schema.d.ts +5 -6
  22. package/dist/plugin/basic-schema.js +7 -2
  23. package/dist/plugin/cli-args.cjs +132 -3
  24. package/dist/plugin/cli-args.d.cts +12 -1
  25. package/dist/plugin/cli-args.d.ts +12 -1
  26. package/dist/plugin/cli-args.js +11 -2
  27. package/dist/plugin/dotenv.cjs +212 -3
  28. package/dist/plugin/dotenv.d.cts +8 -1
  29. package/dist/plugin/dotenv.d.ts +8 -1
  30. package/dist/plugin/dotenv.js +11 -2
  31. package/dist/plugin/env-export.cjs +222 -3
  32. package/dist/plugin/env-export.d.cts +7 -1
  33. package/dist/plugin/env-export.d.ts +7 -1
  34. package/dist/plugin/env-export.js +14 -2
  35. package/dist/plugin/filesystem.cjs +320 -3
  36. package/dist/plugin/filesystem.d.cts +17 -1
  37. package/dist/plugin/filesystem.d.ts +17 -1
  38. package/dist/plugin/filesystem.js +17 -2
  39. package/dist/plugin/process-env.cjs +126 -3
  40. package/dist/plugin/process-env.d.cts +7 -1
  41. package/dist/plugin/process-env.d.ts +7 -1
  42. package/dist/plugin/process-env.js +9 -2
  43. package/dist/plugin-BVNEHj19.d.cts +309 -0
  44. package/dist/plugin-BVNEHj19.d.ts +309 -0
  45. package/dist/toPublicEnv-Dd152fFy.d.cts +7 -0
  46. package/dist/toPublicEnv-Gwz3xTK0.d.ts +7 -0
  47. package/package.json +15 -16
@@ -1,8 +1,14 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
6
12
  var __copyProps = (to, from, except, desc) => {
7
13
  if (from && typeof from === "object" || typeof from === "function") {
8
14
  for (let key of __getOwnPropNames(from))
@@ -11,14 +17,217 @@ var __copyProps = (to, from, except, desc) => {
11
17
  }
12
18
  return to;
13
19
  };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
15
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
29
 
17
30
  // src/plugin/dotenv.ts
18
31
  var dotenv_exports = {};
32
+ __export(dotenv_exports, {
33
+ createDotenvPlugin: () => createDotenvPlugin,
34
+ dotenvEntriesFromObject: () => dotenvEntriesFromObject,
35
+ parseDotenv: () => parseDotenv
36
+ });
19
37
  module.exports = __toCommonJS(dotenv_exports);
20
- __reExport(dotenv_exports, require("@kitsy/cnos-plugin-dotenv"), module.exports);
38
+
39
+ // ../../plugins/dotenv/src/index.ts
40
+ var import_promises8 = require("fs/promises");
41
+ var import_node_path8 = __toESM(require("path"), 1);
42
+
43
+ // ../core/src/manifest/loadManifest.ts
44
+ var import_promises2 = require("fs/promises");
45
+ var import_node_path2 = __toESM(require("path"), 1);
46
+
47
+ // ../core/src/utils/path.ts
48
+ var import_promises = require("fs/promises");
49
+ var import_node_os = __toESM(require("os"), 1);
50
+ var import_node_path = __toESM(require("path"), 1);
51
+ function interpolatePathTemplate(template, tokens) {
52
+ return Object.entries(tokens).reduce(
53
+ (result, [token, value]) => result.replaceAll(`{${token}}`, value),
54
+ template
55
+ );
56
+ }
57
+ function stripWorkspaceTemplatePrefix(template) {
58
+ const normalized = template.replace(/\\/g, "/").replace(/^\.\//, "");
59
+ const marker = "workspaces/{workspace}";
60
+ if (normalized === marker) {
61
+ return ".";
62
+ }
63
+ if (normalized.startsWith(`${marker}/`)) {
64
+ return normalized.slice(marker.length + 1);
65
+ }
66
+ return template;
67
+ }
68
+ function resolveWorkspaceScopedPath(workspaceRoot, template, tokens) {
69
+ const relativeTemplate = stripWorkspaceTemplatePrefix(template);
70
+ const interpolated = interpolatePathTemplate(relativeTemplate, tokens);
71
+ return import_node_path.default.resolve(workspaceRoot, interpolated);
72
+ }
73
+ function toPortablePath(targetPath) {
74
+ return targetPath.replace(/\\/g, "/");
75
+ }
76
+
77
+ // ../core/src/utils/yaml.ts
78
+ var import_yaml = require("yaml");
79
+
80
+ // ../core/src/manifest/loadWorkspaceFile.ts
81
+ var import_promises3 = require("fs/promises");
82
+ var import_node_path3 = __toESM(require("path"), 1);
83
+
84
+ // ../core/src/profiles/expandProfileChain.ts
85
+ var import_promises4 = require("fs/promises");
86
+ var import_node_path4 = __toESM(require("path"), 1);
87
+
88
+ // ../core/src/workspaces/resolveWorkspaceContext.ts
89
+ var import_promises5 = require("fs/promises");
90
+ var import_node_path5 = __toESM(require("path"), 1);
91
+
92
+ // ../core/src/utils/envNaming.ts
93
+ function normalizeMappingConfig(config = {}) {
94
+ return {
95
+ convention: config.convention,
96
+ explicit: config.explicit ?? {}
97
+ };
98
+ }
99
+ function fromScreamingSnake(path9) {
100
+ return path9.split("_").map((segment) => segment.trim().toLowerCase()).filter(Boolean).join(".");
101
+ }
102
+ function envVarToLogicalKey(envVar, config = {}) {
103
+ const normalized = normalizeMappingConfig(config);
104
+ const explicitMatch = normalized.explicit[envVar];
105
+ if (explicitMatch) {
106
+ return explicitMatch;
107
+ }
108
+ if (normalized.convention !== "SCREAMING_SNAKE") {
109
+ return void 0;
110
+ }
111
+ if (envVar.startsWith("SECRET_")) {
112
+ const stripped = envVar.slice("SECRET_".length);
113
+ if (!stripped) {
114
+ return void 0;
115
+ }
116
+ return `secret.${fromScreamingSnake(stripped)}`;
117
+ }
118
+ if (!/^[A-Z][A-Z0-9_]*$/.test(envVar)) {
119
+ return void 0;
120
+ }
121
+ return `value.${fromScreamingSnake(envVar)}`;
122
+ }
123
+
124
+ // ../core/src/runtime/dump.ts
125
+ var import_promises6 = require("fs/promises");
126
+ var import_node_path6 = __toESM(require("path"), 1);
127
+
128
+ // ../core/src/utils/secretStore.ts
129
+ var import_node_crypto = require("crypto");
130
+ var import_promises7 = require("fs/promises");
131
+ var import_node_path7 = __toESM(require("path"), 1);
132
+
133
+ // ../../plugins/dotenv/src/index.ts
134
+ var DOTENV_PLUGIN_ID = "@kitsy/cnos/plugins/dotenv";
135
+ function parseDoubleQuoted(value) {
136
+ return value.replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\t/g, " ").replace(/\\"/g, '"').replace(/\\\\/g, "\\");
137
+ }
138
+ function parseDotenv(document) {
139
+ const parsed = {};
140
+ for (const rawLine of document.split(/\r?\n/)) {
141
+ const line = rawLine.trim();
142
+ if (!line || line.startsWith("#")) {
143
+ continue;
144
+ }
145
+ const withoutExport = line.startsWith("export ") ? line.slice("export ".length).trim() : line;
146
+ const separatorIndex = withoutExport.indexOf("=");
147
+ if (separatorIndex <= 0) {
148
+ continue;
149
+ }
150
+ const envVar = withoutExport.slice(0, separatorIndex).trim();
151
+ let value = withoutExport.slice(separatorIndex + 1).trim();
152
+ if (!envVar) {
153
+ continue;
154
+ }
155
+ if (value.startsWith('"') && value.endsWith('"')) {
156
+ value = parseDoubleQuoted(value.slice(1, -1));
157
+ } else if (value.startsWith("'") && value.endsWith("'")) {
158
+ value = value.slice(1, -1);
159
+ } else {
160
+ value = value.replace(/\s+#.*$/, "").trim();
161
+ }
162
+ parsed[envVar] = value;
163
+ }
164
+ return parsed;
165
+ }
166
+ function dotenvEntriesFromObject(values, mapping = {}, originFile, workspaceId = "default") {
167
+ return Object.entries(values).flatMap(([envVar, value]) => {
168
+ const logicalKey = envVarToLogicalKey(envVar, mapping);
169
+ if (!logicalKey) {
170
+ return [];
171
+ }
172
+ return [
173
+ {
174
+ key: logicalKey,
175
+ value,
176
+ namespace: logicalKey.startsWith("secret.") ? "secret" : "value",
177
+ sourceId: "dotenv",
178
+ pluginId: DOTENV_PLUGIN_ID,
179
+ workspaceId,
180
+ origin: {
181
+ envVar,
182
+ ...originFile ? { file: originFile } : {}
183
+ }
184
+ }
185
+ ];
186
+ });
187
+ }
188
+ async function readIfPresent(filePath) {
189
+ try {
190
+ return await (0, import_promises8.readFile)(filePath, "utf8");
191
+ } catch {
192
+ return void 0;
193
+ }
194
+ }
195
+ function createDotenvPlugin() {
196
+ return {
197
+ id: "dotenv",
198
+ kind: "loader",
199
+ async load(context) {
200
+ const config = context.manifestConfig;
201
+ const rootTemplate = config.root ?? "./env";
202
+ const fileNames = context.profileActivation.envFiles;
203
+ const entries = [];
204
+ for (const workspaceRoot of context.workspace.workspaceRoots) {
205
+ const envRoot = resolveWorkspaceScopedPath(workspaceRoot.path, rootTemplate, {
206
+ workspace: workspaceRoot.workspaceId
207
+ });
208
+ for (const fileName of fileNames) {
209
+ const absolutePath = import_node_path8.default.join(envRoot, fileName);
210
+ const document = await readIfPresent(absolutePath);
211
+ if (!document) {
212
+ continue;
213
+ }
214
+ entries.push(
215
+ ...dotenvEntriesFromObject(
216
+ parseDotenv(document),
217
+ config.envMapping,
218
+ toPortablePath(import_node_path8.default.relative(import_node_path8.default.dirname(context.manifestRoot), absolutePath)),
219
+ workspaceRoot.workspaceId
220
+ )
221
+ );
222
+ }
223
+ }
224
+ return entries;
225
+ }
226
+ };
227
+ }
21
228
  // Annotate the CommonJS export names for ESM import in node:
22
229
  0 && (module.exports = {
23
- ...require("@kitsy/cnos-plugin-dotenv")
230
+ createDotenvPlugin,
231
+ dotenvEntriesFromObject,
232
+ parseDotenv
24
233
  });
@@ -1 +1,8 @@
1
- export * from '@kitsy/cnos-plugin-dotenv';
1
+ import { L as LoaderPlugin, f as ConfigEntry } from '../plugin-BVNEHj19.cjs';
2
+ import { E as EnvMappingConfig } from '../envNaming-BrOk5ndZ.cjs';
3
+
4
+ declare function parseDotenv(document: string): Record<string, string>;
5
+ declare function dotenvEntriesFromObject(values: Record<string, string>, mapping?: EnvMappingConfig, originFile?: string, workspaceId?: string): ConfigEntry[];
6
+ declare function createDotenvPlugin(): LoaderPlugin;
7
+
8
+ export { createDotenvPlugin, dotenvEntriesFromObject, parseDotenv };
@@ -1 +1,8 @@
1
- export * from '@kitsy/cnos-plugin-dotenv';
1
+ import { L as LoaderPlugin, f as ConfigEntry } from '../plugin-BVNEHj19.js';
2
+ import { E as EnvMappingConfig } from '../envNaming-DCaNdnrF.js';
3
+
4
+ declare function parseDotenv(document: string): Record<string, string>;
5
+ declare function dotenvEntriesFromObject(values: Record<string, string>, mapping?: EnvMappingConfig, originFile?: string, workspaceId?: string): ConfigEntry[];
6
+ declare function createDotenvPlugin(): LoaderPlugin;
7
+
8
+ export { createDotenvPlugin, dotenvEntriesFromObject, parseDotenv };
@@ -1,2 +1,11 @@
1
- // src/plugin/dotenv.ts
2
- export * from "@kitsy/cnos-plugin-dotenv";
1
+ import {
2
+ createDotenvPlugin,
3
+ dotenvEntriesFromObject,
4
+ parseDotenv
5
+ } from "../chunk-44JOQPSN.js";
6
+ import "../chunk-K2T4R5WH.js";
7
+ export {
8
+ createDotenvPlugin,
9
+ dotenvEntriesFromObject,
10
+ parseDotenv
11
+ };
@@ -1,8 +1,14 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
6
12
  var __copyProps = (to, from, except, desc) => {
7
13
  if (from && typeof from === "object" || typeof from === "function") {
8
14
  for (let key of __getOwnPropNames(from))
@@ -11,14 +17,227 @@ var __copyProps = (to, from, except, desc) => {
11
17
  }
12
18
  return to;
13
19
  };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
15
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
29
 
17
30
  // src/plugin/env-export.ts
18
31
  var env_export_exports = {};
32
+ __export(env_export_exports, {
33
+ createEnvExportPlugin: () => createEnvExportPlugin,
34
+ createPublicEnvExportPlugin: () => createPublicEnvExportPlugin,
35
+ toEnv: () => toEnv,
36
+ toPublicEnv: () => toPublicEnv
37
+ });
19
38
  module.exports = __toCommonJS(env_export_exports);
20
- __reExport(env_export_exports, require("@kitsy/cnos-plugin-env-export"), module.exports);
39
+
40
+ // ../core/src/errors.ts
41
+ var CnosError = class extends Error {
42
+ constructor(message) {
43
+ super(message);
44
+ this.name = new.target.name;
45
+ }
46
+ };
47
+ var CnosManifestError = class extends CnosError {
48
+ constructor(message, manifestPath) {
49
+ super(manifestPath ? `${message} (${manifestPath})` : message);
50
+ this.manifestPath = manifestPath;
51
+ }
52
+ manifestPath;
53
+ };
54
+
55
+ // ../core/src/manifest/loadManifest.ts
56
+ var import_promises2 = require("fs/promises");
57
+ var import_node_path2 = __toESM(require("path"), 1);
58
+
59
+ // ../core/src/utils/path.ts
60
+ var import_promises = require("fs/promises");
61
+ var import_node_os = __toESM(require("os"), 1);
62
+ var import_node_path = __toESM(require("path"), 1);
63
+
64
+ // ../core/src/utils/yaml.ts
65
+ var import_yaml = require("yaml");
66
+
67
+ // ../core/src/manifest/loadWorkspaceFile.ts
68
+ var import_promises3 = require("fs/promises");
69
+ var import_node_path3 = __toESM(require("path"), 1);
70
+
71
+ // ../core/src/profiles/expandProfileChain.ts
72
+ var import_promises4 = require("fs/promises");
73
+ var import_node_path4 = __toESM(require("path"), 1);
74
+
75
+ // ../core/src/workspaces/resolveWorkspaceContext.ts
76
+ var import_promises5 = require("fs/promises");
77
+ var import_node_path5 = __toESM(require("path"), 1);
78
+
79
+ // ../core/src/utils/envNaming.ts
80
+ function normalizeMappingConfig(config = {}) {
81
+ return {
82
+ convention: config.convention,
83
+ explicit: config.explicit ?? {}
84
+ };
85
+ }
86
+ function toScreamingSnakeSegment(segment) {
87
+ return segment.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[^A-Za-z0-9]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
88
+ }
89
+ function toScreamingSnake(path8) {
90
+ return path8.split(".").map((segment) => toScreamingSnakeSegment(segment)).filter(Boolean).join("_");
91
+ }
92
+ function logicalKeyToEnvVar(key, config = {}) {
93
+ const normalized = normalizeMappingConfig(config);
94
+ const explicitEntry = Object.entries(normalized.explicit).find(([, logicalKey]) => logicalKey === key);
95
+ if (explicitEntry) {
96
+ return explicitEntry[0];
97
+ }
98
+ if (normalized.convention !== "SCREAMING_SNAKE") {
99
+ return void 0;
100
+ }
101
+ if (key.startsWith("value.")) {
102
+ return toScreamingSnake(key.slice("value.".length));
103
+ }
104
+ if (key.startsWith("secret.")) {
105
+ return `SECRET_${toScreamingSnake(key.slice("secret.".length))}`;
106
+ }
107
+ return void 0;
108
+ }
109
+
110
+ // ../core/src/runtime/toEnv.ts
111
+ function fallbackLogicalKeyToEnvVar(key) {
112
+ if (key.startsWith("value.")) {
113
+ return key.slice("value.".length).replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[^A-Za-z0-9]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
114
+ }
115
+ if (key.startsWith("secret.")) {
116
+ const normalized = key.slice("secret.".length).replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[^A-Za-z0-9]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
117
+ return `SECRET_${normalized}`;
118
+ }
119
+ return key.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[^A-Za-z0-9]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
120
+ }
121
+ function normalizeEnvValue(value) {
122
+ if (value === void 0 || value === null) {
123
+ return "";
124
+ }
125
+ if (typeof value === "string") {
126
+ return value;
127
+ }
128
+ if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
129
+ return String(value);
130
+ }
131
+ return JSON.stringify(value);
132
+ }
133
+ function toEnv(graph, manifest, options = {}) {
134
+ const includeSecrets = options.includeSecrets ?? true;
135
+ const output = {};
136
+ const resolvedEntries = Array.from(graph.entries.values()).sort(
137
+ (left, right) => left.key.localeCompare(right.key)
138
+ );
139
+ for (const entry of resolvedEntries) {
140
+ if (entry.namespace === "meta") {
141
+ continue;
142
+ }
143
+ if (!includeSecrets && entry.namespace === "secret") {
144
+ continue;
145
+ }
146
+ const envVar = logicalKeyToEnvVar(entry.key, manifest.envMapping) ?? fallbackLogicalKeyToEnvVar(entry.key);
147
+ output[envVar] = normalizeEnvValue(entry.value);
148
+ }
149
+ return output;
150
+ }
151
+
152
+ // ../core/src/runtime/toPublicEnv.ts
153
+ function fallbackValueEnvVar(key) {
154
+ return key.replace(/^value\./, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[^A-Za-z0-9]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "").toUpperCase();
155
+ }
156
+ function normalizeEnvValue2(value) {
157
+ if (value === void 0 || value === null) {
158
+ return "";
159
+ }
160
+ if (typeof value === "string") {
161
+ return value;
162
+ }
163
+ if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
164
+ return String(value);
165
+ }
166
+ return JSON.stringify(value);
167
+ }
168
+ function resolvePublicPrefix(manifest, options) {
169
+ if (options.prefix) {
170
+ return options.prefix;
171
+ }
172
+ if (!options.framework) {
173
+ return "";
174
+ }
175
+ const configuredPrefix = manifest.public.frameworks[options.framework];
176
+ if (!configuredPrefix) {
177
+ throw new CnosManifestError(`Unknown public framework prefix: ${options.framework}`);
178
+ }
179
+ return configuredPrefix;
180
+ }
181
+ function ensurePublicPromotionKey(key) {
182
+ if (!key.startsWith("value.")) {
183
+ throw new CnosManifestError(`public.promote may only contain value.* keys: ${key}`);
184
+ }
185
+ }
186
+ function toPublicEnv(graph, manifest, options = {}) {
187
+ const prefix = resolvePublicPrefix(manifest, options);
188
+ const output = {};
189
+ const promotions = [...manifest.public.promote].sort((left, right) => left.localeCompare(right));
190
+ for (const key of promotions) {
191
+ ensurePublicPromotionKey(key);
192
+ const resolved = graph.entries.get(key);
193
+ if (!resolved) {
194
+ continue;
195
+ }
196
+ const baseEnvVar = logicalKeyToEnvVar(key, manifest.envMapping) ?? fallbackValueEnvVar(key);
197
+ const envVar = prefix && !baseEnvVar.startsWith(prefix) ? `${prefix}${baseEnvVar}` : baseEnvVar;
198
+ output[envVar] = normalizeEnvValue2(resolved.value);
199
+ }
200
+ return output;
201
+ }
202
+
203
+ // ../core/src/runtime/dump.ts
204
+ var import_promises6 = require("fs/promises");
205
+ var import_node_path6 = __toESM(require("path"), 1);
206
+
207
+ // ../core/src/utils/secretStore.ts
208
+ var import_node_crypto = require("crypto");
209
+ var import_promises7 = require("fs/promises");
210
+ var import_node_path7 = __toESM(require("path"), 1);
211
+
212
+ // ../../plugins/env-export/src/index.ts
213
+ function createEnvExportPlugin() {
214
+ return {
215
+ id: "@kitsy/cnos/plugins/env-export",
216
+ kind: "exporter",
217
+ async export(graph, context) {
218
+ return {
219
+ pluginId: "@kitsy/cnos/plugins/env-export",
220
+ value: toEnv(graph, context.manifest)
221
+ };
222
+ }
223
+ };
224
+ }
225
+ function createPublicEnvExportPlugin() {
226
+ return {
227
+ id: "@kitsy/cnos/plugins/public-env-export",
228
+ kind: "exporter",
229
+ async export(graph, context) {
230
+ return {
231
+ pluginId: "@kitsy/cnos/plugins/public-env-export",
232
+ value: toPublicEnv(graph, context.manifest)
233
+ };
234
+ }
235
+ };
236
+ }
21
237
  // Annotate the CommonJS export names for ESM import in node:
22
238
  0 && (module.exports = {
23
- ...require("@kitsy/cnos-plugin-env-export")
239
+ createEnvExportPlugin,
240
+ createPublicEnvExportPlugin,
241
+ toEnv,
242
+ toPublicEnv
24
243
  });
@@ -1 +1,7 @@
1
- export * from '@kitsy/cnos-plugin-env-export';
1
+ import { E as ExporterPlugin } from '../plugin-BVNEHj19.cjs';
2
+ export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-Dd152fFy.cjs';
3
+
4
+ declare function createEnvExportPlugin(): ExporterPlugin;
5
+ declare function createPublicEnvExportPlugin(): ExporterPlugin;
6
+
7
+ export { createEnvExportPlugin, createPublicEnvExportPlugin };
@@ -1 +1,7 @@
1
- export * from '@kitsy/cnos-plugin-env-export';
1
+ import { E as ExporterPlugin } from '../plugin-BVNEHj19.js';
2
+ export { t as toEnv, a as toPublicEnv } from '../toPublicEnv-Gwz3xTK0.js';
3
+
4
+ declare function createEnvExportPlugin(): ExporterPlugin;
5
+ declare function createPublicEnvExportPlugin(): ExporterPlugin;
6
+
7
+ export { createEnvExportPlugin, createPublicEnvExportPlugin };
@@ -1,2 +1,14 @@
1
- // src/plugin/env-export.ts
2
- export * from "@kitsy/cnos-plugin-env-export";
1
+ import {
2
+ createEnvExportPlugin,
3
+ createPublicEnvExportPlugin
4
+ } from "../chunk-ASZ7I3JJ.js";
5
+ import {
6
+ toEnv,
7
+ toPublicEnv
8
+ } from "../chunk-K2T4R5WH.js";
9
+ export {
10
+ createEnvExportPlugin,
11
+ createPublicEnvExportPlugin,
12
+ toEnv,
13
+ toPublicEnv
14
+ };