@primate/svelte 0.18.3 → 0.20.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.
Files changed (49) hide show
  1. package/lib/private/Default.d.ts +17 -0
  2. package/lib/private/Default.js +20 -0
  3. package/lib/private/Runtime.d.ts +11 -0
  4. package/lib/private/Runtime.js +13 -0
  5. package/lib/private/client/ValidateState.d.ts +8 -0
  6. package/lib/private/client/ValidateState.js +2 -0
  7. package/lib/private/client/Validated.d.ts +8 -0
  8. package/lib/private/client/Validated.js +2 -0
  9. package/lib/private/client/index.d.ts +11 -0
  10. package/lib/private/client/index.js +27 -0
  11. package/lib/private/client/validate.d.ts +25 -0
  12. package/lib/private/client/validate.js +28 -0
  13. package/lib/private/context-name.d.ts +3 -0
  14. package/lib/private/context-name.js +2 -0
  15. package/lib/private/create-root.d.ts +3 -0
  16. package/lib/private/create-root.js +49 -0
  17. package/lib/public/Validated.d.ts +2 -0
  18. package/lib/public/Validated.js +2 -0
  19. package/lib/public/browser.d.ts +2 -0
  20. package/lib/public/browser.js +2 -0
  21. package/lib/public/context-name.d.ts +2 -0
  22. package/{src → lib}/public/context-name.js +1 -0
  23. package/lib/public/default.d.ts +4 -0
  24. package/lib/public/default.js +3 -0
  25. package/lib/public/runtime.d.ts +4 -0
  26. package/lib/public/runtime.js +3 -0
  27. package/lib/public/validate.d.ts +2 -0
  28. package/lib/public/validate.js +2 -0
  29. package/package.json +25 -41
  30. package/src/private/build/client.js +0 -8
  31. package/src/private/build/index.js +0 -14
  32. package/src/private/build/publish.js +0 -40
  33. package/src/private/build/server.js +0 -6
  34. package/src/private/client/create-root.js +0 -31
  35. package/src/private/client/expose.js +0 -1
  36. package/src/private/client/index.js +0 -18
  37. package/src/private/client/spa.js +0 -14
  38. package/src/private/context-name.js +0 -1
  39. package/src/private/extension.js +0 -1
  40. package/src/private/i18n/index.js +0 -10
  41. package/src/private/i18n/locale.js +0 -19
  42. package/src/private/name.js +0 -1
  43. package/src/private/pkgname.js +0 -1
  44. package/src/private/serve/index.js +0 -16
  45. package/src/private/serve/render.js +0 -4
  46. package/src/public/default.js +0 -14
  47. package/src/public/i18n.js +0 -1
  48. package/src/public/locale.js +0 -1
  49. package/src/public/runtime.js +0 -12
