diff --git a/README.md b/README.md index 6c41560..05e1950 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,7 @@ Using `npx` you can run the script without installing it first: This will install `botops` globally so that it may be run from the command line anywhere. -#### Globally via Homebrew - brew install botops - ## 🤯 Usage ``` diff --git a/package.json b/package.json index 6d71f2b..f24937f 100644 --- a/package.json +++ b/package.json @@ -22,9 +22,16 @@ "botops" ], "sideEffects": false, + "main": "dist/index.mjs", "bin": { "botops": "./botops-cli.mjs" }, + "pkg": { + "targets": [ + "node16-macos-arm64" + ], + "outputPath": "package" + }, "files": [ "dist", "*.mjs" @@ -44,7 +51,7 @@ "@inquirer/confirm": "^2.0.15", "@inquirer/select": "^1.3.1", "ajv": "^8.12.0", - "botops-feishu": "workspace:^", + "botops-feishu": "^0.0.1", "clipboardy": "^4.0.0", "conf": "^12.0.0", "fast-glob": "^3.3.1", diff --git a/packages/feishuapi/README.md b/packages/feishuapi/README.md index cedf6c4..1f6882c 100644 --- a/packages/feishuapi/README.md +++ b/packages/feishuapi/README.md @@ -1,37 +1 @@ -# pkg-placeholder - -[![npm version][npm-version-src]][npm-version-href] -[![npm downloads][npm-downloads-src]][npm-downloads-href] -[![bundle][bundle-src]][bundle-href] -[![JSDocs][jsdocs-src]][jsdocs-href] -[![License][license-src]][license-href] - -_description_ - -> **Note**: -> Replace `pkg-placeholder`, `_description_` and `antfu` globally to use this template. - -## Sponsors - -

- - - -

