Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .eslintignore

This file was deleted.

4 changes: 0 additions & 4 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

# npx --no-install commitlint --edit "$1"
npx --no-install commitlint --edit "$1"
File renamed without changes.
18 changes: 3 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ To develop and test the core `VueHooks Plus` package:

1. `packages/hooks/src` folder adds a folder starting with an `useXxx`.

2. Add `en-US.md` and `zh-CN.md` as a document.
2. Add `*.md` as a document at `docs/en` or `docs/zh`.

3. Add `demo` folder as a document example.
3. Add `demo` folder as a document example as `docs/demo`.

4. Add `__tests__` folder as Unit Tests.

Expand All @@ -40,19 +40,7 @@ Start documentation via [Dev Document Guide](./DEV_DOCUMENT.md).

1. Run `pnpm docs:dev` in VueHooks Plus's root folder or Run `pnpm initial` and `pnpm docs:dev` `packages/hooks` folder.

2. `.md` must add a mapping path.

```

---
map:
# Path mapped to docs
path: /useBoolean
---

```

3. `packages/hooks/docs/.vitepress/router.ts` add hooks router info.
2. `docs/.vitepress/config` add hooks router info.

## Pull Request Guidelines

Expand Down
42 changes: 1 addition & 41 deletions DEV_DOCUMENT.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,8 @@
# Dev the Document

## Working principle

