vorzelajs 0.0.3 → 0.0.5
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/dist/cli/dev.d.ts.map +1 -1
- package/dist/cli/dev.js +11 -1
- package/dist/vite/index.js +3 -3
- package/package.json +1 -1
package/dist/cli/dev.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/cli/dev.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/cli/dev.ts"],"names":[],"mappings":"AAgEA,wBAAsB,MAAM,kBAqE3B"}
|
package/dist/cli/dev.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { createServer } from 'node:http';
|
|
2
2
|
import { createServer as createNetServer } from 'node:net';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import url from 'node:url';
|
|
3
5
|
import { getRequestListener } from '@hono/node-server';
|
|
4
6
|
import { createVorzelaApp } from '../server/index.js';
|
|
5
7
|
import { resolveVorzelaConfig } from '../vite/index.js';
|
|
@@ -48,6 +50,11 @@ export async function runDev() {
|
|
|
48
50
|
const { vorzelaServerOnlyPlugin } = await import('../vite/server-only.js');
|
|
49
51
|
const solidPlugin = await import('vite-plugin-solid').then((m) => m.default).catch(() => null);
|
|
50
52
|
const baseConfig = await resolveVorzelaConfig(appRoot);
|
|
53
|
+
// Resolve the framework's internal entry-client file
|
|
54
|
+
const devThisFile = url.fileURLToPath(import.meta.url);
|
|
55
|
+
const frameworkDir = path.resolve(path.dirname(devThisFile), '..');
|
|
56
|
+
const internalExt = path.extname(devThisFile) === '.js' ? '.jsx' : '.tsx';
|
|
57
|
+
const entryClientPath = path.resolve(frameworkDir, `internal/entry-client${internalExt}`);
|
|
51
58
|
const { createServer: createViteServer } = await import('vite');
|
|
52
59
|
const resolvedHmrPort = await findAvailablePort(hmrPort);
|
|
53
60
|
const vite = await createViteServer({
|
|
@@ -58,11 +65,14 @@ export async function runDev() {
|
|
|
58
65
|
port: resolvedHmrPort,
|
|
59
66
|
},
|
|
60
67
|
middlewareMode: true,
|
|
68
|
+
fs: {
|
|
69
|
+
allow: [appRoot, frameworkDir],
|
|
70
|
+
},
|
|
61
71
|
},
|
|
62
72
|
});
|
|
63
73
|
const devAssets = {
|
|
64
74
|
css: ['/src/styles.css'],
|
|
65
|
-
js: [
|
|
75
|
+
js: [`/@fs/${entryClientPath}`],
|
|
66
76
|
};
|
|
67
77
|
const loadEntry = async () => {
|
|
68
78
|
return vite.ssrLoadModule('virtual:vorzela/entry-server');
|
package/dist/vite/index.js
CHANGED
|
@@ -32,11 +32,11 @@ function tryRequirePlugin(name) {
|
|
|
32
32
|
return null;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
async function tryImportPlugin(name) {
|
|
35
|
+
async function tryImportPlugin(name, options) {
|
|
36
36
|
try {
|
|
37
37
|
const mod = await import(name);
|
|
38
38
|
const fn = mod.default ?? mod;
|
|
39
|
-
return typeof fn === 'function' ? fn() : null;
|
|
39
|
+
return typeof fn === 'function' ? fn(options) : null;
|
|
40
40
|
}
|
|
41
41
|
catch {
|
|
42
42
|
return null;
|
|
@@ -110,7 +110,7 @@ export async function resolveVorzelaConfig(appRoot, options = {}) {
|
|
|
110
110
|
plugins.push(options.solid);
|
|
111
111
|
}
|
|
112
112
|
else {
|
|
113
|
-
const solidPlugin = await tryImportPlugin('vite-plugin-solid');
|
|
113
|
+
const solidPlugin = await tryImportPlugin('vite-plugin-solid', { ssr: true });
|
|
114
114
|
if (solidPlugin) {
|
|
115
115
|
plugins.push(solidPlugin);
|
|
116
116
|
}
|