vike 0.4.142-commit-8bf568b → 0.4.142-commit-937cb3b
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/shared/loggerNotProd.js +2 -2
- package/dist/cjs/utils/parseUrl.js +6 -1
- package/dist/cjs/utils/projectInfo.js +1 -1
- package/dist/esm/node/plugin/shared/loggerNotProd.js +2 -2
- package/dist/esm/utils/parseUrl.js +6 -1
- package/dist/esm/utils/projectInfo.d.ts +1 -1
- package/dist/esm/utils/projectInfo.js +1 -1
- package/package.json +1 -1
|
@@ -199,9 +199,9 @@ function logErrorDebugNote() {
|
|
|
199
199
|
store.errorDebugNoteAlreadyShown = true;
|
|
200
200
|
}
|
|
201
201
|
const msg = picocolors_1.default.dim([
|
|
202
|
-
'
|
|
202
|
+
'┌──────────────────────────────────────────────────────────┐',
|
|
203
203
|
"│ Error isn't helpful? See https://vike.dev/errors#verbose │",
|
|
204
|
-
'
|
|
204
|
+
'└──────────────────────────────────────────────────────────┘'
|
|
205
205
|
].join('\n'));
|
|
206
206
|
(0, log_js_1.logDirectly)(msg, 'error');
|
|
207
207
|
}
|
|
@@ -112,7 +112,10 @@ function parsePathname(urlWithoutHashNorSearch, baseServer) {
|
|
|
112
112
|
else {
|
|
113
113
|
// In the browser, this is the Base URL of the current URL
|
|
114
114
|
// Safe access `window?.document?.baseURI` for users who shim `window` in Node.js
|
|
115
|
-
|
|
115
|
+
let baseURI = typeof window !== 'undefined' && window?.document?.baseURI;
|
|
116
|
+
if (baseURI)
|
|
117
|
+
baseURI = parseOrigin(baseURI).pathname;
|
|
118
|
+
const base = baseURI || baseServer;
|
|
116
119
|
const pathname = resolveUrlPathnameRelative(urlWithoutHashNorSearch, base);
|
|
117
120
|
// We need to parse the origin in case `base === window.document.baseURI`
|
|
118
121
|
const parsed = parseOrigin(pathname);
|
|
@@ -155,6 +158,8 @@ function resolveUrlPathnameRelative(pathnameRelative, base) {
|
|
|
155
158
|
let pathnameAbsolute = stack.join('/');
|
|
156
159
|
if (baseRestoreTrailingSlash && !pathnameAbsolute.endsWith('/'))
|
|
157
160
|
pathnameAbsolute += '/';
|
|
161
|
+
if (!pathnameAbsolute.startsWith('/'))
|
|
162
|
+
pathnameAbsolute = '/' + pathnameAbsolute;
|
|
158
163
|
return pathnameAbsolute;
|
|
159
164
|
}
|
|
160
165
|
/* Not needed anymore?
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.projectInfo = void 0;
|
|
4
4
|
const assertSingleInstance_js_1 = require("./assertSingleInstance.js");
|
|
5
|
-
const PROJECT_VERSION = '0.4.142-commit-
|
|
5
|
+
const PROJECT_VERSION = '0.4.142-commit-937cb3b';
|
|
6
6
|
const projectInfo = {
|
|
7
7
|
projectName: 'Vike',
|
|
8
8
|
projectVersion: PROJECT_VERSION,
|
|
@@ -194,9 +194,9 @@ function logErrorDebugNote() {
|
|
|
194
194
|
store.errorDebugNoteAlreadyShown = true;
|
|
195
195
|
}
|
|
196
196
|
const msg = pc.dim([
|
|
197
|
-
'
|
|
197
|
+
'┌──────────────────────────────────────────────────────────┐',
|
|
198
198
|
"│ Error isn't helpful? See https://vike.dev/errors#verbose │",
|
|
199
|
-
'
|
|
199
|
+
'└──────────────────────────────────────────────────────────┘'
|
|
200
200
|
].join('\n'));
|
|
201
201
|
logDirectly(msg, 'error');
|
|
202
202
|
}
|
|
@@ -110,7 +110,10 @@ function parsePathname(urlWithoutHashNorSearch, baseServer) {
|
|
|
110
110
|
else {
|
|
111
111
|
// In the browser, this is the Base URL of the current URL
|
|
112
112
|
// Safe access `window?.document?.baseURI` for users who shim `window` in Node.js
|
|
113
|
-
|
|
113
|
+
let baseURI = typeof window !== 'undefined' && window?.document?.baseURI;
|
|
114
|
+
if (baseURI)
|
|
115
|
+
baseURI = parseOrigin(baseURI).pathname;
|
|
116
|
+
const base = baseURI || baseServer;
|
|
114
117
|
const pathname = resolveUrlPathnameRelative(urlWithoutHashNorSearch, base);
|
|
115
118
|
// We need to parse the origin in case `base === window.document.baseURI`
|
|
116
119
|
const parsed = parseOrigin(pathname);
|
|
@@ -153,6 +156,8 @@ function resolveUrlPathnameRelative(pathnameRelative, base) {
|
|
|
153
156
|
let pathnameAbsolute = stack.join('/');
|
|
154
157
|
if (baseRestoreTrailingSlash && !pathnameAbsolute.endsWith('/'))
|
|
155
158
|
pathnameAbsolute += '/';
|
|
159
|
+
if (!pathnameAbsolute.startsWith('/'))
|
|
160
|
+
pathnameAbsolute = '/' + pathnameAbsolute;
|
|
156
161
|
return pathnameAbsolute;
|
|
157
162
|
}
|
|
158
163
|
/* Not needed anymore?
|
|
@@ -5,7 +5,7 @@ type ProjectVersion = typeof projectInfo.projectVersion;
|
|
|
5
5
|
type ProjectTag = `[${PackageName}]` | `[${PackageName}@${ProjectVersion}]`;
|
|
6
6
|
declare const projectInfo: {
|
|
7
7
|
projectName: "Vike";
|
|
8
|
-
projectVersion: "0.4.142-commit-
|
|
8
|
+
projectVersion: "0.4.142-commit-937cb3b";
|
|
9
9
|
npmPackageName: "vike";
|
|
10
10
|
githubRepository: "https://github.com/vikejs/vike";
|
|
11
11
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { projectInfo };
|
|
2
2
|
import { onProjectInfo } from './assertSingleInstance.js';
|
|
3
|
-
const PROJECT_VERSION = '0.4.142-commit-
|
|
3
|
+
const PROJECT_VERSION = '0.4.142-commit-937cb3b';
|
|
4
4
|
const projectInfo = {
|
|
5
5
|
projectName: 'Vike',
|
|
6
6
|
projectVersion: PROJECT_VERSION,
|