Feature Request: Link Subdirectory
Most of my libraries create their output in a separate folder /dist including a separate package.json file. Published npm package will contain content of this /dist folder only, so I'd prefer to link only this /dist folder. That seems to be not possible.
Example:
// rush.json
{
"projects": [
{
"packageName": "mylib",
"projectFolder": "mylib",
"distFolder": "mylib/dist"
}],
...
}
And in "myapp":
/node_modules/mylib/ <contents from mylib/dist>
Interesting. In our backlog we have a work item proposing to adopt a similar strategy, but we haven't gotten to it yet.
To clarify, you're basically asking for (1) the "npm publish" should be run inside the "dist" folder, and (2) the local symlinks to point to this folder?
I'm not sure I would want to represent this in Rush.json. It might make more sense as a custom setting in your package.json, since it is an inherent configuration of the project.
- @nickpape-msft @dzearing FYI
"npm publish" should be run inside the "dist" folder, and (2) the local symlinks to point to this folder?
Exactly.
It might make more sense as a custom setting in your package.json
Perhaps. Let me add some background info.
I'm using a layout as generated by: https://www.npmjs.com/package/generator-angular-library
/package.json (for IDE, gulp tasks)
/src/package.json
/dist/package.json (copy of /src/package.json)
So it's more like a package (as defined in top level package.json) written in TypeScript that generates a different package (as defined in /src/package.json) now in JavaScript with inlined resources, etc....
+@qz2017 who has been working on revamping the implementation of "rush publish".
Our scenario is a little different. We want to publish different builds of the same NPM pacakge, e.g. an hourly "development" build to our internal NPM registry, as well as a public "production" and "beta" release. The development and beta builds will use NPM release tag suffixes in their version numbers. Since we are publishing a set of NPM packages that go together, the published package.json needs to be fixed up during publishing. For example, if we do a beta release, then package.json should change to reference the beta versions of all its dependencies.
The plan is that Git will track the master copy of package.json in the top-level project folder (/package.json in your example), and then during the build we will copy+transform this to produce /dist/package.json. This means "rush publish" needs to be run from inside the /dist folder.
It's a different scenario from what you describe, but maybe they can both be handled by the same feature of Rush?
Is your project open source? It might be interesting to look at your build setup.
Sorry for not answering. We had to move away from rush (at least for this project) due to problems with typescript and RxJS when working with linked packages.
@cluetjen what tool did you end up using ?
We ended with a "do nothing special" setup. That means, we've separate repositories for all apps / libs / packages. That's not perfect, but "it works". When starting with angular 2 there were simply too many problems everywhere (and it's nearly impossible to really understand what happens during an Angular Build somewhere between ts, webpack, rollup and a lot of angular specials).
While writing this, I think I should try it again with rush...