Skip to content
This repository was archived by the owner on Aug 6, 2024. It is now read-only.

Commit 4992b98

Browse files
committed
chore: update deps and config
1 parent 19bf74f commit 4992b98

19 files changed

+12266
-7781
lines changed

.commitlintrc.cjs

-3
This file was deleted.

.czrc

-3
This file was deleted.

.eslintrc.cjs

-6
This file was deleted.

.lintstagedrc.cjs

-5
This file was deleted.

.markdownlint.json

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
{
2-
"MD001": false,
3-
"MD003": false,
4-
"MD013": false,
5-
"MD022": false,
6-
"MD024": false,
7-
"MD025": false,
8-
"MD033": false,
9-
"MD036": false,
10-
"MD050": false
2+
"$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json",
3+
"extends": "@modyqyw/fabric/markdownlint.json"
114
}

.prettierrc.cjs

-3
This file was deleted.

.simple-git-hooks.cjs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
2-
"pre-commit": "npx lint-staged",
3-
"commit-msg": "npx commitlint --edit ${1}",
4-
};
1+
require('esbuild-register');
2+
const { simpleGitHooks } = require('@modyqyw/fabric');
3+
4+
module.exports = simpleGitHooks();

.vscode/extensions.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"DavidAnson.vscode-markdownlint",
4+
"dbaeumer.vscode-eslint",
5+
"EditorConfig.EditorConfig",
6+
"esbenp.prettier-vscode"
7+
]
8+
}

.vscode/settings.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"[javascript][javascriptreact][typescript][typescriptreact][vue][markdown][json][jsonc][yaml]": {
3+
"editor.codeActionsOnSave": {
4+
"source.fixAll.eslint": "explicit"
5+
}
6+
},
7+
"[markdown]": {
8+
"editor.codeActionsOnSave": {
9+
"source.fixAll.markdownlint": "explicit"
10+
}
11+
},
12+
"editor.defaultFormatter": "esbenp.prettier-vscode",
13+
"editor.formatOnSave": true,
14+
"eslint.experimental.useFlatConfig": true,
15+
"eslint.validate": [
16+
"javascript",
17+
"javascriptreact",
18+
"typescript",
19+
"typescriptreact",
20+
"vue",
21+
"markdown",
22+
"json",
23+
"jsonc",
24+
"yaml"
25+
],
26+
"prettier.enable": true
27+
}

build.config.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { unlink } from 'node:fs/promises';
2+
import { resolve } from 'node:path';
3+
import { defineBuildConfig } from 'unbuild';
4+
5+
export default defineBuildConfig({
6+
clean: true,
7+
declaration: true,
8+
entries: ['./src/index'],
9+
hooks: {
10+
'build:done': async (ctx) => {
11+
const outDir = ctx.options.outDir;
12+
const emptyBuildEntries = ctx.buildEntries.filter(
13+
(entry) => entry.exports?.length === 0,
14+
);
15+
await Promise.all(
16+
emptyBuildEntries.map((entry) => {
17+
return unlink(resolve(outDir, entry.path));
18+
}),
19+
);
20+
},
21+
},
22+
rollup: {
23+
emitCJS: true,
24+
inlineDependencies: true,
25+
},
26+
});

commitlint.config.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { commitlint } from '@modyqyw/fabric';
2+
3+
export default commitlint();

eslint.config.mjs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { eslint } from '@modyqyw/fabric';
2+
3+
export default eslint({
4+
perfectionist: false,
5+
typescript: {
6+
rules: {
7+
'@typescript-eslint/no-namespace': 'off',
8+
},
9+
},
10+
});

lint-staged.config.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { lintStaged } from '@modyqyw/fabric';
2+
3+
export default lintStaged();

package.json

