@edgeone/nuxt-pages 1.0.0 → 1.0.2
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/README.md +7 -27
- package/dist/build/plugin-context.js +1 -1
- package/dist/esm-chunks/{chunk-RPSYO4VM.js → chunk-SHMQI7KT.js} +8 -0
- package/dist/index.js +10 -1
- package/dist/run/handlers/cache.cjs +1 -1
- package/dist/run/handlers/tags-handler.cjs +1 -1
- package/dist/run/handlers/use-cache-handler.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# EdgeOne Nuxt Deploy
|
|
2
2
|
|
|
3
|
-
A professional deployment package that seamlessly deploys your Nuxt 3 applications to Tencent Cloud EdgeOne platform with optimized performance and intelligent caching.
|
|
3
|
+
A professional deployment package that seamlessly deploys your Nuxt 3/4 applications to Tencent Cloud EdgeOne platform with optimized performance and intelligent caching.
|
|
4
4
|
|
|
5
5
|
## ✨ Features
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ A professional deployment package that seamlessly deploys your Nuxt 3 applicatio
|
|
|
14
14
|
|
|
15
15
|
## 📋 Requirements
|
|
16
16
|
|
|
17
|
-
- **Nuxt**: 3
|
|
17
|
+
- **Nuxt**: 3+
|
|
18
18
|
- **Node.js**: 18.x or higher
|
|
19
19
|
- **EdgeOne**: Tencent Cloud EdgeOne account
|
|
20
20
|
|
|
@@ -23,7 +23,7 @@ A professional deployment package that seamlessly deploys your Nuxt 3 applicatio
|
|
|
23
23
|
### Installation
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
npm install @
|
|
26
|
+
npm install @edgeone/nuxt-pages
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
### Basic Usage
|
|
@@ -32,7 +32,7 @@ npm install @tencent/nuxt-pages
|
|
|
32
32
|
|
|
33
33
|
```javascript
|
|
34
34
|
// In your build script or CI/CD pipeline
|
|
35
|
-
import { onPreBuild, onBuild, onPostBuild } from '@
|
|
35
|
+
import { onPreBuild, onBuild, onPostBuild } from '@edgeone/nuxt-pages'
|
|
36
36
|
|
|
37
37
|
const buildOptions = {
|
|
38
38
|
cwd: process.cwd(),
|
|
@@ -194,7 +194,7 @@ Your Nuxt app will be available at `http://localhost:9000`
|
|
|
194
194
|
## 🚨 Compatibility
|
|
195
195
|
|
|
196
196
|
### Supported Features
|
|
197
|
-
- ✅ Nuxt 3
|
|
197
|
+
- ✅ Nuxt 3+
|
|
198
198
|
- ✅ Server-Side Rendering (SSR)
|
|
199
199
|
- ✅ Static Site Generation (SSG)
|
|
200
200
|
- ✅ API Routes
|
|
@@ -204,13 +204,13 @@ Your Nuxt app will be available at `http://localhost:9000`
|
|
|
204
204
|
|
|
205
205
|
### Known Limitations
|
|
206
206
|
- ❌ `@nuxt/image` module (under development)
|
|
207
|
-
- ⚠️ Nuxt versions below 3
|
|
207
|
+
- ⚠️ Nuxt versions below 3 (compatibility in progress)
|
|
208
208
|
|
|
209
209
|
## 🛠️ Troubleshooting
|
|
210
210
|
|
|
211
211
|
### Common Issues
|
|
212
212
|
|
|
213
|
-
1. **Build Fails**: Ensure Nuxt version is 3
|
|
213
|
+
1. **Build Fails**: Ensure Nuxt version is 3+
|
|
214
214
|
2. **Module Conflicts**: Check for unsupported modules like `@nuxt/image`
|
|
215
215
|
3. **Path Issues**: Verify your project structure matches expected layout
|
|
216
216
|
|
|
@@ -249,27 +249,7 @@ interface BuildOptions {
|
|
|
249
249
|
}
|
|
250
250
|
```
|
|
251
251
|
|
|
252
|
-
## 🤝 Contributing
|
|
253
|
-
|
|
254
|
-
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
255
|
-
|
|
256
252
|
## 📄 License
|
|
257
253
|
|
|
258
254
|
ISC License - see [LICENSE](LICENSE) file for details.
|
|
259
255
|
|
|
260
|
-
## 🔗 Links
|
|
261
|
-
|
|
262
|
-
- [GitHub Repository](https://github.com/q153877011/edgeone-nuxt-deploy)
|
|
263
|
-
- [Issues](https://github.com/q153877011/edgeone-nuxt-deploy/issues)
|
|
264
|
-
- [Tencent Cloud EdgeOne](https://cloud.tencent.com/product/eo)
|
|
265
|
-
- [Nuxt 3 Documentation](https://nuxt.com)
|
|
266
|
-
|
|
267
|
-
## 📞 Support
|
|
268
|
-
|
|
269
|
-
- 📧 Create an issue on GitHub
|
|
270
|
-
- 💬 Community discussions
|
|
271
|
-
- 📖 Check the documentation
|
|
272
|
-
|
|
273
|
-
---
|
|
274
|
-
|
|
275
|
-
Made with ❤️ by [Venzil](https://github.com/q153877011) for the Nuxt community.
|
|
@@ -352,6 +352,7 @@ var PluginContext = class {
|
|
|
352
352
|
return configPath;
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
|
+
console.log("Can't find nuxt.config.ts file");
|
|
355
356
|
return null;
|
|
356
357
|
}
|
|
357
358
|
/** Detect and locate server.mjs file */
|
|
@@ -545,6 +546,13 @@ var PluginContext = class {
|
|
|
545
546
|
return [];
|
|
546
547
|
}
|
|
547
548
|
}
|
|
549
|
+
async nuxtStaticGeneration() {
|
|
550
|
+
const nitroJSON = await readFile(join(this.outputDir, "nitro.json"), "utf-8") || "{}";
|
|
551
|
+
if (!nitroJSON) return false;
|
|
552
|
+
const nitroJSONData = JSON.parse(nitroJSON);
|
|
553
|
+
if (nitroJSONData.preset && nitroJSONData.preset === "static") return true;
|
|
554
|
+
return false;
|
|
555
|
+
}
|
|
548
556
|
/** Fails a build with a message and an optional error */
|
|
549
557
|
failBuild(message, error) {
|
|
550
558
|
console.error(message);
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import "./esm-chunks/chunk-NJ4SUJNF.js";
|
|
|
16
16
|
import "./esm-chunks/chunk-V2LFVP3C.js";
|
|
17
17
|
import {
|
|
18
18
|
PluginContext
|
|
19
|
-
} from "./esm-chunks/chunk-
|
|
19
|
+
} from "./esm-chunks/chunk-SHMQI7KT.js";
|
|
20
20
|
import {
|
|
21
21
|
createNuxtApiRoutesMeta,
|
|
22
22
|
createNuxtPagesRouteMeta
|
|
@@ -25,6 +25,7 @@ import "./esm-chunks/chunk-GX4Z7KQX.js";
|
|
|
25
25
|
import "./esm-chunks/chunk-6BT4RYQJ.js";
|
|
26
26
|
|
|
27
27
|
// src/index.ts
|
|
28
|
+
import { rm } from "node:fs/promises";
|
|
28
29
|
function checkNuxtVersion(version) {
|
|
29
30
|
const versionData = version.split(".");
|
|
30
31
|
if (versionData.length === 3 && Number(versionData[0]) < 3) {
|
|
@@ -32,6 +33,9 @@ function checkNuxtVersion(version) {
|
|
|
32
33
|
process.exit(1);
|
|
33
34
|
}
|
|
34
35
|
}
|
|
36
|
+
var removeServerHandler = async (ctx) => {
|
|
37
|
+
await rm(ctx.serverHandlerDir, { recursive: true, force: true });
|
|
38
|
+
};
|
|
35
39
|
var recordOldNitroConfig = null;
|
|
36
40
|
var onPreBuild = async (options) => {
|
|
37
41
|
try {
|
|
@@ -44,6 +48,11 @@ var onPreBuild = async (options) => {
|
|
|
44
48
|
};
|
|
45
49
|
var onBuild = async (options) => {
|
|
46
50
|
const ctx = new PluginContext(options);
|
|
51
|
+
const isStaticGeneration = await ctx.nuxtStaticGeneration();
|
|
52
|
+
if (isStaticGeneration) {
|
|
53
|
+
await removeServerHandler(ctx);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
47
56
|
await createServerHandler(ctx), await createNuxtPagesRouteMeta(ctx);
|
|
48
57
|
await createNuxtApiRoutesMeta(ctx);
|
|
49
58
|
await patchNitroHandler(ctx);
|
|
@@ -199,7 +199,7 @@ var getMemoizedKeyValueStoreBackedByRegionalBlobStore = (...args) => {
|
|
|
199
199
|
|
|
200
200
|
// package.json
|
|
201
201
|
var name = "@edgeone/nuxt-pages";
|
|
202
|
-
var version = "1.0.
|
|
202
|
+
var version = "1.0.2";
|
|
203
203
|
|
|
204
204
|
// src/run/handlers/tags-handler.cts
|
|
205
205
|
var purgeCacheUserAgent = `${name}@${version}`;
|
|
@@ -28,7 +28,7 @@ module.exports = __toCommonJS(tags_handler_exports);
|
|
|
28
28
|
|
|
29
29
|
// package.json
|
|
30
30
|
var name = "@edgeone/nuxt-pages";
|
|
31
|
-
var version = "1.0.
|
|
31
|
+
var version = "1.0.2";
|
|
32
32
|
|
|
33
33
|
// src/run/handlers/request-context.cts
|
|
34
34
|
var import_node_async_hooks = require("node:async_hooks");
|