@appshell/cli 0.8.1-alpha.2 → 0.9.0

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 CHANGED
@@ -258,17 +258,16 @@ Generate the runtime environment js file that reflects the current process.env
258
258
  Options:
259
259
  --help Show help [boolean]
260
260
  --version Show version number [boolean]
261
- -e, --env The .env file to process [string] [default: ".env"]
262
261
  -o, --outDir Output location for the appshell environment js [string] [default: "."]
263
262
  -f, --outFile Output filename for the appshell environment js [string] [default: "appshell.env.js"]
264
- -p, --prefix Only capture environment variables that start with prefix [string] [default: ""]
263
+ -p, --prefix Only capture environment variables that start with prefix or regex [string] [default: ""]
265
264
  -g, --globalName Global variable name window[globalName] used in the output js [string] [default: "__appshell_env__"]
266
265
  ```
267
266
 
268
267
  ### Sample usage
269
268
 
270
269
  ```bash
271
- appshell generate env -e .env --prefix APPSHELL_ --outDir dist
270
+ appshell generate env --prefix APPSHELL_ --outDir dist
272
271
  ```
273
272
 
274
273
  Sample output `appshell.env.js`
@@ -280,6 +279,22 @@ window.__appshell_env__ = {
280
279
  };
281
280
  ```
282
281
 
282
+ ### Using regex to match prefix
283
+
284
+ ```bash
285
+ appshell generate env --prefix '^(APPSHELL_|FOO_).*' --outDir dist
286
+ ```
287
+
288
+ Sample output `appshell.env.js`
289
+
290
+ ```js
291
+ window.__appshell_env__ = {
292
+ APPSHELL_VAR_1 = 'val 1',
293
+ APPSHELL_VAR_2 = 'val 2',
294
+ FOO_VAR = 'some value'
295
+ };
296
+ ```
297
+
283
298
  Include in the public html
284
299
 
285
300
  ```html