@tokenoftrust/storefront-runner 2.4.89 → 2.4.91

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 (129) hide show
  1. package/apps/storefront/.runner-dependency-cruiser.cjs +38 -0
  2. package/apps/storefront/astro.config.mjs +1 -1
  3. package/apps/storefront/drizzle.config.apps.ts +1 -1
  4. package/apps/storefront/env.d.ts +1 -1
  5. package/apps/storefront/migrations/README.md +5 -5
  6. package/apps/storefront/package.json +2 -1
  7. package/apps/storefront/src/components/catalog/storefront/CollectionCard.astro +1 -1
  8. package/apps/storefront/src/components/catalog/storefront/ProductCard.astro +1 -1
  9. package/apps/storefront/src/components/catalog/storefront/commerce/BrandGrid.astro +1 -1
  10. package/apps/storefront/src/components/catalog/storefront/commerce/TagFilterCloud.astro +1 -1
  11. package/apps/storefront/src/components/catalog/storefront/islands/QuickView.tsx +1 -1
  12. package/apps/storefront/src/components/catalog/storefront/islands/RecentlyViewed.tsx +1 -1
  13. package/apps/storefront/src/components/catalog/storefront/islands/SearchTypeahead.tsx +1 -1
  14. package/apps/storefront/src/components/catalog/storefront/plp/ActiveFilters.astro +2 -2
  15. package/apps/storefront/src/components/catalog/storefront/plp/FacetSidebar.astro +2 -2
  16. package/apps/storefront/src/components/catalog/storefront/plp/Pagination.astro +1 -1
  17. package/apps/storefront/src/components/content/storefront/Breadcrumbs.astro +1 -1
  18. package/apps/storefront/src/components/content/storefront/EmptyState.astro +1 -1
  19. package/apps/storefront/src/components/content/storefront/blog/ReactionBar.astro +2 -2
  20. package/apps/storefront/src/components/content/storefront/chrome/NavDropdown.astro +1 -1
  21. package/apps/storefront/src/components/content/storefront/chrome/SiteFooter.astro +1 -1
  22. package/apps/storefront/src/components/content/storefront/chrome/SiteHeader.astro +1 -1
  23. package/apps/storefront/src/components/content/storefront/chrome/UtilityNav.astro +1 -1
  24. package/apps/storefront/src/components/content/storefront/commerce/ArticleCard.astro +1 -1
  25. package/apps/storefront/src/components/content/storefront/home/Hero.astro +1 -1
  26. package/apps/storefront/src/components/content/storefront/marketing/CardGrid.astro +1 -1
  27. package/apps/storefront/src/components/content/storefront/marketing/Integrations.astro +1 -1
  28. package/apps/storefront/src/components/content/storefront/marketing/MarketingCtas.astro +1 -1
  29. package/apps/storefront/src/components/customers/storefront/islands/SavedList.tsx +1 -1
  30. package/apps/storefront/src/config/resolver.ts +1 -1
  31. package/apps/storefront/src/layouts/Layout.astro +1 -1
  32. package/apps/storefront/src/lib/access/auth/adminEntry.ts +1 -1
  33. package/apps/storefront/src/lib/access/auth/brokerAssertion.ts +1 -1
  34. package/apps/storefront/src/lib/access/auth/devAuth.ts +1 -1
  35. package/apps/storefront/src/lib/access/auth/identityToken.ts +1 -1
  36. package/apps/storefront/src/lib/access/auth/mcpClientAssertion.ts +1 -1
  37. package/apps/storefront/src/lib/access/auth/route.ts +1 -1
  38. package/apps/storefront/src/lib/access/auth/totAccessClient.ts +1 -1
  39. package/apps/storefront/src/lib/access/dashboard/delegateGate.ts +1 -1
  40. package/apps/storefront/src/lib/access/dashboard/staffVendorAccess.ts +1 -1
  41. package/apps/storefront/src/lib/access/shared/developerInvites.ts +1 -1
  42. package/apps/storefront/src/lib/access/shared/principalGrants.ts +1 -1
  43. package/apps/storefront/src/lib/access/shared/tenantRouting.ts +1 -1
  44. package/apps/storefront/src/lib/activity/killSwitch.ts +1 -1
  45. package/apps/storefront/src/lib/activity/uiActor.ts +1 -1
  46. package/apps/storefront/src/lib/assets/durableR2Bindings.ts +1 -1
  47. package/apps/storefront/src/lib/checkout/commerce/checkoutHandoffCorrelation.ts +1 -1
  48. package/apps/storefront/src/lib/checkout/shared/checkoutCommerce.ts +1 -1
  49. package/apps/storefront/src/lib/compliance/enforcement.ts +1 -1
  50. package/apps/storefront/src/lib/compliance/tamper-sentinel-boot.ts +1 -1
  51. package/apps/storefront/src/lib/compliance/verification/totVerificationClient.ts +1 -1
  52. package/apps/storefront/src/lib/content/blog/collection.ts +1 -1
  53. package/apps/storefront/src/lib/content/blog/provider.ts +1 -1
  54. package/apps/storefront/src/lib/content/shared/heroSlideshow.ts +1 -1
  55. package/apps/storefront/src/lib/content/shared/homeVisualParity.ts +1 -1
  56. package/apps/storefront/src/lib/content/shared/rawMarketingHtml.ts +1 -1
  57. package/apps/storefront/src/lib/developer-experience/dev/cliSignInCode.ts +1 -1
  58. package/apps/storefront/src/lib/developer-experience/dev/rendezvousBroker.ts +1 -1
  59. package/apps/storefront/src/lib/developer-experience/http/mcpServiceCall.ts +1 -1
  60. package/apps/storefront/src/lib/developer-experience/types/cloudflare-workers.d.ts +1 -1
  61. package/apps/storefront/src/lib/engagement/messaging/messagesClient.ts +1 -1
  62. package/apps/storefront/src/lib/engagement/newsletter/resendClient.ts +1 -1
  63. package/apps/storefront/src/lib/engagement/social/tokenStore.ts +1 -1
  64. package/apps/storefront/src/lib/fulfillment/fulfillmentService.ts +1 -1
  65. package/apps/storefront/src/lib/integrations/apps/gatewayKeys.ts +1 -1
  66. package/apps/storefront/src/lib/integrations/apps/registryAccess.ts +1 -1
  67. package/apps/storefront/src/lib/integrations/webhooks/emit.ts +1 -1
  68. package/apps/storefront/src/lib/integrations/webhooks/getDispatcher.ts +1 -1
  69. package/apps/storefront/src/lib/measurement/attribution/orderConversionD1.ts +1 -1
  70. package/apps/storefront/src/lib/measurement/tracking/d1Control.ts +1 -1
  71. package/apps/storefront/src/lib/measurement/tracking/interactionCollector.ts +1 -1
  72. package/apps/storefront/src/lib/measurement/tracking/tenantD1Registry.ts +1 -1
  73. package/apps/storefront/src/lib/observability/performance/webVitals.ts +1 -1
  74. package/apps/storefront/src/lib/orders/providers/foxyOrderClient.ts +1 -1
  75. package/apps/storefront/src/lib/{env.ts → publication/shared/env.ts} +1 -1
  76. package/apps/storefront/src/lib/{previewReload.ts → publication/shared/previewReload.ts} +1 -1
  77. package/apps/storefront/src/lib/{url.ts → publication/shared/url.ts} +1 -1
  78. package/apps/storefront/src/middleware/candidatePin.ts +1 -1
  79. package/apps/storefront/src/middleware/controlPlane.ts +2 -2
  80. package/apps/storefront/src/middleware/index.ts +2 -2
  81. package/apps/storefront/src/middleware/publicRender.ts +2 -2
  82. package/apps/storefront/src/middleware/renderChain.ts +4 -4
  83. package/apps/storefront/src/middleware/staticBundle.ts +2 -2
  84. package/apps/storefront/src/pages/404.astro +1 -1
  85. package/apps/storefront/src/pages/api/activity.ts +1 -1
  86. package/apps/storefront/src/pages/api/admin/activity-alerts.ts +1 -1
  87. package/apps/storefront/src/pages/api/admin/interaction-insights.ts +1 -1
  88. package/apps/storefront/src/pages/api/admin/orders/[id].ts +1 -1
  89. package/apps/storefront/src/pages/api/admin/orders.ts +1 -1
  90. package/apps/storefront/src/pages/api/auth/send.ts +1 -1
  91. package/apps/storefront/src/pages/api/auth/verify.ts +1 -1
  92. package/apps/storefront/src/pages/api/blog/[collection]/[slug]/react.ts +1 -1
  93. package/apps/storefront/src/pages/api/checkout-style.css.ts +1 -1
  94. package/apps/storefront/src/pages/api/cli/policy.ts +1 -1
  95. package/apps/storefront/src/pages/api/commerce/final-cart-authorization.ts +1 -1
  96. package/apps/storefront/src/pages/api/newsletter/[collection]/subscribe.ts +1 -1
  97. package/apps/storefront/src/pages/api/newsletter/confirm.ts +1 -1
  98. package/apps/storefront/src/pages/api/newsletter/unsubscribe.ts +2 -2
  99. package/apps/storefront/src/pages/api/newsletter.ts +2 -2
  100. package/apps/storefront/src/pages/api/request-access.ts +1 -1
  101. package/apps/storefront/src/pages/api/rum/vitals.ts +1 -1
  102. package/apps/storefront/src/pages/api/tracking/interaction.ts +1 -1
  103. package/apps/storefront/src/pages/auth/login.astro +1 -1
  104. package/apps/storefront/src/pages/capabilities.astro +1 -1
  105. package/apps/storefront/src/pages/collections/[handle].astro +2 -2
  106. package/apps/storefront/src/pages/feed.json.ts +1 -1
  107. package/apps/storefront/src/pages/index.astro +1 -1
  108. package/apps/storefront/src/pages/llms.txt.ts +1 -1
  109. package/apps/storefront/src/pages/products/[handle].astro +1 -1
  110. package/apps/storefront/src/pages/search-index.json.ts +1 -1
  111. package/apps/storefront/src/pages/search.astro +1 -1
  112. package/apps/storefront/src/pages/sitemap.xml.ts +1 -1
  113. package/apps/storefront/src/pages/tenants/[id]/[...path].ts +1 -1
  114. package/apps/storefront/test/pipeline/fake-preview-services.ts +2 -2
  115. package/apps/storefront/test/pipeline/harness.ts +1 -1
  116. package/apps/storefront/test/pipeline/matrix-faults.ts +4 -4
  117. package/apps/storefront/test/pipeline/pipeline-host.ts +9 -9
  118. package/apps/storefront/test/pipeline/publish-kinds.ts +4 -4
  119. package/apps/storefront/test/pipeline/synthetic-job.ts +3 -3
  120. package/apps/storefront/test/pipeline-faults/matrix-lib.ts +2 -2
  121. package/package.json +1 -1
  122. package/packages/public-runtime/src/hosted-image-media-types.ts +1 -1
  123. package/packages/public-runtime/src/retention-holds.ts +1 -1
  124. /package/apps/storefront/src/lib/{d1 → publication/d1}/schema-apps.ts +0 -0
  125. /package/apps/storefront/src/lib/{email → publication/notifications}/candidateConflictEmail.ts +0 -0
  126. /package/apps/storefront/src/lib/{basePath.ts → publication/shared/basePath.ts} +0 -0
  127. /package/apps/storefront/src/lib/{cdnForward.ts → publication/shared/cdnForward.ts} +0 -0
  128. /package/apps/storefront/src/lib/{edgeCache.ts → publication/shared/edgeCache.ts} +0 -0
  129. /package/apps/storefront/src/lib/{runtimeEnv.ts → publication/shared/runtimeEnv.ts} +0 -0
