create-mercato-app 0.6.7-develop.6775.1.c2313bb8a3 → 0.6.7-develop.6784.1.f80b9afce5
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.
- package/agentic/shared/AGENTS.md.template +1 -1
- package/agentic/shared/ai/skills/om-auto-upgrade-0.6.6-to-0.6.7/SKILL.md +98 -0
- package/agentic/shared/ai/skills/tiers.json +4 -1
- package/dist/agentic/guides/module-facts.json +108 -108
- package/dist/agentic/guides/modules/ai_assistant.md +1 -1
- package/dist/agentic/guides/modules/api_docs.md +1 -1
- package/dist/agentic/guides/modules/api_keys.md +1 -1
- package/dist/agentic/guides/modules/attachments.md +1 -1
- package/dist/agentic/guides/modules/audit_logs.md +1 -1
- package/dist/agentic/guides/modules/auth.md +1 -1
- package/dist/agentic/guides/modules/business_rules.md +1 -1
- package/dist/agentic/guides/modules/catalog.md +1 -1
- package/dist/agentic/guides/modules/channel_gmail.md +1 -1
- package/dist/agentic/guides/modules/channel_imap.md +1 -1
- package/dist/agentic/guides/modules/checkout.md +1 -1
- package/dist/agentic/guides/modules/communication_channels.md +1 -1
- package/dist/agentic/guides/modules/configs.md +1 -1
- package/dist/agentic/guides/modules/content.md +1 -1
- package/dist/agentic/guides/modules/currencies.md +1 -1
- package/dist/agentic/guides/modules/customer_accounts.md +1 -1
- package/dist/agentic/guides/modules/customers.md +1 -1
- package/dist/agentic/guides/modules/dashboards.md +1 -1
- package/dist/agentic/guides/modules/data_sync.md +1 -1
- package/dist/agentic/guides/modules/dictionaries.md +1 -1
- package/dist/agentic/guides/modules/directory.md +1 -1
- package/dist/agentic/guides/modules/entities.md +1 -1
- package/dist/agentic/guides/modules/events.md +1 -1
- package/dist/agentic/guides/modules/feature_toggles.md +1 -1
- package/dist/agentic/guides/modules/gateway_stripe.md +1 -1
- package/dist/agentic/guides/modules/generators.md +1 -1
- package/dist/agentic/guides/modules/inbox_ops.md +1 -1
- package/dist/agentic/guides/modules/integrations.md +1 -1
- package/dist/agentic/guides/modules/messages.md +1 -1
- package/dist/agentic/guides/modules/notifications.md +1 -1
- package/dist/agentic/guides/modules/onboarding.md +1 -1
- package/dist/agentic/guides/modules/payment_gateways.md +1 -1
- package/dist/agentic/guides/modules/perspectives.md +1 -1
- package/dist/agentic/guides/modules/planner.md +1 -1
- package/dist/agentic/guides/modules/portal.md +1 -1
- package/dist/agentic/guides/modules/progress.md +1 -1
- package/dist/agentic/guides/modules/query_index.md +1 -1
- package/dist/agentic/guides/modules/record_locks.md +1 -1
- package/dist/agentic/guides/modules/resources.md +1 -1
- package/dist/agentic/guides/modules/sales.md +1 -1
- package/dist/agentic/guides/modules/scheduler.md +1 -1
- package/dist/agentic/guides/modules/search.md +1 -1
- package/dist/agentic/guides/modules/security.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers.md +1 -1
- package/dist/agentic/guides/modules/sso.md +1 -1
- package/dist/agentic/guides/modules/staff.md +1 -1
- package/dist/agentic/guides/modules/storage_s3.md +1 -1
- package/dist/agentic/guides/modules/sync_akeneo.md +1 -1
- package/dist/agentic/guides/modules/sync_excel.md +1 -1
- package/dist/agentic/guides/modules/system_status_overlays.md +1 -1
- package/dist/agentic/guides/modules/translations.md +1 -1
- package/dist/agentic/guides/modules/webhooks.md +1 -1
- package/dist/agentic/guides/modules/wms.md +1 -1
- package/dist/agentic/guides/modules/workflows.md +1 -1
- package/dist/agentic/guides/upstream/BACKWARD_COMPATIBILITY.md +3 -0
- package/dist/agentic/guides/upstream/manifest.json +2 -2
- package/dist/agentic/shared/AGENTS.md.template +1 -1
- package/dist/agentic/shared/ai/skills/om-auto-upgrade-0.6.6-to-0.6.7/SKILL.md +98 -0
- package/dist/agentic/shared/ai/skills/tiers.json +4 -1
- package/package.json +3 -3
- package/template/.env.example +3 -0
- package/template/AGENTS.md +1 -1
- package/template/src/app/(backend)/backend/__tests__/layout-route-registry.test.tsx +1 -0
- package/template/src/app/(backend)/backend/layout.tsx +5 -3
- package/template/src/modules/example/__integration__/TC-EXAMPLE-001-todo-label-edit.spec.ts +123 -0
- package/template/src/modules/example/__integration__/TC-EXAMPLE-002-query-index-failure.spec.ts +155 -0
- package/template/src/modules.ts +3 -0
|
@@ -7,7 +7,7 @@ Extend this app. Route first; never probe unmatched context.
|
|
|
7
7
|
- Route all axes; missing context: `yarn mercato agentic:init --update-harness`.
|
|
8
8
|
- App code: `src/modules/<id>/`; framework context only for a named version gap.
|
|
9
9
|
- Derive trusted `tenantId` + `organizationId` and fail closed. Only an installed contract may use system scope (`organizationId: null`).
|
|
10
|
-
- Use commands
|
|
10
|
+
- Use commands/`makeCrudRoute`/`CrudForm`/`DataTable`, DI/events/UMES; effects stay post-commit.
|
|
11
11
|
- Put entities in `src/modules/<id>/data/entities.ts`; API routes need per-method `metadata` + `openApi`.
|
|
12
12
|
- Editable records expose `updated_at`/`updatedAt`; custom update/delete clients send the version and surface 409s.
|
|
13
13
|
- Run `yarn db:generate`, review scoped SQL/snapshot, and ask before applying it.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: om-auto-upgrade-0.6.6-to-0.6.7
|
|
3
|
+
description: Migrate downstream Open Mercato user code from 0.6.6 to 0.6.7. Applies the pg-errors import move, safely unwraps proven scheduler queue payload consumers, audits query-index callbacks and removed scheduler metadata, then typechecks and reports manual follow-up. Use for "upgrade Open Mercato to 0.6.7", "migrate 0.6.6 to 0.6.7", or "apply the 0.6.7 upgrade notes".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Auto upgrade 0.6.6 to 0.6.7
|
|
7
|
+
|
|
8
|
+
Apply the mechanical parts of the Open Mercato `0.6.6 → 0.6.7` upgrade to a downstream app. Treat the matching section of `UPGRADE_NOTES.md` as the source of truth.
|
|
9
|
+
|
|
10
|
+
## Scope
|
|
11
|
+
|
|
12
|
+
Operate on a standalone app or downstream repository that depends on `@open-mercato/*`. Never modify the framework monorepo's `packages/`, dependency pins, lockfile, generated output, or vendored dependencies. Run after the user has selected and installed `0.6.7`.
|
|
13
|
+
|
|
14
|
+
## Arguments
|
|
15
|
+
|
|
16
|
+
- `--path <dir>`: downstream repository root; defaults to the current directory.
|
|
17
|
+
- `--dry-run`: detect, classify, and report without editing or running mutating commands.
|
|
18
|
+
- `--only <id[,id...]>`: limit work to named checks.
|
|
19
|
+
- `--skip <id[,id...]>`: omit named checks and record the omission in the report.
|
|
20
|
+
|
|
21
|
+
Reject unknown flags and combining `--only` with `--skip`.
|
|
22
|
+
|
|
23
|
+
## Upgrade checks
|
|
24
|
+
|
|
25
|
+
| ID | Classification | Detect | Action |
|
|
26
|
+
| --- | --- | --- | --- |
|
|
27
|
+
| `pg-errors-import` | Automatic | Exact module specifier `@open-mercato/core/modules/communication_channels/lib/pg-errors` | Replace only the module specifier with `@open-mercato/shared/lib/db/pg-errors`; preserve imported names and formatting |
|
|
28
|
+
| `scheduler-flat-payload` | Automatic when proven; otherwise report | Member access shaped as `<job>.payload.payload.<field>` | Unwrap to `<job>.payload.<field>` only after proving the consumer handles a queue targeted by a scheduler registration in this repository |
|
|
29
|
+
| `scheduler-removed-metadata` | Detect and report | Scheduler queue consumers reading `scheduleId`, `scheduleName`, `scopeType`, or `triggeredAt` from the job payload | Identify the matching schedule registration and tell the user to include each required value explicitly in `targetPayload`; never invent values |
|
|
30
|
+
| `query-index-callback-errors` | Detect and report | Direct `upsertIndexBatch` callers with custom `encryptDoc` or `decryptDoc` callbacks that catch and suppress errors | Report the callback and swallowed branch; do not rewrite error policy automatically |
|
|
31
|
+
| `query-index-result-awareness` | No code action | Direct reindex orchestration that assumes partial writes can never fail | Explain that `QueryIndexBatchWriteError` now makes previously hidden loss fail the job/CLI and point to existing error handling/tests |
|
|
32
|
+
|
|
33
|
+
## Workflow
|
|
34
|
+
|
|
35
|
+
### 1. Gate the target
|
|
36
|
+
|
|
37
|
+
Resolve `--path`, require a regular `package.json`, and confirm at least one dependency or dev dependency starts with `@open-mercato/`. Refuse to run when the target contains this framework monorepo's `packages/core` and `packages/shared` workspaces.
|
|
38
|
+
|
|
39
|
+
Inspect installed/pinned Open Mercato versions. Continue when they resolve to `0.6.7`; otherwise warn with the detected versions and require explicit user confirmation before edits. A dry run may continue without confirmation.
|
|
40
|
+
|
|
41
|
+
Exclude `node_modules/`, `.yarn/`, `.git/`, `.next/`, `dist/`, `build/`, `coverage/`, `.mercato/generated/`, and other generated or vendored paths from every scan.
|
|
42
|
+
|
|
43
|
+
### 2. Build and show the plan
|
|
44
|
+
|
|
45
|
+
Run all selected detections before editing. Report each match as `{checkId, file, line, classification, proposedAction}` and show totals by check.
|
|
46
|
+
|
|
47
|
+
For `scheduler-flat-payload`, prove ownership before classifying a match as automatic:
|
|
48
|
+
|
|
49
|
+
1. Find the worker's queue name from its exported metadata or registration.
|
|
50
|
+
2. Find a scheduler definition in the same repository targeting that queue and using `targetPayload`.
|
|
51
|
+
3. Confirm the nested member is reading a field supplied by that `targetPayload`.
|
|
52
|
+
|
|
53
|
+
If any link is missing or multiple schedules disagree, downgrade the match to detect-and-report. Never perform a repository-wide `payload.payload` replacement.
|
|
54
|
+
|
|
55
|
+
With `--dry-run`, print the complete plan plus manual review and stop without edits.
|
|
56
|
+
|
|
57
|
+
### 3. Apply bounded edits
|
|
58
|
+
|
|
59
|
+
Ask for confirmation of the displayed plan. Apply one minimal edit per file:
|
|
60
|
+
|
|
61
|
+
- `pg-errors-import` changes only the exact string-literal module specifier and is idempotent.
|
|
62
|
+
- `scheduler-flat-payload` removes exactly one redundant `.payload` segment for each proven field access. Preserve optional chaining, whitespace, and surrounding logic.
|
|
63
|
+
|
|
64
|
+
Re-scan after editing. Exact old imports and proven nested accesses must be absent; manual findings remain listed.
|
|
65
|
+
|
|
66
|
+
### 4. Verify
|
|
67
|
+
|
|
68
|
+
Use scripts from the downstream app's `package.json`; do not assume monorepo-only commands exist. Run, in order when present:
|
|
69
|
+
|
|
70
|
+
1. `yarn generate`
|
|
71
|
+
2. `yarn typecheck`
|
|
72
|
+
3. the smallest affected test command, otherwise `yarn test`
|
|
73
|
+
4. `yarn build`
|
|
74
|
+
|
|
75
|
+
Stop at the first new failure caused by an edit, revert only that edit, and move it to manual follow-up. Preserve and report pre-existing failures rather than rewriting unrelated code or weakening checks.
|
|
76
|
+
|
|
77
|
+
### 5. Report
|
|
78
|
+
|
|
79
|
+
Report:
|
|
80
|
+
|
|
81
|
+
- detected Open Mercato versions;
|
|
82
|
+
- every edited file grouped by check ID;
|
|
83
|
+
- no-match and skipped checks;
|
|
84
|
+
- exact manual findings for removed scheduler metadata and swallowed query-index callback errors;
|
|
85
|
+
- validation commands and outcomes;
|
|
86
|
+
- a reminder that reindex jobs may now fail where `0.6.6` silently lost records.
|
|
87
|
+
|
|
88
|
+
If no code changes were required, still report that all four detection categories ran. Recommend reviewing the `0.6.6 → 0.6.7` section of `UPGRADE_NOTES.md` before deployment.
|
|
89
|
+
|
|
90
|
+
## Rules
|
|
91
|
+
|
|
92
|
+
- Every automatic edit must be bounded, minimal, and idempotent.
|
|
93
|
+
- Never change dependency versions or regenerate a lockfile.
|
|
94
|
+
- Never edit framework-owned `packages/` or generated/vendor directories.
|
|
95
|
+
- Never invent replacements for removed scheduler metadata.
|
|
96
|
+
- Never make custom encryption/decryption callbacks swallow errors to preserve old behavior.
|
|
97
|
+
- Never weaken typecheck, tests, or build to make the upgrade appear green.
|
|
98
|
+
- Always show the edit plan before mutation and the exact changed-file list afterward.
|
|
@@ -167,7 +167,10 @@
|
|
|
167
167
|
},
|
|
168
168
|
"migration": {
|
|
169
169
|
"description": "One-shot, version-pinned migrations. Install only for the named upgrade.",
|
|
170
|
-
"skills": [
|
|
170
|
+
"skills": [
|
|
171
|
+
"om-auto-upgrade-0.4.10-to-0.5.0",
|
|
172
|
+
"om-auto-upgrade-0.6.6-to-0.6.7"
|
|
173
|
+
]
|
|
171
174
|
}
|
|
172
175
|
}
|
|
173
176
|
}
|