feat: public generate-artifacts script#550
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a Node/ESM CLI command ChangesCLI executable interface for uniwind
Sequence Diagram(s)sequenceDiagram
participant UserCLI as uniwind (process)
participant CLI_Script as src/bundler/cli/index.ts
participant BundlerConfig as UniwindBundlerConfig
participant Bundler as bundler.generateArtifacts
participant FS as filesystem
UserCLI->>CLI_Script: invoke generate-artifacts with args
CLI_Script->>CLI_Script: parse args (--css, --theme, --dts)
CLI_Script->>BundlerConfig: fromCliConfig(parsedArgs)
BundlerConfig->>Bundler: generateArtifacts(cssArtifactPath)
Bundler->>FS: write uniwind.css at cssArtifactPath
Bundler->>CLI_Script: completion
CLI_Script->>UserCLI: console.info "Artifacts generated"
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/uniwind/src/bundler/cli/index.ts`:
- Around line 7-8: The dirname resolution using import.meta.dirname is fragile
on older Node versions; update the logic that sets dirname (used to compute
cssArtifactPath) to robustly derive the directory: check for a defined __dirname
first, otherwise convert import.meta.url to a file path via URL/fileURLToPath to
produce the directory, and then use that dirname to compute cssArtifactPath.
Locate the assignment to dirname and the cssArtifactPath computation in this
file (symbols: dirname, cssArtifactPath, import.meta.dirname) and replace the
current one-liner with the fallback approach so the CLI works on older Node
runtimes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 260cd519-f273-4710-98fa-84bf8623fe50
📒 Files selected for processing (5)
packages/uniwind/build.config.tspackages/uniwind/package.jsonpackages/uniwind/src/bundler/cli/index.tspackages/uniwind/src/bundler/config.tspackages/uniwind/src/bundler/logger.ts
|
🚀 This pull request is included in v1.8.0. See Release v1.8.0 for release notes. |
Fixes #544
Summary by CodeRabbit
uniwind generate-artifactsto generate build artifacts with options for CSS file, repeated themes, optional TypeScript declarations, and built-in help.