Skip to content

Commit

Permalink
upgrade dependencies (#52)
Browse files Browse the repository at this point in the history
* upgrade minor dependencies

* fix: check lesson translations

* upgrade dependencies
  • Loading branch information
nkgentile authored May 10, 2024
1 parent a066a80 commit 7665b38
Show file tree
Hide file tree
Showing 21 changed files with 15,140 additions and 6,930 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ yarn-error.log*
.yalc
# Local Netlify folder
.netlify

tsconfig.tsbuildinfo
7,566 changes: 5,011 additions & 2,555 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
}
},
"dependencies": {
"@sanity/language-filter": "^3.1.1",
"@sanity/language-filter": "^4.0.2",
"husky": "^8.0.3",
"prettier": "^2.8.8",
"sanity": "^3.16.1"
"sanity": "^3.41.1"
},
"devDependencies": {
"@sanity/eslint-config-studio": "^2.0.1",
"eslint": "^8.40.0",
"@sanity/eslint-config-studio": "^4.0.0",
"eslint": "^8.57.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"prettier": "2.8.8",
"typescript": "^5.0.4"
"typescript": "^5.4.5"
},
"prettier": {
"semi": false,
Expand Down
3 changes: 2 additions & 1 deletion studio/components/CourseMedia.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ type CourseMediaType = {
}

export default function CourseMedia(props: CourseMediaType) {
const {presenters = []} = props
const [presenterDocs, setPresenterDocs] = useState<SanityDocument[]>([])
const client = useClient(options)
// eslint-disable-next-line react-hooks/exhaustive-deps
const presenters = Array.isArray(props.presenters) ? props.presenters : []

useEffect(() => {
if (!presenterDocs.length && presenters.length) {
Expand Down
9 changes: 0 additions & 9 deletions studio/components/IframeWrapper.tsx

This file was deleted.

6,752 changes: 4,363 additions & 2,389 deletions studio/package-lock.json

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,34 @@
"sanity"
],
"dependencies": {
"@sanity/assist": "^2.0.0",
"@sanity/code-input": "^4.0.0",
"@sanity/document-internationalization": "^2.0.3",
"@sanity/eslint-config-studio": "^2.0.0",
"@sanity/language-filter": "^3.2.2",
"@sanity/vision": "^3.4.0",
"eslint": "^8.6.0",
"eslint-config-prettier": "^8.5.0",
"@sanity/assist": "^3.0.4",
"@sanity/code-input": "^4.1.4",
"@sanity/document-internationalization": "^3.0.0",
"@sanity/eslint-config-studio": "^4.0.0",
"@sanity/language-filter": "^4.0.2",
"@sanity/vision": "^3.41.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-prettier": "^4.2.1",
"framer-motion": "^9.0.4",
"groq": "^3.4.0",
"prettier": "^2.7.1",
"react": "^18.2.0",
"react-archer": "^4.1.0",
"react-dom": "^18.2.0",
"react-icons": "^4.4.0",
"react-is": "^18.2.0",
"framer-motion": "^11.1.9",
"groq": "^3.41.1",
"prettier": "^2.8.8",
"react": "^18.3.1",
"react-archer": "^4.4.0",
"react-dom": "^18.3.1",
"react-icons": "^5.2.1",
"react-is": "^18.3.1",
"react-xarrows": "^2.0.2",
"sanity": "^3.29.1",
"sanity-plugin-documents-pane": "^2.0.0",
"sanity": "^3.41.1",
"sanity-plugin-documents-pane": "^2.3.0",
"sanity-plugin-google-translate": "^3.0.0",
"sanity-plugin-iframe-pane": "^2.0.0",
"sanity-plugin-internationalized-array": "^1.10.5",
"sanity-plugin-schema-visualizer": "^1.0.0",
"sanity-plugin-transifex": "^3.0.0",
"styled-components": "^5.2.0"
"sanity-plugin-iframe-pane": "^3.1.6",
"sanity-plugin-internationalized-array": "^2.0.0",
"sanity-plugin-schema-visualizer": "^1.1.1",
"sanity-plugin-transifex": "^4.0.0",
"styled-components": "^6.1.11"
},
"devDependencies": {
"@types/styled-components": "^5.1.26"
"@types/styled-components": "^5.1.34"
}
}
3 changes: 2 additions & 1 deletion studio/sanity.config.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Card} from '@sanity/ui'
import {buildLegacyTheme, defineConfig, isKeyedObject} from 'sanity'
import {defineConfig, isKeyedObject} from 'sanity'
import {structureTool} from 'sanity/structure'
import {assist} from '@sanity/assist'
import {visionTool} from '@sanity/vision'
Expand Down Expand Up @@ -92,6 +92,7 @@ export default defineConfig({
}),
],
schema: {
// @ts-expect-error
types: schemaTypes,
templates: (prev) => {
const prevFiltered = prev.filter((template) => template.id !== 'lesson')
Expand Down
2 changes: 1 addition & 1 deletion studio/schemas/objects/marketContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default defineType({
content: 'content',
market: 'market',
},
prepare({content, market}: {content: Block[]; market: string}) {
prepare({content, market}: {content: PortableTextTextBlock[]; market: string}) {
const title = blocksToText(content)

return {
Expand Down
1 change: 0 additions & 1 deletion studio/structure/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {FiAward, FiType, FiUsers} from 'react-icons/fi'
import {StructureResolver, DefaultDocumentNodeResolver} from 'sanity/structure'

import {i18n} from '../../languages'
import preview from './preview'
import references from './references'
import transifex from './transifex'

Expand Down
14 changes: 0 additions & 14 deletions studio/structure/preview.ts

This file was deleted.

3 changes: 2 additions & 1 deletion web/app/[language]/[course]/[lesson]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import {loadQuery} from '@/sanity/lib/store'
import {LABELS_QUERY, LESSON_QUERY} from '@/sanity/queries'

export async function generateStaticParams() {
const lessons = await getLessonsWithSlugs()
let lessons = await getLessonsWithSlugs()
lessons = Array.isArray(lessons) ? lessons : []

const params: {language: string; course: string; lesson: string}[] = lessons
.map((lesson) => ({
Expand Down
3 changes: 2 additions & 1 deletion web/app/[language]/[course]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export const metadata: Metadata = {

// Static params for every course, in every language
export async function generateStaticParams() {
const courses = await getCoursesWithSlugs()
let courses = await getCoursesWithSlugs()
courses = Array.isArray(courses) ? courses : []

const params: {language: string; course: string}[] = courses
.map((course) =>
Expand Down
16 changes: 8 additions & 8 deletions web/components/Callout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {CheckCircleIcon, ExclamationCircleIcon, XCircleIcon} from '@heroicons/react/24/outline'
// import {CheckCircleIcon, ExclamationCircleIcon, XCircleIcon} from '@heroicons/react/24/outline'
import {PortableText} from '@portabletext/react'
import React from 'react'

Expand All @@ -9,11 +9,11 @@ const toneClasses = {
error: 'border-red-500 bg-red-100 text-red-600 shadow-lg shadow-red-100',
}

const toneIcons = {
positive: CheckCircleIcon,
caution: ExclamationCircleIcon,
error: XCircleIcon,
}
// const toneIcons = {
// positive: CheckCircleIcon,
// caution: ExclamationCircleIcon,
// error: XCircleIcon,
// }

export default function Callout({tone = `positive`, content = []}) {
const classNames = [toneClasses.default, toneClasses[tone]].join(' ')
Expand All @@ -22,8 +22,8 @@ export default function Callout({tone = `positive`, content = []}) {
<div className={classNames}>
{/* {React.createElement(toneIcons[tone], {
className: `w-6 md:w-10 h-auto scale-150 transform -rotate-[10deg]`,
})}
<PortableText value={content} /> */}
})}*/}
<PortableText value={content} />
</div>
)
}
2 changes: 1 addition & 1 deletion web/components/Presenters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type PresentersProps = {
}

export default function Presenters(props: PresentersProps) {
const {presenters = []} = props
const presenters = Array.isArray(props.presenters) ? props.presenters : []

return (
<div className="mr-auto flex flex-col gap-y-4">
Expand Down
5 changes: 3 additions & 2 deletions web/components/VisualEditing.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-disable no-restricted-globals */
'use client'

import {enableOverlays, HistoryAdapterNavigate} from '@sanity/overlays'
import {useLiveMode} from '@sanity/react-loader'
import {enableVisualEditing, HistoryAdapterNavigate} from '@sanity/visual-editing'
import {usePathname, useRouter, useSearchParams} from 'next/navigation'
import {useEffect, useRef, useState} from 'react'

Expand All @@ -19,7 +20,7 @@ export default function VisualEditing() {
routerRef.current = router
}, [router])
useEffect(() => {
const disable = enableOverlays({
const disable = enableVisualEditing({
history: {
subscribe: (navigate) => {
setNavigate(() => navigate)
Expand Down
2 changes: 1 addition & 1 deletion web/lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function createLessonLinks(
// Each lesson must have a language
.filter((lesson) => lesson?.language)
.map((lesson) => {
const translations = lesson.translations
const translations = (lesson.translations ?? [])
.filter((ref) => ref?.slug?.current)
.map((ref) => {
const lessonLang = ref.language
Expand Down
Loading

0 comments on commit 7665b38

Please sign in to comment.