Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Refactor package exports #5520

Merged
merged 8 commits into from
Jun 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions babel.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,15 @@ module.exports = {
].filter(Boolean),
overrides: [
{
exclude: [
'./packages/solid-query/**',
'./packages/query-devtools/**',
'./packages/svelte-query/**',
'./packages/vue-query/**',
include: [
'./packages/react-query/**',
'./packages/react-query-devtools/**',
'./packages/react-query-persist-client/**',
],
presets: ['@babel/react'],
},
{
include: ['./packages/solid-query/**', './packages/query-devtools/**'],
include: ['./packages/query-devtools/**', './packages/solid-query/**'],
presets: ['babel-preset-solid'],
},
],
Expand Down
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"{workspaceRoot}/.browserslistrc",
"{workspaceRoot}/babel.config.cjs",
"{workspaceRoot}/package.json",
"{workspaceRoot}/scripts/getRollupConfig.mjs",
"{workspaceRoot}/scripts/getRollupConfig.js",
"{workspaceRoot}/tsconfig.json"
],
"globalNonBuildAffectingConfig": ["{workspaceRoot}/.eslintrc.cjs"],
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"build": "nx run-many --target=build --projects=root",
"watch": "concurrently --kill-others \"pnpm -r build:rollup -w\" \"pnpm -r build:types --watch\"",
"dev": "pnpm run watch",
"prettier": "prettier --plugin-search-dir . \"{packages,examples,scripts}/**/*.{md,js,jsx,cjs,mjs,ts,tsx,json,vue,svelte}\"",
"prettier": "prettier --plugin-search-dir . \"{packages,examples,scripts}/**/*.{md,js,jsx,cjs,ts,tsx,json,vue,svelte}\"",
"prettier:write": "pnpm run prettier --write",
"cipublish": "node scripts/publish.mjs",
"validatePackages": "node scripts/validate-packages.mjs"
"cipublish": "node scripts/publish.js",
"validatePackages": "node scripts/validatePackages.js"
},
"nx": {
"includedScripts": [
Expand Down Expand Up @@ -84,7 +84,6 @@
"rollup-plugin-node-externals": "^6.1.0",
"rollup-plugin-preserve-directives": "^0.2.0",
"rollup-plugin-visualizer": "^5.9.0",
"rollup-preset-solid": "^2.0.1",
"semver": "^7.5.1",
"solid-js": "^1.6.13",
"stream-to-array": "^2.3.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/codemods/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./build/lib",
"rootDir": "./src"
"outDir": "./build/lib"
},
"include": ["src"]
}
18 changes: 13 additions & 5 deletions packages/eslint-plugin-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"type": "commonjs",
"main": "build/lib/index.js",
"type": "module",
"types": "build/lib/index.d.ts",
"main": "build/lib/index.cjs",
"module": "build/lib/index.js",
"exports": {
".": {
"require": "./build/lib/index.js",
"default": "./build/lib/index.js"
"types": "./build/lib/index.d.ts",
"import": "./build/lib/index.js",
"require": "./build/lib/index.cjs",
"default": "./build/lib/index.cjs"
},
"./package.json": "./package.json"
},
Expand All @@ -26,7 +30,7 @@
"test:types": "tsc --noEmit",
"test:lib": "vitest run --coverage",
"test:lib:dev": "pnpm run test:lib --watch",
"build": "tsup --minify"
"build": "tsup --minify --dts"
},
"files": [
"build"
Expand All @@ -38,6 +42,10 @@
"external": [
"eslint"
],
"format": [
"cjs",
"esm"
],
"clean": true,
"bundle": true,
"outDir": "build/lib"
Expand Down
1 change: 0 additions & 1 deletion packages/eslint-plugin-query/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./build/lib",
"rootDir": "./src",
"types": ["vitest/globals"]
},
"include": ["src"]
Expand Down
13 changes: 7 additions & 6 deletions packages/query-async-storage-persister/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"type": "commonjs",
"type": "module",
"types": "build/lib/index.d.ts",
"main": "build/lib/index.js",
"module": "build/lib/index.mjs",
"main": "build/lib/index.cjs",
"module": "build/lib/index.js",
"exports": {
".": {
"types": "./build/lib/index.d.ts",
"import": "./build/lib/index.mjs",
"default": "./build/lib/index.js"
"import": "./build/lib/index.js",
"require": "./build/lib/index.cjs",
"default": "./build/lib/index.cjs"
},
"./package.json": "./package.json"
},
Expand All @@ -34,7 +35,7 @@
"test:lib": "vitest run --coverage",
"test:lib:dev": "pnpm run test:lib --watch",
"build": "pnpm build:rollup && pnpm build:types",
"build:rollup": "rollup --config rollup.config.mjs",
"build:rollup": "rollup --config rollup.config.js",
"build:types": "tsc --emitDeclarationOnly"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// @ts-check

