@runa-ai/runa-cli 0.5.44 → 0.5.45
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/commands/ci/machine/machine.d.ts.map +1 -1
- package/dist/commands/ci/utils/app-runtime.d.ts +8 -0
- package/dist/commands/ci/utils/app-runtime.d.ts.map +1 -1
- package/dist/commands/db/utils/import-impact-analyzer.d.ts +8 -2
- package/dist/commands/db/utils/import-impact-analyzer.d.ts.map +1 -1
- package/dist/commands/dev/machine.d.ts.map +1 -1
- package/dist/commands/env/commands/env-pull.d.ts.map +1 -1
- package/dist/commands/env/constants/local-supabase.d.ts +61 -9
- package/dist/commands/env/constants/local-supabase.d.ts.map +1 -1
- package/dist/index.js +234 -263
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"machine.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/machine/machine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EAAU,KAAK,YAAY,EAAS,MAAM,QAAQ,CAAC;AA8C1D,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAqB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"machine.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/machine/machine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EAAU,KAAK,YAAY,EAAS,MAAM,QAAQ,CAAC;AA8C1D,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAqB,MAAM,YAAY,CAAC;AAexE,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAymCpB,CAAC;AAMH,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC;AACzC,MAAM,MAAM,UAAU,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC;AAMxD;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,CAYzD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAExD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAE5D;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,UAAU,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAE3D"}
|
|
@@ -9,12 +9,20 @@ export declare function writeEnvLocal(params: {
|
|
|
9
9
|
appDir: string;
|
|
10
10
|
values: Record<string, string>;
|
|
11
11
|
}): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* App start mode:
|
|
14
|
+
* - 'dev': Development mode with hot reload (next dev)
|
|
15
|
+
* - 'start': Production mode (next start, requires build)
|
|
16
|
+
*/
|
|
17
|
+
export type AppMode = 'dev' | 'start';
|
|
12
18
|
export declare function startAppBackground(params: {
|
|
13
19
|
repoRoot: string;
|
|
14
20
|
appDir: string;
|
|
15
21
|
port: number;
|
|
16
22
|
env: NodeJS.ProcessEnv;
|
|
17
23
|
tmpDir: string;
|
|
24
|
+
/** App mode: 'dev' for development (hot reload), 'start' for production. Default: 'start' */
|
|
25
|
+
mode?: AppMode;
|
|
18
26
|
}): Promise<{
|
|
19
27
|
pid: number;
|
|
20
28
|
cleanupStreams: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-runtime.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/utils/app-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmGH,wBAAsB,aAAa,CAAC,MAAM,EAAE;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhB;
|
|
1
|
+
{"version":3,"file":"app-runtime.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/utils/app-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmGH,wBAAsB,aAAa,CAAC,MAAM,EAAE;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhB;AAiHD;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,OAAO,CAAC;AAwDtC,wBAAsB,kBAAkB,CAAC,MAAM,EAAE;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,6FAA6F;IAC7F,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC,CA8DvD;AAED,wBAAsB,eAAe,CAAC,MAAM,EAAE;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAOhB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* AI HINT: Schema Import Impact Analyzer
|
|
2
|
+
* AI HINT: Schema Import Impact Analyzer (ts-morph based)
|
|
3
3
|
*
|
|
4
4
|
* Purpose: Analyze which files import schema tables/types and report impact
|
|
5
5
|
* Usage: Used by `runa db sync --show-import-impact` to help developers
|
|
@@ -7,9 +7,15 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Flow:
|
|
9
9
|
* 1. Scan project for TypeScript files
|
|
10
|
-
* 2.
|
|
10
|
+
* 2. Use ts-morph AST to find imports from database/schema packages
|
|
11
11
|
* 3. Map imported symbols to files
|
|
12
12
|
* 4. Report which files would be affected by changes
|
|
13
|
+
*
|
|
14
|
+
* Why ts-morph (not regex):
|
|
15
|
+
* - Correctly handles comments containing 'import' keywords
|
|
16
|
+
* - Handles multi-line imports
|
|
17
|
+
* - Handles template literals and nested quotes
|
|
18
|
+
* - Per .claude/rules/code-quality.md: "Use AST (ts-morph) for TypeScript parsing"
|
|
13
19
|
*/
|
|
14
20
|
export interface ImportReference {
|
|
15
21
|
/** File path relative to project root */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-impact-analyzer.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/utils/import-impact-analyzer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"import-impact-analyzer.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/utils/import-impact-analyzer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAUH,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,iDAAiD;IACjD,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;IAC5C,oCAAoC;IACpC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gCAAgC;IAChC,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AA+JD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB,CA8BvE;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,kBAAkB,EAC1B,cAAc,CAAC,EAAE,MAAM,EAAE,GACxB,MAAM,EAAE,CAoCV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"machine.d.ts","sourceRoot":"","sources":["../../../src/commands/dev/machine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAS1D,OAAO,KAAK,EAAE,UAAU,EAAY,QAAQ,EAAa,MAAM,YAAY,CAAC;AAsF5E,UAAU,aAAa;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;
|
|
1
|
+
{"version":3,"file":"machine.d.ts","sourceRoot":"","sources":["../../../src/commands/dev/machine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAS1D,OAAO,KAAK,EAAE,UAAU,EAAY,QAAQ,EAAa,MAAM,YAAY,CAAC;AAsF5E,UAAU,aAAa;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAmCD,UAAU,aAAa;IACrB,GAAG,EAAE,MAAM,CAAC;CACb;AAoBD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAIH,QAAQ;cAAY,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;EA6K5C,CAAC;AAMH,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC;AAC3C,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAAC;AAM1D;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,WAAW,GAAG,MAAM,CAa1D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO,CAEzD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAE7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-pull.d.ts","sourceRoot":"","sources":["../../../../src/commands/env/commands/env-pull.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAaH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"env-pull.d.ts","sourceRoot":"","sources":["../../../../src/commands/env/commands/env-pull.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAaH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAu9BpC,eAAO,MAAM,WAAW,SA+BpB,CAAC"}
|
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AI HINT: Local Supabase Constants
|
|
3
3
|
*
|
|
4
|
-
* Purpose:
|
|
4
|
+
* Purpose: Dynamic values for local Supabase development (supabase start)
|
|
5
5
|
* These are public, well-known values used by all Supabase CLI installations.
|
|
6
6
|
*
|
|
7
7
|
* Source: https://supabase.com/docs/guides/cli/local-development
|
|
8
8
|
*
|
|
9
|
+
* Port Detection (Priority Order):
|
|
10
|
+
* 1. supabase/config.toml [api].port and [db].port settings
|
|
11
|
+
* 2. Default Supabase ports (54321 for API, 54322 for DB)
|
|
12
|
+
*
|
|
9
13
|
* Note: These keys are intentionally public and NOT secrets.
|
|
10
14
|
* They are the same for all local Supabase instances.
|
|
11
15
|
*/
|
|
16
|
+
interface SupabasePorts {
|
|
17
|
+
api: number;
|
|
18
|
+
db: number;
|
|
19
|
+
}
|
|
12
20
|
/**
|
|
13
|
-
*
|
|
21
|
+
* Detect Supabase ports from config.toml or use defaults.
|
|
22
|
+
*
|
|
23
|
+
* Priority:
|
|
24
|
+
* 1. supabase/config.toml settings
|
|
25
|
+
* 2. Default ports (54321/54322)
|
|
26
|
+
*
|
|
27
|
+
* @param projectRoot - Project root directory (defaults to process.cwd())
|
|
28
|
+
* @returns Detected ports
|
|
14
29
|
*/
|
|
15
|
-
export declare
|
|
30
|
+
export declare function detectLocalSupabasePorts(projectRoot?: string): SupabasePorts;
|
|
16
31
|
/**
|
|
17
32
|
* Local Supabase anon key (fixed, public value)
|
|
18
33
|
* This is the same for all local Supabase instances.
|
|
@@ -24,20 +39,57 @@ export declare const LOCAL_SUPABASE_ANON_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX
|
|
|
24
39
|
*/
|
|
25
40
|
export declare const LOCAL_SUPABASE_SERVICE_ROLE_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU";
|
|
26
41
|
/**
|
|
27
|
-
*
|
|
28
|
-
* User: postgres, Password: postgres (default local credentials)
|
|
42
|
+
* Build local Supabase URL from detected port.
|
|
29
43
|
*/
|
|
30
|
-
export declare
|
|
44
|
+
export declare function buildLocalSupabaseUrl(projectRoot?: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* Build local database URL from detected port.
|
|
47
|
+
*/
|
|
48
|
+
export declare function buildLocalDatabaseUrl(projectRoot?: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* Get map of environment variable keys to their local Supabase values.
|
|
51
|
+
*
|
|
52
|
+
* This function dynamically generates values based on detected ports.
|
|
53
|
+
*
|
|
54
|
+
* @param projectRoot - Project root directory (defaults to process.cwd())
|
|
55
|
+
* @returns Environment variable key-value map
|
|
56
|
+
*/
|
|
57
|
+
export declare function getLocalSupabaseEnvValues(projectRoot?: string): Record<string, string>;
|
|
31
58
|
/**
|
|
32
|
-
*
|
|
59
|
+
* Get human-readable descriptions for each local value (for summary display).
|
|
60
|
+
*
|
|
61
|
+
* @param projectRoot - Project root directory (defaults to process.cwd())
|
|
62
|
+
* @returns Description map
|
|
63
|
+
*/
|
|
64
|
+
export declare function getLocalValueDescriptions(projectRoot?: string): Record<string, string>;
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated Use getLocalSupabaseEnvValues() instead.
|
|
67
|
+
* This constant uses default ports; prefer the function for dynamic port detection.
|
|
33
68
|
*/
|
|
34
69
|
export declare const LOCAL_SUPABASE_ENV_VALUES: Record<string, string>;
|
|
35
70
|
/**
|
|
36
|
-
*
|
|
71
|
+
* @deprecated Use Object.keys(getLocalSupabaseEnvValues()) instead.
|
|
37
72
|
*/
|
|
38
73
|
export declare const LOCAL_REPLACEMENT_KEYS: string[];
|
|
39
74
|
/**
|
|
40
|
-
*
|
|
75
|
+
* @deprecated Use getLocalValueDescriptions() instead.
|
|
41
76
|
*/
|
|
42
77
|
export declare const LOCAL_VALUE_DESCRIPTIONS: Record<string, string>;
|
|
78
|
+
/**
|
|
79
|
+
* @deprecated Use buildLocalSupabaseUrl() instead.
|
|
80
|
+
*/
|
|
81
|
+
export declare const LOCAL_SUPABASE_URL = "http://127.0.0.1:54321";
|
|
82
|
+
/**
|
|
83
|
+
* @deprecated Use buildLocalDatabaseUrl() instead.
|
|
84
|
+
*/
|
|
85
|
+
export declare const LOCAL_DATABASE_URL = "postgresql://postgres:postgres@127.0.0.1:54322/postgres";
|
|
86
|
+
/**
|
|
87
|
+
* Validate that all URL values point to localhost.
|
|
88
|
+
* This prevents accidental production URL usage in local development.
|
|
89
|
+
*
|
|
90
|
+
* @param envValues - Environment values to validate
|
|
91
|
+
* @throws Error if any URL doesn't point to localhost
|
|
92
|
+
*/
|
|
93
|
+
export declare function validateLocalhostValues(envValues: Record<string, string>): void;
|
|
94
|
+
export {};
|
|
43
95
|
//# sourceMappingURL=local-supabase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-supabase.d.ts","sourceRoot":"","sources":["../../../../src/commands/env/constants/local-supabase.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"local-supabase.d.ts","sourceRoot":"","sources":["../../../../src/commands/env/constants/local-supabase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAgBH,UAAU,aAAa;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;CACZ;AA6DD;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,GAAE,MAAsB,GAAG,aAAa,CAW3F;AAMD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,8JACyH,CAAC;AAE9J;;;GAGG;AACH,eAAO,MAAM,+BAA+B,yKAC4H,CAAC;AAEzK;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,GAAE,MAAsB,GAAG,MAAM,CAGjF;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,GAAE,MAAsB,GAAG,MAAM,CAGjF;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,WAAW,GAAE,MAAsB,GAClC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAexB;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,WAAW,GAAE,MAAsB,GAClC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAWxB;AAMD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAA+B,CAAC;AAE7F;;GAEG;AACH,eAAO,MAAM,sBAAsB,UAAyC,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAA+B,CAAC;AAE5F;;GAEG;AACH,eAAO,MAAM,kBAAkB,2BAAyC,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,kBAAkB,4DAAyE,CAAC;AAMzG;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAwB/E"}
|
package/dist/index.js
CHANGED
|
@@ -868,7 +868,7 @@ __export(types_exports, {
|
|
|
868
868
|
calculateSummary: () => calculateSummary,
|
|
869
869
|
createInitialContext: () => createInitialContext2,
|
|
870
870
|
createOutput: () => createOutput4,
|
|
871
|
-
getErrorMessage: () =>
|
|
871
|
+
getErrorMessage: () => getErrorMessage
|
|
872
872
|
});
|
|
873
873
|
function createInitialContext2(input3, repoRoot) {
|
|
874
874
|
return {
|
|
@@ -915,7 +915,7 @@ function createOutput4(context) {
|
|
|
915
915
|
durationMs
|
|
916
916
|
};
|
|
917
917
|
}
|
|
918
|
-
function
|
|
918
|
+
function getErrorMessage(error) {
|
|
919
919
|
return error instanceof Error ? error.message : String(error);
|
|
920
920
|
}
|
|
921
921
|
var init_types = __esm({
|
|
@@ -929,7 +929,7 @@ var CLI_VERSION, HAS_ADMIN_COMMAND;
|
|
|
929
929
|
var init_version = __esm({
|
|
930
930
|
"src/version.ts"() {
|
|
931
931
|
init_esm_shims();
|
|
932
|
-
CLI_VERSION = "0.5.
|
|
932
|
+
CLI_VERSION = "0.5.45";
|
|
933
933
|
HAS_ADMIN_COMMAND = false;
|
|
934
934
|
}
|
|
935
935
|
});
|
|
@@ -7787,33 +7787,38 @@ async function readPackageScripts(pkgPath) {
|
|
|
7787
7787
|
return null;
|
|
7788
7788
|
}
|
|
7789
7789
|
}
|
|
7790
|
-
function
|
|
7791
|
-
const
|
|
7792
|
-
const
|
|
7793
|
-
const
|
|
7794
|
-
const
|
|
7795
|
-
|
|
7796
|
-
|
|
7790
|
+
function determineAppCommand(mode, isMonorepo2, rootScripts, appScripts, repoRoot, appDir, port) {
|
|
7791
|
+
const ciScriptName = mode === "dev" ? "dev:ci" : "start:ci";
|
|
7792
|
+
const defaultScriptName = mode;
|
|
7793
|
+
const nextCommand = mode === "dev" ? "dev" : "start";
|
|
7794
|
+
const rootHasCiScript = Boolean(rootScripts?.[ciScriptName]);
|
|
7795
|
+
const rootHasDefaultScript = Boolean(rootScripts?.[defaultScriptName]);
|
|
7796
|
+
const appHasCiScript = Boolean(appScripts?.[ciScriptName]);
|
|
7797
|
+
const appHasDefaultScript = Boolean(appScripts?.[defaultScriptName]);
|
|
7798
|
+
if (isMonorepo2 && (rootHasCiScript || rootHasDefaultScript)) {
|
|
7799
|
+
const scriptName = rootHasCiScript ? ciScriptName : defaultScriptName;
|
|
7797
7800
|
return { command: ["pnpm", scriptName], useRootScript: true };
|
|
7798
7801
|
}
|
|
7799
|
-
if (
|
|
7800
|
-
const scriptName =
|
|
7802
|
+
if (appHasCiScript || appHasDefaultScript) {
|
|
7803
|
+
const scriptName = appHasCiScript ? ciScriptName : defaultScriptName;
|
|
7801
7804
|
const dirArgs2 = isMonorepo2 ? ["-C", path10__default.relative(repoRoot, appDir)] : [];
|
|
7802
7805
|
return { command: ["pnpm", ...dirArgs2, scriptName], useRootScript: false };
|
|
7803
7806
|
}
|
|
7804
7807
|
const dirArgs = isMonorepo2 ? ["-C", path10__default.relative(repoRoot, appDir)] : [];
|
|
7805
7808
|
return {
|
|
7806
|
-
command: ["pnpm", ...dirArgs, "exec", "next",
|
|
7809
|
+
command: ["pnpm", ...dirArgs, "exec", "next", nextCommand, "-p", String(port)],
|
|
7807
7810
|
useRootScript: false
|
|
7808
7811
|
};
|
|
7809
7812
|
}
|
|
7810
7813
|
async function startAppBackground(params) {
|
|
7814
|
+
const mode = params.mode ?? "start";
|
|
7811
7815
|
const isMonorepo2 = params.appDir !== params.repoRoot;
|
|
7812
7816
|
const rootPkgPath = path10__default.join(params.repoRoot, "package.json");
|
|
7813
7817
|
const appPkgPath = path10__default.join(params.appDir, "package.json");
|
|
7814
7818
|
const rootScripts = await readPackageScripts(rootPkgPath);
|
|
7815
7819
|
const appScripts = isMonorepo2 ? await readPackageScripts(appPkgPath) : rootScripts;
|
|
7816
|
-
const { command, useRootScript } =
|
|
7820
|
+
const { command, useRootScript } = determineAppCommand(
|
|
7821
|
+
mode,
|
|
7817
7822
|
isMonorepo2,
|
|
7818
7823
|
rootScripts,
|
|
7819
7824
|
appScripts,
|
|
@@ -7824,8 +7829,10 @@ async function startAppBackground(params) {
|
|
|
7824
7829
|
const appLog = path10__default.join(params.tmpDir, "app.log");
|
|
7825
7830
|
const out = createWriteStream(appLog, { flags: "a" });
|
|
7826
7831
|
const commandStr = command.join(" ");
|
|
7832
|
+
const modeLabel = mode === "dev" ? "development (hot reload)" : "production";
|
|
7827
7833
|
const logHeader = [
|
|
7828
7834
|
`[runa] Starting app at ${(/* @__PURE__ */ new Date()).toISOString()}`,
|
|
7835
|
+
`[runa] Mode: ${modeLabel}`,
|
|
7829
7836
|
`[runa] Command: ${commandStr}`,
|
|
7830
7837
|
`[runa] Working directory: ${params.repoRoot}`,
|
|
7831
7838
|
`[runa] App directory: ${path10__default.relative(params.repoRoot, params.appDir) || "."}`,
|
|
@@ -8000,7 +8007,8 @@ var appStartActor = fromPromise(
|
|
|
8000
8007
|
appDir,
|
|
8001
8008
|
port,
|
|
8002
8009
|
env: process.env,
|
|
8003
|
-
tmpDir: fullTmpDir
|
|
8010
|
+
tmpDir: fullTmpDir,
|
|
8011
|
+
mode: "dev"
|
|
8004
8012
|
});
|
|
8005
8013
|
await waitForAppReady({
|
|
8006
8014
|
port,
|
|
@@ -14806,9 +14814,6 @@ function createOutput3(context) {
|
|
|
14806
14814
|
error: context.error ?? void 0
|
|
14807
14815
|
};
|
|
14808
14816
|
}
|
|
14809
|
-
function getErrorMessage(error) {
|
|
14810
|
-
return error instanceof Error ? error.message : String(error);
|
|
14811
|
-
}
|
|
14812
14817
|
function extractErrorMessage2(event, fallbackMessage) {
|
|
14813
14818
|
return event.error instanceof Error ? event.error.message : fallbackMessage;
|
|
14814
14819
|
}
|
|
@@ -15034,7 +15039,6 @@ var ciMachine = setup({
|
|
|
15034
15039
|
invoke: {
|
|
15035
15040
|
src: "upsertComment",
|
|
15036
15041
|
input: ({ context }) => {
|
|
15037
|
-
console.log("[DEBUG] initialComment: Posting initial progress comment");
|
|
15038
15042
|
const prNumber = context.prContext?.prNumber ?? 0;
|
|
15039
15043
|
const progressInput = createProgressCommentInput(
|
|
15040
15044
|
context,
|
|
@@ -15592,11 +15596,7 @@ ${generateProgressCommentBody(progressInput)}`;
|
|
|
15592
15596
|
// Core tests failed - go to coreTestsFailed
|
|
15593
15597
|
guard: ({ event }) => {
|
|
15594
15598
|
const failedLayers = event.output.failedLayers ?? [];
|
|
15595
|
-
|
|
15596
|
-
console.log(
|
|
15597
|
-
`[DEBUG] runCoreTests.onDone guard: failedLayers=${JSON.stringify(failedLayers)}, hasFailures=${hasFailures}`
|
|
15598
|
-
);
|
|
15599
|
-
return hasFailures;
|
|
15599
|
+
return failedLayers.length > 0;
|
|
15600
15600
|
},
|
|
15601
15601
|
target: "coreTestsFailed",
|
|
15602
15602
|
actions: assign({
|
|
@@ -15605,9 +15605,6 @@ ${generateProgressCommentBody(progressInput)}`;
|
|
|
15605
15605
|
const results = event.output.results ?? [];
|
|
15606
15606
|
const failedLayers = event.output.failedLayers ?? [];
|
|
15607
15607
|
if (results.length === 0 && failedLayers.length > 0) {
|
|
15608
|
-
console.log(
|
|
15609
|
-
`[DEBUG] Converting failedLayers to layerResults: ${JSON.stringify(failedLayers)}`
|
|
15610
|
-
);
|
|
15611
15608
|
const layerResults = {};
|
|
15612
15609
|
for (const layer of failedLayers) {
|
|
15613
15610
|
layerResults[layer] = { status: "failed", exitCode: 1 };
|
|
@@ -15662,7 +15659,6 @@ ${generateProgressCommentBody(progressInput)}`;
|
|
|
15662
15659
|
entry: assign({
|
|
15663
15660
|
exitCode: ({ context }) => {
|
|
15664
15661
|
if (Object.keys(context.layerResults).length === 0) {
|
|
15665
|
-
console.log("[DEBUG] coreTestsFailed: layerResults is empty, returning exitCode=1");
|
|
15666
15662
|
return 1;
|
|
15667
15663
|
}
|
|
15668
15664
|
return computeExitCodeFromLayerResults(context.layerResults);
|
|
@@ -15687,7 +15683,6 @@ ${generateProgressCommentBody(progressInput)}`;
|
|
|
15687
15683
|
assertions: [{ type: "log", contains: "E2E phase" }]
|
|
15688
15684
|
}
|
|
15689
15685
|
},
|
|
15690
|
-
entry: () => console.log("[DEBUG] Entering e2ePhase (parallel: comment + E2E tests)"),
|
|
15691
15686
|
states: {
|
|
15692
15687
|
// Sub-state 1: Post intermediate comment
|
|
15693
15688
|
intermediateComment: {
|
|
@@ -15712,7 +15707,6 @@ ${generateProgressCommentBody(progressInput)}`;
|
|
|
15712
15707
|
invoke: {
|
|
15713
15708
|
src: "upsertComment",
|
|
15714
15709
|
input: ({ context }) => {
|
|
15715
|
-
console.log("[DEBUG] e2ePhase.intermediateComment: Posting intermediate comment");
|
|
15716
15710
|
const prNumber = context.prContext?.prNumber ?? 0;
|
|
15717
15711
|
const commentInput = createCommentInput(context, {
|
|
15718
15712
|
isIntermediate: true,
|
|
@@ -15742,7 +15736,6 @@ ${generateCommentBody(commentInput)}`;
|
|
|
15742
15736
|
invoke: {
|
|
15743
15737
|
src: "runLayers",
|
|
15744
15738
|
input: ({ context }) => {
|
|
15745
|
-
console.log("[DEBUG] e2ePhase.e2eTests: Running Layer 4");
|
|
15746
15739
|
const e2eBaseUrl = `http://localhost:${context.app?.port ?? 3e3}`;
|
|
15747
15740
|
return {
|
|
15748
15741
|
repoRoot: assertRepoRoot(context),
|
|
@@ -15768,9 +15761,6 @@ ${generateCommentBody(commentInput)}`;
|
|
|
15768
15761
|
// Merge E2E results into layerResults
|
|
15769
15762
|
layerResults: ({ context, event }) => {
|
|
15770
15763
|
const e2eResults = convertLayerResults(event.output.results);
|
|
15771
|
-
console.log(
|
|
15772
|
-
`[DEBUG] e2ePhase.e2eTests: E2E results=${JSON.stringify(e2eResults)}`
|
|
15773
|
-
);
|
|
15774
15764
|
return mergeLayerResults(context.layerResults, e2eResults);
|
|
15775
15765
|
}
|
|
15776
15766
|
})
|
|
@@ -15795,7 +15785,6 @@ ${generateCommentBody(commentInput)}`;
|
|
|
15795
15785
|
onDone: {
|
|
15796
15786
|
target: "finalize",
|
|
15797
15787
|
actions: [
|
|
15798
|
-
() => console.log("[DEBUG] e2ePhase complete, transitioning to finalize"),
|
|
15799
15788
|
// Compute final exit code including E2E results
|
|
15800
15789
|
assign({
|
|
15801
15790
|
exitCode: ({ context }) => computeExitCodeFromLayerResults(context.layerResults)
|
|
@@ -15859,113 +15848,47 @@ ${generateCommentBody(commentInput)}`;
|
|
|
15859
15848
|
}
|
|
15860
15849
|
},
|
|
15861
15850
|
postComment: {
|
|
15862
|
-
entry: () => {
|
|
15863
|
-
console.log("[DEBUG] Entering postComment state");
|
|
15864
|
-
},
|
|
15865
15851
|
always: [
|
|
15866
15852
|
{
|
|
15867
15853
|
// Skip if GitHub comment should not be posted (mode, env, flag checks)
|
|
15868
|
-
guard: ({ context }) =>
|
|
15869
|
-
const shouldPost = shouldPostGitHubComment(context);
|
|
15870
|
-
const isCiPr = isCiPrMode(context);
|
|
15871
|
-
console.log(
|
|
15872
|
-
`[DEBUG] postComment guard: shouldPost=${shouldPost}, isCiPr=${isCiPr}, mode=${context.mode}, env=${context.executionEnv}, skipFlag=${context.input.skipGithubComment}`
|
|
15873
|
-
);
|
|
15874
|
-
if (!shouldPost) {
|
|
15875
|
-
console.log(
|
|
15876
|
-
`[DEBUG] Skipping final comment: shouldPostGitHubComment=false (mode=${context.mode}, env=${context.executionEnv})`
|
|
15877
|
-
);
|
|
15878
|
-
}
|
|
15879
|
-
return !shouldPost;
|
|
15880
|
-
},
|
|
15854
|
+
guard: ({ context }) => !shouldPostGitHubComment(context),
|
|
15881
15855
|
target: "complete"
|
|
15882
15856
|
},
|
|
15883
15857
|
{
|
|
15884
15858
|
// Skip if PR number is not available (can't post without it)
|
|
15885
|
-
guard: ({ context }) =>
|
|
15886
|
-
const skip = !context.prContext?.prNumber;
|
|
15887
|
-
if (skip) {
|
|
15888
|
-
console.log("[DEBUG] Skipping final comment: prNumber not available");
|
|
15889
|
-
}
|
|
15890
|
-
return skip;
|
|
15891
|
-
},
|
|
15859
|
+
guard: ({ context }) => !context.prContext?.prNumber,
|
|
15892
15860
|
target: "complete"
|
|
15893
15861
|
}
|
|
15894
15862
|
],
|
|
15895
15863
|
invoke: {
|
|
15896
15864
|
src: "upsertComment",
|
|
15897
15865
|
input: ({ context }) => {
|
|
15898
|
-
|
|
15899
|
-
|
|
15900
|
-
|
|
15901
|
-
const commentInput = createCommentInput(context);
|
|
15902
|
-
const body = `<!-- runa-ci-report -->
|
|
15866
|
+
const prNumber = assertPrNumber(context);
|
|
15867
|
+
const commentInput = createCommentInput(context);
|
|
15868
|
+
const body = `<!-- runa-ci-report -->
|
|
15903
15869
|
${generateCommentBody(commentInput)}`;
|
|
15904
|
-
|
|
15905
|
-
|
|
15906
|
-
|
|
15907
|
-
|
|
15908
|
-
|
|
15909
|
-
};
|
|
15910
|
-
} catch (error) {
|
|
15911
|
-
console.error(
|
|
15912
|
-
`[DEBUG] Failed to generate comment body: ${error instanceof Error ? error.message : String(error)}`
|
|
15913
|
-
);
|
|
15914
|
-
throw error;
|
|
15915
|
-
}
|
|
15916
|
-
},
|
|
15917
|
-
onDone: {
|
|
15918
|
-
target: "complete",
|
|
15919
|
-
actions: ({ event }) => {
|
|
15920
|
-
if (event.output.success) {
|
|
15921
|
-
console.log("[DEBUG] Final comment posted successfully");
|
|
15922
|
-
} else {
|
|
15923
|
-
console.error(
|
|
15924
|
-
`[DEBUG] Failed to post final comment: ${event.output.error ?? "Unknown error"}`
|
|
15925
|
-
);
|
|
15926
|
-
}
|
|
15927
|
-
}
|
|
15870
|
+
return {
|
|
15871
|
+
issueNumber: prNumber,
|
|
15872
|
+
marker: "<!-- runa-ci-report -->",
|
|
15873
|
+
body
|
|
15874
|
+
};
|
|
15928
15875
|
},
|
|
15929
|
-
|
|
15930
|
-
|
|
15931
|
-
actions: ({ event }) => {
|
|
15932
|
-
console.error(
|
|
15933
|
-
`[DEBUG] postComment actor error: ${event.error instanceof Error ? event.error.message : String(event.error)}`
|
|
15934
|
-
);
|
|
15935
|
-
}
|
|
15936
|
-
}
|
|
15876
|
+
onDone: { target: "complete" },
|
|
15877
|
+
onError: { target: "complete" }
|
|
15937
15878
|
}
|
|
15938
15879
|
},
|
|
15939
15880
|
complete: {
|
|
15940
|
-
entry: () => {
|
|
15941
|
-
console.log("[DEBUG] Entered finalize.complete (final sub-state)");
|
|
15942
|
-
},
|
|
15943
15881
|
type: "final"
|
|
15944
15882
|
}
|
|
15945
15883
|
},
|
|
15946
15884
|
onDone: [
|
|
15947
|
-
{
|
|
15948
|
-
|
|
15949
|
-
target: "failed",
|
|
15950
|
-
actions: () => {
|
|
15951
|
-
console.log("[DEBUG] finalize.onDone -> failed");
|
|
15952
|
-
}
|
|
15953
|
-
},
|
|
15954
|
-
{
|
|
15955
|
-
target: "done",
|
|
15956
|
-
actions: () => {
|
|
15957
|
-
console.log("[DEBUG] finalize.onDone -> done");
|
|
15958
|
-
}
|
|
15959
|
-
}
|
|
15885
|
+
{ guard: ({ context }) => context.exitCode !== 0, target: "failed" },
|
|
15886
|
+
{ target: "done" }
|
|
15960
15887
|
],
|
|
15961
15888
|
exit: [
|
|
15962
|
-
// Stop the app if it was started
|
|
15963
15889
|
({ context }) => {
|
|
15964
15890
|
if (context.appPid) {
|
|
15965
|
-
stopApp(context.appPid).catch((
|
|
15966
|
-
console.error(
|
|
15967
|
-
`[DEBUG] Warning: Failed to stop app (pid: ${context.appPid}): ${getErrorMessage(error)}`
|
|
15968
|
-
);
|
|
15891
|
+
stopApp(context.appPid).catch(() => {
|
|
15969
15892
|
});
|
|
15970
15893
|
}
|
|
15971
15894
|
}
|
|
@@ -15985,23 +15908,13 @@ ${generateCommentBody(commentInput)}`;
|
|
|
15985
15908
|
}
|
|
15986
15909
|
},
|
|
15987
15910
|
type: "final",
|
|
15988
|
-
entry:
|
|
15989
|
-
() =>
|
|
15990
|
-
|
|
15991
|
-
|
|
15992
|
-
|
|
15993
|
-
|
|
15994
|
-
|
|
15995
|
-
const computed = computeExitCodeFromLayerResults(context.layerResults);
|
|
15996
|
-
if (computed !== 0) {
|
|
15997
|
-
console.log(
|
|
15998
|
-
`[DEBUG] done state: Computing exitCode from layerResults: ${computed} (was ${context.exitCode})`
|
|
15999
|
-
);
|
|
16000
|
-
}
|
|
16001
|
-
return computed;
|
|
16002
|
-
}
|
|
16003
|
-
})
|
|
16004
|
-
]
|
|
15911
|
+
entry: assign({
|
|
15912
|
+
durationMs: () => Date.now(),
|
|
15913
|
+
exitCode: ({ context }) => {
|
|
15914
|
+
if (context.exitCode !== 0) return context.exitCode;
|
|
15915
|
+
return computeExitCodeFromLayerResults(context.layerResults);
|
|
15916
|
+
}
|
|
15917
|
+
})
|
|
16005
15918
|
},
|
|
16006
15919
|
failed: {
|
|
16007
15920
|
meta: {
|
|
@@ -16015,14 +15928,10 @@ ${generateCommentBody(commentInput)}`;
|
|
|
16015
15928
|
},
|
|
16016
15929
|
type: "final",
|
|
16017
15930
|
entry: [
|
|
16018
|
-
({ context }) => console.log(`[DEBUG] Entered final state: failed (exitCode=${context.exitCode})`),
|
|
16019
|
-
// Preserve exit code from testsFailed if already set, otherwise compute
|
|
16020
|
-
// If there's an error (actor failure), always return 1
|
|
16021
15931
|
assign({
|
|
16022
15932
|
exitCode: ({ context }) => context.exitCode !== 0 ? context.exitCode : context.error ? 1 : computeExitCodeFromLayerResults(context.layerResults),
|
|
16023
15933
|
durationMs: () => Date.now()
|
|
16024
15934
|
}),
|
|
16025
|
-
// Stop the app if it was started
|
|
16026
15935
|
({ context }) => {
|
|
16027
15936
|
if (context.appPid) {
|
|
16028
15937
|
stopApp(context.appPid).catch(() => {
|
|
@@ -24905,13 +24814,12 @@ var SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
|
24905
24814
|
"__snapshots__"
|
|
24906
24815
|
]);
|
|
24907
24816
|
var MAX_FILE_SIZE = 1024 * 1024;
|
|
24908
|
-
var
|
|
24909
|
-
|
|
24910
|
-
|
|
24911
|
-
|
|
24912
|
-
/from\s+['"].*\/database\/src\/schema['"]/,
|
|
24913
|
-
/from\s+['"].*\/packages\/database\/src\/schema['"]/
|
|
24817
|
+
var SCHEMA_IMPORT_SOURCES = [
|
|
24818
|
+
"@runa-ai/runa-database/schema",
|
|
24819
|
+
"@runa/database/schema",
|
|
24820
|
+
"@runa/database"
|
|
24914
24821
|
];
|
|
24822
|
+
var SCHEMA_RELATIVE_PATTERNS = [/\/database\/src\/schema/, /\/packages\/database\/src\/schema/];
|
|
24915
24823
|
function findTsFiles(dir, files = []) {
|
|
24916
24824
|
if (!existsSync(dir)) return files;
|
|
24917
24825
|
const entries = readdirSync(dir, { withFileTypes: true });
|
|
@@ -24929,75 +24837,80 @@ function findTsFiles(dir, files = []) {
|
|
|
24929
24837
|
}
|
|
24930
24838
|
return files;
|
|
24931
24839
|
}
|
|
24932
|
-
function
|
|
24840
|
+
function isSchemaImport(moduleSpecifier) {
|
|
24841
|
+
if (SCHEMA_IMPORT_SOURCES.includes(moduleSpecifier)) {
|
|
24842
|
+
return true;
|
|
24843
|
+
}
|
|
24844
|
+
return SCHEMA_RELATIVE_PATTERNS.some((pattern) => pattern.test(moduleSpecifier));
|
|
24845
|
+
}
|
|
24846
|
+
function extractSchemaImportsFromAST(sourceFile, rootDir) {
|
|
24933
24847
|
const imports = [];
|
|
24848
|
+
const filePath = sourceFile.getFilePath();
|
|
24849
|
+
const relativeFilePath = relative(rootDir, filePath);
|
|
24850
|
+
const importDeclarations = sourceFile.getImportDeclarations();
|
|
24851
|
+
for (const importDecl of importDeclarations) {
|
|
24852
|
+
const moduleSpecifier = importDecl.getModuleSpecifierValue();
|
|
24853
|
+
if (!isSchemaImport(moduleSpecifier)) {
|
|
24854
|
+
continue;
|
|
24855
|
+
}
|
|
24856
|
+
const line = importDecl.getStartLineNumber();
|
|
24857
|
+
const namedImports = importDecl.getNamedImports();
|
|
24858
|
+
for (const namedImport of namedImports) {
|
|
24859
|
+
const name = namedImport.getName();
|
|
24860
|
+
const isTypeOnly = namedImport.isTypeOnly() || importDecl.isTypeOnly();
|
|
24861
|
+
imports.push({
|
|
24862
|
+
file: relativeFilePath,
|
|
24863
|
+
line,
|
|
24864
|
+
symbol: isTypeOnly ? `type ${name}` : name,
|
|
24865
|
+
source: moduleSpecifier
|
|
24866
|
+
});
|
|
24867
|
+
}
|
|
24868
|
+
const namespaceImport = importDecl.getNamespaceImport();
|
|
24869
|
+
if (namespaceImport) {
|
|
24870
|
+
imports.push({
|
|
24871
|
+
file: relativeFilePath,
|
|
24872
|
+
line,
|
|
24873
|
+
symbol: `* as ${namespaceImport.getText()}`,
|
|
24874
|
+
source: moduleSpecifier
|
|
24875
|
+
});
|
|
24876
|
+
}
|
|
24877
|
+
const defaultImport = importDecl.getDefaultImport();
|
|
24878
|
+
if (defaultImport) {
|
|
24879
|
+
imports.push({
|
|
24880
|
+
file: relativeFilePath,
|
|
24881
|
+
line,
|
|
24882
|
+
symbol: `default (${defaultImport.getText()})`,
|
|
24883
|
+
source: moduleSpecifier
|
|
24884
|
+
});
|
|
24885
|
+
}
|
|
24886
|
+
}
|
|
24887
|
+
return imports;
|
|
24888
|
+
}
|
|
24889
|
+
function extractSchemaImports(filePath, rootDir, project) {
|
|
24934
24890
|
try {
|
|
24935
24891
|
const stats = statSync(filePath);
|
|
24936
24892
|
if (stats.size > MAX_FILE_SIZE) {
|
|
24937
|
-
return
|
|
24938
|
-
}
|
|
24939
|
-
const content = readFileSync(filePath, "utf-8");
|
|
24940
|
-
const lines = content.split("\n");
|
|
24941
|
-
for (let i = 0; i < lines.length; i++) {
|
|
24942
|
-
const line = lines[i];
|
|
24943
|
-
const isSchemaImport = SCHEMA_IMPORT_PATTERNS.some((pattern) => pattern.test(line));
|
|
24944
|
-
if (!isSchemaImport) continue;
|
|
24945
|
-
const sourceMatch = line.match(/from\s+['"]([^'"]+)['"]/);
|
|
24946
|
-
if (!sourceMatch) continue;
|
|
24947
|
-
const source = sourceMatch[1];
|
|
24948
|
-
const namedMatch = line.match(/import\s*\{([^}]+)\}/);
|
|
24949
|
-
if (namedMatch) {
|
|
24950
|
-
const symbols = namedMatch[1].split(",").map((s) => {
|
|
24951
|
-
const parts = s.trim().split(/\s+as\s+/);
|
|
24952
|
-
return parts[0].trim();
|
|
24953
|
-
});
|
|
24954
|
-
for (const symbol of symbols) {
|
|
24955
|
-
if (symbol) {
|
|
24956
|
-
imports.push({
|
|
24957
|
-
file: relative(rootDir, filePath),
|
|
24958
|
-
line: i + 1,
|
|
24959
|
-
symbol,
|
|
24960
|
-
source
|
|
24961
|
-
});
|
|
24962
|
-
}
|
|
24963
|
-
}
|
|
24964
|
-
}
|
|
24965
|
-
const namespaceMatch = line.match(/import\s+\*\s+as\s+(\w+)/);
|
|
24966
|
-
if (namespaceMatch) {
|
|
24967
|
-
imports.push({
|
|
24968
|
-
file: relative(rootDir, filePath),
|
|
24969
|
-
line: i + 1,
|
|
24970
|
-
symbol: `* as ${namespaceMatch[1]}`,
|
|
24971
|
-
source
|
|
24972
|
-
});
|
|
24973
|
-
}
|
|
24974
|
-
const typeMatch = line.match(/import\s+type\s*\{([^}]+)\}/);
|
|
24975
|
-
if (typeMatch) {
|
|
24976
|
-
const symbols = typeMatch[1].split(",").map(
|
|
24977
|
-
(s) => s.trim().split(/\s+as\s+/)[0].trim()
|
|
24978
|
-
);
|
|
24979
|
-
for (const symbol of symbols) {
|
|
24980
|
-
if (symbol) {
|
|
24981
|
-
imports.push({
|
|
24982
|
-
file: relative(rootDir, filePath),
|
|
24983
|
-
line: i + 1,
|
|
24984
|
-
symbol: `type ${symbol}`,
|
|
24985
|
-
source
|
|
24986
|
-
});
|
|
24987
|
-
}
|
|
24988
|
-
}
|
|
24989
|
-
}
|
|
24893
|
+
return [];
|
|
24990
24894
|
}
|
|
24895
|
+
const sourceFile = project.addSourceFileAtPath(filePath);
|
|
24896
|
+
const imports = extractSchemaImportsFromAST(sourceFile, rootDir);
|
|
24897
|
+
project.removeSourceFile(sourceFile);
|
|
24898
|
+
return imports;
|
|
24991
24899
|
} catch {
|
|
24900
|
+
return [];
|
|
24992
24901
|
}
|
|
24993
|
-
return imports;
|
|
24994
24902
|
}
|
|
24995
24903
|
function analyzeImportImpact(rootDir) {
|
|
24996
24904
|
const symbolUsage = /* @__PURE__ */ new Map();
|
|
24997
24905
|
const tsFiles = findTsFiles(rootDir);
|
|
24998
24906
|
let filesWithImports = 0;
|
|
24907
|
+
const project = new Project({
|
|
24908
|
+
skipAddingFilesFromTsConfig: true,
|
|
24909
|
+
skipFileDependencyResolution: true,
|
|
24910
|
+
skipLoadingLibFiles: true
|
|
24911
|
+
});
|
|
24999
24912
|
for (const file of tsFiles) {
|
|
25000
|
-
const imports = extractSchemaImports(file, rootDir);
|
|
24913
|
+
const imports = extractSchemaImports(file, rootDir, project);
|
|
25001
24914
|
if (imports.length > 0) {
|
|
25002
24915
|
filesWithImports++;
|
|
25003
24916
|
}
|
|
@@ -26209,30 +26122,84 @@ async function getVercelRootDirectory() {
|
|
|
26209
26122
|
|
|
26210
26123
|
// src/commands/env/constants/local-supabase.ts
|
|
26211
26124
|
init_esm_shims();
|
|
26212
|
-
var
|
|
26125
|
+
var DEFAULT_API_PORT = 54321;
|
|
26126
|
+
var DEFAULT_DB_PORT = 54322;
|
|
26127
|
+
function parsePortFromToml(content, section, key) {
|
|
26128
|
+
const sectionRegex = new RegExp(`\\[${section}\\]([\\s\\S]*?)(?=\\n\\[|$)`, "g");
|
|
26129
|
+
const sectionMatch = sectionRegex.exec(content);
|
|
26130
|
+
if (!sectionMatch) return null;
|
|
26131
|
+
const sectionContent = sectionMatch[1];
|
|
26132
|
+
const keyRegex = new RegExp(`^\\s*${key}\\s*=\\s*(\\d+)`, "m");
|
|
26133
|
+
const keyMatch = keyRegex.exec(sectionContent);
|
|
26134
|
+
if (!keyMatch) return null;
|
|
26135
|
+
const port = Number.parseInt(keyMatch[1], 10);
|
|
26136
|
+
return Number.isFinite(port) && port > 0 && port < 65536 ? port : null;
|
|
26137
|
+
}
|
|
26138
|
+
function readPortsFromConfigToml(projectRoot) {
|
|
26139
|
+
const configPath = path10__default.join(projectRoot, "supabase", "config.toml");
|
|
26140
|
+
try {
|
|
26141
|
+
const content = readFileSync(configPath, "utf-8");
|
|
26142
|
+
const apiPort = parsePortFromToml(content, "api", "port");
|
|
26143
|
+
const dbPort = parsePortFromToml(content, "db", "port");
|
|
26144
|
+
if (apiPort !== null || dbPort !== null) {
|
|
26145
|
+
return {
|
|
26146
|
+
api: apiPort ?? DEFAULT_API_PORT,
|
|
26147
|
+
db: dbPort ?? DEFAULT_DB_PORT
|
|
26148
|
+
};
|
|
26149
|
+
}
|
|
26150
|
+
return null;
|
|
26151
|
+
} catch {
|
|
26152
|
+
return null;
|
|
26153
|
+
}
|
|
26154
|
+
}
|
|
26155
|
+
function detectLocalSupabasePorts(projectRoot = process.cwd()) {
|
|
26156
|
+
const configPorts = readPortsFromConfigToml(projectRoot);
|
|
26157
|
+
if (configPorts) {
|
|
26158
|
+
return configPorts;
|
|
26159
|
+
}
|
|
26160
|
+
return {
|
|
26161
|
+
api: DEFAULT_API_PORT,
|
|
26162
|
+
db: DEFAULT_DB_PORT
|
|
26163
|
+
};
|
|
26164
|
+
}
|
|
26213
26165
|
var LOCAL_SUPABASE_ANON_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0";
|
|
26214
26166
|
var LOCAL_SUPABASE_SERVICE_ROLE_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU";
|
|
26215
|
-
|
|
26216
|
-
|
|
26217
|
-
|
|
26218
|
-
|
|
26219
|
-
|
|
26220
|
-
|
|
26221
|
-
|
|
26222
|
-
|
|
26223
|
-
|
|
26224
|
-
|
|
26225
|
-
|
|
26226
|
-
|
|
26227
|
-
|
|
26228
|
-
|
|
26229
|
-
|
|
26230
|
-
|
|
26231
|
-
|
|
26232
|
-
|
|
26233
|
-
|
|
26234
|
-
|
|
26235
|
-
|
|
26167
|
+
function buildLocalSupabaseUrl(projectRoot = process.cwd()) {
|
|
26168
|
+
const ports = detectLocalSupabasePorts(projectRoot);
|
|
26169
|
+
return `http://127.0.0.1:${ports.api}`;
|
|
26170
|
+
}
|
|
26171
|
+
function buildLocalDatabaseUrl(projectRoot = process.cwd()) {
|
|
26172
|
+
const ports = detectLocalSupabasePorts(projectRoot);
|
|
26173
|
+
return `postgresql://postgres:postgres@127.0.0.1:${ports.db}/postgres`;
|
|
26174
|
+
}
|
|
26175
|
+
function getLocalSupabaseEnvValues(projectRoot = process.cwd()) {
|
|
26176
|
+
const supabaseUrl = buildLocalSupabaseUrl(projectRoot);
|
|
26177
|
+
const databaseUrl = buildLocalDatabaseUrl(projectRoot);
|
|
26178
|
+
return {
|
|
26179
|
+
// Database URLs
|
|
26180
|
+
DATABASE_URL: databaseUrl,
|
|
26181
|
+
DATABASE_URL_ADMIN: databaseUrl,
|
|
26182
|
+
DATABASE_URL_SERVICE: databaseUrl,
|
|
26183
|
+
// Supabase URLs and keys
|
|
26184
|
+
NEXT_PUBLIC_SUPABASE_URL: supabaseUrl,
|
|
26185
|
+
NEXT_PUBLIC_SUPABASE_ANON_KEY: LOCAL_SUPABASE_ANON_KEY,
|
|
26186
|
+
SUPABASE_SERVICE_ROLE_KEY: LOCAL_SUPABASE_SERVICE_ROLE_KEY
|
|
26187
|
+
};
|
|
26188
|
+
}
|
|
26189
|
+
function getLocalValueDescriptions(projectRoot = process.cwd()) {
|
|
26190
|
+
const ports = detectLocalSupabasePorts(projectRoot);
|
|
26191
|
+
return {
|
|
26192
|
+
DATABASE_URL: `localhost:${ports.db} (PostgreSQL)`,
|
|
26193
|
+
DATABASE_URL_ADMIN: `localhost:${ports.db} (PostgreSQL)`,
|
|
26194
|
+
DATABASE_URL_SERVICE: `localhost:${ports.db} (PostgreSQL)`,
|
|
26195
|
+
NEXT_PUBLIC_SUPABASE_URL: `localhost:${ports.api} (Supabase API)`,
|
|
26196
|
+
NEXT_PUBLIC_SUPABASE_ANON_KEY: "local anon key (supabase-demo)",
|
|
26197
|
+
SUPABASE_SERVICE_ROLE_KEY: "local service key (supabase-demo)"
|
|
26198
|
+
};
|
|
26199
|
+
}
|
|
26200
|
+
var LOCAL_SUPABASE_ENV_VALUES = getLocalSupabaseEnvValues();
|
|
26201
|
+
getLocalValueDescriptions();
|
|
26202
|
+
function validateLocalhostValues(envValues) {
|
|
26236
26203
|
const urlKeys = [
|
|
26237
26204
|
"DATABASE_URL",
|
|
26238
26205
|
"DATABASE_URL_ADMIN",
|
|
@@ -26241,7 +26208,7 @@ function validateLocalhostValues() {
|
|
|
26241
26208
|
];
|
|
26242
26209
|
const invalidEntries = [];
|
|
26243
26210
|
for (const key of urlKeys) {
|
|
26244
|
-
const value =
|
|
26211
|
+
const value = envValues[key];
|
|
26245
26212
|
if (value && !value.includes("127.0.0.1") && !value.includes("localhost")) {
|
|
26246
26213
|
invalidEntries.push(key);
|
|
26247
26214
|
}
|
|
@@ -26252,7 +26219,7 @@ function validateLocalhostValues() {
|
|
|
26252
26219
|
);
|
|
26253
26220
|
}
|
|
26254
26221
|
}
|
|
26255
|
-
validateLocalhostValues();
|
|
26222
|
+
validateLocalhostValues(LOCAL_SUPABASE_ENV_VALUES);
|
|
26256
26223
|
|
|
26257
26224
|
// src/commands/env/commands/env-pull.ts
|
|
26258
26225
|
var ERROR_MESSAGES3 = {
|
|
@@ -26496,10 +26463,14 @@ function replaceWithLocalValues(filePath, logger16, dryRun = false) {
|
|
|
26496
26463
|
logger16.warn(" \u26A0\uFE0F No valid env vars found in .env.development (check syntax)");
|
|
26497
26464
|
return;
|
|
26498
26465
|
}
|
|
26466
|
+
const projectRoot = process.cwd();
|
|
26467
|
+
const localEnvValues = getLocalSupabaseEnvValues(projectRoot);
|
|
26468
|
+
const localDescriptions = getLocalValueDescriptions(projectRoot);
|
|
26469
|
+
const replacementKeys = Object.keys(localEnvValues);
|
|
26499
26470
|
const replacedKeys = [];
|
|
26500
|
-
for (const key of
|
|
26501
|
-
if (key in parsed &&
|
|
26502
|
-
parsed[key] =
|
|
26471
|
+
for (const key of replacementKeys) {
|
|
26472
|
+
if (key in parsed && localEnvValues[key]) {
|
|
26473
|
+
parsed[key] = localEnvValues[key];
|
|
26503
26474
|
replacedKeys.push(key);
|
|
26504
26475
|
}
|
|
26505
26476
|
}
|
|
@@ -26518,7 +26489,7 @@ function replaceWithLocalValues(filePath, logger16, dryRun = false) {
|
|
|
26518
26489
|
if (dryRun) {
|
|
26519
26490
|
logger16.info(` \u{1F3E0} Would replace ${replacedKeys.length} variables with localhost values:`);
|
|
26520
26491
|
for (const key of replacedKeys) {
|
|
26521
|
-
const description =
|
|
26492
|
+
const description = localDescriptions[key] || "localhost";
|
|
26522
26493
|
logger16.info(` ${key} \u2192 ${description}`);
|
|
26523
26494
|
}
|
|
26524
26495
|
logger16.info(" (dry-run: no files modified)");
|
|
@@ -26528,7 +26499,7 @@ function replaceWithLocalValues(filePath, logger16, dryRun = false) {
|
|
|
26528
26499
|
`, "utf-8");
|
|
26529
26500
|
logger16.success(` \u{1F3E0} Replaced ${replacedKeys.length} variables with localhost values:`);
|
|
26530
26501
|
for (const key of replacedKeys) {
|
|
26531
|
-
const description =
|
|
26502
|
+
const description = localDescriptions[key] || "localhost";
|
|
26532
26503
|
logger16.info(` ${key} \u2192 ${description}`);
|
|
26533
26504
|
}
|
|
26534
26505
|
}
|
|
@@ -31133,7 +31104,7 @@ function buildDefinitionMap(definitions) {
|
|
|
31133
31104
|
function buildEnhancedMachines(e2eManifest, definitionMap, machineDefinitions) {
|
|
31134
31105
|
const enhanced = {};
|
|
31135
31106
|
const normalizedIdToCanonical = /* @__PURE__ */ new Map();
|
|
31136
|
-
const isMachineFile = (
|
|
31107
|
+
const isMachineFile = (path64) => path64.includes("machine.ts") || path64.includes("machines/") || path64.includes(".machine.ts") || path64.includes("/machine/");
|
|
31137
31108
|
const addMachine = (id, sourceFile, entryBuilder) => {
|
|
31138
31109
|
const normalizedId = normalizeToCanonicalId(id).toLowerCase();
|
|
31139
31110
|
const existingCanonical = normalizedIdToCanonical.get(normalizedId);
|
|
@@ -33729,9 +33700,9 @@ var PATH_MAPPING_RULES = [
|
|
|
33729
33700
|
category: "prompts"
|
|
33730
33701
|
}
|
|
33731
33702
|
];
|
|
33732
|
-
function getCategoryForPath(
|
|
33703
|
+
function getCategoryForPath(path64) {
|
|
33733
33704
|
for (const rule of PATH_MAPPING_RULES) {
|
|
33734
|
-
if (matchGlobPattern(
|
|
33705
|
+
if (matchGlobPattern(path64, rule.runa) || matchGlobPattern(path64, rule.template)) {
|
|
33735
33706
|
return rule.category;
|
|
33736
33707
|
}
|
|
33737
33708
|
}
|
|
@@ -33751,17 +33722,17 @@ function applyReverseRename(normalized, rule, isTemplate) {
|
|
|
33751
33722
|
}
|
|
33752
33723
|
return normalized;
|
|
33753
33724
|
}
|
|
33754
|
-
function generateComparisonKey(
|
|
33755
|
-
let normalized = isTemplate ? normalizeTemplatePath(
|
|
33725
|
+
function generateComparisonKey(path64, isTemplate) {
|
|
33726
|
+
let normalized = isTemplate ? normalizeTemplatePath(path64) : path64;
|
|
33756
33727
|
for (const rule of PATH_MAPPING_RULES) {
|
|
33757
33728
|
normalized = applyReverseRename(normalized, rule, isTemplate);
|
|
33758
33729
|
}
|
|
33759
33730
|
return normalized;
|
|
33760
33731
|
}
|
|
33761
|
-
function matchGlobPattern(
|
|
33732
|
+
function matchGlobPattern(path64, pattern) {
|
|
33762
33733
|
const regexPattern = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*\*/g, "<<DOUBLE_STAR>>").replace(/\*/g, "([^/]*)").replace(/<<DOUBLE_STAR>>/g, "(.*)");
|
|
33763
33734
|
const regex = new RegExp(`^${regexPattern}$`);
|
|
33764
|
-
const match =
|
|
33735
|
+
const match = path64.match(regex);
|
|
33765
33736
|
if (match) {
|
|
33766
33737
|
const subPath = match[1] ?? "";
|
|
33767
33738
|
return { matched: true, subPath };
|
|
@@ -34123,7 +34094,7 @@ var syncCheckMachine = setup({
|
|
|
34123
34094
|
onError: {
|
|
34124
34095
|
target: "failed",
|
|
34125
34096
|
actions: assign({
|
|
34126
|
-
error: ({ event }) => `Discovery failed: ${
|
|
34097
|
+
error: ({ event }) => `Discovery failed: ${getErrorMessage(event.error)}`
|
|
34127
34098
|
})
|
|
34128
34099
|
}
|
|
34129
34100
|
}
|
|
@@ -34150,7 +34121,7 @@ var syncCheckMachine = setup({
|
|
|
34150
34121
|
onError: {
|
|
34151
34122
|
target: "failed",
|
|
34152
34123
|
actions: assign({
|
|
34153
|
-
error: ({ event }) => `Comparison failed: ${
|
|
34124
|
+
error: ({ event }) => `Comparison failed: ${getErrorMessage(event.error)}`
|
|
34154
34125
|
})
|
|
34155
34126
|
}
|
|
34156
34127
|
}
|
|
@@ -34174,7 +34145,7 @@ var syncCheckMachine = setup({
|
|
|
34174
34145
|
onError: {
|
|
34175
34146
|
target: "failed",
|
|
34176
34147
|
actions: assign({
|
|
34177
|
-
error: ({ event }) => `Report generation failed: ${
|
|
34148
|
+
error: ({ event }) => `Report generation failed: ${getErrorMessage(event.error)}`
|
|
34178
34149
|
})
|
|
34179
34150
|
}
|
|
34180
34151
|
}
|
|
@@ -35733,7 +35704,7 @@ async function runVerification(logger16) {
|
|
|
35733
35704
|
}
|
|
35734
35705
|
async function findWorkspacesWithSdkPackages(rootDir, packageNames) {
|
|
35735
35706
|
const fs14 = await import('fs/promises');
|
|
35736
|
-
const
|
|
35707
|
+
const path64 = await import('path');
|
|
35737
35708
|
const { glob: glob8 } = await import('glob');
|
|
35738
35709
|
const result = [];
|
|
35739
35710
|
const packageJsonPaths = await glob8("**/package.json", {
|
|
@@ -35742,7 +35713,7 @@ async function findWorkspacesWithSdkPackages(rootDir, packageNames) {
|
|
|
35742
35713
|
// Exclude root
|
|
35743
35714
|
});
|
|
35744
35715
|
for (const relPath of packageJsonPaths) {
|
|
35745
|
-
const fullPath =
|
|
35716
|
+
const fullPath = path64.join(rootDir, relPath);
|
|
35746
35717
|
try {
|
|
35747
35718
|
const content = await fs14.readFile(fullPath, "utf-8");
|
|
35748
35719
|
const pkg = JSON.parse(content);
|
|
@@ -35755,7 +35726,7 @@ async function findWorkspacesWithSdkPackages(rootDir, packageNames) {
|
|
|
35755
35726
|
}
|
|
35756
35727
|
if (hasAnySdkPackage) {
|
|
35757
35728
|
result.push({
|
|
35758
|
-
dir:
|
|
35729
|
+
dir: path64.dirname(fullPath),
|
|
35759
35730
|
packages: packageNames
|
|
35760
35731
|
// All packages, not just found ones
|
|
35761
35732
|
});
|
|
@@ -36398,7 +36369,7 @@ var SchemaWatcher = class {
|
|
|
36398
36369
|
persistent: true,
|
|
36399
36370
|
ignoreInitial: true
|
|
36400
36371
|
});
|
|
36401
|
-
this.watcher.on("add", (
|
|
36372
|
+
this.watcher.on("add", (path64) => this.handleFileEvent("add", path64)).on("change", (path64) => this.handleFileEvent("change", path64)).on("unlink", (path64) => this.handleFileEvent("unlink", path64)).on("error", (error) => this.handleError(error));
|
|
36402
36373
|
this.logger.success("\u2705 Schema watcher started");
|
|
36403
36374
|
this.logger.info(chalk.dim(" Press Ctrl+C to stop\n"));
|
|
36404
36375
|
}
|
|
@@ -36419,23 +36390,23 @@ var SchemaWatcher = class {
|
|
|
36419
36390
|
/**
|
|
36420
36391
|
* Handle file system events with debouncing
|
|
36421
36392
|
*/
|
|
36422
|
-
handleFileEvent(type,
|
|
36423
|
-
const existingTimer = this.debounceTimers.get(
|
|
36393
|
+
handleFileEvent(type, path64) {
|
|
36394
|
+
const existingTimer = this.debounceTimers.get(path64);
|
|
36424
36395
|
if (existingTimer) {
|
|
36425
36396
|
clearTimeout(existingTimer);
|
|
36426
36397
|
}
|
|
36427
36398
|
const timer = setTimeout(() => {
|
|
36428
|
-
this.processFileEvent({ type, path:
|
|
36429
|
-
this.debounceTimers.delete(
|
|
36399
|
+
this.processFileEvent({ type, path: path64, timestamp: /* @__PURE__ */ new Date() });
|
|
36400
|
+
this.debounceTimers.delete(path64);
|
|
36430
36401
|
}, this.options.debounceMs);
|
|
36431
|
-
this.debounceTimers.set(
|
|
36402
|
+
this.debounceTimers.set(path64, timer);
|
|
36432
36403
|
}
|
|
36433
36404
|
/**
|
|
36434
36405
|
* Process file system event
|
|
36435
36406
|
*/
|
|
36436
36407
|
async processFileEvent(event) {
|
|
36437
|
-
const { type, path:
|
|
36438
|
-
const fileName =
|
|
36408
|
+
const { type, path: path64 } = event;
|
|
36409
|
+
const fileName = path64.split("/").pop() || path64;
|
|
36439
36410
|
switch (type) {
|
|
36440
36411
|
case "add":
|
|
36441
36412
|
this.logger.info(chalk.green(`\u2795 Added: ${fileName}`));
|
|
@@ -36448,19 +36419,19 @@ var SchemaWatcher = class {
|
|
|
36448
36419
|
return;
|
|
36449
36420
|
}
|
|
36450
36421
|
if (this.options.autoValidate) {
|
|
36451
|
-
await this.validateFile(
|
|
36422
|
+
await this.validateFile(path64);
|
|
36452
36423
|
}
|
|
36453
36424
|
}
|
|
36454
36425
|
/**
|
|
36455
36426
|
* Validate schema file
|
|
36456
36427
|
*/
|
|
36457
|
-
async validateFile(
|
|
36428
|
+
async validateFile(path64) {
|
|
36458
36429
|
try {
|
|
36459
36430
|
this.logger.info(chalk.dim(" Validating..."));
|
|
36460
|
-
const validationResult = await validateSchemaFile(
|
|
36431
|
+
const validationResult = await validateSchemaFile(path64);
|
|
36461
36432
|
if (validationResult.isValid) {
|
|
36462
36433
|
this.logger.success(chalk.green(" \u2713 Validation passed"));
|
|
36463
|
-
const risks = await detectSchemaRisks(
|
|
36434
|
+
const risks = await detectSchemaRisks(path64);
|
|
36464
36435
|
if (risks.length > 0) {
|
|
36465
36436
|
this.logger.warn(` \u26A0\uFE0F ${risks.length} risk(s) detected`);
|
|
36466
36437
|
for (const risk of risks) {
|
|
@@ -36475,7 +36446,7 @@ var SchemaWatcher = class {
|
|
|
36475
36446
|
if (this.options.notifyOnError) {
|
|
36476
36447
|
await notifyDesktop({
|
|
36477
36448
|
title: "Schema Validation Failed",
|
|
36478
|
-
message: `${validationResult.errors.length} error(s) in ${
|
|
36449
|
+
message: `${validationResult.errors.length} error(s) in ${path64.split("/").pop()}`,
|
|
36479
36450
|
type: "error"
|
|
36480
36451
|
});
|
|
36481
36452
|
}
|
|
@@ -36694,7 +36665,7 @@ var TestWatcher = class {
|
|
|
36694
36665
|
persistent: true,
|
|
36695
36666
|
ignoreInitial: true
|
|
36696
36667
|
});
|
|
36697
|
-
this.watcher.on("add", (
|
|
36668
|
+
this.watcher.on("add", (path64) => this.handleFileEvent("add", path64)).on("change", (path64) => this.handleFileEvent("change", path64)).on("unlink", (path64) => this.handleFileEvent("unlink", path64)).on("error", (error) => this.handleError(error));
|
|
36698
36669
|
this.logger.success("\u2705 Test watcher started");
|
|
36699
36670
|
this.logger.info(chalk.dim(" Press Ctrl+C to stop\n"));
|
|
36700
36671
|
}
|
|
@@ -36715,26 +36686,26 @@ var TestWatcher = class {
|
|
|
36715
36686
|
/**
|
|
36716
36687
|
* Handle file system events with debouncing
|
|
36717
36688
|
*/
|
|
36718
|
-
handleFileEvent(type,
|
|
36719
|
-
const existingTimer = this.debounceTimers.get(
|
|
36689
|
+
handleFileEvent(type, path64) {
|
|
36690
|
+
const existingTimer = this.debounceTimers.get(path64);
|
|
36720
36691
|
if (existingTimer) {
|
|
36721
36692
|
clearTimeout(existingTimer);
|
|
36722
36693
|
}
|
|
36723
36694
|
const timer = setTimeout(() => {
|
|
36724
|
-
this.processFileEvent(type,
|
|
36725
|
-
this.debounceTimers.delete(
|
|
36695
|
+
this.processFileEvent(type, path64);
|
|
36696
|
+
this.debounceTimers.delete(path64);
|
|
36726
36697
|
}, this.options.debounceMs);
|
|
36727
|
-
this.debounceTimers.set(
|
|
36698
|
+
this.debounceTimers.set(path64, timer);
|
|
36728
36699
|
}
|
|
36729
36700
|
/**
|
|
36730
36701
|
* Process file system event
|
|
36731
36702
|
*/
|
|
36732
|
-
async processFileEvent(type,
|
|
36703
|
+
async processFileEvent(type, path64) {
|
|
36733
36704
|
if (this.isRunning) {
|
|
36734
36705
|
this.logger.warn(chalk.yellow("\u23F3 Tests already running, skipping..."));
|
|
36735
36706
|
return;
|
|
36736
36707
|
}
|
|
36737
|
-
const fileName =
|
|
36708
|
+
const fileName = path64.split("/").pop() || path64;
|
|
36738
36709
|
switch (type) {
|
|
36739
36710
|
case "add":
|
|
36740
36711
|
this.logger.info(chalk.green(`\u2795 Test added: ${fileName}`));
|
|
@@ -36747,7 +36718,7 @@ var TestWatcher = class {
|
|
|
36747
36718
|
return;
|
|
36748
36719
|
}
|
|
36749
36720
|
if (this.options.autoRun) {
|
|
36750
|
-
await this.runTests(
|
|
36721
|
+
await this.runTests(path64);
|
|
36751
36722
|
}
|
|
36752
36723
|
}
|
|
36753
36724
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runa-ai/runa-cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.45",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "AI-powered DevOps CLI",
|
|
6
6
|
"type": "module",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"typescript": "5.9.3",
|
|
54
54
|
"xstate": "5.25.0",
|
|
55
55
|
"zod": "4.3.5",
|
|
56
|
-
"@runa-ai/runa": "0.5.
|
|
57
|
-
"@runa-ai/runa
|
|
56
|
+
"@runa-ai/runa-xstate-test-plugin": "0.5.35",
|
|
57
|
+
"@runa-ai/runa": "0.5.44"
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|
|
60
60
|
"node": ">=20.0.0"
|