@import-meta-env/babel
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -101,6 +101,16 @@ var __create = Object.create; | ||
// ../vite/src/env.ts | ||
// ../shared/constant.ts | ||
var virtualFile = "import-meta-env"; | ||
var virtualId = "\0" + virtualFile; | ||
var uniqueVariableName = (() => { | ||
const uniqueVariableName2 = "import_meta_env_unique_id_"; | ||
return uniqueVariableName2 + Array(256 - uniqueVariableName2.length).fill("x").join(""); | ||
})(); | ||
var envFilePath = ".env"; | ||
var envExampleFilePath = ".env.example"; | ||
// ../shared/resolve-env.ts | ||
var import_dotenv = require("dotenv"); | ||
var import_picocolors = __toESM(require_picocolors()); | ||
var resolve = ({ | ||
var resolveEnv = ({ | ||
envFilePath: envFilePath2, | ||
@@ -154,12 +164,2 @@ envExampleFilePath: envExampleFilePath2 | ||
// ../vite/src/shared.ts | ||
var virtualFile = "import-meta-env"; | ||
var virtualId = "\0" + virtualFile; | ||
var uniqueVariableName = (() => { | ||
const uniqueVariableName2 = "import_meta_env_unique_id_"; | ||
return uniqueVariableName2 + Array(256 - uniqueVariableName2.length).fill("x").join(""); | ||
})(); | ||
var envFilePath = ".env"; | ||
var envExampleFilePath = ".env.example"; | ||
// src/index.ts | ||
@@ -170,3 +170,3 @@ function importMetaEnvBabelPlugin({ | ||
}) { | ||
const env = resolve({ | ||
const env = resolveEnv({ | ||
envFilePath, | ||
@@ -173,0 +173,0 @@ envExampleFilePath |
{ | ||
"name": "@import-meta-env/babel", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Load environment variables into import.meta.env object", | ||
@@ -21,20 +21,17 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@babel/core": "^7.17.5", | ||
"dotenv": "^11.0.0 || ^12.0.4 || ^13.0.1 || ^14.3.2 || ^15.0.1 || ^16.0.0", | ||
"esbuild": "^0.14.11", | ||
"rimraf": "^3.0.2", | ||
"standard-version": "^9.3.2", | ||
"typescript": "^4.5.4", | ||
"vite": "^2.7.13" | ||
"dotenv": "^11.0.0 || ^12.0.4 || ^13.0.1 || ^14.3.2 || ^15.0.1 || ^16.0.0" | ||
}, | ||
"peerDependencies": { | ||
"dotenv": "^11.0.0 || ^12.0.4 || ^13.0.1 || ^14.3.2 || ^15.0.1 || ^16.0.0", | ||
"vite": "^2.7.13" | ||
"dotenv": "^11.0.0 || ^12.0.4 || ^13.0.1 || ^14.3.2 || ^15.0.1 || ^16.0.0" | ||
}, | ||
"dependencies": { | ||
"picocolors": "^1.0.0" | ||
}, | ||
"scripts": { | ||
"build": "rimraf dist bin && pnpm build-bundle", | ||
"build-bundle": "esbuild src/index.ts --bundle --platform=node --target=node12 --external:vite --external:dotenv --outfile=dist/index.js", | ||
"release": "standard-version -t babel --releaseCommitMessageFormat 'chore(release): @import-meta-env/babel@{{currentTag}}' --path . && pnpm build" | ||
"release": "standard-version -t babel --releaseCommitMessageFormat 'chore(release): @import-meta-env/babel@{{currentTag}}' --path . && pnpm build", | ||
"test": "echo \"no test\"" | ||
}, | ||
"readme": "# @import-meta-env/babel\n\n[![CI](https://github.com/iendeavor/import-meta-env/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/iendeavor/import-meta-env/actions/workflows/ci.yml)\n[![NPM version](https://img.shields.io/npm/v/@import-meta-env/babel.svg)](https://www.npmjs.com/package/@import-meta-env/babel)\n[![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n\nThis plugin is intended to provide an approximation of some of [@import-meta-env/vite](https://github.com/iendeavor/import-meta-env/tree/develop/packages/vite) specific transformations when running the code in other environments, for example, running tests with a NodeJS based test runner.\n\nâ The functionality within these transformations should not be relied upon in production.\n\n## đ Quick Start\n\nInstall and register the plugin:\n\n```sh\n$ npm i dotenv @import-meta-env/babel\n```\n\n```js\n// babel.config.js\nmodule.exports = {\n plugins: [\"module:@import-meta-env/babel\"],\n};\n```\n\nAdjust the test script in your package.json:\n\n```json\n{\n \"scripts\": {\n // If you have a `.env` file:\n \"test\": \"your-test-script\",\n // If you don't have a `.env` file:\n \"test\": \"cross-env S3_BUCKET=YOURS3BUCKET your-test-script\"\n }\n}\n```\n\nSee also:\n\n- [examples](./examples)\n- [@import-meta-env/vite](https://github.com/iendeavor/import-meta-env/tree/main/packages/vite) - Inject environment variables into the import.meta.env object after building the application instead of statically replacing it during production.\n" | ||
"readme": "# @import-meta-env/babel\n\n[![CI](https://github.com/iendeavor/import-meta-env/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/iendeavor/import-meta-env/actions/workflows/ci.yml)\n[![NPM version](https://img.shields.io/npm/v/@import-meta-env/babel.svg)](https://www.npmjs.com/package/@import-meta-env/babel)\n[![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n\nThis plugin is intended to provide an approximation of some of [import-meta-env](https://github.com/iendeavor/import-meta-env) specific transformations when running the code in other environments, for example, running tests with a NodeJS based test runner.\n\nâ The functionality within these transformations should not be relied upon in production.\n\n<br>\n\nThis project use [SemVer](https://semver.org/) for versioning. For the versions available, see the tags on this repository.\n\n## đ Quick Start\n\nInstall and register the plugin:\n\n```sh\n$ npm i @import-meta-env/babel\n```\n\n```js\n// babel.config.js\nmodule.exports = {\n plugins: [\"module:@import-meta-env/babel\"],\n};\n```\n\nAdjust scripts in your package.json or elsewhere:\n\n```json\n{\n \"scripts\": {\n // If you have a `.env` file:\n \"foo\": \"foo\",\n // If you don't have a `.env` file:\n \"foo\": \"cross-env S3_BUCKET=YOURS3BUCKET foo\"\n }\n}\n```\n\nSee also:\n\n- [examples](./examples)\n- [@import-meta-env/cli](https://github.com/iendeavor/import-meta-env/tree/main/packages/cli) - A binary package is used to inject environment variables into those placeholders.\n- [@import-meta-env/unplugin](https://github.com/iendeavor/import-meta-env/tree/main/packages/unplugin) - Inject environment variables into the import.meta.env object after building the application instead of statically replacing it during production.\n\n## đ License\n\nThis project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details\n" | ||
} |
@@ -7,6 +7,10 @@ # @import-meta-env/babel | ||
This plugin is intended to provide an approximation of some of [@import-meta-env/vite](https://github.com/iendeavor/import-meta-env/tree/develop/packages/vite) specific transformations when running the code in other environments, for example, running tests with a NodeJS based test runner. | ||
This plugin is intended to provide an approximation of some of [import-meta-env](https://github.com/iendeavor/import-meta-env) specific transformations when running the code in other environments, for example, running tests with a NodeJS based test runner. | ||
â The functionality within these transformations should not be relied upon in production. | ||
<br> | ||
This project use [SemVer](https://semver.org/) for versioning. For the versions available, see the tags on this repository. | ||
## đ Quick Start | ||
@@ -17,3 +21,3 @@ | ||
```sh | ||
$ npm i dotenv @import-meta-env/babel | ||
$ npm i @import-meta-env/babel | ||
``` | ||
@@ -28,3 +32,3 @@ | ||
Adjust the test script in your package.json: | ||
Adjust scripts in your package.json or elsewhere: | ||
@@ -35,5 +39,5 @@ ```json | ||
// If you have a `.env` file: | ||
"test": "your-test-script", | ||
"foo": "foo", | ||
// If you don't have a `.env` file: | ||
"test": "cross-env S3_BUCKET=YOURS3BUCKET your-test-script" | ||
"foo": "cross-env S3_BUCKET=YOURS3BUCKET foo" | ||
} | ||
@@ -46,2 +50,7 @@ } | ||
- [examples](./examples) | ||
- [@import-meta-env/vite](https://github.com/iendeavor/import-meta-env/tree/main/packages/vite) - Inject environment variables into the import.meta.env object after building the application instead of statically replacing it during production. | ||
- [@import-meta-env/cli](https://github.com/iendeavor/import-meta-env/tree/main/packages/cli) - A binary package is used to inject environment variables into those placeholders. | ||
- [@import-meta-env/unplugin](https://github.com/iendeavor/import-meta-env/tree/main/packages/unplugin) - Inject environment variables into the import.meta.env object after building the application instead of statically replacing it during production. | ||
## đ License | ||
This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14767
1
4
52
3
+ Addedpicocolors@^1.0.0
- Removed@esbuild/linux-loong64@0.14.54(transitive)
- Removedesbuild@0.14.54(transitive)
- Removedesbuild-android-64@0.14.54(transitive)
- Removedesbuild-android-arm64@0.14.54(transitive)
- Removedesbuild-darwin-64@0.14.54(transitive)
- Removedesbuild-darwin-arm64@0.14.54(transitive)
- Removedesbuild-freebsd-64@0.14.54(transitive)
- Removedesbuild-freebsd-arm64@0.14.54(transitive)
- Removedesbuild-linux-32@0.14.54(transitive)
- Removedesbuild-linux-64@0.14.54(transitive)
- Removedesbuild-linux-arm@0.14.54(transitive)
- Removedesbuild-linux-arm64@0.14.54(transitive)
- Removedesbuild-linux-mips64le@0.14.54(transitive)
- Removedesbuild-linux-ppc64le@0.14.54(transitive)
- Removedesbuild-linux-riscv64@0.14.54(transitive)
- Removedesbuild-linux-s390x@0.14.54(transitive)
- Removedesbuild-netbsd-64@0.14.54(transitive)
- Removedesbuild-openbsd-64@0.14.54(transitive)
- Removedesbuild-sunos-64@0.14.54(transitive)
- Removedesbuild-windows-32@0.14.54(transitive)
- Removedesbuild-windows-64@0.14.54(transitive)
- Removedesbuild-windows-arm64@0.14.54(transitive)
- Removedfsevents@2.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedis-core-module@2.15.1(transitive)
- Removednanoid@3.3.7(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpostcss@8.4.49(transitive)
- Removedresolve@1.22.8(transitive)
- Removedrollup@2.77.3(transitive)
- Removedsource-map-js@1.2.1(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedvite@2.9.18(transitive)