@raisenow/tamaro-cli 1.6.0-dev.1 → 1.6.0-dev.3
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/README.md +84 -0
- package/{.history/dist/chunk-FICM3HUI_20230912201610.js → dist/chunk-FI7KZAG6.js} +141 -45
- package/dist/cli.js +1436 -562
- package/dist/webpack.config.js +441 -310
- package/package.json +16 -4
- package/.history/.eslintignore_20220609190420 +0 -4
- package/.history/.eslintignore_20230911190227 +0 -6
- package/.history/.eslintignore_20230911211247 +0 -7
- package/.history/.eslintignore_20230911211250 +0 -7
- package/.history/.eslintrc_20230911201601.js +0 -49
- package/.history/.eslintrc_20230911201643.js +0 -49
- package/.history/.eslintrc_20230911201735.js +0 -49
- package/.history/.eslintrc_20230911201913.js +0 -64
- package/.history/.eslintrc_20230911202002.js +0 -62
- package/.history/.eslintrc_20230911202138.js +0 -133
- package/.history/.eslintrc_20230911202140.js +0 -133
- package/.history/.eslintrc_20230911202145.js +0 -133
- package/.history/.eslintrc_20230911202147.js +0 -133
- package/.history/.eslintrc_20230911202406.js +0 -133
- package/.history/.eslintrc_20230911202447.js +0 -133
- package/.history/.eslintrc_20230911202453.js +0 -133
- package/.history/.eslintrc_20230911202511.js +0 -133
- package/.history/.eslintrc_20230911202527.js +0 -133
- package/.history/.eslintrc_20230911202639.js +0 -125
- package/.history/.eslintrc_20230911202721.js +0 -149
- package/.history/.eslintrc_20230911202746.js +0 -149
- package/.history/.eslintrc_20240423125702.cjs +0 -148
- package/.history/.gitignore_20220609190420 +0 -14
- package/.history/.gitignore_20230911185959 +0 -4
- package/.history/.gitignore_20230911190006 +0 -4
- package/.history/.gitignore_20230911190007 +0 -4
- package/.history/.nmprc_20241004144025 +0 -0
- package/.history/.nmprc_20241004144041 +0 -1
- package/.history/.npmrc_20241004144040 +0 -1
- package/.history/.npmrc_20241004144152 +0 -1
- package/.history/.npmrc_20241004145639 +0 -2
- package/.history/.npmrc_20241004145649 +0 -1
- package/.history/.nvmrc_20250729181039 +0 -1
- package/.history/.prettierignore_20220609190420 +0 -5
- package/.history/.prettierignore_20230911190242 +0 -7
- package/.history/.prettierignore_20230911190245 +0 -7
- package/.history/.prettierignore_20230911211301 +0 -8
- package/.history/CHANGELOG_20250729195139.md +0 -28
- package/.history/CHANGELOG_20250729195148.md +0 -29
- package/.history/CHANGELOG_20250729195156.md +0 -28
- package/.history/CHANGELOG_20250729195218.md +0 -29
- package/.history/CHANGELOG_20250729195223.md +0 -27
- package/.history/CHANGELOG_20250729195506.md +0 -29
- package/.history/CHANGELOG_20250729224404.md +0 -30
- package/.history/CHANGELOG_20250729224411.md +0 -30
- package/.history/CHANGELOG_20250730124538.md +0 -41
- package/.history/CHANGELOG_20250730124603.md +0 -38
- package/.history/CHANGELOG_20250730124627.md +0 -36
- package/.history/CHANGELOG_20250730124638.md +0 -36
- package/.history/CHANGELOG_20250730124640.md +0 -36
- package/.history/README_20230911145033.md +0 -245
- package/.history/README_20230911151749.md +0 -245
- package/.history/README_20230911151844.md +0 -245
- package/.history/README_20230911153040.md +0 -245
- package/.history/README_20230911202959.md +0 -245
- package/.history/bitbucket-pipelines_20250729111540.yml +0 -46
- package/.history/bitbucket-pipelines_20250729210338.yml +0 -46
- package/.history/bitbucket-pipelines_20250729210340.yml +0 -46
- package/.history/bitbucket-pipelines_20250729210342.yml +0 -46
- package/.history/bitbucket-pipelines_20250729222234.yml +0 -47
- package/.history/bitbucket-pipelines_20250729222554.yml +0 -47
- package/.history/bitbucket-pipelines_20250729222555.yml +0 -47
- package/.history/bitbucket-pipelines_20250729223022.yml +0 -46
- package/.history/bitbucket-pipelines_20250729223024.yml +0 -46
- package/.history/cli_20241005014539 +0 -3
- package/.history/cli_20241005014542 +0 -3
- package/.history/cli_20241005014848 +0 -3
- package/.history/dist/chunk-FICM3HUI_20230912183408.js +0 -302
- package/.history/package_20250729182417.json +0 -111
- package/.history/package_20250729182419.json +0 -111
- package/.history/package_20250729182618.json +0 -110
- package/.history/package_20250729182834.json +0 -110
- package/.history/package_20250729183032.json +0 -110
- package/.history/package_20250729183033.json +0 -110
- package/.history/package_20250729185750.json +0 -110
- package/.history/package_20250729185815.json +0 -110
- package/.history/package_20250729185846.json +0 -110
- package/.history/package_20250729185854.json +0 -110
- package/.history/package_20250729185943.json +0 -110
- package/.history/package_20250729190645.json +0 -110
- package/.history/package_20250729195934.json +0 -110
- package/.history/package_20250729200013.json +0 -110
- package/.history/package_20250729200056.json +0 -110
- package/.history/package_20250729200434.json +0 -110
- package/.history/package_20250729200808.json +0 -110
- package/.history/package_20250729200944.json +0 -110
- package/.history/package_20250729214420.json +0 -114
- package/.history/package_20250729223112.json +0 -110
- package/.history/package_20250729223127.json +0 -110
- package/.history/package_20250729223134.json +0 -110
- package/.history/package_20250730124647.json +0 -114
- package/.history/tsconfig_20241005001442.json +0 -34
- package/.history/tsconfig_20241005001500.json +0 -34
- package/.history/tsconfig_20241005001540.json +0 -34
- package/.history/tsconfig_20241005014429.json +0 -42
- package/.history/tsconfig_20241005014436.json +0 -42
- package/.history/tsconfig_20241005014439.json +0 -38
- package/.history/tsconfig_20241005014455.json +0 -38
- package/.history/tsconfig_20241005014521.json +0 -38
- package/.history/vitest.config_20250729214539.ts +0 -0
- package/.history/vitest.config_20250729214659.ts +0 -24
- package/.history/vitest.config_20250729214748.ts +0 -21
- package/.history/vitest.config_20250729214825.ts +0 -21
- package/.history/vitest.config_20250729214902.ts +0 -21
- package/.history/vitest.config_20250729222125.ts +0 -20
- package/.history/vitest.config_20250729222213.ts +0 -20
- package/.idea/codeStyles/Project.xml +0 -131
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/misc.xml +0 -17
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -6
- package/.idea/tamaro-cli.iml +0 -12
- package/.idea/vcs.xml +0 -6
- package/dist/env-Cpc7KHou.js +0 -245
- package/tsdown.config.ts +0 -11
package/README.md
CHANGED
|
@@ -32,6 +32,10 @@ Available commands:
|
|
|
32
32
|
- [`deploy`](#deploy)
|
|
33
33
|
- [`list-deployed`](#list-deployed)
|
|
34
34
|
- [`deploy-email-config`](#deploy-email-config)
|
|
35
|
+
- [`undeploy`](#undeploy)
|
|
36
|
+
- [`undeploy-email-config`](#undeploy-email-config)
|
|
37
|
+
- [`archive`](#archive)
|
|
38
|
+
- [`unarchive`](#unarchive)
|
|
35
39
|
|
|
36
40
|
## `dev`
|
|
37
41
|
|
|
@@ -233,6 +237,86 @@ cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
|
233
237
|
npx -y @raisenow/tamaro-cli deploy-email-config
|
|
234
238
|
```
|
|
235
239
|
|
|
240
|
+
## `undeploy`
|
|
241
|
+
|
|
242
|
+
Undeploy a _Tamaro Core_ or customer configuration bundle from AWS S3. Removes the specified tag from S3 and invalidates
|
|
243
|
+
the CloudFront cache. Always asks for confirmation unless `-y` is passed.
|
|
244
|
+
|
|
245
|
+
**NOTE**: _Tamaro Core_ cannot be undeployed with the `latest` or no tag.
|
|
246
|
+
|
|
247
|
+
### Options
|
|
248
|
+
|
|
249
|
+
- `--tag <tag>` – Tag which should be undeployed (default: "latest")
|
|
250
|
+
- `--all` – Undeploy all tags
|
|
251
|
+
- `--dryrun` – Displays the operations that would be performed without actually running them
|
|
252
|
+
|
|
253
|
+
### Undeploy the "latest" tag
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
257
|
+
npx -y @raisenow/tamaro-cli undeploy
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Undeploy a specific tag
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
264
|
+
npx -y @raisenow/tamaro-cli undeploy --tag WEB-123
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Undeploy all tags
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
271
|
+
npx -y @raisenow/tamaro-cli undeploy --all
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## `undeploy-email-config`
|
|
275
|
+
|
|
276
|
+
Undeploy a widget's email configuration from AWS S3.
|
|
277
|
+
|
|
278
|
+
### Options
|
|
279
|
+
|
|
280
|
+
- `--bucket <bucket>` – AWS bucket for email configs
|
|
281
|
+
- `--dryrun` – Displays the operations that would be performed without actually running them
|
|
282
|
+
|
|
283
|
+
### Example
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
287
|
+
npx -y @raisenow/tamaro-cli undeploy-email-config
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
## `archive`
|
|
291
|
+
|
|
292
|
+
Archive a customer configuration. This moves the configuration folder into the `_archived` folder.
|
|
293
|
+
|
|
294
|
+
### Options
|
|
295
|
+
|
|
296
|
+
- `--dryrun` – Displays the operations that would be performed without actually running them
|
|
297
|
+
|
|
298
|
+
### Example
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
302
|
+
npx -y @raisenow/tamaro-cli archive
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## `unarchive`
|
|
306
|
+
|
|
307
|
+
Unarchive a previously archived customer configuration. This moves the configuration out of the `_archived` folder.
|
|
308
|
+
|
|
309
|
+
### Options
|
|
310
|
+
|
|
311
|
+
- `--dryrun` – Displays the operations that would be performed without actually running them
|
|
312
|
+
|
|
313
|
+
### Example
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
cd /path/to/tamaro-configurations/configs/_archived/example-02-typical-customisations
|
|
317
|
+
npx -y @raisenow/tamaro-cli unarchive
|
|
318
|
+
```
|
|
319
|
+
|
|
236
320
|
# Development
|
|
237
321
|
|
|
238
322
|
Make sure you have installed and activated the proper `node` and `npm` versions.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// node_modules/.pnpm/tsup@
|
|
2
|
-
import { fileURLToPath } from "url";
|
|
1
|
+
// node_modules/.pnpm/tsup@8.5.1_jiti@2.6.0_postcss@8.5.6_tsx@4.19.1_typescript@5.9.3/node_modules/tsup/assets/esm_shims.js
|
|
3
2
|
import path from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
4
|
var getFilename = () => fileURLToPath(import.meta.url);
|
|
5
5
|
var getDirname = () => path.dirname(getFilename());
|
|
6
6
|
var __dirname = /* @__PURE__ */ getDirname();
|
|
@@ -10,13 +10,18 @@ import chalk from "chalk";
|
|
|
10
10
|
import columnify from "columnify";
|
|
11
11
|
import stripIndent from "strip-indent";
|
|
12
12
|
var logTitle = (title) => {
|
|
13
|
-
console.log(
|
|
13
|
+
console.log(chalk.bold(title));
|
|
14
14
|
};
|
|
15
15
|
var logError = (message) => {
|
|
16
16
|
if (message) {
|
|
17
17
|
console.log(chalk.red(message));
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
+
var logSuccess = (message) => {
|
|
21
|
+
if (message) {
|
|
22
|
+
console.log(chalk.green(message));
|
|
23
|
+
}
|
|
24
|
+
};
|
|
20
25
|
var logCommand = (cmd) => {
|
|
21
26
|
console.log(`
|
|
22
27
|
${chalk.dim(stripIndent(cmd).trim())}
|
|
@@ -27,16 +32,40 @@ var logDataTable = (data) => {
|
|
|
27
32
|
console.log("");
|
|
28
33
|
};
|
|
29
34
|
|
|
30
|
-
// src/lib/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
// src/lib/command.ts
|
|
36
|
+
import { execaCommandSync } from "execa";
|
|
37
|
+
import prompts from "prompts";
|
|
38
|
+
var halt = (message) => {
|
|
39
|
+
logError(message);
|
|
40
|
+
process.exit(1);
|
|
41
|
+
};
|
|
42
|
+
var prepareCommand = (cmd) => {
|
|
43
|
+
return cmd.replace(/\n/gm, " ").replace(/[ \t]{2,}/gm, " ").trim();
|
|
44
|
+
};
|
|
45
|
+
var runCommandSync = (cmd, options) => {
|
|
46
|
+
return execaCommandSync(prepareCommand(cmd), options);
|
|
47
|
+
};
|
|
48
|
+
var promptConfirmation = async (message, skipConfirmation) => {
|
|
49
|
+
if (skipConfirmation) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const { confirmed } = await prompts(
|
|
53
|
+
[
|
|
54
|
+
{
|
|
55
|
+
type: "confirm",
|
|
56
|
+
name: "confirmed",
|
|
57
|
+
message,
|
|
58
|
+
initial: false
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
{
|
|
62
|
+
onCancel: () => halt()
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
if (!confirmed) {
|
|
66
|
+
halt("Operation cancelled.");
|
|
67
|
+
}
|
|
68
|
+
};
|
|
40
69
|
|
|
41
70
|
// src/lib/resolve.ts
|
|
42
71
|
import { existsSync, realpathSync } from "fs";
|
|
@@ -45,6 +74,7 @@ import { basename, dirname, join, relative, resolve } from "path";
|
|
|
45
74
|
import chalk2 from "chalk";
|
|
46
75
|
import stripIndent2 from "strip-indent";
|
|
47
76
|
import { getIfUtils } from "webpack-config-utils";
|
|
77
|
+
import { z } from "zod";
|
|
48
78
|
var require2 = createRequire(import.meta.url);
|
|
49
79
|
var moduleFileExtensions = ["ts", "tsx", "js", "jsx"];
|
|
50
80
|
var extensions = moduleFileExtensions.map((v) => `.${v}`);
|
|
@@ -62,6 +92,24 @@ var resolveModule = (resolveFn, filePath) => {
|
|
|
62
92
|
}
|
|
63
93
|
return resolveFn(`${filePath}.js`);
|
|
64
94
|
};
|
|
95
|
+
var resolveEslintPluginConfig = (paths) => {
|
|
96
|
+
try {
|
|
97
|
+
const opts = { paths: [paths.appNodeModules] };
|
|
98
|
+
const eslintPath = require2.resolve("eslint", opts);
|
|
99
|
+
const pkg = require2(require2.resolve("eslint/package.json", opts));
|
|
100
|
+
const version = pkg.version;
|
|
101
|
+
const configType = version.startsWith("8.") ? "eslintrc" : "flat";
|
|
102
|
+
return {
|
|
103
|
+
extensions: moduleFileExtensions,
|
|
104
|
+
eslintPath,
|
|
105
|
+
cwd: paths.app,
|
|
106
|
+
configType
|
|
107
|
+
};
|
|
108
|
+
} catch (error) {
|
|
109
|
+
console.error(error);
|
|
110
|
+
return void 0;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
65
113
|
var resolveBin = (name) => {
|
|
66
114
|
const pkgPath = require2.resolve(`${name}/package.json`);
|
|
67
115
|
const { bin } = require2(pkgPath);
|
|
@@ -92,6 +140,7 @@ var getPaths = (ifCore) => {
|
|
|
92
140
|
appTsConfig: resolveApp("tsconfig.json"),
|
|
93
141
|
appHtml: resolveApp("*.html"),
|
|
94
142
|
appEnv: resolveApp(".env*"),
|
|
143
|
+
configYml: resolveApp("config.yml"),
|
|
95
144
|
appTailwindConfig: void 0
|
|
96
145
|
}
|
|
97
146
|
);
|
|
@@ -105,14 +154,19 @@ var getRelativePaths = (paths) => {
|
|
|
105
154
|
}
|
|
106
155
|
return relativePaths;
|
|
107
156
|
};
|
|
108
|
-
var getIfCoreFns = (
|
|
157
|
+
var getIfCoreFns = ({
|
|
158
|
+
allowArchived = false
|
|
159
|
+
} = {}) => {
|
|
109
160
|
const corePkgPath = resolveApp("package.json");
|
|
110
161
|
const configsPkgPath = resolveApp("../../package.json");
|
|
162
|
+
const archivedConfigsPkgPath = resolveApp("../../../package.json");
|
|
111
163
|
let packageName;
|
|
112
164
|
if (existsSync(corePkgPath)) {
|
|
113
165
|
packageName = require2(corePkgPath).name;
|
|
114
166
|
} else if (existsSync(configsPkgPath)) {
|
|
115
167
|
packageName = require2(configsPkgPath).name;
|
|
168
|
+
} else if (allowArchived && existsSync(archivedConfigsPkgPath)) {
|
|
169
|
+
packageName = require2(archivedConfigsPkgPath).name;
|
|
116
170
|
}
|
|
117
171
|
if (packageName) {
|
|
118
172
|
return getIfUtils({ core: TAMARO_CORE_PACKAGE_NAMES.includes(packageName) }, [
|
|
@@ -133,36 +187,67 @@ var getIfCoreFns = () => {
|
|
|
133
187
|
);
|
|
134
188
|
process.exit(1);
|
|
135
189
|
};
|
|
190
|
+
var resolveAccountUuidFromConfig = (rawConfig, field) => {
|
|
191
|
+
const epmsConfig = z.object({
|
|
192
|
+
[field]: z.object()
|
|
193
|
+
}).safeParse(rawConfig);
|
|
194
|
+
if (!epmsConfig.success) {
|
|
195
|
+
return void 0;
|
|
196
|
+
}
|
|
197
|
+
const simple = z.object({
|
|
198
|
+
[field]: z.object({
|
|
199
|
+
account_uuid: z.uuid()
|
|
200
|
+
})
|
|
201
|
+
}).safeParse(rawConfig);
|
|
202
|
+
if (simple.success) {
|
|
203
|
+
return simple.data[field].account_uuid;
|
|
204
|
+
}
|
|
205
|
+
const accountMapping = z.object({
|
|
206
|
+
[field]: z.object({
|
|
207
|
+
account_mapping: z.uuid()
|
|
208
|
+
})
|
|
209
|
+
}).safeParse(rawConfig);
|
|
210
|
+
if (accountMapping.success) {
|
|
211
|
+
return accountMapping.data[field].account_mapping;
|
|
212
|
+
}
|
|
213
|
+
halt(
|
|
214
|
+
stripIndent2(
|
|
215
|
+
`Could not extract EPMS account UUID(s) from config.yml. Please ensure that the "${field}" field is correctly formatted. Expected formats:
|
|
216
|
+
1. ${field}:
|
|
217
|
+
account_uuid: <UUID>
|
|
218
|
+
|
|
219
|
+
2. ${field}:
|
|
220
|
+
account_mapping: <UUID>
|
|
221
|
+
`
|
|
222
|
+
)
|
|
223
|
+
);
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
// src/lib/constants.ts
|
|
227
|
+
import envPaths from "env-paths";
|
|
228
|
+
var DEFAULT_TAG = "latest";
|
|
229
|
+
var DEFAULT_PORT = 1234;
|
|
230
|
+
var AWS_S3_BUCKET_TAMARO = "tamaro.raisenow.com";
|
|
231
|
+
var AWS_S3_BUCKET_TAMARO_EMAIL_CONFIG_STAGE = "rnw-stage-email-service";
|
|
232
|
+
var AWS_S3_BUCKET_TAMARO_EMAIL_CONFIG_PROD = "rnw-email-service";
|
|
233
|
+
var EPMS_API_BASE_URL_STAGE = "https://api.stage.mesos.raisenow.net";
|
|
234
|
+
var CORE_CONFIG_NAME = "tamaro-core";
|
|
235
|
+
var AWS_CLOUDFRONT_DISTRIBUTION_ID = "EHJ1OM458YQ0I";
|
|
236
|
+
var HTTPS_CRT_FILE = "localhost.crt";
|
|
237
|
+
var HTTPS_KEY_FILE = "localhost.key";
|
|
238
|
+
var CACHE_DIR = envPaths("tamaro-cli", { suffix: "" }).cache;
|
|
136
239
|
|
|
137
240
|
// src/lib/env.ts
|
|
138
241
|
import { createRequire as createRequire2 } from "module";
|
|
139
242
|
import { basename as basename2 } from "path";
|
|
140
243
|
import { config as dotenvConfig } from "dotenv";
|
|
141
|
-
import { expand as dotenvExpand } from "dotenv-expand";
|
|
142
244
|
import { globSync } from "glob";
|
|
143
245
|
import stripIndent3 from "strip-indent";
|
|
144
|
-
|
|
145
|
-
// src/lib/command.ts
|
|
146
|
-
import {
|
|
147
|
-
execaCommandSync
|
|
148
|
-
} from "execa";
|
|
149
|
-
var halt = (message, exitCode = 1) => {
|
|
150
|
-
logError(message);
|
|
151
|
-
process.exit(exitCode);
|
|
152
|
-
};
|
|
153
|
-
var prepareCommand = (cmd) => {
|
|
154
|
-
return cmd.replace(/\n/gm, " ").replace(/[ \t]{2,}/gm, " ").trim();
|
|
155
|
-
};
|
|
156
|
-
var runCommandSync = (cmd, options) => {
|
|
157
|
-
return execaCommandSync(prepareCommand(cmd), options);
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
// src/lib/env.ts
|
|
161
246
|
var require3 = createRequire2(import.meta.url);
|
|
162
247
|
var getEnvVars = (files, ifMin, ifCore, ifLocalCore, ifHttps) => {
|
|
163
248
|
const filePath = files.find((file) => basename2(file) === ".env");
|
|
164
249
|
if (filePath) {
|
|
165
|
-
|
|
250
|
+
dotenvConfig({ path: filePath });
|
|
166
251
|
}
|
|
167
252
|
process.env.NODE_ENV ??= ifMin("production", "development");
|
|
168
253
|
process.env.BABEL_ENV ??= ifMin("production", "development");
|
|
@@ -189,7 +274,11 @@ var getEnvVars = (files, ifMin, ifCore, ifLocalCore, ifHttps) => {
|
|
|
189
274
|
} else {
|
|
190
275
|
let version = process.env.CORE_VERSION;
|
|
191
276
|
version = version ? `@${version}` : "";
|
|
192
|
-
process.env.
|
|
277
|
+
process.env.CORE_URL_PATTERN ??= "https://cdn.jsdelivr.net/npm/@raisenow/tamaro-core{{version}}/dist/index.js";
|
|
278
|
+
process.env.CORE_URL ??= process.env.CORE_URL_PATTERN.replace(
|
|
279
|
+
"{{version}}",
|
|
280
|
+
version
|
|
281
|
+
);
|
|
193
282
|
}
|
|
194
283
|
}
|
|
195
284
|
const varNames = [
|
|
@@ -207,8 +296,10 @@ var getEnvVars = (files, ifMin, ifCore, ifLocalCore, ifHttps) => {
|
|
|
207
296
|
// config
|
|
208
297
|
"WIDGET_UUID",
|
|
209
298
|
"CORE_URL",
|
|
299
|
+
"CORE_URL_PATTERN",
|
|
210
300
|
"CORE_VERSION",
|
|
211
301
|
// should be explicitly specified in each config
|
|
302
|
+
"DISABLE_URL_VERSION_OVERRIDE",
|
|
212
303
|
// epik (obsolete since Tamaro v2.5.0)
|
|
213
304
|
"EPP_API_KEY_DEFAULT",
|
|
214
305
|
"EPP_API_URL_STAGE",
|
|
@@ -267,35 +358,40 @@ var applyEnv = (env) => {
|
|
|
267
358
|
const files = globSync(paths.appEnv);
|
|
268
359
|
const filePath = files.find((file) => basename2(file) === `.env.${env}`);
|
|
269
360
|
if (filePath) {
|
|
270
|
-
|
|
361
|
+
dotenvConfig({ path: filePath });
|
|
271
362
|
}
|
|
272
363
|
};
|
|
273
364
|
|
|
274
365
|
export {
|
|
275
366
|
logTitle,
|
|
276
367
|
logError,
|
|
368
|
+
logSuccess,
|
|
277
369
|
logCommand,
|
|
278
370
|
logDataTable,
|
|
279
371
|
halt,
|
|
280
372
|
runCommandSync,
|
|
281
|
-
|
|
282
|
-
DEFAULT_PORT,
|
|
283
|
-
AWS_S3_EMAIL_CONFIG_PROD_BUCKET,
|
|
284
|
-
AWS_S3_EMAIL_CONFIG_STAGE_BUCKET,
|
|
285
|
-
AWS_S3_BUCKET,
|
|
286
|
-
CORE_CONFIG_NAME,
|
|
287
|
-
AWS_CLOUDFRONT_DISTRIBUTION_ID,
|
|
288
|
-
HTTPS_CRT_FILE,
|
|
289
|
-
HTTPS_KEY_FILE,
|
|
290
|
-
moduleFileExtensions,
|
|
373
|
+
promptConfirmation,
|
|
291
374
|
extensions,
|
|
292
375
|
resolveApp,
|
|
293
376
|
resolveOwn,
|
|
377
|
+
resolveEslintPluginConfig,
|
|
294
378
|
resolveBin,
|
|
295
379
|
getWidgetUuid,
|
|
296
380
|
getPaths,
|
|
297
381
|
getRelativePaths,
|
|
298
382
|
getIfCoreFns,
|
|
383
|
+
resolveAccountUuidFromConfig,
|
|
384
|
+
DEFAULT_TAG,
|
|
385
|
+
DEFAULT_PORT,
|
|
386
|
+
AWS_S3_BUCKET_TAMARO,
|
|
387
|
+
AWS_S3_BUCKET_TAMARO_EMAIL_CONFIG_STAGE,
|
|
388
|
+
AWS_S3_BUCKET_TAMARO_EMAIL_CONFIG_PROD,
|
|
389
|
+
EPMS_API_BASE_URL_STAGE,
|
|
390
|
+
CORE_CONFIG_NAME,
|
|
391
|
+
AWS_CLOUDFRONT_DISTRIBUTION_ID,
|
|
392
|
+
HTTPS_CRT_FILE,
|
|
393
|
+
HTTPS_KEY_FILE,
|
|
394
|
+
CACHE_DIR,
|
|
299
395
|
getEnvVars,
|
|
300
396
|
assertEnvValid,
|
|
301
397
|
applyEnv
|