Skip to content

Add CI check to enforce files field on all published packages#2288

Draft
wre232114 with Copilot wants to merge 2 commits into
mainfrom
copilot/add-ci-check-for-packages
Draft

Add CI check to enforce files field on all published packages#2288
wre232114 with Copilot wants to merge 2 commits into
mainfrom
copilot/add-ci-check-for-packages

Conversation

Copilot AI commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Without a files field, npm publishes everything not in .npmignore, risking accidental inclusion of source, configs, or other unintended files. Several packages were missing this field entirely.

New CI check

scripts/check-package-files.mjs — validates on every PR:

  • Rust plugin main packages: files must include index.js + index.d.ts; all source-file entries must exist on disk
  • Rust plugin npm sub-packages (npm/<abi>/): files must include index.farm
  • JS plugins and packages/*: files must be defined and non-empty (private packages skipped)

Runs via .github/workflows/check-package-files.yaml — lightweight, no build required.

Package fixes

Package Fix
packages/create-farm Added files: ["create-farm.js", "index.js", "index.d.ts"]
packages/runtime-plugin-hmr Added files: ["dist"]
js-plugins/qiankun Added files: ["dist"]
js-plugins/tailwindcss Added files: ["dist"]
rust-plugins/replace-dirname Removed func.js from files — file doesn't exist and isn't referenced in exports

@changeset-bot

changeset-bot Bot commented Mar 31, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d8233ce

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "farm-docs" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "bench" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

@vercel

vercel Bot commented Mar 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
farm-docs Ready Ready Preview, Comment Mar 31, 2026 1:48pm

Agent-Logs-Url: https://github.com/farm-fe/farm/sessions/1077f71f-47a1-437a-9b10-db30a6f653d1

Co-authored-by: wre232114 <8372439+wre232114@users.noreply.github.com>
Copilot AI changed the title [WIP] Add CI check for Rust and JS plugins and published packages Add CI check to enforce files field on all published packages Mar 31, 2026
Copilot AI requested a review from wre232114 March 31, 2026 13:46
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