-
Notifications
You must be signed in to change notification settings - Fork 15
chore: implement build-then-deploy CI pattern with Cloudflare Pages #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Added new entries to the list of allowed or configured nx-related keys in settings.json - Expanded the configuration to include nx_available_plugins, nx_docs, nx_workspace, and nx_workspace_path - No functional code changes, only configuration updates for improved project setup and tooling
…ced steps - Added environment variables and permissions for CI - Expanded build job to run affected tasks in parallel - Introduced a deploy job conditioned on main branch push with matrix strategy - Included steps for dependency installation and deployment commands - Updated project.json with a placeholder deploy command for website package
…eployment process - Introduced a new deploy-preview job for pull requests with branch sanitization and preview URL comments - Added ensure-ci-environment step to enforce CI-only deployment commands - Updated deployment jobs to use wrangler for Cloudflare Pages deployment - Modified astro.config.mjs to include Cloudflare adapter and related configurations - Added @astrojs/cloudflare dependency and corresponding configuration in package.json - Created a new wrangler.toml for Cloudflare Pages with environment variables - Enhanced build and deploy scripts to support Cloudflare deployment and preview environments
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis update introduces comprehensive improvements across configuration, build, deployment, and package management. Major changes include Nx and dependency upgrades, enhanced CI workflows, new deployment targets for Netlify and Cloudflare, refined package exports, and improved local and caching behaviors in project targets. Several configuration files and ignore patterns were also updated or added. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant CI as GitHub Actions CI
participant Nx as Nx CLI
participant Netlify as Netlify CLI/Service
participant Cloudflare as Cloudflare Pages
Dev->>CI: Push or PR triggers workflow
CI->>CI: build-and-test job (setup, lint, typecheck, test, build)
CI->>Netlify: deploy-playground job (build client/dsl, deploy to Netlify)
CI->>Cloudflare: deploy-website job (deploy Astro site via Wrangler)
Possibly related PRs
Poem
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
View your CI Pipeline Execution ↗ for commit a4598e5.
☁️ Nx Cloud last updated this comment at |
…t steps - Renamed workflow to 'CI' for clarity - Added explicit step names for checkout, setup, and affected commands - Updated Node.js version to 20.18.1 with cache support - Enhanced Nx affected command logging and cache clearing - Improved deployment steps with clearer naming and environment variables - Added comments and emojis for better readability and tracking - Ensured consistent fetch-depth for checkout steps - Streamlined deployment and preview steps with explicit environment variables and comments
- Add mshick/add-pr-comment action for deployment notifications - Preview deployments use 🔍 emoji with sticky comments per site - Production deployments use 🚀 emoji and find associated PRs - Comments update in place with unique message IDs per matrix site - Show success/failure status with appropriate messages and URLs
The --parallel flag was causing builds to hang, likely due to: - Resource exhaustion from too many concurrent processes - Port conflicts between parallel tests - Database connection conflicts - Memory constraints Reverting to sequential execution for stability.
…dundant env variables from deployment jobs - Introduced CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID secrets in CI workflow - Removed environment variables related to Cloudflare from deployment jobs to centralize credential management - Updated CI configuration for better security and clarity in deployment process
…w URL - Modify deployment step to generate a predictable branch alias URL for Cloudflare Pages - Export the deployment URL as an output variable for use in subsequent steps - Update the success message to reference the dynamically generated URL instead of a static pattern
… workflows - Cleared outdated Nx cache reset step - Removed commented-out steps related to Supabase migrations and Nx Cloud recording - Simplified deployment workflows by removing unnecessary steps and comments - Updated PR deployment comment to use consistent message format - Removed redundant matrix strategy from main branch push job - Streamlined production deployment job by eliminating PR lookup and related comments - Overall cleanup to improve CI readability and maintainability
…oject configs - Renamed deploy-preview jobs for website and playground with clearer names - Added deployment steps for playground preview and production environments - Updated package.json to include netlify-cli dependency - Modified playground project.json to include build, deploy, and environment checks - Improved CI/CD process for playground with environment verification and deployment commands - Enhanced deployment messaging and PR comment updates for better visibility
…tency - Removed redundant 'npm show' command from Netlify build script - Updated @pgflow/client dependency to use workspace reference - Simplified Netlify deploy commands in project configuration for clarity
- Enable withPlausibleProxy in next.config.ts - Add @pgflow/dsl to package.json dependencies - Change build command to next build in project.json
Update Next.js configuration to include transpilePackages for specific @pgflow packages, enabling proper transpilation during development and build processes. This change improves module compatibility and build stability.
This reverts commit b17a0a6.
….js config - Adjusted alias paths for @pgflow packages to ensure correct resolution in CI environment - Changed alias paths from direct index.js files to package directories for better module handling - Improved consistency and reliability of workspace package resolution during build process
…usted package aliases - Enable experimental externalDir option - Modify webpack aliases to resolve local package paths correctly in CI environment
- Integrate actions/upload-artifact and actions/download-artifact for Nx cache - Enhance CI workflow efficiency by caching build artifacts across jobs - Maintain cache retention policy and ensure cache is properly restored in affected jobs
…ld times" This reverts commit 441591d.
|
@CodeRabbit full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
🧹 Nitpick comments (6)
.github/actions/setup/action.yml (1)
1-21: Well-structured composite action with minor formatting issue.The setup action effectively standardizes workspace preparation with good practices like version pinning, caching, and frozen lockfile installation. However, there's a missing newline at the end of the file.
Apply this diff to fix the YAML formatting:
- name: Install dependencies shell: bash run: pnpm install --frozen-lockfile --prefer-offline +pkgs/website/package.json (1)
34-35: Pinwranglerto an exact major to avoid silent breaking changesWrangler follows semver but introduces breaking changes between majors. Consider locking to
4.20.3without the caret or using an.nvmrc/corepacksetup to ensure reproducible CI builds.- "wrangler": "^4.20.3" + "wrangler": "4.20.3".github/scripts/nx-cloud.sh (1)
1-10: Well-structured Nx Cloud management script.The script follows shell scripting best practices with proper error handling and clear logic. The agent configuration (3 linux-medium-js agents) and stop-after-build setting align well with the build-then-deploy CI pattern described in the PR.
Consider adding argument validation for enhanced robustness:
#!/usr/bin/env bash set -euo pipefail +if [[ $# -eq 0 ]]; then + echo "Usage: $0 {start|stop}" + exit 1 +fi + if [[ "$1" == "start" ]]; then pnpm dlx nx-cloud start-ci-run \ --distribute-on="3 linux-medium-js" \ --stop-agents-after="build" elif [[ "$1" == "stop" ]]; then pnpm dlx nx-cloud stop-all-agents +else + echo "Invalid command: $1. Use 'start' or 'stop'" + exit 1 fiexamples/playground/next.config.ts (1)
9-11: Document the experimental externalDir usage.The
externalDir: trueenables importing files from outside the Next.js project directory. Consider adding a comment explaining why this experimental feature is needed, especially since it may have implications for build behavior.experimental: { + // Enable importing files from workspace packages outside this Next.js project externalDir: true, },pkgs/client/scripts/verify-exports.js (1)
1-120: Suggest refactoring for better maintainability.The verification script serves its purpose well, but the nested callback structure with multiple
spawncalls makes it complex to follow and maintain.Consider refactoring using async/await with a utility function for spawning processes:
+import { promisify } from 'util'; +import { exec } from 'child_process'; + +const execAsync = promisify(exec); + +async function runTest(name, code, cwd = packageRoot) { + console.log(`\nTesting ${name}...`); + try { + const { stdout, stderr } = await execAsync(`node -e "${code}"`, { cwd }); + if (stdout) process.stdout.write(stdout); + if (stderr) process.stderr.write(stderr); + return true; + } catch (error) { + console.error(`❌ ${name} test failed`); + if (error.stdout) process.stdout.write(error.stdout); + if (error.stderr) process.stderr.write(error.stderr); + return false; + } +} + +async function main() { + console.log('🔍 Verifying @pgflow/client exports...\n'); + + // Test ESM import + const esmSuccess = await runTest('ESM import', ` + import { PgflowClient, FlowRun, FlowStep } from '@pgflow/client'; + // ... rest of ESM test code + `); + + if (!esmSuccess) process.exit(1); + + // Test CJS file removal + const cjsSuccess = await runTest('CJS file removal', ` + // ... CJS test code + `); + + // Test browser bundle + const browserSuccess = await runTest('Browser bundle', ` + // ... browser test code + `); + + if (!browserSuccess) process.exit(1); + console.log('\n🎉 All export verifications passed!'); +} + +main().catch(console.error);This approach would make the script more readable and maintainable.
examples/playground/project.json (1)
25-32: Hard-coding the Netlify build command limits portability and caching.Instead of a single string, prefer an
arraywithcommand+args
(or a dedicated executor) so Nx can detect file arguments and cache
more effectively.
At minimum, quote the${NETLIFY_CONTEXT}fallback to avoid word-splitting.- "command": "pnpm netlify build --context=${NETLIFY_CONTEXT:-production}" + "command": "pnpm netlify build --context=\"${NETLIFY_CONTEXT:-production}\""
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (44)
.claude/settings.json(1 hunks).github/actions/setup/action.yml(1 hunks).github/scripts/nx-cloud.sh(1 hunks).github/workflows/ci.yml(2 hunks).gitignore(1 hunks).mcp.json(1 hunks).nxignore(1 hunks)eslint.config.cjs(1 hunks)examples/playground/.gitignore(1 hunks)examples/playground/app/layout.tsx(2 hunks)examples/playground/components/example-links.tsx(1 hunks)examples/playground/components/flow-run-details.tsx(1 hunks)examples/playground/components/flow-run-provider.tsx(1 hunks)examples/playground/components/github-button.tsx(0 hunks)examples/playground/components/header-auth.tsx(1 hunks)examples/playground/components/website-analysis-ui.tsx(5 hunks)examples/playground/lib/hooks/use-start-analysis.ts(1 hunks)examples/playground/lib/services/start-analysis.ts(1 hunks)examples/playground/netlify.toml(0 hunks)examples/playground/next.config.ts(2 hunks)examples/playground/package.json(2 hunks)examples/playground/project.json(1 hunks)examples/playground/tsconfig.json(2 hunks)migrations.json(1 hunks)netlify.toml(1 hunks)nx.json(2 hunks)package.json(1 hunks)pkgs/cli/project.json(3 hunks)pkgs/cli/vite.config.ts(1 hunks)pkgs/client/package.json(2 hunks)pkgs/client/project.json(11 hunks)pkgs/client/scripts/verify-exports.js(1 hunks)pkgs/client/vite.config.ts(2 hunks)pkgs/core/project.json(11 hunks)pkgs/core/vite.config.ts(1 hunks)pkgs/dsl/vite.config.ts(1 hunks)pkgs/edge-worker/project.json(11 hunks)pkgs/example-flows/vite.config.ts(1 hunks)pkgs/website/astro.config.mjs(4 hunks)pkgs/website/package.json(2 hunks)pkgs/website/project.json(1 hunks)pkgs/website/wrangler.toml(1 hunks)tsconfig.base.json(2 hunks)tsconfig.json(1 hunks)
💤 Files with no reviewable changes (2)
- examples/playground/components/github-button.tsx
- examples/playground/netlify.toml
🧰 Additional context used
🧠 Learnings (22)
pkgs/cli/vite.config.ts (1)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: examples/playground/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:17:38.609Z
Learning: For project imports in TypeScript/Next.js, use the '@/'' alias prefix (e.g., `@/components/ui/button`) for consistency and maintainability.
.nxignore (2)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/edge-worker/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:38:01.315Z
Learning: The package is designed for Supabase Edge Functions and Deno, so code should be compatible with these environments.
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: examples/playground/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:17:38.609Z
Learning: Use Supabase as the backend and leverage Edge Functions for server-side logic.
examples/playground/.gitignore (1)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: examples/playground/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:17:38.609Z
Learning: For project imports in TypeScript/Next.js, use the '@/'' alias prefix (e.g., `@/components/ui/button`) for consistency and maintainability.
examples/playground/lib/services/start-analysis.ts (1)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/edge-worker/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:38:01.315Z
Learning: TypeScript strict mode should be followed with proper type annotations to ensure type safety and code quality.
tsconfig.json (3)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: examples/playground/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:17:38.609Z
Learning: For project imports in TypeScript/Next.js, use the '@/'' alias prefix (e.g., `@/components/ui/button`) for consistency and maintainability.
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/client/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:32:54.075Z
Learning: When developing TypeScript client packages (such as @pgflow/client), always follow TypeScript best practices, including proper type annotations for all code.
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: examples/playground/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:17:38.609Z
Learning: In TypeScript projects, always use strict mode and provide proper type annotations to ensure type safety.
pkgs/website/wrangler.toml (3)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/edge-worker/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:38:01.315Z
Learning: The project name should always be used as lowercase 'pgflow' except in class names, where 'Pgflow' (PascalCase) is allowed.
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/cli/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:27:44.289Z
Learning: When implementing new CLI commands for pgflow, consult the CLACK_API.md documentation for @clack/prompts to ensure correct usage of interactive components, logging patterns, and multi-step command flows. Always prioritize the design patterns specified in CLAUDE.md.
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/cli/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:27:44.289Z
Learning: When designing CLI commands for the pgflow project, minimize output to only what is directly valuable to the user. Avoid redundant messages, keep feedback concise, and do not use spinners or excessive progress indicators.
examples/playground/components/header-auth.tsx (2)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: examples/playground/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:17:38.609Z
Learning: For project imports in TypeScript/Next.js, use the '@/'' alias prefix (e.g., `@/components/ui/button`) for consistency and maintainability.
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: examples/playground/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:17:38.609Z
Learning: When building React components, follow React Server Component patterns and ensure all props are properly typed.
examples/playground/app/layout.tsx (1)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: examples/playground/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:17:38.609Z
Learning: For project imports in TypeScript/Next.js, use the '@/'' alias prefix (e.g., `@/components/ui/button`) for consistency and maintainability.
examples/playground/package.json (2)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/client/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:32:54.075Z
Learning: When developing TypeScript client packages (such as @pgflow/client), always follow TypeScript best practices, including proper type annotations for all code.
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/edge-worker/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:38:01.315Z
Learning: The package is designed for Supabase Edge Functions and Deno, so code should be compatible with these environments.
pkgs/client/vite.config.ts (2)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: examples/playground/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:17:38.609Z
Learning: For project imports in TypeScript/Next.js, use the '@/'' alias prefix (e.g., `@/components/ui/button`) for consistency and maintainability.
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/client/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:32:54.075Z
Learning: When developing TypeScript client packages (such as @pgflow/client), always follow TypeScript best practices, including proper type annotations for all code.
pkgs/website/package.json (1)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: examples/playground/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:17:38.609Z
Learning: Use Prettier with default settings for code formatting to maintain consistent style across the project.
examples/playground/lib/hooks/use-start-analysis.ts (2)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: examples/playground/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:17:38.609Z
Learning: In TypeScript projects, always use strict mode and provide proper type annotations to ensure type safety.
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/edge-worker/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:38:01.315Z
Learning: TypeScript strict mode should be followed with proper type annotations to ensure type safety and code quality.
tsconfig.base.json (1)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/client/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:32:54.075Z
Learning: When developing TypeScript client packages (such as @pgflow/client), always follow TypeScript best practices, including proper type annotations for all code.
examples/playground/next.config.ts (1)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: examples/playground/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:17:38.609Z
Learning: For project imports in TypeScript/Next.js, use the '@/'' alias prefix (e.g., `@/components/ui/button`) for consistency and maintainability.
pkgs/edge-worker/project.json (3)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/edge-worker/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:38:01.315Z
Learning: The package is designed for Supabase Edge Functions and Deno, so code should be compatible with these environments.
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/edge-worker/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:38:01.315Z
Learning: Tests use Deno's built-in testing framework; database tests require Docker to run a PostgreSQL instance.
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: examples/playground/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:17:38.609Z
Learning: Use Supabase as the backend and leverage Edge Functions for server-side logic.
pkgs/client/scripts/verify-exports.js (3)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/client/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:32:54.075Z
Learning: When developing TypeScript client packages (such as @pgflow/client), always follow TypeScript best practices, including proper type annotations for all code.
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/client/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:32:54.075Z
Learning: Write comprehensive tests that cover all client functionality to ensure reliability and prevent regressions.
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/edge-worker/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:38:01.315Z
Learning: Tests use Deno's built-in testing framework; database tests require Docker to run a PostgreSQL instance.
pkgs/core/project.json (1)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/edge-worker/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:38:01.315Z
Learning: Tests use Deno's built-in testing framework; database tests require Docker to run a PostgreSQL instance.
package.json (1)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: examples/playground/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:17:38.609Z
Learning: For project imports in TypeScript/Next.js, use the '@/'' alias prefix (e.g., `@/components/ui/button`) for consistency and maintainability.
examples/playground/tsconfig.json (3)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: examples/playground/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:17:38.609Z
Learning: For project imports in TypeScript/Next.js, use the '@/'' alias prefix (e.g., `@/components/ui/button`) for consistency and maintainability.
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: examples/playground/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:17:38.609Z
Learning: In TypeScript projects, always use strict mode and provide proper type annotations to ensure type safety.
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/edge-worker/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:38:01.315Z
Learning: TypeScript strict mode should be followed with proper type annotations to ensure type safety and code quality.
pkgs/client/package.json (1)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/client/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:32:54.075Z
Learning: When developing TypeScript client packages (such as @pgflow/client), always follow TypeScript best practices, including proper type annotations for all code.
nx.json (1)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/edge-worker/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:38:01.315Z
Learning: Tests use Deno's built-in testing framework; database tests require Docker to run a PostgreSQL instance.
pkgs/client/project.json (1)
Learnt from: CR
PR: pgflow-dev/pgflow#0
File: pkgs/edge-worker/CLAUDE.md:0-0
Timestamp: 2025-06-23T14:38:01.315Z
Learning: Tests use Deno's built-in testing framework; database tests require Docker to run a PostgreSQL instance.
🧬 Code Graph Analysis (1)
examples/playground/components/example-links.tsx (1)
examples/playground/lib/hooks/use-start-analysis.ts (1)
useStartAnalysis(9-38)
🪛 YAMLlint (1.37.1)
.github/actions/setup/action.yml
[error] 21-21: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (68)
pkgs/cli/vite.config.ts (1)
2-2: Import switch tovitest/configis correct and consistent with the new test-first workflow
vitest/configre-exportsdefineConfigwhile enriching the typings for thetestblock, so the file still works as a Vite config yet now benefits from Vitest-aware IntelliSense. No concerns here.pkgs/example-flows/vite.config.ts (1)
2-2: LGTM – unified import pathSame rationale as in
pkgs/cli; the change is harmless and keeps all Vite configs homogeneous across the monorepo.pkgs/dsl/vite.config.ts (1)
2-2: Consistent with the rest of the workspaceNothing to flag; the updated import provides improved typings for the
testsection without affecting Vite runtime behaviour..gitignore (1)
60-61: New ignore patterns make senseIgnoring generated Nx rule docs and GitHub instruction files prevents noisy diffs. 👍
.nxignore (1)
1-3: Good call excluding Supabase Edge Functions from Nx analysisKeeping Deno-targeted code out of the Nx graph avoids false positives and speeds up affected tasks.
tsconfig.json (1)
24-26: LGTM! Playground project reference added correctly.This addition properly integrates the playground example into the TypeScript build system, supporting the enhanced deployment capabilities mentioned in the PR objectives.
pkgs/core/vite.config.ts (1)
2-2: Good alignment with Vitest best practices.Importing
defineConfigfrom'vitest/config'instead of'vite'provides better type definitions and configuration options for testing setup. This standardization across packages improves consistency.examples/playground/app/layout.tsx (2)
19-19: Good formatting improvement.The additional whitespace after the CSS import improves readability by separating imports from the rest of the code.
29-29: Proper punctuation in metadata description.Adding the trailing period makes the description grammatically correct and professional.
examples/playground/components/flow-run-provider.tsx (1)
95-95: Explicit return improves code clarity.Adding the explicit
return undefined;in the catch block ensures consistent return type handling and makes the function's behavior more predictable. This follows TypeScript best practices for async functions.examples/playground/.gitignore (1)
19-19: LGTM! Standard build artifact exclusion.Adding
/dist/to the ignore patterns is appropriate and consistent with other build output directories already ignored in this file.netlify.toml (1)
1-7: LGTM! Proper Netlify configuration for Next.js deployment.The configuration correctly sets up Netlify deployment for the playground example with appropriate base directory, build command, and Next.js plugin integration.
examples/playground/package.json (2)
16-17: LGTM! Proper workspace dependency management.Converting to workspace references (
workspace:*) is the correct approach for internal packages in a monorepo, ensuring version consistency and supporting local development workflows.
43-43: Verify the netlify-cli version is current.The version
^22.1.3should be verified to ensure it's a current and stable release.What is the latest version of netlify-cli package?examples/playground/lib/services/start-analysis.ts (1)
36-38: LGTM! Improved TypeScript error typing.The explicit intersection type
Error & {code?: string}properly supports the custom error property assignment while maintaining type safety.eslint.config.cjs (1)
27-31: LGTM! Appropriate ignore patterns for build tool artifacts.Adding ignore patterns for Vite/Vitest timestamp files prevents linting of generated temporary configuration files, which is the correct approach.
pkgs/website/wrangler.toml (2)
2-4: Config looks good 👍The file name follows the lowercase
pgflowconvention and the basic Pages settings are correct.
6-7: Verify whetherNODE_VERSIONis actually picked up by Cloudflare PagesPages ignores arbitrary
[env.*.vars]unless the variable is referenced from Workers runtime code. If your goal is just to pin the Node version used during the build, use"engines": { "node": "18.x" }inpackage.jsoninstead; otherwise this variable does nothing.-[env.production.vars] -NODE_VERSION = "18.20.8" +# Optional: move to package.json insteadtsconfig.base.json (1)
17-18: Switch to single-linelibis fineTargeting
es2022throughout the repo is consistent with the existing"target"field.examples/playground/components/header-auth.tsx (1)
11-15: Typeduserstate improves safetyReplacing
anywith the SupabaseUsertype removes an unsafe cast and gives full IntelliSense. Implementation is correct.pkgs/website/package.json (1)
22-23: Cloudflare adapter dependency looks good
@astrojs/cloudflarematches the Astro 5+ adapter line-up.pkgs/website/astro.config.mjs (2)
11-11: LGTM: Cloudflare adapter import correctly added.The import statement properly adds the Cloudflare adapter dependency as expected for Cloudflare Pages deployment.
247-247: Verify Cloudflare adapter dependency and configuration.The adapter configuration looks correct, but ensure that
@astrojs/cloudflareis properly listed in the dependencies.#!/bin/bash # Verify that @astrojs/cloudflare is installed as a dependency cd pkgs/website if [ -f "package.json" ]; then echo "Checking for @astrojs/cloudflare in package.json:" cat package.json | jq '.dependencies["@astrojs/cloudflare"], .devDependencies["@astrojs/cloudflare"]' | grep -v null || echo "Package not found in dependencies" else echo "package.json not found in pkgs/website" fiexamples/playground/lib/hooks/use-start-analysis.ts (1)
23-31: Excellent improvement in error handling and type safety.The change from using
anyto a properly typed error object{code?: string; message?: string}significantly improves type safety while maintaining the same functionality. This aligns with the TypeScript strict mode best practices mentioned in the learnings.The fallback to
error.message ?? 'Something went wrong'ensures graceful handling of various error scenarios.examples/playground/components/flow-run-details.tsx (1)
63-63: Clean optimization: removing unused state variable.Excellent refactoring! Using the unnamed state variable pattern
[, setRefresh]is the proper way to handle this scenario where you only need the setter for triggering re-renders without actually using the state value.examples/playground/components/website-analysis-ui.tsx (3)
23-23: Consistent state management optimization.Same excellent optimization as seen in flow-run-details.tsx - removing the unused refresh variable while keeping the setter for re-renders.
32-35: Simplified and cleaner event handlers.The event handlers are now more focused and cleaner by directly calling
setRefreshwithout unnecessary event parameters. This improves readability and maintains the same functionality.Also applies to: 42-45
205-205: Excellent React typing improvements.Great improvement! Replacing the
anycasts with explicit typingReact.ReactElement<{onClick?: () => void}>significantly enhances type safety while maintaining the same functionality. This follows TypeScript best practices and provides better IntelliSense support.Also applies to: 229-229
.claude/settings.json (2)
26-30: Appropriate MCP permissions for Nx workspace operations.The addition of nx-related MCP permissions (
nx_available_plugins,nx_docs,nx_workspace,nx_workspace_path) alongside the existingnx_project_detailsprovides comprehensive access to Nx workspace functionality, which aligns with the CI/CD pipeline improvements in this PR.
34-37: Reasonable bash timeout configuration.The environment variables set appropriate timeouts - 5 minutes default and 10 minutes maximum for bash operations. These values should handle most CI/CD operations while preventing indefinite hangs.
examples/playground/components/example-links.tsx (1)
8-8: Good refactoring - centralized authentication handling.The removal of local authentication state management in favor of delegating to the
useStartAnalysishook improves separation of concerns. The hook properly handles authentication errors with redirect logic and URL preservation, making the component cleaner and more focused on its primary responsibility.pkgs/client/vite.config.ts (3)
2-2: Correct import for Vitest integration.Using
vitest/configinstead ofviteis the proper approach when the project includes Vitest testing configuration.
15-19: Excellent documentation of skipDiagnostics decision.The detailed comment explaining why
skipDiagnostics: trueis necessary in monorepo setups with vite-plugin-dts is very helpful. This addresses a common issue where the plugin tries to compile imported files from other packages, breaking rootDir boundaries.
25-28: Simplified build output aligns with ES-only strategy.The change to fixed filename and ES-only format supports the package's move away from CommonJS exports as mentioned in the AI summary. This simplification reduces complexity while maintaining modern module standards.
pkgs/cli/project.json (2)
11-11: Good addition of explicit outputs for Nx caching.Declaring
outputs: ["{options.outputPath}"]helps Nx optimize caching and affected command detection by explicitly tracking build artifacts.
47-47: Appropriate local execution flags for e2e tests.Adding
"local": trueto the e2e test targets is correct since these tests likely require specific local environment setup and shouldn't run in distributed or remote environments.Also applies to: 60-60
examples/playground/tsconfig.json (4)
2-2: Good use of base configuration inheritance.Extending from the base tsconfig promotes consistency across the monorepo and reduces configuration duplication.
27-27: BaseUrl addition supports path mapping.Adding
baseUrl: "."is necessary for the@/*path mapping to work correctly in the Next.js application.
52-59: Clean removal of unused package references.Removing references to
coreandedge-workerpackages that are no longer needed by the playground is good cleanup and reduces unnecessary compilation overhead.
38-46: Verify the redundant .next types path.The include array contains both generic
.next/types/**/*.tspatterns and a specific path../../examples/playground/.next/.next/types/**/*.ts. The specific path appears redundant and potentially incorrect with the double.next/.next/structure.#!/bin/bash # Check if the specific .next types path is actually needed echo "Checking for .next directory structure in playground:" fd -t d ".next" examples/playground/ || echo "No .next directories found" echo -e "\nChecking if the specific path pattern exists:" ls -la examples/playground/.next/.next/ 2>/dev/null || echo "Path examples/playground/.next/.next/ does not exist"examples/playground/next.config.ts (4)
2-4: LGTM! Clean plugin integration pattern.Good use of
composePluginsto properly integrate Nx and Plausible analytics. The import structure is clean and follows Next.js plugin composition best practices.
12-12: Verify all required packages are included in transpilePackages.The removal of
@pgflow/coreand inclusion of@pgflow/clientand@pgflow/dslshould align with actual dependencies. Ensure all workspace packages that need transpilation are included.#!/bin/bash # Check actual dependencies and verify transpilation needs cd examples/playground cat package.json | jq '.dependencies, .devDependencies' grep -r "import.*@pgflow" src/ || echo "No @pgflow imports found in src/"
7-8: Verify the outputFileTracingRoot path resolves correctly.The
outputFileTracingRootis set to../../which should point to the workspace root. Please ensure this path correctly resolves from the playground's location within the monorepo structure.#!/bin/bash # Verify the path structure and ensure outputFileTracingRoot points to workspace root pwd find . -name "next.config.ts" -exec dirname {} \; | head -5 ls -la examples/playground/../../
32-36: Plugin composition order should be verified.The current order applies
withNxfirst, thenwithPlausibleProxy. Verify this order doesn't conflict with how each plugin modifies the Next.js configuration.Does the order of Next.js plugins matter when using composePlugins with withNx and withPlausibleProxy?migrations.json (1)
1-60: LGTM! Well-structured migration configuration.The migrations file properly defines the upgrade path from Nx v20 to v21. All migrations have clear descriptions, proper version targeting, and follow the expected structure for automated migration execution.
package.json (3)
41-44: Verify compatibility of major version updates.Multiple packages received significant version bumps (TypeScript 5.6→5.8, Vite 5.0→6.3, etc.). Test thoroughly to ensure compatibility between these updates.
Are there known compatibility issues between TypeScript 5.8.3, Vite 6.3.5, and the updated Nx v21 ecosystem?
26-37: ```shell
#!/bin/bashSearch for Cloudflare Pages configuration and references
fd -t f wrangler.toml
rg -l -i "cloudflare" .--- `18-27`: **Verify Nx v21 compatibility and breaking changes.** The upgrade from Nx v20.3.0 to v21.2.1 is significant. Ensure all workspace configurations and custom plugins are compatible with this major version bump. ```web What are the major breaking changes in Nx v21 compared to v20, particularly for @nx/next, @nx/vite, and @nx/eslint-plugin?pkgs/edge-worker/project.json (2)
23-23: LGTM! Appropriate local execution configuration.Setting
"local": truefor test, lint, and database-related targets is correct for Supabase Edge Functions development, ensuring proper access to local Supabase instances and Deno runtime.Also applies to: 34-34, 112-112, 123-123, 135-135, 147-147
43-43: Good practice: Disabling cache for stateful operations.Correctly disabling cache for Supabase lifecycle commands (start, stop, status, etc.) prevents issues with stale cached results that could mask actual database state.
Also applies to: 53-53, 63-63, 73-73, 84-84, 101-101
pkgs/website/project.json (3)
31-36: Robust CI environment safety check.The CI environment verification properly prevents accidental local deployments while allowing override with
CI=true. This is a good safety practice for production deployments.
37-44: Verify wrangler configuration exists.The deploy target uses
wrangler pages deploy distbut ensure the requiredwrangler.tomlconfiguration file exists and is properly configured for the website project.#!/bin/bash # Check for wrangler configuration ls -la pkgs/website/wrangler.toml || echo "wrangler.toml not found in website package" ls -la wrangler.toml || echo "wrangler.toml not found in workspace root"
45-52: Validate CLOUDFLARE_BRANCH environment variable usage.The preview deployment uses
${CLOUDFLARE_BRANCH:-preview}syntax. Ensure this environment variable is properly set in CI workflows and verify the fallback branch name is appropriate.#!/bin/bash # Check CI workflow for CLOUDFLARE_BRANCH usage rg "CLOUDFLARE_BRANCH" .github/workflows/pkgs/client/package.json (3)
5-7: LGTM! Well-structured export verification.The addition of the
verify-exportsscript enhances the build reliability by ensuring exports work correctly after build changes.
33-36: LGTM! Clean browser export separation.The dedicated browser export path provides clear separation between Node.js and browser builds, improving the package's usability across different environments.
15-15: Breaking change: Verify backward compatibility.The main entry point has changed from CommonJS (
./dist/index.cjs) to ES module (./dist/index.js). This is a breaking change that could affect existing users who depend on CommonJS imports.Ensure this breaking change is properly documented and that the version bump reflects the breaking nature of this change (major version increment).
#!/bin/bash # Check if this is documented as a breaking change echo "Checking for breaking change documentation..." fd -e md . | xargs rg -l "breaking|BREAKING" | head -5 echo "---" echo "Checking version in package.json..." cat pkgs/client/package.json | jq '.version'pkgs/core/project.json (3)
27-27: LGTM! Appropriate local execution for database operations.Adding
"local": trueto database-related tasks (schema dumps, linting, SQL fixes) ensures these operations run locally rather than in distributed environments, which is correct for database-dependent operations.Also applies to: 101-101, 117-117, 122-122
134-135: LGTM! Proper cache management for stateful services.Disabling cache (
"cache": false) for Supabase lifecycle management commands is appropriate since these operations manage service state and should always execute fresh.Also applies to: 146-147, 156-157, 166-167, 176-177, 186-187
201-201: LGTM! Local execution for test commands.Setting
"local": truefor pgTAP test commands ensures database tests run in the local environment where the test database is available.Also applies to: 221-221
pkgs/client/scripts/verify-exports.js (1)
20-39: LGTM! Comprehensive ESM export testing.The ESM import verification correctly tests all main exports and validates their types, ensuring the package exports work as expected.
nx.json (3)
43-50: LGTM! Next.js plugin integration.The Next.js plugin configuration is properly set up with appropriate target names for build, dev, and start commands, supporting the expanded build and deployment setup mentioned in the PR objectives.
53-60: LGTM! Build dependency management.The build target defaults properly establish dependency chains (
dependsOn: ["^build"]) and caching configuration, which aligns with the PR's goal of improving caching capabilities.
82-118: LGTM! Consistent execution context management.The target defaults properly categorize different types of commands with appropriate
localandcachesettings:
- Database/Supabase operations: local execution, no caching (stateful)
- Verification tasks: local execution, with caching (deterministic)
- Test operations: local execution (environment-dependent)
This provides consistent behavior across the workspace and supports the CI pattern's separation of concerns.
pkgs/client/project.json (4)
8-12: LGTM! Improved build process structure.The restructured build target using
nx:noopwith explicit dependencies (build:lib,build:browser,verify-exports) creates a clear, maintainable build pipeline that ensures all steps complete before the build is considered done.
13-20: LGTM! Well-integrated verification step.The
verify-exportstarget properly depends on both build targets and integrates the verification script into the build pipeline, ensuring export correctness is validated as part of the build process.
23-23: LGTM! Proper output declarations.Adding explicit output declarations to the build targets enables proper caching behavior and dependency tracking in the Nx build system.
Also applies to: 31-31
52-53: LGTM! Appropriate execution context settings.The
local: trueandcache: falsesettings are correctly applied to:
- Supabase lifecycle commands (need fresh execution)
- Database operations (environment-dependent)
- Integration tests (require local database)
This ensures reliable execution in the CI environment while maintaining performance where appropriate.
Also applies to: 64-65, 74-75, 84-85, 94-94, 109-110, 120-120, 142-142, 161-161, 171-171
examples/playground/project.json (1)
33-40: Potential mismatch between Netlify build output and deploy paths.
netlify buildproduces.netlify/distand.netlify/functions.
If a plugin changes these defaults the deploy step will silently publish an
empty site. Consider deriving paths fromnetlify build --jsonoutput or
using the--buildflag ofnetlify deploy(which already rebuilds and
picks the correct folders).Also add
--siteto guard against accidentally deploying to the wrong site.
Deleted the nx-cloud.sh script used for managing CI runs, cleaning up build environment
…ations in CI workflow - Introduced a new GitHub Action for posting deployment status comments on PRs and main branch merges - Updated CI workflow to include post-deployment comments for both preview and production deployments - Enhanced deployment process to automatically notify about success or failure with relevant links and details - Improved visibility of deployment statuses directly within PRs and main branch merge commits
…nagement Refactors CI configuration to set environment variables at job level for consistency, adds missing environment variables for Cloudflare integration, and enhances clarity in environment setup across different job steps. No functional changes to build or test processes.
… check project impact, and add implicit dependencies to website project
…d main branch push
…uild configuration Updated the project.json by removing deprecated implicit dependencies related to SQL scripts, simplifying the project setup and reducing potential build issues.
…guration details - Introduces a comprehensive Markdown document outlining deployment steps, configuration files, environment variables, and common issues for the Next.js playground deployed on Netlify - Details build dependencies, environment variable management, and Netlify CLI usage - Provides local testing instructions and deployment flow overview - Clarifies important caveats to ensure correct deployment behavior and future improvement ideas
… CI workflow - Set environment variable CLOUDFLARE_BRANCH dynamically based on PR number - Configure environment for deployment steps to support preview deployments on PRs - Minor adjustment to workflow to improve deployment context handling
🔍 Preview Deployment: Website✅ Deployment successful! 🔗 Preview URL: https://pr-163.pgflow.pages.dev 📝 Details:
_Last updated: _ |
🔍 Preview Deployment: Playground✅ Deployment successful! 🔗 Preview URL: https://pr-163--pgflow-demo.netlify.app 📝 Details:
_Last updated: _ |
🚀 Production Deployment: Playground✅ Successfully deployed to production! 🔗 Production URL: https://playground.pgflow.dev 📝 Details:
Deployed at: 2025-06-27T01:29:04+02:00 |
🚀 Production Deployment: Website❌ Production deployment failed! Please check the workflow logs for details. |
Summary
This PR adds automated deployments for playground (Netlify) and website (Cloudflare Pages) with PR status comments.
What's New
🚀 Automated Deployments
pr-123--pgflow-demo.netlify.app)pr-123.pgflow.pages.dev)💬 PR Comments
🔧 CI Improvements
.github/actions/setup)Preview URLs for This PR
Required Secrets