Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:31
    matt3224 commented #2110
  • 08:30
    matt3224 commented #2110
  • Dec 06 18:31
    tunnckoCore commented #2171
  • Dec 06 14:46
    Bessonov commented #1012
  • Dec 06 08:47
    renovate[bot] review_requested #2199
  • Dec 06 08:47
    renovate[bot] opened #2199
  • Dec 06 08:47

    renovate[bot] on cpy-cli-3.x

    chore(deps): update dependency … (compare)

  • Dec 05 20:35

    zkochan on master

    fix(deps): update fast-deep-equ… chore(deps): update typescript (compare)

  • Dec 05 19:58

    zkochan on next

    fix(deps): update fast-deep-equ… chore(deps): update typescript (compare)

  • Dec 05 19:49

    renovate[bot] on write-file-atomic-3.x

    (compare)

  • Dec 05 19:47
    zkochan closed #2190
  • Dec 05 19:47

    zkochan on master

    chore(deps): update dependency … (compare)

  • Dec 05 19:38

    zkochan on 1918

    (compare)

  • Dec 05 19:38

    zkochan on master

    feat: add|update [-r] --workspa… (compare)

  • Dec 05 19:38
    zkochan closed #2196
  • Dec 05 19:38
    zkochan closed #1918
  • Dec 05 16:31
    hemedani commented #2175
  • Dec 05 10:39
    zkochan synchronize #2196
  • Dec 05 10:39

    zkochan on 1918

    test: pnpm -r up --workspace (compare)

  • Dec 05 09:36
    sastan unpinned #2198
Antonio Mayrinck Moura
@nthypes
@zkochan looks like that parcel and pnpm have problems. :/
Aankhen
@Aankhen
@zkochan Cool, thank you for the answers.
@nthypes Ah crud, I was just going to look at Parcel to bundle my code to put in a Docker image.
…which doesn’t seem to be the best idea, as it looks it’s more web-focused… hmm.
Aankhen
@Aankhen
How can I bundle up just one package (which I’m compiling from TypeScript using tsc) in a monorepo and its dependencies for a Docker image?
Aankhen
@Aankhen
To elaborate: I have a multi-stage Dockerfile. In the first stage, I compile my code and then prune development dependencies. In the second stage, I copy over the compiled files and the now-minimal node_modules. Or at least, that’s how I did it before. I’m not sure how to handle pnpm’s symlinking and workspace dependencies and all that.
Zoltan Kochan
@zkochan
Could you file an issue for this?
Aankhen
@Aankhen
As in, a feature request?
Aankhen
@Aankhen
Opened #2198.
Zoltan Kochan
@zkochan
yes, thanks
Aankhen
@Aankhen
Thank you!
Antonio Mayrinck Moura
@nthypes
@Aankhen the problem with pnpm on PArcel has been solved.
Antonio Mayrinck Moura
@nthypes
PS: only on PArcel v2
Aankhen
@Aankhen
Cool, thanks for letting me know. :-)
Aankhen
@Aankhen
Is there any way to define a repo-wide set of scripts for a monorepo?
And templates to create new packages within the monorepo? Or to manage packages in general—add, delete, rename, manage common files or package.json settings, and so on. (I realize that may be out of scope for pnpm, so I’m open to any suggestions outside it as well.)
Antonio Mayrinck Moura
@nthypes
I use scripty @Aankhen
And run the commands with pnpm run on the monorepo root dir.
Aankhen
@Aankhen
That looks really nice, thank you.
Aankhen
@Aankhen
Re: the multi-stage Dockerfile, I did manage to get a working version by first running pnpm install -r and then copying only the package I wanted into a different directory using cp -rL, which dereferences symlinks. The problem is, I ended up with a 4.3 GB image, because each package in the repo might have symlinks in its node_modules to another package which might have symlinks yadda yadda, so it’s not a single flat directory, like pnpm creates on its own, but rather a tree with many nested copies of each dependency.
Matt Ledom
@mledom_twitter
I'm running into a similar issue with using pnpm with our serverless framework deploys.
we have a couple utils that get duplicated for each package that uses those
so not only do I get copies of the package but also its node_modules
Matt Ledom
@mledom_twitter
I tried to shamefully-hoist but had the same results
Aankhen
@Aankhen
Yes, I think the problem is because of the symlinks.
They’re a godsend in development but it gets complicated when you want to deploy. Maybe pnpm needs something that will, in a given package directory, dereference the symlinks and flatten the node_modules directory. (Unless a command like that exists already. I haven’t yet been able to find anything.)
Matt Ledom
@mledom_twitter
I like that @Aankhen. I could probably write a serverless plugin that could handle that
Yeah, I don't see anything in the docs like that
Aankhen
@Aankhen
@mledom_twitter, I found something that helped me: https://github.com/lerna/lerna/issues/858#issuecomment-487083308
I adapted the Webpack config to my project and used it to compile my code in a build stage. In the second stage, I only copy over the bundle (modulo some fiddling to get source maps). Now I have a tiny (relatively speaking), functional image.
The only issue I’m having is with moment-duration-format and its unadvertised dependency on moment, but I’m trying the tools Webpack provides to handle special cases.
Aankhen
@Aankhen
Okay, that isn’t working, too many issues with the Webpack config… so back to the single-stage overlarge Docker image.
Matt Ledom
@mledom_twitter
@zkochan when using the shared-workspace-lockfile feature for workspaces the note leads me to believe that my node_modules folders should be empty since all packages are hard linked to the root node_modules. Is that what I should expect? I ask because having the my linked local packages is causing issue when packaging for serverless.
Antonio Mayrinck Moura
@nthypes
It's possible to execute commands only on child dependencies?
Zoltan Kochan
@zkochan
@mledom_twitter almost true. node_modules will contain only symlinks to the direct dependencies. The hardlinks will be in the monorepo root's node_modules/.pnpm dir
@nthypes you may run pnpm run cmd --filter foo... but it will include foo as well. Not only its deps
Matt Ledom
@mledom_twitter
@zkochan is there a way to have all the modules at the root?
Antonio Mayrinck Moura
@nthypes
@zkochan yes, I know.I'm looking for a solution to run only on child dependencies, excluding the parent.
Antonio Mayrinck Moura
@nthypes
@zkochan pnpm run build respects the dependency graph? I.e: it will build the last child dependency before build the main dependency?
Aankhen
@Aankhen

