Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 15:52
    zkochan commented #2206
  • 15:47
    Djaler commented #2206
  • 14:49
    zkochan labeled #2188
  • 14:44

    zkochan on master

    refactor: rename LocalPackages … (compare)

  • 14:11

    zkochan on next

    refactor: rename LocalPackages … (compare)

  • 13:34
    zkochan labeled #2214
  • 13:15

    zkochan on 2191

    (compare)

  • 05:59
    daniele-orlando opened #2214
  • Dec 13 20:47

    zkochan on master

    fix(deps): update npx (compare)

  • Dec 13 20:31

    renovate[bot] on update-notifier-4.x

    (compare)

  • Dec 13 20:31

    renovate[bot] on tree-kill-1.x

    (compare)

  • Dec 13 20:31

    renovate[bot] on http-proxy-agent-3.x

    (compare)

  • Dec 13 20:31

    renovate[bot] on read-package-json-2.x

    (compare)

  • Dec 13 20:29
    zkochan closed #2207
  • Dec 13 20:29
    zkochan closed #2208
  • Dec 13 20:29
    zkochan closed #2209
  • Dec 13 20:29
    zkochan closed #2210
  • Dec 13 20:29

    zkochan on master

    fix(deps): update close #2210 … (compare)

  • Dec 13 20:24

    zkochan on npm_and_yarn

    (compare)

  • Dec 13 20:24
    dependabot[bot] commented #2213
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.

Antonio Mayrinck Moura
@nthypes
@markovicdenis yup! And you should use preserveSymlinks: true on tsconfig
@zkochan I'm thinking to contribute with a PR to enable --filter exclude the main dependency and only execute the command on upstream/downstream dependencies. What do you think?
Zoltan Kochan
@zkochan
@nthypes what would be the syntax?
maybe something like pnpm install --filter foo... --filter !foo
Zoltan Kochan
@zkochan
@mledom_twitter so you'd basically need a pnpm deploy command that would make an exportable node_modules for your server
Antonio Mayrinck Moura
@nthypes
@zkochan yup, thats right. Or pnpm install --filter foo... !foo
Aankhen
@Aankhen

@zkochan I'm thinking to contribute with a PR to enable --filter exclude the main dependency and only execute the command on upstream/downstream dependencies. What do you think?

I was working on this yesterday and I think I’ve almost got it. I was taking a leaf out of Rust’s book: foo^.. for dependencies, ..^foo for dependents.

But maybe the ! makes more sense.
(And I don’t have any issues with someone else doing it. Just the suggestion for the syntax.)
Antonio Mayrinck Moura
@nthypes
@Aankhen can you open a PR?
@zkochan It's expected pnpm change file: to link: in package.json?
Looks like pnpm is changing file to link in the package.json and --filter does not recognize packages with link: as local dependencies.
Zoltan Kochan
@zkochan
@nthypes I am not sure it is expected. But it should recognize it as deps
Aankhen
@Aankhen
@nthypes Sure. In that case, give me some time. I have to find some time to continue, heh.
Matt Ledom
@mledom_twitter
@zkochan yeah, that would be a useful command. It would include all production deps from both the local packages (flattened without the symlink recursion) as well as any other deps in the package.json. With that I could write a plugin that would be able to run that command before the package and write the files to a temp folder. When that is complete, remove the temp folder after the packaging completes leaving the existing mono repo node module setup alone.
Aankhen
@Aankhen
Maybe it could be called pnpm vendor?
I would definitely find that useful.
Zoltan Kochan
@zkochan
Or pnpm export
Aankhen
@Aankhen
Yes!
Matt Ledom
@mledom_twitter
yeah I like that
Aankhen
@Aankhen

@Aankhen can you open a PR?

#2201