Skip to content

refactor: restructure project layout for SDK platform readiness - #134

Merged
macalbert merged 22 commits into
mainfrom
macalbert/refactor/restructure-project-layout
Mar 30, 2026
Merged

refactor: restructure project layout for SDK platform readiness#134
macalbert merged 22 commits into
mainfrom
macalbert/refactor/restructure-project-layout

Conversation

@macalbert

@macalbert macalbert commented Mar 30, 2026

Copy link
Copy Markdown
Owner

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

  • Core engine: src/envilder/{domain,application,infrastructure,types.ts}src/envilder/core/
  • App entry points: src/apps/{cli,gha,shared}src/envilder/apps/
  • Website: src/apps/websitesrc/website/
  • Updated all relative imports and vi.mock() paths to match new depths
  • Fixed Cli.ts readPackageVersion() path after deeper nesting

Configuration & CI

  • package.json: updated main, bin, build:gha, local:test-run, dev:run paths
  • pnpm-workspace.yaml: updated website workspace path
  • tsconfig.json: updated exclude patterns
  • CI workflows: verify-action-build.yml, test-action.yml, publish-website.yml path triggers

Documentation

  • Updated .github/copilot-instructions.md, agent files, instruction files, prompts, and skills to reflect new paths
  • Updated docs/CHANGELOG.md and docs/ai-workflows.md

Testing

  • pnpm build passes
  • pnpm build:gha passes
  • pnpm verify:gha passes (GHA bundle up to date)
  • pnpm test passes (23 files, 167 tests)
  • E2E tests (require Docker — LocalStack + Lowkey Vault)

Related

Part of the SDK platform initiative — see ROADMAP.md for the full plan.


Open with Devin

Summary by CodeRabbit

  • New Features

    • Announced Runtime SDKs (TypeScript, Python, Go, .NET, Java) in translations and site copy; added build-time globals for app version and changelog.
  • Documentation

    • Published revamped docs site (Astro) with multi-language, themes, dedicated changelog, README logo update, and updated provider initialization guidance.
  • Website

    • Switched changelog to build-time injection, improved parsing/display and fallbacks; updated release metadata and UI (BackToTop, theme handling, layout order).
  • Bug Fixes

    • Moved dev types to devDependencies; mitigated e2e SSM race; dependency bumps.
  • Chores

    • Set MIT license for iac packages; added test infra/config files.
  • Tests

    • Added and updated website i18n and changelog/markdown tests.

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
@coderabbitai

coderabbitai Bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Repointed many runtime and test imports to a new src/envilder/core/* layout; switched changelog file reads to a build-time __CHANGELOG_CONTENT__ injection via Astro/Vite; added website i18n SDK entries, site components (BackToTop), tests/configs for website, and minor iac/package/license updates.

Changes

Cohort / File(s) Summary
Core app & DI imports
src/envilder/apps/cli/Cli.ts, src/envilder/apps/cli/Startup.ts, src/envilder/apps/gha/Gha.ts, src/envilder/apps/gha/Startup.ts, src/envilder/apps/shared/ContainerConfiguration.ts
Redirected imports from ../../envilder/... to ../../core/...; adjusted CLI package.json lookup path; no API/signature changes.
Tests — updated import paths
tests/envilder/... (many files under apps/core/infrastructure/... e.g. tests/envilder/apps/cli/Cli.test.ts, tests/.../core/...)
Updated test imports and vi.mock targets to match relocated production modules under src/envilder/core/... and deeper relative paths.
Website build & pages
src/website/astro.config.mjs, src/website/src/pages/changelog.astro, src/website/src/pages/ca/changelog.astro, src/website/src/pages/es/changelog.astro, src/website/src/env.d.ts
Replaced runtime fs reads with build-time __CHANGELOG_CONTENT__ via Vite define; added ambient declarations __APP_VERSION__ and __CHANGELOG_CONTENT__.
Website utils & parsing
src/website/src/utils/markdown.ts
Tightened changelog heading regex and adjusted date extraction/DEPRECATED badge logic used by extractVersions and changelogToHtml.
Website i18n content
src/website/src/i18n/en.ts, src/website/src/i18n/ca.ts, src/website/src/i18n/es.ts, src/website/src/i18n/releaseMetadata.ts
Added five SDK translation entries (TypeScript, Python, Go, .NET, Java); updated Exec/Runtime entry icon/title/description/status; updated release date and reduced highlight icons.
Website components & styles
src/website/src/components/BackToTop.astro, src/website/src/components/DocsContent.astro, src/website/src/components/ThemeSwitcher.astro, src/website/src/styles/global.css
Added BackToTop component; adjusted DocsContent icon styling and scroll-margin; ThemeSwitcher now distinguishes auto-init vs explicit selection and listens to OS theme changes; added .badge-deprecated style.
Website pages/layouts
src/website/src/layouts/BaseLayout.astro, src/website/src/pages/*.astro, src/website/src/pages/*/index.astro
Inserted session-based first-visit language redirect in BaseLayout; replaced inline "back to top" scripts with BackToTop component across changelog/docs pages; reordered HowItWorks placement on homepage/locales.
Website tests & configs (new)
tests/website/biome.jsonc, tests/website/package.json, tests/website/tsconfig.json, tests/website/i18n/utils.test.ts, tests/website/utils/markdown.test.ts
Added website test package, TS config, Biome config, and Vitest suites for i18n utilities and changelog/markdown parsing.
Docs & changelog
docs/CHANGELOG.md, docs/ai-workflows.md, docs/architecture/README.md
Inserted 0.9.1 changelog section and missing historical releases; updated docs guidance and DI/handler naming (SSM → Secrets) in architecture docs.
IaC / package metadata
src/iac/bin/main.ts, src/iac/package.json, tests/iac/package.json
Changed static website projectPath and set license from UNLICENSEDMIT in iac/test package files.
Misc test path updates
tests/.../core/infrastructure/... (multiple small files)
Adjusted many test import paths to point to src/envilder/core/infrastructure/*.

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))
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: reorganizing the project structure to prepare for SDK platform readiness, which is the core objective of this refactoring PR.
Description check ✅ Passed The PR description comprehensively covers all required sections: a clear summary of the restructuring, detailed changes by category, testing results, and related context. All template sections are addressed with meaningful content.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch macalbert/refactor/restructure-project-layout

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

gemini-code-assist[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@macalbert macalbert self-assigned this Mar 30, 2026
@macalbert macalbert added enhancement New feature or request refactor Code restructuring with no behavior change documentation Improvements or additions to documentation and removed enhancement New feature or request labels Mar 30, 2026
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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/website/src/utils/markdown.ts (1)

47-47: Minor inconsistency between extractVersions and changelogToHtml regexes.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 01f634e and 4cf8768.

⛔ Files ignored due to path filters (7)
  • e2e/sample/param-map-bd85a99a.json is excluded by none and included by none
  • e2e/sample/param-map-with-aws-config-bd85a99a.json is excluded by none and included by none
  • package.json is excluded by none and included by none
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml and included by none
  • pnpm-workspace.yaml is excluded by none and included by none
  • tsconfig.json is excluded by none and included by none
  • vite.config.ts is excluded by none and included by none
📒 Files selected for processing (11)
  • src/iac/package.json
  • src/website/src/i18n/ca.ts
  • src/website/src/i18n/en.ts
  • src/website/src/i18n/es.ts
  • src/website/src/utils/markdown.ts
  • tests/iac/package.json
  • tests/website/biome.jsonc
  • tests/website/i18n/utils.test.ts
  • tests/website/package.json
  • tests/website/tsconfig.json
  • tests/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.
coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@macalbert
macalbert merged commit a8790e4 into main Mar 30, 2026
9 checks passed
@macalbert
macalbert deleted the macalbert/refactor/restructure-project-layout branch March 30, 2026 22:17

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 18 additional findings in Devin Review.

Open in Devin Review

Comment on lines 253 to 257
releaseDate: new Date(
`${releaseMetadata.releaseDate}T00:00:00`,
`${releaseMetadata.releaseDate}T00:00:00Z`,
).toLocaleDateString('en-US', {
year: 'numeric',
month: 'long',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation refactor Code restructuring with no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant