GithubHelp home page GithubHelp logo

yarn-isolate-workspace's People

Contributors

alonmiz avatar madvinking avatar mikach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

yarn-isolate-workspace's Issues

Ignored root workspace dependencies?

In a yarn workspace with "root" dependencies i.e. dependencies that should be included in all projects and are listed in the root package.json and installed with yarn add -W eslint, it appears that they are ignored when running npx yarn-isolate-workspace on a child workspace.

This appears to correctly resolve sibling dependencies (which is awesome), but I don't think it covers this situation.

Am I misusing this library? Or is there a way to add support for this?

Feature request for a couple of helpful options

First off, wanted to say that I love this package, it solved a major issue I was having, so thank you for it.

Second, I wanted to request two options that I think could potentially be helpful:

  • copy isolated workspace files

When isolating a workspace, the files and directories of the isolated package are not copied into the _isolated_ directory, I had to write a script to handle this. It'd be great if this could be supported natively.

  • copy dependent node_modules

Most often when using this tool, all required node_modules are installed in the workspace root already, so it'd be nice to simply copy them over to the isolated workspace and not have to yarn install again.

devDependencies are empty in workspaces-src-less

@Madvinking
Hi, maybe I am miss-understanding use case of workspaces-src-less

Here it removes all dev deps:

subWorkspace.pkgJson.devDependencies = {};

But this files are supposed to be used while building isolated package? So devDependencies should exist?

Here is the diff that solved my problem:

diff --git a/node_modules/yarn-isolate-workspace/src/index.js b/node_modules/yarn-isolate-workspace/src/index.js
index 6a389da..2bce714 100755
--- a/node_modules/yarn-isolate-workspace/src/index.js
+++ b/node_modules/yarn-isolate-workspace/src/index.js
@@ -72,7 +72,6 @@ function resolveWorkspacesNewLocation() {
     subWorkspace.pkgJsonLocation = path.join(subWorkspace.newLocation, 'package.json');
     fs.mkdirSync(subWorkspace.newLocation, { recursive: true });
 
-    subWorkspace.pkgJson.devDependencies = {};
     fs.writeFileSync(subWorkspace.pkgJsonLocation, JSON.stringify(subWorkspace.pkgJson, null, 2));
 
     const files = workspacesExcludeGlob
@@ -196,7 +195,7 @@ function createYarnLock() {
         if (!projectWorkspaces[name] && !list.includes(depName)) {
           list.push(depName);
         } else if (projectWorkspaces[name]) {
-          recursive(projectWorkspaces[name].pkgJson.dependencies);
+          recursive({...projectWorkspaces[name].pkgJson.dependencies, ...projectWorkspaces[name].pkgJson.devDependencies});
         }
       });
     };

Compatibility with yarn v2 (berry)

Hey there, you project fits my needs unfortunately it was designed for yarn v2

Any idea what the gaps are?
Anyway - might be useful to add to the doc ๐Ÿš€

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.