Skip to content

Commit

Permalink
fix up knip reports (#420)
Browse files Browse the repository at this point in the history
* fix up knip reports

* fixup

* more changes

* fixup

* update lockfiles

* change import to pure
  • Loading branch information
phryneas authored Jan 23, 2025
1 parent a040bec commit 723c704
Show file tree
Hide file tree
Showing 13 changed files with 167 additions and 1,526 deletions.
12 changes: 6 additions & 6 deletions integration-test/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,27 @@ __metadata:
linkType: hard

"@apollo/client-integration-react-router@exec:./shared/build-client-integration-react-router.cjs::locator=%40integration-test%2Froot%40workspace%3A.":
version: 0.11.5
version: 0.11.8
resolution: "@apollo/client-integration-react-router@exec:./shared/build-client-integration-react-router.cjs#./shared/build-client-integration-react-router.cjs::hash=d34732&locator=%40integration-test%2Froot%40workspace%3A."
dependencies:
"@apollo/client-react-streaming": "npm:0.11.8-alpha.1"
promiscade: "npm:^0.0.2"
peerDependencies:
react: ^19
react-router: ^7.0.2
checksum: 10/e8d6af811d70f120e61f9c6ad3c518a892f75bbb3a84a83ba180c1ca65774660bc01313c053474ae605b0140744ce01f65cd469601180b996702027ddbe8d3c6
checksum: 10/33a961cd848ede8bc31907346134b7f0bfab48522271fa1be4e6deac5d624cf1d0d3c63a9def90c89b2a2894ae683195ca470f77d6fb2fdd7893823ff0c507a6
languageName: node
linkType: hard

"@apollo/client-integration-tanstack-start@exec:./shared/build-client-integration-tanstack-start.cjs::locator=%40integration-test%2Froot%40workspace%3A.":
version: 0.11.5
version: 0.11.8
resolution: "@apollo/client-integration-tanstack-start@exec:./shared/build-client-integration-tanstack-start.cjs#./shared/build-client-integration-tanstack-start.cjs::hash=66d731&locator=%40integration-test%2Froot%40workspace%3A."
dependencies:
"@apollo/client-react-streaming": "npm:0.11.5"
peerDependencies:
"@tanstack/react-router": "*"
react: ^19
checksum: 10/925e6f086df1f3d7a3fd0e60265dce1192a7666934b2ee35f545ffdb00f04463d0734649e9320094b195aaa8b327bd8520a38dd7436051413e97564183f83fda
checksum: 10/8fbcea3c6b0bb00a2036c84159428822538e939ad23ae227d35c92b5df4a8704494bec7b8c7d70c3c67d8f83878e645f8444bdc64a21a899558f904b83194daa
languageName: node
linkType: hard

Expand All @@ -73,7 +73,7 @@ __metadata:
graphql: ^16 || >=17.0.0-alpha.2
react: ^18 || >=19.0.0-rc
react-dom: ^18 || >=19.0.0-rc
checksum: 10/04dbf100bd75132b9ca2b9a00e35e31d89fb9b197339120b5469503a2e4908ec707e145e92cfcb44306b4b9db69c09fe4e10463b228530c7b3a9ac3b7b4500a2
checksum: 10/7eae1b9df8c5e4e37096f37f488d0779f47650b724b4cbedc534dd0c00c3f0ea99c1452cde911e20137e64c6b28c22a9bd760d9d9fb92fe26ade8e253dd607eb
languageName: node
linkType: hard

Expand Down Expand Up @@ -123,7 +123,7 @@ __metadata:
"@apollo/client": ^3.10.4
next: ^13.4.1 || ^14.0.0 || ^15.0.0-rc.0
react: ^18 || >=19.0.0-rc
checksum: 10/a866cc1c43ff0358e7c4a7be793c1c73eb0f0078022cd86475fe375902378e1adfcf4ff7d672a6e365daaba812a0e7ca253af2315275146ddf283825ec1cb75e
checksum: 10/831e5f8f8cb0b86c4fb10bcba1c54966f60e2ff9d72bc3e6f52d0816cc0d71c495f8c2e7a3a8d1d0ab524809f2852a883a36c50de432c718a7c00ad69d160a32
languageName: node
linkType: hard

Expand Down
6 changes: 5 additions & 1 deletion knip.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ const config = {
workspaces: {
".": {
ignoreBinaries: ["jq", "playwright"],
ignoreDependencies: [/@size-limit\/.*/, "prettier"],
ignoreDependencies: [/@size-limit\/.*/, "prettier", "zx"],
},
"packages/*": {
entry: ["**/*.test.{ts,tsx}"],
project: ["**/*.{ts,tsx}"],
},
"packages/test-utils": {
entry: ["*.js"],
},
"packages/client-react-streaming": {
entry: ["**/*.test.{ts,tsx}"],
project: ["**/*.{ts,tsx}"],
Expand All @@ -24,6 +27,7 @@ const config = {
"scripts/**",
"packages/client-react-streaming/api-extractor.d.ts",
"packages/experimental-nextjs-app-support/api-extractor.d.ts",
"**/.yalc/**",
],
};

Expand Down
1 change: 0 additions & 1 deletion packages/client-react-streaming/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@
"@testing-library/react": "^16.1.0",
"@total-typescript/shoehorn": "0.1.2",
"@tsconfig/recommended": "1.0.6",
"@types/eslint": "^9.6.1",
"@types/node": "20.12.11",
"@types/react": "^19.0.0",
"concurrently": "8.2.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ export class ApolloClientBrowserImpl extends ApolloClientClientBaseImpl {
}
}

export class ApolloClientRSCImpl extends ApolloClientBase {
class ApolloClientRSCImpl extends ApolloClientBase {
constructor(options: WrappedApolloClientOptions) {
super(options);
this.setLink(this.link);
Expand Down
6 changes: 3 additions & 3 deletions packages/client-react-streaming/src/transportedQueryRef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
type JsonString,
} from "@apollo/client-react-streaming/stream-utils";

export type RestrictedPreloadOptions = {
type RestrictedPreloadOptions = {
fetchPolicy?: "network-only" | "cache-and-network" | "cache-first";
returnPartialData?: false;
nextFetchPolicy?: undefined;
Expand All @@ -45,7 +45,7 @@ export type PreloadTransportedQueryOptions<TVariables, TData> = Omit<
> &
RestrictedPreloadOptions;

export type TransportedQueryRefOptions = TransportedOptions &
type TransportedQueryRefOptions = TransportedOptions &
RestrictedPreloadOptions;

/**
Expand Down Expand Up @@ -141,7 +141,7 @@ export function createTransportedQueryPreloader(
};
}

export function createTransportedQueryRef<
function createTransportedQueryRef<
TData,
TVariables extends OperationVariables,
>(
Expand Down
3 changes: 1 addition & 2 deletions packages/experimental-nextjs-app-support/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@
"@internal/test-utils": "workspace:^",
"@microsoft/api-extractor": "7.43.2",
"@tsconfig/recommended": "1.0.6",
"@types/eslint": "^9.6.1",
"@types/node": "20.12.11",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
Expand All @@ -137,7 +136,7 @@
"rimraf": "5.0.5",
"tsup": "8.0.2",
"typescript": "^5.7.3",
"wait-on": "^8.0.1"
"wait-on": "8.0.2"
},
"peerDependencies": {
"@apollo/client": "^3.10.4",
Expand Down
1 change: 1 addition & 0 deletions packages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.0",
"private": true,
"devDependencies": {
"@types/eslint": "9.6.1",
"@typescript-eslint/eslint-plugin": "7.5.0",
"@typescript-eslint/parser": "7.5.0",
"eslint": "8.57.0",
Expand Down
15 changes: 3 additions & 12 deletions packages/react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"test:browser": "NODE_OPTIONS=\"${NODE_OPTIONS:-} --conditions=browser\" yarn run test:base",
"test:rsc": "NODE_OPTIONS=\"${NODE_OPTIONS:-} --conditions=react-server\" yarn run test:base",
"prepack": "yarn build",
"prepublishOnly": "wait-on ../client-react-streaming/.published --delay 3000 --timeout 30000 && yarn pack -o attw.tgz && attw attw.tgz && rm attw.tgz && yarn run test",
"prepublishOnly": "wait-on ../client-react-streaming/.built --delay 3000 --timeout 60000 && yarn pack -o attw.tgz && attw attw.tgz && rm attw.tgz && yarn run test",
"test-bundle": "yarn test-bundle:attw && yarn test-bundle:package && yarn test-bundle:publint && yarn test-bundle:shape",
"test-bundle:attw": "attw --pack .",
"test-bundle:package": "yarn workspace monorepo verify-package-json $PWD/package.json",
Expand All @@ -67,30 +67,21 @@
"@apollo/client": "^3.12.6",
"@apollo/client-react-streaming": "workspace:*",
"@arethetypeswrong/cli": "0.15.3",
"@internal/test-utils": "workspace:^",
"@microsoft/api-extractor": "7.43.2",
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "^16.1.0",
"@total-typescript/shoehorn": "0.1.2",
"@tsconfig/recommended": "1.0.6",
"@types/node": "20.12.11",
"@types/react": "^19.0.0",
"concurrently": "8.2.2",
"esbuild": "0.24.2",
"eslint": "8.57.0",
"glob": "10.3.12",
"global-jsdom": "24.0.0",
"globstar": "1.0.0",
"graphql": "16.8.1",
"jsdom": "24.0.0",
"publint": "0.2.7",
"react": "^19.0.0",
"react-router": "patch:react-router@npm%3A7.0.2#~/.yarn/patches/react-router-npm-7.0.2-b96f2bd13c.patch",
"rimraf": "5.0.5",
"ts-node": "10.9.2",
"tsup": "8.0.2",
"tsx": "4.7.1",
"typescript": "5.4.5",
"vitest": "1.6.0"
"wait-on": "8.0.2"
},
"peerDependencies": {
"react": "^19",
Expand Down
8 changes: 4 additions & 4 deletions packages/react-router/src/preloader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function createApolloLoaderHandler(
// once that functionality has been added, all this can be removed.

type EventPromiscade = Promiscade<JsonString<ReadableStreamLinkEvent>>;
export type PromiscadedRef = Omit<TransportedQueryRef, "$__apollo_queryRef"> & {
type PromiscadedRef = Omit<TransportedQueryRef, "$__apollo_queryRef"> & {
$__apollo_queryRef: Omit<
TransportedQueryRef["$__apollo_queryRef"],
"stream"
Expand All @@ -69,7 +69,7 @@ export type PromiscadedRef = Omit<TransportedQueryRef, "$__apollo_queryRef"> & {
};
};

export function isPromiscaded(
function isPromiscaded(
queryRef: TransportedQueryRef | PromiscadedRef
): queryRef is PromiscadedRef {
return "promiscade" in queryRef.$__apollo_queryRef;
Expand All @@ -96,7 +96,7 @@ function replaceStreamWithPromiscade(queryRef: TransportedQueryRef) {
* could result in poor timing and have the modified object be sent over the wire instead
* of the one with the promiscade
*/
export function promiscadedRefToStreamRef(
function promiscadedRefToStreamRef(
queryRef: PromiscadedRef
): TransportedQueryRef {
const { promiscade: _, ...restRef } = queryRef.$__apollo_queryRef;
Expand All @@ -111,7 +111,7 @@ export function promiscadedRefToStreamRef(
};
}

export const hydratedRefs = new WeakMap<PromiscadedRef, TransportedQueryRef>();
const hydratedRefs = new WeakMap<PromiscadedRef, TransportedQueryRef>();
/**
* If `obj` is a Promiscaded Ref, creates a new "live" QueryRef
* If `obj` is a Transported Ref, converts it to a "live" QueryRef
Expand Down
15 changes: 4 additions & 11 deletions packages/tanstack-start/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"test:ssr": "NODE_OPTIONS=\"${NODE_OPTIONS:-} --conditions=node\" yarn run test:base",
"test:browser": "NODE_OPTIONS=\"${NODE_OPTIONS:-} --conditions=browser\" yarn run test:base",
"prepack": "yarn build",
"prepublishOnly": "wait-on ../client-react-streaming/.published --delay 3000 --timeout 30000 && yarn pack -o attw.tgz && attw attw.tgz && rm attw.tgz && yarn run test",
"prepublishOnly": "wait-on ../client-react-streaming/.built --delay 3000 --timeout 60000 && yarn pack -o attw.tgz && attw attw.tgz && rm attw.tgz && yarn run test",
"test-bundle": "yarn test-bundle:attw && yarn test-bundle:package && yarn test-bundle:publint && yarn test-bundle:shape",
"test-bundle:attw": "attw --pack .",
"test-bundle:package": "yarn workspace monorepo verify-package-json $PWD/package.json",
Expand All @@ -71,27 +71,20 @@
"@microsoft/api-extractor": "7.43.2",
"@tanstack/react-router": "patch:@tanstack/react-router@npm%3A1.97.3#~/.yarn/patches/@tanstack-react-router-npm-1.97.3-ad16343f36.patch",
"@tanstack/start": "patch:@tanstack/start@npm%3A1.97.3#~/.yarn/patches/@tanstack-start-npm-1.97.3-da273c2822.patch",
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "^16.1.0",
"@total-typescript/shoehorn": "0.1.2",
"@tsconfig/recommended": "1.0.6",
"@types/node": "20.12.11",
"@types/react": "^19.0.0",
"concurrently": "8.2.2",
"esbuild": "0.24.2",
"eslint": "8.57.0",
"glob": "10.3.12",
"global-jsdom": "24.0.0",
"globstar": "1.0.0",
"graphql": "16.8.1",
"jsdom": "24.0.0",
"publint": "0.2.7",
"react": "^19.0.0",
"react-error-boundary": "5.0.0",
"rimraf": "5.0.5",
"ts-node": "10.9.2",
"tsup": "8.0.2",
"tsx": "4.7.1",
"typescript": "5.4.5",
"vitest": "1.6.0"
"wait-on": "8.0.2"
},
"peerDependencies": {
"@tanstack/react-router": "*",
Expand Down
6 changes: 4 additions & 2 deletions packages/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
"name": "@internal/test-utils",
"private": true,
"version": "0.0.0",
"devDependencies": {
"dependencies": {
"@testing-library/react-render-stream": "^2.0.0",
"expect": "^29.7.0",
"global-jsdom": "^26.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"typescript": "^5.7.3"
},
"type": "module"
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export async function renderStreamEnv() {
const jsdom = await import("global-jsdom");
const cleanupJSDOM = jsdom.default();
const { createRenderStream } = await import(
"@testing-library/react-render-stream"
"@testing-library/react-render-stream/pure"
);

return {
Expand Down
Loading

0 comments on commit 723c704

Please sign in to comment.