diff --git a/configs/tsup/src/index.ts b/configs/tsup/src/index.ts index d8613547f..55947760c 100644 --- a/configs/tsup/src/index.ts +++ b/configs/tsup/src/index.ts @@ -11,9 +11,8 @@ export const options: Options = { } export const scriptOptions: Options = { - format: ['cjs'], - target: ['chrome51', 'firefox53', 'edge18', 'safari11', 'ios11', 'opera38', 'es6', 'node14'], - entry: ['src/scripts/*.{ts,tsx}', '!**/*.{spec,test,test-d,bench}.*'], - outDir: 'dist/scripts', - sourcemap: true, + format: 'cjs', + target: ['node18'], + entry: ['src/bin/*.{ts,tsx}', '!**/*.{spec,test,test-d,bench}.*'], + outDir: 'dist/bin', } diff --git a/packages/codemods/CHANGELOG.md b/packages/codemods/CHANGELOG.md new file mode 100644 index 000000000..034778481 --- /dev/null +++ b/packages/codemods/CHANGELOG.md @@ -0,0 +1,7 @@ +# @suspensive/codemods + +## 0.1.1 + +### Patch Changes + +- [#1370](https://github.com/toss/suspensive/pull/1370) [`390e82d`](https://github.com/toss/suspensive/commit/390e82d57c30e05201d92aaad3a2bd16b9f57bfe) Thanks [@gwansikk](https://github.com/gwansikk)! - refactor(tsup): update script options diff --git a/packages/codemods/package.json b/packages/codemods/package.json index a14e8f342..3081e18a7 100644 --- a/packages/codemods/package.json +++ b/packages/codemods/package.json @@ -1,6 +1,6 @@ { "name": "@suspensive/codemods", - "version": "0.1.0", + "version": "0.1.1", "description": "Codemods for @suspensive.", "keywords": [ "suspensive", @@ -42,6 +42,7 @@ "devDependencies": { "@suspensive/eslint-config": "workspace:*", "@suspensive/tsconfig": "workspace:*", + "@suspensive/tsup": "workspace:*", "@types/jscodeshift": "^0.12.0", "@types/prompts": "^2.4.9" }, diff --git a/packages/codemods/src/transforms/tanstack-query-import.ts b/packages/codemods/src/transforms/tanstack-query-import.ts index 4dc216d52..7133bdf7d 100644 --- a/packages/codemods/src/transforms/tanstack-query-import.ts +++ b/packages/codemods/src/transforms/tanstack-query-import.ts @@ -1,5 +1,5 @@ import type { FileInfo } from 'jscodeshift' -import { createParserFromPath } from '../utils/createParserFromPath' +import { createParserFromPath } from './utils/createParserFromPath' const IMPORT_TO_CHANGE = [ 'useSuspenseQuery', diff --git a/packages/codemods/src/utils/createParserFromPath.spec.ts b/packages/codemods/src/transforms/utils/createParserFromPath.spec.ts similarity index 100% rename from packages/codemods/src/utils/createParserFromPath.spec.ts rename to packages/codemods/src/transforms/utils/createParserFromPath.spec.ts diff --git a/packages/codemods/src/utils/createParserFromPath.ts b/packages/codemods/src/transforms/utils/createParserFromPath.ts similarity index 100% rename from packages/codemods/src/utils/createParserFromPath.ts rename to packages/codemods/src/transforms/utils/createParserFromPath.ts diff --git a/packages/codemods/tsup.config.ts b/packages/codemods/tsup.config.ts index a057fdda0..0f5c5dc91 100644 --- a/packages/codemods/tsup.config.ts +++ b/packages/codemods/tsup.config.ts @@ -1,16 +1,13 @@ +import { scriptOptions } from '@suspensive/tsup' import { defineConfig } from 'tsup' export default defineConfig([ { - format: 'cjs', - target: ['node18'], - entry: ['src/bin/*.{ts,tsx}', '!**/*.{spec,test,test-d,bench}.*'], - outDir: 'dist/bin', + ...scriptOptions, external: ['.bin/jscodeshift'], }, { - format: 'cjs', - target: ['node18'], + ...scriptOptions, entry: ['src/transforms/*.{ts,tsx}', '!**/*.{spec,test,test-d,bench}.*'], outDir: 'dist/transforms', }, diff --git a/packages/jotai/CHANGELOG.md b/packages/jotai/CHANGELOG.md index 5c4acf7e0..42d281654 100644 --- a/packages/jotai/CHANGELOG.md +++ b/packages/jotai/CHANGELOG.md @@ -1,5 +1,7 @@ # @suspensive/jotai +## 2.18.7 + ## 2.18.6 ### Patch Changes diff --git a/packages/jotai/package.json b/packages/jotai/package.json index d0c6d880f..5d5001d83 100644 --- a/packages/jotai/package.json +++ b/packages/jotai/package.json @@ -1,6 +1,6 @@ { "name": "@suspensive/jotai", - "version": "2.18.6", + "version": "2.18.7", "description": "Suspensive interfaces for jotai", "keywords": [ "suspensive", diff --git a/packages/react-query-4/CHANGELOG.md b/packages/react-query-4/CHANGELOG.md index 2023bd0ae..935ba746a 100644 --- a/packages/react-query-4/CHANGELOG.md +++ b/packages/react-query-4/CHANGELOG.md @@ -1,5 +1,12 @@ # @suspensive/react-query-4 +## 2.18.7 + +### Patch Changes + +- Updated dependencies []: + - @suspensive/react@2.18.7 + ## 2.18.6 ### Patch Changes diff --git a/packages/react-query-4/package.json b/packages/react-query-4/package.json index 93c2756b5..503407539 100644 --- a/packages/react-query-4/package.json +++ b/packages/react-query-4/package.json @@ -1,6 +1,6 @@ { "name": "@suspensive/react-query-4", - "version": "2.18.6", + "version": "2.18.7", "description": "Suspensive interfaces for @tanstack/react-query@4", "keywords": [ "suspensive", @@ -59,7 +59,7 @@ "react": "catalog:react18" }, "peerDependencies": { - "@suspensive/react": "workspace:^2.18.6", + "@suspensive/react": "workspace:^2.18.7", "@tanstack/react-query": "^4", "react": "^18" }, diff --git a/packages/react-query-5/CHANGELOG.md b/packages/react-query-5/CHANGELOG.md index 5df7d8cc0..a838699ea 100644 --- a/packages/react-query-5/CHANGELOG.md +++ b/packages/react-query-5/CHANGELOG.md @@ -1,5 +1,12 @@ # @suspensive/react-query-5 +## 2.18.7 + +### Patch Changes + +- Updated dependencies []: + - @suspensive/react@2.18.7 + ## 2.18.6 ### Patch Changes diff --git a/packages/react-query-5/package.json b/packages/react-query-5/package.json index 88114a0e0..71242b0b0 100644 --- a/packages/react-query-5/package.json +++ b/packages/react-query-5/package.json @@ -1,6 +1,6 @@ { "name": "@suspensive/react-query-5", - "version": "2.18.6", + "version": "2.18.7", "description": "Suspensive interfaces for @tanstack/react-query@5", "keywords": [ "suspensive", @@ -59,7 +59,7 @@ "react": "catalog:react18" }, "peerDependencies": { - "@suspensive/react": "workspace:^2.18.6", + "@suspensive/react": "workspace:^2.18.7", "@tanstack/react-query": "^5", "react": "^18" }, diff --git a/packages/react-query/CHANGELOG.md b/packages/react-query/CHANGELOG.md index a3965036a..5a7e5d9d2 100644 --- a/packages/react-query/CHANGELOG.md +++ b/packages/react-query/CHANGELOG.md @@ -1,5 +1,16 @@ # @suspensive/react-query +## 2.18.7 + +### Patch Changes + +- [#1370](https://github.com/toss/suspensive/pull/1370) [`390e82d`](https://github.com/toss/suspensive/commit/390e82d57c30e05201d92aaad3a2bd16b9f57bfe) Thanks [@gwansikk](https://github.com/gwansikk)! - refactor(tsup): update script options + +- Updated dependencies []: + - @suspensive/react@2.18.7 + - @suspensive/react-query-4@2.18.7 + - @suspensive/react-query-5@2.18.7 + ## 2.18.6 ### Patch Changes diff --git a/packages/react-query/package.json b/packages/react-query/package.json index 569a0fcc4..34e8e66f7 100644 --- a/packages/react-query/package.json +++ b/packages/react-query/package.json @@ -1,6 +1,6 @@ { "name": "@suspensive/react-query", - "version": "2.18.6", + "version": "2.18.7", "description": "Suspensive interfaces for @tanstack/react-query", "keywords": [ "suspensive", @@ -35,8 +35,8 @@ "module": "dist/index.js", "types": "dist/index.d.ts", "bin": { - "suspensive-react-query": "dist/scripts/cli.cjs", - "srq": "dist/scripts/cli.cjs" + "suspensive-react-query": "dist/bin/cli.cjs", + "srq": "dist/bin/cli.cjs" }, "files": [ "dist", @@ -50,14 +50,14 @@ "ci:test": "vitest run --coverage --typecheck", "ci:type": "tsc --noEmit", "clean": "rimraf ./dist && rimraf ./coverage", - "postinstall": "node -e \"import('./dist/scripts/postinstall.cjs').catch(e => console.error(e))\"", + "postinstall": "node ./dist/bin/postinstall.cjs || echo 'please reinstall @suspensive/react-query'", "prepack": "pnpm build", "test:ui": "vitest --ui --coverage --typecheck" }, "dependencies": { "@commander-js/extra-typings": "^12.1.0", - "@suspensive/react-query-4": "workspace:^2.18.6", - "@suspensive/react-query-5": "workspace:^2.18.6", + "@suspensive/react-query-4": "workspace:^2.18.7", + "@suspensive/react-query-5": "workspace:^2.18.7", "cli-table3": "^0.6.5", "commander": "^12.1.0" }, @@ -66,12 +66,11 @@ "@suspensive/react": "workspace:*", "@suspensive/tsconfig": "workspace:*", "@suspensive/tsup": "workspace:*", - "@tanstack/react-query": "catalog:react-query4", "@types/react": "catalog:react18", "react": "catalog:react18" }, "peerDependencies": { - "@suspensive/react": "workspace:^2.18.6", + "@suspensive/react": "workspace:^2.18.7", "@tanstack/react-query": "^4 || ^5", "react": "^18" }, diff --git a/packages/react-query/src/scripts/cli.spec.ts b/packages/react-query/src/bin/cli.spec.ts similarity index 95% rename from packages/react-query/src/scripts/cli.spec.ts rename to packages/react-query/src/bin/cli.spec.ts index 254704e6b..50a1dc5e6 100644 --- a/packages/react-query/src/scripts/cli.spec.ts +++ b/packages/react-query/src/bin/cli.spec.ts @@ -4,7 +4,7 @@ import packageJson from '../../package.json' import { getTanStackReactQueryPackageJson } from './utils/package' import { getStatusTable } from './utils/table' -const cliPath = path.resolve(__dirname, '../../dist/scripts/cli.cjs') +const cliPath = path.resolve(__dirname, '../../dist/bin/cli.cjs') describe('cli', () => { it('should display the correct version when using the -v flag', () => { diff --git a/packages/react-query/src/scripts/cli.ts b/packages/react-query/src/bin/cli.ts similarity index 88% rename from packages/react-query/src/scripts/cli.ts rename to packages/react-query/src/bin/cli.ts index ce702a5e7..7768bae2a 100755 --- a/packages/react-query/src/scripts/cli.ts +++ b/packages/react-query/src/bin/cli.ts @@ -1,22 +1,20 @@ #!/usr/bin/env node -'use strict' import { Command } from '@commander-js/extra-typings' import { fixAction, statusAction, switchAction } from './utils/commands' import { getPackageJson } from './utils/package' const packageJson = getPackageJson() -const program = new Command() +const program = new Command(packageJson.name) program - .name(packageJson.name) .description(packageJson.description) .version(packageJson.version, '-v, --version', 'Displays the currently installed version of @suspensive/react-query') program .command('status') .description('Checks compatibility with the currently used version of @tanstack/react-query') - .action(() => statusAction()) + .action(statusAction) program .command('switch') @@ -34,6 +32,6 @@ program .description( "Automatically switch @suspensive/react-query's exports to use compatible Suspensive interfaces for @tanstack/react-query" ) - .action(() => fixAction()) + .action(fixAction) -program.parse() +program.parse(process.argv) diff --git a/packages/react-query/src/scripts/postinstall.ts b/packages/react-query/src/bin/postinstall.ts similarity index 100% rename from packages/react-query/src/scripts/postinstall.ts rename to packages/react-query/src/bin/postinstall.ts diff --git a/packages/react-query/src/scripts/utils/commands.spec.ts b/packages/react-query/src/bin/utils/commands.spec.ts similarity index 100% rename from packages/react-query/src/scripts/utils/commands.spec.ts rename to packages/react-query/src/bin/utils/commands.spec.ts diff --git a/packages/react-query/src/scripts/utils/commands.ts b/packages/react-query/src/bin/utils/commands.ts similarity index 100% rename from packages/react-query/src/scripts/utils/commands.ts rename to packages/react-query/src/bin/utils/commands.ts diff --git a/packages/react-query/src/scripts/utils/copy.spec.ts b/packages/react-query/src/bin/utils/copy.spec.ts similarity index 100% rename from packages/react-query/src/scripts/utils/copy.spec.ts rename to packages/react-query/src/bin/utils/copy.spec.ts diff --git a/packages/react-query/src/scripts/utils/copy.ts b/packages/react-query/src/bin/utils/copy.ts similarity index 100% rename from packages/react-query/src/scripts/utils/copy.ts rename to packages/react-query/src/bin/utils/copy.ts diff --git a/packages/react-query/src/scripts/utils/package.spec.ts b/packages/react-query/src/bin/utils/package.spec.ts similarity index 100% rename from packages/react-query/src/scripts/utils/package.spec.ts rename to packages/react-query/src/bin/utils/package.spec.ts diff --git a/packages/react-query/src/scripts/utils/package.ts b/packages/react-query/src/bin/utils/package.ts similarity index 100% rename from packages/react-query/src/scripts/utils/package.ts rename to packages/react-query/src/bin/utils/package.ts diff --git a/packages/react-query/src/scripts/utils/switchVersion.spec.ts b/packages/react-query/src/bin/utils/switchVersion.spec.ts similarity index 100% rename from packages/react-query/src/scripts/utils/switchVersion.spec.ts rename to packages/react-query/src/bin/utils/switchVersion.spec.ts diff --git a/packages/react-query/src/scripts/utils/switchVersion.ts b/packages/react-query/src/bin/utils/switchVersion.ts similarity index 100% rename from packages/react-query/src/scripts/utils/switchVersion.ts rename to packages/react-query/src/bin/utils/switchVersion.ts diff --git a/packages/react-query/src/scripts/utils/table.ts b/packages/react-query/src/bin/utils/table.ts similarity index 100% rename from packages/react-query/src/scripts/utils/table.ts rename to packages/react-query/src/bin/utils/table.ts diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 138670813..b7bb79522 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,7 @@ # @suspensive/react +## 2.18.7 + ## 2.18.6 ### Patch Changes diff --git a/packages/react/package.json b/packages/react/package.json index 6fed01b25..6cf9ccf0e 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@suspensive/react", - "version": "2.18.6", + "version": "2.18.7", "description": "Suspensive interface for react", "keywords": [ "suspensive", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ba5f513fd..4d2a4d4b2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -595,6 +595,9 @@ importers: '@suspensive/tsconfig': specifier: workspace:* version: link:../../configs/tsconfig + '@suspensive/tsup': + specifier: workspace:* + version: link:../../configs/tsup '@types/jscodeshift': specifier: ^0.12.0 version: 0.12.0 @@ -710,11 +713,14 @@ importers: specifier: ^12.1.0 version: 12.1.0(commander@12.1.0) '@suspensive/react-query-4': - specifier: workspace:^2.18.6 + specifier: workspace:^2.18.7 version: link:../react-query-4 '@suspensive/react-query-5': - specifier: workspace:^2.18.6 + specifier: workspace:^2.18.7 version: link:../react-query-5 + '@tanstack/react-query': + specifier: ^4 || ^5 + version: 4.36.1(react-dom@18.3.1(react@18.3.1))(react-native@0.76.1(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@types/react@18.3.12)(react@18.3.1))(react@18.3.1) cli-table3: specifier: ^0.6.5 version: 0.6.5 @@ -734,9 +740,6 @@ importers: '@suspensive/tsup': specifier: workspace:* version: link:../../configs/tsup - '@tanstack/react-query': - specifier: catalog:react-query4 - version: 4.36.1(react-dom@18.3.1(react@18.3.1))(react-native@0.76.1(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@types/react@18.3.12)(react@18.3.1))(react@18.3.1) '@types/react': specifier: catalog:react18 version: 18.3.12