#Bun workspace: Unlink package and use npm version instead workspace

1 messages · Page 1 of 1 (latest)

sonic osprey
#

I am building an open-source package, which was inside its own repository but I decided to move it inside a monorepo (with turbo, nextjs etc). Now that this package is inside that monorepo, I am unable to work on it independently without breaking things. Next.js app uses that package, and whenever I change stuff it breaks the app code.

I tried unlinking that package and using static version in the package.json, but that didn't help. What should I do at this point?

sonic osprey
#

I have no idea how it got fixed, but I have stashed my changes to not lose it, created a different branch where I updated package.json and then switched to the feature branch and it works now!

sonic osprey
#

lol I spoke too soon. The Next.js app build succeeds locally but fails in the GitHub Actions workflow.

#

There is a generateCode function in a subpackage within the monorepo. I changed its parameter type, which is causing builds to fail in the workflow.

As you can see, locally the monorepo is not affected by this change because it simply uses version 1.8.0 of the package from npm, as specified in package.json.

However, the build is failing in the workflow. Despite package.json specifying version 1.8.0 from npm, the workflow accesses the library from the workspace, which includes the modified version of generateCode. This causes the build to fail.

My plan was to work on the package for a while and only migrate the Next.js app to the new version when it was fully ready. However, this error makes things very difficult. Copy

sonic osprey
#

and from workflow logs, it exactly uses workspace version

short crater