Skip to content
This repository has been archived by the owner on Jan 8, 2021. It is now read-only.

Skip some directory #12

Open
mathpere opened this issue Mar 11, 2015 · 3 comments
Open

Skip some directory #12

mathpere opened this issue Mar 11, 2015 · 3 comments

Comments

@mathpere
Copy link

Hi,

Is there currently a way to skip some dir (root dir or module) from npm-workspace process?
I didn't find it in code source.

Thanks in advance,

Mathieu

@mariocasciaro
Copy link
Owner

Not at the moment, everything in the workspace will be installed by npm-workspace.
Can you tell me what's the reason for excluding a dir/module? Just trying to understand the use case.

@mathpere
Copy link
Author

I have currently 2 use cases:

1/ Speed up deployments.
My project contains many modules and I deploy on several environments. Not all modules are required in each environment.

2/ Simplify deployment.

  • I would like to exclude root directory.
  • I install npm-workspace locally (not globally)

My package.json would have this form:

{
  "name": "my-project",
  "version": "1.0.0",
  "dependencies": {
    "npm-workspace": "^0.2.1"
  },
  "scripts": {
    "postinstall": "npm-workspace install",
    "clean": "npm-workspace clean"
  }
}

And installation would be in one single line:

npm install

I don't know your plans about workspace.json structure but we could imagine something like that:

{
  "links": {
    "my-subproject-1": "my-subproject-1",
    "my-subproject-2": "my-subproject-2"
  },
  "excludes": [
    ".",
    "my-subproject-3"
  ]
}

@toddbluhm
Copy link

👍

I too think this would be a very helpful feature.

My use case is I have all work projects in one root directory with the workspace.json. They are all private npm packages, but a few of them are public. Those public ones I don't need npm-workspace installed each time, but I still need the ability to npm-workspace install them when I do upgrade those public packages either for node version or whatever and being able to link them to the private packages for testing is extremely useful.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants