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

Use pnpm #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Use pnpm #3

wants to merge 1 commit into from

Conversation

iacore
Copy link

@iacore iacore commented Jan 25, 2023

The workspaces key only works for npm, not pnpm or yarn. Vite don't care about that as well.

@jmackie jmackie changed the title Specify dependencies explicitly Use pnpm Jan 25, 2023
@jmackie
Copy link
Member

jmackie commented Jan 25, 2023

Thanks for raising this 🙏

I'm a big fan of pnpm, but I don't think it adds much to a trivial demo app like this.

And seeing as this is mostly intended to be an instructional example, I'd rather not add the complication of a package manager that less people are familiar with.

@iacore
Copy link
Author

iacore commented Jan 25, 2023

This adds pnpm support. I think it should work with yarn/npm as well.

@jmackie
Copy link
Member

jmackie commented Jan 25, 2023

$ npm install
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "link:": link:packages/js-exception

@iacore
Copy link
Author

iacore commented Jan 25, 2023

Can you try changing link: to file:?

The node package manager space is really wild west.

@jmackie
Copy link
Member

jmackie commented Jan 25, 2023

file: works for npm but not pnpm.

But actually the current link: approach doesn't work properly for pnpm either.

pnpm install passes fine, but then pnpm run build fails with:

[vite]: Rollup failed to resolve import "snabbdom" from ".ditto/packages/vdom/ditto-src/App.js".

I'm not entirely clear why that's happening, but I suspect this requires a workspace setup rather than just linked dependencies?

The next issue that's likely to come up is that generated packages/*/package.json files look like...

{
  "name": "vdom",
  "type": "module",
  "dependencies": {
    "js-task": "*",
    "js-unknown": "*",
    "snabbdom": "^3.5.1",
    "std": "*"
  }
}

Which also isn't pnpm compatible. So I suspect package manager will have to be added as a ditto configuration option so we can generate the appropriate format.

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