This message is copied from a private channel in Discord (if you have access, you can view here).
As for publishing, you can use lerna to publish all packages in lockstep.
First bump the package version by running this in the monorepo root:
yarn lerna version <major|minor|patch>That will bump the version numbers of all packages, and their internal references, so for example foam-vscode will point to the new version of foam-core etc.
It will also push a tag to github. If you want to dry run this locally without pushing, you can run
yarn lerna version minor --no-git-tag-version --no-pushWhen you're ready to publish, you can do:
yarn lerna publishOnce the npm packages are published, you can package up the vscode extension with the following command in the
foam-vscodedirectory:
yarn package-extensionThe
vscetool does not understand yarn monorepos, so what this will do is usenpmto install the package, which requires thefoam-coredependency to have already been published to npm. I know this is ass backwards, since if you discover that something is wrong in the packaged extension, you'll need to fix whatever issue there is and then republish the packages to npm, which will again bump the version number and cause potentially dead versions in the registry. If you want to avoid that, you can first create an alpha version with creating a prerelease version, e.g.0.4.1-alpha.0, with:yarn lerna publish <premajor|preminor|prepatch|prerelease>Anyway, once you've gotten a nicely packaged vsix file, you can install
and test it locally:code --install-extension foam-vscode-0.4.1.vsixIf everything is fine, you can then publish the vsix file to marketplace:
vsce publish --packagePath foam-vscode-0.4.1.vsixThat should probably be documented, and the process could be improved, but that's what it is now :man_shrugging:
Two things I wanted to note here:
hi @jsjoeio - you are totally right, I have more notes from the handover with @jevakallio - will write them down in the foam doc.
I would also like to automate most of the flow (there is a testing step, which will need to be manual until we add more e2e tests), any guide/contribution/suggestion very much appreciated (somewhat related to #315)
I can help with this if you want @riccardoferretti - feel free to assign to me after sharing your notes!
More notes:
yarn lerna publish preminor
update CHANGELOG.MD file
yarn lerna publish preminor
from package/foam-vscode
yarn package-extension
do local testing
fix bugs if necessary (and CHANGELOG)
yarn lerna publish minor
republish
from package/foam-vscode
yarn package-extension
might wanna test it again based on bug fixes
publish the extension
npx vsce publish --packagePath foam-vscode-XXX
update the release notes
announce on discord
TODO
when doing the second publish without changes, we need to force the new publish by using yarn lerna publish --force-publish \* (see https://lerna.js.org/#command-publish)
forgot to mention before, we should also make publishing to https://open-vsx.org/ part of this process
Good call!
The latest and greatest script I am following now:
All commands are run from the root folder
master and fast forward to origin/mastergit checkout master && git fetch && git rebase yarn clean && yarn build && yarn test./packages/foam-vscode/CHANGELOG.mdyarn lerna publish preminor --no-git-tag-version --no-push--no-git-tag-version --no-push options prevent that from happeningyarn vscode:package-extension./packages/foam-vscode/foam-vscode-$version.vsixyarn vscode:install-extensionyarn lerna publish minoryarn vscode:package-extensionyarn vscode:publish-extensionOh man...I'm liking how this is shaking out @riccardoferretti 馃憦馃徏 Step 10 sounds great too! Sorry I haven't had time to jump on this, thanks for getting started!
Can steps 9 and 10 be automated?
The discord announces, I supposed that had Github Actions and 9 We can create an Action too.
But Great Script @riccardoferretti
Update. (and fixed numbering)
But as I get more familiar with this, I will probably turn it into a github action soon.
(I am using every release as a test bed for something ;) )
All commands are run from the root folder
master and fast forward to origin/mastergit checkout master && git fetch && git rebase yarn clean && yarn build && yarn test./packages/foam-vscode/CHANGELOG.mdPublish the pre-release packages to NPM
yarn lerna version preminor --no-git-tag-version --no-pushgit add *git commit -m"Preparation for next release"lerna publish from-packagePackage the extension locally
yarn vscode:package-extension./packages/foam-vscode/foam-vscode-$version.vsixyarn vscode:install-extensionyarn lerna publish minoryarn vscode:package-extensionyarn vscode:publish-extensionvsce, just call it via npx e.g. npx vsce login foam)
Most helpful comment
Update. (and fixed numbering)
But as I get more familiar with this, I will probably turn it into a github action soon.
(I am using every release as a test bed for something ;) )
All commands are run from the root folder
masterand fast forward toorigin/mastergit checkout master && git fetch && git rebaseyarn clean && yarn build && yarn test./packages/foam-vscode/CHANGELOG.mdPublish the pre-release packages to NPM
yarn lerna version preminor --no-git-tag-version --no-pushgit add *git commit -m"Preparation for next release"lerna publish from-packagePackage the extension locally
yarn vscode:package-extension./packages/foam-vscode/foam-vscode-$version.vsixyarn vscode:install-extensionyarn lerna publish minoryarn vscode:package-extensionyarn vscode:publish-extensionvsce, just call it via npx e.g.npx vsce login foam)