forked from lukemorales/query-key-factory
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: generate query options and support nested keys
* refactor!: remove deprecated `default` and `toScope` BREAKING CHANGE: `default` key and `toScope` method have been removed from the package * feat!: add support for nested keys BREAKING CHANGE: All intended query key returned values should be an array, returned objects are now used for the nested keys feature * feat: generate query schema * refactor!: make query options format a first class citizen * test: write tests for new implementation * chore: switch to pnpm * build: switch from rollup to tsup * test(`merge-query-keys`): improve tests and assert types * test(`create-query-key-store`): improve tests and assert types * ci: improve release pipeline
- Loading branch information
1 parent
14b3948
commit ba47907
Showing
26 changed files
with
6,064 additions
and
5,006 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@lukemorales/query-key-factory': major | ||
--- | ||
|
||
Generate query options and add support for nested keys | ||
|
||
BREAKING CHANGE: All intended query key returned values should now be an array. Object returns are now used to declare query key, query fn and/or nested keys. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@lukemorales/query-key-factory': major | ||
--- | ||
|
||
Remove deprecated `default` and `toScope` methods | ||
|
||
BREAKING CHANGE: `default` key and `toScope` method have been removed from the package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// ORIGINALLY FROM CLOUDFLARE WRANGLER: | ||
// https://github.com/cloudflare/wrangler2/blob/main/.github/changeset-version.js | ||
|
||
const {exec} = require('child_process'); | ||
const { exec } = require('child_process'); | ||
// This script is used by the `release.yml` workflow to update the version of the packages being released. | ||
// The standard step is only to run `changeset version` but this does not update the package-lock.json file. | ||
// So we also run `npm install`, which does this update. | ||
// The standard step is only to run `changeset version` but this does not update the pnpm-lock.yaml file. | ||
// So we also run `pnpm install`, which does this update. | ||
// This is a workaround until this is handled automatically by `changeset version`. | ||
// See https://github.com/changesets/changesets/issues/421. | ||
exec("yarn changeset version"); | ||
exec("yarn install"); | ||
exec("pnpm run changeset version"); | ||
exec("pnpm install --lockfile-only"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,149 @@ | ||
name: CI | ||
name: ci | ||
|
||
on: | ||
pull_request: | ||
branches: ["*"] | ||
on: [pull_request] | ||
|
||
jobs: | ||
lint-title: | ||
runs-on: ubuntu-latest | ||
name: 🚨 Lint Pull Request title | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
install-deps: | ||
runs-on: ubuntu-latest | ||
name: Install dependencies 🔧 | ||
name: 📦 Install dependencies | ||
steps: | ||
- name: Checkout Repository | ||
- name: 🔑 Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- uses: actions/cache@v3 | ||
id: yarn-cache | ||
- name: 🔧 Install PNPM | ||
uses: pnpm/[email protected] | ||
with: | ||
version: 7 | ||
|
||
- name: ♻️ Cache node_modules | ||
uses: actions/cache@v3 | ||
id: pnpm-cache | ||
with: | ||
path: "**/node_modules" | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Setup Node and install project dependencies | ||
- name: 🛠️ Setup Node and install project dependencies | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '14' | ||
check-latest: true | ||
cache: 'yarn' | ||
cache: 'pnpm' | ||
|
||
if: steps.yarn-cache.outputs.cache-hit != 'true' | ||
- run: yarn install --frozen-lockfile | ||
if: steps.pnpm-cache.outputs.cache-hit != 'true' | ||
- run: pnpm install --prefer-offline | ||
|
||
lint: | ||
lint-package: | ||
runs-on: ubuntu-latest | ||
name: Check for errors 🚨 | ||
name: 🚨 Check for errors | ||
needs: install-deps | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Load node_modules | ||
- name: 🔑 Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: 🔧 Install PNPM | ||
uses: pnpm/[email protected] | ||
with: | ||
version: 7 | ||
|
||
- name: ♻️ Restore node_modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: "**/node_modules" | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
|
||
- name: Restore ESLint Cache | ||
- name: ♻️ Restore ESLint Cache | ||
uses: actions/cache@v3 | ||
id: eslint-cache | ||
with: | ||
path: .eslintcache | ||
key: ${{ matrix.os }}-eslint-${{ hashFiles('**/*.ts', 'package.json', 'tsconfig.json') }} | ||
|
||
- name: 🛠️ Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '14' | ||
check-latest: true | ||
cache: 'pnpm' | ||
|
||
- name: 📦 Install dependencies | ||
if: steps.pnpm-cache.outputs.cache-hit != 'true' | ||
run: pnpm install --prefer-offline | ||
|
||
- name: 🚨 Lint files | ||
run: pnpm run lint | ||
|
||
tests: | ||
name: 🧪 Test package | ||
runs-on: ubuntu-latest | ||
needs: install-deps | ||
steps: | ||
- name: 🔑 Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: 🔧 Install PNPM | ||
uses: pnpm/[email protected] | ||
with: | ||
version: 7 | ||
|
||
- uses: actions/setup-node@v3 | ||
- name: ♻️ Restore node_modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: "**/node_modules" | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
|
||
- name: 🛠️ Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '14' | ||
check-latest: true | ||
cache: 'yarn' | ||
- run: yarn lint | ||
cache: 'pnpm' | ||
|
||
- name: 📦 Install dependencies | ||
if: steps.pnpm-cache.outputs.cache-hit != 'true' | ||
run: pnpm install --prefer-offline | ||
|
||
lint-pr: | ||
- name: 🧪 Run tests | ||
run: pnpm run test:ci | ||
|
||
build: | ||
name: 🏗️ Build package | ||
runs-on: ubuntu-latest | ||
name: Lint the Pull Request Title 🚨 | ||
needs: install-deps | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: 🔑 Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: 🔧 Install PNPM | ||
uses: pnpm/[email protected] | ||
with: | ||
version: 7 | ||
|
||
- name: ♻️ Load node_modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: "**/node_modules" | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
|
||
- name: 🛠️ Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '14' | ||
check-latest: true | ||
cache: 'pnpm' | ||
|
||
- name: 📦 Install dependencies | ||
if: steps.pnpm-cache.outputs.cache-hit != 'true' | ||
run: pnpm install --prefer-offline | ||
|
||
- name: 🏗️ Build package | ||
run: pnpm run build |
Oops, something went wrong.