@kitsy/cnos-webpack 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.
package/README.md CHANGED
@@ -3,3 +3,14 @@
3
3
  Webpack integration for CNOS.
4
4
 
5
5
  It resolves CNOS public config during webpack startup, injects `process.env.*` define replacements for promoted public values, and embeds `globalThis.__CNOS_BROWSER_DATA__` for `@kitsy/cnos/browser`.
6
+
7
+ Webpack uses an empty public env prefix by default. Configure `public.frameworks.webpack` in your manifest or pass `prefix` to the plugin if you want names such as `APP_*`.
8
+
9
+ Recommended plugin order:
10
+ - `new CnosWebpackPlugin(...)`
11
+ - `new HtmlWebpackPlugin(...)`
12
+ - `new MiniCssExtractPlugin(...)`
13
+ - `new CopyPlugin(...)`
14
+ - `new ESLintPlugin(...)`
15
+
16
+ If your webpack config is CommonJS, load CNOS via dynamic `import()` inside an async `module.exports = async () => ...` factory. If webpack loads your config as ESM, `require(...)` is not available.
package/dist/index.d.cts CHANGED
@@ -12,7 +12,7 @@ interface SchemaRule {
12
12
  default?: unknown;
13
13
  }
14
14
 
15
- type WorkspaceSource = 'cli' | 'workspace-file' | 'manifest-default' | 'implicit';
15
+ type WorkspaceSource = 'cli' | 'workspace-file' | 'anchor-file' | 'manifest-default' | 'implicit' | 'directory-inferred';
16
16
  type GlobalRootSource = 'cli' | 'workspace-file' | 'manifest' | 'CNOS_HOME';
17
17
  interface NormalizedWorkspaceItem {
18
18
  extends: string[];
@@ -107,6 +107,12 @@ interface NormalizedManifest {
107
107
  schema: Record<LogicalKey, SchemaRule>;
108
108
  }
109
109
 
110
+ interface SecretReference {
111
+ provider: string;
112
+ ref: string;
113
+ vault?: string;
114
+ }
115
+
110
116
  type LogicalKey = string;
111
117
  type NamespaceName = string;
112
118
  interface ConfigOrigin {
@@ -187,6 +193,25 @@ interface CnosRuntime {
187
193
  toNamespace(namespace: NamespaceName): Record<string, unknown>;
188
194
  toEnv(options?: ToEnvOptions): Record<string, string>;
189
195
  toPublicEnv(options?: ToPublicEnvOptions): Record<string, string>;
196
+ toServerProjection(): ServerProjection;
197
+ refreshSecrets(): Promise<void>;
198
+ refreshSecret(key: LogicalKey): Promise<void>;
199
+ }
200
+ interface ServerProjection {
201
+ version: 1;
202
+ workspace: string;
203
+ profile: string;
204
+ resolvedAt: string;
205
+ configHash: string;
206
+ values: Record<string, unknown>;
207
+ secretRefs: Record<string, SecretReference>;
208
+ publicKeys: string[];
209
+ meta: {
210
+ workspace: string;
211
+ profile: string;
212
+ cnos_version: string;
213
+ namespaces?: string[];
214
+ };
190
215
  }
191
216
 
192
217
  type CnosPluginKind = 'loader' | 'resolver' | 'validator' | 'exporter' | 'inspector';
package/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@ interface SchemaRule {
12
12
  default?: unknown;
13
13
  }
14
14
 
15
- type WorkspaceSource = 'cli' | 'workspace-file' | 'manifest-default' | 'implicit';
15
+ type WorkspaceSource = 'cli' | 'workspace-file' | 'anchor-file' | 'manifest-default' | 'implicit' | 'directory-inferred';
16
16
  type GlobalRootSource = 'cli' | 'workspace-file' | 'manifest' | 'CNOS_HOME';
17
17
  interface NormalizedWorkspaceItem {
18
18
  extends: string[];
@@ -107,6 +107,12 @@ interface NormalizedManifest {
107
107
  schema: Record<LogicalKey, SchemaRule>;
108
108
  }
109
109
 
110
+ interface SecretReference {
111
+ provider: string;
112
+ ref: string;
113
+ vault?: string;
114
+ }
115
+
110
116
  type LogicalKey = string;
111
117
  type NamespaceName = string;
112
118
  interface ConfigOrigin {
@@ -187,6 +193,25 @@ interface CnosRuntime {
187
193
  toNamespace(namespace: NamespaceName): Record<string, unknown>;
188
194
  toEnv(options?: ToEnvOptions): Record<string, string>;
189
195
  toPublicEnv(options?: ToPublicEnvOptions): Record<string, string>;
196
+ toServerProjection(): ServerProjection;
197
+ refreshSecrets(): Promise<void>;
198
+ refreshSecret(key: LogicalKey): Promise<void>;
199
+ }
200
+ interface ServerProjection {
201
+ version: 1;
202
+ workspace: string;
203
+ profile: string;
204
+ resolvedAt: string;
205
+ configHash: string;
206
+ values: Record<string, unknown>;
207
+ secretRefs: Record<string, SecretReference>;
208
+ publicKeys: string[];
209
+ meta: {
210
+ workspace: string;
211
+ profile: string;
212
+ cnos_version: string;
213
+ namespaces?: string[];
214
+ };
190
215
  }
191
216
 
192
217
  type CnosPluginKind = 'loader' | 'resolver' | 'validator' | 'exporter' | 'inspector';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitsy/cnos-webpack",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Webpack integration for CNOS public config injection.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -35,7 +35,7 @@
35
35
  "access": "public"
36
36
  },
37
37
  "dependencies": {
38
- "@kitsy/cnos": "1.5.0"
38
+ "@kitsy/cnos": "1.6.0"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "webpack": ">=5"