@@ -0,0 +1,38 @@
1
+ module.exports = {
2
+ "forbidden": [
3
+ {
4
+ "name": "renderer-no-controlplane",
5
+ "severity": "error",
6
+ "from": {},
7
+ "to": {
8
+ "path": "(^|/)packages/private-controlplane/|^@tot/private-controlplane(/|$)|^@tokenoftrust/private-apps-devkit(/|$)"
9
+ }
10
+ }
11
+ ],
12
+ "options": {
13
+ "tsConfig": {
14
+ "fileName": "tsconfig.json"
15
+ },
16
+ "tsPreCompilationDeps": true,
17
+ "doNotFollow": {
18
+ "path": "node_modules"
19
+ },
20
+ "enhancedResolveOptions": {
21
+ "exportsFields": [
22
+ "exports"
23
+ ],
24
+ "conditionNames": [
25
+ "import",
26
+ "types",
27
+ "node",
28
+ "default"
29
+ ],
30
+ "extensions": [
31
+ ".ts",
32
+ ".tsx",
33
+ ".js",
34
+ ".mjs"
35
+ ]
36
+ }
37
+ }
38
+ };
@@ -87,7 +87,7 @@ export default defineConfig({
87
87
  // Small first-paint tradeoff, offset by cross-page caching (see LIMITATIONS).
88
88
  build: { inlineStylesheets: "never" },
89
89
  // The cross-site form check runs in the front door (src/middleware/index.ts,
90
- // lib/cdnForward.ts `crossSiteFormRefusal`) with the same rule, against the
90
+ // lib/publication/shared/cdnForward.ts `crossSiteFormRefusal`) with the same rule, against the
91
91
  // origin the viewer used. Astro's own check compares with the request URL, which
92
92
  // for a CloudFront-forwarded Tier 3 request is this Worker's host, not the viewer's.
93
93
  security: { checkOrigin: false },
@@ -8,6 +8,6 @@ import { defineConfig } from "drizzle-kit";
8
8
  // lineage/journal — the whole point of splitting the database.
9
9
  export default defineConfig({
10
10
  dialect: "sqlite",
11
- schema: "./src/lib/d1/schema-apps.ts",
11
+ schema: "./src/lib/publication/d1/schema-apps.ts",
12
12
  out: "./migrations-apps",
13
13
  });
@@ -226,7 +226,7 @@ declare global {
226
226
  * the opaque subject, email + role(s)/capability tot20 resolved on this tenant, so chrome
227
227
  * can show "signed in as … — owner/developer/staff". Absent on open or
228
228
  * password-gated hosts. Chrome only: authorization reads the session record for the
229
- * routed tenant (lib/pipeline/admission-request), never this.
229
+ * routed tenant (lib/publication/pipeline/admission-request), never this.
230
230
  */
231
231
  viewer?: {
232
232
  /** Opaque identity-provider subject from the verified session assertion. */
@@ -10,20 +10,20 @@ by **Drizzle Kit** (ADR-0002), applied by `wrangler d1 migrations apply`.
10
10
 
11
11
  ## Source of truth
12
12
 
13
- - **`src/lib/d1/schema.ts`** (Drizzle schema, catalog + customization ONLY) is the
13
+ - **`src/lib/publication/d1/schema.ts`** (Drizzle schema, catalog + customization ONLY) is the
14
14
  source of truth for migration *generation*. `drizzle-kit generate` diffs it into
15
15
  numbered `migrations/*.sql` (+ `meta/` journal) and owns the SQLite table-rebuild
16
16
  logic for `ALTER`s.
17
17
  - **`products_fts`** (FTS5 virtual table) can't be modelled by Drizzle — it's a custom
18
18
  migration (`0001_products_fts.sql`), hand-maintained.
19
19
  - The raw-SQL read model + ETL still consume `CATALOG_D1_SCHEMA`/`CUSTOMIZATION_D1_SCHEMA`
20
- (`@tot/private-controlplane`). A **structural** equivalence test (`src/lib/d1/schema.test.ts`,
20
+ (`@tot/private-controlplane`). A **structural** equivalence test (`src/lib/publication/d1/schema.test.ts`,
21
21
  PRAGMA-based) asserts the migrations reproduce that contract, so generator and read
22
22
  model can't drift.
23
23
 
24
24
  ## Safety (D1 has no rollback)
25
25
 
26
- `src/lib/d1/migrationSafety.ts` + its test **fail CI** on any unmarked `DROP TABLE` /
26
+ `src/lib/publication/d1/migrationSafety.ts` + its test **fail CI** on any unmarked `DROP TABLE` /
27
27
  `DROP COLUMN` (which also catches SQLite column-dropping rebuilds), because the
28
28
  equivalence test only proves *end-state* correctness, not a safe transition. An
29
29
  *intended* destructive change must opt in, in the migration file:
@@ -35,7 +35,7 @@ equivalence test only proves *end-state* correctness, not a safe transition. An
35
35
  ## Workflows
36
36
 
37
37
  **Regular change (add/alter a column, table):**
38
- 1. Edit `src/lib/d1/schema.ts`.
38
+ 1. Edit `src/lib/publication/d1/schema.ts`.
39
39
  2. `pnpm --filter @tot/storefront gen:migrations` (Drizzle emits the next numbered SQL,
40
40
  including SQLite table-rebuilds for unsupported `ALTER`s).
41
41
  3. If a column was removed, add `-- allow-destructive: <reason>` to the generated file.
@@ -56,5 +56,5 @@ wrangler d1 migrations apply CATALOG_DB --env <env> [--remote|--local]
56
56
  ```
57
57
 
58
58
  > Catalog + customization tables share the **one** `CATALOG_DB` binding (one edge DB),
59
- > per `src/lib/customization/d1Store.ts`. The storefront-apps tables are a SEPARATE D1
59
+ > per `src/lib/publication/customization/d1Store.ts`. The storefront-apps tables are a SEPARATE D1
60
60
  > (`STOREFRONT_APPS_DB`) applied the same way, from `../migrations-apps/`.
@@ -14,7 +14,8 @@
14
14
  "preview": "wrangler dev",
15
15
  "typecheck": "astro check && tsc --noEmit",
16
16
  "astro": "astro",
17
- "test": "NODE_OPTIONS=--experimental-sqlite vitest run --exclude src/lib/integrations/apps/v84CleanCloneReplay.test.ts --exclude src/lib/integrations/apps/v84NonportableRouteDogfood.test.ts --exclude src/lib/integrations/apps/v84CloneLifecycleEvidence.test.ts && NODE_OPTIONS=--experimental-sqlite vitest run src/lib/integrations/apps/v84CleanCloneReplay.test.ts src/lib/integrations/apps/v84NonportableRouteDogfood.test.ts src/lib/integrations/apps/v84CloneLifecycleEvidence.test.ts --fileParallelism=false && pnpm run test:pipeline && pnpm run test:pipeline-faults"
17
+ "test": "NODE_OPTIONS=--experimental-sqlite vitest run --exclude src/lib/integrations/apps/v84CleanCloneReplay.test.ts --exclude src/lib/integrations/apps/v84NonportableRouteDogfood.test.ts --exclude src/lib/integrations/apps/v84CloneLifecycleEvidence.test.ts && NODE_OPTIONS=--experimental-sqlite vitest run src/lib/integrations/apps/v84CleanCloneReplay.test.ts src/lib/integrations/apps/v84NonportableRouteDogfood.test.ts src/lib/integrations/apps/v84CloneLifecycleEvidence.test.ts --fileParallelism=false && pnpm run test:pipeline && pnpm run test:pipeline-faults",
18
+ "depcruise": "depcruise src --config .runner-dependency-cruiser.cjs"
18
19
  },
19
20
  "dependencies": {
20
21
  "@astrojs/cloudflare": "^14.0.1",
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import type { CatalogCollection } from "@tot/public-runtime";
8
8
  import Img from "@/components/assets/storefront/Img.astro";
9
- import { withBase } from "@/lib/basePath";
9
+ import { withBase } from "@/lib/publication/shared/basePath";
10
10
  import { pageUrlForm } from "@/lib/content/seo/urlForm";
11
11
 
12
12
  interface Props {
@@ -14,7 +14,7 @@ import Img from "@/components/assets/storefront/Img.astro";
14
14
  import Badge from "@/components/content/storefront/Badge.astro";
15
15
  import PriceDisplay from "@/components/catalog/storefront/commerce/PriceDisplay.astro";
16
16
  import RatingStars from "@/components/catalog/storefront/commerce/RatingStars.astro";
17
- import { withBase } from "@/lib/basePath";
17
+ import { withBase } from "@/lib/publication/shared/basePath";
18
18
  import { pageUrlForm } from "@/lib/content/seo/urlForm";
19
19
 
20
20
  interface Props {
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import Section from "@/components/content/storefront/Section.astro";
17
17
  import Img from "@/components/assets/storefront/Img.astro";
18
- import { withBase } from "@/lib/basePath";
18
+ import { withBase } from "@/lib/publication/shared/basePath";
19
19
 
20
20
  export interface Brand {
21
21
  /** Brand name — the link label, image alt, and text-fallback wordmark. */
@@ -10,7 +10,7 @@
10
10
  * raw-chrome `.tag-cloud` / `.tag-chip` block in
11
11
  * public/shared/commerce-chrome.css — same token vocabulary, same look.
12
12
  */
13
- import { withBase } from "@/lib/basePath";
13
+ import { withBase } from "@/lib/publication/shared/basePath";
14
14
 
15
15
  export interface TagItem {
16
16
  /** Display label. */
@@ -9,7 +9,7 @@
9
9
  import { useEffect, useRef, useState } from "preact/hooks";
10
10
  import { formatPrice } from "@/lib/content/shared/format";
11
11
  import { placeholderDataUri, isUsableImageUrl } from "@/lib/content/shared/placeholder";
12
- import { withClientBase } from "@/lib/basePath";
12
+ import { withClientBase } from "@/lib/publication/shared/basePath";
13
13
 
14
14
  interface QV {
15
15
  handle: string;
@@ -8,7 +8,7 @@
8
8
  import { useEffect, useState } from "preact/hooks";
9
9
  import { formatPrice } from "@/lib/content/shared/format";
10
10
  import { placeholderDataUri, isUsableImageUrl } from "@/lib/content/shared/placeholder";
11
- import { withClientBase } from "@/lib/basePath";
11
+ import { withClientBase } from "@/lib/publication/shared/basePath";
12
12
 
13
13
  export interface RVItem {
14
14
  handle: string;
@@ -14,7 +14,7 @@ import { useCallback, useEffect, useRef, useState } from "preact/hooks";
14
14
  import type { TypeaheadDoc } from "@/lib/catalog/search/index";
15
15
  import { formatPrice } from "@/lib/content/shared/format";
16
16
  import { placeholderDataUri, isUsableImageUrl } from "@/lib/content/shared/placeholder";
17
- import { withClientBase } from "@/lib/basePath";
17
+ import { withClientBase } from "@/lib/publication/shared/basePath";
18
18
 
19
19
  interface Props {
20
20
  action?: string;
@@ -2,10 +2,10 @@
2
2
  /**
3
3
  * Active-filter chips (Shopify-style). Shows what's applied as removable pills
4
4
  * above the grid — each chip is a link that drops exactly one filter, so it's
5
- * URL-addressable and back-button safe like the rest of faceting (src/lib/url.ts).
5
+ * URL-addressable and back-button safe like the rest of faceting (src/lib/publication/shared/url.ts).
6
6
  */
7
7
  import type { ListProductsQuery } from "@tot/public-runtime";
8
- import { toggleFacet, buildQueryString } from "@/lib/url";
8
+ import { toggleFacet, buildQueryString } from "@/lib/publication/shared/url";
9
9
 
10
10
  interface Props {
11
11
  query: ListProductsQuery;
@@ -4,10 +4,10 @@
4
4
  * facet is a real link that toggles a querystring param (no JS required for
5
5
  * filtering). The optional mobile drawer toggle is the only island.
6
6
  *
7
- * Encoding handled by src/lib/url.ts (opt.<Name>=<value>, tag=, price, avail).
7
+ * Encoding handled by src/lib/publication/shared/url.ts (opt.<Name>=<value>, tag=, price, avail).
8
8
  */
9
9
  import type { Facet, ListProductsQuery } from "@tot/public-runtime";
10
- import { toggleFacet, buildQueryString, isPriceBucketActive, togglePriceBucket } from "@/lib/url";
10
+ import { toggleFacet, buildQueryString, isPriceBucketActive, togglePriceBucket } from "@/lib/publication/shared/url";
11
11
  import { PRICE_BUCKETS, bucketByKey } from "@/lib/catalog/shared/priceBuckets";
12
12
 
13
13
  interface Props {
@@ -6,7 +6,7 @@
6
6
  * be progressively enhanced to append, but the no-JS path stays correct.
7
7
  */
8
8
  import type { ListProductsQuery } from "@tot/public-runtime";
9
- import { buildQueryString } from "@/lib/url";
9
+ import { buildQueryString } from "@/lib/publication/shared/url";
10
10
 
11
11
  interface Props {
12
12
  query: ListProductsQuery;
@@ -13,7 +13,7 @@
13
13
  * Build `crumbs` with `siteTrail` (lib/content/shared/breadcrumbs.ts) and pass the SAME array to `breadcrumbLd`.
14
14
  * `class` adds a hook for the page's own styles (`breadcrumbs` on the blog templates).
15
15
  */
16
- import { withBase } from "@/lib/basePath";
16
+ import { withBase } from "@/lib/publication/shared/basePath";
17
17
  import { pageUrlForm } from "@/lib/content/seo/urlForm";
18
18
  import type { Crumb } from "@/lib/content/shared/breadcrumbs";
19
19
 
@@ -3,7 +3,7 @@
3
3
  * <EmptyState> — intentional empty result (search/PLP). Copy is passed in by
4
4
  * the parent (kept in the tenant's editorial voice).
5
5
  */
6
- import { withBase } from "@/lib/basePath";
6
+ import { withBase } from "@/lib/publication/shared/basePath";
7
7
 
8
8
  interface Props {
9
9
  title: string;
@@ -9,8 +9,8 @@
9
9
  * view counts). Tenant/collection-generic: mounts on any post route.
10
10
  */
11
11
  import { getReactionCounts, REACTIONS, type Reaction } from "@/lib/content/blog/reactions.js";
12
- import { readKv } from "@/lib/runtimeEnv";
13
- import { withBase } from "@/lib/basePath";
12
+ import { readKv } from "@/lib/publication/shared/runtimeEnv";
13
+ import { withBase } from "@/lib/publication/shared/basePath";
14
14
 
15
15
  interface Props {
16
16
  /** Collection id the post lives in (e.g. "blog", "the-build"). */
@@ -16,7 +16,7 @@
16
16
  * Tenant-agnostic; theme-token skinned.
17
17
  */
18
18
  import type { ChromeNavItem, ChromeLink } from "@/lib/content/chrome/model";
19
- import { withBase } from "@/lib/basePath";
19
+ import { withBase } from "@/lib/publication/shared/basePath";
20
20
  import { isCurrentNavHref } from "@/lib/content/chrome/navCurrent";
21
21
  import { trackingAttributes } from "@tot/public-runtime";
22
22
 
@@ -8,7 +8,7 @@
8
8
  * or checkout logic (commerce boundary).
9
9
  */
10
10
  import type { ChromeLink, FooterColumn, FooterNewsletter, SocialLink, ChromeLogo, FooterVariant } from "@/lib/content/chrome/model";
11
- import { withBase } from "@/lib/basePath";
11
+ import { withBase } from "@/lib/publication/shared/basePath";
12
12
  import { CHROME_PLACEMENT } from "@/lib/content/chrome/trackingPlacements";
13
13
  import { resolveNewsletterAgeAttestation } from "@/lib/content/chrome/newsletterAgeAttestation";
14
14
  import { trackingAttributes } from "@tot/public-runtime";
@@ -18,7 +18,7 @@ import MegaMenu from "@/components/content/storefront/chrome/MegaMenu.astro";
18
18
  import NavDropdown from "@/components/content/storefront/chrome/NavDropdown.astro";
19
19
  import SearchTypeahead from "@/components/catalog/storefront/islands/SearchTypeahead.tsx";
20
20
  import MobileNav from "@/components/content/storefront/islands/MobileNav.tsx";
21
- import { withBase } from "@/lib/basePath";
21
+ import { withBase } from "@/lib/publication/shared/basePath";
22
22
  import { ctaIdentityAttr } from "@/lib/content/chrome/ctaIdentity";
23
23
  import { CHROME_PLACEMENT } from "@/lib/content/chrome/trackingPlacements";
24
24
  import { trackingAttributes } from "@tot/public-runtime";
@@ -6,7 +6,7 @@
6
6
  * convenience — the mobile menu carries these links).
7
7
  */
8
8
  import type { ChromeLink, SocialLink } from "@/lib/content/chrome/model";
9
- import { withBase } from "@/lib/basePath";
9
+ import { withBase } from "@/lib/publication/shared/basePath";
10
10
  import { CHROME_PLACEMENT } from "@/lib/content/chrome/trackingPlacements";
11
11
  import { trackingAttributes } from "@tot/public-runtime";
12
12
 
@@ -17,7 +17,7 @@
17
17
  * excerpts — omit a field and its row simply doesn't render.
18
18
  */
19
19
  import Img from "@/components/assets/storefront/Img.astro";
20
- import { withBase } from "@/lib/basePath";
20
+ import { withBase } from "@/lib/publication/shared/basePath";
21
21
 
22
22
  export interface ArticleImage {
23
23
  src: string;
@@ -22,7 +22,7 @@
22
22
  import type { HeroBlock } from "@/lib/content/storyblok/content-model";
23
23
  import type { CatalogProduct } from "@tot/public-runtime";
24
24
  import Img from "@/components/assets/storefront/Img.astro";
25
- import { withBase } from "@/lib/basePath";
25
+ import { withBase } from "@/lib/publication/shared/basePath";
26
26
  import { pageUrlForm } from "@/lib/content/seo/urlForm";
27
27
  import { heroSlideshowView } from "@/lib/content/shared/heroSlideshow";
28
28
 
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import Section from "@/components/content/storefront/Section.astro";
8
8
  import type { CardGridBlock } from "@/lib/content/storyblok/content-model";
9
- import { withBase } from "@/lib/basePath";
9
+ import { withBase } from "@/lib/publication/shared/basePath";
10
10
 
11
11
  interface Props {
12
12
  block: CardGridBlock;
@@ -7,7 +7,7 @@
7
7
  import Section from "@/components/content/storefront/Section.astro";
8
8
  import CodeSample from "@/components/content/storefront/marketing/CodeSample.astro";
9
9
  import type { IntegrationsBlock } from "@/lib/content/storyblok/content-model";
10
- import { withBase } from "@/lib/basePath";
10
+ import { withBase } from "@/lib/publication/shared/basePath";
11
11
 
12
12
  interface Props {
13
13
  block: IntegrationsBlock;
@@ -6,7 +6,7 @@
6
6
  * base-path prefix so path-routed tenants stay in-tenant.
7
7
  */
8
8
  import type { MarketingCta } from "@/lib/content/storyblok/content-model";
9
- import { withBase } from "@/lib/basePath";
9
+ import { withBase } from "@/lib/publication/shared/basePath";
10
10
 
11
11
  interface Props {
12
12
  ctas?: MarketingCta[];
@@ -13,7 +13,7 @@ import {
13
13
  } from "@/lib/customers/shared/wishlist";
14
14
  import { formatPrice } from "@/lib/content/shared/format";
15
15
  import { placeholderDataUri, isUsableImageUrl } from "@/lib/content/shared/placeholder";
16
- import { withClientBase } from "@/lib/basePath";
16
+ import { withClientBase } from "@/lib/publication/shared/basePath";
17
17
 
18
18
  interface Props {
19
19
  locale: string;
@@ -21,7 +21,7 @@
21
21
  * default is configurable, not hardcoded.
22
22
  */
23
23
  import { tenantIdFromPath, type TenantResolver } from "@tot/public-runtime";
24
- import { readEnv, readKv } from "@/lib/env";
24
+ import { readEnv, readKv } from "@/lib/publication/shared/env";
25
25
  import {
26
26
  tenantResolver as staticResolver,
27
27
  staticTenants,
@@ -542,7 +542,7 @@ const footerWidgets = await renderWidgetSlot(
542
542
  root-absolute links inside that prefix so navigation stays on the
543
543
  tenant. Host-routed requests have no base path and skip this entirely. */}
544
544
  <script>
545
- import { bindBasePathAnchors } from "@/lib/basePath";
545
+ import { bindBasePathAnchors } from "@/lib/publication/shared/basePath";
546
546
  bindBasePathAnchors();
547
547
  </script>
548
548
 
@@ -4,7 +4,7 @@
4
4
  * keeps a non-member / unauthenticated visitor on the legitimate sign-in gate.
5
5
  *
6
6
  * NARROW to auth/session ENTRY: it CONSUMES the admin tab UX
7
- * (`pages/admin.astro` + `components/admin/AdminPublishTab.astro`) and the
7
+ * (`pages/admin.astro` + `components/publication/admin/AdminPublishTab.astro`) and the
8
8
  * ship-capability model (`change/shipCapabilities` + `change/route` decideIsOwner)
9
9
  * rather than reimplementing either. Everything it resolves is bound to the
10
10
  * RESOLVED tenant, never taken from client input, and never requires a
@@ -23,7 +23,7 @@
23
23
  * direction of the same decoupled-authZ pattern).
24
24
  */
25
25
  import { SignJWT, importPKCS8, type CryptoKey } from "jose";
26
- import { readEnv } from "@/lib/env";
26
+ import { readEnv } from "@/lib/publication/shared/env";
27
27
 
28
28
  /** The audience tot20's broker verifier pins. */
29
29
  export const BROKER_AUDIENCE = "tot20-broker";
@@ -16,7 +16,7 @@
16
16
  * Keeping the bypass in one file means "does prod contain the bypass?" is a single
17
17
  * grep (`devAuth`), and the production path in send/verify is never weakened.
18
18
  */
19
- import { readEnv } from "@/lib/env";
19
+ import { readEnv } from "@/lib/publication/shared/env";
20
20
  import { devTenantResources } from "@/config/devTenants";
21
21
  import { createSession } from "./session.js";
22
22
 
@@ -26,7 +26,7 @@ import {
26
26
  type JWTVerifyGetKey,
27
27
  type JSONWebKeySet,
28
28
  } from "jose";
29
- import { readEnv } from "@/lib/env";
29
+ import { readEnv } from "@/lib/publication/shared/env";
30
30
  import {
31
31
  TENANT_ROLES,
32
32
  isTenantRole,
@@ -34,7 +34,7 @@
34
34
  * `devbook/app-binding.md` Recipe A ("multiple execution environments").
35
35
  */
36
36
  import { importPKCS8, exportJWK, SignJWT, type CryptoKey, type JWK, type JSONWebKeySet } from "jose";
37
- import { readEnv } from "@/lib/env";
37
+ import { readEnv } from "@/lib/publication/shared/env";
38
38
 
39
39
  /** The only algorithm this assertion is signed with (the MCP verifier rejects anything else). */
40
40
  export const MCP_CLIENT_ASSERTION_ALG = "RS256";
@@ -14,7 +14,7 @@
14
14
  * tenant — never from request input.
15
15
  */
16
16
  import type { APIContext } from "astro";
17
- import { readKv } from "@/lib/env";
17
+ import { readKv } from "@/lib/publication/shared/env";
18
18
  import { createTotAccessClient, type TotAccessClient } from "./totAccessClient.js";
19
19
  import {
20
20
  KvSessionStore,
@@ -26,7 +26,7 @@
26
26
  * to `credentialFields()` below — the ONLY spot to touch. Everything else (paths,
27
27
  * bodies, response shapes) is contract-fixed.
28
28
  */
29
- import { readEnv } from "@/lib/env";
29
+ import { readEnv } from "@/lib/publication/shared/env";
30
30
  import { diagEmail } from "@/lib/observability/diag/redact";
31
31
  import { FetchHttpTransport, type HttpResponseLike, type HttpTransport } from "@/lib/developer-experience/http/fetchTransport";
32
32
  import { classifyStepUp, type StepUpChallenge, type StepUpObligation } from "./stepUpChallenge.js";
@@ -37,7 +37,7 @@ export type DelegateSection = { mode: "unpaid"; role: null; explanation: string
37
37
  /**
38
38
  * Resolve the whole delegate section. Before a store is paid, an invited developer can
39
39
  * already add changes AND publish them (both `merge-to-preview` and `publish-live` admit the
40
- * "unpaid-store-developer" basis, lib/pipeline/admission.ts), so delegation has nothing to
40
+ * "unpaid-store-developer" basis, lib/publication/pipeline/admission.ts), so delegation has nothing to
41
41
  * grant: every viewer, the owner included, gets {@link UNPAID_DELEGATION_NOTE}. A paid store
42
42
  * resolves {@link resolveDelegateGate} unchanged.
43
43
  */
@@ -30,7 +30,7 @@
30
30
  * factory) so the routes develop/test against `MockStaffVendorAccessClient` and
31
31
  * swap in the Http client with no call-site change.
32
32
  */
33
- import { readEnv } from "@/lib/env";
33
+ import { readEnv } from "@/lib/publication/shared/env";
34
34
  import { decodeJwt } from "jose";
35
35
 
36
36
  /**
@@ -52,7 +52,7 @@
52
52
  * seam is duplicated locally rather than imported from `@/lib/auth` so the grants
53
53
  * control-plane cluster stays self-contained (see `.dependency-cruiser.cjs`).
54
54
  */
55
- import { readEnv } from "@/lib/env";
55
+ import { readEnv } from "@/lib/publication/shared/env";
56
56
  import { callMcpService } from "@/lib/developer-experience/http/mcpServiceCall";
57
57
  import { diagEmail } from "@/lib/observability/diag/redact";
58
58
  import { checkStorePreviewReady, type PreflightDecision } from "@/lib/access/shared/invitePreflight";
@@ -75,7 +75,7 @@
75
75
  * factory) so the route develops/tests against `MockPrincipalGrantClient` and
76
76
  * swaps in the Http client with no call-site change.
77
77
  */
78
- import { readEnv } from "@/lib/env";
78
+ import { readEnv } from "@/lib/publication/shared/env";
79
79
  import { diagEmail } from "@/lib/observability/diag/redact";
80
80
  import { BROKER_ASSERTION_HEADER, BROKER_PRIVATE_KEY_ENV } from "@/lib/access/auth/brokerAssertion";
81
81
 
@@ -55,7 +55,7 @@ function normalizePath(path: string): string {
55
55
  }
56
56
 
57
57
  /**
58
- * Routing for an authenticated CDN forward (lib/cdnForward.ts). The forward names
58
+ * Routing for an authenticated CDN forward (lib/publication/shared/cdnForward.ts). The forward names
59
59
  * its tenant outright and renders at the apex, as the tenant's own host would.
60
60
  * Only a tenant served from CloudFront static storage (`serving.provider:
61
61
  * "s3-overwrite"`) has a distribution that forwards here; any other resolves to
@@ -24,7 +24,7 @@
24
24
  * dev/tests immediately, and a Worker secret takes effect from the first primed
25
25
  * request of each isolate.
26
26
  */
27
- import { readEnv } from "../runtimeEnv.js";
27
+ import { readEnv } from "../publication/shared/runtimeEnv.js";
28
28
 
29
29
  /** The one canonical flag name — shared verbatim by the server and the CLI mirror. */
30
30
  export const ACTIVITY_KILL_SWITCH_FLAG = "ACTIVITY_TELEMETRY_DISABLED";
@@ -51,7 +51,7 @@ import type { ActionKey } from "@tot/public-runtime";
51
51
  import { readViewerSession } from "@/lib/access/auth/route";
52
52
  import { sessionHostCapability } from "@/lib/access/auth/loginGate";
53
53
  import { isStaffSession } from "@/lib/access/dashboard/staffAdmission";
54
- import { readEnv } from "@/lib/env";
54
+ import { readEnv } from "@/lib/publication/shared/env";
55
55
  import { isOwnerCapability } from "@/lib/access/shared/capability";
56
56
  import { hashActorId, recordActivity } from "./recordActivity";
57
57
 
@@ -4,7 +4,7 @@
4
4
  * with) and TENANT_CACHE for the durable-image status record. Unbound ⇒ every pre-flip stage
5
5
  * refuses, so a pointer-served version can never go live missing its captured images.
6
6
  */
7
- import { readKv, readR2 } from "@/lib/env";
7
+ import { readKv, readR2 } from "@/lib/publication/shared/env";
8
8
  import { makeWorkerR2PinnedOriginalStager, R2StagingError, type R2BucketLike, type StatusKvLike } from "./durableR2.js";
9
9
 
10
10
  export async function workerR2PinnedOriginalStagerFromEnv(): Promise<
@@ -33,7 +33,7 @@ import {
33
33
  type HandoffCorrelation,
34
34
  type IntegrationEnvironment,
35
35
  } from "@tot/public-runtime";
36
- import { readEnv } from "@/lib/env";
36
+ import { readEnv } from "@/lib/publication/shared/env";
37
37
 
38
38
  /** The server-only correlation-signing key binding — distinct from the cart secret
39
39
  * (key separation), and the SAME binding the order join verifies against. */
@@ -29,7 +29,7 @@ import {
29
29
  resolveManagedCheckout,
30
30
  SHARED_DEMO_CHECKOUT,
31
31
  } from "@tot/public-runtime";
32
- import { readEnv } from "@/lib/runtimeEnv";
32
+ import { readEnv } from "@/lib/publication/shared/runtimeEnv";
33
33
 
34
34
  /**
35
35
  * Resolve the effective checkout facts for a tenant, or null when the tenant has
@@ -18,7 +18,7 @@ import type {
18
18
  EnforcementEvidenceSignals,
19
19
  } from "@tot/public-runtime";
20
20
  import { enforcementSignals } from "@tot/public-runtime";
21
- import { readEnv } from "@/lib/env";
21
+ import { readEnv } from "@/lib/publication/shared/env";
22
22
  import { COMPLIANCE_RULE_PROFILES } from "@/config/compliance/rulesets";
23
23
 
24
24
  /** True when the tenant sells age/nicotine-restricted goods (drives fail-closed). */
@@ -24,7 +24,7 @@ import type {
24
24
  IntegrationSiteSurface,
25
25
  } from "@tot/public-runtime";
26
26
  import { INTEGRATION_PLAN_GLOBAL } from "@tot/public-runtime";
27
- import { withClientApiBase } from "@/lib/basePath";
27
+ import { withClientApiBase } from "@/lib/publication/shared/basePath";
28
28
 
29
29
  /** Where the browser posts a tamper beacon; the server receiver records + suspends. */
30
30
  export const TAMPER_BEACON_ENDPOINT = "/api/compliance/tamper";
@@ -34,7 +34,7 @@
34
34
  * Structure mirrors `@/lib/auth/totAccessClient`: interface + Http impl + Mock +
35
35
  * env factory, with the wire-credential shape isolated to `credentialFields()`.
36
36
  */
37
- import { readEnv } from "@/lib/env";
37
+ import { readEnv } from "@/lib/publication/shared/env";
38
38
  import {
39
39
  FetchHttpTransport,
40
40
  type HttpGetTransport,
@@ -6,7 +6,7 @@ import {
6
6
  } from "@tot/public-runtime";
7
7
  import type { AuthorBio, BlogPost, BlogPostSummary, BlogSettings, PostStatus } from "./types.js";
8
8
  import type { ContentProvider } from "../storyblok/provider.js";
9
- import { readEnv } from "../../env.js";
9
+ import { readEnv } from "../../publication/shared/env.js";
10
10
 
11
11
  type ArtifactSource = Pick<ContentProvider, "readArtifact" | "listArtifactPaths">;
12
12
  function canReadArtifacts(value: ArtifactSource | undefined): value is ArtifactSource {
@@ -13,7 +13,7 @@ import {
13
13
  import { getIndexSettings, listPosts } from "./collection.js";
14
14
  import type { BlogPost, BlogPostSummary, BlogSettings } from "./types.js";
15
15
  import type { ContentProvider } from "../storyblok/provider.js";
16
- import { readEnv } from "../../env.js";
16
+ import { readEnv } from "../../publication/shared/env.js";
17
17
 
18
18
  /** The collection id `/blog` reads — the derived fallback's second argument. */
19
19
  const BLOG_COLLECTION = "blog";