Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Bump glob to v10.x #7567

Open
wants to merge 8 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .github/workflows/efps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: eFPS Test
on:
pull_request:
workflow_dispatch:
inputs:
reference_tag:
description: "Reference tag for comparison"
required: true
default: "latest"
enable_profiler:
description: "Enable profiler"
required: true
type: boolean
default: false

jobs:
install:
timeout-minutes: 30
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18

- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
v1-${{ runner.os }}-pnpm-store-
v1-${{ runner.os }}-

- name: Install project dependencies
run: pnpm install

- name: Store Playwright's Version
run: |
PLAYWRIGHT_VERSION=$(npx playwright --version | sed 's/Version //')
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV

- name: Cache Playwright Browsers for Playwright's Version
id: cache-playwright-browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}

- name: Install Playwright Browsers
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: npx playwright install --with-deps

- name: Run eFPS tests
env:
VITE_PERF_EFPS_PROJECT_ID: ${{ secrets.PERF_EFPS_PROJECT_ID }}
VITE_PERF_EFPS_DATASET: ${{ secrets.PERF_EFPS_DATASET }}
PERF_EFPS_SANITY_TOKEN: ${{ secrets.PERF_EFPS_SANITY_TOKEN }}
REFERENCE_TAG: ${{ github.event.inputs.reference_tag || 'latest' }}
ENABLE_PROFILER: ${{ github.event.inputs.enable_profiler || false }}
run: pnpm efps:test

- name: PR comment with report
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2
if: ${{ github.event_name == 'pull_request' }}
with:
comment_tag: "efps-report"
filePath: ${{ github.workspace }}/perf/efps/results/benchmark-results.md

- uses: actions/upload-artifact@v3
if: always()
with:
name: efps-report
path: perf/efps/results
retention-days: 30
2 changes: 1 addition & 1 deletion dev/embedded-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "3.59.0",
"private": true,
"scripts": {
"build": "tsc && vite build",
"build": "tsc && vite build && sanity manifest extract",
"dev": "vite",
"preview": "vite preview"
},
Expand Down
8 changes: 8 additions & 0 deletions dev/embedded-studio/sanity.cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {defineCliConfig} from 'sanity/cli'

export default defineCliConfig({
api: {
projectId: 'ppsg7ml5',
dataset: 'test',
},
})
34 changes: 34 additions & 0 deletions dev/embedded-studio/sanity.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import {defineConfig, defineType} from 'sanity'
import {structureTool} from 'sanity/structure'

const BLOG_POST_SCHEMA = defineType({
type: 'document',
name: 'blogPost',
title: 'Blog post',
fields: [
{
type: 'string',
name: 'title',
title: 'Title',
},
],
})

export const SCHEMA_TYPES = [BLOG_POST_SCHEMA]

export default defineConfig({
projectId: 'ppsg7ml5',
dataset: 'test',

document: {
unstable_comments: {
enabled: true,
},
},

schema: {
types: SCHEMA_TYPES,
},

plugins: [structureTool()],
})
42 changes: 2 additions & 40 deletions dev/embedded-studio/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,46 +1,8 @@
import {Button, Card, Flex, studioTheme, ThemeProvider, usePrefersDark} from '@sanity/ui'
import {useCallback, useMemo, useState} from 'react'
import {
defineConfig,
defineType,
Studio,
StudioLayout,
StudioProvider,
type StudioThemeColorSchemeKey,
} from 'sanity'
import {structureTool} from 'sanity/structure'
import {Studio, StudioLayout, StudioProvider, type StudioThemeColorSchemeKey} from 'sanity'

const BLOG_POST_SCHEMA = defineType({
type: 'document',
name: 'blogPost',
title: 'Blog post',
fields: [
{
type: 'string',
name: 'title',
title: 'Title',
},
],
})

const SCHEMA_TYPES = [BLOG_POST_SCHEMA]

const config = defineConfig({
projectId: 'ppsg7ml5',
dataset: 'test',

document: {
unstable_comments: {
enabled: true,
},
},

schema: {
types: SCHEMA_TYPES,
},

plugins: [structureTool()],
})
import config from '../sanity.config'

