chayns-toolkit 3.5.0-beta.6 → 4.0.0-beta.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/lib/cli.js +32 -33
- package/lib/features/config-file/configSchema.d.ts +70 -152
- package/lib/features/config-file/configSchema.js +19 -1
- package/lib/features/config-file/configSchema.js.map +1 -1
- package/package.json +20 -20
- package/lib/assets/file-mock.js +0 -0
- package/lib/assets/react-testing-library.setup.js +0 -2
- package/lib/commands/testCommand.d.ts +0 -28
- package/lib/commands/testCommand.js +0 -64
- package/lib/commands/testCommand.js.map +0 -1
- package/lib/features/config-file/loadConfig.d.ts +0 -3
- package/lib/features/config-file/loadConfig.js +0 -108
- package/lib/features/config-file/loadConfig.js.map +0 -1
- package/lib/util/format.d.ts +0 -9
- package/lib/util/format.js +0 -31
- package/lib/util/format.js.map +0 -1
- package/lib/util/getPackageManager.d.ts +0 -2
- package/lib/util/getPackageManager.js +0 -26
- package/lib/util/getPackageManager.js.map +0 -1
- package/lib/util/loadPackageJson.d.ts +0 -2
- package/lib/util/loadPackageJson.js +0 -12
- package/lib/util/loadPackageJson.js.map +0 -1
- package/lib/util/output.d.ts +0 -8
- package/lib/util/output.js +0 -34
- package/lib/util/output.js.map +0 -1
- package/lib/util/project.d.ts +0 -7
- package/lib/util/project.js +0 -75
- package/lib/util/project.js.map +0 -1
- package/lib/util/runSteps.d.ts +0 -12
- package/lib/util/runSteps.js +0 -44
- package/lib/util/runSteps.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import type { RsbuildConfig } from "@rsbuild/core
|
|
2
|
+
import type { RsbuildConfig } from "@rsbuild/core";
|
|
3
3
|
export declare const configSchema: z.ZodObject<{
|
|
4
4
|
development: z.ZodDefault<z.ZodObject<{
|
|
5
5
|
host: z.ZodDefault<z.ZodString>;
|
|
@@ -70,8 +70,31 @@ export declare const configSchema: z.ZodObject<{
|
|
|
70
70
|
prefixCss: z.ZodDefault<z.ZodBoolean>;
|
|
71
71
|
cssVersion: z.ZodDefault<z.ZodString>;
|
|
72
72
|
exposeModules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
73
|
+
reactRequiredVersions: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodObject<{
|
|
74
|
+
react: z.ZodOptional<z.ZodString>;
|
|
75
|
+
reactDom: z.ZodOptional<z.ZodString>;
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
react?: string | undefined;
|
|
78
|
+
reactDom?: string | undefined;
|
|
79
|
+
}, {
|
|
80
|
+
react?: string | undefined;
|
|
81
|
+
reactDom?: string | undefined;
|
|
82
|
+
}>, {
|
|
83
|
+
react?: string | undefined;
|
|
84
|
+
reactDom?: string | undefined;
|
|
85
|
+
}, {
|
|
86
|
+
react?: string | undefined;
|
|
87
|
+
reactDom?: string | undefined;
|
|
88
|
+
}>]>>;
|
|
73
89
|
disableReactSharing: z.ZodDefault<z.ZodBoolean>;
|
|
74
90
|
reactRuntime: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"automatic">, z.ZodLiteral<"classic">]>>;
|
|
91
|
+
reactCompiler: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
|
|
92
|
+
target: z.ZodOptional<z.ZodString>;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
target?: string | undefined;
|
|
95
|
+
}, {
|
|
96
|
+
target?: string | undefined;
|
|
97
|
+
}>]>>;
|
|
75
98
|
entryPoints: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
76
99
|
pathIndex: z.ZodString;
|
|
77
100
|
pathHtml: z.ZodOptional<z.ZodString>;
|
|
@@ -108,6 +131,13 @@ export declare const configSchema: z.ZodObject<{
|
|
|
108
131
|
media?: string | undefined;
|
|
109
132
|
} | undefined;
|
|
110
133
|
exposeModules?: Record<string, string> | undefined;
|
|
134
|
+
reactRequiredVersions?: string | {
|
|
135
|
+
react?: string | undefined;
|
|
136
|
+
reactDom?: string | undefined;
|
|
137
|
+
} | undefined;
|
|
138
|
+
reactCompiler?: boolean | {
|
|
139
|
+
target?: string | undefined;
|
|
140
|
+
} | undefined;
|
|
111
141
|
}, {
|
|
112
142
|
path?: string | undefined;
|
|
113
143
|
singleBundle?: boolean | undefined;
|
|
@@ -124,8 +154,15 @@ export declare const configSchema: z.ZodObject<{
|
|
|
124
154
|
prefixCss?: boolean | undefined;
|
|
125
155
|
cssVersion?: string | undefined;
|
|
126
156
|
exposeModules?: Record<string, string> | undefined;
|
|
157
|
+
reactRequiredVersions?: string | {
|
|
158
|
+
react?: string | undefined;
|
|
159
|
+
reactDom?: string | undefined;
|
|
160
|
+
} | undefined;
|
|
127
161
|
disableReactSharing?: boolean | undefined;
|
|
128
162
|
reactRuntime?: "automatic" | "classic" | undefined;
|
|
163
|
+
reactCompiler?: boolean | {
|
|
164
|
+
target?: string | undefined;
|
|
165
|
+
} | undefined;
|
|
129
166
|
entryPoints?: Record<string, {
|
|
130
167
|
pathIndex: string;
|
|
131
168
|
pathHtml?: string | undefined;
|
|
@@ -154,6 +191,13 @@ export declare const configSchema: z.ZodObject<{
|
|
|
154
191
|
media?: string | undefined;
|
|
155
192
|
} | undefined;
|
|
156
193
|
exposeModules?: Record<string, string> | undefined;
|
|
194
|
+
reactRequiredVersions?: string | {
|
|
195
|
+
react?: string | undefined;
|
|
196
|
+
reactDom?: string | undefined;
|
|
197
|
+
} | undefined;
|
|
198
|
+
reactCompiler?: boolean | {
|
|
199
|
+
target?: string | undefined;
|
|
200
|
+
} | undefined;
|
|
157
201
|
}, {
|
|
158
202
|
path?: string | undefined;
|
|
159
203
|
singleBundle?: boolean | undefined;
|
|
@@ -170,8 +214,15 @@ export declare const configSchema: z.ZodObject<{
|
|
|
170
214
|
prefixCss?: boolean | undefined;
|
|
171
215
|
cssVersion?: string | undefined;
|
|
172
216
|
exposeModules?: Record<string, string> | undefined;
|
|
217
|
+
reactRequiredVersions?: string | {
|
|
218
|
+
react?: string | undefined;
|
|
219
|
+
reactDom?: string | undefined;
|
|
220
|
+
} | undefined;
|
|
173
221
|
disableReactSharing?: boolean | undefined;
|
|
174
222
|
reactRuntime?: "automatic" | "classic" | undefined;
|
|
223
|
+
reactCompiler?: boolean | {
|
|
224
|
+
target?: string | undefined;
|
|
225
|
+
} | undefined;
|
|
175
226
|
entryPoints?: Record<string, {
|
|
176
227
|
pathIndex: string;
|
|
177
228
|
pathHtml?: string | undefined;
|
|
@@ -199,87 +250,14 @@ export declare const configSchema: z.ZodObject<{
|
|
|
199
250
|
target: z.ZodUnion<[z.ZodLiteral<"server">, z.ZodLiteral<"client">, z.ZodNull]>;
|
|
200
251
|
watch: z.ZodDefault<z.ZodBoolean>;
|
|
201
252
|
}, "strip", z.ZodTypeAny, {
|
|
202
|
-
dev: boolean;
|
|
203
253
|
target: "client" | "server" | null;
|
|
254
|
+
dev: boolean;
|
|
204
255
|
watch: boolean;
|
|
205
256
|
}, {
|
|
206
|
-
dev: boolean;
|
|
207
257
|
target: "client" | "server" | null;
|
|
258
|
+
dev: boolean;
|
|
208
259
|
watch?: boolean | undefined;
|
|
209
260
|
}>], z.ZodUnknown>, z.ZodType<RsbuildConfig, z.ZodTypeDef, RsbuildConfig>>>;
|
|
210
|
-
jest: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodType<Partial<{
|
|
211
|
-
transform: {
|
|
212
|
-
[glob: string]: [string, {
|
|
213
|
-
presets: Array<string | {
|
|
214
|
-
typescriptSupport: boolean;
|
|
215
|
-
flowSupport: boolean;
|
|
216
|
-
transpileModules: string | boolean;
|
|
217
|
-
reactRefreshSupport: boolean;
|
|
218
|
-
}>;
|
|
219
|
-
}] | string;
|
|
220
|
-
};
|
|
221
|
-
moduleFileExtensions: string[];
|
|
222
|
-
testPathIgnorePatterns: string[];
|
|
223
|
-
setupFilesAfterEnv: string[];
|
|
224
|
-
moduleNameMapper: {
|
|
225
|
-
[glob: string]: string;
|
|
226
|
-
};
|
|
227
|
-
testEnvironment: "jsdom" | "node";
|
|
228
|
-
}>, z.ZodTypeDef, Partial<{
|
|
229
|
-
transform: {
|
|
230
|
-
[glob: string]: [string, {
|
|
231
|
-
presets: Array<string | {
|
|
232
|
-
typescriptSupport: boolean;
|
|
233
|
-
flowSupport: boolean;
|
|
234
|
-
transpileModules: string | boolean;
|
|
235
|
-
reactRefreshSupport: boolean;
|
|
236
|
-
}>;
|
|
237
|
-
}] | string;
|
|
238
|
-
};
|
|
239
|
-
moduleFileExtensions: string[];
|
|
240
|
-
testPathIgnorePatterns: string[];
|
|
241
|
-
setupFilesAfterEnv: string[];
|
|
242
|
-
moduleNameMapper: {
|
|
243
|
-
[glob: string]: string;
|
|
244
|
-
};
|
|
245
|
-
testEnvironment: "jsdom" | "node";
|
|
246
|
-
}>>], z.ZodUnknown>, z.ZodType<Partial<{
|
|
247
|
-
transform: {
|
|
248
|
-
[glob: string]: [string, {
|
|
249
|
-
presets: Array<string | {
|
|
250
|
-
typescriptSupport: boolean;
|
|
251
|
-
flowSupport: boolean;
|
|
252
|
-
transpileModules: string | boolean;
|
|
253
|
-
reactRefreshSupport: boolean;
|
|
254
|
-
}>;
|
|
255
|
-
}] | string;
|
|
256
|
-
};
|
|
257
|
-
moduleFileExtensions: string[];
|
|
258
|
-
testPathIgnorePatterns: string[];
|
|
259
|
-
setupFilesAfterEnv: string[];
|
|
260
|
-
moduleNameMapper: {
|
|
261
|
-
[glob: string]: string;
|
|
262
|
-
};
|
|
263
|
-
testEnvironment: "jsdom" | "node";
|
|
264
|
-
}>, z.ZodTypeDef, Partial<{
|
|
265
|
-
transform: {
|
|
266
|
-
[glob: string]: [string, {
|
|
267
|
-
presets: Array<string | {
|
|
268
|
-
typescriptSupport: boolean;
|
|
269
|
-
flowSupport: boolean;
|
|
270
|
-
transpileModules: string | boolean;
|
|
271
|
-
reactRefreshSupport: boolean;
|
|
272
|
-
}>;
|
|
273
|
-
}] | string;
|
|
274
|
-
};
|
|
275
|
-
moduleFileExtensions: string[];
|
|
276
|
-
testPathIgnorePatterns: string[];
|
|
277
|
-
setupFilesAfterEnv: string[];
|
|
278
|
-
moduleNameMapper: {
|
|
279
|
-
[glob: string]: string;
|
|
280
|
-
};
|
|
281
|
-
testEnvironment: "jsdom" | "node";
|
|
282
|
-
}>>>>;
|
|
283
261
|
}, "strip", z.ZodTypeAny, {
|
|
284
262
|
development: {
|
|
285
263
|
host: string;
|
|
@@ -315,6 +293,13 @@ export declare const configSchema: z.ZodObject<{
|
|
|
315
293
|
media?: string | undefined;
|
|
316
294
|
} | undefined;
|
|
317
295
|
exposeModules?: Record<string, string> | undefined;
|
|
296
|
+
reactRequiredVersions?: string | {
|
|
297
|
+
react?: string | undefined;
|
|
298
|
+
reactDom?: string | undefined;
|
|
299
|
+
} | undefined;
|
|
300
|
+
reactCompiler?: boolean | {
|
|
301
|
+
target?: string | undefined;
|
|
302
|
+
} | undefined;
|
|
318
303
|
};
|
|
319
304
|
manifest: {
|
|
320
305
|
host: boolean;
|
|
@@ -323,47 +308,10 @@ export declare const configSchema: z.ZodObject<{
|
|
|
323
308
|
textStringLibraries?: string[] | undefined;
|
|
324
309
|
};
|
|
325
310
|
webpack?: ((args_0: RsbuildConfig, args_1: {
|
|
326
|
-
dev: boolean;
|
|
327
311
|
target: "client" | "server" | null;
|
|
312
|
+
dev: boolean;
|
|
328
313
|
watch?: boolean | undefined;
|
|
329
314
|
}, ...args: unknown[]) => RsbuildConfig) | undefined;
|
|
330
|
-
jest?: ((args_0: Partial<{
|
|
331
|
-
transform: {
|
|
332
|
-
[glob: string]: [string, {
|
|
333
|
-
presets: Array<string | {
|
|
334
|
-
typescriptSupport: boolean;
|
|
335
|
-
flowSupport: boolean;
|
|
336
|
-
transpileModules: string | boolean;
|
|
337
|
-
reactRefreshSupport: boolean;
|
|
338
|
-
}>;
|
|
339
|
-
}] | string;
|
|
340
|
-
};
|
|
341
|
-
moduleFileExtensions: string[];
|
|
342
|
-
testPathIgnorePatterns: string[];
|
|
343
|
-
setupFilesAfterEnv: string[];
|
|
344
|
-
moduleNameMapper: {
|
|
345
|
-
[glob: string]: string;
|
|
346
|
-
};
|
|
347
|
-
testEnvironment: "jsdom" | "node";
|
|
348
|
-
}>, ...args: unknown[]) => Partial<{
|
|
349
|
-
transform: {
|
|
350
|
-
[glob: string]: [string, {
|
|
351
|
-
presets: Array<string | {
|
|
352
|
-
typescriptSupport: boolean;
|
|
353
|
-
flowSupport: boolean;
|
|
354
|
-
transpileModules: string | boolean;
|
|
355
|
-
reactRefreshSupport: boolean;
|
|
356
|
-
}>;
|
|
357
|
-
}] | string;
|
|
358
|
-
};
|
|
359
|
-
moduleFileExtensions: string[];
|
|
360
|
-
testPathIgnorePatterns: string[];
|
|
361
|
-
setupFilesAfterEnv: string[];
|
|
362
|
-
moduleNameMapper: {
|
|
363
|
-
[glob: string]: string;
|
|
364
|
-
};
|
|
365
|
-
testEnvironment: "jsdom" | "node";
|
|
366
|
-
}>) | undefined;
|
|
367
315
|
}, {
|
|
368
316
|
development?: {
|
|
369
317
|
host?: string | undefined;
|
|
@@ -392,8 +340,15 @@ export declare const configSchema: z.ZodObject<{
|
|
|
392
340
|
prefixCss?: boolean | undefined;
|
|
393
341
|
cssVersion?: string | undefined;
|
|
394
342
|
exposeModules?: Record<string, string> | undefined;
|
|
343
|
+
reactRequiredVersions?: string | {
|
|
344
|
+
react?: string | undefined;
|
|
345
|
+
reactDom?: string | undefined;
|
|
346
|
+
} | undefined;
|
|
395
347
|
disableReactSharing?: boolean | undefined;
|
|
396
348
|
reactRuntime?: "automatic" | "classic" | undefined;
|
|
349
|
+
reactCompiler?: boolean | {
|
|
350
|
+
target?: string | undefined;
|
|
351
|
+
} | undefined;
|
|
397
352
|
entryPoints?: Record<string, {
|
|
398
353
|
pathIndex: string;
|
|
399
354
|
pathHtml?: string | undefined;
|
|
@@ -407,47 +362,10 @@ export declare const configSchema: z.ZodObject<{
|
|
|
407
362
|
textStringLibraries?: string[] | undefined;
|
|
408
363
|
} | undefined;
|
|
409
364
|
webpack?: ((args_0: RsbuildConfig, args_1: {
|
|
410
|
-
dev: boolean;
|
|
411
365
|
target: "client" | "server" | null;
|
|
366
|
+
dev: boolean;
|
|
412
367
|
watch: boolean;
|
|
413
368
|
}, ...args: unknown[]) => RsbuildConfig) | undefined;
|
|
414
|
-
jest?: ((args_0: Partial<{
|
|
415
|
-
transform: {
|
|
416
|
-
[glob: string]: [string, {
|
|
417
|
-
presets: Array<string | {
|
|
418
|
-
typescriptSupport: boolean;
|
|
419
|
-
flowSupport: boolean;
|
|
420
|
-
transpileModules: string | boolean;
|
|
421
|
-
reactRefreshSupport: boolean;
|
|
422
|
-
}>;
|
|
423
|
-
}] | string;
|
|
424
|
-
};
|
|
425
|
-
moduleFileExtensions: string[];
|
|
426
|
-
testPathIgnorePatterns: string[];
|
|
427
|
-
setupFilesAfterEnv: string[];
|
|
428
|
-
moduleNameMapper: {
|
|
429
|
-
[glob: string]: string;
|
|
430
|
-
};
|
|
431
|
-
testEnvironment: "jsdom" | "node";
|
|
432
|
-
}>, ...args: unknown[]) => Partial<{
|
|
433
|
-
transform: {
|
|
434
|
-
[glob: string]: [string, {
|
|
435
|
-
presets: Array<string | {
|
|
436
|
-
typescriptSupport: boolean;
|
|
437
|
-
flowSupport: boolean;
|
|
438
|
-
transpileModules: string | boolean;
|
|
439
|
-
reactRefreshSupport: boolean;
|
|
440
|
-
}>;
|
|
441
|
-
}] | string;
|
|
442
|
-
};
|
|
443
|
-
moduleFileExtensions: string[];
|
|
444
|
-
testPathIgnorePatterns: string[];
|
|
445
|
-
setupFilesAfterEnv: string[];
|
|
446
|
-
moduleNameMapper: {
|
|
447
|
-
[glob: string]: string;
|
|
448
|
-
};
|
|
449
|
-
testEnvironment: "jsdom" | "node";
|
|
450
|
-
}>) | undefined;
|
|
451
369
|
}>;
|
|
452
370
|
export type ToolkitConfig = z.input<typeof configSchema>;
|
|
453
371
|
export type ParsedToolkitConfig = z.output<typeof configSchema>;
|
|
@@ -39,8 +39,27 @@ const outputSchema = zod_1.z
|
|
|
39
39
|
.regex(/^\d+\.\d+$/)
|
|
40
40
|
.default("4.2"),
|
|
41
41
|
exposeModules: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
|
|
42
|
+
reactRequiredVersions: zod_1.z
|
|
43
|
+
.union([
|
|
44
|
+
zod_1.z.string().min(1),
|
|
45
|
+
zod_1.z
|
|
46
|
+
.object({
|
|
47
|
+
react: zod_1.z.string().min(1).optional(),
|
|
48
|
+
reactDom: zod_1.z.string().min(1).optional(),
|
|
49
|
+
})
|
|
50
|
+
.refine((data) => Boolean(data.react || data.reactDom), "Need to define at least one key for output.reactRequiredVersions"),
|
|
51
|
+
])
|
|
52
|
+
.optional(),
|
|
42
53
|
disableReactSharing: zod_1.z.boolean().default(false),
|
|
43
54
|
reactRuntime: zod_1.z.union([zod_1.z.literal("automatic"), zod_1.z.literal("classic")]).default("classic"),
|
|
55
|
+
reactCompiler: zod_1.z
|
|
56
|
+
.union([
|
|
57
|
+
zod_1.z.boolean(),
|
|
58
|
+
zod_1.z.object({
|
|
59
|
+
target: zod_1.z.string().optional(),
|
|
60
|
+
}),
|
|
61
|
+
])
|
|
62
|
+
.optional(),
|
|
44
63
|
entryPoints: zod_1.z
|
|
45
64
|
.record(zod_1.z.string(), zod_1.z.object({
|
|
46
65
|
pathIndex: zod_1.z.string(),
|
|
@@ -76,6 +95,5 @@ exports.configSchema = zod_1.z.object({
|
|
|
76
95
|
}))
|
|
77
96
|
.returns(zod_1.z.custom())
|
|
78
97
|
.optional(),
|
|
79
|
-
jest: zod_1.z.function().args(zod_1.z.custom()).returns(zod_1.z.custom()).optional(),
|
|
80
98
|
});
|
|
81
99
|
//# sourceMappingURL=configSchema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../../src/features/config-file/configSchema.ts"],"names":[],"mappings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@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chayns-toolkit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-beta.1",
|
|
4
4
|
"description": "A zero-config toolchain for developing chayns® apps.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chayns",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"lint": "eslint src/ --ext js,jsx,ts,tsx",
|
|
45
45
|
"prepare": "husky install && shx rm -rf .git/hooks && shx ln -s ../.husky .git/hooks",
|
|
46
46
|
"prepublishOnly": "npm run build && npm run build-types",
|
|
47
|
-
"test": "
|
|
47
|
+
"test": "vitest run"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@babel/preset-env": "^7.29.
|
|
50
|
+
"@babel/preset-env": "^7.29.5",
|
|
51
51
|
"@babel/preset-react": "^7.28.5",
|
|
52
52
|
"@chayns-toolkit/eslint-config": "^3.0.2",
|
|
53
53
|
"@module-federation/node": "^2.7.42",
|
|
@@ -58,47 +58,47 @@
|
|
|
58
58
|
"@rsbuild/plugin-node-polyfill": "^1.4.4",
|
|
59
59
|
"@rsbuild/plugin-react": "^2.0.0",
|
|
60
60
|
"@rsbuild/plugin-sass": "^1.5.2",
|
|
61
|
-
"@rsbuild/plugin-svgr": "^2.0.
|
|
62
|
-
"@
|
|
63
|
-
"
|
|
64
|
-
"ajv": "^8.18.0",
|
|
61
|
+
"@rsbuild/plugin-svgr": "^2.0.2",
|
|
62
|
+
"@wyw-in-js/webpack-loader": "^1.1.0",
|
|
63
|
+
"ajv": "^8.20.0",
|
|
65
64
|
"eslint": "^9.39.4",
|
|
66
65
|
"eslint-formatter-pretty": "^6.0.1",
|
|
67
|
-
"jest": "^29.7.0",
|
|
68
66
|
"postcss-prefix-selector": "^2.1.1",
|
|
69
67
|
"react-refresh": "^0.18.0",
|
|
70
68
|
"serve-handler": "^6.1.7",
|
|
71
|
-
"webpack": "^5.
|
|
69
|
+
"webpack": "^5.106.2",
|
|
72
70
|
"webpack-bundle-analyzer": "^5.3.0",
|
|
73
71
|
"zod": "^3.25.76"
|
|
74
72
|
},
|
|
75
73
|
"devDependencies": {
|
|
76
74
|
"@module-federation/enhanced": "^2.4.0",
|
|
75
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
77
76
|
"@types/eslint": "^9.6.1",
|
|
78
|
-
"@types/jest": "^29.5.14",
|
|
79
77
|
"@types/mock-fs": "^4.13.4",
|
|
80
|
-
"@types/node": "^
|
|
78
|
+
"@types/node": "^22.19.17",
|
|
81
79
|
"@types/semver": "^7.7.1",
|
|
82
80
|
"@types/serve-handler": "^6.1.4",
|
|
83
81
|
"@types/webpack-bundle-analyzer": "^4.7.0",
|
|
84
|
-
"chalk": "^
|
|
85
|
-
"commander": "^
|
|
86
|
-
"esbuild": "^0.
|
|
82
|
+
"chalk": "^5.6.2",
|
|
83
|
+
"commander": "^14.0.3",
|
|
84
|
+
"esbuild": "^0.28.0",
|
|
87
85
|
"fast-glob": "^3.3.3",
|
|
88
86
|
"fs-extra": "^11.3.4",
|
|
89
87
|
"husky": "^9.1.7",
|
|
88
|
+
"jsdom": "^29.1.1",
|
|
90
89
|
"mock-fs": "^5.5.0",
|
|
91
|
-
"prettier": "^3.8.
|
|
92
|
-
"prettier-plugin-packagejson": "^
|
|
90
|
+
"prettier": "^3.8.3",
|
|
91
|
+
"prettier-plugin-packagejson": "^3.0.2",
|
|
93
92
|
"pretty-quick": "^4.2.2",
|
|
94
93
|
"shx": "^0.4.0",
|
|
95
|
-
"type-fest": "^
|
|
96
|
-
"typescript": "^
|
|
94
|
+
"type-fest": "^5.6.0",
|
|
95
|
+
"typescript": "^6.0.3",
|
|
96
|
+
"vitest": "^4.1.5"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
99
|
"@module-federation/enhanced": "^2.4.0",
|
|
100
100
|
"react-devtools": ">=4",
|
|
101
|
-
"typescript": "^4.9.0 || ^5.0.0"
|
|
101
|
+
"typescript": "^4.9.0 || ^5.0.0 || ^6.0.0"
|
|
102
102
|
},
|
|
103
103
|
"peerDependenciesMeta": {
|
|
104
104
|
"react-devtools": {
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
111
|
"engines": {
|
|
112
|
-
"node": ">=
|
|
112
|
+
"node": ">=22"
|
|
113
113
|
},
|
|
114
114
|
"publishConfig": {
|
|
115
115
|
"access": "public"
|
package/lib/assets/file-mock.js
DELETED
|
File without changes
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { StepParams } from "../util/runSteps";
|
|
2
|
-
type TestOptions = {
|
|
3
|
-
watch: boolean;
|
|
4
|
-
setupFile: string;
|
|
5
|
-
};
|
|
6
|
-
type BabelPresetOptions = {
|
|
7
|
-
typescriptSupport: boolean;
|
|
8
|
-
flowSupport: boolean;
|
|
9
|
-
transpileModules: string | boolean;
|
|
10
|
-
reactRefreshSupport: boolean;
|
|
11
|
-
};
|
|
12
|
-
type BabelTransformOptions = {
|
|
13
|
-
presets: Array<string | BabelPresetOptions>;
|
|
14
|
-
};
|
|
15
|
-
export type JestConfig = Partial<{
|
|
16
|
-
transform: {
|
|
17
|
-
[glob: string]: [string, BabelTransformOptions] | string;
|
|
18
|
-
};
|
|
19
|
-
moduleFileExtensions: string[];
|
|
20
|
-
testPathIgnorePatterns: string[];
|
|
21
|
-
setupFilesAfterEnv: string[];
|
|
22
|
-
moduleNameMapper: {
|
|
23
|
-
[glob: string]: string;
|
|
24
|
-
};
|
|
25
|
-
testEnvironment: "jsdom" | "node";
|
|
26
|
-
}>;
|
|
27
|
-
export declare function testCommand({ watch, setupFile, }: TestOptions): (stepParams: StepParams) => Promise<void>;
|
|
28
|
-
export {};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.testCommand = testCommand;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const jest_1 = require("jest");
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const output_1 = require("../util/output");
|
|
11
|
-
const project_1 = require("../util/project");
|
|
12
|
-
function testCommand({ watch, setupFile, }) {
|
|
13
|
-
return async ({ config }) => {
|
|
14
|
-
let jestConfig = {
|
|
15
|
-
transform: {
|
|
16
|
-
"\\.[jt]sx?$": [
|
|
17
|
-
"babel-jest",
|
|
18
|
-
{
|
|
19
|
-
presets: ["@babel/preset-react", "@babel/preset-env"],
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
|
|
24
|
-
moduleNameMapper: {
|
|
25
|
-
"^.+\\.(css|less|scss)$": "babel-jest",
|
|
26
|
-
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": path_1.default.resolve(__dirname, "assets", "file-mock.js"),
|
|
27
|
-
},
|
|
28
|
-
testPathIgnorePatterns: ["^.+\\.eslintrc\\.js$"],
|
|
29
|
-
setupFilesAfterEnv: [
|
|
30
|
-
path_1.default.resolve(__dirname, "assets", "react-testing-library.setup.js"),
|
|
31
|
-
],
|
|
32
|
-
testEnvironment: "jsdom",
|
|
33
|
-
};
|
|
34
|
-
if (typeof config.jest === "function") {
|
|
35
|
-
const modifier = config.jest;
|
|
36
|
-
jestConfig = modifier(jestConfig);
|
|
37
|
-
}
|
|
38
|
-
if (setupFile) {
|
|
39
|
-
const setupFilePath = project_1.project.resolvePath(setupFile);
|
|
40
|
-
const warningText = `The specified setup file for the tests (${setupFilePath}) could not be found.`;
|
|
41
|
-
try {
|
|
42
|
-
if (fs_1.default.existsSync(setupFilePath)) {
|
|
43
|
-
if (jestConfig.setupFilesAfterEnv) {
|
|
44
|
-
jestConfig.setupFilesAfterEnv.push(setupFilePath);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
output_1.output.warn(warningText);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
catch {
|
|
52
|
-
output_1.output.warn(warningText);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
const args = [];
|
|
56
|
-
args.push("--config", JSON.stringify(jestConfig));
|
|
57
|
-
if (watch) {
|
|
58
|
-
args.push("--watch");
|
|
59
|
-
}
|
|
60
|
-
// args.push('--json'); // json output could be used for custom formatting
|
|
61
|
-
await (0, jest_1.run)(args);
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=testCommand.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testCommand.js","sourceRoot":"","sources":["../../src/commands/testCommand.ts"],"names":[],"mappings":";;;;;AAoCA,kCA4DC;AAhGD,4CAAmB;AACnB,+BAA0B;AAC1B,gDAAuB;AACvB,2CAAuC;AACvC,6CAAyC;AAgCzC,SAAgB,WAAW,CAAC,EAC3B,KAAK,EACL,SAAS,GACI;IACb,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QAC3B,IAAI,UAAU,GAAe;YAC5B,SAAS,EAAE;gBACV,aAAa,EAAE;oBACd,YAAY;oBACZ;wBACC,OAAO,EAAE,CAAC,qBAAqB,EAAE,mBAAmB,CAAC;qBACrD;iBACD;aACD;YACD,oBAAoB,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;YAChD,gBAAgB,EAAE;gBACjB,wBAAwB,EAAE,YAAY;gBACtC,qFAAqF,EACpF,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,EAAE,cAAc,CAAC;aAClD;YACD,sBAAsB,EAAE,CAAC,sBAAsB,CAAC;YAChD,kBAAkB,EAAE;gBACnB,cAAI,CAAC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