@raisenow/tamaro-cli 1.0.18 → 1.0.21
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/dist/{chunk-XKMRWPOF.js → chunk-MVLEHXBO.js} +53 -47
- package/dist/cli.js +184 -116
- package/dist/webpack.config.js +58 -39
- package/package.json +34 -33
- package/src/lib/env.ts +11 -1
- package/src/webpack.config.ts +2 -0
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
1
|
// node_modules/tsup/assets/esm_shims.js
|
|
19
2
|
import { fileURLToPath } from "url";
|
|
20
3
|
import path from "path";
|
|
@@ -60,7 +43,9 @@ var TAMARO_SELF_SERVICE_PACKAGE_NAMES = ["@raisenow/tamaro-self-service"];
|
|
|
60
43
|
var resolveApp = (relativePath) => resolve(realpathSync(process.cwd()), relativePath);
|
|
61
44
|
var resolveOwn = (relativePath) => resolve(__dirname, "..", relativePath);
|
|
62
45
|
var resolveModule = (resolveFn, filePath) => {
|
|
63
|
-
const extension = moduleFileExtensions.find(
|
|
46
|
+
const extension = moduleFileExtensions.find(
|
|
47
|
+
(extension2) => existsSync(resolveFn(`${filePath}.${extension2}`))
|
|
48
|
+
);
|
|
64
49
|
if (extension) {
|
|
65
50
|
return resolveFn(`${filePath}.${extension}`);
|
|
66
51
|
}
|
|
@@ -75,25 +60,28 @@ var resolveBin = (name) => {
|
|
|
75
60
|
};
|
|
76
61
|
var getWidgetUuid = () => basename(resolveApp("."));
|
|
77
62
|
var getPaths = (ifCore) => {
|
|
78
|
-
return ifCore(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
63
|
+
return ifCore(
|
|
64
|
+
{
|
|
65
|
+
app: resolveApp("."),
|
|
66
|
+
appEntry: resolveModule(resolveApp, "src/index"),
|
|
67
|
+
appDist: resolveApp("dist"),
|
|
68
|
+
appNodeModules: resolveApp("node_modules"),
|
|
69
|
+
appTsConfig: resolveApp("tsconfig.json"),
|
|
70
|
+
appHtml: resolveApp("src/*.html"),
|
|
71
|
+
appEnv: resolveApp(".env*"),
|
|
72
|
+
appTailwindConfig: resolveApp("tailwind.config.js")
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
app: resolveApp("."),
|
|
76
|
+
appEntry: resolveModule(resolveApp, "widget"),
|
|
77
|
+
appDist: resolveApp(`../../dist/${getWidgetUuid()}`),
|
|
78
|
+
appNodeModules: resolveApp("../../node_modules"),
|
|
79
|
+
appTsConfig: resolveApp("tsconfig.json"),
|
|
80
|
+
appHtml: resolveApp("*.html"),
|
|
81
|
+
appEnv: resolveApp(".env*"),
|
|
82
|
+
appTailwindConfig: void 0
|
|
83
|
+
}
|
|
84
|
+
);
|
|
97
85
|
};
|
|
98
86
|
var getRelativePaths = (paths) => {
|
|
99
87
|
const relativePaths = {};
|
|
@@ -118,12 +106,18 @@ var getIfCoreFns = () => {
|
|
|
118
106
|
"core"
|
|
119
107
|
]);
|
|
120
108
|
}
|
|
121
|
-
logError(
|
|
109
|
+
logError(
|
|
110
|
+
stripIndent2(` You must run "npx @raisenow/tamaro-cli" commands from:
|
|
122
111
|
1. Root of "${chalk2.bold(TAMARO_CORE_PACKAGE_NAMES[0])}" package folder.
|
|
123
|
-
2. Root of particular customer configuration folder of "${chalk2.bold(
|
|
124
|
-
|
|
112
|
+
2. Root of particular customer configuration folder of "${chalk2.bold(
|
|
113
|
+
TAMARO_CONFIGURATIONS_PACKAGE_NAMES[0]
|
|
114
|
+
)}" package.
|
|
115
|
+
3. "src/self-service" folder of "${chalk2.bold(
|
|
116
|
+
TAMARO_SELF_SERVICE_PACKAGE_NAMES[0]
|
|
117
|
+
)}" package.
|
|
125
118
|
You are currently in "${chalk2.bold(realpathSync(process.cwd()))}".
|
|
126
|
-
`)
|
|
119
|
+
`)
|
|
120
|
+
);
|
|
127
121
|
process.exit(1);
|
|
128
122
|
};
|
|
129
123
|
|
|
@@ -157,7 +151,10 @@ var getEnvVars = (files, ifMin, ifCore, ifLocalCore) => {
|
|
|
157
151
|
(_a = process.env).NODE_ENV ?? (_a.NODE_ENV = ifMin("production", "development"));
|
|
158
152
|
(_b = process.env).BABEL_ENV ?? (_b.BABEL_ENV = ifMin("production", "development"));
|
|
159
153
|
(_c = process.env).EXPOSE_VAR ?? (_c.EXPOSE_VAR = ifCore("rnw.tamaroCore", "rnw.tamaro"));
|
|
160
|
-
(_d = process.env).ELEMENT_ATTRIBUTE_DATA_WIDGET ?? (_d.ELEMENT_ATTRIBUTE_DATA_WIDGET = ifCore(
|
|
154
|
+
(_d = process.env).ELEMENT_ATTRIBUTE_DATA_WIDGET ?? (_d.ELEMENT_ATTRIBUTE_DATA_WIDGET = ifCore(
|
|
155
|
+
"rnw-tamaro-core",
|
|
156
|
+
"rnw-tamaro"
|
|
157
|
+
));
|
|
161
158
|
(_e = process.env).WEBPACK_UNIQUE_NAME ?? (_e.WEBPACK_UNIQUE_NAME = ifCore("RnwTamaroCore", "RnwTamaro"));
|
|
162
159
|
process.env.BUILD_DATE = new Date().toISOString();
|
|
163
160
|
(_f = process.env).PUBLIC_URL ?? (_f.PUBLIC_URL = "");
|
|
@@ -188,10 +185,18 @@ var getEnvVars = (files, ifMin, ifCore, ifLocalCore) => {
|
|
|
188
185
|
"PUBLIC_URL",
|
|
189
186
|
"PRODUCT_NAME",
|
|
190
187
|
"PRODUCT_VERSION",
|
|
188
|
+
"EPP_API_KEY_DEFAULT",
|
|
189
|
+
"EPP_API_URL_STAGE",
|
|
190
|
+
"EPP_API_URL_PROD",
|
|
191
|
+
"EPMS_API_URL_STAGE",
|
|
192
|
+
"EPMS_API_URL_PROD",
|
|
193
|
+
"EPP_PROXY_URL_STAGE",
|
|
194
|
+
"EPP_PROXY_URL_PROD",
|
|
195
|
+
"EPMS_PROXY_URL_STAGE",
|
|
196
|
+
"EPMS_PROXY_URL_PROD",
|
|
191
197
|
"WIDGET_UUID",
|
|
192
198
|
"CORE_URL",
|
|
193
|
-
"CORE_VERSION"
|
|
194
|
-
"IS_CREDIT_CARD_IFRAME"
|
|
199
|
+
"CORE_VERSION"
|
|
195
200
|
];
|
|
196
201
|
const raw = Object.keys(process.env).filter((key) => /^PUBLIC_/.test(key) || varNames.includes(key)).reduce((env, key) => {
|
|
197
202
|
env[key] = process.env[key];
|
|
@@ -220,10 +225,12 @@ var assertEnvValid = (env) => {
|
|
|
220
225
|
halt("Flag \u201C--env\u201D is required.");
|
|
221
226
|
}
|
|
222
227
|
if (!envs.includes(env)) {
|
|
223
|
-
halt(
|
|
228
|
+
halt(
|
|
229
|
+
stripIndent3(`
|
|
224
230
|
Flag \u201C--env\u201D has wrong value.
|
|
225
231
|
Available values are: ${envs.map((v) => `\u201C${v}\u201D`).join(", ")}.
|
|
226
|
-
`)
|
|
232
|
+
`)
|
|
233
|
+
);
|
|
227
234
|
}
|
|
228
235
|
const filePath = files.find((file) => basename2(file) === `.env.${env}`);
|
|
229
236
|
dotenvExpand(dotenvConfig({ path: filePath }));
|
|
@@ -231,7 +238,6 @@ var assertEnvValid = (env) => {
|
|
|
231
238
|
};
|
|
232
239
|
|
|
233
240
|
export {
|
|
234
|
-
__spreadValues,
|
|
235
241
|
logTitle,
|
|
236
242
|
logError,
|
|
237
243
|
logCommand,
|
package/dist/cli.js
CHANGED
|
@@ -12,112 +12,105 @@ import {
|
|
|
12
12
|
resolveBin,
|
|
13
13
|
resolveOwn,
|
|
14
14
|
runCommandSync
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-MVLEHXBO.js";
|
|
16
16
|
|
|
17
17
|
// src/cli.ts
|
|
18
18
|
import { createCommand } from "commander";
|
|
19
19
|
|
|
20
20
|
// package.json
|
|
21
|
-
var name = "@raisenow/tamaro-cli";
|
|
22
|
-
var version = "1.0.18";
|
|
23
|
-
var author = {
|
|
24
|
-
name: "RaiseNow",
|
|
25
|
-
email: "development@raisenow.com"
|
|
26
|
-
};
|
|
27
|
-
var type = "module";
|
|
28
|
-
var scripts = {
|
|
29
|
-
prepare: "npm run build",
|
|
30
|
-
start: "npm run dev",
|
|
31
|
-
build: "tsup src/cli.ts src/webpack.config.ts --clean --shims --format esm",
|
|
32
|
-
"build:watch": "npm run build -- --watch --ignore-watch .idea",
|
|
33
|
-
docs: "npx -y http-server . --cors -o /readme.html",
|
|
34
|
-
lint: "eslint --fix . && prettier --write ."
|
|
35
|
-
};
|
|
36
|
-
var bin = "dist/cli.js";
|
|
37
|
-
var engines = {
|
|
38
|
-
node: ">=16",
|
|
39
|
-
npm: ">=8"
|
|
40
|
-
};
|
|
41
|
-
var dependencies = {
|
|
42
|
-
"@babel/cli": "^7.17.10",
|
|
43
|
-
"@babel/core": "^7.18.2",
|
|
44
|
-
"@babel/plugin-proposal-decorators": "^7.18.2",
|
|
45
|
-
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
46
|
-
"@babel/plugin-transform-runtime": "^7.18.2",
|
|
47
|
-
"@babel/preset-env": "^7.18.2",
|
|
48
|
-
"@babel/preset-react": "^7.17.12",
|
|
49
|
-
"@babel/preset-typescript": "^7.17.12",
|
|
50
|
-
"@babel/runtime-corejs3": "^7.18.3",
|
|
51
|
-
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
|
|
52
|
-
"@statoscope/webpack-plugin": "^5.20.1",
|
|
53
|
-
"@types/columnify": "^1.5.1",
|
|
54
|
-
"@types/lodash": "^4.14.182",
|
|
55
|
-
"@types/node": "^17.0.41",
|
|
56
|
-
"@types/node-notifier": "^8.0.2",
|
|
57
|
-
"@types/resolve-bin": "^0.4.1",
|
|
58
|
-
"@types/webpack-config-utils": "^2.3.1",
|
|
59
|
-
"@typescript-eslint/eslint-plugin": "^5.27.1",
|
|
60
|
-
"@typescript-eslint/parser": "^5.27.1",
|
|
61
|
-
autoprefixer: "^10.4.7",
|
|
62
|
-
"babel-loader": "^8.2.5",
|
|
63
|
-
"babel-plugin-lodash": "^3.3.4",
|
|
64
|
-
chalk: "^5.0.1",
|
|
65
|
-
"clean-webpack-plugin": "^4.0.0",
|
|
66
|
-
columnify: "^1.6.0",
|
|
67
|
-
commander: "^9.3.0",
|
|
68
|
-
"copy-webpack-plugin": "^11.0.0",
|
|
69
|
-
"core-js": "^3.22.8",
|
|
70
|
-
"css-loader": "^6.7.1",
|
|
71
|
-
"css-minimizer-webpack-plugin": "^4.0.0",
|
|
72
|
-
dotenv: "^16.0.1",
|
|
73
|
-
"dotenv-expand": "^8.0.3",
|
|
74
|
-
"escape-string-regexp": "^5.0.0",
|
|
75
|
-
eslint: "^8.17.0",
|
|
76
|
-
"eslint-config-prettier": "^8.5.0",
|
|
77
|
-
"eslint-plugin-node": "^11.1.0",
|
|
78
|
-
"eslint-plugin-promise": "^6.0.0",
|
|
79
|
-
"eslint-webpack-plugin": "^3.1.1",
|
|
80
|
-
execa: "^6.1.0",
|
|
81
|
-
"file-loader": "^6.2.0",
|
|
82
|
-
"fork-ts-checker-webpack-plugin": "^7.2.11",
|
|
83
|
-
glob: "^8.0.3",
|
|
84
|
-
"html-loader": "^3.1.0",
|
|
85
|
-
"html-webpack-plugin": "^5.5.0",
|
|
86
|
-
"json-loader": "^0.5.7",
|
|
87
|
-
lodash: "^4.17.21",
|
|
88
|
-
"mini-css-extract-plugin": "^2.6.0",
|
|
89
|
-
"node-notifier": "^10.0.1",
|
|
90
|
-
portfinder: "^1.0.28",
|
|
91
|
-
postcss: "^8.4.14",
|
|
92
|
-
"postcss-custom-properties": "^12.1.7",
|
|
93
|
-
"postcss-loader": "^7.0.0",
|
|
94
|
-
prettier: "^2.6.2",
|
|
95
|
-
"react-refresh": "^0.13.0",
|
|
96
|
-
"resolve-url-loader": "^5.0.0",
|
|
97
|
-
sass: "^1.52.3",
|
|
98
|
-
"sass-loader": "^13.0.0",
|
|
99
|
-
"source-map-loader": "^3.0.1",
|
|
100
|
-
"strip-indent": "^4.0.0",
|
|
101
|
-
"style-loader": "^3.3.1",
|
|
102
|
-
"tsconfig-paths-webpack-plugin": "^3.5.2",
|
|
103
|
-
tsup: "^6.1.0",
|
|
104
|
-
typescript: "^4.7.3",
|
|
105
|
-
"url-loader": "^4.1.1",
|
|
106
|
-
webpack: "^5.73.0",
|
|
107
|
-
"webpack-cli": "^4.9.2",
|
|
108
|
-
"webpack-config-utils": "^2.3.1",
|
|
109
|
-
"webpack-dev-server": "^4.9.2",
|
|
110
|
-
"yaml-loader": "^0.8.0"
|
|
111
|
-
};
|
|
112
21
|
var package_default = {
|
|
113
|
-
name,
|
|
114
|
-
version,
|
|
115
|
-
author
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
22
|
+
name: "@raisenow/tamaro-cli",
|
|
23
|
+
version: "1.0.21",
|
|
24
|
+
author: {
|
|
25
|
+
name: "RaiseNow",
|
|
26
|
+
email: "development@raisenow.com"
|
|
27
|
+
},
|
|
28
|
+
type: "module",
|
|
29
|
+
scripts: {
|
|
30
|
+
prepare: "npm run build",
|
|
31
|
+
start: "npm run dev",
|
|
32
|
+
build: "tsup src/cli.ts src/webpack.config.ts --clean --shims --format esm",
|
|
33
|
+
"build:watch": "npm run build -- --watch --ignore-watch .idea",
|
|
34
|
+
docs: "npx -y http-server . --cors -o /readme.html",
|
|
35
|
+
lint: "eslint --fix . && prettier --write ."
|
|
36
|
+
},
|
|
37
|
+
bin: "dist/cli.js",
|
|
38
|
+
engines: {
|
|
39
|
+
node: ">=16",
|
|
40
|
+
npm: ">=8"
|
|
41
|
+
},
|
|
42
|
+
dependencies: {
|
|
43
|
+
"@babel/cli": "^7.18.9",
|
|
44
|
+
"@babel/core": "^7.18.9",
|
|
45
|
+
"@babel/plugin-proposal-decorators": "^7.18.9",
|
|
46
|
+
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
47
|
+
"@babel/plugin-transform-runtime": "^7.18.9",
|
|
48
|
+
"@babel/preset-env": "^7.18.9",
|
|
49
|
+
"@babel/preset-react": "^7.18.6",
|
|
50
|
+
"@babel/preset-typescript": "^7.18.6",
|
|
51
|
+
"@babel/runtime-corejs3": "^7.18.9",
|
|
52
|
+
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
|
|
53
|
+
"@statoscope/webpack-plugin": "^5.24.0",
|
|
54
|
+
"@types/columnify": "^1.5.1",
|
|
55
|
+
"@types/lodash": "^4.14.182",
|
|
56
|
+
"@types/node": "^18.6.3",
|
|
57
|
+
"@types/node-notifier": "^8.0.2",
|
|
58
|
+
"@types/resolve-bin": "^0.4.1",
|
|
59
|
+
"@types/webpack-config-utils": "^2.3.1",
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "^5.31.0",
|
|
61
|
+
"@typescript-eslint/parser": "^5.31.0",
|
|
62
|
+
autoprefixer: "^10.4.8",
|
|
63
|
+
"babel-loader": "^8.2.5",
|
|
64
|
+
"babel-plugin-istanbul": "^6.1.1",
|
|
65
|
+
"babel-plugin-lodash": "^3.3.4",
|
|
66
|
+
chalk: "^5.0.1",
|
|
67
|
+
"clean-webpack-plugin": "^4.0.0",
|
|
68
|
+
columnify: "^1.6.0",
|
|
69
|
+
commander: "^9.4.0",
|
|
70
|
+
"copy-webpack-plugin": "^11.0.0",
|
|
71
|
+
"core-js": "^3.24.1",
|
|
72
|
+
"css-loader": "^6.7.1",
|
|
73
|
+
"css-minimizer-webpack-plugin": "^4.0.0",
|
|
74
|
+
dotenv: "^16.0.1",
|
|
75
|
+
"dotenv-expand": "^8.0.3",
|
|
76
|
+
"escape-string-regexp": "^5.0.0",
|
|
77
|
+
eslint: "^8.20.0",
|
|
78
|
+
"eslint-config-prettier": "^8.5.0",
|
|
79
|
+
"eslint-plugin-node": "^11.1.0",
|
|
80
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
81
|
+
"eslint-webpack-plugin": "^3.2.0",
|
|
82
|
+
execa: "^6.1.0",
|
|
83
|
+
"file-loader": "^6.2.0",
|
|
84
|
+
"fork-ts-checker-webpack-plugin": "^7.2.13",
|
|
85
|
+
glob: "^8.0.3",
|
|
86
|
+
"html-loader": "^4.1.0",
|
|
87
|
+
"html-webpack-plugin": "^5.5.0",
|
|
88
|
+
"json-loader": "^0.5.7",
|
|
89
|
+
lodash: "^4.17.21",
|
|
90
|
+
"mini-css-extract-plugin": "^2.6.1",
|
|
91
|
+
"node-notifier": "^10.0.1",
|
|
92
|
+
portfinder: "^1.0.28",
|
|
93
|
+
postcss: "^8.4.14",
|
|
94
|
+
"postcss-custom-properties": "^12.1.7",
|
|
95
|
+
"postcss-loader": "^7.0.1",
|
|
96
|
+
prettier: "^2.7.1",
|
|
97
|
+
"react-refresh": "^0.14.0",
|
|
98
|
+
"resolve-url-loader": "^5.0.0",
|
|
99
|
+
sass: "^1.54.0",
|
|
100
|
+
"sass-loader": "^13.0.2",
|
|
101
|
+
"source-map-loader": "^4.0.0",
|
|
102
|
+
"strip-indent": "^4.0.0",
|
|
103
|
+
"style-loader": "^3.3.1",
|
|
104
|
+
"tsconfig-paths-webpack-plugin": "^4.0.0",
|
|
105
|
+
tsup: "^6.2.1",
|
|
106
|
+
typescript: "^4.7.4",
|
|
107
|
+
"url-loader": "^4.1.1",
|
|
108
|
+
webpack: "^5.74.0",
|
|
109
|
+
"webpack-cli": "^4.10.0",
|
|
110
|
+
"webpack-config-utils": "^2.3.1",
|
|
111
|
+
"webpack-dev-server": "^4.9.3",
|
|
112
|
+
"yaml-loader": "^0.8.0"
|
|
113
|
+
}
|
|
121
114
|
};
|
|
122
115
|
|
|
123
116
|
// src/lib/constants.ts
|
|
@@ -135,7 +128,10 @@ var dev = async (options) => {
|
|
|
135
128
|
assertOptionsValid(options);
|
|
136
129
|
const flags = (await prepareFlags([], options)).join(" ");
|
|
137
130
|
const { ifCore } = getIfCoreFns();
|
|
138
|
-
const title = ifCore(
|
|
131
|
+
const title = ifCore(
|
|
132
|
+
"Running dev web-server for Tamaro Core \u2026",
|
|
133
|
+
"Running dev web-server for customer configuration \u2026"
|
|
134
|
+
);
|
|
139
135
|
const wpBin = resolveBin("webpack");
|
|
140
136
|
const wpConfig = resolveOwn("dist/webpack.config.js");
|
|
141
137
|
const cmd = `
|
|
@@ -259,7 +255,10 @@ var build = async (options) => {
|
|
|
259
255
|
const { ifCore } = getIfCoreFns();
|
|
260
256
|
const paths = getPaths(ifCore);
|
|
261
257
|
const configName = ifCore(CORE_CONFIG_NAME, getWidgetUuid());
|
|
262
|
-
const title = ifCore(
|
|
258
|
+
const title = ifCore(
|
|
259
|
+
"Building optimised (minified) bundle of Tamaro Core \u2026",
|
|
260
|
+
`Building optimised (minified) bundle of \u201C${configName}\u201D customer configuration \u2026`
|
|
261
|
+
);
|
|
263
262
|
const wpBin = resolveBin("webpack");
|
|
264
263
|
const wpConfig = resolveOwn("dist/webpack.config.js");
|
|
265
264
|
const cmd = `
|
|
@@ -328,7 +327,10 @@ var deploy = async (options) => {
|
|
|
328
327
|
logTitle("Deploying to AWS S3 \u2026");
|
|
329
328
|
logCommand(cmdSyncAll);
|
|
330
329
|
try {
|
|
331
|
-
withAwsAuthenticate(
|
|
330
|
+
withAwsAuthenticate(
|
|
331
|
+
() => runCommandSync(cmdSyncAll, { stdout: "inherit" }),
|
|
332
|
+
options
|
|
333
|
+
);
|
|
332
334
|
} catch (error) {
|
|
333
335
|
halt(error.stderr);
|
|
334
336
|
}
|
|
@@ -340,7 +342,10 @@ var deploy = async (options) => {
|
|
|
340
342
|
`;
|
|
341
343
|
logCommand(cmdCpEntry);
|
|
342
344
|
try {
|
|
343
|
-
withAwsAuthenticate(
|
|
345
|
+
withAwsAuthenticate(
|
|
346
|
+
() => runCommandSync(cmdCpEntry, { stdout: "inherit" }),
|
|
347
|
+
options
|
|
348
|
+
);
|
|
344
349
|
} catch (error) {
|
|
345
350
|
halt(error.stderr);
|
|
346
351
|
}
|
|
@@ -383,16 +388,20 @@ var assertOptionsValid3 = (options) => {
|
|
|
383
388
|
};
|
|
384
389
|
var assertDistPathExists = (distPath) => {
|
|
385
390
|
if (!existsSync(distPath)) {
|
|
386
|
-
halt(
|
|
391
|
+
halt(
|
|
392
|
+
stripIndent3(`
|
|
387
393
|
Dist folder does not exists.
|
|
388
394
|
Make sure you have built the bundle before trying to deploy it.
|
|
389
|
-
`)
|
|
395
|
+
`)
|
|
396
|
+
);
|
|
390
397
|
}
|
|
391
398
|
};
|
|
392
399
|
var assertTagValid = (tag) => {
|
|
393
400
|
const regex = /^[a-zA-Z0-9-_.]+$/;
|
|
394
401
|
if (!regex.test(tag)) {
|
|
395
|
-
halt(
|
|
402
|
+
halt(
|
|
403
|
+
`Flag \u201C--tag\u201D has forbidden format. Allowed format: ${regex.toString()}.`
|
|
404
|
+
);
|
|
396
405
|
}
|
|
397
406
|
};
|
|
398
407
|
var prepareFlags4 = (flags, options) => {
|
|
@@ -474,7 +483,9 @@ var assertConfigValid = (config) => {
|
|
|
474
483
|
}
|
|
475
484
|
const regex = /^[a-zA-Z0-9-_]+$/;
|
|
476
485
|
if (!regex.test(config)) {
|
|
477
|
-
halt(
|
|
486
|
+
halt(
|
|
487
|
+
`Flag \u201C--config\u201D has forbidden format. Allowed format: ${regex.toString()}.`
|
|
488
|
+
);
|
|
478
489
|
}
|
|
479
490
|
};
|
|
480
491
|
var prepareFlags6 = (flags, options) => {
|
|
@@ -504,14 +515,18 @@ var deployEmailConfig = async (options) => {
|
|
|
504
515
|
--exact-timestamps
|
|
505
516
|
${flags}
|
|
506
517
|
`;
|
|
507
|
-
logTitle(
|
|
518
|
+
logTitle(
|
|
519
|
+
`Deploying email configuration for \u201C${configName}\u201D customer configuration to AWS S3 \u2026`
|
|
520
|
+
);
|
|
508
521
|
logCommand(cmd);
|
|
509
522
|
try {
|
|
510
523
|
withAwsAuthenticate(() => runCommandSync(cmd, { stdout: "inherit" }), options);
|
|
511
524
|
} catch (error) {
|
|
512
525
|
halt(error.stderr);
|
|
513
526
|
}
|
|
514
|
-
logTitle(
|
|
527
|
+
logTitle(
|
|
528
|
+
`Email configuration for \u201C${configName}\u201D customer configuration is deployed.`
|
|
529
|
+
);
|
|
515
530
|
logDataTable({ "Deploy URL:": deployUrl });
|
|
516
531
|
process.on("exit", () => {
|
|
517
532
|
notify({
|
|
@@ -533,7 +548,9 @@ var assertEmailConfigPathExists = (distPath) => {
|
|
|
533
548
|
var assertBucketValid = (tag) => {
|
|
534
549
|
const regex = /^[a-zA-Z0-9-_]+$/;
|
|
535
550
|
if (!regex.test(tag)) {
|
|
536
|
-
halt(
|
|
551
|
+
halt(
|
|
552
|
+
`Flag \u201C--bucket\u201D has forbidden format. Allowed format: ${regex.toString()}.`
|
|
553
|
+
);
|
|
537
554
|
}
|
|
538
555
|
};
|
|
539
556
|
var assertIsNotCore = () => {
|
|
@@ -554,10 +571,34 @@ process.on("SIGINT", () => {
|
|
|
554
571
|
process.exit(1);
|
|
555
572
|
});
|
|
556
573
|
var cli = createCommand().name(package_default.name).version(package_default.version, "-v, --version");
|
|
557
|
-
cli.command("dev").description(
|
|
574
|
+
cli.command("dev").description(
|
|
575
|
+
"Run the local development server for Tamaro Core or a particular customer configuration"
|
|
576
|
+
).option(
|
|
577
|
+
"--local-core",
|
|
578
|
+
"Load Tamaro Core from localhost:1234 instead of the CDN",
|
|
579
|
+
false
|
|
580
|
+
).option("--port <port>", "Web server port", `${DEFAULT_PORT}`).option("--env <env>", "Environment (dev, stage, prod)").action(async (options) => {
|
|
558
581
|
await dev(options);
|
|
559
582
|
});
|
|
560
|
-
cli.command("build").description(
|
|
583
|
+
cli.command("build").description(
|
|
584
|
+
"Build an optimised (minified) bundle of Tamaro Core or a customer configuration"
|
|
585
|
+
).option(
|
|
586
|
+
"--local-core",
|
|
587
|
+
"Load Tamaro Core from localhost:1234 instead of the CDN",
|
|
588
|
+
false
|
|
589
|
+
).option("--analyze", 'Generate bundle statistics to "reports" folder', false).option("--serve", "Run the generated bundle with a local web server", false).option("--port <port>", "Web server port", `${DEFAULT_PORT}`).option("--env <env>", "Environment (dev, stage, prod)").option(
|
|
590
|
+
"--deploy",
|
|
591
|
+
"Deploy Tamaro Core or a customer configuration bundle to AWS S3",
|
|
592
|
+
false
|
|
593
|
+
).option(
|
|
594
|
+
"--tag <tag>",
|
|
595
|
+
"Tag which should be used for the deployment of the bundle",
|
|
596
|
+
DEFAULT_TAG
|
|
597
|
+
).option(
|
|
598
|
+
"--profile <profile>",
|
|
599
|
+
"AWS profile which should be used for the deployment of the bundle",
|
|
600
|
+
DEFAULT_AWS_PROFILE
|
|
601
|
+
).action(async (options) => {
|
|
561
602
|
await build(options);
|
|
562
603
|
if (options.serve) {
|
|
563
604
|
await serve(options);
|
|
@@ -569,13 +610,40 @@ cli.command("build").description("Build an optimised (minified) bundle of Tamaro
|
|
|
569
610
|
cli.command("serve").description("Run a local web server for pre-built bundle").option("--port <port>", "Web server port", `${DEFAULT_PORT}`).action(async (options) => {
|
|
570
611
|
await serve(options);
|
|
571
612
|
});
|
|
572
|
-
cli.command("deploy").description(
|
|
613
|
+
cli.command("deploy").description(
|
|
614
|
+
"Deploy a pre-built Tamaro Core or customer configuration bundle to AWS S3"
|
|
615
|
+
).option(
|
|
616
|
+
"--tag <tag>",
|
|
617
|
+
"Tag which should be used for the deployment of the bundle",
|
|
618
|
+
DEFAULT_TAG
|
|
619
|
+
).option(
|
|
620
|
+
"--profile <profile>",
|
|
621
|
+
"AWS profile which should be used for the deployment of the bundle",
|
|
622
|
+
DEFAULT_AWS_PROFILE
|
|
623
|
+
).action(async (options) => {
|
|
573
624
|
await deploy(options);
|
|
574
625
|
});
|
|
575
|
-
cli.command("list-deployed").description(
|
|
626
|
+
cli.command("list-deployed").description(
|
|
627
|
+
"List deployments of Tamaro Core or a particular customer configuration"
|
|
628
|
+
).option(
|
|
629
|
+
"--config <config>",
|
|
630
|
+
"Configuration name (default: current customer configuration)"
|
|
631
|
+
).option(
|
|
632
|
+
"--profile <profile>",
|
|
633
|
+
"AWS profile which should be used for fetching deployments",
|
|
634
|
+
DEFAULT_AWS_PROFILE
|
|
635
|
+
).action(async (options) => {
|
|
576
636
|
await listDeployed(options);
|
|
577
637
|
});
|
|
578
|
-
cli.command("deploy-email-config").description("Deploy a widget\u2019s email configuration to AWS S3").option(
|
|
638
|
+
cli.command("deploy-email-config").description("Deploy a widget\u2019s email configuration to AWS S3").option(
|
|
639
|
+
"--bucket <bucket>",
|
|
640
|
+
"AWS S3 bucket where it should be deployed",
|
|
641
|
+
DEFAULT_AWS_S3_EMAIL_CONFIG_BUCKET
|
|
642
|
+
).option(
|
|
643
|
+
"--profile <profile>",
|
|
644
|
+
"AWS profile which should be used for the deployment of email configuration",
|
|
645
|
+
DEFAULT_AWS_PROFILE
|
|
646
|
+
).action(async (options) => {
|
|
579
647
|
await deployEmailConfig(options);
|
|
580
648
|
});
|
|
581
649
|
(async () => {
|
package/dist/webpack.config.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
__spreadValues,
|
|
3
2
|
extensions,
|
|
4
3
|
getEnvVars,
|
|
5
4
|
getIfCoreFns,
|
|
@@ -9,7 +8,7 @@ import {
|
|
|
9
8
|
logTitle,
|
|
10
9
|
moduleFileExtensions,
|
|
11
10
|
resolveApp
|
|
12
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MVLEHXBO.js";
|
|
13
12
|
|
|
14
13
|
// src/webpack.config.ts
|
|
15
14
|
import { createRequire } from "module";
|
|
@@ -36,7 +35,7 @@ var PLUGIN_NAME = "InterpolateHtmlPlugin";
|
|
|
36
35
|
var InterpolateHtmlPlugin = class {
|
|
37
36
|
replacements;
|
|
38
37
|
constructor(replacements) {
|
|
39
|
-
this.replacements =
|
|
38
|
+
this.replacements = { ...replacements };
|
|
40
39
|
}
|
|
41
40
|
apply(compiler) {
|
|
42
41
|
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
|
|
@@ -49,7 +48,10 @@ var InterpolateHtmlPlugin = class {
|
|
|
49
48
|
});
|
|
50
49
|
hooks.afterTemplateExecution.tap(PLUGIN_NAME, (data) => {
|
|
51
50
|
Object.entries(this.replacements).forEach(([key, value]) => {
|
|
52
|
-
data.html = data.html.replace(
|
|
51
|
+
data.html = data.html.replace(
|
|
52
|
+
new RegExp(`%${escapeStringRegexp(key)}%`, "g"),
|
|
53
|
+
value || ""
|
|
54
|
+
);
|
|
53
55
|
});
|
|
54
56
|
return data;
|
|
55
57
|
});
|
|
@@ -88,10 +90,11 @@ var getWebpackConfig = async (env) => {
|
|
|
88
90
|
}),
|
|
89
91
|
{
|
|
90
92
|
loader: require2.resolve("css-loader"),
|
|
91
|
-
options:
|
|
93
|
+
options: {
|
|
92
94
|
sourceMap: ifNotMin(),
|
|
93
|
-
importLoaders: 3
|
|
94
|
-
|
|
95
|
+
importLoaders: 3,
|
|
96
|
+
...cssOptions
|
|
97
|
+
}
|
|
95
98
|
},
|
|
96
99
|
{
|
|
97
100
|
loader: require2.resolve("postcss-loader"),
|
|
@@ -144,16 +147,19 @@ var getWebpackConfig = async (env) => {
|
|
|
144
147
|
crossOriginLoading: "anonymous",
|
|
145
148
|
uniqueName: process.env.WEBPACK_UNIQUE_NAME
|
|
146
149
|
},
|
|
147
|
-
stats: ifAnalyze(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
150
|
+
stats: ifAnalyze(
|
|
151
|
+
{
|
|
152
|
+
all: void 0
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
modules: false,
|
|
156
|
+
children: false,
|
|
157
|
+
chunks: false,
|
|
158
|
+
env: true,
|
|
159
|
+
entrypoints: true,
|
|
160
|
+
errorDetails: true
|
|
161
|
+
}
|
|
162
|
+
),
|
|
157
163
|
module: {
|
|
158
164
|
rules: removeEmpty([
|
|
159
165
|
ifNotMin({
|
|
@@ -166,11 +172,14 @@ var getWebpackConfig = async (env) => {
|
|
|
166
172
|
oneOf: [
|
|
167
173
|
{
|
|
168
174
|
test: /\.(js|ts)x?$/,
|
|
169
|
-
include: ifCore(
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
175
|
+
include: ifCore(
|
|
176
|
+
[
|
|
177
|
+
resolveApp("src"),
|
|
178
|
+
resolveApp("node_modules/micromark"),
|
|
179
|
+
resolveApp("node_modules/decode-named-character-reference")
|
|
180
|
+
],
|
|
181
|
+
[resolveApp("."), resolveApp("../../src")]
|
|
182
|
+
),
|
|
174
183
|
loader: require2.resolve("babel-loader"),
|
|
175
184
|
options: {
|
|
176
185
|
babelrc: false,
|
|
@@ -195,7 +204,9 @@ var getWebpackConfig = async (env) => {
|
|
|
195
204
|
version: 3,
|
|
196
205
|
proposals: true
|
|
197
206
|
},
|
|
198
|
-
absoluteRuntime: dirname(
|
|
207
|
+
absoluteRuntime: dirname(
|
|
208
|
+
require2.resolve("@babel/runtime-corejs3/package.json")
|
|
209
|
+
)
|
|
199
210
|
}
|
|
200
211
|
],
|
|
201
212
|
[
|
|
@@ -206,7 +217,8 @@ var getWebpackConfig = async (env) => {
|
|
|
206
217
|
],
|
|
207
218
|
require2.resolve("@babel/plugin-syntax-dynamic-import"),
|
|
208
219
|
require2.resolve("babel-plugin-lodash"),
|
|
209
|
-
ifHmr(require2.resolve("react-refresh/babel"))
|
|
220
|
+
ifHmr(require2.resolve("react-refresh/babel")),
|
|
221
|
+
ifNotMin(require2.resolve("babel-plugin-istanbul"))
|
|
210
222
|
])
|
|
211
223
|
}
|
|
212
224
|
},
|
|
@@ -270,6 +282,7 @@ var getWebpackConfig = async (env) => {
|
|
|
270
282
|
headers: {
|
|
271
283
|
"Access-Control-Allow-Origin": "*"
|
|
272
284
|
},
|
|
285
|
+
allowedHosts: "all",
|
|
273
286
|
client: {
|
|
274
287
|
overlay: {
|
|
275
288
|
warnings: false,
|
|
@@ -289,13 +302,17 @@ var getWebpackConfig = async (env) => {
|
|
|
289
302
|
cwd: paths.app,
|
|
290
303
|
resolvePluginsRelativeTo: paths.app
|
|
291
304
|
}),
|
|
292
|
-
ifMin(
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
305
|
+
ifMin(
|
|
306
|
+
new CleanWebpackPlugin({})
|
|
307
|
+
),
|
|
308
|
+
...appHtmlFiles.map(
|
|
309
|
+
(file) => new HtmlWebpackPlugin2({
|
|
310
|
+
template: file,
|
|
311
|
+
filename: basename(file),
|
|
312
|
+
inject: false,
|
|
313
|
+
minify: false
|
|
314
|
+
})
|
|
315
|
+
),
|
|
299
316
|
new InterpolateHtmlPlugin(envVars.raw),
|
|
300
317
|
new webpack.DefinePlugin(envVars.stringified),
|
|
301
318
|
new ForkTsCheckerWebpackPlugin({
|
|
@@ -314,14 +331,16 @@ var getWebpackConfig = async (env) => {
|
|
|
314
331
|
}
|
|
315
332
|
}),
|
|
316
333
|
ifHmr(new ReactRefreshWebpackPlugin()),
|
|
317
|
-
ifMin(
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
334
|
+
ifMin(
|
|
335
|
+
new MiniCssExtractPlugin({
|
|
336
|
+
filename: "[name]-[contenthash:16].css",
|
|
337
|
+
chunkFilename: "[name]-[contenthash:16].css",
|
|
338
|
+
ignoreOrder: true,
|
|
339
|
+
attributes: {
|
|
340
|
+
"data-widget": process.env.ELEMENT_ATTRIBUTE_DATA_WIDGET
|
|
341
|
+
}
|
|
342
|
+
})
|
|
343
|
+
),
|
|
325
344
|
new webpack.IgnorePlugin({
|
|
326
345
|
resourceRegExp: /^\.\/locale$/,
|
|
327
346
|
contextRegExp: /moment$/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raisenow/tamaro-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "RaiseNow",
|
|
6
6
|
"email": "development@raisenow.com"
|
|
@@ -20,74 +20,75 @@
|
|
|
20
20
|
"npm": ">=8"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@babel/cli": "^7.
|
|
24
|
-
"@babel/core": "^7.18.
|
|
25
|
-
"@babel/plugin-proposal-decorators": "^7.18.
|
|
23
|
+
"@babel/cli": "^7.18.9",
|
|
24
|
+
"@babel/core": "^7.18.9",
|
|
25
|
+
"@babel/plugin-proposal-decorators": "^7.18.9",
|
|
26
26
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
27
|
-
"@babel/plugin-transform-runtime": "^7.18.
|
|
28
|
-
"@babel/preset-env": "^7.18.
|
|
29
|
-
"@babel/preset-react": "^7.
|
|
30
|
-
"@babel/preset-typescript": "^7.
|
|
31
|
-
"@babel/runtime-corejs3": "^7.18.
|
|
27
|
+
"@babel/plugin-transform-runtime": "^7.18.9",
|
|
28
|
+
"@babel/preset-env": "^7.18.9",
|
|
29
|
+
"@babel/preset-react": "^7.18.6",
|
|
30
|
+
"@babel/preset-typescript": "^7.18.6",
|
|
31
|
+
"@babel/runtime-corejs3": "^7.18.9",
|
|
32
32
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
|
|
33
|
-
"@statoscope/webpack-plugin": "^5.
|
|
33
|
+
"@statoscope/webpack-plugin": "^5.24.0",
|
|
34
34
|
"@types/columnify": "^1.5.1",
|
|
35
35
|
"@types/lodash": "^4.14.182",
|
|
36
|
-
"@types/node": "^
|
|
36
|
+
"@types/node": "^18.6.3",
|
|
37
37
|
"@types/node-notifier": "^8.0.2",
|
|
38
38
|
"@types/resolve-bin": "^0.4.1",
|
|
39
39
|
"@types/webpack-config-utils": "^2.3.1",
|
|
40
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
41
|
-
"@typescript-eslint/parser": "^5.
|
|
42
|
-
"autoprefixer": "^10.4.
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^5.31.0",
|
|
41
|
+
"@typescript-eslint/parser": "^5.31.0",
|
|
42
|
+
"autoprefixer": "^10.4.8",
|
|
43
43
|
"babel-loader": "^8.2.5",
|
|
44
|
+
"babel-plugin-istanbul": "^6.1.1",
|
|
44
45
|
"babel-plugin-lodash": "^3.3.4",
|
|
45
46
|
"chalk": "^5.0.1",
|
|
46
47
|
"clean-webpack-plugin": "^4.0.0",
|
|
47
48
|
"columnify": "^1.6.0",
|
|
48
|
-
"commander": "^9.
|
|
49
|
+
"commander": "^9.4.0",
|
|
49
50
|
"copy-webpack-plugin": "^11.0.0",
|
|
50
|
-
"core-js": "^3.
|
|
51
|
+
"core-js": "^3.24.1",
|
|
51
52
|
"css-loader": "^6.7.1",
|
|
52
53
|
"css-minimizer-webpack-plugin": "^4.0.0",
|
|
53
54
|
"dotenv": "^16.0.1",
|
|
54
55
|
"dotenv-expand": "^8.0.3",
|
|
55
56
|
"escape-string-regexp": "^5.0.0",
|
|
56
|
-
"eslint": "^8.
|
|
57
|
+
"eslint": "^8.20.0",
|
|
57
58
|
"eslint-config-prettier": "^8.5.0",
|
|
58
59
|
"eslint-plugin-node": "^11.1.0",
|
|
59
60
|
"eslint-plugin-promise": "^6.0.0",
|
|
60
|
-
"eslint-webpack-plugin": "^3.
|
|
61
|
+
"eslint-webpack-plugin": "^3.2.0",
|
|
61
62
|
"execa": "^6.1.0",
|
|
62
63
|
"file-loader": "^6.2.0",
|
|
63
|
-
"fork-ts-checker-webpack-plugin": "^7.2.
|
|
64
|
+
"fork-ts-checker-webpack-plugin": "^7.2.13",
|
|
64
65
|
"glob": "^8.0.3",
|
|
65
|
-
"html-loader": "^
|
|
66
|
+
"html-loader": "^4.1.0",
|
|
66
67
|
"html-webpack-plugin": "^5.5.0",
|
|
67
68
|
"json-loader": "^0.5.7",
|
|
68
69
|
"lodash": "^4.17.21",
|
|
69
|
-
"mini-css-extract-plugin": "^2.6.
|
|
70
|
+
"mini-css-extract-plugin": "^2.6.1",
|
|
70
71
|
"node-notifier": "^10.0.1",
|
|
71
72
|
"portfinder": "^1.0.28",
|
|
72
73
|
"postcss": "^8.4.14",
|
|
73
74
|
"postcss-custom-properties": "^12.1.7",
|
|
74
|
-
"postcss-loader": "^7.0.
|
|
75
|
-
"prettier": "^2.
|
|
76
|
-
"react-refresh": "^0.
|
|
75
|
+
"postcss-loader": "^7.0.1",
|
|
76
|
+
"prettier": "^2.7.1",
|
|
77
|
+
"react-refresh": "^0.14.0",
|
|
77
78
|
"resolve-url-loader": "^5.0.0",
|
|
78
|
-
"sass": "^1.
|
|
79
|
-
"sass-loader": "^13.0.
|
|
80
|
-
"source-map-loader": "^
|
|
79
|
+
"sass": "^1.54.0",
|
|
80
|
+
"sass-loader": "^13.0.2",
|
|
81
|
+
"source-map-loader": "^4.0.0",
|
|
81
82
|
"strip-indent": "^4.0.0",
|
|
82
83
|
"style-loader": "^3.3.1",
|
|
83
|
-
"tsconfig-paths-webpack-plugin": "^
|
|
84
|
-
"tsup": "^6.1
|
|
85
|
-
"typescript": "^4.7.
|
|
84
|
+
"tsconfig-paths-webpack-plugin": "^4.0.0",
|
|
85
|
+
"tsup": "^6.2.1",
|
|
86
|
+
"typescript": "^4.7.4",
|
|
86
87
|
"url-loader": "^4.1.1",
|
|
87
|
-
"webpack": "^5.
|
|
88
|
-
"webpack-cli": "^4.
|
|
88
|
+
"webpack": "^5.74.0",
|
|
89
|
+
"webpack-cli": "^4.10.0",
|
|
89
90
|
"webpack-config-utils": "^2.3.1",
|
|
90
|
-
"webpack-dev-server": "^4.9.
|
|
91
|
+
"webpack-dev-server": "^4.9.3",
|
|
91
92
|
"yaml-loader": "^0.8.0"
|
|
92
93
|
}
|
|
93
94
|
}
|
package/src/lib/env.ts
CHANGED
|
@@ -83,11 +83,21 @@ export const getEnvVars = (
|
|
|
83
83
|
'PRODUCT_NAME',
|
|
84
84
|
'PRODUCT_VERSION',
|
|
85
85
|
|
|
86
|
+
// epik
|
|
87
|
+
'EPP_API_KEY_DEFAULT',
|
|
88
|
+
'EPP_API_URL_STAGE',
|
|
89
|
+
'EPP_API_URL_PROD',
|
|
90
|
+
'EPMS_API_URL_STAGE',
|
|
91
|
+
'EPMS_API_URL_PROD',
|
|
92
|
+
'EPP_PROXY_URL_STAGE',
|
|
93
|
+
'EPP_PROXY_URL_PROD',
|
|
94
|
+
'EPMS_PROXY_URL_STAGE',
|
|
95
|
+
'EPMS_PROXY_URL_PROD',
|
|
96
|
+
|
|
86
97
|
// config
|
|
87
98
|
'WIDGET_UUID',
|
|
88
99
|
'CORE_URL',
|
|
89
100
|
'CORE_VERSION', // must be explicitly specified in each config
|
|
90
|
-
'IS_CREDIT_CARD_IFRAME',
|
|
91
101
|
]
|
|
92
102
|
|
|
93
103
|
// Collect all vars which names start from "PUBLIC_" or present in "varNames" array
|
package/src/webpack.config.ts
CHANGED
|
@@ -206,6 +206,7 @@ const getWebpackConfig = async (env: any): Promise<Configuration> => {
|
|
|
206
206
|
require.resolve('@babel/plugin-syntax-dynamic-import'),
|
|
207
207
|
require.resolve('babel-plugin-lodash'),
|
|
208
208
|
ifHmr(require.resolve('react-refresh/babel')),
|
|
209
|
+
ifNotMin(require.resolve('babel-plugin-istanbul')),
|
|
209
210
|
]),
|
|
210
211
|
},
|
|
211
212
|
},
|
|
@@ -286,6 +287,7 @@ const getWebpackConfig = async (env: any): Promise<Configuration> => {
|
|
|
286
287
|
headers: {
|
|
287
288
|
'Access-Control-Allow-Origin': '*',
|
|
288
289
|
},
|
|
290
|
+
allowedHosts: 'all',
|
|
289
291
|
client: {
|
|
290
292
|
overlay: {
|
|
291
293
|
warnings: false,
|