From 6c92fa7018662fc3d88f5ec074020a19268c27b0 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 28 Apr 2022 17:21:45 -0700 Subject: [PATCH] feat(tooling): automatically sort `package.json` --- package.json | 62 ++++++++++++++++++++++++++------------------------ pnpm-lock.yaml | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index 9b0c21d127..e006707e70 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,5 @@ { "name": "vue-component-library-starter", - "type": "module", "version": "0.5.0", "description": "The easy way to start your Vue 3 Component Library.", "keywords": [ @@ -14,8 +13,10 @@ ], "license": "MIT", "author": "Open Web Labs", - "main": "./dist/my-awesome-vue-component-lib.umd.js", - "module": "./dist/my-awesome-vue-component-lib.es.js", + "contributors": [ + "Chris Breuer " + ], + "type": "module", "exports": { ".": { "import": "./dist/my-awesome-vue-component-lib.es.js", @@ -24,28 +25,44 @@ "./styles.css": "./styles.css", "./postcss.config.js": "./postcss.config.js" }, + "main": "./dist/my-awesome-vue-component-lib.umd.js", + "module": "./dist/my-awesome-vue-component-lib.es.js", + "typings": "./dist/index.d.ts", "files": [ "dist", "src", "styles.css", "postcss.config.js" ], - "typings": "./dist/index.d.ts", "scripts": { - "dev": "node .scripts/run-example.js", "build": "vite build && vue-tsc --emitDeclarationOnly", - "preview": "vite preview", - "commit": "git-cz", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", + "commit": "git-cz", + "coverage": "vitest run --coverage", + "dev": "node .scripts/run-example.js", + "preinstall": "node .scripts/check-for-pnpm.js && node .scripts/check-node-version.js", "lint": "eslint .", "lint:fix": "eslint . --fix", + "preview": "vite preview", + "release": "npx bumpp package.json examples/*/package.json --commit 'chore(release): %s' --tag --push && pnpm run changelog", "test": "vitest", - "test:unit": "vitest", "test:e2e": "cypress open", - "coverage": "vitest run --coverage", - "typecheck": "vue-tsc --emitDeclarationOnly", - "preinstall": "node .scripts/check-for-pnpm.js && node .scripts/check-node-version.js", - "release": "npx bumpp package.json examples/*/package.json --commit 'chore(release): %s' --tag --push && pnpm run changelog" + "test:unit": "vitest", + "typecheck": "vue-tsc --emitDeclarationOnly" + }, + "simple-git-hooks": { + "pre-commit": "npx lint-staged", + "commit-msg": "npx commitlint --config ./commitlint.config.cjs --edit $1" + }, + "lint-staged": { + "*.{js,jsx,ts,tsx}": "eslint --fix", + "*.{vue}": "prettier --write ./src", + "package.json": "sort-package-json" + }, + "config": { + "commitizen": { + "path": "@commitlint/cz-commitlint" + } }, "dependencies": { "vue": "^3.2.33" @@ -77,6 +94,7 @@ "prettier": "^2.6.2", "prettier-plugin-tailwindcss": "^0.1.10", "simple-git-hooks": "^2.7.0", + "sort-package-json": "^1.55.0", "tailwindcss": "^3.0.24", "typescript": "^4.6.3", "unplugin-auto-import": "^0.7.1", @@ -86,24 +104,8 @@ "vitest": "^0.10.0", "vue-tsc": "^0.34.10" }, - "simple-git-hooks": { - "pre-commit": "npx lint-staged", - "commit-msg": "npx commitlint --config ./commitlint.config.cjs --edit $1" - }, - "lint-staged": { - "*.{js,jsx,ts,tsx}": "eslint --fix", - "*.{vue}": "prettier --write ./src" - }, "engines": { "node": ">=v16.15.0", "pnpm": ">=6.32.11" - }, - "config": { - "commitizen": { - "path": "@commitlint/cz-commitlint" - } - }, - "contributors": [ - "Chris Breuer " - ] -} + } +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 54fc760980..346573e4a1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,6 +27,7 @@ specifiers: prettier: ^2.6.2 prettier-plugin-tailwindcss: ^0.1.10 simple-git-hooks: ^2.7.0 + sort-package-json: ^1.55.0 tailwindcss: ^3.0.24 typescript: ^4.6.3 unplugin-auto-import: ^0.7.1 @@ -67,6 +68,7 @@ devDependencies: prettier: 2.6.2 prettier-plugin-tailwindcss: 0.1.10_prettier@2.6.2 simple-git-hooks: 2.7.0 + sort-package-json: 1.55.0 tailwindcss: 3.0.24 typescript: 4.6.4 unplugin-auto-import: 0.7.1_@vueuse+core@8.3.1+vite@2.9.6 @@ -535,6 +537,13 @@ packages: resolution: {integrity: sha512-/zPMqDkzSZ8t3VtxOa4KPq7uzzW978M9Tvh+j7GHKuo6k6GTLxPJ4J5gE5cjfJ26pnXst0N5Hax8Sr0T2Mi9zQ==} dev: true + /@types/glob/7.2.0: + resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} + dependencies: + '@types/minimatch': 3.0.5 + '@types/node': 17.0.29 + dev: true + /@types/json-schema/7.0.11: resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==} dev: true @@ -549,6 +558,10 @@ packages: '@types/unist': 2.0.6 dev: true + /@types/minimatch/3.0.5: + resolution: {integrity: sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==} + dev: true + /@types/minimist/1.2.2: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} dev: true @@ -1741,6 +1754,11 @@ packages: engines: {node: '>=8'} dev: true + /detect-newline/3.1.0: + resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} + engines: {node: '>=8'} + dev: true + /detective/5.2.0: resolution: {integrity: sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg==} engines: {node: '>=0.8.0'} @@ -2697,6 +2715,10 @@ packages: get-intrinsic: 1.1.1 dev: true + /git-hooks-list/1.0.3: + resolution: {integrity: sha512-Y7wLWcrLUXwk2noSka166byGCvhMtDRpgHdzCno1UQv/n/Hegp++a2xBWJL1lJarnKD3SWaljD+0z1ztqxuKyQ==} + dev: true + /git-raw-commits/2.0.11: resolution: {integrity: sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A==} engines: {node: '>=10'} @@ -2807,6 +2829,20 @@ packages: type-fest: 0.20.2 dev: true + /globby/10.0.0: + resolution: {integrity: sha512-3LifW9M4joGZasyYPz2A1U74zbC/45fvpXUvO/9KbSa+VV0aGZarWkfdgKyR9sExNP0t0x0ss/UMJpNpcaTspw==} + engines: {node: '>=8'} + dependencies: + '@types/glob': 7.2.0 + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.2.11 + glob: 7.2.0 + ignore: 5.2.0 + merge2: 1.4.1 + slash: 3.0.0 + dev: true + /globby/11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} @@ -3138,6 +3174,11 @@ packages: engines: {node: '>=0.10.0'} dev: true + /is-plain-obj/2.1.0: + resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} + engines: {node: '>=8'} + dev: true + /is-regex/1.1.4: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} engines: {node: '>= 0.4'} @@ -4415,6 +4456,22 @@ packages: is-fullwidth-code-point: 4.0.0 dev: true + /sort-object-keys/1.1.3: + resolution: {integrity: sha512-855pvK+VkU7PaKYPc+Jjnmt4EzejQHyhhF33q31qG8x7maDzkeFhAAThdCYay11CISO+qAMwjOBP+fPZe0IPyg==} + dev: true + + /sort-package-json/1.55.0: + resolution: {integrity: sha512-xhKvRD8WGbALjXQkVuk4/93Z/2NIO+5IzKamdMjN5kn3L+N+M9YWQssmM6GXlQr9v1F7PGWsOJEo1gvXOhM7Mg==} + hasBin: true + dependencies: + detect-indent: 6.0.0 + detect-newline: 3.1.0 + git-hooks-list: 1.0.3 + globby: 10.0.0 + is-plain-obj: 2.1.0 + sort-object-keys: 1.1.3 + dev: true + /source-map-js/1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'}