Skip to content

Align generated plugins with the published 0.2.1 contract - #9

Merged
Amartuvshins0404 merged 1 commit into
mainfrom
fix/standalone-plugin-completeness
Oct 21, 2026
Merged

Amartuvshins0404 merged 1 commit into
mainfrom
fix/standalone-plugin-completeness

Conversation

@Amartuvshins0404

@Amartuvshins0404 Amartuvshins0404 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Publish the source that matches npm @erxes/create-plugin@0.2.1.
  • Generated projects pin @erxes/ui, @erxes/ui-modules, and @erxes/api-shared at 3.3.4.
  • Dashed plugin names stay public identities. Settings routes are owned by the plugin. The federation container stays normalized.
  • CI runs the packed-CLI deliverables matrix for every backend, including npm and Yarn on the platform stack.

Verification

  • pnpm check, pnpm lint, and pnpm test: 54 tests passed.
  • The packed end-to-end matrix is what .github/workflows/deliverables.yml runs. It was not repeated locally in this push.
  • npm 0.2.1 is already public. This pull request does not publish again.

Summary by Sourcery

Publish the 0.2.1-compatible plugin generator with corrected host integration, dependency compatibility, security defaults, and deliverable validation.

New Features:

  • Align generated plugin projects with the published 0.2.1 package contract, including exact erxes shared-library versions and updated plugin identity, routing, federation, and platform API behavior.
  • Add platform sample authorization and bounded pagination coverage to generated projects.
  • Add packed-CLI external-project end-to-end coverage across all backend stacks and platform package managers.

Bug Fixes:

  • Preserve dashed plugin names as public identities while normalizing only federation container names.
  • Move settings navigation into the plugin-owned application layout and remove obsolete host settings and notification exposes.
  • Make generated CLI next-step directory commands safe and shell-appropriate across POSIX and PowerShell environments.

Enhancements:

  • Add generated dependency and peer-version constraints for React, telemetry, and Yarn package extensions to keep published projects compatible with the tested host cohort.
  • Strengthen generated platform authorization, tenant isolation, pagination validation, and trusted-gateway guidance.
  • Package only compiled CLI modules and require the built package for end-to-end deliverable testing.

CI:

  • Run the generated deliverables matrix in pull-request and release workflows, covering every backend plus npm and Yarn platform cases.

Documentation:

  • Update user-facing documentation for the 0.2.1 contract, supported package managers, dependency baselines, federation exposes, plugin-owned routes, authorization, and deployment security requirements.

Tests:

  • Expand scaffold and platform unit tests and add packed external-project checks for dependency peers, generated builds, federation output, authorization, pagination, and gateway context behavior.

Chores:

  • Bump the package version to 0.2.1 and synchronize generated templates with the published CLI contract.

Pin the shared libraries at 3.3.4, keep dashed public names, and
own settings routes inside the plugin. CI now runs the packed-CLI
deliverables matrix.
@sourcery-ai

sourcery-ai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This release aligns the generator and its published npm artifact with the 0.2.1 host contract by pinning compatible dependencies, preserving dashed plugin identities, moving settings into plugin-owned routes, adding secured tenant-scoped platform examples, and validating the packed CLI through a CI deliverables matrix spanning all supported backends.

Sequence diagram for secured platform sample access

sequenceDiagram
  actor User
  participant UI as PluginUI
  participant Gateway
  participant API as PluginAPI
  participant Resolver
  participant Models as TenantBoundModels

  User->>UI: Open sample page
  UI->>Gateway: GraphQL samples(limit, offset)
  Gateway->>API: Forward user and tenant headers
  API->>Resolver: Resolve __camel__Samples
  Resolver->>Resolver: checkPermission(SAMPLE_READ)
  Resolver->>Models: list({limit, offset})
  Models-->>Resolver: Tenant-scoped samples
  Resolver-->>UI: Samples or authorization error
Loading

Flow diagram for packed CLI deliverables validation

flowchart TD
  PR[Pull request or release] --> Workflow[Reusable deliverables workflow]
  Workflow --> Matrix[Backend and package-manager matrix]
  Matrix --> Pack[Build and pack CLI]
  Pack --> External[Install in fresh external directory]
  External --> Checks[Run codegen check lint and build]
  Checks --> Federation[Verify federation exposes and no host-singleton fallback]
  Federation --> Result[Deliverables pass]
  Result --> Release[Release job]
Loading

File-Level Changes

