Files
react/compiler/packages/sprout/package.json
T
Mofei Zhang 372696c541 [sprout] Add support for fbt
Fbt + typescript [seems](https://github.com/facebook/fbt/issues/49) [to 
be](https://github.com/facebook/sfbt/issues/72) a non-blessed workflow. We do 
want to allow for both flow and typescript tests, so I followed some 
instructions [from a 
guide](https://dev.to/retyui/how-to-add-support-typescript-for-fbt-an-internationalization-framework-3lo0) 
to add support. 

- fbt tags desugar to.. "fbt" strings. By default, typescript removes unused 
imports at parse step (and on autoformat steps). We pass special 
babel-typescript configs and change vscode settings to mitigate this. 

- I tried adding `fbt` to the global scope, but the fbt transform asserts that 
`fbt` is actually imported in the source program. 

- Other hacks are available, like saying we'll only allow for fbt in flow files, 
or always patching the source code to have an "fbt" import. This seemed the most 
reasonable and easiest to debug / follow when writing tests
2023-11-09 18:55:05 -05:00

53 lines
1.4 KiB
JSON

{
"name": "sprout",
"version": "0.0.1",
"public": false,
"main": "dist/main.js",
"license": "MIT",
"files": [
"src"
],
"scripts": {
"build": "rimraf dist && tsc --build",
"prettier": "prettier --write src",
"test": "echo 'no tests'"
},
"repository": {
"type": "git",
"url": "git+https://github.com/facebook/react-forget.git"
},
"dependencies": {
"@babel/generator": "7.2.0",
"@babel/plugin-syntax-jsx": "^7.18.6",
"@babel/preset-flow": "^7.7.4",
"@babel/preset-typescript": "^7.18.6",
"@babel/types": "^7.19.0",
"@parcel/watcher": "^2.1.0",
"@testing-library/react": "^13.4.0",
"babel-plugin-react-forget": "*",
"chalk": "4",
"fbt": "^1.0.0",
"fixture-test-utils": "*",
"jsdom": "^22.1.0",
"react": "^0.0.0-experimental-493f72b0a-20230727",
"react-dom": "^0.0.0-experimental-493f72b0a-20230727",
"readline": "^1.3.0",
"typescript": "^5.1.0",
"yargs": "^17.7.1"
},
"devDependencies": {
"@babel/core": "^7.19.1",
"@babel/parser": "^7.19.1",
"@babel/plugin-syntax-typescript": "^7.18.6",
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
"@babel/preset-react": "^7.18.6",
"@babel/traverse": "^7.19.1",
"@types/fbt": "^1.0.4",
"@types/node": "^18.7.18",
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"prettier": "2.8.8",
"rimraf": "^3.0.2"
}
}