Skip to content

Commit

Permalink
Merge pull request #387 from terwer/dev
Browse files Browse the repository at this point in the history
docs: update deps
  • Loading branch information
terwer authored Jun 16, 2023
2 parents 6b162c5 + 6af39e7 commit 4c0c4b7
Show file tree
Hide file tree
Showing 51 changed files with 1,452 additions and 388 deletions.
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
auto-install-peers = true
"electron_mirror="http://npm.taobao.org/mirrors/electron/\"="
electron_custom_dir=16.0.6
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- [X] [zhi-common](https://github.com/terwer/zhi/tree/main/libs/zhi-common)
- [ ] [zhi-common-basic](https://github.com/terwer/zhi/tree/main/libs/zhi-common-basic)
- [ ] [zhi-common-json-validate](https://github.com/terwer/zhi/tree/main/libs/zhi-common-json-validate)
- [ ] [zhi-common-markdown](https://github.com/terwer/zhi/tree/main/libs/zhi-common-markdown)
- [X] [zhi-common-markdown](https://github.com/terwer/zhi/tree/main/libs/zhi-common-markdown)
- [ ] [zhi-common-version](https://github.com/terwer/zhi/tree/main/libs/zhi-common-version)
- [X] [zhi-blog-api](https://github.com/terwer/zhi/tree/main/libs/zhi-blog-api)
- [X] [zhi-xmlrpc-middleware](https://github.com/terwer/zhi/tree/main/libs/zhi-xmlrpc-middleware)
Expand All @@ -39,6 +39,8 @@
- [ ] [zhi-http-api](https://github.com/terwer/zhi/tree/main/libs/zhi-http-api)
- [ ] [zhi-zhihu-api](https://github.com/terwer/zhi/tree/main/libs/zhi-zhihu-api)
- [ ] [zhi-csdn-api](https://github.com/terwer/zhi/tree/main/libs/zhi-csdn-api)
- [ ] [zhi-picgo-core](https://github.com/terwer/zhi/tree/main/libs/zhi-picgo-core)
- [ ] [zhi-siyuan-picgo](https://github.com/terwer/zhi/tree/main/libs/zhi-siyuan-picgo)

### scaffold

Expand Down
4 changes: 3 additions & 1 deletion README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- [X] [zhi-common](https://github.com/terwer/zhi/tree/main/libs/zhi-common)
- [ ] [zhi-common-basic](https://github.com/terwer/zhi/tree/main/libs/zhi-common-basic)
- [ ] [zhi-common-json-validate](https://github.com/terwer/zhi/tree/main/libs/zhi-common-json-validate)
- [ ] [zhi-common-markdown](https://github.com/terwer/zhi/tree/main/libs/zhi-common-markdown)
- [X] [zhi-common-markdown](https://github.com/terwer/zhi/tree/main/libs/zhi-common-markdown)
- [ ] [zhi-common-version](https://github.com/terwer/zhi/tree/main/libs/zhi-common-version)
- [X] [zhi-blog-api](https://github.com/terwer/zhi/tree/main/libs/zhi-blog-api)
- [X] [zhi-xmlrpc-middleware](https://github.com/terwer/zhi/tree/main/libs/zhi-xmlrpc-middleware)
Expand All @@ -39,6 +39,8 @@
- [ ] [zhi-http-api](https://github.com/terwer/zhi/tree/main/libs/zhi-http-api)
- [ ] [zhi-zhihu-api](https://github.com/terwer/zhi/tree/main/libs/zhi-zhihu-api)
- [ ] [zhi-csdn-api](https://github.com/terwer/zhi/tree/main/libs/zhi-csdn-api)
- [ ] [zhi-picgo-core](https://github.com/terwer/zhi/tree/main/libs/zhi-picgo-core)
- [ ] [zhi-siyuan-picgo](https://github.com/terwer/zhi/tree/main/libs/zhi-siyuan-picgo)

### 脚手架

Expand Down
12 changes: 12 additions & 0 deletions apps/zhi-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# zhi-cli

## 1.5.10

### Patch Changes

- zhi-log@1.14.10

## 1.5.9

### Patch Changes

- zhi-log@1.14.9

## 1.5.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/zhi-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zhi-cli",
"version": "1.5.8",
"version": "1.5.10",
"description": "a tool for generating zhi framework related projects",
"type": "module",
"bin": {
Expand Down
29 changes: 29 additions & 0 deletions libs/zhi-blog-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# zhi-blog-api

## 1.6.10

### Patch Changes

- fix deps
- Updated dependencies
- zhi-lib-base@0.4.1

## 1.6.9

### Patch Changes

- Updated dependencies
- zhi-lib-base@0.4.0

## 1.6.8

### Patch Changes

- Updated dependencies
- zhi-lib-base@0.3.1

## 1.6.7

### Patch Changes

- Updated dependencies
- zhi-lib-base@0.3.0

## 1.6.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion libs/zhi-blog-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zhi-blog-api",
"version": "1.6.6",
"version": "1.6.10",
"type": "module",
"description": "a common blog interface",
"main": "./dist/index.js",
Expand Down
1 change: 1 addition & 0 deletions libs/zhi-common-markdown/.env.development.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_DEBUG_MODE=true
4 changes: 4 additions & 0 deletions libs/zhi-common-markdown/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: ["./node_modules/@terwer/eslint-config-custom/typescript/index.cjs"],
}
2 changes: 2 additions & 0 deletions libs/zhi-common-markdown/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
.DS_Store
11 changes: 11 additions & 0 deletions libs/zhi-common-markdown/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# platform

# Ignore artifacts:
dist
node_modules

# Ignore all dts files:
*.d.ts

# lib
/pnpm-lock.yaml
30 changes: 30 additions & 0 deletions libs/zhi-common-markdown/.prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2023, Terwer . All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Terwer designates this
* particular file as subject to the "Classpath" exception as provided
* by Terwer in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
* or visit www.terwer.space if you need additional information or have any
* questions.
*/

module.exports = {
semi: false,
singleQuote: false,
printWidth: 120
}
20 changes: 20 additions & 0 deletions libs/zhi-common-markdown/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# zhi-common-markdown

## 0.1.1

### Patch Changes

- fix deps
- Updated dependencies
- zhi-lib-base@0.4.1

## 0.1.0

### Minor Changes

- fix log msg

### Patch Changes

- Updated dependencies
- zhi-lib-base@0.4.0
41 changes: 41 additions & 0 deletions libs/zhi-common-markdown/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# zhi-common-markdown

a universal Markdown parsing tool

## Usage

```js
// usage
```

## Deps

```
## Congregations! zhi-common-markdown need no deps, it is just pure js code 🎉
```

## Dev

```bash
pnpm dev -F zhi-common-markdown
```

## Build

```bash
pnpm build -F zhi-common-markdown
```

## Test

Execute the unit tests via [vitest](https://vitest.dev)

```bash
pnpm test -F zhi-common-markdown
```

## Publish

```bash
pnpm publish -F zhi-common-markdown --tag latest
```
12 changes: 12 additions & 0 deletions libs/zhi-common-markdown/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue + TS</title>
</head>
<body>
This file is for lib hot-load test only, see <a href="/src/index.ts">/src/index.ts</a>
<script type="module" src="/src/index.ts"></script>
</body>
</html>
39 changes: 39 additions & 0 deletions libs/zhi-common-markdown/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "zhi-common-markdown",
"version": "0.1.1",
"type": "module",
"description": "a universal Markdown parsing tool",
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
"repository": "terwer/zhi",
"homepage": "https://github.com/terwer/zhi/tree/main/libs/zhi-common-markdown",
"author": "terwer",
"license": "MIT",
"files": [
"dist",
"README.md"
],
"keywords": [
"zhi",
"lib"
],
"scripts": {
"serve": "vite",
"dev": "vite build --watch",
"build": "vite build",
"start": "vite preview",
"test": "npx vitest --watch"
},
"devDependencies": {
"@terwer/eslint-config-custom": "^1.2.0",
"@terwer/vite-config-custom": "^0.5.0",
"@types/showdown": "^2.0.1"
},
"dependencies": {
"showdown": "^2.1.0",
"zhi-lib-base": "workspace:*"
},
"publishConfig": {
"access": "public"
}
}

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions libs/zhi-common-markdown/src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2023, Terwer . All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Terwer designates this
* particular file as subject to the "Classpath" exception as provided
* by Terwer in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
* or visit www.terwer.space if you need additional information or have any
* questions.
*/

import { describe, it } from "vitest"

describe("index", () => {
it("test index", () => {
console.log("hello")
})
})
27 changes: 27 additions & 0 deletions libs/zhi-common-markdown/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (c) 2023, Terwer . All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Terwer designates this
* particular file as subject to the "Classpath" exception as provided
* by Terwer in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
* or visit www.terwer.space if you need additional information or have any
* questions.
*/

import MarkdownUtil from "./lib/markdownUtil"
export { MarkdownUtil }
41 changes: 41 additions & 0 deletions libs/zhi-common-markdown/src/lib/markdownUtil.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright (c) 2023, Terwer . All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Terwer designates this
* particular file as subject to the "Classpath" exception as provided
* by Terwer in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
* or visit www.terwer.space if you need additional information or have any
* questions.
*/

import { describe, it, expect } from "vitest"
import path from "path"
import MarkdownUtil from "./markdownUtil"

describe("markdownUtil", () => {
const moduleBase = path.resolve(__dirname, "../../../..")
// lute
require(path.join(moduleBase, "libs/zhi-common-markdown/public/libs/lute/lute-1.7.5-20230410.min.cjs"))

it("test renderHTML", async () => {
const markdownUtil = new MarkdownUtil()
const result = await markdownUtil.renderHTML("# hello")
console.log(result)
expect(result).toBe("<h1>hello</h1>\n")
})
})
Loading

0 comments on commit 4c0c4b7

Please sign in to comment.