-
-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: create script for automatic creating `.env` file and update RE… * chore: create script for load env from CLI into `.env` * chore: create more validation for set_global_env.sh * fix: remove unnecessary else from copy_env.sh * chore: add `with-env` script to root package.json * chore: update readme Env Vars section * fix: remove type-check from build and remove cross-env where I've for… * chore: add move explanation about CLI env setting to README.md * chore: add node type for all modules tsconfig.json * chore: add patterns for globalEnv for turbo * chore: rename example env * chore: update README.md for new approach * chore: update set_global_env.sh script to the new prefixes CLI_CEB an… * chore: update README.md for new approach * chore: remove `with-env` and replace old env values * chore: rename CI env to new pattern * fix: change last forgotten __FIREFOX__ env * chore: create base-dev script and remove unnecessary staff from `e2e` * fix: add missing info for README.md * fix: add missing CLI_CEB_* pattern for turbo.json * fix: add missing(during conflicts resolving) `typescript` package to … * fix: rename index.ts to .mts for index of `zipper` and adjust to new env * feat: change CEB_DEV_LOCALE and isDev placeholders to real env values * fix: define env file for i18n prepare-build * fix: remove unnecessary noEmit from `chrome-extension` tsconfig * clean: remove unnecessary isFirefox from manifest.ts * fix: add missing "noEmit" for pre-build.tsconfig.json for chrome-exte… * clean: remove unnecessary import from make-manifest-plugin.ts * clean: remove unnecessary copy-env script from `set-global-env` script * feat: create global env object and new solution for dynamic env values * feat: update root README.md and move env part to env/README.md * chore: add CEB_CI to example.env * feat: change env module to be `module` (tsconfig) * feat: changes refs from `process.env` to `env` from package * chore: create base-build script and restart cli envs on build * feat: create zipper as `module` (tsconfig) and add new env values * fix: resolve pnpm-lock.yaml conflicts * fix: remove unused `esbuild` package * fix: issue with node packages polyfilling * feat: restructure env module * fix: adjust env call to new approach (with only process.env) * fix: rename `consts` to `const` for `env` module * docs: change README.md to solution with process.env * clean: remove unnecessary values from wdio.browser.conf.ts
- Loading branch information
1 parent
f6cfe9f
commit 2b9f85e
Showing
56 changed files
with
1,254 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
VITE_EXAMPLE=example | ||
CEB_DEV_LOCALE= | ||
CEB_EXAMPLE=example_env | ||
CEB_DEV_LOCALE= | ||
CEB_CI= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
# Check if .env does not exist and .example.env exists | ||
if [ ! -f ".env" ] && [ -f ".example.env" ]; then | ||
# Copy .example.env to .env | ||
cp .example.env .env | ||
echo ".example.env has been copied to .env" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Environment Package | ||
|
||
This package contains code which creates env values. | ||
To use the code in the package, you need to follow those steps: | ||
|
||
1. Add a new record to `.env` (NEED TO CONTAIN `CEB_` PREFIX), | ||
|
||
- If you want via cli: | ||
- Add it as argument like: `pnpm set-global-env CLI_CEB_NEXT_VALUE=new_data ...` (NEED TO CONTAIN `CLI_CEB_` PREFIX) | ||
|
||
> [!IMPORTANT] | ||
> `CLI_CEB_DEV` and `CLI_CEB_FIREFOX` are `false` by default \ | ||
> All CLI values are overwriting in each call, that's mean you'll have access to values from current script run only. | ||
- If you want dynamic variables go to `lib/index.ts` and edit `dynamicEnvValues` object. | ||
|
||
2. Use it, for example: | ||
```ts | ||
console.log(process.env['CEB_EXAMPLE']); | ||
``` | ||
or | ||
```ts | ||
console.log(process.env.CEB_EXAMPLE); | ||
``` | ||
but with first solution, autofill should work for IDE: | ||
 | ||
3. You are also able to import const like `IS_DEV` from `@extension/env` like: | ||
```ts | ||
import { IS_DEV } from '@extension/env'; | ||
``` | ||
For more look [ENV CONST](lib/const.ts) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.