Package builds copy Flow sources into lib/ and dist/ untransformed when the checkout sits below a dot-folder
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- babel, javascript, node.js, react-native
- Lĩnh vực
- build-system
Hướng nghiên cứu
Đọc packages/react-native-codegen/scripts/build.js và scripts/build/build.js, đặc biệt là các kiểm tra glob và ignore được mô tả trong issue. Tái hiện các bản build trong một thư mục bắt đầu bằng dấu chấm và một thư mục thông thường, sau đó so sánh các tệp được sao chép hoặc biên dịch và các thư mục kiểm thử được đưa vào. Hoàn thành khi cả hai bản build xử lý các tệp nguồn giống nhau ở cả hai vị trí checkout.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
I found this when a script of mine that clones react-native main into a .repro/ folder and builds ReactAndroid stopped in generateCodegenSchemaFromJavaScript: Node could not load packages/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js (SyntaxError: Missing initializer in const declaration, line 39).
packages/react-native-codegen/scripts/build.js and scripts/build/build.js decide whether to skip a source, copy it as written or compile it with Babel by matching '**/*.js' and their ignore pattern against the file's absolute path, which comes from globSync(..., {absolute: true}) (L108-L112, L95-L99). micromatch's ** does not match a path segment that starts with a dot, so in a checkout below any dot-folder no source matches either pattern: every .js file is copied with its Flow types into lib/ or dist/, and the __tests__, __mocks__ and fixture files are copied with them.
From the same main commit, below .dot/ and below plain/:
yarn buildinpackages/react-native-codegenlogs all 132src.jsfiles as(copy)below.dot/and none belowplain/; itslib/holds 132.jsfiles, 95 of which a CommonJS parse rejects, against 81 and 1 (parsers/parserMock.js) belowplain/.- The root
yarn buildleaves 111.jsfiles in the five packages'dist/below.dot/, 109 rejected, against 72 and 0 belowplain/.
a12b442d26 (#55259) fixed the same kind of check, an absolute path tested for /., in generateRCTThirdPartyComponents.js for #55243.
Other platform: these are react-native's own yarn build scripts; I ran them on Windows.
Steps to reproduce
- Clone
maininto a folder below a dot-folder, for examplework/.dot/react-native, and runyarn install. - Run
yarn buildinpackages/react-native-codegen: it logs(copy)for everysrc/**/*.jsfile. - Run
yarn buildat the root. - Load
packages/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.jswith Node, as ReactAndroid'sgenerateCodegenSchemaFromJavaScriptdoes:SyntaxError: Missing initializer in const declarationat line 39,const platform: ?string = argv.platform;.
./reproduce.sh in the reproducer does these steps in two clones, work/.dot/react-native and work/plain/react-native, and parses every built .js file as CommonJS without running it (check-js.cjs). It exits 1 while a build below the dot-folder leaves more files the parse rejects than the same build below none, and 0 once both leave as many.
Expected: below a dot-folder, both builds compile every src .js file and skip the test folders, as they do below plain/.
Seen: both copy every source as written (output below).
React Native Version
main at b49769c0cc (after 0.90.0-nightly-20261201-13d48c3d8)
Affected Platforms
Build - Windows, Other (please specify)
Output of npx @react-native-community/cli info
Not applicable: these are react-native's own package builds. The run's host:
host: MINGW64_NT-10.0-26300 3.6.10-5a1665c8.x86_64 x86_64; node v26.13.1; yarn 1.22.22
[…]
Stacktrace or Logs
host: MINGW64_NT-10.0-26300 3.6.10-5a1665c8.x86_64 x86_64; node v26.13.1; yarn 1.22.22
.dot: react-native main at b49769c0cc543a803823716600d0b482559681dd, cloned into .dot/react-native
.dot: packages/react-native-codegen yarn build: 132 of the 132 src .js files it logs copied, not compiled
first: src\cli\combine\combine-js-to-schema-cli.js ⇒ lib\cli\combine\combine-js-to-schema-cli.js (copy)
.dot: packages/react-native-codegen/lib: 132 .js files, 95 rejected by a CommonJS parse
first: packages/react-native-codegen/lib/CodegenSchema.js:13: SyntaxError: Unexpected token 'export'
.dot: packages/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js: 1 .js files, 1 rejected by a CommonJS parse
first: packages/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js:39: SyntaxError: Missing initializer in const declaration
.dot: packages/community-cli-plugin/dist, packages/debugger-shell/dist, packages/dev-middleware/dist, packages/metro-config/dist, packages/react-native-compatibility-check/dist: 111 .js files, 109 rejected by a CommonJS parse
first: packages/community-cli-plugin/dist/commands/bundle/__mocks__/sign.js:11: SyntaxError: Unexpected token ':'
plain: react-native main at b49769c0cc543a803823716600d0b482559681dd, cloned into plain/react-native
plain: packages/react-native-codegen yarn build: 0 of the 132 src .js files it logs copied, not compiled
plain: packages/react-native-codegen/lib: 81 .js files, 1 rejected by a CommonJS parse
first: packages/react-native-codegen/lib/parsers/parserMock.js:6: SyntaxError: Cannot use import statement outside a module
plain: packages/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js: 1 .js files, 0 rejected by a CommonJS parse
plain: packages/community-cli-plugin/dist, packages/debugger-shell/dist, packages/dev-middleware/dist, packages/metro-config/dist, packages/react-native-compatibility-check/dist: 72 .js files, 0 rejected by a CommonJS parse
SUMMARY: react-native main b49769c0cc: below a dot-folder the builds leave .js files Node cannot parse; codegen lib: 95 rejected below .dot/, 1 below plain/; root build dist: 109 rejected below .dot/, 0 below plain/
MANDATORY Reproducer
https://github.com/YevheniiKotyrlo/rn-codegen-build-under-dot-folder
Screenshots and Videos
No response
- Ngôn ngữ chính
- C++
- Star
- 127k
- Fork
- 25.4k
- Merge trung bình
- 2 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 283
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của react/react-native
-
App codegen reads the jsSrcsDir of a library with `includesGeneratedCode: true` and prints "No modules to process" for itCó thể đã có người làm @lazerg đã nhận 3 ngày trước. Đang mởNeeds: Triage :mag: Type: New Architecture
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
react/react-native#60358 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`Rect::containsPoint` is not `const`, so a `const Rect` cannot be asked whether it holds a pointCó thể đã có người làm @lazerg đã nhận 3 ngày trước. Đang mởNeeds: Triage :mag:
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
react/react-native#60349 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Needs: Triage :mag: Platform: Android
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
react/react-native#60177 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Needs: Author Feedback Needs: Repro
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
react/react-native#60091 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ReactNative-application.cmake links autolinked libraries to common_flags with the plain target_link_libraries signature, so a library that uses PRIVATE fails the app's CMake configureCó thể đã có người làm @JagguDada01 đã nhận 5 ngày trước. Đang mởNeeds: Triage :mag:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
react/react-native#60000 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của react/react-native
Issue tương tự
-
[bug] [documentation] Document STRPCCMD setup and that PCCMD must be quoted to keep lowercaseĐang mởbug documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
TransformInteract: a circle drag through the centre sets Scale to its minimum, which can't grow backĐang mởdifficulty:easy prio:low type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
NatronGitHub/openfx-supportext#311 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
CachyOS/packageinstaller#211 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
OpenEmu-Silicon/OpenEmu-Silicon#920 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày