Advanced Cookbook
Summary
The recipes here shouldn't need to be used except in very rare circumstances (if you're wondering if the current circumstance applies, it means it probably doesn't)
Upgrading all Dependencies
- NOTE: this shouldn't be done but documented . ping
@DendronTeam
if you think you need to do this (you probably don't)
-
Remove
yarn.lock
at the top of the monoreporm yarn.lock
-
Run
yarn setup
-
Run tests to make sure everything is working correctly
-
Commit the new yarn.lock file
- NOTE: when you do this, you might end up updating other dependencies because of Semver. having a
yarn.lock
means that don't update dependencies even if a new dependency is available. in these cases, be sure to conduct Manual Testing when submitting the PR
Upgrading a single dependency
-
Run the following command at the top of the monorepo:
yarn upgrade <name-of-package-to-upgrade>
-
Run
yarn setup
-
Run tests to make sure everything is working correctly
-
Commit the updated
package.json
and lockfile
- This may make minor (
*.*.X
) upgrades to other packages as well, but that should be harmless.
Adding a new package
Example PR here: https://github.com/dendronhq/dendron/pull/3048
- Create the new package
- NOTE: naming scheme is usually
dendron-{name}
cd packages cp -R _pkg-template dendron-viz
- NOTE: naming scheme is usually
- Update the names
- in package.json
- replace
$PKG_NAME
with package name - replace
$CURRENT_VERSION
with current version in monorepo
- replace
- in package.json
- Add package to
dendron-main.code-workspace
{ "path": "packages/dendron-viz" },
- Add new package to ../package.json (Private)
"workspaces": { "packages": [ ... "packages/common-test-utils", + "packages/dendron-viz", "packages/engine-server", ...
- Add new package to ../bootstrap/scripts/watch.sh (Private)
- NOTE: order matters. make sure that the package is added to that any package it depends on comes before and that packages that depend on it come after
npx lerna run watch --parallel \ --scope @dendronhq/common-all \ --scope @dendronhq/common-server + \ --scope @dendronhq/dendron-viz \ --scope @dendronhq/engine-server \ --scope @dendronhq/plugin-core \ --scope @dendronhq/dendron-cli
- NOTE: order matters. make sure that the package is added to that any package it depends on comes before and that packages that depend on it come after
- Add new package to ../bootstrap/scripts/buildAll.js (Private)
$(`npx lerna run build --scope @dendronhq/common-all`); $(`npx lerna run build --scope @dendronhq/common-server `); +$(`npx lerna run build --scope @dendronhq/dendron-viz `); $(`npx lerna run build --scope @dendronhq/engine-server `); $(`npx lerna run build --scope @dendronhq/pods-core `);
- Add to ../bootstrap/scripts/buildAllForTest.js (Private)
Verify New package
- Run
yarn setup
- Run
ts-node packages/dendron-viz/src/index.ts
ts-node packages/dendron-viz/src/index.ts
# hello world