@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
package/dist/{deployment-previews-set-e6668f10.esm.js → deployment-previews-set-ca0b28cb.esm.js}
RENAMED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import _URL from '@babel/runtime-corejs3/core-js-stable/url';
|
|
2
2
|
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
3
|
-
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
4
3
|
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
5
4
|
import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
6
5
|
import chalk from 'chalk';
|
|
7
6
|
import prompts from 'prompts';
|
|
8
7
|
import { processConfig } from '@commercetools-frontend/application-config';
|
|
9
|
-
import { C as CredentialsStorage } from './credentials-storage-
|
|
10
|
-
import { f as fetchCustomApplication, g as updateCustomApplicationDeploymentPreview, h as createCustomApplicationDeploymentPreview } from './graphql-requests-
|
|
8
|
+
import { C as CredentialsStorage } from './credentials-storage-eb6f9e03.esm.js';
|
|
9
|
+
import { f as fetchCustomApplication, g as updateCustomApplicationDeploymentPreview, h as createCustomApplicationDeploymentPreview } from './graphql-requests-7e319ebc.esm.js';
|
|
11
10
|
import '@commercetools/http-user-agent';
|
|
12
|
-
import './package-
|
|
11
|
+
import './package-9a7b7976.esm.js';
|
|
13
12
|
import '@babel/runtime-corejs3/helpers/classCallCheck';
|
|
14
13
|
import '@babel/runtime-corejs3/helpers/createClass';
|
|
15
14
|
import '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
@@ -46,25 +45,24 @@ const validateUrl = function () {
|
|
|
46
45
|
const validateAlias = function () {
|
|
47
46
|
let alias = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
48
47
|
try {
|
|
49
|
-
new _URL(
|
|
48
|
+
new _URL(`https://${alias}.commercetools.com/`);
|
|
50
49
|
return true;
|
|
51
50
|
} catch (error) {
|
|
52
51
|
return false;
|
|
53
52
|
}
|
|
54
53
|
};
|
|
55
54
|
const getMcUrlLink = _ref => {
|
|
56
|
-
var _context2, _context3, _context4;
|
|
57
55
|
let mcApiUrl = _ref.mcApiUrl,
|
|
58
56
|
organizationId = _ref.organizationId,
|
|
59
57
|
customEntityId = _ref.customEntityId,
|
|
60
58
|
isCustomView = _ref.isCustomView;
|
|
61
59
|
const mcUrl = mcApiUrl.replace('mc-api', 'mc');
|
|
62
|
-
const customEntityLink =
|
|
60
|
+
const customEntityLink = `${mcUrl}/account/organizations/${organizationId}/custom-${isCustomView ? 'views' : 'applications'}/owned/${customEntityId}/deployment-previews`;
|
|
63
61
|
return customEntityLink;
|
|
64
62
|
};
|
|
65
63
|
const isCustomViewData = data => data.entryPointUriPath === undefined;
|
|
66
64
|
async function setDeploymentPreview(_ref2) {
|
|
67
|
-
var
|
|
65
|
+
var _context3;
|
|
68
66
|
let mcApiUrl = _ref2.mcApiUrl,
|
|
69
67
|
applicationId = _ref2.applicationId,
|
|
70
68
|
applicationIdentifier = _ref2.applicationIdentifier,
|
|
@@ -85,28 +83,28 @@ async function setDeploymentPreview(_ref2) {
|
|
|
85
83
|
applicationIdentifier
|
|
86
84
|
});
|
|
87
85
|
if (!fetchedCustomApplication) {
|
|
88
|
-
throw new Error(
|
|
86
|
+
throw new Error(`The Custom Application "${applicationIdentifier}" does not exist in the Merchant Center. Please create a Custom Application first before configuring deployment previews.`);
|
|
89
87
|
}
|
|
90
88
|
let deploymentAlias = options.alias;
|
|
91
89
|
// If the alias was not provided as an argument to the script, let's ask for it.
|
|
92
90
|
if (!deploymentAlias) {
|
|
93
|
-
var
|
|
91
|
+
var _context2;
|
|
94
92
|
const _await$prompts = await prompts({
|
|
95
93
|
type: 'text',
|
|
96
94
|
name: 'alias',
|
|
97
|
-
message: _filterInstanceProperty(
|
|
95
|
+
message: _filterInstanceProperty(_context2 = [`Enter the alias for the deployment preview`, options.dryRun && chalk.gray('Using "--dry-run", no deployment preview will be created.')]).call(_context2, Boolean).join('\n'),
|
|
98
96
|
validate: value => validateAlias(value)
|
|
99
97
|
}),
|
|
100
98
|
alias = _await$prompts.alias;
|
|
101
99
|
deploymentAlias = alias;
|
|
102
100
|
}
|
|
103
|
-
const existingDeploymentPreview = _findInstanceProperty(
|
|
101
|
+
const existingDeploymentPreview = _findInstanceProperty(_context3 = fetchedCustomApplication.application.deployments).call(_context3, deployment => deployment.alias === deploymentAlias);
|
|
104
102
|
if (!options.alias && !options.url && existingDeploymentPreview) {
|
|
105
|
-
var
|
|
103
|
+
var _context4;
|
|
106
104
|
const _await$prompts2 = await prompts({
|
|
107
105
|
type: 'confirm',
|
|
108
106
|
name: 'aliasOverrideConfirmation',
|
|
109
|
-
message: _filterInstanceProperty(
|
|
107
|
+
message: _filterInstanceProperty(_context4 = [`The alias "${chalk.green(deploymentAlias)}" already exists. Do you want to proceed and update the URL?`, options.dryRun && chalk.gray('Using "--dry-run", no deployment preview will be created.')]).call(_context4, Boolean).join('\n'),
|
|
110
108
|
initial: false
|
|
111
109
|
}),
|
|
112
110
|
aliasOverrideConfirmation = _await$prompts2.aliasOverrideConfirmation;
|
|
@@ -117,20 +115,19 @@ async function setDeploymentPreview(_ref2) {
|
|
|
117
115
|
}
|
|
118
116
|
let deploymentUrl = options.url;
|
|
119
117
|
if (!deploymentUrl) {
|
|
120
|
-
var
|
|
118
|
+
var _context5;
|
|
121
119
|
const _await$prompts3 = await prompts({
|
|
122
120
|
type: 'text',
|
|
123
121
|
name: 'url',
|
|
124
|
-
message: _filterInstanceProperty(
|
|
122
|
+
message: _filterInstanceProperty(_context5 = [`Enter the URL for the deployment preview`, options.dryRun && chalk.gray('Using "--dry-run", no deployment preview will be created.')]).call(_context5, Boolean).join('\n'),
|
|
125
123
|
validate: value => validateUrl(value)
|
|
126
124
|
}),
|
|
127
125
|
url = _await$prompts3.url;
|
|
128
126
|
deploymentUrl = url;
|
|
129
127
|
}
|
|
130
128
|
if (options.dryRun) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
console.log("\n".concat(message, "\n"));
|
|
129
|
+
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}".`;
|
|
130
|
+
console.log(`\n${message}\n`);
|
|
134
131
|
return;
|
|
135
132
|
}
|
|
136
133
|
const mcDeploymentPreviewsLink = getMcUrlLink({
|
|
@@ -140,7 +137,6 @@ async function setDeploymentPreview(_ref2) {
|
|
|
140
137
|
isCustomView
|
|
141
138
|
});
|
|
142
139
|
if (existingDeploymentPreview) {
|
|
143
|
-
var _context11;
|
|
144
140
|
await updateCustomApplicationDeploymentPreview({
|
|
145
141
|
mcApiUrl,
|
|
146
142
|
organizationId: fetchedCustomApplication.organizationId,
|
|
@@ -150,10 +146,9 @@ async function setDeploymentPreview(_ref2) {
|
|
|
150
146
|
url: deploymentUrl
|
|
151
147
|
}
|
|
152
148
|
});
|
|
153
|
-
console.log(chalk.green(
|
|
154
|
-
console.log(chalk.green(
|
|
149
|
+
console.log(chalk.green(`Deployment preview with alias "${deploymentAlias}" updated successfully with URL "${deploymentUrl}".`));
|
|
150
|
+
console.log(chalk.green(`You can access the deployment previews at: ${mcDeploymentPreviewsLink}`));
|
|
155
151
|
} else {
|
|
156
|
-
var _context12;
|
|
157
152
|
await createCustomApplicationDeploymentPreview({
|
|
158
153
|
mcApiUrl,
|
|
159
154
|
organizationId: fetchedCustomApplication.organizationId,
|
|
@@ -164,8 +159,8 @@ async function setDeploymentPreview(_ref2) {
|
|
|
164
159
|
url: deploymentUrl
|
|
165
160
|
}
|
|
166
161
|
});
|
|
167
|
-
console.log(chalk.green(
|
|
168
|
-
console.log(chalk.green(
|
|
162
|
+
console.log(chalk.green(`Deployment preview with alias "${deploymentAlias}" created successfully with URL "${deploymentUrl}".`));
|
|
163
|
+
console.log(chalk.green(`You can access the deployment previews at: ${mcDeploymentPreviewsLink}`));
|
|
169
164
|
}
|
|
170
165
|
}
|
|
171
166
|
async function run(options) {
|
|
@@ -175,11 +170,11 @@ async function run(options) {
|
|
|
175
170
|
mcApiUrl = _applicationConfig$en.mcApiUrl,
|
|
176
171
|
applicationIdentifier = _applicationConfig$en.applicationIdentifier;
|
|
177
172
|
const isCustomView = isCustomViewData(localCustomEntityData);
|
|
178
|
-
console.log(
|
|
173
|
+
console.log(`Using Merchant Center environment "${chalk.green(mcApiUrl)}".`);
|
|
179
174
|
console.log();
|
|
180
175
|
const isSessionValid = credentialsStorage.isSessionValid(mcApiUrl);
|
|
181
176
|
if (!isSessionValid) {
|
|
182
|
-
throw new Error(
|
|
177
|
+
throw new Error(`You don't have a valid session. Please, run the "mc-scripts login" command to authenticate yourself.`);
|
|
183
178
|
}
|
|
184
179
|
if (isCustomView) {
|
|
185
180
|
throw new Error('Deployments previews are not supported for Custom Views.');
|
|
@@ -14,7 +14,7 @@ var chalk = require('chalk');
|
|
|
14
14
|
var graphql = require('graphql');
|
|
15
15
|
var graphqlRequest = require('graphql-request');
|
|
16
16
|
var constants = require('@commercetools-frontend/constants');
|
|
17
|
-
var credentialsStorage$1 = require('./credentials-storage-
|
|
17
|
+
var credentialsStorage$1 = require('./credentials-storage-cac35ba6.cjs.prod.js');
|
|
18
18
|
|
|
19
19
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
20
20
|
|
|
@@ -44,7 +44,7 @@ const credentialsStorage = new credentialsStorage$1.CredentialsStorage();
|
|
|
44
44
|
async function requestWithTokenRetry(document, requestOptions) {
|
|
45
45
|
let retryCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
46
46
|
const token = credentialsStorage.getToken(requestOptions.mcApiUrl);
|
|
47
|
-
const client = new graphqlRequest.GraphQLClient(
|
|
47
|
+
const client = new graphqlRequest.GraphQLClient(`${requestOptions.mcApiUrl}/graphql`, {
|
|
48
48
|
headers: _objectSpread(_objectSpread({
|
|
49
49
|
Accept: 'application/json',
|
|
50
50
|
'Content-Type': 'application/json',
|
|
@@ -74,10 +74,7 @@ async function requestWithTokenRetry(document, requestOptions) {
|
|
|
74
74
|
// If it's an unauthorized error, retry the request to force the token to be refreshed.
|
|
75
75
|
if (retryCount === 0 && error.response.errors && error.response.errors.length > 0) {
|
|
76
76
|
var _context;
|
|
77
|
-
const isUnauthorizedError = _someInstanceProperty__default["default"](_context = error.response.errors).call(_context, graphqlError =>
|
|
78
|
-
var _graphqlError$extensi;
|
|
79
|
-
return ((_graphqlError$extensi = graphqlError.extensions) === null || _graphqlError$extensi === void 0 ? void 0 : _graphqlError$extensi.code) === 'UNAUTHENTICATED';
|
|
80
|
-
});
|
|
77
|
+
const isUnauthorizedError = _someInstanceProperty__default["default"](_context = error.response.errors).call(_context, graphqlError => graphqlError.extensions?.code === 'UNAUTHENTICATED');
|
|
81
78
|
if (isUnauthorizedError) {
|
|
82
79
|
console.log(chalk__default["default"].yellow('Expired or invalid session token, attempting to retry the request with a refreshed token...'));
|
|
83
80
|
return requestWithTokenRetry(document, _objectSpread(_objectSpread({}, requestOptions), {}, {
|
|
@@ -12,7 +12,7 @@ import chalk from 'chalk';
|
|
|
12
12
|
import { print } from 'graphql';
|
|
13
13
|
import { GraphQLClient, ClientError } from 'graphql-request';
|
|
14
14
|
import { GRAPHQL_TARGETS } from '@commercetools-frontend/constants';
|
|
15
|
-
import { C as CredentialsStorage, u as userAgent } from './credentials-storage-
|
|
15
|
+
import { C as CredentialsStorage, u as userAgent } from './credentials-storage-eb6f9e03.esm.js';
|
|
16
16
|
|
|
17
17
|
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; }
|
|
18
18
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -29,7 +29,7 @@ const credentialsStorage = new CredentialsStorage();
|
|
|
29
29
|
async function requestWithTokenRetry(document, requestOptions) {
|
|
30
30
|
let retryCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
31
31
|
const token = credentialsStorage.getToken(requestOptions.mcApiUrl);
|
|
32
|
-
const client = new GraphQLClient(
|
|
32
|
+
const client = new GraphQLClient(`${requestOptions.mcApiUrl}/graphql`, {
|
|
33
33
|
headers: _objectSpread(_objectSpread({
|
|
34
34
|
Accept: 'application/json',
|
|
35
35
|
'Content-Type': 'application/json',
|
|
@@ -59,10 +59,7 @@ async function requestWithTokenRetry(document, requestOptions) {
|
|
|
59
59
|
// If it's an unauthorized error, retry the request to force the token to be refreshed.
|
|
60
60
|
if (retryCount === 0 && error.response.errors && error.response.errors.length > 0) {
|
|
61
61
|
var _context;
|
|
62
|
-
const isUnauthorizedError = _someInstanceProperty(_context = error.response.errors).call(_context, graphqlError =>
|
|
63
|
-
var _graphqlError$extensi;
|
|
64
|
-
return ((_graphqlError$extensi = graphqlError.extensions) === null || _graphqlError$extensi === void 0 ? void 0 : _graphqlError$extensi.code) === 'UNAUTHENTICATED';
|
|
65
|
-
});
|
|
62
|
+
const isUnauthorizedError = _someInstanceProperty(_context = error.response.errors).call(_context, graphqlError => graphqlError.extensions?.code === 'UNAUTHENTICATED');
|
|
66
63
|
if (isUnauthorizedError) {
|
|
67
64
|
console.log(chalk.yellow('Expired or invalid session token, attempting to retry the request with a refreshed token...'));
|
|
68
65
|
return requestWithTokenRetry(document, _objectSpread(_objectSpread({}, requestOptions), {}, {
|
|
@@ -14,7 +14,7 @@ var chalk = require('chalk');
|
|
|
14
14
|
var graphql = require('graphql');
|
|
15
15
|
var graphqlRequest = require('graphql-request');
|
|
16
16
|
var constants = require('@commercetools-frontend/constants');
|
|
17
|
-
var credentialsStorage$1 = require('./credentials-storage-
|
|
17
|
+
var credentialsStorage$1 = require('./credentials-storage-e3abd27b.cjs.dev.js');
|
|
18
18
|
|
|
19
19
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
20
20
|
|
|
@@ -44,7 +44,7 @@ const credentialsStorage = new credentialsStorage$1.CredentialsStorage();
|
|
|
44
44
|
async function requestWithTokenRetry(document, requestOptions) {
|
|
45
45
|
let retryCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
46
46
|
const token = credentialsStorage.getToken(requestOptions.mcApiUrl);
|
|
47
|
-
const client = new graphqlRequest.GraphQLClient(
|
|
47
|
+
const client = new graphqlRequest.GraphQLClient(`${requestOptions.mcApiUrl}/graphql`, {
|
|
48
48
|
headers: _objectSpread(_objectSpread({
|
|
49
49
|
Accept: 'application/json',
|
|
50
50
|
'Content-Type': 'application/json',
|
|
@@ -74,10 +74,7 @@ async function requestWithTokenRetry(document, requestOptions) {
|
|
|
74
74
|
// If it's an unauthorized error, retry the request to force the token to be refreshed.
|
|
75
75
|
if (retryCount === 0 && error.response.errors && error.response.errors.length > 0) {
|
|
76
76
|
var _context;
|
|
77
|
-
const isUnauthorizedError = _someInstanceProperty__default["default"](_context = error.response.errors).call(_context, graphqlError =>
|
|
78
|
-
var _graphqlError$extensi;
|
|
79
|
-
return ((_graphqlError$extensi = graphqlError.extensions) === null || _graphqlError$extensi === void 0 ? void 0 : _graphqlError$extensi.code) === 'UNAUTHENTICATED';
|
|
80
|
-
});
|
|
77
|
+
const isUnauthorizedError = _someInstanceProperty__default["default"](_context = error.response.errors).call(_context, graphqlError => graphqlError.extensions?.code === 'UNAUTHENTICATED');
|
|
81
78
|
if (isUnauthorizedError) {
|
|
82
79
|
console.log(chalk__default["default"].yellow('Expired or invalid session token, attempting to retry the request with a refreshed token...'));
|
|
83
80
|
return requestWithTokenRetry(document, _objectSpread(_objectSpread({}, requestOptions), {}, {
|
package/dist/{i18n-message-complilation-8aec9d1b.esm.js → i18n-message-complilation-21d3b0aa.esm.js}
RENAMED
|
@@ -8,7 +8,7 @@ function getI18nMessageFormat(source) {
|
|
|
8
8
|
}
|
|
9
9
|
function handleMessageCompilationError(fileIdentifier, error, warnFunction) {
|
|
10
10
|
if (!process.env.CI) {
|
|
11
|
-
warnFunction(new Error(
|
|
11
|
+
warnFunction(new Error(`[i18n message compilation] Message compilation on ${fileIdentifier} has failed.\n` + `Consider setting the environmental variable ${chalk.yellow('DISABLE_I18N_MESSAGE_COMPILATION')} to true to disable the message loader or resolve the issues on the messages file.\n` + `${error instanceof Error ? `Error: ${error.message}` : ''}`));
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -15,7 +15,7 @@ function getI18nMessageFormat(source) {
|
|
|
15
15
|
}
|
|
16
16
|
function handleMessageCompilationError(fileIdentifier, error, warnFunction) {
|
|
17
17
|
if (!process.env.CI) {
|
|
18
|
-
warnFunction(new Error(
|
|
18
|
+
warnFunction(new Error(`[i18n message compilation] Message compilation on ${fileIdentifier} has failed.\n` + `Consider setting the environmental variable ${chalk__default["default"].yellow('DISABLE_I18N_MESSAGE_COMPILATION')} to true to disable the message loader or resolve the issues on the messages file.\n` + `${error instanceof Error ? `Error: ${error.message}` : ''}`));
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -15,7 +15,7 @@ function getI18nMessageFormat(source) {
|
|
|
15
15
|
}
|
|
16
16
|
function handleMessageCompilationError(fileIdentifier, error, warnFunction) {
|
|
17
17
|
if (!process.env.CI) {
|
|
18
|
-
warnFunction(new Error(
|
|
18
|
+
warnFunction(new Error(`[i18n message compilation] Message compilation on ${fileIdentifier} has failed.\n` + `Consider setting the environmental variable ${chalk__default["default"].yellow('DISABLE_I18N_MESSAGE_COMPILATION')} to true to disable the message loader or resolve the issues on the messages file.\n` + `${error instanceof Error ? `Error: ${error.message}` : ''}`));
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -14,9 +14,9 @@ var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/obje
|
|
|
14
14
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
15
15
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
16
16
|
var fetch = require('node-fetch');
|
|
17
|
-
var credentialsStorage$1 = require('./credentials-storage-
|
|
17
|
+
var credentialsStorage$1 = require('./credentials-storage-e3abd27b.cjs.dev.js');
|
|
18
18
|
require('@commercetools/http-user-agent');
|
|
19
|
-
require('./package-
|
|
19
|
+
require('./package-3a9024e1.cjs.dev.js');
|
|
20
20
|
require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
21
21
|
require('@babel/runtime-corejs3/helpers/createClass');
|
|
22
22
|
require('@babel/runtime-corejs3/core-js-stable/date/now');
|
|
@@ -44,7 +44,7 @@ var fetch__default = /*#__PURE__*/_interopDefault(fetch);
|
|
|
44
44
|
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; }
|
|
45
45
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
46
46
|
const getAuthToken = async (mcApiUrl, payload, headers) => {
|
|
47
|
-
const response = await fetch__default["default"](
|
|
47
|
+
const response = await fetch__default["default"](`${mcApiUrl}/tokens/cli`, {
|
|
48
48
|
method: 'POST',
|
|
49
49
|
headers: _objectSpread({
|
|
50
50
|
Accept: 'application/json',
|
|
@@ -70,13 +70,13 @@ const credentialsStorage = new credentialsStorage$1.CredentialsStorage();
|
|
|
70
70
|
async function run() {
|
|
71
71
|
const applicationConfig$1 = applicationConfig.processConfig();
|
|
72
72
|
const mcApiUrl = applicationConfig$1.env.mcApiUrl;
|
|
73
|
-
console.log(
|
|
73
|
+
console.log(`Using Merchant Center environment "${chalk__default["default"].green(mcApiUrl)}".`);
|
|
74
74
|
console.log();
|
|
75
75
|
if (credentialsStorage.isSessionValid(mcApiUrl)) {
|
|
76
|
-
console.log(
|
|
76
|
+
console.log(`You already have a valid session.`);
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
console.log(
|
|
79
|
+
console.log(`Enter the login credentials:`);
|
|
80
80
|
const _await$prompts = await prompts__default["default"]({
|
|
81
81
|
type: 'text',
|
|
82
82
|
name: 'email',
|
|
@@ -90,14 +90,14 @@ async function run() {
|
|
|
90
90
|
}),
|
|
91
91
|
password = _await$prompts2.password;
|
|
92
92
|
if (!email || !password) {
|
|
93
|
-
throw new Error(
|
|
93
|
+
throw new Error(`Missing email or password values. Aborting.`);
|
|
94
94
|
}
|
|
95
95
|
const credentials = await getAuthToken(mcApiUrl, {
|
|
96
96
|
email,
|
|
97
97
|
password
|
|
98
98
|
});
|
|
99
99
|
credentialsStorage.setToken(mcApiUrl, credentials);
|
|
100
|
-
console.log(chalk__default["default"].green(
|
|
100
|
+
console.log(chalk__default["default"].green(`Login successful.\n`));
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
exports["default"] = run;
|
|
@@ -12,9 +12,9 @@ import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object
|
|
|
12
12
|
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
13
13
|
import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
14
14
|
import fetch from 'node-fetch';
|
|
15
|
-
import { u as userAgent, C as CredentialsStorage } from './credentials-storage-
|
|
15
|
+
import { u as userAgent, C as CredentialsStorage } from './credentials-storage-eb6f9e03.esm.js';
|
|
16
16
|
import '@commercetools/http-user-agent';
|
|
17
|
-
import './package-
|
|
17
|
+
import './package-9a7b7976.esm.js';
|
|
18
18
|
import '@babel/runtime-corejs3/helpers/classCallCheck';
|
|
19
19
|
import '@babel/runtime-corejs3/helpers/createClass';
|
|
20
20
|
import '@babel/runtime-corejs3/core-js-stable/date/now';
|
|
@@ -27,7 +27,7 @@ import 'node:fs';
|
|
|
27
27
|
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; }
|
|
28
28
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29
29
|
const getAuthToken = async (mcApiUrl, payload, headers) => {
|
|
30
|
-
const response = await fetch(
|
|
30
|
+
const response = await fetch(`${mcApiUrl}/tokens/cli`, {
|
|
31
31
|
method: 'POST',
|
|
32
32
|
headers: _objectSpread({
|
|
33
33
|
Accept: 'application/json',
|
|
@@ -53,13 +53,13 @@ const credentialsStorage = new CredentialsStorage();
|
|
|
53
53
|
async function run() {
|
|
54
54
|
const applicationConfig = processConfig();
|
|
55
55
|
const mcApiUrl = applicationConfig.env.mcApiUrl;
|
|
56
|
-
console.log(
|
|
56
|
+
console.log(`Using Merchant Center environment "${chalk.green(mcApiUrl)}".`);
|
|
57
57
|
console.log();
|
|
58
58
|
if (credentialsStorage.isSessionValid(mcApiUrl)) {
|
|
59
|
-
console.log(
|
|
59
|
+
console.log(`You already have a valid session.`);
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
console.log(
|
|
62
|
+
console.log(`Enter the login credentials:`);
|
|
63
63
|
const _await$prompts = await prompts({
|
|
64
64
|
type: 'text',
|
|
65
65
|
name: 'email',
|
|
@@ -73,14 +73,14 @@ async function run() {
|
|
|
73
73
|
}),
|
|
74
74
|
password = _await$prompts2.password;
|
|
75
75
|
if (!email || !password) {
|
|
76
|
-
throw new Error(
|
|
76
|
+
throw new Error(`Missing email or password values. Aborting.`);
|
|
77
77
|
}
|
|
78
78
|
const credentials = await getAuthToken(mcApiUrl, {
|
|
79
79
|
email,
|
|
80
80
|
password
|
|
81
81
|
});
|
|
82
82
|
credentialsStorage.setToken(mcApiUrl, credentials);
|
|
83
|
-
console.log(chalk.green(
|
|
83
|
+
console.log(chalk.green(`Login successful.\n`));
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
export { run as default };
|
|
@@ -14,9 +14,9 @@ var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/obje
|
|
|
14
14
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
15
15
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
16
16
|
var fetch = require('node-fetch');
|
|
17
|
-
var credentialsStorage$1 = require('./credentials-storage-
|
|
17
|
+
var credentialsStorage$1 = require('./credentials-storage-cac35ba6.cjs.prod.js');
|
|
18
18
|
require('@commercetools/http-user-agent');
|
|
19
|
-
require('./package-
|
|
19
|
+
require('./package-378cc0b4.cjs.prod.js');
|
|
20
20
|
require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
21
21
|
require('@babel/runtime-corejs3/helpers/createClass');
|
|
22
22
|
require('@babel/runtime-corejs3/core-js-stable/date/now');
|
|
@@ -44,7 +44,7 @@ var fetch__default = /*#__PURE__*/_interopDefault(fetch);
|
|
|
44
44
|
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; }
|
|
45
45
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
46
46
|
const getAuthToken = async (mcApiUrl, payload, headers) => {
|
|
47
|
-
const response = await fetch__default["default"](
|
|
47
|
+
const response = await fetch__default["default"](`${mcApiUrl}/tokens/cli`, {
|
|
48
48
|
method: 'POST',
|
|
49
49
|
headers: _objectSpread({
|
|
50
50
|
Accept: 'application/json',
|
|
@@ -70,13 +70,13 @@ const credentialsStorage = new credentialsStorage$1.CredentialsStorage();
|
|
|
70
70
|
async function run() {
|
|
71
71
|
const applicationConfig$1 = applicationConfig.processConfig();
|
|
72
72
|
const mcApiUrl = applicationConfig$1.env.mcApiUrl;
|
|
73
|
-
console.log(
|
|
73
|
+
console.log(`Using Merchant Center environment "${chalk__default["default"].green(mcApiUrl)}".`);
|
|
74
74
|
console.log();
|
|
75
75
|
if (credentialsStorage.isSessionValid(mcApiUrl)) {
|
|
76
|
-
console.log(
|
|
76
|
+
console.log(`You already have a valid session.`);
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
console.log(
|
|
79
|
+
console.log(`Enter the login credentials:`);
|
|
80
80
|
const _await$prompts = await prompts__default["default"]({
|
|
81
81
|
type: 'text',
|
|
82
82
|
name: 'email',
|
|
@@ -90,14 +90,14 @@ async function run() {
|
|
|
90
90
|
}),
|
|
91
91
|
password = _await$prompts2.password;
|
|
92
92
|
if (!email || !password) {
|
|
93
|
-
throw new Error(
|
|
93
|
+
throw new Error(`Missing email or password values. Aborting.`);
|
|
94
94
|
}
|
|
95
95
|
const credentials = await getAuthToken(mcApiUrl, {
|
|
96
96
|
email,
|
|
97
97
|
password
|
|
98
98
|
});
|
|
99
99
|
credentialsStorage.setToken(mcApiUrl, credentials);
|
|
100
|
-
console.log(chalk__default["default"].green(
|
|
100
|
+
console.log(chalk__default["default"].green(`Login successful.\n`));
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
exports["default"] = run;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var pkgJson = {
|
|
4
4
|
name: "@commercetools-frontend/mc-scripts",
|
|
5
|
-
version: "22.
|
|
5
|
+
version: "22.31.0",
|
|
6
6
|
description: "Configuration and scripts for developing a MC application",
|
|
7
7
|
bugs: "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
8
8
|
repository: {
|
|
@@ -62,13 +62,13 @@ var pkgJson = {
|
|
|
62
62
|
"@babel/core": "^7.22.17",
|
|
63
63
|
"@babel/runtime": "^7.22.15",
|
|
64
64
|
"@babel/runtime-corejs3": "^7.22.15",
|
|
65
|
-
"@commercetools-frontend/application-components": "22.
|
|
66
|
-
"@commercetools-frontend/application-config": "22.
|
|
67
|
-
"@commercetools-frontend/assets": "22.
|
|
68
|
-
"@commercetools-frontend/babel-preset-mc-app": "22.
|
|
69
|
-
"@commercetools-frontend/constants": "22.
|
|
70
|
-
"@commercetools-frontend/mc-dev-authentication": "22.
|
|
71
|
-
"@commercetools-frontend/mc-html-template": "22.
|
|
65
|
+
"@commercetools-frontend/application-components": "22.31.0",
|
|
66
|
+
"@commercetools-frontend/application-config": "22.31.0",
|
|
67
|
+
"@commercetools-frontend/assets": "22.31.0",
|
|
68
|
+
"@commercetools-frontend/babel-preset-mc-app": "22.31.0",
|
|
69
|
+
"@commercetools-frontend/constants": "22.31.0",
|
|
70
|
+
"@commercetools-frontend/mc-dev-authentication": "22.31.0",
|
|
71
|
+
"@commercetools-frontend/mc-html-template": "22.31.0",
|
|
72
72
|
"@commercetools/http-user-agent": "3.0.0",
|
|
73
73
|
"@formatjs/cli-lib": "^6.3.8",
|
|
74
74
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var pkgJson = {
|
|
4
4
|
name: "@commercetools-frontend/mc-scripts",
|
|
5
|
-
version: "22.
|
|
5
|
+
version: "22.31.0",
|
|
6
6
|
description: "Configuration and scripts for developing a MC application",
|
|
7
7
|
bugs: "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
8
8
|
repository: {
|
|
@@ -62,13 +62,13 @@ var pkgJson = {
|
|
|
62
62
|
"@babel/core": "^7.22.17",
|
|
63
63
|
"@babel/runtime": "^7.22.15",
|
|
64
64
|
"@babel/runtime-corejs3": "^7.22.15",
|
|
65
|
-
"@commercetools-frontend/application-components": "22.
|
|
66
|
-
"@commercetools-frontend/application-config": "22.
|
|
67
|
-
"@commercetools-frontend/assets": "22.
|
|
68
|
-
"@commercetools-frontend/babel-preset-mc-app": "22.
|
|
69
|
-
"@commercetools-frontend/constants": "22.
|
|
70
|
-
"@commercetools-frontend/mc-dev-authentication": "22.
|
|
71
|
-
"@commercetools-frontend/mc-html-template": "22.
|
|
65
|
+
"@commercetools-frontend/application-components": "22.31.0",
|
|
66
|
+
"@commercetools-frontend/application-config": "22.31.0",
|
|
67
|
+
"@commercetools-frontend/assets": "22.31.0",
|
|
68
|
+
"@commercetools-frontend/babel-preset-mc-app": "22.31.0",
|
|
69
|
+
"@commercetools-frontend/constants": "22.31.0",
|
|
70
|
+
"@commercetools-frontend/mc-dev-authentication": "22.31.0",
|
|
71
|
+
"@commercetools-frontend/mc-html-template": "22.31.0",
|
|
72
72
|
"@commercetools/http-user-agent": "3.0.0",
|
|
73
73
|
"@formatjs/cli-lib": "^6.3.8",
|
|
74
74
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var pkgJson = {
|
|
2
2
|
name: "@commercetools-frontend/mc-scripts",
|
|
3
|
-
version: "22.
|
|
3
|
+
version: "22.31.0",
|
|
4
4
|
description: "Configuration and scripts for developing a MC application",
|
|
5
5
|
bugs: "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
repository: {
|
|
@@ -60,13 +60,13 @@ var pkgJson = {
|
|
|
60
60
|
"@babel/core": "^7.22.17",
|
|
61
61
|
"@babel/runtime": "^7.22.15",
|
|
62
62
|
"@babel/runtime-corejs3": "^7.22.15",
|
|
63
|
-
"@commercetools-frontend/application-components": "22.
|
|
64
|
-
"@commercetools-frontend/application-config": "22.
|
|
65
|
-
"@commercetools-frontend/assets": "22.
|
|
66
|
-
"@commercetools-frontend/babel-preset-mc-app": "22.
|
|
67
|
-
"@commercetools-frontend/constants": "22.
|
|
68
|
-
"@commercetools-frontend/mc-dev-authentication": "22.
|
|
69
|
-
"@commercetools-frontend/mc-html-template": "22.
|
|
63
|
+
"@commercetools-frontend/application-components": "22.31.0",
|
|
64
|
+
"@commercetools-frontend/application-config": "22.31.0",
|
|
65
|
+
"@commercetools-frontend/assets": "22.31.0",
|
|
66
|
+
"@commercetools-frontend/babel-preset-mc-app": "22.31.0",
|
|
67
|
+
"@commercetools-frontend/constants": "22.31.0",
|
|
68
|
+
"@commercetools-frontend/mc-dev-authentication": "22.31.0",
|
|
69
|
+
"@commercetools-frontend/mc-html-template": "22.31.0",
|
|
70
70
|
"@commercetools/http-user-agent": "3.0.0",
|
|
71
71
|
"@formatjs/cli-lib": "^6.3.8",
|
|
72
72
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
2
|
-
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
3
2
|
import fs from 'fs';
|
|
4
3
|
import path from 'path';
|
|
5
4
|
import { d as doesFileExist } from './does-file-exist-32618334.esm.js';
|
|
@@ -13,15 +12,11 @@ const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
|
|
|
13
12
|
|
|
14
13
|
// Resolve file paths in the order given
|
|
15
14
|
const resolveModule = (resolveFn, filePath) => {
|
|
16
|
-
const extension = _findInstanceProperty(moduleFileExtensions).call(moduleFileExtensions, extension => {
|
|
17
|
-
var _context;
|
|
18
|
-
return doesFileExist(resolveFn(_concatInstanceProperty(_context = "".concat(filePath, ".")).call(_context, extension)));
|
|
19
|
-
});
|
|
15
|
+
const extension = _findInstanceProperty(moduleFileExtensions).call(moduleFileExtensions, extension => doesFileExist(resolveFn(`${filePath}.${extension}`)));
|
|
20
16
|
if (extension) {
|
|
21
|
-
|
|
22
|
-
return resolveFn(_concatInstanceProperty(_context2 = "".concat(filePath, ".")).call(_context2, extension));
|
|
17
|
+
return resolveFn(`${filePath}.${extension}`);
|
|
23
18
|
}
|
|
24
|
-
return resolveFn(
|
|
19
|
+
return resolveFn(`${filePath}.js`);
|
|
25
20
|
};
|
|
26
21
|
|
|
27
22
|
// Resolve the absolute path of the caller location. This is necessary
|
|
@@ -31,7 +26,7 @@ const paths = {
|
|
|
31
26
|
appBuild: resolveApp('public'),
|
|
32
27
|
appIndexHtmlTemplate: resolveApp('public/index.html.template'),
|
|
33
28
|
appIndexHtml: resolveApp('public/index.html'),
|
|
34
|
-
appWebpackConfig: resolveModule(resolveApp,
|
|
29
|
+
appWebpackConfig: resolveModule(resolveApp, `webpack.config.${process.env.NODE_ENV === 'production' ? 'prod' : 'dev'}`),
|
|
35
30
|
yarnLockFile: resolveApp('yarn.lock'),
|
|
36
31
|
appRoot: resolveApp('.'),
|
|
37
32
|
entryPoint: resolveModule(resolveApp, 'src/index'),
|