@fuzdev/gro 0.192.0 → 0.192.1
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/build.task.d.ts +1 -0
- package/dist/build.task.d.ts.map +1 -1
- package/dist/build.task.js +16 -10
- package/package.json +1 -1
- package/src/lib/build.task.ts +18 -12
package/dist/build.task.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare const Args: z.ZodObject<{
|
|
|
9
9
|
install: z.ZodDefault<z.ZodBoolean>;
|
|
10
10
|
'no-install': z.ZodDefault<z.ZodBoolean>;
|
|
11
11
|
force_build: z.ZodDefault<z.ZodBoolean>;
|
|
12
|
+
allow_dirty: z.ZodDefault<z.ZodBoolean>;
|
|
12
13
|
}, z.core.$strict>;
|
|
13
14
|
export type Args = z.infer<typeof Args>;
|
|
14
15
|
/**
|
package/dist/build.task.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/build.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAOtB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAW/C,cAAc;AACd,eAAO,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"build.task.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/build.task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAOtB,OAAO,EAAY,KAAK,IAAI,EAAC,MAAM,WAAW,CAAC;AAW/C,cAAc;AACd,eAAO,MAAM,IAAI;;;;;;;;;kBAkBf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AASvC,cAAc;AACd,eAAO,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI,CAuG3B,CAAC"}
|
package/dist/build.task.js
CHANGED
|
@@ -24,6 +24,10 @@ export const Args = z.strictObject({
|
|
|
24
24
|
.boolean()
|
|
25
25
|
.meta({ description: 'force a fresh build, ignoring the cache' })
|
|
26
26
|
.default(false),
|
|
27
|
+
allow_dirty: z
|
|
28
|
+
.boolean()
|
|
29
|
+
.meta({ description: 'skip the post-build dirty workspace check' })
|
|
30
|
+
.default(false),
|
|
27
31
|
});
|
|
28
32
|
/**
|
|
29
33
|
* Length of git commit hash when displayed in logs (standard git convention).
|
|
@@ -40,7 +44,7 @@ export const task = {
|
|
|
40
44
|
Args,
|
|
41
45
|
run: async (ctx) => {
|
|
42
46
|
const { args, invoke_task, log, config } = ctx;
|
|
43
|
-
const { sync, gen, install, force_build } = args;
|
|
47
|
+
const { sync, gen, install, force_build, allow_dirty } = args;
|
|
44
48
|
if (sync || install) {
|
|
45
49
|
if (!sync)
|
|
46
50
|
log.warn('sync is false but install is true, so ignoring the sync option');
|
|
@@ -91,15 +95,17 @@ export const task = {
|
|
|
91
95
|
await plugins.adapt();
|
|
92
96
|
await plugins.teardown();
|
|
93
97
|
// Verify workspace didn't become dirty during build
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
'
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
if (!allow_dirty) {
|
|
99
|
+
const final_workspace_status = await git_check_clean_workspace();
|
|
100
|
+
if (final_workspace_status !== workspace_status) {
|
|
101
|
+
// Workspace state changed during build - this indicates a problem
|
|
102
|
+
throw new TaskError('Build process modified tracked files or created untracked files.\n\n' +
|
|
103
|
+
'Git status after build:\n' +
|
|
104
|
+
final_workspace_status +
|
|
105
|
+
'\n\n' +
|
|
106
|
+
'Builds should only write to output directories (build/, dist/, etc.).\n' +
|
|
107
|
+
'This usually indicates a plugin or build step is incorrectly modifying source files.');
|
|
108
|
+
}
|
|
103
109
|
}
|
|
104
110
|
// Save build cache metadata after successful build (only if workspace is clean)
|
|
105
111
|
if (!workspace_dirty) {
|
package/package.json
CHANGED
package/src/lib/build.task.ts
CHANGED
|
@@ -31,6 +31,10 @@ export const Args = z.strictObject({
|
|
|
31
31
|
.boolean()
|
|
32
32
|
.meta({description: 'force a fresh build, ignoring the cache'})
|
|
33
33
|
.default(false),
|
|
34
|
+
allow_dirty: z
|
|
35
|
+
.boolean()
|
|
36
|
+
.meta({description: 'skip the post-build dirty workspace check'})
|
|
37
|
+
.default(false),
|
|
34
38
|
});
|
|
35
39
|
export type Args = z.infer<typeof Args>;
|
|
36
40
|
|
|
@@ -52,7 +56,7 @@ export const task: Task<Args> = {
|
|
|
52
56
|
Args,
|
|
53
57
|
run: async (ctx): Promise<void> => {
|
|
54
58
|
const {args, invoke_task, log, config} = ctx;
|
|
55
|
-
const {sync, gen, install, force_build} = args;
|
|
59
|
+
const {sync, gen, install, force_build, allow_dirty} = args;
|
|
56
60
|
|
|
57
61
|
if (sync || install) {
|
|
58
62
|
if (!sync) log.warn('sync is false but install is true, so ignoring the sync option');
|
|
@@ -113,17 +117,19 @@ export const task: Task<Args> = {
|
|
|
113
117
|
await plugins.teardown();
|
|
114
118
|
|
|
115
119
|
// Verify workspace didn't become dirty during build
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
'
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
if (!allow_dirty) {
|
|
121
|
+
const final_workspace_status = await git_check_clean_workspace();
|
|
122
|
+
if (final_workspace_status !== workspace_status) {
|
|
123
|
+
// Workspace state changed during build - this indicates a problem
|
|
124
|
+
throw new TaskError(
|
|
125
|
+
'Build process modified tracked files or created untracked files.\n\n' +
|
|
126
|
+
'Git status after build:\n' +
|
|
127
|
+
final_workspace_status +
|
|
128
|
+
'\n\n' +
|
|
129
|
+
'Builds should only write to output directories (build/, dist/, etc.).\n' +
|
|
130
|
+
'This usually indicates a plugin or build step is incorrectly modifying source files.',
|
|
131
|
+
);
|
|
132
|
+
}
|
|
127
133
|
}
|
|
128
134
|
|
|
129
135
|
// Save build cache metadata after successful build (only if workspace is clean)
|