Change Details Files
Pins generated projects to the published shared-library and runtime compatibility contract.
  • Bumps the CLI to 0.2.1 and packages only compiled CLI modules.
  • Pins the three erxes shared packages to 3.3.4 and constrains React, telemetry, and package-manager-specific peer metadata.
  • Rejects Yarn Classic for platform projects and documents host, gateway, deployment, and package-cohort requirements.
package.json
pnpm-lock.yaml
src/scaffold.ts
src/generated.ts
README.md
templates/base/AGENTS.md
templates/base/README.md
templates/base/docs/erxes-integration.md
templates/ui/react/package.json
Aligns generated plugin identity, federation exposes, and settings ownership with the host contract.
  • Preserves dashed public names in manifests, permissions, CONFIG, and page exposes while normalizing only federation container names.
  • Reduces baseline exposes to config and the main page, moving settings and navigation into an AppLayout-owned nested route.
  • Updates generated route links, federation sharing, platform compatibility metadata, and removes the legacy settings and notification widget templates.
src/generated.ts
src/naming.ts
templates/ui/react/rspack.config.ts
templates/ui/react/src/Main.tsx
templates/ui/react/src/config.tsx
templates/ui/react/src/modules/Navigation.tsx
templates/ui/react/src/pages/IndexPage.tsx
templates/ui/react/src/pages/SettingsPage.tsx
templates/ui/react/src/Settings.tsx
templates/ui/react/src/modules/SettingsNavigation.tsx
templates/ui/react/src/widgets/NotificationWidget.tsx
Adds an authenticated, tenant-scoped, bounded platform sample flow to generated projects.
  • Registers platform permissions and enforces login, tenant presence, permission checks, and pagination validation before model access.
  • Applies bounded, deterministic Mongo pagination and generates a UI sample panel with loading, error, empty, and paging states.
  • Updates platform model context generation and common manifest validation.
templates/api/platform/src/graphql/schema.ts
templates/api/platform/src/main.ts
templates/api/platform/src/modules/sample/db/models/Sample.ts
templates/api/platform/src/permissions.ts
templates/api/commonjs/src/config.ts
templates/api/shared/src/config.ts
templates/ui/platform/src/Samples.tsx
src/scaffold.ts
Makes CLI verification exercise the packed npm deliverable across all backend and package-manager variants.
  • Builds and installs the packed CLI in an external directory before scaffolding.
  • Adds an eight-case matrix covering every backend plus npm and Yarn platform cases, with installed-peer, codegen, type-check, lint, build, federation, authorization, and context assertions.
  • Adds focused template and scaffold tests for identity, package constraints, permissions, pagination, and unsupported Yarn versions.
.github/workflows/ci.yml
.github/workflows/deliverables.yml
.github/workflows/release.yml
package.json
test/e2e.test.ts
test/fixtures/platform-access.mjs
test/fixtures/standalone-context.mjs
test/platform.test.ts
test/scaffold.test.ts
Improves generated CLI guidance and documents the security boundary for forwarded gateway identity.
  • Quotes generated directory-change commands appropriately for POSIX shells and PowerShell.
  • Clarifies that forwarded user and tenant headers are trusted gateway assertions, requiring private API networking and ingress header stripping.
src/cli.ts
templates/api/standalone/src/context.ts
README.md
templates/base/AGENTS.md
templates/base/README.md
templates/base/docs/erxes-integration.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 142d61c1-20fa-49d8-b488-ee07882f4655
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Comment on lines +8 to +34
runs-on: ubuntu-latest
timeout-minutes: 25
strategy:
fail-fast: false
max-parallel: 3
matrix:
# Every backend builds React too. Additional package managers are
# exercised on the default platform stack rather than a 6x4 matrix.
case: [platform-pnpm, platform-npm, platform-yarn, express-pnpm, fastify-pnpm, hono-pnpm, nestjs-pnpm, elysia-bun]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.x"
- run: corepack enable yarn && corepack prepare yarn@4.18.1 --activate
- run: pnpm install --frozen-lockfile
- name: Test packed CLI in a fresh external directory
run: pnpm test:e2e
env:
E2E_CASE: ${{ matrix.case }}
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​types/​semver@​7.8.01001007481100
Updatedi18next@​26.5.3 ⏵ 23.16.8100 +110091 -193 -4100
Addedreact-is@​18.3.110010010098100

View full report

@Amartuvshins0404
Amartuvshins0404 merged commit 0be4beb into main Oct 21, 2026
16 of 17 checks passed

@sourcery-ai sourcery-ai 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.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. The generated platform permission declares sample reads as tenant-wide (all), so users granted that action can read every sample record in their tenant. If that scope is too broad, reverting this generator change will not revoke access or undo disclosures from projects already generated and deployed.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

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.

2 participants