@commercetools-frontend/mc-scripts 25.0.0 → 25.2.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.
- package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.dev.js +1 -1
- package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.prod.js +1 -1
- package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.esm.js +1 -1
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.dev.js +28 -14
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +28 -14
- package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +28 -14
- package/dist/{build-50f29fb0.cjs.prod.js → build-182a099c.cjs.prod.js} +7 -7
- package/dist/{build-0b4c6b04.esm.js → build-220a1658.esm.js} +7 -7
- package/dist/{build-1baf8a00.cjs.dev.js → build-519d246d.cjs.dev.js} +7 -7
- package/dist/{build-vite-e26f6c9f.cjs.dev.js → build-vite-837e7c94.cjs.dev.js} +64 -43
- package/dist/{build-vite-85211835.esm.js → build-vite-8cae71a0.esm.js} +61 -24
- package/dist/{build-vite-4a6c90c2.cjs.prod.js → build-vite-b007241b.cjs.prod.js} +64 -43
- package/dist/commercetools-frontend-mc-scripts.cjs.dev.js +1 -1
- package/dist/commercetools-frontend-mc-scripts.cjs.prod.js +1 -1
- package/dist/commercetools-frontend-mc-scripts.esm.js +1 -1
- package/dist/{compile-html-adfef598.esm.js → compile-html-025cd493.esm.js} +2 -4
- package/dist/{compile-html-b80f9651.cjs.prod.js → compile-html-50fd05ec.cjs.prod.js} +2 -5
- package/dist/{compile-html-8679f721.cjs.dev.js → compile-html-f4ac88cc.cjs.dev.js} +2 -5
- package/dist/config-sync-0b96d430.esm.js +255 -0
- package/dist/config-sync-b3072939.cjs.prod.js +265 -0
- package/dist/config-sync-ci-4a09aa00.cjs.prod.js +305 -0
- package/dist/config-sync-ci-85e3fec2.esm.js +294 -0
- package/dist/config-sync-ci-eadb8bfc.cjs.dev.js +305 -0
- package/dist/config-sync-f8fca39f.cjs.dev.js +265 -0
- package/dist/{config-sync-87ba9f28.cjs.prod.js → config-sync-helpers-11fc328f.cjs.prod.js} +193 -326
- package/dist/{config-sync-27ca0c93.cjs.dev.js → config-sync-helpers-dab59ed9.cjs.dev.js} +195 -328
- package/dist/{config-sync-ff4b1e5b.esm.js → config-sync-helpers-fe6ea729.esm.js} +186 -323
- package/dist/{create-postcss-config-34bab342.cjs.prod.js → create-postcss-config-56b74a34.cjs.prod.js} +1 -1
- package/dist/{create-postcss-config-0e833724.cjs.dev.js → create-postcss-config-78879a12.cjs.dev.js} +1 -1
- package/dist/{create-postcss-config-e6dfba3f.esm.js → create-postcss-config-95f9bf62.esm.js} +1 -1
- package/dist/{create-webpack-config-for-development-fe0945ce.cjs.prod.js → create-webpack-config-for-development-3eb1b365.cjs.prod.js} +7 -7
- package/dist/{create-webpack-config-for-development-2ac1d86f.cjs.dev.js → create-webpack-config-for-development-62b89920.cjs.dev.js} +7 -7
- package/dist/{create-webpack-config-for-development-be2722d6.esm.js → create-webpack-config-for-development-a28736fa.esm.js} +7 -7
- package/dist/{create-webpack-config-for-production-66c77849.esm.js → create-webpack-config-for-production-21ea561f.esm.js} +8 -8
- package/dist/{create-webpack-config-for-production-2200e554.cjs.prod.js → create-webpack-config-for-production-3b6599db.cjs.prod.js} +8 -8
- package/dist/{create-webpack-config-for-production-d2c41a9d.cjs.dev.js → create-webpack-config-for-production-e5ed8805.cjs.dev.js} +8 -8
- package/dist/{credentials-storage-381abf27.cjs.prod.js → credentials-storage-6d592cd6.cjs.prod.js} +21 -3
- package/dist/{credentials-storage-de220814.cjs.dev.js → credentials-storage-c4c5980e.cjs.dev.js} +21 -3
- package/dist/{credentials-storage-7285d7b4.esm.js → credentials-storage-fcc77fb6.esm.js} +21 -3
- package/dist/declarations/src/types.d.ts +4 -0
- package/dist/{deployment-previews-set-7f9fbfe5.esm.js → deployment-previews-set-7d49e7df.esm.js} +22 -27
- package/dist/{deployment-previews-set-3697be5e.cjs.dev.js → deployment-previews-set-8d6a1e99.cjs.dev.js} +22 -28
- package/dist/{deployment-previews-set-e92403f7.cjs.prod.js → deployment-previews-set-f8ce3db7.cjs.prod.js} +22 -28
- package/dist/{graphql-requests-bab5fcc3.cjs.dev.js → graphql-requests-b57fca4c.cjs.prod.js} +5 -8
- package/dist/{graphql-requests-d8bc2292.esm.js → graphql-requests-d2fa2ca7.esm.js} +6 -9
- package/dist/{graphql-requests-8ef89149.cjs.prod.js → graphql-requests-da194989.cjs.dev.js} +5 -8
- package/dist/{i18n-message-complilation-8aec9d1b.esm.js → i18n-message-complilation-21d3b0aa.esm.js} +1 -1
- package/dist/{i18n-message-complilation-3f80e8d6.cjs.dev.js → i18n-message-complilation-7311cb29.cjs.dev.js} +1 -1
- package/dist/{i18n-message-complilation-393d344a.cjs.prod.js → i18n-message-complilation-7762da61.cjs.prod.js} +1 -1
- package/dist/{login-5fd67aac.cjs.prod.js → login-9774c9cc.cjs.prod.js} +154 -38
- package/dist/login-abb38213.esm.js +337 -0
- package/dist/{login-9fac9eee.cjs.dev.js → login-f4550251.cjs.dev.js} +154 -38
- package/dist/{optimizations-ea21b802.cjs.prod.js → optimizations-7789145e.cjs.dev.js} +5 -8
- package/dist/{optimizations-ea71a24a.esm.js → optimizations-bf991634.esm.js} +5 -7
- package/dist/{optimizations-ebbeaf88.cjs.dev.js → optimizations-fb93514f.cjs.prod.js} +5 -8
- package/dist/{package-ff04bcf7.cjs.dev.js → package-0eebca1b.cjs.dev.js} +21 -11
- package/dist/{package-4bdd2ccf.esm.js → package-9e6910b8.esm.js} +21 -11
- package/dist/{package-428d5001.cjs.prod.js → package-b9298ce3.cjs.prod.js} +21 -11
- package/dist/{paths-7bf7e88e.esm.js → paths-39f22b8b.esm.js} +4 -9
- package/dist/{paths-af1a725a.cjs.prod.js → paths-7768b440.cjs.prod.js} +4 -10
- package/dist/{paths-ec3e3a7d.cjs.dev.js → paths-b76fc753.cjs.dev.js} +4 -10
- package/dist/{serve-04a03d5f.cjs.dev.js → serve-38456e1b.cjs.dev.js} +7 -6
- package/dist/{serve-fb1a0f5a.esm.js → serve-be1f9439.esm.js} +6 -6
- package/dist/{serve-2a863026.cjs.prod.js → serve-cc4a766d.cjs.prod.js} +7 -6
- package/dist/{start-643a55bb.esm.js → start-109f9462.esm.js} +8 -9
- package/dist/{start-47ea5e04.cjs.dev.js → start-7765f44c.cjs.dev.js} +8 -9
- package/dist/{start-84cdf12b.cjs.prod.js → start-e014127c.cjs.prod.js} +8 -9
- package/dist/{start-vite-eea72ba9.cjs.dev.js → start-vite-068e9f73.cjs.dev.js} +3 -4
- package/dist/{start-vite-d548c121.cjs.prod.js → start-vite-29078b3a.cjs.prod.js} +3 -4
- package/dist/{start-vite-d649d1f3.esm.js → start-vite-7d1161e8.esm.js} +3 -4
- package/dist/{vite-plugin-svgr-53ef97c7.cjs.dev.js → vite-plugin-svgr-4034a834.cjs.prod.js} +4 -4
- package/dist/{vite-plugin-svgr-5de1cad9.cjs.prod.js → vite-plugin-svgr-7d06f400.cjs.dev.js} +4 -4
- package/dist/{vite-plugin-svgr-22c8d518.esm.js → vite-plugin-svgr-de6ee7da.esm.js} +4 -4
- package/package.json +21 -11
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.dev.js +2 -2
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.prod.js +2 -2
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.esm.js +2 -2
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.dev.js +6 -6
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +6 -6
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +6 -6
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.dev.js +1 -1
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.prod.js +1 -1
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.esm.js +1 -1
- package/dist/login-9ee43381.esm.js +0 -223
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
4
4
|
var path = require('path');
|
|
5
|
-
var _package = require('./package-
|
|
5
|
+
var _package = require('./package-b9298ce3.cjs.prod.js');
|
|
6
6
|
|
|
7
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
8
8
|
|
package/dist/{create-postcss-config-0e833724.cjs.dev.js → create-postcss-config-78879a12.cjs.dev.js}
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
4
4
|
var path = require('path');
|
|
5
|
-
var _package = require('./package-
|
|
5
|
+
var _package = require('./package-0eebca1b.cjs.dev.js');
|
|
6
6
|
|
|
7
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
8
8
|
|
package/dist/{create-postcss-config-e6dfba3f.esm.js → create-postcss-config-95f9bf62.esm.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { p as pkgJson } from './package-
|
|
3
|
+
import { p as pkgJson } from './package-9e6910b8.esm.js';
|
|
4
4
|
|
|
5
5
|
// This function aims to return the same result as `require.resolve`.
|
|
6
6
|
// However, resolving a path to a `.css` file does not return the real
|
|
@@ -25,10 +25,10 @@ var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
|
|
|
25
25
|
var _Object$assign = require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
26
26
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
27
27
|
var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
|
|
28
|
-
var createPostcssConfig = require('./create-postcss-config-
|
|
28
|
+
var createPostcssConfig = require('./create-postcss-config-56b74a34.cjs.prod.js');
|
|
29
29
|
var hasJsxRuntime = require('./has-jsx-runtime-c3202df5.cjs.prod.js');
|
|
30
|
-
var optimizations = require('./optimizations-
|
|
31
|
-
var paths = require('./paths-
|
|
30
|
+
var optimizations = require('./optimizations-fb93514f.cjs.prod.js');
|
|
31
|
+
var paths = require('./paths-7768b440.cjs.prod.js');
|
|
32
32
|
var vendorsToTranspile = require('./vendors-to-transpile-04a49d40.cjs.prod.js');
|
|
33
33
|
|
|
34
34
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -90,7 +90,7 @@ let LocalHtmlWebpackPlugin = /*#__PURE__*/function () {
|
|
|
90
90
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
91
91
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context6, _context7; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys(Object(t), !0)).call(_context6, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys(Object(t))).call(_context7, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
92
92
|
// https://babeljs.io/blog/2017/09/11/zero-config-with-babel-macros
|
|
93
|
-
const momentLocalesToKeep = ["de", "de-at", "de-ch", "en-
|
|
93
|
+
const momentLocalesToKeep = ["de", "de-at", "de-ch", "en-gb", "en-au", "en-ca", "en-ie", "en-in", "en-nz", "en-sg", "es", "es-do", "es-mx", "fr", "pt-br"];
|
|
94
94
|
const defaultToggleFlags = {
|
|
95
95
|
generateIndexHtml: true,
|
|
96
96
|
disableCoreJs: false
|
|
@@ -152,7 +152,7 @@ function createWebpackConfigForDevelopment() {
|
|
|
152
152
|
// https://github.com/facebook/create-react-app/issues/290
|
|
153
153
|
// `web` extension prefixes have been added for better support
|
|
154
154
|
// for React Native Web.
|
|
155
|
-
extensions: _mapInstanceProperty__default["default"](_context = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context, ext =>
|
|
155
|
+
extensions: _mapInstanceProperty__default["default"](_context = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context, ext => `.${ext}`),
|
|
156
156
|
// NOTE: this is meant to be a temporary list of fallback/polyfills for certain
|
|
157
157
|
// nodejs modules. With Webpack <5 these polyfills were included by default in Webpack,
|
|
158
158
|
// however now it's not the case anymore.
|
|
@@ -306,9 +306,9 @@ function createWebpackConfigForDevelopment() {
|
|
|
306
306
|
name: 'prefixIds',
|
|
307
307
|
params: {
|
|
308
308
|
delim: '',
|
|
309
|
-
prefix: (_, info) =>
|
|
309
|
+
prefix: (_, info) => `svg${crypto__default["default"].createHash('shake256', {
|
|
310
310
|
outputLength: 6
|
|
311
|
-
}).update(info.path || '').digest('hex')
|
|
311
|
+
}).update(info.path || '').digest('hex')}`
|
|
312
312
|
}
|
|
313
313
|
}]
|
|
314
314
|
}
|
|
@@ -25,10 +25,10 @@ var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
|
|
|
25
25
|
var _Object$assign = require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
26
26
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
27
27
|
var mcHtmlTemplate = require('@commercetools-frontend/mc-html-template');
|
|
28
|
-
var createPostcssConfig = require('./create-postcss-config-
|
|
28
|
+
var createPostcssConfig = require('./create-postcss-config-78879a12.cjs.dev.js');
|
|
29
29
|
var hasJsxRuntime = require('./has-jsx-runtime-aa5d21ee.cjs.dev.js');
|
|
30
|
-
var optimizations = require('./optimizations-
|
|
31
|
-
var paths = require('./paths-
|
|
30
|
+
var optimizations = require('./optimizations-7789145e.cjs.dev.js');
|
|
31
|
+
var paths = require('./paths-b76fc753.cjs.dev.js');
|
|
32
32
|
var vendorsToTranspile = require('./vendors-to-transpile-6ab4ea06.cjs.dev.js');
|
|
33
33
|
|
|
34
34
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -90,7 +90,7 @@ let LocalHtmlWebpackPlugin = /*#__PURE__*/function () {
|
|
|
90
90
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
91
91
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context6, _context7; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys(Object(t), !0)).call(_context6, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys(Object(t))).call(_context7, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
92
92
|
// https://babeljs.io/blog/2017/09/11/zero-config-with-babel-macros
|
|
93
|
-
const momentLocalesToKeep = ["de", "de-at", "de-ch", "en-
|
|
93
|
+
const momentLocalesToKeep = ["de", "de-at", "de-ch", "en-gb", "en-au", "en-ca", "en-ie", "en-in", "en-nz", "en-sg", "es", "es-do", "es-mx", "fr", "pt-br"];
|
|
94
94
|
const defaultToggleFlags = {
|
|
95
95
|
generateIndexHtml: true,
|
|
96
96
|
disableCoreJs: false
|
|
@@ -152,7 +152,7 @@ function createWebpackConfigForDevelopment() {
|
|
|
152
152
|
// https://github.com/facebook/create-react-app/issues/290
|
|
153
153
|
// `web` extension prefixes have been added for better support
|
|
154
154
|
// for React Native Web.
|
|
155
|
-
extensions: _mapInstanceProperty__default["default"](_context = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context, ext =>
|
|
155
|
+
extensions: _mapInstanceProperty__default["default"](_context = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context, ext => `.${ext}`),
|
|
156
156
|
// NOTE: this is meant to be a temporary list of fallback/polyfills for certain
|
|
157
157
|
// nodejs modules. With Webpack <5 these polyfills were included by default in Webpack,
|
|
158
158
|
// however now it's not the case anymore.
|
|
@@ -306,9 +306,9 @@ function createWebpackConfigForDevelopment() {
|
|
|
306
306
|
name: 'prefixIds',
|
|
307
307
|
params: {
|
|
308
308
|
delim: '',
|
|
309
|
-
prefix: (_, info) =>
|
|
309
|
+
prefix: (_, info) => `svg${crypto__default["default"].createHash('shake256', {
|
|
310
310
|
outputLength: 6
|
|
311
|
-
}).update(info.path || '').digest('hex')
|
|
311
|
+
}).update(info.path || '').digest('hex')}`
|
|
312
312
|
}
|
|
313
313
|
}]
|
|
314
314
|
}
|
|
@@ -23,10 +23,10 @@ import _createClass from '@babel/runtime-corejs3/helpers/esm/createClass';
|
|
|
23
23
|
import _Object$assign from '@babel/runtime-corejs3/core-js-stable/object/assign';
|
|
24
24
|
import { processConfig } from '@commercetools-frontend/application-config';
|
|
25
25
|
import { replaceHtmlPlaceholders } from '@commercetools-frontend/mc-html-template';
|
|
26
|
-
import { c as createPostcssConfig } from './create-postcss-config-
|
|
26
|
+
import { c as createPostcssConfig } from './create-postcss-config-95f9bf62.esm.js';
|
|
27
27
|
import { h as hasJsxRuntime } from './has-jsx-runtime-e3ecb09b.esm.js';
|
|
28
|
-
import { g as getWepbackCacheGroups } from './optimizations-
|
|
29
|
-
import { p as paths } from './paths-
|
|
28
|
+
import { g as getWepbackCacheGroups } from './optimizations-bf991634.esm.js';
|
|
29
|
+
import { p as paths } from './paths-39f22b8b.esm.js';
|
|
30
30
|
import { v as vendorsToTranspile } from './vendors-to-transpile-7dc84a72.esm.js';
|
|
31
31
|
|
|
32
32
|
let LocalHtmlWebpackPlugin = /*#__PURE__*/function () {
|
|
@@ -65,7 +65,7 @@ let LocalHtmlWebpackPlugin = /*#__PURE__*/function () {
|
|
|
65
65
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
66
66
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context6, _context7; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context6 = ownKeys(Object(t), !0)).call(_context6, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context7 = ownKeys(Object(t))).call(_context7, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
67
67
|
// https://babeljs.io/blog/2017/09/11/zero-config-with-babel-macros
|
|
68
|
-
const momentLocalesToKeep = ["de", "de-at", "de-ch", "en-
|
|
68
|
+
const momentLocalesToKeep = ["de", "de-at", "de-ch", "en-gb", "en-au", "en-ca", "en-ie", "en-in", "en-nz", "en-sg", "es", "es-do", "es-mx", "fr", "pt-br"];
|
|
69
69
|
const defaultToggleFlags = {
|
|
70
70
|
generateIndexHtml: true,
|
|
71
71
|
disableCoreJs: false
|
|
@@ -127,7 +127,7 @@ function createWebpackConfigForDevelopment() {
|
|
|
127
127
|
// https://github.com/facebook/create-react-app/issues/290
|
|
128
128
|
// `web` extension prefixes have been added for better support
|
|
129
129
|
// for React Native Web.
|
|
130
|
-
extensions: _mapInstanceProperty(_context = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context, ext =>
|
|
130
|
+
extensions: _mapInstanceProperty(_context = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context, ext => `.${ext}`),
|
|
131
131
|
// NOTE: this is meant to be a temporary list of fallback/polyfills for certain
|
|
132
132
|
// nodejs modules. With Webpack <5 these polyfills were included by default in Webpack,
|
|
133
133
|
// however now it's not the case anymore.
|
|
@@ -281,9 +281,9 @@ function createWebpackConfigForDevelopment() {
|
|
|
281
281
|
name: 'prefixIds',
|
|
282
282
|
params: {
|
|
283
283
|
delim: '',
|
|
284
|
-
prefix: (_, info) =>
|
|
284
|
+
prefix: (_, info) => `svg${crypto.createHash('shake256', {
|
|
285
285
|
outputLength: 6
|
|
286
|
-
}).update(info.path || '').digest('hex')
|
|
286
|
+
}).update(info.path || '').digest('hex')}`
|
|
287
287
|
}
|
|
288
288
|
}]
|
|
289
289
|
}
|
|
@@ -27,10 +27,10 @@ import _reduceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/insta
|
|
|
27
27
|
import _Object$assign from '@babel/runtime-corejs3/core-js-stable/object/assign';
|
|
28
28
|
import fs from 'fs';
|
|
29
29
|
import path from 'path';
|
|
30
|
-
import { c as createPostcssConfig } from './create-postcss-config-
|
|
30
|
+
import { c as createPostcssConfig } from './create-postcss-config-95f9bf62.esm.js';
|
|
31
31
|
import { h as hasJsxRuntime } from './has-jsx-runtime-e3ecb09b.esm.js';
|
|
32
|
-
import { g as getWepbackCacheGroups } from './optimizations-
|
|
33
|
-
import { p as paths } from './paths-
|
|
32
|
+
import { g as getWepbackCacheGroups } from './optimizations-bf991634.esm.js';
|
|
33
|
+
import { p as paths } from './paths-39f22b8b.esm.js';
|
|
34
34
|
import { v as vendorsToTranspile } from './vendors-to-transpile-7dc84a72.esm.js';
|
|
35
35
|
|
|
36
36
|
let FinalStatsWriterPlugin = /*#__PURE__*/function () {
|
|
@@ -79,7 +79,7 @@ let FinalStatsWriterPlugin = /*#__PURE__*/function () {
|
|
|
79
79
|
fs.writeFileSync(path.join(this.config.outputPath, 'stats.json'), _JSON$stringify(finalStats, null, 2));
|
|
80
80
|
} catch (error) {
|
|
81
81
|
// eslint-disable-next-line no-console
|
|
82
|
-
console.warn(
|
|
82
|
+
console.warn(`[FinalStatsWriterPlugin] The dist folder could not be found at ${this.config.outputPath}. Check the console for errors during the webpack compilation.`);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}]);
|
|
@@ -88,7 +88,7 @@ let FinalStatsWriterPlugin = /*#__PURE__*/function () {
|
|
|
88
88
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
89
89
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context7, _context8; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context7 = ownKeys(Object(t), !0)).call(_context7, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context8 = ownKeys(Object(t))).call(_context8, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
90
90
|
// https://babeljs.io/blog/2017/09/11/zero-config-with-babel-macros
|
|
91
|
-
const momentLocalesToKeep = ["de", "de-at", "de-ch", "en-
|
|
91
|
+
const momentLocalesToKeep = ["de", "de-at", "de-ch", "en-gb", "en-au", "en-ca", "en-ie", "en-in", "en-nz", "en-sg", "es", "es-do", "es-mx", "fr", "pt-br"];
|
|
92
92
|
const defaultToggleFlags = {
|
|
93
93
|
// Allow to disable CSS extraction in case it's not necessary (e.g. for Storybook)
|
|
94
94
|
enableExtractCss: true,
|
|
@@ -200,7 +200,7 @@ function createWebpackConfigForProduction() {
|
|
|
200
200
|
// https://github.com/facebook/create-react-app/issues/290
|
|
201
201
|
// `web` extension prefixes have been added for better support
|
|
202
202
|
// for React Native Web.
|
|
203
|
-
extensions: _mapInstanceProperty(_context2 = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context2, ext =>
|
|
203
|
+
extensions: _mapInstanceProperty(_context2 = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context2, ext => `.${ext}`),
|
|
204
204
|
// NOTE: this is meant to be a temporary list of fallback/polyfills for certain
|
|
205
205
|
// nodejs modules. With Webpack <5 these polyfills were included by default in Webpack,
|
|
206
206
|
// however now it's not the case anymore.
|
|
@@ -330,9 +330,9 @@ function createWebpackConfigForProduction() {
|
|
|
330
330
|
name: 'prefixIds',
|
|
331
331
|
params: {
|
|
332
332
|
delim: '',
|
|
333
|
-
prefix: (_, info) =>
|
|
333
|
+
prefix: (_, info) => `svg${crypto.createHash('shake256', {
|
|
334
334
|
outputLength: 6
|
|
335
|
-
}).update(info.path || '').digest('hex')
|
|
335
|
+
}).update(info.path || '').digest('hex')}`
|
|
336
336
|
}
|
|
337
337
|
}]
|
|
338
338
|
}
|
|
@@ -29,10 +29,10 @@ var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/ins
|
|
|
29
29
|
var _Object$assign = require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
30
30
|
var fs = require('fs');
|
|
31
31
|
var path = require('path');
|
|
32
|
-
var createPostcssConfig = require('./create-postcss-config-
|
|
32
|
+
var createPostcssConfig = require('./create-postcss-config-56b74a34.cjs.prod.js');
|
|
33
33
|
var hasJsxRuntime = require('./has-jsx-runtime-c3202df5.cjs.prod.js');
|
|
34
|
-
var optimizations = require('./optimizations-
|
|
35
|
-
var paths = require('./paths-
|
|
34
|
+
var optimizations = require('./optimizations-fb93514f.cjs.prod.js');
|
|
35
|
+
var paths = require('./paths-7768b440.cjs.prod.js');
|
|
36
36
|
var vendorsToTranspile = require('./vendors-to-transpile-04a49d40.cjs.prod.js');
|
|
37
37
|
|
|
38
38
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -109,7 +109,7 @@ let FinalStatsWriterPlugin = /*#__PURE__*/function () {
|
|
|
109
109
|
fs__default["default"].writeFileSync(path__default["default"].join(this.config.outputPath, 'stats.json'), _JSON$stringify__default["default"](finalStats, null, 2));
|
|
110
110
|
} catch (error) {
|
|
111
111
|
// eslint-disable-next-line no-console
|
|
112
|
-
console.warn(
|
|
112
|
+
console.warn(`[FinalStatsWriterPlugin] The dist folder could not be found at ${this.config.outputPath}. Check the console for errors during the webpack compilation.`);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
}]);
|
|
@@ -118,7 +118,7 @@ let FinalStatsWriterPlugin = /*#__PURE__*/function () {
|
|
|
118
118
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
119
119
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context7, _context8; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context7 = ownKeys(Object(t), !0)).call(_context7, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context8 = ownKeys(Object(t))).call(_context8, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
120
120
|
// https://babeljs.io/blog/2017/09/11/zero-config-with-babel-macros
|
|
121
|
-
const momentLocalesToKeep = ["de", "de-at", "de-ch", "en-
|
|
121
|
+
const momentLocalesToKeep = ["de", "de-at", "de-ch", "en-gb", "en-au", "en-ca", "en-ie", "en-in", "en-nz", "en-sg", "es", "es-do", "es-mx", "fr", "pt-br"];
|
|
122
122
|
const defaultToggleFlags = {
|
|
123
123
|
// Allow to disable CSS extraction in case it's not necessary (e.g. for Storybook)
|
|
124
124
|
enableExtractCss: true,
|
|
@@ -230,7 +230,7 @@ function createWebpackConfigForProduction() {
|
|
|
230
230
|
// https://github.com/facebook/create-react-app/issues/290
|
|
231
231
|
// `web` extension prefixes have been added for better support
|
|
232
232
|
// for React Native Web.
|
|
233
|
-
extensions: _mapInstanceProperty__default["default"](_context2 = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context2, ext =>
|
|
233
|
+
extensions: _mapInstanceProperty__default["default"](_context2 = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context2, ext => `.${ext}`),
|
|
234
234
|
// NOTE: this is meant to be a temporary list of fallback/polyfills for certain
|
|
235
235
|
// nodejs modules. With Webpack <5 these polyfills were included by default in Webpack,
|
|
236
236
|
// however now it's not the case anymore.
|
|
@@ -360,9 +360,9 @@ function createWebpackConfigForProduction() {
|
|
|
360
360
|
name: 'prefixIds',
|
|
361
361
|
params: {
|
|
362
362
|
delim: '',
|
|
363
|
-
prefix: (_, info) =>
|
|
363
|
+
prefix: (_, info) => `svg${crypto__default["default"].createHash('shake256', {
|
|
364
364
|
outputLength: 6
|
|
365
|
-
}).update(info.path || '').digest('hex')
|
|
365
|
+
}).update(info.path || '').digest('hex')}`
|
|
366
366
|
}
|
|
367
367
|
}]
|
|
368
368
|
}
|
|
@@ -29,10 +29,10 @@ var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/ins
|
|
|
29
29
|
var _Object$assign = require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
30
30
|
var fs = require('fs');
|
|
31
31
|
var path = require('path');
|
|
32
|
-
var createPostcssConfig = require('./create-postcss-config-
|
|
32
|
+
var createPostcssConfig = require('./create-postcss-config-78879a12.cjs.dev.js');
|
|
33
33
|
var hasJsxRuntime = require('./has-jsx-runtime-aa5d21ee.cjs.dev.js');
|
|
34
|
-
var optimizations = require('./optimizations-
|
|
35
|
-
var paths = require('./paths-
|
|
34
|
+
var optimizations = require('./optimizations-7789145e.cjs.dev.js');
|
|
35
|
+
var paths = require('./paths-b76fc753.cjs.dev.js');
|
|
36
36
|
var vendorsToTranspile = require('./vendors-to-transpile-6ab4ea06.cjs.dev.js');
|
|
37
37
|
|
|
38
38
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -109,7 +109,7 @@ let FinalStatsWriterPlugin = /*#__PURE__*/function () {
|
|
|
109
109
|
fs__default["default"].writeFileSync(path__default["default"].join(this.config.outputPath, 'stats.json'), _JSON$stringify__default["default"](finalStats, null, 2));
|
|
110
110
|
} catch (error) {
|
|
111
111
|
// eslint-disable-next-line no-console
|
|
112
|
-
console.warn(
|
|
112
|
+
console.warn(`[FinalStatsWriterPlugin] The dist folder could not be found at ${this.config.outputPath}. Check the console for errors during the webpack compilation.`);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
}]);
|
|
@@ -118,7 +118,7 @@ let FinalStatsWriterPlugin = /*#__PURE__*/function () {
|
|
|
118
118
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
119
119
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context7, _context8; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context7 = ownKeys(Object(t), !0)).call(_context7, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context8 = ownKeys(Object(t))).call(_context8, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
120
120
|
// https://babeljs.io/blog/2017/09/11/zero-config-with-babel-macros
|
|
121
|
-
const momentLocalesToKeep = ["de", "de-at", "de-ch", "en-
|
|
121
|
+
const momentLocalesToKeep = ["de", "de-at", "de-ch", "en-gb", "en-au", "en-ca", "en-ie", "en-in", "en-nz", "en-sg", "es", "es-do", "es-mx", "fr", "pt-br"];
|
|
122
122
|
const defaultToggleFlags = {
|
|
123
123
|
// Allow to disable CSS extraction in case it's not necessary (e.g. for Storybook)
|
|
124
124
|
enableExtractCss: true,
|
|
@@ -230,7 +230,7 @@ function createWebpackConfigForProduction() {
|
|
|
230
230
|
// https://github.com/facebook/create-react-app/issues/290
|
|
231
231
|
// `web` extension prefixes have been added for better support
|
|
232
232
|
// for React Native Web.
|
|
233
|
-
extensions: _mapInstanceProperty__default["default"](_context2 = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context2, ext =>
|
|
233
|
+
extensions: _mapInstanceProperty__default["default"](_context2 = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context2, ext => `.${ext}`),
|
|
234
234
|
// NOTE: this is meant to be a temporary list of fallback/polyfills for certain
|
|
235
235
|
// nodejs modules. With Webpack <5 these polyfills were included by default in Webpack,
|
|
236
236
|
// however now it's not the case anymore.
|
|
@@ -360,9 +360,9 @@ function createWebpackConfigForProduction() {
|
|
|
360
360
|
name: 'prefixIds',
|
|
361
361
|
params: {
|
|
362
362
|
delim: '',
|
|
363
|
-
prefix: (_, info) =>
|
|
363
|
+
prefix: (_, info) => `svg${crypto__default["default"].createHash('shake256', {
|
|
364
364
|
outputLength: 6
|
|
365
|
-
}).update(info.path || '').digest('hex')
|
|
365
|
+
}).update(info.path || '').digest('hex')}`
|
|
366
366
|
}
|
|
367
367
|
}]
|
|
368
368
|
}
|
package/dist/{credentials-storage-381abf27.cjs.prod.js → credentials-storage-6d592cd6.cjs.prod.js}
RENAMED
|
@@ -17,16 +17,21 @@ var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
|
17
17
|
var os__default = /*#__PURE__*/_interopDefault(os);
|
|
18
18
|
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Environment variable name for providing a token directly (useful for CI).
|
|
22
|
+
* When set, this token will be used instead of the stored credentials.
|
|
23
|
+
*/
|
|
24
|
+
const MC_ACCESS_TOKEN_ENV_VAR = 'MC_ACCESS_TOKEN';
|
|
20
25
|
let CredentialsStorage = /*#__PURE__*/function () {
|
|
21
26
|
function CredentialsStorage() {
|
|
22
27
|
_classCallCheck(this, CredentialsStorage);
|
|
23
28
|
this.credentialsFilePath = void 0;
|
|
24
29
|
const homedir = os__default["default"].homedir();
|
|
25
|
-
const credentialsFolderPath = path__default["default"].join(homedir,
|
|
30
|
+
const credentialsFolderPath = path__default["default"].join(homedir, `.commercetools`);
|
|
26
31
|
this.credentialsFilePath = path__default["default"].join(credentialsFolderPath, 'mc-credentials.json');
|
|
27
32
|
|
|
28
|
-
// Ensure the credentials file is present
|
|
29
|
-
if (!doesFileExist.doesFileExist(this.credentialsFilePath)) {
|
|
33
|
+
// Ensure the credentials file is present (skip if using env var token)
|
|
34
|
+
if (!process.env[MC_ACCESS_TOKEN_ENV_VAR] && !doesFileExist.doesFileExist(this.credentialsFilePath)) {
|
|
30
35
|
fs__default["default"].mkdirSync(credentialsFolderPath, {
|
|
31
36
|
recursive: true
|
|
32
37
|
});
|
|
@@ -52,6 +57,11 @@ let CredentialsStorage = /*#__PURE__*/function () {
|
|
|
52
57
|
}, {
|
|
53
58
|
key: "getToken",
|
|
54
59
|
value: function getToken(environmentKey) {
|
|
60
|
+
// Check for environment variable token first (useful for CI)
|
|
61
|
+
const envToken = process.env[MC_ACCESS_TOKEN_ENV_VAR];
|
|
62
|
+
if (envToken) {
|
|
63
|
+
return envToken;
|
|
64
|
+
}
|
|
55
65
|
const allCredentials = this._loadCredentials();
|
|
56
66
|
if (!this.isSessionValid(environmentKey)) {
|
|
57
67
|
return null;
|
|
@@ -61,6 +71,10 @@ let CredentialsStorage = /*#__PURE__*/function () {
|
|
|
61
71
|
}, {
|
|
62
72
|
key: "setToken",
|
|
63
73
|
value: function setToken(environmentKey, credentials) {
|
|
74
|
+
// Don't write credentials if using env var token
|
|
75
|
+
if (process.env[MC_ACCESS_TOKEN_ENV_VAR]) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
64
78
|
const allCredentials = this._loadCredentials();
|
|
65
79
|
allCredentials[environmentKey] = credentials;
|
|
66
80
|
this._writeCredentials(allCredentials);
|
|
@@ -68,6 +82,10 @@ let CredentialsStorage = /*#__PURE__*/function () {
|
|
|
68
82
|
}, {
|
|
69
83
|
key: "isSessionValid",
|
|
70
84
|
value: function isSessionValid(environmentKey) {
|
|
85
|
+
// If using environment variable token, assume it's valid
|
|
86
|
+
if (process.env[MC_ACCESS_TOKEN_ENV_VAR]) {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
71
89
|
const allCredentials = this._loadCredentials();
|
|
72
90
|
const credentials = allCredentials[environmentKey];
|
|
73
91
|
if (!credentials) {
|
package/dist/{credentials-storage-de220814.cjs.dev.js → credentials-storage-c4c5980e.cjs.dev.js}
RENAMED
|
@@ -17,16 +17,21 @@ var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
|
17
17
|
var os__default = /*#__PURE__*/_interopDefault(os);
|
|
18
18
|
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Environment variable name for providing a token directly (useful for CI).
|
|
22
|
+
* When set, this token will be used instead of the stored credentials.
|
|
23
|
+
*/
|
|
24
|
+
const MC_ACCESS_TOKEN_ENV_VAR = 'MC_ACCESS_TOKEN';
|
|
20
25
|
let CredentialsStorage = /*#__PURE__*/function () {
|
|
21
26
|
function CredentialsStorage() {
|
|
22
27
|
_classCallCheck(this, CredentialsStorage);
|
|
23
28
|
this.credentialsFilePath = void 0;
|
|
24
29
|
const homedir = os__default["default"].homedir();
|
|
25
|
-
const credentialsFolderPath = path__default["default"].join(homedir,
|
|
30
|
+
const credentialsFolderPath = path__default["default"].join(homedir, `.commercetools`);
|
|
26
31
|
this.credentialsFilePath = path__default["default"].join(credentialsFolderPath, 'mc-credentials.json');
|
|
27
32
|
|
|
28
|
-
// Ensure the credentials file is present
|
|
29
|
-
if (!doesFileExist.doesFileExist(this.credentialsFilePath)) {
|
|
33
|
+
// Ensure the credentials file is present (skip if using env var token)
|
|
34
|
+
if (!process.env[MC_ACCESS_TOKEN_ENV_VAR] && !doesFileExist.doesFileExist(this.credentialsFilePath)) {
|
|
30
35
|
fs__default["default"].mkdirSync(credentialsFolderPath, {
|
|
31
36
|
recursive: true
|
|
32
37
|
});
|
|
@@ -52,6 +57,11 @@ let CredentialsStorage = /*#__PURE__*/function () {
|
|
|
52
57
|
}, {
|
|
53
58
|
key: "getToken",
|
|
54
59
|
value: function getToken(environmentKey) {
|
|
60
|
+
// Check for environment variable token first (useful for CI)
|
|
61
|
+
const envToken = process.env[MC_ACCESS_TOKEN_ENV_VAR];
|
|
62
|
+
if (envToken) {
|
|
63
|
+
return envToken;
|
|
64
|
+
}
|
|
55
65
|
const allCredentials = this._loadCredentials();
|
|
56
66
|
if (!this.isSessionValid(environmentKey)) {
|
|
57
67
|
return null;
|
|
@@ -61,6 +71,10 @@ let CredentialsStorage = /*#__PURE__*/function () {
|
|
|
61
71
|
}, {
|
|
62
72
|
key: "setToken",
|
|
63
73
|
value: function setToken(environmentKey, credentials) {
|
|
74
|
+
// Don't write credentials if using env var token
|
|
75
|
+
if (process.env[MC_ACCESS_TOKEN_ENV_VAR]) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
64
78
|
const allCredentials = this._loadCredentials();
|
|
65
79
|
allCredentials[environmentKey] = credentials;
|
|
66
80
|
this._writeCredentials(allCredentials);
|
|
@@ -68,6 +82,10 @@ let CredentialsStorage = /*#__PURE__*/function () {
|
|
|
68
82
|
}, {
|
|
69
83
|
key: "isSessionValid",
|
|
70
84
|
value: function isSessionValid(environmentKey) {
|
|
85
|
+
// If using environment variable token, assume it's valid
|
|
86
|
+
if (process.env[MC_ACCESS_TOKEN_ENV_VAR]) {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
71
89
|
const allCredentials = this._loadCredentials();
|
|
72
90
|
const credentials = allCredentials[environmentKey];
|
|
73
91
|
if (!credentials) {
|
|
@@ -7,16 +7,21 @@ import os from 'node:os';
|
|
|
7
7
|
import path from 'node:path';
|
|
8
8
|
import { d as doesFileExist } from './does-file-exist-32618334.esm.js';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Environment variable name for providing a token directly (useful for CI).
|
|
12
|
+
* When set, this token will be used instead of the stored credentials.
|
|
13
|
+
*/
|
|
14
|
+
const MC_ACCESS_TOKEN_ENV_VAR = 'MC_ACCESS_TOKEN';
|
|
10
15
|
let CredentialsStorage = /*#__PURE__*/function () {
|
|
11
16
|
function CredentialsStorage() {
|
|
12
17
|
_classCallCheck(this, CredentialsStorage);
|
|
13
18
|
this.credentialsFilePath = void 0;
|
|
14
19
|
const homedir = os.homedir();
|
|
15
|
-
const credentialsFolderPath = path.join(homedir,
|
|
20
|
+
const credentialsFolderPath = path.join(homedir, `.commercetools`);
|
|
16
21
|
this.credentialsFilePath = path.join(credentialsFolderPath, 'mc-credentials.json');
|
|
17
22
|
|
|
18
|
-
// Ensure the credentials file is present
|
|
19
|
-
if (!doesFileExist(this.credentialsFilePath)) {
|
|
23
|
+
// Ensure the credentials file is present (skip if using env var token)
|
|
24
|
+
if (!process.env[MC_ACCESS_TOKEN_ENV_VAR] && !doesFileExist(this.credentialsFilePath)) {
|
|
20
25
|
fs.mkdirSync(credentialsFolderPath, {
|
|
21
26
|
recursive: true
|
|
22
27
|
});
|
|
@@ -42,6 +47,11 @@ let CredentialsStorage = /*#__PURE__*/function () {
|
|
|
42
47
|
}, {
|
|
43
48
|
key: "getToken",
|
|
44
49
|
value: function getToken(environmentKey) {
|
|
50
|
+
// Check for environment variable token first (useful for CI)
|
|
51
|
+
const envToken = process.env[MC_ACCESS_TOKEN_ENV_VAR];
|
|
52
|
+
if (envToken) {
|
|
53
|
+
return envToken;
|
|
54
|
+
}
|
|
45
55
|
const allCredentials = this._loadCredentials();
|
|
46
56
|
if (!this.isSessionValid(environmentKey)) {
|
|
47
57
|
return null;
|
|
@@ -51,6 +61,10 @@ let CredentialsStorage = /*#__PURE__*/function () {
|
|
|
51
61
|
}, {
|
|
52
62
|
key: "setToken",
|
|
53
63
|
value: function setToken(environmentKey, credentials) {
|
|
64
|
+
// Don't write credentials if using env var token
|
|
65
|
+
if (process.env[MC_ACCESS_TOKEN_ENV_VAR]) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
54
68
|
const allCredentials = this._loadCredentials();
|
|
55
69
|
allCredentials[environmentKey] = credentials;
|
|
56
70
|
this._writeCredentials(allCredentials);
|
|
@@ -58,6 +72,10 @@ let CredentialsStorage = /*#__PURE__*/function () {
|
|
|
58
72
|
}, {
|
|
59
73
|
key: "isSessionValid",
|
|
60
74
|
value: function isSessionValid(environmentKey) {
|
|
75
|
+
// If using environment variable token, assume it's valid
|
|
76
|
+
if (process.env[MC_ACCESS_TOKEN_ENV_VAR]) {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
61
79
|
const allCredentials = this._loadCredentials();
|
|
62
80
|
const credentials = allCredentials[environmentKey];
|
|
63
81
|
if (!credentials) {
|
|
@@ -11,11 +11,15 @@ export type TCliCommandCompileHtmlOptions = {
|
|
|
11
11
|
export type TCliCommandConfigSyncOptions = {
|
|
12
12
|
dryRun: boolean;
|
|
13
13
|
};
|
|
14
|
+
export type TCliCommandConfigSyncCIOptions = {
|
|
15
|
+
dryRun: boolean;
|
|
16
|
+
};
|
|
14
17
|
export type TCliCommandLoginOptions = {
|
|
15
18
|
mcApiUrl?: string;
|
|
16
19
|
projectKey?: string;
|
|
17
20
|
oauthScope?: string[];
|
|
18
21
|
force?: boolean;
|
|
22
|
+
headless?: boolean;
|
|
19
23
|
};
|
|
20
24
|
export type TCliCommandSetDeploymentPreviewOptions = {
|
|
21
25
|
alias?: string;
|