-
Notifications
You must be signed in to change notification settings - Fork 0
Managing Modules
Commit your plugin before running Update or Remove. Update replaces generated files; Remove deletes the complete module, including your implementation.
Check generated files, metadata, the link to your plugin, exports, and the local
node_modules link:
supernote-module validate your-moduleAlso compile the generated Android integration:
supernote-module validate your-module --buildAdd --verbose when diagnosing a failed build. Validate all modules created by
the generator with:
supernote-module validate --allWarning: Update has no dry-run or file-by-file diff. Commit first.
supernote-module update your-moduleInteractive Update shows a replace/preserve summary and Git status. --yes
accepts that plan. Update cannot change the module type, package name,
JavaScript name, Android namespace, or package version.
| Type | Preserved by Update |
|---|---|
| Native | Kotlin/Java below android/src/main/java/ and migrated legacy android/src/main/kotlin/, except generated packages |
| JNI/JSI | Complete android/src/main/cpp/ tree, including deliberately deleted starter files |
Native Update retains the previous index.d.ts until the Android/KSP build
regenerates it. Build after changing exports.
Update may replace:
- package and JavaScript wrapper files;
- Android build and registration files;
- generated bridge or binding code;
- the generated README and module metadata.
Files the Generator Creates lists the exact editable paths and replacement categories.
Update normally refreshes npm or Yarn only when package metadata or the local
link is stale. With --skip-install, run the recovery command it prints.
Warning: Remove deletes the complete module directory, including all preserved implementation source. Commit or copy it first.
supernote-module remove your-moduleInteractive removal requires typing the exact package name. Automation requires an explicit target and confirmation:
supernote-module remove your-module --yes
supernote-module remove --all --yesRemove unlinks the package and deletes its directory. If the operation fails
before deletion is committed, the generator attempts to roll it back. Remove
normally refreshes npm or Yarn after unlinking; --skip-install leaves that
step to you.
When both package-lock.json and yarn.lock exist, commands that need package
manager work require --package-manager npm or --package-manager yarn.
Generator operations attempt to roll back failed changes. If npm, Yarn, or
another process changes the same files during the operation, automatic rollback
may be incomplete. Exit code 3 means recovery is still required.
- Follow the printed recovery action.
- Run the generator again to allow startup recovery.
- Do not delete
.supernote-module-transaction.jsonor recovery storage while recovery is pending. - If recovery repeatedly fails, preserve the journal and inspect the reported paths before editing files manually.
Transactions reduce partial changes, but version control is still the safest way to inspect and restore your work.