@forgebook/sveltekit 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +145 -2
- package/dist/src/app/env.d.ts +8 -0
- package/dist/src/app/env.js +15 -0
- package/dist/src/app/forms.d.ts +68 -0
- package/dist/src/app/forms.js +125 -0
- package/dist/src/app/manifest.d.ts +21 -0
- package/dist/src/app/manifest.js +17 -0
- package/dist/src/app/navigation.d.ts +97 -0
- package/dist/src/app/navigation.js +147 -0
- package/dist/src/app/paths.d.ts +32 -0
- package/dist/src/app/paths.js +56 -0
- package/dist/src/app/state.d.ts +27 -0
- package/dist/src/app/state.js +60 -0
- package/dist/src/app/stores.d.ts +31 -0
- package/dist/src/app/stores.js +36 -0
- package/dist/src/appSettings.d.ts +44 -0
- package/dist/src/appSettings.js +55 -0
- package/dist/src/kitParameters.d.ts +272 -0
- package/dist/src/kitParameters.js +291 -0
- package/dist/src/kitRenderer.d.ts +3 -0
- package/dist/src/kitRenderer.js +254 -0
- package/dist/src/kitStore.d.ts +90 -0
- package/dist/src/kitStore.js +301 -0
- package/dist/src/mountFrame.d.ts +14 -0
- package/dist/src/mountFrame.js +15 -0
- package/dist/src/routeIds.d.ts +44 -0
- package/dist/src/routeIds.js +150 -0
- package/dist/src/routeOrder.d.ts +18 -0
- package/dist/src/routeOrder.js +187 -0
- package/dist/src/stories.d.ts +48 -0
- package/dist/src/stories.js +11 -0
- package/dist/src/storyCode.d.ts +3 -0
- package/dist/src/storyCode.js +9 -0
- package/dist/src/storyPage.d.ts +35 -0
- package/dist/src/storyPage.js +19 -0
- package/dist/src/vite/envModules.d.ts +67 -0
- package/dist/src/vite/envModules.js +181 -0
- package/dist/src/vite/extractDocs.d.ts +14 -0
- package/dist/src/vite/extractDocs.js +20 -0
- package/dist/src/vite/kitPlugin.d.ts +28 -0
- package/dist/src/vite/kitPlugin.js +241 -0
- package/dist/src/vite/kitProject.d.ts +27 -0
- package/dist/src/vite/kitProject.js +176 -0
- package/dist/src/vite/projectFiles.d.ts +14 -0
- package/dist/src/vite/projectFiles.js +70 -0
- package/dist/src/vite/sveltekit.d.ts +26 -0
- package/dist/src/vite/sveltekit.js +39 -0
- package/package.json +113 -3
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* A SvelteKit project, as the catalogue reads it: SvelteKit's options, from the project's own Vite configuration
|
|
11
|
+
* (SvelteKit 3 keeps them there) or from `svelte.config.js` (SvelteKit 2), and the project's other Vite plugins.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* The project's `vite.config` is loaded, not run as a server: SvelteKit's plugin, made there, holds the options it read
|
|
15
|
+
* and checked (`api.options`), whichever version wrote them, so the catalogue reads what SvelteKit itself does. Its own
|
|
16
|
+
* plugins are left out, since they build an app; the project's other plugins (Tailwind CSS, an i18n compiler) are kept,
|
|
17
|
+
* so its components are drawn as the app draws them.
|
|
18
|
+
*
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
21
|
+
import { existsSync } from "node:fs";
|
|
22
|
+
import { join, resolve } from "node:path";
|
|
23
|
+
import { pathToFileURL } from "node:url";
|
|
24
|
+
import { loadConfigFromFile } from "vite";
|
|
25
|
+
/** SvelteKit's plugin that holds the options it read. */
|
|
26
|
+
const SETUP_PLUGIN = "vite-plugin-sveltekit-setup";
|
|
27
|
+
/**
|
|
28
|
+
* The plugins SvelteKit's `sveltekit()` makes: its own (any whose name says SvelteKit, so one it adds later is left out
|
|
29
|
+
* too, its environment's among them), and Svelte's, which the catalogue makes itself.
|
|
30
|
+
*/
|
|
31
|
+
const KIT_PLUGIN = /sveltekit|^vite-plugin-svelte([-:]|$)/;
|
|
32
|
+
/** The names `svelte.config` may have, in the order SvelteKit 2 looks for them. */
|
|
33
|
+
const SVELTE_CONFIGS = ["svelte.config.js", "svelte.config.mjs", "svelte.config.ts", "svelte.config.mts"];
|
|
34
|
+
/** The options of Svelte's Vite plugin read from SvelteKit's. */
|
|
35
|
+
const SVELTE_KEYS = ["preprocess", "compilerOptions", "extensions"];
|
|
36
|
+
/** Whether a value is a plain object. */
|
|
37
|
+
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
38
|
+
/** Whether a value is one of Vite's plugins. */
|
|
39
|
+
const isPlugin = (value) => isRecord(value) && typeof value["name"] === "string";
|
|
40
|
+
/**
|
|
41
|
+
* A configuration's plugins as one list: Vite takes nested lists and promises of plugins.
|
|
42
|
+
*
|
|
43
|
+
* @param plugins - the plugins, as the configuration writes them.
|
|
44
|
+
*/
|
|
45
|
+
const flatPlugins = async (plugins) => {
|
|
46
|
+
const value = await plugins;
|
|
47
|
+
if (Array.isArray(value))
|
|
48
|
+
return (await Promise.all(value.map(flatPlugins))).flat();
|
|
49
|
+
return isPlugin(value) ? [value] : [];
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* SvelteKit's options held by its setup plugin.
|
|
53
|
+
*
|
|
54
|
+
* @param plugins - the project's plugins.
|
|
55
|
+
*/
|
|
56
|
+
const setupOptions = (plugins) => {
|
|
57
|
+
const setup = plugins.find((plugin) => plugin.name === SETUP_PLUGIN);
|
|
58
|
+
const api = setup?.api;
|
|
59
|
+
return isRecord(api) && isRecord(api["options"]) ? api["options"] : undefined;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* The options of Svelte's Vite plugin a SvelteKit configuration gives, read as they are: Svelte's plugin reads no
|
|
63
|
+
* `svelte.config.js` then, since the configuration was it.
|
|
64
|
+
*
|
|
65
|
+
* @param options - SvelteKit's options, or `svelte.config.js`'s default export.
|
|
66
|
+
*/
|
|
67
|
+
const svelteOptionsOf = (options) => ({
|
|
68
|
+
configFile: false,
|
|
69
|
+
...Object.fromEntries(SVELTE_KEYS.filter((key) => options[key] !== undefined).map((key) => [key, options[key]]))
|
|
70
|
+
});
|
|
71
|
+
/**
|
|
72
|
+
* SvelteKit's options from a SvelteKit 2 `svelte.config.js`, loaded as Node loads a module.
|
|
73
|
+
*
|
|
74
|
+
* @param dir - the project's folder.
|
|
75
|
+
*/
|
|
76
|
+
const svelteConfigOptions = async (dir) => {
|
|
77
|
+
const file = SVELTE_CONFIGS.map((name) => join(dir, name)).find((path) => existsSync(path));
|
|
78
|
+
if (file === undefined)
|
|
79
|
+
return { kit: {}, config: {}, problem: undefined };
|
|
80
|
+
try {
|
|
81
|
+
const loaded = await import(__rewriteRelativeImportExtension(pathToFileURL(file).href));
|
|
82
|
+
const config = isRecord(loaded) && isRecord(loaded["default"]) ? loaded["default"] : {};
|
|
83
|
+
return { kit: isRecord(config["kit"]) ? config["kit"] : {}, config, problem: undefined };
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
return {
|
|
87
|
+
kit: {},
|
|
88
|
+
config: {},
|
|
89
|
+
problem: `${file} could not be loaded: ${error instanceof Error ? error.message : String(error)}`
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* The extensions of a project's Svelte components, from Svelte's options: `.svelte` by default.
|
|
95
|
+
*
|
|
96
|
+
* @param options - SvelteKit's options, or `svelte.config.js`'s default export.
|
|
97
|
+
*/
|
|
98
|
+
const extensionsOf = (options) => {
|
|
99
|
+
const { extensions } = options;
|
|
100
|
+
const listed = Array.isArray(extensions) ? extensions.filter((item) => typeof item === "string") : [];
|
|
101
|
+
return listed.length === 0 ? [".svelte"] : listed;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* What is wrong with a SvelteKit 3 project `svelte-kit sync` has not run in: its `tsconfig.json` extends
|
|
105
|
+
* `$app/tsconfig`, which the command writes, so every module of the catalogue fails to compile without it.
|
|
106
|
+
*
|
|
107
|
+
* @param root - the project's folder.
|
|
108
|
+
* @param version - SvelteKit's major version.
|
|
109
|
+
* @param problem - what was found wrong before.
|
|
110
|
+
*/
|
|
111
|
+
const syncedProblem = (root, version, problem) => {
|
|
112
|
+
const isSynced = version === 2 || existsSync(join(root, "node_modules", "$app", "tsconfig.json"));
|
|
113
|
+
return {
|
|
114
|
+
problem: problem ??
|
|
115
|
+
(isSynced
|
|
116
|
+
? undefined
|
|
117
|
+
: "SvelteKit has not written its types: run `svelte-kit sync` first (SvelteKit's templates run it on install, as `prepare`), since the project's tsconfig.json extends $app/tsconfig")
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* The plugins a project's Vite configuration writes, loaded as `vite dev` loads it.
|
|
122
|
+
*
|
|
123
|
+
* @param root - the project's folder.
|
|
124
|
+
* @param viteConfig - the configuration, from the folder; the one Vite would find by default; `false` reads none.
|
|
125
|
+
* @returns the plugins as written, and why the configuration could not be loaded.
|
|
126
|
+
*/
|
|
127
|
+
const viteConfigPlugins = async (root, viteConfig) => {
|
|
128
|
+
if (viteConfig === false)
|
|
129
|
+
return { plugins: [], problem: undefined };
|
|
130
|
+
try {
|
|
131
|
+
const loaded = await loadConfigFromFile({ command: "serve", mode: "development" }, viteConfig === undefined ? undefined : resolve(root, viteConfig), root, "silent");
|
|
132
|
+
return { plugins: loaded?.config.plugins, problem: undefined };
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
136
|
+
return { plugins: [], problem: `The project's Vite configuration could not be loaded: ${reason}` };
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Reads a SvelteKit project.
|
|
141
|
+
*
|
|
142
|
+
* @param dir - the project's folder.
|
|
143
|
+
* @param viteConfig - its Vite configuration, from the folder; the one Vite would find by default; `false` reads none.
|
|
144
|
+
* @param keepPlugin - whether to keep one of the project's own plugins; every one by default.
|
|
145
|
+
*/
|
|
146
|
+
export const loadKitProject = async (dir, viteConfig, keepPlugin = () => true) => {
|
|
147
|
+
const root = resolve(dir);
|
|
148
|
+
const { plugins: written, problem } = await viteConfigPlugins(root, viteConfig);
|
|
149
|
+
const plugins = await flatPlugins(written);
|
|
150
|
+
const options = setupOptions(plugins);
|
|
151
|
+
const others = plugins.filter((plugin) => !KIT_PLUGIN.test(plugin.name) && keepPlugin(plugin));
|
|
152
|
+
// SvelteKit 2's options hold SvelteKit's under `kit`, beside Svelte's; SvelteKit 3's are SvelteKit's alone
|
|
153
|
+
if (options !== undefined) {
|
|
154
|
+
const kit = options["kit"];
|
|
155
|
+
const version = isRecord(kit) ? 2 : 3;
|
|
156
|
+
return {
|
|
157
|
+
...syncedProblem(root, version, problem),
|
|
158
|
+
dir: root,
|
|
159
|
+
kit: isRecord(kit) ? kit : options,
|
|
160
|
+
version,
|
|
161
|
+
extensions: extensionsOf(options),
|
|
162
|
+
svelte: svelteOptionsOf(options),
|
|
163
|
+
plugins: others
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
const fromSvelteConfig = await svelteConfigOptions(root);
|
|
167
|
+
return {
|
|
168
|
+
dir: root,
|
|
169
|
+
kit: fromSvelteConfig.kit,
|
|
170
|
+
version: 2,
|
|
171
|
+
extensions: extensionsOf(fromSvelteConfig.config),
|
|
172
|
+
svelte: undefined,
|
|
173
|
+
plugins: others,
|
|
174
|
+
problem: problem ?? fromSvelteConfig.problem
|
|
175
|
+
};
|
|
176
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AppRoute } from "../appSettings.ts";
|
|
2
|
+
/**
|
|
3
|
+
* The routes of a project's routes folder: every folder with a page or an endpoint.
|
|
4
|
+
*
|
|
5
|
+
* @param routesDir - the routes folder (`src/routes`).
|
|
6
|
+
* @param extensions - the extensions of the project's Svelte components (`.svelte`).
|
|
7
|
+
*/
|
|
8
|
+
export declare const projectRoutes: (routesDir: string, extensions: readonly string[]) => AppRoute[];
|
|
9
|
+
/**
|
|
10
|
+
* The files of a project's static folder, as paths from it.
|
|
11
|
+
*
|
|
12
|
+
* @param staticDir - the folder (`static`).
|
|
13
|
+
*/
|
|
14
|
+
export declare const projectStaticFiles: (staticDir: string) => string[];
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The routes and static files of a SvelteKit project, read from its folders: what `$app/state` matches a story's
|
|
3
|
+
* address against, and what `$app/manifest` lists.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
8
|
+
import { join, relative, sep } from "node:path";
|
|
9
|
+
/** A route's page: `+page.svelte`, or another extension the project compiles as Svelte. */
|
|
10
|
+
const PAGE_FILE = /^\+page(@[^.]*)?\.[^.]+$/;
|
|
11
|
+
/** A route's endpoint: `+server.js` or `+server.ts`. */
|
|
12
|
+
const SERVER_FILE = /^\+server\.[cm]?[jt]s$/;
|
|
13
|
+
/** The most static files listed: a folder of thousands of images is listed no further. */
|
|
14
|
+
const MOST_STATIC_FILES = 5000;
|
|
15
|
+
/**
|
|
16
|
+
* A folder's path from another, written with `/`.
|
|
17
|
+
*
|
|
18
|
+
* @param from - the folder it is relative to.
|
|
19
|
+
* @param path - the path.
|
|
20
|
+
*/
|
|
21
|
+
const slashed = (from, path) => relative(from, path).split(sep).join("/");
|
|
22
|
+
/**
|
|
23
|
+
* The routes of a project's routes folder: every folder with a page or an endpoint.
|
|
24
|
+
*
|
|
25
|
+
* @param routesDir - the routes folder (`src/routes`).
|
|
26
|
+
* @param extensions - the extensions of the project's Svelte components (`.svelte`).
|
|
27
|
+
*/
|
|
28
|
+
export const projectRoutes = (routesDir, extensions) => {
|
|
29
|
+
if (!existsSync(routesDir))
|
|
30
|
+
return [];
|
|
31
|
+
const routes = [];
|
|
32
|
+
const visit = (dir) => {
|
|
33
|
+
const entries = readdirSync(dir, { withFileTypes: true });
|
|
34
|
+
const files = entries.filter((entry) => entry.isFile()).map((entry) => entry.name);
|
|
35
|
+
const page = files.some((file) => PAGE_FILE.test(file) && extensions.some((extension) => file.endsWith(extension)));
|
|
36
|
+
const endpoint = files.some((file) => SERVER_FILE.test(file));
|
|
37
|
+
if (page || endpoint) {
|
|
38
|
+
const path = slashed(routesDir, dir);
|
|
39
|
+
routes.push({ id: path === "" ? "/" : `/${path}`, page, endpoint });
|
|
40
|
+
}
|
|
41
|
+
for (const entry of entries)
|
|
42
|
+
if (entry.isDirectory())
|
|
43
|
+
visit(join(dir, entry.name));
|
|
44
|
+
};
|
|
45
|
+
visit(routesDir);
|
|
46
|
+
return routes.sort((first, second) => first.id.localeCompare(second.id));
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* The files of a project's static folder, as paths from it.
|
|
50
|
+
*
|
|
51
|
+
* @param staticDir - the folder (`static`).
|
|
52
|
+
*/
|
|
53
|
+
export const projectStaticFiles = (staticDir) => {
|
|
54
|
+
if (!existsSync(staticDir))
|
|
55
|
+
return [];
|
|
56
|
+
const files = [];
|
|
57
|
+
const visit = (dir) => {
|
|
58
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
59
|
+
if (files.length >= MOST_STATIC_FILES)
|
|
60
|
+
return;
|
|
61
|
+
const path = join(dir, entry.name);
|
|
62
|
+
if (entry.isDirectory())
|
|
63
|
+
visit(path);
|
|
64
|
+
else if (entry.isFile())
|
|
65
|
+
files.push(slashed(staticDir, path));
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
visit(staticDir);
|
|
69
|
+
return files.sort();
|
|
70
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FrameworkAdapter } from "forgebook/vite/adapter";
|
|
2
|
+
import type { Plugin } from "vite";
|
|
3
|
+
/** The options of `sveltekit()`. */
|
|
4
|
+
export type SveltekitOptions = {
|
|
5
|
+
/** The SvelteKit project's folder; the folder the command runs in by default. */
|
|
6
|
+
readonly dir?: string;
|
|
7
|
+
/**
|
|
8
|
+
* The project's Vite configuration, from its folder, where SvelteKit 3 keeps its options; the one Vite would find
|
|
9
|
+
* by default; `false` reads none (SvelteKit 2's `svelte.config.js` is read then, and the project's other plugins
|
|
10
|
+
* are left out).
|
|
11
|
+
*/
|
|
12
|
+
readonly viteConfig?: string | false;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to keep one of the app's own Vite plugins (SvelteKit's are always left out); every one by default. A
|
|
15
|
+
* catalogue runs them as `vite dev` would, its build too: leave out one that only an app's build needs (a source-map
|
|
16
|
+
* upload, a service-worker generator).
|
|
17
|
+
*/
|
|
18
|
+
readonly keepPlugin?: (plugin: Plugin) => boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* SvelteKit, as the plugin reads and draws its components.
|
|
22
|
+
*
|
|
23
|
+
* @param options - the project's folder and its Vite configuration.
|
|
24
|
+
* @returns the adapter.
|
|
25
|
+
*/
|
|
26
|
+
export declare const sveltekit: (options?: SveltekitOptions) => FrameworkAdapter;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Forgebook's adapter for SvelteKit, for the Vite plugin: `defineConfig({ framework: sveltekit() })`.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* SvelteKit is Svelte: the props are read as Svelte's, and the stories drawn with Svelte's renderer, wrapped so each
|
|
6
|
+
* has its page, its data and its links (`@forgebook/sveltekit/frame`). What SvelteKit adds is Vite's work: Svelte's
|
|
7
|
+
* plugin with the project's own Svelte options, the project's other plugins, and this package's plugin for SvelteKit's
|
|
8
|
+
* modules, aliases and environment (`kitPlugin.ts`). SvelteKit's own plugins are left out: they build an app, and a
|
|
9
|
+
* catalogue draws components.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
import { extname } from "node:path";
|
|
14
|
+
import { svelte } from "@forgebook/svelte/vite";
|
|
15
|
+
import { kitPlugin } from "./kitPlugin.js";
|
|
16
|
+
import { loadKitProject } from "./kitProject.js";
|
|
17
|
+
/**
|
|
18
|
+
* SvelteKit, as the plugin reads and draws its components.
|
|
19
|
+
*
|
|
20
|
+
* @param options - the project's folder and its Vite configuration.
|
|
21
|
+
* @returns the adapter.
|
|
22
|
+
*/
|
|
23
|
+
export const sveltekit = (options = {}) => {
|
|
24
|
+
const base = svelte();
|
|
25
|
+
return {
|
|
26
|
+
name: "sveltekit",
|
|
27
|
+
// beside this module, with its extension: `.ts` in the sources, `.js` once built for npm
|
|
28
|
+
docsModule: new URL(`./extractDocs${extname(import.meta.url)}`, import.meta.url).href,
|
|
29
|
+
// the catalogue imports this package only: its own pages, which use Svelte's
|
|
30
|
+
pages: { frame: "@forgebook/sveltekit/frame", code: "@forgebook/sveltekit/code" },
|
|
31
|
+
browserDependencies: base.browserDependencies ?? [],
|
|
32
|
+
...(base.componentFiles === undefined ? {} : { componentFiles: base.componentFiles }),
|
|
33
|
+
vitePlugins: async () => {
|
|
34
|
+
const project = await loadKitProject(options.dir ?? process.cwd(), options.viteConfig, options.keepPlugin);
|
|
35
|
+
const withSvelte = project.svelte === undefined ? base : svelte({ plugin: project.svelte });
|
|
36
|
+
return [...((await withSvelte.vitePlugins?.()) ?? []), ...project.plugins, kitPlugin(project)];
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,116 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forgebook/sveltekit",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Forgebook for SvelteKit: a SvelteKit project's components drawn outside the app, with $app/state, $app/navigation, $app/forms, $app/paths, the environment and a page's load, on Vite.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"sveltekit",
|
|
7
|
+
"svelte",
|
|
8
|
+
"catalogue",
|
|
9
|
+
"stories"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/ensiria/forgebook.git",
|
|
15
|
+
"directory": "packages/sveltekit"
|
|
16
|
+
},
|
|
17
|
+
"type": "module",
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=22.18"
|
|
23
|
+
},
|
|
24
|
+
"sideEffects": false,
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/src/stories.d.ts",
|
|
28
|
+
"default": "./dist/src/stories.js"
|
|
29
|
+
},
|
|
30
|
+
"./code": {
|
|
31
|
+
"types": "./dist/src/storyCode.d.ts",
|
|
32
|
+
"default": "./dist/src/storyCode.js"
|
|
33
|
+
},
|
|
34
|
+
"./docs": {
|
|
35
|
+
"types": "./dist/src/vite/extractDocs.d.ts",
|
|
36
|
+
"default": "./dist/src/vite/extractDocs.js"
|
|
37
|
+
},
|
|
38
|
+
"./frame": {
|
|
39
|
+
"types": "./dist/src/mountFrame.d.ts",
|
|
40
|
+
"default": "./dist/src/mountFrame.js"
|
|
41
|
+
},
|
|
42
|
+
"./renderer": {
|
|
43
|
+
"types": "./dist/src/kitRenderer.d.ts",
|
|
44
|
+
"default": "./dist/src/kitRenderer.js"
|
|
45
|
+
},
|
|
46
|
+
"./page": {
|
|
47
|
+
"types": "./dist/src/storyPage.d.ts",
|
|
48
|
+
"default": "./dist/src/storyPage.js"
|
|
49
|
+
},
|
|
50
|
+
"./vite": {
|
|
51
|
+
"types": "./dist/src/vite/sveltekit.d.ts",
|
|
52
|
+
"default": "./dist/src/vite/sveltekit.js"
|
|
53
|
+
},
|
|
54
|
+
"./app/env": {
|
|
55
|
+
"types": "./dist/src/app/env.d.ts",
|
|
56
|
+
"default": "./dist/src/app/env.js"
|
|
57
|
+
},
|
|
58
|
+
"./app/forms": {
|
|
59
|
+
"types": "./dist/src/app/forms.d.ts",
|
|
60
|
+
"default": "./dist/src/app/forms.js"
|
|
61
|
+
},
|
|
62
|
+
"./app/manifest": {
|
|
63
|
+
"types": "./dist/src/app/manifest.d.ts",
|
|
64
|
+
"default": "./dist/src/app/manifest.js"
|
|
65
|
+
},
|
|
66
|
+
"./app/navigation": {
|
|
67
|
+
"types": "./dist/src/app/navigation.d.ts",
|
|
68
|
+
"default": "./dist/src/app/navigation.js"
|
|
69
|
+
},
|
|
70
|
+
"./app/paths": {
|
|
71
|
+
"types": "./dist/src/app/paths.d.ts",
|
|
72
|
+
"default": "./dist/src/app/paths.js"
|
|
73
|
+
},
|
|
74
|
+
"./app/state": {
|
|
75
|
+
"types": "./dist/src/app/state.d.ts",
|
|
76
|
+
"default": "./dist/src/app/state.js"
|
|
77
|
+
},
|
|
78
|
+
"./app/stores": {
|
|
79
|
+
"types": "./dist/src/app/stores.d.ts",
|
|
80
|
+
"default": "./dist/src/app/stores.js"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"dependencies": {
|
|
84
|
+
"@forgebook/story-format": "0.2.0",
|
|
85
|
+
"@forgebook/svelte": "0.2.0"
|
|
86
|
+
},
|
|
87
|
+
"peerDependencies": {
|
|
88
|
+
"svelte": "^5.46.4",
|
|
89
|
+
"vite": "^8.0.0",
|
|
90
|
+
"forgebook": "^0.2.0"
|
|
91
|
+
},
|
|
92
|
+
"devDependencies": {
|
|
93
|
+
"@sveltejs/kit": "3.1.1",
|
|
94
|
+
"@sveltejs/vite-plugin-svelte": "7.3.1",
|
|
95
|
+
"@types/node": "24.19.2",
|
|
96
|
+
"happy-dom": "21.0.4",
|
|
97
|
+
"svelte": "5.57.3",
|
|
98
|
+
"svelte-check": "4.7.8",
|
|
99
|
+
"typescript": "npm:typescript@6.0.3",
|
|
100
|
+
"vite": "8.3.5",
|
|
101
|
+
"vitest": "5.0.5",
|
|
102
|
+
"@forgebook/testing": "0.2.0",
|
|
103
|
+
"@forgebook/typescript-config": "0.0.0",
|
|
104
|
+
"forgebook": "0.2.0",
|
|
105
|
+
"@forgebook/tools": "0.0.0"
|
|
106
|
+
},
|
|
107
|
+
"publishConfig": {
|
|
108
|
+
"access": "public"
|
|
109
|
+
},
|
|
110
|
+
"scripts": {
|
|
111
|
+
"build": "package-build build",
|
|
112
|
+
"manifest": "package-build manifest",
|
|
113
|
+
"test": "vitest run",
|
|
114
|
+
"typecheck": "tsc -p src && tsc -p src/vite && svelte-check --tsconfig test/tsconfig.json --fail-on-warnings"
|
|
115
|
+
}
|
|
6
116
|
}
|