Move codegen into packages/react-native-codegen
Summary: This is the first step in organizing React Native slightly differently. This doesn't set up a "monorepo" structure for the GitHub repo yet, it merely moves a few files around and I slightly updated the package.json file for the codegen project. Reviewed By: rickhanlonii, TheSavior Differential Revision: D13974180 fbshipit-source-id: f53375f3b6618ef12658064cb1fc690ef1f95299
This commit is contained in:
Родитель
f307ac7c5e
Коммит
5ed749e1b2
|
@ -10,7 +10,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import type {SchemaType} from '../../../codegen/src/CodegenSchema.js';
|
||||
import type {SchemaType} from '../../../packages/react-native-codegen/src/CodegenSchema.js';
|
||||
|
||||
const SwitchSchema: SchemaType = {
|
||||
modules: {
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"jscodeshift": "^0.6.2",
|
||||
"nullthrows": "^1.1.0"
|
||||
},
|
||||
"private": true
|
||||
}
|
|
@ -2,7 +2,7 @@ load("@fbsource//tools/build_defs:default_platform_defs.bzl", "ANDROID", "APPLE"
|
|||
load("@fbsource//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
|
||||
load("@fbsource//tools/build_defs:fb_xplat_cxx_binary.bzl", "fb_xplat_cxx_binary")
|
||||
load("@fbsource//tools/build_defs/oss:rn_defs.bzl", "rn_xplat_cxx_library")
|
||||
load("@fbsource//xplat/js/react-native-github/codegen:DEFS.bzl", "rn_codegen_test")
|
||||
load("@fbsource//xplat/js/react-native-github/packages/react-native-codegen:DEFS.bzl", "rn_codegen_test")
|
||||
|
||||
fb_native.sh_binary(
|
||||
name = "copy_fixture_schema",
|
|
@ -17,7 +17,7 @@ def rn_codegen_test(
|
|||
fb_native.genrule(
|
||||
name = copy_schema_name,
|
||||
srcs = [],
|
||||
cmd = "$(exe xplat//js/react-native-github/codegen:copy_fixture_schema) {} $OUT".format(fixture_name),
|
||||
cmd = "$(exe xplat//js/react-native-github/packages/react-native-codegen:copy_fixture_schema) {} $OUT".format(fixture_name),
|
||||
out = "schema-{}.json".format(fixture_name),
|
||||
)
|
||||
|
||||
|
@ -38,7 +38,7 @@ def rn_codegen(
|
|||
fb_native.genrule(
|
||||
name = generate_fixtures_rule_name,
|
||||
srcs = [],
|
||||
cmd = "$(exe xplat//js/react-native-github/codegen:rn_codegen) $(location {}) {} $OUT".format(schema_target, name),
|
||||
cmd = "$(exe xplat//js/react-native-github/packages/react-native-codegen:rn_codegen) $(location {}) {} $OUT".format(schema_target, name),
|
||||
out = "codegenfiles-{}".format(name),
|
||||
)
|
||||
|
|
@ -6,6 +6,6 @@ set -u
|
|||
THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
|
||||
|
||||
# shellcheck source=xplat/js/env-utils/setup_env_vars.sh
|
||||
source "$THIS_DIR/../../../env-utils/setup_env_vars.sh"
|
||||
source "$THIS_DIR/../../../../env-utils/setup_env_vars.sh"
|
||||
|
||||
exec "$FLOW_NODE_BINARY" "$THIS_DIR/combine-js-to-schema.js" "$@"
|
|
@ -6,6 +6,6 @@ set -u
|
|||
THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
|
||||
|
||||
# shellcheck source=xplat/js/env-utils/setup_env_vars.sh
|
||||
source "$THIS_DIR/../../../env-utils/setup_env_vars.sh"
|
||||
source "$THIS_DIR/../../../../env-utils/setup_env_vars.sh"
|
||||
|
||||
exec "$FLOW_NODE_BINARY" "$THIS_DIR/copy-fixture.js" "$@"
|
|
@ -6,7 +6,7 @@ set -u
|
|||
THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
|
||||
|
||||
# shellcheck source=xplat/js/env-utils/setup_env_vars.sh
|
||||
source "$THIS_DIR/../../../env-utils/setup_env_vars.sh"
|
||||
source "$THIS_DIR/../../../../env-utils/setup_env_vars.sh"
|
||||
|
||||
pushd "$THIS_DIR/.." >/dev/null
|
||||
"$INSTALL_NODE_MODULES"
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"version": "0.0.1",
|
||||
"name": "react-native-codgen",
|
||||
"description": "⚛️ Code generation tools for React Native",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:facebook/react-native.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"jscodeshift": "^0.6.2",
|
||||
"nullthrows": "^1.1.0"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
Загрузка…
Ссылка в новой задаче