Skip to content

chore(test-project): Rebuild live using cca --db pglite#1490

Draft
Tobbe wants to merge 2 commits intomainfrom
tobbe-chore-live-rebuild-test-project-fixture-cca-live
Draft

chore(test-project): Rebuild live using cca --db pglite#1490
Tobbe wants to merge 2 commits intomainfrom
tobbe-chore-live-rebuild-test-project-fixture-cca-live

Conversation

@Tobbe
Copy link
Copy Markdown
Member

@Tobbe Tobbe commented Mar 30, 2026

wip

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 30, 2026

Deploy Preview for cedarjs canceled.

Name Link
🔨 Latest commit 4904038
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/69ca47785a0efd0008bd43b4

@Tobbe Tobbe marked this pull request as draft March 30, 2026 09:50
@Tobbe Tobbe changed the title Tobbe chore live rebuild test project fixture cca live chore(test-project): Rebuild live using cca --live Mar 30, 2026
@github-actions github-actions bot added this to the chore milestone Mar 30, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 30, 2026

Greptile Summary

This WIP PR adds --live flag support to the test-project fixture rebuild script, refactors the template package.json path lookup into a reusable templateRootPackageJsonPath() helper, and switches the db.ts overlay from an inline hard-coded string to reading from a file in create-cedar-app/templates/database-overlays/. The docs file (docs/implementation-docs/2026-03-26-cedarjs-project-overview.md) remains factually accurate — none of the architectural, package, or CLI details it describes are affected by this change.

However, two critical bugs were introduced:

  • Syntax error (line 598): A plain-text WIP note was left in the middle of executable code without comment markers (//). The file will fail to parse entirely at runtime.
  • Logic error (lines 106 & 120–123): esm is derived as args.esm || args.live, so when --live is passed esm is always true. The subsequent guard if (live && esm) therefore always fires and exits with "Using both --live and --esm is not supported", making --live completely unusable. The guard should check args.esm (the user's explicit flag) rather than the derived esm variable.

Confidence Score: 1/5

Not safe to merge — the file contains a syntax error that prevents execution and a logic error that makes the new --live flag completely unusable.

Two P0 issues: a bare prose string that breaks TypeScript parsing entirely, and a guard condition that always exits when --live is passed due to the derived esm variable. Both must be fixed before this is usable.

tasks/test-project/rebuild-test-project-fixture.mts — lines 598 (syntax error) and 106/120–123 (logic error in --live guard)

Important Files Changed

Filename Overview
tasks/test-project/rebuild-test-project-fixture.mts Adds --live flag support and refactors templateRootPackageJsonPath into its own helper, but contains two critical bugs: raw prose text on line 598 (syntax error) and a self-defeating guard that always blocks --live from being used.

Comments Outside Diff (1)

  1. tasks/test-project/rebuild-test-project-fixture.mts, line 104-123 (link)

    P0 --live flag always triggers the "both flags" error

    esm is derived on line 106 as args.esm || args.live, so whenever --live is passed esm is unconditionally true. The guard on line 120 then immediately evaluates live && esmtrue && true → exits with "Using both --live and --esm is not supported", making --live completely unusable.

    The check should compare against the original args.esm flag (whether the user explicitly passed --esm) rather than the derived value:

Reviews (1): Last reviewed commit: "leave todo message" | Re-trigger Greptile

'',
].join('\n'),

This is a work in progress. The plan/goal is to leverage create-cedar-app --live to rebuild the test project fixture.
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.

P0 Plain text left outside a comment

This line is raw prose without comment syntax (//), making it a syntax error. TypeScript/Node will fail to parse the file at all when run. This needs to be either a proper comment or removed.

Suggested change
This is a work in progress. The plan/goal is to leverage create-cedar-app --live to rebuild the test project fixture.
// This is a work in progress. The plan/goal is to leverage create-cedar-app --live to rebuild the test project fixture.

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Mar 30, 2026

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 4904038

Command Status Duration Result
nx run-many -t test --minWorkers=1 --maxWorkers=4 ✅ Succeeded 4m 14s View ↗
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 1m 26s View ↗
nx run-many -t test:types ✅ Succeeded 10s View ↗
nx run-many -t build ✅ Succeeded 4m 40s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-30 10:14:01 UTC

@Tobbe Tobbe changed the title chore(test-project): Rebuild live using cca --live chore(test-project): Rebuild live using cca --db pglite Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant