@coreframe/config 0.1.15-next.2 → 0.1.15
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 +8 -37
- package/dist/worker.d.ts +1 -1
- package/dist/worker.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ import { JsonObject, JsonValue, PrimaryWorkerContributions, PrimaryWorkerEnviron
|
|
|
3
3
|
//#region src/index.d.ts
|
|
4
4
|
type CoreframeConfig = {
|
|
5
5
|
/** Object storage and public asset delivery settings. */assets?: AssetsConfig; /** Responsive layout breakpoints in logical CSS pixels. */
|
|
6
|
-
breakpoints?: BreakpointsConfig; /**
|
|
6
|
+
breakpoints?: BreakpointsConfig; /** Dashboard build, development, and deployment settings. */
|
|
7
|
+
dashboard?: DashboardConfig; /** Database settings used by local and deployment workflows. */
|
|
7
8
|
database?: DatabaseConfig; /** Deployment hooks, environments, checks, and release settings. */
|
|
8
|
-
deploy?: DeployConfig; /**
|
|
9
|
-
extension?: ExtensionConfig; /** Local development settings. */
|
|
9
|
+
deploy?: DeployConfig; /** Local development settings. */
|
|
10
10
|
dev?: DevConfig; /** Translation catalog and locale settings. */
|
|
11
11
|
i18n?: I18nConfig; /** Local development job inspection and reset settings. */
|
|
12
12
|
jobs?: JobsConfig; /** Flutter host integration settings. */
|
|
@@ -14,26 +14,6 @@ type CoreframeConfig = {
|
|
|
14
14
|
preview?: PreviewConfig; /** Worker build and runtime settings. */
|
|
15
15
|
worker?: WorkerConfig;
|
|
16
16
|
};
|
|
17
|
-
type ExtensionStore = "chrome" | "edge" | "firefox";
|
|
18
|
-
type ExtensionConfig = {
|
|
19
|
-
/** WXT project used for builds and store operations. */wxt: {
|
|
20
|
-
/** Project-relative WXT configuration file. */config: string; /** Directory in which WXT writes extension and source ZIPs. */
|
|
21
|
-
outputDirectory?: string;
|
|
22
|
-
}; /** Stores enabled for this extension. Omitted stores are never contacted. */
|
|
23
|
-
stores: {
|
|
24
|
-
chrome?: {
|
|
25
|
-
extensionId?: string;
|
|
26
|
-
publisherId?: string;
|
|
27
|
-
};
|
|
28
|
-
edge?: {
|
|
29
|
-
productId?: string;
|
|
30
|
-
};
|
|
31
|
-
firefox?: {
|
|
32
|
-
channel?: "listed" | "unlisted";
|
|
33
|
-
extensionId?: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
17
|
/** Named responsive layout breakpoints shared by Panda, web, and Flutter. */
|
|
38
18
|
type BreakpointsConfig = Readonly<{
|
|
39
19
|
"2xl": number;
|
|
@@ -68,23 +48,14 @@ type AssetsConfig = {
|
|
|
68
48
|
region: string; /** Bucket containing original source assets. */
|
|
69
49
|
sourceBucket: string;
|
|
70
50
|
};
|
|
51
|
+
type DashboardConfig = {
|
|
52
|
+
/** Whether the project builds, develops, and deploys the Coreframe dashboard. Defaults to true. */enabled?: boolean;
|
|
53
|
+
};
|
|
71
54
|
type DatabaseDialect = "postgres" | "sqlite";
|
|
72
55
|
type DatabaseConfig = {
|
|
73
|
-
/** Database engine used by project workflows. */dialect: DatabaseDialect; /**
|
|
74
|
-
environments?: Partial<Record<"staging" | "production", DatabaseEnvironmentConfig>>; /** Project-relative module that seeds the database. */
|
|
56
|
+
/** Database engine used by project workflows. */dialect: DatabaseDialect; /** Project-relative module that seeds the database. */
|
|
75
57
|
seed?: string;
|
|
76
58
|
};
|
|
77
|
-
type DatabaseEnvironmentConfig = {
|
|
78
|
-
/** Environment variable containing the database URL. */urlEnv: string; /** Environment variable containing the libSQL authentication token. */
|
|
79
|
-
authTokenEnv?: string; /** PostgreSQL TLS options. URL query parameters remain supported. */
|
|
80
|
-
tls?: boolean | DatabaseTlsConfig;
|
|
81
|
-
};
|
|
82
|
-
type DatabaseTlsConfig = {
|
|
83
|
-
caEnv?: string;
|
|
84
|
-
certEnv?: string;
|
|
85
|
-
keyEnv?: string;
|
|
86
|
-
rejectUnauthorized?: boolean;
|
|
87
|
-
};
|
|
88
59
|
type JobsConfig = {
|
|
89
60
|
/** Project-relative module exporting the local development job administration contract. */entry: string;
|
|
90
61
|
};
|
|
@@ -242,4 +213,4 @@ declare function readProjectConfig({
|
|
|
242
213
|
declare function importProjectModule<T>(path: string, cwd?: string): Promise<T>;
|
|
243
214
|
declare function importProjectDependency<T>(specifier: string, cwd?: string): Promise<T>;
|
|
244
215
|
//#endregion
|
|
245
|
-
export { AssetsConfig, BreakpointsConfig, CoreframeConfig, DatabaseConfig, DatabaseDialect,
|
|
216
|
+
export { AssetsConfig, BreakpointsConfig, CoreframeConfig, DashboardConfig, DatabaseConfig, DatabaseDialect, DeployConfig, DeployContext, DeployEnvironment, DeployEnvironmentConfig, DeployMode, DeploySmokeCheck, DevConfig, DevPlatform, FlutterConfig, FlutterDeepLinkConfig, I18nConfig, JobsConfig, JsonObject, JsonValue, PreviewAccessBypassConfig, PreviewAccessConfig, PreviewAccessIpContext, PreviewAccessIpResolver, 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/worker.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ declare const primaryWorkerConfigPath = "wrangler.jsonc";
|
|
|
7
7
|
declare const primaryWorkerEnvironments: readonly ["development", "staging", "production"];
|
|
8
8
|
declare const coreframeGeneratedWorkerVariables: readonly ["DEPLOY_ENV", "POSTHOG_RELEASE"];
|
|
9
9
|
declare const coreframeManagedWorkerSecrets: readonly ["COREFRAME_ACCESS_TOKEN_SECRET", "DASHBOARD_PASSWORD"];
|
|
10
|
-
declare const coreframeLocalWorkerVariables: readonly ["COREFRAME_DEV_JOBS_TOKEN", "
|
|
10
|
+
declare const coreframeLocalWorkerVariables: readonly ["COREFRAME_DEV_JOBS_TOKEN", "PGDATABASE", "PGHOST", "PGPASSWORD", "PGPORT", "PGUSER", "PORTLESS_URL", "TURSO_AUTH_TOKEN", "TURSO_DATABASE_URL"];
|
|
11
11
|
type PrimaryWorkerEnvironment = (typeof primaryWorkerEnvironments)[number];
|
|
12
12
|
type WorkerDeployEnvironment = Exclude<PrimaryWorkerEnvironment, "development">;
|
|
13
13
|
type WorkerEnvironmentKind = "secret" | "variable" | "generated";
|
package/dist/worker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=`wrangler.jsonc`,t=[`development`,`staging`,`production`],n=[`DEPLOY_ENV`,`POSTHOG_RELEASE`],r=[`COREFRAME_ACCESS_TOKEN_SECRET`,`DASHBOARD_PASSWORD`],i=[`COREFRAME_DEV_JOBS_TOKEN`,`
|
|
1
|
+
const e=`wrangler.jsonc`,t=[`development`,`staging`,`production`],n=[`DEPLOY_ENV`,`POSTHOG_RELEASE`],r=[`COREFRAME_ACCESS_TOKEN_SECRET`,`DASHBOARD_PASSWORD`],i=[`COREFRAME_DEV_JOBS_TOKEN`,`PGDATABASE`,`PGHOST`,`PGPASSWORD`,`PGPORT`,`PGUSER`,`PORTLESS_URL`,`TURSO_AUTH_TOKEN`,`TURSO_DATABASE_URL`],a=/^[A-Z][A-Z0-9_]*$/;function o(e){return n.some(t=>t===e)}function s(e){return Object.entries(e??{}).map(([e,t])=>{if(!a.test(e))throw Error(`Invalid Worker environment name ${JSON.stringify(e)} in coreframe.config.ts. Use uppercase letters, numbers, and underscores.`);let n=[...new Set(t.requiredIn??[])];if(t.kind===`generated`&&!o(e))throw Error(`${e} is declared as generated, but Coreframe does not generate it. Use kind "variable" or "secret".`);if(o(e)&&t.kind!==`generated`)throw Error(`${e} is generated by Coreframe and must use kind "generated".`);return{...t,name:e,requiredIn:n}}).sort((e,t)=>e.name.localeCompare(t.name))}function c({config:e,environment:t,contributions:n={}}){let r=structuredClone(e),i=h(r.env,`env`),a=h(i[t],`env.${t}`),o=h(a.vars,`env.${t}.vars`),s=h(a.secrets,`env.${t}.secrets`),c=g(s.required,`env.${t}.secrets.required`),l=n.generatedValues??{},u=[...new Set(n.requiredSecrets??[])].sort();p(`variable`,Object.keys(o),Object.keys(l),t),p(`secret`,c,u,t);let d=n.bindings??{},{env:_,...v}=r,y=m(v,a),b=m(d);p(`binding`,[...y],[...b],t);let x=f(a,d,`env.${t}`);return Object.keys(l).length>0&&(x.vars={...o,...l}),u.length>0&&(x.secrets={...s,required:[...c,...u].sort()}),r.env={...i,[t]:x},r}function l(e){return m(e)}function u(e){let t=m(e),n=e=>{if(!_(e))return;let n=_(e.vars)?e.vars:{};Object.keys(n).forEach(e=>t.add(e));let r=_(e.secrets)?e.secrets:{};(Array.isArray(r.required)?r.required:[]).forEach(e=>{typeof e==`string`&&t.add(e)})};return n(e),_(e.env)&&Object.values(e.env).forEach(n),t}function d(e,t){let n=s(t),r=new Map(n.map(e=>[e.name,e])),i=[...m(e)].filter(e=>r.has(e)).sort(),a=new Set,o=new Set,c=e=>{_(e)&&(_(e.vars)&&Object.keys(e.vars).forEach(e=>{r.get(e)?.kind===`secret`&&a.add(e)}),_(e.secrets)&&Array.isArray(e.secrets.required)&&e.secrets.required.forEach(e=>{typeof e==`string`&&r.get(e)?.kind!==`secret`&&r.has(e)&&o.add(e)}))};c(e),_(e.env)&&Object.values(e.env).forEach(c);let l=[...i.map(e=>`${e} (native binding)`),...[...a].sort().map(e=>`${e} (plain variable)`),...[...o].sort().map(e=>`${e} (required secret)`)];if(l.length>0)throw Error(`Worker inventory ownership conflicts with wrangler.jsonc: ${l.join(`, `)}. Keep string metadata in coreframe.config.ts and native binding topology in wrangler.jsonc.`)}function f(e,t,n){let r={...e};for(let[i,a]of Object.entries(t)){if(i in e)throw Error(`Coreframe cannot contribute ${n}.${i}; wrangler.jsonc already owns it.`);r[i]=structuredClone(a)}return r}function p(e,t,n,r){let i=n.filter(e=>t.includes(e)).sort();if(i.length>0)throw Error(`Coreframe ${e} ownership conflicts in Wrangler environment ${r}: ${i.join(`, `)}. Remove the duplicate declarations from wrangler.jsonc.`)}function m(...e){let t=new Set,n=e=>{if(Array.isArray(e)){e.forEach(n);return}_(e)&&(typeof e.binding==`string`&&t.add(e.binding),Object.values(e).forEach(n))};return e.forEach(n),t}function h(e,t){if(e===void 0)return{};if(!_(e))throw Error(`${t} in wrangler.jsonc must be an object.`);return e}function g(e,t){if(e===void 0)return[];if(!Array.isArray(e)||!e.every(e=>typeof e==`string`))throw Error(`${t} in wrangler.jsonc must be an array of strings.`);return e}function _(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}export{n as coreframeGeneratedWorkerVariables,i as coreframeLocalWorkerVariables,r as coreframeManagedWorkerSecrets,c as derivePrimaryWorkerConfig,s as normalizeWorkerEnvironment,e as primaryWorkerConfigPath,t as primaryWorkerEnvironments,d as validateWorkerInventoryOwnership,l as workerBindingNames,u as wranglerEnvironmentNames};
|