https://pulumi.com logo
#general
Title
# general
i

important-leather-28796

06/29/2022, 10:47 PM
Anyone using microstacks and common code in a typescript monorepo? e.g. we have common code across stacks that should be reused. Are you using yarn workspaces? yarn link? tsconfig paths?
I’m attempting to use tsconfig paths, it appears I needed to yarn install with:
Copy code
"resolutions": {
    "cloud-common": "workspace:*"
  }
tsc was unhappy without the
yarn install
first, just wondering what others are doing with common code that is unpublished…
I’m still trying to iron out tsc/path errors, but curious if others are using separated project/common code amongst stacks and the method used
l

little-cartoon-10569

06/30/2022, 12:55 AM
tsconfig paths are working, for the versions from the last couple of months iirc.
👍 1
b

brief-fall-32292

06/30/2022, 9:52 AM
We are using Turborepo with yarn workspaces to manage our monorepo. It currently has close to 10 Pulumi stacks, each implemented as a distinct Node package and most of them consume a shared "utilities" library.
👍 1
i

important-leather-28796

06/30/2022, 10:11 PM
I did figure out a trick, setting up the
package.json
like this works for
lint
,
tsc
, and
pulumi
without having to run an explicit build (use src ts only), making it far more convenient:
Copy code
"main": "src/index.ts",
  "typings": "src/index.ts",
^^ also doing it this way with yarn workspaces, I did not need any tsconfig paths. I add a top level
resolutions: { "my-shared-pkg": "workspace:*" }
and good to go
284 Views