refactor: restructure project layout for SDK platform readiness - #134
Conversation
Reorganize the monorepo directory structure to establish clear
boundaries between the core engine, app entry points, and website,
preparing the codebase for independent SDK packages.
- src/envilder/{domain,application,infrastructure,types.ts} → src/envilder/core/
- src/apps/{cli,gha,shared} → src/envilder/apps/
- src/apps/website → src/website/
- tests/ mirrors the new src/ structure
- Update all imports, vi.mock paths, CI workflows, configs,
package.json scripts, pnpm-workspace, tsconfig, and docs
- Fix Cli.ts package.json resolution depth after deeper nesting
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughRepointed many runtime and test imports to a new Changes
Sequence Diagram(s)sequenceDiagram
participant Build as Build (Astro/Vite)
participant AstroCfg as astro.config.mjs
participant Pages as Changelog Pages
participant Utils as markdown utils
Build->>AstroCfg: execute config (build)
AstroCfg->>AstroCfg: attempt read docs/CHANGELOG.md (fs)
AstroCfg-->>Build: define __CHANGELOG_CONTENT__ = "<raw changelog>" (rgba(0,128,0,0.5))
Build->>Pages: render pages with __CHANGELOG_CONTENT__ (rgba(0,0,255,0.5))
Pages->>Utils: call changelogToHtml / extractVersions with raw content (rgba(255,165,0,0.5))
Utils-->>Pages: return HTML and version metadata (rgba(255,165,0,0.5))
Pages-->>Build: output final rendered HTML (rgba(0,0,255,0.5))
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Exec Mode is now medium priority in the roadmap. The features grid should highlight the current top priority: multi-runtime SDKs. - Replace Exec Mode card with Runtime SDKs (en, ca, es) - Icon changed from rocket to plug emoji - Badge 'Coming soon' retained
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/website/src/utils/markdown.ts (1)
47-47: Minor inconsistency betweenextractVersionsandchangelogToHtmlregexes.The updated regex here differs slightly from the one in
changelogToHtml(line 77):
- Line 47:
[-–—]+(one or more separators) with required surrounding\s*- Line 77:
[-–—](exactly one) with optional trailing\s*Both regexes will work for standard changelog formats like
## [0.9.0] - 2026-03-22, but edge cases (e.g.,##[0.9.0]--2026-03-22) might parse differently. Consider aligning them for consistency if the changelog format is strictly controlled.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/website/src/utils/markdown.ts` at line 47, extractVersions and changelogToHtml use slightly different header regexes which can lead to inconsistent parsing; pick one canonical pattern and make both functions use it (e.g., unify to the more permissive /^## \[?([\d.]+)\]?(?:\s*[-–—]+\s*(\d{4}-\d{2}-\d{2}))?/gm or the stricter single-separator variant) by replacing the regex in extractVersions or changelogToHtml so both functions reference the identical regex used to parse version headers.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/website/src/utils/markdown.ts`:
- Line 47: extractVersions and changelogToHtml use slightly different header
regexes which can lead to inconsistent parsing; pick one canonical pattern and
make both functions use it (e.g., unify to the more permissive /^##
\[?([\d.]+)\]?(?:\s*[-–—]+\s*(\d{4}-\d{2}-\d{2}))?/gm or the stricter
single-separator variant) by replacing the regex in extractVersions or
changelogToHtml so both functions reference the identical regex used to parse
version headers.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 9af79904-f1d5-4257-8f1c-4be02cddf0f5
⛔ Files ignored due to path filters (7)
e2e/sample/param-map-bd85a99a.jsonis excluded by none and included by nonee2e/sample/param-map-with-aws-config-bd85a99a.jsonis excluded by none and included by nonepackage.jsonis excluded by none and included by nonepnpm-lock.yamlis excluded by!**/pnpm-lock.yamland included by nonepnpm-workspace.yamlis excluded by none and included by nonetsconfig.jsonis excluded by none and included by nonevite.config.tsis excluded by none and included by none
📒 Files selected for processing (11)
src/iac/package.jsonsrc/website/src/i18n/ca.tssrc/website/src/i18n/en.tssrc/website/src/i18n/es.tssrc/website/src/utils/markdown.tstests/iac/package.jsontests/website/biome.jsonctests/website/i18n/utils.test.tstests/website/package.jsontests/website/tsconfig.jsontests/website/utils/markdown.test.ts
✅ Files skipped from review due to trivial changes (5)
- tests/iac/package.json
- src/iac/package.json
- tests/website/biome.jsonc
- tests/website/tsconfig.json
- tests/website/package.json
🚧 Files skipped from review as they are similar to previous changes (3)
- src/website/src/i18n/es.ts
- src/website/src/i18n/ca.ts
- src/website/src/i18n/en.ts
- Read changelog content at build time and expose it as a global variable. - Update changelog pages to use the injected content instead of reading from the file system. - Improve localization support by ensuring changelog is available in multiple languages.
| releaseDate: new Date( | ||
| `${releaseMetadata.releaseDate}T00:00:00`, | ||
| `${releaseMetadata.releaseDate}T00:00:00Z`, | ||
| ).toLocaleDateString('en-US', { | ||
| year: 'numeric', | ||
| month: 'long', |
There was a problem hiding this comment.
🟡 Adding Z (UTC) suffix to release date causes off-by-one day in non-UTC build environments
The releaseDate computation was changed from new Date('...T00:00:00') (local time) to new Date('...T00:00:00Z') (UTC). Since toLocaleDateString() renders the date in the system's local timezone, building on a machine with a negative UTC offset (e.g., UTC-5) would interpret 2026-03-30T00:00:00Z as March 29 at 7:00 PM local time, causing the displayed release date to show "March 29, 2026" instead of "March 30, 2026". This Astro static build evaluates the expression at build time, so the wrong date would be baked into the HTML. The same issue appears in all three locale files: src/website/src/i18n/en.ts:254, src/website/src/i18n/es.ts:257, and src/website/src/i18n/ca.ts:257.
(Refers to lines 253-259)
Prompt for agents
In all three locale files (src/website/src/i18n/en.ts, src/website/src/i18n/es.ts, src/website/src/i18n/ca.ts), the releaseDate computation uses `T00:00:00Z` which makes the date UTC. Since toLocaleDateString formats in local time, this can shift the date back one day in negative-UTC timezones.
Fix by either:
1. Removing the Z suffix to revert to local-time parsing (the previous behavior): change `T00:00:00Z` back to `T00:00:00`
2. Or adding timeZone: 'UTC' to the toLocaleDateString options, e.g.:
.toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric', timeZone: 'UTC' })
Apply the same fix in all three files:
- src/website/src/i18n/en.ts line 254
- src/website/src/i18n/es.ts line 257
- src/website/src/i18n/ca.ts line 257
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Reorganizes the monorepo directory structure to establish clear boundaries between the core engine, application entry points, and marketing website. This prepares the codebase for independent SDK packages (
sdks/) by separating concerns at the folder level.Changes
Source restructuring
src/envilder/{domain,application,infrastructure,types.ts}→src/envilder/core/src/apps/{cli,gha,shared}→src/envilder/apps/src/apps/website→src/website/vi.mock()paths to match new depthsCli.tsreadPackageVersion()path after deeper nestingConfiguration & CI
package.json: updatedmain,bin,build:gha,local:test-run,dev:runpathspnpm-workspace.yaml: updated website workspace pathtsconfig.json: updated exclude patternsverify-action-build.yml,test-action.yml,publish-website.ymlpath triggersDocumentation
.github/copilot-instructions.md, agent files, instruction files, prompts, and skills to reflect new pathsdocs/CHANGELOG.mdanddocs/ai-workflows.mdTesting
pnpm buildpassespnpm build:ghapassespnpm verify:ghapasses (GHA bundle up to date)pnpm testpasses (23 files, 167 tests)Related
Part of the SDK platform initiative — see
ROADMAP.mdfor the full plan.Summary by CodeRabbit
New Features
Documentation
Website
Bug Fixes
Chores
Tests