Skip to content

Commit

Permalink
chore(angular-query): remove dead code found by Knip
Browse files Browse the repository at this point in the history
  • Loading branch information
arnoud-dv committed Nov 30, 2023
1 parent 9c2c79d commit ea2c637
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 104 deletions.
3 changes: 0 additions & 3 deletions integrations/angular-cli-standalone-17/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@
"dependencies": {
"@angular/animations": "^17.0.2",
"@angular/common": "^17.0.2",
"@angular/compiler": "^17.0.2",
"@angular/core": "^17.0.2",
"@angular/forms": "^17.0.2",
"@angular/platform-browser": "^17.0.2",
"@angular/platform-browser-dynamic": "^17.0.2",
"@tanstack/angular-query-experimental": "workspace:../../packages/angular-query-experimental/build",
"@tanstack/angular-query-devtools-experimental": "workspace:../../packages/angular-query-devtools-experimental/build",
"rxjs": "^7.8.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import { injectQuery } from '@tanstack/angular-query-experimental'
imports: [AngularQueryDevtoolsComponent, CommonModule],
})
export class AppComponent {
/**
* @public
*/
query = injectQuery(() => ({
queryKey: ['test'],
queryFn: async () => {
Expand Down
5 changes: 4 additions & 1 deletion knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ export default {
ignore: ['**/__mocks__/**'],
ignoreDependencies: ['vue2', 'vue2.7'],
},
'integrations/angular-cli-standalone-17': {
entry: ['src/main.ts'],
},
},
compilers: {
svelte: (text: string) => [...svelteCompiler(text)].join('\n'),
vue: (text) => {
vue: (text: string) => {
const scripts = []
let match
while ((match = vueCompiler.exec(text))) scripts.push(match[1])
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"@vitest/coverage-istanbul": "^0.33.0",
"@vitest/runner": "^0.34.6",
"@vitest/snapshot": "^0.34.6",
"axios": "^1.5.1",
"chalk": "^5.3.0",
"cpy-cli": "^5.0.0",
Expand Down
6 changes: 0 additions & 6 deletions packages/angular-query-devtools-experimental/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,10 @@
"tslib": "^2.6.2"
},
"devDependencies": {
"@angular/cli": "^17.0.0",
"@angular/common": "^17.0.2",
"@angular/compiler": "^17.0.2",
"@angular/compiler-cli": "^17.0.2",
"@angular/core": "^17.0.2",
"@angular/platform-browser": "^17.0.2",
"@angular/platform-browser-dynamic": "^17.0.2",
"@tanstack/angular-query-experimental": "workspace:../angular-query-experimental/build",
"ng-packagr": "^17.0.0",
"reflect-metadata": "^0.1.13",
"typescript": "5.2.2",
"zone.js": "^0.14.2"
},
Expand Down
3 changes: 0 additions & 3 deletions packages/angular-query-experimental/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,13 @@
},
"devDependencies": {
"@analogjs/vite-plugin-angular": "^0.2.18",
"@angular/animations": "^17.0.2",
"@angular/cli": "^17.0.0",
"@angular/common": "^17.0.2",
"@angular/compiler": "^17.0.2",
"@angular/compiler-cli": "^17.0.2",
"@angular/core": "^17.0.2",
"@angular/platform-browser": "^17.0.2",
"@angular/platform-browser-dynamic": "^17.0.2",
"ng-packagr": "^17.0.0",
"reflect-metadata": "^0.1.13",
"typescript": "5.2.2",
"zone.js": "^0.14.2"
},
Expand Down
32 changes: 0 additions & 32 deletions packages/angular-query-experimental/src/tests/test-utils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
export function flushPromises(timeout = 0): Promise<unknown> {
return new Promise(function (resolve) {
setTimeout(resolve, timeout)
})
}

export function simpleFetcher(): Promise<string> {
return new Promise((resolve) => {
setTimeout(() => {
Expand All @@ -26,18 +20,6 @@ export function getSimpleFetcherWithReturnData(returnData: unknown) {
new Promise((resolve) => setTimeout(() => resolve(returnData), 0))
}

export function infiniteFetcher({
pageParam,
}: {
pageParam?: number
}): Promise<string> {
return new Promise((resolve) => {
setTimeout(() => {
return resolve('data on page ' + pageParam)
}, 0)
})
}

export function rejectFetcher(): Promise<Error> {
return new Promise((_, reject) => {
setTimeout(() => {
Expand All @@ -53,17 +35,3 @@ export function successMutator<T>(param: T): Promise<T> {
}, 0)
})
}

export function errorMutator<T>(_: T): Promise<Error> {
return rejectFetcher()
}

export type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends <
T,
>() => T extends Y ? 1 : 2
? true
: false

export type Expect<T extends true> = T

export const doNotExecute = (_func: () => void) => true
57 changes: 0 additions & 57 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ea2c637

Please sign in to comment.