@dreamkit/dev 0.0.8 → 0.0.10
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/lib/DreamkitDevServer.d.ts +4 -0
- package/lib/DreamkitDevServer.d.ts.map +1 -1
- package/lib/DreamkitDevServer.js +15 -0
- package/lib/adapters/solid-start/dev-server.d.ts +8 -0
- package/lib/adapters/solid-start/dev-server.d.ts.map +1 -0
- package/lib/adapters/{solid-start.js → solid-start/dev-server.js} +42 -16
- package/lib/adapters/solid-start/middleware.d.ts +6 -0
- package/lib/adapters/solid-start/middleware.d.ts.map +1 -0
- package/lib/adapters/solid-start/middleware.js +13 -0
- package/lib/adapters/solid-start/prod-server.d.ts +2 -0
- package/lib/adapters/solid-start/prod-server.d.ts.map +1 -0
- package/lib/adapters/solid-start/prod-server.js +9 -0
- package/lib/bin.js +1 -1
- package/lib/plugins/dreamkit.d.ts.map +1 -1
- package/lib/plugins/dreamkit.js +5 -3
- package/lib/utils/vinxi.d.ts +18 -3
- package/lib/utils/vinxi.d.ts.map +1 -1
- package/lib/utils/vinxi.js +15 -0
- package/package.json +4 -3
- package/lib/adapters/solid-start.d.ts +0 -8
- package/lib/adapters/solid-start.d.ts.map +0 -1
|
@@ -10,18 +10,22 @@ export type DreamkitDevExternalOptions = {
|
|
|
10
10
|
export type DreamkitDevInOptions = DreamkitPluginOptions & DreamkitDevExternalOptions;
|
|
11
11
|
export type DreamkitDevOptions = OutDreamkitPluginOptions & DreamkitDevExternalOptions;
|
|
12
12
|
export declare class DreamkitDevServer {
|
|
13
|
+
static instanceKey: string;
|
|
13
14
|
readonly app: App;
|
|
14
15
|
readonly entry: VirtualShaking;
|
|
15
16
|
protected runtimeServer: ViteDevServer | undefined;
|
|
16
17
|
protected runtime: ViteRuntime | undefined;
|
|
17
18
|
readonly options: DreamkitDevOptions;
|
|
18
19
|
constructor(inOptions: DreamkitDevInOptions);
|
|
20
|
+
static instance(): DreamkitDevServer;
|
|
21
|
+
static saveInstance(instance: DreamkitDevServer): void;
|
|
19
22
|
fetch(path: string): Promise<any>;
|
|
20
23
|
fetchDefault<T>(path: string): Promise<T>;
|
|
21
24
|
fetchRoute(path: string): Promise<Route>;
|
|
22
25
|
findRouteObjects(): Promise<Record<string, any>>;
|
|
23
26
|
fetchEntryObjects(): Promise<Record<string, any>>;
|
|
24
27
|
prepare(includeRouteFileObjects?: boolean): Promise<void>;
|
|
28
|
+
start(): Promise<void>;
|
|
25
29
|
stop(): Promise<void>;
|
|
26
30
|
}
|
|
27
31
|
//# sourceMappingURL=DreamkitDevServer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DreamkitDevServer.d.ts","sourceRoot":"","sources":["../src/DreamkitDevServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,qBAAqB,EACrB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AAItB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAMpD,OAAO,EAAE,GAAG,EAAW,KAAK,EAAU,MAAM,eAAe,CAAC;AAE5D,OAAO,EAAmC,aAAa,EAAE,MAAM,MAAM,CAAC;AAGtE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,GACtD,0BAA0B,CAAC;AAC7B,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,GACvD,0BAA0B,CAAC;AAE7B,qBAAa,iBAAiB;IAC5B,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAClB,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,SAAS,CAAC,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;IACnD,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,CAAC;IAC3C,QAAQ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AAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAKxC,gBAAgB;IAyBhB,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAIjD,OAAO,CAAC,uBAAuB,UAAO;IAoCtC,KAAK;IAIL,IAAI;CAKX"}
|
package/lib/DreamkitDevServer.js
CHANGED
|
@@ -10,6 +10,7 @@ import { createServer, createViteRuntime } from "vite";
|
|
|
10
10
|
import solidPlugin from "vite-plugin-solid";
|
|
11
11
|
import tsconfigPlugin from "vite-tsconfig-paths";
|
|
12
12
|
export class DreamkitDevServer {
|
|
13
|
+
static instanceKey = "dk:dev-server";
|
|
13
14
|
app;
|
|
14
15
|
entry;
|
|
15
16
|
runtimeServer;
|
|
@@ -44,6 +45,15 @@ export class DreamkitDevServer {
|
|
|
44
45
|
},
|
|
45
46
|
});
|
|
46
47
|
}
|
|
48
|
+
static instance() {
|
|
49
|
+
const value = globalThis[DreamkitDevServer.instanceKey];
|
|
50
|
+
if (!value)
|
|
51
|
+
throw new Error("DreamkitDevServer instance not found");
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
static saveInstance(instance) {
|
|
55
|
+
globalThis[DreamkitDevServer.instanceKey] = instance;
|
|
56
|
+
}
|
|
47
57
|
async fetch(path) {
|
|
48
58
|
//const mod = $server.moduleGraph.getModuleById(shaking.entry);
|
|
49
59
|
//if (mod) $server.moduleGraph.invalidateModule(mod);
|
|
@@ -119,7 +129,12 @@ export class DreamkitDevServer {
|
|
|
119
129
|
};
|
|
120
130
|
await this.app.add(objects);
|
|
121
131
|
}
|
|
132
|
+
async start() {
|
|
133
|
+
await this.app.start();
|
|
134
|
+
}
|
|
122
135
|
async stop() {
|
|
136
|
+
if (this.app.started)
|
|
137
|
+
await this.app.stop();
|
|
123
138
|
await this.runtimeServer?.close();
|
|
124
139
|
await this.runtime?.destroy();
|
|
125
140
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DreamkitDevInOptions, DreamkitDevServer } from "../../DreamkitDevServer.js";
|
|
2
|
+
import { DreamkitPluginOptions } from "../../options.js";
|
|
3
|
+
import { VinxiApp } from "../../utils/vinxi.js";
|
|
4
|
+
export declare function fetchDreamkitDevOptions(options: {
|
|
5
|
+
root: string;
|
|
6
|
+
}): Promise<DreamkitDevInOptions>;
|
|
7
|
+
export declare function createDreamkitDevServer(vinxiApp: VinxiApp, inOptions?: DreamkitPluginOptions): DreamkitDevServer;
|
|
8
|
+
//# sourceMappingURL=dev-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-server.d.ts","sourceRoot":"","sources":["../../../src/adapters/solid-start/dev-server.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAKzD,OAAO,EAML,QAAQ,EAET,MAAM,sBAAsB,CAAC;AAsB9B,wBAAsB,uBAAuB,CAAC,OAAO,EAAE;IACrD,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAqDhC;AAuCD,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,QAAQ,EAClB,SAAS,GAAE,qBAA0B,qBAqJtC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { DreamkitDevServer, } from "
|
|
2
|
-
import { generate } from "
|
|
3
|
-
import { tryGenerate } from "
|
|
4
|
-
import { execute } from "
|
|
5
|
-
import { createDelayedFunction } from "
|
|
6
|
-
import { transformCode } from "
|
|
7
|
-
import { onChangeVinxiRoutes, } from "
|
|
8
|
-
import { isRoute, $route } from "@dreamkit/app";
|
|
9
|
-
import {
|
|
1
|
+
import { DreamkitDevServer, } from "../../DreamkitDevServer.js";
|
|
2
|
+
import { generate } from "../../actions/generate.js";
|
|
3
|
+
import { tryGenerate } from "../../utils/ast.js";
|
|
4
|
+
import { execute } from "../../utils/runtime.js";
|
|
5
|
+
import { createDelayedFunction } from "../../utils/timeout.js";
|
|
6
|
+
import { transformCode } from "../../utils/transform.js";
|
|
7
|
+
import { addVinxiPlugin, addVinxiRollupPlugin, isVinxiBuild, onChangeVinxiRoutes, } from "../../utils/vinxi.js";
|
|
8
|
+
import { isRoute, $route, App } from "@dreamkit/app";
|
|
9
|
+
import { existsSync } from "fs";
|
|
10
|
+
import { join, normalize, relative, resolve } from "path";
|
|
11
|
+
import { fileURLToPath } from "url";
|
|
10
12
|
const isEntryRoute = (id, value) => !id.startsWith("/") && isRoute(value);
|
|
11
13
|
// StackBlitz Polyfill
|
|
12
14
|
class $CustomEvent extends Event {
|
|
@@ -88,12 +90,18 @@ function addVinxiEntryRoutes(vinxiApp, objectId, objectValue, entryPath) {
|
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
export function createDreamkitDevServer(vinxiApp, inOptions = {}) {
|
|
91
|
-
const
|
|
93
|
+
const ssrFileRouter = vinxiApp.config.routers.find((config) => config.name === "ssr").internals.routes;
|
|
92
94
|
const server = new DreamkitDevServer({
|
|
93
95
|
root: resolve(vinxiApp.config.root ?? "."),
|
|
94
|
-
routeDir:
|
|
96
|
+
routeDir: ssrFileRouter.config.dir,
|
|
95
97
|
...inOptions,
|
|
96
98
|
});
|
|
99
|
+
DreamkitDevServer.saveInstance(server);
|
|
100
|
+
App.saveInstance(server.app);
|
|
101
|
+
const selfPath = (file, rel) => {
|
|
102
|
+
const path = fileURLToPath(new URL(`./${file}`, import.meta.url));
|
|
103
|
+
return normalize(rel ? relative(server.options.root, path) : path);
|
|
104
|
+
};
|
|
97
105
|
async function onBuildStart() {
|
|
98
106
|
await server.prepare(false);
|
|
99
107
|
for (const route of server.app.routes) {
|
|
@@ -156,11 +164,9 @@ export function createDreamkitDevServer(vinxiApp, inOptions = {}) {
|
|
|
156
164
|
if (!isVinxiRouterPage)
|
|
157
165
|
return;
|
|
158
166
|
const id = vinxiRoute.path;
|
|
159
|
-
if (
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
else if (action === "add" || action === "update") {
|
|
167
|
+
if (router.name === "ssr" && server.app.objects.has(id))
|
|
168
|
+
await server.app.remove([id]);
|
|
169
|
+
if (action === "add" || action === "update") {
|
|
164
170
|
const routeObject = await server.fetchDefault(vinxiRoute.filePath);
|
|
165
171
|
if (isRoute(routeObject))
|
|
166
172
|
vinxiRoute.$$route = {
|
|
@@ -182,6 +188,26 @@ export function createDreamkitDevServer(vinxiApp, inOptions = {}) {
|
|
|
182
188
|
}
|
|
183
189
|
}
|
|
184
190
|
}
|
|
191
|
+
const ssrRouter = vinxiApp.getRouter("ssr");
|
|
192
|
+
ssrRouter.middleware = selfPath("middleware.js", true);
|
|
193
|
+
if (isVinxiBuild()) {
|
|
194
|
+
const dreamkitEntryId = "dk:entry";
|
|
195
|
+
const dreamkitEntry = join(server.options.root, "src/dreamkit.tsx").replaceAll("\\", "/");
|
|
196
|
+
const existsDreamkitEntry = existsSync(dreamkitEntry);
|
|
197
|
+
addVinxiPlugin(vinxiApp, selfPath("prod-server.js"));
|
|
198
|
+
addVinxiRollupPlugin(vinxiApp, {
|
|
199
|
+
name: "dk:entry",
|
|
200
|
+
resolveId(id) {
|
|
201
|
+
if (id === dreamkitEntryId) {
|
|
202
|
+
return existsDreamkitEntry ? dreamkitEntry : `\0${dreamkitEntryId}`;
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
load(id) {
|
|
206
|
+
if (!existsDreamkitEntry && id === `\0${dreamkitEntryId}`)
|
|
207
|
+
return { code: "export {}" };
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
}
|
|
185
211
|
vinxiApp.hooks.hook("app:build:router:start", onBuildStart);
|
|
186
212
|
vinxiApp.hooks.hook("app:build:router:vite:end", onBuildEnd);
|
|
187
213
|
vinxiApp.hooks.hook("app:build:nitro:start", onBuildStart);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../../src/adapters/solid-start/middleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAkC,MAAM,YAAY,CAAC;;wBAI1D,SAAS;;AAF3B,wBASE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { App } from "@dreamkit/app";
|
|
2
|
+
import { getWebRequest, sendWebResponse } from "vinxi/http";
|
|
3
|
+
export default {
|
|
4
|
+
onRequest: [
|
|
5
|
+
async (event) => {
|
|
6
|
+
const app = App.instance();
|
|
7
|
+
const request = getWebRequest(event);
|
|
8
|
+
const response = await app.request(request);
|
|
9
|
+
if (response)
|
|
10
|
+
await sendWebResponse(event, response);
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prod-server.d.ts","sourceRoot":"","sources":["../../../src/adapters/solid-start/prod-server.ts"],"names":[],"mappings":"AAIA,yBAA+B,MAAM,EAAE,GAAG,iBAKzC"}
|
package/lib/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DreamkitDevServer } from "./DreamkitDevServer.js";
|
|
2
2
|
import { generate } from "./actions/generate.js";
|
|
3
|
-
import { fetchDreamkitDevOptions } from "./adapters/solid-start.js";
|
|
3
|
+
import { fetchDreamkitDevOptions } from "./adapters/solid-start/dev-server.js";
|
|
4
4
|
import { createCommand } from "commander";
|
|
5
5
|
import { relative, resolve } from "path";
|
|
6
6
|
const program = createCommand();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dreamkit.d.ts","sourceRoot":"","sources":["../../src/plugins/dreamkit.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAItD,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,wBAAgB,cAAc,CAAC,SAAS,GAAE,qBAA0B,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"dreamkit.d.ts","sourceRoot":"","sources":["../../src/plugins/dreamkit.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAItD,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,wBAAgB,cAAc,CAAC,SAAS,GAAE,qBAA0B,GAAG,MAAM,CAkD5E"}
|
package/lib/plugins/dreamkit.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { createDreamkitDevServer } from "../adapters/solid-start.js";
|
|
1
|
+
import { createDreamkitDevServer } from "../adapters/solid-start/dev-server.js";
|
|
2
2
|
import { tryGenerate } from "../utils/ast.js";
|
|
3
3
|
import { transformCode } from "../utils/transform.js";
|
|
4
|
-
import { onVinxiApp } from "../utils/vinxi.js";
|
|
4
|
+
import { isVinxiBuild, onVinxiApp } from "../utils/vinxi.js";
|
|
5
5
|
export function dreamkitPlugin(inOptions = {}) {
|
|
6
6
|
let isSolidStart = false;
|
|
7
7
|
let server;
|
|
8
|
-
const cleanup = onVinxiApp((app) => {
|
|
8
|
+
const cleanup = onVinxiApp(async (app) => {
|
|
9
9
|
server = createDreamkitDevServer(app, inOptions);
|
|
10
|
+
if (!isVinxiBuild())
|
|
11
|
+
await server.start();
|
|
10
12
|
});
|
|
11
13
|
return {
|
|
12
14
|
name: "dreamkit",
|
package/lib/utils/vinxi.d.ts
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { App } from "vinxi";
|
|
1
|
+
import type { InputOptionsWithPlugins, Plugin } from "rollup";
|
|
2
|
+
import type { App, Internals } from "vinxi";
|
|
3
|
+
import type { Router } from "vinxi/http";
|
|
4
|
+
export type VinxiApp = Omit<App, "getRouter"> & {
|
|
5
|
+
config: {
|
|
6
|
+
server?: App["config"]["server"] & {
|
|
7
|
+
plugins?: string[];
|
|
8
|
+
rollupConfig?: InputOptionsWithPlugins;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
getRouter(name: string): Router & {
|
|
12
|
+
middleware?: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
3
15
|
export type VinxiRoute = {
|
|
4
16
|
_dreamkitEntryId?: string;
|
|
5
17
|
page: boolean;
|
|
@@ -21,6 +33,9 @@ export type BaseFileSystemRouter = Omit<Internals["routes"] & {}, "getRoutes"> &
|
|
|
21
33
|
buildRoutes(): Promise<VinxiRoute[]>;
|
|
22
34
|
buildRoutesPromise: Promise<any> | undefined;
|
|
23
35
|
};
|
|
24
|
-
export declare function
|
|
36
|
+
export declare function isVinxiBuild(): boolean;
|
|
37
|
+
export declare function onVinxiApp(cb: (app: VinxiApp) => void): () => void;
|
|
38
|
+
export declare function addVinxiPlugin(vinxiApp: VinxiApp, path: string): void;
|
|
39
|
+
export declare function addVinxiRollupPlugin(vinxiApp: VinxiApp, plugin: Plugin): void;
|
|
25
40
|
export declare function onChangeVinxiRoutes(router: BaseFileSystemRouter, cb: (action: "add" | "update" | "remove", route: VinxiRoute) => any): () => void;
|
|
26
41
|
//# sourceMappingURL=vinxi.d.ts.map
|
package/lib/utils/vinxi.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vinxi.d.ts","sourceRoot":"","sources":["../../src/utils/vinxi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"vinxi.d.ts","sourceRoot":"","sources":["../../src/utils/vinxi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC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AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAMtE;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,oBAAoB,EAC5B,EAAE,EAAE,CAAC,MAAM,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,EAAE,KAAK,EAAE,UAAU,KAAK,GAAG,cAmCpE"}
|
package/lib/utils/vinxi.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { normalize } from "path";
|
|
2
|
+
export function isVinxiBuild() {
|
|
3
|
+
return process.argv.slice(2).includes("build");
|
|
4
|
+
}
|
|
2
5
|
export function onVinxiApp(cb) {
|
|
3
6
|
Object.defineProperty(globalThis, "app", {
|
|
4
7
|
configurable: true,
|
|
@@ -17,6 +20,18 @@ export function onVinxiApp(cb) {
|
|
|
17
20
|
});
|
|
18
21
|
};
|
|
19
22
|
}
|
|
23
|
+
export function addVinxiPlugin(vinxiApp, path) {
|
|
24
|
+
if (!vinxiApp.config.server.plugins)
|
|
25
|
+
vinxiApp.config.server.plugins = [];
|
|
26
|
+
vinxiApp.config.server.plugins.push(path);
|
|
27
|
+
}
|
|
28
|
+
export function addVinxiRollupPlugin(vinxiApp, plugin) {
|
|
29
|
+
if (!vinxiApp.config.server.rollupConfig)
|
|
30
|
+
vinxiApp.config.server.rollupConfig = { plugins: [] };
|
|
31
|
+
if (!vinxiApp.config.server.rollupConfig.plugins)
|
|
32
|
+
vinxiApp.config.server.rollupConfig.plugins = [];
|
|
33
|
+
vinxiApp.config.server.rollupConfig.plugins.push(plugin);
|
|
34
|
+
}
|
|
20
35
|
export function onChangeVinxiRoutes(router, cb) {
|
|
21
36
|
const addRoute = router._addRoute.bind(router);
|
|
22
37
|
const removeRoute = router.removeRoute.bind(router);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dreamkit/dev",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "Development tools for DreamKit.",
|
|
5
5
|
"homepage": "https://dreamkit.dev",
|
|
6
6
|
"repository": {
|
|
@@ -42,10 +42,11 @@
|
|
|
42
42
|
"es-module-lexer": "^1.5.4",
|
|
43
43
|
"esbuild": "^0.24.0",
|
|
44
44
|
"glob": "^11.0.0",
|
|
45
|
+
"rollup": "^4.26.0",
|
|
45
46
|
"vite-plugin-solid": "^2.10.2",
|
|
46
47
|
"vite-tsconfig-paths": "^5.1.2",
|
|
47
|
-
"@dreamkit/app": "0.0.
|
|
48
|
-
"@dreamkit/schema": "0.0.
|
|
48
|
+
"@dreamkit/app": "0.0.4",
|
|
49
|
+
"@dreamkit/schema": "0.0.3"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
52
|
"@types/debug": "^4.1.12",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DreamkitDevInOptions, DreamkitDevServer } from "../DreamkitDevServer.js";
|
|
2
|
-
import { DreamkitPluginOptions } from "../options.js";
|
|
3
|
-
import { App } from "vinxi";
|
|
4
|
-
export declare function fetchDreamkitDevOptions(options: {
|
|
5
|
-
root: string;
|
|
6
|
-
}): Promise<DreamkitDevInOptions>;
|
|
7
|
-
export declare function createDreamkitDevServer(vinxiApp: App, inOptions?: DreamkitPluginOptions): DreamkitDevServer;
|
|
8
|
-
//# sourceMappingURL=solid-start.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"solid-start.d.ts","sourceRoot":"","sources":["../../src/adapters/solid-start.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAYtD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAkB5B,wBAAsB,uBAAuB,CAAC,OAAO,EAAE;IACrD,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAqDhC;AAsCD,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,GAAG,EACb,SAAS,GAAE,qBAA0B,qBAoHtC"}
|