@uniformdev/canvas-sveltekit 20.48.1-alpha.33.sha-eb3f272086 → 20.81.1-alpha.53.sha-78fe06af4f

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.
@@ -1,10 +1,15 @@
1
1
  import type { RequestEvent } from '@sveltejs/kit';
2
2
  import type { Handle } from '@sveltejs/kit/hooks';
3
- import type { UniformPreviewData } from '../models.js';
3
+ import { type UniformPreviewData } from '../models.js';
4
4
  /**
5
5
  * Options for creating the Uniform handle hook.
6
6
  */
7
7
  export type CreateUniformHandleOptions = {
8
+ /**
9
+ * Returns the preview secret that signs the preview cookie. Must match the secret given to
10
+ * `createPreviewHandler`. When it returns an empty value, preview cookies are ignored.
11
+ */
12
+ secret: () => string | undefined;
8
13
  /**
9
14
  * Optional callback when preview data is present.
10
15
  * Useful for logging or additional setup.
@@ -15,15 +20,19 @@ export type CreateUniformHandleOptions = {
15
20
  * Creates a SvelteKit handle hook that integrates Uniform preview mode.
16
21
  *
17
22
  * This hook:
18
- * - Makes preview data available via `event.locals.uniformPreview`
23
+ * - Verifies the signed preview cookie and makes its data available via `event.locals.uniformPreview`
19
24
  * - Optionally calls a callback when in preview mode
20
25
  *
26
+ * `createUniformLoad` reads preview state from `event.locals.uniformPreview`, so this hook is required
27
+ * for draft content and contextual editing.
28
+ *
21
29
  * @example
22
30
  * // In src/hooks.server.ts
23
31
  * import { createUniformHandle } from '@uniformdev/canvas-sveltekit';
24
32
  * import { sequence } from '@sveltejs/kit/hooks';
25
33
  *
26
34
  * const uniformHandle = createUniformHandle({
35
+ * secret: () => process.env.UNIFORM_PREVIEW_SECRET,
27
36
  * onPreview: (event, previewData) => {
28
37
  * console.log('Preview mode active:', previewData);
29
38
  * },
@@ -39,4 +48,4 @@ export type CreateUniformHandleOptions = {
39
48
  * }
40
49
  * };
41
50
  */
42
- export declare function createUniformHandle(options?: CreateUniformHandleOptions): Handle;
51
+ export declare function createUniformHandle(options: CreateUniformHandleOptions): Handle;
@@ -1,17 +1,23 @@
1
+ import { UNIFORM_PREVIEW_COOKIE_NAME } from '../models.js';
1
2
  import { getPreviewData } from '../preview/previewCookie.js';
3
+ let hasWarnedMissingSecret = false;
2
4
  /**
3
5
  * Creates a SvelteKit handle hook that integrates Uniform preview mode.
4
6
  *
5
7
  * This hook:
6
- * - Makes preview data available via `event.locals.uniformPreview`
8
+ * - Verifies the signed preview cookie and makes its data available via `event.locals.uniformPreview`
7
9
  * - Optionally calls a callback when in preview mode
8
10
  *
11
+ * `createUniformLoad` reads preview state from `event.locals.uniformPreview`, so this hook is required
12
+ * for draft content and contextual editing.
13
+ *
9
14
  * @example
10
15
  * // In src/hooks.server.ts
11
16
  * import { createUniformHandle } from '@uniformdev/canvas-sveltekit';
12
17
  * import { sequence } from '@sveltejs/kit/hooks';
13
18
  *
14
19
  * const uniformHandle = createUniformHandle({
20
+ * secret: () => process.env.UNIFORM_PREVIEW_SECRET,
15
21
  * onPreview: (event, previewData) => {
16
22
  * console.log('Preview mode active:', previewData);
17
23
  * },
@@ -28,14 +34,17 @@ import { getPreviewData } from '../preview/previewCookie.js';
28
34
  * };
29
35
  */
30
36
  export function createUniformHandle(options) {
31
- const { onPreview } = options ?? {};
37
+ const { secret, onPreview } = options;
32
38
  return async ({ event, resolve }) => {
33
- // Parse preview data from cookie and attach to locals
34
- const previewData = getPreviewData(event.cookies);
39
+ const previewSecret = secret();
40
+ if (!previewSecret && event.cookies.get(UNIFORM_PREVIEW_COOKIE_NAME) && !hasWarnedMissingSecret) {
41
+ hasWarnedMissingSecret = true;
42
+ // eslint-disable-next-line no-console
43
+ console.warn('[canvas-sveltekit] Ignoring the Uniform preview cookie because no preview secret is configured.');
44
+ }
45
+ const previewData = previewSecret ? await getPreviewData(event.cookies, previewSecret) : null;
35
46
  if (previewData) {
36
- // Attach to locals for access in load functions
37
47
  event.locals.uniformPreview = previewData;
38
- // Call optional callback
39
48
  await onPreview?.(event, previewData);
40
49
  }
41
50
  return resolve(event);
package/dist/models.d.ts CHANGED
@@ -14,6 +14,8 @@ export type UniformPreviewData = {
14
14
  compositionPath?: string;
15
15
  /** The locale being previewed */
16
16
  locale?: string;
17
+ /** The release being previewed. Route fetches use it unless request options set a release. */
18
+ releaseId?: string;
17
19
  /** Whether this is a playground preview (component/pattern preview) */
18
20
  isPlayground?: boolean;
19
21
  /**
@@ -23,6 +25,14 @@ export type UniformPreviewData = {
23
25
  */
24
26
  patternType?: Exclude<CompositionGetParameters['patternType'], 'all'>;
25
27
  };
28
+ declare global {
29
+ namespace App {
30
+ interface Locals {
31
+ /** Verified preview data from the signed preview cookie, set by `createUniformHandle`. */
32
+ uniformPreview?: UniformPreviewData;
33
+ }
34
+ }
35
+ }
26
36
  /**
27
37
  * The name of the cookie used to store preview data.
28
38
  */
@@ -22,7 +22,7 @@ export type CreatePreviewHandlerOptions = CreatePreviewHandlerGetOptions & Creat
22
22
  * export const POST = handlers.POST;
23
23
  * export const OPTIONS = handlers.OPTIONS;
24
24
  */
25
- export declare function createPreviewHandler(options?: CreatePreviewHandlerOptions): {
25
+ export declare function createPreviewHandler(options: CreatePreviewHandlerOptions): {
26
26
  GET: RequestHandler;
27
27
  POST: RequestHandler;
28
28
  OPTIONS: RequestHandler;
@@ -18,7 +18,7 @@ import { createPreviewHandlerPost } from './previewHandlerPost.js';
18
18
  * export const OPTIONS = handlers.OPTIONS;
19
19
  */
20
20
  export function createPreviewHandler(options) {
21
- const { secret, resolveFullPath, playgroundPath, enhance } = options ?? {};
21
+ const { secret, resolveFullPath, playgroundPath, enhance } = options;
22
22
  const GET = createPreviewHandlerGet({ secret, resolveFullPath, playgroundPath });
23
23
  const POST = createPreviewHandlerPost({ secret, enhance });
24
24
  const OPTIONS = async () => {
@@ -1,33 +1,36 @@
1
1
  import type { Cookies } from '@sveltejs/kit';
2
2
  import { type UniformPreviewData } from '../models.js';
3
3
  /**
4
- * Serializes preview data to a cookie value.
4
+ * Serializes preview data to a cookie value signed with the preview secret.
5
+ * Throws when `secret` is empty, because an unsigned cookie would let anyone enable preview.
5
6
  */
6
- export declare function serializePreviewData(data: UniformPreviewData): string;
7
+ export declare function serializePreviewData(data: UniformPreviewData, secret: string): Promise<string>;
7
8
  /**
8
- * Deserializes preview data from a cookie value.
9
+ * Verifies a signed preview cookie value and returns its preview data.
10
+ * Returns null when `secret` is empty, the value is malformed, or the signature does not match.
9
11
  */
10
- export declare function deserializePreviewData(value: string): UniformPreviewData | null;
12
+ export declare function deserializePreviewData(value: string, secret: string): Promise<UniformPreviewData | null>;
11
13
  /**
12
- * Gets preview data from cookies.
14
+ * Reads the preview cookie and returns its preview data if the signature matches `secret`, otherwise null.
13
15
  */
14
- export declare function getPreviewData(cookies: Cookies): UniformPreviewData | null;
16
+ export declare function getPreviewData(cookies: Cookies, secret: string): Promise<UniformPreviewData | null>;
15
17
  /**
16
- * Sets preview data in cookies.
18
+ * Sets the preview cookie, signed with `secret`. Throws when `secret` is empty.
17
19
  *
18
20
  * @param cookies - SvelteKit Cookies object
19
21
  * @param data - Preview data to set
22
+ * @param secret - The preview secret used to sign the cookie
20
23
  * @param options - Cookie options
21
24
  */
22
- export declare function setPreviewData(cookies: Cookies, data: UniformPreviewData, options?: {
25
+ export declare function setPreviewData(cookies: Cookies, data: UniformPreviewData, secret: string, options?: {
23
26
  /** Max age in seconds. For contextual editing, use a short value (10s). */
24
27
  maxAge?: number;
25
- }): void;
28
+ }): Promise<void>;
26
29
  /**
27
30
  * Clears preview data from cookies.
28
31
  */
29
32
  export declare function clearPreviewData(cookies: Cookies): void;
30
33
  /**
31
- * Checks if preview mode is active.
34
+ * Returns true when the request carries a preview cookie signed with `secret`.
32
35
  */
33
- export declare function isPreviewMode(cookies: Cookies): boolean;
36
+ export declare function isPreviewMode(cookies: Cookies, secret: string): Promise<boolean>;
@@ -1,41 +1,83 @@
1
1
  import { UNIFORM_PREVIEW_COOKIE_NAME } from '../models.js';
2
+ const encoder = new TextEncoder();
3
+ const decoder = new TextDecoder();
4
+ function toBase64Url(bytes) {
5
+ let binary = '';
6
+ for (const byte of bytes) {
7
+ binary += String.fromCharCode(byte);
8
+ }
9
+ return btoa(binary).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
10
+ }
11
+ function fromBase64Url(value) {
12
+ const binary = atob(value.replace(/-/g, '+').replace(/_/g, '/'));
13
+ return Uint8Array.from(binary, (char) => char.charCodeAt(0));
14
+ }
2
15
  /**
3
- * Serializes preview data to a cookie value.
16
+ * Imports the preview secret as an HMAC-SHA256 key. Web Crypto keeps this usable on edge runtimes.
4
17
  */
5
- export function serializePreviewData(data) {
6
- return Buffer.from(JSON.stringify(data)).toString('base64');
18
+ function importSigningKey(secret) {
19
+ return crypto.subtle.importKey('raw', encoder.encode(secret), { name: 'HMAC', hash: 'SHA-256' }, false, [
20
+ 'sign',
21
+ 'verify',
22
+ ]);
7
23
  }
8
24
  /**
9
- * Deserializes preview data from a cookie value.
25
+ * Serializes preview data to a cookie value signed with the preview secret.
26
+ * Throws when `secret` is empty, because an unsigned cookie would let anyone enable preview.
10
27
  */
11
- export function deserializePreviewData(value) {
28
+ export async function serializePreviewData(data, secret) {
29
+ if (!secret) {
30
+ throw new Error('A preview secret is required to sign the Uniform preview cookie.');
31
+ }
32
+ const payload = toBase64Url(encoder.encode(JSON.stringify(data)));
33
+ const key = await importSigningKey(secret);
34
+ const signature = await crypto.subtle.sign('HMAC', key, encoder.encode(payload));
35
+ return `${payload}.${toBase64Url(new Uint8Array(signature))}`;
36
+ }
37
+ /**
38
+ * Verifies a signed preview cookie value and returns its preview data.
39
+ * Returns null when `secret` is empty, the value is malformed, or the signature does not match.
40
+ */
41
+ export async function deserializePreviewData(value, secret) {
42
+ if (!secret) {
43
+ return null;
44
+ }
45
+ const [payload, signature, ...rest] = value.split('.');
46
+ if (!payload || !signature || rest.length > 0) {
47
+ return null;
48
+ }
12
49
  try {
13
- const decoded = Buffer.from(value, 'base64').toString('utf-8');
14
- return JSON.parse(decoded);
50
+ const key = await importSigningKey(secret);
51
+ const isValid = await crypto.subtle.verify('HMAC', key, fromBase64Url(signature), encoder.encode(payload));
52
+ if (!isValid) {
53
+ return null;
54
+ }
55
+ return JSON.parse(decoder.decode(fromBase64Url(payload)));
15
56
  }
16
57
  catch {
17
58
  return null;
18
59
  }
19
60
  }
20
61
  /**
21
- * Gets preview data from cookies.
62
+ * Reads the preview cookie and returns its preview data if the signature matches `secret`, otherwise null.
22
63
  */
23
- export function getPreviewData(cookies) {
64
+ export async function getPreviewData(cookies, secret) {
24
65
  const cookie = cookies.get(UNIFORM_PREVIEW_COOKIE_NAME);
25
66
  if (!cookie) {
26
67
  return null;
27
68
  }
28
- return deserializePreviewData(cookie);
69
+ return deserializePreviewData(cookie, secret);
29
70
  }
30
71
  /**
31
- * Sets preview data in cookies.
72
+ * Sets the preview cookie, signed with `secret`. Throws when `secret` is empty.
32
73
  *
33
74
  * @param cookies - SvelteKit Cookies object
34
75
  * @param data - Preview data to set
76
+ * @param secret - The preview secret used to sign the cookie
35
77
  * @param options - Cookie options
36
78
  */
37
- export function setPreviewData(cookies, data, options) {
38
- const value = serializePreviewData(data);
79
+ export async function setPreviewData(cookies, data, secret, options) {
80
+ const value = await serializePreviewData(data, secret);
39
81
  cookies.set(UNIFORM_PREVIEW_COOKIE_NAME, value, {
40
82
  path: '/',
41
83
  httpOnly: true,
@@ -51,8 +93,8 @@ export function clearPreviewData(cookies) {
51
93
  cookies.delete(UNIFORM_PREVIEW_COOKIE_NAME, { path: '/' });
52
94
  }
53
95
  /**
54
- * Checks if preview mode is active.
96
+ * Returns true when the request carries a preview cookie signed with `secret`.
55
97
  */
56
- export function isPreviewMode(cookies) {
57
- return cookies.get(UNIFORM_PREVIEW_COOKIE_NAME) !== undefined;
98
+ export async function isPreviewMode(cookies, secret) {
99
+ return (await getPreviewData(cookies, secret)) !== null;
58
100
  }
@@ -4,8 +4,11 @@ import { type ResolveFullPath } from '../models.js';
4
4
  * Options for creating the preview GET handler.
5
5
  */
6
6
  export type CreatePreviewHandlerGetOptions = {
7
- /** Function that returns the preview secret. If set, requests must include matching secret. */
8
- secret?: () => string;
7
+ /**
8
+ * Returns the preview secret. Requests must include it, and it signs the preview cookie.
9
+ * When it returns an empty value, preview cannot be enabled.
10
+ */
11
+ secret: () => string | undefined;
9
12
  /**
10
13
  * Resolves the full path to redirect to.
11
14
  * Defaults to returning `path` if truthy, otherwise returns `slug`.
@@ -26,4 +29,4 @@ export type CreatePreviewHandlerGetOptions = {
26
29
  * playgroundPath: '/playground',
27
30
  * });
28
31
  */
29
- export declare function createPreviewHandlerGet(options?: CreatePreviewHandlerGetOptions): RequestHandler;
32
+ export declare function createPreviewHandlerGet(options: CreatePreviewHandlerGetOptions): RequestHandler;
@@ -35,7 +35,7 @@ function validateLocalRedirectUrl(pathToRedirectTo) {
35
35
  * });
36
36
  */
37
37
  export function createPreviewHandlerGet(options) {
38
- const { secret, resolveFullPath = resolveFullPathDefault, playgroundPath } = options ?? {};
38
+ const { secret, resolveFullPath = resolveFullPathDefault, playgroundPath } = options;
39
39
  return async ({ url, cookies, request }) => {
40
40
  const searchParams = url.searchParams;
41
41
  // Config check endpoint
@@ -76,6 +76,7 @@ export function createPreviewHandlerGet(options) {
76
76
  const slug = searchParams.get(compositionQueryParams.slug) ?? undefined;
77
77
  const path = searchParams.get(compositionQueryParams.path) ?? undefined;
78
78
  const locale = searchParams.get(compositionQueryParams.locale) ?? undefined;
79
+ const releaseId = searchParams.get('releaseId') || undefined;
79
80
  if (typeof pathToRedirectTo === 'undefined') {
80
81
  pathToRedirectTo = resolveFullPath({ id, slug, path, locale });
81
82
  }
@@ -88,10 +89,13 @@ export function createPreviewHandlerGet(options) {
88
89
  clearPreviewData(cookies);
89
90
  redirect(307, pathToRedirectTo);
90
91
  }
91
- // Validate secret if configured
92
- const previewSecret = typeof secret === 'function' ? secret() : secret;
93
- const isUsingPreviewSecret = Boolean(previewSecret);
94
- if (isUsingPreviewSecret && searchParams.get(SECRET_QUERY_STRING_PARAM) !== previewSecret) {
92
+ const previewSecret = secret();
93
+ if (!previewSecret) {
94
+ // eslint-disable-next-line no-console
95
+ console.warn('[canvas-sveltekit] Preview was requested, but no preview secret is configured.');
96
+ error(401, 'Preview is not configured');
97
+ }
98
+ if (searchParams.get(SECRET_QUERY_STRING_PARAM) !== previewSecret) {
95
99
  error(401, 'Invalid token');
96
100
  }
97
101
  // Check if this is valid contextual editing
@@ -104,12 +108,13 @@ export function createPreviewHandlerGet(options) {
104
108
  compositionSlug: slug,
105
109
  compositionPath: path,
106
110
  locale,
111
+ releaseId,
107
112
  isPlayground,
108
113
  patternType: !isPlayground
109
114
  ? undefined
110
115
  : searchParams.get('patternType'),
111
116
  };
112
- setPreviewData(cookies, previewData, {
117
+ await setPreviewData(cookies, previewData, previewSecret, {
113
118
  // Short max age for contextual editing to avoid stale preview state
114
119
  maxAge: isUniformContextualEditing ? 10 : undefined,
115
120
  });
@@ -4,8 +4,11 @@ import { type RootComponentInstance } from '@uniformdev/canvas';
4
4
  * Options for creating the preview POST handler.
5
5
  */
6
6
  export type CreatePreviewHandlerPostOptions = {
7
- /** Function that returns the preview secret for hash validation. */
8
- secret?: () => string;
7
+ /**
8
+ * Returns the preview secret that validates the composition hash.
9
+ * When it returns an empty value, every request is rejected.
10
+ */
11
+ secret: () => string | undefined;
9
12
  /** Function to enhance the composition after receiving it. */
10
13
  enhance?: (composition: RootComponentInstance, context: {
11
14
  event: RequestEvent;
@@ -26,4 +29,4 @@ export type CreatePreviewHandlerPostOptions = {
26
29
  * },
27
30
  * });
28
31
  */
29
- export declare function createPreviewHandlerPost(options?: CreatePreviewHandlerPostOptions): RequestHandler;
32
+ export declare function createPreviewHandlerPost(options: CreatePreviewHandlerPostOptions): RequestHandler;
@@ -16,26 +16,15 @@ import { generateHash } from '@uniformdev/canvas';
16
16
  * });
17
17
  */
18
18
  export function createPreviewHandlerPost(options) {
19
- const { secret, enhance } = options ?? {};
19
+ const { secret, enhance } = options;
20
20
  return async (event) => {
21
21
  const body = (await event.request.json());
22
22
  const { composition, hash } = body;
23
23
  if (!composition) {
24
24
  error(422, 'Missing "composition" parameter');
25
25
  }
26
- const previewSecret = typeof secret === 'function' ? secret() : secret;
27
- const hasProvidedHash = Boolean(hash);
28
- const hasConfiguredHash = Boolean(previewSecret);
29
- if (hasProvidedHash && hasConfiguredHash) {
30
- const calculatedHash = generateHash({
31
- composition,
32
- secret: previewSecret,
33
- });
34
- if (calculatedHash !== hash) {
35
- error(401, 'Not authorized');
36
- }
37
- }
38
- else if (hasConfiguredHash) {
26
+ const previewSecret = secret();
27
+ if (!previewSecret || !hash || generateHash({ composition, secret: previewSecret }) !== hash) {
39
28
  error(401, 'Not authorized');
40
29
  }
41
30
  await enhance?.(composition, { event });
@@ -13,6 +13,8 @@ export declare function createRouteFetcher<TContext, TResult, TSuccessResult>(op
13
13
  resolvedUrl: string;
14
14
  /** Default state (draft/published) for fetching */
15
15
  defaultFetchState?: number | undefined;
16
+ /** The release from the verified preview cookie, used when request options do not set one */
17
+ previewReleaseId?: string;
16
18
  };
17
19
  defaultHandleNotFound: NonNullable<typeof options.handleNotFound>;
18
20
  defaultHandleComposition: NonNullable<typeof options.handleComposition>;
@@ -15,7 +15,7 @@ export function createRouteFetcher(options) {
15
15
  });
16
16
  const handleModifyPath = modifyPath ?? ((path) => decodeURI(path));
17
17
  return async function fetcher(context) {
18
- const { contextualEditingCompositionId, contextualEditingPath, resolvedUrl, defaultFetchState: defaultPreviewState, } = parseContext(context);
18
+ const { contextualEditingCompositionId, contextualEditingPath, resolvedUrl, defaultFetchState: defaultPreviewState, previewReleaseId, } = parseContext(context);
19
19
  let nodePath = prefix ? resolvedUrl.replace(new RegExp(`^${prefix}`), '') : resolvedUrl;
20
20
  nodePath = handleModifyPath(nodePath, context);
21
21
  const invokeRedirectResult = (redirect, duration) => (handleRedirect ?? defaultHandleRedirect)(nodePath, redirect, context, (response) => defaultHandleRedirect(nodePath, response, context, () => {
@@ -58,6 +58,7 @@ export function createRouteFetcher(options) {
58
58
  dataSourceVariant: getDataSourceVariantFromRouteGetParams(resolvedOptions ?? {}, defaultPreviewState),
59
59
  projectMapId: projectMapId,
60
60
  path: nodePath,
61
+ releaseId: resolvedOptions?.releaseId ?? previewReleaseId,
61
62
  });
62
63
  const duration = Date.now() - time;
63
64
  if (!silent) {
@@ -2,6 +2,7 @@ import type { ServerLoadEvent } from '@sveltejs/kit';
2
2
  import type { CreateUniformLoadOptions, UniformLoadFoundResult, UniformLoadResult } from './types.js';
3
3
  /**
4
4
  * Creates a SvelteKit load function that fetches compositions from the Uniform Route API.
5
+ * Fetches draft content when `createUniformHandle` has verified a preview cookie for the request.
5
6
  *
6
7
  * @example
7
8
  * // In +page.server.ts
@@ -2,7 +2,6 @@ import { error, redirect } from '@sveltejs/kit';
2
2
  import { CANVAS_DRAFT_STATE } from '@uniformdev/canvas';
3
3
  import { getTargetVariableExpandedUrl } from '@uniformdev/redirect';
4
4
  import { resolvePathFromParams } from '../helpers/resolvePathFromParams.js';
5
- import { getPreviewData } from '../preview/previewCookie.js';
6
5
  import { createRouteFetcher } from './createRouteFetcher.js';
7
6
  export function createUniformLoad(options) {
8
7
  const defaultHandleRedirect = (requestUrl, matched, event) => {
@@ -32,7 +31,7 @@ export function createUniformLoad(options) {
32
31
  defaultHandleNotFound,
33
32
  defaultHandleRedirect,
34
33
  parseContext(event) {
35
- const previewData = getPreviewData(event.cookies);
34
+ const previewData = event.locals.uniformPreview;
36
35
  return {
37
36
  contextualEditingCompositionId: previewData?.isUniformContextualEditing
38
37
  ? previewData?.compositionId
@@ -46,6 +45,7 @@ export function createUniformLoad(options) {
46
45
  }),
47
46
  // Auto-engage draft content when in preview mode
48
47
  defaultFetchState: previewData ? CANVAS_DRAFT_STATE : undefined,
48
+ previewReleaseId: previewData?.releaseId,
49
49
  };
50
50
  },
51
51
  });
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-sveltekit",
3
- "version": "20.48.1-alpha.33.sha-eb3f272086",
3
+ "version": "20.81.1-alpha.53.sha-78fe06af4f",
4
4
  "description": "SvelteKit SDK for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "scripts": {
7
7
  "dev": "vite dev",
8
- "build": "vite build && npm run prepack",
9
- "preview": "vite preview",
10
- "prepare": "svelte-kit sync || echo ''",
11
- "prepack": "svelte-kit sync && svelte-package && publint",
8
+ "build": "svelte-kit sync && svelte-package && publint",
12
9
  "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
10
+ "lint": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
11
+ "test": "svelte-kit sync && vitest run",
13
12
  "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
14
13
  },
15
14
  "files": [
16
15
  "dist",
17
16
  "!dist/**/*.test.*",
18
- "!dist/**/*.spec.*"
17
+ "!dist/**/*.spec.*",
18
+ "!dist/**/__tests__/**"
19
19
  ],
20
20
  "sideEffects": [
21
21
  "**/*.css"
@@ -48,27 +48,24 @@
48
48
  }
49
49
  },
50
50
  "dependencies": {
51
- "@uniformdev/canvas": "20.48.1-alpha.33.sha-eb3f272086",
52
- "@uniformdev/canvas-svelte": "20.48.1-alpha.33.sha-eb3f272086",
53
- "@uniformdev/context": "20.48.1-alpha.33.sha-eb3f272086",
54
- "@uniformdev/project-map": "20.48.1-alpha.33.sha-eb3f272086",
55
- "@uniformdev/redirect": "20.48.1-alpha.33.sha-eb3f272086",
56
- "@uniformdev/richtext": "20.48.1-alpha.33.sha-eb3f272086",
57
- "colorette": "2.0.20",
58
- "uuid": "^13.0.0"
51
+ "@uniformdev/canvas": "20.81.1-alpha.53.sha-78fe06af4f",
52
+ "@uniformdev/canvas-svelte": "20.81.1-alpha.53.sha-78fe06af4f",
53
+ "@uniformdev/project-map": "20.81.1-alpha.53.sha-78fe06af4f",
54
+ "@uniformdev/redirect": "20.81.1-alpha.53.sha-78fe06af4f",
55
+ "colorette": "2.0.20"
59
56
  },
60
57
  "devDependencies": {
61
- "@sveltejs/adapter-auto": "^8.0.0",
62
- "@sveltejs/adapter-vercel": "^7.0.1",
63
- "@sveltejs/kit": "^3.1.0",
64
- "@sveltejs/package": "^3.0.1",
65
- "@sveltejs/vite-plugin-svelte": "^7.3.1",
66
- "@uniformdev/context-edge": "20.48.1-alpha.33.sha-eb3f272086",
67
- "publint": "^0.3.15",
68
- "svelte": "^5.57.3",
69
- "svelte-check": "^4.7.7",
58
+ "@sveltejs/adapter-auto": "8.0.0",
59
+ "@sveltejs/adapter-vercel": "7.0.1",
60
+ "@sveltejs/kit": "3.1.0",
61
+ "@sveltejs/package": "3.0.1",
62
+ "@sveltejs/vite-plugin-svelte": "7.3.1",
63
+ "@uniformdev/context-edge": "20.81.1-alpha.53.sha-78fe06af4f",
64
+ "publint": "0.3.25",
65
+ "svelte": "5.57.3",
66
+ "svelte-check": "4.7.7",
70
67
  "typescript": "6.0.3",
71
- "vite": "^8.3.5"
68
+ "vite": "8.3.5"
72
69
  },
73
70
  "keywords": [
74
71
  "svelte",
@@ -79,5 +76,5 @@
79
76
  "publishConfig": {
80
77
  "access": "public"
81
78
  },
82
- "gitHead": "eb3f2720868747479af048c5aa8fb28df7b01936"
79
+ "gitHead": "78fe06af4f6478090dd1383cc3511961c46de0e9"
83
80
  }