Skip to content

Commit

Permalink
feat!: support single executable applications ($1424)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: dotenv is a dependency instead of a peer dependency

closes: #1421
  • Loading branch information
soc221b authored and Ernest committed Sep 1, 2024
1 parent fb5df78 commit d6dfbb2
Show file tree
Hide file tree
Showing 106 changed files with 71 additions and 4,585 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ jobs:
- "@vue+cli@5-example"
- "angular-webpack-example"
- "babel-starter-example"
- "compatibility-example"
- "create-next-app-example"
- "create-react-app-example"
- "create-vue-app-example"
Expand Down
1 change: 0 additions & 1 deletion diff/after-using-import-meta-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
},
"devDependencies": {
"cross-env": "^7.0.3",
"dotenv": "^16.0.3",
"html-webpack-plugin": "^5.5.0",
"serve": "^14.2.0",
"webpack": "^5.75.0",
Expand Down
14 changes: 1 addition & 13 deletions docs/guide/getting-started/runtime-transform.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,4 @@ For more information, see [API](/api.html#import-meta-env-cli).

### Without Node.js

Since your application may be deployed on a system that doesn't have Node.js installed, you can use [pkg](https://github.com/vercel/pkg) to package the `import-meta-env` script into a standalone binary.

For example, you may host your application on a [Alpine Linux nginx image](https://hub.docker.com/_/nginx)):

```bash
$ npx pkg ./node_modules/@import-meta-env/cli/bin/import-meta-env.js \
--target node18-alpine-x64 \
--output import-meta-env-alpine
```

```bash
$ ./import-meta-env-alpine -x .env.example
```
The [Single executable applications](https://nodejs.org/api/single-executable-applications.html#single-executable-applications) feature allows the distribution of a Node.js application conveniently to a system that does not have Node.js installed, you could use it to package the `import-meta-env` script into a `node` binary.
6 changes: 3 additions & 3 deletions packages/babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"main": "dist/index.js",
"scripts": {
"build": "rimraf dist bin && pnpm build-bundle",
"build-bundle": "esbuild src/index.ts --bundle --platform=node --target=node14 --external:vite --external:dotenv --outfile=dist/index.js",
"build-bundle": "esbuild src/index.ts --bundle --platform=node --target=node14 --external:vite --outfile=dist/index.js",
"pack": "rm -f *.tgz && pnpm pack && node ../../scripts/rename-tgz.js",
"postinstall": "node -e \"try{require('./scripts/postinstall')}catch(e){}\"",
"release": "standard-version --skip.tag -t babel --preset=conventionalcommits --releaseCommitMessageFormat 'chore(release): @import-meta-env/babel@{{currentTag}}' --path .",
Expand All @@ -30,8 +30,7 @@
"homepage": "https://github.com/runtime-env/import-meta-env/tree/main/packages/babel#readme",
"peerDependencies": {
"@babel/core": "^7.0.0-0",
"@import-meta-env/cli": "^0.5.1 || ^0.6.0",
"dotenv": "^11.0.0 || ^12.0.4 || ^13.0.1 || ^14.3.2 || ^15.0.1 || ^16.0.0"
"@import-meta-env/cli": "^0.5.1 || ^0.6.0"
},
"peerDependenciesMeta": {
"@import-meta-env/cli": {
Expand All @@ -40,6 +39,7 @@
},
"dependencies": {
"@babel/helper-plugin-utils": "^7.19.0",
"dotenv": "^16.0.0",
"picocolors": "^1.0.0"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],
"scripts": {
"build": "rimraf bin && pnpm build-cli",
"build-cli": "esbuild src/index.ts --bundle --platform=node --target=node14 --external:dotenv --outfile=bin/import-meta-env.js && node ./scripts/patchBin.js",
"build-cli": "esbuild src/index.ts --bundle --platform=node --target=node14 --outfile=bin/import-meta-env.js && node ./scripts/patchBin.js",
"pack": "rm -f *.tgz && pnpm pack && node ../../scripts/rename-tgz.js",
"release": "standard-version --skip.tag -t cli --preset=conventionalcommits --releaseCommitMessageFormat 'chore(release): @import-meta-env/cli@{{currentTag}}' --path .",
"test": "jest src/__tests__"
Expand All @@ -40,8 +40,7 @@
"peerDependencies": {
"@import-meta-env/babel": "^0.4.3",
"@import-meta-env/swc": "^0.4.5",
"@import-meta-env/unplugin": "^0.4.8 || ^0.5.0",
"dotenv": "^11.0.0 || ^12.0.4 || ^13.0.1 || ^14.3.2 || ^15.0.1 || ^16.0.0"
"@import-meta-env/unplugin": "^0.4.8 || ^0.5.0"
},
"peerDependenciesMeta": {
"@import-meta-env/babel": {
Expand All @@ -56,6 +55,7 @@
},
"dependencies": {
"commander": "12.1.0",
"dotenv": "^16.0.0",
"glob": "11.0.0",
"picocolors": "1.0.1",
"serialize-javascript": "6.0.2"
Expand Down
16 changes: 0 additions & 16 deletions packages/examples/@vue+cli@4-example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/examples/@vue+cli@4-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"@vue/cli-plugin-babel": "~4.5.15",
"@vue/cli-service": "~4.5.15",
"cross-env": "^7.0.3",
"dotenv": "^16.0.0",
"rimraf": "^3.0.2",
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
Expand Down
16 changes: 0 additions & 16 deletions packages/examples/@vue+cli@5-example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/examples/@vue+cli@5-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"cross-env": "^7.0.3",
"dotenv": "^16.0.0",
"rimraf": "^3.0.2"
},
"browserslist": [
Expand Down
16 changes: 0 additions & 16 deletions packages/examples/angular-webpack-example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/examples/angular-webpack-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@types/jasmine": "~4.0.0",
"@types/node": "^18.19.26",
"cross-env": "^7.0.3",
"dotenv": "^16.0.3",
"jasmine-core": "~4.3.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
Expand Down
16 changes: 0 additions & 16 deletions packages/examples/babel-starter-example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/examples/babel-starter-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"@babel/preset-env": "^7.16.11",
"concurrently": "7.0.0",
"cross-env": "^7.0.3",
"dotenv": "^16.0.3",
"rimraf": "^3.0.2"
}
}

This file was deleted.

5 changes: 0 additions & 5 deletions packages/examples/compatibility-example/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion packages/examples/compatibility-example/README.md

This file was deleted.

Loading

0 comments on commit d6dfbb2

Please sign in to comment.