From f74ec8ed8306650fb6d9296d5982605cfce7534c Mon Sep 17 00:00:00 2001 From: Luke Morales Date: Mon, 7 Nov 2022 20:53:22 -0300 Subject: [PATCH] fix: repair published types (#32) * ci: remove cached build and skip NPM release on GPR forced workflow * fix: repair exported variable is using interface but cannot be named error --- .changeset/two-spies-draw.md | 5 +++++ .github/workflows/release.yml | 22 ++++------------------ src/query-context.types.ts | 12 +++++++++--- 3 files changed, 18 insertions(+), 21 deletions(-) create mode 100644 .changeset/two-spies-draw.md diff --git a/.changeset/two-spies-draw.md b/.changeset/two-spies-draw.md new file mode 100644 index 0000000..1ab0570 --- /dev/null +++ b/.changeset/two-spies-draw.md @@ -0,0 +1,5 @@ +--- +'@lukemorales/query-key-factory': patch +--- + +Fix published types diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4019729..4dd5c4f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,15 +60,6 @@ jobs: with: version: 7 - - name: ♻️ Cache build files - uses: actions/cache@v3 - id: build-cache - with: - path: "**/dist" - key: ${{ runner.os }}-build-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-build- - - name: 🛠️ Setup Node uses: actions/setup-node@v3 with: @@ -91,6 +82,7 @@ jobs: release: name: 🚀 Release to NPM + if: github.event.inputs.forceGPR != 'true' runs-on: ubuntu-latest needs: build outputs: @@ -126,9 +118,6 @@ jobs: cache: 'pnpm' registry-url: 'https://registry.npmjs.org' - # - name: 🗃️ Create .npmrc - # run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc - - name: 👤 Set git user run: | git config --global user.email "lukemorales@live.com" @@ -171,12 +160,6 @@ jobs: path: "**/node_modules" key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }} - - name: ♻️ Load build files - uses: actions/cache@v3 - with: - path: "**/dist" - key: ${{ runner.os }}-build-${{ hashFiles('**/pnpm-lock.yaml') }} - - name: 🛠️ Setup Node for GPR uses: actions/setup-node@v3 with: @@ -189,6 +172,9 @@ jobs: if: steps.pnpm-cache.outputs.cache-hit != 'true' run: pnpm install --prefer-offline + - name: ⚒️ Build package + run: pnpm run build + - name: 🚀 Publish to GPR run: pnpm publish env: diff --git a/src/query-context.types.ts b/src/query-context.types.ts index b6b20af..e643cb9 100644 --- a/src/query-context.types.ts +++ b/src/query-context.types.ts @@ -1,14 +1,20 @@ export type QueryKey = readonly unknown[]; +/** + * @internal use QueryFunction from "@tanstack/query-core" instead + */ export type QueryFunction = ( - context: QueryFunctionContext, + context?: QueryFunctionContext, ) => T | Promise; -export interface QueryFunctionContext { +/** + * @internal use QueryFunctionContext from "@tanstack/query-core" instead + */ +export type QueryFunctionContext = { queryKey: TQueryKey; signal?: AbortSignal; pageParam?: TPageParam; meta: QueryMeta | undefined; -} +}; type QueryMeta = Record;