@coreframe/config 0.1.6 → 0.1.8
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 +107 -68
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,120 +2,159 @@ 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
|
-
type DevPlatform = "android" | "
|
|
35
|
+
type DevPlatform = "android" | "ios" | "linux" | "macos" | "web" | "webext" | "windows";
|
|
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
|
-
|
|
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
|
-
type TauriReleasePlatform = "macos" | "windows" | "linux" | "ios" | "android";
|
|
75
|
-
type TauriReleasePlatformConfig = {
|
|
76
|
-
artifactGlobs?: string[];
|
|
77
|
-
buildArgs?: string[];
|
|
78
|
-
targetTriple?: string;
|
|
79
|
-
updatePlatform?: string;
|
|
80
|
-
};
|
|
81
|
-
type TauriReleaseConfig = {
|
|
82
|
-
artifactDownloadDir?: string;
|
|
83
|
-
b2Bucket?: string;
|
|
84
|
-
latestManifestPath?: string;
|
|
85
|
-
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;
|
|
96
|
-
workflowTimeoutMs?: number;
|
|
97
|
-
};
|
|
98
107
|
type DeploySmokeCheck = {
|
|
99
|
-
name: string;
|
|
100
|
-
path?: string;
|
|
101
|
-
url?: string;
|
|
108
|
+
/** Label used to identify the check in deployment output. */name: string; /** Application-relative path checked after deployment. */
|
|
109
|
+
path?: string; /** Absolute URL checked after deployment instead of an application path. */
|
|
110
|
+
url?: string; /** HTTP status code or codes that count as a successful check. */
|
|
102
111
|
expectedStatus?: "2xx" | number | number[];
|
|
103
112
|
};
|
|
104
113
|
type DeployEnvironmentConfig = {
|
|
105
|
-
url?: string;
|
|
114
|
+
/** Public application URL for the deployment environment. */url?: string;
|
|
106
115
|
};
|
|
107
116
|
type StagingHostnameConfig = {
|
|
108
|
-
managedLabelPrefix: string;
|
|
109
|
-
parentHostname: string;
|
|
117
|
+
/** Prefix added to generated staging DNS labels. */managedLabelPrefix: string; /** Parent hostname under which staging hostnames are generated. */
|
|
118
|
+
parentHostname: string; /** Worker service whose application-origin secret is updated for staging. */
|
|
110
119
|
workerService: string;
|
|
111
120
|
};
|
|
112
121
|
type DeployConfig = {
|
|
113
|
-
afterDeploy?: (context: DeployContext) => Promise<void> | void;
|
|
114
|
-
afterWorkerDeploy?: (context: DeployContext) => Promise<void> | void;
|
|
122
|
+
/** Hook called after all deployment work completes. */afterDeploy?: (context: DeployContext) => Promise<void> | void; /** Hook called immediately after the worker deployment completes. */
|
|
123
|
+
afterWorkerDeploy?: (context: DeployContext) => Promise<void> | void; /** Per-environment deployment overrides. */
|
|
115
124
|
environments?: Partial<Record<DeployEnvironment, DeployEnvironmentConfig>>;
|
|
125
|
+
/**
|
|
126
|
+
* HTTP checks run against the application after deployment.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* defineConfig({
|
|
130
|
+
* deploy: {
|
|
131
|
+
* smokeChecks: [
|
|
132
|
+
* { name: "home", path: "/" },
|
|
133
|
+
* {
|
|
134
|
+
* name: "status page",
|
|
135
|
+
* url: "https://status.example.com/health",
|
|
136
|
+
* expectedStatus: [200, 204],
|
|
137
|
+
* },
|
|
138
|
+
* ],
|
|
139
|
+
* },
|
|
140
|
+
* })
|
|
141
|
+
*/
|
|
116
142
|
smokeChecks?: DeploySmokeCheck[];
|
|
143
|
+
/**
|
|
144
|
+
* Settings for generating and assigning staging hostnames.
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* defineConfig({
|
|
148
|
+
* deploy: {
|
|
149
|
+
* stagingHostname: {
|
|
150
|
+
* managedLabelPrefix: "review-",
|
|
151
|
+
* parentHostname: "staging.example.com",
|
|
152
|
+
* workerService: "example-api-staging",
|
|
153
|
+
* },
|
|
154
|
+
* },
|
|
155
|
+
* })
|
|
156
|
+
*/
|
|
117
157
|
stagingHostname?: StagingHostnameConfig;
|
|
118
|
-
tauriRelease?: TauriReleaseConfig;
|
|
119
158
|
};
|
|
120
159
|
declare function defineConfig(config: CoreframeConfig): CoreframeConfig;
|
|
121
160
|
declare function readProjectConfig({
|
|
@@ -126,4 +165,4 @@ declare function readProjectConfig({
|
|
|
126
165
|
declare function importProjectModule<T>(path: string, cwd?: string): Promise<T>;
|
|
127
166
|
declare function importProjectDependency<T>(specifier: string, cwd?: string): Promise<T>;
|
|
128
167
|
//#endregion
|
|
129
|
-
export { AssetsConfig, CoreframeConfig, DatabaseConfig, DatabaseDialect, DeployConfig, DeployContext, DeployEnvironment, DeployEnvironmentConfig, DeploySmokeCheck, DevConfig, DevPlatform, FlutterConfig, FlutterDeepLinkConfig, I18nConfig, JsonObject, JsonValue, PreviewConfig, PreviewTunnelConfig, PreviewWorkerConfig, PrimaryWorkerContributions, PrimaryWorkerEnvironment, StagingHostnameConfig,
|
|
168
|
+
export { AssetsConfig, CoreframeConfig, DatabaseConfig, DatabaseDialect, DeployConfig, DeployContext, DeployEnvironment, DeployEnvironmentConfig, 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 };
|