eddev 2.0.0-beta.78 → 2.0.0-beta.80
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.
|
@@ -6,8 +6,8 @@ import { useRouter } from "../hooks/useRouter.js";
|
|
|
6
6
|
import { isSameOrigin } from "../utils.js";
|
|
7
7
|
import { useRoute } from "../hooks/useRoute.js";
|
|
8
8
|
import { useRouterState } from "../hooks/useRouterState.js";
|
|
9
|
-
export const Link = forwardRef(({ preferBack, ...props }, ref) => {
|
|
10
|
-
const Comp =
|
|
9
|
+
export const Link = forwardRef(({ preferBack, as, ...props }, ref) => {
|
|
10
|
+
const Comp = as || "a";
|
|
11
11
|
if (env.admin) {
|
|
12
12
|
return (_jsx(Comp, { ref: ref, ...props, href: props.href ?? undefined, onClick: (e) => {
|
|
13
13
|
props.onClick?.(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "2.0.0-beta.
|
|
1
|
+
export declare const VERSION = "2.0.0-beta.80";
|
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.80";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { joinURL } from "ufo";
|
|
2
2
|
import { createApp } from "vinxi";
|
|
3
|
+
import tsconfigPaths from "vite-tsconfig-paths";
|
|
3
4
|
import { StatefulLog } from "../utils/stateful-log.js";
|
|
4
|
-
import { corePlugins } from "./get-vite-config.js";
|
|
5
|
+
import { corePlugins, envPlugin } from "./get-vite-config.js";
|
|
5
6
|
import { getVinxiFolder } from "./vinxi-codegen.js";
|
|
6
7
|
export function createVinxiApp(args) {
|
|
7
8
|
const log = args.log ?? new StatefulLog({ label: "Build" });
|
|
@@ -110,24 +111,25 @@ export function createVinxiApp(args) {
|
|
|
110
111
|
base: joinURL(args.publicUrl, folderName),
|
|
111
112
|
};
|
|
112
113
|
}),
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
114
|
+
{
|
|
115
|
+
name: "bypass-api",
|
|
116
|
+
type: "http",
|
|
117
|
+
base: "/_bypass/",
|
|
118
|
+
handler: `${folder}/handler.bypass.ts`,
|
|
119
|
+
target: "server",
|
|
120
|
+
plugins: () => [
|
|
121
|
+
tsconfigPaths(),
|
|
122
|
+
envPlugin({
|
|
123
|
+
rootDir: args.rootDir,
|
|
124
|
+
console: log,
|
|
125
|
+
mode: args.mode,
|
|
126
|
+
publicUrl: args.publicUrl,
|
|
127
|
+
serverless: true,
|
|
128
|
+
target: "frontend",
|
|
129
|
+
client: false,
|
|
130
|
+
}),
|
|
131
|
+
],
|
|
132
|
+
},
|
|
131
133
|
// {
|
|
132
134
|
// name: "wp-proxy",
|
|
133
135
|
// type: "http",
|
|
@@ -177,6 +177,36 @@ export function createVinxiCodegen(opts) {
|
|
|
177
177
|
},
|
|
178
178
|
});
|
|
179
179
|
if (opts.serverless) {
|
|
180
|
+
codegen.registerFile({
|
|
181
|
+
name: "handler.bypass.ts",
|
|
182
|
+
generate: code /* tsx */ `
|
|
183
|
+
/// <reference types="vinxi/types/server" />
|
|
184
|
+
import { createRouter, eventHandler, getRouterParam, getQuery, getWebRequest, getRequestHeaders, getRequestURL, setCookie } from "vinxi/http"
|
|
185
|
+
import { serverContext } from "./context.js"
|
|
186
|
+
const router = createRouter()
|
|
187
|
+
.get(
|
|
188
|
+
"/setBypassCookie/",
|
|
189
|
+
eventHandler(async (event) => {
|
|
190
|
+
const bypassToken = process.env.VERCEL_BYPASS_TOKEN
|
|
191
|
+
const cookieName = "__prerender_bypass"
|
|
192
|
+
|
|
193
|
+
setCookie(event, "eddev", "true", {
|
|
194
|
+
expires: new Date(Date.now() + 1000 * 60 * 60 * 24),
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
return {
|
|
198
|
+
status: 200,
|
|
199
|
+
headers: {
|
|
200
|
+
"content-type": "text/plain",
|
|
201
|
+
},
|
|
202
|
+
body: bypassToken,
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
}),
|
|
206
|
+
)
|
|
207
|
+
export default router.handler
|
|
208
|
+
`,
|
|
209
|
+
});
|
|
180
210
|
// codegen.registerFile({
|
|
181
211
|
// name: "handler.data-api.ts",
|
|
182
212
|
// generate: code/* tsx */ `
|