eddev 2.0.0-beta.16 → 2.0.0-beta.18
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/app/server/render-ssr-page.js +2 -1
- package/dist/app/server/server-context.js +1 -1
- package/dist/node/cli/cli.js +11 -9
- package/dist/node/cli/version.d.ts +1 -1
- package/dist/node/cli/version.js +1 -1
- package/dist/node/compiler/get-vite-config.js +10 -9
- package/dist/node/compiler/vinxi-codegen.js +10 -8
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ import { SSRRoot } from "../entry/ssr-root.js";
|
|
|
6
6
|
import { RouteLoader } from "../lib/routing/loader.js";
|
|
7
7
|
export async function renderPageToSSRStream(pathname, initialData, serverContext) {
|
|
8
8
|
const clientManifest = serverContext.getManifest("client");
|
|
9
|
+
console.log("Manifest is", clientManifest);
|
|
9
10
|
const assets = await clientManifest.inputs[clientManifest.handler].assets();
|
|
10
11
|
const jsx = (_jsx(SSRRoot, { assets: _jsx(Suspense, { children: assets.map((m) => renderAsset(m)) }), pathname: pathname, initialData: initialData, loader: new RouteLoader() }));
|
|
11
12
|
const stream = await new Promise(async (resolve) => {
|
|
@@ -14,7 +15,7 @@ export async function renderPageToSSRStream(pathname, initialData, serverContext
|
|
|
14
15
|
resolve(stream);
|
|
15
16
|
},
|
|
16
17
|
bootstrapModules: [clientManifest.inputs[clientManifest.handler].output.path],
|
|
17
|
-
bootstrapScriptContent: `window.manifest = ${JSON.stringify(clientManifest.json())}; window._PAGE_DATA = ${JSON.stringify(initialData)}`,
|
|
18
|
+
bootstrapScriptContent: `window.manifest = ${JSON.stringify(await clientManifest.json())}; window._PAGE_DATA = ${JSON.stringify(initialData)}`,
|
|
18
19
|
});
|
|
19
20
|
});
|
|
20
21
|
return stream;
|
|
@@ -27,7 +27,7 @@ export class ServerContext {
|
|
|
27
27
|
}
|
|
28
28
|
getOriginUrl(url) {
|
|
29
29
|
const parsed = parseURL(url);
|
|
30
|
-
const parsedOrigin = parseURL(
|
|
30
|
+
const parsedOrigin = parseURL(this.origin);
|
|
31
31
|
parsed.host = parsedOrigin.host;
|
|
32
32
|
parsed.protocol = parsedOrigin.protocol;
|
|
33
33
|
return stringifyParsedURL(parsed);
|
package/dist/node/cli/cli.js
CHANGED
|
@@ -2,8 +2,8 @@ import chalk from "chalk";
|
|
|
2
2
|
import { Command } from "commander";
|
|
3
3
|
import { setDefaultResultOrder } from "dns";
|
|
4
4
|
import { config as importDotEnv } from "dotenv";
|
|
5
|
-
import { adminLog } from "../compiler/bundler.admin.js";
|
|
6
|
-
import { frontendLog } from "../compiler/bundler.frontend.js";
|
|
5
|
+
import { AdminBundler, adminLog } from "../compiler/bundler.admin.js";
|
|
6
|
+
import { FrontendBundler, frontendLog } from "../compiler/bundler.frontend.js";
|
|
7
7
|
import { DevServer, serverlessLog } from "../compiler/dev-server.js";
|
|
8
8
|
import { createVinxiCodegen } from "../compiler/vinxi-codegen.js";
|
|
9
9
|
import { graphqlLog } from "../graphql/graphql-codegen.js";
|
|
@@ -160,13 +160,15 @@ program
|
|
|
160
160
|
console,
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
163
|
+
else {
|
|
164
|
+
// Load the compiler
|
|
165
|
+
new AdminBundler(project, {
|
|
166
|
+
mode: "development",
|
|
167
|
+
});
|
|
168
|
+
new FrontendBundler(project, {
|
|
169
|
+
mode: "production",
|
|
170
|
+
});
|
|
171
|
+
}
|
|
170
172
|
});
|
|
171
173
|
program
|
|
172
174
|
.command("info")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "2.0.0-beta.
|
|
1
|
+
export declare const VERSION = "2.0.0-beta.18";
|
package/dist/node/cli/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "2.0.0-beta.
|
|
1
|
+
export const VERSION = "2.0.0-beta.18";
|
|
@@ -88,13 +88,14 @@ export function ssrPlugin() {
|
|
|
88
88
|
...config.legacy,
|
|
89
89
|
proxySsrExternalModules: true,
|
|
90
90
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
config.ssr = {
|
|
92
|
+
...config.ssr,
|
|
93
|
+
// @ts-ignore
|
|
94
|
+
noExternal: ["eddev", "vinxi", "react-use", ...(config?.optimizeDeps?.noExternal ?? [])],
|
|
95
|
+
optimizeDeps: {
|
|
96
|
+
exclude: ["eddev", "vinxi"],
|
|
97
|
+
},
|
|
98
|
+
};
|
|
98
99
|
config.optimizeDeps = {
|
|
99
100
|
...config.optimizeDeps,
|
|
100
101
|
include: [
|
|
@@ -106,7 +107,7 @@ export function ssrPlugin() {
|
|
|
106
107
|
"react-dom/client",
|
|
107
108
|
...(config?.optimizeDeps?.include ?? []),
|
|
108
109
|
],
|
|
109
|
-
exclude: ["eddev", ...(config?.optimizeDeps?.exclude ?? [])],
|
|
110
|
+
exclude: ["eddev", "vinxi", ...(config?.optimizeDeps?.exclude ?? [])],
|
|
110
111
|
};
|
|
111
112
|
return config;
|
|
112
113
|
},
|
|
@@ -134,7 +135,7 @@ function buildStatusPlugin(console) {
|
|
|
134
135
|
};
|
|
135
136
|
}
|
|
136
137
|
export function corePlugins(args) {
|
|
137
|
-
return [
|
|
138
|
+
return [args.serverless && ssrPlugin(), envPlugin(args), tsconfigPaths(), reactPlugin()].flat();
|
|
138
139
|
}
|
|
139
140
|
export function getViteConfig(args) {
|
|
140
141
|
const console = args.console;
|
|
@@ -97,7 +97,7 @@ export function createVinxiCodegen(opts) {
|
|
|
97
97
|
import { devToolsStore } from 'eddev/devtools'
|
|
98
98
|
|
|
99
99
|
// Set up a dynamic entry which will load the configured tailwind manifest
|
|
100
|
-
devToolsStore.loadTailwindConfig = () => import('./manifest/tailwind-config')
|
|
100
|
+
devToolsStore.loadTailwindConfig = () => import('./manifest/tailwind-config.js')
|
|
101
101
|
|
|
102
102
|
// Create the asset renderer, which will ensure scripts/styles are mounted correctly
|
|
103
103
|
function getAssets() {
|
|
@@ -157,7 +157,7 @@ export function createVinxiCodegen(opts) {
|
|
|
157
157
|
generate: code /* tsx */ `
|
|
158
158
|
/// <reference types="vinxi/types/server" />
|
|
159
159
|
import { createRouter, eventHandler, getRouterParam, getQuery, getWebRequest, getRequestHeaders } from "vinxi/http"
|
|
160
|
-
import { serverContext } from "./context"
|
|
160
|
+
import { serverContext } from "./context.js"
|
|
161
161
|
|
|
162
162
|
const router = createRouter()
|
|
163
163
|
.get(
|
|
@@ -221,13 +221,14 @@ export function createVinxiCodegen(opts) {
|
|
|
221
221
|
generate: code /* tsx */ `
|
|
222
222
|
/// <reference types="vinxi/types/server" />
|
|
223
223
|
import "../../views/index.css"
|
|
224
|
-
import "./manifest/blocks"
|
|
225
|
-
import "./manifest/styles"
|
|
226
|
-
import "./manifest/views"
|
|
224
|
+
import "./manifest/blocks.js"
|
|
225
|
+
import "./manifest/styles.js"
|
|
226
|
+
import "./manifest/views.js"
|
|
227
227
|
|
|
228
228
|
import { renderPageToSSRStream, proxyWpAdmin } from "eddev/server"
|
|
229
229
|
import { eventHandler, setResponseHeader, setResponseStatus, getRequestURL } from "vinxi/http"
|
|
230
|
-
import { serverContext } from "./context"
|
|
230
|
+
import { serverContext } from "./context.js"
|
|
231
|
+
import { getManifest } from "vinxi/manifest"
|
|
231
232
|
|
|
232
233
|
export default eventHandler({
|
|
233
234
|
handler: async (event) => {
|
|
@@ -246,6 +247,7 @@ export function createVinxiCodegen(opts) {
|
|
|
246
247
|
if (response.ok) {
|
|
247
248
|
setResponseStatus(event, response.status)
|
|
248
249
|
setResponseHeader(event, "Content-Type", "text/html; charset=utf-8")
|
|
250
|
+
console.log('MM', getManifest('client'))
|
|
249
251
|
return renderPageToSSRStream(url.pathname, await response.json(), serverContext)
|
|
250
252
|
} else {
|
|
251
253
|
return response
|
|
@@ -263,7 +265,7 @@ export function createVinxiCodegen(opts) {
|
|
|
263
265
|
/// <reference types="vinxi/types/server" />
|
|
264
266
|
import { proxyWpAdmin } from "eddev/server"
|
|
265
267
|
import { eventHandler } from "vinxi/http"
|
|
266
|
-
import { serverContext } from "./context"
|
|
268
|
+
import { serverContext } from "./context.js"
|
|
267
269
|
|
|
268
270
|
export default eventHandler(async (event) => {
|
|
269
271
|
return proxyWpAdmin(event, serverContext)
|
|
@@ -399,7 +401,7 @@ export function createVinxiCodegen(opts) {
|
|
|
399
401
|
name: "manifest/tailwind-config.ts",
|
|
400
402
|
generate: async () => {
|
|
401
403
|
return code /* ts */ `
|
|
402
|
-
import tw from "../../../tailwind.config"
|
|
404
|
+
import tw from "../../../tailwind.config.ts"
|
|
403
405
|
import resolveConfig from 'tailwindcss/resolveConfig'
|
|
404
406
|
import { devToolsStore } from 'eddev/devtools'
|
|
405
407
|
|