Skip to content

Commit bcbcf38

Browse files
authored
chore: use single tsc build and move types to monorepo root (#668)
1 parent 00e20d2 commit bcbcf38

26 files changed

Lines changed: 286 additions & 557 deletions

File tree

.circleci/config.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,12 @@ jobs:
4444
path: coverage
4545
destination: coverage
4646

47-
lint_and_typecheck_node_10:
47+
lint_node_10:
4848
executor: node_10
4949
steps:
5050
- attach_workspace:
5151
at: ~/haul_node_10
5252
- run: yarn lint
53-
- run: yarn typecheck
5453

5554
unit_test_node_10:
5655
executor: node_10
@@ -170,13 +169,12 @@ jobs:
170169
root: .
171170
paths: .
172171

173-
lint_and_typecheck_node_latest:
172+
lint_node_latest:
174173
executor: node_latest
175174
steps:
176175
- attach_workspace:
177176
at: ~/haul_node_latest
178177
- run: yarn lint
179-
- run: yarn typecheck
180178

181179
unit_test_node_latest:
182180
executor: node_latest
@@ -192,7 +190,7 @@ workflows:
192190
jobs:
193191
# Node 10 jobs
194192
- setup_node_10
195-
- lint_and_typecheck_node_10:
193+
- lint_node_10:
196194
requires:
197195
- setup_node_10
198196
- unit_test_node_10:
@@ -224,7 +222,7 @@ workflows:
224222
- setup_node_10
225223
- check_coverage:
226224
requires:
227-
- lint_and_typecheck_node_10
225+
- lint_node_10
228226
- unit_test_node_10
229227
- e2e_rn_0_59x
230228
- e2e_rn_0_60x
@@ -236,7 +234,7 @@ workflows:
236234

237235
# Node (latest) jobs
238236
- setup_node_latest
239-
- lint_and_typecheck_node_latest:
237+
- lint_node_latest:
240238
requires:
241239
- setup_node_latest
242240
- unit_test_node_latest:

.eslintrc

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"extends": "@callstack/eslint-config/node",
3-
"rules": {
4-
"import/no-extraneous-dependencies": [2, {
5-
"devDependencies": ["**/types.ts", "**/*.test.ts"]
6-
}]
7-
}
3+
"overrides": [
4+
{
5+
"files": ["**/types.ts", "**/*.test.ts"],
6+
"rules": {
7+
"import/no-extraneous-dependencies": 0
8+
}
9+
}
10+
]
811
}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,5 @@ dist/
9393
.vscode/
9494
.DS_Store
9595
.coverage_output
96-
fixtures/node_modules/
96+
fixtures/node_modules/
97+
**/tsconfig.tsbuildinfo