+51-37
Original file line numberDiff line numberDiff line change
@@ -20,70 +20,84 @@
2020
"license": "MIT",
2121
"author": {
2222
"name": "ModyQyW",
23-
"email": "[email protected]",
24-
"url": "https://modyqyw.github.io"
23+
"email": "[email protected]",
24+
"url": "https://modyqyw.top"
25+
},
26+
"type": "module",
27+
"exports": {
28+
".": {
29+
"import": {
30+
"types": "./dist/index.d.mts"
31+
},
32+
"require": {
33+
"types": "./dist/index.d.cts"
34+
}
35+
}
2536
},
2637
"types": "./dist/index.d.ts",
38+
"typesVersions": {
39+
"*": {
40+
"*": [
41+
"./dist/*",
42+
"./dist/index.d.ts"
43+
]
44+
}
45+
},
2746
"files": [
2847
"dist"
2948
],
3049
"scripts": {
31-
"build": "rollup -c",
50+
"build": "unbuild",
3251
"depupdate": "taze -fw",
33-
"dev": "rollup -c --watch",
52+
"dev": "unbuild --stub",
53+
"format": "prettier . \"!**/package-lock.json*\" \"!**/yarn.lock\" \"!**/pnpm-lock.yaml\" --ignore-unknown --write --cache --log-level=warn",
3454
"lint": "conc \"pnpm:lint:eslint\" \"pnpm:lint:markdownlint\" \"pnpm:lint:publint\"",
35-
"lint:eslint": "eslint ./src --fix --cache --ignore-path=.gitignore",
55+
"lint:eslint": "eslint ./src --fix --cache",
3656
"lint:markdownlint": "markdownlint . --fix --ignore-path=.gitignore",
3757
"lint:publint": "publint",
3858
"prepare": "is-ci || simple-git-hooks",
3959
"prepublishOnly": "pnpm run build",
4060
"release": "pnpm install && pnpm run build && pnpm run lint && pnpm run typecheck && pnpm run test && bumpp",
41-
"test": "vitest typecheck --run",
42-
"test:coverage": "vitest typecheck --run --coverage",
61+
"test": "vitest --typecheck --run",
62+
"test:coverage": "vitest --typecheck --run --coverage",
4363
"typecheck": "tsc --noEmit"
4464
},
4565
"dependencies": {
46-
"@dcloudio/types": "^3.3.3",
47-
"@uni-helper/uni-app-types": "^0.5.7",
48-
"vue3": "npm:vue@^3.2.47"
66+
"@dcloudio/types": "^3.4.8",
67+
"@uni-helper/uni-app-types": "^0.5.13",
68+
"vue3": "npm:vue@^3.4.27"
4969
},
5070
"devDependencies": {
51-
"@commitlint/cli": "^17.6.3",
52-
"@commitlint/config-conventional": "^17.6.3",
53-
"@commitlint/prompt": "^17.6.3",
54-
"@modyqyw/fabric": "^8.0.3",
55-
"@tsconfig/node18": "^2.0.0",
56-
"@types/node": "^18.16.7",
57-
"@typescript-eslint/eslint-plugin": "^5.59.5",
58-
"@typescript-eslint/parser": "^5.59.5",
59-
"@vitest/coverage-c8": "^0.31.0",
60-
"bumpp": "^9.1.0",
61-
"c8": "^7.13.0",
62-
"commitizen": "^4.3.0",
63-
"concurrently": "^8.0.1",
64-
"eslint": "^8.40.0",
71+
"@commitlint/cli": "^19.3.0",
72+
"@modyqyw/fabric": "^10.9.5",
73+
"@tsconfig/node20": "^20.1.4",
74+
"@types/node": "^20.12.12",
75+
"@vitest/coverage-v8": "^1.6.0",
76+
"bumpp": "^9.4.1",
77+
"concurrently": "^8.2.2",
78+
"esbuild-register": "^3.5.0",
79+
"eslint": "^8.57.0",
6580
"is-ci": "^3.0.1",
66-
"lint-staged": "^13.2.2",
67-
"markdownlint-cli": "^0.34.0",
68-
"prettier": "^2.8.8",
69-
"publint": "^0.1.11",
70-
"rollup": "^3.21.6",
71-
"rollup-plugin-delete": "^2.0.0",
72-
"rollup-plugin-dts": "^5.3.0",
73-
"simple-git-hooks": "^2.8.1",
74-
"taze": "^0.10.1",
75-
"typescript": "^5.0.4",
76-
"vitest": "^0.31.0"
81+
"lint-staged": "^15.2.2",
82+
"markdownlint-cli": "^0.40.0",
83+
"prettier": "^3.2.5",
84+
"publint": "^0.2.7",
85+
"simple-git-hooks": "^2.11.1",
86+
"taze": "^0.13.8",
87+
"typescript": "^5.4.5",
88+
"unbuild": "^2.0.0",
89+
"vitest": "^1.6.0"
7790
},
7891
"peerDependencies": {
79-
"@uni-helper/uni-app-types": "^0.5.1"
92+
"@uni-helper/uni-app-types": "^0.5.13",
93+
"typescript": "^4.8.0 || ^5.0.0"
8094
},
8195
"peerDependenciesMeta": {
8296
"@uni-helper/uni-app-types": {
8397
"optional": true
8498
}
8599
},
86-
"packageManager": "pnpm@8.5.0",
100+
"packageManager": "pnpm@9.1.1",
87101
"engines": {
88102
"node": ">=14.18"
89103
},

0 commit comments

Comments
 (0)