Skip to content

Commit e63aed4

Browse files
committed
feat: better standalone project testing
1 parent 462b040 commit e63aed4

File tree

6 files changed

+18
-3
lines changed

6 files changed

+18
-3
lines changed

.github/workflows/standalone-project.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ jobs:
2727
- run: yarn build
2828
- run: node ./dist/index.js
2929
- run: yarn app-config -v
30+
- run: yarn app-config c
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
generate:
2+
- file: ./src/app-config.d.ts
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
type: object
2+
additionalProperties: false
3+
required: [propA]
4+
5+
properties:
6+
propA:
7+
type: string
8+
format: uri
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
propA: 'http://example.com'

tests/standalone-project/src/app-config.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import '@app-config/main';
55

66
export interface Config {
7-
propA?: number;
7+
propA: string;
88
}
99

1010
// augment the default export from app-config

tests/standalone-project/src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
import { config, loadConfig } from "@app-config/main";
1+
import { config, loadConfig } from '@app-config/main';
22

33
async function main() {
44
await loadConfig();
55
console.log(config);
66
}
77

8-
main();
8+
main().catch((err) => {
9+
console.error(err);
10+
process.exit(1);
11+
});

0 commit comments

Comments
 (0)