@graphcommerce/next-config 9.1.0-canary.16 → 9.1.0-canary.18
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 +8 -0
- package/__tests__/interceptors/findPlugins.ts +32 -4
- package/dist/generated/config.js +1 -1
- package/dist/index.js +134 -171
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 9.1.0-canary.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`62b71d5`](https://github.com/graphcommerce-org/graphcommerce/commit/62b71d5ed1d482fdb5b76dc19ac4d55fc41fb191) - Solve issue: TypeError: InMemoryLRUCache is not a constructor ([@paales](https://github.com/paales))
|
|
8
|
+
|
|
9
|
+
## 9.1.0-canary.17
|
|
10
|
+
|
|
3
11
|
## 9.1.0-canary.16
|
|
4
12
|
|
|
5
13
|
## 9.1.0-canary.15
|
|
@@ -297,7 +297,14 @@ it('finds plugins', () => {
|
|
|
297
297
|
},
|
|
298
298
|
{
|
|
299
299
|
"enabled": true,
|
|
300
|
-
"
|
|
300
|
+
"sourceExport": "meshConfig",
|
|
301
|
+
"sourceModule": "@graphcommerce/googlerecaptcha/plugins/meshRecaptcha",
|
|
302
|
+
"targetExport": "meshConfig",
|
|
303
|
+
"targetModule": "@graphcommerce/graphql-mesh/meshConfig",
|
|
304
|
+
"type": "function",
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"enabled": true,
|
|
301
308
|
"sourceExport": "GraphQLProvider",
|
|
302
309
|
"sourceModule": "@graphcommerce/googlerecaptcha/plugins/GrecaptchaGraphQLProvider",
|
|
303
310
|
"targetExport": "GraphQLProvider",
|
|
@@ -306,7 +313,6 @@ it('finds plugins', () => {
|
|
|
306
313
|
},
|
|
307
314
|
{
|
|
308
315
|
"enabled": true,
|
|
309
|
-
"ifConfig": "googleRecaptchaKey",
|
|
310
316
|
"sourceExport": "ApolloErrorSnackbar",
|
|
311
317
|
"sourceModule": "@graphcommerce/googlerecaptcha/plugins/GrecaptchaApolloErrorSnackbar",
|
|
312
318
|
"targetExport": "ApolloErrorSnackbar",
|
|
@@ -315,7 +321,6 @@ it('finds plugins', () => {
|
|
|
315
321
|
},
|
|
316
322
|
{
|
|
317
323
|
"enabled": true,
|
|
318
|
-
"ifConfig": "googleRecaptchaKey",
|
|
319
324
|
"sourceExport": "ApolloErrorFullPage",
|
|
320
325
|
"sourceModule": "@graphcommerce/googlerecaptcha/plugins/GrecaptchaApolloErrorFullPage",
|
|
321
326
|
"targetExport": "ApolloErrorFullPage",
|
|
@@ -324,7 +329,6 @@ it('finds plugins', () => {
|
|
|
324
329
|
},
|
|
325
330
|
{
|
|
326
331
|
"enabled": true,
|
|
327
|
-
"ifConfig": "googleRecaptchaKey",
|
|
328
332
|
"sourceExport": "ApolloErrorAlert",
|
|
329
333
|
"sourceModule": "@graphcommerce/googlerecaptcha/plugins/GrecaptchaApolloErrorAlert",
|
|
330
334
|
"targetExport": "ApolloErrorAlert",
|
|
@@ -548,6 +552,14 @@ it('finds plugins', () => {
|
|
|
548
552
|
"targetModule": "@graphcommerce/graphql",
|
|
549
553
|
"type": "component",
|
|
550
554
|
},
|
|
555
|
+
{
|
|
556
|
+
"enabled": true,
|
|
557
|
+
"sourceExport": "meshConfig",
|
|
558
|
+
"sourceModule": "@graphcommerce/magento-store/plugins/meshMagentoStore",
|
|
559
|
+
"targetExport": "meshConfig",
|
|
560
|
+
"targetModule": "@graphcommerce/graphql-mesh/meshConfig",
|
|
561
|
+
"type": "function",
|
|
562
|
+
},
|
|
551
563
|
{
|
|
552
564
|
"enabled": true,
|
|
553
565
|
"sourceExport": "graphqlConfig",
|
|
@@ -556,6 +568,22 @@ it('finds plugins', () => {
|
|
|
556
568
|
"targetModule": "@graphcommerce/graphql",
|
|
557
569
|
"type": "function",
|
|
558
570
|
},
|
|
571
|
+
{
|
|
572
|
+
"enabled": true,
|
|
573
|
+
"sourceExport": "getPrivateQueryContext",
|
|
574
|
+
"sourceModule": "@graphcommerce/magento-store/plugins/magentoCurrencyCode",
|
|
575
|
+
"targetExport": "getPrivateQueryContext",
|
|
576
|
+
"targetModule": "@graphcommerce/graphql",
|
|
577
|
+
"type": "function",
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
"enabled": true,
|
|
581
|
+
"sourceExport": "usePrivateQueryContext",
|
|
582
|
+
"sourceModule": "@graphcommerce/magento-store/plugins/magentoCurrencyCode",
|
|
583
|
+
"targetExport": "usePrivateQueryContext",
|
|
584
|
+
"targetModule": "@graphcommerce/graphql",
|
|
585
|
+
"type": "function",
|
|
586
|
+
},
|
|
559
587
|
{
|
|
560
588
|
"enabled": true,
|
|
561
589
|
"sourceExport": "meshConfig",
|
package/dist/generated/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
const isDefinedNonNullAny = (v) => v !==
|
|
3
|
+
const isDefinedNonNullAny = (v) => v !== void 0 && v !== null;
|
|
4
4
|
const definedNonNullAnySchema = z.any().refine((v) => isDefinedNonNullAny(v));
|
|
5
5
|
const CartPermissionsSchema = z.enum(["CUSTOMER_ONLY", "DISABLED", "ENABLED"]);
|
|
6
6
|
const CompareVariantSchema = z.enum(["CHECKBOX", "ICON"]);
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
1
|
+
import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { createRequire } from 'module';
|
|
4
3
|
import assert from 'assert';
|
|
5
4
|
import crypto from 'crypto';
|
|
6
5
|
import webpack from 'webpack';
|
|
@@ -54,12 +53,6 @@ function findParentPath(directory) {
|
|
|
54
53
|
return null;
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
var require$1 = (
|
|
58
|
-
true
|
|
59
|
-
? /* @__PURE__ */ createRequire(import.meta.url)
|
|
60
|
-
: require
|
|
61
|
-
);
|
|
62
|
-
|
|
63
56
|
class TopologicalSort {
|
|
64
57
|
#nodes;
|
|
65
58
|
#visitedNodes;
|
|
@@ -83,12 +76,12 @@ class TopologicalSort {
|
|
|
83
76
|
const sourceNode = this.#nodes.get(fromKey);
|
|
84
77
|
const targetNode = this.#nodes.get(toKey);
|
|
85
78
|
assert.strictEqual(
|
|
86
|
-
sourceNode !==
|
|
79
|
+
sourceNode !== void 0,
|
|
87
80
|
true,
|
|
88
81
|
`Source package with key ${fromKey} doesn't exist`
|
|
89
82
|
);
|
|
90
83
|
assert.strictEqual(
|
|
91
|
-
targetNode !==
|
|
84
|
+
targetNode !== void 0,
|
|
92
85
|
true,
|
|
93
86
|
`Target package with key ${toKey} doesn't exist`
|
|
94
87
|
);
|
|
@@ -176,7 +169,7 @@ function sig() {
|
|
|
176
169
|
|
|
177
170
|
const resolveCache = /* @__PURE__ */ new Map();
|
|
178
171
|
function findPackageJson(id, root) {
|
|
179
|
-
let dir = id.startsWith("/") ? id : require
|
|
172
|
+
let dir = id.startsWith("/") ? id : require.resolve(id);
|
|
180
173
|
let packageJsonLocation = path.join(dir, "package.json");
|
|
181
174
|
while (!fs.existsSync(packageJsonLocation)) {
|
|
182
175
|
dir = path.dirname(dir);
|
|
@@ -189,7 +182,7 @@ function resolveRecursivePackageJson(dependencyPath, dependencyStructure, root,
|
|
|
189
182
|
const isRoot = dependencyPath === root;
|
|
190
183
|
let fileName;
|
|
191
184
|
try {
|
|
192
|
-
fileName = require
|
|
185
|
+
fileName = require.resolve(path.join(dependencyPath, "package.json"));
|
|
193
186
|
} catch (e2) {
|
|
194
187
|
fileName = findPackageJson(dependencyPath, root);
|
|
195
188
|
}
|
|
@@ -337,175 +330,145 @@ const demoConfig = {
|
|
|
337
330
|
previewSecret: "SECRET"
|
|
338
331
|
};
|
|
339
332
|
|
|
340
|
-
/******************************************************************************
|
|
341
|
-
Copyright (c) Microsoft Corporation.
|
|
342
|
-
|
|
343
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
344
|
-
purpose with or without fee is hereby granted.
|
|
345
|
-
|
|
346
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
347
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
348
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
349
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
350
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
351
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
352
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
353
|
-
***************************************************************************** */
|
|
354
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
355
|
-
|
|
356
|
-
|
|
357
333
|
var __assign = function() {
|
|
358
|
-
__assign = Object.assign || function
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
334
|
+
__assign = Object.assign || function __assign2(t) {
|
|
335
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
336
|
+
s = arguments[i];
|
|
337
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
338
|
+
}
|
|
339
|
+
return t;
|
|
364
340
|
};
|
|
365
341
|
return __assign.apply(this, arguments);
|
|
366
342
|
};
|
|
367
|
-
|
|
368
343
|
function __spreadArray(to, from, pack) {
|
|
369
344
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
345
|
+
if (ar || !(i in from)) {
|
|
346
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
347
|
+
ar[i] = from[i];
|
|
348
|
+
}
|
|
374
349
|
}
|
|
375
350
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
376
351
|
}
|
|
377
|
-
|
|
378
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
352
|
+
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
379
353
|
var e = new Error(message);
|
|
380
354
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
381
355
|
};
|
|
382
356
|
|
|
383
357
|
function isNonNullObject(obj) {
|
|
384
|
-
|
|
358
|
+
return obj !== null && typeof obj === "object";
|
|
385
359
|
}
|
|
386
360
|
|
|
387
361
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
388
362
|
function mergeDeep() {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
}
|
|
395
|
-
// In almost any situation where you could succeed in getting the
|
|
396
|
-
// TypeScript compiler to infer a tuple type for the sources array, you
|
|
397
|
-
// could just use mergeDeep instead of mergeDeepArray, so instead of
|
|
398
|
-
// trying to convert T[] to an intersection type we just infer the array
|
|
399
|
-
// element type, which works perfectly when the sources array has a
|
|
400
|
-
// consistent element type.
|
|
363
|
+
var sources = [];
|
|
364
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
365
|
+
sources[_i] = arguments[_i];
|
|
366
|
+
}
|
|
367
|
+
return mergeDeepArray(sources);
|
|
368
|
+
}
|
|
401
369
|
function mergeDeepArray(sources) {
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
}
|
|
370
|
+
var target = sources[0] || {};
|
|
371
|
+
var count = sources.length;
|
|
372
|
+
if (count > 1) {
|
|
373
|
+
var merger = new DeepMerger();
|
|
374
|
+
for (var i = 1; i < count; ++i) {
|
|
375
|
+
target = merger.merge(target, sources[i]);
|
|
409
376
|
}
|
|
410
|
-
|
|
377
|
+
}
|
|
378
|
+
return target;
|
|
411
379
|
}
|
|
412
|
-
var defaultReconciler = function
|
|
413
|
-
|
|
380
|
+
var defaultReconciler = function(target, source, property) {
|
|
381
|
+
return this.merge(target[property], source[property]);
|
|
414
382
|
};
|
|
415
|
-
var DeepMerger =
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
// the source, and the recursion can terminate here.
|
|
447
|
-
target = _this.shallowCopyForMerge(target);
|
|
448
|
-
target[sourceKey] = source[sourceKey];
|
|
449
|
-
}
|
|
450
|
-
});
|
|
451
|
-
return target;
|
|
452
|
-
}
|
|
453
|
-
// If source (or target) is not an object, let source replace target.
|
|
454
|
-
return source;
|
|
455
|
-
};
|
|
456
|
-
DeepMerger.prototype.shallowCopyForMerge = function (value) {
|
|
457
|
-
if (isNonNullObject(value)) {
|
|
458
|
-
if (!this.pastCopies.has(value)) {
|
|
459
|
-
if (Array.isArray(value)) {
|
|
460
|
-
value = value.slice(0);
|
|
461
|
-
}
|
|
462
|
-
else {
|
|
463
|
-
value = __assign({ __proto__: Object.getPrototypeOf(value) }, value);
|
|
464
|
-
}
|
|
465
|
-
this.pastCopies.add(value);
|
|
383
|
+
var DeepMerger = (
|
|
384
|
+
/** @class */
|
|
385
|
+
function() {
|
|
386
|
+
function DeepMerger2(reconciler) {
|
|
387
|
+
if (reconciler === void 0) {
|
|
388
|
+
reconciler = defaultReconciler;
|
|
389
|
+
}
|
|
390
|
+
this.reconciler = reconciler;
|
|
391
|
+
this.isObject = isNonNullObject;
|
|
392
|
+
this.pastCopies = /* @__PURE__ */ new Set();
|
|
393
|
+
}
|
|
394
|
+
DeepMerger2.prototype.merge = function(target, source) {
|
|
395
|
+
var _this = this;
|
|
396
|
+
var context = [];
|
|
397
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
398
|
+
context[_i - 2] = arguments[_i];
|
|
399
|
+
}
|
|
400
|
+
if (isNonNullObject(source) && isNonNullObject(target)) {
|
|
401
|
+
Object.keys(source).forEach(function(sourceKey) {
|
|
402
|
+
if (hasOwnProperty.call(target, sourceKey)) {
|
|
403
|
+
var targetValue = target[sourceKey];
|
|
404
|
+
if (source[sourceKey] !== targetValue) {
|
|
405
|
+
var result = _this.reconciler.apply(_this, __spreadArray([
|
|
406
|
+
target,
|
|
407
|
+
source,
|
|
408
|
+
sourceKey
|
|
409
|
+
], context, false));
|
|
410
|
+
if (result !== targetValue) {
|
|
411
|
+
target = _this.shallowCopyForMerge(target);
|
|
412
|
+
target[sourceKey] = result;
|
|
413
|
+
}
|
|
466
414
|
}
|
|
415
|
+
} else {
|
|
416
|
+
target = _this.shallowCopyForMerge(target);
|
|
417
|
+
target[sourceKey] = source[sourceKey];
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
return target;
|
|
421
|
+
}
|
|
422
|
+
return source;
|
|
423
|
+
};
|
|
424
|
+
DeepMerger2.prototype.shallowCopyForMerge = function(value) {
|
|
425
|
+
if (isNonNullObject(value)) {
|
|
426
|
+
if (!this.pastCopies.has(value)) {
|
|
427
|
+
if (Array.isArray(value)) {
|
|
428
|
+
value = value.slice(0);
|
|
429
|
+
} else {
|
|
430
|
+
value = __assign({ __proto__: Object.getPrototypeOf(value) }, value);
|
|
431
|
+
}
|
|
432
|
+
this.pastCopies.add(value);
|
|
467
433
|
}
|
|
468
|
-
|
|
434
|
+
}
|
|
435
|
+
return value;
|
|
469
436
|
};
|
|
470
|
-
return
|
|
471
|
-
}()
|
|
437
|
+
return DeepMerger2;
|
|
438
|
+
}()
|
|
439
|
+
);
|
|
472
440
|
|
|
473
441
|
var toString = Object.prototype.toString;
|
|
474
|
-
/**
|
|
475
|
-
* Deeply clones a value to create a new instance.
|
|
476
|
-
*/
|
|
477
442
|
function cloneDeep(value) {
|
|
478
|
-
|
|
443
|
+
return cloneDeepHelper(value);
|
|
479
444
|
}
|
|
480
445
|
function cloneDeepHelper(val, seen) {
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
});
|
|
504
|
-
return copy_2;
|
|
505
|
-
}
|
|
506
|
-
default:
|
|
507
|
-
return val;
|
|
446
|
+
switch (toString.call(val)) {
|
|
447
|
+
case "[object Array]": {
|
|
448
|
+
seen = seen || /* @__PURE__ */ new Map();
|
|
449
|
+
if (seen.has(val))
|
|
450
|
+
return seen.get(val);
|
|
451
|
+
var copy_1 = val.slice(0);
|
|
452
|
+
seen.set(val, copy_1);
|
|
453
|
+
copy_1.forEach(function(child, i) {
|
|
454
|
+
copy_1[i] = cloneDeepHelper(child, seen);
|
|
455
|
+
});
|
|
456
|
+
return copy_1;
|
|
457
|
+
}
|
|
458
|
+
case "[object Object]": {
|
|
459
|
+
seen = seen || /* @__PURE__ */ new Map();
|
|
460
|
+
if (seen.has(val))
|
|
461
|
+
return seen.get(val);
|
|
462
|
+
var copy_2 = Object.create(Object.getPrototypeOf(val));
|
|
463
|
+
seen.set(val, copy_2);
|
|
464
|
+
Object.keys(val).forEach(function(key) {
|
|
465
|
+
copy_2[key] = cloneDeepHelper(val[key], seen);
|
|
466
|
+
});
|
|
467
|
+
return copy_2;
|
|
508
468
|
}
|
|
469
|
+
default:
|
|
470
|
+
return val;
|
|
471
|
+
}
|
|
509
472
|
}
|
|
510
473
|
|
|
511
474
|
function isObject$1(val) {
|
|
@@ -521,7 +484,7 @@ function diff(item1, item2) {
|
|
|
521
484
|
if (!isSame) return item2;
|
|
522
485
|
if (isArray(item1) && isArray(item2)) {
|
|
523
486
|
const res = item1.map((val, idx) => diff(val, item2[idx])).filter((val) => !!val);
|
|
524
|
-
return res.length ? res :
|
|
487
|
+
return res.length ? res : void 0;
|
|
525
488
|
}
|
|
526
489
|
if (isObject$1(item1) && isObject$1(item2)) {
|
|
527
490
|
const entriesRight = Object.fromEntries(
|
|
@@ -531,9 +494,9 @@ function diff(item1, item2) {
|
|
|
531
494
|
Object.entries(item2).map(([key, val]) => [key, diff(item1[key], val)]).filter((entry) => !!entry[1])
|
|
532
495
|
);
|
|
533
496
|
const entries = { ...entriesRight, ...entriesLeft };
|
|
534
|
-
return Object.keys(entries).length ? entries :
|
|
497
|
+
return Object.keys(entries).length ? entries : void 0;
|
|
535
498
|
}
|
|
536
|
-
return item2 === item1 ?
|
|
499
|
+
return item2 === item1 ? void 0 : item2;
|
|
537
500
|
}
|
|
538
501
|
|
|
539
502
|
const fmt$1 = (s) => s.split(/(\d+)/).map((v) => lodash.snakeCase(v)).join("");
|
|
@@ -621,7 +584,7 @@ function mergeEnvIntoConfig(schema, config, env) {
|
|
|
621
584
|
const envValue = filteredEnv[envVar];
|
|
622
585
|
applyResult.push({ envVar, envValue, dotVar, error });
|
|
623
586
|
});
|
|
624
|
-
return [
|
|
587
|
+
return [void 0, applyResult];
|
|
625
588
|
}
|
|
626
589
|
Object.entries(result.data).forEach(([envVar, value]) => {
|
|
627
590
|
const dotVar = envToDot[envVar];
|
|
@@ -655,9 +618,9 @@ function formatAppliedEnv(applyResult) {
|
|
|
655
618
|
return `${chalk.yellowBright(` \u203C ${envVariableFmt}`)} => ${warning.join(", ")}`;
|
|
656
619
|
}
|
|
657
620
|
if (!dotVar) return chalk.red(`${envVariableFmt} => ignored (no matching config)`);
|
|
658
|
-
if (from ===
|
|
659
|
-
if (from ===
|
|
660
|
-
if (from !==
|
|
621
|
+
if (from === void 0 && to === void 0) return ` = ${baseLog}: (ignored)`;
|
|
622
|
+
if (from === void 0 && to !== void 0) return ` ${chalk.green("+")} ${baseLog}`;
|
|
623
|
+
if (from !== void 0 && to === void 0) return ` ${chalk.red("-")} ${baseLog}`;
|
|
661
624
|
return ` ${chalk.yellowBright("~")} ${baseLog}`;
|
|
662
625
|
});
|
|
663
626
|
let header = chalk.blueBright("info");
|
|
@@ -668,7 +631,7 @@ function formatAppliedEnv(applyResult) {
|
|
|
668
631
|
}
|
|
669
632
|
|
|
670
633
|
function flattenKeys(value, initialPathPrefix, stringify) {
|
|
671
|
-
if (value === null || value ===
|
|
634
|
+
if (value === null || value === void 0 || typeof value === "number") {
|
|
672
635
|
return { [initialPathPrefix]: value };
|
|
673
636
|
}
|
|
674
637
|
if (typeof value === "string") {
|
|
@@ -848,7 +811,7 @@ function extractValue(node, path, optional = false) {
|
|
|
848
811
|
if (isIdentifier(node)) {
|
|
849
812
|
switch (node.value) {
|
|
850
813
|
case "undefined":
|
|
851
|
-
return
|
|
814
|
+
return void 0;
|
|
852
815
|
default:
|
|
853
816
|
return RUNTIME_VALUE;
|
|
854
817
|
}
|
|
@@ -862,7 +825,7 @@ function extractValue(node, path, optional = false) {
|
|
|
862
825
|
}
|
|
863
826
|
arr.push(extractValue(elem.expression, path, optional));
|
|
864
827
|
} else {
|
|
865
|
-
arr.push(
|
|
828
|
+
arr.push(void 0);
|
|
866
829
|
}
|
|
867
830
|
}
|
|
868
831
|
return arr;
|
|
@@ -913,7 +876,7 @@ function extractExports(module) {
|
|
|
913
876
|
case "VariableDeclaration":
|
|
914
877
|
moduleItem.declaration.declarations.forEach((decl) => {
|
|
915
878
|
if (isIdentifier(decl.id) && decl.init) {
|
|
916
|
-
exports[decl.id.value] = extractValue(decl.init,
|
|
879
|
+
exports[decl.id.value] = extractValue(decl.init, void 0, true);
|
|
917
880
|
}
|
|
918
881
|
});
|
|
919
882
|
break;
|
|
@@ -930,7 +893,7 @@ const pluginConfigParsed = z.object({
|
|
|
930
893
|
ifConfig: z.union([z.string(), z.tuple([z.string(), z.unknown()])]).optional()
|
|
931
894
|
});
|
|
932
895
|
function nonNullable(value) {
|
|
933
|
-
return value !== null && value !==
|
|
896
|
+
return value !== null && value !== void 0;
|
|
934
897
|
}
|
|
935
898
|
const isObject = (input) => typeof input === "object" && input !== null && !Array.isArray(input);
|
|
936
899
|
function parseStructure(ast, gcConfig, sourceModule) {
|
|
@@ -965,7 +928,7 @@ function parseStructure(ast, gcConfig, sourceModule) {
|
|
|
965
928
|
if (!parsed.success) {
|
|
966
929
|
if (errors.length)
|
|
967
930
|
console.error(parsed.error.errors.map((e) => `${e.path} ${e.message}`).join("\n"));
|
|
968
|
-
return
|
|
931
|
+
return void 0;
|
|
969
932
|
}
|
|
970
933
|
let enabled = true;
|
|
971
934
|
if (parsed.data.ifConfig) {
|
|
@@ -1062,7 +1025,7 @@ function printSync(m) {
|
|
|
1062
1025
|
}
|
|
1063
1026
|
|
|
1064
1027
|
function parseAndFindExport(resolved, findExport, resolve) {
|
|
1065
|
-
if (!resolved?.source) return
|
|
1028
|
+
if (!resolved?.source) return void 0;
|
|
1066
1029
|
const ast = parseSync(resolved.source);
|
|
1067
1030
|
for (const node of ast.body) {
|
|
1068
1031
|
if (node.type === "ExportDeclaration") {
|
|
@@ -1108,24 +1071,24 @@ function parseAndFindExport(resolved, findExport, resolve) {
|
|
|
1108
1071
|
if (newResolved && resolved.dependency !== newResolved.dependency) return newResolved;
|
|
1109
1072
|
}
|
|
1110
1073
|
}
|
|
1111
|
-
return
|
|
1074
|
+
return void 0;
|
|
1112
1075
|
}
|
|
1113
1076
|
function findOriginalSource(plug, resolved, resolve) {
|
|
1114
1077
|
if (!resolved?.source)
|
|
1115
1078
|
return {
|
|
1116
|
-
resolved:
|
|
1079
|
+
resolved: void 0,
|
|
1117
1080
|
error: new Error(`Plugin: Can not find module ${plug.targetModule} for ${plug.sourceModule}`)
|
|
1118
1081
|
};
|
|
1119
1082
|
const newResolved = parseAndFindExport(resolved, plug.targetExport, resolve);
|
|
1120
1083
|
if (!newResolved) {
|
|
1121
1084
|
return {
|
|
1122
|
-
resolved:
|
|
1085
|
+
resolved: void 0,
|
|
1123
1086
|
error: new Error(
|
|
1124
1087
|
`Plugin target not found ${plug.targetModule}#${plug.sourceExport} for plugin ${plug.sourceModule}#${plug.sourceExport}`
|
|
1125
1088
|
)
|
|
1126
1089
|
};
|
|
1127
1090
|
}
|
|
1128
|
-
return { resolved: newResolved, error:
|
|
1091
|
+
return { resolved: newResolved, error: void 0 };
|
|
1129
1092
|
}
|
|
1130
1093
|
|
|
1131
1094
|
class Visitor {
|
|
@@ -2747,7 +2710,7 @@ async function generateInterceptors(plugins, resolve, config, force) {
|
|
|
2747
2710
|
await Promise.all(
|
|
2748
2711
|
Object.entries(byTargetModuleAndExport).map(async ([target, interceptor]) => {
|
|
2749
2712
|
const file = `${interceptor.fromRoot}.interceptor.tsx`;
|
|
2750
|
-
const originalSource = !force && await fs$1.access(file, fs$1.constants.F_OK).then(() => true).catch(() => false) ? (await fs$1.readFile(file)).toString() :
|
|
2713
|
+
const originalSource = !force && await fs$1.access(file, fs$1.constants.F_OK).then(() => true).catch(() => false) ? (await fs$1.readFile(file)).toString() : void 0;
|
|
2751
2714
|
return [
|
|
2752
2715
|
target,
|
|
2753
2716
|
await generateInterceptor(interceptor, config ?? {}, originalSource)
|
|
@@ -2885,7 +2848,7 @@ function domains(config) {
|
|
|
2885
2848
|
defaultLocale: loc.locale,
|
|
2886
2849
|
locales: [...acc[loc.domain]?.locales ?? [], loc.locale],
|
|
2887
2850
|
domain: loc.domain,
|
|
2888
|
-
http: process.env.NODE_ENV === "development" ||
|
|
2851
|
+
http: process.env.NODE_ENV === "development" || void 0
|
|
2889
2852
|
};
|
|
2890
2853
|
return acc;
|
|
2891
2854
|
},
|
|
@@ -2920,7 +2883,7 @@ function withGraphCommerce(nextConfig, cwd = process.cwd()) {
|
|
|
2920
2883
|
remotePatterns: [
|
|
2921
2884
|
"magentoEndpoint" in graphcommerceConfig ? {
|
|
2922
2885
|
hostname: new URL(graphcommerceConfig.magentoEndpoint).hostname
|
|
2923
|
-
} :
|
|
2886
|
+
} : void 0,
|
|
2924
2887
|
{ hostname: "**.graphassets.com" },
|
|
2925
2888
|
{ hostname: "*.graphcommerce.org" },
|
|
2926
2889
|
...nextConfig.images?.remotePatterns ?? []
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/next-config",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "9.1.0-canary.
|
|
5
|
+
"version": "9.1.0-canary.18",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "./src/index.ts",
|
|
8
8
|
"exports": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"prepack": "pkgroll --clean-dist"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@graphql-codegen/cli": "5.0.
|
|
22
|
+
"@graphql-codegen/cli": "5.0.5",
|
|
23
23
|
"@swc/core": "1.10.1",
|
|
24
24
|
"@swc/wasm-web": "^1.10.1",
|
|
25
25
|
"@types/circular-dependency-plugin": "^5.0.8",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"zod": "^3.24.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@graphcommerce/prettier-config-pwa": "^9.1.0-canary.
|
|
46
|
+
"@graphcommerce/prettier-config-pwa": "^9.1.0-canary.18",
|
|
47
47
|
"@lingui/loader": "*",
|
|
48
48
|
"@lingui/macro": "*",
|
|
49
49
|
"@lingui/react": "*",
|