@coreframe/config 0.1.9 → 0.1.11

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/index.d.ts CHANGED
@@ -2,7 +2,8 @@ import { JsonObject, JsonValue, PrimaryWorkerContributions, PrimaryWorkerEnviron
2
2
 
3
3
  //#region src/index.d.ts
4
4
  type CoreframeConfig = {
5
- /** Object storage and public asset delivery settings. */assets?: AssetsConfig; /** Database settings used by local and deployment workflows. */
5
+ /** Object storage and public asset delivery settings. */assets?: AssetsConfig; /** Responsive layout breakpoints in logical CSS pixels. */
6
+ breakpoints?: BreakpointsConfig; /** Database settings used by local and deployment workflows. */
6
7
  database?: DatabaseConfig; /** Deployment hooks, environments, checks, and release settings. */
7
8
  deploy?: DeployConfig; /** Local development settings. */
8
9
  dev?: DevConfig; /** Translation catalog and locale settings. */
@@ -11,6 +12,24 @@ type CoreframeConfig = {
11
12
  preview?: PreviewConfig; /** Worker build and runtime settings. */
12
13
  worker?: WorkerConfig;
13
14
  };
15
+ /** Named responsive layout breakpoints shared by Panda, web, and Flutter. */
16
+ type BreakpointsConfig = Readonly<{
17
+ "2xl": number;
18
+ lg: number;
19
+ md: number;
20
+ sm: number;
21
+ xl: number;
22
+ }>;
23
+ declare const breakpointNames: readonly ["sm", "md", "lg", "xl", "2xl"];
24
+ declare function defineConfig(config: CoreframeConfig): CoreframeConfig;
25
+ /** Validates and returns the project's required breakpoint contract. */
26
+ declare function validateBreakpoints(value: unknown): BreakpointsConfig;
27
+ /** Loads and validates the project's required breakpoint contract. */
28
+ declare function readProjectBreakpoints({
29
+ cwd
30
+ }?: {
31
+ cwd?: string;
32
+ }): Promise<BreakpointsConfig>;
14
33
  type FlutterConfig = {
15
34
  /** Custom URL origin accepted for navigation into the Flutter app. */deepLink: FlutterDeepLinkConfig;
16
35
  };
@@ -98,6 +117,8 @@ type I18nConfig = {
98
117
  sourceLocale: string;
99
118
  };
100
119
  type DeployEnvironment = "staging" | "production";
120
+ /** Active topology published by the Coreframe deployment workflow. */
121
+ type DeployMode = "client" | "full";
101
122
  type DeployContext = {
102
123
  /** Deployment environment being released. */environment: DeployEnvironment; /** Human-readable name assigned to the release. */
103
124
  releaseName: string; /** Public URL of the deployed application. */
@@ -121,13 +142,15 @@ type StagingHostnameConfig = {
121
142
  type DeployConfig = {
122
143
  /** Hook called after all deployment work completes. */afterDeploy?: (context: DeployContext) => Promise<void> | void; /** Hook called immediately after the worker deployment completes. */
123
144
  afterWorkerDeploy?: (context: DeployContext) => Promise<void> | void; /** Per-environment deployment overrides. */
124
- environments?: Partial<Record<DeployEnvironment, DeployEnvironmentConfig>>;
145
+ environments?: Partial<Record<DeployEnvironment, DeployEnvironmentConfig>>; /** Deployed application topology selected by the Coreframe release workflow. */
146
+ mode: DeployMode;
125
147
  /**
126
148
  * HTTP checks run against the application after deployment.
127
149
  *
128
150
  * @example
129
151
  * defineConfig({
130
152
  * deploy: {
153
+ * mode: "full",
131
154
  * smokeChecks: [
132
155
  * { name: "home", path: "/" },
133
156
  * {
@@ -146,6 +169,7 @@ type DeployConfig = {
146
169
  * @example
147
170
  * defineConfig({
148
171
  * deploy: {
172
+ * mode: "full",
149
173
  * stagingHostname: {
150
174
  * managedLabelPrefix: "review-",
151
175
  * parentHostname: "staging.example.com",
@@ -156,7 +180,6 @@ type DeployConfig = {
156
180
  */
157
181
  stagingHostname?: StagingHostnameConfig;
158
182
  };
159
- declare function defineConfig(config: CoreframeConfig): CoreframeConfig;
160
183
  declare function readProjectConfig({
161
184
  cwd
162
185
  }?: {
@@ -165,4 +188,4 @@ declare function readProjectConfig({
165
188
  declare function importProjectModule<T>(path: string, cwd?: string): Promise<T>;
166
189
  declare function importProjectDependency<T>(specifier: string, cwd?: string): Promise<T>;
167
190
  //#endregion
168
- export { AssetsConfig, CoreframeConfig, DatabaseConfig, DatabaseDialect, DeployConfig, DeployContext, DeployEnvironment, DeployEnvironmentConfig, DeploySmokeCheck, DevConfig, DevPlatform, FlutterConfig, FlutterDeepLinkConfig, I18nConfig, JsonObject, JsonValue, PreviewConfig, PreviewTunnelConfig, PreviewWorkerConfig, PrimaryWorkerContributions, PrimaryWorkerEnvironment, StagingHostnameConfig, WorkerConfig, WorkerDeployEnvironment, WorkerEnvironmentDeclaration, WorkerEnvironmentKind, WorkerEnvironmentVariableConfig, WranglerConfig, coreframeGeneratedWorkerVariables, coreframeLocalWorkerVariables, coreframeManagedWorkerSecrets, defineConfig, derivePrimaryWorkerConfig, importProjectDependency, importProjectModule, normalizeWorkerEnvironment, primaryWorkerConfigPath, primaryWorkerEnvironments, readProjectConfig, validateWorkerInventoryOwnership, workerBindingNames, wranglerEnvironmentNames };
191
+ export { AssetsConfig, BreakpointsConfig, CoreframeConfig, DatabaseConfig, DatabaseDialect, DeployConfig, DeployContext, DeployEnvironment, DeployEnvironmentConfig, DeployMode, DeploySmokeCheck, DevConfig, DevPlatform, FlutterConfig, FlutterDeepLinkConfig, I18nConfig, JsonObject, JsonValue, PreviewConfig, PreviewTunnelConfig, PreviewWorkerConfig, PrimaryWorkerContributions, PrimaryWorkerEnvironment, StagingHostnameConfig, WorkerConfig, WorkerDeployEnvironment, WorkerEnvironmentDeclaration, WorkerEnvironmentKind, WorkerEnvironmentVariableConfig, WranglerConfig, breakpointNames, coreframeGeneratedWorkerVariables, coreframeLocalWorkerVariables, coreframeManagedWorkerSecrets, defineConfig, derivePrimaryWorkerConfig, importProjectDependency, importProjectModule, normalizeWorkerEnvironment, primaryWorkerConfigPath, primaryWorkerEnvironments, readProjectBreakpoints, readProjectConfig, validateBreakpoints, validateWorkerInventoryOwnership, workerBindingNames, wranglerEnvironmentNames };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{fs as e,process as t}from"./environment.js";import{coreframeGeneratedWorkerVariables as n,coreframeLocalWorkerVariables as r,coreframeManagedWorkerSecrets as i,derivePrimaryWorkerConfig as a,normalizeWorkerEnvironment as o,primaryWorkerConfigPath as s,primaryWorkerEnvironments as c,validateWorkerInventoryOwnership as l,workerBindingNames as u,wranglerEnvironmentNames as d}from"./worker.js";import{resolve as f}from"node:path";import{pathToFileURL as p}from"node:url";import{resolve as m}from"import-meta-resolve";function h(e){return e}async function g({cwd:n=t.cwd()}={}){let r=f(n,`coreframe.config.ts`),i;try{i=(await e.stat(r,{bigint:!0})).mtimeNs}catch{return{}}let a=p(r);return a.searchParams.set(`modified`,i.toString()),(await import(a.href)).default??{}}async function _(e,n=t.cwd()){return await import(p(f(n,e)).href)}async function v(e,n=t.cwd()){return await import(m(e,p(f(n,`package.json`)).href))}export{n as coreframeGeneratedWorkerVariables,r as coreframeLocalWorkerVariables,i as coreframeManagedWorkerSecrets,h as defineConfig,a as derivePrimaryWorkerConfig,v as importProjectDependency,_ as importProjectModule,o as normalizeWorkerEnvironment,s as primaryWorkerConfigPath,c as primaryWorkerEnvironments,g as readProjectConfig,l as validateWorkerInventoryOwnership,u as workerBindingNames,d as wranglerEnvironmentNames};
1
+ import{fs as e,process as t}from"./environment.js";import{coreframeGeneratedWorkerVariables as n,coreframeLocalWorkerVariables as r,coreframeManagedWorkerSecrets as i,derivePrimaryWorkerConfig as a,normalizeWorkerEnvironment as o,primaryWorkerConfigPath as s,primaryWorkerEnvironments as c,validateWorkerInventoryOwnership as l,workerBindingNames as u,wranglerEnvironmentNames as d}from"./worker.js";import{resolve as f}from"node:path";import{pathToFileURL as p}from"node:url";import{resolve as m}from"import-meta-resolve";const h=[`sm`,`md`,`lg`,`xl`,`2xl`];function g(e){return e.breakpoints!==void 0&&_(e.breakpoints),e}function _(e){if(!y(e))throw Error(`coreframe.config.ts must configure breakpoints.sm, md, lg, xl, and 2xl as positive finite numbers.`);let t=Object.keys(e).sort(),n=[...h].sort();if(t.length!==n.length||t.some((e,t)=>e!==n[t]))throw Error(`coreframe.config.ts breakpoints must contain only sm, md, lg, xl, and 2xl.`);let r=0;for(let t of h){let n=e[t];if(typeof n!=`number`||!Number.isFinite(n)||n<=0)throw Error(`coreframe.config.ts breakpoints.${t} must be a positive finite number of logical pixels.`);if(n<=r)throw Error(`coreframe.config.ts breakpoints must increase strictly from sm through 2xl; breakpoints.${t} is not greater than the preceding value.`);r=n}return e}async function v({cwd:e=t.cwd()}={}){let n=await b({cwd:e});if(n.breakpoints===void 0)throw Error(`coreframe.config.ts must configure breakpoints.sm, md, lg, xl, and 2xl as positive finite numbers.`);return _(n.breakpoints)}function y(e){return!!(e&&typeof e==`object`&&!Array.isArray(e))}async function b({cwd:n=t.cwd()}={}){let r=f(n,`coreframe.config.ts`),i;try{i=(await e.stat(r,{bigint:!0})).mtimeNs}catch{return{}}let a=p(r);return a.searchParams.set(`modified`,i.toString()),(await import(a.href)).default??{}}async function x(e,n=t.cwd()){return await import(p(f(n,e)).href)}async function S(e,n=t.cwd()){return await import(m(e,p(f(n,`package.json`)).href))}export{h as breakpointNames,n as coreframeGeneratedWorkerVariables,r as coreframeLocalWorkerVariables,i as coreframeManagedWorkerSecrets,g as defineConfig,a as derivePrimaryWorkerConfig,S as importProjectDependency,x as importProjectModule,o as normalizeWorkerEnvironment,s as primaryWorkerConfigPath,c as primaryWorkerEnvironments,v as readProjectBreakpoints,b as readProjectConfig,_ as validateBreakpoints,l as validateWorkerInventoryOwnership,u as workerBindingNames,d as wranglerEnvironmentNames};
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@coreframe/config",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Environment and project configuration utilities for Coreframe apps",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/airlock-labs/coreframe.git",
7
+ "url": "git+https://github.com/coreframe-js/coreframe.git",
8
8
  "directory": "node/config"
9
9
  },
10
10
  "files": [