@utoo/pack 1.3.1 → 1.3.2

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.
Files changed (2) hide show
  1. package/config_schema.json +280 -225
  2. package/package.json +9 -10
@@ -1,16 +1,9 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "ProjectOptions",
4
- "description": "Top-level project options configuration This represents the root structure of utoopack.json",
3
+ "title": "CompleteConfig",
4
+ "description": "Top-level configuration for utoopack.json This represents the JSON config file structure, aligned with pack-core's `Config` struct.",
5
5
  "type": "object",
6
6
  "properties": {
7
- "buildId": {
8
- "description": "The build id.",
9
- "type": [
10
- "string",
11
- "null"
12
- ]
13
- },
14
7
  "cacheHandler": {
15
8
  "description": "Cache handler configuration",
16
9
  "type": [
@@ -26,24 +19,6 @@
26
19
  ],
27
20
  "additionalProperties": true
28
21
  },
29
- "defineEnv": {
30
- "description": "A map of environment variables which should get injected at compile time.",
31
- "anyOf": [
32
- {
33
- "$ref": "#/definitions/SchemaDefineEnv"
34
- },
35
- {
36
- "type": "null"
37
- }
38
- ]
39
- },
40
- "dev": {
41
- "description": "Whether to run in development mode",
42
- "type": [
43
- "boolean",
44
- "null"
45
- ]
46
- },
47
22
  "devServer": {
48
23
  "description": "Development server configuration",
49
24
  "anyOf": [
@@ -144,13 +119,6 @@
144
119
  }
145
120
  ]
146
121
  },
147
- "packPath": {
148
- "description": "Absolute path for @utoo/pack",
149
- "type": [
150
- "string",
151
- "null"
152
- ]
153
- },
154
122
  "persistentCaching": {
155
123
  "description": "Enable persistent caching",
156
124
  "type": [
@@ -158,21 +126,25 @@
158
126
  "null"
159
127
  ]
160
128
  },
