@open-mercato/cli 0.6.7-develop.6669.1.40b669666b → 0.6.7-develop.6671.1.4b925c5096
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/.turbo/turbo-build.log +2 -1
- package/AGENTS.md +1 -1
- package/dist/agentic/guides/module-facts.json +296 -53
- 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 +4 -2
- 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 +77 -0
- package/dist/agentic/guides/modules/workflows.md +1 -1
- package/dist/lib/post-generate-invalidation.js +2 -2
- package/dist/lib/post-generate-invalidation.js.map +2 -2
- package/dist/mercato.js +15 -1
- package/dist/mercato.js.map +2 -2
- package/package.json +5 -5
- package/src/__tests__/mercato.test.ts +323 -1
- package/src/lib/__tests__/post-generate-invalidation.test.ts +24 -0
- package/src/lib/post-generate-invalidation.ts +5 -2
- package/src/mercato.ts +31 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# business_rules — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6671.1.4b925c5096 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# communication_channels — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6671.1.4b925c5096 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# customer_accounts — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6671.1.4b925c5096 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# feature_toggles — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6671.1.4b925c5096 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# gateway_stripe — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6671.1.4b925c5096 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# payment_gateways — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6671.1.4b925c5096 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# sales — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6671.1.4b925c5096 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -33,13 +33,15 @@
|
|
|
33
33
|
| sales:sales_document_tag | SalesDocumentTag | sales_document_tags | yes | no |
|
|
34
34
|
| sales:sales_document_tag_assignment | SalesDocumentTagAssignment | sales_document_tag_assignments | yes | no |
|
|
35
35
|
|
|
36
|
-
## Events (
|
|
36
|
+
## Events (43)
|
|
37
37
|
|
|
38
38
|
| ID | Category | Entity |
|
|
39
39
|
|---|---|---|
|
|
40
40
|
| sales.order.created | crud | order |
|
|
41
41
|
| sales.order.updated | crud | order |
|
|
42
42
|
| sales.order.deleted | crud | order |
|
|
43
|
+
| sales.order.confirmed | lifecycle | order |
|
|
44
|
+
| sales.order.cancelled | lifecycle | order |
|
|
43
45
|
| sales.quote.created | crud | quote |
|
|
44
46
|
| sales.quote.updated | crud | quote |
|
|
45
47
|
| sales.quote.deleted | crud | quote |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# shipping_carriers — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6671.1.4b925c5096 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# system_status_overlays — module facts (generated, do not edit)
|
|
2
|
-
<!-- generated from @open-mercato/core 0.6.7-develop.
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6671.1.4b925c5096 — R1 staleness stamp -->
|
|
3
3
|
|
|
4
4
|
## Entities
|
|
5
5
|
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# wms — module facts (generated, do not edit)
|
|
2
|
+
<!-- generated from @open-mercato/core 0.6.7-develop.6671.1.4b925c5096 — R1 staleness stamp -->
|
|
3
|
+
|
|
4
|
+
## Entities
|
|
5
|
+
|
|
6
|
+
| Entity ID | Class | Table | Editable | CustomFields |
|
|
7
|
+
|---|---|---|---|---|
|
|
8
|
+
| wms:warehouse | Warehouse | wms_warehouses | no | yes |
|
|
9
|
+
| wms:warehouse_zone | WarehouseZone | wms_warehouse_zones | no | yes |
|
|
10
|
+
| wms:warehouse_location | WarehouseLocation | wms_warehouse_locations | no | yes |
|
|
11
|
+
| wms:product_inventory_profile | ProductInventoryProfile | wms_product_inventory_profiles | no | yes |
|
|
12
|
+
| wms:inventory_lot | InventoryLot | wms_inventory_lots | no | yes |
|
|
13
|
+
| wms:inventory_balance | InventoryBalance | wms_inventory_balances | no | yes |
|
|
14
|
+
| wms:inventory_reservation | InventoryReservation | wms_inventory_reservations | no | yes |
|
|
15
|
+
| wms:sales_order_warehouse_assignment | SalesOrderWarehouseAssignment | wms_sales_order_warehouse_assignments | no | no |
|
|
16
|
+
| wms:inventory_movement | InventoryMovement | wms_inventory_movements | no | yes |
|
|
17
|
+
|
|
18
|
+
## Events (27)
|
|
19
|
+
|
|
20
|
+
| ID | Category | Entity |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| wms.warehouse.created | crud | warehouse |
|
|
23
|
+
| wms.warehouse.updated | crud | warehouse |
|
|
24
|
+
| wms.zone.created | crud | zone |
|
|
25
|
+
| wms.zone.updated | crud | zone |
|
|
26
|
+
| wms.location.created | crud | location |
|
|
27
|
+
| wms.location.updated | crud | location |
|
|
28
|
+
| wms.inventory_profile.created | crud | inventory_profile |
|
|
29
|
+
| wms.inventory_profile.updated | crud | inventory_profile |
|
|
30
|
+
| wms.inventory_balance.created | crud | inventory_balance |
|
|
31
|
+
| wms.inventory_balance.updated | crud | inventory_balance |
|
|
32
|
+
| wms.inventory_balance.deleted | crud | inventory_balance |
|
|
33
|
+
| wms.inventory_reservation.created | crud | inventory_reservation |
|
|
34
|
+
| wms.inventory_reservation.updated | crud | inventory_reservation |
|
|
35
|
+
| wms.inventory_reservation.deleted | crud | inventory_reservation |
|
|
36
|
+
| wms.inventory_movement.created | crud | inventory_movement |
|
|
37
|
+
| wms.inventory_movement.updated | crud | inventory_movement |
|
|
38
|
+
| wms.inventory_movement.deleted | crud | inventory_movement |
|
|
39
|
+
| wms.inventory.received | custom | inventory |
|
|
40
|
+
| wms.inventory.adjusted | custom | inventory |
|
|
41
|
+
| wms.inventory.reserved | custom | inventory |
|
|
42
|
+
| wms.inventory.released | custom | inventory |
|
|
43
|
+
| wms.inventory.allocated | custom | inventory |
|
|
44
|
+
| wms.inventory.moved | custom | inventory |
|
|
45
|
+
| wms.inventory.reconciled | custom | inventory |
|
|
46
|
+
| wms.inventory.low_stock | lifecycle | inventory |
|
|
47
|
+
| wms.inventory.balance_drift | lifecycle | inventory |
|
|
48
|
+
| wms.inventory.reservation_shortfall | lifecycle | inventory |
|
|
49
|
+
|
|
50
|
+
## ACL features (10)
|
|
51
|
+
|
|
52
|
+
wms.view · wms.manage_warehouses · wms.manage_zones · wms.manage_locations · wms.manage_inventory · wms.manage_reservations · wms.adjust_inventory · wms.receive_inventory · wms.cycle_count · wms.import
|
|
53
|
+
|
|
54
|
+
## API routes
|
|
55
|
+
|
|
56
|
+
_none_
|
|
57
|
+
|
|
58
|
+
## DI service tokens
|
|
59
|
+
|
|
60
|
+
_none_
|
|
61
|
+
|
|
62
|
+
## Search entities
|
|
63
|
+
|
|
64
|
+
_none_
|
|
65
|
+
|
|
66
|
+
## Host extension points
|
|
67
|
+
|
|
68
|
+
- Entity IDs: _none_
|
|
69
|
+
- Table IDs: _none_
|
|
70
|
+
|
|
71
|
+
## Notifications
|
|
72
|
+
|
|
73
|
+
wms.inventory.low_stock · wms.inventory.reservation_shortfall
|
|
74
|
+
|
|
75
|
+
## CLI
|
|
76
|
+
|
|
77
|
+
verify-balances
|
|
@@ -11,12 +11,12 @@ function touchGeneratedFiles(appDir) {
|
|
|
11
11
|
const generatedDir = path.join(appDir, ".mercato", "generated");
|
|
12
12
|
if (!fs.existsSync(generatedDir) || !fs.statSync(generatedDir).isDirectory()) return [];
|
|
13
13
|
const touched = [];
|
|
14
|
+
const touchedAt = /* @__PURE__ */ new Date();
|
|
14
15
|
const entries = fs.readdirSync(generatedDir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name));
|
|
15
16
|
for (const entry of entries) {
|
|
16
17
|
if (!entry.isFile() || !TOUCHABLE_GENERATED_FILE_PATTERN.test(entry.name)) continue;
|
|
17
18
|
const filePath = path.join(generatedDir, entry.name);
|
|
18
|
-
|
|
19
|
-
fs.writeFileSync(filePath, contents);
|
|
19
|
+
fs.utimesSync(filePath, touchedAt, touchedAt);
|
|
20
20
|
touched.push(filePath);
|
|
21
21
|
}
|
|
22
22
|
return touched;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/lib/post-generate-invalidation.ts"],
|
|
4
|
-
"sourcesContent": ["import fs from 'node:fs'\nimport path from 'node:path'\nimport { purgeConfiguredCachePatternsAcrossTenantScopes } from '@open-mercato/shared/lib/cache/maintenance'\n\nconst STRUCTURAL_CACHE_PATTERNS = [\n 'nav:*',\n 'crud|*|*|*/admin/nav|*',\n 'crud|*|*|*/portal/nav|*',\n]\nconst TOUCHABLE_GENERATED_FILE_PATTERN = /\\.generated(?:\\.[a-z0-9]+)?(?:\\.ts|\\.checksum)$/i\n\nexport type PostGenerateStructuralInvalidationResult = {\n cacheEntriesDeleted: number\n generatedFilesTouched: string[]\n cacheError: unknown | null\n generatedFilesError: unknown | null\n}\n\nfunction touchGeneratedFiles(appDir: string): string[] {\n const generatedDir = path.join(appDir, '.mercato', 'generated')\n if (!fs.existsSync(generatedDir) || !fs.statSync(generatedDir).isDirectory()) return []\n\n const touched: string[] = []\n const entries = fs.readdirSync(generatedDir, { withFileTypes: true })\n .sort((left, right) => left.name.localeCompare(right.name))\n for (const entry of entries) {\n if (!entry.isFile() || !TOUCHABLE_GENERATED_FILE_PATTERN.test(entry.name)) continue\n const filePath = path.join(generatedDir, entry.name)\n
|
|
5
|
-
"mappings": "AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,sDAAsD;AAE/D,MAAM,4BAA4B;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AACF;AACA,MAAM,mCAAmC;AASzC,SAAS,oBAAoB,QAA0B;AACrD,QAAM,eAAe,KAAK,KAAK,QAAQ,YAAY,WAAW;AAC9D,MAAI,CAAC,GAAG,WAAW,YAAY,KAAK,CAAC,GAAG,SAAS,YAAY,EAAE,YAAY,EAAG,QAAO,CAAC;AAEtF,QAAM,UAAoB,CAAC;AAC3B,QAAM,UAAU,GAAG,YAAY,cAAc,EAAE,eAAe,KAAK,CAAC,EACjE,KAAK,CAAC,MAAM,UAAU,KAAK,KAAK,cAAc,MAAM,IAAI,CAAC;AAC5D,aAAW,SAAS,SAAS;AAC3B,QAAI,CAAC,MAAM,OAAO,KAAK,CAAC,iCAAiC,KAAK,MAAM,IAAI,EAAG;AAC3E,UAAM,WAAW,KAAK,KAAK,cAAc,MAAM,IAAI;AACnD,
|
|
4
|
+
"sourcesContent": ["import fs from 'node:fs'\nimport path from 'node:path'\nimport { purgeConfiguredCachePatternsAcrossTenantScopes } from '@open-mercato/shared/lib/cache/maintenance'\n\nconst STRUCTURAL_CACHE_PATTERNS = [\n 'nav:*',\n 'crud|*|*|*/admin/nav|*',\n 'crud|*|*|*/portal/nav|*',\n]\nconst TOUCHABLE_GENERATED_FILE_PATTERN = /\\.generated(?:\\.[a-z0-9]+)?(?:\\.ts|\\.checksum)$/i\n\nexport type PostGenerateStructuralInvalidationResult = {\n cacheEntriesDeleted: number\n generatedFilesTouched: string[]\n cacheError: unknown | null\n generatedFilesError: unknown | null\n}\n\nfunction touchGeneratedFiles(appDir: string): string[] {\n const generatedDir = path.join(appDir, '.mercato', 'generated')\n if (!fs.existsSync(generatedDir) || !fs.statSync(generatedDir).isDirectory()) return []\n\n const touched: string[] = []\n // `utimes` advances mtime without opening the file for writing. Rewriting the\n // identical bytes would truncate multi-megabyte registries first, and Turbopack\n // reads them concurrently during a dev compile \u2014 it can observe the empty window.\n const touchedAt = new Date()\n const entries = fs.readdirSync(generatedDir, { withFileTypes: true })\n .sort((left, right) => left.name.localeCompare(right.name))\n for (const entry of entries) {\n if (!entry.isFile() || !TOUCHABLE_GENERATED_FILE_PATTERN.test(entry.name)) continue\n const filePath = path.join(generatedDir, entry.name)\n fs.utimesSync(filePath, touchedAt, touchedAt)\n touched.push(filePath)\n }\n return touched\n}\n\nexport async function runPostGenerateStructuralInvalidation(\n appDir: string,\n): Promise<PostGenerateStructuralInvalidationResult> {\n let cacheEntriesDeleted = 0\n let generatedFilesTouched: string[] = []\n let cacheError: unknown | null = null\n let generatedFilesError: unknown | null = null\n\n try {\n generatedFilesTouched = touchGeneratedFiles(appDir)\n } catch (error) {\n generatedFilesError = error\n }\n\n try {\n cacheEntriesDeleted = await purgeConfiguredCachePatternsAcrossTenantScopes(STRUCTURAL_CACHE_PATTERNS)\n } catch (error) {\n cacheError = error\n }\n\n return {\n cacheEntriesDeleted,\n generatedFilesTouched,\n cacheError,\n generatedFilesError,\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,sDAAsD;AAE/D,MAAM,4BAA4B;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AACF;AACA,MAAM,mCAAmC;AASzC,SAAS,oBAAoB,QAA0B;AACrD,QAAM,eAAe,KAAK,KAAK,QAAQ,YAAY,WAAW;AAC9D,MAAI,CAAC,GAAG,WAAW,YAAY,KAAK,CAAC,GAAG,SAAS,YAAY,EAAE,YAAY,EAAG,QAAO,CAAC;AAEtF,QAAM,UAAoB,CAAC;AAI3B,QAAM,YAAY,oBAAI,KAAK;AAC3B,QAAM,UAAU,GAAG,YAAY,cAAc,EAAE,eAAe,KAAK,CAAC,EACjE,KAAK,CAAC,MAAM,UAAU,KAAK,KAAK,cAAc,MAAM,IAAI,CAAC;AAC5D,aAAW,SAAS,SAAS;AAC3B,QAAI,CAAC,MAAM,OAAO,KAAK,CAAC,iCAAiC,KAAK,MAAM,IAAI,EAAG;AAC3E,UAAM,WAAW,KAAK,KAAK,cAAc,MAAM,IAAI;AACnD,OAAG,WAAW,UAAU,WAAW,SAAS;AAC5C,YAAQ,KAAK,QAAQ;AAAA,EACvB;AACA,SAAO;AACT;AAEA,eAAsB,sCACpB,QACmD;AACnD,MAAI,sBAAsB;AAC1B,MAAI,wBAAkC,CAAC;AACvC,MAAI,aAA6B;AACjC,MAAI,sBAAsC;AAE1C,MAAI;AACF,4BAAwB,oBAAoB,MAAM;AAAA,EACpD,SAAS,OAAO;AACd,0BAAsB;AAAA,EACxB;AAEA,MAAI;AACF,0BAAsB,MAAM,+CAA+C,yBAAyB;AAAA,EACtG,SAAS,OAAO;AACd,iBAAa;AAAA,EACf;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/mercato.js
CHANGED
|
@@ -75,6 +75,7 @@ const TURBOPACK_CORRUPTION_PATTERNS = [
|
|
|
75
75
|
"Unable to open static sorted file",
|
|
76
76
|
"TurbopackInternalError"
|
|
77
77
|
];
|
|
78
|
+
const DEV_COLD_START_RETRY_DELAY_MS = 1500;
|
|
78
79
|
const BUILTIN_CLI_MODULE_IDS = /* @__PURE__ */ new Set(["queue", "generate", "deploy", "db", "server", "test"]);
|
|
79
80
|
function collectNestedErrors(error, seen = /* @__PURE__ */ new Set()) {
|
|
80
81
|
if (!error || seen.has(error)) {
|
|
@@ -202,7 +203,7 @@ async function ensureDatabaseExists(dbUrl) {
|
|
|
202
203
|
}
|
|
203
204
|
}
|
|
204
205
|
function isTurbopackCacheCorruption(output) {
|
|
205
|
-
return TURBOPACK_CORRUPTION_PATTERNS.
|
|
206
|
+
return TURBOPACK_CORRUPTION_PATTERNS.some((pattern) => output.includes(pattern));
|
|
206
207
|
}
|
|
207
208
|
function removeTurbopackDevCache(appDir) {
|
|
208
209
|
fs.rmSync(path.join(appDir, ".mercato", "next", "dev"), { recursive: true, force: true });
|
|
@@ -1594,6 +1595,7 @@ async function run(argv = process.argv) {
|
|
|
1594
1595
|
const nodeModulesBases = Array.from(/* @__PURE__ */ new Set([env.rootDir, appDir]));
|
|
1595
1596
|
let processes = [];
|
|
1596
1597
|
let didRetryCorruptedTurbopackCache = false;
|
|
1598
|
+
let didRetryFailedColdStart = false;
|
|
1597
1599
|
let stopping = false;
|
|
1598
1600
|
let devRestartPromiseResolve = null;
|
|
1599
1601
|
let activeLazySupervisor = null;
|
|
@@ -1731,6 +1733,18 @@ async function run(argv = process.argv) {
|
|
|
1731
1733
|
restarted.readyPromise.then(readyResolve);
|
|
1732
1734
|
return resolve(await restarted.exitPromise);
|
|
1733
1735
|
}
|
|
1736
|
+
if (!didRetryFailedColdStart && !reportedReady && !stopping && typeof code === "number" && code !== 0) {
|
|
1737
|
+
didRetryFailedColdStart = true;
|
|
1738
|
+
lastRestartReason = "a failed cold start";
|
|
1739
|
+
writeDevSplashRuntimeRestarting(lastRestartReason);
|
|
1740
|
+
console.log(`[server] Next.js dev server exited before becoming ready (exit code ${code}). Retrying once...`);
|
|
1741
|
+
await new Promise((wake) => setTimeout(wake, DEV_COLD_START_RETRY_DELAY_MS));
|
|
1742
|
+
if (!stopping) {
|
|
1743
|
+
const restarted = startNextDev(runtimeEnv);
|
|
1744
|
+
restarted.readyPromise.then(readyResolve);
|
|
1745
|
+
return resolve(await restarted.exitPromise);
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1734
1748
|
resolve({
|
|
1735
1749
|
label: "Next.js dev server",
|
|
1736
1750
|
code,
|