fixtures/react_native_windows_e2e_app/__tests__/appium.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ test('RNWTestApp renders correctly', async () => {
5757

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

package.json

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,24 @@
55
],
66
"scripts": {
77
"lint": "eslint --ext '.js,.ts' './packages'",
8-
"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\"",
9-
"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\"",
10-
"build:def": "lerna exec --ignore @haul-bundler/core-legacy \"tsc --emitDeclarationOnly -p ./tsconfig.json --outDir ./build\"",
11-
"prepare": "yarn build:source && yarn build:def",
12-
"typecheck": "tsc --noEmit",
138
"test": "jest",
9+
"clean": "rm -rf ./packages/*/build ./packages/*/tsconfig.tsbuildinfo",
10+
"watch": "yarn clean && concurrently \"yarn:watch:source\" \"yarn:watch:ts\"",
11+
"build:source": "lerna exec --parallel \"babel src --out-dir build --extensions .js,.ts,.tsx --source-maps --config-file=../../babel.config.js\"",
12+
"watch:source": "lerna exec --parallel \"babel src --out-dir build --extensions .js,.ts,.tsx --source-maps --config-file=../../babel.config.js --watch\"",
13+
"build:ts": "node ./scripts/build_ts.js",
14+
"watch:ts": "node ./scripts/build_ts.js --watch",
15+
"prepare": "yarn clean && yarn build:source && yarn build:ts",
1416
"coverage:report": "nyc report --reporter=lcov --reporter=json --reporter=text --exclude='**/haul-preset-0.59/*/vendor/**'",
1517
"coverage:check": "nyc check-coverage --temp-dir coverage",
1618
"release": "NODE_ENV=production yarn prepare && lerna publish --ignore-prepublish --ignore-scripts --sign-git-commit"
1719
},
1820
"dependencies": {
1921
"chalk": "^2.4.2",
22+
"concurrently": "^5.0.0",
2023
"escape-string-regexp": "^2.0.0",
24+
"execa": "^3.2.0",
25+
"glob": "^7.1.5",
2126
"lerna": "^3.16.4",
2227
"mkdirp": "^0.5.1",
2328
"node-fetch": "^2.6.0",
@@ -35,20 +40,60 @@
3540
"@babel/preset-env": "^7.4.3",
3641
"@babel/preset-typescript": "^7.3.3",
3742
"@callstack/eslint-config": "^7.0.0",
43+
"@haul-bundler/babel-preset-react-native": "^0.14.0",
44+
"@haul-bundler/cli": "^0.14.0",
45+
"@haul-bundler/core": "^0.14.0",
46+
"@types/babel__core": "^7.1.2",
47+
"@types/case-sensitive-paths-webpack-plugin": "^2.1.3",
48+
"@types/cpx": "^1.5.0",
49+
"@types/dedent": "^0.7.0",
50+
"@types/del": "^4.0.0",
51+
"@types/hapi__boom": "^7.4.0",
52+
"@types/hapi__hapi": "^18.2.5",
53+
"@types/hapi__inert": "^5.2.0",
54+
"@types/hapi__joi": "^15.0.3",
55+
"@types/image-size": "^0.7.0",
56+
"@types/inquirer": "^6.5.0",
57+
"@types/is-ci": "^2.0.0",
3858
"@types/jest": "^24.0.17",
59+
"@types/loader-utils": "^1.1.3",
60+
"@types/lodash.get": "^4.4.6",
61+
"@types/lodash.merge": "^4.6.6",
62+
"@types/lodash.throttle": "^4.1.6",
3963
"@types/mkdirp": "^0.5.2",
4064
"@types/node": "^10.14.15",
65+
"@types/node-fetch": "^2.5.0",
66+
"@types/npm-registry-fetch": "^4.0.1",
67+
"@types/resolve": "^0.0.8",
4168
"@types/rimraf": "^2.0.2",
69+
"@types/semver": "^6.0.1",
70+
"@types/strip-ansi": "^5.2.1",
71+
"@types/terminal-kit": "^1.28.0",
72+
"@types/terser-webpack-plugin": "^1.2.1",
4273
"@types/webpack": "^4.32.1",
74+
"@types/webpack-sources": "^0.1.5",
75+
"@types/which": "^1.3.1",
76+
"@types/wrap-ansi": "^3.0.0",
77+
"@types/ws": "^6.0.2",
78+
"@types/yargs": "^13.0.2",
4379
"@typescript-eslint/eslint-plugin": "^1.13.0",
4480
"@typescript-eslint/parser": "^1.13.0",
4581
"babel-eslint": "^10.0.2",
4682
"babel-jest": "^24.8.0",
83+
"babel-loader": "^8.0.5",
4784
"babel-plugin-istanbul": "^5.2.0",
4885
"codecov": "^3.5.0",
86+
"dedent": "^0.7.0",
87+
"del": "^5.1.0",
4988
"eslint": "^6.1.0",
5089
"jest": "^24.8.0",
5190
"metro": "^0.56.0",
52-
"typescript": "^3.5.3"
91+
"react-native": "0.60.0",
92+
"snapshot-diff": "^0.5.2",
93+
"source-map": "^0.7.3",
94+
"terser": "^4.1.3",
95+
"typescript": "^3.5.3",
96+
"webpack": "^4.39.1",
97+
"webpack-sources": "^1.4.3"
5398
}
5499
}

packages/haul-babel-preset-react-native/package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,5 @@
4444
"@babel/template": "^7.4.4",
4545
"metro-react-native-babel-preset": "^0.54.0"
4646
},
47-
"devDependencies": {
48-
"@types/babel__core": "^7.1.2",
49-
"@types/babel__template": "^7.0.2",
50-
"@types/dedent": "^0.7.0",
51-
"dedent": "^0.7.0"
52-
},
5347
"gitHead": "c41becc82dfeafb07b642ebed8f082775647ec3f"
5448
}
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"extends": "../../tsconfig.json",
3-
"include": [
4-
"src/**/*.ts"
5-
],
6-
"exclude": [
7-
"**/__tests__/**"
8-
]
3+
"compilerOptions": {
4+
"rootDir": "src",
5+
"outDir": "build"
6+
}
97
}

packages/haul-basic-bundle-webpack-plugin/package.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,5 @@
1717
"dependencies": {
1818
"concat-with-sourcemaps": "^1.1.0"
1919
},
20-
"devDependencies": {
21-
"@types/del": "^4.0.0",
22-
"@types/webpack-sources": "^0.1.5",
23-
"del": "^5.1.0",
24-
"webpack": "^4.39.1",
25-
"webpack-sources": "^1.4.3"
26-
},
2720
"gitHead": "c41becc82dfeafb07b642ebed8f082775647ec3f"
2821
}
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"typeRoots": ["node_modules/@types", "typings"]
5-
},
6-
"include": [
7-
"src/**/*.ts"
8-
],
9-
"exclude": [
10-
"**/__tests__/**",
11-
]
12-
}
4+
"rootDir": "src",
5+
"outDir": "build"
6+
}
7+
}

packages/haul-cli/package.json

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,5 @@
3939
"yargs": "^13.3.0",
4040
"yargs-parser": "^13.1.1"
4141
},
42-
"devDependencies": {
43-
"@types/cpx": "^1.5.0",
44-
"@types/dedent": "^0.7.0",
45-
"@types/inquirer": "^6.5.0",
46-
"@types/mkdirp": "^0.5.2",
47-
"@types/npm-registry-fetch": "^4.0.1",
48-
"@types/which": "^1.3.1",
49-
"@types/ws": "^6.0.2",
50-
"@types/yargs": "^13.0.2",
51-
"webpack": "^4.39.1"
52-
},
5342
"gitHead": "c41becc82dfeafb07b642ebed8f082775647ec3f"
5443
}

0 commit comments

Comments
 (0)