@deallony/shared
Shared TypeScript types, DTOs, Zod schemas, and utilities for Deallony projects.
One-command releases
Run from a clean, synchronized main branch with push access to origin/main.
| Command | Action |
|---|---|
npm run deploy | Bump patch, build, publish to npm, commit/tag/push GitLab |
npm run deploy:minor | npm + GitLab minor release |
npm run deploy:major | npm + GitLab major release |
npm run deploy:dry-run | Preview version and inspect current package, no mutation |
npm run deploy:git | Bump patch, build, commit/tag/push GitLab without npm publish |
npm run deploy:git:minor | GitLab-only minor release |
npm run deploy:git:major | GitLab-only major release |
npm run deploy:git:dry-run | Preview GitLab-only release |
Version increments follow semantic versioning; 1.2.99 becomes 1.2.100.
Automatic npm login
npm run deploy first checks npm whoami. If npm returns E401 or ENEEDAUTH,
the script runs npm login --registry=https://registry.npmjs.org/ --auth-type=web and
opens the browser sign-in flow. After you finish logging in, it rechecks your
identity and continues the same release. Network failures and canceled logins
stop the release before modifying the package version. deploy:git never logs
into npm.
npm authentication
Run npm login --registry=https://registry.npmjs.org/ and ensure your account has
publishing permission for the public scoped package @deallony/shared.
Complete any npm 2FA prompts when required. Never commit npm tokens.
Publish without browser approval
A normal npm login session still makes npm publish open the browser for 2FA
on every release. A granular token with "bypass 2FA" removes that step:
- On npmjs.com open your avatar > Access Tokens > Generate New Token > Granular Access Token.
- Name it
deallony-shared-publish, pick an expiration (npm caps write tokens, so note the date to renew), and tick Bypass two-factor authentication (2FA). - Under Packages and scopes choose Read and write, Only select
packages and scopes, and select
@deallony/shared. Leave organizations at no access. Generate and copy the token. - Run
notepad $HOME\.npmrc(PowerShell) and set this line, replacing any existing//registry.npmjs.org/:_authToken=line://registry.npmjs.org/:_authToken=<paste token>. Save. Editing the file keeps the token out of shell history; never paste it into a repo.npmrc. - Check with
npm whoami, thennpm run deploy:dry-run.
When the token expires, npm whoami fails and the script falls back to browser
login; generate a new token and repeat step 4.
Failure recovery
If publishing fails, inspect and restore generated local changes before retrying.
If npm publication succeeds but Git push/commit fails, do not republish that version.
Resolve the Git issue and push the existing release commit and vX.Y.Z tag.
Merge this feature branch first; merging does not trigger publication automatically.