-
-
Notifications
You must be signed in to change notification settings - Fork 638
Phase 3: Prepare core package for workspace structure #1830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 25 commits
7745727
ce91f23
0182224
6f08b49
385df7f
4417277
3b34f34
5fd223e
ef7c6e6
4b94aba
8cf9138
ee4487a
5eb784f
a9e1e01
3250a03
660cab3
eab8e2a
c1c6b45
b34e161
946698d
a784eb6
87fe9cc
3e992bc
20f2f0b
dfc1275
caf8d34
325e4e8
e0d1365
fd728b3
0a97c1e
86e0ab6
ceb15a6
4331ea1
40ccdb2
c9c406f
804a88d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ tmp/ | |
|
|
||
| node_modules | ||
|
|
||
| /node_package/lib | ||
| /packages/*/lib | ||
|
|
||
| yarn-debug.* | ||
| yarn-error.* | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,7 +6,7 @@ tmp/ | |||||||
| coverage/ | ||||||||
| **/app/assets/webpack/ | ||||||||
| gen-examples/examples/* | ||||||||
| node_package/lib/* | ||||||||
| packages/*/lib/* | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep ignoring node_package/lib while builds still output there PR states outDir remains node_package/lib; replacing the ignore with packages//lib/ drops coverage for node_package/lib and may format compiled artifacts. Add both patterns. Apply: - packages/*/lib/*
+node_package/lib/*
+packages/*/lib/*Based on learnings. π Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||||
| spec/react_on_rails/dummy-for-generators/app/javascript/bundles/HelloWorld/* | ||||||||
| bundle/ | ||||||||
| spec/dummy/lib/bs/** | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,7 +19,7 @@ const config = tsEslint.config([ | |||||||
| includeIgnoreFile(path.resolve(__dirname, '.gitignore')), | ||||||||
| globalIgnores([ | ||||||||
| // compiled code | ||||||||
| 'node_package/lib/', | ||||||||
| 'packages/*/lib/', | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ESLint should also ignore node_package/lib/ Given builds still emit to node_package/lib/, linting that tree will slow CI and surface false positives. Keep the new packages/*/lib/ ignore, but also ignore node_package/lib/. Apply: - 'packages/*/lib/',
+ 'packages/*/lib/',
+ 'node_package/lib/',π Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||||
| // pro package (has its own linting) | ||||||||
| 'react_on_rails_pro/', | ||||||||
| // used for tests only | ||||||||
|
|
@@ -145,7 +145,13 @@ const config = tsEslint.config([ | |||||||
| }, | ||||||||
| }, | ||||||||
| { | ||||||||
| files: ['node_package/**/*'], | ||||||||
| files: ['packages/**/*'], | ||||||||
| rules: { | ||||||||
| 'import/extensions': ['error', 'ignorePackages'], | ||||||||
| }, | ||||||||
| }, | ||||||||
| { | ||||||||
| files: ['packages/react-on-rails/src/**/*'], | ||||||||
| rules: { | ||||||||
| 'import/extensions': ['error', 'ignorePackages'], | ||||||||
| }, | ||||||||
|
|
@@ -176,7 +182,7 @@ const config = tsEslint.config([ | |||||||
| languageOptions: { | ||||||||
| parserOptions: { | ||||||||
| projectService: { | ||||||||
| allowDefaultProject: ['eslint.config.ts', 'knip.ts', 'node_package/tests/*.test.{ts,tsx}'], | ||||||||
| allowDefaultProject: ['eslint.config.ts', 'knip.ts', 'packages/*/tests/*.test.{ts,tsx}'], | ||||||||
| // Needed because `import * as ... from` instead of `import ... from` doesn't work in this file | ||||||||
| // for some imports. | ||||||||
| defaultProject: 'tsconfig.eslint.json', | ||||||||
|
|
@@ -211,7 +217,7 @@ const config = tsEslint.config([ | |||||||
| }, | ||||||||
| }, | ||||||||
| { | ||||||||
| files: ['node_package/tests/**', '**/*.test.{js,jsx,ts,tsx}'], | ||||||||
| files: ['packages/*/tests/**', '**/*.test.{js,jsx,ts,tsx}'], | ||||||||
|
|
||||||||
| extends: [ | ||||||||
| jest.configs['flat/recommended'], | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { createJsWithTsPreset } from 'ts-jest'; | ||
|
|
||
| // Global Jest configuration for the monorepo | ||
| // Contains common settings that all packages inherit | ||
| export default { | ||
| // === TypeScript Configuration === | ||
| // ts-jest preset with custom TypeScript settings | ||
| ...createJsWithTsPreset({ | ||
| tsconfig: { | ||
| // Relative imports in our TS code include `.ts` extensions. | ||
| // When compiling the package, TS rewrites them to `.js`, | ||
| // but ts-jest runs on the original code where the `.js` files don't exist, | ||
| // so this setting needs to be disabled here. | ||
| rewriteRelativeImportExtensions: false, | ||
| }, | ||
| }), | ||
|
|
||
| // === Test Environment Configuration === | ||
| testEnvironment: 'jsdom', | ||
|
|
||
| // === Common Test Patterns === | ||
| // Default test pattern - packages can override this | ||
| testMatch: ['**/?(*.)+(spec|test).[jt]s?(x)'], | ||
|
|
||
| // === Common Module File Extensions === | ||
| moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json'], | ||
| }; |
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -25,9 +25,9 @@ scripts: | |||||||||||||||||||
| # 3. Check if the project is built now; | ||||||||||||||||||||
| # 4. If it failed, print an error message (still follow https://docs.npmjs.com/cli/v8/using-npm/scripts#best-practices). | ||||||||||||||||||||
| script: > | ||||||||||||||||||||
| [ -f node_package/lib/ReactOnRails.full.js ] || | ||||||||||||||||||||
| [ -f packages/react-on-rails/lib/ReactOnRails.full.js ] || | ||||||||||||||||||||
| (npm run build >/dev/null 2>&1 || true) && | ||||||||||||||||||||
| [ -f node_package/lib/ReactOnRails.full.js ] || | ||||||||||||||||||||
| [ -f packages/react-on-rails/lib/ReactOnRails.full.js ] || | ||||||||||||||||||||
| { echo 'Building react-on-rails seems to have failed!'; } | ||||||||||||||||||||
|
Comment on lines
+28
to
31
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restore the prepack build guard to Our build artifacts are still emitted into - [ -f packages/react-on-rails/lib/ReactOnRails.full.js ] ||
+ [ -f node_package/lib/ReactOnRails.full.js ] ||
(npm run build >/dev/null 2>&1 || true) &&
- [ -f packages/react-on-rails/lib/ReactOnRails.full.js ] ||
+ [ -f node_package/lib/ReactOnRails.full.js ] ||π Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||||||||||||||||
|
|
||||||||||||||||||||
| format: | ||||||||||||||||||||
|
|
||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build before yalc publish to ensure lib exists
The workflow publishes via yalc without building first. Insert a build step before publishing.
π Committable suggestion
π€ Prompt for AI Agents