@liuli-util/cli 3.19.1 → 3.19.2
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/LICENSE +21 -0
- package/dist/bin.js +1 -1
- package/dist/bin.js.map +2 -2
- package/dist/commands/deploy/DeployService.d.ts.map +1 -1
- package/package.json +74 -73
- package/src/commands/deploy/DeployService.ts +5 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeployService.d.ts","sourceRoot":"","sources":["../../../src/commands/deploy/DeployService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAe,MAAM,oBAAoB,CAAA;AACjE,OAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AASzD,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;IACpD;;OAEG;IACH,MAAM,IAAI,eAAe,CAAC,IAAI,EAAE,YAAY,CAAC,CAAA;CAC9C;AAED,oBAAY,cAAc;IACxB,OAAO,aAAa;IACpB,IAAI,SAAS;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,OAAO,CAAA;IACd,IAAI,EAAE,cAAc,CAAA;CACrB;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACxE,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,cAAc,CAAA;CAC1B;AAED;;GAEG;AACH,qBAAa,iBAAkB,YAAW,cAAc;IAC1C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,iBAAiB;IAEvD,MAAM,IAAI,eAAe,CAAC,I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;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACxE,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,cAAc,CAAA;CAC1B;AAED;;GAEG;AACH,qBAAa,iBAAkB,YAAW,cAAc;IAC1C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,iBAAiB;IAEvD,MAAM,IAAI,eAAe,CAAC,IAAI,EAAE,YAAY,CAAC;IAc7C,QAAQ,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC;CAsBrD;AAED,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC;IAC3E;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;GAEG;AACH,qBAAa,oBAAqB,YAAW,cAAc;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,oBAAoB;IAE1D,MAAM,IAAI,eAAe,CAAC,IAAI,EAAE,YAAY,CAAC;IA4E7C,QAAQ,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC;CAkBlD"}
|
package/package.json
CHANGED
|
@@ -1,73 +1,74 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@liuli-util/cli",
|
|
3
|
-
"version": "3.19.
|
|
4
|
-
"description": "一个针对于库和 CLI 应用程序打包的零配置 CLI",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.esm.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"license": "MIT",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
}
|
|
73
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@liuli-util/cli",
|
|
3
|
+
"version": "3.19.2",
|
|
4
|
+
"description": "一个针对于库和 CLI 应用程序打包的零配置 CLI",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"bin": {
|
|
10
|
+
"liuli-cli": "./bin.js"
|
|
11
|
+
},
|
|
12
|
+
"jest": {
|
|
13
|
+
"preset": "ts-jest",
|
|
14
|
+
"testMatch": [
|
|
15
|
+
"<rootDir>/src/**/__tests__/*.test.ts"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public",
|
|
20
|
+
"registry": "https://registry.npmjs.org/"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@liuli-util/commitlint-standard-config": "^0.1.6",
|
|
24
|
+
"@liuli-util/eslint-config-react-ts": "^0.2.1",
|
|
25
|
+
"@liuli-util/eslint-config-ts": "^0.4.0",
|
|
26
|
+
"@liuli-util/prettier-standard-config": "^0.2.0",
|
|
27
|
+
"ajv": "^8.8.2",
|
|
28
|
+
"ajv-formats": "^2.1.1",
|
|
29
|
+
"ajv-i18n": "^4.2.0",
|
|
30
|
+
"chokidar": "^3.5.2",
|
|
31
|
+
"commander": "^8.2.0",
|
|
32
|
+
"conf": "^10.1.1",
|
|
33
|
+
"enquirer": "^2.3.6",
|
|
34
|
+
"esbuild": "^0.13.15",
|
|
35
|
+
"fs-extra": "^10.0.0",
|
|
36
|
+
"glob": "^7.2.0",
|
|
37
|
+
"glob-promise": "^4.2.0",
|
|
38
|
+
"json5": "^2.2.0",
|
|
39
|
+
"simple-git": "^2.45.1",
|
|
40
|
+
"spinnies": "^0.5.1",
|
|
41
|
+
"ssh2": "^1.5.0",
|
|
42
|
+
"ssh2-sftp-client": "^7.2.1",
|
|
43
|
+
"tar": "^6.1.11",
|
|
44
|
+
"ts-morph": "^12.0.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/fs-extra": "^9.0.13",
|
|
48
|
+
"@types/glob": "^7",
|
|
49
|
+
"@types/jest": "^27.0.2",
|
|
50
|
+
"@types/lodash": "^4.14.178",
|
|
51
|
+
"@types/node": "^16.9.6",
|
|
52
|
+
"@types/ssh2-sftp-client": "^7.0.0",
|
|
53
|
+
"esno": "^0.9.1",
|
|
54
|
+
"jest": "^27.4.7",
|
|
55
|
+
"lodash": "^4.17.21",
|
|
56
|
+
"rimraf": "^3.0.2",
|
|
57
|
+
"ts-jest": "^27.1.3",
|
|
58
|
+
"type-fest": "^2.3.4",
|
|
59
|
+
"typescript": "^4.5.5"
|
|
60
|
+
},
|
|
61
|
+
"repository": {
|
|
62
|
+
"type": "git",
|
|
63
|
+
"url": "https://github.com/rxliuli/liuli-tools/tree/master/apps/liuli-cli"
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"setup": "pnpm build",
|
|
67
|
+
"build": "esno src/bin.ts build cli",
|
|
68
|
+
"dev": "esno src/bin.ts build cli -w",
|
|
69
|
+
"start": "esno src/bin.ts",
|
|
70
|
+
"test": "jest --all",
|
|
71
|
+
"lint": "eslint --fix src/**"
|
|
72
|
+
},
|
|
73
|
+
"readme": "# @liuli-util/cli\r\n\r\n> [中文](https://github.com/rxliuli/liuli-tools/tree/master/apps/liuli-cli/README.zh-CN.md)\r\n\r\nA zero-configuration CLI packaged for libraries and CLI applications.\r\n\r\n## Getting started\r\n\r\n### Install\r\n\r\n```sh\r\nyarn add -D @liuli-util/cli # local installation\r\nnpm i -g @liuli-util/cli # install globally\r\n```\r\n\r\n### Bale\r\n\r\n```sh\r\nyarn liuli-cli build lib # package library\r\nyarn liuli-cli build cli # package cli reference program\r\n```\r\n\r\n> Add the `-w` option to start the watch mode of rollup, the packaged dist/ will not be compressed and the dependencies will not be included in the bundle.\r\n\r\n\r\n\r\n### Generate\r\n\r\n```sh\r\nyarn liuli-cli generate <name> --template lib # Generate ts-lib project\r\nyarn liuli-cli generate <name> --template cli # Generate cli project\r\n```\r\n\r\nutil also supports interactive project creation\r\n\r\n```shell\r\nyarn liuli-cli generate\r\n```\r\n\r\n\r\n\r\n### Sync configuration\r\n\r\n```shell\r\nyarn liuli-cli sync\r\n```\r\n\r\nWhich configuration needs to be synced in package.json\r\n\r\n```json\r\n{\r\n \"sync\": [\"prettier\", \"workspaces\", \"commitlint\", \"simplehooks\"]\r\n}\r\n```\r\n\r\nCurrently supported configuration items\r\n\r\n- prettier\r\n- commitlint\r\n- simplehooks\r\n- workspaces\r\n- gitignore\r\n- eslint-ts\r\n- eslint-vue-ts\r\n- jest\r\n\r\nFuture goals: By default will include checking the synchronization of the cli itself (if it needs to be used outside of a monorepo), eslint/style-lint etc., and implementing an interactive cli when not configured\r\n\r\n> Note: Currently only the dependencies are synced and no installation is performed\r\n\r\nInteractive initialization synchronization configuration is also supported\r\n\r\n```shell\r\nyarn liuli-cli sync init\r\n```\r\n\r\n## design concept\r\n\r\n- Convention over configuration, configuration should not be provided if possible. VitePress does this too, reference: https://vitepress.vuejs.org/#lighter-page-weight This leads to some constraints, including the following\r\n - When packaging the library, the entry file must be `src/index.ts`, and the export file must be `dist/index.esm.js` and `dist/index.js`\r\n - When packaging the CLI, the entry file must be `src/bin.ts`, and the exit file must be `dist/bin.js`\r\n - All dependencies will be treated as external dependencies when packaging lib, and all dependencies will be bundled when packaging cli\r\n\r\n## FAQ\r\n\r\n### Why not bundle external dependencies\r\n\r\nThe main reason is that you want to leave the bundling work to the final application, avoid bundling the same dependencies repeatedly, and also avoid dealing with the problem of using `worker_threads` directly based on the file system in nodejs.\r\n"
|
|
74
|
+
}
|
|
@@ -166,7 +166,9 @@ export class GhPagesDeployService implements IDeployService {
|
|
|
166
166
|
} else {
|
|
167
167
|
await git.cwd(localRepoPath)
|
|
168
168
|
mark('更新项目')
|
|
169
|
-
await git.pull(
|
|
169
|
+
await git.pull(defaultRemote, defaultBranch, {
|
|
170
|
+
'--allow-unrelated-histories': null,
|
|
171
|
+
})
|
|
170
172
|
}
|
|
171
173
|
mark('复制文件')
|
|
172
174
|
const remoteDestPath = path.join(localRepoPath, this.options.dest ?? './')
|
|
@@ -181,12 +183,8 @@ export class GhPagesDeployService implements IDeployService {
|
|
|
181
183
|
await git.commit('Updates gh-pages by liuli-cli')
|
|
182
184
|
}
|
|
183
185
|
mark('推送到远端')
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
mark('完成推送')
|
|
187
|
-
} else {
|
|
188
|
-
mark('没有更新,跳过推送')
|
|
189
|
-
}
|
|
186
|
+
await git.push(defaultRemote, defaultBranch)
|
|
187
|
+
mark('完成推送')
|
|
190
188
|
obs.disconnect()
|
|
191
189
|
})
|
|
192
190
|
}
|