@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.
@@ -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,IAAI,EAAE,YAAY,CAAC;IAc7C,QAAQ,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC;CAsBrD;AAED,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,i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ACxE,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.1",
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
- "scripts": {
10
- "setup": "pnpm build",
11
- "build": "esno src/bin.ts build cli",
12
- "dev": "esno src/bin.ts build cli -w",
13
- "start": "esno src/bin.ts",
14
- "test": "jest --all",
15
- "lint": "eslint --fix src/**"
16
- },
17
- "bin": {
18
- "liuli-cli": "./bin.js"
19
- },
20
- "jest": {
21
- "preset": "ts-jest",
22
- "testMatch": [
23
- "<rootDir>/src/**/__tests__/*.test.ts"
24
- ]
25
- },
26
- "publishConfig": {
27
- "access": "public",
28
- "registry": "https://registry.npmjs.org/"
29
- },
30
- "dependencies": {
31
- "@liuli-util/commitlint-standard-config": "^0.1.6",
32
- "@liuli-util/eslint-config-react-ts": "^0.2.1",
33
- "@liuli-util/eslint-config-ts": "^0.4.0",
34
- "@liuli-util/prettier-standard-config": "^0.2.0",
35
- "ajv": "^8.8.2",
36
- "ajv-formats": "^2.1.1",
37
- "ajv-i18n": "^4.2.0",
38
- "chokidar": "^3.5.2",
39
- "commander": "^8.2.0",
40
- "conf": "^10.1.1",
41
- "enquirer": "^2.3.6",
42
- "esbuild": "^0.13.15",
43
- "fs-extra": "^10.0.0",
44
- "glob": "^7.2.0",
45
- "glob-promise": "^4.2.0",
46
- "json5": "^2.2.0",
47
- "simple-git": "^2.45.1",
48
- "spinnies": "^0.5.1",
49
- "ssh2": "^1.5.0",
50
- "ssh2-sftp-client": "^7.2.1",
51
- "tar": "^6.1.11",
52
- "ts-morph": "^12.0.0"
53
- },
54
- "devDependencies": {
55
- "@types/fs-extra": "^9.0.13",
56
- "@types/glob": "^7",
57
- "@types/jest": "^27.0.2",
58
- "@types/lodash": "^4.14.178",
59
- "@types/node": "^16.9.6",
60
- "@types/ssh2-sftp-client": "^7.0.0",
61
- "esno": "^0.9.1",
62
- "jest": "^27.4.7",
63
- "lodash": "^4.17.21",
64
- "rimraf": "^3.0.2",
65
- "ts-jest": "^27.1.3",
66
- "type-fest": "^2.3.4",
67
- "typescript": "^4.5.5"
68
- },
69
- "repository": {
70
- "type": "git",
71
- "url": "https://github.com/rxliuli/liuli-tools/tree/master/apps/liuli-cli"
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![Monitor Mode](https://liuli.dev/images/liuli-cli%20%E7%9B%91%E8%A7%86%E6%A8%A1%E5%BC%8F.gif)\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![Liuli-cli interactively create screenshots](https://liuli.dev/images/liuli-cli%20%E4%BA%A4%E4%BA%92%E5%BC%8F%E5%88%9B %E5%BB%BA%E6%88%AA%E5%9B%BE.gif)\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
- if ((await git.status()).ahead > 0 || forcePush) {
185
- await git.push(defaultRemote, defaultBranch)
186
- mark('完成推送')
187
- } else {
188
- mark('没有更新,跳过推送')
189
- }
186
+ await git.push(defaultRemote, defaultBranch)
187
+ mark('完成推送')
190
188
  obs.disconnect()
191
189
  })
192
190
  }