161
- "processEnv": {
162
- "description": "A map of environment variables to use when compiling code.",
129
+ "provider": {
130
+ "description": "Provider (ProvidePlugin) configuration",
163
131
  "type": [
164
132
  "object",
165
133
  "null"
166
134
  ],
167
135
  "additionalProperties": {
168
- "type": "string"
136
+ "$ref": "#/definitions/SchemaProviderConfigValue"
169
137
  }
170
138
  },
171
- "projectPath": {
172
- "description": "A path inside the root_path which contains the app directories.",
173
- "type": [
174
- "string",
175
- "null"
139
+ "react": {
140
+ "description": "React configuration",
141
+ "anyOf": [
142
+ {
143
+ "$ref": "#/definitions/SchemaReactConfig"
144
+ },
145
+ {
146
+ "type": "null"
147
+ }
176
148
  ]
177
149
  },
178
150
  "resolve": {
@@ -186,13 +158,6 @@
186
158
  }
187
159
  ]
188
160
  },
189
- "rootPath": {
190
- "description": "A root path from which all files must be nested under.",
191
- "type": [
192
- "string",
193
- "null"
194
- ]
195
- },
196
161
  "sourceMaps": {
197
162
  "description": "Enable source maps",
198
163
  "type": [
@@ -224,36 +189,152 @@
224
189
  "string",
225
190
  "null"
226
191
  ]
227
- },
228
- "watch": {
229
- "description": "Filesystem watcher options.",
230
- "anyOf": [
192
+ }
193
+ },
194
+ "definitions": {
195
+ "SchemaConfigConditionContentType": {
196
+ "description": "Configuration condition for content type",
197
+ "oneOf": [
231
198
  {
232
- "$ref": "#/definitions/SchemaWatchOptions"
199
+ "description": "Glob pattern for content type matching",
200
+ "type": "object",
201
+ "required": [
202
+ "type",
203
+ "value"
204
+ ],
205
+ "properties": {
206
+ "type": {
207
+ "type": "string",
208
+ "enum": [
209
+ "glob"
210
+ ]
211
+ },
212
+ "value": {
213
+ "type": "string"
214
+ }
215
+ }
233
216
  },
234
217
  {
235
- "type": "null"
218
+ "description": "Regex match for content type",
219
+ "type": "object",
220
+ "required": [
221
+ "type",
222
+ "value"
223
+ ],
224
+ "properties": {
225
+ "type": {
226
+ "type": "string",
227
+ "enum": [
228
+ "regex"
229
+ ]
230
+ },
231
+ "value": {
232
+ "$ref": "#/definitions/SchemaRegexComponents"
233
+ }
234
+ }
236
235
  }
237
236
  ]
238
- }
239
- },
240
- "definitions": {
237
+ },
241
238
  "SchemaConfigConditionItem": {
242
- "description": "Configuration condition item",
243
- "type": "object",
244
- "required": [
245
- "path"
246
- ],
247
- "properties": {
248
- "path": {
249
- "description": "Condition path configuration",
250
- "allOf": [
251
- {
252
- "$ref": "#/definitions/SchemaConfigConditionPath"
239
+ "description": "Configuration condition item — supports compound conditions (all/any/not) and base conditions with path, content, query, and contentType matchers.",
240
+ "anyOf": [
241
+ {
242
+ "description": "All conditions must match",
243
+ "type": "object",
244
+ "required": [
245
+ "all"
246
+ ],
247
+ "properties": {
248
+ "all": {
249
+ "type": "array",
250
+ "items": {
251
+ "$ref": "#/definitions/SchemaConfigConditionItem"
252
+ }
253
253
  }
254
- ]
254
+ }
255
+ },
256
+ {
257
+ "description": "Any condition must match",
258
+ "type": "object",
259
+ "required": [
260
+ "any"
261
+ ],
262
+ "properties": {
263
+ "any": {
264
+ "type": "array",
265
+ "items": {
266
+ "$ref": "#/definitions/SchemaConfigConditionItem"
267
+ }
268
+ }
269
+ }
270
+ },
271
+ {
272
+ "description": "Negate a condition",
273
+ "type": "object",
274
+ "required": [
275
+ "not"
276
+ ],
277
+ "properties": {
278
+ "not": {
279
+ "$ref": "#/definitions/SchemaConfigConditionItem"
280
+ }
281
+ }
282
+ },
283
+ {
284
+ "description": "Base condition with path/content/query/contentType matchers",
285
+ "type": "object",
286
+ "properties": {
287
+ "content": {
288
+ "description": "Content regex",
289
+ "anyOf": [
290
+ {
291
+ "$ref": "#/definitions/SchemaRegexComponents"
292
+ },
293
+ {
294
+ "type": "null"
295
+ }
296
+ ]
297
+ },
298
+ "contentType": {
299
+ "description": "Content type condition",
300
+ "anyOf": [
301
+ {
302
+ "$ref": "#/definitions/SchemaConfigConditionContentType"
303
+ },
304
+ {
305
+ "type": "null"
306
+ }
307
+ ]
308
+ },
309
+ "path": {
310
+ "description": "Path condition",
311
+ "anyOf": [
312
+ {
313
+ "$ref": "#/definitions/SchemaConfigConditionPath"
314
+ },
315
+ {
316
+ "type": "null"
317
+ }
318
+ ]
319
+ },
320
+ "query": {
321
+ "description": "Query condition",
322
+ "anyOf": [
323
+ {
324
+ "$ref": "#/definitions/SchemaConfigConditionQuery"
325
+ },
326
+ {
327
+ "type": "null"
328
+ }
329
+ ]
330
+ }
331
+ }
332
+ },
333
+ {
334
+ "description": "Built-in condition (e.g., \"server\", \"client\", \"edge\")",
335
+ "type": "string"
255
336
  }
256
- }
337
+ ]
257
338
  },
258
339
  "SchemaConfigConditionPath": {
259
340
  "description": "Configuration condition path",
@@ -298,6 +379,49 @@
298
379
  }
299
380
  ]
300
381
  },
382
+ "SchemaConfigConditionQuery": {
383
+ "description": "Configuration condition for query strings",
384
+ "oneOf": [
385
+ {
386
+ "description": "Constant string match for query",
387
+ "type": "object",
388
+ "required": [
389
+ "type",
390
+ "value"
391
+ ],
392
+ "properties": {
393
+ "type": {
394
+ "type": "string",
395
+ "enum": [
396
+ "constant"
397
+ ]
398
+ },
399
+ "value": {
400
+ "type": "string"
401
+ }
402
+ }
403
+ },
404
+ {
405
+ "description": "Regex match for query",
406
+ "type": "object",
407
+ "required": [
408
+ "type",
409
+ "value"
410
+ ],
411
+ "properties": {
412
+ "type": {
413
+ "type": "string",
414
+ "enum": [
415
+ "regex"
416
+ ]
417
+ },
418
+ "value": {
419
+ "$ref": "#/definitions/SchemaRegexComponents"
420
+ }
421
+ }
422
+ }
423
+ ]
424
+ },
301
425
  "SchemaCopyItem": {
302
426
  "description": "Copy item configuration Can be either a string (source path) or an object with from and optional to",
303
427
  "anyOf": [
@@ -327,42 +451,6 @@
327
451
  }
328
452
  ]
329
453
  },
