Upgrade a project
On this page
A project installs Globetrotter from tarballs in vendor/globetrotter/ until the packages are on a registry. A plain npm install can answer "up to date" and keep the old code when the version did not change.
With a bundle (the way for everyone who was handed one)
From the folder that holds the newer globetrotter-<version>/:
node globetrotter-<version>/install.mjs upgrade ../my-project(or upgrade . from inside the project). It replaces the tarballs in vendor/globetrotter/, points package.json at them (in frontend/ too), installs, runs sync, sync --check and doctor. Then restart globetrotter dev. Install Globetrotter has the same in context.
For people changing Globetrotter itself
Every package in the repository says 0.2.0; scripts/pack-into.mjs gives each pack a version that is new every time. From the Globetrotter repository:
node scripts/pack-into.mjs ../my-projectIt packs the seven packages as 0.2.<commits>-dev.<sha> (.dirty.<time> after it when the working tree has changes), replaces the tarballs in my-project/vendor/globetrotter/, and points package.json (and frontend/package.json) at them. It installs nothing and writes nothing in the repository. Add --dry to see the version only.
In the project:
npm install ./vendor/globetrotter/*.tgz
(cd frontend && npm install ../vendor/globetrotter/globetrotter-core-*.tgz ../vendor/globetrotter/globetrotter-widgets-m3-*.tgz) # when the pages live in frontend/
npx globetrotter --version
npx globetrotter sync
npx globetrotter sync --check
npx globetrotter doctorThen restart globetrotter dev: the studio it staged under .globetrotter/studio is refreshed when it starts.
What each says
globetrotter --version(or-v): the version and the commit it was packed from. In a source checkout, the working tree's commit.globetrotter doctor: one line for each rule of "in sync", with what to run when it fails. Exit 1 when one fails;--jsonfor a program.- design = generated pages
- generated types = bindings (
tsc --noEmitin the pages' folder) - service = generated backend = your code
- service = pages (
contract-drift) - migrations written = applied, in the local environment
- the project's Globetrotter = its vendored tarballs = the CLI you run
sync --checkruns rule 1 to 4 too, andtsc --noEmitin the pages' folder (--no-tscskips it).- The studio shows a quiet notice when the project installs another version than the studio is, and a banner when the backend is behind its migrations.
When a migration is waiting
globetrotter dev (local environment) applies a migration that only adds (CREATE TABLE, CREATE INDEX, ADD COLUMN) and says so in one line. A migration that does more (DROP, a rebuild, ALTER COLUMN, UPDATE, DELETE) is never applied by itself: dev prints what is waiting and the exact command, and the studio's banner shows the same with a Copy button. The banner's Apply button appears only for the additive local case.
Do not
- Do not run
npm installand trust "up to date": checknpx globetrotter --version. - Do not link the project to the repository's source (
file:../Designer-/packages/*): two copies of React, and a project nobody else can clone.