@geekmidas/cli 10.0.0-alpha.4 → 10.0.0-alpha.40
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/README.md +52 -74
- package/bin/adjacent-tsconfig.mjs +97 -0
- package/bin/gkm.mjs +7 -1
- package/dist/{HostingerProvider-h3EbEp-Z.cjs → HostingerProvider-BZFGYYVA.cjs} +21 -22
- package/dist/HostingerProvider-BZFGYYVA.cjs.map +1 -0
- package/dist/{HostingerProvider-Cft7lEYr.mjs → HostingerProvider-Bh6K7QYz.mjs} +20 -21
- package/dist/HostingerProvider-Bh6K7QYz.mjs.map +1 -0
- package/dist/{LocalStateProvider-Db9SEjyH.cjs → LocalStateProvider-7HR6SS2t.cjs} +11 -6
- package/dist/LocalStateProvider-7HR6SS2t.cjs.map +1 -0
- package/dist/{LocalStateProvider-Bn6tS-oL.mjs → LocalStateProvider-D7QyJoLM.mjs} +10 -4
- package/dist/LocalStateProvider-D7QyJoLM.mjs.map +1 -0
- package/dist/{openapi-CA0yJUTN.cjs → OpenApiTsGenerator-B4Kj_qNU.cjs} +142 -303
- package/dist/OpenApiTsGenerator-B4Kj_qNU.cjs.map +1 -0
- package/dist/{openapi-kkQbsRVj.mjs → OpenApiTsGenerator-CEh3EKN3.mjs} +113 -255
- package/dist/OpenApiTsGenerator-CEh3EKN3.mjs.map +1 -0
- package/dist/{Route53Provider-RdpUDJQk.mjs → Route53Provider-Cvj40A8I.mjs} +12 -12
- package/dist/Route53Provider-Cvj40A8I.mjs.map +1 -0
- package/dist/{Route53Provider-di2fMM5N.cjs → Route53Provider-DVILBsvV.cjs} +20 -21
- package/dist/Route53Provider-DVILBsvV.cjs.map +1 -0
- package/dist/{SSMStateProvider-BRt2py-A.mjs → SSMStateProvider-B0Hu1MKZ.mjs} +13 -4
- package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +1 -0
- package/dist/{SSMStateProvider-DyX8s9HI.cjs → SSMStateProvider-VrQ-yeqd.cjs} +17 -9
- package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +1 -0
- package/dist/aws-DkHdTV-p.cjs +61 -0
- package/dist/aws-DkHdTV-p.cjs.map +1 -0
- package/dist/aws-DojzQnLd.mjs +61 -0
- package/dist/aws-DojzQnLd.mjs.map +1 -0
- package/dist/{backup-provisioner-BrsHwYG0.cjs → backup-provisioner-BmhIO_Yr.cjs} +21 -19
- package/dist/backup-provisioner-BmhIO_Yr.cjs.map +1 -0
- package/dist/{backup-provisioner-Bgj5Vi_L.mjs → backup-provisioner-DIVCbfee.mjs} +10 -7
- package/dist/backup-provisioner-DIVCbfee.mjs.map +1 -0
- package/dist/{bundler-Be8Zg4Wd.mjs → bundler--fyybf1N.mjs} +19 -30
- package/dist/bundler--fyybf1N.mjs.map +1 -0
- package/dist/{bundler-BY1OmV1e.cjs → bundler-By6_sXiL.cjs} +20 -32
- package/dist/bundler-By6_sXiL.cjs.map +1 -0
- package/dist/{config-WRdsQYZK.mjs → config-5watB1D0.mjs} +142 -154
- package/dist/config-5watB1D0.mjs.map +1 -0
- package/dist/{config-C21ocYNd.cjs → config-CJ-PAb7M.cjs} +209 -210
- package/dist/config-CJ-PAb7M.cjs.map +1 -0
- package/dist/config.cjs +9 -6
- package/dist/config.d.cts +62 -33
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +62 -33
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +3 -5
- package/dist/deploy/sniffer-envkit-patch.cjs +18 -10
- package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.d.cts +0 -2
- package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.d.mts +0 -2
- package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.mjs +10 -2
- package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
- package/dist/deploy/sniffer-hooks.cjs +13 -7
- package/dist/deploy/sniffer-hooks.cjs.map +1 -1
- package/dist/deploy/sniffer-hooks.d.cts +1 -2
- package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
- package/dist/deploy/sniffer-hooks.d.mts +1 -2
- package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
- package/dist/deploy/sniffer-hooks.mjs +9 -2
- package/dist/deploy/sniffer-hooks.mjs.map +1 -1
- package/dist/deploy/sniffer-loader.cjs +16 -7
- package/dist/deploy/sniffer-loader.cjs.map +1 -1
- package/dist/deploy/sniffer-loader.d.cts +1 -1
- package/dist/deploy/sniffer-loader.d.mts +1 -1
- package/dist/deploy/sniffer-loader.mjs +13 -2
- package/dist/deploy/sniffer-loader.mjs.map +1 -1
- package/dist/deploy/sniffer-routes-worker.cjs +11 -11
- package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
- package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
- package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
- package/dist/deploy/sniffer-routes-worker.mjs +3 -3
- package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
- package/dist/deploy/sniffer-worker.cjs +15 -6
- package/dist/deploy/sniffer-worker.cjs.map +1 -1
- package/dist/deploy/sniffer-worker.d.cts +1 -3
- package/dist/deploy/sniffer-worker.d.cts.map +1 -1
- package/dist/deploy/sniffer-worker.d.mts +1 -3
- package/dist/deploy/sniffer-worker.d.mts.map +1 -1
- package/dist/deploy/sniffer-worker.mjs +15 -4
- package/dist/deploy/sniffer-worker.mjs.map +1 -1
- package/dist/{discover-DTmFeloL.cjs → discover-B0f_kuNN.cjs} +118 -66
- package/dist/discover-B0f_kuNN.cjs.map +1 -0
- package/dist/{discover-CAlFgYec.mjs → discover-BLhf7V_J.mjs} +67 -22
- package/dist/discover-BLhf7V_J.mjs.map +1 -0
- package/dist/{emit-CbcRolsa.cjs → emit-BdoPFjZf.cjs} +53 -36
- package/dist/emit-BdoPFjZf.cjs.map +1 -0
- package/dist/{emit-CiZS_5Ub.mjs → emit-Bzq7JsMP.mjs} +24 -6
- package/dist/emit-Bzq7JsMP.mjs.map +1 -0
- package/dist/github-BAr8WGkR.cjs +213 -0
- package/dist/github-BAr8WGkR.cjs.map +1 -0
- package/dist/github-D5MthUlR.mjs +213 -0
- package/dist/github-D5MthUlR.mjs.map +1 -0
- package/dist/{index-DCtipn2h.d.cts → index-B3PeGOQp.d.cts} +4 -23
- package/dist/index-B3PeGOQp.d.cts.map +1 -0
- package/dist/{index-BThUzEIp.d.mts → index-BOyaGcCm.d.mts} +4 -23
- package/dist/index-BOyaGcCm.d.mts.map +1 -0
- package/dist/index.cjs +7071 -4519
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +7117 -4586
- package/dist/index.mjs.map +1 -1
- package/dist/migrate-BVI3yqcE.mjs +736 -0
- package/dist/migrate-BVI3yqcE.mjs.map +1 -0
- package/dist/migrate-CFOUApUt.cjs +743 -0
- package/dist/migrate-CFOUApUt.cjs.map +1 -0
- package/dist/openapi.cjs +197 -8
- package/dist/openapi.cjs.map +1 -0
- package/dist/openapi.d.cts +47 -14
- package/dist/openapi.d.cts.map +1 -1
- package/dist/openapi.d.mts +47 -14
- package/dist/openapi.d.mts.map +1 -1
- package/dist/openapi.mjs +191 -5
- package/dist/openapi.mjs.map +1 -0
- package/dist/ready-D8UXsP6q.mjs +516 -0
- package/dist/ready-D8UXsP6q.mjs.map +1 -0
- package/dist/ready-mcxamf73.cjs +563 -0
- package/dist/ready-mcxamf73.cjs.map +1 -0
- package/dist/reconcile/public.cjs +4 -4
- package/dist/reconcile/public.d.cts +27 -26
- package/dist/reconcile/public.d.cts.map +1 -1
- package/dist/reconcile/public.d.mts +27 -26
- package/dist/reconcile/public.d.mts.map +1 -1
- package/dist/reconcile/public.mjs +3 -4
- package/dist/{reconcile-CFs8C_1a.mjs → reconcile--I7V4Klj.mjs} +4 -7
- package/dist/reconcile--I7V4Klj.mjs.map +1 -0
- package/dist/{reconcile-D0pimNiy.cjs → reconcile-CuCQBa5-.cjs} +5 -8
- package/dist/reconcile-CuCQBa5-.cjs.map +1 -0
- package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
- package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
- package/dist/storage-BzaUxmqe.mjs +124 -0
- package/dist/storage-BzaUxmqe.mjs.map +1 -0
- package/dist/storage-CSGoC3bK.cjs +152 -0
- package/dist/storage-CSGoC3bK.cjs.map +1 -0
- package/dist/store-DQgxT_WR.cjs +211 -0
- package/dist/store-DQgxT_WR.cjs.map +1 -0
- package/dist/store-DeGATCS-.mjs +182 -0
- package/dist/store-DeGATCS-.mjs.map +1 -0
- package/dist/types-0R124hrY.d.mts +6324 -0
- package/dist/types-0R124hrY.d.mts.map +1 -0
- package/dist/types-DfdYe31u.d.cts +6325 -0
- package/dist/types-DfdYe31u.d.cts.map +1 -0
- package/dist/vitest.cjs +65 -0
- package/dist/vitest.cjs.map +1 -0
- package/dist/vitest.d.cts +29 -0
- package/dist/vitest.d.cts.map +1 -0
- package/dist/vitest.d.mts +29 -0
- package/dist/vitest.d.mts.map +1 -0
- package/dist/vitest.mjs +65 -0
- package/dist/vitest.mjs.map +1 -0
- package/dist/workspace/index.cjs +3 -4
- package/dist/workspace/index.d.cts +3 -3
- package/dist/workspace/index.d.mts +3 -3
- package/dist/workspace/index.mjs +2 -3
- package/dist/{credentials-G1JwBoXH.cjs → workspace-BIqeeqcR.cjs} +2248 -1809
- package/dist/workspace-BIqeeqcR.cjs.map +1 -0
- package/dist/{workspace-BFMrAKqI.mjs → workspace-DOmIhiau.mjs} +863 -952
- package/dist/workspace-DOmIhiau.mjs.map +1 -0
- package/dist/{credentials-BBIRJVp4.mjs → workspace-DwS1JK5u.mjs} +2114 -1706
- package/dist/workspace-DwS1JK5u.mjs.map +1 -0
- package/dist/{workspace-BcucjwvA.cjs → workspace-RYSYtHP7.cjs} +1032 -1098
- package/dist/workspace-RYSYtHP7.cjs.map +1 -0
- package/package.json +29 -20
- package/dist/CachedStateProvider-BLo7zv7S.cjs +0 -3
- package/dist/CachedStateProvider-BxoAm-B2.mjs +0 -3
- package/dist/CachedStateProvider-CqPdW7CB.cjs +0 -60
- package/dist/CachedStateProvider-CqPdW7CB.cjs.map +0 -1
- package/dist/CachedStateProvider-DTniehMP.mjs +0 -54
- package/dist/CachedStateProvider-DTniehMP.mjs.map +0 -1
- package/dist/HostingerProvider-Cft7lEYr.mjs.map +0 -1
- package/dist/HostingerProvider-h3EbEp-Z.cjs.map +0 -1
- package/dist/LocalStateProvider-Bn6tS-oL.mjs.map +0 -1
- package/dist/LocalStateProvider-Db9SEjyH.cjs.map +0 -1
- package/dist/Route53Provider-RdpUDJQk.mjs.map +0 -1
- package/dist/Route53Provider-di2fMM5N.cjs.map +0 -1
- package/dist/SSMStateProvider-BRt2py-A.mjs.map +0 -1
- package/dist/SSMStateProvider-DyX8s9HI.cjs.map +0 -1
- package/dist/backup-provisioner-Bgj5Vi_L.mjs.map +0 -1
- package/dist/backup-provisioner-BrsHwYG0.cjs.map +0 -1
- package/dist/bundler-BY1OmV1e.cjs.map +0 -1
- package/dist/bundler-Be8Zg4Wd.mjs.map +0 -1
- package/dist/chunk-Duj1WY3L.mjs +0 -7
- package/dist/config-C21ocYNd.cjs.map +0 -1
- package/dist/config-WRdsQYZK.mjs.map +0 -1
- package/dist/credentials-B5zRHdAl.mjs +0 -141
- package/dist/credentials-B5zRHdAl.mjs.map +0 -1
- package/dist/credentials-BBIRJVp4.mjs.map +0 -1
- package/dist/credentials-BapzjyV5.cjs +0 -195
- package/dist/credentials-BapzjyV5.cjs.map +0 -1
- package/dist/credentials-G1JwBoXH.cjs.map +0 -1
- package/dist/discover-CAlFgYec.mjs.map +0 -1
- package/dist/discover-DTmFeloL.cjs.map +0 -1
- package/dist/dokploy-api-BS2xnJLZ.mjs +0 -3
- package/dist/dokploy-api-BsVH0y_s.cjs +0 -718
- package/dist/dokploy-api-BsVH0y_s.cjs.map +0 -1
- package/dist/dokploy-api-BuxDRo3l.cjs +0 -3
- package/dist/dokploy-api-aTFPz7_4.mjs +0 -706
- package/dist/dokploy-api-aTFPz7_4.mjs.map +0 -1
- package/dist/emit-CbcRolsa.cjs.map +0 -1
- package/dist/emit-CiZS_5Ub.mjs.map +0 -1
- package/dist/encryption-C6jaU0hE.cjs +0 -54
- package/dist/encryption-C6jaU0hE.cjs.map +0 -1
- package/dist/encryption-CHzzeR8a.cjs +0 -4
- package/dist/encryption-CQUncu7v.mjs +0 -3
- package/dist/encryption-D-abyhZx.mjs +0 -42
- package/dist/encryption-D-abyhZx.mjs.map +0 -1
- package/dist/fullstack-secrets-C-GGohke.cjs +0 -111
- package/dist/fullstack-secrets-C-GGohke.cjs.map +0 -1
- package/dist/fullstack-secrets-D1o9-G5l.mjs +0 -87
- package/dist/fullstack-secrets-D1o9-G5l.mjs.map +0 -1
- package/dist/generator-CNzBw7g5.cjs +0 -289
- package/dist/generator-CNzBw7g5.cjs.map +0 -1
- package/dist/generator-VE2JrFlY.mjs +0 -253
- package/dist/generator-VE2JrFlY.mjs.map +0 -1
- package/dist/index-BThUzEIp.d.mts.map +0 -1
- package/dist/index-DCtipn2h.d.cts.map +0 -1
- package/dist/openapi-CA0yJUTN.cjs.map +0 -1
- package/dist/openapi-kkQbsRVj.mjs.map +0 -1
- package/dist/openapi-react-query-Byltvm_7.mjs +0 -167
- package/dist/openapi-react-query-Byltvm_7.mjs.map +0 -1
- package/dist/openapi-react-query-CmJ1xDbn.cjs +0 -173
- package/dist/openapi-react-query-CmJ1xDbn.cjs.map +0 -1
- package/dist/openapi-react-query.cjs +0 -4
- package/dist/openapi-react-query.d.cts +0 -11
- package/dist/openapi-react-query.d.cts.map +0 -1
- package/dist/openapi-react-query.d.mts +0 -11
- package/dist/openapi-react-query.d.mts.map +0 -1
- package/dist/openapi-react-query.mjs +0 -4
- package/dist/reconcile-CFs8C_1a.mjs.map +0 -1
- package/dist/reconcile-D0pimNiy.cjs.map +0 -1
- package/dist/setup-B5_oHHUj.cjs +0 -11
- package/dist/setup-Cm2UnAdh.cjs +0 -473
- package/dist/setup-Cm2UnAdh.cjs.map +0 -1
- package/dist/setup-DXvRLTZN.mjs +0 -443
- package/dist/setup-DXvRLTZN.mjs.map +0 -1
- package/dist/setup-ZijS4qeC.mjs +0 -11
- package/dist/storage-BJmzYxt8.cjs +0 -363
- package/dist/storage-BJmzYxt8.cjs.map +0 -1
- package/dist/storage-BM9hGpgv.cjs +0 -7
- package/dist/storage-Bi24WfoW.mjs +0 -297
- package/dist/storage-Bi24WfoW.mjs.map +0 -1
- package/dist/storage-CYlGwWTj.mjs +0 -3
- package/dist/sync-CmEuNZsB.mjs +0 -76
- package/dist/sync-CmEuNZsB.mjs.map +0 -1
- package/dist/sync-D306yOWu.cjs +0 -4
- package/dist/sync-SizaChmC.cjs +0 -93
- package/dist/sync-SizaChmC.cjs.map +0 -1
- package/dist/sync-hOqAWHR6.mjs +0 -3
- package/dist/types-BhIl-COG.d.cts +0 -2184
- package/dist/types-BhIl-COG.d.cts.map +0 -1
- package/dist/types-C-arnQ1r.d.mts +0 -2184
- package/dist/types-C-arnQ1r.d.mts.map +0 -1
- package/dist/workspace-BFMrAKqI.mjs.map +0 -1
- package/dist/workspace-BcucjwvA.cjs.map +0 -1
- package/dist/workspace-DdJss8I6.cjs +0 -9
- package/dist/workspace-k4l3rsFh.mjs +0 -8
package/dist/config.d.cts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defineWorkspace } from "./index-
|
|
3
|
-
|
|
1
|
+
import { S as WorkspaceConfig, g as LoadedConfig, r as GkmConfig, v as NormalizedAppConfig, y as NormalizedWorkspace } from "./types-DfdYe31u.cjs";
|
|
2
|
+
import { i as defineWorkspace } from "./index-B3PeGOQp.cjs";
|
|
4
3
|
//#region src/config.d.ts
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Define GKM configuration with full TypeScript support.
|
|
8
6
|
* This is an identity function that provides type safety and autocomplete.
|
|
@@ -20,8 +18,8 @@ import { defineWorkspace } from "./index-DCtipn2h.cjs";
|
|
|
20
18
|
* });
|
|
21
19
|
* ```
|
|
22
20
|
*/
|
|
23
|
-
declare function defineConfig(config: GkmConfig): GkmConfig;
|
|
24
|
-
interface ParsedModuleConfig {
|
|
21
|
+
export declare function defineConfig(config: GkmConfig): GkmConfig;
|
|
22
|
+
export interface ParsedModuleConfig {
|
|
25
23
|
path: string;
|
|
26
24
|
importPattern: string;
|
|
27
25
|
}
|
|
@@ -42,28 +40,23 @@ interface ParsedModuleConfig {
|
|
|
42
40
|
* parseModuleConfig('./src/config/env#myEnv', 'envParser')
|
|
43
41
|
* // { path: './src/config/env', importPattern: '{ myEnv as envParser }' }
|
|
44
42
|
*/
|
|
45
|
-
declare function parseModuleConfig(configString: string, defaultAlias: string): ParsedModuleConfig;
|
|
46
|
-
interface ConfigDiscoveryResult {
|
|
43
|
+
export declare function parseModuleConfig(configString: string, defaultAlias: string): ParsedModuleConfig;
|
|
44
|
+
export interface ConfigDiscoveryResult {
|
|
47
45
|
configPath: string;
|
|
48
46
|
workspaceRoot: string;
|
|
49
47
|
}
|
|
50
|
-
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
* getAppNameFromCwd('/path/to/apps/api')
|
|
56
|
-
* // package.json: { "name": "@myorg/api" }
|
|
57
|
-
* // Returns: 'api'
|
|
58
|
-
*/
|
|
59
|
-
declare function getAppNameFromCwd(cwd?: string): string | null;
|
|
48
|
+
/** No gkm config in a directory or any of its parents. */
|
|
49
|
+
export declare class ConfigNotFound extends Error {
|
|
50
|
+
readonly cwd: string;
|
|
51
|
+
constructor(cwd: string);
|
|
52
|
+
}
|
|
60
53
|
/**
|
|
61
54
|
* Load configuration file (single-app format).
|
|
62
55
|
* For backwards compatibility with existing code.
|
|
63
56
|
*
|
|
64
57
|
* @deprecated Use loadWorkspaceConfig for new code
|
|
65
58
|
*/
|
|
66
|
-
declare function loadConfig(cwd?: string): Promise<GkmConfig>;
|
|
59
|
+
export declare function loadConfig(cwd?: string): Promise<GkmConfig>;
|
|
67
60
|
/**
|
|
68
61
|
* Load configuration file and process it as a workspace.
|
|
69
62
|
* Works with both single-app and workspace configurations.
|
|
@@ -81,8 +74,29 @@ declare function loadConfig(cwd?: string): Promise<GkmConfig>;
|
|
|
81
74
|
* }
|
|
82
75
|
* ```
|
|
83
76
|
*/
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
/**
|
|
78
|
+
* The workspace a directory belongs to, as its config states it — without
|
|
79
|
+
* discovering its constructs.
|
|
80
|
+
*
|
|
81
|
+
* For callers that need a fact the config holds (where a stage's secrets are
|
|
82
|
+
* stored) and nothing the graph adds. `loadWorkspaceConfig` imports every
|
|
83
|
+
* construct module to derive the apps, which is a cost a secrets read should
|
|
84
|
+
* not pay.
|
|
85
|
+
*/
|
|
86
|
+
export declare function loadWorkspaceSettings(cwd?: string): Promise<LoadedConfig['workspace']>;
|
|
87
|
+
export declare function loadWorkspaceConfig(cwd?: string): Promise<LoadedConfig>;
|
|
88
|
+
/**
|
|
89
|
+
* A workspace with no `constructs` glob.
|
|
90
|
+
*
|
|
91
|
+
* In v10 every address, container and app comes from what the workspace
|
|
92
|
+
* declares — there is no second path that reads a hand-written compose file or
|
|
93
|
+
* an `apps` block's ports. A config that declares nothing has nothing to run.
|
|
94
|
+
*/
|
|
95
|
+
export declare class WorkspaceDeclaresNoConstructs extends Error {
|
|
96
|
+
readonly root: string;
|
|
97
|
+
constructor(root: string);
|
|
98
|
+
}
|
|
99
|
+
export interface AppConfigResult {
|
|
86
100
|
appName: string;
|
|
87
101
|
app: NormalizedAppConfig;
|
|
88
102
|
gkmConfig: GkmConfig;
|
|
@@ -90,31 +104,46 @@ interface AppConfigResult {
|
|
|
90
104
|
workspaceRoot: string;
|
|
91
105
|
appRoot: string;
|
|
92
106
|
}
|
|
107
|
+
/** A directory that no app in the workspace lives in. */
|
|
108
|
+
export declare class NotInAnApp extends Error {
|
|
109
|
+
readonly cwd: string;
|
|
110
|
+
readonly apps: Readonly<Record<string, string>>;
|
|
111
|
+
constructor(cwd: string, apps: Readonly<Record<string, string>>);
|
|
112
|
+
}
|
|
93
113
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
114
|
+
* The backend app a directory is part of, with its gkm config — found by the
|
|
115
|
+
* `path` its construct declares.
|
|
96
116
|
*
|
|
97
117
|
* @example
|
|
98
118
|
* ```ts
|
|
99
|
-
* // From apps/api
|
|
119
|
+
* // From apps/api, where a construct declares `path: 'apps/api'`
|
|
100
120
|
* const { app, workspace, workspaceRoot } = await loadAppConfig();
|
|
101
|
-
* console.log(app.routes); // './src/endpoints/**\/*.ts'
|
|
102
121
|
* ```
|
|
122
|
+
*
|
|
123
|
+
* @throws {NotInAnApp} when no app's path contains the directory.
|
|
124
|
+
* @throws {NotABackendApp} when the app it is in has no gkm config to run.
|
|
103
125
|
*/
|
|
104
|
-
declare function loadAppConfig(cwd?: string): Promise<AppConfigResult>;
|
|
105
|
-
|
|
126
|
+
export declare function loadAppConfig(cwd?: string): Promise<AppConfigResult>;
|
|
127
|
+
/** The app a directory is in has no gkm config — a site, or an entry app. */
|
|
128
|
+
export declare class NotABackendApp extends Error {
|
|
129
|
+
readonly appName: string;
|
|
130
|
+
constructor(appName: string);
|
|
131
|
+
}
|
|
132
|
+
export interface WorkspaceAppInfo {
|
|
133
|
+
/** The app's key in the workspace. */
|
|
106
134
|
appName: string;
|
|
107
135
|
app: NormalizedAppConfig;
|
|
108
136
|
workspace: NormalizedWorkspace;
|
|
109
137
|
workspaceRoot: string;
|
|
110
138
|
}
|
|
111
139
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
140
|
+
* The app a directory is part of, frontend or backend — found by the `path`
|
|
141
|
+
* its construct declares. Unlike `loadAppConfig`, the app need not have a
|
|
142
|
+
* gkm config, which is what `gkm exec` and `gkm test` from a site need.
|
|
143
|
+
*
|
|
144
|
+
* @throws {NotInAnApp} when no app's path contains the directory.
|
|
115
145
|
*/
|
|
116
|
-
declare function loadWorkspaceAppInfo(cwd?: string): Promise<WorkspaceAppInfo>;
|
|
117
|
-
//# sourceMappingURL=config.d.ts.map
|
|
146
|
+
export declare function loadWorkspaceAppInfo(cwd?: string): Promise<WorkspaceAppInfo>;
|
|
118
147
|
//#endregion
|
|
119
|
-
export {
|
|
148
|
+
export { type GkmConfig, type LoadedConfig, type WorkspaceConfig, defineWorkspace };
|
|
120
149
|
//# sourceMappingURL=config.d.cts.map
|
package/dist/config.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.cts","names":[],"sources":["../src/config.ts"],"
|
|
1
|
+
{"version":3,"file":"config.d.cts","names":[],"sources":["../src/config.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;wBAoCgB,aAAa,QAAQ,YAAY;iBAIhC;EAChB;EACA;;;;;;;;;;;;;;;;;;;wBAoBe,kBACf,sBACA,uBACE;iBAac;EAChB;EACA;;;qBA2CY,uBAAuB;WACd;EAArB,YAAqB;;;;;;;;wBAoCA,WACrB,eACE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAuCW,sBACrB,eACE,QAAQ;wBAKW,oBACrB,eACE,QAAQ;;;;;;;;qBA4DE,sCAAsC;WAC7B;EAArB,YAAqB;;iBAWL;EAChB;EACA,KAAK;EACL,WAAW;EACX,WAAW;EACX;EACA;;;qBAqCY,mBAAmB;WAErB;WACA,MAAM,SAAS;EAFzB,YACU,aACA,MAAM,SAAS;;;;;;;;;;;;;;;wBAoCJ,cACrB,eACE,QAAQ;;qBAkBE,uBAAuB;WACd;EAArB,YAAqB;;iBAQL;;EAEhB;EACA,KAAK;EACL,WAAW;EACX;;;;;;;;;wBAUqB,qBACrB,eACE,QAAQ"}
|
package/dist/config.d.mts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defineWorkspace } from "./index-
|
|
3
|
-
|
|
1
|
+
import { S as WorkspaceConfig, g as LoadedConfig, r as GkmConfig, v as NormalizedAppConfig, y as NormalizedWorkspace } from "./types-0R124hrY.mjs";
|
|
2
|
+
import { i as defineWorkspace } from "./index-BOyaGcCm.mjs";
|
|
4
3
|
//#region src/config.d.ts
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Define GKM configuration with full TypeScript support.
|
|
8
6
|
* This is an identity function that provides type safety and autocomplete.
|
|
@@ -20,8 +18,8 @@ import { defineWorkspace } from "./index-BThUzEIp.mjs";
|
|
|
20
18
|
* });
|
|
21
19
|
* ```
|
|
22
20
|
*/
|
|
23
|
-
declare function defineConfig(config: GkmConfig): GkmConfig;
|
|
24
|
-
interface ParsedModuleConfig {
|
|
21
|
+
export declare function defineConfig(config: GkmConfig): GkmConfig;
|
|
22
|
+
export interface ParsedModuleConfig {
|
|
25
23
|
path: string;
|
|
26
24
|
importPattern: string;
|
|
27
25
|
}
|
|
@@ -42,28 +40,23 @@ interface ParsedModuleConfig {
|
|
|
42
40
|
* parseModuleConfig('./src/config/env#myEnv', 'envParser')
|
|
43
41
|
* // { path: './src/config/env', importPattern: '{ myEnv as envParser }' }
|
|
44
42
|
*/
|
|
45
|
-
declare function parseModuleConfig(configString: string, defaultAlias: string): ParsedModuleConfig;
|
|
46
|
-
interface ConfigDiscoveryResult {
|
|
43
|
+
export declare function parseModuleConfig(configString: string, defaultAlias: string): ParsedModuleConfig;
|
|
44
|
+
export interface ConfigDiscoveryResult {
|
|
47
45
|
configPath: string;
|
|
48
46
|
workspaceRoot: string;
|
|
49
47
|
}
|
|
50
|
-
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
* getAppNameFromCwd('/path/to/apps/api')
|
|
56
|
-
* // package.json: { "name": "@myorg/api" }
|
|
57
|
-
* // Returns: 'api'
|
|
58
|
-
*/
|
|
59
|
-
declare function getAppNameFromCwd(cwd?: string): string | null;
|
|
48
|
+
/** No gkm config in a directory or any of its parents. */
|
|
49
|
+
export declare class ConfigNotFound extends Error {
|
|
50
|
+
readonly cwd: string;
|
|
51
|
+
constructor(cwd: string);
|
|
52
|
+
}
|
|
60
53
|
/**
|
|
61
54
|
* Load configuration file (single-app format).
|
|
62
55
|
* For backwards compatibility with existing code.
|
|
63
56
|
*
|
|
64
57
|
* @deprecated Use loadWorkspaceConfig for new code
|
|
65
58
|
*/
|
|
66
|
-
declare function loadConfig(cwd?: string): Promise<GkmConfig>;
|
|
59
|
+
export declare function loadConfig(cwd?: string): Promise<GkmConfig>;
|
|
67
60
|
/**
|
|
68
61
|
* Load configuration file and process it as a workspace.
|
|
69
62
|
* Works with both single-app and workspace configurations.
|
|
@@ -81,8 +74,29 @@ declare function loadConfig(cwd?: string): Promise<GkmConfig>;
|
|
|
81
74
|
* }
|
|
82
75
|
* ```
|
|
83
76
|
*/
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
/**
|
|
78
|
+
* The workspace a directory belongs to, as its config states it — without
|
|
79
|
+
* discovering its constructs.
|
|
80
|
+
*
|
|
81
|
+
* For callers that need a fact the config holds (where a stage's secrets are
|
|
82
|
+
* stored) and nothing the graph adds. `loadWorkspaceConfig` imports every
|
|
83
|
+
* construct module to derive the apps, which is a cost a secrets read should
|
|
84
|
+
* not pay.
|
|
85
|
+
*/
|
|
86
|
+
export declare function loadWorkspaceSettings(cwd?: string): Promise<LoadedConfig['workspace']>;
|
|
87
|
+
export declare function loadWorkspaceConfig(cwd?: string): Promise<LoadedConfig>;
|
|
88
|
+
/**
|
|
89
|
+
* A workspace with no `constructs` glob.
|
|
90
|
+
*
|
|
91
|
+
* In v10 every address, container and app comes from what the workspace
|
|
92
|
+
* declares — there is no second path that reads a hand-written compose file or
|
|
93
|
+
* an `apps` block's ports. A config that declares nothing has nothing to run.
|
|
94
|
+
*/
|
|
95
|
+
export declare class WorkspaceDeclaresNoConstructs extends Error {
|
|
96
|
+
readonly root: string;
|
|
97
|
+
constructor(root: string);
|
|
98
|
+
}
|
|
99
|
+
export interface AppConfigResult {
|
|
86
100
|
appName: string;
|
|
87
101
|
app: NormalizedAppConfig;
|
|
88
102
|
gkmConfig: GkmConfig;
|
|
@@ -90,31 +104,46 @@ interface AppConfigResult {
|
|
|
90
104
|
workspaceRoot: string;
|
|
91
105
|
appRoot: string;
|
|
92
106
|
}
|
|
107
|
+
/** A directory that no app in the workspace lives in. */
|
|
108
|
+
export declare class NotInAnApp extends Error {
|
|
109
|
+
readonly cwd: string;
|
|
110
|
+
readonly apps: Readonly<Record<string, string>>;
|
|
111
|
+
constructor(cwd: string, apps: Readonly<Record<string, string>>);
|
|
112
|
+
}
|
|
93
113
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
114
|
+
* The backend app a directory is part of, with its gkm config — found by the
|
|
115
|
+
* `path` its construct declares.
|
|
96
116
|
*
|
|
97
117
|
* @example
|
|
98
118
|
* ```ts
|
|
99
|
-
* // From apps/api
|
|
119
|
+
* // From apps/api, where a construct declares `path: 'apps/api'`
|
|
100
120
|
* const { app, workspace, workspaceRoot } = await loadAppConfig();
|
|
101
|
-
* console.log(app.routes); // './src/endpoints/**\/*.ts'
|
|
102
121
|
* ```
|
|
122
|
+
*
|
|
123
|
+
* @throws {NotInAnApp} when no app's path contains the directory.
|
|
124
|
+
* @throws {NotABackendApp} when the app it is in has no gkm config to run.
|
|
103
125
|
*/
|
|
104
|
-
declare function loadAppConfig(cwd?: string): Promise<AppConfigResult>;
|
|
105
|
-
|
|
126
|
+
export declare function loadAppConfig(cwd?: string): Promise<AppConfigResult>;
|
|
127
|
+
/** The app a directory is in has no gkm config — a site, or an entry app. */
|
|
128
|
+
export declare class NotABackendApp extends Error {
|
|
129
|
+
readonly appName: string;
|
|
130
|
+
constructor(appName: string);
|
|
131
|
+
}
|
|
132
|
+
export interface WorkspaceAppInfo {
|
|
133
|
+
/** The app's key in the workspace. */
|
|
106
134
|
appName: string;
|
|
107
135
|
app: NormalizedAppConfig;
|
|
108
136
|
workspace: NormalizedWorkspace;
|
|
109
137
|
workspaceRoot: string;
|
|
110
138
|
}
|
|
111
139
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
140
|
+
* The app a directory is part of, frontend or backend — found by the `path`
|
|
141
|
+
* its construct declares. Unlike `loadAppConfig`, the app need not have a
|
|
142
|
+
* gkm config, which is what `gkm exec` and `gkm test` from a site need.
|
|
143
|
+
*
|
|
144
|
+
* @throws {NotInAnApp} when no app's path contains the directory.
|
|
115
145
|
*/
|
|
116
|
-
declare function loadWorkspaceAppInfo(cwd?: string): Promise<WorkspaceAppInfo>;
|
|
117
|
-
//# sourceMappingURL=config.d.ts.map
|
|
146
|
+
export declare function loadWorkspaceAppInfo(cwd?: string): Promise<WorkspaceAppInfo>;
|
|
118
147
|
//#endregion
|
|
119
|
-
export {
|
|
148
|
+
export { type GkmConfig, type LoadedConfig, type WorkspaceConfig, defineWorkspace };
|
|
120
149
|
//# sourceMappingURL=config.d.mts.map
|
package/dist/config.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.mts","names":[],"sources":["../src/config.ts"],"
|
|
1
|
+
{"version":3,"file":"config.d.mts","names":[],"sources":["../src/config.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;wBAoCgB,aAAa,QAAQ,YAAY;iBAIhC;EAChB;EACA;;;;;;;;;;;;;;;;;;;wBAoBe,kBACf,sBACA,uBACE;iBAac;EAChB;EACA;;;qBA2CY,uBAAuB;WACd;EAArB,YAAqB;;;;;;;;wBAoCA,WACrB,eACE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAuCW,sBACrB,eACE,QAAQ;wBAKW,oBACrB,eACE,QAAQ;;;;;;;;qBA4DE,sCAAsC;WAC7B;EAArB,YAAqB;;iBAWL;EAChB;EACA,KAAK;EACL,WAAW;EACX,WAAW;EACX;EACA;;;qBAqCY,mBAAmB;WAErB;WACA,MAAM,SAAS;EAFzB,YACU,aACA,MAAM,SAAS;;;;;;;;;;;;;;;wBAoCJ,cACrB,eACE,QAAQ;;qBAkBE,uBAAuB;WACd;EAArB,YAAqB;;iBAQL;;EAEhB;EACA,KAAK;EACL,WAAW;EACX;;;;;;;;;wBAUqB,qBACrB,eACE,QAAQ"}
|
package/dist/config.mjs
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { defineConfig, defineWorkspace, getAppNameFromCwd, loadAppConfig, loadConfig, loadWorkspaceAppInfo, loadWorkspaceConfig, parseModuleConfig };
|
|
1
|
+
import { a as defineConfig, c as loadWorkspaceAppInfo, d as parseModuleConfig, i as WorkspaceDeclaresNoConstructs, l as loadWorkspaceConfig, n as NotABackendApp, o as loadAppConfig, r as NotInAnApp, s as loadConfig, t as ConfigNotFound, u as loadWorkspaceSettings } from "./config-5watB1D0.mjs";
|
|
2
|
+
import { i as defineWorkspace } from "./workspace-DOmIhiau.mjs";
|
|
3
|
+
export { ConfigNotFound, NotABackendApp, NotInAnApp, WorkspaceDeclaresNoConstructs, defineConfig, defineWorkspace, loadAppConfig, loadConfig, loadWorkspaceAppInfo, loadWorkspaceConfig, loadWorkspaceSettings, parseModuleConfig };
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _geekmidas_envkit_sniffer = require("@geekmidas/envkit/sniffer");
|
|
4
3
|
//#region src/deploy/sniffer-envkit-patch.ts
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Patched @geekmidas/envkit module for entry app sniffing.
|
|
6
|
+
*
|
|
7
|
+
* This module re-exports the SnifferEnvironmentParser as EnvironmentParser,
|
|
8
|
+
* allowing entry apps to be imported while capturing their env var usage.
|
|
9
|
+
*
|
|
10
|
+
* The actual sniffer instance is stored in globalThis.__envSniffer
|
|
11
|
+
* so the worker script can retrieve the captured variables.
|
|
12
|
+
*/
|
|
13
|
+
if (!globalThis.__envSniffer) globalThis.__envSniffer = new _geekmidas_envkit_sniffer.SnifferEnvironmentParser();
|
|
6
14
|
/**
|
|
7
15
|
* Patched EnvironmentParser that uses the global sniffer instance.
|
|
8
16
|
*
|
|
@@ -15,13 +23,13 @@ var PatchedEnvironmentParser = class {
|
|
|
15
23
|
return globalThis.__envSniffer.create(builder);
|
|
16
24
|
}
|
|
17
25
|
};
|
|
18
|
-
|
|
19
26
|
//#endregion
|
|
20
27
|
exports.EnvironmentParser = PatchedEnvironmentParser;
|
|
21
|
-
Object.defineProperty(exports,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
Object.defineProperty(exports, "SnifferEnvironmentParser", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function() {
|
|
31
|
+
return _geekmidas_envkit_sniffer.SnifferEnvironmentParser;
|
|
32
|
+
}
|
|
26
33
|
});
|
|
34
|
+
|
|
27
35
|
//# sourceMappingURL=sniffer-envkit-patch.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-envkit-patch.cjs","names":["SnifferEnvironmentParser"
|
|
1
|
+
{"version":3,"file":"sniffer-envkit-patch.cjs","names":["SnifferEnvironmentParser"],"sources":["../../src/deploy/sniffer-envkit-patch.ts"],"sourcesContent":["/**\n * Patched @geekmidas/envkit module for entry app sniffing.\n *\n * This module re-exports the SnifferEnvironmentParser as EnvironmentParser,\n * allowing entry apps to be imported while capturing their env var usage.\n *\n * The actual sniffer instance is stored in globalThis.__envSniffer\n * so the worker script can retrieve the captured variables.\n */\n\nimport { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n\n// Extend globalThis type for the sniffer instance\ndeclare global {\n\t// eslint-disable-next-line no-var\n\tvar __envSniffer: SnifferEnvironmentParser | undefined;\n}\n\n// Create a shared sniffer instance that will be used by all imports\n// This is stored globally so the worker script can access it\nif (!globalThis.__envSniffer) {\n\tglobalThis.__envSniffer = new SnifferEnvironmentParser();\n}\n\n// Type for the config parser returned by create()\ninterface ConfigParser<T> {\n\tparse(): T;\n\tsafeParse(): { success: true; data: T } | { success: false; error: Error };\n}\n\n// Type for the env fetcher function\ntype EnvFetcher = (name: string) => {\n\tstring(): { parse(): string; safeParse(): unknown };\n\tnumber(): { parse(): number; safeParse(): unknown };\n\tboolean(): { parse(): boolean; safeParse(): unknown };\n\toptional(): EnvFetcher;\n\tdefault(value: unknown): EnvFetcher;\n};\n\n/**\n * Patched EnvironmentParser that uses the global sniffer instance.\n *\n * This class wraps the global sniffer to maintain API compatibility\n * with the real EnvironmentParser. The constructor accepts an env\n * parameter for API compatibility but ignores it since we're sniffing.\n */\nclass PatchedEnvironmentParser {\n\tcreate<TReturn extends Record<string, unknown>>(\n\t\tbuilder: (get: EnvFetcher) => TReturn,\n\t): ConfigParser<TReturn> {\n\t\treturn globalThis.__envSniffer!.create(\n\t\t\tbuilder as any,\n\t\t) as unknown as ConfigParser<TReturn>;\n\t}\n}\n\n// Export the patched parser as EnvironmentParser\nexport { PatchedEnvironmentParser as EnvironmentParser };\n\n// Re-export other envkit exports that entry apps might use\nexport { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAI,CAAC,WAAW,cACf,WAAW,eAAe,IAAIA,0BAAAA,yBAAyB;;;;;;;;AAyBxD,IAAM,2BAAN,MAA+B;CAC9B,OACC,SACwB;EACxB,OAAO,WAAW,aAAc,OAC/B,OACD;CACD;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-envkit-patch.d.cts","names":[],"sources":["../../src/deploy/sniffer-envkit-patch.ts"],"
|
|
1
|
+
{"version":3,"file":"sniffer-envkit-patch.d.cts","names":["SnifferEnvironmentParser"],"sources":["../../src/deploy/sniffer-envkit-patch.ts"],"mappings":";;QAaQ;MAEH,cAAcA;;UAUT,aAAa;EACtB,SAAS;EACT;IAAe;IAAe,MAAM;;IAAQ;IAAgB,OAAO;;;KAI/D,cAAc;EAClB;IAAY;IAAiB;;EAC7B;IAAY;IAAiB;;EAC7B;IAAa;IAAkB;;EAC/B,YAAY;EACZ,QAAQ,iBAAiB;;;;;;;;;cAUpB;EACL,OAAO,gBAAgB,yBACtB,UAAU,KAAK,eAAe,UAC5B,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-envkit-patch.d.mts","names":[],"sources":["../../src/deploy/sniffer-envkit-patch.ts"],"
|
|
1
|
+
{"version":3,"file":"sniffer-envkit-patch.d.mts","names":["SnifferEnvironmentParser"],"sources":["../../src/deploy/sniffer-envkit-patch.ts"],"mappings":";;QAaQ;MAEH,cAAcA;;UAUT,aAAa;EACtB,SAAS;EACT;IAAe;IAAe,MAAM;;IAAQ;IAAgB,OAAO;;;KAI/D,cAAc;EAClB;IAAY;IAAiB;;EAC7B;IAAY;IAAiB;;EAC7B;IAAa;IAAkB;;EAC/B,YAAY;EACZ,QAAQ,iBAAiB;;;;;;;;;cAUpB;EACL,OAAO,gBAAgB,yBACtB,UAAU,KAAK,eAAe,UAC5B,aAAa"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { SnifferEnvironmentParser, SnifferEnvironmentParser as SnifferEnvironmentParser$1 } from "@geekmidas/envkit/sniffer";
|
|
2
|
-
|
|
3
2
|
//#region src/deploy/sniffer-envkit-patch.ts
|
|
3
|
+
/**
|
|
4
|
+
* Patched @geekmidas/envkit module for entry app sniffing.
|
|
5
|
+
*
|
|
6
|
+
* This module re-exports the SnifferEnvironmentParser as EnvironmentParser,
|
|
7
|
+
* allowing entry apps to be imported while capturing their env var usage.
|
|
8
|
+
*
|
|
9
|
+
* The actual sniffer instance is stored in globalThis.__envSniffer
|
|
10
|
+
* so the worker script can retrieve the captured variables.
|
|
11
|
+
*/
|
|
4
12
|
if (!globalThis.__envSniffer) globalThis.__envSniffer = new SnifferEnvironmentParser$1();
|
|
5
13
|
/**
|
|
6
14
|
* Patched EnvironmentParser that uses the global sniffer instance.
|
|
@@ -14,7 +22,7 @@ var PatchedEnvironmentParser = class {
|
|
|
14
22
|
return globalThis.__envSniffer.create(builder);
|
|
15
23
|
}
|
|
16
24
|
};
|
|
17
|
-
|
|
18
25
|
//#endregion
|
|
19
26
|
export { PatchedEnvironmentParser as EnvironmentParser, SnifferEnvironmentParser };
|
|
27
|
+
|
|
20
28
|
//# sourceMappingURL=sniffer-envkit-patch.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-envkit-patch.mjs","names":["SnifferEnvironmentParser"
|
|
1
|
+
{"version":3,"file":"sniffer-envkit-patch.mjs","names":["SnifferEnvironmentParser"],"sources":["../../src/deploy/sniffer-envkit-patch.ts"],"sourcesContent":["/**\n * Patched @geekmidas/envkit module for entry app sniffing.\n *\n * This module re-exports the SnifferEnvironmentParser as EnvironmentParser,\n * allowing entry apps to be imported while capturing their env var usage.\n *\n * The actual sniffer instance is stored in globalThis.__envSniffer\n * so the worker script can retrieve the captured variables.\n */\n\nimport { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n\n// Extend globalThis type for the sniffer instance\ndeclare global {\n\t// eslint-disable-next-line no-var\n\tvar __envSniffer: SnifferEnvironmentParser | undefined;\n}\n\n// Create a shared sniffer instance that will be used by all imports\n// This is stored globally so the worker script can access it\nif (!globalThis.__envSniffer) {\n\tglobalThis.__envSniffer = new SnifferEnvironmentParser();\n}\n\n// Type for the config parser returned by create()\ninterface ConfigParser<T> {\n\tparse(): T;\n\tsafeParse(): { success: true; data: T } | { success: false; error: Error };\n}\n\n// Type for the env fetcher function\ntype EnvFetcher = (name: string) => {\n\tstring(): { parse(): string; safeParse(): unknown };\n\tnumber(): { parse(): number; safeParse(): unknown };\n\tboolean(): { parse(): boolean; safeParse(): unknown };\n\toptional(): EnvFetcher;\n\tdefault(value: unknown): EnvFetcher;\n};\n\n/**\n * Patched EnvironmentParser that uses the global sniffer instance.\n *\n * This class wraps the global sniffer to maintain API compatibility\n * with the real EnvironmentParser. The constructor accepts an env\n * parameter for API compatibility but ignores it since we're sniffing.\n */\nclass PatchedEnvironmentParser {\n\tcreate<TReturn extends Record<string, unknown>>(\n\t\tbuilder: (get: EnvFetcher) => TReturn,\n\t): ConfigParser<TReturn> {\n\t\treturn globalThis.__envSniffer!.create(\n\t\t\tbuilder as any,\n\t\t) as unknown as ConfigParser<TReturn>;\n\t}\n}\n\n// Export the patched parser as EnvironmentParser\nexport { PatchedEnvironmentParser as EnvironmentParser };\n\n// Re-export other envkit exports that entry apps might use\nexport { SnifferEnvironmentParser } from '@geekmidas/envkit/sniffer';\n"],"mappings":";;;;;;;;;;;AAoBA,IAAI,CAAC,WAAW,cACf,WAAW,eAAe,IAAIA,2BAAyB;;;;;;;;AAyBxD,IAAM,2BAAN,MAA+B;CAC9B,OACC,SACwB;EACxB,OAAO,WAAW,aAAc,OAC/B,OACD;CACD;AACD"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const node_url = require_chunk.__toESM(require("node:url"));
|
|
5
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let node_fs = require("node:fs");
|
|
3
|
+
let node_path = require("node:path");
|
|
6
4
|
//#region src/deploy/sniffer-hooks.ts
|
|
7
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Module loader hooks for entry app sniffing.
|
|
7
|
+
*
|
|
8
|
+
* This module provides the resolve hook that intercepts '@geekmidas/envkit'
|
|
9
|
+
* imports and redirects them to the patched sniffer version.
|
|
10
|
+
*
|
|
11
|
+
* This file is registered via module.register() from sniffer-loader.ts.
|
|
12
|
+
*/
|
|
13
|
+
const __filename$1 = (0, require("node:url").fileURLToPath)(require("url").pathToFileURL(__filename).href);
|
|
8
14
|
const __dirname$1 = (0, node_path.dirname)(__filename$1);
|
|
9
15
|
const mjsPath = (0, node_path.join)(__dirname$1, "sniffer-envkit-patch.mjs");
|
|
10
16
|
const tsPath = (0, node_path.join)(__dirname$1, "sniffer-envkit-patch.ts");
|
|
@@ -19,7 +25,7 @@ async function resolve(specifier, context, nextResolve) {
|
|
|
19
25
|
};
|
|
20
26
|
return nextResolve(specifier, context);
|
|
21
27
|
}
|
|
22
|
-
|
|
23
28
|
//#endregion
|
|
24
29
|
exports.resolve = resolve;
|
|
30
|
+
|
|
25
31
|
//# sourceMappingURL=sniffer-hooks.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-hooks.cjs","names":["__filename","__dirname","
|
|
1
|
+
{"version":3,"file":"sniffer-hooks.cjs","names":["__filename","fileURLToPath","__dirname","dirname","join","existsSync"],"sources":["../../src/deploy/sniffer-hooks.ts"],"sourcesContent":["/**\n * Module loader hooks for entry app sniffing.\n *\n * This module provides the resolve hook that intercepts '@geekmidas/envkit'\n * imports and redirects them to the patched sniffer version.\n *\n * This file is registered via module.register() from sniffer-loader.ts.\n */\n\nimport { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\n// Resolve path to the patched envkit module\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Try .mjs first (production dist), then .ts (development)\nconst mjsPath = join(__dirname, 'sniffer-envkit-patch.mjs');\nconst tsPath = join(__dirname, 'sniffer-envkit-patch.ts');\nconst patchedEnvkitPath = existsSync(mjsPath) ? mjsPath : tsPath;\n\ntype ResolveContext = {\n\tconditions: string[];\n\timportAttributes: Record<string, string>;\n\tparentURL?: string;\n};\n\ntype ResolveResult = {\n\turl: string;\n\tshortCircuit?: boolean;\n\tformat?: string;\n};\n\ntype NextResolve = (\n\tspecifier: string,\n\tcontext: ResolveContext,\n) => Promise<ResolveResult>;\n\n/**\n * Resolve hook - intercepts module resolution for @geekmidas/envkit\n */\nexport async function resolve(\n\tspecifier: string,\n\tcontext: ResolveContext,\n\tnextResolve: NextResolve,\n): Promise<ResolveResult> {\n\t// Intercept @geekmidas/envkit imports\n\tif (specifier === '@geekmidas/envkit') {\n\t\treturn {\n\t\t\turl: `file://${patchedEnvkitPath}`,\n\t\t\tshortCircuit: true,\n\t\t};\n\t}\n\n\treturn nextResolve(specifier, context);\n}\n"],"mappings":";;;;;;;;;;;;AAcA,MAAMA,gBAAAA,qBAAaC,CAAAA,CAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B;AAChD,MAAMC,eAAAA,GAAYC,UAAAA,QAAAA,CAAQH,YAAU;AAGpC,MAAM,WAAA,GAAUI,UAAAA,KAAAA,CAAKF,aAAW,0BAA0B;AAC1D,MAAM,UAAA,GAASE,UAAAA,KAAAA,CAAKF,aAAW,yBAAyB;AACxD,MAAM,qBAAA,GAAoBG,QAAAA,WAAAA,CAAW,OAAO,IAAI,UAAU;;;;AAsB1D,eAAsB,QACrB,WACA,SACA,aACyB;CAEzB,IAAI,cAAc,qBACjB,OAAO;EACN,KAAK,UAAU;EACf,cAAc;CACf;CAGD,OAAO,YAAY,WAAW,OAAO;AACtC"}
|
|
@@ -21,7 +21,6 @@ type NextResolve = (specifier: string, context: ResolveContext) => Promise<Resol
|
|
|
21
21
|
/**
|
|
22
22
|
* Resolve hook - intercepts module resolution for @geekmidas/envkit
|
|
23
23
|
*/
|
|
24
|
-
declare function resolve(specifier: string, context: ResolveContext, nextResolve: NextResolve): Promise<ResolveResult>;
|
|
24
|
+
export declare function resolve(specifier: string, context: ResolveContext, nextResolve: NextResolve): Promise<ResolveResult>;
|
|
25
25
|
//#endregion
|
|
26
|
-
export { resolve };
|
|
27
26
|
//# sourceMappingURL=sniffer-hooks.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-hooks.d.cts","names":[],"sources":["../../src/deploy/sniffer-hooks.ts"],"
|
|
1
|
+
{"version":3,"file":"sniffer-hooks.d.cts","names":[],"sources":["../../src/deploy/sniffer-hooks.ts"],"mappings":";;;;;;;;;KAsBK;EACJ;EACA,kBAAkB;EAClB;;KAGI;EACJ;EACA;EACA;;KAGI,eACJ,mBACA,SAAS,mBACL,QAAQ;;;;wBAKS,QACrB,mBACA,SAAS,gBACT,aAAa,cACX,QAAQ"}
|
|
@@ -21,7 +21,6 @@ type NextResolve = (specifier: string, context: ResolveContext) => Promise<Resol
|
|
|
21
21
|
/**
|
|
22
22
|
* Resolve hook - intercepts module resolution for @geekmidas/envkit
|
|
23
23
|
*/
|
|
24
|
-
declare function resolve(specifier: string, context: ResolveContext, nextResolve: NextResolve): Promise<ResolveResult>;
|
|
24
|
+
export declare function resolve(specifier: string, context: ResolveContext, nextResolve: NextResolve): Promise<ResolveResult>;
|
|
25
25
|
//#endregion
|
|
26
|
-
export { resolve };
|
|
27
26
|
//# sourceMappingURL=sniffer-hooks.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-hooks.d.mts","names":[],"sources":["../../src/deploy/sniffer-hooks.ts"],"
|
|
1
|
+
{"version":3,"file":"sniffer-hooks.d.mts","names":[],"sources":["../../src/deploy/sniffer-hooks.ts"],"mappings":";;;;;;;;;KAsBK;EACJ;EACA,kBAAkB;EAClB;;KAGI;EACJ;EACA;EACA;;KAGI,eACJ,mBACA,SAAS,mBACL,QAAQ;;;;wBAKS,QACrB,mBACA,SAAS,gBACT,aAAa,cACX,QAAQ"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
|
-
|
|
5
4
|
//#region src/deploy/sniffer-hooks.ts
|
|
5
|
+
/**
|
|
6
|
+
* Module loader hooks for entry app sniffing.
|
|
7
|
+
*
|
|
8
|
+
* This module provides the resolve hook that intercepts '@geekmidas/envkit'
|
|
9
|
+
* imports and redirects them to the patched sniffer version.
|
|
10
|
+
*
|
|
11
|
+
* This file is registered via module.register() from sniffer-loader.ts.
|
|
12
|
+
*/
|
|
6
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
7
14
|
const __dirname = dirname(__filename);
|
|
8
15
|
const mjsPath = join(__dirname, "sniffer-envkit-patch.mjs");
|
|
@@ -18,7 +25,7 @@ async function resolve(specifier, context, nextResolve) {
|
|
|
18
25
|
};
|
|
19
26
|
return nextResolve(specifier, context);
|
|
20
27
|
}
|
|
21
|
-
|
|
22
28
|
//#endregion
|
|
23
29
|
export { resolve };
|
|
30
|
+
|
|
24
31
|
//# sourceMappingURL=sniffer-hooks.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sniffer-hooks.mjs","names":[
|
|
1
|
+
{"version":3,"file":"sniffer-hooks.mjs","names":[],"sources":["../../src/deploy/sniffer-hooks.ts"],"sourcesContent":["/**\n * Module loader hooks for entry app sniffing.\n *\n * This module provides the resolve hook that intercepts '@geekmidas/envkit'\n * imports and redirects them to the patched sniffer version.\n *\n * This file is registered via module.register() from sniffer-loader.ts.\n */\n\nimport { existsSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\n// Resolve path to the patched envkit module\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Try .mjs first (production dist), then .ts (development)\nconst mjsPath = join(__dirname, 'sniffer-envkit-patch.mjs');\nconst tsPath = join(__dirname, 'sniffer-envkit-patch.ts');\nconst patchedEnvkitPath = existsSync(mjsPath) ? mjsPath : tsPath;\n\ntype ResolveContext = {\n\tconditions: string[];\n\timportAttributes: Record<string, string>;\n\tparentURL?: string;\n};\n\ntype ResolveResult = {\n\turl: string;\n\tshortCircuit?: boolean;\n\tformat?: string;\n};\n\ntype NextResolve = (\n\tspecifier: string,\n\tcontext: ResolveContext,\n) => Promise<ResolveResult>;\n\n/**\n * Resolve hook - intercepts module resolution for @geekmidas/envkit\n */\nexport async function resolve(\n\tspecifier: string,\n\tcontext: ResolveContext,\n\tnextResolve: NextResolve,\n): Promise<ResolveResult> {\n\t// Intercept @geekmidas/envkit imports\n\tif (specifier === '@geekmidas/envkit') {\n\t\treturn {\n\t\t\turl: `file://${patchedEnvkitPath}`,\n\t\t\tshortCircuit: true,\n\t\t};\n\t}\n\n\treturn nextResolve(specifier, context);\n}\n"],"mappings":";;;;;;;;;;;;AAcA,MAAM,aAAa,cAAc,YAAY,GAAG;AAChD,MAAM,YAAY,QAAQ,UAAU;AAGpC,MAAM,UAAU,KAAK,WAAW,0BAA0B;AAC1D,MAAM,SAAS,KAAK,WAAW,yBAAyB;AACxD,MAAM,oBAAoB,WAAW,OAAO,IAAI,UAAU;;;;AAsB1D,eAAsB,QACrB,WACA,SACA,aACyB;CAEzB,IAAI,cAAc,qBACjB,OAAO;EACN,KAAK,UAAU;EACf,cAAc;CACf;CAGD,OAAO,YAAY,WAAW,OAAO;AACtC"}
|
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const node_module = require_chunk.__toESM(require("node:module"));
|
|
6
|
-
|
|
1
|
+
let node_fs = require("node:fs");
|
|
2
|
+
let node_path = require("node:path");
|
|
3
|
+
let node_module = require("node:module");
|
|
4
|
+
let node_url = require("node:url");
|
|
7
5
|
//#region src/deploy/sniffer-loader.ts
|
|
6
|
+
/**
|
|
7
|
+
* Node.js module loader registration for entry app sniffing.
|
|
8
|
+
*
|
|
9
|
+
* This module registers a custom loader hook that intercepts imports of
|
|
10
|
+
* '@geekmidas/envkit' and replaces the EnvironmentParser with
|
|
11
|
+
* SnifferEnvironmentParser, allowing us to capture which environment
|
|
12
|
+
* variables an entry app accesses.
|
|
13
|
+
*
|
|
14
|
+
* Usage:
|
|
15
|
+
* node --import tsx --import ./sniffer-loader.mjs ./sniffer-worker.mjs /path/to/entry.ts
|
|
16
|
+
*/
|
|
8
17
|
const __filename$1 = (0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href);
|
|
9
18
|
const __dirname$1 = (0, node_path.dirname)(__filename$1);
|
|
10
19
|
const mjsPath = (0, node_path.join)(__dirname$1, "sniffer-hooks.mjs");
|
|
11
20
|
const tsPath = (0, node_path.join)(__dirname$1, "sniffer-hooks.ts");
|
|
12
21
|
const hooksPath = (0, node_fs.existsSync)(mjsPath) ? mjsPath : tsPath;
|
|
13
22
|
(0, node_module.register)((0, node_url.pathToFileURL)(hooksPath).href, require("url").pathToFileURL(__filename).href);
|
|
14
|
-
|
|
15
23
|
//#endregion
|
|
24
|
+
|
|
16
25
|
//# sourceMappingURL=sniffer-loader.cjs.map
|