@kitsy/cnos 1.5.0 → 1.6.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.
Files changed (62) hide show
  1. package/dist/build/index.cjs +333 -117
  2. package/dist/build/index.d.cts +3 -2
  3. package/dist/build/index.d.ts +3 -2
  4. package/dist/build/index.js +13 -8
  5. package/dist/{chunk-HMM76UYZ.js → chunk-BMAD24KC.js} +1 -1
  6. package/dist/{chunk-ZTPSFXWP.js → chunk-JYWQFMW5.js} +1 -1
  7. package/dist/{chunk-FWJC4Y2D.js → chunk-MW4OVAT3.js} +1 -1
  8. package/dist/chunk-QU5CXL47.js +577 -0
  9. package/dist/{chunk-APIU4GTB.js → chunk-S7H2UULC.js} +315 -107
  10. package/dist/{chunk-WCHX2QFY.js → chunk-UJBQS7CJ.js} +1 -1
  11. package/dist/{chunk-RYGSG3GR.js → chunk-UOKVLCFL.js} +10 -10
  12. package/dist/{chunk-T6Y57KTT.js → chunk-UR7CHHNN.js} +1 -1
  13. package/dist/{chunk-J4K4JUJL.js → chunk-VGZREX5D.js} +1 -1
  14. package/dist/{chunk-EQSKV3DP.js → chunk-XSUP7JKH.js} +23 -1
  15. package/dist/configure/index.cjs +332 -122
  16. package/dist/configure/index.d.cts +3 -3
  17. package/dist/configure/index.d.ts +3 -3
  18. package/dist/configure/index.js +8 -8
  19. package/dist/{envNaming-Dvm_LP2D.d.ts → envNaming-B7Mztkcf.d.ts} +1 -1
  20. package/dist/{envNaming-S4B-dHUx.d.cts → envNaming-gMVnPOfe.d.cts} +1 -1
  21. package/dist/index.cjs +754 -143
  22. package/dist/index.d.cts +1 -1
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.js +10 -10
  25. package/dist/internal.cjs +229 -103
  26. package/dist/internal.d.cts +16 -28
  27. package/dist/internal.d.ts +16 -28
  28. package/dist/internal.js +11 -3
  29. package/dist/plugin/basic-schema.cjs +22 -15
  30. package/dist/plugin/basic-schema.d.cts +1 -1
  31. package/dist/plugin/basic-schema.d.ts +1 -1
  32. package/dist/plugin/basic-schema.js +2 -2
  33. package/dist/plugin/cli-args.cjs +27 -18
  34. package/dist/plugin/cli-args.d.cts +1 -1
  35. package/dist/plugin/cli-args.d.ts +1 -1
  36. package/dist/plugin/cli-args.js +2 -2
  37. package/dist/plugin/dotenv.cjs +35 -26
  38. package/dist/plugin/dotenv.d.cts +2 -2
  39. package/dist/plugin/dotenv.d.ts +2 -2
  40. package/dist/plugin/dotenv.js +2 -2
  41. package/dist/plugin/env-export.cjs +34 -22
  42. package/dist/plugin/env-export.d.cts +2 -2
  43. package/dist/plugin/env-export.d.ts +2 -2
  44. package/dist/plugin/env-export.js +2 -2
  45. package/dist/plugin/filesystem.cjs +42 -33
  46. package/dist/plugin/filesystem.d.cts +1 -1
  47. package/dist/plugin/filesystem.d.ts +1 -1
  48. package/dist/plugin/filesystem.js +2 -2
  49. package/dist/plugin/process-env.cjs +24 -17
  50. package/dist/plugin/process-env.d.cts +2 -2
  51. package/dist/plugin/process-env.d.ts +2 -2
  52. package/dist/plugin/process-env.js +2 -2
  53. package/dist/{plugin-B4xwySxw.d.cts → plugin-CKrBlWGI.d.cts} +52 -3
  54. package/dist/{plugin-B4xwySxw.d.ts → plugin-CKrBlWGI.d.ts} +52 -3
  55. package/dist/runtime/index.cjs +752 -143
  56. package/dist/runtime/index.d.cts +19 -1
  57. package/dist/runtime/index.d.ts +19 -1
  58. package/dist/runtime/index.js +10 -10
  59. package/dist/{toPublicEnv-ggmphZFs.d.cts → toPublicEnv-CmBsy53P.d.cts} +1 -1
  60. package/dist/{toPublicEnv-CvhGAfsB.d.ts → toPublicEnv-q6VwWxXZ.d.ts} +1 -1
  61. package/package.json +1 -1
  62. package/dist/chunk-TO76YYS4.js +0 -189
