@seayoo-web/finder 1.0.5 → 1.0.6
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/dist/plugin.vite.js +1 -1
- package/index.d.ts +81 -0
- package/index.js +7 -8
- package/package.json +1 -1
package/dist/plugin.vite.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const{finderDeploy:finderDeploy}=require("./core"),
|
|
1
|
+
const{finderDeploy:finderDeploy}=require("./core"),path=require("path");require("colors"),module.exports=function(e){let r=null;return{name:"finerDeployAgent",generateBundle({dir:e}){r=process.cwd(),e&&(r=path.resolve(r,e))},async closeBundle(){await finderDeploy({preview:!0,archive:path.resolve(path.dirname(r),"archive"),...e,dist:r}).then((function(e){e&&console.log("部署成功".bgGreen,(e.previewUrl||"").green)}))}}};
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
interface IDeployCoreOptions {
|
|
2
|
+
/** 要部署的最终目录,比如 https://xxx.com/test/path/ */
|
|
3
|
+
dist?: string;
|
|
4
|
+
/** 如果不指定目录,可以指定一个zip文件,指定zip后,dist无效 */
|
|
5
|
+
zip?: string,
|
|
6
|
+
/** 归档备份的文件名,如果不指定文件名,则按照时间戳命名zip文件 */
|
|
7
|
+
archive?: string,
|
|
8
|
+
/** 部署目标地址 */
|
|
9
|
+
deployTo: string,
|
|
10
|
+
/** 部署授权用户名 */
|
|
11
|
+
user: string,
|
|
12
|
+
/** 部署授权key */
|
|
13
|
+
key: string,
|
|
14
|
+
/** 是否部署完毕后打开目标文件 */
|
|
15
|
+
preview?: boolean
|
|
16
|
+
/** 是否调试输出更多信息 */
|
|
17
|
+
debug?: boolean
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface IDeployResult {
|
|
21
|
+
/** 页面预览地址 */
|
|
22
|
+
previewUrl: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface IUploadCoreOptions {
|
|
26
|
+
/** 需要上传的文件全路径 */
|
|
27
|
+
file: string,
|
|
28
|
+
/** 部署目标地址 */
|
|
29
|
+
deployTo: string,
|
|
30
|
+
/** 部署授权用户名 */
|
|
31
|
+
user: string,
|
|
32
|
+
/** 部署授权key */
|
|
33
|
+
key: string,
|
|
34
|
+
/** 是否部署完毕后打开目标文件 */
|
|
35
|
+
preview?: boolean
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface IVitePlugin {
|
|
39
|
+
name: string,
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** 部署内容到 finder 中 */
|
|
43
|
+
export declare const finderDeploy: (options: IDeployCoreOptions) => Promise<IDeployResult | void>;
|
|
44
|
+
|
|
45
|
+
/** 上传本地文件到 finder */
|
|
46
|
+
export declare const finderUpload: (options: IUploadCoreOptions) => Promise<void>;
|
|
47
|
+
|
|
48
|
+
/** 部署用插件,支持 webpack 和 vite */
|
|
49
|
+
export declare const deployPlugin: {
|
|
50
|
+
/** webpack 部署插件 */
|
|
51
|
+
webpack: (options: {
|
|
52
|
+
/** 归档备份的文件名,如果不指定文件名,则按照时间戳命名zip文件 */
|
|
53
|
+
archive?: string,
|
|
54
|
+
/** 部署目标地址 */
|
|
55
|
+
deployTo: string,
|
|
56
|
+
/** 部署授权用户名 */
|
|
57
|
+
user: string,
|
|
58
|
+
/** 部署授权key */
|
|
59
|
+
key: string,
|
|
60
|
+
/** 是否部署完毕后打开目标文件 */
|
|
61
|
+
preview?: boolean
|
|
62
|
+
}) => void,
|
|
63
|
+
|
|
64
|
+
/** vite 部署插件 */
|
|
65
|
+
vite: (options: {
|
|
66
|
+
/** 如果不指定目录,可以指定一个zip文件,指定zip后,dist无效 */
|
|
67
|
+
zip?: string,
|
|
68
|
+
/** 归档备份的文件名,如果不指定文件名,则按照时间戳命名zip文件 */
|
|
69
|
+
archive?: string,
|
|
70
|
+
/** 是否调试输出更多信息 */
|
|
71
|
+
debug?: boolean,
|
|
72
|
+
/** 部署目标地址 */
|
|
73
|
+
deployTo: string,
|
|
74
|
+
/** 部署授权用户名 */
|
|
75
|
+
user: string,
|
|
76
|
+
/** 部署授权key */
|
|
77
|
+
key: string,
|
|
78
|
+
/** 是否部署完毕后打开目标文件 */
|
|
79
|
+
preview?: boolean
|
|
80
|
+
}) => IVitePlugin;
|
|
81
|
+
}
|
package/index.js
CHANGED
|
@@ -2,11 +2,10 @@ const { finderDeploy, finderUpload } = require('./dist/core');
|
|
|
2
2
|
const WebpackDeployPlugin = require('./dist/plugin.webpack');
|
|
3
3
|
const ViteDeployPlugin = require('./dist/plugin.vite');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
5
|
+
exports.finderDeploy = finderDeploy;
|
|
6
|
+
exports.finderUpload = finderUpload;
|
|
7
|
+
|
|
8
|
+
exports.deployPlugin = {
|
|
9
|
+
webpack: WebpackDeployPlugin,
|
|
10
|
+
vite: ViteDeployPlugin
|
|
11
|
+
};
|