nuxt-gin-tools 0.2.17 → 0.2.19
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/.go-watch.json +20 -20
- package/LICENSE +21 -21
- package/README.md +228 -150
- package/commands/builder.d.ts +6 -1
- package/commands/builder.js +17 -8
- package/commands/develop.d.ts +8 -3
- package/commands/develop.js +23 -9
- package/commands/pack.d.ts +6 -52
- package/commands/pack.js +124 -8
- package/commands/update.d.ts +6 -1
- package/commands/update.js +16 -9
- package/index.js +68 -37
- package/package.json +31 -30
- package/src/cli-options.d.ts +8 -0
- package/src/cli-options.js +43 -0
- package/src/go-gin-server.json +4 -4
- package/src/pack-config.schema.json +62 -62
- package/src/pack.d.ts +55 -0
- package/src/pack.js +7 -0
- package/src/server-config.json +35 -35
package/src/pack.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { BuildOptions } from "../commands/builder";
|
|
2
|
+
export interface PackConfig extends BuildOptions {
|
|
3
|
+
/**
|
|
4
|
+
* 额外需要打包的文件映射
|
|
5
|
+
* key: 源文件路径(相对于项目根目录或绝对路径)
|
|
6
|
+
* value: 打包后对应位置(相对于服务器构建目录或绝对路径)
|
|
7
|
+
*/
|
|
8
|
+
extraFiles?: Record<string, string>;
|
|
9
|
+
/**
|
|
10
|
+
* 额外需要打包的文件 Glob(相对于项目根目录)
|
|
11
|
+
*/
|
|
12
|
+
extraFilesGlobs?: string[];
|
|
13
|
+
/**
|
|
14
|
+
* 排除文件/目录 Glob(相对于项目根目录)
|
|
15
|
+
*/
|
|
16
|
+
exclude?: string[];
|
|
17
|
+
/**
|
|
18
|
+
* 打包输出 zip 名称(相对于默认 zip 目录)
|
|
19
|
+
*/
|
|
20
|
+
zipName?: string;
|
|
21
|
+
/**
|
|
22
|
+
* 打包输出 zip 路径(相对于项目根目录或绝对路径)
|
|
23
|
+
*/
|
|
24
|
+
zipPath?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 服务器构建输出目录(相对于项目根目录或绝对路径)
|
|
27
|
+
*/
|
|
28
|
+
serverPath?: string;
|
|
29
|
+
/**
|
|
30
|
+
* 打包前钩子
|
|
31
|
+
*/
|
|
32
|
+
beforePack?: () => Promise<void> | void;
|
|
33
|
+
/**
|
|
34
|
+
* 打包后钩子
|
|
35
|
+
*/
|
|
36
|
+
afterPack?: (zipPath: string) => Promise<void> | void;
|
|
37
|
+
/**
|
|
38
|
+
* 是否清理 dist
|
|
39
|
+
*/
|
|
40
|
+
cleanDist?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 是否写入启动脚本和 package.json
|
|
43
|
+
*/
|
|
44
|
+
writeScripts?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* 写入/覆盖 package.json 内容
|
|
47
|
+
*/
|
|
48
|
+
packageJson?: Record<string, unknown>;
|
|
49
|
+
/**
|
|
50
|
+
* 复制时是否覆盖同名文件
|
|
51
|
+
*/
|
|
52
|
+
overwrite?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export declare function createPackConfig(config: PackConfig): PackConfig;
|
|
55
|
+
export default createPackConfig;
|
package/src/pack.js
ADDED
package/src/server-config.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "API configuration schema",
|
|
3
|
-
"description": "API configuration schema. For more info see http://json-schema.org/ and https://frontaid.io/blog/json-schema-vscode/",
|
|
4
|
-
"type": "object",
|
|
5
|
-
"properties": {
|
|
6
|
-
"ginPort": {
|
|
7
|
-
"title": "The port for Gin / Gin框架端口",
|
|
8
|
-
"type": "integer"
|
|
9
|
-
},
|
|
10
|
-
"nuxtPort": {
|
|
11
|
-
"title": "The port for Nuxt / Nuxt框架devServer端口",
|
|
12
|
-
"type": "integer"
|
|
13
|
-
},
|
|
14
|
-
"baseUrl": {
|
|
15
|
-
"title": "The base url for nuxt. / Nuxt的BaseUrl",
|
|
16
|
-
"type": "string",
|
|
17
|
-
"pattern": "^\\/\\w.+"
|
|
18
|
-
},
|
|
19
|
-
"killPortBeforeDevelop": {
|
|
20
|
-
"title": "Kill port before develop / 开发前释放端口",
|
|
21
|
-
"type": "boolean",
|
|
22
|
-
"default": true
|
|
23
|
-
},
|
|
24
|
-
"cleanupBeforeDevelop": {
|
|
25
|
-
"title": "Cleanup before develop / 开发前清理",
|
|
26
|
-
"type": "boolean",
|
|
27
|
-
"default": false
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"required": [
|
|
31
|
-
"ginPort",
|
|
32
|
-
"nuxtPort",
|
|
33
|
-
"baseUrl"
|
|
34
|
-
]
|
|
35
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"title": "API configuration schema",
|
|
3
|
+
"description": "API configuration schema. For more info see http://json-schema.org/ and https://frontaid.io/blog/json-schema-vscode/",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"ginPort": {
|
|
7
|
+
"title": "The port for Gin / Gin框架端口",
|
|
8
|
+
"type": "integer"
|
|
9
|
+
},
|
|
10
|
+
"nuxtPort": {
|
|
11
|
+
"title": "The port for Nuxt / Nuxt框架devServer端口",
|
|
12
|
+
"type": "integer"
|
|
13
|
+
},
|
|
14
|
+
"baseUrl": {
|
|
15
|
+
"title": "The base url for nuxt. / Nuxt的BaseUrl",
|
|
16
|
+
"type": "string",
|
|
17
|
+
"pattern": "^\\/\\w.+"
|
|
18
|
+
},
|
|
19
|
+
"killPortBeforeDevelop": {
|
|
20
|
+
"title": "Kill port before develop / 开发前释放端口",
|
|
21
|
+
"type": "boolean",
|
|
22
|
+
"default": true
|
|
23
|
+
},
|
|
24
|
+
"cleanupBeforeDevelop": {
|
|
25
|
+
"title": "Cleanup before develop / 开发前清理",
|
|
26
|
+
"type": "boolean",
|
|
27
|
+
"default": false
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"required": [
|
|
31
|
+
"ginPort",
|
|
32
|
+
"nuxtPort",
|
|
33
|
+
"baseUrl"
|
|
34
|
+
]
|
|
35
|
+
}
|