@granite-js/cli 0.1.3 → 0.1.5
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/CHANGELOG.md +17 -0
- package/dist/index.cjs +22 -1
- package/dist/index.js +22 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @granite-js/cli
|
|
2
2
|
|
|
3
|
+
## 0.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 767298b: ensure esbuild config applied correctly
|
|
8
|
+
- @granite-js/mpack@0.1.5
|
|
9
|
+
- @granite-js/plugin-core@0.1.5
|
|
10
|
+
- @granite-js/utils@0.1.5
|
|
11
|
+
|
|
12
|
+
## 0.1.4
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- @granite-js/mpack@0.1.4
|
|
17
|
+
- @granite-js/plugin-core@0.1.4
|
|
18
|
+
- @granite-js/utils@0.1.4
|
|
19
|
+
|
|
3
20
|
## 0.1.3
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -384,6 +384,27 @@ function mergeMetroConfig(objValue, srcValue, key) {
|
|
|
384
384
|
}
|
|
385
385
|
return void 0;
|
|
386
386
|
}
|
|
387
|
+
function mergeEsbuildConfig(objValue, srcValue, key) {
|
|
388
|
+
if (key === "banner" && typeof objValue === "object" && typeof srcValue === "object") {
|
|
389
|
+
return Object.entries(srcValue ?? {}).reduce(
|
|
390
|
+
(acc, [key2, value]) => ({
|
|
391
|
+
...acc,
|
|
392
|
+
[key2]: [acc[key2], value].join("\n")
|
|
393
|
+
}),
|
|
394
|
+
objValue ?? {}
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
if (key === "footer" && typeof objValue === "object" && typeof srcValue === "object") {
|
|
398
|
+
return Object.entries(srcValue ?? {}).reduce(
|
|
399
|
+
(acc, [key2, value]) => ({
|
|
400
|
+
...acc,
|
|
401
|
+
[key2]: [acc[key2], value].join("\n")
|
|
402
|
+
}),
|
|
403
|
+
objValue ?? {}
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
return void 0;
|
|
407
|
+
}
|
|
387
408
|
function combineComparers(...fns) {
|
|
388
409
|
return (targetValue, sourceValue, key, target, source) => {
|
|
389
410
|
for (const fn of fns) {
|
|
@@ -398,7 +419,7 @@ function combineComparers(...fns) {
|
|
|
398
419
|
async function mergeConfigFromPlugins(plugins) {
|
|
399
420
|
const pluginsResolved = await (0, import_plugin_core3.flattenPlugins)(plugins);
|
|
400
421
|
return pluginsResolved.reduce(
|
|
401
|
-
(acc, plugin) => (0, import_es_toolkit2.mergeWith)(acc, plugin.config ?? {}, combineComparers(concatArray, mergeMetroConfig)),
|
|
422
|
+
(acc, plugin) => (0, import_es_toolkit2.mergeWith)(acc, plugin.config ?? {}, combineComparers(concatArray, mergeMetroConfig, mergeEsbuildConfig)),
|
|
402
423
|
{}
|
|
403
424
|
);
|
|
404
425
|
}
|
package/dist/index.js
CHANGED
|
@@ -356,6 +356,27 @@ function mergeMetroConfig(objValue, srcValue, key) {
|
|
|
356
356
|
}
|
|
357
357
|
return void 0;
|
|
358
358
|
}
|
|
359
|
+
function mergeEsbuildConfig(objValue, srcValue, key) {
|
|
360
|
+
if (key === "banner" && typeof objValue === "object" && typeof srcValue === "object") {
|
|
361
|
+
return Object.entries(srcValue ?? {}).reduce(
|
|
362
|
+
(acc, [key2, value]) => ({
|
|
363
|
+
...acc,
|
|
364
|
+
[key2]: [acc[key2], value].join("\n")
|
|
365
|
+
}),
|
|
366
|
+
objValue ?? {}
|
|
367
|
+
);
|
|
368
|
+
}
|
|
369
|
+
if (key === "footer" && typeof objValue === "object" && typeof srcValue === "object") {
|
|
370
|
+
return Object.entries(srcValue ?? {}).reduce(
|
|
371
|
+
(acc, [key2, value]) => ({
|
|
372
|
+
...acc,
|
|
373
|
+
[key2]: [acc[key2], value].join("\n")
|
|
374
|
+
}),
|
|
375
|
+
objValue ?? {}
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
return void 0;
|
|
379
|
+
}
|
|
359
380
|
function combineComparers(...fns) {
|
|
360
381
|
return (targetValue, sourceValue, key, target, source) => {
|
|
361
382
|
for (const fn of fns) {
|
|
@@ -370,7 +391,7 @@ function combineComparers(...fns) {
|
|
|
370
391
|
async function mergeConfigFromPlugins(plugins) {
|
|
371
392
|
const pluginsResolved = await flattenPlugins(plugins);
|
|
372
393
|
return pluginsResolved.reduce(
|
|
373
|
-
(acc, plugin) => mergeWith(acc, plugin.config ?? {}, combineComparers(concatArray, mergeMetroConfig)),
|
|
394
|
+
(acc, plugin) => mergeWith(acc, plugin.config ?? {}, combineComparers(concatArray, mergeMetroConfig, mergeEsbuildConfig)),
|
|
374
395
|
{}
|
|
375
396
|
);
|
|
376
397
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@granite-js/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5",
|
|
5
5
|
"description": "The Granite CLI",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"vitest": "^3.0.7"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@granite-js/mpack": "0.1.
|
|
48
|
-
"@granite-js/plugin-core": "0.1.
|
|
49
|
-
"@granite-js/utils": "0.1.
|
|
47
|
+
"@granite-js/mpack": "0.1.5",
|
|
48
|
+
"@granite-js/plugin-core": "0.1.5",
|
|
49
|
+
"@granite-js/utils": "0.1.5",
|
|
50
50
|
"@inquirer/prompts": "^7.2.3",
|
|
51
51
|
"@shopify/semaphore": "^3.1.0",
|
|
52
52
|
"chalk": "^4",
|