Skip to content

Fix package.json entry points across all packages - #987

Open
theoephraim wants to merge 1 commit into
mainfrom
fix-package-entry-points
Open

Fix package.json entry points across all packages#987
theoephraim wants to merge 1 commit into
mainfrom
fix-package-entry-points

Conversation

@theoephraim

Copy link
Copy Markdown
Member

Prompted by npmx-dev/npmx.dev#2837, where varlock shows up as CJS. Auditing every path referenced from every package.json turned up 33 dangling references across the monorepo.

What was wrong

Dead entry points. varlock had "main": "index.js", pointing at a file that has never existed. 15 plugin packages had "main": "dist/index.js" and "types": "dist/index.d.ts", neither of which their builds emit (the only artifact is dist/plugin.cjs).

Bare default conditions. Most exports used default rather than naming import/require. npmx's detection walks the exports tree, sets hasRequire if any string ends in .cjs, and never consults type: module. Our ./init-server and ./init-edge are genuinely CJS, so with no import condition anywhere the whole package got classified cjs.

Changes

  • varlock - main now points at ./dist/index.js, added top-level types. Explicit import on the 12 ESM subpaths, explicit require on the two .cjs ones. default is kept everywhere as the fallback, so resolution behavior is unchanged.
  • 15 plugin packages - removed the main/types that pointed at files the build never produces. Their ./plugin export stays a plain string, since EnvGraphPlugin.pluginFilePath reads it as one.
  • ci-env-info, vite, cloudflare, astro - explicit import conditions; astro's bare string export expanded to carry types.
  • nextjs - subpath exports had no types at all, so @varlock/nextjs-integration/plugin and friends resolved untyped. Now explicit types/require/default.
  • env-spec-parser - added top-level types.

Verification

Full build, turbo test:ci (8/8 packages, 2071 tests), turbo typecheck (26/27; varlock-docs-mcp fails on missing Cloudflare Worker types, pre-existing on main). Plus a resolver probe running all 14 varlock subpaths through Node under both import.meta.resolve and require.resolve - all resolve, unchanged from before.

Note on the badge

npmx will now report varlock as dual rather than cjs. It can't reach plain esm while init-server/init-edge are exported as .cjs, and those genuinely are CJS. Dropping them from exports would break the resolution contract with older @varlock/nextjs-integration, so they stay. Their heuristic ignoring type: module when default is used is still a bug on their end; the issue stays open.

- varlock: main pointed at a nonexistent top-level index.js
- 15 plugins: main/types pointed at dist/index.js + dist/index.d.ts, which
  the plugin builds never emit (only dist/plugin.cjs)
- declare import/require conditions explicitly instead of relying on a bare
  default, so module-format detection sees the real format
- add missing types conditions for nextjs integration subpath exports
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

bumpy-frog

The changes in this PR will be included in the next version bump.

patch Patch releases

  • @env-spec/parser 0.5.0 → 0.5.1
  • @varlock/1password-plugin 2.0.3 → 2.0.4
  • @varlock/akeyless-plugin 2.0.0 → 2.0.1
  • @varlock/astro-integration 1.3.0 → 1.3.1
  • @varlock/aws-secrets-plugin 1.2.2 → 1.2.3
  • @varlock/azure-key-vault-plugin 1.2.2 → 1.2.3
  • @varlock/bitwarden-plugin 2.0.0 → 2.0.1
  • @varlock/ci-env-info 0.1.0 → 0.1.1
  • @varlock/cloudflare-integration 1.4.0 → 1.4.1
  • @varlock/dashlane-plugin 2.0.0 → 2.0.1
  • @varlock/doppler-plugin 2.0.0 → 2.0.1
  • @varlock/google-secret-manager-plugin 1.2.1 → 1.2.2
  • @varlock/hashicorp-vault-plugin 2.1.0 → 2.1.1
  • @varlock/infisical-plugin 2.1.0 → 2.1.1
  • @varlock/keeper-plugin 2.0.0 → 2.0.1
  • @varlock/kubernetes-plugin 1.0.0 → 1.0.1
  • @varlock/nextjs-integration 1.2.0 → 1.2.1
  • @varlock/pass-plugin 1.0.1 → 1.0.2
  • @varlock/passbolt-plugin 2.0.0 → 2.0.1
  • @varlock/proton-pass-plugin 2.0.0 → 2.0.1
  • @varlock/vite-integration 1.4.0 → 1.4.1
  • varlock 1.16.0 → 1.16.1

