diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 7e74b3ee543..0efc3910ab7 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -2,6 +2,10 @@ name: pr on: [pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.ref }} + cancel-in-progress: true + env: NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} diff --git a/packages/eslint-plugin-query/package.json b/packages/eslint-plugin-query/package.json index c825f2b4b65..e54bb7ada2b 100644 --- a/packages/eslint-plugin-query/package.json +++ b/packages/eslint-plugin-query/package.json @@ -30,7 +30,7 @@ "test:types": "tsc --noEmit", "test:lib": "vitest run --coverage", "test:lib:dev": "pnpm run test:lib --watch", - "test:build": "publint", + "test:build": "publint --strict", "build": "tsup --minify --dts" }, "files": [ diff --git a/packages/query-async-storage-persister/package.json b/packages/query-async-storage-persister/package.json index d81ec84f3cc..2ed50db7cad 100644 --- a/packages/query-async-storage-persister/package.json +++ b/packages/query-async-storage-persister/package.json @@ -34,7 +34,7 @@ "test:types": "tsc --noEmit", "test:lib": "vitest run --coverage", "test:lib:dev": "pnpm run test:lib --watch", - "test:build": "publint", + "test:build": "publint --strict", "build": "pnpm build:rollup && pnpm build:types", "build:rollup": "rollup --config rollup.config.js", "build:types": "tsc --emitDeclarationOnly" diff --git a/packages/query-broadcast-client-experimental/package.json b/packages/query-broadcast-client-experimental/package.json index f7a478f1205..9519bc8f2b5 100644 --- a/packages/query-broadcast-client-experimental/package.json +++ b/packages/query-broadcast-client-experimental/package.json @@ -32,7 +32,7 @@ "clean": "rimraf ./build && rimraf ./coverage", "test:eslint": "eslint --ext .ts,.tsx ./src", "test:types": "tsc --noEmit", - "test:build": "publint", + "test:build": "publint --strict", "build": "pnpm build:rollup && pnpm build:types", "build:rollup": "rollup --config rollup.config.js", "build:types": "tsc --emitDeclarationOnly" diff --git a/packages/query-core/package.json b/packages/query-core/package.json index 85befc2c3dd..3db268f065e 100644 --- a/packages/query-core/package.json +++ b/packages/query-core/package.json @@ -34,7 +34,7 @@ "test:types": "tsc --noEmit", "test:lib": "vitest run --coverage", "test:lib:dev": "pnpm run test:lib --watch", - "test:build": "publint", + "test:build": "publint --strict", "build": "pnpm build:rollup && pnpm build:types", "build:rollup": "rollup --config rollup.config.js", "build:types": "tsc --emitDeclarationOnly" diff --git a/packages/query-devtools/package.json b/packages/query-devtools/package.json index 7b7697b3502..fb9fa2bba2a 100644 --- a/packages/query-devtools/package.json +++ b/packages/query-devtools/package.json @@ -11,20 +11,20 @@ "url": "https://github.com/sponsors/tannerlinsley" }, "type": "module", - "types": "build/types/index.d.ts", - "main": "build/cjs/index.js", - "module": "build/esm/index.js", + "types": "dist/types/index.d.ts", + "main": "dist/cjs/index.cjs", + "module": "dist/esm/index.js", "exports": { ".": { - "types": "./build/types/index.d.ts", - "solid": "./build/source/index.jsx", - "import": "./build/esm/index.js", + "types": "./dist/types/index.d.ts", + "solid": "./dist/source/index.jsx", + "import": "./dist/esm/index.js", "browser": { - "import": "./build/esm/index.js", - "require": "./build/cjs/index.js" + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.cjs" }, - "require": "./build/cjs/index.js", - "node": "./build/cjs/index.js" + "require": "./dist/cjs/index.cjs", + "node": "./dist/cjs/index.cjs" }, "./package.json": "./package.json" }, @@ -34,14 +34,12 @@ "test:types": "tsc --noEmit", "test:lib": "vitest run --coverage", "test:lib:dev": "pnpm run test:lib --watch", - "test:build": "publint", - "build": "pnpm build:rollup && pnpm rename-build-dir", - "rename-build-dir": "rimraf ./build && mv ./dist ./build", - "build:rollup": "rollup --config rollup.config.js", - "build:types": "tsc --emitDeclarationOnly" + "test:build": "publint --strict", + "build": "pnpm build:rollup", + "build:rollup": "rollup --config rollup.config.js" }, "files": [ - "build", + "dist", "src" ], "dependencies": { diff --git a/packages/query-devtools/rollup.config.js b/packages/query-devtools/rollup.config.js index 540dc9e36fd..e188340430e 100644 --- a/packages/query-devtools/rollup.config.js +++ b/packages/query-devtools/rollup.config.js @@ -1,13 +1,30 @@ // @ts-check + +import { defineConfig } from 'rollup' import withSolid from 'rollup-preset-solid' -const config = withSolid({ - input: 'src/index.tsx', - targets: ['esm', 'cjs'], -}) +export function createQueryDevtoolsConfig() { + const solidRollupOptions = /** @type {import('rollup').RollupOptions} */ ( + withSolid({ + input: `./src/index.tsx`, + targets: ['esm', 'cjs'], + external: [], + }) + ) + + const outputs = !solidRollupOptions.output + ? [] + : Array.isArray(solidRollupOptions.output) + ? solidRollupOptions.output + : [solidRollupOptions.output] + + outputs.forEach((output) => { + if (output.format === 'cjs') { + output.entryFileNames = '[name].cjs' + } + }) -if (!Array.isArray(config)) { - config.external = [] + return solidRollupOptions } -export default config +export default defineConfig(createQueryDevtoolsConfig()) diff --git a/packages/query-persist-client-core/package.json b/packages/query-persist-client-core/package.json index 0605e654704..10b7c6a4a89 100644 --- a/packages/query-persist-client-core/package.json +++ b/packages/query-persist-client-core/package.json @@ -34,7 +34,7 @@ "test:types": "tsc --noEmit", "test:lib": "vitest run --coverage", "test:lib:dev": "pnpm run test:lib --watch", - "test:build": "publint", + "test:build": "publint --strict", "build": "pnpm build:rollup && pnpm build:types", "build:rollup": "rollup --config rollup.config.js", "build:types": "tsc --emitDeclarationOnly" diff --git a/packages/query-sync-storage-persister/package.json b/packages/query-sync-storage-persister/package.json index ed1ac3d03c7..0005cd6e590 100644 --- a/packages/query-sync-storage-persister/package.json +++ b/packages/query-sync-storage-persister/package.json @@ -34,7 +34,7 @@ "test:types": "tsc --noEmit", "test:lib": "vitest run --coverage", "test:lib:dev": "pnpm run test:lib --watch", - "test:build": "publint", + "test:build": "publint --strict", "build": "pnpm build:rollup && pnpm build:types", "build:rollup": "rollup --config rollup.config.js", "build:types": "tsc --emitDeclarationOnly" diff --git a/packages/react-query-devtools/package.json b/packages/react-query-devtools/package.json index a232ca461b1..5f1e394d586 100644 --- a/packages/react-query-devtools/package.json +++ b/packages/react-query-devtools/package.json @@ -40,7 +40,7 @@ "test:types": "tsc --noEmit", "test:lib": "vitest run --coverage", "test:lib:dev": "pnpm run test:lib --watch", - "test:build": "publint", + "test:build": "publint --strict", "build": "pnpm build:rollup && pnpm build:types", "build:rollup": "rollup --config rollup.config.js", "build:types": "tsc --emitDeclarationOnly && cpy index.d.ts index.prod.d.ts --cwd=build/lib" diff --git a/packages/react-query-persist-client/package.json b/packages/react-query-persist-client/package.json index 143f0c53630..52a4a0e56c0 100644 --- a/packages/react-query-persist-client/package.json +++ b/packages/react-query-persist-client/package.json @@ -34,7 +34,7 @@ "test:types": "tsc --noEmit", "test:lib": "vitest run --coverage", "test:lib:dev": "pnpm run test:lib --watch", - "test:build": "publint", + "test:build": "publint --strict", "build": "pnpm build:rollup && pnpm build:types", "build:rollup": "rollup --config rollup.config.js", "build:types": "tsc --emitDeclarationOnly" diff --git a/packages/react-query/package.json b/packages/react-query/package.json index 82190fc0873..0c56669f967 100644 --- a/packages/react-query/package.json +++ b/packages/react-query/package.json @@ -30,7 +30,7 @@ "test:types": "tsc --noEmit", "test:lib": "vitest run --coverage", "test:lib:dev": "pnpm run test:lib --watch", - "test:build": "publint", + "test:build": "publint --strict", "build": "pnpm build:rollup && pnpm build:codemods && pnpm build:types", "build:rollup": "rollup --config rollup.config.js", "build:codemods": "cpy ../codemods/src/**/* ./build/codemods", diff --git a/packages/solid-query/package.json b/packages/solid-query/package.json index f4775add4a9..4d0cf701994 100644 --- a/packages/solid-query/package.json +++ b/packages/solid-query/package.json @@ -33,7 +33,7 @@ "test:types": "tsc --noEmit", "test:lib": "vitest run --coverage", "test:lib:dev": "pnpm run test:lib --watch", - "test:build": "publint", + "test:build": "publint --strict", "build": "pnpm build:rollup && pnpm build:types", "build:rollup": "rollup --config rollup.config.js", "build:types": "tsc --emitDeclarationOnly" diff --git a/packages/svelte-query-devtools/package.json b/packages/svelte-query-devtools/package.json index b365dd6b0df..578af66c6b1 100644 --- a/packages/svelte-query-devtools/package.json +++ b/packages/svelte-query-devtools/package.json @@ -31,7 +31,7 @@ "clean": "rimraf ./build && rimraf ./coverage", "test:types": "svelte-check --tsconfig ./tsconfig.json", "test:eslint": "eslint --ext .svelte,.ts ./src", - "test:build": "publint", + "test:build": "publint --strict", "build": "svelte-package --input ./src --output ./build/lib" }, "dependencies": { diff --git a/packages/svelte-query/package.json b/packages/svelte-query/package.json index 8f7cb2f1f94..988f22b491d 100644 --- a/packages/svelte-query/package.json +++ b/packages/svelte-query/package.json @@ -35,7 +35,7 @@ "test:eslint": "eslint --ext .svelte,.ts ./src", "test:lib": "vitest run --coverage", "test:lib:dev": "pnpm run test:lib --watch", - "test:build": "publint", + "test:build": "publint --strict", "build": "svelte-package --input ./src --output ./build/lib" }, "dependencies": { diff --git a/packages/vue-query/package.json b/packages/vue-query/package.json index 1ff09a56422..f6083f5774c 100644 --- a/packages/vue-query/package.json +++ b/packages/vue-query/package.json @@ -37,7 +37,7 @@ "test:2.7": "vue-demi-switch 2.7 vue2.7 && vitest", "test:3": "vue-demi-switch 3 && vitest", "test:lib:dev": "pnpm run test:lib --watch", - "test:build": "publint", + "test:build": "publint --strict", "build": "pnpm build:rollup && pnpm build:types", "build:rollup": "rollup --config rollup.config.js", "build:types": "tsc --emitDeclarationOnly"