vike 0.4.171-commit-bb72501 → 0.4.171-commit-f9548df
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/addSsrMiddleware.js +12 -4
- package/dist/cjs/node/prerender/runPrerender.js +30 -11
- package/dist/cjs/node/prerender/utils.js +1 -0
- package/dist/cjs/node/runtime/renderPage/executeOnRenderHtmlHook.js +7 -7
- package/dist/cjs/node/runtime/renderPage/loadUserFilesServerSide.js +4 -5
- package/dist/cjs/node/runtime/renderPage/preparePageContextForUserConsumptionServerSide.js +2 -2
- package/dist/cjs/node/runtime/renderPage/renderPageAlreadyRouted.js +22 -3
- package/dist/cjs/node/runtime/utils.js +1 -0
- package/dist/cjs/shared/{addUrlComputedProps.js → getPageContextUrlComputed.js} +50 -42
- package/dist/cjs/shared/route/index.js +2 -2
- package/dist/cjs/shared/route/resolveRouteFunction.js +2 -2
- package/dist/cjs/shared/utils.js +2 -0
- package/dist/cjs/utils/assert.js +1 -1
- package/dist/cjs/utils/assertNodeVersion.js +1 -1
- package/dist/cjs/utils/changeEnumerable.js +9 -0
- package/dist/cjs/utils/normalizeHeaders.js +13 -0
- package/dist/cjs/utils/objectAssign.js +1 -1
- package/dist/cjs/utils/objectDefineProperty.js +8 -0
- package/dist/cjs/utils/projectInfo.js +1 -1
- package/dist/esm/client/client-routing-runtime/createPageContext.d.ts +4 -2
- package/dist/esm/client/client-routing-runtime/createPageContext.js +4 -3
- package/dist/esm/client/client-routing-runtime/getPageContextFromHooks.js +11 -7
- package/dist/esm/client/shared/loadUserFilesClientSide.js +4 -4
- package/dist/esm/node/plugin/shared/addSsrMiddleware.js +9 -4
- package/dist/esm/node/prerender/runPrerender.js +31 -12
- package/dist/esm/node/prerender/utils.d.ts +1 -0
- package/dist/esm/node/prerender/utils.js +1 -0
- package/dist/esm/node/runtime/renderPage/executeOnRenderHtmlHook.js +7 -7
- package/dist/esm/node/runtime/renderPage/loadUserFilesServerSide.d.ts +1 -9
- package/dist/esm/node/runtime/renderPage/loadUserFilesServerSide.js +4 -5
- package/dist/esm/node/runtime/renderPage/preparePageContextForUserConsumptionServerSide.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/preparePageContextForUserConsumptionServerSide.js +2 -2
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.d.ts +55 -46
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.js +23 -4
- package/dist/esm/node/runtime/utils.d.ts +1 -0
- package/dist/esm/node/runtime/utils.js +1 -0
- package/dist/esm/shared/{addUrlComputedProps.d.ts → getPageContextUrlComputed.d.ts} +23 -21
- package/dist/esm/shared/{addUrlComputedProps.js → getPageContextUrlComputed.js} +50 -42
- package/dist/esm/shared/route/index.d.ts +3 -3
- package/dist/esm/shared/route/index.js +2 -2
- package/dist/esm/shared/route/resolveRouteFunction.d.ts +2 -2
- package/dist/esm/shared/route/resolveRouteFunction.js +2 -2
- package/dist/esm/shared/types.d.ts +24 -4
- package/dist/esm/shared/utils.d.ts +2 -0
- package/dist/esm/shared/utils.js +2 -0
- package/dist/esm/types/index.d.ts +1 -1
- package/dist/esm/utils/assert.js +1 -1
- package/dist/esm/utils/assertNodeVersion.js +1 -1
- package/dist/esm/utils/changeEnumerable.d.ts +2 -0
- package/dist/esm/utils/changeEnumerable.js +5 -0
- package/dist/esm/utils/normalizeHeaders.d.ts +1 -0
- package/dist/esm/utils/normalizeHeaders.js +9 -0
- package/dist/esm/utils/objectAssign.js +1 -1
- package/dist/esm/utils/objectDefineProperty.d.ts +4 -0
- package/dist/esm/utils/objectDefineProperty.js +4 -0
- package/dist/esm/utils/projectInfo.d.ts +2 -2
- package/dist/esm/utils/projectInfo.js +1 -1
- package/package.json +2 -2
|
@@ -1,45 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Object.assign(pageContext2, pageContext)
|
|
15
|
-
// ❌ Also breaks the property getters
|
|
16
|
-
const pageContext3 = { ...pageContext }
|
|
17
|
-
// ✅ Preserves property getters of pageContext (see objectAssign() implementation)
|
|
18
|
-
objectAssign(pageContext2, pageContext)
|
|
19
|
-
```
|
|
20
|
-
*/
|
|
21
|
-
assert(isPropertyGetter(pageContext, 'urlPathname'));
|
|
22
|
-
}
|
|
23
|
-
if ('urlParsed' in pageContext)
|
|
24
|
-
assert(isPropertyGetter(pageContext, 'urlParsed'));
|
|
25
|
-
// TODO/v1-release: move pageContext.urlParsed to pageContext.url
|
|
26
|
-
if ('url' in pageContext)
|
|
27
|
-
assert(isPropertyGetter(pageContext, 'url'));
|
|
28
|
-
Object.defineProperty(pageContext, 'urlPathname', {
|
|
1
|
+
export { getPageContextUrlComputed };
|
|
2
|
+
export { assertPageContextUrl };
|
|
3
|
+
// =====================
|
|
4
|
+
// File determining the URL logic.
|
|
5
|
+
// URLs need to be computed, because the user can modify the URL e.g. with onBeforeRoute() for i18n.
|
|
6
|
+
// =====================
|
|
7
|
+
import { objectDefineProperty } from '../utils/objectDefineProperty.js';
|
|
8
|
+
import { assert, parseUrl, assertWarning, isPlainObject, isPropertyGetter, isBrowser, changeEnumerable } from './utils.js';
|
|
9
|
+
function getPageContextUrlComputed(pageContext) {
|
|
10
|
+
assert(typeof pageContext.urlOriginal === 'string');
|
|
11
|
+
assertPageContextUrlComputed(pageContext);
|
|
12
|
+
const pageContextUrlComputed = {};
|
|
13
|
+
objectDefineProperty(pageContextUrlComputed, 'urlPathname', {
|
|
29
14
|
get: urlPathnameGetter,
|
|
30
|
-
enumerable,
|
|
15
|
+
enumerable: true,
|
|
31
16
|
configurable: true
|
|
32
17
|
});
|
|
33
|
-
|
|
18
|
+
objectDefineProperty(pageContextUrlComputed, 'url', {
|
|
34
19
|
get: urlGetter,
|
|
35
20
|
enumerable: false,
|
|
36
21
|
configurable: true
|
|
37
22
|
});
|
|
38
|
-
|
|
23
|
+
objectDefineProperty(pageContextUrlComputed, 'urlParsed', {
|
|
39
24
|
get: urlParsedGetter,
|
|
40
|
-
enumerable,
|
|
25
|
+
enumerable: true,
|
|
41
26
|
configurable: true
|
|
42
27
|
});
|
|
28
|
+
return pageContextUrlComputed;
|
|
43
29
|
}
|
|
44
30
|
function getUrlParsed(pageContext) {
|
|
45
31
|
// We need a url handler function because the onBeforeRoute() hook may set pageContext.urlLogical (typically for i18n)
|
|
@@ -90,7 +76,7 @@ function urlParsedGetter() {
|
|
|
90
76
|
const { origin, pathname, pathnameOriginal, search, searchAll, searchOriginal, hash, hashOriginal } = urlParsedOriginal;
|
|
91
77
|
const hashIsAvailable = isBrowser();
|
|
92
78
|
const warnHashNotAvailable = (prop) => {
|
|
93
|
-
assertWarning(hashIsAvailable, `pageContext.urlParsed.${prop} isn't available on the server-side (HTTP requests don't include the URL hash
|
|
79
|
+
assertWarning(hashIsAvailable, `pageContext.urlParsed.${prop} isn't available on the server-side (HTTP requests don't include the URL hash)`, { onlyOnce: true, showStackTrace: true });
|
|
94
80
|
};
|
|
95
81
|
const urlParsed = {
|
|
96
82
|
origin,
|
|
@@ -120,21 +106,43 @@ function urlParsedGetter() {
|
|
|
120
106
|
return searchOriginal;
|
|
121
107
|
}
|
|
122
108
|
};
|
|
123
|
-
|
|
124
|
-
|
|
109
|
+
changeEnumerable(urlParsed, 'hashString', false);
|
|
110
|
+
changeEnumerable(urlParsed, 'searchString', false);
|
|
125
111
|
if (!hashIsAvailable) {
|
|
126
|
-
|
|
127
|
-
|
|
112
|
+
changeEnumerable(urlParsed, 'hash', false);
|
|
113
|
+
changeEnumerable(urlParsed, 'hashOriginal', false);
|
|
128
114
|
}
|
|
129
115
|
return urlParsed;
|
|
130
116
|
}
|
|
131
|
-
function
|
|
132
|
-
const descriptor = Object.getOwnPropertyDescriptor(obj, prop);
|
|
133
|
-
Object.defineProperty(obj, prop, { ...descriptor, enumerable: false });
|
|
134
|
-
}
|
|
135
|
-
function assertPageContextUrlComputedProps(pageContext) {
|
|
117
|
+
function assertPageContextUrl(pageContext) {
|
|
136
118
|
assert(typeof pageContext.urlOriginal === 'string');
|
|
137
119
|
assert(typeof pageContext.urlPathname === 'string');
|
|
138
120
|
assert(isPlainObject(pageContext.urlParsed));
|
|
139
121
|
assert(pageContext.urlPathname === pageContext.urlParsed.pathname);
|
|
122
|
+
assertPageContextUrlComputed(pageContext);
|
|
123
|
+
}
|
|
124
|
+
function assertPageContextUrlComputed(pageContext) {
|
|
125
|
+
/*
|
|
126
|
+
If the isPropertyGetter() assertions fail then it's most likely because Object.assign() was used instead of `objectAssign()`:
|
|
127
|
+
```js
|
|
128
|
+
const PageContextUrlComputed = getPageContextUrlComputed(pageContext)
|
|
129
|
+
|
|
130
|
+
// ❌ Breaks the property getters of pageContext set by getPageContextUrlComputed() such as pageContext.urlPathname
|
|
131
|
+
Object.assign(pageContext, pageContextUrlComputed)
|
|
132
|
+
|
|
133
|
+
// ❌ Also breaks property getters
|
|
134
|
+
const pageContext = { ...pageContextUrlComputed }
|
|
135
|
+
|
|
136
|
+
// ✅ Preserves property getters of pageContext (see objectAssign() implementation)
|
|
137
|
+
objectAssign(pageContext, pageContextUrlComputed)
|
|
138
|
+
```
|
|
139
|
+
*/
|
|
140
|
+
if ('urlPathname' in pageContext) {
|
|
141
|
+
assert(typeof pageContext.urlPathname === 'string');
|
|
142
|
+
assert(isPropertyGetter(pageContext, 'urlPathname'));
|
|
143
|
+
}
|
|
144
|
+
if ('urlParsed' in pageContext)
|
|
145
|
+
assert(isPropertyGetter(pageContext, 'urlParsed'));
|
|
146
|
+
if ('url' in pageContext)
|
|
147
|
+
assert(isPropertyGetter(pageContext, 'url'));
|
|
140
148
|
}
|
|
@@ -4,18 +4,18 @@ export type { PageContextFromRoute };
|
|
|
4
4
|
export type { PageRoutes };
|
|
5
5
|
export type { RouteMatches };
|
|
6
6
|
import type { PageFile } from '../getPageFiles.js';
|
|
7
|
-
import {
|
|
7
|
+
import { type PageContextUrlInternal, type PageContextUrlSource } from '../getPageContextUrlComputed.js';
|
|
8
8
|
import type { PageRoutes, RouteType } from './loadPageRoutes.js';
|
|
9
9
|
import type { PageConfigRuntime, PageConfigGlobalRuntime } from '../page-configs/PageConfig.js';
|
|
10
10
|
import type { Hook } from '../hooks/getHook.js';
|
|
11
|
-
type PageContextForRoute =
|
|
11
|
+
type PageContextForRoute = PageContextUrlInternal & {
|
|
12
12
|
_pageFilesAll: PageFile[];
|
|
13
13
|
_pageConfigs: PageConfigRuntime[];
|
|
14
14
|
_allPageIds: string[];
|
|
15
15
|
_pageConfigGlobal: PageConfigGlobalRuntime;
|
|
16
16
|
_pageRoutes: PageRoutes;
|
|
17
17
|
_onBeforeRouteHook: Hook | null;
|
|
18
|
-
} &
|
|
18
|
+
} & PageContextUrlSource;
|
|
19
19
|
type PageContextFromRoute = {
|
|
20
20
|
_pageId: string | null;
|
|
21
21
|
routeParams: Record<string, string>;
|
|
@@ -6,7 +6,7 @@ if (isBrowser()) {
|
|
|
6
6
|
assertClientRouting();
|
|
7
7
|
}
|
|
8
8
|
import { assert, assertUsage, isPlainObject, objectAssign } from './utils.js';
|
|
9
|
-
import {
|
|
9
|
+
import { assertPageContextUrl } from '../getPageContextUrlComputed.js';
|
|
10
10
|
import { resolvePrecendence } from './resolvePrecedence.js';
|
|
11
11
|
import { resolveRouteString } from './resolveRouteString.js';
|
|
12
12
|
import { resolveRouteFunction } from './resolveRouteFunction.js';
|
|
@@ -15,7 +15,7 @@ import { debug } from './debug.js';
|
|
|
15
15
|
import pc from '@brillout/picocolors';
|
|
16
16
|
async function route(pageContextForRoute) {
|
|
17
17
|
debug('Pages routes:', pageContextForRoute._pageRoutes);
|
|
18
|
-
|
|
18
|
+
assertPageContextUrl(pageContextForRoute);
|
|
19
19
|
const pageContextFromRoute = {};
|
|
20
20
|
// onBeforeRoute()
|
|
21
21
|
const pageContextFromOnBeforeRouteHook = await executeOnBeforeRouteHook(pageContextForRoute);
|
|
@@ -2,8 +2,8 @@ export { resolveRouteFunction };
|
|
|
2
2
|
export { assertRouteParams };
|
|
3
3
|
export { assertSyncRouting };
|
|
4
4
|
export { warnDeprecatedAllowKey };
|
|
5
|
-
import {
|
|
6
|
-
declare function resolveRouteFunction(routeFunction: Function, pageContext:
|
|
5
|
+
import { PageContextUrlInternal } from '../getPageContextUrlComputed.js';
|
|
6
|
+
declare function resolveRouteFunction(routeFunction: Function, pageContext: PageContextUrlInternal, routeDefinedAtString: string): Promise<null | {
|
|
7
7
|
precedence: number | null;
|
|
8
8
|
routeParams: Record<string, string>;
|
|
9
9
|
}>;
|
|
@@ -2,11 +2,11 @@ export { resolveRouteFunction };
|
|
|
2
2
|
export { assertRouteParams };
|
|
3
3
|
export { assertSyncRouting };
|
|
4
4
|
export { warnDeprecatedAllowKey };
|
|
5
|
-
import {
|
|
5
|
+
import { assertPageContextUrl } from '../getPageContextUrlComputed.js';
|
|
6
6
|
import { assert, assertUsage, assertWarning, hasProp, isPlainObject, isPromise } from './utils.js';
|
|
7
7
|
import pc from '@brillout/picocolors';
|
|
8
8
|
async function resolveRouteFunction(routeFunction, pageContext, routeDefinedAtString) {
|
|
9
|
-
|
|
9
|
+
assertPageContextUrl(pageContext);
|
|
10
10
|
let result = routeFunction(pageContext);
|
|
11
11
|
assertSyncRouting(result, `The Route Function ${routeDefinedAtString}`);
|
|
12
12
|
// TODO/v1-release: make resolveRouteFunction() and route() sync
|
|
@@ -7,7 +7,7 @@ export { PageContextBuiltInServerInternal };
|
|
|
7
7
|
export { PageContextBuiltInServer_deprecated as PageContextBuiltInServer };
|
|
8
8
|
export { PageContextBuiltInClientWithClientRouting_deprecated as PageContextBuiltInClientWithClientRouting };
|
|
9
9
|
export { PageContextBuiltInClientWithServerRouting_deprecated as PageContextBuiltInClientWithServerRouting };
|
|
10
|
-
import type {
|
|
10
|
+
import type { PageContextUrlInternal, PageContextUrlClient, PageContextUrlServer } from './getPageContextUrlComputed.js';
|
|
11
11
|
import type { ConfigEntries, ExportsAll, From, Source, Sources } from './getPageFiles/getExports.js';
|
|
12
12
|
import type { Config } from './page-configs/Config.js';
|
|
13
13
|
import type { PageContextConfig } from './page-configs/Config/PageContextConfig.js';
|
|
@@ -59,6 +59,26 @@ type PageContextBuiltInCommon<Data> = {
|
|
|
59
59
|
* https://vike.dev/renderPage
|
|
60
60
|
*/
|
|
61
61
|
urlOriginal: string;
|
|
62
|
+
/**
|
|
63
|
+
* The HTTP Headers of the incoming HTTP Request.
|
|
64
|
+
*
|
|
65
|
+
* As a string object normalized by Vike.
|
|
66
|
+
*
|
|
67
|
+
* See also:
|
|
68
|
+
* - https://vike.dev/headers
|
|
69
|
+
* - `pageContext.headersOriginal`
|
|
70
|
+
*/
|
|
71
|
+
headers: Record<string, string> | null;
|
|
72
|
+
/**
|
|
73
|
+
* The HTTP Headers of the incoming HTTP Request.
|
|
74
|
+
*
|
|
75
|
+
* The original object provided by the server.
|
|
76
|
+
*
|
|
77
|
+
* See also:
|
|
78
|
+
* - https://vike.dev/headers
|
|
79
|
+
* - `pageContext.headers`
|
|
80
|
+
*/
|
|
81
|
+
headersOriginal?: unknown;
|
|
62
82
|
/** If an error occurs, whether the error is a `404 Page Not Found`.
|
|
63
83
|
*
|
|
64
84
|
* https://vike.dev/error-page
|
|
@@ -99,7 +119,7 @@ type PageContextBuiltInCommon<Data> = {
|
|
|
99
119
|
/** @deprecated */
|
|
100
120
|
pageExports: Record<string, unknown>;
|
|
101
121
|
};
|
|
102
|
-
type PageContextBuiltInServer<Data> = PageContextBuiltInCommon<Data> &
|
|
122
|
+
type PageContextBuiltInServer<Data> = PageContextBuiltInCommon<Data> & PageContextUrlServer;
|
|
103
123
|
type PageContextBuiltInClientWithClientRouting<Data> = Partial<PageContextBuiltInCommon<Data>> & Pick<PageContextBuiltInCommon<Data>, 'Page' | 'pageExports' | 'config' | 'configEntries' | 'exports' | 'exportsAll' | 'abortReason' | 'data' | 'source' | 'sources' | 'from'> & {
|
|
104
124
|
/** Whether the current page is already rendered to HTML */
|
|
105
125
|
isHydration: boolean;
|
|
@@ -109,7 +129,7 @@ type PageContextBuiltInClientWithClientRouting<Data> = Partial<PageContextBuiltI
|
|
|
109
129
|
* The value is `true` when the user clicks on his browser's backward navigation button, or when invoking `history.back()`.
|
|
110
130
|
*/
|
|
111
131
|
isBackwardNavigation: boolean | null;
|
|
112
|
-
} &
|
|
132
|
+
} & PageContextUrlClient;
|
|
113
133
|
type PageContextBuiltInClientWithServerRouting<Data> = Partial<PageContextBuiltInCommon<Data>> & Pick<PageContextBuiltInCommon<Data>, 'Page' | 'pageExports' | 'exports' | 'abortReason' | 'data'> & {
|
|
114
134
|
/**
|
|
115
135
|
* Whether the current page is already rendered to HTML.
|
|
@@ -125,7 +145,7 @@ type PageContextBuiltInClientWithServerRouting<Data> = Partial<PageContextBuiltI
|
|
|
125
145
|
isBackwardNavigation: null;
|
|
126
146
|
};
|
|
127
147
|
/** For Vike internal use */
|
|
128
|
-
type PageContextBuiltInServerInternal = Omit<PageContextBuiltInCommon<unknown> &
|
|
148
|
+
type PageContextBuiltInServerInternal = Omit<PageContextBuiltInCommon<unknown> & PageContextUrlInternal, 'data'>;
|
|
129
149
|
/** @deprecated
|
|
130
150
|
* Replace:
|
|
131
151
|
* ```
|
|
@@ -21,3 +21,5 @@ export * from '../utils/checkType.js';
|
|
|
21
21
|
export * from '../utils/getValuePrintable.js';
|
|
22
22
|
export * from '../utils/escapeRegex.js';
|
|
23
23
|
export * from '../utils/isArray.js';
|
|
24
|
+
export * from '../utils/changeEnumerable.js';
|
|
25
|
+
export * from '../utils/objectDefineProperty.js';
|
package/dist/esm/shared/utils.js
CHANGED
|
@@ -25,3 +25,5 @@ export * from '../utils/checkType.js';
|
|
|
25
25
|
export * from '../utils/getValuePrintable.js';
|
|
26
26
|
export * from '../utils/escapeRegex.js';
|
|
27
27
|
export * from '../utils/isArray.js';
|
|
28
|
+
export * from '../utils/changeEnumerable.js';
|
|
29
|
+
export * from '../utils/objectDefineProperty.js';
|
|
@@ -10,7 +10,7 @@ export type { Config, ConfigMeta as Meta, DataAsync, DataSync, GuardAsync, Guard
|
|
|
10
10
|
export type { ConfigEnv } from '../shared/page-configs/PageConfig.js';
|
|
11
11
|
export type { ConfigDefinition, ConfigEffect } from '../node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js';
|
|
12
12
|
export type { ConfigEntries } from '../shared/getPageFiles/getExports.js';
|
|
13
|
-
export type { Url } from '../shared/
|
|
13
|
+
export type { Url } from '../shared/getPageContextUrlComputed.js';
|
|
14
14
|
export type { InjectFilterEntry } from '../node/runtime/html/injectAssets/getHtmlTags.js';
|
|
15
15
|
export { defineConfig } from './defineConfig.js';
|
|
16
16
|
import type { ConfigEnv } from '../shared/page-configs/PageConfig.js';
|
package/dist/esm/utils/assert.js
CHANGED
|
@@ -92,7 +92,7 @@ function assertWarning(condition, msg, { onlyOnce, showStackTrace }) {
|
|
|
92
92
|
}
|
|
93
93
|
globalObject.onBeforeLog?.();
|
|
94
94
|
if (showStackTrace) {
|
|
95
|
-
const err =
|
|
95
|
+
const err = createErrorWithCleanStackTrace(msg, numberOfStackTraceLinesToRemove);
|
|
96
96
|
globalObject.showStackTraceList.add(err);
|
|
97
97
|
globalObject.logger(err, 'warn');
|
|
98
98
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalizeHeaders(headersOriginal: unknown): Record<string, string>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function normalizeHeaders(
|
|
2
|
+
/* This type is precise, too precise which can be annoying: e.g. cannot pass a string[][] argument because it doesn't match the more precise [string,string][] type.
|
|
3
|
+
headersOriginal ConstructorParameters<typeof Headers>[0]
|
|
4
|
+
*/
|
|
5
|
+
headersOriginal) {
|
|
6
|
+
const headersStandard = new Headers(headersOriginal);
|
|
7
|
+
const headers = Object.fromEntries(headersStandard.entries());
|
|
8
|
+
return headers;
|
|
9
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { objectAssign };
|
|
2
2
|
// Same as Object.assign() but:
|
|
3
3
|
// - With type inference
|
|
4
|
-
// - Preserves property descriptors, which we need for preserving the getters added by
|
|
4
|
+
// - Preserves property descriptors, which we need for preserving the getters added by getPageContextUrlComputed()
|
|
5
5
|
function objectAssign(obj, objAddendum) {
|
|
6
6
|
if (objAddendum) {
|
|
7
7
|
Object.defineProperties(obj, Object.getOwnPropertyDescriptors(objAddendum));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Like Object.defineProperty() but with type inference */
|
|
2
|
+
export declare function objectDefineProperty<Obj extends object, Prop extends PropertyKey, PropertyType>(obj: Obj, prop: Prop, { get, ...args }: {
|
|
3
|
+
get: () => PropertyType;
|
|
4
|
+
} & Omit<PropertyDescriptor, 'set' | 'get'>): asserts obj is Obj & Record<Prop, PropertyType>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { projectInfo };
|
|
2
2
|
export { PROJECT_VERSION };
|
|
3
|
-
declare const PROJECT_VERSION: "0.4.171-commit-
|
|
3
|
+
declare const PROJECT_VERSION: "0.4.171-commit-f9548df";
|
|
4
4
|
declare const projectInfo: {
|
|
5
5
|
projectName: "Vike";
|
|
6
|
-
projectVersion: "0.4.171-commit-
|
|
6
|
+
projectVersion: "0.4.171-commit-f9548df";
|
|
7
7
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vike",
|
|
3
|
-
"version": "0.4.171-commit-
|
|
3
|
+
"version": "0.4.171-commit-f9548df",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "tsc --watch",
|
|
6
6
|
"build": "rimraf dist/ && pnpm run build:esm && pnpm run build:cjs",
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
"vite": "npm:@brillout/vite@5.1.0-commit-3dc7abd"
|
|
217
217
|
},
|
|
218
218
|
"engines": {
|
|
219
|
-
"node": ">=
|
|
219
|
+
"node": ">=18.0.0"
|
|
220
220
|
},
|
|
221
221
|
"description": "Like Next.js/Nuxt but as do-one-thing-do-it-well Vite plugin.",
|
|
222
222
|
"repository": "https://github.com/vikejs/vike",
|