@coreframe/config 0.1.5 → 0.1.7

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +143 -58
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -2,115 +2,200 @@ import { JsonObject, JsonValue, PrimaryWorkerContributions, PrimaryWorkerEnviron
2
2
 
3
3
  //#region src/index.d.ts
4
4
  type CoreframeConfig = {
5
- assets?: AssetsConfig;
6
- database?: DatabaseConfig;
7
- deploy?: DeployConfig;
8
- dev?: DevConfig;
9
- i18n?: I18nConfig;
10
- flutter?: FlutterConfig;
11
- preview?: PreviewConfig;
5
+ /** Object storage and public asset delivery settings. */assets?: AssetsConfig; /** Database settings used by local and deployment workflows. */
6
+ database?: DatabaseConfig; /** Deployment hooks, environments, checks, and release settings. */
7
+ deploy?: DeployConfig; /** Local development settings. */
8
+ dev?: DevConfig; /** Translation catalog and locale settings. */
9
+ i18n?: I18nConfig; /** Flutter host integration settings. */
10
+ flutter?: FlutterConfig; /** Local preview server and tunnel settings. */
11
+ preview?: PreviewConfig; /** Worker build and runtime settings. */
12
12
  worker?: WorkerConfig;
13
13
  };
14
14
  type FlutterConfig = {
15
- deepLink: FlutterDeepLinkConfig;
15
+ /** Custom URL origin accepted for navigation into the Flutter app. */deepLink: FlutterDeepLinkConfig;
16
16
  };
17
17
  type FlutterDeepLinkConfig = {
18
- host: string;
18
+ /** Lowercase URL host accepted for Flutter navigation links, without a port. */host: string; /** Lowercase URI scheme used by Flutter navigation links. */
19
19
  scheme: string;
20
20
  };
21
21
  type AssetsConfig = {
22
- credentialProfile: string;
23
- endpoint: string;
24
- projectId: string;
25
- publicBaseUrl: string;
26
- publicBucket: string;
27
- region: string;
22
+ /** Credential profile used to access the asset storage service. */credentialProfile: string; /** S3-compatible API endpoint for the asset storage service. */
23
+ endpoint: string; /** Project identifier used to namespace generated asset keys. */
24
+ projectId: string; /** Base URL from which browsers load published assets. */
25
+ publicBaseUrl: string; /** Bucket containing assets published for browser access. */
26
+ publicBucket: string; /** Storage region passed to the S3-compatible client. */
27
+ region: string; /** Bucket containing original source assets. */
28
28
  sourceBucket: string;
29
29
  };
30
30
  type DatabaseDialect = "postgres" | "sqlite";
31
31
  type DatabaseConfig = {
32
- dialect: DatabaseDialect;
32
+ /** Database engine used by project workflows. */dialect: DatabaseDialect; /** Project-relative module that seeds the database. */
33
33
  seed?: string;
34
34
  };
35
35
  type DevPlatform = "android" | "desktop" | "ios" | "macos" | "web" | "webext";
36
36
  type DevConfig = {
37
- platforms?: DevPlatform[];
37
+ /** Platforms started by the development command. */platforms?: DevPlatform[];
38
38
  };
39
39
  type PreviewTunnelConfig = {
40
- dns: "external" | "managed";
41
- hostname: string;
42
- name: string;
40
+ /** Whether Coreframe or an external provider manages the tunnel hostname's DNS. */dns: "external" | "managed"; /** Public hostname assigned to the preview tunnel. */
41
+ hostname: string; /** Cloudflare tunnel name. */
42
+ name: string; /** Credential profile used to manage the tunnel. */
43
43
  profile: string;
44
44
  };
45
45
  type PreviewConfig = {
46
- appOrigin?: string;
47
- host?: string;
48
- port?: number;
46
+ /** Exact HTTPS origin used by browser-facing application URLs. */appOrigin?: string; /** Network interface on which the local preview server listens. */
47
+ host?: string; /** TCP port on which the local preview server listens. */
48
+ port?: number; /** Whether startup fails when the configured port is unavailable. */
49
49
  strictPort?: boolean;
50
- tunnel?: PreviewTunnelConfig;
50
+ /**
51
+ * Public tunnel settings for the local preview server.
52
+ *
53
+ * @example
54
+ * defineConfig({
55
+ * preview: {
56
+ * appOrigin: "https://preview.example.com",
57
+ * tunnel: {
58
+ * dns: "managed",
59
+ * hostname: "preview.example.com",
60
+ * name: "coreframe-preview",
61
+ * profile: "company",
62
+ * },
63
+ * },
64
+ * })
65
+ */
66
+ tunnel?: PreviewTunnelConfig; /** Worker bindings supplied during preview. */
67
+ worker?: PreviewWorkerConfig;
68
+ };
69
+ type PreviewWorkerConfig = {
70
+ /** JSON-serializable values exposed as worker bindings during preview. */bindings: Record<string, JsonObject>;
51
71
  };
52
72
  type I18nConfig = {
53
- catalogs: string[];
73
+ /** Catalog names generated for each configured locale. */catalogs: string[]; /** Project-relative directory containing translation catalogs. */
54
74
  directory?: string;
75
+ /**
76
+ * External command used to generate translated messages.
77
+ *
78
+ * @example
79
+ * defineConfig({
80
+ * i18n: {
81
+ * catalogs: ["web"],
82
+ * generator: {
83
+ * command: "node",
84
+ * args: ["scripts/i18n/generate.ts"],
85
+ * id: "vercel-ai-sdk-openai",
86
+ * },
87
+ * locales: ["en", "es"],
88
+ * sourceLocale: "en",
89
+ * },
90
+ * })
91
+ */
55
92
  generator?: {
56
- args?: string[];
57
- command: string;
93
+ /** Arguments appended to the translation generator command. */args?: string[]; /** Executable invoked to generate translations. */
94
+ command: string; /** Stable identifier recorded for the translation generator. */
58
95
  id: string;
59
- };
60
- locales: string[];
96
+ }; /** Locale identifiers included in translation workflows. */
97
+ locales: string[]; /** Locale in which source messages are written. */
61
98
  sourceLocale: string;
62
99
  };
