-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(genenv): Small CLI to generate typescript file exporting constan…
…ts from environment variables (#424)
- Loading branch information
1 parent
e70a098
commit 95aa5d1
Showing
12 changed files
with
1,478 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: GenEnv | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
pull_request: | ||
paths: | ||
- 'genenv/**' | ||
|
||
workflow_dispatch: {} | ||
|
||
defaults: | ||
run: | ||
working-directory: ./genenv | ||
|
||
jobs: | ||
genenv: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: 8.6.2 | ||
- run: pnpm install --frozen-lockfile | ||
- run: pnpm build | ||
- run: pnpm check:type | ||
- run: pnpm test | ||
- name: Publish | ||
if: github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' | ||
uses: botpress/gh-actions/publish-if-not-exists@master | ||
with: | ||
path: './genenv' | ||
token: '${{ secrets.NPM_ACCESS_TOKEN }}' |
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 @@ | ||
#!/usr/bin/env node | ||
require("./dist/index.js"); |
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,11 @@ | ||
import esbuild from 'esbuild' | ||
|
||
void esbuild.build({ | ||
entryPoints: ['./src/index.ts'], | ||
bundle: true, | ||
platform: 'node', | ||
format: 'cjs', | ||
external: [], | ||
outdir: './dist', | ||
sourcemap: true | ||
}) |
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,25 @@ | ||
{ | ||
"name": "@bpinternal/genenv", | ||
"version": "0.0.1", | ||
"description": "Small CLI to generate typescript file exporting constants from environment variables.", | ||
"bin": { | ||
"genenv": "./bin.js" | ||
}, | ||
"scripts": { | ||
"check:type": "tsc --noEmit", | ||
"dev": "ts-node -T ./src/index.ts", | ||
"build": "ts-node -T ./build.ts", | ||
"test": "vitest run" | ||
}, | ||
"dependencies": { | ||
"@bpinternal/yargs-extra": "0.0.14", | ||
"dotenv": "^16.4.4" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^22.7.5", | ||
"esbuild": "^0.16.12", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^4.9.4", | ||
"vitest": "^2.1.3" | ||
} | ||
} |
Oops, something went wrong.