@nuxt/bridge-edge 3.3.1-28735063.574e7ee → 3.3.1-28745713.5493b4e

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.
@@ -7,7 +7,7 @@ import { genObjectFromRawEntries, genDynamicImport } from 'knitwork';
7
7
  import fse from 'fs-extra';
8
8
  import { debounce } from 'perfect-debounce';
9
9
  import { isIgnored, logger } from '@nuxt/kit';
10
- import { h as hashId, u as uniq, g as generateDevSSRManifest, i as isCSS } from '../shared/bridge-edge.90dc9deb.mjs';
10
+ import { h as hashId, u as uniq, g as generateDevSSRManifest, i as isCSS } from '../shared/bridge-edge.facfe0f1.mjs';
11
11
  import { c as createIsExternal } from './vite.mjs';
12
12
  import 'h3';
13
13
  import 'node-fetch';
@@ -3,7 +3,7 @@ import hash from 'hash-sum';
3
3
  import { resolve } from 'pathe';
4
4
  import { genImport, genObjectFromRawEntries } from 'knitwork';
5
5
 
6
- const version = "3.3.1-28735063.574e7ee";
6
+ const version = "3.3.1-28745713.5493b4e";
7
7
 
8
8
  const middlewareTemplate = {
9
9
  filename: "middleware.js",
@@ -2,7 +2,7 @@ import { normalize, isAbsolute, resolve as resolve$1, join } from 'pathe';
2
2
  import { logger, isIgnored } from '@nuxt/kit';
3
3
  import { resolve, findExports, sanitizeFilePath } from 'mlly';
4
4
  import { joinURL, withoutLeadingSlash, withTrailingSlash } from 'ufo';
5
- import { t as transpile, d as distDir, i as isCSS, p as prepareManifests, a as pkgDir } from '../shared/bridge-edge.90dc9deb.mjs';
5
+ import { t as transpile, d as distDir, i as isCSS, p as prepareManifests, a as pkgDir } from '../shared/bridge-edge.facfe0f1.mjs';
6
6
  import createVuePlugin from '@vitejs/plugin-vue2';
7
7
  import { getPort } from 'get-port-please';
8
8
  import { toNodeListener, createApp, defineEventHandler, defineLazyEventHandler, eventHandler, createError } from 'h3';
@@ -299,6 +299,11 @@ async function buildClient(ctx) {
299
299
  "process.static": false,
300
300
  // use `process.client` instead. `process.browser` is deprecated
301
301
  "process.browser": true,
302
+ "import.meta.client": true,
303
+ "import.meta.server": false,
304
+ "import.meta.browser": true,
305
+ "import.meta.nitro": false,
306
+ "import.meta.prerender": false,
302
307
  "module.hot": false
303
308
  },
304
309
  cacheDir: resolve$1(ctx.nuxt.options.rootDir, "node_modules/.cache/vite/client"),
@@ -437,7 +442,10 @@ async function buildServer(ctx) {
437
442
  "process.client": false,
438
443
  "process.static": false,
439
444
  // use `process.client` instead. `process.browser` is deprecated
440
- "process.browser": false
445
+ "process.browser": false,
446
+ "import.meta.server": true,
447
+ "import.meta.client": false,
448
+ "import.meta.browser": false
441
449
  },
442
450
  cacheDir: resolve$1(ctx.nuxt.options.rootDir, "node_modules/.cache/vite/server"),
443
451
  resolve: {
package/dist/module.d.mts CHANGED
@@ -1,62 +1,53 @@
1
- /// <reference types="nitropack" />
2
1
  import { NuxtModule } from '@nuxt/schema';
3
2
 
4
- interface BridgeConfig {
5
- nitro: boolean
6
- nitroGenerator: boolean
7
- vite: boolean | {
8
- /**
9
- * If set to false, `@vitejs/plugin-legacy` not used.
10
- */
11
- legacy?: boolean
12
- }
13
- app: boolean | {}
14
- capi: boolean | {
15
- legacy?: boolean
16
- }
17
- /**
18
- * @deprecated use `imports.autoImport` instead to disable auto-importing.
19
- * @see {@link https://nuxt.com/docs/guide/concepts/auto-imports#disabling-auto-imports}
20
- */
21
- imports: boolean
22
- /** @deprecated */
23
- autoImports?: boolean
24
- transpile: boolean
25
- compatibility: boolean
26
- postcss8: boolean
27
- resolve: boolean
28
- typescript: boolean | {
29
- /**
30
- * @deprecated please use `esbuild` instead
31
- */
32
- isTSX?: boolean
33
- /**
34
- * If `vite: false`, setting `esbuild: true` will use `esbuild-loader`
35
- * to process `.ts`/`.tsx` files within your project.
36
- */
37
- esbuild?: boolean
38
- }
39
- meta: boolean | null
40
- macros: false | {
41
- pageMeta: boolean
42
- }
43
- }
44
-
45
- declare module '@nuxt/bridge-schema' {
46
- interface Nuxt2Config {
47
- bridge?: Partial<BridgeConfig> | false
48
- }
49
- }
50
-
51
- declare module 'nitropack' {
52
- interface NitroRouteConfig {
53
- ssr?: boolean
54
- }
55
- interface NitroRouteOptions {
56
- ssr?: boolean
57
- }
58
- }
59
-
60
- declare const _default: NuxtModule<BridgeConfig>;
3
+ declare const _default: NuxtModule<{
4
+ nitro: boolean;
5
+ nitroGenerator: boolean;
6
+ vite: boolean | {
7
+ legacy?: boolean;
8
+ };
9
+ app: boolean | {};
10
+ capi: boolean | {
11
+ legacy?: boolean;
12
+ };
13
+ imports: boolean;
14
+ autoImports: boolean;
15
+ transpile: boolean;
16
+ compatibility: boolean;
17
+ postcss8: boolean;
18
+ resolve: boolean;
19
+ typescript: boolean | {
20
+ isTSX?: boolean;
21
+ esbuild?: boolean;
22
+ };
23
+ meta: boolean;
24
+ macros: false | {
25
+ pageMeta: boolean;
26
+ };
27
+ }, {
28
+ nitro: boolean;
29
+ nitroGenerator: boolean;
30
+ vite: boolean | {
31
+ legacy?: boolean;
32
+ };
33
+ app: boolean | {};
34
+ capi: boolean | {
35
+ legacy?: boolean;
36
+ };
37
+ imports: boolean;
38
+ autoImports: boolean;
39
+ transpile: boolean;
40
+ compatibility: boolean;
41
+ postcss8: boolean;
42
+ resolve: boolean;
43
+ typescript: boolean | {
44
+ isTSX?: boolean;
45
+ esbuild?: boolean;
46
+ };
47
+ meta: boolean;
48
+ macros: false | {
49
+ pageMeta: boolean;
50
+ };
51
+ }, false>;
61
52
 
62
53
  export { _default as default };
package/dist/module.d.ts CHANGED
@@ -1,62 +1,53 @@
1
- /// <reference types="nitropack" />
2
1
  import { NuxtModule } from '@nuxt/schema';
3
2
 
4
- interface BridgeConfig {
5
- nitro: boolean
6
- nitroGenerator: boolean
7
- vite: boolean | {
8
- /**
9
- * If set to false, `@vitejs/plugin-legacy` not used.
10
- */
11
- legacy?: boolean
12
- }
13
- app: boolean | {}
14
- capi: boolean | {
15
- legacy?: boolean
16
- }
17
- /**
18
- * @deprecated use `imports.autoImport` instead to disable auto-importing.
19
- * @see {@link https://nuxt.com/docs/guide/concepts/auto-imports#disabling-auto-imports}
20
- */
21
- imports: boolean
22
- /** @deprecated */
23
- autoImports?: boolean
24
- transpile: boolean
25
- compatibility: boolean
26
- postcss8: boolean
27
- resolve: boolean
28
- typescript: boolean | {
29
- /**
30
- * @deprecated please use `esbuild` instead
31
- */
32
- isTSX?: boolean
33
- /**
34
- * If `vite: false`, setting `esbuild: true` will use `esbuild-loader`
35
- * to process `.ts`/`.tsx` files within your project.
36
- */
37
- esbuild?: boolean
38
- }
39
- meta: boolean | null
40
- macros: false | {
41
- pageMeta: boolean
42
- }
43
- }
44
-
45
- declare module '@nuxt/bridge-schema' {
46
- interface Nuxt2Config {
47
- bridge?: Partial<BridgeConfig> | false
48
- }
49
- }
50
-
51
- declare module 'nitropack' {
52
- interface NitroRouteConfig {
53
- ssr?: boolean
54
- }
55
- interface NitroRouteOptions {
56
- ssr?: boolean
57
- }
58
- }
59
-
60
- declare const _default: NuxtModule<BridgeConfig>;
3
+ declare const _default: NuxtModule<{
4
+ nitro: boolean;
5
+ nitroGenerator: boolean;
6
+ vite: boolean | {
7
+ legacy?: boolean;
8
+ };
9
+ app: boolean | {};
10
+ capi: boolean | {
11
+ legacy?: boolean;
12
+ };
13
+ imports: boolean;
14
+ autoImports: boolean;
15
+ transpile: boolean;
16
+ compatibility: boolean;
17
+ postcss8: boolean;
18
+ resolve: boolean;
19
+ typescript: boolean | {
20
+ isTSX?: boolean;
21
+ esbuild?: boolean;
22
+ };
23
+ meta: boolean;
24
+ macros: false | {
25
+ pageMeta: boolean;
26
+ };
27
+ }, {
28
+ nitro: boolean;
29
+ nitroGenerator: boolean;
30
+ vite: boolean | {
31
+ legacy?: boolean;
32
+ };
33
+ app: boolean | {};
34
+ capi: boolean | {
35
+ legacy?: boolean;
36
+ };
37
+ imports: boolean;
38
+ autoImports: boolean;
39
+ transpile: boolean;
40
+ compatibility: boolean;
41
+ postcss8: boolean;
42
+ resolve: boolean;
43
+ typescript: boolean | {
44
+ isTSX?: boolean;
45
+ esbuild?: boolean;
46
+ };
47
+ meta: boolean;
48
+ macros: false | {
49
+ pageMeta: boolean;
50
+ };
51
+ }, false>;
61
52
 
62
53
  export { _default as default };
package/dist/module.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import '@nuxt/kit';
2
2
  import 'h3';
3
- export { m as default } from './shared/bridge-edge.90dc9deb.mjs';
3
+ export { m as default } from './shared/bridge-edge.facfe0f1.mjs';
4
4
  import 'fs';
5
5
  import 'url';
6
6
  import 'node-fetch';
@@ -1037,7 +1037,7 @@ function setupBetterResolve() {
1037
1037
  });
1038
1038
  }
