Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,31 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Install pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
with:
version: 10.34.5

- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache: pnpm

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

# Only shipped dependencies gate the build. Advisories confined to the
# dev-only test toolchain (Azurite and its transitives) are tracked in
# docs/securityscan.md rather than blocking every pull request.
- name: Audit runtime dependencies
run: npm audit --omit=dev --audit-level=low
run: pnpm audit --prod --audit-level=low

- name: Check formatting
run: npm run format:check
run: pnpm run format:check

- name: Check types
run: npm run check
run: pnpm run check

- name: Run tests
run: npm test
run: pnpm test
15 changes: 9 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,26 @@ jobs:
registry-url: https://registry.npmjs.org
package-manager-cache: false

- name: Enable Corepack
run: corepack enable

- name: Use the reviewed npm release
run: npm install --global npm@11.18.0

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Check formatting
run: npm run format:check
run: pnpm run format:check

- name: Check types
run: npm run check
run: pnpm run check

- name: Run tests
run: npm test
run: pnpm test

- name: Prepare and verify the release tarball
run: npm run release:pack -- -- --require-clean --require-main-ancestor --require-release-tag --expected-release-commit "${RELEASE_COMMIT}" --output .release
run: pnpm run release:pack -- --require-clean --require-main-ancestor --require-release-tag --expected-release-commit "${RELEASE_COMMIT}" --output .release

# Crosses the job boundary through run metadata rather than the artifact,
# so the publish job cannot be fooled by a self-consistent replacement of
Expand Down Expand Up @@ -131,4 +134,4 @@ jobs:
path: .release

- name: Publish the verified prepared tarball
run: npm run release:publish -- -- --expected-release-commit "${RELEASE_COMMIT}" --expected-manifest-digest "${RELEASE_MANIFEST_DIGEST}" --manifest .release/package-manifest.json
run: node scripts/release-packages.mjs publish --expected-release-commit "${RELEASE_COMMIT}" --expected-manifest-digest "${RELEASE_MANIFEST_DIGEST}" --manifest .release/package-manifest.json
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
link-workspace-packages=true
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm-lock.yaml
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ renders blank without them. Each needs `prepack` running the build, or a stale
## Workflow

Work on a `claude/*` branch and open a pull request. The gate is
`npm run format:check`, `npm run check`, and `npm test` — all three, on Node 22
`pnpm run format:check`, `pnpm run check`, and `pnpm test` — all three, on Node 22
and 24.

Publishing is trusted-publisher only; no tokens exist. A release starts from a
Expand Down
13 changes: 8 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ Thank you for helping improve Storage Blobs.

## Local development

Storage Blobs requires Node.js 22 or newer.
Storage Blobs requires Node.js 22 or newer. Corepack is bundled through
Node 24; on Node 25 or newer, install it first.

```sh
npm ci
npm run check
npm test
npm run format:check
npm install -g corepack
corepack enable
pnpm install
pnpm run check
pnpm test
pnpm run format:check
```

## Pull requests
Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,16 @@ marketing features.

## Development

Requires Node.js 22 or newer.
Requires Node.js 22 or newer. Corepack is bundled through Node 24; on
Node 25 or newer, install it first.

```sh
npm ci
npm run format:check
npm run check
npm test
npm install -g corepack
corepack enable
pnpm install
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved
pnpm run format:check
pnpm run check
pnpm test
```

## License
Expand Down
15 changes: 9 additions & 6 deletions docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,17 @@ The release workflow verifies that the tag:
- points to the checkout and the GitHub release-event commit; and
- is contained in `origin/main`.

Its preparation job has no OIDC permission. It installs the reviewed npm
version without dependency caching, runs the full gate, builds and packs once,
smoke-tests the tarball from a clean consumer, records its SHA-1 and SHA-512
integrity, and uploads the exact prepared artifact.
Its preparation job has no OIDC permission. It enables Corepack for the
reviewed pnpm version, installs the reviewed `npm@11.18.0` used to pack and
talk to the registry, runs the full gate against `pnpm-lock.yaml` without
dependency caching, builds and packs once, smoke-tests the tarball from a
clean consumer, records its SHA-1 and SHA-512 integrity, and uploads the
exact prepared artifact.

Only the `npm-publish` job receives `id-token: write`. It installs no
dependencies, verifies the prepared manifest and tarball hashes against the
release commit, and publishes that tarball with npm provenance.
dependencies and does not download pnpm. It verifies the prepared manifest
and tarball hashes against the release commit, and publishes that tarball
with npm provenance.

## Safe retry

Expand Down
8 changes: 4 additions & 4 deletions docs/securityscan.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Scope: repository `storage-blobs` (Pegma `@pegma/storage-*` packages)

### Stack

- Monorepo (npm workspaces), TypeScript, ESM-only, Node >= 22, vitest.
- Monorepo (pnpm workspaces), TypeScript, ESM-only, Node >= 22, vitest.
- Packages:
- `@pegma/storage-blobs` — port, memory store, conformance suite (no runtime deps).
- `@pegma/storage-azure-blob` — Azure Blob adapter (Azurite in CI).
Expand Down Expand Up @@ -46,7 +46,7 @@ authorized the caller. Attacker-relevant surfaces:

### Excluded

- `node_modules/`, `package-lock.json`, `dist/`, `*.tsbuildinfo` (generated)
- `node_modules/`, `pnpm-lock.yaml`, `dist/`, `*.tsbuildinfo` (generated)
- `docs/*.md`, READMEs (documentation)

### Phase 1 — Mechanized sweeps (raw output summarized)
Expand Down Expand Up @@ -111,7 +111,7 @@ advisories are still present in the dev-only azurite chain and there is no
upstream fix to take: 3.36.0 is the latest release, and npm's proposed 3.33.0 is
a downgrade that keeps the same vulnerable `rimraf` and pulls _older_ `uuid` and
`@azure/ms-rest-js`. What changed is the boundary: CI now gates on
`npm audit --omit=dev --audit-level=low`, so shipped dependencies are enforced
`pnpm audit --prod --audit-level=low`, so shipped dependencies are enforced
clean (currently 0 advisories) and any future _runtime_ advisory fails the build,
while the dev-chain advisories remain a tracked, non-gating item to re-check when
azurite next releases.
Expand All @@ -133,7 +133,7 @@ azurite next releases.
- **Fix:** Track an azurite release that drops the vulnerable transitives and
bump the devDependency when available (npm currently proposes azurite
3.33.0 as the "fix", which is a downgrade — verify before applying). Add
`npm audit --omit=dev` (expected clean) to CI so a _runtime_ advisory fails
`pnpm audit --prod` (expected clean) to CI so a _runtime_ advisory fails
the build, and keep dev-chain advisories as a tracked, non-gating item.

### [LOW] Publish pipeline trusts the cross-job artifact's self-consistency
Expand Down
Loading