Skip to content

Commit

Permalink
fix: repair published types (#32)
Browse files Browse the repository at this point in the history
* ci: remove cached build and skip NPM release on GPR forced workflow

* fix: repair exported variable is using interface but cannot be named error
  • Loading branch information
lukemorales committed Nov 7, 2022
1 parent 222926e commit f74ec8e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
5 changes: 5 additions & 0 deletions .changeset/two-spies-draw.md
@@ -0,0 +1,5 @@
---
'@lukemorales/query-key-factory': patch
---

Fix published types
22 changes: 4 additions & 18 deletions .github/workflows/release.yml
Expand Up @@ -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:
Expand All @@ -91,6 +82,7 @@ jobs:

release:
name: 🚀 Release to NPM
if: github.event.inputs.forceGPR != 'true'
runs-on: ubuntu-latest
needs: build
outputs:
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
12 changes: 9 additions & 3 deletions 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<T = unknown, TQueryKey extends QueryKey = QueryKey> = (
context: QueryFunctionContext<TQueryKey>,
context?: QueryFunctionContext<TQueryKey>,
) => T | Promise<T>;

export interface QueryFunctionContext<TQueryKey extends QueryKey = QueryKey, TPageParam = any> {
/**
* @internal use QueryFunctionContext from "@tanstack/query-core" instead
*/
export type QueryFunctionContext<TQueryKey extends QueryKey = QueryKey, TPageParam = any> = {
queryKey: TQueryKey;
signal?: AbortSignal;
pageParam?: TPageParam;
meta: QueryMeta | undefined;
}
};

type QueryMeta = Record<string, unknown>;

0 comments on commit f74ec8e

Please sign in to comment.