@raisenow/tamaro-cli 1.0.8 → 1.0.9
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/.eslintrc.js +0 -6
- package/.gitignore +1 -2
- package/.prettierignore +1 -0
- package/dist/cli.js +435 -88
- package/dist/webpack.config.js +42 -16
- package/package.json +29 -32
- package/readme.md +99 -73
- package/src/cli.ts +93 -15
- package/src/commands/build.ts +97 -0
- package/src/commands/deploy-email-config.ts +107 -0
- package/src/commands/deploy.ts +151 -0
- package/src/commands/dev.ts +61 -0
- package/src/commands/list-deployed.ts +102 -0
- package/src/commands/serve.ts +29 -0
- package/src/lib/aws.ts +119 -0
- package/src/lib/helpers.ts +100 -23
- package/src/webpack.config.ts +14 -2
- package/src/assets/rnw-logo.png +0 -0
- package/src/commands/build/index.ts +0 -42
- package/src/commands/deploy/index.ts +0 -24
- package/src/commands/dev/index.ts +0 -32
- package/src/commands/serve/index.ts +0 -12
package/dist/webpack.config.js
CHANGED
|
@@ -46,6 +46,7 @@ __export(webpack_config_exports, {
|
|
|
46
46
|
default: () => webpack_config_default
|
|
47
47
|
});
|
|
48
48
|
var import_path2 = require("path");
|
|
49
|
+
var import_fs2 = require("fs");
|
|
49
50
|
var import_glob = __toESM(require("glob"));
|
|
50
51
|
var import_webpack_config_utils2 = require("webpack-config-utils");
|
|
51
52
|
var import_webpack = __toESM(require("webpack"));
|
|
@@ -91,18 +92,17 @@ var InterpolateHtmlPlugin_default = InterpolateHtmlPlugin;
|
|
|
91
92
|
var import_path = require("path");
|
|
92
93
|
var import_fs = require("fs");
|
|
93
94
|
var import_chalk = __toESM(require("chalk"));
|
|
94
|
-
var import_node_notifier = require("node-notifier");
|
|
95
|
+
var import_node_notifier = __toESM(require("node-notifier"));
|
|
95
96
|
var import_webpack_config_utils = require("webpack-config-utils");
|
|
96
97
|
var import_columnify = __toESM(require("columnify"));
|
|
97
98
|
var import_boxen = __toESM(require("boxen"));
|
|
98
99
|
var import_dotenv_expand = require("dotenv-expand");
|
|
99
100
|
var import_dotenv = require("dotenv");
|
|
101
|
+
var import_open = __toESM(require("open"));
|
|
100
102
|
var import_strip_indent = __toESM(require("strip-indent"));
|
|
101
|
-
var
|
|
102
|
-
var
|
|
103
|
-
|
|
104
|
-
"demo-tamaro-configurations"
|
|
105
|
-
];
|
|
103
|
+
var import_execa = require("execa");
|
|
104
|
+
var TAMARO_CORE_PACKAGE_NAMES = ["@raisenow/tamaro-core"];
|
|
105
|
+
var TAMARO_CONFIGURATIONS_PACKAGE_NAMES = ["@raisenow/tamaro-configurations"];
|
|
106
106
|
var getIfCoreFns = () => {
|
|
107
107
|
const corePkgPath = resolveApp("package.json");
|
|
108
108
|
const configsPkgPath = resolveApp("../../package.json");
|
|
@@ -118,12 +118,12 @@ var getIfCoreFns = () => {
|
|
|
118
118
|
return (0, import_webpack_config_utils.getIfUtils)({ core: false }, ["core"]);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
|
|
121
|
+
logError((0, import_strip_indent.default)(` You must run "npx @raisenow/tamaro-cli" commands from:
|
|
122
122
|
1. Root of "${import_chalk.default.bold(TAMARO_CORE_PACKAGE_NAMES[0])}" package folder.
|
|
123
123
|
2. Root of particular customer configuration folder of "${import_chalk.default.bold(TAMARO_CONFIGURATIONS_PACKAGE_NAMES[0])}" package.
|
|
124
124
|
You are currently in "${import_chalk.default.bold((0, import_fs.realpathSync)(process.cwd()))}".
|
|
125
|
-
`))
|
|
126
|
-
process.exit(
|
|
125
|
+
`));
|
|
126
|
+
process.exit(1);
|
|
127
127
|
};
|
|
128
128
|
var moduleFileExtensions = ["ts", "tsx", "js", "jsx"];
|
|
129
129
|
var extensions = moduleFileExtensions.map((v) => `.${v}`);
|
|
@@ -158,6 +158,15 @@ var getPaths = (ifCore) => {
|
|
|
158
158
|
appTailwindConfig: void 0
|
|
159
159
|
});
|
|
160
160
|
};
|
|
161
|
+
var getRelativePaths = (paths) => {
|
|
162
|
+
const relativePaths = {};
|
|
163
|
+
for (const [type, absPath] of Object.entries(paths)) {
|
|
164
|
+
if (absPath) {
|
|
165
|
+
relativePaths[type] = (0, import_path.relative)("./", absPath) || ".";
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return relativePaths;
|
|
169
|
+
};
|
|
161
170
|
var getEnvVars = (filePath, ifMin, ifCore, ifLocalCore) => {
|
|
162
171
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
163
172
|
(0, import_dotenv_expand.expand)((0, import_dotenv.config)({ path: filePath }));
|
|
@@ -208,12 +217,23 @@ var getEnvVars = (filePath, ifMin, ifCore, ifLocalCore) => {
|
|
|
208
217
|
};
|
|
209
218
|
return { raw, stringified };
|
|
210
219
|
};
|
|
220
|
+
var logError = (message) => {
|
|
221
|
+
if (message) {
|
|
222
|
+
console.log(import_chalk.default.red(message));
|
|
223
|
+
}
|
|
224
|
+
};
|
|
211
225
|
var logDataTable = (vars, title) => {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
226
|
+
logTable((0, import_columnify.default)(vars, { showHeaders: false }), title);
|
|
227
|
+
};
|
|
228
|
+
var logTable = (text, title) => {
|
|
229
|
+
let out = "";
|
|
230
|
+
const boxTitle = title ? import_chalk.default.bold(`${title}`) : void 0;
|
|
231
|
+
if (boxTitle) {
|
|
232
|
+
out += `${boxTitle}
|
|
233
|
+
`;
|
|
234
|
+
}
|
|
235
|
+
out += text;
|
|
236
|
+
console.log((0, import_boxen.default)(out, {
|
|
217
237
|
margin: 0,
|
|
218
238
|
padding: {
|
|
219
239
|
top: 0,
|
|
@@ -237,7 +257,8 @@ var getWebpackConfig = async (env) => {
|
|
|
237
257
|
const envVars = getEnvVars(paths.appEnv, ifMin, ifCore, ifLocalCore);
|
|
238
258
|
const { ifHmr } = (0, import_webpack_config_utils2.getIfUtils)({ hmr: process.env.HMR_ENABLED === "true" }, ["hmr"]);
|
|
239
259
|
const port = await (0, import_portfinder.getPortPromise)({ port: 1234 });
|
|
240
|
-
|
|
260
|
+
const useTailwind = ifCore() && paths.appTailwindConfig && (0, import_fs2.existsSync)(paths.appTailwindConfig);
|
|
261
|
+
logDataTable(getRelativePaths(paths), "Paths");
|
|
241
262
|
logDataTable(envVars.raw, "Environment variables");
|
|
242
263
|
const getCssLoaders = (cssOptions = {}) => {
|
|
243
264
|
return (0, import_webpack_config_utils2.removeEmpty)([
|
|
@@ -262,7 +283,12 @@ var getWebpackConfig = async (env) => {
|
|
|
262
283
|
options: {
|
|
263
284
|
postcssOptions: {
|
|
264
285
|
plugins: (0, import_webpack_config_utils2.removeEmpty)([
|
|
265
|
-
|
|
286
|
+
useTailwind ? [
|
|
287
|
+
require.resolve("tailwindcss", {
|
|
288
|
+
paths: [paths.appNodeModules]
|
|
289
|
+
}),
|
|
290
|
+
paths.appTailwindConfig
|
|
291
|
+
] : void 0,
|
|
266
292
|
require.resolve("postcss-custom-properties"),
|
|
267
293
|
require.resolve("autoprefixer")
|
|
268
294
|
])
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raisenow/tamaro-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "RaiseNow",
|
|
6
6
|
"email": "development@raisenow.com"
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
"dev": "npm run build -- --watch --ignore-watch .idea",
|
|
13
13
|
"build": "tsup src/cli.ts src/webpack.config.ts --format cjs",
|
|
14
14
|
"docs": "npx -y http-server . --cors -o /readme.html",
|
|
15
|
-
"lint": "eslint ."
|
|
16
|
-
"lint:fix": "eslint . --fix"
|
|
15
|
+
"lint": "eslint . --fix && prettier --write ."
|
|
17
16
|
},
|
|
18
17
|
"bin": "dist/cli.js",
|
|
19
18
|
"engines": {
|
|
@@ -21,83 +20,81 @@
|
|
|
21
20
|
"npm": ">=8"
|
|
22
21
|
},
|
|
23
22
|
"dependencies": {
|
|
24
|
-
"@babel/cli": "^7.
|
|
25
|
-
"@babel/core": "^7.
|
|
26
|
-
"@babel/plugin-proposal-decorators": "^7.
|
|
23
|
+
"@babel/cli": "^7.17.0",
|
|
24
|
+
"@babel/core": "^7.17.0",
|
|
25
|
+
"@babel/plugin-proposal-decorators": "^7.17.0",
|
|
27
26
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
28
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
27
|
+
"@babel/plugin-transform-runtime": "^7.17.0",
|
|
29
28
|
"@babel/preset-env": "^7.16.11",
|
|
30
29
|
"@babel/preset-react": "^7.16.7",
|
|
31
30
|
"@babel/preset-typescript": "^7.16.7",
|
|
32
|
-
"@babel/runtime-corejs3": "^7.
|
|
31
|
+
"@babel/runtime-corejs3": "^7.17.0",
|
|
33
32
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.4",
|
|
34
|
-
"@statoscope/webpack-plugin": "^5.20.
|
|
35
|
-
"@svgr/webpack": "^6.2.
|
|
33
|
+
"@statoscope/webpack-plugin": "^5.20.1",
|
|
34
|
+
"@svgr/webpack": "^6.2.1",
|
|
36
35
|
"@types/columnify": "^1.5.1",
|
|
37
36
|
"@types/lodash": "^4.14.178",
|
|
38
37
|
"@types/mini-css-extract-plugin": "^2.5.1",
|
|
39
|
-
"@types/node": "^17.0.
|
|
38
|
+
"@types/node": "^17.0.16",
|
|
40
39
|
"@types/node-notifier": "^8.0.2",
|
|
41
40
|
"@types/resolve-bin": "^0.4.1",
|
|
42
41
|
"@types/webpack-config-utils": "^2.3.1",
|
|
43
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
44
|
-
"@typescript-eslint/parser": "^5.
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^5.11.0",
|
|
43
|
+
"@typescript-eslint/parser": "^5.11.0",
|
|
45
44
|
"autoprefixer": "^10.4.2",
|
|
46
45
|
"babel-loader": "^8.2.3",
|
|
47
46
|
"babel-plugin-lodash": "^3.3.4",
|
|
48
47
|
"boxen": "^5.1.2",
|
|
49
48
|
"chalk": "^4.1.2",
|
|
50
49
|
"clean-webpack-plugin": "^4.0.0",
|
|
51
|
-
"columnify": "^1.
|
|
52
|
-
"commander": "^
|
|
53
|
-
"copy-webpack-plugin": "^10.2.
|
|
54
|
-
"core-js": "^3.
|
|
55
|
-
"css-loader": "^6.
|
|
50
|
+
"columnify": "^1.6.0",
|
|
51
|
+
"commander": "^9.0.0",
|
|
52
|
+
"copy-webpack-plugin": "^10.2.4",
|
|
53
|
+
"core-js": "^3.21.0",
|
|
54
|
+
"css-loader": "^6.6.0",
|
|
56
55
|
"css-minimizer-webpack-plugin": "^3.4.1",
|
|
57
56
|
"current-script-polyfill": "^1.0.0",
|
|
58
|
-
"dotenv": "^
|
|
59
|
-
"dotenv-expand": "^
|
|
57
|
+
"dotenv": "^16.0.0",
|
|
58
|
+
"dotenv-expand": "^8.0.1",
|
|
60
59
|
"element-closest": "^3.0.2",
|
|
61
60
|
"escape-string-regexp": "^4.0.0",
|
|
62
|
-
"eslint": "^8.
|
|
63
|
-
"eslint-config-prettier": "^8.3.0",
|
|
61
|
+
"eslint": "^8.8.0",
|
|
64
62
|
"eslint-plugin-node": "^11.1.0",
|
|
65
|
-
"eslint-plugin-prettier": "^4.0.0",
|
|
66
63
|
"eslint-plugin-promise": "^6.0.0",
|
|
67
64
|
"eslint-webpack-plugin": "^3.1.0",
|
|
68
65
|
"execa": "^5.1.1",
|
|
69
66
|
"file-loader": "^6.2.0",
|
|
70
|
-
"fork-ts-checker-webpack-plugin": "^
|
|
67
|
+
"fork-ts-checker-webpack-plugin": "^7.1.1",
|
|
71
68
|
"glob": "^7.2.0",
|
|
72
69
|
"html-loader": "^3.1.0",
|
|
73
70
|
"html-webpack-plugin": "^5.5.0",
|
|
74
71
|
"json-loader": "^0.5.7",
|
|
75
72
|
"lodash": "^4.17.21",
|
|
76
73
|
"mini-css-extract-plugin": "^2.5.3",
|
|
77
|
-
"node-notifier": "^10.0.
|
|
74
|
+
"node-notifier": "^10.0.1",
|
|
75
|
+
"open": "^8.4.0",
|
|
78
76
|
"portfinder": "^1.0.28",
|
|
79
|
-
"postcss": "^8.4.
|
|
80
|
-
"postcss-custom-properties": "^12.1.
|
|
77
|
+
"postcss": "^8.4.6",
|
|
78
|
+
"postcss-custom-properties": "^12.1.4",
|
|
81
79
|
"postcss-loader": "^6.2.1",
|
|
82
80
|
"prettier": "^2.5.1",
|
|
83
81
|
"react-refresh": "^0.11.0",
|
|
84
82
|
"resolve-bin": "^1.0.0",
|
|
85
83
|
"resolve-url-loader": "^5.0.0",
|
|
86
|
-
"sass": "^1.49.
|
|
84
|
+
"sass": "^1.49.7",
|
|
87
85
|
"sass-loader": "^12.4.0",
|
|
88
86
|
"source-map-loader": "^3.0.1",
|
|
89
87
|
"strip-indent": "^3.0.0",
|
|
90
88
|
"style-loader": "^3.3.1",
|
|
91
|
-
"tailwindcss": "^0.7.4",
|
|
92
89
|
"tsconfig-paths-webpack-plugin": "^3.5.2",
|
|
93
|
-
"tsup": "^5.11.
|
|
90
|
+
"tsup": "^5.11.13",
|
|
94
91
|
"typescript": "^4.5.5",
|
|
95
92
|
"unfetch": "^4.2.0",
|
|
96
93
|
"url-loader": "^4.1.1",
|
|
97
|
-
"webpack": "^5.
|
|
94
|
+
"webpack": "^5.68.0",
|
|
98
95
|
"webpack-cli": "^4.9.2",
|
|
99
96
|
"webpack-config-utils": "^2.3.1",
|
|
100
|
-
"webpack-dev-server": "^4.7.
|
|
97
|
+
"webpack-dev-server": "^4.7.4",
|
|
101
98
|
"yaml-loader": "^0.6.0"
|
|
102
99
|
}
|
|
103
100
|
}
|
package/readme.md
CHANGED
|
@@ -1,179 +1,206 @@
|
|
|
1
1
|
# Getting started
|
|
2
2
|
|
|
3
|
-
It
|
|
3
|
+
It’s a command-line interface for all operations with Tamaro customer configurations and _Tamaro Core_.
|
|
4
4
|
|
|
5
|
-
You don
|
|
5
|
+
You don’t need to install it manually. The recommended way to run it is by using the `npx` command, which comes along with NPM.
|
|
6
6
|
|
|
7
7
|
# Usage
|
|
8
8
|
|
|
9
|
-
To see an overview of all possible commands just run the following command without any arguments
|
|
9
|
+
To see an overview of all possible commands just run the following command without any arguments.
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
npx -y @raisenow/tamaro-cli
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
To see the
|
|
15
|
+
To see the informoation about some particular command (for example `dev` command), prepend `help` before the command name:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
npx -y @raisenow/tamaro-cli help dev
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
Substitute `dev` with the command you want to get
|
|
21
|
+
Substitute `dev` with the command you want to get information about.
|
|
22
22
|
|
|
23
23
|
# Commands
|
|
24
24
|
|
|
25
25
|
Available commands:
|
|
26
|
-
- [dev](#dev)
|
|
27
|
-
- [build](#build)
|
|
28
|
-
- [deploy](#deploy)
|
|
29
|
-
- [serve](#serve)
|
|
30
26
|
|
|
31
|
-
|
|
27
|
+
- [`dev`](#dev)
|
|
28
|
+
- [`build`](#build)
|
|
29
|
+
- [`deploy`](#deploy)
|
|
30
|
+
- [`serve`](#serve)
|
|
31
|
+
- [`list-deployed`](#list-deployed)
|
|
32
|
+
- [`deploy-email-config`](#deploy-email-config)
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
## `dev`
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
- `--local-core` – Load *Tamaro Core* from localhost instead of CDN
|
|
36
|
+
Runs the local development server for _Tamaro Core_ or a particular customer configuration.
|
|
37
37
|
|
|
38
|
-
###
|
|
38
|
+
### Options
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
- `--local-core` – Load _Tamaro Core_ from localhost instead of the CDN
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
### Run local server using Tamaro Core from CDN
|
|
43
|
+
|
|
44
|
+
Run the local development server for the _example-02-typical-customisations_ customer configuration. You will be able to access Tamaro on http://localhost:1234 (port may differ, see console output).
|
|
43
45
|
|
|
44
46
|
```bash
|
|
45
47
|
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
46
48
|
npx -y @raisenow/tamaro-cli dev
|
|
47
49
|
```
|
|
48
50
|
|
|
49
|
-
### Run
|
|
51
|
+
### Run local server using a locally running Tamaro Core
|
|
50
52
|
|
|
51
|
-
1. Run development web
|
|
52
|
-
|
|
53
|
-
After running this command, development web-server should be running on http://localhost:1234/ (port may differ).
|
|
53
|
+
1. Run the local development web server for _Tamaro Core_ in the first terminal tab. You will be able to access a default configuration of Tamaro on http://localhost:1234 (port may differ, see console output).
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
56
|
cd /path/to/tamaro-core
|
|
57
57
|
npx -y @raisenow/tamaro-cli dev
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
2. Run development web
|
|
61
|
-
|
|
62
|
-
After running this command, development web-server should be running on http://localhost:1235/ (port may differ).
|
|
60
|
+
2. Run the local development web server for the _example-02-typical-customisations_ customer configuration in the second terminal tab. After running this command, you will able to access the configuration on http://localhost:1235 (port may differ, see console output).
|
|
63
61
|
|
|
64
62
|
```bash
|
|
65
63
|
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
66
64
|
npx -y @raisenow/tamaro-cli dev --local-core
|
|
67
65
|
```
|
|
68
66
|
|
|
69
|
-
## build
|
|
67
|
+
## `build`
|
|
70
68
|
|
|
71
|
-
Build optimised (minified) bundle of
|
|
69
|
+
Build an optimised (minified) bundle of _Tamaro Core_ or a customer configuration.
|
|
72
70
|
|
|
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
|
|
71
|
+
### Options
|
|
79
72
|
|
|
80
|
-
|
|
81
|
-
|
|
73
|
+
- `--local-core` – Load _Tamaro Core_ from localhost instead of the CDN
|
|
74
|
+
- `--analyze` – Generate bundle statistics to `reports` folder
|
|
75
|
+
- `--deploy` – Deploy _Tamaro Core_ or a customer configuration bundle to AWS S3
|
|
76
|
+
- `--serve` – Run the generated bundle with a local web server
|
|
77
|
+
- `--tag <tag>` – Tag which should be used for the deployment of the bundle (default: “latest”)
|
|
78
|
+
- `--profile <profile>` – AWS profile which should be used for the deployment of the bundle (default: “payments-prod-cs-deployer”)
|
|
82
79
|
|
|
83
|
-
### Build and deploy customer configuration
|
|
80
|
+
### Build and deploy a customer configuration
|
|
84
81
|
|
|
85
|
-
Build and deploy optimised (minified) bundle of
|
|
82
|
+
Build and deploy an optimised (minified) bundle of the _example-02-typical-customisations_ customer configuration.
|
|
86
83
|
|
|
87
84
|
```bash
|
|
88
85
|
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
89
86
|
npx -y @raisenow/tamaro-cli build --deploy
|
|
90
87
|
```
|
|
91
88
|
|
|
92
|
-
As a result bundle should be deployed to: https://tamaro.raisenow.com/example-02-typical-customisations/latest/
|
|
89
|
+
As a result, the bundle should be deployed to: https://tamaro.raisenow.com/example-02-typical-customisations/latest/
|
|
93
90
|
|
|
94
|
-
### Build and deploy customer configuration with a specific tag
|
|
91
|
+
### Build and deploy a customer configuration with a specific tag
|
|
95
92
|
|
|
96
|
-
Build and deploy optimised (minified) bundle of
|
|
93
|
+
Build and deploy an optimised (minified) bundle of the _example-02-typical-customisations_ customer configuration with the tag _WEB-123_.
|
|
97
94
|
|
|
98
95
|
```bash
|
|
99
96
|
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
100
97
|
npx -y @raisenow/tamaro-cli build --deploy --tag WEB-123
|
|
101
98
|
```
|
|
102
99
|
|
|
103
|
-
As a result bundle should be deployed to: https://tamaro.raisenow.com/example-02-typical-customisations/WEB-123/
|
|
100
|
+
As a result, the bundle should be deployed to: https://tamaro.raisenow.com/example-02-typical-customisations/WEB-123/
|
|
104
101
|
|
|
105
|
-
### Build and serve customer configuration
|
|
102
|
+
### Build and serve a customer configuration
|
|
106
103
|
|
|
107
|
-
Build and serve optimised (minified) bundle of
|
|
104
|
+
Build and serve an optimised (minified) bundle of the _example-02-typical-customisations_ customer configuration.
|
|
108
105
|
|
|
109
|
-
After running this command, web
|
|
106
|
+
After running this command, a local web server should be running on http://localhost:1234 (port may differ, see console output).
|
|
110
107
|
|
|
111
108
|
```bash
|
|
112
109
|
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
113
110
|
npx -y @raisenow/tamaro-cli build --serve
|
|
114
111
|
```
|
|
115
112
|
|
|
113
|
+
## `deploy`
|
|
116
114
|
|
|
117
|
-
|
|
115
|
+
Deploy a pre-built _Tamaro Core_ or customer configuration bundle to AWS S3.
|
|
118
116
|
|
|
119
|
-
|
|
117
|
+
### Options
|
|
120
118
|
|
|
121
|
-
|
|
122
|
-
- `--
|
|
119
|
+
- `--tag <tag>` – Tag which should be used for the deployment of the bundle (default: “latest”)
|
|
120
|
+
- `--profile <profile>` – AWS profile which should be used for the deployment of the bundle (default: “payments-prod-cs-deployer”)
|
|
123
121
|
|
|
124
|
-
Make sure you have built the bundle before deploying it with this command, otherwise you may mistakenly deploy the bundle from previous build.
|
|
122
|
+
Make sure you have built the bundle before deploying it with this command, otherwise you may mistakenly deploy the bundle from a previous build.
|
|
125
123
|
|
|
126
|
-
Example
|
|
124
|
+
### Example
|
|
127
125
|
|
|
128
|
-
1. Build optimised (minified) bundle of
|
|
126
|
+
1. Build an optimised (minified) bundle of the _example-02-typical-customisations_ customer configuration
|
|
129
127
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
```bash
|
|
129
|
+
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
130
|
+
npx -y @raisenow/tamaro-cli build
|
|
131
|
+
```
|
|
134
132
|
|
|
135
|
-
2.
|
|
133
|
+
2. Deploy it
|
|
136
134
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
```bash
|
|
136
|
+
npx -y @raisenow/tamaro-cli deploy
|
|
137
|
+
```
|
|
140
138
|
|
|
141
|
-
3.
|
|
139
|
+
3. Optionally, deploy it with the _WEB-123_ tag
|
|
142
140
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
```bash
|
|
142
|
+
npx -y @raisenow/tamaro-cli deploy --tag WEB-123
|
|
143
|
+
```
|
|
146
144
|
|
|
147
|
-
## serve
|
|
145
|
+
## `serve`
|
|
148
146
|
|
|
149
|
-
Run web
|
|
147
|
+
Run a local web server for pre-built bundle.
|
|
150
148
|
|
|
151
|
-
Example
|
|
149
|
+
### Example
|
|
152
150
|
|
|
153
|
-
1. Build optimised (minified) bundle of
|
|
151
|
+
1. Build an optimised (minified) bundle of the _example-02-typical-customisations_ customer configuration
|
|
154
152
|
|
|
155
153
|
```bash
|
|
156
154
|
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
157
155
|
npx -y @raisenow/tamaro-cli build
|
|
158
156
|
```
|
|
159
157
|
|
|
160
|
-
2. Serve it.
|
|
161
|
-
|
|
162
|
-
After running this command, web-server should be running on http://localhost:1234/ (port may differ).
|
|
158
|
+
2. Serve it. After running this command, web-server should be running on http://localhost:1234 (port may differ, see console output).
|
|
163
159
|
|
|
164
160
|
```bash
|
|
165
161
|
npx -y @raisenow/tamaro-cli serve
|
|
166
162
|
```
|
|
167
163
|
|
|
164
|
+
## `list-deployed`
|
|
165
|
+
|
|
166
|
+
List deployments of _Tamaro Core_ or a particular customer configuration.
|
|
167
|
+
|
|
168
|
+
### Options
|
|
169
|
+
|
|
170
|
+
- `--config <config>` – Configuration name (default: current customer configuration)
|
|
171
|
+
- `--profile <profile>` – AWS profile which should be used for fetching deployments (default: “payments-prod-cs-deployer”)
|
|
172
|
+
|
|
173
|
+
### Example
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
177
|
+
npx -y @raisenow/tamaro-cli list-deployed
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## `deploy-email-config`
|
|
181
|
+
|
|
182
|
+
Deploy a widget’s email configuration to AWS S3.
|
|
183
|
+
|
|
184
|
+
### Options
|
|
185
|
+
|
|
186
|
+
- `--bucket <bucket>` – AWS S3 bucket where it should be deployed (default: “rnw-email-service”)
|
|
187
|
+
- `--profile <profile>` – AWS profile which should be used for the deployment of email configuration (default: “payments-prod-cs-deployer”)
|
|
188
|
+
|
|
189
|
+
### Example
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
193
|
+
npx -y @raisenow/tamaro-cli deploy-email-config
|
|
194
|
+
```
|
|
168
195
|
|
|
169
196
|
# Development
|
|
170
197
|
|
|
171
|
-
Make sure you have installed and activated proper `node` and `npm` versions.
|
|
198
|
+
Make sure you have installed and activated the proper `node` and `npm` versions.
|
|
172
199
|
|
|
173
200
|
- `node: ">= 16"`
|
|
174
201
|
- `npm: ">= 8"`
|
|
175
202
|
|
|
176
|
-
Clone the
|
|
203
|
+
Clone the repository and install its dependencies:
|
|
177
204
|
|
|
178
205
|
```bash
|
|
179
206
|
git clone git@bitbucket.org:raisenow/tamaro-cli.git
|
|
@@ -187,14 +214,13 @@ Link package source to be able to run its local version:
|
|
|
187
214
|
npm link .
|
|
188
215
|
```
|
|
189
216
|
|
|
190
|
-
Run the `dev` script to watch source files and automatically rebuild on changes.
|
|
191
|
-
It must be running during *Tamaro CLI* development process.
|
|
217
|
+
Run the `dev` script to watch source files and automatically rebuild on changes. It must be running during the _Tamaro CLI_ development process.
|
|
192
218
|
|
|
193
219
|
```bash
|
|
194
220
|
npm run dev
|
|
195
221
|
```
|
|
196
222
|
|
|
197
|
-
To use
|
|
223
|
+
To use the locally linked version of _Tamaro CLI_, use it without `@raisenow/` scope, `-y` flag is also not needed:
|
|
198
224
|
|
|
199
225
|
```bash
|
|
200
226
|
npx tamaro-cli dev
|