[generate/package] include react type for web packages (#128082)

This commit is contained in:
Spencer 2022-03-18 11:51:27 -07:00 committed by GitHub
parent a4856b47fa
commit 07cacbe799
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View file

@ -8,6 +8,9 @@ PKG_REQUIRE_NAME = <%- json(pkg.name) %>
SOURCE_FILES = glob(
[
"src/**/*.ts",
<%_ if (pkg.web) { _%>
"src/**/*.tsx",
<%_ } _%>
],
exclude = [
"**/*.test.*",
@ -36,6 +39,9 @@ NPM_MODULE_EXTRA_FILES = [
# "@npm//name-of-package"
# eg. "@npm//lodash"
RUNTIME_DEPS = [
<%_ if (pkg.web) { _%>
"@npm//react"
<%_ } _%>
]
# In this array place dependencies necessary to build the types, which will include the
@ -50,6 +56,9 @@ RUNTIME_DEPS = [
TYPES_DEPS = [
"@npm//@types/node",
"@npm//@types/jest",
<%_ if (pkg.web) { _%>
"@npm//@types/react"
<%_ } _%>
]
jsts_transpiler(

View file

@ -7,8 +7,14 @@
"rootDir": "src",
"stripInternal": false,
"types": [
<%_ if (pkg.web) { _%>
"jest",
"node",
"react"
<%_ } else { _%>
"jest",
"node"
<%_ } _%>
]
},
"include": [