63
100
  type DeployEnvironment = "staging" | "production";
64
101
  type DeployContext = {
65
- environment: DeployEnvironment;
66
- releaseName: string;
67
- url: string;
102
+ /** Deployment environment being released. */environment: DeployEnvironment; /** Human-readable name assigned to the release. */
103
+ releaseName: string; /** Public URL of the deployed application. */
104
+ url: string; /** Version assigned to the release. */
68
105
  version: string;
69
106
  };
70
107
  type TauriReleasePlatform = "macos" | "windows" | "linux" | "ios" | "android";
71
108
  type TauriReleasePlatformConfig = {
72
- artifactGlobs?: string[];
73
- buildArgs?: string[];
74
- targetTriple?: string;
109
+ /** Glob patterns used to find build artifacts for the platform. */artifactGlobs?: string[]; /** Arguments passed to the Tauri build command for the platform. */
110
+ buildArgs?: string[]; /** Rust target triple used to build the platform. */
111
+ targetTriple?: string; /** Platform key written to the Tauri updater manifest. */
75
112
  updatePlatform?: string;
76
113
  };
77
114
  type TauriReleaseConfig = {
78
- artifactDownloadDir?: string;
79
- b2Bucket?: string;
80
- latestManifestPath?: string;
115
+ /** Local directory into which remote workflow artifacts are downloaded. */artifactDownloadDir?: string; /** Backblaze B2 bucket that receives release files. */
116
+ b2Bucket?: string; /** Local path where the latest updater manifest is written. */
117
+ latestManifestPath?: string; /** Platforms built on the machine running the deploy command. */
81
118
  localPlatforms?: TauriReleasePlatform[];
82
- platform?: Partial<Record<TauriReleasePlatform, TauriReleasePlatformConfig>>;
83
- publicBaseUrl?: string;
84
- publicPathPrefix?: string;
85
- releaseNotesPath?: string;
86
- releasePath?: string;
87
- releaseUploadDir?: string;
88
- workflowPlatforms?: TauriReleasePlatform[];
89
- workflowName?: string;
90
- workflowPollIntervalMs?: number;
91
- workflowRef?: string;
119
+ /**
120
+ * Per-platform artifact discovery and build overrides.
121
+ *
122
+ * @example
123
+ * defineConfig({
124
+ * deploy: {
125
+ * tauriRelease: {
126
+ * platform: {
127
+ * macos: {
128
+ * artifactGlobs: ["src-tauri/target/release/bundle/macos/*.sig"],
129
+ * targetTriple: "aarch64-apple-darwin",
130
+ * },
131
+ * },
132
+ * },
133
+ * },
134
+ * })
135
+ */
136
+ platform?: Partial<Record<TauriReleasePlatform, TauriReleasePlatformConfig>>; /** Public base URL used to construct release download URLs. */
137
+ publicBaseUrl?: string; /** Path prefix added to public release download URLs. */
138
+ publicPathPrefix?: string; /** Project-relative path to the release notes file. */
139
+ releaseNotesPath?: string; /** Remote path under which versioned release files are stored. */
140
+ releasePath?: string; /** Local directory containing release files ready for upload. */
141
+ releaseUploadDir?: string; /** Platforms built by the remote release workflow. */
142
+ workflowPlatforms?: TauriReleasePlatform[]; /** GitHub Actions workflow used to build remote release artifacts. */
143
+ workflowName?: string; /** Delay in milliseconds between remote workflow status checks. */
144
+ workflowPollIntervalMs?: number; /** Git ref on which the remote release workflow runs. */
145
+ workflowRef?: string; /** Maximum time in milliseconds to wait for the remote workflow. */
92
146
  workflowTimeoutMs?: number;
93
147
  };
