Skip to content

Adopt npm workspaces for Anvil - #6

Draft
PSchmiedmayer wants to merge 20 commits into
mainfrom
anvil-npm-workspaces
Draft

PSchmiedmayer wants to merge 20 commits into
mainfrom
anvil-npm-workspaces

Conversation

@PSchmiedmayer

Copy link
Copy Markdown
Member

♻️ Current situation & Problem

The standalone editor uses pnpm and has its own build and deployment configuration.
A shared npm workspace and validation workflow give the standalone editor and future library consumers the same build inputs.

Tracked in #5.

⚙️ Release Notes

  • Use Node.js 24 and npm 12 to install, build and test the standalone editor.
  • Require the shared repository checks, build, tests with local coverage, and Pages artifact in CI.
  • Deploy the Pages artifact from a stable GitHub release backed by a verified signed tag.

📚 Documentation

The README gives standalone setup instructions, and the development guide covers local validation and static hosting.

✅ Testing

Verify a clean npm ci, npm run validate and npm run pages:build on the candidate.
Check import, editing, preview and export in the built standalone app.
Verify that release validation rejects a missing or lightweight tag, an unverified signature, a mismatched commit and a commit outside the default branch.

Code of Conduct & Contributing Guidelines

Move the workspace from pnpm to npm workspaces with npm 12 and Node.js 24,
use the shared ESLint and Prettier configurations from
@schmiedmayerlab/grove-configurations with the grove-ts TypeScript flags,
and fix every finding they report.

Add the grove-ts workflow structure on the organization's shared
workflows: build and test with quality, Node.js 26, Pages build, coverage
and dependency review jobs, CodeQL, repository standards, the monthly link
check, and a release deployment that publishes public packages to npm with
Trusted Publishing and deploys the app to GitHub Pages. Pages no longer
deploy on every push to main.

Add the package verification, package lint, audit, Trusted Publishing and
Pages scripts with their tests, knip analysis, CONTRIBUTORS.md,
CITATION.cff, AGENTS.md, Dependabot as in grove-ts, and REUSE headers that
name the Anvil open-source project.
@PSchmiedmayer
PSchmiedmayer added this pull request to stack #9 December 3, 2026 21:24
@coderabbitai

coderabbitai Bot commented Dec 3, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • 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

standards:
name: Standards
if: github.repository == 'SchmiedmayerLab/anvil'
uses: SchmiedmayerLab/.github/.github/workflows/repository-standards.yml@v0.5
- name: Set up pnpm
uses: pnpm/action-setup@v6
- name: Set up Node.js and install dependencies
uses: SchmiedmayerLab/.github/actions/setup-node-project@v0.5
with:
persist-credentials: false
- name: Set up Node.js and install dependencies
uses: SchmiedmayerLab/.github/actions/setup-node-project@v0.5
timeout-minutes: 10
build-and-deploy:
name: Build and Deploy to GitHub Pages
uses: SchmiedmayerLab/.github/.github/workflows/npm-pages.yml@v0.5
permissions:
contents: read
pull-requests: read
uses: SchmiedmayerLab/.github/.github/workflows/markdown-links.yml@v0.5
GitHub reports the repository as SchmiedmayerLab/Anvil, and the lab standards check compares citation and badge URLs with that name exactly. The citation, badges, and upstream conditions in the workflow now use it.
The identifier suffix now encodes the full random 32-bit value instead of reducing it modulo 36^4, which CodeQL reports as a biased use of a cryptographic random number.
Each workspace writes lcov source paths relative to its own folder, so files with the same name in different workspaces collide when Codecov maps them. The lcov reporters now use the repository root as the project root.
The workspace move reformats nearly every source line, so patch coverage measures the whole editor. The new tests drive the outline, inspector fields, conditions, previews, side panels, standard plugins, and the standalone example through the public editor, and exercise validation, document, and FHIR helpers directly.
The package TypeScript projects include their Vitest configurations but not the Node type definitions, so the repository root is now derived from the configuration's URL.
Tests no longer pin message wording that names a missing value, restore the clipboard and object URL stubs after each test, use fake timers for the delayed save and URL release, and declare jsdom for the standalone app tests that use it.
A contained resource without a resourceType is reported as not a value set instead of "a undefined", resource and item types take "an" before a vowel, and an item control without a code is labelled "no code" instead of "undefined".
The repository, issue, and homepage URLs and the trusted publishing fixtures now name SchmiedmayerLab/Anvil as GitHub reports it, like the citation and badges.
The labels of controls that do not fit read "an integer item" and "a url item", and the value text helper keeps its own comment.
Identifiers stay distinct across a 600-item import with a duplicated item, and the suffix encodes the smallest and largest random values in seven characters.
The validation and standard plugin messages use one helper module instead of a copy each.
Update typescript-eslint to 8.74.0 and lucide-react to 1.82.0, which
are older than the seven-day cooldown.
Refresh the transitive cross-spawn to 7.1.2 (GHSA-ghv9-86vm-4v8m) and
minimatch to 11.0.10 (GHSA-3924-r96c-gp9w) within their existing ranges.
Carry the dependency and security updates from main into the npm
workspaces. The pnpm lockfile stays removed, and the npm lockfile pins
the same direct and patched versions.
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