- -## License - -[MIT](./LICENSE) License © 2023-PRESENT [Anthony Fu](https://github.com/antfu) - - - -[npm-version-src]: https://img.shields.io/npm/v/pkg-placeholder?style=flat&colorA=080f12&colorB=1fa669 -[npm-version-href]: https://npmjs.com/package/pkg-placeholder -[npm-downloads-src]: https://img.shields.io/npm/dm/pkg-placeholder?style=flat&colorA=080f12&colorB=1fa669 -[npm-downloads-href]: https://npmjs.com/package/pkg-placeholder -[bundle-src]: https://img.shields.io/bundlephobia/minzip/pkg-placeholder?style=flat&colorA=080f12&colorB=1fa669&label=minzip -[bundle-href]: https://bundlephobia.com/result?p=pkg-placeholder -[license-src]: https://img.shields.io/github/license/antfu/pkg-placeholder.svg?style=flat&colorA=080f12&colorB=1fa669 -[license-href]: https://github.com/antfu/pkg-placeholder/blob/main/LICENSE -[jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669 -[jsdocs-href]: https://www.jsdocs.io/package/pkg-placeholder +## BotOps - Feishu diff --git a/packages/feishuapi/build.config.ts b/packages/feishuapi/build.config.ts index 0bd008c..63a857b 100644 --- a/packages/feishuapi/build.config.ts +++ b/packages/feishuapi/build.config.ts @@ -4,9 +4,10 @@ export default defineBuildConfig({ entries: [ 'src/index', ], - declaration: true, + declaration: false, clean: true, rollup: { - emitCJS: true, + emitCJS: false, }, + failOnWarn: false, }) diff --git a/packages/feishuapi/package.json b/packages/feishuapi/package.json index 501a680..b31d855 100644 --- a/packages/feishuapi/package.json +++ b/packages/feishuapi/package.json @@ -3,7 +3,7 @@ "type": "module", "version": "0.0.1", "packageManager": "pnpm@8.14.0", - "description": "onebot feishu auto deploy module", + "description": "botops feishu auto deploy module", "author": "River ", "license": "MIT", "homepage": "https://github.com/ConnectAI-E/botops", @@ -12,12 +12,14 @@ "url": "git+https://github.com/ConnectAI-E/botops.git" }, "bugs": "https://github.com/ConnectAI-E/botops/issues", - "keywords": [], + "keywords": [ + "feishu", + "cli", + "botops" + ], "sideEffects": false, "exports": { ".": { - "types": "./dist/index.d.ts", - "require": "./dist/index.cjs", "import": "./dist/index.mjs" } }, @@ -47,6 +49,7 @@ "prepare": "simple-git-hooks" }, "dependencies": { + "FormData": "^0.10.1", "puppeteer-core": "^21.7.0" }, "devDependencies": { diff --git a/packages/feishuapi/pnpm-lock.yaml b/packages/feishuapi/pnpm-lock.yaml index 78117cd..50a252e 100644 --- a/packages/feishuapi/pnpm-lock.yaml +++ b/packages/feishuapi/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: dependencies: + FormData: + specifier: ^0.10.1 + version: 0.10.1 puppeteer-core: specifier: ^21.7.0 version: 21.7.0 @@ -1436,6 +1439,26 @@ packages: pretty-format: 29.7.0 dev: true + /File@0.10.2: + resolution: {integrity: sha512-gomQVTq/10wIR399uhGTWtYcYneTXbfe3p2RO/NR0MPrLkIyOaE9DCEPXihAm+72epLtXaplitwfJ/wkmj88dg==} + dependencies: + mime: 4.0.1 + dev: false + + /FileReader@0.10.2: + resolution: {integrity: sha512-O0K+5KRnDBFNogBPtV5hWjyJSQOoB2j3ZLbre1pBjCdE9CNpeIUPI8IX3G7eafIZ/HsllbGaIucEbt2qL+EX0g==} + dev: false + + /FormData@0.10.1: + resolution: {integrity: sha512-Win+aXiahTJE/uwQWcq7BaLRdqOjNlDiWq2RkGvywkUluz8uejQrUPfmuXJJ6+4kaoH0r4S7Y+J6R/PGcNyp5w==} + dependencies: + File: 0.10.2 + FileReader: 0.10.2 + bufferjs: 3.0.1 + forEachAsync: 3.0.0 + remedial: 1.0.8 + dev: false + /acorn-jsx@5.3.2(acorn@8.11.2): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -1623,6 +1646,11 @@ packages: ieee754: 1.2.1 dev: false + /bufferjs@3.0.1: + resolution: {integrity: sha512-qrCIGPcd9ODawCNyqR2o55zgaC/r7XHZ7oUh2s99uk+NVBS3SjIHigxS1S2KXpt8wsoQxAN55iPi8GIH8TGMRg==} + engines: {node: '>=0.2.0'} + dev: false + /builtin-modules@3.3.0: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} @@ -2685,6 +2713,11 @@ packages: resolution: {integrity: sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==} dev: true + /forEachAsync@3.0.0: + resolution: {integrity: sha512-a6qFIJll2VuqpWNRvJfgT7pGgobR89qnARafcCkGg6q1BCWrowc3WvRoYidxtFWRwaeUpk+5kiKZtdlRLwSufQ==} + deprecated: Please use 'foreachasync' instead. See https://www.npmjs.com/package/foreachasync + dev: false + /foreground-child@3.1.1: resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} engines: {node: '>=14'} @@ -3406,6 +3439,12 @@ packages: mime-db: 1.52.0 dev: true + /mime@4.0.1: + resolution: {integrity: sha512-5lZ5tyrIfliMXzFtkYyekWbtRXObT9OWa8IwQ5uxTBDHucNNwniRqo0yInflj+iYi5CBa6qxadGzGarDfuEOxA==} + engines: {node: '>=16'} + hasBin: true + dev: false + /mimic-fn@2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} @@ -3983,6 +4022,10 @@ packages: jsesc: 0.5.0 dev: true + /remedial@1.0.8: + resolution: {integrity: sha512-/62tYiOe6DzS5BqVsNpH/nkGlX45C/Sp6V+NtiN6JQNS1Viay7cWkazmRkrQrdFj2eshDe96SIQNIoMxqhzBOg==} + dev: false + /require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fce1342..5d635e3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,7 +18,7 @@ importers: specifier: ^8.12.0 version: 8.12.0 botops-feishu: - specifier: workspace:^ + specifier: ^0.0.1 version: link:packages/feishuapi clipboardy: specifier: ^4.0.0 @@ -114,6 +114,9 @@ importers: packages/feishuapi: dependencies: + FormData: + specifier: ^0.10.1 + version: 0.10.1 puppeteer-core: specifier: ^21.7.0 version: 21.7.0 @@ -2303,6 +2306,26 @@ packages: pretty-format: 29.7.0 dev: true + /File@0.10.2: + resolution: {integrity: sha512-gomQVTq/10wIR399uhGTWtYcYneTXbfe3p2RO/NR0MPrLkIyOaE9DCEPXihAm+72epLtXaplitwfJ/wkmj88dg==} + dependencies: + mime: 4.0.1 + dev: false + + /FileReader@0.10.2: + resolution: {integrity: sha512-O0K+5KRnDBFNogBPtV5hWjyJSQOoB2j3ZLbre1pBjCdE9CNpeIUPI8IX3G7eafIZ/HsllbGaIucEbt2qL+EX0g==} + dev: false + + /FormData@0.10.1: + resolution: {integrity: sha512-Win+aXiahTJE/uwQWcq7BaLRdqOjNlDiWq2RkGvywkUluz8uejQrUPfmuXJJ6+4kaoH0r4S7Y+J6R/PGcNyp5w==} + dependencies: + File: 0.10.2 + FileReader: 0.10.2 + bufferjs: 3.0.1 + forEachAsync: 3.0.0 + remedial: 1.0.8 + dev: false + /acorn-jsx@5.3.2(acorn@8.11.3): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -2668,6 +2691,11 @@ packages: base64-js: 1.5.1 ieee754: 1.2.1 + /bufferjs@3.0.1: + resolution: {integrity: sha512-qrCIGPcd9ODawCNyqR2o55zgaC/r7XHZ7oUh2s99uk+NVBS3SjIHigxS1S2KXpt8wsoQxAN55iPi8GIH8TGMRg==} + engines: {node: '>=0.2.0'} + dev: false + /builtin-modules@3.3.0: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} @@ -4883,6 +4911,11 @@ packages: is-callable: 1.2.7 dev: true + /forEachAsync@3.0.0: + resolution: {integrity: sha512-a6qFIJll2VuqpWNRvJfgT7pGgobR89qnARafcCkGg6q1BCWrowc3WvRoYidxtFWRwaeUpk+5kiKZtdlRLwSufQ==} + deprecated: Please use 'foreachasync' instead. See https://www.npmjs.com/package/foreachasync + dev: false + /foreground-child@3.1.1: resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} engines: {node: '>=14'} @@ -6191,6 +6224,12 @@ packages: mime-db: 1.52.0 dev: true + /mime@4.0.1: + resolution: {integrity: sha512-5lZ5tyrIfliMXzFtkYyekWbtRXObT9OWa8IwQ5uxTBDHucNNwniRqo0yInflj+iYi5CBa6qxadGzGarDfuEOxA==} + engines: {node: '>=16'} + hasBin: true + dev: false + /mimic-fn@1.2.0: resolution: {integrity: sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==} engines: {node: '>=4'} @@ -7417,6 +7456,10 @@ packages: jsesc: 0.5.0 dev: true + /remedial@1.0.8: + resolution: {integrity: sha512-/62tYiOe6DzS5BqVsNpH/nkGlX45C/Sp6V+NtiN6JQNS1Viay7cWkazmRkrQrdFj2eshDe96SIQNIoMxqhzBOg==} + dev: false + /require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} diff --git a/src/auth.ts b/src/auth.ts index 80c7036..4315743 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -2,6 +2,8 @@ import type { Argv } from 'yargs' import ora from 'ora' import select, { Separator } from '@inquirer/select' + +// @ts-expect-error This is an expected error because no type definition for this package import { getFeishuCookies } from 'botops-feishu' import confirm from '@inquirer/confirm' import { FeishuConfigManager } from './config' diff --git a/src/config.ts b/src/config.ts index 1a51a92..fa28d8b 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,6 +1,8 @@ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-expect-error import Conf from 'conf' + +// @ts-expect-error This is an expected error because no type definition for this package import { Configuration, OpenApp } from 'botops-feishu' import { name } from '../package.json'