nuxt-gin-tools 0.1.14 → 0.1.16

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/.air.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  root = "."
2
2
  testdata_dir = "testdata"
3
- .build/.server_dir = ".build/.server"
3
+ tmp_dir= ".build/.server"
4
4
 
5
5
  [build]
6
6
  args_bin = []
package/dev.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
package/dev.go ADDED
@@ -0,0 +1,32 @@
1
+ package main
2
+
3
+ import (
4
+ "log"
5
+ "os"
6
+ "os/exec"
7
+ "runtime"
8
+ )
9
+
10
+ func main() {
11
+ // 构建命令
12
+ cmd := exec.Command("~/go/bin/air", "-c", "node_modules/nuxt-gin-tools/.air.toml")
13
+
14
+ // 如果是windows,运行air
15
+ if runtime.GOOS == "windows" {
16
+ cmd = exec.Command("air", "-c", "node_modules/nuxt-gin-tools/.air.toml")
17
+ }
18
+
19
+ // 设置标准输出和错误输出
20
+ cmd.Stdout = os.Stdout
21
+ cmd.Stderr = os.Stderr
22
+
23
+ // 启动命令
24
+ if err := cmd.Start(); err != nil {
25
+ log.Fatalf("Failed to start air: %v", err)
26
+ }
27
+
28
+ // 等待命令完成
29
+ if err := cmd.Wait(); err != nil {
30
+ log.Fatalf("Air command finished with error: %v", err)
31
+ }
32
+ }
package/dev.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const concurrently_1 = __importDefault(require("concurrently"));
7
+ const fs_extra_1 = require("fs-extra");
8
+ const path_1 = require("path");
9
+ const cwd = process.cwd();
10
+ const serverConfig = (0, fs_extra_1.readJSONSync)((0, path_1.join)(cwd, "server.config.json"));
11
+ (0, concurrently_1.default)([
12
+ {
13
+ command: `nuxt dev --port ${serverConfig.port}`,
14
+ name: "nuxt",
15
+ prefixColor: "yellow",
16
+ },
17
+ ]);
package/go.mod ADDED
@@ -0,0 +1,3 @@
1
+ module nuxt-gin
2
+
3
+ go 1.24.3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-gin-tools",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "This project is used as a dependency for [nuxt-gin-starter](https://github.com/RapboyGao/nuxt-gin-starter.git)",
5
5
  "bin": {
6
6
  "nuxt-gin": "index.js"
package/src/develop.js CHANGED
@@ -44,6 +44,7 @@ function develop() {
44
44
  yield (0, cleanup_1.default)();
45
45
  yield (0, postinstall_1.default)();
46
46
  }
47
+ (0, fs_extra_1.ensureDirSync)((0, path_1.join)(cwd, ".build/.server"));
47
48
  yield (0, concurrently_1.default)([
48
49
  {
49
50
  command: getAirCommand(),
@@ -1,3 +1,4 @@
1
+ import type { NuxtConfig } from "nuxt/config";
1
2
  export interface ServerConfigJson {
2
3
  /**
3
4
  * 前端基础 URL
@@ -53,62 +54,4 @@ export interface MyNuxtConfig {
53
54
  * });
54
55
  * ```
55
56
  */
56
- export declare function createDefaultConfig({ serverConfig, apiBasePath }: MyNuxtConfig): {
57
- buildDir: string;
58
- srcDir: string;
59
- ssr: boolean;
60
- /**
61
- * 配置实验性功能
62
- * 禁用 payloadExtraction 功能,该功能可能用于提取页面的有效负载数据
63
- * 这里禁用它可能是为了避免某些兼容性问题或特定的项目需求
64
- */
65
- experimental: {
66
- payloadExtraction: boolean;
67
- };
68
- devtools: {
69
- timeline: {
70
- enabled: boolean;
71
- };
72
- };
73
- /**
74
- * 配置应用的基础 URL
75
- * 从 server.config.json 文件中获取 baseUrl 作为应用的基础 URL
76
- * 这个基础 URL 将用于构建应用的路由和请求地址
77
- */
78
- app: {
79
- baseURL: string;
80
- };
81
- /**
82
- * 配置开发服务器的端口号
83
- * 从 server.config.json 文件中获取 nuxtPort 作为开发服务器的端口号
84
- * 启动开发服务器时,将使用该端口号进行监听
85
- */
86
- devServer: {
87
- port: number;
88
- cors: {
89
- origin: string;
90
- methods: string[];
91
- allowHeaders: string[];
92
- credentials: boolean;
93
- maxAge: string;
94
- };
95
- };
96
- nitro: {
97
- output: {
98
- dir: string;
99
- };
100
- devProxy: {
101
- [x: string]: {
102
- target: string;
103
- changeOrigin: boolean;
104
- };
105
- };
106
- };
107
- vite: {
108
- plugins: never[];
109
- esbuild: {
110
- jsxFactory: string;
111
- jsxFragment: string;
112
- };
113
- };
114
- };
57
+ export function createDefaultConfig({ serverConfig, apiBasePath }: MyNuxtConfig): NuxtConfig;