nuxt-gin-tools 0.1.12 → 0.1.14

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 ADDED
@@ -0,0 +1,42 @@
1
+ root = "."
2
+ testdata_dir = "testdata"
3
+ .build/.server_dir = ".build/.server"
4
+
5
+ [build]
6
+ args_bin = []
7
+ bin = "./.build/.server/development.exe"
8
+ cmd = "go build -o ./.build/.server/development.exe ."
9
+ delay = 0
10
+ exclude_dir = ["assets", ".build/.server", "vendor", "testdata", "node_modules", "vue", "api", ".vscode", ".git"]
11
+ exclude_file = []
12
+ exclude_regex = ["_test.go"]
13
+ exclude_unchanged = false
14
+ follow_symlink = false
15
+ full_bin = ""
16
+ include_dir = []
17
+ include_ext = ["go", "tpl", ".build/.server", "html"]
18
+ include_file = []
19
+ kill_delay = "0s"
20
+ log = "build-errors.log"
21
+ rerun = false
22
+ rerun_delay = 500
23
+ send_interrupt = false
24
+ stop_on_error = false
25
+
26
+ [color]
27
+ app = ""
28
+ build = "yellow"
29
+ main = "magenta"
30
+ runner = "green"
31
+ watcher = "cyan"
32
+
33
+ [log]
34
+ main_only = false
35
+ time = true
36
+
37
+ [misc]
38
+ clean_on_exit = false
39
+
40
+ [screen]
41
+ clear_on_rebuild = false
42
+ keep_scroll = true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-gin-tools",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
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
@@ -30,10 +30,10 @@ const serverConfig = (0, fs_extra_1.readJSONSync)((0, path_1.join)(cwd, "server.
30
30
  */
31
31
  function getAirCommand() {
32
32
  if (os_1.default.platform() === "darwin") {
33
- return "~/go/bin/air";
33
+ return "~/go/bin/air -c node_modules/nuxt-gin-tools/.air.toml";
34
34
  }
35
35
  else {
36
- return "air";
36
+ return "air -c node_modules/nuxt-gin-tools/.air.toml";
37
37
  }
38
38
  }
39
39
  function develop() {
@@ -34,6 +34,24 @@ export interface MyNuxtConfig {
34
34
  * 创建默认的 Nuxt 配置
35
35
  * @param param0 包含服务器配置和 API 基础路径的参数对象
36
36
  * @returns Nuxt 配置对象
37
+ *
38
+ * 用法如下:
39
+ * ```typescript
40
+ * import { createDefaultConfig } from 'nuxt-gin-tools/src/nuxt-config';
41
+ * import type { NuxtConfig } from 'nuxt/config';
42
+ * import { defineNuxtConfig } from 'nuxt/config';
43
+ * import SERVER_CONFIG from './server.config.json';
44
+ * import { BASE_PATH } from './vue/composables/api/base';
45
+ *
46
+ * const config = createDefaultConfig({
47
+ * apiBasePath: BASE_PATH,
48
+ * serverConfig: SERVER_CONFIG,
49
+ * }) as NuxtConfig;
50
+ *
51
+ * export default defineNuxtConfig({
52
+ * ...config,
53
+ * });
54
+ * ```
37
55
  */
38
56
  export declare function createDefaultConfig({ serverConfig, apiBasePath }: MyNuxtConfig): {
39
57
  buildDir: string;
@@ -94,4 +112,3 @@ export declare function createDefaultConfig({ serverConfig, apiBasePath }: MyNux
94
112
  };
95
113
  };
96
114
  };
97
- export default createDefaultConfig;
@@ -5,6 +5,24 @@ exports.createDefaultConfig = createDefaultConfig;
5
5
  * 创建默认的 Nuxt 配置
6
6
  * @param param0 包含服务器配置和 API 基础路径的参数对象
7
7
  * @returns Nuxt 配置对象
8
+ *
9
+ * 用法如下:
10
+ * ```typescript
11
+ * import { createDefaultConfig } from 'nuxt-gin-tools/src/nuxt-config';
12
+ * import type { NuxtConfig } from 'nuxt/config';
13
+ * import { defineNuxtConfig } from 'nuxt/config';
14
+ * import SERVER_CONFIG from './server.config.json';
15
+ * import { BASE_PATH } from './vue/composables/api/base';
16
+ *
17
+ * const config = createDefaultConfig({
18
+ * apiBasePath: BASE_PATH,
19
+ * serverConfig: SERVER_CONFIG,
20
+ * }) as NuxtConfig;
21
+ *
22
+ * export default defineNuxtConfig({
23
+ * ...config,
24
+ * });
25
+ * ```
8
26
  */
9
27
  function createDefaultConfig({ serverConfig, apiBasePath }) {
10
28
  /**
@@ -85,4 +103,3 @@ function createDefaultConfig({ serverConfig, apiBasePath }) {
85
103
  },
86
104
  };
87
105
  }
88
- exports.default = createDefaultConfig;