I just cloned the pnpm repository and ran pnpm test -r to get a baseline before trying to implement a feature. packages/config fails:

│ > @pnpm/config@5.0.2 tsc redacted\packages\config
│ > rimraf lib && tsc
│ src/index.ts(1,32): error TS2307: Cannot find module '@pnpm/constants'.
│ src/index.ts(2,23): error TS2307: Cannot find module '@pnpm/error'.

Is this temporary breakage because of ongoing development or something to open an issue for?

Hang on, it works when I enter the directory and run it manually.
Aankhen
@Aankhen
Still fails when I run pnpm test -r from the base directory. 🤷‍♂️
Zoltan Kochan
@zkochan
@nthypes yes. If you mean pnpm run -r build. Or pnpm rebuild
@Aankhen run pnpm test in the root of the repo
@mledom_twitter why would you want that? it would give access to all deps from all projects in the monorepo
Aankhen
@Aankhen
Ah, thanks.
Matt Ledom
@mledom_twitter
@zkochan I'm trying to deploy with serverless. We have a mono repo with a bunch of packages for individual lambda functions and then shared packages. Those shared packages are linked. Some of those shared packages depend on others. When I try to build the deploy package its either including multiple copies of node_modules or not including deps modules down the shared package paths. I have yet to find a great way to flatten all depends into a deployable file to remove duplicates and shrink our zip to meaningful sizes.
I've been trying to use the jetpack serverless plugin to include or exclude paths to reduce this deep recursive shared package structure but not having any luck getting a correctly built zip
markovicdenis
@markovicdenis

@nthypes

Auto import and Auto sugestion doews not work when using pnpm.

Using typescript version 3.1.3 fixes the issue for me.