Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate @sveltejs/kit dependency (adapter-netlify + adapter-vercel) #1422

Closed
ThomOrlo opened this issue May 11, 2021 · 2 comments · Fixed by #1434 or #1505
Closed

Duplicate @sveltejs/kit dependency (adapter-netlify + adapter-vercel) #1422

ThomOrlo opened this issue May 11, 2021 · 2 comments · Fixed by #1434 or #1505
Labels
bug Something isn't working

Comments

@ThomOrlo
Copy link
Contributor

ThomOrlo commented May 11, 2021

Describe the bug
With @sveltejs/adapter-vercel or @sveltejs/adapter-netlify, @sveltejs/kit dependency may be downloaded twice.

To Reproduce

npm init svelte@next

→ Skeleton project

npm install
npm install @sveltejs/adapter-vercel@next

@sveltejs/kit 1.0.0-next.104 + 1.0.0-next.105 inside package-lock.json:

    "@sveltejs/adapter-vercel": {
      "version": "1.0.0-next.17",
      "resolved": "https://registry.npmjs.org/@sveltejs/adapter-vercel/-/adapter-vercel-1.0.0-next.17.tgz",
      "integrity": "sha512-35Z4R9V4+katvCZz37+E3pjcacQq8goIqwuClIVnnSK7+OUd6LoGb/cFoHm7OdvoSLUKaXSZ9/bLF/hwpmfJhQ==",
      "dev": true,
      "requires": {
        "@sveltejs/kit": "1.0.0-next.104",
        "esbuild": "^0.11.18"
      },
      "dependencies": {
        "@sveltejs/kit": {
          "version": "1.0.0-next.104",
          "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.0.0-next.104.tgz",
          "integrity": "sha512-1ww5NvpGYJdKXR4bfxo04AM4izcJwTziFIVrImq3jqS2b4d8l3KfrJOqgv+e07RvW/WakrCRPAyZzeHpXLdkZg==",
          "dev": true,
          "requires": {
            "@sveltejs/vite-plugin-svelte": "^1.0.0-next.9",
            "cheap-watch": "^1.0.3",
            "sade": "^1.7.4",
            "vite": "^2.2.4"
          }
        }
      }
    },
    "@sveltejs/kit": {
      "version": "1.0.0-next.105",
      "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.0.0-next.105.tgz",
      "integrity": "sha512-bmo5OD5cLyxk1DWE0Boj6NOXI4CviE93WCcdTpLpAXi8l/JQIk38o/lCbtm+edmdYdEI+J6TuseU2zTa+bA6cg==",
      "dev": true,
      "requires": {
        "@sveltejs/vite-plugin-svelte": "^1.0.0-next.10",
        "cheap-watch": "^1.0.3",
        "sade": "^1.7.4",
        "vite": "^2.3.0"
      }
    },

Reproduction: https://github.com/ThomOrlo/duplicate-sveltekit-dependency/
package-lock.json: https://github.com/ThomOrlo/duplicate-sveltekit-dependency/blob/main/package-lock.json#L17

Expected behavior

Only @sveltejs/kit 1.0.0-next.105 inside package-lock.json.

For example:

    "@sveltejs/adapter-vercel": {
      "version": "1.0.0-next.17",
      "resolved": "https://registry.npmjs.org/@sveltejs/adapter-vercel/-/adapter-vercel-1.0.0-next.17.tgz",
      "integrity": "sha512-35Z4R9V4+katvCZz37+E3pjcacQq8goIqwuClIVnnSK7+OUd6LoGb/cFoHm7OdvoSLUKaXSZ9/bLF/hwpmfJhQ==",
      "dev": true,
      "requires": {
        "@sveltejs/kit": "^1.0.0-next.104",
        "esbuild": "^0.11.18"
      }
    },
    "@sveltejs/kit": {
      "version": "1.0.0-next.105",
      "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.0.0-next.105.tgz",
      "integrity": "sha512-bmo5OD5cLyxk1DWE0Boj6NOXI4CviE93WCcdTpLpAXi8l/JQIk38o/lCbtm+edmdYdEI+J6TuseU2zTa+bA6cg==",
      "dev": true,
      "requires": {
        "@sveltejs/vite-plugin-svelte": "^1.0.0-next.10",
        "cheap-watch": "^1.0.3",
        "sade": "^1.7.4",
        "vite": "^2.3.0"
      }
    },

