nono-migration
v1.4.1
Published
CLI tool to manage migration changes and user changes separately for React Native miniapp projects
Maintainers
Readme
nono-migration
A CLI tool to manage migration changes and user changes separately for React Native miniapp projects. This tool helps you maintain clean git history by separating migration-generated changes from your manual code changes.
Features
- 🔄 Smart Migration Management: Automatically separates migration changes from user changes
- 📦 Git Integration: Intelligent staging and committing with change separation
- 🎯 Exclude List: Track files that should have migration changes excluded from commits
- 📸 Snapshot System: Maintains snapshots of user and migration changes
- 🚀 Easy Updates: Simple command to update migration tools
Installation
Install globally using npm:
npm install -g nono-migrationOr using yarn:
yarn global add nono-migrationUsage
Initialize Migration
Run this command when you want to start using the migration tool:
nono migration
# or
nono start
# or
nono -mThis command will:
- Snapshot your current changes to
user-changes.json - Run
momo-migration - Save migration changes to
migration-changes.json - Create
.git-exclude-listwith files changed by migration - Add nono scripts to your
package.json - Update ports from 8181 to 8182 if your package name is
vn.momo.profileor@momo-mini-app/profile - Add tracking files to
.gitignore
Commit Changes
Use this command instead of git commit to commit only your changes:
nono commit -m "fix(chat): SC-1 your commit message"With additional options:
nono commit -m "fix(chat): SC-1 message" --amend
nono commit --amend --no-editThis command will:
- Compare files in
.git-exclude-listwith snapshots inmigration-changes.json - Stage only the differences (your changes)
- Keep migration changes unstaged
- Commit with your message
- Preserve tracking files for next commit
Update Migration Tools
Update @momo-platform/momo-migration and @momo-platform/momo-cli to latest versions:
nono update
# or
nono -uVersion
Check the installed version:
nono --version
# or
nono -vHow It Works
Example Workflow
Step 1: Initial State
- You have a modified file:
src/api/profileApi.ts
Step 2: Run Migration
nono migrationThe tool will:
- Save
src/api/profileApi.tstouser-changes.json - Run
momo-migrationwhich modifies multiple files:package.json.gitlab-ci.ymlapp.jsonbabel.config.json- And more...
- Save these migration changes to
migration-changes.json - Create
.git-exclude-listwith all migration-modified files
Step 3: Make More Changes
- Edit
package.json(which is in.git-exclude-list) - Edit
src/components/AvatarProfile.tsx(not in exclude list)
Git status will show:
- Staged:
package.json - Unstaged: All migration files + your new changes
Step 4: Commit Your Changes
nono commit -m "fix(chat): SC-1 update profile logic"The tool will:
- Compare
package.jsonwith snapshot inmigration-changes.json - Separate your changes (A) from migration changes (B)
- Stage only your changes:
package.json(A),src/api/profileApi.ts,src/components/AvatarProfile.tsx - Keep migration changes unstaged
- Commit only your changes
- Preserve tracking files for next commit
File Structure
After running nono migration, you'll have these tracking files:
migration-changes.json: Snapshot of all changes made by migrationuser-changes.json: Snapshot of your changes before migration.git-exclude-list: List of files to separate during commit
These files are automatically added to .gitignore.
Scripts in package.json
The migration command adds these scripts:
{
"scripts": {
"nono:commit": "nono commit",
"nono:migration": "nono migration",
"nono:update": "nono update"
}
}You can also use them via yarn/npm:
yarn nono:commit -m "message"
yarn nono:migration
yarn nono:updateDevelopment
Build
npm run buildDevelopment Mode
npm run devLocal Testing
npm linkThen you can use nono command globally in your terminal.
Requirements
- Node.js >= 14.0.0
- Git
License
MIT
Author
Built with ❤️ for React Native miniapp development teams.
