Skip to content

ci: wait for npm packages to be available before publishing vscode extension#312

Merged
mizdra merged 1 commit into
mainfrom
improve-release-flow
Jan 24, 2026
Merged

ci: wait for npm packages to be available before publishing vscode extension#312
mizdra merged 1 commit into
mainfrom
improve-release-flow

Conversation

@mizdra
Copy link
Copy Markdown
Owner

@mizdra mizdra commented Jan 24, 2026

Summary

  • Add scripts/wait-for-npm-packages.sh to wait for npm packages to be available on the registry
  • Update release workflow to wait for npm packages before publishing vscode extension

Problem

When npm packages are published, there is a delay before they become available on the npm registry. If the vscode extension is published immediately after npm publish completes, it may reference package versions that are not yet available, causing installation failures.

https://github.com/mizdra/css-modules-kit/actions/runs/20407976012/job/58640517750

Run npx @vscode/vsce publish --no-git-tag-version --skip-duplicate
Executing prepublish script 'npm run vscode:prepublish'...

> css-modules-kit-vscode@0.4.0 vscode:prepublish
> run-s vscode:prepublish:rewrite-root-package-json vscode:prepublish:npm-install


> css-modules-kit-vscode@0.4.0 vscode:prepublish:rewrite-root-package-json
> jq 'del(.workspaces)' ../../package.json > tmp.json && mv tmp.json ../../package.json


> css-modules-kit-vscode@0.4.0 vscode:prepublish:npm-install
> npm i --no-package-lock --omit=dev

npm error code ETARGET
npm error notarget No matching version found for @css-modules-kit/ts-plugin@^0.7.0.
npm error notarget In most cases you or one of your dependencies are requesting
npm error notarget a package version that doesn't exist.
npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2025-12-21T09_41_30_979Z-debug-0.log
ERROR: "vscode:prepublish:npm-install" exited with 1.
npm error Lifecycle script `vscode:prepublish` failed with error:
npm error code 1
npm error path /home/runner/work/css-modules-kit/css-modules-kit/packages/vscode
npm error workspace css-modules-kit-vscode@0.4.0
npm error location /home/runner/work/css-modules-kit/css-modules-kit/packages/vscode
npm error command failed
npm error command sh -c run-s vscode:prepublish:rewrite-root-package-json vscode:prepublish:npm-install
Error: npm failed with exit code 1
Error: Process completed with exit code 1.

Solution

The new script:

  • Parses the publishedPackages output from changesets action
  • Polls npm view <package>@<version> to verify each package is available
  • Retries up to 10 times with 10-second intervals
  • Only proceeds to vscode extension publishing after all packages are confirmed available

Test plan

  • Verify the release workflow works correctly on the next release
  • Confirm vscode extension installation succeeds immediately after publishing

🤖 Generated with Claude Code

…tension

Add a script to wait for published npm packages to be available on the
registry before publishing the vscode extension. This prevents the vscode
extension from being published with outdated dependencies.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 24, 2026

⚠️ No Changeset found

Latest commit: 767cd28

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.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

@mizdra mizdra merged commit 8adc3e1 into main Jan 24, 2026
31 of 32 checks passed
@mizdra mizdra deleted the improve-release-flow branch January 24, 2026 07:24
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.

1 participant