-
-
Notifications
You must be signed in to change notification settings - Fork 1
Feat: Integrate OXC for faster builds and improved Mincho transformations #281
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
base: main
Are you sure you want to change the base?
Changes from all commits
3a5e15a
fb3547b
26dda39
601c254
06b5c25
40d180b
97423db
1905bff
878b60a
fa61197
e2603f6
5ba2bcf
f073162
6ae70aa
56b3d6e
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 |
|---|---|---|
|
|
@@ -17,10 +17,11 @@ | |
| } | ||
| }, | ||
| "devDependencies": { | ||
| "@eslint/js": "^9.38.0", | ||
| "@eslint/core": "0.17.0", | ||
|
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. 🧩 Analysis chain🏁 Script executed: rg -n "@eslint/core" configs/eslint-config-custom/Repository: mincho-js/mincho Length of output: 42 🏁 Script executed: # Check if @eslint/core is mentioned in package.json or if it's a peer dependency
cat configs/eslint-config-custom/package.json | grep -A 50 "dependencies\|peerDependencies"Repository: mincho-js/mincho Length of output: 42 🏁 Script executed: # Also check if there are any comments or documentation about this dependency
rg -i "eslint.*core|core.*eslint" configs/eslint-config-custom/ -B 2 -A 2Repository: mincho-js/mincho Length of output: 42 🏁 Script executed: cat configs/eslint-config-custom/package.jsonRepository: mincho-js/mincho Length of output: 933 🏁 Script executed: find configs/eslint-config-custom -name "*.js" -type fRepository: mincho-js/mincho Length of output: 218 🏁 Script executed: cat configs/eslint-config-custom/eslint.config.typescript.jsRepository: mincho-js/mincho Length of output: 2053 🏁 Script executed: cat configs/eslint-config-custom/eslint.config.base.js && echo "---" && cat configs/eslint-config-custom/eslint.config.yaml.jsRepository: mincho-js/mincho Length of output: 1379 Remove unused The 🤖 Prompt for AI Agents |
||
| "@eslint/js": "9.39.0", | ||
| "@types/node": "^24.9.1", | ||
| "@typescript-eslint/parser": "^8.46.2", | ||
| "eslint": "^9.38.0", | ||
| "eslint": "9.39.0", | ||
| "eslint-config-prettier": "^10.1.8", | ||
| "eslint-plugin-prettier": "^5.5.4", | ||
| "eslint-plugin-yml": "^1.19.0", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,9 +29,8 @@ | |
| "module": "NodeNext", /* Specify what module code is generated. */ | ||
| // "rootDir": ".", /* Specify the root folder within your source files. */ | ||
| "moduleResolution": "nodenext", /* Specify how TypeScript looks up a file from a given module specifier. */ | ||
| "baseUrl": ".", /* Specify the base directory to resolve non-relative module names. */ | ||
| "paths": { /* Specify a set of entries that re-map imports to additional lookup locations. */ | ||
| "@/*": ["src/*"] | ||
| "@/*": ["./src/*"] | ||
| }, | ||
|
Comment on lines
32
to
34
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. 🧩 Analysis chain🏁 Script executed: # Find the base config and understand the structure
find . -name "tsconfig.base.json" -o -name "tsconfig*.json" | head -30Repository: mincho-js/mincho Length of output: 1256 🏁 Script executed: # Get monorepo structure
ls -la | grep -E "^d"Repository: mincho-js/mincho Length of output: 707 🏁 Script executed: # Find all tsconfig files extending the base config
rg -l "tsconfig-custom/tsconfig.base.json" --type jsonRepository: mincho-js/mincho Length of output: 505 🏁 Script executed: # For each file that extends the base config, check if it overrides paths
rg "tsconfig-custom/tsconfig.base.json" --type json -A 50 | grep -E "(tsconfig|paths|@/)"Repository: mincho-js/mincho Length of output: 12186 🏁 Script executed: # Check which packages actually use @/* imports
rg "@/" --type ts --type tsx | head -50Repository: mincho-js/mincho Length of output: 87 🏁 Script executed: # Specifically check packages/oxc which extends base without overriding paths or baseUrl
cat packages/oxc/tsconfig.jsonRepository: mincho-js/mincho Length of output: 456 🏁 Script executed: # Check if packages that extend base actually have src directories at the expected locations
find packages -type d -name "src" | head -20Repository: mincho-js/mincho Length of output: 286 🏁 Script executed: # Look at the base config more closely to understand paths definition
cat configs/tsconfig-custom/tsconfig.base.jsonRepository: mincho-js/mincho Length of output: 13123 🏁 Script executed: # Check for @/ imports in packages/oxc
rg "@/" packages/oxc/ --type tsRepository: mincho-js/mincho Length of output: 42 🏁 Script executed: # Check all packages for @/ usage to understand scope of issue
rg "@/" --type ts -c | sort -rnRepository: mincho-js/mincho Length of output: 643 🏁 Script executed: # Look at packages/oxc/src to see what it imports
ls -la packages/oxc/src/Repository: mincho-js/mincho Length of output: 601 🏁 Script executed: # Check if there are any import errors or build warnings related to path resolution
rg "Cannot find" --type ts --type js 2>/dev/null || echo "No errors found"Repository: mincho-js/mincho Length of output: 75 🏁 Script executed: # Double-check packages that extend base without baseUrl override
# to ensure they don't use @/ imports
rg "@/" packages/debug-log/ --type ts
rg "@/" packages/css-additional-types/ --type ts
rg "@/" configs/vite-config-custom/ --type tsRepository: mincho-js/mincho Length of output: 42 🏁 Script executed: # Verify the actual path resolution by checking packages that use @/
# Look at transform-to-vanilla which uses @/ and sets baseUrl
cat packages/transform-to-vanilla/tsconfig.lib.json | grep -A 5 "baseUrl\|paths"Repository: mincho-js/mincho Length of output: 225 Base config's path mappings work in practice, but the design lacks defensiveness. The change from The design risk remains valid: if a future package uses Consider documenting that all packages extending this config must either set 🤖 Prompt for AI Agents |
||
| // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ | ||
| // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| { | ||
| "files": [], | ||
| "compilerOptions": { | ||
| "composite": true | ||
| }, | ||
|
Comment on lines
+3
to
+5
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. Do we need this option? |
||
| "references": [ | ||
| { "path": "./tsconfig.node.json" }, | ||
| { "path": "./tsconfig.lib.json" } | ||
| ] | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,10 @@ | ||
| { | ||
| "extends": "tsconfig-custom/tsconfig.node.json", | ||
| "compilerOptions": { | ||
| "composite": true, | ||
| "noEmit": false, | ||
| "declaration": true, | ||
| "emitDeclarationOnly": true, | ||
|
Comment on lines
+4
to
+7
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. I think that the node type should not be emitted, as it is only used for type checking for build purposes. |
||
| "tsBuildInfoFile": "./.cache/typescript/tsbuildinfo-node", | ||
| "outDir": "./.cache/tsbuild-node" | ||
| }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,11 +27,11 @@ | |
| "noUncheckedSideEffectImports": true, | ||
|
|
||
| /* Path Aliases for Workspace Packages */ | ||
| "baseUrl": "../../", | ||
| "paths": { | ||
| "@mincho-js/react": ["packages/react/src"], | ||
| "@mincho-js/css": ["packages/css/src"], | ||
| "@mincho-js/vite": ["packages/vite/src"] | ||
| "*": ["../../*"], | ||
| "@mincho-js/react": ["../../packages/react/src"], | ||
| "@mincho-js/css": ["../../packages/css/src"], | ||
| "@mincho-js/vite": ["../../packages/vite/src"] | ||
|
Comment on lines
+31
to
+34
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. I think we can remove them all. |
||
| }, | ||
|
Comment on lines
29
to
35
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Inspecting tsconfig.app.json ==="
cat -n examples/react-babel/tsconfig.app.json 2>/dev/null || echo "File not found"
echo
echo "=== All tsconfig files in examples/react-babel ==="
fd -a '^tsconfig.*\.json$' examples/react-babel -x echo {} 2>/dev/null || true
echo
echo "=== Check for extends and baseUrl in tsconfig.app.json ==="
rg -n '"extends"|"baseUrl"' examples/react-babel/tsconfig.app.json 2>/dev/null || echo "No extends or baseUrl found"
echo
echo "=== Check what tsconfig.app.json extends from (if anything) ==="
grep -i extends examples/react-babel/tsconfig.app.json || echo "No extends directive"
echo
echo "=== Inspect parent tsconfig in examples/ ==="
fd -a '^tsconfig.*\.json$' examples -maxdepth 1 -x echo {} 2>/dev/null || true
echo
echo "=== Imports in examples/react-babel/src - look for bare/monorepo paths ==="
find examples/react-babel/src -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) 2>/dev/null | head -20Repository: mincho-js/mincho Length of output: 1991 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== All import statements in examples/react-babel/src ==="
rg -n "^import|^export.*from" examples/react-babel/src/ -t ts -t tsx --max-count=50 2>/dev/null || true
echo
echo "=== Check for subpath imports of @mincho-js/* ==="
rg -n '@mincho-js/[^"'\'']+/' examples/react-babel/src/ -t ts -t tsx 2>/dev/null || echo "No subpath imports found"
echo
echo "=== Check what non-relative, non-@scope imports exist ==="
rg -n 'from\s+["\x27](?![./])([a-z])' examples/react-babel/src/ -t ts -t tsx --max-count=30 2>/dev/null || trueRepository: mincho-js/mincho Length of output: 252 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Check tsconfig hierarchy - root and examples ==="
if [ -f tsconfig.json ]; then
echo "Root tsconfig.json exists"
grep -E '"extends"|"baseUrl"' tsconfig.json || echo "No extends/baseUrl in root"
fi
echo
echo "=== Check if examples/tsconfig.json exists ==="
if [ -f examples/tsconfig.json ]; then
echo "examples/tsconfig.json content:"
cat -n examples/tsconfig.json
fi
echo
echo "=== Verify structure of examples/react-babel ==="
ls -la examples/react-babel/ | grep -E "tsconfig|src" || trueRepository: mincho-js/mincho Length of output: 514 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== examples/react-babel/tsconfig.json ==="
cat -n examples/react-babel/tsconfig.json
echo
echo "=== Source files in examples/react-babel/src ==="
for file in examples/react-babel/src/*.tsx examples/react-babel/src/*.ts; do
if [ -f "$file" ]; then
echo "--- $file ---"
cat -n "$file"
echo
fi
doneRepository: mincho-js/mincho Length of output: 2687 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== TypeScript paths behavior verification ==="
echo "TS docs: paths without baseUrl are typically ignored or baseUrl defaults to '.'"
echo "Checking if moduleResolution affects this..."
echo
echo "=== Check tsconfig.node.json ==="
cat -n examples/react-babel/tsconfig.node.json
echo
echo "=== Verify what import patterns actually exist ==="
rg -n 'import\s+' examples/react-babel/src/ -A 1 2>/dev/null || echo "No imports found"Repository: mincho-js/mincho Length of output: 1467 Configuration is functional but could be cleaner The tsconfig.app.json uses Suggested tightening {
"compilerOptions": {
+ "baseUrl": ".",
/* Path Aliases for Workspace Packages */
"paths": {
- "*": ["../../*"],
"@mincho-js/react": ["../../packages/react/src"],
"@mincho-js/css": ["../../packages/css/src"],
"@mincho-js/vite": ["../../packages/vite/src"]
},
🤖 Prompt for AI Agents |
||
|
|
||
| "tsBuildInfoFile": "./.cache/typescript/tsbuildinfo-app" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Logs | ||
| logs | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| pnpm-debug.log* | ||
| lerna-debug.log* | ||
|
|
||
| node_modules | ||
| dist | ||
| dist-ssr | ||
| *.local | ||
|
|
||
| # Editor directories and files | ||
| .vscode/* | ||
| !.vscode/extensions.json | ||
| .idea | ||
| .DS_Store | ||
| *.suo | ||
| *.ntvs* | ||
| *.njsproj | ||
| *.sln | ||
| *.sw? |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # React + TypeScript + Vite | ||
|
|
||
| This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. | ||
|
|
||
| Currently, two official plugins are available: | ||
|
|
||
| - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh | ||
| - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh | ||
|
|
||
| ## React Compiler | ||
|
|
||
| The React Compiler is enabled on this template. See [this documentation](https://react.dev/learn/react-compiler) for more information. | ||
|
|
||
| Note: This will impact Vite dev & build performances. | ||
|
|
||
| ## Expanding the ESLint configuration | ||
|
|
||
| If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: | ||
|
|
||
| ```js | ||
| export default defineConfig([ | ||
| globalIgnores(['dist']), | ||
| { | ||
| files: ['**/*.{ts,tsx}'], | ||
| extends: [ | ||
| // Other configs... | ||
|
|
||
| // Remove tseslint.configs.recommended and replace with this | ||
| tseslint.configs.recommendedTypeChecked, | ||
| // Alternatively, use this for stricter rules | ||
| tseslint.configs.strictTypeChecked, | ||
| // Optionally, add this for stylistic rules | ||
| tseslint.configs.stylisticTypeChecked, | ||
|
|
||
| // Other configs... | ||
| ], | ||
| languageOptions: { | ||
| parserOptions: { | ||
| project: ['./tsconfig.node.json', './tsconfig.app.json'], | ||
| tsconfigRootDir: import.meta.dirname, | ||
| }, | ||
| // other options... | ||
| }, | ||
| }, | ||
| ]) | ||
| ``` | ||
|
|
||
| You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: | ||
|
|
||
| ```js | ||
| // eslint.config.js | ||
| import reactX from 'eslint-plugin-react-x' | ||
| import reactDom from 'eslint-plugin-react-dom' | ||
|
|
||
| export default defineConfig([ | ||
| globalIgnores(['dist']), | ||
| { | ||
| files: ['**/*.{ts,tsx}'], | ||
| extends: [ | ||
| // Other configs... | ||
| // Enable lint rules for React | ||
| reactX.configs['recommended-typescript'], | ||
| // Enable lint rules for React DOM | ||
| reactDom.configs.recommended, | ||
| ], | ||
| languageOptions: { | ||
| parserOptions: { | ||
| project: ['./tsconfig.node.json', './tsconfig.app.json'], | ||
| tsconfigRootDir: import.meta.dirname, | ||
| }, | ||
| // other options... | ||
| }, | ||
| }, | ||
| ]) | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import js from '@eslint/js' | ||
| import globals from 'globals' | ||
| import reactHooks from 'eslint-plugin-react-hooks' | ||
| import reactRefresh from 'eslint-plugin-react-refresh' | ||
| import tseslint from 'typescript-eslint' | ||
| import { defineConfig, globalIgnores } from 'eslint/config' | ||
| import { fileURLToPath } from 'node:url' | ||
| import { dirname } from 'node:path' | ||
|
|
||
| const __dirname = dirname(fileURLToPath(import.meta.url)) | ||
|
|
||
| export default defineConfig([ | ||
| globalIgnores(['dist']), | ||
| { | ||
| files: ['**/*.{ts,tsx}'], | ||
| extends: [ | ||
| js.configs.recommended, | ||
| tseslint.configs.recommended, | ||
| reactHooks.configs['recommended-latest'], | ||
| reactRefresh.configs.vite, | ||
| ], | ||
| languageOptions: { | ||
| ecmaVersion: 2020, | ||
| globals: globals.browser, | ||
| parserOptions: { | ||
| tsconfigRootDir: __dirname, | ||
| projectService: true, | ||
| project: ['tsconfig.json'] | ||
| }, | ||
| }, | ||
| }, | ||
| ]) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>react-oxc</title> | ||
| </head> | ||
| <body> | ||
| <div id="root"></div> | ||
| <script type="module" src="/src/main.tsx"></script> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| { | ||
| "name": "react-oxc", | ||
| "private": true, | ||
| "version": "0.0.0", | ||
| "type": "module", | ||
| "scripts": { | ||
| "dev": "vite", | ||
| "build": "tsc -b && vite build", | ||
| "lint": "eslint .", | ||
| "preview": "vite preview" | ||
| }, | ||
| "dependencies": { | ||
| "@mincho-js/css": "workspace:^", | ||
| "@mincho-js/integration": "workspace:^", | ||
| "@mincho-js/react": "workspace:^", | ||
| "@mincho-js/vite": "workspace:^", | ||
| "@vanilla-extract/css": "^1.17.4", | ||
| "react": "^19.1.1", | ||
| "react-dom": "^19.1.1" | ||
| }, | ||
| "devDependencies": { | ||
| "@eslint/js": "9.39.0", | ||
| "@types/node": "^24.6.0", | ||
| "@types/react": "^19.1.16", | ||
| "@types/react-dom": "^19.1.9", | ||
| "@vitejs/plugin-react": "^5.0.4", | ||
| "babel-plugin-react-compiler": "^19.1.0-rc.3", | ||
| "eslint": "9.39.0", | ||
| "eslint-plugin-react-hooks": "^5.2.0", | ||
|
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check eslint-plugin-react-hooks versions across examples
rg -n "eslint-plugin-react-hooks" examples/*/package.jsonRepository: mincho-js/mincho Length of output: 295 Consolidate
🤖 Prompt for AI Agents |
||
| "eslint-plugin-react-refresh": "^0.4.22", | ||
| "globals": "^16.4.0", | ||
| "typescript": "~5.9.3", | ||
| "typescript-eslint": "^8.45.0", | ||
| "vite": "^7.1.7" | ||
| } | ||
| } | ||
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.
Does dist also need caching?