I modified the [ruabick](https://github.com/dewfall123/ruabick) plugin o read the .md file and map the generated path。

### plugins:

- `@vue-hooks-plus/vite-plugin-gen-temp` dynamically generate md files.
- `@vue-hooks-plus/vitepress-demo-block` demo block at the md files.
- `@vue-hooks-plus/vitepress` transformation based on vitepress to support internationalization.
- `@vue-hooks-plus/md-demo-plugins` apply demo block.

[Source](https://github.com/InhiblabCore/plugins)

## Start

need run initial at `packages/hooks` folder.

```bash

pnpm initial

```

Check if a .docs folder is generated in your directory。If it fails, it cannot be started and needs to be re-run `initial` 👆 .

next, vitepress run .docs

```bash

pnpm docs:dev

```

or

at `root` dir run

```bash

pnpm install
pnpm docs:dev

```

will implement script to finished `scripts/docs.ts`

If the page startup is blank, you need to refresh the page.
15 changes: 10 additions & 5 deletions commitlint.config.js → commitlint.config.cts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
// revert:回滚某个更早之前的提交 | Roll back some earlier previous submission
// version: 改变package.json 版本 | Change the package.json version

module.exports = {
import { RuleConfigSeverity, type UserConfig } from "@commitlint/types";

const Configuration: UserConfig = {
extends: ["@commitlint/config-conventional"],
formatter: "@commitlint/format",
ignores: [commit => commit.includes('init')],
extends: ['@commitlint/config-conventional'],
rules: {
'body-leading-blank': [2, 'always'],
'footer-leading-blank': [1, 'always'],
Expand All @@ -22,8 +25,7 @@ module.exports = {
'type-empty': [2, 'never'],
'subject-case': [0],
'type-enum': [
2,
'always',
RuleConfigSeverity.Error, "always",
[
'feat',
'fix',
Expand All @@ -42,4 +44,7 @@ module.exports = {
],
],
},
}
};

export default Configuration;

53 changes: 53 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import pluginVue from 'eslint-plugin-vue'
import globals from 'globals'
import { defineConfig, globalIgnores } from 'eslint/config'

export default defineConfig([
...pluginVue.configs['flat/recommended'],
globalIgnores(['dist/*', 'node_modules/*', 'patches/*', 'types/*']),
{
rules: {
'vue/multi-word-component-names': 'off',
'vue/html-self-closing': 'off',
'react/no-string-refs': 'off',
'react/no-unknown-property': 'off',
'react/display-name': 'off',
'no-sparse-arrays': 0,
'no-inner-declarations': 0,
'no-constant-condition': 0,
'no-restricted-imports': [
'error',
{
paths: ['vue-hooks-plus', '..', '../..', 'packages/hooks/src/index.ts'],
},
],
'no-unused-vars': [
2,
{
vars: 'local',
args: 'none',
},
],
'node/no-callback-literal': 'off',
'import/namespace': 'off',
'import/default': 'off',
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',

'vue/attributes-order': 'off',
'vue/one-component-per-file': 'off',
'vue/html-closing-bracket-newline': 'off',
'vue/max-attributes-per-line': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/attribute-hyphenation': 'off',
'vue/require-default-prop': 'off',
},
languageOptions: {
sourceType: 'module',
globals: {
...globals.browser,
},
},
},
])
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"docs:build": "pnpm build && vitepress build docs",
"docs:build-github": "pnpm build:vitepress-demo-block && tsx scripts/gitPage.ts github",
"docs:build-gitee": "pnpm build:vitepress-demo-block && tsx scripts/gitPage.ts gitee",
"clean": " rimraf dist lib es",
"build": "pnpm recursive exec pnpm run build",
"test": "vitest",
"test:ui": "vitest --ui",
Expand All @@ -23,8 +22,8 @@
"docs:preview": "vitepress preview docs"
},
"devDependencies": {
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@commitlint/cli": "^17.8.1",
"@commitlint/config-conventional": "^17.8.1",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^29.0.0",
"@types/lodash": "^4.14.178",
Expand All @@ -34,18 +33,18 @@
"@types/prettier": "^2.6.3",
"@types/qs": "^6.9.7",
"@types/react-dom": "^18.0.6",
"@typescript-eslint/eslint-plugin": "^5.33.0",
"@vite-pwa/vitepress": "^1.0.0",
"@vitejs/plugin-vue": "^2.3.1",
"@vitest/coverage-c8": "^0.25.7",
"@vitest/ui": "^0.25.3",
"@vue-hooks-plus/eslint-config": "workspace:^1.0.0",
"@vue-hooks-plus/md-demo-plugins": "^1.0.0",
"@vue-hooks-plus/types": "workspace:^2.0.0",
"@vue-hooks-plus/use-immer": "workspace:^1.0.0",
"@vue-hooks-plus/use-request": "workspace:^2.0.0",
"@vue-hooks-plus/use-request-plugins": "workspace:^2.0.0",
"@vue-hooks-plus/use-worker": "workspace:^1.0.0",
"@vue-hooks-plus/use-url-state": "workspace:^1.0.0",
"@vue-hooks-plus/use-worker": "workspace:^1.0.0",
"@vue-hooks-plus/vite-plugin-gen-temp": "^2.6.6",
"@vue-hooks-plus/vitepress": "^1.2.4",
"@vue-hooks-plus/vitepress-demo-block": "workspace:^1.0.0",
Expand All @@ -54,6 +53,8 @@
"axios": "^1.4.0",
"broadcast-channel": "^5.1.0",
"cross-env": "^7.0.3",
"eslint": "^9.24.0",
"eslint-plugin-vue": "^9.6.0",
"execa": "^6.1.0",
"fast-glob": "^3.2.12",
"fs-extra": "^11.3.0",
Expand Down Expand Up @@ -84,9 +85,12 @@
"vue-tsc": "1.0.9",
"vue-typical": "^2.1.0"
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged"
},
"lint-staged": {
"*.{js,ts,tsx,vue}": [
"echo Linting..."
"*.{js,ts,tsx,vue,md,json}": [
"eslint --cache --fix"
]
},
"repository": "https://github.com/InhiblabCore/vue-hooks-plus",
Expand Down
100 changes: 0 additions & 100 deletions packages/eslint-config/index.js

This file was deleted.

31 changes: 0 additions & 31 deletions packages/eslint-config/package.json

This file was deleted.

File renamed without changes.
6 changes: 0 additions & 6 deletions packages/hooks/scripts/config.ts

This file was deleted.

Loading
Loading