@@ -0,0 +1,17 @@
1
+ import Runtime from "#Runtime";
2
+ export default class Default extends Runtime {
3
+ root: {
4
+ create: (depth: number, i18n_active: boolean) => string;
5
+ };
6
+ css: {
7
+ filter: RegExp;
8
+ };
9
+ compile: {
10
+ client: (text: string) => {
11
+ css: string;
12
+ js: string;
13
+ };
14
+ server: (text: string) => string;
15
+ };
16
+ }
17
+ //# sourceMappingURL=Default.d.ts.map
@@ -0,0 +1,20 @@
1
+ import create_root from "#create-root";
2
+ import Runtime from "#Runtime";
3
+ import { compile } from "svelte/compiler";
4
+ export default class Default extends Runtime {
5
+ root = {
6
+ create: create_root,
7
+ };
8
+ css = {
9
+ filter: /\.sveltecss$/,
10
+ };
11
+ compile = {
12
+ client: (text) => {
13
+ const accessors = true;
14
+ const { css, js } = compile(text, { accessors, generate: "client" });
15
+ return { css: css?.code ?? "", js: js.code };
16
+ },
17
+ server: (text) => compile(text, { generate: "server" }).js.code,
18
+ };
19
+ }
20
+ //# sourceMappingURL=Default.js.map
@@ -0,0 +1,11 @@
1
+ import FrontendModule from "@primate/core/frontend/Module";
2
+ import type Render from "@primate/core/frontend/Render";
3
+ import type { Component } from "svelte";
4
+ export default class Runtime extends FrontendModule<Component> {
5
+ name: string;
6
+ defaultExtensions: string[];
7
+ layouts: boolean;
8
+ client: boolean;
9
+ render: Render<Component>;
10
+ }
11
+ //# sourceMappingURL=Runtime.d.ts.map
@@ -0,0 +1,13 @@
1
+ import FrontendModule from "@primate/core/frontend/Module";
2
+ import { render } from "svelte/server";
3
+ export default class Runtime extends FrontendModule {
4
+ name = "svelte";
5
+ defaultExtensions = [".svelte"];
6
+ layouts = true;
7
+ client = true;
8
+ render = (view, props) => {
9
+ const { head, html } = render(view, { props: { p: { ...props } } });
10
+ return { body: html, head };
11
+ };
12
+ }
13
+ //# sourceMappingURL=Runtime.js.map
@@ -0,0 +1,8 @@
1
+ import type ValidationError from "@primate/core/client/ValidationError";
2
+ type ValidateState<T> = {
3
+ error: null | ValidationError;
4
+ loading: boolean;
5
+ value: T;
6
+ };
7
+ export type { ValidateState as default };
8
+ //# sourceMappingURL=ValidateState.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ValidateState.js.map
@@ -0,0 +1,8 @@
1
+ import type ValidateState from "#client/ValidateState";
2
+ import type ValidateUpdater from "@primate/core/client/ValidateUpdater";
3
+ import type { Readable } from "svelte/store";
4
+ type Validated<T> = {
5
+ update: (updater: ValidateUpdater<T>) => Promise<void>;
6
+ } & Readable<ValidateState<T>>;
7
+ export type { Validated as default };
8
+ //# sourceMappingURL=Validated.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Validated.js.map
@@ -0,0 +1,11 @@
1
+ import type ClientData from "@primate/core/client/Data";
2
+ import type Dict from "@rcompat/type/Dict";
3
+ type Data = ClientData<{
4
+ views: string[];
5
+ props: Dict[];
6
+ }>;
7
+ export default class SvelteClient {
8
+ static mount(_view: string, data: ClientData<Data>): void;
9
+ }
10
+ export {};
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,27 @@
1
+ import spa from "@primate/core/client/spa";
2
+ import { hydrate, mount } from "svelte";
3
+ import root from "svelte:root";
4
+ import * as views from "svelte:views";
5
+ const make_props = (data) => ({
6
+ views: data.views.map(name => views[name]),
7
+ props: data.props,
8
+ request: {
9
+ ...data.request,
10
+ url: new URL(location.href),
11
+ },
12
+ update: () => undefined,
13
+ });
14
+ export default class SvelteClient {
15
+ static mount(_view, data) {
16
+ const _root = (data.ssr ? hydrate : mount)(root, {
17
+ props: {
18
+ p: make_props(data),
19
+ },
20
+ target: document.body,
21
+ });
22
+ data.spa && window.addEventListener("DOMContentLoaded", () => spa((_data, update) => {
23
+ _root.p = { ...make_props(_data), update };
24
+ }));
25
+ }
26
+ }
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,25 @@
1
+ import type Validated from "#client/Validated";
2
+ declare const _default: <T>(initial: T) => {
3
+ delete: (url: string, options?: {
4
+ headers?: import("@rcompat/type/Dict").default<string>;
5
+ map?: ((v: T) => import("@rcompat/type/JSONValue").default) | undefined;
6
+ path?: import("@rcompat/type/JSONPointer").default;
7
+ } | undefined) => Validated<T>;
8
+ patch: (url: string, options?: {
9
+ headers?: import("@rcompat/type/Dict").default<string>;
10
+ map?: ((v: T) => import("@rcompat/type/JSONValue").default) | undefined;
11
+ path?: import("@rcompat/type/JSONPointer").default;
12
+ } | undefined) => Validated<T>;
13
+ post: (url: string, options?: {
14
+ headers?: import("@rcompat/type/Dict").default<string>;
15
+ map?: ((v: T) => import("@rcompat/type/JSONValue").default) | undefined;
16
+ path?: import("@rcompat/type/JSONPointer").default;
17
+ } | undefined) => Validated<T>;
18
+ put: (url: string, options?: {
19
+ headers?: import("@rcompat/type/Dict").default<string>;
20
+ map?: ((v: T) => import("@rcompat/type/JSONValue").default) | undefined;
21
+ path?: import("@rcompat/type/JSONPointer").default;
22
+ } | undefined) => Validated<T>;
23
+ };
24
+ export default _default;
25
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1,28 @@
1
+ import toValidated from "@primate/core/client/toValidated";
2
+ import validate from "@primate/core/client/validate";
3
+ import { get, writable } from "svelte/store";
4
+ function useValidate(init) {
5
+ const { set, subscribe, update } = writable({
6
+ error: null,
7
+ loading: false,
8
+ value: init.initial,
9
+ });
10
+ async function $update(updater) {
11
+ let previous;
12
+ update((s) => {
13
+ previous = s.value;
14
+ return { ...s, error: null, loading: true, value: updater(s.value) };
15
+ });
16
+ try {
17
+ await validate(init, get({ subscribe }).value);
18
+ update(s => ({ ...s, loading: false }));
19
+ }
20
+ catch (e) {
21
+ // rollback
22
+ set({ error: e, loading: false, value: previous });
23
+ }
24
+ }
25
+ return { subscribe, update: $update };
26
+ }
27
+ export default toValidated(useValidate);
28
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1,3 @@
1
+ declare const _default: "__PRMT__";
2
+ export default _default;
3
+ //# sourceMappingURL=context-name.d.ts.map
@@ -0,0 +1,2 @@
1
+ export default "__PRMT__";
2
+ //# sourceMappingURL=context-name.js.map
@@ -0,0 +1,3 @@
1
+ declare const _default: (depth: number, i18n_active: boolean) => string;
2
+ export default _default;
3
+ //# sourceMappingURL=create-root.d.ts.map
@@ -0,0 +1,49 @@
1
+ export default (depth, i18n_active) => {
2
+ const n = depth - 1;
3
+ const body = Array.from({ length: n }, (_, i) => i - 1)
4
+ .reduceRight((child, _, i) => `
5
+ {#if p.views[${i + 1}]}
6
+ <svelte:component this={p.views[${i}]} request={p.request} {...p.props[${i}]}>
7
+ ${child}
8
+ </svelte:component>
9
+ {:else}
10
+ <svelte:component this={p.views[${i}]} request={p.request} {...p.props[${i}]}/>
11
+ {/if}
12
+ `, `<svelte:component this={p.views[${n}]} request={p.request} {...p.props[${n}]}/>`);
13
+ const i18nImports = i18n_active
14
+ ? `
15
+ import t from "#i18n";
16
+ import sInternal from "primate/s/internal";
17
+ import { onMount } from "svelte";`
18
+ : "";
19
+ const i18nInit = i18n_active
20
+ ? `
21
+ const server = p.request.context.i18n.locale;
22
+ if (server !== undefined && server !== t.locale.get()) {
23
+ t[sInternal].init(server);
24
+ }
25
+
26
+ // after hydration: in storage modes, flip to saved locale once
27
+ onMount(() => { t[sInternal].restore(); });`
28
+ : "";
29
+ return `
30
+ <script>
31
+ import { afterUpdate, setContext } from "svelte";
32
+ import context_name from "@primate/svelte/context-name";
33
+ ${i18nImports}
34
+
35
+ export let p;
36
+
37
+ // expose full request context to children (unchanged)
38
+ setContext(context_name, p.request.context);
39
+
40
+ ${i18nInit}
41
+
42
+ // let the platform hook push heads after updates (unchanged)
43
+ afterUpdate(p.update);
44
+ </script>
45
+
46
+ ${body}
47
+ `;
48
+ };
49
+ //# sourceMappingURL=create-root.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "#client/Validated";
2
+ //# sourceMappingURL=Validated.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Validated.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "#client/index";
2
+ //# sourceMappingURL=browser.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "#client/index";
2
+ //# sourceMappingURL=browser.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "#context-name";
2
+ //# sourceMappingURL=context-name.d.ts.map
@@ -1 +1,2 @@
1
1
  export { default } from "#context-name";
