Skip to content

Commit

Permalink
chore: merge next into corel
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanl17 committed Dec 24, 2024
1 parent cd2d8ac commit 1adfcc8
Show file tree
Hide file tree
Showing 47 changed files with 472 additions and 503 deletions.
2 changes: 1 addition & 1 deletion dev/depcheck-test/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "depcheck-test",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"license": "MIT",
"author": "Sanity.io <[email protected]>"
Expand Down
4 changes: 2 additions & 2 deletions dev/design-studio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "design-studio",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"description": "Sanity Design Studio",
"keywords": [
Expand Down Expand Up @@ -31,7 +31,7 @@
"start": "../.bin/sanity start --port 4000"
},
"dependencies": {
"@sanity/icons": "^3.5.5",
"@sanity/icons": "^3.5.6",
"@sanity/ui": "^2.10.12",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
4 changes: 2 additions & 2 deletions dev/embedded-studio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "embedded-studio",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"scripts": {
"build": "tsc && vite build && sanity manifest extract",
Expand All @@ -15,7 +15,7 @@
"styled-components": "^6.1.0"
},
"devDependencies": {
"@types/react": "^18.3.17",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"@vitejs/plugin-react": "^4.3.4",
"typescript": "5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion dev/page-building-studio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sanity-page-building-studio",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"license": "MIT",
"author": "Sanity.io <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion dev/starter-next-studio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sanity-starter-next-studio",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"license": "MIT",
"author": "Sanity.io <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion dev/starter-studio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sanity-starter-studio",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"license": "MIT",
"author": "Sanity.io <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion dev/strict-studio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sanity-strict-studio",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"license": "MIT",
"author": "Sanity.io <[email protected]>",
Expand Down
6 changes: 3 additions & 3 deletions dev/studio-e2e-testing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "studio-e2e-testing",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"keywords": [
"sanity"
Expand All @@ -17,9 +17,9 @@
"dependencies": {
"@sanity/color-input": "^4.0.1",
"@sanity/google-maps-input": "^4.0.0",
"@sanity/icons": "^3.5.5",
"@sanity/icons": "^3.5.6",
"@sanity/ui": "^2.10.12",
"@sanity/vision": "3.68.1",
"@sanity/vision": "3.68.3",
"babel-plugin-react-compiler": "19.0.0-beta-201e55d-20241215",
"react": "^18.3.1",
"react-compiler-runtime": "19.0.0-beta-201e55d-20241215",
Expand Down
2 changes: 1 addition & 1 deletion dev/test-create-integration-studio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "test-create-integration-studio",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"license": "MIT",
"author": "Sanity.io <[email protected]>",
Expand Down
4 changes: 2 additions & 2 deletions dev/test-next-studio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sanity-test-next-studio",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"license": "MIT",
"author": "Sanity.io <[email protected]>",
Expand All @@ -13,7 +13,7 @@
"dependencies": {
"@sanity/vision": "workspace:*",
"babel-plugin-react-compiler": "19.0.0-beta-201e55d-20241215",
"next": "15.1.1",
"next": "15.1.2",
"react": "rc",
"react-dom": "rc",
"react-is": "rc",
Expand Down
10 changes: 5 additions & 5 deletions dev/test-studio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sanity-test-studio",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"license": "MIT",
"author": "Sanity.io <[email protected]>",
Expand All @@ -16,15 +16,15 @@
"workshop:dev": "node -r esbuild-register scripts/workshop/dev.ts"
},
"dependencies": {
"@portabletext/editor": "^1.16.3",
"@portabletext/editor": "^1.18.5",
"@portabletext/react": "^3.0.0",
"@sanity/assist": "^3.0.2",
"@sanity/block-tools": "3.68.1",
"@sanity/block-tools": "3.68.3",
"@sanity/client": "^6.24.1",
"@sanity/color": "^3.0.0",
"@sanity/color-input": "^4.0.1",
"@sanity/google-maps-input": "^4.0.0",
"@sanity/icons": "^3.5.5",
"@sanity/icons": "^3.5.6",
"@sanity/image-url": "^1.0.2",
"@sanity/locale-ko-kr": "^1.0.1",
"@sanity/locale-nb-no": "^1.0.1",
Expand All @@ -42,7 +42,7 @@
"@sanity/util": "workspace:*",
"@sanity/uuid": "^3.0.1",
"@sanity/vision": "workspace:*",
"@sanity/visual-editing": "2.10.10",
"@sanity/visual-editing": "2.11.3",
"@turf/helpers": "^6.0.1",
"@turf/points-within-polygon": "^5.1.5",
"@vercel/stega": "0.1.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/blog-studio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blog-studio",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"description": "Content studio running with schema from the blog init template",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion examples/clean-studio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clean-studio",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"description": "Content studio running with schema from the clean template",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions examples/ecommerce-studio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ecommerce-studio",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"description": "",
"keywords": [
Expand Down Expand Up @@ -29,7 +29,7 @@
"start": "sanity dev --port 3337"
},
"dependencies": {
"@sanity/cli": "3.68.1",
"@sanity/cli": "3.68.3",
"@sanity/ui": "^2.10.12",
"react": "^18.3.1",
"react-barcode": "^1.4.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/movies-studio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "movies-studio",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"description": "Content studio running with schema from the moviedb init template",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"packages/groq",
"packages/sanity"
],
"version": "3.68.1"
"version": "3.68.3"
}
2 changes: 1 addition & 1 deletion 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 --cache --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 27 .",
"check:react-compiler": "eslint --cache --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 26 .",
"report:react-compiler-bailout": "eslint --cache --no-inline-config --no-eslintrc --ext .cjs,.mjs,.js,.jsx,.ts,.tsx --parser @typescript-eslint/parser --plugin react-compiler --rule 'react-compiler/react-compiler: [error,{__unstable_donotuse_reportAllBailouts:true}]' --ignore-path .eslintignore.react-compiler -f ./scripts/reactCompilerBailouts.cjs . || true",
"check:test": "run-s test -- --silent",
"check:types": "tsc && turbo run check:types --filter='./packages/*' --filter='./packages/@sanity/*'",
Expand Down
2 changes: 1 addition & 1 deletion packages/@repo/dev-aliases/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@repo/dev-aliases",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"description": "Dev aliases for the sanity monorepo",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/@repo/package.bundle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@repo/package.bundle",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"description": "Shared package bundle configuration",
"main": "./src/package.bundle.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/@repo/package.config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@repo/package.config",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"description": "Shared @sanity/pkg-utils configuration",
"main": "./src/package.config.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/@repo/test-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@repo/test-config",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"description": "Test (as in unit test) config shared across packages in the sanity monorepo",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/@repo/test-exports/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@repo/test-exports",
"version": "3.68.1",
"version": "3.68.3",
"private": true,
"description": "Ensures that all the monorepo packages that are published works in native node ESM and CJS runtimes",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@repo/tsconfig/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@repo/tsconfig",
"version": "3.68.1",
"version": "3.68.3",
"private": true
}
6 changes: 3 additions & 3 deletions packages/@sanity/block-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sanity/block-tools",
"version": "3.68.1",
"version": "3.68.3",
"description": "Can format HTML, Slate JSON or Sanity block array into any other format.",
"keywords": [
"sanity",
Expand Down Expand Up @@ -49,15 +49,15 @@
"watch": "pkg-utils watch"
},
"dependencies": {
"@sanity/types": "3.68.1",
"@sanity/types": "3.68.3",
"@types/react": "^18.3.5",
"get-random-values-esm": "1.0.2",
"lodash": "^4.17.21"
},
"devDependencies": {
"@repo/package.config": "workspace:*",
"@repo/test-config": "workspace:*",
"@sanity/schema": "3.68.1",
"@sanity/schema": "3.68.3",
"@types/jsdom": "^20.0.0",
"@types/lodash": "^4.17.7",
"@vercel/stega": "0.1.2",
Expand Down
9 changes: 4 additions & 5 deletions packages/@sanity/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sanity/cli",
"version": "3.68.1",
"version": "3.68.3",
"description": "Sanity CLI tool for managing Sanity installations, managing plugins, schemas and datasets",
"keywords": [
"sanity",
Expand Down Expand Up @@ -58,10 +58,10 @@
"dependencies": {
"@babel/traverse": "^7.23.5",
"@sanity/client": "^6.24.1",
"@sanity/codegen": "3.68.1",
"@sanity/codegen": "3.68.3",
"@sanity/telemetry": "^0.7.7",
"@sanity/template-validator": "^1.0.2",
"@sanity/util": "3.68.1",
"@sanity/template-validator": "^1.2.1",
"@sanity/util": "3.68.3",
"chalk": "^4.1.2",
"debug": "^4.3.4",
"decompress": "^4.2.0",
Expand All @@ -72,7 +72,6 @@
"pkg-dir": "^5.0.0",
"prettier": "^3.3.0",
"semver": "^7.3.5",
"silver-fleece": "1.1.0",
"validate-npm-package-name": "^3.0.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {mkdir} from 'node:fs/promises'
import {join} from 'node:path'

import {getMonoRepo, GitHubFileReader, validateTemplate} from '@sanity/template-validator'
import {type Framework, frameworks} from '@vercel/frameworks'
import {detectFrameworkRecord, LocalFileSystemDetector} from '@vercel/fs-detectors'

Expand All @@ -12,11 +13,10 @@ import {
checkNeedsReadToken,
downloadAndExtractRepo,
generateSanityApiReadToken,
getPackages,
getGitHubRawContentUrl,
type RepoInfo,
setCorsOrigin,
tryApplyPackageName,
validateRemoteTemplate,
} from '../../util/remoteTemplate'
import {type GenerateConfigOptions} from './createStudioConfig'
import {tryGitInit} from './git'
Expand All @@ -39,11 +39,20 @@ export async function bootstrapRemoteTemplate(
const {outputPath, repoInfo, bearerToken, variables, packageName} = opts
const {output, apiClient} = context
const name = [repoInfo.username, repoInfo.name, repoInfo.filePath].filter(Boolean).join('/')
const contentsUrl = getGitHubRawContentUrl(repoInfo)
const headers: Record<string, string> = {}
if (bearerToken) {
headers.Authorization = `Bearer ${bearerToken}`
}
const spinner = output.spinner(`Bootstrapping files from template "${name}"`).start()

debug('Validating remote template')
const packages = await getPackages(repoInfo, bearerToken)
await validateRemoteTemplate(repoInfo, packages, bearerToken)
const fileReader = new GitHubFileReader(contentsUrl, headers)
const packages = await getMonoRepo(fileReader)
const validation = await validateTemplate(fileReader, packages)
if (!validation.isValid) {
throw new Error(validation.errors.join('\n'))
}

debug('Create new directory "%s"', outputPath)
await mkdir(outputPath, {recursive: true})
Expand Down
18 changes: 1 addition & 17 deletions packages/@sanity/cli/src/actions/init-project/initProject.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {existsSync, readFileSync} from 'node:fs'
import {existsSync} from 'node:fs'
import fs from 'node:fs/promises'
import path from 'node:path'

Expand All @@ -11,7 +11,6 @@ import {deburr, noop} from 'lodash'
import pFilter from 'p-filter'
import resolveFrom from 'resolve-from'
import semver from 'semver'
import {evaluate, patch} from 'silver-fleece'

import {CLIInitStepCompleted} from '../../__telemetry__/init.telemetry'
import {type InitFlags} from '../../commands/init/initCommand'
Expand Down Expand Up @@ -434,21 +433,6 @@ export default async function initSanity(

await writeSourceFiles(sanityFolder(useTypeScript, templateToUse), undefined, hasSrcFolder)

// set tsconfig.json target to ES2017
const tsConfigPath = path.join(workDir, 'tsconfig.json')

if (useTypeScript && existsSync(tsConfigPath)) {
const tsConfigFile = readFileSync(tsConfigPath, 'utf8')
const config = evaluate(tsConfigFile)

if (config.compilerOptions.target?.toLowerCase() !== 'es2017') {
config.compilerOptions.target = 'ES2017'

const newConfig = patch(tsConfigFile, config)
await fs.writeFile(tsConfigPath, Buffer.from(newConfig))
}
}

const appendEnv = unattended ? true : await promptForAppendEnv(prompt, envFilename)

if (appendEnv) {
Expand Down
Loading

0 comments on commit 1adfcc8

Please sign in to comment.