We use git to manage our source code. To verify installation worked, type the command line git --version and you should see output similar to this:
> git --version
git version 2.28.0
The exact version does not matter. Similarly for Node, which we use for our build tools:
> node --version
v14.9.0
We use Lerna to manage the packages in this monorepo.
It is not needed if you just want to mofify the examples and tutorials.
You only need it to modify Worldcore itself:
To test a locally modified Worldcore package, we need to make an example use the version you modified locally, rather than the released version specified in its package.json. This is the main purpose of lerna. Instead of installing packages from npm in node_modules, it will link your local version of the package into node_modules.
Assuming you did not do the lerna bootstrap step above, but used a regular npm i, you would have this structure in the node_modules/@croquet directory, containing the official Worldcore packages:
Now when you modify something in e.g. packages/widget and rebuild wctest, it will use your version of the packages, rather than the released versions.
Publish Worldcore packages
We use lerna with "fixed" versioning, meaning each package will have the same version.
For each modified package:
update CHANGELOG.md with the next release version
commit everything (the next step needs a clean repo)
bump the version
lerna version --no-push
This will allow you to select the next version number,
and update all packages to that version, as well as their dependencies
(which includes demos, examples, and tutorials, as listed in lerna.json).
We use --no-push to get a chance to roll back if needed
(undo the version commit and delete the tag).
请发表评论