@realadvisor-sites/kit-react 0.3.0 → 0.4.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 CHANGED
@@ -1,9 +1,10 @@
1
1
  # @realadvisor/sites-kit-react
2
2
 
3
- The React Router version of the RealAdvisor sites kit: React Router 7
4
- (framework mode, SSR) on a Cloudflare Worker, with the same guarantees as the
5
- Astro kit (`@realadvisor/sites-kit`). It reuses the Astro kit for every rule,
6
- string and browser script it can (`lib/` format, i18n, legal, search, seo,
3
+ The React Router kit for RealAdvisor sites: React Router 7 (framework mode,
4
+ SSR) on a Cloudflare Worker, with the same guarantees as the Astro kit
5
+ (`@realadvisor/sites-kit-astro`). Both are built on the shared core
6
+ (`@realadvisor/sites-kit-core`), which a site installs next to this kit. It
7
+ reuses the core for every rule, string and browser script it can (`lib/` format, i18n, legal, search, seo,
7
8
  image, env, render-error; `client/` enquiry, consent, combobox, listings
8
9
  search and map; the check:deploy rules; `AGENTS.md` / `DESIGN.md` still
9
10
  apply) and adds only what React needs. Reference site:
package/client/index.ts CHANGED
@@ -13,9 +13,9 @@ export { islands } from './islands';
13
13
 
14
14
  export function kit() {
15
15
  const has = (sel: string) => !!document.querySelector(sel);
16
- if (has('[data-enquiry]')) void import('@realadvisor/sites-kit/client/enquiry');
17
- if (has('[data-consent]')) void import('@realadvisor/sites-kit/client/consent');
18
- if (has('[data-combobox]')) void import('@realadvisor/sites-kit/client/combobox');
19
- if (has('[data-rs-root]')) void import('@realadvisor/sites-kit/client/listings-search');
20
- else if (has('[data-ra-map]')) void import('@realadvisor/sites-kit/client/listings-map');
16
+ if (has('[data-enquiry]')) void import('@realadvisor/sites-kit-core/client/enquiry');
17
+ if (has('[data-consent]')) void import('@realadvisor/sites-kit-core/client/consent');
18
+ if (has('[data-combobox]')) void import('@realadvisor/sites-kit-core/client/combobox');
19
+ if (has('[data-rs-root]')) void import('@realadvisor/sites-kit-core/client/listings-search');
20
+ else if (has('[data-ra-map]')) void import('@realadvisor/sites-kit-core/client/listings-map');
21
21
  }
@@ -3,7 +3,7 @@
3
3
  * Astro kit's client/consent.ts). Renders only when ANALYTICS_ID is set;
4
4
  * GA4 loads only after "Accept". Keep both buttons equal in weight.
5
5
  */
6
- import { lang, privacyPath, t } from '@realadvisor/sites-kit/i18n';
6
+ import { lang, privacyPath, t } from '@realadvisor/sites-kit-core/i18n';
7
7
  import { useKit, usePageLocale } from './Document';
8
8
 
9
9
  /** `locale`: default the page's (from its path), as the rest of the page. */
@@ -22,9 +22,9 @@
22
22
  */
23
23
  import { createContext, useContext, type ReactNode } from 'react';
24
24
  import { isRouteErrorResponse, Scripts, ScrollRestoration, useLocation, useMatches, useRouteError } from 'react-router';
25
- import { localeOfPath } from '@realadvisor/sites-kit/i18n';
25
+ import { localeOfPath } from '@realadvisor/sites-kit-core/i18n';
26
26
  import client from 'virtual:sites-kit-react/client';
27
- import { safeJsonLd } from '@realadvisor/sites-kit/seo';
27
+ import { safeJsonLd } from '@realadvisor/sites-kit-core/seo';
28
28
 
29
29
  /** The request's CSP nonce (server only; the browser hides it). */
30
30
  export const NonceContext = createContext<string | undefined>(undefined);
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * THE enquiry form (port of EnquiryForm.astro: same markup, same fields, same
3
- * browser script @realadvisor/sites-kit/client/enquiry, same /api/enquiry
3
+ * browser script @realadvisor/sites-kit-core/client/enquiry, same /api/enquiry
4
4
  * contract). Every form that sends a message to the agency is this one.
5
5
  *
6
6
  * <EnquiryForm listingId={l.id} agentId={l.agent?.id} agentName={l.agent?.first_name} message={…} />
@@ -11,7 +11,7 @@
11
11
  */
12
12
  import { useLocation } from 'react-router';
13
13
  import { FIXTURE_TURNSTILE_SITE_KEY } from '@realadvisor/sites-sdk';
14
- import { t as tr, lang, localeOfPath, privacyPath, type StringKey } from '@realadvisor/sites-kit/i18n';
14
+ import { t as tr, lang, localeOfPath, privacyPath, type StringKey } from '@realadvisor/sites-kit-core/i18n';
15
15
  import { useKit } from './Document';
16
16
  import { Input } from './form/Input';
17
17
  import { Button } from './form/Button';
@@ -3,7 +3,7 @@
3
3
  * this page (the same `alternates` the page gives <Seo>), the current one
4
4
  * aria-current. Single-language sites render nothing.
5
5
  */
6
- import { lang } from '@realadvisor/sites-kit/i18n';
6
+ import { lang } from '@realadvisor/sites-kit-core/i18n';
7
7
 
8
8
  export function LanguageSwitch({ alternates, locale, className }: { alternates: { lang: string; href: string }[]; locale: string; className?: string }) {
9
9
  if (alternates.length < 2) return null;
@@ -21,4 +21,4 @@ export function LanguageSwitch({ alternates, locale, className }: { alternates:
21
21
  }
22
22
 
23
23
  /** Alternates of one page in every locale: `localePath(path, locale)` per language. */
24
- export { localePath } from '@realadvisor/sites-kit/i18n';
24
+ export { localePath } from '@realadvisor/sites-kit-core/i18n';
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * <LegalContent sections={legalNotice(agencyOf(org, team))} />
6
6
  */
7
- import type { LegalSection } from '@realadvisor/sites-kit/legal';
7
+ import type { LegalSection } from '@realadvisor/sites-kit-core/legal';
8
8
 
9
9
  export function LegalContent({ sections, className }: { sections: LegalSection[]; className?: string }) {
10
10
  return (
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * Listings map (port of ListingsMap.astro: same markup and data-* contract;
3
- * the browser side is @realadvisor/sites-kit/client/listings-map, no map
3
+ * the browser side is @realadvisor/sites-kit-core/client/listings-map, no map
4
4
  * library, OSM tiles only). Height: `--map-h` on a parent. Keep the attribution.
5
5
  *
6
6
  * <ListingsMap listings={located} href={listingUrl} price={price} />
7
7
  */
8
8
  import type { Listing } from '@realadvisor/sites-sdk/types';
9
- import { formatPrice, listingUrl } from '@realadvisor/sites-kit/format';
10
- import { img } from '@realadvisor/sites-kit/image';
11
- import { lang, localePath, pluralForms, propertyTypeLabel, t } from '@realadvisor/sites-kit/i18n';
9
+ import { formatPrice, listingUrl } from '@realadvisor/sites-kit-core/format';
10
+ import { img } from '@realadvisor/sites-kit-core/image';
11
+ import { lang, localePath, pluralForms, propertyTypeLabel, t } from '@realadvisor/sites-kit-core/i18n';
12
12
  import { usePageLocale } from './Document';
13
13
 
14
14
  type MapProps<L> = {
@@ -1,7 +1,7 @@
1
1
  /** Numbered pages of ListingsSearch (port of ListingsPager.astro). */
2
- import { pageList, type SearchResult } from '@realadvisor/sites-kit/search';
2
+ import { pageList, type SearchResult } from '@realadvisor/sites-kit-core/search';
3
3
  import { usePageLocale } from './Document';
4
- import { lang, t } from '@realadvisor/sites-kit/i18n';
4
+ import { lang, t } from '@realadvisor/sites-kit-core/i18n';
5
5
 
6
6
  export function ListingsPager({ result, href, locale }: { result: SearchResult; href: (over: { page?: number }) => string; locale?: string }) {
7
7
  const l = lang(locale ?? usePageLocale());
@@ -15,9 +15,9 @@
15
15
  */
16
16
  import type { ReactNode } from 'react';
17
17
  import type { Listing } from '@realadvisor/sites-sdk/types';
18
- import { mapView, searchHref, type FilterKey } from '@realadvisor/sites-kit/search';
19
- import { formatAmount, formatPrice, formatSurface, listingUrl } from '@realadvisor/sites-kit/format';
20
- import { count, lang, localePath, offerTypeLabel, propertyTypeLabel, t } from '@realadvisor/sites-kit/i18n';
18
+ import { mapView, searchHref, type FilterKey } from '@realadvisor/sites-kit-core/search';
19
+ import { formatAmount, formatPrice, formatSurface, listingUrl } from '@realadvisor/sites-kit-core/format';
20
+ import { count, lang, localePath, offerTypeLabel, propertyTypeLabel, t } from '@realadvisor/sites-kit-core/i18n';
21
21
  import type { ListingsResult } from '../lib/search';
22
22
  import { ListingsMap } from './ListingsMap';
23
23
  import { ListingsPager } from './ListingsPager';
@@ -13,7 +13,7 @@
13
13
  * `dangerouslySetInnerHTML` in app/). It is a plain object, so it passes
14
14
  * through loader data (JSON) unchanged.
15
15
  */
16
- import { sanitizeHtml } from '@realadvisor/sites-kit';
16
+ import { sanitizeHtml } from '@realadvisor/sites-kit-core';
17
17
 
18
18
  /** HTML that went through sanitizeHtml: make it with `sanitized()` only (a string brand: it survives loader serialization). */
19
19
  export type SanitizedHtml = { readonly kind: 'sanitized-html'; readonly sanitizedHtml: string };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Searchable select for long lists (port of form/Combobox.astro): a native
3
- * select (works without JS), upgraded by @realadvisor/sites-kit/client/combobox.
3
+ * select (works without JS), upgraded by @realadvisor/sites-kit-core/client/combobox.
4
4
  */
5
5
  import type { Option } from './Select';
6
6
 
package/env.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * tsconfig includes it: "include": ["node_modules/@realadvisor/sites-kit-react/env.d.ts", ...].
4
4
  */
5
5
  declare module 'virtual:sites-kit/site' {
6
- const site: import('@realadvisor/sites-kit/site-config').SiteConfig;
6
+ const site: import('@realadvisor/sites-kit-core/site-config').SiteConfig;
7
7
  export default site;
8
8
  }
9
9
  declare module 'virtual:sites-kit-react/client' {
@@ -26,10 +26,10 @@ declare module 'astro:env/server' {
26
26
  export const SITES_FIXTURE: string | undefined;
27
27
  }
28
28
  declare module 'virtual:sites-kit/fixtures' {
29
- const fixtures: Record<string, { default: import('@realadvisor/sites-kit').SiteFixture }>;
29
+ const fixtures: Record<string, { default: import('@realadvisor/sites-kit-core').SiteFixture }>;
30
30
  export default fixtures;
31
31
  }
32
- declare module '@realadvisor/sites-kit/security' {
32
+ declare module '@realadvisor/sites-kit-core/security' {
33
33
  export const ALLOWED_HOSTS: { img: string[]; script: string[]; connect: string[]; frame: string[] };
34
34
  export function csp(preview: boolean): string;
35
35
  export function securityHeaders(preview: boolean): Record<string, string>;
package/lib/image.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * img.realadvisor.ch, Google profile photos, other hosts unchanged) plus a
4
4
  * crop of the original (imgproxy `c:` step), which sites had to add.
5
5
  */
6
- import { img, srcset, type ImgOptions } from '@realadvisor/sites-kit/image';
6
+ import { img, srcset, type ImgOptions } from '@realadvisor/sites-kit-core/image';
7
7
 
8
8
  export { img, srcset, type ImgOptions };
9
9
 
package/lib/records.ts CHANGED
@@ -4,10 +4,10 @@
4
4
  * reference as the Astro kit words them.
5
5
  */
6
6
  import type { Listing } from '@realadvisor/sites-sdk/types';
7
- import { formatPrice } from '@realadvisor/sites-kit/format';
7
+ import { formatPrice } from '@realadvisor/sites-kit-core/format';
8
8
 
9
- export { agencyOf } from '@realadvisor/sites-kit/agency';
10
- export { listingRef } from '@realadvisor/sites-kit/seo';
9
+ export { agencyOf } from '@realadvisor/sites-kit-core/agency';
10
+ export { listingRef } from '@realadvisor/sites-kit-core/seo';
11
11
 
12
12
  /**
13
13
  * `CHF 2'850'000`, `CHF 4'200 / Monat`, "Preis auf Anfrage" (DESIGN.md 5), in
package/lib/search.ts CHANGED
@@ -13,11 +13,11 @@
13
13
  * a price filter (a CHF + EUR agency: filter in one, or hide the price filter).
14
14
  */
15
15
  import type { Listing } from '@realadvisor/sites-sdk/types';
16
- import { poolCurrency, runSearch, type SearchOptions, type SearchParams, type SearchResult } from '@realadvisor/sites-kit/search';
17
- import { LOCALE } from '@realadvisor/sites-kit/format';
18
- import { localeOfPath } from '@realadvisor/sites-kit/i18n';
16
+ import { poolCurrency, runSearch, type SearchOptions, type SearchParams, type SearchResult } from '@realadvisor/sites-kit-core/search';
17
+ import { LOCALE } from '@realadvisor/sites-kit-core/format';
18
+ import { localeOfPath } from '@realadvisor/sites-kit-core/i18n';
19
19
 
20
- export { parseSearch, searchHref, mapView, type SearchParams } from '@realadvisor/sites-kit/search';
20
+ export { parseSearch, searchHref, mapView, type SearchParams } from '@realadvisor/sites-kit-core/search';
21
21
 
22
22
  /** The kit's SearchResult and the price filter's currency. */
23
23
  export type ListingsResult = SearchResult & { currency?: string };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@realadvisor-sites/kit-react",
3
- "version": "0.3.0",
4
- "description": "The React Router (framework mode, SSR on Cloudflare Workers) version of the RealAdvisor sites kit: Worker with a per-request CSP nonce, data through the SDK interface, images, legal, consent, enquiry, SEO, listings search and map, and the deploy check. Reuses @realadvisor/sites-kit for every rule, string and browser script it can.",
3
+ "version": "0.4.0",
4
+ "description": "The React Router (framework mode, SSR on Cloudflare Workers) version of the RealAdvisor sites kit: Worker with a per-request CSP nonce, data through the SDK interface, images, legal, consent, enquiry, SEO, listings search and map, and the deploy check. Reuses @realadvisor/sites-kit-core for every rule, string and browser script it can.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -50,8 +50,8 @@
50
50
  "sites-kit-react": "./bin/sites-kit-react.mjs"
51
51
  },
52
52
  "peerDependencies": {
53
- "@realadvisor/sites-kit": "^0.3.0",
54
- "@realadvisor/sites-sdk": "^0.3.0",
53
+ "@realadvisor/sites-kit-core": "^0.4.0",
54
+ "@realadvisor/sites-sdk": "^0.4.0",
55
55
  "react": "^19.0.0",
56
56
  "react-dom": "^19.0.0",
57
57
  "react-router": "^7.18.0",
package/server/data.ts CHANGED
@@ -19,8 +19,8 @@
19
19
  */
20
20
  import { createClient, createFixtureClient } from '@realadvisor/sites-sdk';
21
21
  import type { Portals, SitesClient } from '@realadvisor/sites-sdk/types';
22
- import { previewApi } from '@realadvisor/sites-kit/env';
23
- import { withTextLocale } from '@realadvisor/sites-kit/page-locale';
22
+ import { previewApi } from '@realadvisor/sites-kit-core/env';
23
+ import { withTextLocale } from '@realadvisor/sites-kit-core/page-locale';
24
24
  import type { Fixture } from './fixture-client';
25
25
 
26
26
  export { createFixtureClient, fixtureOnly, type Fixture } from './fixture-client';
package/server/enquiry.ts CHANGED
@@ -6,4 +6,4 @@
6
6
  * import { sites } from '../lib/data.server';
7
7
  * export const action = ({ request }: Route.ActionArgs) => enquiryAction(request, sites);
8
8
  */
9
- export { enquiryAction, type EnquiryClient } from '@realadvisor/sites-kit/enquiry';
9
+ export { enquiryAction, type EnquiryClient } from '@realadvisor/sites-kit-core/enquiry';
@@ -1,2 +1,2 @@
1
1
  /** The example sites' fixture and its client: the Astro kit's (lib/fixture.ts). */
2
- export { createFixtureClient, fixtureOnly, type Fixture } from '@realadvisor/sites-kit/fixture';
2
+ export { createFixtureClient, fixtureOnly, type Fixture } from '@realadvisor/sites-kit-core/fixture';
package/server/kit.ts CHANGED
@@ -7,9 +7,9 @@
7
7
  *
8
8
  * and `canonical(request)` for every page's <Seo>.
9
9
  */
10
- import { analyticsId, siteMode } from '@realadvisor/sites-kit/env';
11
- import { canonicalUrl } from '@realadvisor/sites-kit/seo';
12
- import { localeOfPath } from '@realadvisor/sites-kit/i18n';
10
+ import { analyticsId, siteMode } from '@realadvisor/sites-kit-core/env';
11
+ import { canonicalUrl } from '@realadvisor/sites-kit-core/seo';
12
+ import { localeOfPath } from '@realadvisor/sites-kit-core/i18n';
13
13
  import { FIXTURE_TURNSTILE_SITE_KEY } from '@realadvisor/sites-sdk';
14
14
  import { liveClient } from './data';
15
15
  import type { KitData } from '../components/Document';
@@ -5,7 +5,7 @@
5
5
  * kit's lib/security.mjs as it is: same hosts, same directives, no hash, no
6
6
  * 'unsafe-inline' for scripts.
7
7
  */
8
- import { securityHeaders } from '@realadvisor/sites-kit/security';
8
+ import { securityHeaders } from '@realadvisor/sites-kit-core/security';
9
9
 
10
10
  /** 128 random bits, base64: a new one for every HTML response. */
11
11
  export function createNonce(): string {
package/server/seo.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  * Every path on the public origin (SITE_URL). Legal pages of every
10
10
  * language: `legalPaths()`.
11
11
  */
12
- import { LOCALES, legalPath, privacyPath } from '@realadvisor/sites-kit/i18n';
12
+ import { LOCALES, legalPath, privacyPath } from '@realadvisor/sites-kit-core/i18n';
13
13
  import { siteUrl } from './kit';
14
14
 
15
15
  const esc = (s: string) => s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
package/server/worker.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Per request it:
8
8
  * - hands the Worker env (SITE_MODE, SITES_API_URL, SITES_API_KEY,
9
- * ANALYTICS_ID) to the kit (`@realadvisor/sites-kit/env`);
9
+ * ANALYTICS_ID) to the kit (`@realadvisor/sites-kit-core/env`);
10
10
  * - answers the 301s of site.json `redirects`, refuses cross-site form
11
11
  * posts (Astro's checkOrigin);
12
12
  * - makes a fresh CSP nonce (128 random bits) and passes it to React Router
@@ -23,10 +23,10 @@
23
23
  import { createRequestHandler, type ServerBuild } from 'react-router';
24
24
  import site from 'virtual:sites-kit/site';
25
25
  import inlineStyles from 'virtual:sites-kit-react/css';
26
- import { setRuntimeEnv, siteMode, type SiteEnv } from '@realadvisor/sites-kit/env';
27
- import { notFoundPage, renderFailed } from '@realadvisor/sites-kit/render-error';
28
- import { localeOfPath } from '@realadvisor/sites-kit/i18n';
29
- import { withPageLocale } from '@realadvisor/sites-kit/page-locale';
26
+ import { setRuntimeEnv, siteMode, type SiteEnv } from '@realadvisor/sites-kit-core/env';
27
+ import { notFoundPage, renderFailed } from '@realadvisor/sites-kit-core/render-error';
28
+ import { localeOfPath } from '@realadvisor/sites-kit-core/i18n';
29
+ import { withPageLocale } from '@realadvisor/sites-kit-core/page-locale';
30
30
  import { createNonce, siteHeaders } from './security';
31
31
 
32
32
  /** The parts of the Workers runtime types the kit uses (no @cloudflare/workers-types: it clashes with the DOM lib). */
package/styles/kit.css CHANGED
@@ -10,11 +10,11 @@
10
10
  * Imported from JS, the kit's Vite plugin turns it into one import per part
11
11
  * (no @import for the bundler to hoist): the rules sit exactly where the
12
12
  * import is. A site that needs fewer parts imports them one by one:
13
- * import '@realadvisor/sites-kit/styles/form.css';
13
+ * import '@realadvisor/sites-kit-core/styles/form.css';
14
14
  * import '@realadvisor/sites-kit-react/styles/consent.css';
15
15
  * From another stylesheet (`@import`) this file is plain CSS, below.
16
16
  */
17
- @import '@realadvisor/sites-kit/styles/form.css';
17
+ @import '@realadvisor/sites-kit-core/styles/form.css';
18
18
  @import './search.css';
19
19
  @import './pager.css';
20
20
  @import './map.css';
@@ -46,9 +46,9 @@ import {
46
46
  offHosts,
47
47
  pageAssets,
48
48
  parseTags,
49
- } from '@realadvisor/sites-kit/tools/check-deploy.mjs';
50
- import { buildLeaks } from '@realadvisor/sites-kit/tools/secret-leaks.mjs';
51
- import { csp as kitCsp } from '@realadvisor/sites-kit/security';
49
+ } from '@realadvisor/sites-kit-core/tools/check-deploy.mjs';
50
+ import { buildLeaks } from '@realadvisor/sites-kit-core/tools/secret-leaks.mjs';
51
+ import { csp as kitCsp } from '@realadvisor/sites-kit-core/security';
52
52
 
53
53
  const JS_TYPES = new Set(['', 'module', 'text/javascript', 'application/javascript']);
54
54
  const LISTING_PATH = /^\/[^/]+\/[^/]+-[0-9a-f]{8}-[0-9a-f]{4}-/i;
@@ -100,7 +100,7 @@ export function unsafeHtml(root) {
100
100
  for (const m of readFileSync(file, 'utf8').matchAll(/dangerouslySetInnerHTML=\{\{\s*__html:\s*([^}]*)\}\}/g)) {
101
101
  const expr = m[1].trim();
102
102
  if (/^(sanitizeHtml|safeJsonLd)\([^()]*(\([^()]*\))?[^()]*\)$/.test(expr)) continue;
103
- out.push({ page: relative(root, file), message: `dangerouslySetInnerHTML={{ __html: ${expr.slice(0, 40)} }} renders unescaped HTML: use sanitizeHtml(…) from @realadvisor/sites-kit, or sanitized() in the loader + <SafeHtml> from @realadvisor/sites-kit-react (or <JsonLd>)` });
103
+ out.push({ page: relative(root, file), message: `dangerouslySetInnerHTML={{ __html: ${expr.slice(0, 40)} }} renders unescaped HTML: use sanitizeHtml(…) from @realadvisor/sites-kit-core, or sanitized() in the loader + <SafeHtml> from @realadvisor/sites-kit-react (or <JsonLd>)` });
104
104
  }
105
105
  // Any other form (a variable, a spread object) cannot be read here: <SafeHtml> is the typed way.
106
106
  for (const m of readFileSync(file, 'utf8').matchAll(/dangerouslySetInnerHTML=\{(?!\{)\s*([^}]{0,60})/g)) {
package/vite.mjs CHANGED
@@ -32,14 +32,14 @@
32
32
  import { existsSync, writeFileSync } from 'node:fs';
33
33
  import { join, relative, resolve } from 'node:path';
34
34
  import { fileURLToPath } from 'node:url';
35
- import { readSiteConfig, SITE_CONFIG_FILE } from '@realadvisor/sites-kit/site-config';
36
- import { securityHeaders } from '@realadvisor/sites-kit/security';
35
+ import { readSiteConfig, SITE_CONFIG_FILE } from '@realadvisor/sites-kit-core/site-config';
36
+ import { securityHeaders } from '@realadvisor/sites-kit-core/security';
37
37
 
38
38
  const SITE_ID = 'virtual:sites-kit/site';
39
39
  const CLIENT_ID = 'virtual:sites-kit-react/client';
40
40
  const CSS_ID = 'virtual:sites-kit-react/css';
41
41
  const resolved = (id) => `\0${id}`;
42
- const KIT_PACKAGES = ['@realadvisor/sites-kit', '@realadvisor/sites-kit-react', '@realadvisor/sites-sdk'];
42
+ const KIT_PACKAGES = ['@realadvisor/sites-kit-core', '@realadvisor/sites-kit-react', '@realadvisor/sites-sdk'];
43
43
 
44
44
  /**
45
45
  * PRELOAD: Vite wraps every dynamic `import()` of the browser build in its
@@ -140,8 +140,8 @@ export default function sitesKit(opts = {}) {
140
140
  },
141
141
  async load(id) {
142
142
  if (id === KIT_CSS_ID) {
143
- const form = await this.resolve('@realadvisor/sites-kit/styles/form.css', join(KIT_DIR, 'components', 'EnquiryForm.tsx'));
144
- return [form?.id ?? '@realadvisor/sites-kit/styles/form.css', ...KIT_PARTS].map((f) => `import ${JSON.stringify(f)};`).join('\n');
143
+ const form = await this.resolve('@realadvisor/sites-kit-core/styles/form.css', join(KIT_DIR, 'components', 'EnquiryForm.tsx'));
144
+ return [form?.id ?? '@realadvisor/sites-kit-core/styles/form.css', ...KIT_PARTS].map((f) => `import ${JSON.stringify(f)};`).join('\n');
145
145
  }
146
146
  // The browser build: the kit's small preload helper instead of Vite's (see PRELOAD).
147
147
  if (id === PRELOAD_ID && command === 'build' && this.environment?.config.consumer === 'client' && base.startsWith('/')) return preloadHelper(base);