330
- "SchemaDefineEnv": {
331
- "description": "Environment variables for build-time injection",
332
- "type": "object",
333
- "properties": {
334
- "client": {
335
- "description": "Client-side environment variables",
336
- "type": [
337
- "array",
338
- "null"
339
- ],
340
- "items": {
341
- "$ref": "#/definitions/SchemaEnvVar"
342
- }
343
- },
344
- "edge": {
345
- "description": "Edge-side environment variables",
346
- "type": [
347
- "array",
348
- "null"
349
- ],
350
- "items": {
351
- "$ref": "#/definitions/SchemaEnvVar"
352
- }
353
- },
354
- "nodejs": {
355
- "description": "Node.js environment variables",
356
- "type": [
357
- "array",
358
- "null"
359
- ],
360
- "items": {
361
- "$ref": "#/definitions/SchemaEnvVar"
362
- }
363
- }
364
- }
365
- },
366
454
  "SchemaDevServer": {
367
455
  "description": "Development server configuration",
368
456
  "type": "object",
@@ -418,88 +506,30 @@
418
506
  }
419
507
  }
420
508
  },
421
- "SchemaEnvVar": {
422
- "description": "Environment variable pair",
423
- "type": "object",
424
- "required": [
425
- "name",
426
- "value"
427
- ],
428
- "properties": {
429
- "name": {
430
- "description": "Variable name",
431
- "type": "string"
432
- },
433
- "value": {
434
- "description": "Variable value",
435
- "type": "string"
436
- }
437
- }
438
- },
439
509
  "SchemaExperimentalConfig": {
440
510
  "description": "Experimental features configuration",
441
511
  "type": "object",
442
512
  "properties": {
443
- "cacheHandlers": {
444
- "description": "Cache handlers",
445
- "type": [
446
- "object",
447
- "null"
448
- ],
449
- "additionalProperties": {
450
- "type": "string"
451
- }
452
- },
453
- "dynamicIO": {
454
- "description": "Dynamic IO",
455
- "type": [
456
- "boolean",
457
- "null"
458
- ]
459
- },
460
- "esmExternals": {
461
- "description": "ESM externals"
462
- },
463
- "mdxRs": {
464
- "description": "MDX-RS options"
465
- },
466
- "ppr": {
467
- "description": "Partial prerendering"
468
- },
469
513
  "reactCompiler": {
470
514
  "description": "React compiler"
471
515
  },
472
- "serverActions": {
473
- "description": "Server actions"
474
- },
475
516
  "swcPlugins": {
476
- "description": "SWC plugins",
517
+ "description": "SWC plugins as [path, options] tuples",
477
518
  "type": [
478
519
  "array",
479
520
  "null"
480
521
  ],
481
- "items": true
482
- },
483
- "taint": {
484
- "description": "Taint",
485
- "type": [
486
- "boolean",
487
- "null"
488
- ]
489
- },
490
- "useCache": {
491
- "description": "Use cache",
492
- "type": [
493
- "boolean",
494
- "null"
495
- ]
496
- },
497
- "viewTransition": {
498
- "description": "View transition",
499
- "type": [
500
- "boolean",
501
- "null"
502
- ]
522
+ "items": {
523
+ "type": "array",
524
+ "items": [
525
+ {
526
+ "type": "string"
527
+ },
528
+ true
529
+ ],
530
+ "maxItems": 2,
531
+ "minItems": 2
532
+ }
503
533
  }
504
534
  }
505
535
  },
@@ -549,7 +579,7 @@
549
579
  "description": "External dependency configuration",