2
+ //# sourceMappingURL=context-name.js.map
@@ -0,0 +1,4 @@
1
+ import Default from "#Default";
2
+ declare const _default: (options?: typeof Default.input) => Default;
3
+ export default _default;
4
+ //# sourceMappingURL=default.d.ts.map
@@ -0,0 +1,3 @@
1
+ import Default from "#Default";
2
+ export default (options) => new Default(options);
3
+ //# sourceMappingURL=default.js.map
@@ -0,0 +1,4 @@
1
+ import Runtime from "#Runtime";
2
+ declare const _default: (options?: typeof Runtime.input) => Runtime;
3
+ export default _default;
4
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1,3 @@
1
+ import Runtime from "#Runtime";
2
+ export default (options) => new Runtime(options);
3
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "#client/validate";
2
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "#client/validate";
2
+ //# sourceMappingURL=validate.js.map
package/package.json CHANGED
@@ -1,65 +1,49 @@
1
1
  {
2
2
  "name": "@primate/svelte",
3
- "version": "0.18.3",
3
+ "version": "0.20.0",
4
4
  "description": "Primate Svelte frontend",
5
- "homepage": "https://primatejs.com/modules/svelte",
6
- "bugs": "https://github.com/primatejs/primate/issues",
5
+ "homepage": "https://primate.run/docs/frontend/svelte",
6
+ "bugs": "https://github.com/primate-run/primate/issues",
7
7
  "license": "MIT",
8
8
  "files": [
9
- "src/**/*.js",
10
- "!src/**/*.spec.js"
9
+ "/lib/**/*.js",
10
+ "/lib/**/*.d.ts",
11
+ "!/**/*.spec.*"
11
12
  ],
12
13
  "repository": {
13
14
  "type": "git",
14
- "url": "https://github.com/primatejs/primate",
15
+ "url": "https://github.com/primate-run/primate",
15
16
  "directory": "packages/svelte"
16
17
  },
17
18
  "dependencies": {
18
- "@rcompat/fs": "^0.7.0",
19
- "@primate/frontend": "^0.16.3"
19
+ "@rcompat/fs": "^0.21.1",
20
+ "@primate/core": "^0.3.0"
20
21
  },
21
22
  "peerDependencies": {
22
- "svelte": "4",
23
- "@primate/i18n": "^0.8.3",
24
- "primate": "^0.32.5"
25
- },
26
- "peerDependenciesMeta": {
27
- "@primate/i18n": {
28
- "optional": true
29
- }
23
+ "svelte": "5",
24
+ "primate": "^0.34.0"
30
25
  },
31
26
  "type": "module",
32
27
  "imports": {
33
28
  "#*": {
34
- "livetypes": "./src/private/*.js",
35
- "default": "./src/private/*.js"
36
- },
37
- "#build": {
38
- "livetypes": "./src/private/build/index.js",
39
- "default": "./src/private/build/index.js"
40
- },
41
- "#serve": {
42
- "livetypes": "./src/private/serve/index.js",
43
- "default": "./src/private/serve/index.js"
44
- },
45
- "#client": {
46
- "livetypes": "./src/private/client/index.js",
47
- "default": "./src/private/client/index.js"
48
- },
49
- "#client/*": {
50
- "livetypes": "./src/private/client/*.js",
51
- "default": "./src/private/client/*.js"
52
- },
53
- "#i18n/*": {
54
- "livetypes": "./src/private/i18n/*.js",
55
- "default": "./src/private/i18n/*.js"
29
+ "apekit": "./src/private/*.ts",
30
+ "default": "./lib/private/*.js"
56
31
  }
57
32
  },
58
33
  "exports": {
59
34
  ".": {
60
- "runtime": "./src/public/runtime.js",
61
- "default": "./src/public/default.js"
35
+ "browser": "./lib/public/browser.js",
36
+ "runtime": "./lib/public/runtime.js",
37
+ "default": "./lib/public/default.js"
62
38
  },
63
- "./*": "./src/public/*.js"
39
+ "./*": {
40
+ "apekit": "./src/public/*.ts",
41
+ "default": "./lib/public/*.js"
42
+ }
43
+ },
44
+ "scripts": {
45
+ "build": "npm run clean && tsc",
46
+ "clean": "rm -rf ./lib",
47
+ "lint": "eslint ."
64
48
  }
65
49
  }