I think it's because of "@sveltejs/kit": "workspace:*", it should be "@sveltejs/kit": "workspace:^"?

adapter-vercel: https://github.com/sveltejs/kit/blob/master/packages/adapter-vercel/package.json#L20
adapter-netlify: https://github.com/sveltejs/kit/blob/master/packages/adapter-netlify/package.json#L20

Documentation: https://pnpm.io/workspaces#publishing-workspace-packages

{
    "dependencies": {
        "foo": "workspace:*",
        "bar": "workspace:~",
        "qar": "workspace:^",
        "zoo": "workspace:^1.5.0"
    }
}

Will be transformed into:

{
    "dependencies": {
        "foo": "1.5.0",
        "bar": "~1.5.0",
        "qar": "^1.5.0",
        "zoo": "^1.5.0"
    }
} 

Information about your SvelteKit Installation:

Diagnostics
  • The output of npx envinfo --system --npmPackages svelte,@sveltejs/kit,vite --binaries --browsers
  System:
    OS: Linux 5.4 Debian GNU/Linux 10 (buster) 10 (buster)
    CPU: (4) x64 06/8e
    Memory: 6.45 GB / 6.48 GB
    Container: Yes
    Shell: 5.7.1 - /usr/bin/zsh
  Binaries:
    Node: 14.16.0 - ~/.volta/tools/image/node/14.16.0/bin/node
    Yarn: 1.22.10 - ~/.volta/tools/image/yarn/1.22.10/bin/yarn
    npm: 6.14.11 - ~/.volta/tools/image/node/14.16.0/bin/npm
  npmPackages:
    @sveltejs/kit: next => 1.0.0-next.105 
    svelte: ^3.34.0 => 3.38.2 
  • Your browser
    Chrome

  • Your adapter (e.g. Node, static, Vercel, Begin, etc...)

Vercel and Netlify

Severity
Does not cause a bug.

@ThomOrlo ThomOrlo changed the title Duplicate @svelte/kit dependency (adapter-netlify + adapter-vercel) Duplicate @sveltejs/kit dependency (adapter-netlify + adapter-vercel) May 11, 2021
@benmccann
Copy link
Member

Ah, changing from * to ^ seems like a good idea. I'd be in favor of that change if you'd like to send a PR for it

@Rich-Harris Rich-Harris added the bug Something isn't working label May 12, 2021
@benmccann
Copy link
Member

@ThomOrlo thanks for this. Unfortunately we had to revert your PR with #1482. It seems that workspace:^ is a new feature of pnpm and there's a bug in it. The release step of Github actions was failing: https://github.com/sveltejs/kit/runs/2598739207

Package "@sveltejs/kit" must depend on the current version of "@sveltejs/kit": "1.0.0-next.107" vs "^"
🦋 error TypeError: Invalid comparator: ^
🦋 error at Comparator.parse (/home/runner/work/kit/kit/node_modules/.pnpm/semver@5.7.1/node_modules/semver/semver.js:754:11)
🦋 error at new Comparator (/home/runner/work/kit/kit/node_modules/.pnpm/semver@5.7.1/node_modules/semver/semver.js:737:8)
🦋 error at Range. (/home/runner/work/kit/kit/node_modules/.pnpm/semver@5.7.1/node_modules/semver/semver.js:925:12)
🦋 error at Array.map ()
🦋 error at Range.parseRange (/home/runner/work/kit/kit/node_modules/.pnpm/semver@5.7.1/node_modules/semver/semver.js:924:13)
🦋 error at Range. (/home/runner/work/kit/kit/node_modules/.pnpm/semver@5.7.1/node_modules/semver/semver.js:867:17)
🦋 error at Array.map ()
🦋 error at new Range (/home/runner/work/kit/kit/node_modules/.pnpm/semver@5.7.1/node_modules/semver/semver.js:866:40)
🦋 error at versionPackage (/home/runner/work/kit/kit/node_modules/.pnpm/@changesets+apply-release-plan@5.0.0/node_modules/@changesets/apply-release-plan/dist/apply-release-plan.cjs.dev.js:160:9)
🦋 error at /home/runner/work/kit/kit/node_modules/.pnpm/@changesets+apply-release-plan@5.0.0/node_modules/@changesets/apply-release-plan/dist/apply-release-plan.cjs.dev.js:312:12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants