From 0c84651ebba4a14fcb105611ddeb7a51ff887a36 Mon Sep 17 00:00:00 2001 From: snomiao Date: Sat, 18 Jun 2022 00:54:01 +0800 Subject: [PATCH] fix(all): update docs --- ABOUT.md | 20 +++++++ README.md | 42 +++++++++++++++ package.json | 5 +- packages/bothforage/README.md | 3 +- packages/chrome-dev/README.md | 1 - packages/chrome-extension-dev/README.md | 21 +++++++- packages/jsx-rename/README.md | 30 ++++++++--- packages/junction-move/README.md | 8 +-- packages/md-aggregate/CHANGELOG.md | 71 +++++++++++++++++++++++++ packages/md-aggregate/README.md | 21 ++++++++ packages/md-aggregate/package.json | 8 +-- packages/md-aggregate/src/cli.ts | 1 - packages/monopkgs/README.md | 27 +++++++--- packages/my-version/README.md | 21 ++++++++ packages/objtranspose/README.md | 21 ++++++++ packages/outer-join-by/README.md | 1 - packages/sno-mongo-ku/README.md | 47 ++++++++++++++++ packages/sno-utils/README.md | 23 +++++++- packages/snobuild/README.md | 21 +++++++- packages/snofa/README.md | 21 ++++++++ packages/snogwt/README.md | 26 +++++++-- packages/snorun/README.md | 21 ++++++++ packages/snosay/README.md | 26 +++++++-- pnpm-lock.yaml | 6 +-- 24 files changed, 444 insertions(+), 48 deletions(-) create mode 100644 ABOUT.md create mode 100644 README.md create mode 100644 packages/sno-mongo-ku/README.md diff --git a/ABOUT.md b/ABOUT.md new file mode 100644 index 00000000..b4245591 --- /dev/null +++ b/ABOUT.md @@ -0,0 +1,20 @@ +# About + +## License + +GPLv3 - [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-3.0.en.html) + +## Author + +Author: snomiao +Website: [snomiao.com](https://snomiao.com) + +## Sponsors + +- None yet. + +Claim your sponsorship by donating snomiao <[Email: snomiao@gmail.com](mailto:snomiao@gmail.com)> + +## Contribute + +The main repo is in [here](https://github.com/snomiao/js#readme), any issue and PR's welcome. diff --git a/README.md b/README.md new file mode 100644 index 00000000..f63686bd --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# snomiao.js + +## Packages + +- [md-aggregate](./md-aggregate/README.md) +- [monopkgs](./monopkgs/README.md) +- [sno-utils](./sno-utils/README.md) +- [objtranspose](./objtranspose/README.md) +- [bothforage](./bothforage/README.md) +- [my-version](./my-version/README.md) +- [jsx-rename](./jsx-rename/README.md) +- [snogwt](./snogwt/README.md) +- [snorun](./snorun/README.md) +- [snosay](./snosay/README.md) +- [chrome-dev](./chrome-dev/README.md) +- [chrome-extension-dev](./chrome-extension-dev/README.md) +- [junction-move](./junction-move/README.md) +- [snobuild](./snobuild/README.md) +- [outer-join-by](./outer-join-by/README.md) +- [snofa](./snofa/README.md) +- [sno-mongo-ku](./sno-mongo-ku/README.md) + +## About + +### License + +GPLv3 - [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-3.0.en.html) + +### Author + +Author: snomiao +Website: [snomiao.com](https://snomiao.com) + +### Sponsors + +- None yet. + +Claim your sponsorship by donating snomiao <[Email: snomiao@gmail.com](mailto:snomiao@gmail.com)> + +### Contribute + +The main repo is in [here](https://github.com/snomiao/js#readme), any issue and PR's welcome. diff --git a/package.json b/package.json index ba8389e2..d3721435 100644 --- a/package.json +++ b/package.json @@ -19,11 +19,14 @@ ], "scripts": { "build": "lerna run build", + "docs": "npm run docs:root && npm run docs:about", + "docs:about": "lerna exec -- md-aggregate ./README.md -i ../../ABOUT.md -w", + "docs:root": "md-aggregate ./README.md -i ABOUT.md -w", "format": "prettier -w . && eslint --fix .", "lerna-publish": "lerna publish", "monopkgs": "monopkgs", "test": "lerna run test", - "postversion": "monopkgs && npm run format && git commit -a -m \"chore: bump version and format\"" + "postversion": "npm run docs:root && monopkgs && npm run format && git commit -a -m \"chore: bump version and format\"" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^5.19.0", diff --git a/packages/bothforage/README.md b/packages/bothforage/README.md index 915f9483..f9056376 100644 --- a/packages/bothforage/README.md +++ b/packages/bothforage/README.md @@ -1,4 +1,4 @@ -# README +# bothForage is localForage + nodeForage a dead simple module trying to use localforage or nodeforage. - localforage in browser - nodeforage in Node.js @@ -18,7 +18,6 @@ npm i bothforage GPLv3 - [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-3.0.en.html) - ### Author Author: snomiao diff --git a/packages/chrome-dev/README.md b/packages/chrome-dev/README.md index 4b341500..da3a9f6b 100644 --- a/packages/chrome-dev/README.md +++ b/packages/chrome-dev/README.md @@ -37,7 +37,6 @@ chrome-dev -h GPLv3 - [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-3.0.en.html) - ### Author Author: snomiao diff --git a/packages/chrome-extension-dev/README.md b/packages/chrome-extension-dev/README.md index c7bedcd0..89ded290 100644 --- a/packages/chrome-extension-dev/README.md +++ b/packages/chrome-extension-dev/README.md @@ -24,7 +24,24 @@ extdev -v ``` -## Author & License + +## About + +### License + +GPLv3 - [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-3.0.en.html) + +### Author Author: snomiao -LICENSE: GPLv3 +Website: [snomiao.com](https://snomiao.com) + +### Sponsors + +- None yet. + +Claim your sponsorship by donating snomiao <[Email: snomiao@gmail.com](mailto:snomiao@gmail.com)> + +### Contribute + +The main repo is in [here](https://github.com/snomiao/js#readme), any issue and PR's welcome. diff --git a/packages/jsx-rename/README.md b/packages/jsx-rename/README.md index 9d04138d..84cec218 100644 --- a/packages/jsx-rename/README.md +++ b/packages/jsx-rename/README.md @@ -1,21 +1,35 @@ # JSX-Rename -Rename your jsx files in .js into .jsx. Useful when you want to use vite. +CLI tool to rename your jsx files in .js into .jsx. Useful when you want to migrate your project to vite. ## Usage ```shell +npm i -g jsx-rename +jsx-rename ./src/*.js +``` -npx jsx-rename ./node-modules/**/react-native/*.js -npx jsx-rename ./src/*.js +## ref -``` +- [jsx-renamer/jsx-renamer at master · PuddleByteComputing/jsx-renamer](https://github.com/PuddleByteComputing/jsx-renamer/blob/master/jsx-renamer) + +## About + +### License -## Author & License +GPLv3 - [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-3.0.en.html) + +### Author Author: snomiao -LICENSE: GPLv3 +Website: [snomiao.com](https://snomiao.com) -## ref +### Sponsors -- [jsx-renamer/jsx-renamer at master · PuddleByteComputing/jsx-renamer](https://github.com/PuddleByteComputing/jsx-renamer/blob/master/jsx-renamer) +- None yet. + +Claim your sponsorship by donating snomiao <[Email: snomiao@gmail.com](mailto:snomiao@gmail.com)> + +### Contribute + +The main repo is in [here](https://github.com/snomiao/js#readme), any issue and PR's welcome. diff --git a/packages/junction-move/README.md b/packages/junction-move/README.md index 80755b95..9ec9cc38 100644 --- a/packages/junction-move/README.md +++ b/packages/junction-move/README.md @@ -1,10 +1,10 @@ # junction-move -Move a folder to new location and make a Juction link to new location. Only works with windows yet. +Move a folder to new location and make a Juction link to new location. Only works with windows yet. ## Usage -``` +```batch Usage: npx junction-move from_folder to_folder Example: npx junction-move C:\Go D:\Go ``` @@ -17,7 +17,3 @@ With Two commands robocopy %from_path% %to_path% /MOVE /e mklink /J %from_path% %to_path% ``` - -## License - -ISC \ No newline at end of file diff --git a/packages/md-aggregate/CHANGELOG.md b/packages/md-aggregate/CHANGELOG.md index fceef8a4..f9816d48 100644 --- a/packages/md-aggregate/CHANGELOG.md +++ b/packages/md-aggregate/CHANGELOG.md @@ -99,3 +99,74 @@ Note: This section is orginally written in CHANGELOG.md file and is merged into ## 0.0.2 (2022-04-20) **Note:** Version bump only for package md-aggregate + +## MD-Aggregate + +Aggregate README.md with CHANGELOG.md or whatever.md. + +### Install + +```shell +npm i -g md-aggregate +``` + +### Usage + +```plaintext +md-aggregate [input..] + +aggregate markdown files + +Options: + -w, --write write mode (when missing you will get preview in console) + [boolean] -i, --input source markdown files [array] -t, --target destination markdown file [string] -h, --help Show help [boolean] -v, --version Show version number [boolean] + +Examples: + preview: md-aggregate README.md CHANGELOG.md + one: md-aggregate README.md CHANGELOG.md -w + multi: md-aggregate README.md ABOUT.md LICENSE.md CHANGELOG.md -w + multi: md-aggregate README.md -i ABOUT.md -i LICENSE.md -i CHANGELOG.md + -w +``` + +### Description + +Insert markdown documents into one document, and level up the titles, + +For Example, you have README.md like this + +```markdown +### README.md + +### OTHER + +...OTHER +``` + +and CHANGELOG.md like this + +```markdown +### CHANGE LOG + +### x.x.x + +...CHANGELOG +``` + +It will be append or replaced into README.md like this: + +```markdown +### README + +### OTHER + +...OTHER + +### CHANGE LOG + +#### x.x.x + +...CHANGELOG + +... +``` diff --git a/packages/md-aggregate/README.md b/packages/md-aggregate/README.md index b3aa4613..419c136f 100644 --- a/packages/md-aggregate/README.md +++ b/packages/md-aggregate/README.md @@ -68,3 +68,24 @@ It will be append or replaced into README.md like this: ... ``` + +## About + +### License + +GPLv3 - [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-3.0.en.html) + +### Author + +Author: snomiao +Website: [snomiao.com](https://snomiao.com) + +### Sponsors + +- None yet. + +Claim your sponsorship by donating snomiao <[Email: snomiao@gmail.com](mailto:snomiao@gmail.com)> + +### Contribute + +The main repo is in [here](https://github.com/snomiao/js#readme), any issue and PR's welcome. diff --git a/packages/md-aggregate/package.json b/packages/md-aggregate/package.json index dc0a0926..4b4c99dc 100644 --- a/packages/md-aggregate/package.json +++ b/packages/md-aggregate/package.json @@ -1,6 +1,6 @@ { "name": "md-aggregate", - "version": "1.1.13", + "version": "2.0.1", "description": "Aggregate README.md with CHANGELOG.md or whatever", "keywords": [ "markdown", @@ -35,8 +35,8 @@ "lib" ], "scripts": { - "build": "tsc && node esbuild-with-cli.mjs", - "prepack": "snobuild --lib", + "build": "snobuild --lib", + "prepack": "npm run build", "postversion": "prettier -w CHANGELOG.md && md-aggregate CHANGELOG.md README.md -w" }, "dependencies": { @@ -44,7 +44,7 @@ "yargs": "^17.5.1" }, "devDependencies": { - "snobuild": "^1.0.0" + "snobuild": "^2.0.0" }, "publishConfig": { "access": "public" diff --git a/packages/md-aggregate/src/cli.ts b/packages/md-aggregate/src/cli.ts index bddbb7d2..844b98c4 100644 --- a/packages/md-aggregate/src/cli.ts +++ b/packages/md-aggregate/src/cli.ts @@ -21,6 +21,5 @@ const argv = await yargs(hideBin(process.argv)) .alias("h", "help") .alias("v", "version") .demandCommand(2).argv; -console.log(argv); await mdAggregate( argv); diff --git a/packages/monopkgs/README.md b/packages/monopkgs/README.md index 3a5624d2..85bcc2ea 100644 --- a/packages/monopkgs/README.md +++ b/packages/monopkgs/README.md @@ -27,13 +27,28 @@ cd $monorepo && npx monopkgs - [ ] overwrite or keep existed files - [x] respect .gitignores -## PR's welcome. +## Reference -## Author +- [node.js - Configure repository field on package.json on monorepo - Stack Overflow](https://stackoverflow.com/questions/52922529/configure-repository-field-on-package-json-on-monorepo) -Author: snomiao@gmail.com -LICENSE: GPLv3 +## About -## Reference +### License -- [node.js - Configure repository field on package.json on monorepo - Stack Overflow](https://stackoverflow.com/questions/52922529/configure-repository-field-on-package-json-on-monorepo) +GPLv3 - [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-3.0.en.html) + + +### Author + +Author: snomiao +Website: [snomiao.com](https://snomiao.com) + +### Sponsors + +- None yet. + +Claim your sponsorship by donating snomiao <[Email: snomiao@gmail.com](mailto:snomiao@gmail.com)> + +### Contribute + +The main repo is in [here](https://github.com/snomiao/js#readme), any issue and PR's welcome. diff --git a/packages/my-version/README.md b/packages/my-version/README.md index 595714fb..c7583614 100644 --- a/packages/my-version/README.md +++ b/packages/my-version/README.md @@ -26,3 +26,24 @@ if (args["--version"]) console.log(`v${await myVersion()}`) ## Reference - [pkg-dir - npm](https://www.npmjs.com/package/pkg-dir) + +## About + +### License + +GPLv3 - [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-3.0.en.html) + +### Author + +Author: snomiao +Website: [snomiao.com](https://snomiao.com) + +### Sponsors + +- None yet. + +Claim your sponsorship by donating snomiao <[Email: snomiao@gmail.com](mailto:snomiao@gmail.com)> + +### Contribute + +The main repo is in [here](https://github.com/snomiao/js#readme), any issue and PR's welcome. diff --git a/packages/objtranspose/README.md b/packages/objtranspose/README.md index 34b56ab9..ec7beeb0 100644 --- a/packages/objtranspose/README.md +++ b/packages/objtranspose/README.md @@ -1 +1,22 @@ # objtranspose (WIP) + +## About + +### License + +GPLv3 - [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-3.0.en.html) + +### Author + +Author: snomiao +Website: [snomiao.com](https://snomiao.com) + +### Sponsors + +- None yet. + +Claim your sponsorship by donating snomiao <[Email: snomiao@gmail.com](mailto:snomiao@gmail.com)> + +### Contribute + +The main repo is in [here](https://github.com/snomiao/js#readme), any issue and PR's welcome. diff --git a/packages/outer-join-by/README.md b/packages/outer-join-by/README.md index dd4b3a94..1666be46 100644 --- a/packages/outer-join-by/README.md +++ b/packages/outer-join-by/README.md @@ -32,7 +32,6 @@ it("join by name", () => { GPLv3 - [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-3.0.en.html) - ### Author Author: snomiao diff --git a/packages/sno-mongo-ku/README.md b/packages/sno-mongo-ku/README.md new file mode 100644 index 00000000..4a2e79cf --- /dev/null +++ b/packages/sno-mongo-ku/README.md @@ -0,0 +1,47 @@ +# sno-mongo-ku + +Simplify the use of mongodb with typescript, Without db.collection("your collection").findOne() + +## Usage + +```typescript +const db = await snoMongoKu(mongo_connect_url); + +await db.myAnyCollection.findOne({ a: 1 }); // Magic! +// it is just same as +// await mongoClient.db(...).collection("your collection").findOne() + +await db.myAnyCollection.upsertMany( + [ + { email: "snomiao@gmail.com", name: "snomiao" }, + { email: "example@example.com", name: "example" }, + ], + { email: 1 }, +); // Upsert many with index! + +await db.myAnyCollection.upsertMany([ + { _id: "n9MidAL5SGhpm1jf", email: "snomiao@gmail.com", name: "snomiao" }, + { _id: "n9MidAL5SGhpm1jf", email: "example@example.com", name: "example" }, +]); // Upsert many with _id. +``` + +## About + +### License + +GPLv3 - [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-3.0.en.html) + +### Author + +Author: snomiao +Website: [snomiao.com](https://snomiao.com) + +### Sponsors + +- None yet. + +Claim your sponsorship by donating snomiao <[Email: snomiao@gmail.com](mailto:snomiao@gmail.com)> + +### Contribute + +The main repo is in [here](https://github.com/snomiao/js#readme), any issue and PR's welcome. diff --git a/packages/sno-utils/README.md b/packages/sno-utils/README.md index 880da672..97c5a356 100644 --- a/packages/sno-utils/README.md +++ b/packages/sno-utils/README.md @@ -1,3 +1,24 @@ -# 雪星实用函数库 +# sno-utils 功能介绍:TODO + +## About + +### License + +GPLv3 - [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-3.0.en.html) + +### Author + +Author: snomiao +Website: [snomiao.com](https://snomiao.com) + +### Sponsors + +- None yet. + +Claim your sponsorship by donating snomiao <[Email: snomiao@gmail.com](mailto:snomiao@gmail.com)> + +### Contribute + +The main repo is in [here](https://github.com/snomiao/js#readme), any issue and PR's welcome. diff --git a/packages/snobuild/README.md b/packages/snobuild/README.md index 6c32a032..75b25b6a 100644 --- a/packages/snobuild/README.md +++ b/packages/snobuild/README.md @@ -55,6 +55,23 @@ Options: - [esninja - npm](https://www.npmjs.com/package/esninja) -## Author +## About -snomiao +### License + +GPLv3 - [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-3.0.en.html) + +### Author + +Author: snomiao +Website: [snomiao.com](https://snomiao.com) + +### Sponsors + +- None yet. + +Claim your sponsorship by donating snomiao <[Email: snomiao@gmail.com](mailto:snomiao@gmail.com)> + +### Contribute + +The main repo is in [here](https://github.com/snomiao/js#readme), any issue and PR's welcome. diff --git a/packages/snofa/README.md b/packages/snofa/README.md index 7f4ee3eb..c7e942f3 100644 --- a/packages/snofa/README.md +++ b/packages/snofa/README.md @@ -39,3 +39,24 @@ await snofa( - [Ramda Documentation](https://ramdajs.com/docs/) - [selfrefactor/rambda](https://github.com/selfrefactor/rambda) - [Lodash Documentation](https://lodash.com/docs/) + +## About + +### License + +GPLv3 - [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-3.0.en.html) + +### Author + +Author: snomiao +Website: [snomiao.com](https://snomiao.com) + +### Sponsors + +- None yet. + +Claim your sponsorship by donating snomiao <[Email: snomiao@gmail.com](mailto:snomiao@gmail.com)> + +### Contribute + +The main repo is in [here](https://github.com/snomiao/js#readme), any issue and PR's welcome. diff --git a/packages/snogwt/README.md b/packages/snogwt/README.md index dbb9ce62..4a72086d 100644 --- a/packages/snogwt/README.md +++ b/packages/snogwt/README.md @@ -29,12 +29,28 @@ snogwt ``` -## Author & License - -Author: snomiao -LICENSE: GPLv3 - ## ref - [How to build a CLI with Node.js](https://www.twilio.com/blog/how-to-build-a-cli-with-node-js) - [say - npm](https://www.npmjs.com/package/say) + +## About + +### License + +GPLv3 - [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-3.0.en.html) + +### Author + +Author: snomiao +Website: [snomiao.com](https://snomiao.com) + +### Sponsors + +- None yet. + +Claim your sponsorship by donating snomiao <[Email: snomiao@gmail.com](mailto:snomiao@gmail.com)> + +### Contribute + +The main repo is in [here](https://github.com/snomiao/js#readme), any issue and PR's welcome. diff --git a/packages/snorun/README.md b/packages/snorun/README.md index 8672beba..79db70e7 100644 --- a/packages/snorun/README.md +++ b/packages/snorun/README.md @@ -29,3 +29,24 @@ const result = // > command // > succ ``` + +## About + +### License + +GPLv3 - [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-3.0.en.html) + +### Author + +Author: snomiao +Website: [snomiao.com](https://snomiao.com) + +### Sponsors + +- None yet. + +Claim your sponsorship by donating snomiao <[Email: snomiao@gmail.com](mailto:snomiao@gmail.com)> + +### Contribute + +The main repo is in [here](https://github.com/snomiao/js#readme), any issue and PR's welcome. diff --git a/packages/snosay/README.md b/packages/snosay/README.md index d723de0e..1e02bd70 100644 --- a/packages/snosay/README.md +++ b/packages/snosay/README.md @@ -73,12 +73,28 @@ export declare const exportFile: ( - [x] cli - [ ] set default voice -## Author & License - -Author: snomiao -LICENSE: GPLv3 - ## ref - [How to build a CLI with Node.js](https://www.twilio.com/blog/how-to-build-a-cli-with-node-js) - [say - npm](https://www.npmjs.com/package/say) + +## About + +### License + +GPLv3 - [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](https://www.gnu.org/licenses/gpl-3.0.en.html) + +### Author + +Author: snomiao +Website: [snomiao.com](https://snomiao.com) + +### Sponsors + +- None yet. + +Claim your sponsorship by donating snomiao <[Email: snomiao@gmail.com](mailto:snomiao@gmail.com)> + +### Contribute + +The main repo is in [here](https://github.com/snomiao/js#readme), any issue and PR's welcome. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 338e7f09..1e3ea19f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -103,13 +103,13 @@ importers: packages/md-aggregate: specifiers: escape-string-regexp: ^5.0.0 - snobuild: ^1.0.0 + snobuild: ^2.0.0 yargs: ^17.5.1 dependencies: escape-string-regexp: 5.0.0 yargs: 17.5.1 devDependencies: - snobuild: 1.0.2 + snobuild: link:../snobuild packages/monopkgs: specifiers: @@ -140,7 +140,7 @@ importers: '@types/mocha': ^9.1.1 data-forge: ^1.9.5 mocha: ^10.0.0 - snobuild: workspace:^2.2.1 + snobuild: ^2.2.1 tsx: ^3.4.2 dependencies: data-forge: 1.9.5