This project is a monorepo managed by yarn. The packages are located in the packages directory.
yarn install
yarn startBuild all packages.
yarn buildyarn testTo test a specific package, use the following command:
node --experimental-vm-modules node_modules/.bin/jest --selectProjects ui --coverageyarn build: Builds all packages using Lernayarn test: Runs tests across all packagesyarn lint: Runs ESLint with auto-fix across all packagesyarn version-prerelease: Creates a prerelease versionyarn version-patch: Creates a patch versionyarn version-minor: Creates a minor versionyarn version-major: Creates a major versionyarn publish-dry-run: Tests the publishing processyarn publish-preview: Publishes with preview tagyarn publish-release: Publishes the latest version
To create a new version and trigger the NPM publishing workflow:
- Create a new version using one of these commands:
# For patch updates (0.0.X)
yarn run version-patch
# For minor updates (0.X.0)
yarn run version-minor
# For major updates (X.0.0)
yarn run version-major
# For prerelease versions (e.g., 0.0.1-alpha.0)
yarn run version-prereleaseNote: if you need to set the base version first, you can run the following command, e.g.:
npx lerna version 0.5.14-alpha.0 --no-push --sync-workspace-lock --no-git-tag-version --force-publish --npm-client=yarn
ts-node scripts/update-version.mjsThen, you need to commit the changes of version number in all package.json files, especially the lockfile.
yarn install
git commit --signoff -am "chore: update version number to X.Y.Z"- (Optional)Before pushing the tag, you can test the publishing process:
# Test publishing without actually publishing
yarn run publish-dry-run
# Or publish to preview tag for testing
yarn run publish-previewThe publish-dry-run command:
-
Simulates the entire publishing process without actually publishing to NPM
-
Shows what would be published, including:
- Package names and versions
- Files that would be included
- Dependencies that would be published
-
Useful for catching issues before actual publishing
-
Example output:
lerna notice cli v3.11.0 lerna info dry-run enabled lerna info Publishing packages to NPM lerna info - geodalib-core@0.0.1 lerna info - geodalib-io@0.0.1 lerna info - geodalib-viz@0.0.1 lerna info - geodalib@0.0.1 lerna info dry-run finishedYou may need to update the gitHead in the package.json files after running the
publish-dry-runcommand.
git add .
git commit -am --signoff "chore: update version number to X.Y.Z"
git push- Push the version tag to GitHub:
Create a new version tag:
git tag -a v0.0.2-alpha.11 -m "chore: update version number to 0.0.2-alpha.11"
git push origin --tagsIf you want to remove the tag and the version number, you can run the following commands:
git tag -d v0.0.2-alpha.11
git push origin --delete v0.0.2-alpha.11This will:
- Create a new version tag
- Push the tag to GitHub
- Trigger the GitHub workflow that publishes the package to NPM
Note: All version scripts include the --no-push flag by default, which is why you need to manually push the tag. This gives you a chance to review the changes before triggering the publishing workflow.
Additional publishing commands:
yarn run publish-dry-run: Test the publishing process without actually publishingyarn run publish-preview: Publish with the 'preview' tag (useful for testing)yarn run publish-release: Publish the latest version to NPM