fast-web-deployment 1.0.0

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.
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ decompressDevBashScript: (basePath: string, projectName: string) => string;
3
+ };
4
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import archiver from "archiver";
2
+ /**
3
+ * @description: 压缩开发环境dist目录
4
+ * @param {string} sourceDir 源目录
5
+ * @param {string} targetDir 目标目录
6
+ * @param {string} projectName 项目名称
7
+ * @param {archiver.Format} format 压缩格式
8
+ * @return {Promise<boolean>} 压缩成功返回true,失败返回false
9
+ */
10
+ declare function compressDevDist(sourceDir: string, targetDir: string, projectName: string, format: archiver.Format): Promise<boolean>;
11
+ /**
12
+ * @description: 删除压缩文件
13
+ * @param {string} targetDir 目标目录
14
+ * @param {string} projectName 项目名称
15
+ * @param {archiver.Format} format 压缩格式
16
+ */
17
+ declare function deleteCompressionFile(targetDir: string, projectName: string, format: archiver.Format): void;
18
+ declare const _default: {
19
+ compressDevDist: typeof compressDevDist;
20
+ deleteCompressionFile: typeof deleteCompressionFile;
21
+ };
22
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import { type Config as NodeSSHConnectOptions } from "node-ssh";
2
+ /**
3
+ * @description: 发布到服务器
4
+ * @param needCompressionDirectoryPath 需要压缩的目录路径
5
+ * @param projectName 项目名称
6
+ * @param isPassword 是否使用密码登录
7
+ * @returns
8
+ */
9
+ declare function publishToSsh(needCompressionDirectoryPath: string, projectName: string, isPassword: boolean): {
10
+ yamlMethod: (yamlPath: string) => Promise<void>;
11
+ optionsMethod: (options: NodeSSHConnectOptions & {
12
+ method: "privateKey" | "password";
13
+ sshPublishDirectory: string;
14
+ }) => Promise<void>;
15
+ };
16
+ export { publishToSsh };
@@ -0,0 +1,13 @@
1
+ import { type Config as NodeSSHConnectOptions } from "node-ssh";
2
+ /**
3
+ * @description: 连接 SSH
4
+ * @param config 连接配置
5
+ * @returns ssh 实例
6
+ */
7
+ declare function connectSSH(config: NodeSSHConnectOptions & {
8
+ method: "privateKey" | "password";
9
+ }, compressionFilePath: string, publishDirectory: string, projectName: string, format: string): Promise<boolean | undefined>;
10
+ declare const _default: {
11
+ connectSSH: typeof connectSSH;
12
+ };
13
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "fast-web-deployment",
3
+ "version": "1.0.0",
4
+ "description": "A fast and easy-to-use web deployment tool for Node.js projects with SSH support",
5
+ "main": "./dist/fast-web-deployment.cjs.js",
6
+ "module": "./dist/fast-web-deployment.es.js",
7
+ "types": "./dist/main.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/fast-web-deployment.es.js",
11
+ "require": "./dist/fast-web-deployment.cjs.js",
12
+ "types": "./dist/main.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "dev": "vite",
20
+ "build": "vite build && tsc --emitDeclarationOnly",
21
+ "preview": "vite preview",
22
+ "test": "vitest",
23
+ "prepublishOnly": "npm run build"
24
+ },
25
+ "keywords": [
26
+ "deployment",
27
+ "ssh",
28
+ "web",
29
+ "deploy",
30
+ "nodejs",
31
+ "automation",
32
+ "compression",
33
+ "tar",
34
+ "zip",
35
+ "publish",
36
+ "ci/cd"
37
+ ],
38
+ "author": "ITCODE 2021",
39
+ "license": "MIT",
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "https://github.com/your-username/fast-web-deployment.git"
43
+ },
44
+ "homepage": "https://github.com/your-username/fast-web-deployment#readme",
45
+ "bugs": {
46
+ "url": "https://github.com/your-username/fast-web-deployment/issues"
47
+ },
48
+ "engines": {
49
+ "node": ">=18.0.0"
50
+ },
51
+ "devDependencies": {
52
+ "@types/archiver": "^7.0.0",
53
+ "@types/cli-progress": "^3.11.6",
54
+ "@types/js-yaml": "^4.0.9",
55
+ "terser": "^5.46.0",
56
+ "typescript": "~5.9.3",
57
+ "vite": "npm:rolldown-vite@7.2.5",
58
+ "vite-plugin-compression": "^0.5.1",
59
+ "vitest": "^4.0.18"
60
+ },
61
+ "dependencies": {
62
+ "@types/node": "^25.0.10",
63
+ "ansi-colors": "^4.1.3",
64
+ "archiver": "^7.0.1",
65
+ "cli-progress": "^3.12.0",
66
+ "inquirer": "^12.6.3",
67
+ "js-yaml": "^4.1.0",
68
+ "node-ssh": "^13.2.1",
69
+ "ts-node": "^10.9.2",
70
+ "zod": "^4.3.6"
71
+ },
72
+ "overrides": {
73
+ "vite": "npm:rolldown-vite@7.2.5"
74
+ }
75
+ }