export function App() {
const prefersDark = usePrefersDark()
Expand Down
3 changes: 3 additions & 0 deletions dev/starter-next-studio/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.next

public/static/*.create-schema.json
public/static/create-manifest.json
36 changes: 4 additions & 32 deletions dev/starter-next-studio/components/Studio.tsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,13 @@
import {useMemo} from 'react'
import {defineConfig, Studio} from 'sanity'
import {structureTool} from 'sanity/structure'
import {Studio} from 'sanity'

import config from '../sanity.config'

const wrapperStyles = {height: '100vh', width: '100vw'}

export default function StudioRoot({basePath}: {basePath: string}) {
const config = useMemo(
() =>
defineConfig({
basePath,
plugins: [structureTool()],
title: 'Next.js Starter',
projectId: 'ppsg7ml5',
dataset: 'test',
schema: {
types: [
{
type: 'document',
name: 'post',
title: 'Post',
fields: [
{
type: 'string',
name: 'title',
title: 'Title',
},
],
},
],
},
}),
[basePath],
)

return (
<div style={wrapperStyles}>
<Studio config={config} />
<Studio config={{...config, basePath}} />
</div>
)
}
2 changes: 1 addition & 1 deletion dev/starter-next-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MIT",
"author": "Sanity.io <[email protected]>",
"scripts": {
"build": "next build",
"build": "sanity manifest extract --path public/static && next build",
"dev": "next dev",
"start": "next start"
},
Expand Down
8 changes: 8 additions & 0 deletions dev/starter-next-studio/sanity.cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {defineCliConfig} from 'sanity/cli'

export default defineCliConfig({
api: {
projectId: 'ppsg7ml5',
dataset: 'test',
},
})
25 changes: 25 additions & 0 deletions dev/starter-next-studio/sanity.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {defineConfig} from 'sanity'
import {structureTool} from 'sanity/structure'

export default defineConfig({
plugins: [structureTool()],
title: 'Next.js Starter',
projectId: 'ppsg7ml5',
dataset: 'test',
schema: {
types: [
{
type: 'document',
name: 'post',
title: 'Post',
fields: [
{
type: 'string',
name: 'title',
title: 'Title',
},
],
},
],
},
})
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"e2e:setup": "node -r dotenv-flow/config -r esbuild-register scripts/e2e/setup",
"e2e:start": "pnpm --filter studio-e2e-testing preview",
"etl": "node -r dotenv-flow/config -r esbuild-register scripts/etl",
"efps:test": "cd perf/efps && pnpm test",
"example:blog-studio": "cd examples/blog-studio && pnpm start",
"example:clean-studio": "cd examples/blog-studio && pnpm start",
"example:ecommerce-studio": "cd examples/blog-studio && pnpm start",
Expand Down Expand Up @@ -115,7 +116,6 @@
"@sanity/tsdoc": "1.0.105",
"@sanity/ui": "^2.8.9",
"@sanity/uuid": "^3.0.2",
"@types/glob": "^7.2.0",
"@types/lodash": "^4.17.7",
"@types/node": "^18.19.8",
"@types/react": "^18.3.5",
Expand Down Expand Up @@ -147,7 +147,7 @@
"eslint-plugin-unicorn": "^52.0.0",
"eslint-plugin-unused-imports": "^3.2.0",
"execa": "^2.0.0",
"glob": "^7.2.0",
"glob": "^10.4.0",
"globby": "^10.0.0",
"husky": "^9.0.11",
"jest": "^29.7.0",
Expand Down
1 change: 1 addition & 0 deletions packages/@sanity/cli/src/util/noSuchCommandText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const coreCommands = [
'graphql',
'hook',
'migration',
'manifest',
'preview',
'schema',
'start',
Expand Down
5 changes: 5 additions & 0 deletions packages/sanity/package.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ export default defineConfig({
require: './lib/_internal/cli/threads/extractSchema.js',
runtime: 'node',
},
{
source: './src/_internal/cli/threads/extractManifest.ts',
require: './lib/_internal/cli/threads/extractManifest.js',
runtime: 'node',
},
],

extract: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export default async function buildSanityStudio(

spin.text = `Build Sanity Studio (${buildDuration.toFixed()}ms)`
spin.succeed()

trace.complete()
if (flags.stats) {
output.print('\nLargest module files:')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import tar from 'tar-fs'

import {shouldAutoUpdate} from '../../util/shouldAutoUpdate'
import buildSanityStudio, {type BuildSanityStudioCommandFlags} from '../build/buildAction'
import {extractManifestSafe} from '../manifest/extractManifestAction'
import {
checkDir,
createDeployment,
Expand Down Expand Up @@ -101,16 +102,25 @@ export default async function deployStudioAction(
// Always build the project, unless --no-build is passed
const shouldBuild = flags.build
if (shouldBuild) {
const buildArgs = [customSourceDir].filter(Boolean)
const {didCompile} = await buildSanityStudio(
{...args, extOptions: flags, argsWithoutOptions: buildArgs},
context,
{basePath: '/'},
)
const buildArgs = {
...args,
extOptions: flags,
argsWithoutOptions: [customSourceDir].filter(Boolean),
}
const {didCompile} = await buildSanityStudio(buildArgs, context, {basePath: '/'})

if (!didCompile) {
return
}

await extractManifestSafe(
{
...buildArgs,
extOptions: {},
extraArguments: [],
},
context,
)
}

// Ensure that the directory exists, is a directory and seems to have valid content
Expand Down
Loading
Loading