Skip to content

Commit 11df522

Browse files
authored
[rcr] Generate ts defs (facebook#31994)
This was accidentally removed in the esbuild transition. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/31994). * facebook#31995 * __->__ facebook#31994
1 parent 9627d71 commit 11df522

File tree

6 files changed

+408
-22
lines changed

6 files changed

+408
-22
lines changed

compiler/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,19 @@
3030
"concurrently": "^7.4.0",
3131
"esbuild": "^0.24.2",
3232
"folder-hash": "^4.0.4",
33+
"npm-dts": "^1.3.13",
3334
"object-assign": "^4.1.1",
3435
"ora": "5.4.1",
3536
"prettier": "^3.3.3",
3637
"prettier-plugin-hermes-parser": "^0.26.0",
3738
"prompt-promise": "^1.0.3",
39+
"rimraf": "^5.0.10",
3840
"typescript": "^5.4.3",
3941
"wait-on": "^7.2.0",
4042
"yargs": "^17.7.2"
4143
},
44+
"resolutions": {
45+
"rimraf": "5.0.10"
46+
},
4247
"packageManager": "yarn@1.22.22"
4348
}

compiler/packages/babel-plugin-react-compiler/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"pretty-format": "^24",
5151
"react": "0.0.0-experimental-4beb1fd8-20241118",
5252
"react-dom": "0.0.0-experimental-4beb1fd8-20241118",
53-
"rimraf": "^3.0.2",
5453
"ts-jest": "^29.1.1",
5554
"ts-node": "^10.9.2",
5655
"zod": "^3.22.4",

compiler/packages/react-compiler-runtime/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "Runtime for React Compiler",
55
"license": "MIT",
66
"main": "dist/index.js",
7+
"typings": "dist/index.d.ts",
78
"files": [
89
"dist",
910
"src"

compiler/packages/react-compiler-runtime/scripts/build.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
const esbuild = require('esbuild');
1111
const yargs = require('yargs');
1212
const path = require('path');
13+
const {Generator} = require('npm-dts');
1314

1415
const argv = yargs(process.argv.slice(2))
1516
.options('p', {
@@ -61,6 +62,10 @@ async function main() {
6162
minify: false,
6263
...config,
6364
});
65+
await new Generator({
66+
entry: 'src/index.ts',
67+
output: 'dist/index.d.ts',
68+
}).generate();
6469
}
6570
}
6671

compiler/packages/snap/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@
5151
"@types/node": "^18.7.18",
5252
"@typescript-eslint/eslint-plugin": "^7.4.0",
5353
"@typescript-eslint/parser": "^7.4.0",
54-
"object-assign": "^4.1.1",
55-
"rimraf": "^3.0.2"
54+
"object-assign": "^4.1.1"
5655
},
5756
"resolutions": {
5857
"./**/@babel/parser": "7.7.4",

0 commit comments

Comments
 (0)