@@ -1,8 +0,0 @@
1
- import * as compiler from "svelte/compiler";
2
-
3
- export default text => {
4
- const options = { generate: "dom", hydratable: true };
5
- const { js, css } = compiler.compile(text, options);
6
- return { js: js.code, css: css.code };
7
- };
8
-
@@ -1,14 +0,0 @@
1
- import create_root from "#client/create-root";
2
- import expose from "#client/expose";
3
- import name from "#name";
4
- import build from "@primate/frontend/core/build";
5
- import client from "./client.js";
6
- import publish from "./publish.js";
7
- import server from "./server.js";
8
-
9
- export default extension => build({
10
- create_root,
11
- extension,
12
- name,
13
- actions: { compile: { client, server }, expose, publish },
14
- });
@@ -1,40 +0,0 @@
1
- import file from "@rcompat/fs/file";
2
- import webpath from "@rcompat/fs/webpath";
3
- import client from "./client.js";
4
-
5
- const css_filter = /\.sveltecss$/u;
6
- const root_filter = /^root:svelte$/u;
7
-
8
- export default (app, extension) => ({
9
- name: "svelte",
10
- setup(build) {
11
- build.onResolve({ filter: css_filter }, ({ path }) => {
12
- return { path, namespace: "sveltecss" };
13
- });
14
- build.onResolve({ filter: root_filter }, ({ path }) => {
15
- return { path, namespace: "svelteroot" };
16
- });
17
- build.onLoad({ filter: css_filter }, ({ path }) => {
18
- const contents = app.build.load(webpath(path));
19
- return contents ? { contents, loader: "css", resolveDir: app.root.path } : null;
20
- });
21
- build.onLoad({ filter: root_filter }, ({ path }) => {
22
- const contents = app.build.load(path);
23
- return contents ? { contents, loader: "js", resolveDir: app.root.path } : null;
24
- });
25
- build.onLoad({ filter: new RegExp(`${extension}$`, "u") }, async args => {
26
- // Load the file from the file system
27
- const source = await file(args.path).text();
28
-
29
- // Convert Svelte syntax to JavaScript
30
- const { js, css } = client(source);
31
- let contents = js;
32
- if (css !== null && css !== "") {
33
- const path = webpath(`${args.path}css`);
34
- app.build.save(path, css);
35
- contents += `\nimport "${path}";`;
36
- }
37
- return { contents };
38
- });
39
- },
40
- });
@@ -1,6 +0,0 @@
1
- import * as compiler from "svelte/compiler";
2
-
3
- export default text => {
4
- const options = { generate: "ssr", hydratable: true };
5
- return compiler.compile(text, options).js.code;
6
- };
@@ -1,31 +0,0 @@
1
- export default length => {
2
- const n = length - 1;
3
- const body = Array.from({ length: n }, (_, i) => i - 1)
4
- .reduceRight((child, _, i) => `
5
- {#if components[${i + 1}]}
6
- <svelte:component this={components[${i}]} {request} {...data[${i}]}>
7
- ${child}
8
- </svelte:component>
9
- {:else}
10
- <svelte:component this={components[${i}]} {request} {...data[${i}]}/>
11
- {/if}
12
- `, `<svelte:component this={components[${n}]} {request} {...data[${n}]}/>`);
13
-
14
- return `
15
- <script>
16
- import { afterUpdate, setContext } from "svelte";
17
- import context_name from "@primate/svelte/context-name";
18
-
19
- export let components;
20
- export let data;
21
- export let request;
22
- export let context;
23
- export let update = () => undefined;
24
-
25
- setContext(context_name, context);
26
-
27
- afterUpdate(update);
28
- </script>
29
- ${body}
30
- `;
31
- };
@@ -1 +0,0 @@
1
- export default "export { setContext } from \"svelte\";";
@@ -1,18 +0,0 @@
1
- import spa from "./spa.js";
2
-
3
- export default ({ names, data, context, request }, options) => `
4
- import * as components from "app";
5
- let root = new components.root_svelte({
6
- target: document.body,
7
- hydrate: true,
8
- props: {
9
- components: [${names.map(name => `components.${name}`).join(", ")}],
10
- data: ${JSON.stringify(data)},
11
- context: ${JSON.stringify(context)},
12
- request: {
13
- ...${JSON.stringify(request)},
14
- url: new URL(location.href),
15
- },
16
- },
17
- });
18
- ${options.spa ? spa : ""}`;
@@ -1,14 +0,0 @@
1
- export default `
2
- const { spa } = components;
3
- window.addEventListener("DOMContentLoaded", _ => spa((props, update) => {
4
- root.$set({
5
- components: props.names.map(name => components[name]),
6
- data: props.data,
7
- context: props.context,
8
- request: {
9
- ...props.request,
10
- url: new URL(location.href),
11
- },
12
- update,
13
- });
14
- }));`;
@@ -1 +0,0 @@
1
- export default "__PRMT__";
@@ -1 +0,0 @@
1
- export default ".svelte";
@@ -1,10 +0,0 @@
1
- import context_name from "#context-name";
2
- import locale_store from "#i18n/locale";
3
- import resolve from "@primate/i18n/core/resolve";
4
- import { getContext } from "svelte";
5
- import { derived } from "svelte/store";
6
-
7
- export default derived(locale_store, locale => (key, placeholders) => {
8
- const { locales } = getContext(context_name).i18n;
9
- return resolve(locales[locale], key, placeholders);
10
- });
@@ -1,19 +0,0 @@
1
- import context_name from "#context-name";
2
- import save from "@primate/i18n/core/save";
3
- import { getContext } from "svelte";
4
- import { writable } from "svelte/store";
5
-
6
- const store = writable("", set => {
7
- const { locale } = getContext(context_name).i18n;
8
- set(locale);
9
-
10
- return () => undefined;
11
- });
12
-
13
- export default {
14
- subscribe: store.subscribe,
15
- set: locale => {
16
- store.set(locale);
17
- save(locale);
18
- },
19
- };
@@ -1 +0,0 @@
1
- export default "svelte";
@@ -1 +0,0 @@
1
- export default "@primate/svelte";
@@ -1,16 +0,0 @@
1
- import client from "#client";
2
- import name from "#name";
3
- import handler from "@primate/frontend/core/handler";
4
- import render from "./render.js";
5
-
6
- export default (extension, spa) => (app, next) => {
7
- app.register(extension, handler({
8
- app,
9
- render,
10
- client,
11
- name,
12
- spa,
13
- }));
14
-
15
- return next(app);
16
- };
@@ -1,4 +0,0 @@
1
- export default (component, ...args) => {
2
- const { html, head } = component.render(...args);
3
- return { body: html, head };
4
- };
@@ -1,14 +0,0 @@
1
- import build from "#build";
2
- import default_extension from "#extension";
3
- import pkgname from "#pkgname";
4
- import serve from "#serve";
5
-
6
- export default ({
7
- extension = default_extension,
8
- // activate fetch-based browsing
9
- spa = true,
10
- } = {}) => ({
11
- name: pkgname,
12
- build: build(extension),
13
- serve: serve(extension, spa),
14
- });
@@ -1 +0,0 @@
1
- export { default } from "#i18n/index";
@@ -1 +0,0 @@
1
- export { default } from "#i18n/locale";
@@ -1,12 +0,0 @@
1
- import default_extension from "#extension";
2
- import pkgname from "#pkgname";
3
- import serve from "#serve";
4
-
5
- export default ({
6
- extension = default_extension,
7
- // activate fetch-based browsing
8
- spa = true,
9
- } = {}) => ({
10
- name: pkgname,
11
- serve: serve(extension, spa),
12
- });