mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
## Summary
The `react-devtools-fusebox` private package is used in the React Native
DevTools (Fusebox) frontend by checking build artifacts into RN's
[fork]([`facebookexperimental/rn-chrome-devtools-frontend`](https://github.com/facebookexperimental/rn-chrome-devtools-frontend))
of the Chrome DevTools (CDT) repo - see
https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/22.
Currently, the CDT fork also includes a [manually written TypeScript
definition
file](1d5f8d5209/front_end/third_party/react-devtools/package/frontend.d.ts)
which describes `react-devtools-fusebox`'s API. This PR moves that file
into the React repo, next to the implementation of
`react-devtools-fusebox`, so we can update it atomically with changes to
the package.
As this is the first bit of TypeScript in this repo, the PR adds minimal
support for formatting `.d.ts` files with Prettier. It also opts out
`react-devtools-fusebox/dist/` from linting/formatting as a drive-by
fix.
For now, we'll just maintain the `.d.ts` file manually, but we could
consider leveraging
[`flow-api-translator`](https://www.npmjs.com/package/flow-api-translator)
to auto-generate it in the future.
## How did you test this change?
Build `react-devtools-fusebox`, observe that `dist/frontend.d.ts`
exists.
24 lines
770 B
JSON
24 lines
770 B
JSON
{
|
|
"name": "react-devtools-fusebox",
|
|
"version": "0.0.0",
|
|
"private": "true",
|
|
"license": "MIT",
|
|
"files": ["dist"],
|
|
"scripts": {
|
|
"build:frontend:copy-types": "cp src/*.d.ts dist/",
|
|
"build:frontend:local": "cross-env NODE_ENV=development webpack --config webpack.config.frontend.js && yarn build:frontend:copy-types",
|
|
"build:frontend": "cross-env NODE_ENV=production webpack --config webpack.config.frontend.js && yarn build:frontend:copy-types",
|
|
"build": "yarn build:frontend"
|
|
},
|
|
"devDependencies": {
|
|
"buffer": "^6.0.3",
|
|
"cross-env": "^7.0.3",
|
|
"css-loader": "^6.9.1",
|
|
"mini-css-extract-plugin": "^2.7.7",
|
|
"process": "^0.11.10",
|
|
"webpack": "^5.82.1",
|
|
"webpack-cli": "^5.1.1",
|
|
"workerize-loader": "^2.0.2"
|
|
}
|
|
}
|