@raisenow/tamaro-cli 1.0.10 → 1.0.13
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 → .eslintrc.cjs} +2 -9
- package/.gitignore +3 -3
- package/.nvmrc +1 -1
- package/{.prettierrc.js → .prettierrc.cjs} +1 -0
- package/{readme.md → README.md} +36 -32
- package/dist/chunk-OXDXJ5B5.js +249 -0
- package/dist/cli.js +257 -324
- package/dist/webpack.config.js +108 -341
- package/package.json +35 -44
- package/readme.html +1 -1
- package/src/cli.ts +31 -19
- package/src/commands/build.ts +33 -28
- package/src/commands/deploy-email-config.ts +29 -21
- package/src/commands/deploy.ts +52 -39
- package/src/commands/dev.ts +29 -18
- package/src/commands/list-deployed.ts +23 -13
- package/src/commands/serve.ts +36 -12
- package/src/lib/InterpolateHtmlPlugin.ts +10 -8
- package/src/lib/aws.ts +43 -35
- package/src/lib/command.ts +27 -0
- package/src/lib/constants.ts +7 -0
- package/src/lib/env.ts +145 -0
- package/src/lib/logging.ts +32 -0
- package/src/lib/notifier.ts +22 -0
- package/src/lib/resolve.ts +144 -0
- package/src/webpack.config.ts +26 -77
- package/tsconfig.json +1 -1
- package/src/lib/helpers.ts +0 -356
- package/src/lib/polyfills.js +0 -8
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
2
|
-
const {resolve} = require('path')
|
|
3
|
-
|
|
4
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
5
|
-
|
|
6
1
|
module.exports = {
|
|
7
2
|
root: true,
|
|
8
3
|
env: {
|
|
@@ -22,17 +17,15 @@ module.exports = {
|
|
|
22
17
|
'plugin:node/recommended',
|
|
23
18
|
'plugin:promise/recommended',
|
|
24
19
|
'plugin:@typescript-eslint/recommended',
|
|
25
|
-
'
|
|
20
|
+
'prettier',
|
|
26
21
|
],
|
|
27
22
|
plugins: [],
|
|
28
23
|
rules: {
|
|
29
24
|
curly: 1,
|
|
30
|
-
|
|
31
25
|
'node/no-unsupported-features/es-syntax': 0,
|
|
32
26
|
'node/no-missing-import': 0,
|
|
33
27
|
'node/shebang': 0,
|
|
34
28
|
'no-process-exit': 0,
|
|
35
|
-
|
|
36
29
|
'@typescript-eslint/ban-ts-comment': 0,
|
|
37
30
|
'@typescript-eslint/no-explicit-any': 0,
|
|
38
31
|
'@typescript-eslint/no-non-null-assertion': 0,
|
|
@@ -42,7 +35,7 @@ module.exports = {
|
|
|
42
35
|
{
|
|
43
36
|
files: ['*.ts', '*.tsx'],
|
|
44
37
|
parserOptions: {
|
|
45
|
-
project:
|
|
38
|
+
project: 'tsconfig.json',
|
|
46
39
|
},
|
|
47
40
|
},
|
|
48
41
|
],
|
package/.gitignore
CHANGED
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
16.
|
|
1
|
+
16.14.2
|
package/{readme.md → README.md}
RENAMED
|
@@ -26,8 +26,8 @@ Available commands:
|
|
|
26
26
|
|
|
27
27
|
- [`dev`](#dev)
|
|
28
28
|
- [`build`](#build)
|
|
29
|
-
- [`deploy`](#deploy)
|
|
30
29
|
- [`serve`](#serve)
|
|
30
|
+
- [`deploy`](#deploy)
|
|
31
31
|
- [`list-deployed`](#list-deployed)
|
|
32
32
|
- [`deploy-email-config`](#deploy-email-config)
|
|
33
33
|
|
|
@@ -37,7 +37,9 @@ Runs the local development server for _Tamaro Core_ or a particular customer con
|
|
|
37
37
|
|
|
38
38
|
### Options
|
|
39
39
|
|
|
40
|
-
- `--local-core` – Load _Tamaro Core_ from localhost instead of the CDN
|
|
40
|
+
- `--local-core` – Load _Tamaro Core_ from localhost:1234 instead of the CDN
|
|
41
|
+
- `--port <port>` – Web server port (default: 1234)
|
|
42
|
+
- `--env <env>` – Environment (dev, stage, prod)
|
|
41
43
|
|
|
42
44
|
### Run local server using Tamaro Core from CDN
|
|
43
45
|
|
|
@@ -70,10 +72,12 @@ Build an optimised (minified) bundle of _Tamaro Core_ or a customer configuratio
|
|
|
70
72
|
|
|
71
73
|
### Options
|
|
72
74
|
|
|
73
|
-
- `--local-core` – Load _Tamaro Core_ from localhost instead of the CDN
|
|
75
|
+
- `--local-core` – Load _Tamaro Core_ from localhost:1234 instead of the CDN
|
|
74
76
|
- `--analyze` – Generate bundle statistics to `reports` folder
|
|
75
|
-
- `--deploy` – Deploy _Tamaro Core_ or a customer configuration bundle to AWS S3
|
|
76
77
|
- `--serve` – Run the generated bundle with a local web server
|
|
78
|
+
- `--port <port>` – Web server port (default: 1234)
|
|
79
|
+
- `--env <env>` – Environment (dev, stage, prod)
|
|
80
|
+
- `--deploy` – Deploy _Tamaro Core_ or a customer configuration bundle to AWS S3
|
|
77
81
|
- `--tag <tag>` – Tag which should be used for the deployment of the bundle (default: “latest”)
|
|
78
82
|
- `--profile <profile>` – AWS profile which should be used for the deployment of the bundle (default: “payments-prod-cs-deployer”)
|
|
79
83
|
|
|
@@ -110,41 +114,35 @@ cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
|
110
114
|
npx -y @raisenow/tamaro-cli build --serve
|
|
111
115
|
```
|
|
112
116
|
|
|
113
|
-
## `
|
|
114
|
-
|
|
115
|
-
Deploy a pre-built _Tamaro Core_ or customer configuration bundle to AWS S3.
|
|
116
|
-
|
|
117
|
-
### Options
|
|
118
|
-
|
|
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”)
|
|
117
|
+
## `serve`
|
|
121
118
|
|
|
122
|
-
|
|
119
|
+
Run a local web server for pre-built bundle.
|
|
123
120
|
|
|
124
121
|
### Example
|
|
125
122
|
|
|
126
|
-
1.
|
|
123
|
+
1. Build an optimised (minified) bundle of the _example-02-typical-customisations_ customer configuration
|
|
127
124
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
125
|
+
```bash
|
|
126
|
+
cd /path/to/tamaro-configurations/configs/example-02-typical-customisations
|
|
127
|
+
npx -y @raisenow/tamaro-cli build
|
|
128
|
+
```
|
|
132
129
|
|
|
133
|
-
2.
|
|
130
|
+
2. Serve it. After running this command, web-server should be running on http://localhost:1234 (port may differ, see console output).
|
|
134
131
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
132
|
+
```bash
|
|
133
|
+
npx -y @raisenow/tamaro-cli serve
|
|
134
|
+
```
|
|
138
135
|
|
|
139
|
-
|
|
136
|
+
## `deploy`
|
|
140
137
|
|
|
141
|
-
|
|
142
|
-
npx -y @raisenow/tamaro-cli deploy --tag WEB-123
|
|
143
|
-
```
|
|
138
|
+
Deploy a pre-built _Tamaro Core_ or customer configuration bundle to AWS S3.
|
|
144
139
|
|
|
145
|
-
|
|
140
|
+
### Options
|
|
146
141
|
|
|
147
|
-
|
|
142
|
+
- `--tag <tag>` – Tag which should be used for the deployment of the bundle (default: “latest”)
|
|
143
|
+
- `--profile <profile>` – AWS profile which should be used for the deployment of the bundle (default: “payments-prod-cs-deployer”)
|
|
144
|
+
|
|
145
|
+
Make sure you have built the bundle before deploying it with this command, otherwise you may mistakenly deploy the bundle from a previous build.
|
|
148
146
|
|
|
149
147
|
### Example
|
|
150
148
|
|
|
@@ -155,10 +153,16 @@ Run a local web server for pre-built bundle.
|
|
|
155
153
|
npx -y @raisenow/tamaro-cli build
|
|
156
154
|
```
|
|
157
155
|
|
|
158
|
-
2.
|
|
156
|
+
2. Deploy it
|
|
159
157
|
|
|
160
158
|
```bash
|
|
161
|
-
npx -y @raisenow/tamaro-cli
|
|
159
|
+
npx -y @raisenow/tamaro-cli deploy
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
3. Optionally, deploy it with the _WEB-123_ tag
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
npx -y @raisenow/tamaro-cli deploy --tag WEB-123
|
|
162
166
|
```
|
|
163
167
|
|
|
164
168
|
## `list-deployed`
|
|
@@ -214,10 +218,10 @@ Link package source to be able to run its local version:
|
|
|
214
218
|
npm link .
|
|
215
219
|
```
|
|
216
220
|
|
|
217
|
-
Run the `
|
|
221
|
+
Run the `build:watch` script to watch source files and automatically rebuild on changes. It must be running during the _Tamaro CLI_ development process.
|
|
218
222
|
|
|
219
223
|
```bash
|
|
220
|
-
npm run
|
|
224
|
+
npm run build:watch
|
|
221
225
|
```
|
|
222
226
|
|
|
223
227
|
To use the locally linked version of _Tamaro CLI_, use it without `@raisenow/` scope, `-y` flag is also not needed:
|
|
@@ -0,0 +1,249 @@
|
|
|
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
|
+
// node_modules/tsup/assets/esm_shims.js
|
|
19
|
+
import { fileURLToPath } from "url";
|
|
20
|
+
import path from "path";
|
|
21
|
+
var getFilename = () => fileURLToPath(import.meta.url);
|
|
22
|
+
var getDirname = () => path.dirname(getFilename());
|
|
23
|
+
var __dirname = /* @__PURE__ */ getDirname();
|
|
24
|
+
|
|
25
|
+
// src/lib/logging.ts
|
|
26
|
+
import chalk from "chalk";
|
|
27
|
+
import stripIndent from "strip-indent";
|
|
28
|
+
import columnify from "columnify";
|
|
29
|
+
var logTitle = (title) => {
|
|
30
|
+
console.log(`${chalk.bold(title)}`);
|
|
31
|
+
};
|
|
32
|
+
var logError = (message) => {
|
|
33
|
+
if (message) {
|
|
34
|
+
console.log(chalk.red(message));
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var logCommand = (cmd) => {
|
|
38
|
+
console.log(`
|
|
39
|
+
${chalk.dim(stripIndent(cmd).trim())}
|
|
40
|
+
`);
|
|
41
|
+
};
|
|
42
|
+
var logDataTable = (data) => {
|
|
43
|
+
console.log(columnify(data, { showHeaders: false }));
|
|
44
|
+
console.log("");
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// src/lib/resolve.ts
|
|
48
|
+
import { createRequire } from "module";
|
|
49
|
+
import { basename, dirname, join, relative, resolve } from "path";
|
|
50
|
+
import { existsSync, realpathSync } from "fs";
|
|
51
|
+
import { getIfUtils } from "webpack-config-utils";
|
|
52
|
+
import stripIndent2 from "strip-indent";
|
|
53
|
+
import chalk2 from "chalk";
|
|
54
|
+
var require2 = createRequire(import.meta.url);
|
|
55
|
+
var moduleFileExtensions = ["ts", "tsx", "js", "jsx"];
|
|
56
|
+
var extensions = moduleFileExtensions.map((v) => `.${v}`);
|
|
57
|
+
var TAMARO_CORE_PACKAGE_NAMES = ["@raisenow/tamaro-core"];
|
|
58
|
+
var TAMARO_CONFIGURATIONS_PACKAGE_NAMES = ["@raisenow/tamaro-configurations"];
|
|
59
|
+
var resolveApp = (relativePath) => resolve(realpathSync(process.cwd()), relativePath);
|
|
60
|
+
var resolveOwn = (relativePath) => resolve(__dirname, "..", relativePath);
|
|
61
|
+
var resolveModule = (resolveFn, filePath) => {
|
|
62
|
+
const extension = moduleFileExtensions.find((extension2) => existsSync(resolveFn(`${filePath}.${extension2}`)));
|
|
63
|
+
if (extension) {
|
|
64
|
+
return resolveFn(`${filePath}.${extension}`);
|
|
65
|
+
}
|
|
66
|
+
return resolveFn(`${filePath}.js`);
|
|
67
|
+
};
|
|
68
|
+
var resolveBin = (name) => {
|
|
69
|
+
const pkgPath = require2.resolve(`${name}/package.json`);
|
|
70
|
+
const { bin } = require2(pkgPath);
|
|
71
|
+
const dir = dirname(pkgPath);
|
|
72
|
+
const binPath = typeof bin === "object" ? bin[name] : bin;
|
|
73
|
+
return join(dir, binPath);
|
|
74
|
+
};
|
|
75
|
+
var getWidgetUuid = () => basename(resolveApp("."));
|
|
76
|
+
var getPaths = (ifCore) => {
|
|
77
|
+
return ifCore({
|
|
78
|
+
app: resolveApp("."),
|
|
79
|
+
appEntry: resolveModule(resolveApp, "src/index"),
|
|
80
|
+
appDist: resolveApp("dist"),
|
|
81
|
+
appNodeModules: resolveApp("node_modules"),
|
|
82
|
+
appTsConfig: resolveApp("tsconfig.json"),
|
|
83
|
+
appHtml: resolveApp("src/*.html"),
|
|
84
|
+
appEnv: resolveApp(".env*"),
|
|
85
|
+
appTailwindConfig: resolveApp("tailwind.config.js")
|
|
86
|
+
}, {
|
|
87
|
+
app: resolveApp("."),
|
|
88
|
+
appEntry: resolveModule(resolveApp, "widget"),
|
|
89
|
+
appDist: resolveApp(`../../dist/${getWidgetUuid()}`),
|
|
90
|
+
appNodeModules: resolveApp("../../node_modules"),
|
|
91
|
+
appTsConfig: resolveApp("tsconfig.json"),
|
|
92
|
+
appHtml: resolveApp("*.html"),
|
|
93
|
+
appEnv: resolveApp(".env*"),
|
|
94
|
+
appTailwindConfig: void 0
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
var getRelativePaths = (paths) => {
|
|
98
|
+
const relativePaths = {};
|
|
99
|
+
for (const [type, absPath] of Object.entries(paths)) {
|
|
100
|
+
if (absPath) {
|
|
101
|
+
relativePaths[type] = relative("./", absPath) || ".";
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return relativePaths;
|
|
105
|
+
};
|
|
106
|
+
var getIfCoreFns = () => {
|
|
107
|
+
const corePkgPath = resolveApp("package.json");
|
|
108
|
+
const configsPkgPath = resolveApp("../../package.json");
|
|
109
|
+
if (existsSync(corePkgPath)) {
|
|
110
|
+
const { name } = require2(corePkgPath);
|
|
111
|
+
if (TAMARO_CORE_PACKAGE_NAMES.includes(name)) {
|
|
112
|
+
return getIfUtils({ core: true }, ["core"]);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (existsSync(configsPkgPath)) {
|
|
116
|
+
const { name } = require2(configsPkgPath);
|
|
117
|
+
if (TAMARO_CONFIGURATIONS_PACKAGE_NAMES.includes(name)) {
|
|
118
|
+
return getIfUtils({ core: false }, ["core"]);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
logError(stripIndent2(` You must run "npx @raisenow/tamaro-cli" commands from:
|
|
122
|
+
1. Root of "${chalk2.bold(TAMARO_CORE_PACKAGE_NAMES[0])}" package folder.
|
|
123
|
+
2. Root of particular customer configuration folder of "${chalk2.bold(TAMARO_CONFIGURATIONS_PACKAGE_NAMES[0])}" package.
|
|
124
|
+
You are currently in "${chalk2.bold(realpathSync(process.cwd()))}".
|
|
125
|
+
`));
|
|
126
|
+
process.exit(1);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
// src/lib/env.ts
|
|
130
|
+
import { createRequire as createRequire2 } from "module";
|
|
131
|
+
import { basename as basename2 } from "path";
|
|
132
|
+
import glob from "glob";
|
|
133
|
+
import { expand as dotenvExpand } from "dotenv-expand";
|
|
134
|
+
import { config as dotenvConfig } from "dotenv";
|
|
135
|
+
import stripIndent3 from "strip-indent";
|
|
136
|
+
|
|
137
|
+
// src/lib/command.ts
|
|
138
|
+
import { execaCommandSync } from "execa";
|
|
139
|
+
var fail = (message) => {
|
|
140
|
+
logError(message);
|
|
141
|
+
process.exit(1);
|
|
142
|
+
};
|
|
143
|
+
var prepareCommand = (cmd) => {
|
|
144
|
+
return cmd.replace(/\n/gm, " ").replace(/[ \t]{2,}/gm, " ").trim();
|
|
145
|
+
};
|
|
146
|
+
var runCommandSync = (cmd, options) => {
|
|
147
|
+
return execaCommandSync(prepareCommand(cmd), options);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
// src/lib/env.ts
|
|
151
|
+
var require3 = createRequire2(import.meta.url);
|
|
152
|
+
var getEnvVars = (files, ifMin, ifCore, ifLocalCore) => {
|
|
153
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
154
|
+
const filePath = files.find((file) => basename2(file) === ".env");
|
|
155
|
+
dotenvExpand(dotenvConfig({ path: filePath }));
|
|
156
|
+
(_b = (_a = process.env).NODE_ENV) != null ? _b : _a.NODE_ENV = ifMin("production", "development");
|
|
157
|
+
(_d = (_c = process.env).BABEL_ENV) != null ? _d : _c.BABEL_ENV = ifMin("production", "development");
|
|
158
|
+
(_f = (_e = process.env).EXPOSE_VAR) != null ? _f : _e.EXPOSE_VAR = ifCore("rnw.tamaroCore", "rnw.tamaro");
|
|
159
|
+
(_h = (_g = process.env).ELEMENT_ATTRIBUTE_DATA_WIDGET) != null ? _h : _g.ELEMENT_ATTRIBUTE_DATA_WIDGET = ifCore("rnw-tamaro-core", "rnw-tamaro");
|
|
160
|
+
(_j = (_i = process.env).WEBPACK_UNIQUE_NAME) != null ? _j : _i.WEBPACK_UNIQUE_NAME = ifCore("RnwTamaroCore", "RnwTamaro");
|
|
161
|
+
process.env.BUILD_DATE = new Date().toISOString();
|
|
162
|
+
(_l = (_k = process.env).HMR_ENABLED) != null ? _l : _k.HMR_ENABLED = ifMin("false", "true");
|
|
163
|
+
if (ifCore()) {
|
|
164
|
+
process.env.PRODUCT_NAME = "tamaro";
|
|
165
|
+
const corePkgPath = resolveApp("package.json");
|
|
166
|
+
const { version } = require3(corePkgPath);
|
|
167
|
+
process.env.PRODUCT_VERSION = version;
|
|
168
|
+
}
|
|
169
|
+
if (!ifCore()) {
|
|
170
|
+
process.env.WIDGET_UUID = getWidgetUuid();
|
|
171
|
+
if (ifLocalCore()) {
|
|
172
|
+
process.env.CORE_URL = `http://0.0.0.0:1234/index.js`;
|
|
173
|
+
} else {
|
|
174
|
+
let version = process.env.CORE_VERSION;
|
|
175
|
+
version = version ? `@${version}` : "";
|
|
176
|
+
(_n = (_m = process.env).CORE_URL) != null ? _n : _m.CORE_URL = `https://cdn.jsdelivr.net/npm/@raisenow/tamaro-core${version}/dist/index.js`;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
const varNames = [
|
|
180
|
+
"NODE_ENV",
|
|
181
|
+
"BABEL_ENV",
|
|
182
|
+
"EXPOSE_VAR",
|
|
183
|
+
"ELEMENT_ATTRIBUTE_DATA_WIDGET",
|
|
184
|
+
"WEBPACK_UNIQUE_NAME",
|
|
185
|
+
"BUILD_DATE",
|
|
186
|
+
"PRODUCT_NAME",
|
|
187
|
+
"PRODUCT_VERSION",
|
|
188
|
+
"WIDGET_UUID",
|
|
189
|
+
"CORE_URL",
|
|
190
|
+
"CORE_VERSION",
|
|
191
|
+
"IS_CREDIT_CARD_IFRAME"
|
|
192
|
+
];
|
|
193
|
+
const raw = Object.keys(process.env).filter((key) => /^PUBLIC_/.test(key) || varNames.includes(key)).reduce((env, key) => {
|
|
194
|
+
env[key] = process.env[key];
|
|
195
|
+
return env;
|
|
196
|
+
}, {});
|
|
197
|
+
const stringified = {
|
|
198
|
+
"process.env": Object.keys(raw).reduce((env, key) => {
|
|
199
|
+
env[key] = JSON.stringify(raw[key]);
|
|
200
|
+
return env;
|
|
201
|
+
}, {})
|
|
202
|
+
};
|
|
203
|
+
return { raw, stringified };
|
|
204
|
+
};
|
|
205
|
+
var assertEnvValid = (env) => {
|
|
206
|
+
const { ifCore } = getIfCoreFns();
|
|
207
|
+
const paths = getPaths(ifCore);
|
|
208
|
+
const files = glob.sync(paths.appEnv);
|
|
209
|
+
const envs = files.map((file) => basename2(file).replace(/^\.env\.?/, "")).filter((v) => !!v);
|
|
210
|
+
if (envs.length === 0) {
|
|
211
|
+
if (env) {
|
|
212
|
+
console.log("Flag \u201C--env\u201D is ignored.");
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
if (envs.length !== 0) {
|
|
216
|
+
if (!env) {
|
|
217
|
+
fail("Flag \u201C--env\u201D is required.");
|
|
218
|
+
}
|
|
219
|
+
if (!envs.includes(env)) {
|
|
220
|
+
fail(stripIndent3(`
|
|
221
|
+
Flag \u201C--env\u201D has wrong value.
|
|
222
|
+
Available values are: ${envs.map((v) => `\u201C${v}\u201D`).join(", ")}.
|
|
223
|
+
`));
|
|
224
|
+
}
|
|
225
|
+
const filePath = files.find((file) => basename2(file) === `.env.${env}`);
|
|
226
|
+
dotenvExpand(dotenvConfig({ path: filePath }));
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export {
|
|
231
|
+
__spreadValues,
|
|
232
|
+
logTitle,
|
|
233
|
+
logError,
|
|
234
|
+
logCommand,
|
|
235
|
+
logDataTable,
|
|
236
|
+
moduleFileExtensions,
|
|
237
|
+
extensions,
|
|
238
|
+
resolveApp,
|
|
239
|
+
resolveOwn,
|
|
240
|
+
resolveBin,
|
|
241
|
+
getWidgetUuid,
|
|
242
|
+
getPaths,
|
|
243
|
+
getRelativePaths,
|
|
244
|
+
getIfCoreFns,
|
|
245
|
+
fail,
|
|
246
|
+
runCommandSync,
|
|
247
|
+
getEnvVars,
|
|
248
|
+
assertEnvValid
|
|
249
|
+
};
|