From b451843b25969459f1543af61e58f11d5102734e Mon Sep 17 00:00:00 2001 From: arvinxx Date: Tue, 9 May 2023 20:41:10 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20feat:=20=E6=9B=B4=E6=96=B0=20prett?= =?UTF-8?q?ier=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .prettierignore | 1 + .prettierrc | 5 ----- .prettierrc.js | 19 +++++++++++++++++++ package.json | 24 +++++++++++------------- packages/bar/package.json | 25 +++++++++++++------------ packages/foo/package.json | 25 +++++++++++++------------ 6 files changed, 57 insertions(+), 42 deletions(-) delete mode 100644 .prettierrc create mode 100644 .prettierrc.js diff --git a/.prettierignore b/.prettierignore index b86a5bb..f35ebc6 100644 --- a/.prettierignore +++ b/.prettierignore @@ -16,3 +16,4 @@ LICENSE .eslintcache *.lock yarn-error.log +package.json diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 9409967..0000000 --- a/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "singleQuote": true, - "trailingComma": "all", - "printWidth": 80 -} diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..b70ecec --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,19 @@ +module.exports = { + pluginSearchDirs: false, + plugins: [ + require.resolve('prettier-plugin-organize-imports'), + require.resolve('prettier-plugin-packagejson'), + ], + printWidth: 100, + proseWrap: 'never', + singleQuote: true, + trailingComma: 'all', + overrides: [ + { + files: '*.md', + options: { + proseWrap: 'preserve', + }, + }, + ], +}; diff --git a/package.json b/package.json index c817590..0f0331b 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,17 @@ { "name": "monorepo-template", "private": true, - "author": "arvinxx(arvinx@foxmail.com)", "description": "monorepo develop template", - "workspaces": [ - "packages/*" - ], "homepage": "https://github.com/arvinxx/monorepo-template#readme", "bugs": { "url": "https://github.com/arvinxx/monorepo-template" }, "repository": "git+https://github.com/arvinxx/monorepo-template.git", "license": "MIT", + "author": "arvinxx(arvinx@foxmail.com)", + "workspaces": [ + "packages/*" + ], "scripts": { "start": "concurrently \"npm run api:dev\" \"npm run site:dev\"", "build": "father build", @@ -58,35 +58,33 @@ "@testing-library/react-hooks": "^3.2.1", "@types/classnames": "^2.2.7", "@types/fs-extra": "^9.0.1", - "@umijs/lint": "^4", "@types/jsdom": "^16.2.3", - "@types/node": "^14.14.10", "@types/react": "^18", "@types/react-dom": "^18", - "@types/uuid": "^8.3.0", + "@umijs/lint": "^4", "@vitest/coverage-c8": "latest", + "antd": "^5", "commitlint": "^17", "commitlint-config-gitmoji": "^2", - "conventional-changelog-gitmoji-config": "^1.4.0", "concurrently": "^7", + "conventional-changelog-gitmoji-config": "^1.4.0", "cross-env": "^7", + "dpdm": "^3", "dumi": "^2", - "antd": "^5", - "jsdom": "^21", - "dumi-theme-antd-style": "latest", "dumi-assets-types": "^1", - "dpdm": "^3", + "dumi-theme-antd-style": "latest", "eslint": "^8", "father": "^4", "husky": "^8", + "jsdom": "^21", "lint-staged": "^13", + "multi-semantic-release": "^3", "onchange": "^7", "prettier": "^2", "prettier-plugin-organize-imports": "^3", "prettier-plugin-packagejson": "^2", "react": "^18", "react-dom": "^18", - "multi-semantic-release": "^3", "semantic-release": "^21", "semantic-release-config-gitmoji": "^1", "stylelint": "^14", diff --git a/packages/bar/package.json b/packages/bar/package.json index 88ae6d7..131b910 100644 --- a/packages/bar/package.json +++ b/packages/bar/package.json @@ -1,16 +1,21 @@ { "name": "@arvinxu/bar", "version": "2.0.0", + "main": "lib/index.js", + "module": "es/index.js", + "types": "lib/index.d.ts", "files": [ "lib", "es", "dist" ], - "main": "lib/index.js", - "module": "es/index.js", - "publishConfig": { - "registry": "https://registry.npmjs.org", - "access": "public" + "scripts": { + "build": "father build", + "clean": "rm -rf es lib dist build coverage .umi", + "cov": "jest --coverage", + "doctor": "father doctor", + "test": "vitest", + "test:update": "vitest -u" }, "dependencies": { "@arvinxu/foo": "2.0.0" @@ -19,12 +24,8 @@ "react": "^18", "react-dom": "^18" }, - "scripts": { - "build": "father build", - "test": "vitest", - "test:update": "vitest -u", - "cov": "jest --coverage", - "doctor": "father doctor", - "clean": "rm -rf es lib dist build coverage .umi" + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org" } } diff --git a/packages/foo/package.json b/packages/foo/package.json index b8ca6e6..a173903 100644 --- a/packages/foo/package.json +++ b/packages/foo/package.json @@ -1,27 +1,28 @@ { "name": "@arvinxu/foo", "version": "2.0.0", + "main": "lib/index.js", + "module": "es/index.js", + "types": "lib/index.d.ts", "files": [ "lib", "es", "dist" ], - "main": "lib/index.js", - "module": "es/index.js", - "publishConfig": { - "registry": "https://registry.npmjs.org", - "access": "public" + "scripts": { + "build": "father build", + "clean": "rm -rf es lib dist build coverage .dumi", + "doctor": "father doctor", + "test": "vitest", + "test:coverage": "vitest run --coverage", + "test:update": "vitest -u" }, "peerDependencies": { "react": "^18", "react-dom": "^18" }, - "scripts": { - "build": "father build", - "test": "vitest", - "test:coverage": "vitest run --coverage", - "test:update": "vitest -u", - "doctor": "father doctor", - "clean": "rm -rf es lib dist build coverage .dumi" + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org" } }