@fayz-ai/sdk 0.9.0-next.1 → 0.10.0
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/README.md +2 -2
- package/dist/ai-builder.js +1 -1
- package/dist/{chunk-2YJXKDHO.js → chunk-6UZOXHGJ.js} +11 -6
- package/dist/chunk-6UZOXHGJ.js.map +1 -0
- package/dist/{chunk-V4GWI7WH.js → chunk-7UXTYT6I.js} +65 -4
- package/dist/chunk-7UXTYT6I.js.map +1 -0
- package/dist/{chunk-7XM4LONE.js → chunk-BJFMBVMP.js} +2 -2
- package/dist/chunk-BJFMBVMP.js.map +1 -0
- package/dist/chunk-HA5O3CW7.js +181 -0
- package/dist/chunk-HA5O3CW7.js.map +1 -0
- package/dist/chunk-VRUPJGFZ.js +135 -0
- package/dist/chunk-VRUPJGFZ.js.map +1 -0
- package/dist/deprecations.d.ts +98 -0
- package/dist/deprecations.d.ts.map +1 -0
- package/dist/deprecations.js +3 -0
- package/dist/deprecations.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -4
- package/dist/release-channels.js +1 -1
- package/dist/shop.d.ts +32 -0
- package/dist/shop.d.ts.map +1 -1
- package/dist/shop.js +2 -1
- package/dist/supported-surface.d.ts +8 -1
- package/dist/supported-surface.d.ts.map +1 -1
- package/dist/supported-surface.js +1 -1
- package/dist/vite.d.ts +30 -1
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +10 -2
- package/dist/vite.js.map +1 -1
- package/package.json +7 -14
- package/dist/chunk-2YJXKDHO.js.map +0 -1
- package/dist/chunk-7XM4LONE.js.map +0 -1
- package/dist/chunk-V4GWI7WH.js.map +0 -1
- package/dist/chunk-YZQW3BJA.js +0 -135
- package/dist/chunk-YZQW3BJA.js.map +0 -1
- package/src/agent.test.ts +0 -114
- package/src/agent.ts +0 -335
- package/src/ai-builder.ts +0 -115
- package/src/app-params.ts +0 -69
- package/src/client.test.ts +0 -176
- package/src/client.ts +0 -229
- package/src/index.ts +0 -94
- package/src/release-channels.json +0 -103
- package/src/release-channels.test.ts +0 -41
- package/src/release-channels.ts +0 -41
- package/src/runtime.test.ts +0 -123
- package/src/runtime.ts +0 -211
- package/src/shop.test.ts +0 -114
- package/src/shop.ts +0 -1118
- package/src/supported-surface.json +0 -40
- package/src/supported-surface.ts +0 -33
- package/src/types.ts +0 -67
- package/src/vite.ts +0 -121
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/deprecations.json","../src/deprecations.ts"],"names":[],"mappings":";AAAA,IAAA,oBAAA,GAAA;AAAA,EACE,eAAA,EAAmB,CAAA;AAAA,EACnB,MAAA,EAAU;AAAA,IACR,sBAAA,EAA0B,CAAA;AAAA,IAC1B,OAAA,EAAW;AAAA,GACb;AAAA,EACA,YAAA,EAAgB;AAAA,IACd;AAAA,MACE,EAAA,EAAM,oBAAA;AAAA,MACN,OAAA,EAAW,eAAA;AAAA,MACX,OAAA,EAAW,cAAA;AAAA,MACX,KAAA,EAAS,gCAAA;AAAA,MACT,YAAA,EAAgB,QAAA;AAAA,MAChB,QAAA,EAAY,QAAA;AAAA,MACZ,WAAA,EAAe,sNAAA;AAAA,MACf,IAAA,EAAQ,mSAAA;AAAA,MACR,KAAA,EAAS,CAAC,4BAAA,EAA8B,4BAAA,EAA8B,0BAA0B,CAAA;AAAA,MAChG,MAAA,EAAU,uGAAA;AAAA,MACV,OAAA,EAAW,2BAAA;AAAA,MACX,SAAA,EAAa;AAAA,KACf;AAAA,IACA;AAAA,MACE,EAAA,EAAM,+BAAA;AAAA,MACN,OAAA,EAAW,cAAA;AAAA,MACX,OAAA,EAAW,iBAAA;AAAA,MACX,KAAA,EAAS,6CAAA;AAAA,MACT,YAAA,EAAgB,OAAA;AAAA,MAChB,QAAA,EAAY,QAAA;AAAA,MACZ,WAAA,EAAe,mIAAA;AAAA,MACf,IAAA,EAAQ,4VAAA;AAAA,MACR,KAAA,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wB,GAAA,EAA8B;AACpE,EAAA,MAAM,IAAA,GAAO,OAAA,CAAQ,GAAA,CAAI,YAAY,CAAA;AACrC,EAAA,MAAM,EAAA,GAAK,OAAA,CAAQ,GAAA,CAAI,QAAQ,CAAA;AAG/B,EAAA,IAAI,EAAA,CAAG,KAAA,GAAQ,IAAA,CAAK,KAAA,SAAc,MAAA,CAAO,iBAAA;AACzC,EAAA,OAAO,EAAA,CAAG,QAAQ,IAAA,CAAK,KAAA;AACzB","file":"chunk-HA5O3CW7.js","sourcesContent":["{\n \"registryVersion\": 1,\n \"policy\": {\n \"minMinorsBeforeRemoval\": 2,\n \"summary\": \"Nothing is removed without a shim, and the deprecation is enumerable (spine I10). A deprecation is ANNOUNCED in a minor release and REMOVED no earlier than two minor releases later, so a store always has one whole release in which both the old and the new input work. Every shim's warning names its replacement (I2). Every row here carries a codemod id; a codemod that cannot be safe refuses and names the decision a human must make.\"\n },\n \"deprecations\": [\n {\n \"id\": \"admin.package.saas\",\n \"package\": \"@fayz-ai/saas\",\n \"surface\": \"package-name\",\n \"title\": \"the @fayz-ai/saas package name\",\n \"deprecatedIn\": \"0.10.0\",\n \"removeIn\": \"0.12.0\",\n \"replacement\": \"@fayz-ai/admin — same exports, same subpaths (/ui, /db, /org, /billing, /permissions), renamed because the package is the admin surface (shell, CRUD engine, org, billing, permissions), not the business model\",\n \"shim\": \"packages/saas is now a thin package that re-exports @fayz-ai/admin, so an app that has not migrated builds and runs unchanged. What it costs is a second package in the graph and one console warning per entry point per session. It ships no implementation, so there is no behaviour to drift.\",\n \"where\": [\"packages/saas/src/index.ts\", \"packages/saas/package.json\", \"packages/sdk/src/vite.ts\"],\n \"detect\": \"The app's package.json depends on @fayz-ai/saas, or any file under src/ imports from '@fayz-ai/saas'.\",\n \"codemod\": \"admin.saas-package-rename\",\n \"reference\": \"packages/saas/README.md\"\n },\n {\n \"id\": \"shop.provider.productMetadata\",\n \"package\": \"@fayz-ai/sdk\",\n \"surface\": \"provider-option\",\n \"title\": \"createFayzShopProvider({ productMetadata })\",\n \"deprecatedIn\": \"0.9.0\",\n \"removeIn\": \"0.11.0\",\n \"replacement\": \"product variants — plg_shop_product_variants, read through products.bySlug / getProductVariants (admin > product > variants)\",\n \"shim\": \"The overlay is still merged into each product's metadata for DISPLAY, so a store passing it keeps rendering. What it no longer does is define the option axes checkout sells: 0028 variants are the sellable unit and 0029 prices and names an order line from them. An axis that exists only in the overlay renders a picker that resolves to no variant.\",\n \"where\": [\"packages/sdk/src/shop.ts\", \"packages/storefront/src/data/product-options.ts\"],\n \"detect\": \"The app passes `productMetadata` to createFayzShopProvider (usually src/config/shop.ts), or the running provider warns once per session.\",\n \"codemod\": \"shop.product-metadata-overlay\",\n \"reference\": \"docs/storefront/storefront-architecture-spine.md (M5), docs/storefront/storefront-contract.md\"\n },\n {\n \"id\": \"storefront.commerce.discounts\",\n \"package\": \"@fayz-ai/storefront\",\n \"surface\": \"document-field\",\n \"title\": \"config.discounts / commerce.discounts (percent coupon codes)\",\n \"deprecatedIn\": \"0.9.0\",\n \"removeIn\": \"0.11.0\",\n \"replacement\": \"promotions.promotions — a rule-engine Promotion with an eligibility rule on `code` and a percentage application method (spine M6, I8)\",\n \"shim\": \"The provider still honours the legacy path: every `{code, percent}` entry is translated by storefrontDiscountToPromotion and evaluated by the ONE rule engine, so the money is identical. What the legacy shape cannot express is everything the engine exists for — buy-N-get-M, tiers, minimum subtotal, product/category scoping, automatic application.\",\n \"where\": [\n \"packages/shop/src/rules/adapter.ts\",\n \"packages/storefront/src/hooks/use-discount-validator.ts\",\n \"packages/storefront/src/document/sections.ts\"\n ],\n \"detect\": \"commerce.discounts is present in the Store Document (config.discounts in a config-derived document).\",\n \"codemod\": \"commerce.discounts-to-promotions\",\n \"reference\": \"docs/storefront/storefront-architecture-spine.md (M6, I8), docs/storefront/storefront-contract.md\"\n },\n {\n \"id\": \"shop.inventory.directCountWrite\",\n \"package\": \"@fayz-ai/shop\",\n \"surface\": \"sql-column-write\",\n \"title\": \"direct writes to plg_shop_product_variants.inventory_count (and plg_shop_products.inventory_count)\",\n \"deprecatedIn\": \"0.9.0\",\n \"removeIn\": \"0.11.0\",\n \"replacement\": \"insert a plg_shop_stock_movements row (receipt / adjustment / loss / count) — the ledger is the truth and inventory_count is its mirror\",\n \"shim\": \"0036 turns a direct write to a VARIANT count into an `adjustment` movement with reason `legacy_write`, and 0037 forwards a write to the PRODUCT count to that product's default variant the same way. Both RAISE a WARNING. The quantities are exact; the taxonomy is not — the shim is told a number changed and never why, so a sale arriving this way is recorded as an adjustment with no order_id.\",\n \"where\": [\n \"packages/shop/migrations/0036_inventory_count_mirror.sql\",\n \"packages/shop/migrations/0037_default_variant.sql\"\n ],\n \"signals\": [\n \"DEPRECATED (I10): direct write to plg_shop_product_variants.inventory_count\",\n \"DEPRECATED (I10): direct write to plg_shop_products.inventory_count\"\n ],\n \"detect\": \"Not visible in a store's repo: it is a property of the callers writing to a pool. Count the `legacy_write` reason in plg_shop_stock_movements — that count IS the migration backlog.\",\n \"codemod\": \"shop.inventory-count-write\",\n \"reference\": \"docs/storefront/inventory-model.md §6, §9 step 3\"\n },\n {\n \"id\": \"shop.placeOrder.variantless\",\n \"package\": \"@fayz-ai/shop\",\n \"surface\": \"sql-code-path\",\n \"title\": \"the variantless leg of shop_place_order\",\n \"deprecatedIn\": \"0.9.0\",\n \"removeIn\": \"0.11.0\",\n \"replacement\": \"every product gets a default variant (migration 0037), and the variant is the universal sellable unit — the order line resolves a variant and the sale reaches the ledger\",\n \"shim\": \"0039 keeps the leg: a line whose product has no variant at all still sells, guarded against the product-level inventory_count exactly as before 0034. It emits one enumerable NOTICE per order naming the products that took it, so the deprecation is countable rather than silent. Such a sale does NOT reach the stock ledger, so it answers none of the questions inventory-model.md §0 exists for.\",\n \"where\": [\"packages/shop/migrations/0039_place_order_ledger.sql\"],\n \"signals\": [\"shop_place_order: DEPRECATED variantless stock path used for\"],\n \"detect\": \"Not visible in a store's repo: it is pool state. Its exit condition is in 0039's header — the count of products with no variant must read 0 on every pool.\",\n \"codemod\": \"shop.place-order-variantless\",\n \"reference\": \"docs/storefront/inventory-model.md §10 q6, packages/shop/migrations/0039_place_order_ledger.sql (header)\"\n },\n {\n \"id\": \"storefront.backend.supabaseUrl\",\n \"package\": \"@fayz-ai/storefront\",\n \"surface\": \"document-field\",\n \"title\": \"config.supabaseUrl / backend.supabaseUrl\",\n \"deprecatedIn\": \"0.9.0\",\n \"removeIn\": \"0.11.0\",\n \"replacement\": \"auth.supabase.url\",\n \"shim\": \"The legacy field still rides in the backend section so an old config round-trips losslessly, and hydrateStoreDocument still sets config.supabaseUrl from it.\",\n \"where\": [\"packages/storefront/src/document/sections.ts\", \"packages/storefront/src/document/round-trip.ts\"],\n \"detect\": \"backend.supabaseUrl is present in the Store Document.\",\n \"codemod\": \"backend.supabase-to-auth\",\n \"reference\": \"docs/storefront/storefront-contract.md\"\n },\n {\n \"id\": \"storefront.backend.supabaseAnonKey\",\n \"package\": \"@fayz-ai/storefront\",\n \"surface\": \"document-field\",\n \"title\": \"config.supabaseAnonKey / backend.supabaseAnonKey\",\n \"deprecatedIn\": \"0.9.0\",\n \"removeIn\": \"0.11.0\",\n \"replacement\": \"auth.supabase.anonKey\",\n \"shim\": \"The legacy field still rides in the backend section so an old config round-trips losslessly, and hydrateStoreDocument still sets config.supabaseAnonKey from it.\",\n \"where\": [\"packages/storefront/src/document/sections.ts\", \"packages/storefront/src/document/round-trip.ts\"],\n \"detect\": \"backend.supabaseAnonKey is present in the Store Document.\",\n \"codemod\": \"backend.supabase-to-auth\",\n \"reference\": \"docs/storefront/storefront-contract.md\"\n }\n ]\n}\n","import registry from './deprecations.json'\n\n// ---------------------------------------------------------------------------\n// The deprecation registry — spine I10, as ROWS.\n//\n// \"Nothing is removed without a shim, and the deprecation is enumerable.\" The\n// enumerable half is this file. WooCommerce keeps 60 deprecated hooks alive\n// through a DECLARED map dispatched at runtime; the reason that works at their\n// scale is that the map is data one tool can read. Ours is\n// `deprecations.json`, and it lives here for the same reason\n// `supported-surface.json` and `release-channels.json` do: @fayz-ai/sdk has no\n// dependencies, so every package, the CLI and a generated app can all read the\n// same table without anyone taking a dependency to do it.\n//\n// Two properties are load-bearing, and both are tested:\n//\n// 1. EVERY warning names its replacement (I2). A shim that can import this\n// module builds its message with `deprecationMessage(id)`, so the warning\n// and the row cannot drift. A shim that CANNOT — PL/pgSQL cannot import\n// JSON — declares its literal marker text in the row's `signals`, and a\n// test asserts that text really occurs in the named migration.\n// 2. EVERY row carries a codemod id. `fayz upgrade` either transforms the\n// document or REFUSES and names the decision a human must make. A\n// deprecation with no answer at all is the thing this registry exists to\n// make impossible.\n//\n// The policy is a number, not a promise: a deprecation announced in 0.9 is\n// removed no earlier than 0.11, so a fleet always has one whole release in\n// which both the old and the new input work.\n// ---------------------------------------------------------------------------\n\n/** Where a deprecated thing lives, which is also what can detect it. */\nexport type FayzDeprecationSurface =\n /** A field of the Store Document (and of the config it is derived from). */\n | 'document-field'\n /** An option passed to a provider factory in the store's own code. */\n | 'provider-option'\n /** A write to a column that is no longer the truth. */\n | 'sql-column-write'\n /** A branch of a SQL function kept alive for data that has not migrated. */\n | 'sql-code-path'\n /** A package name kept alive by a re-export after the package was renamed. */\n | 'package-name'\n\nexport interface FayzDeprecation {\n /** Stable dotted id. The key everything else references. */\n id: string\n /** Package that owns the surface. */\n package: string\n surface: FayzDeprecationSurface\n /** What is deprecated, in the words the author would recognize. */\n title: string\n /** SDK minor in which the deprecation was ANNOUNCED. */\n deprecatedIn: string\n /** SDK minor in which the shim is REMOVED. */\n removeIn: string\n /** What to use instead. Every warning for this id names it (I2). */\n replacement: string\n /** What keeps working during the window, and precisely what it costs. */\n shim: string\n /** Repo paths where the shim lives — the registry has to be auditable. */\n where: string[]\n /**\n * Literal marker text the shim emits at runtime, for shims that cannot build\n * their message from this row (PL/pgSQL). Asserted against the real file by\n * packages/shop/src/deprecations.test.ts.\n */\n signals?: string[]\n /** How `fayz upgrade` finds it in a store — including \"you cannot, here is\n * the query that counts it in the pool instead\". */\n detect: string\n /** Codemod id that retires it. Never empty: a codemod that cannot be safe\n * exists anyway and refuses, naming the human decision. */\n codemod: string\n /** The design record. */\n reference: string\n}\n\nexport interface FayzDeprecationPolicy {\n /** Minimum number of minor releases between announcement and removal. */\n minMinorsBeforeRemoval: number\n summary: string\n}\n\nexport interface FayzDeprecationRegistry {\n registryVersion: number\n policy: FayzDeprecationPolicy\n deprecations: FayzDeprecation[]\n}\n\nconst table = registry as unknown as FayzDeprecationRegistry\n\nexport const fayzDeprecationPolicy: FayzDeprecationPolicy = table.policy\n\n/** Every deprecation, in declaration order. */\nexport function listDeprecations(): FayzDeprecation[] {\n return table.deprecations.map((row) => ({ ...row, where: [...row.where], signals: row.signals ? [...row.signals] : undefined }))\n}\n\n/** One row by id. Unknown ids throw and name the valid set (I2). */\nexport function getDeprecation(id: string): FayzDeprecation {\n const row = table.deprecations.find((entry) => entry.id === id)\n if (!row) {\n throw new Error(\n `Unknown deprecation id \"${id}\". Valid: ${table.deprecations.map((entry) => entry.id).join(', ')}`,\n )\n }\n return row\n}\n\nexport function hasDeprecation(id: string): boolean {\n return table.deprecations.some((entry) => entry.id === id)\n}\n\n/** Deprecation ids a given codemod retires. */\nexport function deprecationsForCodemod(codemod: string): FayzDeprecation[] {\n return table.deprecations.filter((entry) => entry.codemod === codemod)\n}\n\n/** Every codemod id the registry references, deduped, in declaration order. */\nexport function listDeprecationCodemods(): string[] {\n return [...new Set(table.deprecations.map((entry) => entry.codemod))]\n}\n\n/**\n * The warning text for a deprecation — the ONE place its prose is built.\n *\n * `context` is the caller's specifics (\"on variant abc\", \"at commerce.discounts[0]\");\n * it is appended, never substituted, so no caller can drop the replacement.\n */\nexport function deprecationMessage(id: string, context?: string): string {\n const row = getDeprecation(id)\n const where = context ? ` ${context}` : ''\n return (\n `DEPRECATED (${row.id}):${where} ${row.title} is deprecated since ${row.deprecatedIn} ` +\n `and is REMOVED in ${row.removeIn}. Use instead: ${row.replacement}. ` +\n `Migrate with \\`fayz upgrade\\` (codemod ${row.codemod}).`\n )\n}\n\nconst warned = new Set<string>()\n\n/**\n * Warn once per id per session.\n *\n * Once, because the alternative is one line per request, which buries the\n * signal this exists to produce. The dedupe key is the ID ALONE, not\n * (id, context): a shim whose context varies per call would otherwise\n * re-warn forever and reintroduce exactly the flood the once-ness exists to\n * prevent. Returns true when it actually warned, so a shim is testable\n * without reading the console.\n */\nexport function warnDeprecated(id: string, context?: string): boolean {\n if (warned.has(id)) return false\n warned.add(id)\n console.warn(deprecationMessage(id, context))\n return true\n}\n\n/** Test seam — re-arms every once-per-session deprecation warning. */\nexport function resetDeprecationWarnings(): void {\n warned.clear()\n}\n\nfunction minorOf(version: string): { major: number; minor: number } {\n const [major = '0', minor = '0'] = version.split('.')\n return { major: Number(major), minor: Number(minor) }\n}\n\n/**\n * Does `version` still get the shim?\n *\n * The question every consumer actually asks, answered from the table rather\n * than from a comment. Compared on (major, minor) because the policy is stated\n * in minors — a patch never removes anything.\n */\nexport function isDeprecationShimmed(id: string, version: string): boolean {\n const row = getDeprecation(id)\n const at = minorOf(version)\n const gone = minorOf(row.removeIn)\n if (at.major !== gone.major) return at.major < gone.major\n return at.minor < gone.minor\n}\n\n/** Minors between announcement and removal — the policy's unit. */\nexport function deprecationWindowMinors(row: FayzDeprecation): number {\n const from = minorOf(row.deprecatedIn)\n const to = minorOf(row.removeIn)\n // Majors are not commensurable with minors; a major bump is treated as\n // \"far beyond the window\", which is the only safe reading.\n if (to.major > from.major) return Number.POSITIVE_INFINITY\n return to.minor - from.minor\n}\n\nexport { table as fayzDeprecationRegistry }\n"]}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// src/release-channels.json
|
|
2
|
+
var release_channels_default = {
|
|
3
|
+
channels: {
|
|
4
|
+
stable: {
|
|
5
|
+
"@fayz-ai/sdk": "^0.10.0",
|
|
6
|
+
"@fayz-ai/admin": "^0.10.0",
|
|
7
|
+
"@fayz-ai/core": "^0.10.0",
|
|
8
|
+
"@fayz-ai/auth": "^0.10.0",
|
|
9
|
+
"@fayz-ai/ui": "^0.10.0",
|
|
10
|
+
"@fayz-ai/shop": "^0.10.0",
|
|
11
|
+
"@fayz-ai/storefront": "^0.10.0",
|
|
12
|
+
"@fayz-ai/portal": "^0.10.0",
|
|
13
|
+
"@fayz-ai/courses": "^0.10.0",
|
|
14
|
+
"@fayz-ai/db": "^0.10.0",
|
|
15
|
+
"@fayz-ai/plugin-agenda": "^0.9.1",
|
|
16
|
+
"@fayz-ai/plugin-auth": "^0.9.1",
|
|
17
|
+
"@fayz-ai/plugin-automations": "^0.9.1",
|
|
18
|
+
"@fayz-ai/plugin-blog": "^0.10.0",
|
|
19
|
+
"@fayz-ai/plugin-conversations": "^0.9.1",
|
|
20
|
+
"@fayz-ai/plugin-courses": "^0.9.1",
|
|
21
|
+
"@fayz-ai/plugin-crm": "^0.9.1",
|
|
22
|
+
"@fayz-ai/plugin-dashboard": "^0.9.1",
|
|
23
|
+
"@fayz-ai/plugin-financial": "^0.9.1",
|
|
24
|
+
"@fayz-ai/plugin-forms": "^0.9.1",
|
|
25
|
+
"@fayz-ai/plugin-inventory": "^0.9.1",
|
|
26
|
+
"@fayz-ai/plugin-marketing": "^0.9.1",
|
|
27
|
+
"@fayz-ai/plugin-menu": "^0.9.1",
|
|
28
|
+
"@fayz-ai/plugin-orders": "^0.9.1",
|
|
29
|
+
"@fayz-ai/plugin-payments": "^0.9.1",
|
|
30
|
+
"@fayz-ai/plugin-reports": "^0.9.1",
|
|
31
|
+
"@fayz-ai/plugin-reputation": "^0.9.1",
|
|
32
|
+
"@fayz-ai/plugin-shop": "^0.9.1",
|
|
33
|
+
"@fayz-ai/plugin-sites": "^0.9.1",
|
|
34
|
+
"@fayz-ai/plugin-tables": "^0.9.1",
|
|
35
|
+
"@fayz-ai/plugin-tasks": "^0.9.1"
|
|
36
|
+
},
|
|
37
|
+
latest: {
|
|
38
|
+
"@fayz-ai/sdk": "^0.10.0",
|
|
39
|
+
"@fayz-ai/admin": "^0.10.0",
|
|
40
|
+
"@fayz-ai/core": "^0.10.0",
|
|
41
|
+
"@fayz-ai/auth": "^0.10.0",
|
|
42
|
+
"@fayz-ai/ui": "^0.10.0",
|
|
43
|
+
"@fayz-ai/shop": "^0.10.0",
|
|
44
|
+
"@fayz-ai/storefront": "^0.10.0",
|
|
45
|
+
"@fayz-ai/portal": "^0.10.0",
|
|
46
|
+
"@fayz-ai/courses": "^0.10.0",
|
|
47
|
+
"@fayz-ai/db": "^0.10.0",
|
|
48
|
+
"@fayz-ai/plugin-agenda": "^0.9.1",
|
|
49
|
+
"@fayz-ai/plugin-auth": "^0.9.1",
|
|
50
|
+
"@fayz-ai/plugin-automations": "^0.9.1",
|
|
51
|
+
"@fayz-ai/plugin-blog": "^0.10.0",
|
|
52
|
+
"@fayz-ai/plugin-conversations": "^0.9.1",
|
|
53
|
+
"@fayz-ai/plugin-courses": "^0.9.1",
|
|
54
|
+
"@fayz-ai/plugin-crm": "^0.9.1",
|
|
55
|
+
"@fayz-ai/plugin-dashboard": "^0.9.1",
|
|
56
|
+
"@fayz-ai/plugin-financial": "^0.9.1",
|
|
57
|
+
"@fayz-ai/plugin-forms": "^0.9.1",
|
|
58
|
+
"@fayz-ai/plugin-inventory": "^0.9.1",
|
|
59
|
+
"@fayz-ai/plugin-marketing": "^0.9.1",
|
|
60
|
+
"@fayz-ai/plugin-menu": "^0.9.1",
|
|
61
|
+
"@fayz-ai/plugin-orders": "^0.9.1",
|
|
62
|
+
"@fayz-ai/plugin-payments": "^0.9.1",
|
|
63
|
+
"@fayz-ai/plugin-reports": "^0.9.1",
|
|
64
|
+
"@fayz-ai/plugin-reputation": "^0.9.1",
|
|
65
|
+
"@fayz-ai/plugin-shop": "^0.9.1",
|
|
66
|
+
"@fayz-ai/plugin-sites": "^0.9.1",
|
|
67
|
+
"@fayz-ai/plugin-tables": "^0.9.1",
|
|
68
|
+
"@fayz-ai/plugin-tasks": "^0.9.1"
|
|
69
|
+
},
|
|
70
|
+
preview: {
|
|
71
|
+
"@fayz-ai/sdk": "^0.10.0",
|
|
72
|
+
"@fayz-ai/admin": "^0.10.0",
|
|
73
|
+
"@fayz-ai/core": "^0.10.0",
|
|
74
|
+
"@fayz-ai/auth": "^0.10.0",
|
|
75
|
+
"@fayz-ai/ui": "^0.10.0",
|
|
76
|
+
"@fayz-ai/shop": "^0.10.0",
|
|
77
|
+
"@fayz-ai/storefront": "^0.10.0",
|
|
78
|
+
"@fayz-ai/portal": "^0.10.0",
|
|
79
|
+
"@fayz-ai/courses": "^0.10.0",
|
|
80
|
+
"@fayz-ai/db": "^0.10.0",
|
|
81
|
+
"@fayz-ai/plugin-agenda": "^0.9.1",
|
|
82
|
+
"@fayz-ai/plugin-auth": "^0.9.1",
|
|
83
|
+
"@fayz-ai/plugin-automations": "^0.9.1",
|
|
84
|
+
"@fayz-ai/plugin-blog": "^0.10.0",
|
|
85
|
+
"@fayz-ai/plugin-conversations": "^0.9.1",
|
|
86
|
+
"@fayz-ai/plugin-courses": "^0.9.1",
|
|
87
|
+
"@fayz-ai/plugin-crm": "^0.9.1",
|
|
88
|
+
"@fayz-ai/plugin-dashboard": "^0.9.1",
|
|
89
|
+
"@fayz-ai/plugin-financial": "^0.9.1",
|
|
90
|
+
"@fayz-ai/plugin-forms": "^0.9.1",
|
|
91
|
+
"@fayz-ai/plugin-inventory": "^0.9.1",
|
|
92
|
+
"@fayz-ai/plugin-marketing": "^0.9.1",
|
|
93
|
+
"@fayz-ai/plugin-menu": "^0.9.1",
|
|
94
|
+
"@fayz-ai/plugin-orders": "^0.9.1",
|
|
95
|
+
"@fayz-ai/plugin-payments": "^0.9.1",
|
|
96
|
+
"@fayz-ai/plugin-reports": "^0.9.1",
|
|
97
|
+
"@fayz-ai/plugin-reputation": "^0.9.1",
|
|
98
|
+
"@fayz-ai/plugin-shop": "^0.9.1",
|
|
99
|
+
"@fayz-ai/plugin-sites": "^0.9.1",
|
|
100
|
+
"@fayz-ai/plugin-tables": "^0.9.1",
|
|
101
|
+
"@fayz-ai/plugin-tasks": "^0.9.1"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// src/release-channels.ts
|
|
107
|
+
var releaseChannelPackages = release_channels_default.channels;
|
|
108
|
+
function buildVersionSet(channel) {
|
|
109
|
+
return {
|
|
110
|
+
channel,
|
|
111
|
+
packages: { ...releaseChannelPackages[channel] }
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
var fayzPackageVersionSets = {
|
|
115
|
+
stable: buildVersionSet("stable"),
|
|
116
|
+
latest: buildVersionSet("latest"),
|
|
117
|
+
preview: buildVersionSet("preview")
|
|
118
|
+
};
|
|
119
|
+
function resolveFayzPackageVersions(channel = "stable") {
|
|
120
|
+
return fayzPackageVersionSets[channel];
|
|
121
|
+
}
|
|
122
|
+
function resolveFayzPackageDependencies(channel = "stable") {
|
|
123
|
+
return { ...resolveFayzPackageVersions(channel).packages };
|
|
124
|
+
}
|
|
125
|
+
function resolveFayzPackageVersion(packageName, channel = "stable") {
|
|
126
|
+
const version = resolveFayzPackageVersions(channel).packages[packageName];
|
|
127
|
+
if (!version) {
|
|
128
|
+
throw new Error(`No Fayz package version configured for ${packageName} in ${channel} channel`);
|
|
129
|
+
}
|
|
130
|
+
return version;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export { fayzPackageVersionSets, resolveFayzPackageDependencies, resolveFayzPackageVersion, resolveFayzPackageVersions };
|
|
134
|
+
//# sourceMappingURL=chunk-VRUPJGFZ.js.map
|
|
135
|
+
//# sourceMappingURL=chunk-VRUPJGFZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/release-channels.json","../src/release-channels.ts"],"names":[],"mappings":";AAAA,IAAA,wBAAA,GAAA;AAAA,EACE,QAAA,EAAY;AAAA,IACV,MAAA,EAAU;AAAA,MACR,cAAA,EAAgB,SAAA;AAAA,MAChB,gBAAA,EAAkB,SAAA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,MAAM,OAAA,GAAU,0BAAA,CAA2B,OAAO,CAAA,CAAE,SAAS,WAAW,CAAA;AAExE,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,uCAAA,EAA0C,WAAW,CAAA,IAAA,EAAO,OAAO,CAAA,QAAA,CAAU,CAAA;AAAA,EAC/F;AAEA,EAAA,OAAO,OAAA;AACT","file":"chunk-VRUPJGFZ.js","sourcesContent":["{\n \"channels\": {\n \"stable\": {\n \"@fayz-ai/sdk\": \"^0.10.0\",\n \"@fayz-ai/admin\": \"^0.10.0\",\n \"@fayz-ai/core\": \"^0.10.0\",\n \"@fayz-ai/auth\": \"^0.10.0\",\n \"@fayz-ai/ui\": \"^0.10.0\",\n \"@fayz-ai/shop\": \"^0.10.0\",\n \"@fayz-ai/storefront\": \"^0.10.0\",\n \"@fayz-ai/portal\": \"^0.10.0\",\n \"@fayz-ai/courses\": \"^0.10.0\",\n \"@fayz-ai/db\": \"^0.10.0\",\n \"@fayz-ai/plugin-agenda\": \"^0.9.1\",\n \"@fayz-ai/plugin-auth\": \"^0.9.1\",\n \"@fayz-ai/plugin-automations\": \"^0.9.1\",\n \"@fayz-ai/plugin-blog\": \"^0.10.0\",\n \"@fayz-ai/plugin-conversations\": \"^0.9.1\",\n \"@fayz-ai/plugin-courses\": \"^0.9.1\",\n \"@fayz-ai/plugin-crm\": \"^0.9.1\",\n \"@fayz-ai/plugin-dashboard\": \"^0.9.1\",\n \"@fayz-ai/plugin-financial\": \"^0.9.1\",\n \"@fayz-ai/plugin-forms\": \"^0.9.1\",\n \"@fayz-ai/plugin-inventory\": \"^0.9.1\",\n \"@fayz-ai/plugin-marketing\": \"^0.9.1\",\n \"@fayz-ai/plugin-menu\": \"^0.9.1\",\n \"@fayz-ai/plugin-orders\": \"^0.9.1\",\n \"@fayz-ai/plugin-payments\": \"^0.9.1\",\n \"@fayz-ai/plugin-reports\": \"^0.9.1\",\n \"@fayz-ai/plugin-reputation\": \"^0.9.1\",\n \"@fayz-ai/plugin-shop\": \"^0.9.1\",\n \"@fayz-ai/plugin-sites\": \"^0.9.1\",\n \"@fayz-ai/plugin-tables\": \"^0.9.1\",\n \"@fayz-ai/plugin-tasks\": \"^0.9.1\"\n },\n \"latest\": {\n \"@fayz-ai/sdk\": \"^0.10.0\",\n \"@fayz-ai/admin\": \"^0.10.0\",\n \"@fayz-ai/core\": \"^0.10.0\",\n \"@fayz-ai/auth\": \"^0.10.0\",\n \"@fayz-ai/ui\": \"^0.10.0\",\n \"@fayz-ai/shop\": \"^0.10.0\",\n \"@fayz-ai/storefront\": \"^0.10.0\",\n \"@fayz-ai/portal\": \"^0.10.0\",\n \"@fayz-ai/courses\": \"^0.10.0\",\n \"@fayz-ai/db\": \"^0.10.0\",\n \"@fayz-ai/plugin-agenda\": \"^0.9.1\",\n \"@fayz-ai/plugin-auth\": \"^0.9.1\",\n \"@fayz-ai/plugin-automations\": \"^0.9.1\",\n \"@fayz-ai/plugin-blog\": \"^0.10.0\",\n \"@fayz-ai/plugin-conversations\": \"^0.9.1\",\n \"@fayz-ai/plugin-courses\": \"^0.9.1\",\n \"@fayz-ai/plugin-crm\": \"^0.9.1\",\n \"@fayz-ai/plugin-dashboard\": \"^0.9.1\",\n \"@fayz-ai/plugin-financial\": \"^0.9.1\",\n \"@fayz-ai/plugin-forms\": \"^0.9.1\",\n \"@fayz-ai/plugin-inventory\": \"^0.9.1\",\n \"@fayz-ai/plugin-marketing\": \"^0.9.1\",\n \"@fayz-ai/plugin-menu\": \"^0.9.1\",\n \"@fayz-ai/plugin-orders\": \"^0.9.1\",\n \"@fayz-ai/plugin-payments\": \"^0.9.1\",\n \"@fayz-ai/plugin-reports\": \"^0.9.1\",\n \"@fayz-ai/plugin-reputation\": \"^0.9.1\",\n \"@fayz-ai/plugin-shop\": \"^0.9.1\",\n \"@fayz-ai/plugin-sites\": \"^0.9.1\",\n \"@fayz-ai/plugin-tables\": \"^0.9.1\",\n \"@fayz-ai/plugin-tasks\": \"^0.9.1\"\n },\n \"preview\": {\n \"@fayz-ai/sdk\": \"^0.10.0\",\n \"@fayz-ai/admin\": \"^0.10.0\",\n \"@fayz-ai/core\": \"^0.10.0\",\n \"@fayz-ai/auth\": \"^0.10.0\",\n \"@fayz-ai/ui\": \"^0.10.0\",\n \"@fayz-ai/shop\": \"^0.10.0\",\n \"@fayz-ai/storefront\": \"^0.10.0\",\n \"@fayz-ai/portal\": \"^0.10.0\",\n \"@fayz-ai/courses\": \"^0.10.0\",\n \"@fayz-ai/db\": \"^0.10.0\",\n \"@fayz-ai/plugin-agenda\": \"^0.9.1\",\n \"@fayz-ai/plugin-auth\": \"^0.9.1\",\n \"@fayz-ai/plugin-automations\": \"^0.9.1\",\n \"@fayz-ai/plugin-blog\": \"^0.10.0\",\n \"@fayz-ai/plugin-conversations\": \"^0.9.1\",\n \"@fayz-ai/plugin-courses\": \"^0.9.1\",\n \"@fayz-ai/plugin-crm\": \"^0.9.1\",\n \"@fayz-ai/plugin-dashboard\": \"^0.9.1\",\n \"@fayz-ai/plugin-financial\": \"^0.9.1\",\n \"@fayz-ai/plugin-forms\": \"^0.9.1\",\n \"@fayz-ai/plugin-inventory\": \"^0.9.1\",\n \"@fayz-ai/plugin-marketing\": \"^0.9.1\",\n \"@fayz-ai/plugin-menu\": \"^0.9.1\",\n \"@fayz-ai/plugin-orders\": \"^0.9.1\",\n \"@fayz-ai/plugin-payments\": \"^0.9.1\",\n \"@fayz-ai/plugin-reports\": \"^0.9.1\",\n \"@fayz-ai/plugin-reputation\": \"^0.9.1\",\n \"@fayz-ai/plugin-shop\": \"^0.9.1\",\n \"@fayz-ai/plugin-sites\": \"^0.9.1\",\n \"@fayz-ai/plugin-tables\": \"^0.9.1\",\n \"@fayz-ai/plugin-tasks\": \"^0.9.1\"\n }\n }\n}\n","import releaseChannels from './release-channels.json'\n\nexport type FayzPackageChannel = 'stable' | 'latest' | 'preview'\n\nexport interface FayzPackageVersionSet {\n channel: FayzPackageChannel\n packages: Record<string, string>\n}\n\nconst releaseChannelPackages = releaseChannels.channels as Record<FayzPackageChannel, Record<string, string>>\n\nfunction buildVersionSet(channel: FayzPackageChannel): FayzPackageVersionSet {\n return {\n channel,\n packages: { ...releaseChannelPackages[channel] },\n }\n}\n\nexport const fayzPackageVersionSets: Record<FayzPackageChannel, FayzPackageVersionSet> = {\n stable: buildVersionSet('stable'),\n latest: buildVersionSet('latest'),\n preview: buildVersionSet('preview'),\n}\n\nexport function resolveFayzPackageVersions(channel: FayzPackageChannel = 'stable'): FayzPackageVersionSet {\n return fayzPackageVersionSets[channel]\n}\n\nexport function resolveFayzPackageDependencies(channel: FayzPackageChannel = 'stable'): Record<string, string> {\n return { ...resolveFayzPackageVersions(channel).packages }\n}\n\nexport function resolveFayzPackageVersion(packageName: string, channel: FayzPackageChannel = 'stable'): string {\n const version = resolveFayzPackageVersions(channel).packages[packageName]\n\n if (!version) {\n throw new Error(`No Fayz package version configured for ${packageName} in ${channel} channel`)\n }\n\n return version\n}\n"]}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/** Where a deprecated thing lives, which is also what can detect it. */
|
|
2
|
+
export type FayzDeprecationSurface =
|
|
3
|
+
/** A field of the Store Document (and of the config it is derived from). */
|
|
4
|
+
'document-field'
|
|
5
|
+
/** An option passed to a provider factory in the store's own code. */
|
|
6
|
+
| 'provider-option'
|
|
7
|
+
/** A write to a column that is no longer the truth. */
|
|
8
|
+
| 'sql-column-write'
|
|
9
|
+
/** A branch of a SQL function kept alive for data that has not migrated. */
|
|
10
|
+
| 'sql-code-path'
|
|
11
|
+
/** A package name kept alive by a re-export after the package was renamed. */
|
|
12
|
+
| 'package-name';
|
|
13
|
+
export interface FayzDeprecation {
|
|
14
|
+
/** Stable dotted id. The key everything else references. */
|
|
15
|
+
id: string;
|
|
16
|
+
/** Package that owns the surface. */
|
|
17
|
+
package: string;
|
|
18
|
+
surface: FayzDeprecationSurface;
|
|
19
|
+
/** What is deprecated, in the words the author would recognize. */
|
|
20
|
+
title: string;
|
|
21
|
+
/** SDK minor in which the deprecation was ANNOUNCED. */
|
|
22
|
+
deprecatedIn: string;
|
|
23
|
+
/** SDK minor in which the shim is REMOVED. */
|
|
24
|
+
removeIn: string;
|
|
25
|
+
/** What to use instead. Every warning for this id names it (I2). */
|
|
26
|
+
replacement: string;
|
|
27
|
+
/** What keeps working during the window, and precisely what it costs. */
|
|
28
|
+
shim: string;
|
|
29
|
+
/** Repo paths where the shim lives — the registry has to be auditable. */
|
|
30
|
+
where: string[];
|
|
31
|
+
/**
|
|
32
|
+
* Literal marker text the shim emits at runtime, for shims that cannot build
|
|
33
|
+
* their message from this row (PL/pgSQL). Asserted against the real file by
|
|
34
|
+
* packages/shop/src/deprecations.test.ts.
|
|
35
|
+
*/
|
|
36
|
+
signals?: string[];
|
|
37
|
+
/** How `fayz upgrade` finds it in a store — including "you cannot, here is
|
|
38
|
+
* the query that counts it in the pool instead". */
|
|
39
|
+
detect: string;
|
|
40
|
+
/** Codemod id that retires it. Never empty: a codemod that cannot be safe
|
|
41
|
+
* exists anyway and refuses, naming the human decision. */
|
|
42
|
+
codemod: string;
|
|
43
|
+
/** The design record. */
|
|
44
|
+
reference: string;
|
|
45
|
+
}
|
|
46
|
+
export interface FayzDeprecationPolicy {
|
|
47
|
+
/** Minimum number of minor releases between announcement and removal. */
|
|
48
|
+
minMinorsBeforeRemoval: number;
|
|
49
|
+
summary: string;
|
|
50
|
+
}
|
|
51
|
+
export interface FayzDeprecationRegistry {
|
|
52
|
+
registryVersion: number;
|
|
53
|
+
policy: FayzDeprecationPolicy;
|
|
54
|
+
deprecations: FayzDeprecation[];
|
|
55
|
+
}
|
|
56
|
+
declare const table: FayzDeprecationRegistry;
|
|
57
|
+
export declare const fayzDeprecationPolicy: FayzDeprecationPolicy;
|
|
58
|
+
/** Every deprecation, in declaration order. */
|
|
59
|
+
export declare function listDeprecations(): FayzDeprecation[];
|
|
60
|
+
/** One row by id. Unknown ids throw and name the valid set (I2). */
|
|
61
|
+
export declare function getDeprecation(id: string): FayzDeprecation;
|
|
62
|
+
export declare function hasDeprecation(id: string): boolean;
|
|
63
|
+
/** Deprecation ids a given codemod retires. */
|
|
64
|
+
export declare function deprecationsForCodemod(codemod: string): FayzDeprecation[];
|
|
65
|
+
/** Every codemod id the registry references, deduped, in declaration order. */
|
|
66
|
+
export declare function listDeprecationCodemods(): string[];
|
|
67
|
+
/**
|
|
68
|
+
* The warning text for a deprecation — the ONE place its prose is built.
|
|
69
|
+
*
|
|
70
|
+
* `context` is the caller's specifics ("on variant abc", "at commerce.discounts[0]");
|
|
71
|
+
* it is appended, never substituted, so no caller can drop the replacement.
|
|
72
|
+
*/
|
|
73
|
+
export declare function deprecationMessage(id: string, context?: string): string;
|
|
74
|
+
/**
|
|
75
|
+
* Warn once per id per session.
|
|
76
|
+
*
|
|
77
|
+
* Once, because the alternative is one line per request, which buries the
|
|
78
|
+
* signal this exists to produce. The dedupe key is the ID ALONE, not
|
|
79
|
+
* (id, context): a shim whose context varies per call would otherwise
|
|
80
|
+
* re-warn forever and reintroduce exactly the flood the once-ness exists to
|
|
81
|
+
* prevent. Returns true when it actually warned, so a shim is testable
|
|
82
|
+
* without reading the console.
|
|
83
|
+
*/
|
|
84
|
+
export declare function warnDeprecated(id: string, context?: string): boolean;
|
|
85
|
+
/** Test seam — re-arms every once-per-session deprecation warning. */
|
|
86
|
+
export declare function resetDeprecationWarnings(): void;
|
|
87
|
+
/**
|
|
88
|
+
* Does `version` still get the shim?
|
|
89
|
+
*
|
|
90
|
+
* The question every consumer actually asks, answered from the table rather
|
|
91
|
+
* than from a comment. Compared on (major, minor) because the policy is stated
|
|
92
|
+
* in minors — a patch never removes anything.
|
|
93
|
+
*/
|
|
94
|
+
export declare function isDeprecationShimmed(id: string, version: string): boolean;
|
|
95
|
+
/** Minors between announcement and removal — the policy's unit. */
|
|
96
|
+
export declare function deprecationWindowMinors(row: FayzDeprecation): number;
|
|
97
|
+
export { table as fayzDeprecationRegistry };
|
|
98
|
+
//# sourceMappingURL=deprecations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecations.d.ts","sourceRoot":"","sources":["../src/deprecations.ts"],"names":[],"mappings":"AA+BA,wEAAwE;AACxE,MAAM,MAAM,sBAAsB;AAChC,4EAA4E;AAC1E,gBAAgB;AAClB,sEAAsE;GACpE,iBAAiB;AACnB,uDAAuD;GACrD,kBAAkB;AACpB,4EAA4E;GAC1E,eAAe;AACjB,8EAA8E;GAC5E,cAAc,CAAA;AAElB,MAAM,WAAW,eAAe;IAC9B,4DAA4D;IAC5D,EAAE,EAAE,MAAM,CAAA;IACV,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,sBAAsB,CAAA;IAC/B,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAA;IACb,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAA;IACpB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAA;IAChB,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAA;IACnB,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAA;IACZ,0EAA0E;IAC1E,KAAK,EAAE,MAAM,EAAE,CAAA;IACf;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB;yDACqD;IACrD,MAAM,EAAE,MAAM,CAAA;IACd;gEAC4D;IAC5D,OAAO,EAAE,MAAM,CAAA;IACf,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,yEAAyE;IACzE,sBAAsB,EAAE,MAAM,CAAA;IAC9B,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,uBAAuB;IACtC,eAAe,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,qBAAqB,CAAA;IAC7B,YAAY,EAAE,eAAe,EAAE,CAAA;CAChC;AAED,QAAA,MAAM,KAAK,EAA0B,uBAAuB,CAAA;AAE5D,eAAO,MAAM,qBAAqB,EAAE,qBAAoC,CAAA;AAExE,+CAA+C;AAC/C,wBAAgB,gBAAgB,IAAI,eAAe,EAAE,CAEpD;AAED,oEAAoE;AACpE,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,CAQ1D;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,+CAA+C;AAC/C,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,EAAE,CAEzE;AAED,+EAA+E;AAC/E,wBAAgB,uBAAuB,IAAI,MAAM,EAAE,CAElD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAQvE;AAID;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAKpE;AAED,sEAAsE;AACtE,wBAAgB,wBAAwB,IAAI,IAAI,CAE/C;AAOD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAMzE;AAED,mEAAmE;AACnE,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAOpE;AAED,OAAO,EAAE,KAAK,IAAI,uBAAuB,EAAE,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { deprecationMessage, deprecationWindowMinors, deprecationsForCodemod, fayzDeprecationPolicy, table as fayzDeprecationRegistry, getDeprecation, hasDeprecation, isDeprecationShimmed, listDeprecationCodemods, listDeprecations, resetDeprecationWarnings, warnDeprecated } from './chunk-HA5O3CW7.js';
|
|
2
|
+
//# sourceMappingURL=deprecations.js.map
|
|
3
|
+
//# sourceMappingURL=deprecations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"deprecations.js"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export { fayzPackageVersionSets, resolveFayzPackageDependencies, resolveFayzPack
|
|
|
5
5
|
export type { FayzPackageChannel, FayzPackageVersionSet } from './release-channels';
|
|
6
6
|
export { getSupportedPackages, getInternalPackages, isSupportedPackage, fayzSupportedSurface, } from './supported-surface';
|
|
7
7
|
export type { FayzPackageTier, FayzSupportedSurface } from './supported-surface';
|
|
8
|
+
export { deprecationMessage, deprecationWindowMinors, deprecationsForCodemod, fayzDeprecationPolicy, fayzDeprecationRegistry, getDeprecation, hasDeprecation, isDeprecationShimmed, listDeprecationCodemods, listDeprecations, resetDeprecationWarnings, warnDeprecated, } from './deprecations';
|
|
9
|
+
export type { FayzDeprecation, FayzDeprecationPolicy, FayzDeprecationRegistry, FayzDeprecationSurface, } from './deprecations';
|
|
8
10
|
export { AI_BUILDER_REQUEST_CLASSES, AI_BUILDER_REQUEST_CLASS_IDS, isAllowedRequestClass, } from './ai-builder';
|
|
9
11
|
export type { FayzLayer, AiBuilderRequestClass, AiBuilderRequestClassDef, } from './ai-builder';
|
|
10
12
|
export { createFayzRuntimeClient, FayzRuntimeError, } from './runtime';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC/D,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,UAAU,CAAA;AACj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AAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,eAAe,GAChB,MAAM,SAAS,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC/D,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,sBAAsB,EACtB,8BAA8B,EAC9B,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AACnF,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAChF,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,GACf,MAAM,gBAAgB,CAAA;AACvB,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,cAAc,CAAA;AACrB,YAAY,EACV,SAAS,EACT,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC/D,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,sBAAsB,EACtB,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,sBAAsB,EACtB,aAAa,GACd,MAAM,QAAQ,CAAA;AACf,YAAY,EACV,uBAAuB,EACvB,8BAA8B,EAC9B,2BAA2B,EAC3B,yBAAyB,EACzB,4BAA4B,EAC5B,4BAA4B,EAC5B,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,QAAQ,CAAA;AACf,YAAY,EACV,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,6BAA6B,EAC7B,wBAAwB,EACxB,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,WAAW,CAAA;AAClB,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,eAAe,GAChB,MAAM,SAAS,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
export { AI_BUILDER_REQUEST_CLASSES, AI_BUILDER_REQUEST_CLASS_IDS, isAllowedRequestClass } from './chunk-BJFMBVMP.js';
|
|
1
2
|
export { FayzApiError, createFayzClient, fayz } from './chunk-UWOQAD5A.js';
|
|
2
3
|
export { FayzRuntimeError, createFayzRuntimeClient } from './chunk-FRIOW6KW.js';
|
|
3
4
|
export { appParams, resolveAppParams } from './chunk-YGX37DT3.js';
|
|
4
5
|
export { FayzAgentError, createFayzAgentClient } from './chunk-LSBVNW75.js';
|
|
5
|
-
export { FayzShopError, createFayzShopProvider } from './chunk-
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
6
|
+
export { FayzShopError, createFayzShopProvider } from './chunk-7UXTYT6I.js';
|
|
7
|
+
export { deprecationMessage, deprecationWindowMinors, deprecationsForCodemod, fayzDeprecationPolicy, table as fayzDeprecationRegistry, getDeprecation, hasDeprecation, isDeprecationShimmed, listDeprecationCodemods, listDeprecations, resetDeprecationWarnings, warnDeprecated } from './chunk-HA5O3CW7.js';
|
|
8
|
+
export { fayzPackageVersionSets, resolveFayzPackageDependencies, resolveFayzPackageVersion, resolveFayzPackageVersions } from './chunk-VRUPJGFZ.js';
|
|
9
|
+
export { surface as fayzSupportedSurface, getInternalPackages, getSupportedPackages, isSupportedPackage } from './chunk-6UZOXHGJ.js';
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
|
10
11
|
//# sourceMappingURL=index.js.map
|
package/dist/release-channels.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { fayzPackageVersionSets, resolveFayzPackageDependencies, resolveFayzPackageVersion, resolveFayzPackageVersions } from './chunk-
|
|
1
|
+
export { fayzPackageVersionSets, resolveFayzPackageDependencies, resolveFayzPackageVersion, resolveFayzPackageVersions } from './chunk-VRUPJGFZ.js';
|
|
2
2
|
//# sourceMappingURL=release-channels.js.map
|
|
3
3
|
//# sourceMappingURL=release-channels.js.map
|
package/dist/shop.d.ts
CHANGED
|
@@ -70,6 +70,10 @@ export declare class FayzShopError extends Error {
|
|
|
70
70
|
readonly responseBody?: unknown | undefined;
|
|
71
71
|
constructor(message: string, status: number, responseBody?: unknown | undefined);
|
|
72
72
|
}
|
|
73
|
+
/** The registry id this shim answers to. */
|
|
74
|
+
export declare const PRODUCT_METADATA_OVERLAY_DEPRECATION = "shop.provider.productMetadata";
|
|
75
|
+
/** Test seam — re-arms the once-per-session overlay deprecation warning. */
|
|
76
|
+
export declare function resetProductMetadataOverlayDeprecationWarning(): void;
|
|
73
77
|
declare function updateOrderPayload(input: {
|
|
74
78
|
status?: FayzShopOrderStatus;
|
|
75
79
|
financialStatus?: FayzShopFinancialStatus;
|
|
@@ -241,6 +245,32 @@ export declare function createFayzShopProvider(options: FayzShopProviderOptions)
|
|
|
241
245
|
deleteProduct(): Promise<never>;
|
|
242
246
|
uploadProductImage(): Promise<never>;
|
|
243
247
|
deleteProductImage(): Promise<never>;
|
|
248
|
+
/**
|
|
249
|
+
* Option axes + variants from the 0028 tables (spine M5) — the read that
|
|
250
|
+
* replaces the productMetadata overlay as the source of product options.
|
|
251
|
+
* Anon reads are already scoped by the storefront RLS (active variants of
|
|
252
|
+
* publicly readable products only).
|
|
253
|
+
*/
|
|
254
|
+
getProductVariants(productId: string): Promise<{
|
|
255
|
+
options: {
|
|
256
|
+
id: string;
|
|
257
|
+
name: string;
|
|
258
|
+
values: string[];
|
|
259
|
+
position: number;
|
|
260
|
+
}[];
|
|
261
|
+
variants: {
|
|
262
|
+
id: string;
|
|
263
|
+
productId: string;
|
|
264
|
+
options: Record<string, string>;
|
|
265
|
+
sku: string | null;
|
|
266
|
+
price: number | null;
|
|
267
|
+
compareAtPrice: number | null;
|
|
268
|
+
inventoryCount: number;
|
|
269
|
+
position: number;
|
|
270
|
+
status: "active" | "archived";
|
|
271
|
+
imageId: string | null;
|
|
272
|
+
}[];
|
|
273
|
+
}>;
|
|
244
274
|
listCategories(): Promise<{
|
|
245
275
|
id: string;
|
|
246
276
|
tenantId: string;
|
|
@@ -474,8 +504,10 @@ export declare function createFayzShopProvider(options: FayzShopProviderOptions)
|
|
|
474
504
|
label?: string;
|
|
475
505
|
};
|
|
476
506
|
paymentMethod?: "pix" | "credit_card" | "debit_card" | "boleto" | "cash" | "other";
|
|
507
|
+
metadata?: Record<string, unknown>;
|
|
477
508
|
items: Array<{
|
|
478
509
|
productId: string;
|
|
510
|
+
variantId?: string;
|
|
479
511
|
quantity: number;
|
|
480
512
|
optionsLabel?: string;
|
|
481
513
|
}>;
|
package/dist/shop.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shop.d.ts","sourceRoot":"","sources":["../src/shop.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shop.d.ts","sourceRoot":"","sources":["../src/shop.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAC5B,eAAe,CAAC,EAAE,8BAA8B,EAAE,CAAA;IAClD,OAAO,CAAC,EAAE,OAAO,KAAK,CAAA;CACvB;AAED;;;;;;;;;;;;;GAaG;AACH,KAAK,mBAAmB,GAAG,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;AAI1D,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI,GAAG,IAAI,CAErF;AAED,MAAM,WAAW,8BAA8B;IAC7C,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC;AAED,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAA;AACnE,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,CAAA;AACnE,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,MAAM,GAAG,gBAAgB,GAAG,UAAU,GAAG,oBAAoB,GAAG,QAAQ,CAAA;AAC1H,MAAM,MAAM,y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
|
|
1
|
-
export { FayzShopError, createFayzShopProvider, setShopAccessTokenResolver } from './chunk-
|
|
1
|
+
export { FayzShopError, PRODUCT_METADATA_OVERLAY_DEPRECATION, createFayzShopProvider, resetProductMetadataOverlayDeprecationWarning, setShopAccessTokenResolver } from './chunk-7UXTYT6I.js';
|
|
2
|
+
import './chunk-HA5O3CW7.js';
|
|
2
3
|
//# sourceMappingURL=shop.js.map
|
|
3
4
|
//# sourceMappingURL=shop.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type FayzPackageTier = 'stable';
|
|
1
|
+
export type FayzPackageTier = 'stable' | 'deprecated';
|
|
2
2
|
export interface FayzSupportedSurface {
|
|
3
3
|
surfaceVersion: number;
|
|
4
4
|
supported: Record<string, FayzPackageTier>;
|
|
@@ -15,5 +15,12 @@ export declare function getInternalPackages(): string[];
|
|
|
15
15
|
* Non-Fayz packages (no `@fayz-ai/` prefix) are out of scope and return true.
|
|
16
16
|
*/
|
|
17
17
|
export declare function isSupportedPackage(packageName: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* True when `packageName` is on the surface but scheduled for removal. Such a
|
|
20
|
+
* package still builds — `fayz doctor` reports it as a migration to do, not as
|
|
21
|
+
* a boundary violation. The replacement and removal version live in
|
|
22
|
+
* `deprecations.json`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isDeprecatedPackage(packageName: string): boolean;
|
|
18
25
|
export { surface as fayzSupportedSurface };
|
|
19
26
|
//# sourceMappingURL=supported-surface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supported-surface.d.ts","sourceRoot":"","sources":["../src/supported-surface.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"supported-surface.d.ts","sourceRoot":"","sources":["../src/supported-surface.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,YAAY,CAAA;AAErD,MAAM,WAAW,oBAAoB;IACnC,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IAC1C,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,QAAA,MAAM,OAAO,EAAkC,oBAAoB,CAAA;AAEnE,uFAAuF;AACvF,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAE/C;AAED,wFAAwF;AACxF,wBAAgB,mBAAmB,IAAI,MAAM,EAAE,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAG/D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { surface as fayzSupportedSurface, getInternalPackages, getSupportedPackages, isSupportedPackage } from './chunk-
|
|
1
|
+
export { surface as fayzSupportedSurface, getInternalPackages, getSupportedPackages, isDeprecatedPackage, isSupportedPackage } from './chunk-6UZOXHGJ.js';
|
|
2
2
|
//# sourceMappingURL=supported-surface.js.map
|
|
3
3
|
//# sourceMappingURL=supported-surface.js.map
|
package/dist/vite.d.ts
CHANGED
|
@@ -8,7 +8,13 @@ export interface FayzViteOptions {
|
|
|
8
8
|
aliases?: Record<string, string>;
|
|
9
9
|
/** Extra Vite plugins, appended after @vitejs/plugin-react. */
|
|
10
10
|
plugins?: PluginOption[];
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* SDK source location, absolute or relative to the app root
|
|
13
|
+
* (default `../../fayz-sdk`).
|
|
14
|
+
*
|
|
15
|
+
* The `FAYZ_SDK_DIR` environment variable OVERRIDES this — see
|
|
16
|
+
* {@link resolveSdkDir}.
|
|
17
|
+
*/
|
|
12
18
|
sdkDir?: string;
|
|
13
19
|
/** App root directory (default process.cwd()). */
|
|
14
20
|
root?: string;
|
|
@@ -36,9 +42,32 @@ export interface FayzViteOptions {
|
|
|
36
42
|
* import { fayzVite } from '@fayz-ai/sdk/vite'
|
|
37
43
|
* export default defineConfig(fayzVite({ port: 5185, plugins: [react()] }))
|
|
38
44
|
*
|
|
45
|
+
* Where that local source is read from is {@link resolveSdkDir}: `FAYZ_SDK_DIR`
|
|
46
|
+
* beats the `sdkDir` option beats `../../fayz-sdk`.
|
|
47
|
+
*
|
|
39
48
|
* The app passes its own `@vitejs/plugin-react` so `@fayz-ai/sdk` carries no
|
|
40
49
|
* build-tool peer deps (which otherwise choke npm's peer resolution, since sdk
|
|
41
50
|
* sits in every dependency path).
|
|
42
51
|
*/
|
|
52
|
+
/** Env var that redirects local-source resolution to another SDK checkout. */
|
|
53
|
+
export declare const FAYZ_SDK_DIR_ENV = "FAYZ_SDK_DIR";
|
|
54
|
+
/**
|
|
55
|
+
* Where the local SDK source is, as an absolute path. Resolution order:
|
|
56
|
+
*
|
|
57
|
+
* 1. `FAYZ_SDK_DIR` (env) — wins, absolute or root-relative
|
|
58
|
+
* 2. `sdkDir` (option) — what the app's vite config declares
|
|
59
|
+
* 3. `../../fayz-sdk` — the sibling-checkout convention
|
|
60
|
+
*
|
|
61
|
+
* Env wins deliberately. `sdkDir` lives in the app's COMMITTED vite config, so
|
|
62
|
+
* without an override there was no way to build, dev or `fayz validate` a
|
|
63
|
+
* store against a different SDK tree (a worktree, a release branch) short of
|
|
64
|
+
* editing that committed file or dropping an untracked config shim next to it
|
|
65
|
+
* — which is exactly what the fleet ended up doing. An env var is the one
|
|
66
|
+
* knob a CLI flag and a container can both set without touching the repo.
|
|
67
|
+
*
|
|
68
|
+
* Exported so the CLI and the tests agree on the precedence by construction
|
|
69
|
+
* rather than by comment.
|
|
70
|
+
*/
|
|
71
|
+
export declare function resolveSdkDir(root: string, sdkDir?: string, env?: Record<string, string | undefined>): string;
|
|
43
72
|
export declare function fayzVite(opts?: FayzViteOptions): UserConfig;
|
|
44
73
|
//# sourceMappingURL=vite.d.ts.map
|
package/dist/vite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAgB,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAgB,MAAM,MAAM,CAAA;AAiBlE,MAAM,WAAW,eAAe;IAC9B,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,yDAAyD;IACzD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,+DAA+D;IAC/D,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAA;IAC7B;;;;OAIG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;CAChC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,iBAAiB,CAAA;AAE9C;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,EACf,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GACpD,MAAM,CAGR;AAED,wBAAgB,QAAQ,CAAC,IAAI,GAAE,eAAoB,GAAG,UAAU,CA6D/D"}
|
package/dist/vite.js
CHANGED
|
@@ -3,10 +3,13 @@ import { resolve } from 'path';
|
|
|
3
3
|
|
|
4
4
|
// src/vite.ts
|
|
5
5
|
var SDK_PACKAGES = [
|
|
6
|
+
// 'saas' is the deprecated compat shim for 'admin' — kept so an app that has
|
|
7
|
+
// not migrated its imports still resolves in source mode (removed in 0.12.0).
|
|
6
8
|
"sdk",
|
|
7
9
|
"core",
|
|
8
10
|
"auth",
|
|
9
11
|
"ui",
|
|
12
|
+
"admin",
|
|
10
13
|
"saas",
|
|
11
14
|
"shop",
|
|
12
15
|
"storefront",
|
|
@@ -37,9 +40,14 @@ var SDK_PLUGINS = [
|
|
|
37
40
|
"tables",
|
|
38
41
|
"tasks"
|
|
39
42
|
];
|
|
43
|
+
var FAYZ_SDK_DIR_ENV = "FAYZ_SDK_DIR";
|
|
44
|
+
function resolveSdkDir(root, sdkDir, env = process.env) {
|
|
45
|
+
const fromEnv = env[FAYZ_SDK_DIR_ENV]?.trim();
|
|
46
|
+
return resolve(root, fromEnv || sdkDir || "../../fayz-sdk");
|
|
47
|
+
}
|
|
40
48
|
function fayzVite(opts = {}) {
|
|
41
49
|
const root = opts.root ?? process.cwd();
|
|
42
|
-
const fayzSdk =
|
|
50
|
+
const fayzSdk = resolveSdkDir(root, opts.sdkDir);
|
|
43
51
|
const wantLocal = process.env.FAYZ_SDK_SOURCE !== "published";
|
|
44
52
|
const localPresent = existsSync(resolve(fayzSdk, "packages/core/src/index.ts"));
|
|
45
53
|
const useLocal = wantLocal && localPresent;
|
|
@@ -94,6 +102,6 @@ function fayzVite(opts = {}) {
|
|
|
94
102
|
};
|
|
95
103
|
}
|
|
96
104
|
|
|
97
|
-
export { fayzVite };
|
|
105
|
+
export { FAYZ_SDK_DIR_ENV, fayzVite, resolveSdkDir };
|
|
98
106
|
//# sourceMappingURL=vite.js.map
|
|
99
107
|
//# sourceMappingURL=vite.js.map
|