Skip to content

Commit b43fcf0

Browse files
robhoganmeta-codesync[bot]
authored andcommitted
Stop checking in generated .d.ts; keep only public API snapshots (#1801)
Summary: Pull Request resolved: #1801 Makes the per-package TypeScript definition files (`packages/*/types/*.d.ts`) build artefacts instead of checked-in source, now that `microsoft/api-extractor` gives us snapshots of public APIs. Note - `.d.ts` files are still emitted for every module at build time and published to npm. The main benefit of this is to reduce developer friction - previously, any change to a module's API would require rebuilding TS definitions. Now, a manual step is only required when changing the *public* API, which is both much less common and should always be done intentionally. Changelog: Internal Reviewed By: huntie Differential Revision: D112750746 fbshipit-source-id: a0563d5f1fa43f5604be905a5c9fa5a6bcfad43d
1 parent ab0b38b commit b43fcf0

228 files changed

Lines changed: 18 additions & 9016 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

β€Ž.gitignoreβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
/reports
66
npm-debug.log*
77
packages/*/build/
8+
# Generated TypeScript definitions. Build artifacts produced on demand from
9+
# Flow sources (for npm publish and public API snapshotting); not checked in.
10+
packages/*/types/
811

912
website/build/
1013
website/i18n/*

β€Žpackage.jsonβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
},
4949
"scripts": {
5050
"build-clean": "rm -rf ./packages/*/build",
51-
"build": "node ./scripts/build.js",
51+
"build": "yarn run build-ts-defs && node ./scripts/build.js",
5252
"build-ts-defs": "node -r @babel/register ./scripts/generateTypeScriptDefinitions.js",
5353
"build-api-snapshots": "node -r @babel/register ./scripts/generateApiSnapshots.js",
5454
"verify-api-snapshots": "node -r @babel/register ./scripts/generateApiSnapshots.js --verify",
@@ -62,7 +62,7 @@
6262
"test-coverage": "yarn run build && yarn run jest --coverage -i && node scripts/mapCoverage.js",
6363
"test-smoke": "yarn start build --config packages/metro/src/integration_tests/metro.config.js TestBundle.js --out /tmp/TestBundle",
6464
"typecheck": "flow check",
65-
"typecheck-ts": "tsc --project tsconfig.json",
65+
"typecheck-ts": "yarn run build-ts-defs && tsc --project tsconfig.json",
6666
"update-babel-flow-lib-defs": "node -r @babel/register ./scripts/updateBabelFlowLibraryDefinitions",
6767
"update-version": "node ./scripts/updateVersion"
6868
},

β€Žpackages/buck-worker-tool/types/CommandFailedError.d.tsβ€Ž

Lines changed: 0 additions & 25 deletions
This file was deleted.

β€Žpackages/buck-worker-tool/types/profiling.d.tsβ€Ž

Lines changed: 0 additions & 19 deletions
This file was deleted.

β€Žpackages/buck-worker-tool/types/worker-tool.d.tsβ€Ž

Lines changed: 0 additions & 25 deletions
This file was deleted.

β€Žpackages/metro-babel-transformer/types/index.d.tsβ€Ž

Lines changed: 0 additions & 86 deletions
This file was deleted.

β€Žpackages/metro-cache-key/types/index.d.tsβ€Ž

Lines changed: 0 additions & 18 deletions
This file was deleted.

β€Žpackages/metro-cache/types/Cache.d.tsβ€Ž

Lines changed: 0 additions & 32 deletions
This file was deleted.

β€Žpackages/metro-cache/types/index.d.tsβ€Ž

Lines changed: 0 additions & 36 deletions
This file was deleted.

β€Žpackages/metro-cache/types/stableHash.d.tsβ€Ž

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
Β (0)