vike 0.4.252-commit-7f781cf → 0.4.252-commit-1d0a050

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.
@@ -9,7 +9,7 @@ import path from 'node:path';
9
9
  import crypto from 'node:crypto';
10
10
  import pc from '@brillout/picocolors';
11
11
  import { import_ } from '@brillout/import';
12
- import { assert, assertWarning, assertUsage } from '../../../../utils/assert.js';
12
+ import { assert, assertWarning } from '../../../../utils/assert.js';
13
13
  import { assertIsNotProductionRuntime } from '../../../../utils/assertSetup.js';
14
14
  import { createDebug } from '../../../../utils/debug.js';
15
15
  import { genPromise } from '../../../../utils/genPromise.js';
@@ -39,7 +39,12 @@ async function transpileAndExecuteFile(filePath, userRootDir, isExtensionConfig,
39
39
  }
40
40
  const { promise, resolve } = genPromise();
41
41
  esbuildCache.transpileCache[filePathAbsoluteFilesystem] = promise;
42
- assertUsage(isPlainScriptFile(filePathAbsoluteFilesystem), `${filePathToShowToUserResolved} has file extension .${fileExtension} but a config file can only be a JavaScript/TypeScript file`);
42
+ /* We tolerate .tsx so that a file can be both a runtime and config file (`meta.env.config === true && meta.env.server === true`), e.g. https://github.com/brillout/docpress/issues/86
43
+ assertUsage(
44
+ isPlainScriptFile(filePathAbsoluteFilesystem),
45
+ `${filePathToShowToUserResolved} has file extension .${fileExtension} but a config file can only be a JavaScript/TypeScript file`,
46
+ )
47
+ */
43
48
  const isHeader = isHeaderFile(filePathAbsoluteFilesystem);
44
49
  if (isHeader) {
45
50
  assertWarning(false, `${pc.cyan('.h.js')} files are deprecated: simply renaming ${filePathToShowToUserResolved} to ${removeHeaderFileExtension(filePathToShowToUserResolved)} is usually enough, although you may occasionally need to use ${pc.cyan("with { type: 'pointer' }")} as explained at https://vike.dev/config#pointer-imports`, { onlyOnce: true });
@@ -1 +1 @@
1
- export declare const PROJECT_VERSION: "0.4.252-commit-7f781cf";
1
+ export declare const PROJECT_VERSION: "0.4.252-commit-1d0a050";
@@ -1,2 +1,2 @@
1
1
  // Automatically updated by @brillout/release-me
2
- export const PROJECT_VERSION = '0.4.252-commit-7f781cf';
2
+ export const PROJECT_VERSION = '0.4.252-commit-1d0a050';
@@ -1 +1,2 @@
1
+ /** Test whether the environment is a *real* browser (not a browser simulation such as `jsdom`). */
1
2
  export declare function isBrowser(): boolean;
@@ -1,5 +1,7 @@
1
+ /** Test whether the environment is a *real* browser (not a browser simulation such as `jsdom`). */
1
2
  export function isBrowser() {
2
- // Using `typeof window !== 'undefined'` alone is not enough because some users use https://www.npmjs.com/package/ssr-window
3
- return typeof window !== 'undefined' && typeof window.scrollY === 'number';
4
- // Alternatively, test whether environment is a *real* browser: https://github.com/brillout/picocolors/blob/d59a33a0fd52a8a33e4158884069192a89ce0113/picocolors.js#L87-L89
3
+ // - Using `typeof window !== 'undefined'` alone isn't narrow enough because some users use https://www.npmjs.com/package/ssr-window
4
+ // - Using `typeof window !== "undefined" && typeof window.scrollY === "number"` still isn't narrow enough because of jsdom
5
+ // - https://github.com/jsdom/jsdom/issues/1537#issuecomment-1689368267
6
+ return Object.getOwnPropertyDescriptor(globalThis, 'window')?.get?.toString().includes('[native code]') ?? false;
5
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.252-commit-7f781cf",
3
+ "version": "0.4.252-commit-1d0a050",
4
4
  "repository": "https://github.com/vikejs/vike",
5
5
  "exports": {
6
6
  "./server": {
@@ -153,7 +153,7 @@
153
153
  "node": ">=20.19.0"
154
154
  },
155
155
  "license": "MIT",
156
- "description": "The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.",
156
+ "description": "(Replaces Next.js/Nuxt) 🔨 Composable framework to build (advanced) applications with flexibility and stability.",
157
157
  "keywords": [
158
158
  "vite-plugin",
159
159
  "ssr",