Skip to content

Commit

Permalink
chore: squash everything
Browse files Browse the repository at this point in the history
chore(deps): update app dependencies to v0.0.0-experimental-fa06e2c-20241014

refactor: use comlink

feat: expose schema

feat: expose preview snapshots

feat: display title and icon on overlay elements

refactor(comlink): improve types

feat: optimistic state

refactor: improve types

feat(visual-editing): context menu

fix(visual-editing): mutate observe

chore: fix lockfile

feat(visual-editing): mutate on drag and drop

refactor(helpers): improve comlink compatibility names

chore: fix lockfile

chore(release): publish canary [skip ci]

fix: use mutate package state machine

chore(deps): update peter-evans/create-pull-request digest to d121e62 (#1818)

fix(visual-editing): apply optimistic state on local rebase

feat(visual-editing): non-union array context menu support

fix(visual-editing): mismatched types

chore(visual-editing): remove snapshot log

chore(release): publish canary [skip ci]

fix(visual-editing): prevent undefined array item on drag

fix(comlink): use sendTo over sendParent, improve request abort handling

fix(visual-editing): support dragging on all axes

chore(visual-editing): lint, remove unused deps

chore(visual-editing): improve useOptimistic types

chore: setup `@repo/eslint-config` and `@repo/prettier-config` (#1822)

chore(deps): update sanity monorepo to ^3.57.3

chore(deps): bump non-major

chore(visual-editing): remove useOptimistic warning, always return state

fix(deps): Update sanity monorepo to v3.57.3 (#1823)

chore(deps): bump remaining non-major

chore(deps): update peter-evans/create-pull-request digest to 6cd32fd (#1824)

fix(visual-editing): constrain context menu group size

chore: add `@repo/studio-url` (#1825)

chore(deps): update app dependencies (#1828)

chore: setup dynamic preview urls (#1829)

fix(visual-editing): use ref for reducers passed to useOptimistic hook

fix(visual-editing): render overlays outside of preview frame

chore: setup typegen (#1830)

chore: fix canary release command

chore(release): publish canary [skip ci]

chore: add `@sanity/next-loader` (#1831)

chore(release): publish canary [skip ci]

fix: add better Suspense boundaries for lazy loaded components

chore(deps): update app dependencies (#1835)

chore(release): publish canary [skip ci]

fix(deps): Update sanity monorepo to ^3.57.4 (#1839)

chore(deps): update sanity monorepo to ^3.57.4 (#1838)

chore(deps): update dependency @sveltejs/adapter-auto to ^3.2.5 (#1836)

chore(deps): update dependency @sveltejs/kit to ^2.5.28 (#1837)

chore: don't render zero below Presentation Tool

chore(release): publish canary [skip ci]

fix: gracefully handle missing grants to create preview secrets

chore(release): publish canary [skip ci]

chore: use exact versions

chore(release): publish canary [skip ci]

chore: setup comlink

chore: stable link

chore(release): publish canary [skip ci]

chore: cleanup debug tools

chore: support perspective switcher

chore(release): publish canary [skip ci]

chore: stop deduping `framer-motion`

chore(deps): update peter-evans/create-pull-request digest to 5e91468 (#1840)

chore(deps): update dependency @tinloof/sanity-studio to v1.3.4 (#1841)

chore: support validating preview secret with server action

chore(release): publish canary [skip ci]

chore: improve comlink connectivity

chore: increase timeout

chore(release): publish canary [skip ci]

chore: update live demo

chore: animate color changes

chore: longer duration

chore: do not animate initial chars

chore: better memoization of animated letters

chore(deps): update app dependencies (#1842)

chore: add hooks

chore(release): publish canary [skip ci]

chore: handle draft mode in next v15

chore(release): publish canary [skip ci]

chore: fix prod crash

chore(deps): update app dependencies (#1844)

chore(deps): update storybook monorepo to ^8.3.2 (#1845)

fix(visual-editing): check if node is in body before removing it

chore(release): publish canary [skip ci]

chore(deps): update remix monorepo to ^2.12.1 (#1846)

chore: improve debugging

chore: improve debugging

chore(release): publish canary [skip ci]

chore: React.memo causes unmount/mount in layout.tsx

chore(release): publish canary [skip ci]

chore: only load comlink when postMessage is detected

chore(release): publish canary [skip ci]

chore: add hook for reporting status

chore(release): publish canary [skip ci]

chore: support Live Draft Content API events

chore(release): publish canary [skip ci]

chore: only setup live drafts in draft mode

chore(release): publish canary [skip ci]

chore: add `SanityLiveStream` component

chore(release): publish canary [skip ci]

chore(deps): update pnpm to v9.11.0 (#1852)

chore(deps): update app dependencies (#1847)

chore(deps): update dependency next to ^14.2.13 (#1850)

chore(deps): update dependency @types/react to ^18.3.8 (#1849)

fix(deps): Update xstate monorepo (#1853)

chore(deps): update dependency vite to ^5.4.7 (#1851)

chore(release): publish canary [skip ci]

chore: use vX for now

fix(visual-editing): allow open in studio click action

chore: move page-builder-demo to next-loader

chore(release): publish canary [skip ci]

fix(deps): update dependency @sanity/client to ^6.22.0 (#1854)

chore: fix typegen

chore: typegen nits

chore: bump canaries again

chore(release): publish canary [skip ci]

chore: test live stream

chore(release): publish canary [skip ci]

fix(comlink): transition channel to handshaking state on request failure

chore(deps): update app dependencies (#1855)

chore(deps): update dependency tailwindcss to ^3.4.13 (#1856)

chore(live): handle tags and query scoping

chore(release): publish canary [skip ci]

chore(live): set empty params

chore(release): publish canary [skip ci]

chore(drag-and-drop-minimap): implement minimap scaling (#1857)

* chore(drag-and-drop-minimap): implement minimap scaling

refine transform > scroll logic

lint

remove remix timestamp

tidy up scaleRect

mouse button check

fix

mouse btn check

drag speed scale trigger

remove delta

shift minimap

show badge

abstract minimap prompt to own component, tidy design

tidy up renderVisualEditing

parentNode check in renderVisualEditing

tidy renderVisualEditing

group dnd elements in Overlays template

add geometric functions to utils

fix linter issues

sanding the edges

wip

tidy matrix transforms

clean up event listeners

clean up keydown

* chore(drag-and-drop-minimap): tidy up automated next-env change

* chore(drag-and-drop-minimap): remove disable-overlays css

* chore(drag-and-drop-minimap): add clarifying ccomment to window.focus in drag handler

* chore(drag-and-drop-minimap): fix linter issues

* chore: bump next-sanity to fix render position issue

* chore: fix ssr error

chore(release): publish canary [skip ci]

fix(deps): Update sanity monorepo to ^3.58.0 (#1864)

chore(deps): update dependency @types/react to ^18.3.9 (#1859)

fix(deps): Update dependency prettier-plugin-tailwindcss to v0.6.8 (#1862)

chore(deps): update dependency vite to ^5.4.8 (#1860)

fix(comlink): emit correct connection status when a controller has existing targets before connection is created

chore(deps): update app dependencies (canary) (#1858)

* chore(deps): update app dependencies

* chore: downgrade some deps

---------

chore(deps): update storybook monorepo to ^8.3.3 (#1861)

chore(deps): update sanity monorepo to ^3.58.0 (#1863)

chore: tweak page builder demo index page

chore(useOptimistic): fix flash of stale content issue

chore(deps): update dependency next to v14.2.12 [security] (#1865)

chore: use exact version of `@sanity/mutate`

chore(release): publish canary [skip ci]

chore: prevent crashes on visual editing unmounts

chore: bump `next` canaries

chore: stable typegen with prettier

chore: run prettier on the canary branch when needed

fix(next-loader): better clarify token diffs

chore: fix prettier script

chore: increase timeouts

chore: handle handshake consistently

chore(presentation): optimize iframe component and ref forwarding

chore: add new browser token to turbo json

chore(page-builder-demo): add draft mode enabler

chore(page-builder-demo): don't use `<SanityLiveStream />` yet

chore(release): publish canary [skip ci]

fix(next-loader): validate CORS

chore: test cors error

chore: improve CORS validation

chore(deps): update app dependencies (#1867)

fix(next-loader): support new async APIs in next v15

chore: fix build error

chore(release): publish canary [skip ci]

chore: remove debug code

chore(live-next): everything is live

fix(next-loader): ensure standalone live preview of drafts passthrough

chore(release): publish canary [skip ci]

feat: add qrcode of share url (#1870)

chore(release): publish canary [skip ci]

chore: add page builder pages route

chore: add SSG to new pages route

chore: add page builder page location resolver

chore: simplify page builder demo

chore: fix build error

chore(deps): update dependency next-sanity to v9.5.1-canary.22 (#1869)

chore(deps): update dependency next-sanity to v9.5.1-canary.23

Image fix (#1872)

chore(drag-and-drop): drag handles, drag centroids, bugfixes

* chore(drag-and-drop): add drag handles, bug fixes

reset minimap transform centered in viewport

centroid dragging, scale padding

prevent scrollIntoView while dragging

tidy up comments

typegen

* chore(drag-and-drop): tidy elementoverlay css

* chore(drag-and-drop): fix linter issues

* chore(drag-and-drog): fix drag disabled attr

* chore(drag-and-drop): tidy up mouse state in dragAndDrop

* chore(drag-and-drop): remove unused fragment in ElementOverlay

* chore(drag-and-drop): update label padding

chore: nuxt app build depends on core loader

chore: cleanup nuxt app

chore(deps): update app dependencies

chore(deps): update dependency @sanity/assist to v3.0.7

chore(deps): update dependency @types/react to ^18.3.11

chore(deps): update dependency next to ^14.2.14

chore(deps): update dependency turbo to v2.1.3

chore: fix lockfile

chore(drag-and-drop-ui-updates): various ui/ux tweaks, interaction sequence refined (#1886)

chore(deps): update dependency vitest to ^2.1.2 (#1890)

chore(deps): update dependency @sveltejs/kit to ^2.6.3 (#1889)

chore(deps): update dependency @sanity/assist to v3.0.8 (#1888)

feat(visual-editing): add `useDocuments` hook (#1884)

chore(deps): update app dependencies (#1887)

fix(deps): update dependency @sanity/client to ^6.22.1

fix(deps): Update sanity monorepo to ^3.60.0 (#1894)

chore(deps): update pnpm to v9.12.1 (#1892)

chore(deps): update sanity monorepo to ^3.60.0 (#1893)

fix(deps): Update linters (#1897)

fix(deps): Update dependency prettier-plugin-svelte to v3.2.7 (#1896)

chore(deps): update storybook monorepo to ^8.3.5 (#1895)

chore(deps): update app dependencies

chore(deps): update dependency eslint-plugin-react-hooks to v5 (#1905)

chore(deps): update dependency @types/react-dom to ^18.3.1 (#1900)

chore(deps): update dependency next to ^14.2.15 (#1901)

chore(deps): update dependency typescript to v5.6.3 (#1902)

chore(deps): update dependency @sveltejs/kit to ^2.7.0 (#1903)

chore(deps): update remix monorepo to ^2.13.1 (#1904)

chore(release): publish canary [skip ci]

chore(deps): update dependency astro to ^4.16.3 (#1909)

chore: bump pkg-utils

chore(release): publish canary [skip ci]

chore(deps): update dependency date-fns to v4 (#1913)

chore(deps): update app dependencies (#1917)

chore(deps): update dependency @sanity/pkg-utils to ^6.11.3 (#1918)

fix(deps): Update dependency date-fns to v4 (#1914)

chore(deps): update dependency vitest to ^2.1.3 (#1920)

chore(deps): update dependency vite to ^5.4.9 (#1919)

chore(next-loader): improve live stream compat with next v15 turbo

chore(deps): update dependency @sveltejs/kit to ^2.7.1

chore(release): publish canary [skip ci]

Co-Authored-By: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-Authored-By: Cody Olsen <[email protected]>
Co-Authored-By: Rupert Dunk <[email protected]>
Co-Authored-By: George Francis <[email protected]>
  • Loading branch information
5 people committed Oct 15, 2024
1 parent b53d8b9 commit bdd5553
Show file tree
Hide file tree
Showing 561 changed files with 20,169 additions and 13,385 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
cache: pnpm
node-version: lts/*
- run: pnpm install --ignore-scripts
- run: pnpm build --filter=./packages/*
- run: pnpm build --filter=!./apps/*
- run: pnpm lint

test:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
with:
app-id: ${{ secrets.ECOSPARK_APP_ID }}
private-key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }}
- uses: peter-evans/create-pull-request@8867c4aba1b742c39f8d0ba35429c2dfa4b6cb20 # v7
- uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7
with:
body: I ran `pnpm lint:fix` 🧑‍💻
branch: actions/lint-fix
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Prettier

on:
push:
branches: [main]
branches: [main, canary]
workflow_dispatch:

concurrency:
Expand All @@ -23,8 +23,7 @@ jobs:
with:
cache: pnpm
node-version: lts/*

- run: pnpm install --dev --ignore-scripts
- run: pnpm install --ignore-scripts
- uses: actions/cache@v4
with:
path: node_modules/.cache/prettier/.prettier-cache
Expand All @@ -36,10 +35,10 @@ jobs:
with:
app-id: ${{ secrets.ECOSPARK_APP_ID }}
private-key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }}
- uses: peter-evans/create-pull-request@8867c4aba1b742c39f8d0ba35429c2dfa4b6cb20 # v7
- uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7
with:
body: I ran `pnpm format` 🧑‍💻
branch: actions/prettier
branch: "actions/prettier-${{ github.ref_name }}"
commit-message: 'chore(prettier): 🤖 ✨'
labels: 🤖 bot
sign-commits: true
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,25 @@ jobs:

# Publish to NPM on new releases
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created || github.event.inputs.publish == 'true' }}
if: ${{ steps.release.outputs.releases_created || github.event.inputs.publish == 'true' }}
- uses: pnpm/action-setup@v4
if: ${{ steps.release.outputs.release_created || github.event.inputs.publish == 'true' }}
if: ${{ steps.release.outputs.releases_created || github.event.inputs.publish == 'true' }}
- uses: actions/setup-node@v4
if: ${{ steps.release.outputs.release_created || github.event.inputs.publish == 'true' }}
if: ${{ steps.release.outputs.releases_created || github.event.inputs.publish == 'true' }}
with:
cache: pnpm
node-version: lts/*
- name: install deps & build
run: pnpm install --ignore-scripts && pnpm build --filter=./packages/*
if: ${{ steps.release.outputs.release_created || github.event.inputs.publish == 'true' }}
run: pnpm install --ignore-scripts && pnpm build --filter=!./apps/*
if: ${{ steps.release.outputs.releases_created || github.event.inputs.publish == 'true' }}
- name: Set publishing config
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
if: ${{ steps.release.outputs.release_created || github.event.inputs.publish == 'true' }}
if: ${{ steps.release.outputs.releases_created || github.event.inputs.publish == 'true' }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
# Release Please has already incremented versions and published tags, so we just
# need to publish all unpublished versions to NPM here
- run: pnpm -r publish
if: ${{ steps.release.outputs.release_created || github.event.inputs.publish == 'true' }}
if: ${{ steps.release.outputs.releases_created || github.event.inputs.publish == 'true' }}
env:
NPM_CONFIG_PROVENANCE: true
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
apps/*/.next
apps/*/build
apps/*/dist
apps/*/.output
apps/*/public/build
apps/*/sanity.types.ts
CHANGELOG.md
packages/*/dist
packages/*/dist-svelte
packages/*/storybook-static
packages/@repo/*/dist
packages/@repo/*/dist-svelte
packages/@repo/*/storybook-static
pnpm-lock.yaml
tsconfig.json

1 change: 0 additions & 1 deletion apps/astro/README.md

This file was deleted.

23 changes: 17 additions & 6 deletions apps/astro/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {defineConfig} from 'astro/config'
import {workspaces, studioUrl as baseUrl, apiVersion} from 'apps-common/env'
import sanity from '@sanity/astro'
import react from '@astrojs/react'
import tailwind from '@astrojs/tailwind'
import vercel from '@astrojs/vercel/serverless'
const {projectId, dataset, workspace} = workspaces['astro']
const studioUrl = `${baseUrl}/${workspace}`
import {apiVersion, workspaces} from '@repo/env'
import {studioUrl as baseUrl} from '@repo/studio-url'
import sanity from '@sanity/astro'
import {defineConfig} from 'astro/config'

const {projectId, dataset} = workspaces['astro']

// https://astro.build/config
export default defineConfig({
Expand All @@ -17,7 +18,17 @@ export default defineConfig({
useCdn: true,
apiVersion,
stega: {
studioUrl,
studioUrl: (sourceDocument) => {
if (
sourceDocument._projectId === workspaces['cross-dataset-references'].projectId &&
sourceDocument._dataset === workspaces['cross-dataset-references'].dataset
) {
const {workspace, tool} = workspaces['cross-dataset-references']
return {baseUrl, workspace, tool}
}
const {workspace, tool} = workspaces['astro']
return {baseUrl, workspace, tool}
},
},
}),
react(),
Expand Down
24 changes: 15 additions & 9 deletions apps/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,28 @@
"preview": "astro preview",
"start": "astro dev"
},
"prettier": "@repo/prettier-config",
"dependencies": {
"@astrojs/check": "^0.9.3",
"@astrojs/check": "^0.9.4",
"@astrojs/react": "^3.6.2",
"@astrojs/tailwind": "^5.1.0",
"@astrojs/vercel": "^7.8.0",
"@astrojs/tailwind": "^5.1.2",
"@astrojs/vercel": "^7.8.1",
"@repo/env": "workspace:*",
"@repo/studio-url": "workspace:*",
"@sanity/astro": "^3.1.6",
"@sanity/client": "^6.21.3",
"@sanity/client": "^6.22.1",
"@sanity/image-url": "^1.0.2",
"@sanity/visual-editing": "workspace:*",
"apps-common": "workspace:^",
"astro": "^4.15.4",
"@vercel/stega": "^0.1.2",
"astro": "^4.16.3",
"astro-portabletext": "^0.10.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sanity": "3.57.2",
"tailwindcss": "^3.4.10",
"typescript": "5.6.2"
"sanity": "3.60.0",
"tailwindcss": "^3.4.13",
"typescript": "5.6.3"
},
"devDependencies": {
"@repo/prettier-config": "workspace:*"
}
}
1 change: 1 addition & 0 deletions apps/astro/src/layouts/layout.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import {VisualEditing} from '@sanity/astro/visual-editing'
const visualEditingEnabled = import.meta.env.SANITY_VISUAL_EDITING_ENABLED == 'true'
export type props = {
Expand Down
4 changes: 2 additions & 2 deletions apps/astro/src/pages/shoes/[slug].astro
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
import {shoe, shoesList, type ShoeResult, type ShoesListResult} from 'apps-common/queries'
import {formatCurrency} from 'apps-common/utils'
import {PortableText} from 'astro-portabletext'
import Layout from '../../layouts/layout.astro'
import {loadQuery} from '../../load-query'
import {shoe, shoesList, type ShoeResult, type ShoesListResult} from '../../queries'
import {urlFor, urlForCrossDatasetReference} from '../../sanity'
import {formatCurrency} from '../../utils'
const {slug} = Astro.params
Expand Down
4 changes: 2 additions & 2 deletions apps/astro/src/pages/shoes/index.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
import {shoesList, type ShoesListResult} from 'apps-common/queries'
import {formatCurrency} from 'apps-common/utils'
import Layout from '../../layouts/layout.astro'
import {loadQuery} from '../../load-query'
import {shoesList, type ShoesListResult} from '../../queries'
import {urlFor, urlForCrossDatasetReference} from '../../sanity'
import {formatCurrency} from '../../utils'
const {data: products} = await loadQuery<ShoesListResult>({query: shoesList})
const _loading = false
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion apps/astro/src/sanity.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {workspaces} from '@repo/env'
import imageUrlBuilder from '@sanity/image-url'
import {workspaces} from 'apps-common/env'

const {projectId, dataset} = workspaces['astro']

Expand Down
18 changes: 18 additions & 0 deletions apps/astro/src/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {vercelStegaSplit} from '@vercel/stega'

export function formatCurrency(_value: number | string): string {
let value = typeof _value === 'string' ? undefined : _value
let encoded = ''
if (typeof _value === 'string') {
const split = vercelStegaSplit(_value)
value = parseInt(split.cleaned, 10)
encoded = split.encoded
}
const formatter = new Intl.NumberFormat('en', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 0,
maximumFractionDigits: 0,
})
return `${formatter.format(value!)}${encoded}`
}
103 changes: 0 additions & 103 deletions apps/common/package.json

This file was deleted.

1 change: 0 additions & 1 deletion apps/common/src/index.ts

This file was deleted.

11 changes: 0 additions & 11 deletions apps/common/src/lib/findField.ts

This file was deleted.

6 changes: 0 additions & 6 deletions apps/common/src/lib/isFieldMember.ts

This file was deleted.

30 changes: 0 additions & 30 deletions apps/common/src/lib/useReferenceEditState.ts

This file was deleted.

Loading

0 comments on commit bdd5553

Please sign in to comment.