Skip to content

Commit

Permalink
[rcr] Generate ts defs (#31994)
Browse files Browse the repository at this point in the history
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).
* #31995
* __->__ #31994
  • Loading branch information
poteto authored Jan 6, 2025
1 parent 9627d71 commit 11df522
Show file tree
Hide file tree
Showing 6 changed files with 408 additions and 22 deletions.
5 changes: 5 additions & 0 deletions compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,19 @@
"concurrently": "^7.4.0",
"esbuild": "^0.24.2",
"folder-hash": "^4.0.4",
"npm-dts": "^1.3.13",
"object-assign": "^4.1.1",
"ora": "5.4.1",
"prettier": "^3.3.3",
"prettier-plugin-hermes-parser": "^0.26.0",
"prompt-promise": "^1.0.3",
"rimraf": "^5.0.10",
"typescript": "^5.4.3",
"wait-on": "^7.2.0",
"yargs": "^17.7.2"
},
"resolutions": {
"rimraf": "5.0.10"
},
"packageManager": "[email protected]"
}
1 change: 0 additions & 1 deletion compiler/packages/babel-plugin-react-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"pretty-format": "^24",
"react": "0.0.0-experimental-4beb1fd8-20241118",
"react-dom": "0.0.0-experimental-4beb1fd8-20241118",
"rimraf": "^3.0.2",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.2",
"zod": "^3.22.4",
Expand Down
1 change: 1 addition & 0 deletions compiler/packages/react-compiler-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Runtime for React Compiler",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
"dist",
"src"
Expand Down
5 changes: 5 additions & 0 deletions compiler/packages/react-compiler-runtime/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
const esbuild = require('esbuild');
const yargs = require('yargs');
const path = require('path');
const {Generator} = require('npm-dts');

const argv = yargs(process.argv.slice(2))
.options('p', {
Expand Down Expand Up @@ -61,6 +62,10 @@ async function main() {
minify: false,
...config,
});
await new Generator({
entry: 'src/index.ts',
output: 'dist/index.d.ts',
}).generate();
}
}

Expand Down
3 changes: 1 addition & 2 deletions compiler/packages/snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@
"@types/node": "^18.7.18",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"object-assign": "^4.1.1",
"rimraf": "^3.0.2"
"object-assign": "^4.1.1"
},
"resolutions": {
"./**/@babel/parser": "7.7.4",
Expand Down
Loading

0 comments on commit 11df522

Please sign in to comment.