@commercetools-frontend/mc-scripts 22.30.2 → 22.31.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 +19 -19
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +19 -19
- package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +19 -19
- package/dist/{build-f86a84a7.cjs.dev.js → build-08fc2868.cjs.dev.js} +6 -6
- package/dist/{build-14007257.esm.js → build-b00da074.esm.js} +6 -6
- package/dist/{build-9031cc94.cjs.prod.js → build-bfc9ead3.cjs.prod.js} +6 -6
- package/dist/{build-vite-87662f4d.cjs.dev.js → build-vite-14eeea5d.cjs.dev.js} +7 -8
- package/dist/{build-vite-b19a39fb.esm.js → build-vite-71767c7d.esm.js} +7 -8
- package/dist/{build-vite-c7ccff49.cjs.prod.js → build-vite-cefb3775.cjs.prod.js} +7 -8
- 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-b325191e.cjs.prod.js → config-sync-a76e45e3.cjs.prod.js} +64 -74
- package/dist/{config-sync-1724cc9a.cjs.dev.js → config-sync-b2172892.cjs.dev.js} +66 -76
- package/dist/{config-sync-fc206c13.esm.js → config-sync-e5aa853f.esm.js} +66 -75
- package/dist/{create-postcss-config-057a555f.cjs.prod.js → create-postcss-config-4636f5c9.cjs.prod.js} +1 -1
- package/dist/{create-postcss-config-0617df94.cjs.dev.js → create-postcss-config-ce058cc5.cjs.dev.js} +1 -1
- package/dist/{create-postcss-config-807412fe.esm.js → create-postcss-config-e3ad83aa.esm.js} +1 -1
- package/dist/{create-webpack-config-for-development-568a4b28.cjs.dev.js → create-webpack-config-for-development-154ee43f.cjs.dev.js} +5 -5
- package/dist/{create-webpack-config-for-development-506dcdae.esm.js → create-webpack-config-for-development-aabb9a02.esm.js} +5 -5
- package/dist/{create-webpack-config-for-development-57671ec4.cjs.prod.js → create-webpack-config-for-development-b65498a3.cjs.prod.js} +5 -5
- package/dist/{create-webpack-config-for-production-7acd5767.cjs.dev.js → create-webpack-config-for-production-ce81f82b.cjs.dev.js} +6 -6
- package/dist/{create-webpack-config-for-production-44bd9918.esm.js → create-webpack-config-for-production-e8ba7a77.esm.js} +6 -6
- package/dist/{create-webpack-config-for-production-98a57ade.cjs.prod.js → create-webpack-config-for-production-f2aadce3.cjs.prod.js} +6 -6
- package/dist/{credentials-storage-c561765b.cjs.prod.js → credentials-storage-cac35ba6.cjs.prod.js} +2 -2
- package/dist/{credentials-storage-60d64f06.cjs.dev.js → credentials-storage-e3abd27b.cjs.dev.js} +2 -2
- package/dist/{credentials-storage-c04d4f40.esm.js → credentials-storage-eb6f9e03.esm.js} +2 -2
- package/dist/{deployment-previews-set-8e61ad4a.cjs.dev.js → deployment-previews-set-1fd17456.cjs.dev.js} +22 -28
- package/dist/{deployment-previews-set-46ac7db8.cjs.prod.js → deployment-previews-set-3c88d175.cjs.prod.js} +22 -28
- package/dist/{deployment-previews-set-e6668f10.esm.js → deployment-previews-set-ca0b28cb.esm.js} +22 -27
- package/dist/{graphql-requests-374900f3.cjs.dev.js → graphql-requests-0887e583.cjs.prod.js} +3 -6
- package/dist/{graphql-requests-4a3570d5.esm.js → graphql-requests-7e319ebc.esm.js} +3 -6
- package/dist/{graphql-requests-b46c1a1f.cjs.prod.js → graphql-requests-b05fd260.cjs.dev.js} +3 -6
- 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-ae73724b.cjs.dev.js → login-5fa5604e.cjs.dev.js} +8 -8
- package/dist/{login-caf53bc3.esm.js → login-7f5bb79c.esm.js} +8 -8
- package/dist/{login-8982f184.cjs.prod.js → login-829a1b56.cjs.prod.js} +8 -8
- package/dist/{package-15bc96fe.cjs.dev.js → package-378cc0b4.cjs.prod.js} +8 -8
- package/dist/{package-7793b7ec.cjs.prod.js → package-3a9024e1.cjs.dev.js} +8 -8
- package/dist/{package-f33bb0fc.esm.js → package-9a7b7976.esm.js} +8 -8
- 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-7b2e35a1.cjs.prod.js → serve-5666b16a.cjs.prod.js} +2 -3
- package/dist/{serve-5f480513.esm.js → serve-6a951584.esm.js} +2 -3
- package/dist/{serve-efceb930.cjs.dev.js → serve-f898c45e.cjs.dev.js} +2 -3
- package/dist/{start-c1143111.cjs.dev.js → start-58d4a0d4.cjs.dev.js} +7 -8
- package/dist/{start-2c728521.esm.js → start-7877df72.esm.js} +7 -8
- package/dist/{start-5bd6fd2b.cjs.prod.js → start-df494b7b.cjs.prod.js} +7 -8
- package/dist/{start-vite-8e72a6a9.cjs.prod.js → start-vite-1f2a92bd.cjs.prod.js} +3 -4
- package/dist/{start-vite-7d25a064.cjs.dev.js → start-vite-ce32d36a.cjs.dev.js} +3 -4
- package/dist/{start-vite-e706f764.esm.js → start-vite-d68b39d3.esm.js} +3 -4
- package/dist/{vite-plugin-svgr-13d96e7a.esm.js → vite-plugin-svgr-069f402d.esm.js} +2 -2
- package/dist/{vite-plugin-svgr-7def8ea1.cjs.prod.js → vite-plugin-svgr-7fb42bbf.cjs.dev.js} +2 -2
- package/dist/{vite-plugin-svgr-496f5b25.cjs.dev.js → vite-plugin-svgr-b080c510.cjs.prod.js} +2 -2
- package/package.json +8 -8
- 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 +5 -5
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +5 -5
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +5 -5
- 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
|
@@ -29,9 +29,9 @@ 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-ce058cc5.cjs.dev.js');
|
|
33
33
|
var hasJsxRuntime = require('./has-jsx-runtime-aa5d21ee.cjs.dev.js');
|
|
34
|
-
var paths = require('./paths-
|
|
34
|
+
var paths = require('./paths-b76fc753.cjs.dev.js');
|
|
35
35
|
var vendorsToTranspile = require('./vendors-to-transpile-6ab4ea06.cjs.dev.js');
|
|
36
36
|
|
|
37
37
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -108,7 +108,7 @@ let FinalStatsWriterPlugin = /*#__PURE__*/function () {
|
|
|
108
108
|
fs__default["default"].writeFileSync(path__default["default"].join(this.config.outputPath, 'stats.json'), _JSON$stringify__default["default"](finalStats, null, 2));
|
|
109
109
|
} catch (error) {
|
|
110
110
|
// eslint-disable-next-line no-console
|
|
111
|
-
console.warn(
|
|
111
|
+
console.warn(`[FinalStatsWriterPlugin] The dist folder could not be found at ${this.config.outputPath}. Check the console for errors during the webpack compilation.`);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
}]);
|
|
@@ -222,7 +222,7 @@ function createWebpackConfigForProduction() {
|
|
|
222
222
|
// https://github.com/facebook/create-react-app/issues/290
|
|
223
223
|
// `web` extension prefixes have been added for better support
|
|
224
224
|
// for React Native Web.
|
|
225
|
-
extensions: _mapInstanceProperty__default["default"](_context2 = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context2, ext =>
|
|
225
|
+
extensions: _mapInstanceProperty__default["default"](_context2 = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context2, ext => `.${ext}`),
|
|
226
226
|
// NOTE: this is meant to be a temporary list of fallback/polyfills for certain
|
|
227
227
|
// nodejs modules. With Webpack <5 these polyfills were included by default in Webpack,
|
|
228
228
|
// however now it's not the case anymore.
|
|
@@ -350,9 +350,9 @@ function createWebpackConfigForProduction() {
|
|
|
350
350
|
name: 'prefixIds',
|
|
351
351
|
params: {
|
|
352
352
|
delim: '',
|
|
353
|
-
prefix: (_, info) =>
|
|
353
|
+
prefix: (_, info) => `svg${crypto__default["default"].createHash('shake256', {
|
|
354
354
|
outputLength: 6
|
|
355
|
-
}).update(info.path || '').digest('hex')
|
|
355
|
+
}).update(info.path || '').digest('hex')}`
|
|
356
356
|
}
|
|
357
357
|
}]
|
|
358
358
|
}
|
|
@@ -27,9 +27,9 @@ 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-e3ad83aa.esm.js';
|
|
31
31
|
import { h as hasJsxRuntime } from './has-jsx-runtime-e3ecb09b.esm.js';
|
|
32
|
-
import { p as paths } from './paths-
|
|
32
|
+
import { p as paths } from './paths-39f22b8b.esm.js';
|
|
33
33
|
import { v as vendorsToTranspile } from './vendors-to-transpile-7dc84a72.esm.js';
|
|
34
34
|
|
|
35
35
|
let FinalStatsWriterPlugin = /*#__PURE__*/function () {
|
|
@@ -78,7 +78,7 @@ let FinalStatsWriterPlugin = /*#__PURE__*/function () {
|
|
|
78
78
|
fs.writeFileSync(path.join(this.config.outputPath, 'stats.json'), _JSON$stringify(finalStats, null, 2));
|
|
79
79
|
} catch (error) {
|
|
80
80
|
// eslint-disable-next-line no-console
|
|
81
|
-
console.warn(
|
|
81
|
+
console.warn(`[FinalStatsWriterPlugin] The dist folder could not be found at ${this.config.outputPath}. Check the console for errors during the webpack compilation.`);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}]);
|
|
@@ -192,7 +192,7 @@ function createWebpackConfigForProduction() {
|
|
|
192
192
|
// https://github.com/facebook/create-react-app/issues/290
|
|
193
193
|
// `web` extension prefixes have been added for better support
|
|
194
194
|
// for React Native Web.
|
|
195
|
-
extensions: _mapInstanceProperty(_context2 = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context2, ext =>
|
|
195
|
+
extensions: _mapInstanceProperty(_context2 = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context2, ext => `.${ext}`),
|
|
196
196
|
// NOTE: this is meant to be a temporary list of fallback/polyfills for certain
|
|
197
197
|
// nodejs modules. With Webpack <5 these polyfills were included by default in Webpack,
|
|
198
198
|
// however now it's not the case anymore.
|
|
@@ -320,9 +320,9 @@ function createWebpackConfigForProduction() {
|
|
|
320
320
|
name: 'prefixIds',
|
|
321
321
|
params: {
|
|
322
322
|
delim: '',
|
|
323
|
-
prefix: (_, info) =>
|
|
323
|
+
prefix: (_, info) => `svg${crypto.createHash('shake256', {
|
|
324
324
|
outputLength: 6
|
|
325
|
-
}).update(info.path || '').digest('hex')
|
|
325
|
+
}).update(info.path || '').digest('hex')}`
|
|
326
326
|
}
|
|
327
327
|
}]
|
|
328
328
|
}
|
|
@@ -29,9 +29,9 @@ 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-4636f5c9.cjs.prod.js');
|
|
33
33
|
var hasJsxRuntime = require('./has-jsx-runtime-c3202df5.cjs.prod.js');
|
|
34
|
-
var paths = require('./paths-
|
|
34
|
+
var paths = require('./paths-7768b440.cjs.prod.js');
|
|
35
35
|
var vendorsToTranspile = require('./vendors-to-transpile-04a49d40.cjs.prod.js');
|
|
36
36
|
|
|
37
37
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -108,7 +108,7 @@ let FinalStatsWriterPlugin = /*#__PURE__*/function () {
|
|
|
108
108
|
fs__default["default"].writeFileSync(path__default["default"].join(this.config.outputPath, 'stats.json'), _JSON$stringify__default["default"](finalStats, null, 2));
|
|
109
109
|
} catch (error) {
|
|
110
110
|
// eslint-disable-next-line no-console
|
|
111
|
-
console.warn(
|
|
111
|
+
console.warn(`[FinalStatsWriterPlugin] The dist folder could not be found at ${this.config.outputPath}. Check the console for errors during the webpack compilation.`);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
}]);
|
|
@@ -222,7 +222,7 @@ function createWebpackConfigForProduction() {
|
|
|
222
222
|
// https://github.com/facebook/create-react-app/issues/290
|
|
223
223
|
// `web` extension prefixes have been added for better support
|
|
224
224
|
// for React Native Web.
|
|
225
|
-
extensions: _mapInstanceProperty__default["default"](_context2 = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context2, ext =>
|
|
225
|
+
extensions: _mapInstanceProperty__default["default"](_context2 = ['js', 'mjs', 'cjs', 'ts', 'tsx', 'json', 'jsx']).call(_context2, ext => `.${ext}`),
|
|
226
226
|
// NOTE: this is meant to be a temporary list of fallback/polyfills for certain
|
|
227
227
|
// nodejs modules. With Webpack <5 these polyfills were included by default in Webpack,
|
|
228
228
|
// however now it's not the case anymore.
|
|
@@ -350,9 +350,9 @@ function createWebpackConfigForProduction() {
|
|
|
350
350
|
name: 'prefixIds',
|
|
351
351
|
params: {
|
|
352
352
|
delim: '',
|
|
353
|
-
prefix: (_, info) =>
|
|
353
|
+
prefix: (_, info) => `svg${crypto__default["default"].createHash('shake256', {
|
|
354
354
|
outputLength: 6
|
|
355
|
-
}).update(info.path || '').digest('hex')
|
|
355
|
+
}).update(info.path || '').digest('hex')}`
|
|
356
356
|
}
|
|
357
357
|
}]
|
|
358
358
|
}
|
package/dist/{credentials-storage-c561765b.cjs.prod.js → credentials-storage-cac35ba6.cjs.prod.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var createHttpUserAgent = require('@commercetools/http-user-agent');
|
|
4
|
-
var _package = require('./package-
|
|
4
|
+
var _package = require('./package-378cc0b4.cjs.prod.js');
|
|
5
5
|
var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
6
6
|
var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
|
|
7
7
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
@@ -30,7 +30,7 @@ const userAgent = createHttpUserAgent__default["default"]({
|
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
const homedir = os__default["default"].homedir();
|
|
33
|
-
const credentialsFolderPath = path__default["default"].join(homedir,
|
|
33
|
+
const credentialsFolderPath = path__default["default"].join(homedir, `.commercetools`);
|
|
34
34
|
const credentialsFilePath = path__default["default"].join(credentialsFolderPath, 'mc-credentials.json');
|
|
35
35
|
let CredentialsStorage = /*#__PURE__*/function () {
|
|
36
36
|
function CredentialsStorage() {
|
package/dist/{credentials-storage-60d64f06.cjs.dev.js → credentials-storage-e3abd27b.cjs.dev.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var createHttpUserAgent = require('@commercetools/http-user-agent');
|
|
4
|
-
var _package = require('./package-
|
|
4
|
+
var _package = require('./package-3a9024e1.cjs.dev.js');
|
|
5
5
|
var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
6
6
|
var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
|
|
7
7
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
@@ -30,7 +30,7 @@ const userAgent = createHttpUserAgent__default["default"]({
|
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
const homedir = os__default["default"].homedir();
|
|
33
|
-
const credentialsFolderPath = path__default["default"].join(homedir,
|
|
33
|
+
const credentialsFolderPath = path__default["default"].join(homedir, `.commercetools`);
|
|
34
34
|
const credentialsFilePath = path__default["default"].join(credentialsFolderPath, 'mc-credentials.json');
|
|
35
35
|
let CredentialsStorage = /*#__PURE__*/function () {
|
|
36
36
|
function CredentialsStorage() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import createHttpUserAgent from '@commercetools/http-user-agent';
|
|
2
|
-
import { p as pkgJson } from './package-
|
|
2
|
+
import { p as pkgJson } from './package-9a7b7976.esm.js';
|
|
3
3
|
import _classCallCheck from '@babel/runtime-corejs3/helpers/esm/classCallCheck';
|
|
4
4
|
import _createClass from '@babel/runtime-corejs3/helpers/esm/createClass';
|
|
5
5
|
import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
@@ -19,7 +19,7 @@ const userAgent = createHttpUserAgent({
|
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
const homedir = os.homedir();
|
|
22
|
-
const credentialsFolderPath = path.join(homedir,
|
|
22
|
+
const credentialsFolderPath = path.join(homedir, `.commercetools`);
|
|
23
23
|
const credentialsFilePath = path.join(credentialsFolderPath, 'mc-credentials.json');
|
|
24
24
|
let CredentialsStorage = /*#__PURE__*/function () {
|
|
25
25
|
function CredentialsStorage() {
|
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
|
|
4
4
|
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
5
|
-
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
6
5
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
7
6
|
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
8
7
|
var chalk = require('chalk');
|
|
9
8
|
var prompts = require('prompts');
|
|
10
9
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
11
|
-
var credentialsStorage$1 = require('./credentials-storage-
|
|
12
|
-
var graphqlRequests = require('./graphql-requests-
|
|
10
|
+
var credentialsStorage$1 = require('./credentials-storage-e3abd27b.cjs.dev.js');
|
|
11
|
+
var graphqlRequests = require('./graphql-requests-b05fd260.cjs.dev.js');
|
|
13
12
|
require('@commercetools/http-user-agent');
|
|
14
|
-
require('./package-
|
|
13
|
+
require('./package-3a9024e1.cjs.dev.js');
|
|
15
14
|
require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
16
15
|
require('@babel/runtime-corejs3/helpers/createClass');
|
|
17
16
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
@@ -38,7 +37,6 @@ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e };
|
|
|
38
37
|
|
|
39
38
|
var _URL__default = /*#__PURE__*/_interopDefault(_URL);
|
|
40
39
|
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
41
|
-
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
42
40
|
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
43
41
|
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
44
42
|
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
@@ -58,25 +56,24 @@ const validateUrl = function () {
|
|
|
58
56
|
const validateAlias = function () {
|
|
59
57
|
let alias = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
60
58
|
try {
|
|
61
|
-
new _URL__default["default"](
|
|
59
|
+
new _URL__default["default"](`https://${alias}.commercetools.com/`);
|
|
62
60
|
return true;
|
|
63
61
|
} catch (error) {
|
|
64
62
|
return false;
|
|
65
63
|
}
|
|
66
64
|
};
|
|
67
65
|
const getMcUrlLink = _ref => {
|
|
68
|
-
var _context2, _context3, _context4;
|
|
69
66
|
let mcApiUrl = _ref.mcApiUrl,
|
|
70
67
|
organizationId = _ref.organizationId,
|
|
71
68
|
customEntityId = _ref.customEntityId,
|
|
72
69
|
isCustomView = _ref.isCustomView;
|
|
73
70
|
const mcUrl = mcApiUrl.replace('mc-api', 'mc');
|
|
74
|
-
const customEntityLink =
|
|
71
|
+
const customEntityLink = `${mcUrl}/account/organizations/${organizationId}/custom-${isCustomView ? 'views' : 'applications'}/owned/${customEntityId}/deployment-previews`;
|
|
75
72
|
return customEntityLink;
|
|
76
73
|
};
|
|
77
74
|
const isCustomViewData = data => data.entryPointUriPath === undefined;
|
|
78
75
|
async function setDeploymentPreview(_ref2) {
|
|
79
|
-
var
|
|
76
|
+
var _context3;
|
|
80
77
|
let mcApiUrl = _ref2.mcApiUrl,
|
|
81
78
|
applicationId = _ref2.applicationId,
|
|
82
79
|
applicationIdentifier = _ref2.applicationIdentifier,
|
|
@@ -97,28 +94,28 @@ async function setDeploymentPreview(_ref2) {
|
|
|
97
94
|
applicationIdentifier
|
|
98
95
|
});
|
|
99
96
|
if (!fetchedCustomApplication) {
|
|
100
|
-
throw new Error(
|
|
97
|
+
throw new Error(`The Custom Application "${applicationIdentifier}" does not exist in the Merchant Center. Please create a Custom Application first before configuring deployment previews.`);
|
|
101
98
|
}
|
|
102
99
|
let deploymentAlias = options.alias;
|
|
103
100
|
// If the alias was not provided as an argument to the script, let's ask for it.
|
|
104
101
|
if (!deploymentAlias) {
|
|
105
|
-
var
|
|
102
|
+
var _context2;
|
|
106
103
|
const _await$prompts = await prompts__default["default"]({
|
|
107
104
|
type: 'text',
|
|
108
105
|
name: 'alias',
|
|
109
|
-
message: _filterInstanceProperty__default["default"](
|
|
106
|
+
message: _filterInstanceProperty__default["default"](_context2 = [`Enter the alias for the deployment preview`, options.dryRun && chalk__default["default"].gray('Using "--dry-run", no deployment preview will be created.')]).call(_context2, Boolean).join('\n'),
|
|
110
107
|
validate: value => validateAlias(value)
|
|
111
108
|
}),
|
|
112
109
|
alias = _await$prompts.alias;
|
|
113
110
|
deploymentAlias = alias;
|
|
114
111
|
}
|
|
115
|
-
const existingDeploymentPreview = _findInstanceProperty__default["default"](
|
|
112
|
+
const existingDeploymentPreview = _findInstanceProperty__default["default"](_context3 = fetchedCustomApplication.application.deployments).call(_context3, deployment => deployment.alias === deploymentAlias);
|
|
116
113
|
if (!options.alias && !options.url && existingDeploymentPreview) {
|
|
117
|
-
var
|
|
114
|
+
var _context4;
|
|
118
115
|
const _await$prompts2 = await prompts__default["default"]({
|
|
119
116
|
type: 'confirm',
|
|
120
117
|
name: 'aliasOverrideConfirmation',
|
|
121
|
-
message: _filterInstanceProperty__default["default"](
|
|
118
|
+
message: _filterInstanceProperty__default["default"](_context4 = [`The alias "${chalk__default["default"].green(deploymentAlias)}" already exists. Do you want to proceed and update the URL?`, options.dryRun && chalk__default["default"].gray('Using "--dry-run", no deployment preview will be created.')]).call(_context4, Boolean).join('\n'),
|
|
122
119
|
initial: false
|
|
123
120
|
}),
|
|
124
121
|
aliasOverrideConfirmation = _await$prompts2.aliasOverrideConfirmation;
|
|
@@ -129,20 +126,19 @@ async function setDeploymentPreview(_ref2) {
|
|
|
129
126
|
}
|
|
130
127
|
let deploymentUrl = options.url;
|
|
131
128
|
if (!deploymentUrl) {
|
|
132
|
-
var
|
|
129
|
+
var _context5;
|
|
133
130
|
const _await$prompts3 = await prompts__default["default"]({
|
|
134
131
|
type: 'text',
|
|
135
132
|
name: 'url',
|
|
136
|
-
message: _filterInstanceProperty__default["default"](
|
|
133
|
+
message: _filterInstanceProperty__default["default"](_context5 = [`Enter the URL for the deployment preview`, options.dryRun && chalk__default["default"].gray('Using "--dry-run", no deployment preview will be created.')]).call(_context5, Boolean).join('\n'),
|
|
137
134
|
validate: value => validateUrl(value)
|
|
138
135
|
}),
|
|
139
136
|
url = _await$prompts3.url;
|
|
140
137
|
deploymentUrl = url;
|
|
141
138
|
}
|
|
142
139
|
if (options.dryRun) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
console.log("\n".concat(message, "\n"));
|
|
140
|
+
const message = existingDeploymentPreview ? `The existing deployment preview with alias "${deploymentAlias}" would have been updated with this url: "${deploymentUrl}".` : `A new deployment preview with alias "${deploymentAlias}" would have been created with this url: "${deploymentUrl}".`;
|
|
141
|
+
console.log(`\n${message}\n`);
|
|
146
142
|
return;
|
|
147
143
|
}
|
|
148
144
|
const mcDeploymentPreviewsLink = getMcUrlLink({
|
|
@@ -152,7 +148,6 @@ async function setDeploymentPreview(_ref2) {
|
|
|
152
148
|
isCustomView
|
|
153
149
|
});
|
|
154
150
|
if (existingDeploymentPreview) {
|
|
155
|
-
var _context11;
|
|
156
151
|
await graphqlRequests.updateCustomApplicationDeploymentPreview({
|
|
157
152
|
mcApiUrl,
|
|
158
153
|
organizationId: fetchedCustomApplication.organizationId,
|
|
@@ -162,10 +157,9 @@ async function setDeploymentPreview(_ref2) {
|
|
|
162
157
|
url: deploymentUrl
|
|
163
158
|
}
|
|
164
159
|
});
|
|
165
|
-
console.log(chalk__default["default"].green(
|
|
166
|
-
console.log(chalk__default["default"].green(
|
|
160
|
+
console.log(chalk__default["default"].green(`Deployment preview with alias "${deploymentAlias}" updated successfully with URL "${deploymentUrl}".`));
|
|
161
|
+
console.log(chalk__default["default"].green(`You can access the deployment previews at: ${mcDeploymentPreviewsLink}`));
|
|
167
162
|
} else {
|
|
168
|
-
var _context12;
|
|
169
163
|
await graphqlRequests.createCustomApplicationDeploymentPreview({
|
|
170
164
|
mcApiUrl,
|
|
171
165
|
organizationId: fetchedCustomApplication.organizationId,
|
|
@@ -176,8 +170,8 @@ async function setDeploymentPreview(_ref2) {
|
|
|
176
170
|
url: deploymentUrl
|
|
177
171
|
}
|
|
178
172
|
});
|
|
179
|
-
console.log(chalk__default["default"].green(
|
|
180
|
-
console.log(chalk__default["default"].green(
|
|
173
|
+
console.log(chalk__default["default"].green(`Deployment preview with alias "${deploymentAlias}" created successfully with URL "${deploymentUrl}".`));
|
|
174
|
+
console.log(chalk__default["default"].green(`You can access the deployment previews at: ${mcDeploymentPreviewsLink}`));
|
|
181
175
|
}
|
|
182
176
|
}
|
|
183
177
|
async function run(options) {
|
|
@@ -187,11 +181,11 @@ async function run(options) {
|
|
|
187
181
|
mcApiUrl = _applicationConfig$en.mcApiUrl,
|
|
188
182
|
applicationIdentifier = _applicationConfig$en.applicationIdentifier;
|
|
189
183
|
const isCustomView = isCustomViewData(localCustomEntityData);
|
|
190
|
-
console.log(
|
|
184
|
+
console.log(`Using Merchant Center environment "${chalk__default["default"].green(mcApiUrl)}".`);
|
|
191
185
|
console.log();
|
|
192
186
|
const isSessionValid = credentialsStorage.isSessionValid(mcApiUrl);
|
|
193
187
|
if (!isSessionValid) {
|
|
194
|
-
throw new Error(
|
|
188
|
+
throw new Error(`You don't have a valid session. Please, run the "mc-scripts login" command to authenticate yourself.`);
|
|
195
189
|
}
|
|
196
190
|
if (isCustomView) {
|
|
197
191
|
throw new Error('Deployments previews are not supported for Custom Views.');
|
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
|
|
4
4
|
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
5
|
-
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
6
5
|
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
7
6
|
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
8
7
|
var chalk = require('chalk');
|
|
9
8
|
var prompts = require('prompts');
|
|
10
9
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
11
|
-
var credentialsStorage$1 = require('./credentials-storage-
|
|
12
|
-
var graphqlRequests = require('./graphql-requests-
|
|
10
|
+
var credentialsStorage$1 = require('./credentials-storage-cac35ba6.cjs.prod.js');
|
|
11
|
+
var graphqlRequests = require('./graphql-requests-0887e583.cjs.prod.js');
|
|
13
12
|
require('@commercetools/http-user-agent');
|
|
14
|
-
require('./package-
|
|
13
|
+
require('./package-378cc0b4.cjs.prod.js');
|
|
15
14
|
require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
16
15
|
require('@babel/runtime-corejs3/helpers/createClass');
|
|
17
16
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
@@ -38,7 +37,6 @@ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e };
|
|
|
38
37
|
|
|
39
38
|
var _URL__default = /*#__PURE__*/_interopDefault(_URL);
|
|
40
39
|
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
41
|
-
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
42
40
|
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
43
41
|
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
44
42
|
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
@@ -58,25 +56,24 @@ const validateUrl = function () {
|
|
|
58
56
|
const validateAlias = function () {
|
|
59
57
|
let alias = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
60
58
|
try {
|
|
61
|
-
new _URL__default["default"](
|
|
59
|
+
new _URL__default["default"](`https://${alias}.commercetools.com/`);
|
|
62
60
|
return true;
|
|
63
61
|
} catch (error) {
|
|
64
62
|
return false;
|
|
65
63
|
}
|
|
66
64
|
};
|
|
67
65
|
const getMcUrlLink = _ref => {
|
|
68
|
-
var _context2, _context3, _context4;
|
|
69
66
|
let mcApiUrl = _ref.mcApiUrl,
|
|
70
67
|
organizationId = _ref.organizationId,
|
|
71
68
|
customEntityId = _ref.customEntityId,
|
|
72
69
|
isCustomView = _ref.isCustomView;
|
|
73
70
|
const mcUrl = mcApiUrl.replace('mc-api', 'mc');
|
|
74
|
-
const customEntityLink =
|
|
71
|
+
const customEntityLink = `${mcUrl}/account/organizations/${organizationId}/custom-${isCustomView ? 'views' : 'applications'}/owned/${customEntityId}/deployment-previews`;
|
|
75
72
|
return customEntityLink;
|
|
76
73
|
};
|
|
77
74
|
const isCustomViewData = data => data.entryPointUriPath === undefined;
|
|
78
75
|
async function setDeploymentPreview(_ref2) {
|
|
79
|
-
var
|
|
76
|
+
var _context3;
|
|
80
77
|
let mcApiUrl = _ref2.mcApiUrl,
|
|
81
78
|
applicationId = _ref2.applicationId,
|
|
82
79
|
applicationIdentifier = _ref2.applicationIdentifier,
|
|
@@ -97,28 +94,28 @@ async function setDeploymentPreview(_ref2) {
|
|
|
97
94
|
applicationIdentifier
|
|
98
95
|
});
|
|
99
96
|
if (!fetchedCustomApplication) {
|
|
100
|
-
throw new Error(
|
|
97
|
+
throw new Error(`The Custom Application "${applicationIdentifier}" does not exist in the Merchant Center. Please create a Custom Application first before configuring deployment previews.`);
|
|
101
98
|
}
|
|
102
99
|
let deploymentAlias = options.alias;
|
|
103
100
|
// If the alias was not provided as an argument to the script, let's ask for it.
|
|
104
101
|
if (!deploymentAlias) {
|
|
105
|
-
var
|
|
102
|
+
var _context2;
|
|
106
103
|
const _await$prompts = await prompts__default["default"]({
|
|
107
104
|
type: 'text',
|
|
108
105
|
name: 'alias',
|
|
109
|
-
message: _filterInstanceProperty__default["default"](
|
|
106
|
+
message: _filterInstanceProperty__default["default"](_context2 = [`Enter the alias for the deployment preview`, options.dryRun && chalk__default["default"].gray('Using "--dry-run", no deployment preview will be created.')]).call(_context2, Boolean).join('\n'),
|
|
110
107
|
validate: value => validateAlias(value)
|
|
111
108
|
}),
|
|
112
109
|
alias = _await$prompts.alias;
|
|
113
110
|
deploymentAlias = alias;
|
|
114
111
|
}
|
|
115
|
-
const existingDeploymentPreview = _findInstanceProperty__default["default"](
|
|
112
|
+
const existingDeploymentPreview = _findInstanceProperty__default["default"](_context3 = fetchedCustomApplication.application.deployments).call(_context3, deployment => deployment.alias === deploymentAlias);
|
|
116
113
|
if (!options.alias && !options.url && existingDeploymentPreview) {
|
|
117
|
-
var
|
|
114
|
+
var _context4;
|
|
118
115
|
const _await$prompts2 = await prompts__default["default"]({
|
|
119
116
|
type: 'confirm',
|
|
120
117
|
name: 'aliasOverrideConfirmation',
|
|
121
|
-
message: _filterInstanceProperty__default["default"](
|
|
118
|
+
message: _filterInstanceProperty__default["default"](_context4 = [`The alias "${chalk__default["default"].green(deploymentAlias)}" already exists. Do you want to proceed and update the URL?`, options.dryRun && chalk__default["default"].gray('Using "--dry-run", no deployment preview will be created.')]).call(_context4, Boolean).join('\n'),
|
|
122
119
|
initial: false
|
|
123
120
|
}),
|
|
124
121
|
aliasOverrideConfirmation = _await$prompts2.aliasOverrideConfirmation;
|
|
@@ -129,20 +126,19 @@ async function setDeploymentPreview(_ref2) {
|
|
|
129
126
|
}
|
|
130
127
|
let deploymentUrl = options.url;
|
|
131
128
|
if (!deploymentUrl) {
|
|
132
|
-
var
|
|
129
|
+
var _context5;
|
|
133
130
|
const _await$prompts3 = await prompts__default["default"]({
|
|
134
131
|
type: 'text',
|
|
135
132
|
name: 'url',
|
|
136
|
-
message: _filterInstanceProperty__default["default"](
|
|
133
|
+
message: _filterInstanceProperty__default["default"](_context5 = [`Enter the URL for the deployment preview`, options.dryRun && chalk__default["default"].gray('Using "--dry-run", no deployment preview will be created.')]).call(_context5, Boolean).join('\n'),
|
|
137
134
|
validate: value => validateUrl(value)
|
|
138
135
|
}),
|
|
139
136
|
url = _await$prompts3.url;
|
|
140
137
|
deploymentUrl = url;
|
|
141
138
|
}
|
|
142
139
|
if (options.dryRun) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
console.log("\n".concat(message, "\n"));
|
|
140
|
+
const message = existingDeploymentPreview ? `The existing deployment preview with alias "${deploymentAlias}" would have been updated with this url: "${deploymentUrl}".` : `A new deployment preview with alias "${deploymentAlias}" would have been created with this url: "${deploymentUrl}".`;
|
|
141
|
+
console.log(`\n${message}\n`);
|
|
146
142
|
return;
|
|
147
143
|
}
|
|
148
144
|
const mcDeploymentPreviewsLink = getMcUrlLink({
|
|
@@ -152,7 +148,6 @@ async function setDeploymentPreview(_ref2) {
|
|
|
152
148
|
isCustomView
|
|
153
149
|
});
|
|
154
150
|
if (existingDeploymentPreview) {
|
|
155
|
-
var _context11;
|
|
156
151
|
await graphqlRequests.updateCustomApplicationDeploymentPreview({
|
|
157
152
|
mcApiUrl,
|
|
158
153
|
organizationId: fetchedCustomApplication.organizationId,
|
|
@@ -162,10 +157,9 @@ async function setDeploymentPreview(_ref2) {
|
|
|
162
157
|
url: deploymentUrl
|
|
163
158
|
}
|
|
164
159
|
});
|
|
165
|
-
console.log(chalk__default["default"].green(
|
|
166
|
-
console.log(chalk__default["default"].green(
|
|
160
|
+
console.log(chalk__default["default"].green(`Deployment preview with alias "${deploymentAlias}" updated successfully with URL "${deploymentUrl}".`));
|
|
161
|
+
console.log(chalk__default["default"].green(`You can access the deployment previews at: ${mcDeploymentPreviewsLink}`));
|
|
167
162
|
} else {
|
|
168
|
-
var _context12;
|
|
169
163
|
await graphqlRequests.createCustomApplicationDeploymentPreview({
|
|
170
164
|
mcApiUrl,
|
|
171
165
|
organizationId: fetchedCustomApplication.organizationId,
|
|
@@ -176,8 +170,8 @@ async function setDeploymentPreview(_ref2) {
|
|
|
176
170
|
url: deploymentUrl
|
|
177
171
|
}
|
|
178
172
|
});
|
|
179
|
-
console.log(chalk__default["default"].green(
|
|
180
|
-
console.log(chalk__default["default"].green(
|
|
173
|
+
console.log(chalk__default["default"].green(`Deployment preview with alias "${deploymentAlias}" created successfully with URL "${deploymentUrl}".`));
|
|
174
|
+
console.log(chalk__default["default"].green(`You can access the deployment previews at: ${mcDeploymentPreviewsLink}`));
|
|
181
175
|
}
|
|
182
176
|
}
|
|
183
177
|
async function run(options) {
|
|
@@ -187,11 +181,11 @@ async function run(options) {
|
|
|
187
181
|
mcApiUrl = _applicationConfig$en.mcApiUrl,
|
|
188
182
|
applicationIdentifier = _applicationConfig$en.applicationIdentifier;
|
|
189
183
|
const isCustomView = isCustomViewData(localCustomEntityData);
|
|
190
|
-
console.log(
|
|
184
|
+
console.log(`Using Merchant Center environment "${chalk__default["default"].green(mcApiUrl)}".`);
|
|
191
185
|
console.log();
|
|
192
186
|
const isSessionValid = credentialsStorage.isSessionValid(mcApiUrl);
|
|
193
187
|
if (!isSessionValid) {
|
|
194
|
-
throw new Error(
|
|
188
|
+
throw new Error(`You don't have a valid session. Please, run the "mc-scripts login" command to authenticate yourself.`);
|
|
195
189
|
}
|
|
196
190
|
if (isCustomView) {
|
|
197
191
|
throw new Error('Deployments previews are not supported for Custom Views.');
|