vike 0.4.197-commit-1251ed9 → 0.4.198-commit-081c85f
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/cjs/node/plugin/plugins/fileEnv.js +3 -0
- package/dist/cjs/node/plugin/shared/loggerNotProd.js +1 -1
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/client/client-routing-runtime/getPageContextCurrent.d.ts +0 -2
- package/dist/esm/client/client-routing-runtime/getPageContextCurrent.js +4 -16
- package/dist/esm/client/client-routing-runtime/prefetch.js +0 -1
- package/dist/esm/node/plugin/plugins/fileEnv.js +3 -0
- package/dist/esm/node/plugin/shared/loggerNotProd.js +1 -1
- package/dist/esm/shared/types.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/projectInfo.d.ts +1 -1
- package/package.json +1 -1
|
@@ -22,6 +22,9 @@ function fileEnv() {
|
|
|
22
22
|
return;
|
|
23
23
|
if (skip(id))
|
|
24
24
|
return;
|
|
25
|
+
// For `.vue` files: https://github.com/vikejs/vike/issues/1912#issuecomment-2394981475
|
|
26
|
+
if (id.endsWith('?direct'))
|
|
27
|
+
id = id.slice(0, -1 * '?direct'.length);
|
|
25
28
|
const moduleInfo = viteDevServer.moduleGraph.getModuleById(id);
|
|
26
29
|
(0, utils_js_1.assert)(moduleInfo);
|
|
27
30
|
const importers = Array.from(moduleInfo.importers)
|
|
@@ -185,7 +185,7 @@ function logErrorDebugNote() {
|
|
|
185
185
|
return;
|
|
186
186
|
store.errorDebugNoteAlreadyShown = true;
|
|
187
187
|
}
|
|
188
|
-
const msg = picocolors_1.default.dim((0, utils_js_1.formatHintLog)("Error isn't helpful? See https://vike.dev/
|
|
188
|
+
const msg = picocolors_1.default.dim((0, utils_js_1.formatHintLog)("Error isn't helpful? See https://vike.dev/debug#verbose-errors"));
|
|
189
189
|
(0, log_js_1.logDirectly)(msg, 'error');
|
|
190
190
|
}
|
|
191
191
|
function getCategory(httpRequestId = null) {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
export { setPageContextCurrent };
|
|
2
2
|
export { getPageContextCurrent };
|
|
3
|
-
export { getPageContextCurrentAsync };
|
|
4
3
|
import type { PageContextExports } from '../../shared/getPageFiles.js';
|
|
5
4
|
type PageContextCurrent = PageContextExports & {
|
|
6
5
|
urlPathname: string;
|
|
7
6
|
};
|
|
8
7
|
declare function getPageContextCurrent(): null | PageContextCurrent;
|
|
9
|
-
declare function getPageContextCurrentAsync(): Promise<PageContextCurrent>;
|
|
10
8
|
declare function setPageContextCurrent(pageContextCurrent: PageContextCurrent): void;
|
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
export { setPageContextCurrent };
|
|
2
2
|
export { getPageContextCurrent };
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return {
|
|
8
|
-
pageContextCurrent: null,
|
|
9
|
-
pageContextCurrentPromise,
|
|
10
|
-
pageContextCurrentPromiseResolve
|
|
11
|
-
};
|
|
12
|
-
})());
|
|
3
|
+
import { getGlobalObject } from './utils.js';
|
|
4
|
+
const globalObject = getGlobalObject('getPageContextCurrent.ts', {
|
|
5
|
+
pageContextCurrent: null
|
|
6
|
+
});
|
|
13
7
|
function getPageContextCurrent() {
|
|
14
8
|
const { pageContextCurrent } = globalObject;
|
|
15
9
|
return pageContextCurrent;
|
|
16
10
|
}
|
|
17
|
-
// TODO/pageContext-prefetch: I think we can remove this? Once we use Vike's default if pageContextCurrent isn't defined yet.
|
|
18
|
-
async function getPageContextCurrentAsync() {
|
|
19
|
-
const pageContextCurrent = await globalObject.pageContextCurrentPromise;
|
|
20
|
-
return pageContextCurrent;
|
|
21
|
-
}
|
|
22
11
|
function setPageContextCurrent(pageContextCurrent) {
|
|
23
12
|
globalObject.pageContextCurrent = pageContextCurrent;
|
|
24
|
-
globalObject.pageContextCurrentPromiseResolve(pageContextCurrent);
|
|
25
13
|
}
|
|
@@ -17,6 +17,9 @@ function fileEnv() {
|
|
|
17
17
|
return;
|
|
18
18
|
if (skip(id))
|
|
19
19
|
return;
|
|
20
|
+
// For `.vue` files: https://github.com/vikejs/vike/issues/1912#issuecomment-2394981475
|
|
21
|
+
if (id.endsWith('?direct'))
|
|
22
|
+
id = id.slice(0, -1 * '?direct'.length);
|
|
20
23
|
const moduleInfo = viteDevServer.moduleGraph.getModuleById(id);
|
|
21
24
|
assert(moduleInfo);
|
|
22
25
|
const importers = Array.from(moduleInfo.importers)
|
|
@@ -180,7 +180,7 @@ function logErrorDebugNote() {
|
|
|
180
180
|
return;
|
|
181
181
|
store.errorDebugNoteAlreadyShown = true;
|
|
182
182
|
}
|
|
183
|
-
const msg = pc.dim(formatHintLog("Error isn't helpful? See https://vike.dev/
|
|
183
|
+
const msg = pc.dim(formatHintLog("Error isn't helpful? See https://vike.dev/debug#verbose-errors"));
|
|
184
184
|
logDirectly(msg, 'error');
|
|
185
185
|
}
|
|
186
186
|
function getCategory(httpRequestId = null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.198-commit-081c85f";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.
|
|
2
|
+
export const PROJECT_VERSION = '0.4.198-commit-081c85f';
|