94
148
  type DeploySmokeCheck = {
95
- name: string;
96
- path?: string;
97
- url?: string;
149
+ /** Label used to identify the check in deployment output. */name: string; /** Application-relative path checked after deployment. */
150
+ path?: string; /** Absolute URL checked after deployment instead of an application path. */
151
+ url?: string; /** HTTP status code or codes that count as a successful check. */
98
152
  expectedStatus?: "2xx" | number | number[];
99
153
  };
100
154
  type DeployEnvironmentConfig = {
101
- url?: string;
155
+ /** Public application URL for the deployment environment. */url?: string;
102
156
  };
103
157
  type StagingHostnameConfig = {
104
- managedLabelPrefix: string;
105
- parentHostname: string;
158
+ /** Prefix added to generated staging DNS labels. */managedLabelPrefix: string; /** Parent hostname under which staging hostnames are generated. */
159
+ parentHostname: string; /** Worker service whose application-origin secret is updated for staging. */
106
160
  workerService: string;
107
161
  };
108
162
  type DeployConfig = {
109
- afterDeploy?: (context: DeployContext) => Promise<void> | void;
110
- afterWorkerDeploy?: (context: DeployContext) => Promise<void> | void;
163
+ /** Hook called after all deployment work completes. */afterDeploy?: (context: DeployContext) => Promise<void> | void; /** Hook called immediately after the worker deployment completes. */
164
+ afterWorkerDeploy?: (context: DeployContext) => Promise<void> | void; /** Per-environment deployment overrides. */
111
165
  environments?: Partial<Record<DeployEnvironment, DeployEnvironmentConfig>>;
166
+ /**
167
+ * HTTP checks run against the application after deployment.
168
+ *
169
+ * @example
170
+ * defineConfig({
171
+ * deploy: {
172
+ * smokeChecks: [
173
+ * { name: "home", path: "/" },
174
+ * {
175
+ * name: "status page",
176
+ * url: "https://status.example.com/health",
177
+ * expectedStatus: [200, 204],
178
+ * },
179
+ * ],
180
+ * },
181
+ * })
182
+ */
112
183
  smokeChecks?: DeploySmokeCheck[];
113
- stagingHostname?: StagingHostnameConfig;
184
+ /**
185
+ * Settings for generating and assigning staging hostnames.
186
+ *
187
+ * @example
188
+ * defineConfig({
189
+ * deploy: {
190
+ * stagingHostname: {
191
+ * managedLabelPrefix: "review-",
192
+ * parentHostname: "staging.example.com",
193
+ * workerService: "example-api-staging",
194
+ * },
195
+ * },
196
+ * })
197
+ */
198
+ stagingHostname?: StagingHostnameConfig; /** Tauri desktop and mobile release settings. */
114
199
  tauriRelease?: TauriReleaseConfig;
115
200
  };
