@nuxt/kit 3.3.1 → 3.3.3

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.
Files changed (2) hide show
  1. package/dist/index.mjs +6 -5
  2. package/package.json +8 -7
package/dist/index.mjs CHANGED
@@ -165,10 +165,11 @@ ${issues.toString()}`);
165
165
  if (definition.hooks) {
166
166
  nuxt.hooks.addHooks(definition.hooks);
167
167
  }
168
- const mark = performance.mark();
168
+ const key = `nuxt:module:${uniqueKey || Math.round(Math.random() * 1e4)}`;
169
+ const mark = performance.mark(key);
169
170
  const res = await definition.setup?.call(null, _options, nuxt) ?? {};
170
- const perf = performance.measure(`nuxt:module:${uniqueKey || Math.round(Math.random() * 1e4)}`, mark.name);
171
- const setupTime = Math.round(perf.duration * 100) / 100;
171
+ const perf = performance.measure(key, mark?.name);
172
+ const setupTime = perf ? Math.round(perf.duration * 100) / 100 : 0;
172
173
  if (setupTime > 5e3) {
173
174
  logger.warn(`Slow module \`${uniqueKey || "<no name>"}\` took \`${setupTime}ms\` to setup.`);
174
175
  } else if (nuxt.options.debug) {
@@ -731,8 +732,8 @@ function normalizeTemplate(template) {
731
732
  }
732
733
  return template;
733
734
  }
734
- function updateTemplates(options) {
735
- return useNuxt().hooks.callHook("builder:generateApp", options);
735
+ async function updateTemplates(options) {
736
+ return await tryUseNuxt()?.hooks.callHook("builder:generateApp", options);
736
737
  }
737
738
 
738
739
  function addLayout(template, name) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/kit",
3
- "version": "3.3.1",
3
+ "version": "3.3.3",
4
4
  "repository": "nuxt/nuxt",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -8,7 +8,8 @@
8
8
  "exports": {
9
9
  ".": {
10
10
  "types": "./dist/index.d.ts",
11
- "import": "./dist/index.mjs"
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.mjs"
12
13
  },
13
14
  "./package.json": "./package.json"
14
15
  },
@@ -16,14 +17,13 @@
16
17
  "dist"
17
18
  ],
18
19
  "dependencies": {
19
- "@nuxt/schema": "3.3.1",
20
20
  "c12": "^1.2.0",
21
21
  "consola": "^2.15.3",
22
22
  "defu": "^6.1.2",
23
23
  "globby": "^13.1.3",
24
24
  "hash-sum": "^2.0.0",
25
25
  "ignore": "^5.2.4",
26
- "jiti": "^1.17.2",
26
+ "jiti": "^1.18.2",
27
27
  "knitwork": "^1.0.0",
28
28
  "lodash.template": "^4.5.0",
29
29
  "mlly": "^1.2.0",
@@ -32,11 +32,12 @@
32
32
  "scule": "^1.0.0",
33
33
  "semver": "^7.3.8",
34
34
  "unctx": "^2.1.2",
35
- "unimport": "^3.0.2",
36
- "untyped": "^1.2.2"
35
+ "unimport": "^3.0.4",
36
+ "untyped": "^1.3.2",
37
+ "@nuxt/schema": "3.3.3"
37
38
  },
38
39
  "devDependencies": {
39
- "@types/lodash.template": "^4",
40
+ "@types/lodash.template": "^4.5.1",
40
41
  "@types/semver": "^7.3.13",
41
42
  "unbuild": "latest"
42
43
  },