Skip to content

question: Is syncpack support respect mainApp as a main reference? #309

@flixyudh

Description

@flixyudh

Question

Does syncpack support to treat MainApp as a source of truth dependencies while the other packages must respect the MainApp? I don't know what this structure should be called.


Usecase

Let say I have this tree structure:

monorepo/
  apps/
    myApp/package.json
  packages/
    a/package.json
    c/package.json

with detail dependencies like this:

apps/myapp/package.json:

{
  "version": "1.0.0",
  "name": "myapp",
  "main": "index.js",
  "private": true,
  "dependencies": {
    "lodash": "^4.17.21",
  }
}

packages/a/package.json:

{
  "version": "1.0.0",
  "name": "@packages/a",
  "main": "index.js",
  "private": true,
  "peerDependencies": {
    "zustand": "*"
  }
}

packages/b/package.json:

{
  "version": "1.0.0",
  "name": "@packages/b",
  "main": "index.js",
  "private": true,
  "peerDependencies": {
    "lodash": "*",
    "axios": "*"
  }
}

as you see the apps/myapp/package.json only has lodash, but packages/a has zustand as peerDep, and packages/b also has axios as peerDep.

How do i make apps/myapp/ as the main deps, so other packages that have library but not yet added on myapp appear when run syncpack?

I want to make the unlisted peerDependencies on packages/* to be listed on apps/myapp first. so the expected apps/myapp/package.json is:

{
  "version": "1.0.0",
  "name": "myapp",
  "main": "index.js",
  "private": true,
  "dependencies": {
    "axios": "latest-version",
    "lodash": "^4.17.21",
    "zustand": "latest-version",
  }
}

I've tried to search relevan issue about my case, but i'm not found it yet.

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions