Automation on top of the OfflineDex spreadsheet: save-change highlighting and per-version migration. See CONTEXT.md for full design notes.
├── library/ OfflineDex Library — standalone Apps Script project
│ ├── appsscript.json
│ ├── SaveTracker.js
│ └── Migrator.js
├── bound/ Bound script — per-version, lives inside each spreadsheet copy
│ ├── appsscript.json
│ ├── onOpen.js
│ ├── LoadPlayerData.js
│ └── UploadPlayerData.html
├── CONTEXT.md Full design and decision log
└── README.md This file
.clasp.json files are gitignored (contain Script IDs). Each project directory needs one locally — see formats below.
./install.shWires up the git hooks so git push auto-runs clasp push for whichever project changed.
- Node.js v20+
- clasp:
npm install -g @google/clasp clasp login(one-time OAuth flow)- Apps Script API enabled: https://script.google.com/home/usersettings
Do this once. The library project is stable across all spreadsheet versions.
1. Create the Apps Script project
Go to script.google.com, create a new standalone project named "OfflineDex Library".
2. Wire up clasp
cd libraryCreate library/.clasp.json with the library's Script ID (from Project Settings > Script ID in the Apps Script editor):
{
"scriptId": "YOUR_LIBRARY_SCRIPT_ID",
"rootDir": "."
}3. Push the library
clasp push4. Deploy as a library
In the Apps Script editor: Deploy → New deployment → type: Library → description "v1" → Deploy.
Note the deployment version number (starts at 1). You'll need this in the bound script's appsscript.json.
5. Fill in the manifest placeholder
In bound/appsscript.json, replace FILL_IN_LIBRARY_SCRIPT_ID with the library's Script ID and confirm the version number matches what you deployed.
The bound appsscript.json needs two libraries: your OfflineDexLib (above) and the creator's cCryptoGS. You need to get cCryptoGS's Script ID from the creator's project.
How to get the cCryptoGS Script ID:
- Open any existing OfflineDex spreadsheet copy (one you've already been using)
- Extensions → Apps Script → Libraries (left sidebar)
- Click
cCryptoGS→ copy the Script ID and note the version
Fill both into bound/appsscript.json:
{
"timeZone": "America/New_York",
"dependencies": {
"libraries": [
{
"userSymbol": "OfflineDexLib",
"libraryId": "YOUR_LIBRARY_SCRIPT_ID",
"version": "1",
"developmentMode": false
},
{
"userSymbol": "cCryptoGS",
"libraryId": "ACTUAL_CCRYPTOGS_SCRIPT_ID",
"version": "3",
"developmentMode": false
}
]
},
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8"
}Commit this filled-in appsscript.json to git. You only need to do this once — subsequent version setups restore it via git restore.
1. Copy the new spreadsheet
Make a fresh copy of the creator's new public spreadsheet into your Drive.
2. Get the new Script ID
Open the copy → Extensions → Apps Script → Project Settings → Script ID.
3. Update .clasp.json
cd boundEdit (or create) bound/.clasp.json:
{
"scriptId": "NEW_SPREADSHEETS_SCRIPT_ID",
"rootDir": "."
}4. Pull, restore, and merge
python3 update.pyThis pulls the creator's full file set, restores your edits, and auto-merges any changes the creator made to appsscript.json (new macros, etc.). It warns you if anything needs manual review. If the manifest changed, review and commit it before pushing.
5. Push
clasp push -f6. Run the migration
- Reload the spreadsheet tab
- Menu: Upload PokeRogue Data → Migrate from previous version
- Enter the version you're migrating FROM when prompted (e.g.
5.07) - Wait for the completion alert (~2 minutes)
8. Upload your save
- Menu: Upload PokeRogue Data → Upload Data
cd library
# edit files
clasp pushThen in the Apps Script editor: Deploy → Manage deployments → pencil on the existing deployment → Version: New version → Deploy.
Finally, bump the version number in bound/appsscript.json and run through the next version's setup (or update in-place via the Apps Script UI on each active spreadsheet).
Both appsscript.json files use America/Los_Angeles. Change if needed — it affects how Apps Script formats dates in logs.