@coreframe/config 0.1.6 → 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 +139 -58
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -2,119 +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. */
51
67
  worker?: PreviewWorkerConfig;
52
68
  };
53
69
  type PreviewWorkerConfig = {
54
- bindings: Record<string, JsonObject>;
70
+ /** JSON-serializable values exposed as worker bindings during preview. */bindings: Record<string, JsonObject>;
55
71
  };
56
72
  type I18nConfig = {
57
- catalogs: string[];
73
+ /** Catalog names generated for each configured locale. */catalogs: string[]; /** Project-relative directory containing translation catalogs. */
58
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
+ */
59
92
  generator?: {
60
- args?: string[];
61
- 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. */
62
95
  id: string;
63
- };
64
- locales: string[];
96
+ }; /** Locale identifiers included in translation workflows. */
97
+ locales: string[]; /** Locale in which source messages are written. */
65
98
  sourceLocale: string;
66
99
  };
67
100
  type DeployEnvironment = "staging" | "production";
68
101
  type DeployContext = {
69
- environment: DeployEnvironment;
70
- releaseName: string;
71
- 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. */
72
105
  version: string;
73
106
  };
74
107
  type TauriReleasePlatform = "macos" | "windows" | "linux" | "ios" | "android";
75
108
  type TauriReleasePlatformConfig = {
76
- artifactGlobs?: string[];
77
- buildArgs?: string[];
78
- 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. */
79
112
  updatePlatform?: string;
80
113
  };
81
114
  type TauriReleaseConfig = {
82
- artifactDownloadDir?: string;
83
- b2Bucket?: string;
84
- 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. */
85
118
  localPlatforms?: TauriReleasePlatform[];
86
- platform?: Partial<Record<TauriReleasePlatform, TauriReleasePlatformConfig>>;
87
- publicBaseUrl?: string;
88
- publicPathPrefix?: string;
89
- releaseNotesPath?: string;
90
- releasePath?: string;
91
- releaseUploadDir?: string;
92
- workflowPlatforms?: TauriReleasePlatform[];
93
- workflowName?: string;
94
- workflowPollIntervalMs?: number;
95
- 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. */
96
146
  workflowTimeoutMs?: number;
97
147
  };
98
148
  type DeploySmokeCheck = {
99
- name: string;
100
- path?: string;
101
- 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. */
102
152
  expectedStatus?: "2xx" | number | number[];
103
153
  };
104
154
  type DeployEnvironmentConfig = {
105
- url?: string;
155
+ /** Public application URL for the deployment environment. */url?: string;
106
156
  };
107
157
  type StagingHostnameConfig = {
108
- managedLabelPrefix: string;
109
- 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. */
110
160
  workerService: string;
111
161
  };
112
162
  type DeployConfig = {
113
- afterDeploy?: (context: DeployContext) => Promise<void> | void;
114
- 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. */
115
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
+ */
116
183
  smokeChecks?: DeploySmokeCheck[];
117
- 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. */
118
199
  tauriRelease?: TauriReleaseConfig;
119
200
  };
120
201
  declare function defineConfig(config: CoreframeConfig): CoreframeConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreframe/config",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Environment and project configuration utilities for Coreframe apps",
5
5
  "repository": {
6
6
  "type": "git",