550
580
  "anyOf": [
551
581
  {
552
- "description": "Simple string external (e.g., \\\"react\\\" -> \\\"React\\\")",
582
+ "description": "Simple string external (e.g., \"react\" -> \"React\")",
553
583
  "type": "string"
554
584
  },
555
585
  {
@@ -815,16 +845,6 @@
815
845
  "description": "Module configuration",
816
846
  "type": "object",
817
847
  "properties": {
818
- "conditions": {
819
- "description": "Module conditions configuration",
820
- "type": [
821
- "object",
822
- "null"
823
- ],
824
- "additionalProperties": {
825
- "$ref": "#/definitions/SchemaConfigConditionItem"
826
- }
827
- },
828
848
  "rules": {
829
849
  "description": "Module rules configuration",
830
850
  "type": [
@@ -961,14 +981,14 @@
961
981
  ]
962
982
  },
963
983
  "removeUnusedExports": {
964
- "description": "Whether to remove unused exports",
984
+ "description": "Whether to remove unused exports. Defaults to false in development, true in production.",
965
985
  "type": [
966
986
  "boolean",
967
987
  "null"
968
988
  ]
969
989
  },
970
990
  "removeUnusedImports": {
971
- "description": "Whether to remove unused imports",
991
+ "description": "Whether to remove unused imports. Defaults to false in development, true in production.",
972
992
  "type": [
973
993
  "boolean",
974
994
  "null"
@@ -1002,7 +1022,7 @@
1002
1022
  ]
1003
1023
  },
1004
1024
  "wasmAsAsset": {
1005
- "description": "Whether to bunle wasm as asset. Defaults to false. When false, WASM files will be output as static assets.",
1025
+ "description": "Whether to bundle WASM as asset. Defaults to false. When false, WASM files will be output as static assets.",
1006
1026
  "type": [
1007
1027
  "boolean",
1008
1028
  "null"
@@ -1014,8 +1034,15 @@
1014
1034
  "description": "Output configuration",
1015
1035
  "type": "object",
1016
1036
  "properties": {
1037
+ "assetModuleFilename": {
1038
+ "description": "Filename pattern for asset modules (images, fonts, etc.)",
1039
+ "type": [
1040
+ "string",
1041
+ "null"
1042
+ ]
1043
+ },
1017
1044
  "chunkFilename": {
1018
- "description": "Filename pattern for chunk files",
1045
+ "description": "Filename pattern for JS chunk files",
1019
1046
  "type": [
1020
1047
  "string",
1021
1048
  "null"
@@ -1045,6 +1072,20 @@
1045
1072
  "$ref": "#/definitions/SchemaCopyItem"
1046
1073
  }
1047
1074
  },
1075
+ "cssChunkFilename": {
1076
+ "description": "Filename pattern for CSS chunk files",
1077
+ "type": [
1078
+ "string",
1079
+ "null"
1080
+ ]
1081
+ },
1082
+ "cssFilename": {
1083
+ "description": "Filename pattern for main CSS files",
1084
+ "type": [
1085
+ "string",
1086
+ "null"
1087
+ ]
1088
+ },
1048
1089
  "entryRootExport": {
1049
1090
  "description": "Expose entry module exports to global scope with the specified name. When set, all named exports from the entry module will be available on window/globalThis under the specified name. If set to empty string, will use package.json name. Default: None (no exposure)",
1050
1091
  "type": [
@@ -1053,7 +1094,7 @@
1053
1094
  ]
1054
1095
  },
1055
1096
  "filename": {
1056
- "description": "Filename pattern for main files",
1097
+ "description": "Filename pattern for main JS files",
1057
1098
  "type": [
1058
1099
  "string",
1059
1100
  "null"
@@ -1066,6 +1107,13 @@
1066
1107
  "null"
1067
1108
  ]
1068
1109
  },
1110
+ "publicPath": {
1111
+ "description": "URL prefix prepended to all chunk and asset URLs. Use 'runtime' for runtime-resolved public path.",
1112
+ "type": [
1113
+ "string",
1114
+ "null"
1115
+ ]
1116
+ },
1069
1117
  "type": {
1070
1118
  "description": "Output type",
1071
1119
  "anyOf": [
@@ -1087,6 +1135,42 @@
1087
1135
  "export"
1088
1136
  ]
1089
1137
  },
1138
+ "SchemaProviderConfigValue": {
1139
+ "description": "Provider configuration value. Can be a simple module name string or a [module, export] tuple.",
1140
+ "anyOf": [
1141
+ {
1142
+ "description": "Simple module import, e.g. \"jquery\"",
1143
+ "type": "string"
1144
+ },
1145
+ {
1146
+ "description": "Named export import, e.g. [\"buffer\", \"Buffer\"]",
1147
+ "type": "array",
1148
+ "items": {
1149
+ "type": "string"
1150
+ }
1151
+ }
1152
+ ]
1153
+ },
1154
+ "SchemaReactConfig": {
1155
+ "description": "React configuration",
1156
+ "type": "object",
1157
+ "properties": {
1158
+ "importSource": {
1159
+ "description": "Custom JSX import source",
1160
+ "type": [
1161
+ "string",
1162
+ "null"
1163
+ ]
1164
+ },
1165
+ "runtime": {
1166
+ "description": "JSX runtime to use (automatic or classic)",
1167
+ "type": [
1168
+ "string",
1169
+ "null"
1170
+ ]
1171
+ }
1172
+ }
1173
+ },
1090
1174
  "SchemaRegexComponents": {
1091
1175
  "description": "Regular expression components",
1092
1176
  "type": "object",
@@ -1241,6 +1325,9 @@
1241
1325
  "less": {
1242
1326
  "description": "Less configuration"
1243
1327
  },
1328
+ "postcss": {
1329
+ "description": "Inline PostCSS configuration"
1330
+ },
1244
1331
  "sass": {
1245
1332
  "description": "Sass configuration"
1246
1333
  },
@@ -1274,38 +1361,6 @@
1274
1361
  }
1275
1362
  }
1276
1363
  ]
1277
- },
1278
- "SchemaWatchOptions": {
1279
- "description": "Filesystem watcher options",
1280
- "type": "object",
1281
- "required": [
1282
- "enable"
1283
- ],
1284
- "properties": {
1285
- "enable": {
1286
- "description": "Whether to watch the filesystem for file changes.",
1287
- "type": "boolean"
1288
- },
1289
- "ignored": {
1290
- "description": "Paths to ignore when watching for file changes. By default, ignores: node_modules",
1291
- "type": [
1292
- "array",
1293
- "null"
1294
- ],
1295
- "items": {
1296
- "type": "string"
1297
- }
1298
- },
1299
- "pollInterval": {
1300
- "description": "Enable polling at a certain interval if the native file watching doesn't work (e.g. docker).",
1301
- "type": [
1302
- "integer",
1303
- "null"
1304
- ],
1305
- "format": "uint64",
1306
- "minimum": 0.0
1307
- }
1308
- }
1309
1364
  }
1310
1365
  }
1311
1366
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utoo/pack",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "main": "cjs/index.js",
5
5
  "module": "esm/index.js",
6
6
  "types": "esm/index.d.ts",
@@ -41,8 +41,7 @@
41
41
  "@hono/node-server": "^1.19.11",
42
42
  "@hono/node-ws": "^1.3.0",
43
43
  "@swc/helpers": "0.5.15",
44
- "@utoo/pack-shared": "1.3.1",
45
- "@utoo/style-loader": "^1.0.0",
44
+ "@utoo/pack-shared": "1.3.2",
46
45
  "domparser-rs": "^0.0.7",
47
46
  "find-up": "4.1.0",
48
47
  "get-port": "^7.1.0",
@@ -90,12 +89,12 @@
90
89
  },
91
90
  "repository": "git@github.com:utooland/utoo.git",
92
91
  "optionalDependencies": {
93
- "@utoo/pack-darwin-arm64": "1.3.1",
94
- "@utoo/pack-darwin-x64": "1.3.1",
95
- "@utoo/pack-linux-arm64-gnu": "1.3.1",
96
- "@utoo/pack-linux-arm64-musl": "1.3.1",
97
- "@utoo/pack-linux-x64-gnu": "1.3.1",
98
- "@utoo/pack-linux-x64-musl": "1.3.1",
99
- "@utoo/pack-win32-x64-msvc": "1.3.1"
92
+ "@utoo/pack-darwin-arm64": "1.3.2",
93
+ "@utoo/pack-darwin-x64": "1.3.2",
94
+ "@utoo/pack-linux-arm64-gnu": "1.3.2",
95
+ "@utoo/pack-linux-arm64-musl": "1.3.2",
96
+ "@utoo/pack-linux-x64-gnu": "1.3.2",
97
+ "@utoo/pack-linux-x64-musl": "1.3.2",
98
+ "@utoo/pack-win32-x64-msvc": "1.3.2"
100
99
  }
101
100
  }