@coreframe/config 0.3.0 → 0.3.2
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/dev-services.d.ts +17 -0
- package/dist/dev-services.js +1 -0
- package/dist/index.d.ts +9 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/dev-services.d.ts
|
|
2
|
+
/** A loopback TCP service owned by a local web development session. */
|
|
3
|
+
type DevServiceConfig = {
|
|
4
|
+
/** Executable on PATH or a path relative to the project root. */command: string; /** Literal arguments. Coreframe replaces {host} and {port} with the upstream address. */
|
|
5
|
+
args: readonly string[]; /** Launch only after a client connects to the published endpoint. */
|
|
6
|
+
start: "on-connect"; /** Time allowed for the process to accept a TCP connection. Defaults to 10,000 ms. */
|
|
7
|
+
readinessTimeoutMs?: number; /** Optional published URL to bind in the local Worker. */
|
|
8
|
+
workerEnv?: {
|
|
9
|
+
name: string;
|
|
10
|
+
protocol: "tcp" | "http" | "https" | "ws" | "wss";
|
|
11
|
+
path?: `/${string}`;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
/** Internal environment transport from the dev command to the local Worker configuration. */
|
|
15
|
+
declare const devServiceWorkerBindingsEnv = "COREFRAME_DEV_SERVICE_WORKER_BINDINGS";
|
|
16
|
+
//#endregion
|
|
17
|
+
export { DevServiceConfig, devServiceWorkerBindingsEnv };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=`COREFRAME_DEV_SERVICE_WORKER_BINDINGS`;export{e as devServiceWorkerBindingsEnv};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DevServiceConfig, devServiceWorkerBindingsEnv } from "./dev-services.js";
|
|
1
2
|
import { JsonObject, JsonValue, PrimaryWorkerContributions, PrimaryWorkerEnvironment, WorkerConfig, WorkerDeployEnvironment, WorkerEnvironmentDeclaration, WorkerEnvironmentKind, WorkerEnvironmentVariableConfig, WranglerConfig, coreframeGeneratedWorkerVariables, coreframeLocalWorkerVariables, coreframeManagedWorkerSecrets, derivePrimaryWorkerConfig, normalizeWorkerEnvironment, primaryWorkerConfigPath, primaryWorkerEnvironments, validateWorkerInventoryOwnership, workerBindingNames, wranglerEnvironmentNames } from "./worker.js";
|
|
2
3
|
|
|
3
4
|
//#region src/index.d.ts
|
|
@@ -42,6 +43,11 @@ type AssetsConfig = {
|
|
|
42
43
|
};
|
|
43
44
|
type DashboardConfig = {
|
|
44
45
|
/** Whether the project builds, develops, and deploys the Coreframe dashboard. Defaults to true. */enabled?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Development router. Client mode requires the dashboard's client-compatible route contract.
|
|
48
|
+
* Defaults to framework.
|
|
49
|
+
*/
|
|
50
|
+
devRouter?: "framework" | "client";
|
|
45
51
|
};
|
|
46
52
|
type DatabaseDialect = "postgres" | "sqlite";
|
|
47
53
|
type DatabaseConfig = {
|
|
@@ -60,7 +66,8 @@ type JobsConfig = {
|
|
|
60
66
|
};
|
|
61
67
|
type DevPlatform = "web" | "webext";
|
|
62
68
|
type DevConfig = {
|
|
63
|
-
/** Platforms started by the development command. */platforms?: DevPlatform[];
|
|
69
|
+
/** Platforms started by the development command. */platforms?: DevPlatform[]; /** Named, on-demand TCP services for local web development. */
|
|
70
|
+
services?: Readonly<Record<string, DevServiceConfig>>;
|
|
64
71
|
};
|
|
65
72
|
type PreviewTunnelConfig = {
|
|
66
73
|
/** Whether Coreframe or an external provider manages the preview hostname's DNS. */dns: "external" | "managed"; /** Cloudflare tunnel name. */
|
|
@@ -249,4 +256,4 @@ declare function readProjectConfig({
|
|
|
249
256
|
declare function importProjectModule<T>(path: string, cwd?: string): Promise<T>;
|
|
250
257
|
declare function importProjectDependency<T>(specifier: string, cwd?: string): Promise<T>;
|
|
251
258
|
//#endregion
|
|
252
|
-
export { AssetsConfig, BreakpointsConfig, CoreframeConfig, DashboardConfig, DatabaseConfig, DatabaseDialect, DeployConfig, DeployContext, DeployEnvironment, DeployEnvironmentConfig, DeployMode, DeploySmokeCheck, DevConfig, DevPlatform, I18nConfig, JobsConfig, JsonObject, JsonValue, PreviewAccessBypassConfig, PreviewAccessConfig, PreviewAccessIpContext, PreviewAccessIpResolver, PreviewConfig, PreviewTunnelConfig, PreviewWorkerConfig, PrimaryWorkerContributions, PrimaryWorkerEnvironment, ReviewerDeployContext, ReviewerDeployModule, StagingHostnameConfig, WorkerConfig, WorkerDeployEnvironment, WorkerEnvironmentDeclaration, WorkerEnvironmentKind, WorkerEnvironmentVariableConfig, WranglerConfig, breakpointNames, coreframeGeneratedWorkerVariables, coreframeLocalWorkerVariables, coreframeManagedWorkerSecrets, defineConfig, derivePrimaryWorkerConfig, importProjectDependency, importProjectModule, normalizeWorkerEnvironment, primaryWorkerConfigPath, primaryWorkerEnvironments, readProjectBreakpoints, readProjectConfig, validateBreakpoints, validateWorkerInventoryOwnership, workerBindingNames, wranglerEnvironmentNames };
|
|
259
|
+
export { AssetsConfig, BreakpointsConfig, CoreframeConfig, DashboardConfig, DatabaseConfig, DatabaseDialect, DeployConfig, DeployContext, DeployEnvironment, DeployEnvironmentConfig, DeployMode, DeploySmokeCheck, DevConfig, DevPlatform, DevServiceConfig, I18nConfig, JobsConfig, JsonObject, JsonValue, PreviewAccessBypassConfig, PreviewAccessConfig, PreviewAccessIpContext, PreviewAccessIpResolver, PreviewConfig, PreviewTunnelConfig, PreviewWorkerConfig, PrimaryWorkerContributions, PrimaryWorkerEnvironment, ReviewerDeployContext, ReviewerDeployModule, StagingHostnameConfig, WorkerConfig, WorkerDeployEnvironment, WorkerEnvironmentDeclaration, WorkerEnvironmentKind, WorkerEnvironmentVariableConfig, WranglerConfig, breakpointNames, coreframeGeneratedWorkerVariables, coreframeLocalWorkerVariables, coreframeManagedWorkerSecrets, defineConfig, derivePrimaryWorkerConfig, devServiceWorkerBindingsEnv, importProjectDependency, importProjectModule, normalizeWorkerEnvironment, primaryWorkerConfigPath, primaryWorkerEnvironments, readProjectBreakpoints, readProjectConfig, validateBreakpoints, validateWorkerInventoryOwnership, workerBindingNames, wranglerEnvironmentNames };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fs as
|
|
1
|
+
import{devServiceWorkerBindingsEnv as e}from"./dev-services.js";import{fs as t,process as n}from"./environment.js";import{coreframeGeneratedWorkerVariables as r,coreframeLocalWorkerVariables as i,coreframeManagedWorkerSecrets as a,derivePrimaryWorkerConfig as o,normalizeWorkerEnvironment as s,primaryWorkerConfigPath as c,primaryWorkerEnvironments as l,validateWorkerInventoryOwnership as u,workerBindingNames as d,wranglerEnvironmentNames as f}from"./worker.js";import{resolve as p}from"node:path";import{pathToFileURL as m}from"node:url";import{resolve as h}from"import-meta-resolve";const g=[`sm`,`md`,`lg`,`xl`,`2xl`];function _(e){return e.breakpoints!==void 0&&v(e.breakpoints),e}function v(e){if(!b(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=[...g].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 g){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 y({cwd:e=n.cwd()}={}){let t=await x({cwd:e});if(t.breakpoints===void 0)throw Error(`coreframe.config.ts must configure breakpoints.sm, md, lg, xl, and 2xl as positive finite numbers.`);return v(t.breakpoints)}function b(e){return!!(e&&typeof e==`object`&&!Array.isArray(e))}async function x({cwd:e=n.cwd()}={}){let r=p(e,`coreframe.config.ts`),i;try{i=(await t.stat(r,{bigint:!0})).mtimeNs}catch{return{}}let a=m(r);return a.searchParams.set(`modified`,i.toString()),(await import(a.href)).default??{}}async function S(e,t=n.cwd()){return await import(m(p(t,e)).href)}async function C(e,t=n.cwd()){return await import(h(e,m(p(t,`package.json`)).href))}export{g as breakpointNames,r as coreframeGeneratedWorkerVariables,i as coreframeLocalWorkerVariables,a as coreframeManagedWorkerSecrets,_ as defineConfig,o as derivePrimaryWorkerConfig,e as devServiceWorkerBindingsEnv,C as importProjectDependency,S as importProjectModule,s as normalizeWorkerEnvironment,c as primaryWorkerConfigPath,l as primaryWorkerEnvironments,y as readProjectBreakpoints,x as readProjectConfig,v as validateBreakpoints,u as validateWorkerInventoryOwnership,d as workerBindingNames,f as wranglerEnvironmentNames};
|