@coreframe/config 0.1.10 → 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 +21 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
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; /**
|
|
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
|
};
|
|
@@ -161,7 +180,6 @@ type DeployConfig = {
|
|
|
161
180
|
*/
|
|
162
181
|
stagingHostname?: StagingHostnameConfig;
|
|
163
182
|
};
|
|
164
|
-
declare function defineConfig(config: CoreframeConfig): CoreframeConfig;
|
|
165
183
|
declare function readProjectConfig({
|
|
166
184
|
cwd
|
|
167
185
|
}?: {
|
|
@@ -170,4 +188,4 @@ declare function readProjectConfig({
|
|
|
170
188
|
declare function importProjectModule<T>(path: string, cwd?: string): Promise<T>;
|
|
171
189
|
declare function importProjectDependency<T>(specifier: string, cwd?: string): Promise<T>;
|
|
172
190
|
//#endregion
|
|
173
|
-
export { AssetsConfig, 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, 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
|
|
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};
|