Bump files in this PR

Click here if you want to add another bump file to this PR


This comment is maintained by bumpy.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle size

⚠️ grows the bundle by 1.1 KB (+0.0%)

Metric main This PR Δ
Total dist 5007.0 KB 5008.1 KB +1.1 KB (+0.0%)
JS 1716.6 KB 1717.2 KB +0.6 KB (+0.0%)
Sourcemaps 3213.8 KB 3214.8 KB +1.0 KB (+0.0%)
Type defs 76.6 KB 76.1 KB −0.5 KB (−0.7%)

dist/ only; native binaries are versioned separately and not counted here.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes Reviewed all package entry-point updates in commit 376e97e2, including their emitted artifacts and runtime and type resolution paths.

  • Varlock conditions: Corrects top-level entry points, adds explicit ESM import conditions, and marks the two self-contained CommonJS runtime bundles with require conditions while preserving default fallbacks.
  • Integration conditions: Adds explicit ESM conditions to CI, Astro, Cloudflare, and Vite packages, and adds typed CommonJS conditions to every Next.js integration export.
  • Parser declarations: Adds the legacy top-level TypeScript declaration target for @env-spec/parser.
  • Plugin cleanup: Removes nonexistent root entry points from 15 plugin manifests while preserving the loader-consumed ./plugin string export.
  • Release metadata: Adds patch bumps for all affected publishable packages.

Pullfrog  | View workflow run | Using azure/gpt-5.6-sol𝕏

@pkg-pr-new

pkg-pr-new Bot commented Aug 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

@varlock/ci-env-info

npm i https://pkg.pr.new/@varlock/ci-env-info@987

@env-spec/parser

npm i https://pkg.pr.new/@env-spec/parser@987

varlock

npm i https://pkg.pr.new/varlock@987

@varlock/astro-integration

npm i https://pkg.pr.new/@varlock/astro-integration@987

@varlock/cloudflare-integration

npm i https://pkg.pr.new/@varlock/cloudflare-integration@987

@varlock/nextjs-integration

npm i https://pkg.pr.new/@varlock/nextjs-integration@987

@varlock/vite-integration

npm i https://pkg.pr.new/@varlock/vite-integration@987

@varlock/1password-plugin

npm i https://pkg.pr.new/@varlock/1password-plugin@987

@varlock/akeyless-plugin

npm i https://pkg.pr.new/@varlock/akeyless-plugin@987

@varlock/aws-secrets-plugin

npm i https://pkg.pr.new/@varlock/aws-secrets-plugin@987

@varlock/azure-key-vault-plugin

npm i https://pkg.pr.new/@varlock/azure-key-vault-plugin@987

@varlock/bitwarden-plugin

npm i https://pkg.pr.new/@varlock/bitwarden-plugin@987

@varlock/dashlane-plugin

npm i https://pkg.pr.new/@varlock/dashlane-plugin@987

@varlock/doppler-plugin

npm i https://pkg.pr.new/@varlock/doppler-plugin@987

@varlock/google-secret-manager-plugin

npm i https://pkg.pr.new/@varlock/google-secret-manager-plugin@987

@varlock/hashicorp-vault-plugin

npm i https://pkg.pr.new/@varlock/hashicorp-vault-plugin@987

@varlock/infisical-plugin

npm i https://pkg.pr.new/@varlock/infisical-plugin@987

@varlock/keeper-plugin

npm i https://pkg.pr.new/@varlock/keeper-plugin@987

@varlock/kubernetes-plugin

npm i https://pkg.pr.new/@varlock/kubernetes-plugin@987

@varlock/pass-plugin

npm i https://pkg.pr.new/@varlock/pass-plugin@987

@varlock/passbolt-plugin

npm i https://pkg.pr.new/@varlock/passbolt-plugin@987

@varlock/proton-pass-plugin

npm i https://pkg.pr.new/@varlock/proton-pass-plugin@987

commit: 376e97e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant