I have the following project I am using Pulumi to manage my various cloud run jobs. I am trying to set up all my package management to use a tool like mise for each of development. The problem is each of the cloud run jobs has their own package.json file and there is no easy way to install all of the node_modules recursively. I have looked at tools like yarn workspaces, or pnpm (with recursive install), but neither works. When I use these tools pulumi up fails with a syntax error. I can only run pulumi up on each job after running npm i in each child directory which is cumbersome.
├── README.md
├── infra
│ ├── job1
│ │ ├── Pulumi.dev.yaml
│ │ ├── Pulumi.prod.yaml
│ │ ├── Pulumi.qa.yaml
│ │ ├── Pulumi.yaml
│ │ ├── index.ts
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── tsconfig.json
│ ├── job2
│ │ ├── Pulumi.dev.yaml
│ │ ├── Pulumi.prod.yaml
│ │ ├── Pulumi.qa.yaml
│ │ ├── Pulumi.yaml
│ │ ├── index.ts
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ └── tsconfig.json
│ └── job3
│ ├── Pulumi.dev.yaml
│ ├── Pulumi.prod.yaml
│ ├── Pulumi.qa.yaml
│ ├── Pulumi.yaml
│ ├── index.ts
│ ├── package-lock.json
│ ├── package.json
│ └── tsconfig.json
├── justfile
├── lib
│ └── job5
│ ├── cloudrun.ts
│ ├── package-lock.json
│ ├── package.json
│ └── tsconfig.json
├── mise.toml
Is there a way in which I can call npm i recursively from the main project directory? Is it possible to share the package.json files in some way they all essentially are the same:
{
"name": "job1",
"main": "index.ts",
"version": "1.0.0",
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.17.0",
"@eslint/migrate-config": "1.3.5",
"@types/node": "^18.19.69",
"@typescript-eslint/eslint-plugin": "^8.19.0",
"@typescript-eslint/parser": "^8.19.0",
"eslint": "^9.17.0",
"typescript": "^5.7.2"
},
"dependencies": {
"@lib/cloudrun": "file:../../lib/job5",
"@pulumi/docker": "^4.5.8",
"@pulumi/gcp": "^7.38.0",
"@pulumi/pulumi": "^3.144.1",
"@pulumi/random": "^4.16.8",
"natural-cron": "^1.0.2"
}
}
What is the best practice here? I am open to any and all solutions.