@salesforce/pwa-kit-dev 3.15.0-nightly-20251208080231 → 3.15.0-preview.0
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.
|
@@ -17,7 +17,7 @@ var _ssrNamespacePaths = require("@salesforce/pwa-kit-runtime/utils/ssr-namespac
|
|
|
17
17
|
var _overridesPlugin = _interopRequireDefault(require("./overrides-plugin"));
|
|
18
18
|
var _plugins = require("./plugins");
|
|
19
19
|
var _configNames = require("./config-names");
|
|
20
|
-
var _pkg$ccExtensibility, _pkg$ccExtensibility2, _pkg$ccExtensibility3, _pkg$ccExtensibility4, _pkg$ccExtensibility5, _pkg$ccExtensibility6, _pkg$ccExtensibility7, _pkg$ccExtensibility8, _pkg$ccExtensibility9, _pkg$
|
|
20
|
+
var _pkg$ccExtensibility, _pkg$ccExtensibility2, _pkg$ccExtensibility3, _pkg$ccExtensibility4, _pkg$ccExtensibility5, _pkg$ccExtensibility6, _pkg$ccExtensibility7, _pkg$ccExtensibility8, _pkg$ccExtensibility9, _pkg$ccExtensibility0, _pkg$ccExtensibility1, _pkg$ccExtensibility10;
|
|
21
21
|
/*
|
|
22
22
|
* Copyright (c) 2021, salesforce.com, inc.
|
|
23
23
|
* All rights reserved.
|
|
@@ -27,8 +27,7 @@ var _pkg$ccExtensibility, _pkg$ccExtensibility2, _pkg$ccExtensibility3, _pkg$ccE
|
|
|
27
27
|
/* eslint-env node */
|
|
28
28
|
// For more information on these settings, see https://webpack.js.org/configuration
|
|
29
29
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
30
|
-
function
|
|
31
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
30
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
32
31
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
33
32
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
34
33
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -57,8 +56,8 @@ if ([production, development].indexOf(mode) < 0) {
|
|
|
57
56
|
const EXT_OVERRIDES_DIR = exports.EXT_OVERRIDES_DIR = typeof (pkg === null || pkg === void 0 ? void 0 : (_pkg$ccExtensibility = pkg.ccExtensibility) === null || _pkg$ccExtensibility === void 0 ? void 0 : _pkg$ccExtensibility.overridesDir) === 'string' && !(pkg !== null && pkg !== void 0 && (_pkg$ccExtensibility2 = pkg.ccExtensibility) !== null && _pkg$ccExtensibility2 !== void 0 && (_pkg$ccExtensibility3 = _pkg$ccExtensibility2.overridesDir) !== null && _pkg$ccExtensibility3 !== void 0 && _pkg$ccExtensibility3.match(/(^\/|^\\)/)) ? '/' + (pkg === null || pkg === void 0 ? void 0 : (_pkg$ccExtensibility4 = pkg.ccExtensibility) === null || _pkg$ccExtensibility4 === void 0 ? void 0 : (_pkg$ccExtensibility5 = _pkg$ccExtensibility4.overridesDir) === null || _pkg$ccExtensibility5 === void 0 ? void 0 : _pkg$ccExtensibility5.replace(/\\/g, '/')) : pkg !== null && pkg !== void 0 && (_pkg$ccExtensibility6 = pkg.ccExtensibility) !== null && _pkg$ccExtensibility6 !== void 0 && _pkg$ccExtensibility6.overridesDir ? pkg === null || pkg === void 0 ? void 0 : (_pkg$ccExtensibility7 = pkg.ccExtensibility) === null || _pkg$ccExtensibility7 === void 0 ? void 0 : (_pkg$ccExtensibility8 = _pkg$ccExtensibility7.overridesDir) === null || _pkg$ccExtensibility8 === void 0 ? void 0 : _pkg$ccExtensibility8.replace(/\\/g, '/') : '';
|
|
58
57
|
const EXT_OVERRIDES_DIR_NO_SLASH = exports.EXT_OVERRIDES_DIR_NO_SLASH = EXT_OVERRIDES_DIR === null || EXT_OVERRIDES_DIR === void 0 ? void 0 : EXT_OVERRIDES_DIR.replace(/^\//, '');
|
|
59
58
|
const EXT_EXTENDS = exports.EXT_EXTENDS = pkg === null || pkg === void 0 ? void 0 : (_pkg$ccExtensibility9 = pkg.ccExtensibility) === null || _pkg$ccExtensibility9 === void 0 ? void 0 : _pkg$ccExtensibility9.extends;
|
|
60
|
-
const EXT_EXTENDS_WIN = exports.EXT_EXTENDS_WIN = pkg === null || pkg === void 0 ? void 0 : (_pkg$
|
|
61
|
-
const EXT_EXTENDABLE = exports.EXT_EXTENDABLE = pkg === null || pkg === void 0 ? void 0 : (_pkg$
|
|
59
|
+
const EXT_EXTENDS_WIN = exports.EXT_EXTENDS_WIN = pkg === null || pkg === void 0 ? void 0 : (_pkg$ccExtensibility0 = pkg.ccExtensibility) === null || _pkg$ccExtensibility0 === void 0 ? void 0 : (_pkg$ccExtensibility1 = _pkg$ccExtensibility0.extends) === null || _pkg$ccExtensibility1 === void 0 ? void 0 : _pkg$ccExtensibility1.replace('/', '\\');
|
|
60
|
+
const EXT_EXTENDABLE = exports.EXT_EXTENDABLE = pkg === null || pkg === void 0 ? void 0 : (_pkg$ccExtensibility10 = pkg.ccExtensibility) === null || _pkg$ccExtensibility10 === void 0 ? void 0 : _pkg$ccExtensibility10.extendable;
|
|
62
61
|
|
|
63
62
|
// TODO: can these be handled in package.json as peerDependencies?
|
|
64
63
|
// https://salesforce-internal.slack.com/archives/C0DKK1FJS/p1672939909212589
|
|
@@ -9,8 +9,7 @@ var _path = _interopRequireWildcard(require("path"));
|
|
|
9
9
|
var _glob = _interopRequireDefault(require("glob"));
|
|
10
10
|
var _config = require("./config");
|
|
11
11
|
var _utils = require("./utils");
|
|
12
|
-
function
|
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
14
|
/*
|
|
16
15
|
* Copyright (c) 2021, salesforce.com, inc.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/pwa-kit-dev",
|
|
3
|
-
"version": "3.15.0-
|
|
3
|
+
"version": "3.15.0-preview.0",
|
|
4
4
|
"description": "Build tools for pwa-kit",
|
|
5
5
|
"homepage": "https://github.com/SalesforceCommerceCloud/pwa-kit/tree/develop/packages/pwa-kit-dev#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@loadable/server": "^5.15.3",
|
|
59
59
|
"@loadable/webpack-plugin": "^5.15.2",
|
|
60
60
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
|
|
61
|
-
"@salesforce/pwa-kit-runtime": "3.15.0-
|
|
61
|
+
"@salesforce/pwa-kit-runtime": "3.15.0-preview.0",
|
|
62
62
|
"@typescript-eslint/eslint-plugin": "^5.57.0",
|
|
63
63
|
"@typescript-eslint/parser": "^5.57.0",
|
|
64
64
|
"archiver": "1.3.0",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"@types/node": "~16.0.3",
|
|
123
123
|
"@types/node-fetch": "~2.6.3",
|
|
124
124
|
"@types/validator": "~13.7.14",
|
|
125
|
-
"internal-lib-build": "3.15.0-
|
|
125
|
+
"internal-lib-build": "3.15.0-preview.0",
|
|
126
126
|
"nock": "^13.3.0",
|
|
127
127
|
"nodemon": "^2.0.22",
|
|
128
128
|
"superagent": "^6.1.0",
|
|
@@ -148,5 +148,5 @@
|
|
|
148
148
|
"publishConfig": {
|
|
149
149
|
"directory": "dist"
|
|
150
150
|
},
|
|
151
|
-
"gitHead": "
|
|
151
|
+
"gitHead": "40542ae8754e3274bc7910e89e57c96089e2d22a"
|
|
152
152
|
}
|
package/utils/script-utils.js
CHANGED
|
@@ -77,7 +77,7 @@ const getProjectPkg = exports.getProjectPkg = /*#__PURE__*/function () {
|
|
|
77
77
|
* @param dir Directory to walk
|
|
78
78
|
* @returns Set of file paths within the directory
|
|
79
79
|
*/
|
|
80
|
-
const
|
|
80
|
+
const _walkDir = exports.walkDir = /*#__PURE__*/function () {
|
|
81
81
|
var _ref3 = _asyncToGenerator(function* (dir, baseDir, fileSet) {
|
|
82
82
|
fileSet = fileSet || new Set();
|
|
83
83
|
const entries = yield (0, _fsExtra.readdir)(dir, {
|
|
@@ -87,7 +87,7 @@ const walkDir = exports.walkDir = /*#__PURE__*/function () {
|
|
|
87
87
|
var _ref4 = _asyncToGenerator(function* (entry) {
|
|
88
88
|
const entryPath = _path.default.join(dir, entry.name);
|
|
89
89
|
if (entry.isDirectory()) {
|
|
90
|
-
yield
|
|
90
|
+
yield _walkDir(entryPath, baseDir, fileSet);
|
|
91
91
|
} else {
|
|
92
92
|
var _fileSet;
|
|
93
93
|
(_fileSet = fileSet) === null || _fileSet === void 0 ? void 0 : _fileSet.add(entryPath.replace(baseDir + _path.default.sep, ''));
|
|
@@ -272,7 +272,7 @@ class CloudAPIClient {
|
|
|
272
272
|
/** Milliseconds to wait between checks. */
|
|
273
273
|
const delay = 30_000;
|
|
274
274
|
/** Check the deployment status to see whether it has finished. */
|
|
275
|
-
const
|
|
275
|
+
const _check = /*#__PURE__*/function () {
|
|
276
276
|
var _ref6 = _asyncToGenerator(function* () {
|
|
277
277
|
const url = new _url.URL(`/api/projects/${project}/target/${environment}`, _this4.opts.origin);
|
|
278
278
|
const res = yield _this4.opts.fetch(url, {
|
|
@@ -299,7 +299,7 @@ class CloudAPIClient {
|
|
|
299
299
|
case 'PUBLISH_IN_PROGRESS':
|
|
300
300
|
// In progress - check again after the next delay
|
|
301
301
|
// `check` is async, so we need to use .catch to properly handle errors
|
|
302
|
-
setTimeout(() => void
|
|
302
|
+
setTimeout(() => void _check().catch(reject), delay);
|
|
303
303
|
return;
|
|
304
304
|
case 'CREATE_FAILED':
|
|
305
305
|
case 'PUBLISH_FAILED':
|
|
@@ -318,7 +318,7 @@ class CloudAPIClient {
|
|
|
318
318
|
};
|
|
319
319
|
}();
|
|
320
320
|
// Start checking after the first delay!
|
|
321
|
-
setTimeout(() => void
|
|
321
|
+
setTimeout(() => void _check().catch(reject), delay);
|
|
322
322
|
});
|
|
323
323
|
})();
|
|
324
324
|
}
|
|
@@ -387,7 +387,7 @@ const createBundle = exports.createBundle = /*#__PURE__*/function () {
|
|
|
387
387
|
const extendsTemplate = 'node_modules/' + ccExtensibility.extends;
|
|
388
388
|
let cc_overrides = [];
|
|
389
389
|
if (ccExtensibility.overridesDir) {
|
|
390
|
-
const overrides_files = yield
|
|
390
|
+
const overrides_files = yield _walkDir(ccExtensibility.overridesDir, ccExtensibility.overridesDir);
|
|
391
391
|
cc_overrides = Array.from(overrides_files).filter(item => (0, _fsExtra.existsSync)(_path.default.join(extendsTemplate, item)));
|
|
392
392
|
}
|
|
393
393
|
const dependencyTree = yield getProjectDependencyTree();
|
|
@@ -6,8 +6,7 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
6
6
|
var _os = _interopRequireDefault(require("os"));
|
|
7
7
|
var scriptUtils = _interopRequireWildcard(require("./script-utils"));
|
|
8
8
|
var dependencyTreeMockData = _interopRequireWildcard(require("./mocks/dependency-tree-mock-data"));
|
|
9
|
-
function
|
|
10
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
11
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
13
12
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
@@ -321,7 +320,7 @@ describe('scriptUtils', () => {
|
|
|
321
320
|
expectedURL: 'https://cloud.mobify.com/api/projects/project-slug/builds/',
|
|
322
321
|
status: 401
|
|
323
322
|
}]])('should push a built bundle and handle status codes (%p)', /*#__PURE__*/function () {
|
|
324
|
-
var
|
|
323
|
+
var _ref29 = _asyncToGenerator(function* ({
|
|
325
324
|
projectSlug,
|
|
326
325
|
targetSlug,
|
|
327
326
|
expectedURL,
|
|
@@ -365,11 +364,11 @@ describe('scriptUtils', () => {
|
|
|
365
364
|
fetch: fetchMock
|
|
366
365
|
});
|
|
367
366
|
const fn = /*#__PURE__*/function () {
|
|
368
|
-
var
|
|
367
|
+
var _ref31 = _asyncToGenerator(function* () {
|
|
369
368
|
return yield client.push(bundle, projectSlug, targetSlug);
|
|
370
369
|
});
|
|
371
370
|
return function fn() {
|
|
372
|
-
return
|
|
371
|
+
return _ref31.apply(this, arguments);
|
|
373
372
|
};
|
|
374
373
|
}();
|
|
375
374
|
|
|
@@ -393,7 +392,7 @@ describe('scriptUtils', () => {
|
|
|
393
392
|
}));
|
|
394
393
|
});
|
|
395
394
|
return function (_x) {
|
|
396
|
-
return
|
|
395
|
+
return _ref29.apply(this, arguments);
|
|
397
396
|
};
|
|
398
397
|
}());
|
|
399
398
|
});
|
|
@@ -425,11 +424,11 @@ describe('scriptUtils', () => {
|
|
|
425
424
|
fetch: fetchMock
|
|
426
425
|
});
|
|
427
426
|
const fn = /*#__PURE__*/function () {
|
|
428
|
-
var
|
|
427
|
+
var _ref34 = _asyncToGenerator(function* () {
|
|
429
428
|
return yield client.createLoggingToken(projectSlug, targetSlug);
|
|
430
429
|
});
|
|
431
430
|
return function fn() {
|
|
432
|
-
return
|
|
431
|
+
return _ref34.apply(this, arguments);
|
|
433
432
|
};
|
|
434
433
|
}();
|
|
435
434
|
expect(yield fn()).toBe('token-value');
|
|
@@ -476,11 +475,11 @@ describe('scriptUtils', () => {
|
|
|
476
475
|
const files = ['a', 'b/1', 'b/2', 'c/d/e'].map(_path.default.normalize);
|
|
477
476
|
beforeEach(/*#__PURE__*/_asyncToGenerator(function* () {
|
|
478
477
|
yield Promise.all(files.map(/*#__PURE__*/function () {
|
|
479
|
-
var
|
|
478
|
+
var _ref36 = _asyncToGenerator(function* (file) {
|
|
480
479
|
return yield (0, _fsExtra.createFile)(_path.default.join(tmpDir, file));
|
|
481
480
|
});
|
|
482
481
|
return function (_x2) {
|
|
483
|
-
return
|
|
482
|
+
return _ref36.apply(this, arguments);
|
|
484
483
|
};
|
|
485
484
|
}()));
|
|
486
485
|
}));
|