Skip to content

Commit

Permalink
Merge branch 'next' into corel
Browse files Browse the repository at this point in the history
* next:
  chore(deps): update dependency sanity-diff-patch to v4 (#7630)
  feat: validate PR title against conventional commits (#7580)
  chore(deps): update dependency @sanity/tsdoc to v1.0.113 (#7627)
  fix(deps): update dependency @sanity/client to ^6.22.2 (#7625)
  chore(deps): update typescript-tooling (#7605)
  fix: restore support for defaultOrdering. (#7626)
  • Loading branch information
bjoerge committed Oct 23, 2024
2 parents ed74a74 + 01d0313 commit 760900e
Show file tree
Hide file tree
Showing 17 changed files with 1,368 additions and 1,287 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/validate-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Validate PR title"

on:
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion dev/embedded-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"typescript": "5.6.2",
"typescript": "5.6.3",
"vite": "^4.5.3"
}
}
2 changes: 1 addition & 1 deletion dev/test-next-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"sanity": "workspace:*",
"sanity-test-studio": "workspace:*",
"styled-components": "^6.1.12",
"typescript": "5.6.2"
"typescript": "5.6.3"
}
}
2 changes: 1 addition & 1 deletion dev/test-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@sanity/migrate": "workspace:*",
"@sanity/preview-url-secret": "^1.6.1",
"@sanity/react-loader": "^1.8.3",
"@sanity/tsdoc": "1.0.105",
"@sanity/tsdoc": "1.0.113",
"@sanity/types": "workspace:*",
"@sanity/ui": "^2.8.9",
"@sanity/ui-workshop": "^1.0.0",
Expand Down
11 changes: 11 additions & 0 deletions dev/test-studio/structure/resolveStructure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,17 @@ export const structure: StructureResolver = (S, {schema, documentStore, i18n}) =

S.divider(),

S.listItem()
.title('Default ordering test')
.id('default-ordering')
.child(() =>
S.documentTypeList('species')
.defaultOrdering([{field: 'species', direction: 'asc'}])
.title('Species')
.id('default-ordering-list')
.filter('_type == $type'),
),

...S.documentTypeListItems()
.filter((listItem) => {
const id = listItem.getId()
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@
"@sanity/eslint-config-i18n": "1.0.0",
"@sanity/eslint-config-studio": "^4.0.0",
"@sanity/mutate": "^0.10.0",
"@sanity/pkg-utils": "6.11.2",
"@sanity/pkg-utils": "6.11.4",
"@sanity/prettier-config": "^1.0.2",
"@sanity/test": "0.0.1-alpha.1",
"@sanity/tsdoc": "1.0.105",
"@sanity/tsdoc": "1.0.113",
"@sanity/ui": "file:registry/sanity-ui-2.8.9.tgz",
"@sanity/uuid": "^3.0.2",
"@types/glob": "^7.2.0",
Expand Down Expand Up @@ -166,7 +166,7 @@
"sanity": "workspace:*",
"semver": "^7.3.5",
"turbo": "^2.1.3",
"typescript": "5.6.2",
"typescript": "5.6.3",
"vite": "^4.5.3",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^2.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
},
"dependencies": {
"@babel/traverse": "^7.23.5",
"@sanity/client": "^6.22.1",
"@sanity/client": "^6.22.2",
"@sanity/codegen": "3.61.0",
"@sanity/telemetry": "^0.7.7",
"@sanity/util": "3.61.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/migrate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"watch": "pkg-utils watch"
},
"dependencies": {
"@sanity/client": "^6.22.1",
"@sanity/client": "^6.22.2",
"@sanity/mutate": "^0.10.0",
"@sanity/types": "3.61.0",
"@sanity/util": "3.61.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"watch": "pkg-utils watch"
},
"dependencies": {
"@sanity/client": "^6.22.1",
"@sanity/client": "^6.22.2",
"@types/react": "^18.3.5"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"watch": "pkg-utils watch"
},
"dependencies": {
"@sanity/client": "^6.22.1",
"@sanity/client": "^6.22.2",
"@sanity/types": "3.61.0",
"get-random-values-esm": "1.0.2",
"moment": "^2.30.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/vision/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"@repo/package.config": "workspace:*",
"@sanity/block-tools": "workspace:*",
"@sanity/cli": "workspace:*",
"@sanity/client": "^6.22.1",
"@sanity/client": "^6.22.2",
"@sanity/codegen": "workspace:*",
"@sanity/diff": "workspace:*",
"@sanity/migrate": "workspace:*",
Expand Down
8 changes: 4 additions & 4 deletions packages/sanity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
"@sanity/bifur-client": "^0.4.1",
"@sanity/block-tools": "3.61.0",
"@sanity/cli": "3.61.0",
"@sanity/client": "^6.22.1",
"@sanity/client": "^6.22.2",
"@sanity/color": "^3.0.0",
"@sanity/diff": "3.61.0",
"@sanity/diff-match-patch": "^3.1.1",
Expand Down Expand Up @@ -253,7 +253,7 @@
"rxjs": "^7.8.0",
"rxjs-exhaustmap-with-trailing": "^2.1.1",
"rxjs-mergemap-array": "^0.1.0",
"sanity-diff-patch": "^3.0.2",
"sanity-diff-patch": "^4.0.0",
"scroll-into-view-if-needed": "^3.0.3",
"semver": "^7.3.5",
"shallow-equals": "^1.0.0",
Expand All @@ -276,8 +276,8 @@
"@repo/test-config": "workspace:*",
"@sanity/codegen": "3.61.0",
"@sanity/generate-help-url": "^3.0.0",
"@sanity/pkg-utils": "6.11.2",
"@sanity/tsdoc": "1.0.105",
"@sanity/pkg-utils": "6.11.4",
"@sanity/tsdoc": "1.0.113",
"@sanity/ui-workshop": "^1.2.11",
"@sentry/types": "^8.12.0",
"@testing-library/jest-dom": "^6.4.8",
Expand Down
14 changes: 8 additions & 6 deletions packages/sanity/src/core/store/key-value/localStorageSWR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ import {type KeyValueStore, type KeyValueStoreValue} from './types'
*/
export function withLocalStorageSWR(wrappedStore: KeyValueStore): KeyValueStore {
function getKey(key: string) {
return merge(of(localStoreStorage.getKey(key)), wrappedStore.getKey(key)).pipe(
distinctUntilChanged(isEqual),
tap((value) => {
localStoreStorage.setKey(key, value)
}),
)
return merge(
of(localStoreStorage.getKey(key)),
wrappedStore.getKey(key).pipe(
tap((wrappedStoreValue) => {
localStoreStorage.setKey(key, wrappedStoreValue)
}),
),
).pipe(distinctUntilChanged(isEqual))
}
function setKey(key: string, nextValue: KeyValueStoreValue) {
localStoreStorage.setKey(key, nextValue)
Expand Down
7 changes: 5 additions & 2 deletions packages/sanity/src/structure/useStructureToolSetting.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {useCallback, useMemo} from 'react'
import {useObservable} from 'react-rx'
import {map} from 'rxjs/operators'
import {useKeyValueStore} from 'sanity'

const STRUCTURE_TOOL_NAMESPACE = 'studio.structure-tool'
Expand All @@ -17,8 +18,10 @@ export function useStructureToolSetting<ValueType>(
const keyValueStoreKey = [STRUCTURE_TOOL_NAMESPACE, namespace, key].filter(Boolean).join('.')

const value$ = useMemo(() => {
return keyValueStore.getKey(keyValueStoreKey)
}, [keyValueStore, keyValueStoreKey])
return keyValueStore
.getKey(keyValueStoreKey)
.pipe(map((value) => (value === null ? defaultValue : value)))
}, [defaultValue, keyValueStore, keyValueStoreKey])

const value = useObservable(value$, defaultValue) as ValueType
const set = useCallback(
Expand Down
2 changes: 1 addition & 1 deletion perf/efps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"test": "npm start"
},
"devDependencies": {
"@sanity/client": "^6.22.1",
"@sanity/client": "^6.22.2",
"@swc-node/register": "^1.10.9",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
Expand Down
4 changes: 2 additions & 2 deletions perf/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"dependencies": {
"@playwright/test": "1.44.1",
"@sanity/client": "^6.22.1",
"@sanity/client": "^6.22.2",
"@sanity/uuid": "^3.0.1",
"dotenv": "^16.0.3",
"execa": "^2.0.0",
Expand All @@ -32,6 +32,6 @@
"@types/node": "^18.15.3",
"esbuild": "0.21.5",
"ts-node": "^10.9.2",
"typescript": "5.6.2"
"typescript": "5.6.3"
}
}
Loading

0 comments on commit 760900e

Please sign in to comment.