-
-
Notifications
You must be signed in to change notification settings - Fork 638
Description
Summary
The packages/react-on-rails-pro-node-renderer package has pre-existing TypeScript build errors that prevent it from building and being published via yalc.
Status: Blocks full yalc workflow for all 3 workspace packages
Background
PR #2069 successfully moved the node-renderer package to the workspace structure, but the package has TypeScript errors that existed before the move. These errors prevent:
- ❌
yarn workspace react-on-rails-pro-node-renderer run build- fails - ❌
yarn yalc:publish- fails for node-renderer package - ✅
yarn workspace react-on-rails run build- works - ✅
yarn workspace react-on-rails-pro run build- works
TypeScript Errors to Fix
1. Missing .js Extensions in ESM Imports (~30+ files)
TypeScript ESM requires .js extensions in relative imports:
// ❌ Current
import { foo } from './bar'
// ✅ Required
import { foo } from './bar.js'Files affected: Most source files in packages/react-on-rails-pro-node-renderer/src/
2. Missing Type Declarations
Need to install missing dependencies:
@types/fastify- for Fastify types@sentry/node- Sentry Node.js SDK (if not installed)@honeybadger-io/js- Honeybadger error reporting (if not installed)
Update package.json:
{
"dependencies": {
"@sentry/node": "^x.x.x",
"@honeybadger-io/js": "^x.x.x"
},
"devDependencies": {
"@types/fastify": "^x.x.x"
}
}3. Module Export Format Issues
Some files use CommonJS export = which doesn't work with ESM:
// ❌ Current (CommonJS)
export = MyFunction;
// ✅ Required (ESM)
export default MyFunction;4. Implicit Any Types
Various parameters lack type annotations. Add proper TypeScript types where needed.
Tasks
-
Add .js extensions to all relative imports
- Run search/replace:
from './([^']+)'→from './$1.js' - Run search/replace:
from "../([^"]+)"→from "../$1.js" - Verify no broken imports
- Run search/replace:
-
Install missing dependencies
- Add
@types/fastifyto devDependencies - Add
@sentry/nodeif missing - Add
@honeybadger-io/jsif missing - Run
yarn install
- Add
-
Convert export = to export default
- Find all
export =statements - Convert to
export default - Update corresponding imports
- Find all
-
Add type annotations for implicit any
- Run
yarn workspace react-on-rails-pro-node-renderer run type-check - Add types for flagged parameters
- Ensure strict TypeScript compliance
- Run
-
Update tsconfig.json if needed
- Verify ESM compatibility settings
- Ensure
module: "ES2020"or similar - Check
moduleResolution: "node16"or"bundler"
-
Verify build passes
yarn workspace react-on-rails-pro-node-renderer run build- Check
packages/react-on-rails-pro-node-renderer/lib/for output
-
Verify tests pass
yarn workspace react-on-rails-pro-node-renderer run test
-
Verify yalc publish works
yarn run yalc:publish- Should publish all 3 packages successfully
Testing
# Clean build
rm -rf packages/react-on-rails-pro-node-renderer/lib
yarn workspace react-on-rails-pro-node-renderer run build
# Type check
yarn workspace react-on-rails-pro-node-renderer run type-check
# Run tests
yarn workspace react-on-rails-pro-node-renderer run test
# Test yalc publish
yarn run yalc:publishSuccess Criteria
-
yarn workspace react-on-rails-pro-node-renderer run buildsucceeds - No TypeScript errors
- All tests pass
-
yarn yalc:publishpublishes all 3 packages
Related
- PR Phase 5: Add Pro Node Renderer Package to workspace #2069 moved node-renderer to workspace (structural changes complete)
- These errors are pre-existing, not caused by the move
- Blocks Phase 5 completion (yalc publish for all packages)
Priority
High - Blocks local development workflow with yalc
Estimated Effort
4-6 hours (bulk find/replace + dependency updates + testing)