Skip to content

Commit

Permalink
Merge branch 'next' into corel
Browse files Browse the repository at this point in the history
* next: (25 commits)
  fix(deps): update dependency @sanity/ui to ^2.8.16 (#7723)
  fix(deps): update dependency @sanity/ui to ^2.8.16 (#7722)
  chore(lockfile): update dependency @sanity/asset-utils to v2.0.7 (#7721)
  fix(deps): update dependency @sanity/ui to ^2.8.15 (#7717)
  fix(deps): update dependency @sanity/ui to ^2.8.15 (#7718)
  fix(deps): Update babel monorepo (#7719)
  chore(deps): update typescript-tooling (#7681)
  chore(deps): bump react-compiler linter (#7715)
  fix(deps): Update dev-non-major (#7708)
  fix(deps): update dependency react-rx to ^4.1.0 (#7714)
  fix(deps): update dependency @portabletext/editor to ^1.2.0 (#7709)
  chore(deps): update dependency lerna to ^8.1.9 (#7711)
  fix(deps): update dependency @sanity/ui to ^2.8.14 (#7713)
  chore: telemetry definition files are owned by @data-eng (#7703)
  fix(deps): update dependency react-rx to ^4.0.1 (#7712)
  fix(deps): Update dev-non-major (#7693)
  chore(deps): update dependency @vitejs/plugin-react to ^4.3.3 (#7688)
  fix(deps): update dependency @sanity/ui to ^2.8.13 (#7694)
  fix(deps): update dependency @portabletext/editor to ^1.1.11 (#7667)
  feat(cli): prepare nextjs starter template for live mode (#7633)
  ...
  • Loading branch information
bjoerge committed Nov 1, 2024
2 parents aef9dcc + 3048630 commit ea93fea
Show file tree
Hide file tree
Showing 22 changed files with 1,772 additions and 1,554 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ packages/sanity/src/structure/panes/documentList/sheetList @sanity-io/studio-ex
/packages/@sanity/cli/templates/shopify* @thebiggianthead

# Telemetry definitions
*.telemetry.ts @sanity-io/growth
*.telemetry.ts @sanity-io/data-eng

# -- Plugins --

Expand Down
2 changes: 1 addition & 1 deletion dev/design-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"dependencies": {
"@sanity/icons": "^3.4.0",
"@sanity/ui": "^2.8.10",
"@sanity/ui": "^2.8.16",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sanity": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion dev/embedded-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"preview": "vite preview"
},
"dependencies": {
"@sanity/ui": "^2.8.10",
"@sanity/ui": "^2.8.16",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sanity": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions dev/studio-e2e-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"dependencies": {
"@sanity/google-maps-input": "^4.0.0",
"@sanity/icons": "^3.4.0",
"@sanity/ui": "^2.8.10",
"@sanity/vision": "3.62.2",
"@sanity/ui": "^2.8.16",
"@sanity/vision": "3.62.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sanity": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion dev/test-next-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@sanity/vision": "workspace:*",
"babel-plugin-react-compiler": "0.0.0-experimental-de2cfda-20240912",
"next": "15.0.1",
"next": "15.0.2",
"react": "19.0.0-rc-a7d1240c-20240731",
"react-dom": "19.0.0-rc-a7d1240c-20240731",
"react-is": "19.0.0-rc-a7d1240c-20240731",
Expand Down
8 changes: 4 additions & 4 deletions dev/test-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"workshop:dev": "node -r esbuild-register scripts/workshop/dev.ts"
},
"dependencies": {
"@portabletext/editor": "^1.1.7",
"@portabletext/editor": "^1.2.0",
"@portabletext/react": "^3.0.0",
"@sanity/assist": "^3.0.2",
"@sanity/block-tools": "3.62.2",
"@sanity/block-tools": "3.62.3",
"@sanity/client": "^6.22.2",
"@sanity/color": "^3.0.0",
"@sanity/google-maps-input": "^4.0.0",
Expand All @@ -34,9 +34,9 @@
"@sanity/migrate": "workspace:*",
"@sanity/preview-url-secret": "^2.0.1-release.0",
"@sanity/react-loader": "^1.10.15-release.0",
"@sanity/tsdoc": "1.0.113",
"@sanity/tsdoc": "1.0.122",
"@sanity/types": "workspace:*",
"@sanity/ui": "^2.8.10",
"@sanity/ui": "^2.8.16",
"@sanity/ui-workshop": "^1.0.0",
"@sanity/util": "workspace:*",
"@sanity/uuid": "^3.0.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/ecommerce-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"dependencies": {
"@sanity/cli": "3.62.2",
"@sanity/ui": "^2.8.10",
"@sanity/ui": "^2.8.16",
"react": "^18.3.1",
"react-barcode": "^1.4.1",
"react-dom": "^18.3.1",
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"check:deps": "pnpm --recursive --parallel exec depcheck",
"check:format": "prettier . --check",
"check:lint": "turbo run lint --continue -- --quiet",
"check:react-compiler": "eslint --no-inline-config --no-eslintrc --ext .cjs,.mjs,.js,.jsx,.ts,.tsx --parser @typescript-eslint/parser --plugin react-compiler --rule 'react-compiler/react-compiler: [warn]' --ignore-path .eslintignore.react-compiler --max-warnings 7 .",
"check:react-compiler": "eslint --no-inline-config --no-eslintrc --ext .cjs,.mjs,.js,.jsx,.ts,.tsx --parser @typescript-eslint/parser --plugin react-compiler --rule 'react-compiler/react-compiler: [warn]' --ignore-path .eslintignore.react-compiler --max-warnings 80 .",
"check:test": "run-s test -- --silent",
"check:types": "tsc && turbo run check:types --filter='./packages/*' --filter='./packages/@sanity/*'",
"chore:format:fix": "prettier --cache --write .",
Expand Down Expand Up @@ -111,10 +111,10 @@
"@sanity/eslint-config-i18n": "1.0.0",
"@sanity/eslint-config-studio": "^4.0.0",
"@sanity/mutate": "^0.10.1",
"@sanity/pkg-utils": "6.11.4",
"@sanity/pkg-utils": "6.11.8",
"@sanity/prettier-config": "^1.0.2",
"@sanity/test": "0.0.1-alpha.1",
"@sanity/tsdoc": "1.0.113",
"@sanity/tsdoc": "1.0.122",
"@sanity/ui": "2.10.0-corel.0",
"@sanity/uuid": "^3.0.2",
"@types/glob": "^7.2.0",
Expand All @@ -125,7 +125,7 @@
"@types/yargs": "^17.0.7",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@vitejs/plugin-react": "^4.3.1",
"@vitejs/plugin-react": "^4.3.3",
"cac": "^6.7.12",
"chalk": "^4.1.2",
"depcheck": "^1.4.7",
Expand All @@ -142,7 +142,7 @@
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.36.1",
"eslint-plugin-react-compiler": "0.0.0-experimental-9ed098e-20240725",
"eslint-plugin-react-compiler": "beta",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-tsdoc": "^0.3.0",
Expand All @@ -154,7 +154,7 @@
"husky": "^9.0.11",
"jest": "^29.7.0",
"js-yaml": "^4.1.0",
"lerna": "^8.1.8",
"lerna": "^8.1.9",
"lint-staged": "^12.1.2",
"lodash": "^4.17.21",
"minimist": "^1.2.5",
Expand Down
6 changes: 3 additions & 3 deletions packages/@repo/test-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"./vitest": "./vitest/index.mjs"
},
"devDependencies": {
"@babel/preset-env": "^7.24.7",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@babel/preset-env": "^7.26.0",
"@babel/preset-react": "^7.25.9",
"@babel/preset-typescript": "^7.26.0",
"@jest/globals": "^29.7.0",
"@repo/dev-aliases": "workspace:*",
"babel-plugin-transform-vite-meta-hot": "^1.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,21 @@ export const client = createClient({
})
`

const live = `// Querying with "sanityFetch" will keep content automatically updated
// Before using it, import and render "<SanityLive />" in your layout, see
// https://github.com/sanity-io/next-sanity#live-content-api for more information.
import { defineLive } from "next-sanity";
import { client } from './client'
export const { sanityFetch, SanityLive } = defineLive({
client: client.withConfig({
// Live content is currently only available on the experimental API
// https://www.sanity.io/docs/api-versioning
apiVersion: 'vX'
})
});
`

const imageTS = `import createImageUrlBuilder from '@sanity/image-url'
import { SanityImageSource } from "@sanity/image-url/lib/types/types";
Expand Down Expand Up @@ -201,6 +216,7 @@ export const sanityFolder = (
'env.': useTypeScript ? envTS : envJS,
'lib': {
'client.': client,
'live.': live,
'image.': useTypeScript ? imageTS : imageJS,
},
}
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 @@ -56,7 +56,7 @@
"@repo/package.config": "workspace:*",
"@repo/test-config": "workspace:*",
"@sanity/insert-menu": "1.0.10",
"@vitejs/plugin-react": "^4.3.1",
"@vitejs/plugin-react": "^4.3.3",
"react": "^18.3.1",
"rimraf": "^3.0.2",
"vitest": "^2.1.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 @@ -63,7 +63,7 @@
"@rexxars/react-split-pane": "^0.1.93",
"@sanity/color": "^3.0.0",
"@sanity/icons": "^3.4.0",
"@sanity/ui": "^2.8.10",
"@sanity/ui": "^2.8.16",
"@uiw/react-codemirror": "^4.11.4",
"is-hotkey-esm": "^1.0.0",
"json-2-csv": "^5.5.1",
Expand Down
12 changes: 6 additions & 6 deletions packages/sanity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"@dnd-kit/sortable": "^7.0.1",
"@dnd-kit/utilities": "^3.2.0",
"@juggle/resize-observer": "^3.3.1",
"@portabletext/editor": "^1.1.5",
"@portabletext/editor": "^1.2.0",
"@portabletext/react": "^3.0.0",
"@rexxars/react-json-inspector": "^8.0.1",
"@sanity/asset-utils": "^2.0.6",
Expand All @@ -177,7 +177,7 @@
"@sanity/schema": "3.62.2",
"@sanity/telemetry": "^0.7.7",
"@sanity/types": "3.62.2",
"@sanity/ui": "^2.8.10",
"@sanity/ui": "^2.8.16",
"@sanity/util": "3.62.2",
"@sanity/uuid": "^3.0.1",
"@sentry/react": "^8.7.0",
Expand Down Expand Up @@ -244,7 +244,7 @@
"react-i18next": "14.0.2",
"react-is": "^18.2.0",
"react-refractor": "^2.1.6",
"react-rx": "^4.0.0",
"react-rx": "^4.1.0",
"read-pkg-up": "^7.0.1",
"refractor": "^3.6.0",
"resolve-from": "^5.0.0",
Expand Down Expand Up @@ -276,8 +276,8 @@
"@repo/test-config": "workspace:*",
"@sanity/codegen": "3.62.2",
"@sanity/generate-help-url": "^3.0.0",
"@sanity/pkg-utils": "6.11.4",
"@sanity/tsdoc": "1.0.113",
"@sanity/pkg-utils": "6.11.8",
"@sanity/tsdoc": "1.0.122",
"@sanity/ui-workshop": "^1.2.11",
"@sentry/types": "^8.12.0",
"@testing-library/jest-dom": "^6.4.8",
Expand All @@ -300,7 +300,7 @@
"@types/rimraf": "^3.0.2",
"@types/semver": "^6.2.3",
"@types/tar-fs": "^2.0.1",
"@vitejs/plugin-react": "^4.3.1",
"@vitejs/plugin-react": "^4.3.3",
"@vvo/tzdb": "6.137.0",
"blob-polyfill": "^9.0.20240710",
"date-fns-tz": "2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/sanity/src/core/scheduledPublishing/tool/Tool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default function Tool() {
</Box>
)}

<Box flex={1}>
<Box flex={1} overflow="auto">
{isInitialLoading ? (
<Box padding={4}>
<Text muted>Loading...</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,7 @@ const VirtualList = () => {
}, [scheduleState, sortBy, containerRef])

return (
<Box
paddingBottom={6}
paddingTop={1}
paddingX={4}
ref={containerRef}
style={{
position: 'relative',
overflowX: 'hidden',
overflowY: 'auto',
height: '100%',
boxSizing: 'border-box',
}}
>
<Box paddingBottom={6} paddingTop={1} paddingX={4} ref={containerRef} overflow="hidden">
<Box
style={{
height: `${totalSize}px`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable camelcase */
import {type SanityClient} from '@sanity/client'
import {type InitialValueResolverContext} from '@sanity/types'
import {type InitialValueResolverContext, type Schema} from '@sanity/types'
import {firstValueFrom} from 'rxjs'
import {describe, expect, it} from 'vitest'

Expand Down Expand Up @@ -51,6 +51,14 @@ describe('getTemplatePermissions', () => {
userId: null,
})

const context: InitialValueResolverContext = {
projectId: 'test-project',
dataset: 'test-dataset',
schema: schema as Schema,
currentUser: null,
getClient: () => client as unknown as SanityClient,
}

const permissions = firstValueFrom(
getTemplatePermissions({
grantsStore,
Expand All @@ -62,15 +70,17 @@ describe('getTemplatePermissions', () => {
templateId: 'author-developer-locked',
type: 'initialValueTemplateItem',
schemaType: 'author',
parameters: {},
},
{
id: 'author-developer-unlocked',
templateId: 'author-developer-unlocked',
type: 'initialValueTemplateItem',
schemaType: 'author',
parameters: {},
},
],
context: {} as InitialValueResolverContext,
context,
}),
)

Expand All @@ -79,6 +89,7 @@ describe('getTemplatePermissions', () => {
description: undefined,
granted: false,
icon: undefined,
i18n: undefined,
schemaType: 'author',
id: 'author-developer-locked',
reason: 'No matching grants found',
Expand All @@ -93,11 +104,13 @@ describe('getTemplatePermissions', () => {
templateId: 'author-developer-locked',
title: 'Developer',
type: 'initialValueTemplateItem',
parameters: {},
},
{
description: undefined,
granted: true,
icon: undefined,
i18n: undefined,
schemaType: 'author',
id: 'author-developer-unlocked',
reason: 'Matching grant',
Expand All @@ -112,6 +125,7 @@ describe('getTemplatePermissions', () => {
templateId: 'author-developer-unlocked',
title: 'Developer',
type: 'initialValueTemplateItem',
parameters: {},
},
])
})
Expand Down
Loading

0 comments on commit ea93fea

Please sign in to comment.