diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 85145ceb..30541e8c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,4 +20,5 @@ repos: - id: prettier additional_dependencies: - prettier@3.2.5 - - '@ianvs/prettier-plugin-sort-imports@4.1.1' + - '@ianvs/prettier-plugin-sort-imports@4.2.1' + - prettier-plugin-packagejson@2.4.12 diff --git a/.prettierignore b/.prettierignore index e012e905..2800b618 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,6 +1,5 @@ dist/ node_modules/ -package.json pnpm-lock.yaml example/ payload-examples/ diff --git a/package.json b/package.json index 48a0232f..345add61 100644 --- a/package.json +++ b/package.json @@ -3,53 +3,48 @@ "version": "1.3.1", "private": true, "description": "A Github Action to deploy to Cloudflare Pages", + "keywords": [ + "actions", + "node", + "setup" + ], + "bugs": "https://github.com/unlike-ltd/github-actions-cloudflare-pages/issues", + "repository": { + "type": "git", + "url": "https://github.com/unlike-ltd/github-actions-cloudflare-pages.git" + }, + "license": "MIT", + "author": "Unlike Ltd (https://unlike.dev/)", "type": "module", "exports": "./dist/index.js", "scripts": { - "start": "node -r dotenv/config ./dist/index.js", + "act:d": "act -j delete --secret-file .env", + "all": "pnpm run codegen && pnpm run codegen:events && pnpm run tsc:ls && pnpm run format && pnpm run lint:ls && pnpm run test && pnpm run build", "build": "node ./esbuild.config.js", "build:cli": "esbuild src/index.ts --bundle --platform=node --target=node18 --format=esm --keep-names --legal-comments=external --sourcemap --analyze --outfile=dist/index.js --tree-shaking=true", - "tsc:check": "tsc --noEmit --checkJs", - "tsc:watch": "pnpm run tsc:check --watch", - "tsc:ls": "pnpm run tsc:check --listFilesOnly", - "tsc:types": "pnpm run codegen && pnpm run codegen:events && pnpm run tsc:ls", + "changeset": "changeset", + "codegen": "graphql-codegen-esm --config graphql.config.js", + "codegen:events": "tsx bin/codegen/index.ts", + "codegen:watch": "pnpm run codegen --watch", + "deployments:delete": "tsx bin/deployments/index.ts", + "download": "tsx bin/download/index.ts", "format": "prettier --write .", "format:check": "prettier --check .", "lint": "pnpm run tsc:check && eslint .", "lint:debug": "pnpm run lint -- --debug", "lint:fix": "pnpm run lint -- --fix", "lint:ls": "DEBUG=eslint:cli-engine pnpm run lint", + "release": "changeset publish", + "start": "node -r dotenv/config ./dist/index.js", "test": "vitest run", "test:ci": "vitest run --reporter=github-actions", "test:watch": "vitest", - "all": "pnpm run codegen && pnpm run codegen:events && pnpm run tsc:ls && pnpm run format && pnpm run lint:ls && pnpm run test && pnpm run build", - "act:d": "act -j delete --secret-file .env", - "codegen": "graphql-codegen-esm --config graphql.config.js", - "codegen:watch": "pnpm run codegen --watch", - "codegen:events": "tsx bin/codegen/index.ts", - "download": "tsx bin/download/index.ts", - "deployments:delete": "tsx bin/deployments/index.ts", - "changeset": "changeset", - "version": "changeset version", - "release": "changeset publish" - }, - "repository": { - "type": "git", - "url": "https://github.com/unlike-ltd/github-actions-cloudflare-pages.git" - }, - "bugs": "https://github.com/unlike-ltd/github-actions-cloudflare-pages/issues", - "keywords": [ - "actions", - "node", - "setup" - ], - "author": "Unlike Ltd (https://unlike.dev/)", - "license": "MIT", - "engines": { - "node": "^20.11.0", - "pnpm": "^8.15.1" + "tsc:check": "tsc --noEmit --checkJs", + "tsc:ls": "pnpm run tsc:check --listFilesOnly", + "tsc:types": "pnpm run codegen && pnpm run codegen:events && pnpm run tsc:ls", + "tsc:watch": "pnpm run tsc:check --watch", + "version": "changeset version" }, - "packageManager": "pnpm@8.15.1", "dependencies": { "@octokit-next/core": "2.7.1", "@octokit/plugin-paginate-rest": "10.0.0", @@ -83,11 +78,17 @@ "graphql": "16.8.1", "graphql-tag": "2.12.6", "prettier": "3.2.5", + "prettier-plugin-packagejson": "2.4.12", "tsx": "4.7.1", "typescript": "5.4.3", "undici": "6.7.1", "vitest": "1.4.0" }, + "packageManager": "pnpm@8.15.1", + "engines": { + "node": "^20.11.0", + "pnpm": "^8.15.1" + }, "pnpm": { "peerDependencyRules": { "ignoreMissing": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d972eaa1..1fef75eb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -97,6 +97,9 @@ devDependencies: prettier: specifier: 3.2.5 version: 3.2.5 + prettier-plugin-packagejson: + specifier: 2.4.12 + version: 2.4.12(prettier@3.2.5) tsx: specifier: 4.7.1 version: 4.7.1 @@ -2598,6 +2601,11 @@ packages: webcrypto-core: 1.7.8 dev: true + /@pkgr/core@0.1.1: + resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} + engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} + dev: true + /@repeaterjs/repeater@3.0.5: resolution: {integrity: sha512-l3YHBLAol6d/IKnB9LhpD0cEZWAoe3eFKUyTYWmFmCO2Q/WOckxLQAUyMZWwZV2M/m3+4vgRoaolFqaII82/TA==} dev: true @@ -3750,6 +3758,16 @@ packages: engines: {node: '>=8'} dev: true + /detect-indent@7.0.1: + resolution: {integrity: sha512-Mc7QhQ8s+cLrnUfU/Ji94vG/r8M26m8f++vyres4ZoojaRDpZ1eSIh/EpzLNwlWuvzSZ3UbDFspjFvTDXe6e/g==} + engines: {node: '>=12.20'} + dev: true + + /detect-newline@4.0.1: + resolution: {integrity: sha512-qE3Veg1YXzGHQhlA6jzebZN2qVf6NX+A7m7qlhCGG30dJixrAQhYOsJjsnBjJkCSmuOPpCk30145fr8FV0bzog==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + /diff-sequences@29.6.3: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -4420,6 +4438,11 @@ packages: source-map: 0.6.1 dev: false + /get-stdin@9.0.0: + resolution: {integrity: sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA==} + engines: {node: '>=12'} + dev: true + /get-stream@8.0.1: resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} engines: {node: '>=16'} @@ -4440,6 +4463,10 @@ packages: resolve-pkg-maps: 1.0.0 dev: true + /git-hooks-list@3.1.0: + resolution: {integrity: sha512-LF8VeHeR7v+wAbXqfgRlTSX/1BJR9Q1vEMR8JAz1cEg6GX07+zyj3sAdDvYjj/xnlIfVuGgj4qBei1K3hKH+PA==} + dev: true + /glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -4499,6 +4526,17 @@ packages: slash: 3.0.0 dev: true + /globby@13.2.2: + resolution: {integrity: sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + dir-glob: 3.0.1 + fast-glob: 3.3.2 + ignore: 5.3.1 + merge2: 1.4.1 + slash: 4.0.0 + dev: true + /gopd@1.0.1: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} dependencies: @@ -4890,7 +4928,6 @@ packages: /is-plain-obj@4.1.0: resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} engines: {node: '>=12'} - dev: false /is-plain-object@5.0.0: resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} @@ -5804,6 +5841,19 @@ packages: engines: {node: '>= 0.8.0'} dev: true + /prettier-plugin-packagejson@2.4.12(prettier@3.2.5): + resolution: {integrity: sha512-hifuuOgw5rHHTdouw9VrhT8+Nd7UwxtL1qco8dUfd4XUFQL6ia3xyjSxhPQTsGnSYFraTWy5Omb+MZm/OWDTpQ==} + peerDependencies: + prettier: '>= 1.16.0' + peerDependenciesMeta: + prettier: + optional: true + dependencies: + prettier: 3.2.5 + sort-package-json: 2.8.0 + synckit: 0.9.0 + dev: true + /prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} @@ -6249,6 +6299,11 @@ packages: engines: {node: '>=8'} dev: true + /slash@4.0.0: + resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} + engines: {node: '>=12'} + dev: true + /slice-ansi@3.0.0: resolution: {integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==} engines: {node: '>=8'} @@ -6287,6 +6342,23 @@ packages: tslib: 2.6.2 dev: true + /sort-object-keys@1.1.3: + resolution: {integrity: sha512-855pvK+VkU7PaKYPc+Jjnmt4EzejQHyhhF33q31qG8x7maDzkeFhAAThdCYay11CISO+qAMwjOBP+fPZe0IPyg==} + dev: true + + /sort-package-json@2.8.0: + resolution: {integrity: sha512-PxeNg93bTJWmDGnu0HADDucoxfFiKkIr73Kv85EBThlI1YQPdc0XovBgg2llD0iABZbu2SlKo8ntGmOP9wOj/g==} + hasBin: true + dependencies: + detect-indent: 7.0.1 + detect-newline: 4.0.1 + get-stdin: 9.0.0 + git-hooks-list: 3.1.0 + globby: 13.2.2 + is-plain-obj: 4.1.0 + sort-object-keys: 1.1.3 + dev: true + /source-map-js@1.2.0: resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} engines: {node: '>=0.10.0'} @@ -6475,6 +6547,14 @@ packages: tslib: 2.6.2 dev: true + /synckit@0.9.0: + resolution: {integrity: sha512-7RnqIMq572L8PeEzKeBINYEJDDxpcH8JEgLwUqBd3TkofhFRbkq4QLR0u+36avGAhCRbk2nnmjcW9SE531hPDg==} + engines: {node: ^14.18.0 || >=16.0.0} + dependencies: + '@pkgr/core': 0.1.1 + tslib: 2.6.2 + dev: true + /term-size@2.2.1: resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} engines: {node: '>=8'} diff --git a/prettier.config.cjs b/prettier.config.cjs index 0bdd507b..3a88abd1 100644 --- a/prettier.config.cjs +++ b/prettier.config.cjs @@ -1,6 +1,9 @@ /** @type {import("@ianvs/prettier-plugin-sort-imports").PrettierConfig} */ const config = { - plugins: [require.resolve('@ianvs/prettier-plugin-sort-imports')], + plugins: [ + require.resolve('@ianvs/prettier-plugin-sort-imports'), + 'prettier-plugin-packagejson' + ], importOrder: [ '', '',