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

Migrate from npm to pnpm #1875

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

jamesst20
Copy link

@jamesst20 jamesst20 commented May 12, 2024

Note: This is based from this branch #1874
This is just one small commit: 7dd0a03

Replace npm by pnpm.

Pnpm is a much better package manager. If you are curious about its differences, I recommend you to google it.
Syntax and usage is pretty much identical

pnpm add -D package-name # npm install --save-dev package-name
pnpm install # pnpm install

# Build all
pnpm build:all
# or
pnpm --workspace-concurrency 1 -r build


# Publish all
pnpm -r publish

The reason why it's a good idea is because pnpm properly scopes packages unlike npm. As you can see in the single commit of this branch, I had to add missing packages to few repos. This should have never worked in the first place. This prevent weird bugs as well where the wrong package version is used for building as well.

Also, using @inertiajs/core from the workspace would be a better approach because sometimes both adapter and core need an update. i.e adding a new type that would be missing from the core in the currently published version.

Pnpm automatically re-alias properly packages referenced from the workspace.

https://pnpm.io/workspaces

Referencing workspace packages through aliases
Let's say you have a package in the workspace named foo. Usually, you would reference it as "foo": "workspace:*".

If you want to use a different alias, the following syntax will work too: "bar": "workspace:foo@*".

Before publish, aliases are converted to regular aliased dependencies. The above example will become: "bar": "npm:foo@1.0.0".

@jamesst20 jamesst20 force-pushed the pnpm_setup branch 2 times, most recently from b79bbe4 to abd39cf Compare May 12, 2024 18:56
jamesst20 added a commit to jamesst20/inertia that referenced this pull request May 12, 2024
jamesst20 added a commit to jamesst20/inertia that referenced this pull request May 12, 2024
jamesst20 added a commit to jamesst20/inertia that referenced this pull request May 12, 2024
@jamesst20 jamesst20 force-pushed the pnpm_setup branch 2 times, most recently from d8ddb88 to 692a4ca Compare May 12, 2024 19:46
jamesst20 added a commit to jamesst20/inertia that referenced this pull request May 12, 2024
Merge punyflash/inertia with some tweaks and fixes
jamesst20 added a commit to jamesst20/inertia that referenced this pull request May 12, 2024
Merge punyflash/inertia with some tweaks and fixes
jamesst20 added a commit to jamesst20/inertia that referenced this pull request May 12, 2024
Merge punyflash/inertia with some tweaks and fixes
jamesst20 added a commit to jamesst20/inertia that referenced this pull request May 12, 2024
jamesst20 added a commit to jamesst20/inertia that referenced this pull request May 12, 2024
jamesst20 added a commit to jamesst20/inertia that referenced this pull request May 16, 2024
jamesst20 added a commit to jamesst20/inertia that referenced this pull request May 28, 2024
jamesst20 added a commit to jamesst20/inertia that referenced this pull request May 28, 2024
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.

None yet

1 participant