@raisenow/tamaro-cli 1.0.7 → 1.0.8
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/.gitignore +2 -0
- package/.nvmrc +1 -1
- package/dist/cli.js +69 -71
- package/dist/webpack.config.js +46 -40
- package/package.json +44 -46
- package/readme.html +55 -0
- package/readme.md +201 -0
- package/src/cli.ts +15 -10
- package/src/commands/build/index.ts +0 -1
- package/src/commands/deploy/index.ts +1 -2
- package/src/commands/serve/index.ts +1 -1
- package/src/lib/helpers.ts +3 -3
- package/src/webpack.config.ts +11 -1
package/.gitignore
CHANGED
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
16.13.
|
|
1
|
+
16.13.2
|
package/dist/cli.js
CHANGED
|
@@ -6,24 +6,24 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
9
|
-
var __reExport = (target, module2, desc) => {
|
|
9
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
10
10
|
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
11
11
|
for (let key of __getOwnPropNames(module2))
|
|
12
|
-
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
12
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
13
13
|
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
14
14
|
}
|
|
15
15
|
return target;
|
|
16
16
|
};
|
|
17
|
-
var
|
|
18
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default",
|
|
17
|
+
var __toESM = (module2, isNodeMode) => {
|
|
18
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
// src/cli.ts
|
|
22
|
-
var import_commander =
|
|
22
|
+
var import_commander = require("commander");
|
|
23
23
|
|
|
24
24
|
// package.json
|
|
25
25
|
var name = "@raisenow/tamaro-cli";
|
|
26
|
-
var version = "1.0.
|
|
26
|
+
var version = "1.0.8";
|
|
27
27
|
var author = {
|
|
28
28
|
name: "RaiseNow",
|
|
29
29
|
email: "development@raisenow.com"
|
|
@@ -34,6 +34,7 @@ var scripts = {
|
|
|
34
34
|
start: "npm run dev",
|
|
35
35
|
dev: "npm run build -- --watch --ignore-watch .idea",
|
|
36
36
|
build: "tsup src/cli.ts src/webpack.config.ts --format cjs",
|
|
37
|
+
docs: "npx -y http-server . --cors -o /readme.html",
|
|
37
38
|
lint: "eslint .",
|
|
38
39
|
"lint:fix": "eslint . --fix"
|
|
39
40
|
};
|
|
@@ -43,31 +44,28 @@ var engines = {
|
|
|
43
44
|
npm: ">=8"
|
|
44
45
|
};
|
|
45
46
|
var dependencies = {
|
|
46
|
-
"@babel/cli": "^7.16.
|
|
47
|
-
"@babel/core": "^7.16.
|
|
48
|
-
"@babel/plugin-proposal-decorators": "^7.16.
|
|
47
|
+
"@babel/cli": "^7.16.8",
|
|
48
|
+
"@babel/core": "^7.16.12",
|
|
49
|
+
"@babel/plugin-proposal-decorators": "^7.16.7",
|
|
49
50
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
50
|
-
"@babel/plugin-transform-runtime": "^7.16.
|
|
51
|
-
"@babel/preset-env": "^7.16.
|
|
52
|
-
"@babel/preset-react": "^7.16.
|
|
53
|
-
"@babel/preset-typescript": "^7.16.
|
|
54
|
-
"@babel/runtime-corejs3": "^7.16.
|
|
55
|
-
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.
|
|
56
|
-
"@statoscope/webpack-plugin": "^5.
|
|
57
|
-
"@svgr/webpack": "^
|
|
51
|
+
"@babel/plugin-transform-runtime": "^7.16.10",
|
|
52
|
+
"@babel/preset-env": "^7.16.11",
|
|
53
|
+
"@babel/preset-react": "^7.16.7",
|
|
54
|
+
"@babel/preset-typescript": "^7.16.7",
|
|
55
|
+
"@babel/runtime-corejs3": "^7.16.8",
|
|
56
|
+
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.4",
|
|
57
|
+
"@statoscope/webpack-plugin": "^5.20.0",
|
|
58
|
+
"@svgr/webpack": "^6.2.0",
|
|
58
59
|
"@types/columnify": "^1.5.1",
|
|
59
|
-
"@types/
|
|
60
|
-
"@types/css-
|
|
61
|
-
"@types/
|
|
62
|
-
"@types/
|
|
63
|
-
"@types/node": "^16.11.7",
|
|
64
|
-
"@types/node-notifier": "^8.0.1",
|
|
60
|
+
"@types/lodash": "^4.14.178",
|
|
61
|
+
"@types/mini-css-extract-plugin": "^2.5.1",
|
|
62
|
+
"@types/node": "^17.0.12",
|
|
63
|
+
"@types/node-notifier": "^8.0.2",
|
|
65
64
|
"@types/resolve-bin": "^0.4.1",
|
|
66
65
|
"@types/webpack-config-utils": "^2.3.1",
|
|
67
|
-
"@
|
|
68
|
-
"@typescript-eslint/
|
|
69
|
-
|
|
70
|
-
autoprefixer: "^10.4.0",
|
|
66
|
+
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
|
67
|
+
"@typescript-eslint/parser": "^5.10.1",
|
|
68
|
+
autoprefixer: "^10.4.2",
|
|
71
69
|
"babel-loader": "^8.2.3",
|
|
72
70
|
"babel-plugin-lodash": "^3.3.4",
|
|
73
71
|
boxen: "^5.1.2",
|
|
@@ -75,54 +73,54 @@ var dependencies = {
|
|
|
75
73
|
"clean-webpack-plugin": "^4.0.0",
|
|
76
74
|
columnify: "^1.5.4",
|
|
77
75
|
commander: "^8.3.0",
|
|
78
|
-
"copy-webpack-plugin": "^
|
|
79
|
-
"core-js": "^3.
|
|
76
|
+
"copy-webpack-plugin": "^10.2.1",
|
|
77
|
+
"core-js": "^3.20.3",
|
|
80
78
|
"css-loader": "^6.5.1",
|
|
81
|
-
"css-minimizer-webpack-plugin": "^3.1
|
|
79
|
+
"css-minimizer-webpack-plugin": "^3.4.1",
|
|
82
80
|
"current-script-polyfill": "^1.0.0",
|
|
83
|
-
dotenv: "^
|
|
84
|
-
"dotenv-expand": "^
|
|
81
|
+
dotenv: "^14.3.2",
|
|
82
|
+
"dotenv-expand": "^6.0.1",
|
|
85
83
|
"element-closest": "^3.0.2",
|
|
86
84
|
"escape-string-regexp": "^4.0.0",
|
|
87
|
-
eslint: "^8.
|
|
85
|
+
eslint: "^8.7.0",
|
|
88
86
|
"eslint-config-prettier": "^8.3.0",
|
|
89
87
|
"eslint-plugin-node": "^11.1.0",
|
|
90
88
|
"eslint-plugin-prettier": "^4.0.0",
|
|
91
|
-
"eslint-plugin-promise": "^
|
|
89
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
92
90
|
"eslint-webpack-plugin": "^3.1.0",
|
|
93
91
|
execa: "^5.1.1",
|
|
94
92
|
"file-loader": "^6.2.0",
|
|
95
|
-
"fork-ts-checker-webpack-plugin": "^6.
|
|
93
|
+
"fork-ts-checker-webpack-plugin": "^6.5.0",
|
|
96
94
|
glob: "^7.2.0",
|
|
97
|
-
"html-loader": "^3.0
|
|
95
|
+
"html-loader": "^3.1.0",
|
|
98
96
|
"html-webpack-plugin": "^5.5.0",
|
|
99
97
|
"json-loader": "^0.5.7",
|
|
100
98
|
lodash: "^4.17.21",
|
|
101
|
-
"mini-css-extract-plugin": "^2.
|
|
99
|
+
"mini-css-extract-plugin": "^2.5.3",
|
|
102
100
|
"node-notifier": "^10.0.0",
|
|
103
101
|
portfinder: "^1.0.28",
|
|
104
|
-
postcss: "^8.
|
|
105
|
-
"postcss-custom-properties": "^12.
|
|
106
|
-
"postcss-loader": "^6.2.
|
|
107
|
-
prettier: "^2.
|
|
102
|
+
postcss: "^8.4.5",
|
|
103
|
+
"postcss-custom-properties": "^12.1.3",
|
|
104
|
+
"postcss-loader": "^6.2.1",
|
|
105
|
+
prettier: "^2.5.1",
|
|
108
106
|
"react-refresh": "^0.11.0",
|
|
109
107
|
"resolve-bin": "^1.0.0",
|
|
110
|
-
"resolve-url-loader": "^
|
|
111
|
-
sass: "^1.
|
|
112
|
-
"sass-loader": "^12.
|
|
113
|
-
"source-map-loader": "^3.0.
|
|
108
|
+
"resolve-url-loader": "^5.0.0",
|
|
109
|
+
sass: "^1.49.0",
|
|
110
|
+
"sass-loader": "^12.4.0",
|
|
111
|
+
"source-map-loader": "^3.0.1",
|
|
114
112
|
"strip-indent": "^3.0.0",
|
|
115
113
|
"style-loader": "^3.3.1",
|
|
116
114
|
tailwindcss: "^0.7.4",
|
|
117
|
-
"tsconfig-paths-webpack-plugin": "^3.5.
|
|
118
|
-
tsup: "^5.
|
|
119
|
-
typescript: "^4.
|
|
115
|
+
"tsconfig-paths-webpack-plugin": "^3.5.2",
|
|
116
|
+
tsup: "^5.11.11",
|
|
117
|
+
typescript: "^4.5.5",
|
|
120
118
|
unfetch: "^4.2.0",
|
|
121
119
|
"url-loader": "^4.1.1",
|
|
122
|
-
webpack: "^5.
|
|
123
|
-
"webpack-cli": "^4.9.
|
|
120
|
+
webpack: "^5.67.0",
|
|
121
|
+
"webpack-cli": "^4.9.2",
|
|
124
122
|
"webpack-config-utils": "^2.3.1",
|
|
125
|
-
"webpack-dev-server": "^4.
|
|
123
|
+
"webpack-dev-server": "^4.7.3",
|
|
126
124
|
"yaml-loader": "^0.6.0"
|
|
127
125
|
};
|
|
128
126
|
var package_default = {
|
|
@@ -137,19 +135,19 @@ var package_default = {
|
|
|
137
135
|
};
|
|
138
136
|
|
|
139
137
|
// src/commands/dev/index.ts
|
|
140
|
-
var import_execa =
|
|
138
|
+
var import_execa = require("execa");
|
|
141
139
|
|
|
142
140
|
// src/lib/helpers.ts
|
|
143
|
-
var import_path =
|
|
144
|
-
var import_fs =
|
|
145
|
-
var import_chalk =
|
|
146
|
-
var import_node_notifier =
|
|
147
|
-
var import_webpack_config_utils =
|
|
148
|
-
var import_columnify =
|
|
149
|
-
var import_boxen =
|
|
150
|
-
var import_dotenv_expand =
|
|
151
|
-
var import_dotenv =
|
|
152
|
-
var import_strip_indent =
|
|
141
|
+
var import_path = require("path");
|
|
142
|
+
var import_fs = require("fs");
|
|
143
|
+
var import_chalk = __toESM(require("chalk"));
|
|
144
|
+
var import_node_notifier = require("node-notifier");
|
|
145
|
+
var import_webpack_config_utils = require("webpack-config-utils");
|
|
146
|
+
var import_columnify = __toESM(require("columnify"));
|
|
147
|
+
var import_boxen = __toESM(require("boxen"));
|
|
148
|
+
var import_dotenv_expand = require("dotenv-expand");
|
|
149
|
+
var import_dotenv = require("dotenv");
|
|
150
|
+
var import_strip_indent = __toESM(require("strip-indent"));
|
|
153
151
|
var TAMARO_CORE_PACKAGE_NAMES = ["@raisenow/tamaro-core", "demo-tamaro-core"];
|
|
154
152
|
var TAMARO_CONFIGURATIONS_PACKAGE_NAMES = [
|
|
155
153
|
"@raisenow/tamaro-configurations",
|
|
@@ -224,7 +222,7 @@ var notify = (args) => {
|
|
|
224
222
|
};
|
|
225
223
|
|
|
226
224
|
// src/commands/dev/index.ts
|
|
227
|
-
var import_resolve_bin =
|
|
225
|
+
var import_resolve_bin = __toESM(require("resolve-bin"));
|
|
228
226
|
var prepareDevFlags = (options) => {
|
|
229
227
|
const { localCore } = options;
|
|
230
228
|
let flags = [];
|
|
@@ -241,8 +239,8 @@ var dev = async (options) => {
|
|
|
241
239
|
};
|
|
242
240
|
|
|
243
241
|
// src/commands/build/index.ts
|
|
244
|
-
var import_execa2 =
|
|
245
|
-
var import_resolve_bin2 =
|
|
242
|
+
var import_execa2 = require("execa");
|
|
243
|
+
var import_resolve_bin2 = __toESM(require("resolve-bin"));
|
|
246
244
|
var prepareBuildFlags = (options) => {
|
|
247
245
|
const { localCore, analyze } = options;
|
|
248
246
|
let flags = [];
|
|
@@ -264,7 +262,7 @@ var build = async (options) => {
|
|
|
264
262
|
};
|
|
265
263
|
|
|
266
264
|
// src/commands/deploy/index.ts
|
|
267
|
-
var import_execa3 =
|
|
265
|
+
var import_execa3 = require("execa");
|
|
268
266
|
var deploy = async (options) => {
|
|
269
267
|
const { ifCore } = getIfCoreFns();
|
|
270
268
|
const paths = getPaths(ifCore);
|
|
@@ -274,11 +272,11 @@ var deploy = async (options) => {
|
|
|
274
272
|
};
|
|
275
273
|
|
|
276
274
|
// src/commands/serve/index.ts
|
|
277
|
-
var import_execa4 =
|
|
275
|
+
var import_execa4 = require("execa");
|
|
278
276
|
var serve = async () => {
|
|
279
277
|
const { ifCore } = getIfCoreFns();
|
|
280
278
|
const paths = getPaths(ifCore);
|
|
281
|
-
const cmd = `npx -y http-server ${paths.appDist} --cors`;
|
|
279
|
+
const cmd = `npx -y http-server ${paths.appDist} --cors --port 1234`;
|
|
282
280
|
logCommand(cmd);
|
|
283
281
|
(0, import_execa4.commandSync)(cmd, { stdio: "inherit" });
|
|
284
282
|
};
|
|
@@ -294,7 +292,7 @@ var cli = (0, import_commander.createCommand)().name(package_default.name).versi
|
|
|
294
292
|
cli.command("dev").description("Run dev web-server for Tamaro Core or customer configuration").option("--local-core", "Load Tamaro Core from localhost instead of CDN").action(async (options) => {
|
|
295
293
|
await dev(options);
|
|
296
294
|
});
|
|
297
|
-
cli.command("build").description("Build Tamaro Core or customer configuration for production").option("--local-core", "Load Tamaro Core from localhost instead of CDN").option("--analyze", 'Generate
|
|
295
|
+
cli.command("build").description("Build optimised (minified) bundle of Tamaro Core or customer configuration for production").option("--local-core", "Load Tamaro Core from localhost instead of CDN").option("--analyze", 'Generate bundle statistics to "reports" folder').option("--deploy", "Deploy Tamaro Core or customer configuration bundle to AWS").option("--serve", "Run web-server for the bundle").option("--tag <tag>", "Tag which will be used for deployment of the bundle").action(async (options) => {
|
|
298
296
|
await build(options);
|
|
299
297
|
if (options.deploy) {
|
|
300
298
|
await deploy(options);
|
|
@@ -303,10 +301,10 @@ cli.command("build").description("Build Tamaro Core or customer configuration fo
|
|
|
303
301
|
await serve();
|
|
304
302
|
}
|
|
305
303
|
});
|
|
306
|
-
cli.command("deploy").description("Deploy Tamaro Core or customer configuration to AWS").option("--
|
|
304
|
+
cli.command("deploy").description("Deploy prebuilt Tamaro Core or customer configuration bundle to AWS").option("--tag <tag>", "Tag which will be used for deployment of the bundle").action(async (options) => {
|
|
307
305
|
await deploy(options);
|
|
308
306
|
});
|
|
309
|
-
cli.command("serve").description("Run web-server for
|
|
307
|
+
cli.command("serve").description("Run web-server for prebuilt bundle").action(async () => {
|
|
310
308
|
await serve();
|
|
311
309
|
});
|
|
312
310
|
(async () => {
|
package/dist/webpack.config.js
CHANGED
|
@@ -20,52 +20,53 @@ var __spreadValues = (a, b) => {
|
|
|
20
20
|
};
|
|
21
21
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
22
22
|
var __export = (target, all) => {
|
|
23
|
-
__markAsModule(target);
|
|
24
23
|
for (var name in all)
|
|
25
24
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
26
25
|
};
|
|
27
|
-
var __reExport = (target, module2, desc) => {
|
|
26
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
28
27
|
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
29
28
|
for (let key of __getOwnPropNames(module2))
|
|
30
|
-
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
29
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
31
30
|
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
32
31
|
}
|
|
33
32
|
return target;
|
|
34
33
|
};
|
|
35
|
-
var
|
|
36
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default",
|
|
37
|
-
};
|
|
38
|
-
var __publicField = (obj, key, value) => {
|
|
39
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
40
|
-
return value;
|
|
34
|
+
var __toESM = (module2, isNodeMode) => {
|
|
35
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
41
36
|
};
|
|
37
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
38
|
+
return (module2, temp) => {
|
|
39
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
40
|
+
};
|
|
41
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
42
42
|
|
|
43
43
|
// src/webpack.config.ts
|
|
44
|
-
|
|
44
|
+
var webpack_config_exports = {};
|
|
45
|
+
__export(webpack_config_exports, {
|
|
45
46
|
default: () => webpack_config_default
|
|
46
47
|
});
|
|
47
|
-
var import_path2 =
|
|
48
|
-
var import_glob =
|
|
49
|
-
var import_webpack_config_utils2 =
|
|
50
|
-
var import_webpack =
|
|
51
|
-
var import_portfinder =
|
|
52
|
-
var import_tsconfig_paths_webpack_plugin =
|
|
53
|
-
var import_clean_webpack_plugin =
|
|
54
|
-
var import_html_webpack_plugin2 =
|
|
55
|
-
var import_fork_ts_checker_webpack_plugin =
|
|
56
|
-
var import_react_refresh_webpack_plugin =
|
|
57
|
-
var import_mini_css_extract_plugin =
|
|
58
|
-
var import_css_minimizer_webpack_plugin =
|
|
59
|
-
var import_eslint_webpack_plugin =
|
|
60
|
-
var import_copy_webpack_plugin =
|
|
61
|
-
var import_webpack_plugin =
|
|
48
|
+
var import_path2 = require("path");
|
|
49
|
+
var import_glob = __toESM(require("glob"));
|
|
50
|
+
var import_webpack_config_utils2 = require("webpack-config-utils");
|
|
51
|
+
var import_webpack = __toESM(require("webpack"));
|
|
52
|
+
var import_portfinder = require("portfinder");
|
|
53
|
+
var import_tsconfig_paths_webpack_plugin = require("tsconfig-paths-webpack-plugin");
|
|
54
|
+
var import_clean_webpack_plugin = require("clean-webpack-plugin");
|
|
55
|
+
var import_html_webpack_plugin2 = __toESM(require("html-webpack-plugin"));
|
|
56
|
+
var import_fork_ts_checker_webpack_plugin = __toESM(require("fork-ts-checker-webpack-plugin"));
|
|
57
|
+
var import_react_refresh_webpack_plugin = __toESM(require("@pmmmwh/react-refresh-webpack-plugin"));
|
|
58
|
+
var import_mini_css_extract_plugin = __toESM(require("mini-css-extract-plugin"));
|
|
59
|
+
var import_css_minimizer_webpack_plugin = __toESM(require("css-minimizer-webpack-plugin"));
|
|
60
|
+
var import_eslint_webpack_plugin = __toESM(require("eslint-webpack-plugin"));
|
|
61
|
+
var import_copy_webpack_plugin = __toESM(require("copy-webpack-plugin"));
|
|
62
|
+
var import_webpack_plugin = __toESM(require("@statoscope/webpack-plugin"));
|
|
62
63
|
|
|
63
64
|
// src/lib/InterpolateHtmlPlugin.ts
|
|
64
|
-
var import_html_webpack_plugin =
|
|
65
|
-
var import_escape_string_regexp =
|
|
65
|
+
var import_html_webpack_plugin = __toESM(require("html-webpack-plugin"));
|
|
66
|
+
var import_escape_string_regexp = __toESM(require("escape-string-regexp"));
|
|
66
67
|
var InterpolateHtmlPlugin = class {
|
|
68
|
+
replacements;
|
|
67
69
|
constructor(replacements) {
|
|
68
|
-
__publicField(this, "replacements");
|
|
69
70
|
this.replacements = __spreadValues({}, replacements);
|
|
70
71
|
}
|
|
71
72
|
apply(compiler) {
|
|
@@ -87,16 +88,16 @@ var InterpolateHtmlPlugin = class {
|
|
|
87
88
|
var InterpolateHtmlPlugin_default = InterpolateHtmlPlugin;
|
|
88
89
|
|
|
89
90
|
// src/lib/helpers.ts
|
|
90
|
-
var import_path =
|
|
91
|
-
var import_fs =
|
|
92
|
-
var import_chalk =
|
|
93
|
-
var import_node_notifier =
|
|
94
|
-
var import_webpack_config_utils =
|
|
95
|
-
var import_columnify =
|
|
96
|
-
var import_boxen =
|
|
97
|
-
var import_dotenv_expand =
|
|
98
|
-
var import_dotenv =
|
|
99
|
-
var import_strip_indent =
|
|
91
|
+
var import_path = require("path");
|
|
92
|
+
var import_fs = require("fs");
|
|
93
|
+
var import_chalk = __toESM(require("chalk"));
|
|
94
|
+
var import_node_notifier = require("node-notifier");
|
|
95
|
+
var import_webpack_config_utils = require("webpack-config-utils");
|
|
96
|
+
var import_columnify = __toESM(require("columnify"));
|
|
97
|
+
var import_boxen = __toESM(require("boxen"));
|
|
98
|
+
var import_dotenv_expand = require("dotenv-expand");
|
|
99
|
+
var import_dotenv = require("dotenv");
|
|
100
|
+
var import_strip_indent = __toESM(require("strip-indent"));
|
|
100
101
|
var TAMARO_CORE_PACKAGE_NAMES = ["@raisenow/tamaro-core", "demo-tamaro-core"];
|
|
101
102
|
var TAMARO_CONFIGURATIONS_PACKAGE_NAMES = [
|
|
102
103
|
"@raisenow/tamaro-configurations",
|
|
@@ -159,7 +160,7 @@ var getPaths = (ifCore) => {
|
|
|
159
160
|
};
|
|
160
161
|
var getEnvVars = (filePath, ifMin, ifCore, ifLocalCore) => {
|
|
161
162
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
162
|
-
(0, import_dotenv_expand.
|
|
163
|
+
(0, import_dotenv_expand.expand)((0, import_dotenv.config)({ path: filePath }));
|
|
163
164
|
(_b = (_a = process.env).NODE_ENV) != null ? _b : _a.NODE_ENV = ifMin("production", "development");
|
|
164
165
|
(_d = (_c = process.env).BABEL_ENV) != null ? _d : _c.BABEL_ENV = ifMin("production", "development");
|
|
165
166
|
(_f = (_e = process.env).EXPOSE_VAR) != null ? _f : _e.EXPOSE_VAR = ifCore("rnw.tamaroCore", "rnw.tamaro");
|
|
@@ -324,7 +325,11 @@ var getWebpackConfig = async (env) => {
|
|
|
324
325
|
oneOf: [
|
|
325
326
|
{
|
|
326
327
|
test: /\.(js|ts)x?$/,
|
|
327
|
-
|
|
328
|
+
include: ifCore([
|
|
329
|
+
resolveApp("src"),
|
|
330
|
+
resolveApp("node_modules/micromark"),
|
|
331
|
+
resolveApp("node_modules/decode-named-character-reference")
|
|
332
|
+
], [resolveApp("."), resolveApp("../../src")]),
|
|
328
333
|
loader: require.resolve("babel-loader"),
|
|
329
334
|
options: {
|
|
330
335
|
babelrc: false,
|
|
@@ -539,5 +544,6 @@ var getWebpackConfig = async (env) => {
|
|
|
539
544
|
return (0, import_webpack_config_utils2.removeEmpty)(config);
|
|
540
545
|
};
|
|
541
546
|
var webpack_config_default = getWebpackConfig;
|
|
547
|
+
module.exports = __toCommonJS(webpack_config_exports);
|
|
542
548
|
// Annotate the CommonJS export names for ESM import in node:
|
|
543
549
|
0 && (module.exports = {});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raisenow/tamaro-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "RaiseNow",
|
|
6
6
|
"email": "development@raisenow.com"
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"start": "npm run dev",
|
|
12
12
|
"dev": "npm run build -- --watch --ignore-watch .idea",
|
|
13
13
|
"build": "tsup src/cli.ts src/webpack.config.ts --format cjs",
|
|
14
|
+
"docs": "npx -y http-server . --cors -o /readme.html",
|
|
14
15
|
"lint": "eslint .",
|
|
15
16
|
"lint:fix": "eslint . --fix"
|
|
16
17
|
},
|
|
@@ -20,31 +21,28 @@
|
|
|
20
21
|
"npm": ">=8"
|
|
21
22
|
},
|
|
22
23
|
"dependencies": {
|
|
23
|
-
"@babel/cli": "^7.16.
|
|
24
|
-
"@babel/core": "^7.16.
|
|
25
|
-
"@babel/plugin-proposal-decorators": "^7.16.
|
|
24
|
+
"@babel/cli": "^7.16.8",
|
|
25
|
+
"@babel/core": "^7.16.12",
|
|
26
|
+
"@babel/plugin-proposal-decorators": "^7.16.7",
|
|
26
27
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
27
|
-
"@babel/plugin-transform-runtime": "^7.16.
|
|
28
|
-
"@babel/preset-env": "^7.16.
|
|
29
|
-
"@babel/preset-react": "^7.16.
|
|
30
|
-
"@babel/preset-typescript": "^7.16.
|
|
31
|
-
"@babel/runtime-corejs3": "^7.16.
|
|
32
|
-
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.
|
|
33
|
-
"@statoscope/webpack-plugin": "^5.
|
|
34
|
-
"@svgr/webpack": "^
|
|
28
|
+
"@babel/plugin-transform-runtime": "^7.16.10",
|
|
29
|
+
"@babel/preset-env": "^7.16.11",
|
|
30
|
+
"@babel/preset-react": "^7.16.7",
|
|
31
|
+
"@babel/preset-typescript": "^7.16.7",
|
|
32
|
+
"@babel/runtime-corejs3": "^7.16.8",
|
|
33
|
+
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.4",
|
|
34
|
+
"@statoscope/webpack-plugin": "^5.20.0",
|
|
35
|
+
"@svgr/webpack": "^6.2.0",
|
|
35
36
|
"@types/columnify": "^1.5.1",
|
|
36
|
-
"@types/
|
|
37
|
-
"@types/css-
|
|
38
|
-
"@types/
|
|
39
|
-
"@types/
|
|
40
|
-
"@types/node": "^16.11.7",
|
|
41
|
-
"@types/node-notifier": "^8.0.1",
|
|
37
|
+
"@types/lodash": "^4.14.178",
|
|
38
|
+
"@types/mini-css-extract-plugin": "^2.5.1",
|
|
39
|
+
"@types/node": "^17.0.12",
|
|
40
|
+
"@types/node-notifier": "^8.0.2",
|
|
42
41
|
"@types/resolve-bin": "^0.4.1",
|
|
43
42
|
"@types/webpack-config-utils": "^2.3.1",
|
|
44
|
-
"@
|
|
45
|
-
"@typescript-eslint/
|
|
46
|
-
"
|
|
47
|
-
"autoprefixer": "^10.4.0",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
|
44
|
+
"@typescript-eslint/parser": "^5.10.1",
|
|
45
|
+
"autoprefixer": "^10.4.2",
|
|
48
46
|
"babel-loader": "^8.2.3",
|
|
49
47
|
"babel-plugin-lodash": "^3.3.4",
|
|
50
48
|
"boxen": "^5.1.2",
|
|
@@ -52,54 +50,54 @@
|
|
|
52
50
|
"clean-webpack-plugin": "^4.0.0",
|
|
53
51
|
"columnify": "^1.5.4",
|
|
54
52
|
"commander": "^8.3.0",
|
|
55
|
-
"copy-webpack-plugin": "^
|
|
56
|
-
"core-js": "^3.
|
|
53
|
+
"copy-webpack-plugin": "^10.2.1",
|
|
54
|
+
"core-js": "^3.20.3",
|
|
57
55
|
"css-loader": "^6.5.1",
|
|
58
|
-
"css-minimizer-webpack-plugin": "^3.1
|
|
56
|
+
"css-minimizer-webpack-plugin": "^3.4.1",
|
|
59
57
|
"current-script-polyfill": "^1.0.0",
|
|
60
|
-
"dotenv": "^
|
|
61
|
-
"dotenv-expand": "^
|
|
58
|
+
"dotenv": "^14.3.2",
|
|
59
|
+
"dotenv-expand": "^6.0.1",
|
|
62
60
|
"element-closest": "^3.0.2",
|
|
63
61
|
"escape-string-regexp": "^4.0.0",
|
|
64
|
-
"eslint": "^8.
|
|
62
|
+
"eslint": "^8.7.0",
|
|
65
63
|
"eslint-config-prettier": "^8.3.0",
|
|
66
64
|
"eslint-plugin-node": "^11.1.0",
|
|
67
65
|
"eslint-plugin-prettier": "^4.0.0",
|
|
68
|
-
"eslint-plugin-promise": "^
|
|
66
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
69
67
|
"eslint-webpack-plugin": "^3.1.0",
|
|
70
68
|
"execa": "^5.1.1",
|
|
71
69
|
"file-loader": "^6.2.0",
|
|
72
|
-
"fork-ts-checker-webpack-plugin": "^6.
|
|
70
|
+
"fork-ts-checker-webpack-plugin": "^6.5.0",
|
|
73
71
|
"glob": "^7.2.0",
|
|
74
|
-
"html-loader": "^3.0
|
|
72
|
+
"html-loader": "^3.1.0",
|
|
75
73
|
"html-webpack-plugin": "^5.5.0",
|
|
76
74
|
"json-loader": "^0.5.7",
|
|
77
75
|
"lodash": "^4.17.21",
|
|
78
|
-
"mini-css-extract-plugin": "^2.
|
|
76
|
+
"mini-css-extract-plugin": "^2.5.3",
|
|
79
77
|
"node-notifier": "^10.0.0",
|
|
80
78
|
"portfinder": "^1.0.28",
|
|
81
|
-
"postcss": "^8.
|
|
82
|
-
"postcss-custom-properties": "^12.
|
|
83
|
-
"postcss-loader": "^6.2.
|
|
84
|
-
"prettier": "^2.
|
|
79
|
+
"postcss": "^8.4.5",
|
|
80
|
+
"postcss-custom-properties": "^12.1.3",
|
|
81
|
+
"postcss-loader": "^6.2.1",
|
|
82
|
+
"prettier": "^2.5.1",
|
|
85
83
|
"react-refresh": "^0.11.0",
|
|
86
84
|
"resolve-bin": "^1.0.0",
|
|
87
|
-
"resolve-url-loader": "^
|
|
88
|
-
"sass": "^1.
|
|
89
|
-
"sass-loader": "^12.
|
|
90
|
-
"source-map-loader": "^3.0.
|
|
85
|
+
"resolve-url-loader": "^5.0.0",
|
|
86
|
+
"sass": "^1.49.0",
|
|
87
|
+
"sass-loader": "^12.4.0",
|
|
88
|
+
"source-map-loader": "^3.0.1",
|
|
91
89
|
"strip-indent": "^3.0.0",
|
|
92
90
|
"style-loader": "^3.3.1",
|
|
93
91
|
"tailwindcss": "^0.7.4",
|
|
94
|
-
"tsconfig-paths-webpack-plugin": "^3.5.
|
|
95
|
-
"tsup": "^5.
|
|
96
|
-
"typescript": "^4.
|
|
92
|
+
"tsconfig-paths-webpack-plugin": "^3.5.2",
|
|
93
|
+
"tsup": "^5.11.11",
|
|
94
|
+
"typescript": "^4.5.5",
|
|
97
95
|
"unfetch": "^4.2.0",
|
|
98
96
|
"url-loader": "^4.1.1",
|
|
99
|
-
"webpack": "^5.
|
|
100
|
-
"webpack-cli": "^4.9.
|
|
97
|
+
"webpack": "^5.67.0",
|
|
98
|
+
"webpack-cli": "^4.9.2",
|
|
101
99
|
"webpack-config-utils": "^2.3.1",
|
|
102
|
-
"webpack-dev-server": "^4.
|
|
100
|
+
"webpack-dev-server": "^4.7.3",
|
|
103
101
|
"yaml-loader": "^0.6.0"
|
|
104
102
|
}
|
|
105
103
|
}
|
package/readme.html
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<title>Tamaro CLI</title>
|
|
6
|
+
<meta name="viewport" content="width=device-width" />
|
|
7
|
+
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
|
8
|
+
<link
|
|
9
|
+
rel="icon"
|
|
10
|
+
href="https://assets.raisenow.io/favicon.svg"
|
|
11
|
+
sizes="any"
|
|
12
|
+
type="image/svg+xml"
|
|
13
|
+
/>
|
|
14
|
+
<link
|
|
15
|
+
rel="icon"
|
|
16
|
+
href="https://assets.raisenow.io/favicon.png"
|
|
17
|
+
type="image/png"
|
|
18
|
+
/>
|
|
19
|
+
|
|
20
|
+
<link
|
|
21
|
+
rel="stylesheet"
|
|
22
|
+
href="https://cdn.jsdelivr.net/npm/docsify-themeable/dist/css/theme-simple.css"
|
|
23
|
+
/>
|
|
24
|
+
<!-- <link-->
|
|
25
|
+
<!-- rel="stylesheet"-->
|
|
26
|
+
<!-- href="https://cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css"-->
|
|
27
|
+
<!-- />-->
|
|
28
|
+
|
|
29
|
+
<style>
|
|
30
|
+
.search .clear-button.show {
|
|
31
|
+
display: flex !important;
|
|
32
|
+
align-items: center;
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
35
|
+
</head>
|
|
36
|
+
<body>
|
|
37
|
+
<div id="app"></div>
|
|
38
|
+
<script>
|
|
39
|
+
window.$docsify = {
|
|
40
|
+
name: '@raisenow/tamaro-cli',
|
|
41
|
+
// themeColor: '#537397',
|
|
42
|
+
maxLevel: 2,
|
|
43
|
+
homepage: './readme.md',
|
|
44
|
+
coverpage: false,
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
<script src="https://cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
|
|
48
|
+
<script src="https://cdn.jsdelivr.net/npm/docsify-themeable/dist/js/docsify-themeable.min.js"></script>
|
|
49
|
+
<script src="https://cdn.jsdelivr.net/npm/docsify-copy-code"></script>
|
|
50
|
+
<script src="https://cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
|
|
51
|
+
<!-- <script src="https://cdn.jsdelivr.net/npm/prismjs/components/prism-yaml.min.js"></script>-->
|
|
52
|
+
<!-- <script src="https://cdn.jsdelivr.net/npm/prismjs/components/prism-typescript.min.js"></script>-->
|
|
53
|
+
<!-- <script src="https://cdn.jsdelivr.net/npm/docsify-pagination/dist/docsify-pagination.min.js"></script>-->
|
|
54
|
+
</body>
|
|
55
|
+
</html>
|
package/readme.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# Getting started
|
|
2
|
+
|
|
3
|
+
It's a command-line interface for all operations with Tamaro customer configurations and *Tamaro Core*.
|
|
4
|
+
|
|
5
|
+
You don't need to install it manually. The recommended way is to run it using `npx` command, which must be available along with `node` and `npm` commands.
|
|
6
|
+
|
|
7
|
+
# Usage
|
|
8
|
+
|
|
9
|
+
To see an overview of all possible commands just run the following command without any arguments:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx -y @raisenow/tamaro-cli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
To see the info about some particular command (for example `dev` command), prepend `help` before the command name:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx -y @raisenow/tamaro-cli help dev
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Substitute `dev` with the command you want to get info about.
|
|
22
|
+
|
|
23
|
+
# Commands
|
|
24
|
+
|
|
25
|
+
Available commands:
|
|
26
|
+
- [dev](#dev)
|
|
27
|
+
- [build](#build)
|
|
28
|
+
- [deploy](#deploy)
|
|
29
|
+
- [serve](#serve)
|
|
30
|
+
|
|
31
|
+
## dev
|
|
32
|
+
|
|
33
|
+
Runs development web-server for *Tamaro Core* or particular customer configuration.
|
|
34
|
+
|
|
35
|
+
Options:
|
|
36
|
+
- `--local-core` – Load *Tamaro Core* from localhost instead of CDN
|
|
37
|
+
|
|
38
|
+
### Run development web-server using Tamaro Core from CDN
|
|
39
|
+
|
|
40
|
+
Run development web-server for `example-02-typical-customisations` customer configuration.
|
|
41
|
+
|
|
42
|
+
After running this command, development web-server should be running on http://localhost:1234/ (port may differ).
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
46
|
+
npx -y @raisenow/tamaro-cli dev
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Run development web-server using locally running Tamaro Core
|
|
50
|
+
|
|
51
|
+
1. Run development web-server for *Tamaro Core* in the first terminal tab.
|
|
52
|
+
|
|
53
|
+
After running this command, development web-server should be running on http://localhost:1234/ (port may differ).
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
cd /path/to/tamaro-core
|
|
57
|
+
npx -y @raisenow/tamaro-cli dev
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
2. Run development web-server for `example-02-typical-customisations` customer configuration in the second terminal tab.
|
|
61
|
+
|
|
62
|
+
After running this command, development web-server should be running on http://localhost:1235/ (port may differ).
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
66
|
+
npx -y @raisenow/tamaro-cli dev --local-core
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## build
|
|
70
|
+
|
|
71
|
+
Build optimised (minified) bundle of *Tamaro Core* or customer configuration for production.
|
|
72
|
+
|
|
73
|
+
Options:
|
|
74
|
+
- `--local-core` – Load *Tamaro Core* from localhost instead of CDN
|
|
75
|
+
- `--analyze` – Generate bundle statistics to `reports` folder
|
|
76
|
+
- `--deploy` – Deploy *Tamaro Core* or customer configuration bundle to AWS
|
|
77
|
+
- `--serve` – Run web-server for the bundle
|
|
78
|
+
- `--tag <tag>` – Tag which will be used for deployment of the bundle
|
|
79
|
+
|
|
80
|
+
Before trying to deploy a bundle, make sure you have proper AWS credentials in your environment, otherwise deployment will fail.
|
|
81
|
+
More info about configuring AWS credentials and profiles is in the [wiki page](https://raisenow.atlassian.net/wiki/spaces/DEVOPS/pages/3201731220).
|
|
82
|
+
|
|
83
|
+
### Build and deploy customer configuration
|
|
84
|
+
|
|
85
|
+
Build and deploy optimised (minified) bundle of `example-02-typical-customisations` customer configuration.
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
89
|
+
npx -y @raisenow/tamaro-cli build --deploy
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
As a result bundle should be deployed to: https://tamaro.raisenow.com/example-02-typical-customisations/latest/index.html
|
|
93
|
+
|
|
94
|
+
### Build and deploy customer configuration with a specific tag
|
|
95
|
+
|
|
96
|
+
Build and deploy optimised (minified) bundle of `example-02-typical-customisations` customer configuration with `WEB-123` tag.
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
100
|
+
npx -y @raisenow/tamaro-cli build --deploy --tag WEB-123
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
As a result bundle should be deployed to: https://tamaro.raisenow.com/example-02-typical-customisations/WEB-123/index.html
|
|
104
|
+
|
|
105
|
+
### Build and serve customer configuration
|
|
106
|
+
|
|
107
|
+
Build and serve optimised (minified) bundle of `example-02-typical-customisations` customer configuration.
|
|
108
|
+
|
|
109
|
+
After running this command, web-server should be running on http://localhost:1234/ (port may differ).
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
113
|
+
npx -y @raisenow/tamaro-cli build --serve
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
## deploy
|
|
118
|
+
|
|
119
|
+
Deploy prebuilt Tamaro Core or customer configuration bundle to AWS.
|
|
120
|
+
|
|
121
|
+
Options:
|
|
122
|
+
- `--tag <tag>` – Tag which will be used for deployment of the bundle
|
|
123
|
+
|
|
124
|
+
Make sure you have built the bundle before deploying it with this command, otherwise you may mistakenly deploy the bundle from previous build.
|
|
125
|
+
|
|
126
|
+
Example:
|
|
127
|
+
|
|
128
|
+
1. Build optimised (minified) bundle of `example-02-typical-customisations` customer configuration.
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
132
|
+
npx -y @raisenow/tamaro-cli build
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
2. Deploy it:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
npx -y @raisenow/tamaro-cli deploy
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
3. Optionally deploy it with `WEB-123` tag:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
npx -y @raisenow/tamaro-cli deploy --tag WEB-123
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## serve
|
|
148
|
+
|
|
149
|
+
Run web-server for prebuilt bundle.
|
|
150
|
+
|
|
151
|
+
Example:
|
|
152
|
+
|
|
153
|
+
1. Build optimised (minified) bundle of `example-02-typical-customisations` customer configuration.
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
157
|
+
npx -y @raisenow/tamaro-cli build
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
2. Serve it.
|
|
161
|
+
|
|
162
|
+
After running this command, web-server should be running on http://localhost:1234/ (port may differ).
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
npx -y @raisenow/tamaro-cli serve
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
# Development
|
|
170
|
+
|
|
171
|
+
Make sure you have installed and activated proper `node` and `npm` versions.
|
|
172
|
+
|
|
173
|
+
- `node: ">= 16"`
|
|
174
|
+
- `npm: ">= 8"`
|
|
175
|
+
|
|
176
|
+
Clone the repo and install its dependencies:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
git clone git@bitbucket.org:raisenow/tamaro-cli.git
|
|
180
|
+
cd tamaro-cli
|
|
181
|
+
npm ci
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Link package source to be able to run its local version:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
npm link .
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Run the `dev` script to watch source files and automatically rebuild on changes.
|
|
191
|
+
It must be running during *Tamaro CLI* development process.
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
npm run dev
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
To use local linked version of *Tamaro CLI*, use it without `@raisenow/` scope, `-y` flag is also not needed:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
npx tamaro-cli dev
|
|
201
|
+
```
|
package/src/cli.ts
CHANGED
|
@@ -37,13 +37,17 @@ cli
|
|
|
37
37
|
|
|
38
38
|
cli
|
|
39
39
|
.command('build')
|
|
40
|
-
.description(
|
|
40
|
+
.description(
|
|
41
|
+
'Build optimised (minified) bundle of Tamaro Core or customer configuration for production',
|
|
42
|
+
)
|
|
41
43
|
.option('--local-core', 'Load Tamaro Core from localhost instead of CDN')
|
|
42
|
-
.option('--analyze', 'Generate
|
|
43
|
-
.option(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
.option('--analyze', 'Generate bundle statistics to "reports" folder')
|
|
45
|
+
.option(
|
|
46
|
+
'--deploy',
|
|
47
|
+
'Deploy Tamaro Core or customer configuration bundle to AWS',
|
|
48
|
+
)
|
|
49
|
+
.option('--serve', 'Run web-server for the bundle')
|
|
50
|
+
.option('--tag <tag>', 'Tag which will be used for deployment of the bundle')
|
|
47
51
|
.action(async (options: BuildOptions) => {
|
|
48
52
|
await build(options)
|
|
49
53
|
|
|
@@ -58,16 +62,17 @@ cli
|
|
|
58
62
|
|
|
59
63
|
cli
|
|
60
64
|
.command('deploy')
|
|
61
|
-
.description(
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
.description(
|
|
66
|
+
'Deploy prebuilt Tamaro Core or customer configuration bundle to AWS',
|
|
67
|
+
)
|
|
68
|
+
.option('--tag <tag>', 'Tag which will be used for deployment of the bundle')
|
|
64
69
|
.action(async (options: DeployOptions) => {
|
|
65
70
|
await deploy(options)
|
|
66
71
|
})
|
|
67
72
|
|
|
68
73
|
cli
|
|
69
74
|
.command('serve')
|
|
70
|
-
.description('Run web-server for
|
|
75
|
+
.description('Run web-server for prebuilt bundle')
|
|
71
76
|
.action(async () => {
|
|
72
77
|
await serve()
|
|
73
78
|
})
|
|
@@ -4,7 +4,6 @@ import {getIfCoreFns, getPaths, logCommand} from 'lib/helpers'
|
|
|
4
4
|
///////////////////////////////////////////////////////////////////////////////
|
|
5
5
|
|
|
6
6
|
export type DeployOptions = {
|
|
7
|
-
latest?: boolean
|
|
8
7
|
tag?: string
|
|
9
8
|
}
|
|
10
9
|
|
|
@@ -13,7 +12,7 @@ export type DeployOptions = {
|
|
|
13
12
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14
13
|
export const deploy = async (options: DeployOptions): Promise<void> => {
|
|
15
14
|
// todo: ensure build exists
|
|
16
|
-
// todo: handle "tag"
|
|
15
|
+
// todo: handle "tag" option
|
|
17
16
|
// todo: implement
|
|
18
17
|
const {ifCore} = getIfCoreFns()
|
|
19
18
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -6,7 +6,7 @@ import {getIfCoreFns, getPaths, logCommand} from 'lib/helpers'
|
|
|
6
6
|
export const serve = async (): Promise<void> => {
|
|
7
7
|
const {ifCore} = getIfCoreFns()
|
|
8
8
|
const paths = getPaths(ifCore)
|
|
9
|
-
const cmd = `npx -y http-server ${paths.appDist} --cors`
|
|
9
|
+
const cmd = `npx -y http-server ${paths.appDist} --cors --port 1234`
|
|
10
10
|
logCommand(cmd)
|
|
11
11
|
commandSync(cmd, {stdio: 'inherit'})
|
|
12
12
|
}
|
package/src/lib/helpers.ts
CHANGED
|
@@ -5,8 +5,8 @@ import {notify as nodeNotify} from 'node-notifier'
|
|
|
5
5
|
import {getIfUtils, IfUtils, IfUtilsFn} from 'webpack-config-utils'
|
|
6
6
|
import columnify from 'columnify'
|
|
7
7
|
import boxen from 'boxen'
|
|
8
|
-
import dotenvExpand from 'dotenv-expand'
|
|
9
|
-
import
|
|
8
|
+
import {expand as dotenvExpand} from 'dotenv-expand'
|
|
9
|
+
import {config as dotenvConfig} from 'dotenv'
|
|
10
10
|
import stripIndent from 'strip-indent'
|
|
11
11
|
|
|
12
12
|
///////////////////////////////////////////////////////////////////////////////
|
|
@@ -141,7 +141,7 @@ export const getEnvVars = (
|
|
|
141
141
|
ifCore: IfUtilsFn,
|
|
142
142
|
ifLocalCore: IfUtilsFn,
|
|
143
143
|
) => {
|
|
144
|
-
dotenvExpand(
|
|
144
|
+
dotenvExpand(dotenvConfig({path: filePath}))
|
|
145
145
|
|
|
146
146
|
process.env.NODE_ENV ??= ifMin('production', 'development')
|
|
147
147
|
process.env.BABEL_ENV ??= ifMin('production', 'development')
|
package/src/webpack.config.ts
CHANGED
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
getPaths,
|
|
30
30
|
logDataTable,
|
|
31
31
|
moduleFileExtensions,
|
|
32
|
+
resolveApp,
|
|
32
33
|
resolveOwn,
|
|
33
34
|
} from 'lib/helpers'
|
|
34
35
|
|
|
@@ -145,9 +146,18 @@ const getWebpackConfig = async (env: any): Promise<Configuration> => {
|
|
|
145
146
|
{
|
|
146
147
|
oneOf: [
|
|
147
148
|
// App Javascript and Typescript (Babel)
|
|
149
|
+
// and some dependencies distributed in a non-es5 formats
|
|
148
150
|
{
|
|
149
151
|
test: /\.(js|ts)x?$/,
|
|
150
|
-
|
|
152
|
+
include: ifCore(
|
|
153
|
+
[
|
|
154
|
+
resolveApp('src'),
|
|
155
|
+
resolveApp('node_modules/micromark'),
|
|
156
|
+
resolveApp('node_modules/decode-named-character-reference'),
|
|
157
|
+
],
|
|
158
|
+
[resolveApp('.'), resolveApp('../../src')],
|
|
159
|
+
),
|
|
160
|
+
|
|
151
161
|
loader: require.resolve('babel-loader'),
|
|
152
162
|
options: {
|
|
153
163
|
babelrc: false,
|