8000 Allow importing "vault-env/$SUBMODULE" · faradayio/vault-env-js@c31dd31 · GitHub
[go: up one dir, main page]

Skip to content

Commit c31dd31

Browse files
committed
Allow importing "vault-env/$SUBMODULE"
This package exports multiple modules which are intended to be required separately. This is a bit tricky with TypeScript: microsoft/TypeScript#8305 microsoft/TypeScript#33079 The only way to make this work is to get rid of the "./src" and "./dist" directories and dump everything at the top level. Ick.
1 parent 5127d63 commit c31dd31

File tree

13 files changed

+24
-16
lines changed

13 files changed

+24
-16
lines changed

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
/dist
1+
*.d.ts
2+
*.js
23
/node_modules
34
/.eslintrc.js

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/node_modules/
2-
/dist/
2+
*.d.ts
3+
*.js

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/node_modules/
2-
/dist/
2+
*.d.ts
3+
*.js
34
/coverage/

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Changed
1111

1212
- All `Secretfile` entries must now have the form `VAR_NAME path/to/secret:key`. We no longer support values which are missing `:key`, or which have or nested `:key1:key1`.
13+
- The return type of `parseSecretfile` has changed.
1314
- The code has been ported to TypeScript.
1415
- All dependencies have been updated.

src/cli.ts renamed to cli.ts

File renamed without changes.

src/local.ts renamed to local.ts

File renamed without changes.

src/main.ts renamed to main.ts

File renamed without changes.

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22
"name": "vault-env",
33
"version": "4.3.1",
44
"description": "Put your vault secrets in your process.env",
5-
"main": "dist/src/main.js",
6-
"types": "dist/src/main.d.ts",
5+
"main": "main.js",
6+
"types": "main.d.ts",
77
"files": [
8-
"dist/src/**/*.d.ts",
9-
"dist/src/**/*.js"
8+
"*.d.ts",
9+
"*.js"
1010
],
1111
"scripts": {
12+
"clean": "rm -f *.d.ts *.js test/*.d.ts test/index.js test/fakeVault*.js",
1213
"build": "tsc",
1314
"fmt": "prettier --write .",
14-
"lint": "eslint src/**/*.ts test/**/*.ts",
15-
"prepublish": "rm -rf dist && npm run build",
15+
"lint": "eslint *.ts test/**/*.ts",
16+
"prepublishOnly": "npm run clean && npm run build",
1617
"test": "mocha -r ts-node/register test/index.ts"
1718
},
1819
"bin": {
19-
"vault-env": "dist/src/cli.js"
20+
"vault-env": "cli.js"
2021
},
2122
"keywords": [
2223
"vault",

src/parseSecretfile.ts renamed to parseSecretfile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import assert from "assert";
1+
import assert = require("assert");
22

33
const SECRETFILE_PATTERN = /^([a-zA-Z_][a-zA-Z0-9_]+)\s+([^:\s]+):(.+)$/;
44
const SECRETFILE_COMMENT_PATTERN = /(^#)|(^\s*$)/;
File renamed without changes.

0 commit comments

Comments
 (0)
0