projectstorm / react-diagrams

a super simple, no-nonsense diagramming library written in react that just works
https://projectstorm.cloud/react-diagrams
MIT License
8.45k stars 1.16k forks source link

Rename top-level package.json name #959

Open marcidy opened 1 year ago

marcidy commented 1 year ago

I'm using yarn 3.2.2

I couldn't run yarn at all in the repo at commit 2a810ca2.

$ yarn
Internal Error: Duplicate workspace name @projectstorm/react-diagrams: /home/marcidy/projects/react-diagrams/packages/react-diagrams conflicts with /home/marcidy/projects/react-diagrams
    at ze.addWorkspace (/home/marcidy/.yarn/releases/yarn-3.2.2.cjs:439:1952)
    at async ze.setupWorkspaces (/home/marcidy/.yarn/releases/yarn-3.2.2.cjs:439:1637)
    at async Function.find (/home/marcidy/.yarn/releases/yarn-3.2.2.cjs:436:1560)
    at async um.execute (/home/marcidy/.yarn/releases/yarn-3.2.2.cjs:499:12090)
    at async um.validateAndExecute (/home/marcidy/.yarn/releases/yarn-3.2.2.cjs:345:673)
    at async ws.run (/home/marcidy/.yarn/releases/yarn-3.2.2.cjs:359:2087)
    at async ws.runExit (/home/marcidy/.yarn/releases/yarn-3.2.2.cjs:359:2271)
    at async i (/home/marcidy/.yarn/releases/yarn-3.2.2.cjs:446:12696)
    at async t (/home/marcidy/.yarn/releases/yarn-3.2.2.cjs:446:10914)

I fixed it by changing the name field in package.json.

{
    "name": "@projectstorm/react-diagrams-literally-anything-else",
    author: dylanvorster,
...
}

With that change, yarn ran and i could run the demos.

I cannot find the full explanation for that issue (e.g. when/why duplicate workspaces are an issue).

However, the issue appears to have the root cause that the name field in package.json cannot be the same in the same project.

The offending files are: package.json packages/react-diagrams/package.json

I'm quite new to yarn/node/react etc and not 100% sure this right, though. I'd add a PR per contribution guidelines, but it's (just) a name change which seems like you would want to select the name.