@kitsy/cnos 0.0.1 → 1.0.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/README.md +3 -1
- package/dist/chunk-BSETFXI3.js +23 -0
- package/dist/chunk-BSOPGV7G.js +49 -0
- package/dist/chunk-D7AYK7X5.js +8899 -0
- package/dist/chunk-I6QXNQEF.js +202 -0
- package/dist/chunk-QNGS4HFP.js +109 -0
- package/dist/chunk-TYA4BNYT.js +83 -0
- package/dist/chunk-V4LCFDBY.js +35 -0
- package/dist/envNaming-BrOk5ndZ.d.cts +8 -0
- package/dist/envNaming-DCaNdnrF.d.ts +8 -0
- package/dist/index.cjs +9244 -28
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +109 -23
- package/dist/internal.cjs +7593 -0
- package/dist/internal.d.cts +20 -0
- package/dist/internal.d.ts +20 -0
- package/dist/internal.js +18 -0
- package/dist/plugin/basic-schema.cjs +7519 -3
- package/dist/plugin/basic-schema.d.cts +5 -6
- package/dist/plugin/basic-schema.d.ts +5 -6
- package/dist/plugin/basic-schema.js +7 -2
- package/dist/plugin/cli-args.cjs +7437 -3
- package/dist/plugin/cli-args.d.cts +12 -1
- package/dist/plugin/cli-args.d.ts +12 -1
- package/dist/plugin/cli-args.js +11 -2
- package/dist/plugin/dotenv.cjs +7517 -3
- package/dist/plugin/dotenv.d.cts +8 -1
- package/dist/plugin/dotenv.d.ts +8 -1
- package/dist/plugin/dotenv.js +11 -2
- package/dist/plugin/env-export.cjs +7527 -3
- package/dist/plugin/env-export.d.cts +7 -1
- package/dist/plugin/env-export.d.ts +7 -1
- package/dist/plugin/env-export.js +14 -2
- package/dist/plugin/filesystem.cjs +7625 -3
- package/dist/plugin/filesystem.d.cts +17 -1
- package/dist/plugin/filesystem.d.ts +17 -1
- package/dist/plugin/filesystem.js +17 -2
- package/dist/plugin/process-env.cjs +7431 -3
- package/dist/plugin/process-env.d.cts +7 -1
- package/dist/plugin/process-env.d.ts +7 -1
- package/dist/plugin/process-env.js +9 -2
- package/dist/plugin-BVNEHj19.d.cts +309 -0
- package/dist/plugin-BVNEHj19.d.ts +309 -0
- package/dist/toPublicEnv-Dd152fFy.d.cts +7 -0
- package/dist/toPublicEnv-Gwz3xTK0.d.ts +7 -0
- package/package.json +14 -18
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
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 processEnvEntriesFromObject(env: Record<string, string | undefined>, mapping?: EnvMappingConfig, workspaceId?: string): ConfigEntry[];
|
|
5
|
+
declare function createProcessEnvPlugin(): LoaderPlugin;
|
|
6
|
+
|
|
7
|
+
export { createProcessEnvPlugin, processEnvEntriesFromObject };
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
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 processEnvEntriesFromObject(env: Record<string, string | undefined>, mapping?: EnvMappingConfig, workspaceId?: string): ConfigEntry[];
|
|
5
|
+
declare function createProcessEnvPlugin(): LoaderPlugin;
|
|
6
|
+
|
|
7
|
+
export { createProcessEnvPlugin, processEnvEntriesFromObject };
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
createProcessEnvPlugin,
|
|
3
|
+
processEnvEntriesFromObject
|
|
4
|
+
} from "../chunk-BSOPGV7G.js";
|
|
5
|
+
import "../chunk-D7AYK7X5.js";
|
|
6
|
+
export {
|
|
7
|
+
createProcessEnvPlugin,
|
|
8
|
+
processEnvEntriesFromObject
|
|
9
|
+
};
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
type ProfileResolveFrom = 'cli.profile' | 'env.CNOS_PROFILE' | 'default';
|
|
2
|
+
type ProfileSource = 'cli' | 'workspace-file' | 'env' | 'manifest-default';
|
|
3
|
+
interface ProfileActivation {
|
|
4
|
+
values: string[];
|
|
5
|
+
secrets: string[];
|
|
6
|
+
envFiles: string[];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface SchemaRule {
|
|
10
|
+
type?: 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
11
|
+
required?: boolean;
|
|
12
|
+
enum?: unknown[];
|
|
13
|
+
pattern?: string;
|
|
14
|
+
default?: unknown;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type WorkspaceSource = 'cli' | 'workspace-file' | 'manifest-default' | 'implicit';
|
|
18
|
+
type GlobalRootSource = 'cli' | 'workspace-file' | 'manifest' | 'CNOS_HOME';
|
|
19
|
+
interface WorkspaceFile {
|
|
20
|
+
workspace?: string;
|
|
21
|
+
profile?: string;
|
|
22
|
+
globalRoot?: string;
|
|
23
|
+
}
|
|
24
|
+
interface WorkspaceItemConfig {
|
|
25
|
+
extends?: string | string[];
|
|
26
|
+
globalId?: string;
|
|
27
|
+
}
|
|
28
|
+
interface NormalizedWorkspaceItem {
|
|
29
|
+
extends: string[];
|
|
30
|
+
globalId?: string;
|
|
31
|
+
}
|
|
32
|
+
interface WorkspaceRoot {
|
|
33
|
+
scope: 'global' | 'local';
|
|
34
|
+
workspaceId: string;
|
|
35
|
+
path: string;
|
|
36
|
+
}
|
|
37
|
+
interface WorkspaceContext {
|
|
38
|
+
workspaceId: string;
|
|
39
|
+
workspaceSource: WorkspaceSource;
|
|
40
|
+
globalRoot?: string;
|
|
41
|
+
globalRootSource?: GlobalRootSource;
|
|
42
|
+
workspaceChain: string[];
|
|
43
|
+
workspaceRoots: WorkspaceRoot[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type ResolutionArrayPolicy = 'replace' | 'append' | 'unique-append';
|
|
47
|
+
interface ManifestFile {
|
|
48
|
+
version?: number;
|
|
49
|
+
project?: {
|
|
50
|
+
name?: string;
|
|
51
|
+
};
|
|
52
|
+
workspaces?: {
|
|
53
|
+
default?: string;
|
|
54
|
+
global?: {
|
|
55
|
+
enabled?: boolean;
|
|
56
|
+
root?: string;
|
|
57
|
+
allowWrite?: boolean;
|
|
58
|
+
};
|
|
59
|
+
items?: Record<string, WorkspaceItemConfig>;
|
|
60
|
+
};
|
|
61
|
+
profiles?: {
|
|
62
|
+
default?: string;
|
|
63
|
+
resolveFrom?: ProfileResolveFrom[];
|
|
64
|
+
};
|
|
65
|
+
plugins?: {
|
|
66
|
+
loaders?: string[];
|
|
67
|
+
resolver?: string;
|
|
68
|
+
validators?: string[];
|
|
69
|
+
exporters?: string[];
|
|
70
|
+
inspectors?: string[];
|
|
71
|
+
};
|
|
72
|
+
sources?: Record<string, Record<string, unknown>>;
|
|
73
|
+
resolution?: {
|
|
74
|
+
precedence?: string[];
|
|
75
|
+
arrayPolicy?: ResolutionArrayPolicy;
|
|
76
|
+
};
|
|
77
|
+
envMapping?: {
|
|
78
|
+
convention?: 'SCREAMING_SNAKE';
|
|
79
|
+
explicit?: Record<string, LogicalKey>;
|
|
80
|
+
};
|
|
81
|
+
public?: {
|
|
82
|
+
promote?: LogicalKey[];
|
|
83
|
+
frameworks?: Record<string, string>;
|
|
84
|
+
};
|
|
85
|
+
writePolicy?: {
|
|
86
|
+
define?: {
|
|
87
|
+
defaultProfile?: string;
|
|
88
|
+
targets?: Partial<Record<'value' | 'secret', string>>;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
schema?: Record<LogicalKey, SchemaRule>;
|
|
92
|
+
}
|
|
93
|
+
interface NormalizedManifest {
|
|
94
|
+
version: 1;
|
|
95
|
+
project: {
|
|
96
|
+
name: string;
|
|
97
|
+
};
|
|
98
|
+
workspaces: {
|
|
99
|
+
default?: string;
|
|
100
|
+
global: {
|
|
101
|
+
enabled: boolean;
|
|
102
|
+
root?: string;
|
|
103
|
+
allowWrite: boolean;
|
|
104
|
+
};
|
|
105
|
+
items: Record<string, NormalizedWorkspaceItem>;
|
|
106
|
+
};
|
|
107
|
+
profiles: {
|
|
108
|
+
default: string;
|
|
109
|
+
resolveFrom: ProfileResolveFrom[];
|
|
110
|
+
};
|
|
111
|
+
plugins: {
|
|
112
|
+
loaders: string[];
|
|
113
|
+
resolver: string;
|
|
114
|
+
validators: string[];
|
|
115
|
+
exporters: string[];
|
|
116
|
+
inspectors: string[];
|
|
117
|
+
};
|
|
118
|
+
sources: Record<string, Record<string, unknown>>;
|
|
119
|
+
resolution: {
|
|
120
|
+
precedence: string[];
|
|
121
|
+
arrayPolicy: ResolutionArrayPolicy;
|
|
122
|
+
};
|
|
123
|
+
envMapping: {
|
|
124
|
+
convention?: 'SCREAMING_SNAKE';
|
|
125
|
+
explicit: Record<string, LogicalKey>;
|
|
126
|
+
};
|
|
127
|
+
public: {
|
|
128
|
+
promote: LogicalKey[];
|
|
129
|
+
frameworks: Record<string, string>;
|
|
130
|
+
};
|
|
131
|
+
writePolicy: {
|
|
132
|
+
define: {
|
|
133
|
+
defaultProfile: string;
|
|
134
|
+
targets: Record<'value' | 'secret', string>;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
schema: Record<LogicalKey, SchemaRule>;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
type LogicalKey = string;
|
|
141
|
+
type NamespaceName = 'value' | 'secret' | 'meta';
|
|
142
|
+
interface ConfigOrigin {
|
|
143
|
+
file?: string;
|
|
144
|
+
line?: number;
|
|
145
|
+
envVar?: string;
|
|
146
|
+
cliArg?: string;
|
|
147
|
+
}
|
|
148
|
+
interface ConfigEntry {
|
|
149
|
+
key: LogicalKey;
|
|
150
|
+
value: unknown;
|
|
151
|
+
namespace: NamespaceName;
|
|
152
|
+
sourceId: string;
|
|
153
|
+
pluginId: string;
|
|
154
|
+
workspaceId: string;
|
|
155
|
+
profile?: string;
|
|
156
|
+
origin?: ConfigOrigin;
|
|
157
|
+
metadata?: Record<string, unknown>;
|
|
158
|
+
}
|
|
159
|
+
interface ResolvedEntry {
|
|
160
|
+
key: LogicalKey;
|
|
161
|
+
value: unknown;
|
|
162
|
+
namespace: NamespaceName;
|
|
163
|
+
winner: ConfigEntry;
|
|
164
|
+
overridden: ConfigEntry[];
|
|
165
|
+
}
|
|
166
|
+
interface ResolvedGraph {
|
|
167
|
+
entries: Map<LogicalKey, ResolvedEntry>;
|
|
168
|
+
profile: string;
|
|
169
|
+
resolvedAt: string;
|
|
170
|
+
profileSource: ProfileSource;
|
|
171
|
+
workspace: WorkspaceContext;
|
|
172
|
+
}
|
|
173
|
+
interface InspectResult {
|
|
174
|
+
key: LogicalKey;
|
|
175
|
+
value: unknown;
|
|
176
|
+
namespace: NamespaceName;
|
|
177
|
+
profile: string;
|
|
178
|
+
profileSource: ProfileSource;
|
|
179
|
+
workspace: {
|
|
180
|
+
id: string;
|
|
181
|
+
source: WorkspaceContext['workspaceSource'];
|
|
182
|
+
chain: string[];
|
|
183
|
+
};
|
|
184
|
+
winner: {
|
|
185
|
+
sourceId: string;
|
|
186
|
+
pluginId: string;
|
|
187
|
+
workspaceId: string;
|
|
188
|
+
origin?: ConfigOrigin;
|
|
189
|
+
};
|
|
190
|
+
overridden: Array<{
|
|
191
|
+
sourceId: string;
|
|
192
|
+
pluginId: string;
|
|
193
|
+
workspaceId: string;
|
|
194
|
+
value: unknown;
|
|
195
|
+
origin?: ConfigOrigin;
|
|
196
|
+
}>;
|
|
197
|
+
}
|
|
198
|
+
interface CnosCreateOptions {
|
|
199
|
+
root?: string;
|
|
200
|
+
profile?: string;
|
|
201
|
+
workspace?: string;
|
|
202
|
+
globalRoot?: string;
|
|
203
|
+
cnosVersion?: string;
|
|
204
|
+
plugins?: CnosPlugin[];
|
|
205
|
+
cliArgs?: string[];
|
|
206
|
+
processEnv?: Record<string, string | undefined>;
|
|
207
|
+
}
|
|
208
|
+
interface ToEnvOptions {
|
|
209
|
+
includeSecrets?: boolean;
|
|
210
|
+
}
|
|
211
|
+
interface ToPublicEnvOptions {
|
|
212
|
+
framework?: string;
|
|
213
|
+
prefix?: string;
|
|
214
|
+
}
|
|
215
|
+
interface DumpPlanOptions {
|
|
216
|
+
flatten?: boolean;
|
|
217
|
+
}
|
|
218
|
+
interface DumpFile {
|
|
219
|
+
path: string;
|
|
220
|
+
namespace: Exclude<NamespaceName, 'meta'>;
|
|
221
|
+
content: string;
|
|
222
|
+
}
|
|
223
|
+
interface DumpPlan {
|
|
224
|
+
workspaceId: string;
|
|
225
|
+
profile: string;
|
|
226
|
+
flatten: boolean;
|
|
227
|
+
files: DumpFile[];
|
|
228
|
+
}
|
|
229
|
+
interface DumpOptions extends DumpPlanOptions {
|
|
230
|
+
to: string;
|
|
231
|
+
}
|
|
232
|
+
interface DumpResult extends DumpPlan {
|
|
233
|
+
root: string;
|
|
234
|
+
}
|
|
235
|
+
interface CnosRuntime {
|
|
236
|
+
manifest: NormalizedManifest;
|
|
237
|
+
plugins: CnosPlugin[];
|
|
238
|
+
readonly graph: ResolvedGraph;
|
|
239
|
+
read<T = unknown>(key: LogicalKey): T | undefined;
|
|
240
|
+
require<T = unknown>(key: LogicalKey): T;
|
|
241
|
+
readOr<T>(key: LogicalKey, fallback: T): T;
|
|
242
|
+
value<T = unknown>(path: string): T | undefined;
|
|
243
|
+
secret<T = unknown>(path: string): T | undefined;
|
|
244
|
+
meta<T = unknown>(path: string): T | undefined;
|
|
245
|
+
inspect(key: LogicalKey): InspectResult;
|
|
246
|
+
toObject(): Record<string, unknown>;
|
|
247
|
+
toNamespace(namespace: NamespaceName): Record<string, unknown>;
|
|
248
|
+
toEnv(options?: ToEnvOptions): Record<string, string>;
|
|
249
|
+
toPublicEnv(options?: ToPublicEnvOptions): Record<string, string>;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
type CnosPluginKind = 'loader' | 'resolver' | 'validator' | 'exporter' | 'inspector';
|
|
253
|
+
interface CnosPlugin {
|
|
254
|
+
id: string;
|
|
255
|
+
kind: CnosPluginKind;
|
|
256
|
+
}
|
|
257
|
+
interface LoaderContext {
|
|
258
|
+
manifestConfig: Record<string, unknown>;
|
|
259
|
+
profile: string;
|
|
260
|
+
profileChain: string[];
|
|
261
|
+
profileActivation: ProfileActivation;
|
|
262
|
+
manifestRoot: string;
|
|
263
|
+
workspace: WorkspaceContext;
|
|
264
|
+
cliArgs?: string[];
|
|
265
|
+
processEnv?: Record<string, string | undefined>;
|
|
266
|
+
}
|
|
267
|
+
interface ValidationContext {
|
|
268
|
+
manifest: NormalizedManifest;
|
|
269
|
+
schema?: Record<LogicalKey, SchemaRule>;
|
|
270
|
+
}
|
|
271
|
+
interface ExportContext {
|
|
272
|
+
manifest: NormalizedManifest;
|
|
273
|
+
promotions: string[];
|
|
274
|
+
frameworkPrefixes?: string[];
|
|
275
|
+
workspace: WorkspaceContext;
|
|
276
|
+
}
|
|
277
|
+
interface LoaderPlugin extends CnosPlugin {
|
|
278
|
+
kind: 'loader';
|
|
279
|
+
load(context: LoaderContext): Promise<ConfigEntry[]>;
|
|
280
|
+
}
|
|
281
|
+
interface ValidationIssue {
|
|
282
|
+
code: string;
|
|
283
|
+
message: string;
|
|
284
|
+
key?: LogicalKey;
|
|
285
|
+
}
|
|
286
|
+
interface ValidationResult {
|
|
287
|
+
pluginId: string;
|
|
288
|
+
valid: boolean;
|
|
289
|
+
issues: ValidationIssue[];
|
|
290
|
+
}
|
|
291
|
+
interface ValidationSummary {
|
|
292
|
+
valid: boolean;
|
|
293
|
+
issues: ValidationIssue[];
|
|
294
|
+
results: ValidationResult[];
|
|
295
|
+
}
|
|
296
|
+
interface ValidatorPlugin extends CnosPlugin {
|
|
297
|
+
kind: 'validator';
|
|
298
|
+
validate(graph: ResolvedGraph, context: ValidationContext): Promise<ValidationResult>;
|
|
299
|
+
}
|
|
300
|
+
interface ExportResult {
|
|
301
|
+
pluginId: string;
|
|
302
|
+
value: Record<string, string>;
|
|
303
|
+
}
|
|
304
|
+
interface ExporterPlugin extends CnosPlugin {
|
|
305
|
+
kind: 'exporter';
|
|
306
|
+
export(graph: ResolvedGraph, context: ExportContext): Promise<ExportResult>;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export type { CnosCreateOptions as C, DumpPlanOptions as D, ExporterPlugin as E, InspectResult as I, LoaderPlugin as L, ManifestFile as M, NormalizedManifest as N, ResolvedGraph as R, ToEnvOptions as T, ValidationSummary as V, WorkspaceFile as W, DumpPlan as a, DumpOptions as b, DumpResult as c, CnosRuntime as d, CnosPlugin as e, ConfigEntry as f, LogicalKey as g, ToPublicEnvOptions as h, ValidationIssue as i, ValidatorPlugin as j, WorkspaceRoot as k, NamespaceName as l };
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
type ProfileResolveFrom = 'cli.profile' | 'env.CNOS_PROFILE' | 'default';
|
|
2
|
+
type ProfileSource = 'cli' | 'workspace-file' | 'env' | 'manifest-default';
|
|
3
|
+
interface ProfileActivation {
|
|
4
|
+
values: string[];
|
|
5
|
+
secrets: string[];
|
|
6
|
+
envFiles: string[];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface SchemaRule {
|
|
10
|
+
type?: 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
11
|
+
required?: boolean;
|
|
12
|
+
enum?: unknown[];
|
|
13
|
+
pattern?: string;
|
|
14
|
+
default?: unknown;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type WorkspaceSource = 'cli' | 'workspace-file' | 'manifest-default' | 'implicit';
|
|
18
|
+
type GlobalRootSource = 'cli' | 'workspace-file' | 'manifest' | 'CNOS_HOME';
|
|
19
|
+
interface WorkspaceFile {
|
|
20
|
+
workspace?: string;
|
|
21
|
+
profile?: string;
|
|
22
|
+
globalRoot?: string;
|
|
23
|
+
}
|
|
24
|
+
interface WorkspaceItemConfig {
|
|
25
|
+
extends?: string | string[];
|
|
26
|
+
globalId?: string;
|
|
27
|
+
}
|
|
28
|
+
interface NormalizedWorkspaceItem {
|
|
29
|
+
extends: string[];
|
|
30
|
+
globalId?: string;
|
|
31
|
+
}
|
|
32
|
+
interface WorkspaceRoot {
|
|
33
|
+
scope: 'global' | 'local';
|
|
34
|
+
workspaceId: string;
|
|
35
|
+
path: string;
|
|
36
|
+
}
|
|
37
|
+
interface WorkspaceContext {
|
|
38
|
+
workspaceId: string;
|
|
39
|
+
workspaceSource: WorkspaceSource;
|
|
40
|
+
globalRoot?: string;
|
|
41
|
+
globalRootSource?: GlobalRootSource;
|
|
42
|
+
workspaceChain: string[];
|
|
43
|
+
workspaceRoots: WorkspaceRoot[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type ResolutionArrayPolicy = 'replace' | 'append' | 'unique-append';
|
|
47
|
+
interface ManifestFile {
|
|
48
|
+
version?: number;
|
|
49
|
+
project?: {
|
|
50
|
+
name?: string;
|
|
51
|
+
};
|
|
52
|
+
workspaces?: {
|
|
53
|
+
default?: string;
|
|
54
|
+
global?: {
|
|
55
|
+
enabled?: boolean;
|
|
56
|
+
root?: string;
|
|
57
|
+
allowWrite?: boolean;
|
|
58
|
+
};
|
|
59
|
+
items?: Record<string, WorkspaceItemConfig>;
|
|
60
|
+
};
|
|
61
|
+
profiles?: {
|
|
62
|
+
default?: string;
|
|
63
|
+
resolveFrom?: ProfileResolveFrom[];
|
|
64
|
+
};
|
|
65
|
+
plugins?: {
|
|
66
|
+
loaders?: string[];
|
|
67
|
+
resolver?: string;
|
|
68
|
+
validators?: string[];
|
|
69
|
+
exporters?: string[];
|
|
70
|
+
inspectors?: string[];
|
|
71
|
+
};
|
|
72
|
+
sources?: Record<string, Record<string, unknown>>;
|
|
73
|
+
resolution?: {
|
|
74
|
+
precedence?: string[];
|
|
75
|
+
arrayPolicy?: ResolutionArrayPolicy;
|
|
76
|
+
};
|
|
77
|
+
envMapping?: {
|
|
78
|
+
convention?: 'SCREAMING_SNAKE';
|
|
79
|
+
explicit?: Record<string, LogicalKey>;
|
|
80
|
+
};
|
|
81
|
+
public?: {
|
|
82
|
+
promote?: LogicalKey[];
|
|
83
|
+
frameworks?: Record<string, string>;
|
|
84
|
+
};
|
|
85
|
+
writePolicy?: {
|
|
86
|
+
define?: {
|
|
87
|
+
defaultProfile?: string;
|
|
88
|
+
targets?: Partial<Record<'value' | 'secret', string>>;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
schema?: Record<LogicalKey, SchemaRule>;
|
|
92
|
+
}
|
|
93
|
+
interface NormalizedManifest {
|
|
94
|
+
version: 1;
|
|
95
|
+
project: {
|
|
96
|
+
name: string;
|
|
97
|
+
};
|
|
98
|
+
workspaces: {
|
|
99
|
+
default?: string;
|
|
100
|
+
global: {
|
|
101
|
+
enabled: boolean;
|
|
102
|
+
root?: string;
|
|
103
|
+
allowWrite: boolean;
|
|
104
|
+
};
|
|
105
|
+
items: Record<string, NormalizedWorkspaceItem>;
|
|
106
|
+
};
|
|
107
|
+
profiles: {
|
|
108
|
+
default: string;
|
|
109
|
+
resolveFrom: ProfileResolveFrom[];
|
|
110
|
+
};
|
|
111
|
+
plugins: {
|
|
112
|
+
loaders: string[];
|
|
113
|
+
resolver: string;
|
|
114
|
+
validators: string[];
|
|
115
|
+
exporters: string[];
|
|
116
|
+
inspectors: string[];
|
|
117
|
+
};
|
|
118
|
+
sources: Record<string, Record<string, unknown>>;
|
|
119
|
+
resolution: {
|
|
120
|
+
precedence: string[];
|
|
121
|
+
arrayPolicy: ResolutionArrayPolicy;
|
|
122
|
+
};
|
|
123
|
+
envMapping: {
|
|
124
|
+
convention?: 'SCREAMING_SNAKE';
|
|
125
|
+
explicit: Record<string, LogicalKey>;
|
|
126
|
+
};
|
|
127
|
+
public: {
|
|
128
|
+
promote: LogicalKey[];
|
|
129
|
+
frameworks: Record<string, string>;
|
|
130
|
+
};
|
|
131
|
+
writePolicy: {
|
|
132
|
+
define: {
|
|
133
|
+
defaultProfile: string;
|
|
134
|
+
targets: Record<'value' | 'secret', string>;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
schema: Record<LogicalKey, SchemaRule>;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
type LogicalKey = string;
|
|
141
|
+
type NamespaceName = 'value' | 'secret' | 'meta';
|
|
142
|
+
interface ConfigOrigin {
|
|
143
|
+
file?: string;
|
|
144
|
+
line?: number;
|
|
145
|
+
envVar?: string;
|
|
146
|
+
cliArg?: string;
|
|
147
|
+
}
|
|
148
|
+
interface ConfigEntry {
|
|
149
|
+
key: LogicalKey;
|
|
150
|
+
value: unknown;
|
|
151
|
+
namespace: NamespaceName;
|
|
152
|
+
sourceId: string;
|
|
153
|
+
pluginId: string;
|
|
154
|
+
workspaceId: string;
|
|
155
|
+
profile?: string;
|
|
156
|
+
origin?: ConfigOrigin;
|
|
157
|
+
metadata?: Record<string, unknown>;
|
|
158
|
+
}
|
|
159
|
+
interface ResolvedEntry {
|
|
160
|
+
key: LogicalKey;
|
|
161
|
+
value: unknown;
|
|
162
|
+
namespace: NamespaceName;
|
|
163
|
+
winner: ConfigEntry;
|
|
164
|
+
overridden: ConfigEntry[];
|
|
165
|
+
}
|
|
166
|
+
interface ResolvedGraph {
|
|
167
|
+
entries: Map<LogicalKey, ResolvedEntry>;
|
|
168
|
+
profile: string;
|
|
169
|
+
resolvedAt: string;
|
|
170
|
+
profileSource: ProfileSource;
|
|
171
|
+
workspace: WorkspaceContext;
|
|
172
|
+
}
|
|
173
|
+
interface InspectResult {
|
|
174
|
+
key: LogicalKey;
|
|
175
|
+
value: unknown;
|
|
176
|
+
namespace: NamespaceName;
|
|
177
|
+
profile: string;
|
|
178
|
+
profileSource: ProfileSource;
|
|
179
|
+
workspace: {
|
|
180
|
+
id: string;
|
|
181
|
+
source: WorkspaceContext['workspaceSource'];
|
|
182
|
+
chain: string[];
|
|
183
|
+
};
|
|
184
|
+
winner: {
|
|
185
|
+
sourceId: string;
|
|
186
|
+
pluginId: string;
|
|
187
|
+
workspaceId: string;
|
|
188
|
+
origin?: ConfigOrigin;
|
|
189
|
+
};
|
|
190
|
+
overridden: Array<{
|
|
191
|
+
sourceId: string;
|
|
192
|
+
pluginId: string;
|
|
193
|
+
workspaceId: string;
|
|
194
|
+
value: unknown;
|
|
195
|
+
origin?: ConfigOrigin;
|
|
196
|
+
}>;
|
|
197
|
+
}
|
|
198
|
+
interface CnosCreateOptions {
|
|
199
|
+
root?: string;
|
|
200
|
+
profile?: string;
|
|
201
|
+
workspace?: string;
|
|
202
|
+
globalRoot?: string;
|
|
203
|
+
cnosVersion?: string;
|
|
204
|
+
plugins?: CnosPlugin[];
|
|
205
|
+
cliArgs?: string[];
|
|
206
|
+
processEnv?: Record<string, string | undefined>;
|
|
207
|
+
}
|
|
208
|
+
interface ToEnvOptions {
|
|
209
|
+
includeSecrets?: boolean;
|
|
210
|
+
}
|
|
211
|
+
interface ToPublicEnvOptions {
|
|
212
|
+
framework?: string;
|
|
213
|
+
prefix?: string;
|
|
214
|
+
}
|
|
215
|
+
interface DumpPlanOptions {
|
|
216
|
+
flatten?: boolean;
|
|
217
|
+
}
|
|
218
|
+
interface DumpFile {
|
|
219
|
+
path: string;
|
|
220
|
+
namespace: Exclude<NamespaceName, 'meta'>;
|
|
221
|
+
content: string;
|
|
222
|
+
}
|
|
223
|
+
interface DumpPlan {
|
|
224
|
+
workspaceId: string;
|
|
225
|
+
profile: string;
|
|
226
|
+
flatten: boolean;
|
|
227
|
+
files: DumpFile[];
|
|
228
|
+
}
|
|
229
|
+
interface DumpOptions extends DumpPlanOptions {
|
|
230
|
+
to: string;
|
|
231
|
+
}
|
|
232
|
+
interface DumpResult extends DumpPlan {
|
|
233
|
+
root: string;
|
|
234
|
+
}
|
|
235
|
+
interface CnosRuntime {
|
|
236
|
+
manifest: NormalizedManifest;
|
|
237
|
+
plugins: CnosPlugin[];
|
|
238
|
+
readonly graph: ResolvedGraph;
|
|
239
|
+
read<T = unknown>(key: LogicalKey): T | undefined;
|
|
240
|
+
require<T = unknown>(key: LogicalKey): T;
|
|
241
|
+
readOr<T>(key: LogicalKey, fallback: T): T;
|
|
242
|
+
value<T = unknown>(path: string): T | undefined;
|
|
243
|
+
secret<T = unknown>(path: string): T | undefined;
|
|
244
|
+
meta<T = unknown>(path: string): T | undefined;
|
|
245
|
+
inspect(key: LogicalKey): InspectResult;
|
|
246
|
+
toObject(): Record<string, unknown>;
|
|
247
|
+
toNamespace(namespace: NamespaceName): Record<string, unknown>;
|
|
248
|
+
toEnv(options?: ToEnvOptions): Record<string, string>;
|
|
249
|
+
toPublicEnv(options?: ToPublicEnvOptions): Record<string, string>;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
type CnosPluginKind = 'loader' | 'resolver' | 'validator' | 'exporter' | 'inspector';
|
|
253
|
+
interface CnosPlugin {
|
|
254
|
+
id: string;
|
|
255
|
+
kind: CnosPluginKind;
|
|
256
|
+
}
|
|
257
|
+
interface LoaderContext {
|
|
258
|
+
manifestConfig: Record<string, unknown>;
|
|
259
|
+
profile: string;
|
|
260
|
+
profileChain: string[];
|
|
261
|
+
profileActivation: ProfileActivation;
|
|
262
|
+
manifestRoot: string;
|
|
263
|
+
workspace: WorkspaceContext;
|
|
264
|
+
cliArgs?: string[];
|
|
265
|
+
processEnv?: Record<string, string | undefined>;
|
|
266
|
+
}
|
|
267
|
+
interface ValidationContext {
|
|
268
|
+
manifest: NormalizedManifest;
|
|
269
|
+
schema?: Record<LogicalKey, SchemaRule>;
|
|
270
|
+
}
|
|
271
|
+
interface ExportContext {
|
|
272
|
+
manifest: NormalizedManifest;
|
|
273
|
+
promotions: string[];
|
|
274
|
+
frameworkPrefixes?: string[];
|
|
275
|
+
workspace: WorkspaceContext;
|
|
276
|
+
}
|
|
277
|
+
interface LoaderPlugin extends CnosPlugin {
|
|
278
|
+
kind: 'loader';
|
|
279
|
+
load(context: LoaderContext): Promise<ConfigEntry[]>;
|
|
280
|
+
}
|
|
281
|
+
interface ValidationIssue {
|
|
282
|
+
code: string;
|
|
283
|
+
message: string;
|
|
284
|
+
key?: LogicalKey;
|
|
285
|
+
}
|
|
286
|
+
interface ValidationResult {
|
|
287
|
+
pluginId: string;
|
|
288
|
+
valid: boolean;
|
|
289
|
+
issues: ValidationIssue[];
|
|
290
|
+
}
|
|
291
|
+
interface ValidationSummary {
|
|
292
|
+
valid: boolean;
|
|
293
|
+
issues: ValidationIssue[];
|
|
294
|
+
results: ValidationResult[];
|
|
295
|
+
}
|
|
296
|
+
interface ValidatorPlugin extends CnosPlugin {
|
|
297
|
+
kind: 'validator';
|
|
298
|
+
validate(graph: ResolvedGraph, context: ValidationContext): Promise<ValidationResult>;
|
|
299
|
+
}
|
|
300
|
+
interface ExportResult {
|
|
301
|
+
pluginId: string;
|
|
302
|
+
value: Record<string, string>;
|
|
303
|
+
}
|
|
304
|
+
interface ExporterPlugin extends CnosPlugin {
|
|
305
|
+
kind: 'exporter';
|
|
306
|
+
export(graph: ResolvedGraph, context: ExportContext): Promise<ExportResult>;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export type { CnosCreateOptions as C, DumpPlanOptions as D, ExporterPlugin as E, InspectResult as I, LoaderPlugin as L, ManifestFile as M, NormalizedManifest as N, ResolvedGraph as R, ToEnvOptions as T, ValidationSummary as V, WorkspaceFile as W, DumpPlan as a, DumpOptions as b, DumpResult as c, CnosRuntime as d, CnosPlugin as e, ConfigEntry as f, LogicalKey as g, ToPublicEnvOptions as h, ValidationIssue as i, ValidatorPlugin as j, WorkspaceRoot as k, NamespaceName as l };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { R as ResolvedGraph, N as NormalizedManifest, T as ToEnvOptions, h as ToPublicEnvOptions } from './plugin-BVNEHj19.cjs';
|
|
2
|
+
|
|
3
|
+
declare function toEnv(graph: ResolvedGraph, manifest: NormalizedManifest, options?: ToEnvOptions): Record<string, string>;
|
|
4
|
+
|
|
5
|
+
declare function toPublicEnv(graph: ResolvedGraph, manifest: NormalizedManifest, options?: ToPublicEnvOptions): Record<string, string>;
|
|
6
|
+
|
|
7
|
+
export { toPublicEnv as a, toEnv as t };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { R as ResolvedGraph, N as NormalizedManifest, T as ToEnvOptions, h as ToPublicEnvOptions } from './plugin-BVNEHj19.js';
|
|
2
|
+
|
|
3
|
+
declare function toEnv(graph: ResolvedGraph, manifest: NormalizedManifest, options?: ToEnvOptions): Record<string, string>;
|
|
4
|
+
|
|
5
|
+
declare function toPublicEnv(graph: ResolvedGraph, manifest: NormalizedManifest, options?: ToPublicEnvOptions): Record<string, string>;
|
|
6
|
+
|
|
7
|
+
export { toPublicEnv as a, toEnv as t };
|