1039
1039
 
1040
- const NODE_MODULES_RE$1 = /[\\/]node_modules[\\/]/;
1040
+ const NODE_MODULES_RE$2 = /[\\/]node_modules[\\/]/;
1041
1041
  const IMPORTS_RE = /(['"])#imports\1/;
1042
1042
  const TransformPlugin = createUnplugin(({ ctx, options }) => {
1043
1043
  return {
@@ -1061,7 +1061,7 @@ const TransformPlugin = createUnplugin(({ ctx, options }) => {
1061
1061
  },
1062
1062
  async transform(_code, id) {
1063
1063
  id = normalize(id);
1064
- const isNodeModule = NODE_MODULES_RE$1.test(id) && !options.transform?.include?.some((pattern) => pattern.test(id));
1064
+ const isNodeModule = NODE_MODULES_RE$2.test(id) && !options.transform?.include?.some((pattern) => pattern.test(id));
1065
1065
  if (isNodeModule && !IMPORTS_RE.test(_code)) {
1066
1066
  return;
1067
1067
  }
@@ -1698,7 +1698,7 @@ async function generateWebpackBuildManifest() {
1698
1698
  await writeClientManifest(manifest, nuxt.options.buildDir);
1699
1699
  }
1700
1700
 
1701
- const NODE_MODULES_RE = /[\\/]node_modules[\\/]/;
1701
+ const NODE_MODULES_RE$1 = /[\\/]node_modules[\\/]/;
1702
1702
  const HAS_MACRO_RE = /\bdefinePageMeta\s*\(\s*/;
1703
1703
  const PageMetaPlugin = createUnplugin(
1704
1704
  (options) => {
@@ -1716,7 +1716,7 @@ const PageMetaPlugin = createUnplugin(
1716
1716
  },
1717
1717
  transform(code, id) {
1718
1718
  id = normalize(id);
1719
- const isNodeModule = NODE_MODULES_RE.test(id);
1719
+ const isNodeModule = NODE_MODULES_RE$1.test(id);
1720
1720
  if (isNodeModule) {
1721
1721
  return;
1722
1722
  }
@@ -1869,6 +1869,38 @@ const pageMetaModule = defineNuxtModule({
1869
1869
  }
1870
1870
  });
1871
1871
 
1872
+ const NODE_MODULES_RE = /[\\/]node_modules[\\/]/;
1873
+ const ImportMetaPlugin = createUnplugin(() => {
1874
+ return {
1875
+ name: "nuxt:import-meta-transform",
1876
+ enforce: "post",
1877
+ transformInclude(id) {
1878
+ const { pathname } = parseURL(
1879
+ decodeURIComponent(pathToFileURL$1(id).href)
1880
+ );
1881
+ const extensions = [".js", ".vue", ".ts", ".jsx", ".tsx", ".mjs"];
1882
+ if (extensions.some((ext) => pathname.endsWith(ext))) {
1883
+ return true;
1884
+ }
1885
+ },
1886
+ transform(code, id) {
1887
+ id = normalize(id);
1888
+ const isNodeModule = NODE_MODULES_RE.test(id);
1889
+ if (isNodeModule) {
1890
+ return;
1891
+ }
1892
+ const s = new MagicString(code);
1893
+ s.replace(/import\.meta\.client/g, "process.client").replace(/import\.meta\.server/g, "process.server").replace(/import\.meta\.browser/g, "process.browser").replace(/import\.meta\.nitro/g, "process.nitro").replace(/import\.meta\.prerender/g, "process.prerender");
1894
+ if (s.hasChanged()) {
1895
+ return {
1896
+ code: s.toString(),
1897
+ map: s.generateMap({ hires: true })
1898
+ };
1899
+ }
1900
+ }
1901
+ };
1902
+ });
1903
+
1872
1904
  const module = defineNuxtModule({
1873
1905
  meta: {
1874
1906
  name: "nuxt-bridge",
@@ -2013,6 +2045,7 @@ const module = defineNuxtModule({
2013
2045
  getContents: () => "export default false"
2014
2046
  });
2015
2047
  }
2048
+ addWebpackPlugin(ImportMetaPlugin.webpack);
2016
2049
  }
2017
2050
  });
2018
2051
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/bridge-edge",
3
- "version": "3.3.1-28735063.574e7ee",
3
+ "version": "3.3.1-28745713.5493b4e",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/bridge.git"
@@ -22,16 +22,16 @@
22
22
  "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
23
23
  "@babel/plugin-proposal-optional-chaining": "^7.21.0",
24
24
  "@babel/plugin-transform-typescript": "^7.25.2",
25
- "@nuxt/bridge-schema": "npm:@nuxt/bridge-schema-edge@3.3.1-28735063.574e7ee",
25
+ "@nuxt/bridge-schema": "npm:@nuxt/bridge-schema-edge@3.3.1-28745713.5493b4e",
26
26
  "@nuxt/devalue": "^2.0.2",
27
- "@nuxt/kit": "3.12.4",
27
+ "@nuxt/kit": "3.13.0",
28
28
  "@nuxt/postcss8": "^1.1.3",
29
- "@nuxt/schema": "3.12.4",
29
+ "@nuxt/schema": "3.13.0",
30
30
  "@nuxt/ui-templates": "^1.3.4",
31
31
  "@rollup/plugin-replace": "^5.0.7",
32
- "@unhead/ssr": "^1.9.16",
33
- "@unhead/vue": "^1.9.16",
34
- "@vitejs/plugin-legacy": "^5.4.1",
32
+ "@unhead/ssr": "^1.10.0",
33
+ "@unhead/vue": "^1.10.0",
34
+ "@vitejs/plugin-legacy": "^5.4.2",
35
35
  "@vitejs/plugin-vue2": "^2.3.1",
36
36
  "acorn": "^8.12.1",
37
37
  "cookie-es": "^1.2.2",
@@ -54,27 +54,27 @@
54
54
  "mlly": "^1.7.1",
55
55
  "nitropack": "^2.9.7",
56
56
  "node-fetch": "^3.3.2",
57
- "nypm": "^0.3.9",
57
+ "nypm": "^0.3.11",
58
58
  "ofetch": "^1.3.4",
59
59
  "ohash": "^1.1.3",
60
60
  "pathe": "^1.1.2",
61
61
  "perfect-debounce": "^1.0.0",
62
- "pkg-types": "^1.1.3",
62
+ "pkg-types": "^1.2.0",
63
63
  "postcss": "^8.4.41",
64
64
  "postcss-import": "^16.1.0",
65
65
  "postcss-import-resolver": "^2.0.0",
66
- "postcss-preset-env": "^10.0.0",
66
+ "postcss-preset-env": "^10.0.2",
67
67
  "postcss-url": "^10.1.3",
68
68
  "scule": "^1.3.0",
69
69
  "semver": "^7.6.3",
70
70
  "std-env": "^3.7.0",
71
- "terser": "^5.31.5",
71
+ "terser": "^5.31.6",
72
72
  "ufo": "^1.5.4",
73
73
  "unctx": "^2.3.1",
74
- "unimport": "^3.10.0",
75
- "unplugin": "^1.12.1",
74
+ "unimport": "^3.11.1",
75
+ "unplugin": "^1.12.2",
76
76
  "untyped": "^1.4.2",
77
- "vite": "~5.4.0",
77
+ "vite": "~5.4.2",
78
78
  "vite-node": "^2.0.5",
79
79
  "vue-bundle-renderer": "^2.1.0"
80
80
  },
@@ -86,7 +86,7 @@
86
86
  "@types/hash-sum": "^1.0.2",
87
87
  "@types/node-fetch": "^3.0.2",
88
88
  "nuxt": "^2.18.1",
89
- "rollup": "^4.20.0",
89
+ "rollup": "^4.21.0",
90
90
  "unbuild": "2.0.0",
91
91
  "vue": "^2.7.15",
92
92
  "vue-router": "^3.6.5"