-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to build & publish JSDO packages #277
Comments
I was able to publish to a private npm registry, but there is a lot of manual steps involved to reconcile version number differences. Here are the steps I take to build the packages:
The publish command is set to use the target registry because I added the publishConfig setting in package.json for all the packages. But, I have to manually go in and |
Oh - I'm sorry. I guess I made it sound like I was stating something rather than asking something. The build commands above do work, but I was looking for insight myself as to how to better manage the project specifically as it relates to versioning. Maybe I don't understand node well enough, but it seems to me that if the sub-projects in the packages directory use the top level package as a dependency that each one should be a separate project (i.e. another repo), or else the whole project should be all together as a single package. Otherwise, the child packages have to manage the version numbers for top level packages, which doesn't make sense... What's the reasoning for having all these child packages? To target specific platforms? Would it cause a performance issue to just put all of this into a single package? |
Sorry, indeed misread before. Different team. It's been a while since I looked into the included build and packaging scripts. I think I concluded that npm publishing has manual steps, but it's really been a while. Maybe @edselg can advise nudge. Otherwise - I'd recommend looking at Consultingwerk's fork. They only cherrypick changes, so while the fork might not work for you, their build process might. They have a build-flow based on gulp which I find much more comprehensible. Maybe the resulting ng package fits your needs better. |
Hello, The instructions from #266 are so that you can build and install the package without having to publish it to private npm server. You can use "npm set registry" instead of publishConfig to change the default registry in your environment. This will update .npmrc. Regarding versioning, you could use a model where you specify a build date in the version (example .date-number) and in this way, it will be updated. Of course, this would mean that your build would need to dynamically update the version number in the package.json. We have used this format for a version number in the past when publishing using the with next and rc. NativeScript also uses this format for their daily builds. Regarding the package configuration. Please let me know if you need more info. I hope this helps. |
Hi @edselg thanks for the info. I took a look at the angular project. I do see what you mean about the sub packages. However, their approach seems slightly different when it comes to versioning them: The version numbers of the packages are given a placeholder string which is dynamically replaced with the new version number at build/deploy time. Were there any plans to follow this model for the jsdo? Or do you go in and manually update each version number of each sub package when deploying to npmjs.org? |
Hello @hutcj We tried some few approaches.
No plans for that exact model. We looked at replacing the version dynamically at build time. I think we just replaced the version in the JSON object. We did not use a placeholder. We also tried using "npm version VersionNumber" and "npm version prerelease".
We manually update each version number of each sub package at the beginning of the cycle. We settled on using "npm unpublish PackageName --force --registry Registry" + "npm publish --registry Registry". This seemed to be the best approach for our needs at the time as it also seemed to solve issues with the npm server where versions failed to publish. I hope this helps. |
Hi, we would like to publish the JSDO npm packages to an internal registry since the official packages aren't being updated to take advantage of recent features and fixes in the develop branch. How do I build/publish the packages? We use jsdo-core and jsdo-angular specifically. I tried npm publish from inside the packages/core and packages/angular folders, and it successfully published the package, but it was basically empty. This was after running npm install and npm run build:jsdo
UPDATE:
I see there is some instructions here, but was wondering how to modify the steps to work for publishing, not just generating the packages? #266 (comment)
The text was updated successfully, but these errors were encountered: