Skip to content

Commit 15278a1

Browse files
authored
Merge pull request #91 from launchcodedev/standalone-project
Adds a standalone project for full tests of dependencies, and adds `json-schema` types explicitly
2 parents 5eaa945 + c29521b commit 15278a1

File tree

11 files changed

+103
-1
lines changed

11 files changed

+103
-1
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: standalone-project
2+
3+
on:
4+
push:
5+
branches: '*'
6+
7+
jobs:
8+
build:
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest]
12+
node-version: [14.x]
13+
14+
runs-on: ${{ matrix.os }}
15+
16+
defaults:
17+
run:
18+
working-directory: ./test-standalone-project
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: actions/setup-node@v1
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
26+
- run: yarn install && yarn build
27+
working-directory: ./app-config
28+
29+
- run: rm -rf ./node_modules ./app-config/node_modules
30+
working-directory: .
31+
32+
- run: yarn install
33+
- run: yarn build
34+
- run: node ./dist/index.js

app-config/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"@types/openpgp": "4",
4242
"@types/prompts": "2",
4343
"@types/readable-stream": "2",
44+
"@types/json-schema": "7",
4445
"@types/urijs": "1",
4546
"ajv": "7",
4647
"ajv-formats": "1",
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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
type: object
2+
additionalProperties: false
3+
4+
properties:
5+
propA:
6+
type: integer
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
propA: 42

test-standalone-project/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# don't commit lockfile, we want to test with latest
2+
yarn.lock

test-standalone-project/package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "test-standalone-project",
3+
"version": "0.0.0",
4+
"license": "MPL-2.0",
5+
"private": true,
6+
"main": "dist/index.js",
7+
"scripts": {
8+
"start": "node ./dist/index.js",
9+
"build": "tsc -b",
10+
"clean": "rm -rf dist *.tsbuildinfo",
11+
"lint": "echo",
12+
"fix": "echo",
13+
"test": "echo"
14+
},
15+
"dependencies": {
16+
"@lcdev/app-config": "file:../app-config"
17+
},
18+
"devDependencies": {
19+
"typescript": "*"
20+
}
21+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// AUTO GENERATED CODE
2+
// Run app-config with 'generate' command to regenerate this file
3+
4+
import '@lcdev/app-config';
5+
6+
export interface Config {
7+
propA?: number;
8+
}
9+
10+
// augment the default export from app-config
11+
declare module '@lcdev/app-config' {
12+
export interface ExportedConfig extends Config {}
13+
}

test-standalone-project/src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { config, loadConfig } from "@lcdev/app-config";
2+
3+
async function main() {
4+
await loadConfig();
5+
console.log(config);
6+
}
7+
8+
main();

test-standalone-project/tsconfig.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"compilerOptions": {
3+
"rootDir": "./src",
4+
"outDir": "./dist",
5+
"module": "commonjs",
6+
"moduleResolution": "node",
7+
"lib": ["es2015"],
8+
"target": "es2015",
9+
"strict": true,
10+
"esModuleInterop": true
11+
},
12+
"include": ["src/**/*"],
13+
"exclude": ["node_modules"]
14+
}

0 commit comments

Comments
 (0)