import { defineConfig } from 'rollup'
import { buildConfigs } from '../../scripts/getRollupConfig.mjs'
import { buildConfigs } from '../../scripts/getRollupConfig.js'

export default defineConfig(
buildConfigs({
name: 'query-async-storage-persister',
jsName: 'QueryAsyncStoragePersister',
outputFile: 'index',
entryFile: './src/index.ts',
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"compilerOptions": {
"noEmit": true
},
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs", "rollup.config.mjs"]
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs", "rollup.config.js"]
}
1 change: 0 additions & 1 deletion packages/query-async-storage-persister/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./build/lib",
"rootDir": "./src",
"types": ["vitest/globals"]
},
"include": ["src"]
Expand Down
13 changes: 7 additions & 6 deletions packages/query-broadcast-client-experimental/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"type": "commonjs",
"type": "module",
"types": "build/lib/index.d.ts",
"main": "build/lib/index.js",
"module": "build/lib/index.mjs",
"main": "build/lib/index.cjs",
"module": "build/lib/index.js",
"exports": {
".": {
"types": "./build/lib/index.d.ts",
"import": "./build/lib/index.mjs",
"default": "./build/lib/index.js"
"import": "./build/lib/index.js",
"require": "./build/lib/index.cjs",
"default": "./build/lib/index.cjs"
},
"./package.json": "./package.json"
},
Expand All @@ -32,7 +33,7 @@
"test:eslint": "eslint --ext .ts,.tsx ./src",
"test:types": "tsc --noEmit",
"build": "pnpm build:rollup && pnpm build:types",
"build:rollup": "rollup --config rollup.config.mjs",
"build:rollup": "rollup --config rollup.config.js",
"build:types": "tsc --emitDeclarationOnly"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// @ts-check

import { defineConfig } from 'rollup'
import { buildConfigs } from '../../scripts/getRollupConfig.mjs'
import { buildConfigs } from '../../scripts/getRollupConfig.js'

export default defineConfig(
buildConfigs({
name: 'query-broadcast-client-experimental',
jsName: 'QueryBroadcastClient',
outputFile: 'index',
entryFile: './src/index.ts',
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"compilerOptions": {
"noEmit": true
},
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs", "rollup.config.mjs"]
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs", "rollup.config.js"]
}
3 changes: 1 addition & 2 deletions packages/query-broadcast-client-experimental/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./build/lib",
"rootDir": "./src"
"outDir": "./build/lib"
},
"include": ["src"]
}
13 changes: 7 additions & 6 deletions packages/query-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"type": "commonjs",
"type": "module",
"types": "build/lib/index.d.ts",
"main": "build/lib/index.js",
"module": "build/lib/index.mjs",
"main": "build/lib/index.cjs",
"module": "build/lib/index.js",
"exports": {
".": {
"types": "./build/lib/index.d.ts",
"import": "./build/lib/index.mjs",
"default": "./build/lib/index.js"
"import": "./build/lib/index.js",
"require": "./build/lib/index.cjs",
"default": "./build/lib/index.cjs"
},
"./package.json": "./package.json"
},
Expand All @@ -34,7 +35,7 @@
"test:lib": "vitest run --coverage",
"test:lib:dev": "pnpm run test:lib --watch",
"build": "pnpm build:rollup && pnpm build:types",
"build:rollup": "rollup --config rollup.config.mjs",
"build:rollup": "rollup --config rollup.config.js",
"build:types": "tsc --emitDeclarationOnly"
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// @ts-check

import { defineConfig } from 'rollup'
import { buildConfigs } from '../../scripts/getRollupConfig.mjs'
import { buildConfigs } from '../../scripts/getRollupConfig.js'

export default defineConfig(
buildConfigs({
name: 'query-core',
jsName: 'QueryCore',
outputFile: 'index',
entryFile: './src/index.ts',
}),
Expand Down
2 changes: 1 addition & 1 deletion packages/query-core/tsconfig.eslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"compilerOptions": {
"noEmit": true
},
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs", "rollup.config.mjs"]
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs", "rollup.config.js"]
}
1 change: 0 additions & 1 deletion packages/query-core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./build/lib",
"rootDir": "./src",
"types": ["vitest/globals"]
},
"include": ["src"]
Expand Down
15 changes: 8 additions & 7 deletions packages/query-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"type": "commonjs",
"type": "module",
"types": "build/types/index.d.ts",
"main": "build/cjs/index.js",
"module": "build/esm/index.mjs",
"main": "build/lib/index.cjs",
"module": "build/lib/index.js",
"exports": {
".": {
"types": "./build/types/index.d.ts",
"import": "./build/esm/index.mjs",
"require": "./build/cjs/index.js",
"default": "./build/cjs/index.js"
"solid": "./build/source/index.jsx",
"import": "./build/lib/index.js",
"require": "./build/lib/index.cjs",
"default": "./build/lib/index.cjs"
},
"./package.json": "./package.json"
},
Expand All @@ -30,7 +31,7 @@
"test:lib": "vitest run --coverage",
"test:lib:dev": "pnpm run test:lib --watch",
"build": "pnpm build:rollup && pnpm build:types",
"build:rollup": "rollup --config rollup.config.mjs",
"build:rollup": "rollup --config rollup.config.js",
"build:types": "tsc"
},
"files": [
Expand Down
14 changes: 14 additions & 0 deletions packages/query-devtools/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// @ts-check

import { defineConfig } from 'rollup'
import { buildConfigs } from '../../scripts/getRollupConfig.js'

export default defineConfig(
buildConfigs({
name: 'query-devtools',
outputFile: 'index',
entryFile: './src/index.tsx',
forceBundle: true,
bundleDeps: true,
}),
)
6 changes: 0 additions & 6 deletions packages/query-devtools/rollup.config.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion packages/query-devtools/tsconfig.eslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"compilerOptions": {
"noEmit": true
},
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs", "rollup.config.mjs"]
"include": ["**/*.ts", "**/*.tsx", ".eslintrc.cjs", "rollup.config.js"]
}
1 change: 0 additions & 1 deletion packages/query-devtools/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"jsx": "preserve",
"jsxImportSource": "solid-js",
"outDir": "./build/source",
"rootDir": "./src",
"types": ["vitest/globals"]
},
"include": ["src"]
Expand Down
13 changes: 7 additions & 6 deletions packages/query-persist-client-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"type": "commonjs",
"type": "module",
"types": "build/lib/index.d.ts",
"main": "build/lib/index.js",
"module": "build/lib/index.mjs",
"main": "build/lib/index.cjs",
"module": "build/lib/index.js",
"exports": {
".": {
"types": "./build/lib/index.d.ts",
"import": "./build/lib/index.mjs",
"default": "./build/lib/index.js"
"import": "./build/lib/index.js",
"require": "./build/lib/index.cjs",
"default": "./build/lib/index.cjs"
},
"./package.json": "./package.json"
},
Expand All @@ -34,7 +35,7 @@
"test:lib": "vitest run --coverage",
"test:lib:dev": "pnpm run test:lib --watch",
"build": "pnpm build:rollup && pnpm build:types",
"build:rollup": "rollup --config rollup.config.mjs",
"build:rollup": "rollup --config rollup.config.js",
"build:types": "tsc --emitDeclarationOnly"
},
"dependencies": {
Expand Down
Loading