116
201
  declare function defineConfig(config: CoreframeConfig): CoreframeConfig;
@@ -122,4 +207,4 @@ declare function readProjectConfig({
122
207
  declare function importProjectModule<T>(path: string, cwd?: string): Promise<T>;
123
208
  declare function importProjectDependency<T>(specifier: string, cwd?: string): Promise<T>;
124
209
  //#endregion
125
- export { AssetsConfig, CoreframeConfig, DatabaseConfig, DatabaseDialect, DeployConfig, DeployContext, DeployEnvironment, DeployEnvironmentConfig, DeploySmokeCheck, DevConfig, DevPlatform, FlutterConfig, FlutterDeepLinkConfig, I18nConfig, JsonObject, JsonValue, PreviewConfig, PreviewTunnelConfig, PrimaryWorkerContributions, PrimaryWorkerEnvironment, StagingHostnameConfig, TauriReleaseConfig, TauriReleasePlatform, TauriReleasePlatformConfig, WorkerConfig, WorkerDeployEnvironment, WorkerEnvironmentDeclaration, WorkerEnvironmentKind, WorkerEnvironmentVariableConfig, WranglerConfig, coreframeGeneratedWorkerVariables, coreframeLocalWorkerVariables, coreframeManagedWorkerSecrets, defineConfig, derivePrimaryWorkerConfig, importProjectDependency, importProjectModule, normalizeWorkerEnvironment, primaryWorkerConfigPath, primaryWorkerEnvironments, readProjectConfig, validateWorkerInventoryOwnership, workerBindingNames, wranglerEnvironmentNames };
210
+ export { AssetsConfig, CoreframeConfig, DatabaseConfig, DatabaseDialect, DeployConfig, DeployContext, DeployEnvironment, DeployEnvironmentConfig, DeploySmokeCheck, DevConfig, DevPlatform, FlutterConfig, FlutterDeepLinkConfig, I18nConfig, JsonObject, JsonValue, PreviewConfig, PreviewTunnelConfig, PreviewWorkerConfig, PrimaryWorkerContributions, PrimaryWorkerEnvironment, StagingHostnameConfig, TauriReleaseConfig, TauriReleasePlatform, TauriReleasePlatformConfig, WorkerConfig, WorkerDeployEnvironment, WorkerEnvironmentDeclaration, WorkerEnvironmentKind, WorkerEnvironmentVariableConfig, WranglerConfig, coreframeGeneratedWorkerVariables, coreframeLocalWorkerVariables, coreframeManagedWorkerSecrets, defineConfig, derivePrimaryWorkerConfig, importProjectDependency, importProjectModule, normalizeWorkerEnvironment, primaryWorkerConfigPath, primaryWorkerEnvironments, readProjectConfig, validateWorkerInventoryOwnership, workerBindingNames, wranglerEnvironmentNames };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreframe/config",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Environment and project configuration utilities for Coreframe apps",
5
5
  "repository": {
6
6
  "type": "git",