@metasession.co/devaudit-plugin-sdk 1.6.1 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +14 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -28,7 +28,7 @@ A plugin is an npm package whose `package.json` declares a `devaudit` field, and
28
28
  "commands": [
29
29
  { "name": "migrate-status", "description": "Show pending Prisma migrations" }
30
30
  ],
31
- "hooks": ["afterUpdate"]
31
+ "hooks": ["afterSync"]
32
32
  }
33
33
  }
34
34
  ```
@@ -42,7 +42,7 @@ const plugin: Plugin = {
42
42
  name: 'devaudit-plugin-prisma',
43
43
  apiVersion: '1',
44
44
  hooks: {
45
- afterUpdate: async (ctx) => {
45
+ afterSync: async (ctx) => {
46
46
  ctx.logger.info(`Sync done. Now run \`npx prisma migrate deploy\` in ${ctx.projectPath}.`);
47
47
  },
48
48
  },
@@ -56,6 +56,18 @@ const plugin: Plugin = {
56
56
  export default plugin;
57
57
  ```
58
58
 
59
+ ## Lifecycle hooks
60
+
61
+ `LifecycleHookName` (the type export below) currently includes these values:
62
+
63
+ | Hook | Fires | Status |
64
+ | --- | --- | --- |
65
+ | `beforeSync` / `afterSync` | Around the template-copy step of `devaudit update` | **Wired up and working** — the one hook pair every shipped plugin actually uses (e.g. the Prisma plugin's `afterSync`, above). |
66
+ | `onDoctor` | At the end of `devaudit doctor`, after the built-in checks | **Wired up and working** — see [`docs/doctor.md`](../docs/doctor.md#plugin-extension-point-ondoctor). |
67
+ | `beforeInstall` / `afterInstall` | Around `devaudit install` | **Wired up and working** (`cli/src/install/index.ts`). |
68
+ | `beforePush` / `afterPush` | Around `devaudit push` | **Wired up and working** (`cli/src/commands/push.ts`). |
69
+ | `beforeUpdate` / `afterUpdate` | Intended to wrap the whole `devaudit update` invocation (broader than just the template-sync step `beforeSync`/`afterSync` cover) | **Reserved, not implemented** — declared in the type, but no code path calls them. If you need a post-sync hook today, use `afterSync`; it covers the same practical use case (act on the freshly-synced tree). |
70
+
59
71
  ## What's exported
60
72
 
61
73
  | Export | Purpose |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metasession.co/devaudit-plugin-sdk",
3
- "version": "1.6.1",
3
+ "version": "1.7.1",
4
4
  "description": "DevAudit CLI plugin contract — interfaces, manifest schema, and lifecycle hooks that DevAudit plugins compile against.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",