Skip to content

Commit

Permalink
feat: revisit the build process
Browse files Browse the repository at this point in the history
  • Loading branch information
XVincentX committed Feb 8, 2019
1 parent fad249c commit d7d307f
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 64 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"setup": "yarn",
"fmt": "prettier --write \"packages/*/src/**/*.{ts,js}\"",
"lint": "tslint packages/*/src/**/*.{ts}",
"build": "tsc --build tsconfig.all.json",
"build": "tsc --build ./packages/tsconfig.build.json",
"build.clean": "find ./packages -name lib -type d -exec rm -rf {} \\;",
"build.watch": "yarn build.clean && tsc --build --watch tsconfig.all.json",
"build.watch": "yarn build.clean && tsc --build --watch ./packages/tsconfig.build.json",
"test": "yarn lint && yarn test.fast",
"pretest.fast": "yarn build",
"test.fast": "jest --env=node --maxWorkers=2",
Expand Down
13 changes: 13 additions & 0 deletions packages/cli/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "../tsconfig.build.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib"
},
"include": ["src"],
"references": [
{
"path": "../http-server/tsconfig.build.json"
}
]
}
15 changes: 4 additions & 11 deletions packages/cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"target": "es2017"
},
"include": [
"src/**/*"
],
"references": [
{ "path": "../http-server" }
]
"module":"commonjs",
"moduleResolution": "node"
}
}
8 changes: 8 additions & 0 deletions packages/core/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.build.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib"
},
"include": ["src"],
}
11 changes: 4 additions & 7 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
},
"include": [
"src/**/*"
]
"module":"commonjs",
"moduleResolution": "node"
}
}
8 changes: 8 additions & 0 deletions packages/http-server/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.build.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib"
},
"include": ["src"],
}
20 changes: 4 additions & 16 deletions packages/http-server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"composite": true
},
"include": [
"src/**/*"
],
"references": [
{
"path": "../core"
},
{
"path": "../http"
}
]
"module":"commonjs",
"moduleResolution": "node"
}
}
8 changes: 8 additions & 0 deletions packages/http/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.build.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib"
},
"include": ["src"],
}
17 changes: 4 additions & 13 deletions packages/http/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"composite": true
},
"include": [
"src/**/*"
],
"references": [
{
"path": "../core"
}
]
"module":"commonjs",
"moduleResolution": "node"
}
}
10 changes: 2 additions & 8 deletions packages/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"exclude": ["**/node_modules", "**/__tests__", "**/fixtures"],
"compilerOptions": {
"composite": true,
"sourceMap": true,
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"allowUnreachableCode": false,
"forceConsistentCasingInFileNames": true,
Expand All @@ -17,14 +14,11 @@
"pretty": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"listFiles": true,
"target": "es5",
"module": "commonjs",
"importHelpers": true,
"lib": ["dom", "es6", "es7"],
"noUnusedParameters": true,
"allowSyntheticDefaultImports": false,
"declaration": true,
"resolveJsonModule": true
"resolveJsonModule": true,
"target": "es5"
}
}
31 changes: 31 additions & 0 deletions packages/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"extends": "./tsconfig.base.json",
"exclude": [
"**/node_modules",
"**/__tests__",
"**/fixtures"
],
"compilerOptions": {
"composite": true,
"sourceMap": true,
"declaration": true,
"declarationMap": true,
"moduleResolution": "node",
"target": "es5",
"module": "commonjs",
},
"references": [
{
"path": "cli/tsconfig.build.json"
},
{
"path": "core/tsconfig.build.json"
},
{
"path": "http/tsconfig.build.json"
},
{
"path": "http-server/tsconfig.build.json"
}
]
}
17 changes: 10 additions & 7 deletions packages/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"files": [],
"references": [
{ "path": "packages/core" },
{ "path": "packages/cli" },
{ "path": "packages/http" },
{ "path": "packages/http-server" }
]
"extends": "./tsconfig.base.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@stoplight/prism-core": ["core/src/index.ts"],
"@stoplight/prism-cli": ["cli/src/index.ts"],
"@stoplight/prism-http": ["http/src/index.ts"],
"@stoplight/prism-http-server": ["http-server/src/index.ts"],
}
}
}

0 comments on commit d7d307f

Please sign in to comment.