| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat(cli): zero deploy (#4129) ## Changes Fixes https://linear.app/nango/issue/NAN-3242/new-compilation-and-deploy - Deploy zero yaml Since I needed to rewrite a lot, I decided to clean up and hopefully improve confirmation output. Let me know (check the video). It's missing json schema and single file deploy. And of course it's not working on the platform yet. - API: Add information about updated scripts ## 🧪 Tests - Init a new folder `node ../nango/packages/cli/dist/index.js init --zero test` - `cd test` - Set env key and hostport in `.env` - Deploy `node ../../nango/packages/cli/dist/index.js deploy dev` https://github.com/user-attachments/assets/8bc4a0ac-0d19-497f-8407-3110e2fbbfa4 <!-- Summary by @propel-code-bot --> --- **feat(cli): Initial Zero Deploy Implementation and Cross-Stack Deploy Diff Refactor** This PR introduces a major overhaul to the Nango CLI's deployment system by implementing 'zero deploy'-a structure allowing CLI-driven deployments without relying on `nango.yaml` configuration. This required substantial changes and refactoring across the CLI, server, API types, example templates, and dependency management. The PR adds a fully packaged/compiled deploy mechanism for yaml-less integration projects, enhances deploy flow feedback and confirmation output, and overhauls server/API-side diff logic to categorize new, updated, and deleted items (syncs, actions, scripts) for more accurate reconciliation and messaging. It also includes improvements for the onboarding experience, example project scaffolding, and dependency updates/cleanups. **Key Changes:** • New zero deploy (`yaml-less`) workflow for ``CLI``, with full packaging/compilation and deploy orchestration (packages/cli/lib/`zeroYaml`/deploy.ts, index.ts, init.ts) • Enhanced diff/confirmation output for deployments; server/``API`` now supports `updated` in addition to new/deleted syncs/actions/`onEvent` scripts (shared/lib/services/sync/sync.service.ts, deploy `postConfirmation`.ts, types) • ``API`` and types expanded to support granular diff responses, with broader backwards-compatibility (types/lib/deploy/api.ts) • ``CLI`` example integrations refactored for zero deploy, with improved initial scaffolding (.env handling, onboarding instructions) • Dependency and lockfile updates: esbuild major/minor bumps, new columnify for ``CLI`` output, dead deps removed • Assorted bugfixes and ergonomic tweaks in ``CLI`` arg parsing, error handling, and onboarding flow **Affected Areas:** • ``CLI`` main entrypoint and `zeroYaml` workflow • Deployment (packaging, compilation, post-confirmation, deploy) • ``API`` & types for deploy/diff responses • Sync/action/`onEvent` diffing & reconciliation logic (shared/services/sync) • Example/template integrations & onboarding docs • ``CLI``/example env setup • Package dependency and lockfile management **Potential Impact:** **Functionality**: Significantly changes the way CLI deployments function for yaml-less projects, introduces more granular confirmation outputs, and can affect legacy deploy flows (e.g., must ensure backward compatibility where yaml is still used). **Performance**: Negligible for most use cases; slightly increased compute/memory during diff resolution for large configurations. **Security**: No new external attack surfaces or privileged flows introduced. **Scalability**: Improved internal structure lays the groundwork for handling larger sets of integrations and more granular updates as projects scale. **Review Focus:** • Correctness and ``UX`` of packaging/compilation/deploy workflow in `zeroYaml`/deploy.ts • Consistency and accuracy of diff outputs (new/updated/deleted) across ``CLI`` and server • Backward compatibility in both ``CLI`` and server ``API`` paths • Completeness and safety of dependency updates and package-lock sync • Type safety and expansion impact in ``API`` responses • Clarity/ergonomics of onboarding and example template updates <details> <summary><strong>Testing Needed</strong></summary> • End-to-end zero deploy: initialize new repo, set env, deploy using new ``CLI`` workflow • Deploy/diff combinations with mixes of new, updated, and deleted syncs/actions/scripts to verify plan confirmation output • Regression test existing (nango.yaml) deploys for backward compatibility • Server ``API`` endpoints: diff and deploy with different payloads; integration and unit test all paths </details> <details> <summary><strong>Code Quality Assessment</strong></summary> **packages/cli/lib/zeroYaml/deploy.ts**: Structured and readable, though file is large and could be further modularized; robust error handling; strong TypeScript idioms. **packages/shared/lib/services/sync/sync.service.ts**: Logic improved for update handling; some complex state flow could benefit from future extraction. **packages/cli/lib/index.ts**: Clear argument handling and command separation; dual-path support for legacy and new flows. **packages/cli/example/github/***: Matches new flow and onboarding; temporary type alias present and commented. **types/lib/deploy/api.ts**: Expanded types maintain compatibility and add needed granularity; size of response should be monitored. </details> <details> <summary><strong>Best Practices</strong></summary> **Type-Safety**: • Comprehensive `TypeScript` annotations and correct interface extensions for new workflow **Error Handling**: • Consistent try/catch and error surface; clear ``CLI`` messaging **Dependency Management**: • Explicit version bumps; test/dev/main split obeyed; dead deps removed **Testing/Modularization**: • `E2E` flows well tested (per author), but large modules should be broken down further </details> <details> <summary><strong>Possible Issues</strong></summary> • Potential backward compatibility breakages with legacy yaml-based deploys if dual paths diverge. • Zero deploy flow lacks single-file deploy and JSON schema support as flagged by author (roadmap limitation, not a regression). • Monolithic logic in zeroYaml/deploy.ts could slow future refactor and bug resolution. • Dependency bumps (notably esbuild and new columnify) require full downstream smoke test. </details> --- *This summary was automatically generated by @propel-code-bot* | 1 年前 |