
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@basketry/react-query
Advanced tools
Basketry generator for generating React Query (TanStack Query) hooks and query/mutation options. This generator can be coupled with any Basketry parser to automatically generate type-safe React Query integration from your API definitions.
Starting with v0.2.0, this generator adopts the React Query v5 queryOptions pattern. The old hook wrappers are deprecated but still available for backwards compatibility.
// Old pattern (deprecated)
import { useGetWidgets } from './hooks/widgets';
const result = useGetWidgets(params);
// New pattern
import { useQuery } from '@tanstack/react-query';
import { getWidgetsQueryOptions } from './hooks/widgets';
const result = useQuery(getWidgetsQueryOptions(params));
// Old pattern (deprecated)
import { useCreateWidget } from './hooks/widgets';
const mutation = useCreateWidget();
// New pattern
import { useMutation } from '@tanstack/react-query';
import { createWidgetMutationOptions } from './hooks/widgets';
const mutation = useMutation(createWidgetMutationOptions());
// Old pattern (deprecated)
import { useGetWidgetsInfinite } from './hooks/widgets';
const result = useGetWidgetsInfinite(params);
// New pattern
import { useInfiniteQuery } from '@tanstack/react-query';
import { getWidgetsInfiniteQueryOptions } from './hooks/widgets';
const result = useInfiniteQuery(getWidgetsInfiniteQueryOptions(params));
The new version includes a type-safe query key builder for cache operations:
import { matchQueryKey } from './hooks/query-key-builder';
// Invalidate all queries for a service
queryClient.invalidateQueries({ queryKey: matchQueryKey('widgets') });
// Invalidate specific operation
queryClient.invalidateQueries({
queryKey: matchQueryKey('widgets', 'getWidgets'),
});
// Invalidate with specific parameters
queryClient.invalidateQueries({
queryKey: matchQueryKey('widgets', 'getWidgets', { status: 'active' }),
});
We provide a jscodeshift codemod to automatically migrate your codebase:
# Using the provided script
./node_modules/@basketry/react-query/codemod/run-migration.sh # Preview (dry run)
./node_modules/@basketry/react-query/codemod/run-migration.sh --apply # Apply changes
# Or using jscodeshift directly
npx jscodeshift -t ./node_modules/@basketry/react-query/codemod/react-query-v0.2-migration.js \
src/ --extensions=ts,tsx --parser=tsx --dry # Preview (dry run)
npx jscodeshift -t ./node_modules/@basketry/react-query/codemod/react-query-v0.2-migration.js \
src/ --extensions=ts,tsx --parser=tsx # Apply changes
See codemod documentation for more details.
npm ci
npm run build
npm start
Note that the lint
script is run prior to build
. Auto-fixable linting or formatting errors may be fixed by running npm run fix
.
.test.ts
suffixnpm t
/coverage/lcov-report/index.html
Generated with generator-ts-console
FAQs
Basketry generator for generating Typescript interfaces
We found that @basketry/react-query demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.