@@ -1,4 +1,4 @@
1
- import { b as LogicalKey } from '../plugin-B4xwySxw.cjs';
1
+ import { b as LogicalKey, g as CnosRuntime, I as InspectResult } from '../plugin-CKrBlWGI.cjs';
2
2
 
3
3
  interface CnosSingleton {
4
4
  <T = unknown>(key: LogicalKey): T | undefined;
@@ -8,6 +8,15 @@ interface CnosSingleton {
8
8
  value<T = unknown>(path: string): T | undefined;
9
9
  secret<T = unknown>(path: string): T | undefined;
10
10
  meta<T = unknown>(path: string): T | undefined;
11
+ inspect(key: LogicalKey): ReturnType<CnosRuntime['inspect']>;
12
+ toNamespace(namespace: string): ReturnType<CnosRuntime['toNamespace']>;
13
+ toEnv(options?: Parameters<CnosRuntime['toEnv']>[0]): ReturnType<CnosRuntime['toEnv']>;
14
+ toPublicEnv(options?: Parameters<CnosRuntime['toPublicEnv']>[0]): ReturnType<CnosRuntime['toPublicEnv']>;
15
+ format(message: string): string;
16
+ log(message: string): string;
17
+ loadProjection(source: string): Promise<void>;
18
+ refreshSecrets(): Promise<void>;
19
+ refreshSecret(key: LogicalKey): Promise<void>;
11
20
  ready(): Promise<void>;
12
21
  }
13
22
  declare const cnos: CnosSingleton & {
@@ -17,6 +26,15 @@ declare const cnos: CnosSingleton & {
17
26
  value<T = unknown>(path: string): T | undefined;
18
27
  secret<T = unknown>(path: string): T | undefined;
19
28
  meta<T = unknown>(path: string): T | undefined;
29
+ inspect(key: LogicalKey): InspectResult;
30
+ toNamespace(namespace: string): Record<string, unknown>;
31
+ toEnv(options: Parameters<CnosRuntime["toEnv"]>[0]): Record<string, string>;
32
+ toPublicEnv(options: Parameters<CnosRuntime["toPublicEnv"]>[0]): Record<string, string>;
33
+ format(message: string): string;
34
+ log(message: string): string;
35
+ loadProjection(source: string): Promise<void>;
36
+ refreshSecrets(): Promise<void>;
37
+ refreshSecret(key: LogicalKey): Promise<void>;
20
38
  ready(): Promise<void>;
21
39
  };
22
40
 
@@ -1,4 +1,4 @@
1
- import { b as LogicalKey } from '../plugin-B4xwySxw.js';
1
+ import { b as LogicalKey, g as CnosRuntime, I as InspectResult } from '../plugin-CKrBlWGI.js';
2
2
 
3
3
  interface CnosSingleton {
4
4
  <T = unknown>(key: LogicalKey): T | undefined;
@@ -8,6 +8,15 @@ interface CnosSingleton {
8
8
  value<T = unknown>(path: string): T | undefined;
9
9
  secret<T = unknown>(path: string): T | undefined;
10
10
  meta<T = unknown>(path: string): T | undefined;
11
+ inspect(key: LogicalKey): ReturnType<CnosRuntime['inspect']>;
12
+ toNamespace(namespace: string): ReturnType<CnosRuntime['toNamespace']>;
13
+ toEnv(options?: Parameters<CnosRuntime['toEnv']>[0]): ReturnType<CnosRuntime['toEnv']>;
14
+ toPublicEnv(options?: Parameters<CnosRuntime['toPublicEnv']>[0]): ReturnType<CnosRuntime['toPublicEnv']>;
15
+ format(message: string): string;
16
+ log(message: string): string;
17
+ loadProjection(source: string): Promise<void>;
18
+ refreshSecrets(): Promise<void>;
19
+ refreshSecret(key: LogicalKey): Promise<void>;
11
20
  ready(): Promise<void>;
12
21
  }
13
22
  declare const cnos: CnosSingleton & {
@@ -17,6 +26,15 @@ declare const cnos: CnosSingleton & {
17
26
  value<T = unknown>(path: string): T | undefined;
18
27
  secret<T = unknown>(path: string): T | undefined;
19
28
  meta<T = unknown>(path: string): T | undefined;
29
+ inspect(key: LogicalKey): InspectResult;
30
+ toNamespace(namespace: string): Record<string, unknown>;
31
+ toEnv(options: Parameters<CnosRuntime["toEnv"]>[0]): Record<string, string>;
32
+ toPublicEnv(options: Parameters<CnosRuntime["toPublicEnv"]>[0]): Record<string, string>;
33
+ format(message: string): string;
34
+ log(message: string): string;
35
+ loadProjection(source: string): Promise<void>;
36
+ refreshSecrets(): Promise<void>;
37
+ refreshSecret(key: LogicalKey): Promise<void>;
20
38
  ready(): Promise<void>;
21
39
  };
22
40
 
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  runtime_default
3
- } from "../chunk-TO76YYS4.js";
4
- import "../chunk-EQSKV3DP.js";
5
- import "../chunk-RYGSG3GR.js";
6
- import "../chunk-J4K4JUJL.js";
7
- import "../chunk-T6Y57KTT.js";
8
- import "../chunk-WCHX2QFY.js";
9
- import "../chunk-FWJC4Y2D.js";
10
- import "../chunk-ZTPSFXWP.js";
11
- import "../chunk-HMM76UYZ.js";
12
- import "../chunk-APIU4GTB.js";
3
+ } from "../chunk-QU5CXL47.js";
4
+ import "../chunk-XSUP7JKH.js";
5
+ import "../chunk-UOKVLCFL.js";
6
+ import "../chunk-BMAD24KC.js";
7
+ import "../chunk-VGZREX5D.js";
8
+ import "../chunk-UR7CHHNN.js";
9
+ import "../chunk-UJBQS7CJ.js";
10
+ import "../chunk-MW4OVAT3.js";
11
+ import "../chunk-JYWQFMW5.js";
12
+ import "../chunk-S7H2UULC.js";
13
13
  export {
14
14
  runtime_default as default
15
15
  };
@@ -1,4 +1,4 @@
1
- import { R as ResolvedGraph, N as NormalizedManifest, T as ToEnvOptions, c as ToPublicEnvOptions } from './plugin-B4xwySxw.cjs';
1
+ import { R as ResolvedGraph, N as NormalizedManifest, T as ToEnvOptions, c as ToPublicEnvOptions } from './plugin-CKrBlWGI.cjs';
2
2
 
3
3
  declare function toEnv(graph: ResolvedGraph, manifest: NormalizedManifest, options?: ToEnvOptions): Record<string, string>;
4
4
 
@@ -1,4 +1,4 @@
1
- import { R as ResolvedGraph, N as NormalizedManifest, T as ToEnvOptions, c as ToPublicEnvOptions } from './plugin-B4xwySxw.js';
1
+ import { R as ResolvedGraph, N as NormalizedManifest, T as ToEnvOptions, c as ToPublicEnvOptions } from './plugin-CKrBlWGI.js';
2
2
 
3
3
  declare function toEnv(graph: ResolvedGraph, manifest: NormalizedManifest, options?: ToEnvOptions): Record<string, string>;
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitsy/cnos",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Batteries-included CNOS runtime package wired with the official plugins.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -1,189 +0,0 @@
1
- import {
2
- graphRequiresSecretHydration,
3
- readRuntimeGraphFromEnv
4
- } from "./chunk-EQSKV3DP.js";
5
- import {
6
- createCnos,
7
- getBootstrappedSecretHydrationRequired,
8
- getSingletonReady,
9
- getSingletonRuntime,
10
- setBootstrappedSecretHydrationRequired,
11
- setSingletonReady,
12
- setSingletonRuntime
13
- } from "./chunk-RYGSG3GR.js";
14
- import {
15
- inspectValue,
16
- readOrValue,
17
- readValue,
18
- requireValue,
19
- toEnv,
20
- toLogicalKey,
21
- toNamespaceObject,
22
- toPublicEnv
23
- } from "./chunk-APIU4GTB.js";
24
-
25
- // src/runtime/index.ts
26
- var NOT_READY_MESSAGE = "CNOS not initialized. Call await cnos.ready() or use cnos run.";
27
- function getRuntimeOrThrow() {
28
- const runtime = getSingletonRuntime();
29
- if (!runtime) {
30
- throw new Error(NOT_READY_MESSAGE);
31
- }
32
- return runtime;
33
- }
34
- function attachBootstrappedGraph(graph) {
35
- if (getSingletonRuntime()) {
36
- return;
37
- }
38
- const bootstrappedManifest = {
39
- version: 1,
40
- project: {
41
- name: "bootstrapped"
42
- },
43
- workspaces: {
44
- global: {
45
- enabled: Boolean(graph.workspace.globalRoot),
46
- ...graph.workspace.globalRoot ? {
47
- root: graph.workspace.globalRoot
48
- } : {},
49
- allowWrite: false
50
- },
51
- items: {},
52
- ...graph.workspace.workspaceSource === "implicit" ? {} : {
53
- default: graph.workspace.workspaceId
54
- }
55
- },
56
- profiles: {
57
- default: graph.profile,
58
- resolveFrom: ["default"]
59
- },
60
- plugins: {
61
- loaders: [],
62
- resolver: "profile-aware",
63
- validators: [],
64
- exporters: [],
65
- inspectors: []
66
- },
67
- sources: {},
68
- resolution: {
69
- precedence: [],
70
- arrayPolicy: "replace"
71
- },
72
- envMapping: {
73
- explicit: {}
74
- },
75
- public: {
76
- promote: [],
77
- frameworks: {}
78
- },
79
- namespaces: {},
80
- vaults: {},
81
- writePolicy: {
82
- define: {
83
- defaultProfile: graph.profile,
84
- targets: {
85
- value: "./values/app.yml",
86
- secret: "./secrets/app.yml"
87
- }
88
- }
89
- },
90
- schema: {}
91
- };
92
- const runtime = {
93
- manifest: bootstrappedManifest,
94
- plugins: [],
95
- graph,
96
- read(key) {
97
- return readValue(graph, key);
98
- },
99
- require(key) {
100
- return requireValue(graph, key);
101
- },
102
- readOr(key, fallback) {
103
- return readOrValue(graph, key, fallback);
104
- },
105
- value(path) {
106
- return readValue(graph, toLogicalKey("value", path));
107
- },
108
- secret(path) {
109
- return readValue(graph, toLogicalKey("secret", path));
110
- },
111
- meta(path) {
112
- return readValue(graph, toLogicalKey("meta", path));
113
- },
114
- inspect(key) {
115
- return inspectValue(graph, key);
116
- },
117
- toObject() {
118
- return toNamespaceObject(graph);
119
- },
120
- toNamespace(namespace) {
121
- return toNamespaceObject(graph, namespace);
122
- },
123
- toEnv(options) {
124
- return toEnv(graph, bootstrappedManifest, options);
125
- },
126
- toPublicEnv(options) {
127
- return toPublicEnv(graph, bootstrappedManifest, options);
128
- }
129
- };
130
- setSingletonRuntime(runtime);
131
- setBootstrappedSecretHydrationRequired(graphRequiresSecretHydration(graph));
132
- }
133
- function bootstrapFromProcessEnv() {
134
- if (typeof process === "undefined") {
135
- return;
136
- }
137
- try {
138
- const graph = readRuntimeGraphFromEnv(process.env);
139
- if (graph) {
140
- attachBootstrappedGraph(graph);
141
- }
142
- } catch {
143
- }
144
- }
145
- bootstrapFromProcessEnv();
146
- var cnos = Object.assign(
147
- ((key) => readValue(getRuntimeOrThrow().graph, key)),
148
- {
149
- read(key) {
150
- return readValue(getRuntimeOrThrow().graph, key);
151
- },
152
- require(key) {
153
- return requireValue(getRuntimeOrThrow().graph, key);
154
- },
155
- readOr(key, fallback) {
156
- return readOrValue(getRuntimeOrThrow().graph, key, fallback);
157
- },
158
- value(path) {
159
- return readValue(getRuntimeOrThrow().graph, toLogicalKey("value", path));
160
- },
161
- secret(path) {
162
- return readValue(getRuntimeOrThrow().graph, toLogicalKey("secret", path));
163
- },
164
- meta(path) {
165
- return readValue(getRuntimeOrThrow().graph, toLogicalKey("meta", path));
166
- },
167
- async ready() {
168
- if (getSingletonRuntime() && !getBootstrappedSecretHydrationRequired()) {
169
- return;
170
- }
171
- const existing = getSingletonReady();
172
- if (existing && !getBootstrappedSecretHydrationRequired()) {
173
- await existing;
174
- return;
175
- }
176
- const readyPromise = createCnos().then((runtime) => {
177
- setSingletonRuntime(runtime);
178
- return runtime;
179
- });
180
- setSingletonReady(readyPromise);
181
- await readyPromise;
182
- }
183
- }
184
- );
185
- var runtime_default = cnos;
186
-
187
- export {
188
- runtime_default
189
- };