Skip to content

Commit

Permalink
chore: use single tsc build and move types to monorepo root (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
zamotany committed Nov 4, 2019
1 parent 00e20d2 commit bcbcf38
Show file tree
Hide file tree
Showing 26 changed files with 286 additions and 557 deletions.
12 changes: 5 additions & 7 deletions .circleci/config.yml
Expand Up @@ -44,13 +44,12 @@ jobs:
path: coverage
destination: coverage

lint_and_typecheck_node_10:
lint_node_10:
executor: node_10
steps:
- attach_workspace:
at: ~/haul_node_10
- run: yarn lint
- run: yarn typecheck

unit_test_node_10:
executor: node_10
Expand Down Expand Up @@ -170,13 +169,12 @@ jobs:
root: .
paths: .

lint_and_typecheck_node_latest:
lint_node_latest:
executor: node_latest
steps:
- attach_workspace:
at: ~/haul_node_latest
- run: yarn lint
- run: yarn typecheck

unit_test_node_latest:
executor: node_latest
Expand All @@ -192,7 +190,7 @@ workflows:
jobs:
# Node 10 jobs
- setup_node_10
- lint_and_typecheck_node_10:
- lint_node_10:
requires:
- setup_node_10
- unit_test_node_10:
Expand Down Expand Up @@ -224,7 +222,7 @@ workflows:
- setup_node_10
- check_coverage:
requires:
- lint_and_typecheck_node_10
- lint_node_10
- unit_test_node_10
- e2e_rn_0_59x
- e2e_rn_0_60x
Expand All @@ -236,7 +234,7 @@ workflows:

# Node (latest) jobs
- setup_node_latest
- lint_and_typecheck_node_latest:
- lint_node_latest:
requires:
- setup_node_latest
- unit_test_node_latest:
Expand Down
13 changes: 8 additions & 5 deletions .eslintrc
@@ -1,8 +1,11 @@
{
"extends": "@callstack/eslint-config/node",
"rules": {
"import/no-extraneous-dependencies": [2, {
"devDependencies": ["**/types.ts", "**/*.test.ts"]
}]
}
"overrides": [
{
"files": ["**/types.ts", "**/*.test.ts"],
"rules": {
"import/no-extraneous-dependencies": 0
}
}
]
}
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -93,4 +93,5 @@ dist/
.vscode/
.DS_Store
.coverage_output
fixtures/node_modules/
fixtures/node_modules/
**/tsconfig.tsbuildinfo
Expand Up @@ -57,6 +57,6 @@ test('RNWTestApp renders correctly', async () => {

expect(await getByTestId('app1')).toBeDefined();
expect(await (await getByTestId('app1LoadTime')).text()).toMatch(/Load time: ([1-9]|[0-9]{2}) ms/);

expect(await getByTestId('films')).toBeDefined();
});
57 changes: 51 additions & 6 deletions package.json
Expand Up @@ -5,19 +5,24 @@
],
"scripts": {
"lint": "eslint --ext '.js,.ts' './packages'",
"build:source": "lerna exec --parallel \"babel src --out-dir build --extensions .js,.ts,.tsx --source-maps --delete-dir-on-start --config-file=../../babel.config.js\"",
"watch": "lerna exec --parallel \"babel src --out-dir build --extensions .js,.ts,.tsx --source-maps --delete-dir-on-start --config-file=../../babel.config.js --watch\"",
"build:def": "lerna exec --ignore @haul-bundler/core-legacy \"tsc --emitDeclarationOnly -p ./tsconfig.json --outDir ./build\"",
"prepare": "yarn build:source && yarn build:def",
"typecheck": "tsc --noEmit",
"test": "jest",
"clean": "rm -rf ./packages/*/build ./packages/*/tsconfig.tsbuildinfo",
"watch": "yarn clean && concurrently \"yarn:watch:source\" \"yarn:watch:ts\"",
"build:source": "lerna exec --parallel \"babel src --out-dir build --extensions .js,.ts,.tsx --source-maps --config-file=../../babel.config.js\"",
"watch:source": "lerna exec --parallel \"babel src --out-dir build --extensions .js,.ts,.tsx --source-maps --config-file=../../babel.config.js --watch\"",
"build:ts": "node ./scripts/build_ts.js",
"watch:ts": "node ./scripts/build_ts.js --watch",
"prepare": "yarn clean && yarn build:source && yarn build:ts",
"coverage:report": "nyc report --reporter=lcov --reporter=json --reporter=text --exclude='**/haul-preset-0.59/*/vendor/**'",
"coverage:check": "nyc check-coverage --temp-dir coverage",
"release": "NODE_ENV=production yarn prepare && lerna publish --ignore-prepublish --ignore-scripts --sign-git-commit"
},
"dependencies": {
"chalk": "^2.4.2",
"concurrently": "^5.0.0",
"escape-string-regexp": "^2.0.0",
"execa": "^3.2.0",
"glob": "^7.1.5",
"lerna": "^3.16.4",
"mkdirp": "^0.5.1",
"node-fetch": "^2.6.0",
Expand All @@ -35,20 +40,60 @@
"@babel/preset-env": "^7.4.3",
"@babel/preset-typescript": "^7.3.3",
"@callstack/eslint-config": "^7.0.0",
"@haul-bundler/babel-preset-react-native": "^0.14.0",
"@haul-bundler/cli": "^0.14.0",
"@haul-bundler/core": "^0.14.0",
"@types/babel__core": "^7.1.2",
"@types/case-sensitive-paths-webpack-plugin": "^2.1.3",
"@types/cpx": "^1.5.0",
"@types/dedent": "^0.7.0",
"@types/del": "^4.0.0",
"@types/hapi__boom": "^7.4.0",
"@types/hapi__hapi": "^18.2.5",
"@types/hapi__inert": "^5.2.0",
"@types/hapi__joi": "^15.0.3",
"@types/image-size": "^0.7.0",
"@types/inquirer": "^6.5.0",
"@types/is-ci": "^2.0.0",
"@types/jest": "^24.0.17",
"@types/loader-utils": "^1.1.3",
"@types/lodash.get": "^4.4.6",
"@types/lodash.merge": "^4.6.6",
"@types/lodash.throttle": "^4.1.6",
"@types/mkdirp": "^0.5.2",
"@types/node": "^10.14.15",
"@types/node-fetch": "^2.5.0",
"@types/npm-registry-fetch": "^4.0.1",
"@types/resolve": "^0.0.8",
"@types/rimraf": "^2.0.2",
"@types/semver": "^6.0.1",
"@types/strip-ansi": "^5.2.1",
"@types/terminal-kit": "^1.28.0",
"@types/terser-webpack-plugin": "^1.2.1",
"@types/webpack": "^4.32.1",
"@types/webpack-sources": "^0.1.5",
"@types/which": "^1.3.1",
"@types/wrap-ansi": "^3.0.0",
"@types/ws": "^6.0.2",
"@types/yargs": "^13.0.2",
"@typescript-eslint/eslint-plugin": "^1.13.0",
"@typescript-eslint/parser": "^1.13.0",
"babel-eslint": "^10.0.2",
"babel-jest": "^24.8.0",
"babel-loader": "^8.0.5",
"babel-plugin-istanbul": "^5.2.0",
"codecov": "^3.5.0",
"dedent": "^0.7.0",
"del": "^5.1.0",
"eslint": "^6.1.0",
"jest": "^24.8.0",
"metro": "^0.56.0",
"typescript": "^3.5.3"
"react-native": "0.60.0",
"snapshot-diff": "^0.5.2",
"source-map": "^0.7.3",
"terser": "^4.1.3",
"typescript": "^3.5.3",
"webpack": "^4.39.1",
"webpack-sources": "^1.4.3"
}
}
6 changes: 0 additions & 6 deletions packages/haul-babel-preset-react-native/package.json
Expand Up @@ -44,11 +44,5 @@
"@babel/template": "^7.4.4",
"metro-react-native-babel-preset": "^0.54.0"
},
"devDependencies": {
"@types/babel__core": "^7.1.2",
"@types/babel__template": "^7.0.2",
"@types/dedent": "^0.7.0",
"dedent": "^0.7.0"
},
"gitHead": "c41becc82dfeafb07b642ebed8f082775647ec3f"
}
10 changes: 4 additions & 6 deletions packages/haul-babel-preset-react-native/tsconfig.json
@@ -1,9 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": [
"src/**/*.ts"
],
"exclude": [
"**/__tests__/**"
]
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
}
}
7 changes: 0 additions & 7 deletions packages/haul-basic-bundle-webpack-plugin/package.json
Expand Up @@ -17,12 +17,5 @@
"dependencies": {
"concat-with-sourcemaps": "^1.1.0"
},
"devDependencies": {
"@types/del": "^4.0.0",
"@types/webpack-sources": "^0.1.5",
"del": "^5.1.0",
"webpack": "^4.39.1",
"webpack-sources": "^1.4.3"
},
"gitHead": "c41becc82dfeafb07b642ebed8f082775647ec3f"
}
13 changes: 4 additions & 9 deletions packages/haul-basic-bundle-webpack-plugin/tsconfig.json
@@ -1,12 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"typeRoots": ["node_modules/@types", "typings"]
},
"include": [
"src/**/*.ts"
],
"exclude": [
"**/__tests__/**",
]
}
"rootDir": "src",
"outDir": "build"
}
}
11 changes: 0 additions & 11 deletions packages/haul-cli/package.json
Expand Up @@ -39,16 +39,5 @@
"yargs": "^13.3.0",
"yargs-parser": "^13.1.1"
},
"devDependencies": {
"@types/cpx": "^1.5.0",
"@types/dedent": "^0.7.0",
"@types/inquirer": "^6.5.0",
"@types/mkdirp": "^0.5.2",
"@types/npm-registry-fetch": "^4.0.1",
"@types/which": "^1.3.1",
"@types/ws": "^6.0.2",
"@types/yargs": "^13.0.2",
"webpack": "^4.39.1"
},
"gitHead": "c41becc82dfeafb07b642ebed8f082775647ec3f"
}
15 changes: 9 additions & 6 deletions packages/haul-cli/tsconfig.json
@@ -1,12 +1,15 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"typeRoots": ["node_modules/@types", "typings"]
"rootDir": "src",
"outDir": "build"
},
"include": [
"src/**/*.ts"
],
"exclude": [
"**/__tests__/**",
"references": [
{
"path": "../haul-core"
},
{
"path": "../haul-inspector-events"
}
]
}
3 changes: 0 additions & 3 deletions packages/haul-core-legacy/package.json
Expand Up @@ -30,8 +30,5 @@
"mkdirp": "^0.5.1",
"ws": "^6.2.1"
},
"devDependencies": {
"snapshot-diff": "^0.5.2"
},
"gitHead": "c41becc82dfeafb07b642ebed8f082775647ec3f"
}
20 changes: 0 additions & 20 deletions packages/haul-core/package.json
Expand Up @@ -55,25 +55,5 @@
"wrap-ansi": "^6.0.0",
"ws": "^6.2.1"
},
"devDependencies": {
"@types/babel__core": "^7.1.2",
"@types/dedent": "^0.7.0",
"@types/hapi__boom": "^7.4.0",
"@types/hapi__hapi": "^18.2.5",
"@types/hapi__inert": "^5.2.0",
"@types/hapi__joi": "^15.0.3",
"@types/image-size": "^0.7.0",
"@types/loader-utils": "^1.1.3",
"@types/lodash.get": "^4.4.6",
"@types/lodash.merge": "^4.6.6",
"@types/lodash.throttle": "^4.1.6",
"@types/node-fetch": "^2.5.0",
"@types/resolve": "^0.0.8",
"@types/semver": "^6.0.1",
"@types/strip-ansi": "^5.2.1",
"@types/terminal-kit": "^1.28.0",
"@types/wrap-ansi": "^3.0.0",
"@types/ws": "^6.0.2"
},
"gitHead": "c41becc82dfeafb07b642ebed8f082775647ec3f"
}
18 changes: 12 additions & 6 deletions packages/haul-core/tsconfig.json
@@ -1,13 +1,19 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"typeRoots": ["node_modules/@types", "typings"],
"rootDir": "src",
"outDir": "build",
"jsx": "react"
},
"include": [
"src/**/*.ts", "src/**/*.tsx"
],
"exclude": [
"**/__tests__/**",
"references": [
{
"path": "../haul-inspector-events"
},
{
"path": "../haul-basic-bundle-webpack-plugin"
},
{
"path": "../haul-ram-bundle-webpack-plugin"
}
]
}
10 changes: 4 additions & 6 deletions packages/haul-inspector-events/tsconfig.json
@@ -1,9 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": [
"src/**/*.ts"
],
"exclude": [
"**/__tests__/**",
]
"compilerOptions": {
"rootDir": "src",
"outDir": "build",
}
}
4 changes: 0 additions & 4 deletions packages/haul-inspector/package.json
Expand Up @@ -22,9 +22,5 @@
"ws": "^6.2.1",
"yargs": "^13.3.0"
},
"devDependencies": {
"@types/ws": "^6.0.2",
"@types/yargs": "^13.0.2"
},
"gitHead": "c41becc82dfeafb07b642ebed8f082775647ec3f"
}
13 changes: 8 additions & 5 deletions packages/haul-inspector/tsconfig.json
@@ -1,9 +1,12 @@
{
"extends": "../../tsconfig.json",
"include": [
"src/**/*.ts"
],
"exclude": [
"**/__tests__/**",
"compilerOptions": {
"rootDir": "src",
"outDir": "build",
},
"references": [
{
"path": "../haul-inspector-events"
}
]
}

0 comments on commit bcbcf38

Please sign in to comment.