由 lulu 出售

A full-featured headless CMS studio with serverless functions, GROQ querying, AI integrations, and E2E testing — built for content teams and developers.
This block provides the internal monorepo tooling packages for Sanity Studio v5, including bundle management, ESLint configuration, release note automation, test configuration, and shared utilities. It is intended for teams maintaining or extending Sanity Studio itself, or building tightly integrated tooling on top of the Sanity Studio monorepo infrastructure.
@repo/bundle-manager/ - CLI and programmatic API for tagging versions and uploading Studio bundles to Sanity's CDN@repo/eslint-config/ - Shared flat ESLint configuration used across all packages in the monorepo@repo/package.bundle/ - Build tooling for bundling individual packages@repo/package.config/ - Shared package configuration utilities@repo/release-notes/ - Automation for drafting, publishing, and writing changelog/release note documents@repo/test-config/ - Shared Vitest configuration with aliases and sensible defaults for monorepo packages@repo/test-dts-exports/ - Type declaration export testing utilities@repo/test-exports/ - Runtime export testing utilities@repo/tsconfig/ - Shared TypeScript configuration base files@repo/utils/ - Shared runtime utilities (env vars, timers, ID helpers)@sanity/ - Sanity-specific packages (types, schema, diff, mutator, vision, etc.)groq/ - GROQ query language packagesanity/ - Core Sanity Studio packagenpm install user@example.com
npm install groq
npm install @sanity/client
npm install @sanity/types
npm install vitest
npm install typescript-eslint eslint @eslint/js eslint-config-prettier eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-import eslint-plugin-simple-import-sort eslint-plugin-unicorn eslint-plugin-unused-imports eslint-plugin-tsdoc eslint-plugin-oxlint eslint-config-sanity eslint-config-turbo eslint-import-resolver-typescript globals
No native build steps, pod installs, or Expo prebuild are required.
Copy the source/ directory into your repository root, e.g. as packages/ or alongside your existing packages.
Add path aliases to tsconfig.json so TypeScript resolves the monorepo packages:
启动隔离沙箱并在服务器端直接运行 — 无需本地配置。
此版本的 Tetrees AI Review
This TypeScript cli / script completed archive review. Structure, dependency manifests, documentation, functional source, and common risk patterns were checked by the Tetrees verification pipeline; runtime phases are stated separately.
Deterministic AVCP artifact review
管道 avcp-2026-08-04.1 · SHA-256 6a819e9b61e852fc…
This version-scoped review deterministically inspects the submitted archive for structure, dependencies, documentation, functional source, and common malicious or high-risk signals. Build and test phases are reported as passed only after an isolated sandbox audition. It is not a guarantee of perfect security.
审查日期 2026年8月4日
将此产品直接导入你的 AI IDE、网页构建器或云端 IDE。
将 Tetrees 连接到兼容的 AI IDE,列出你拥有的产品并获取已验证 ZIP,同时不会开放卖家上传权限。
暂无评价。
Sign in to join the discussion
Loading discussion…
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@repo/utils": ["packages/@repo/utils/src/index.ts"],
"@repo/bundle-manager": ["packages/@repo/bundle-manager/src/index.ts"],
"@repo/release-notes": ["packages/@repo/release-notes/src/index.ts"],
"sanity": ["packages/sanity/src/_exports"],
"groq": ["packages/groq/src/_exports.mts"]
}
}
}
SANITY_AUTH_TOKEN=<your-sanity-token>
GITHUB_TOKEN=<your-github-token>
vitest.config.ts:import {defineConfig} from './packages/@repo/test-config/vitest/index.mjs'
export default defineConfig({
test: {
include: ['src/**/*.test.ts'],
},
})
eslint.config.mjs:import sharedConfig from './packages/@repo/eslint-config/index.js'
export default [...sharedConfig]
import {tagVersion} from '@repo/bundle-manager'
function tagVersion(options: {
version: string
tag: string
dryRun?: boolean
}): Promise<void>
Tags a specific bundle version in Sanity's CDN manifest. Use this after a release is cut to associate a dist-tag (e.g. latest, next) with a specific uploaded version.
import {uploadBundles} from '@repo/bundle-manager'
function uploadBundles(options: {
version: string
buildDir: string
dryRun?: boolean
}): Promise<void>
Uploads compiled Studio bundle artifacts to Sanity's CDN. Call this as part of a CI release pipeline after building the Studio packages.
import {createOrUpdateChangelogDocs} from '@repo/release-notes'
function createOrUpdateChangelogDocs(options: {
version: string
releaseNotes: string
dryRun?: boolean
}): Promise<void>
Creates or updates changelog documentation for a release in the configured destination (e.g. Sanity dataset or GitHub). Use this in a post-release CI step to keep changelog documents in sync with published versions.
import {defineConfig} from '@repo/test-config/vitest/index.mjs'
function defineConfig(config?: UserConfig): UserConfig
Wraps Vitest's defineConfig with monorepo-standard defaults: disabled console interception, package path aliases, and typecheck/exclude presets. Use this in every package's vitest.config.ts to stay consistent.
import {readEnv} from '@repo/utils'
function readEnv(key: string): string
Reads a required environment variable by name, throwing if it is absent. Use instead of raw process.env access to get early, clear errors when configuration is missing.
A CI pipeline builds the Studio and then uses bundle-manager to upload artifacts and tag the release.
import {tagVersion, uploadBundles} from '@repo/bundle-manager'
import {readEnv} from '@repo/utils'
async function publishRelease(version: string) {
// Ensure required env is present
readEnv('SANITY_AUTH_TOKEN')
await uploadBundles({
version,
buildDir: './dist',
dryRun: process.env.DRY_RUN === 'true',
})
await tagVersion({
version,
tag: 'latest',
dryRun: process.env.DRY_RUN === 'true',
})
console.log(`Version ${version} uploaded and tagged as latest`)
}
publishRelease('5.24.0').catch(console.error)
After a release PR is merged, create or update changelog docs in the Sanity dataset.
import {createOrUpdateChangelogDocs} from '@repo/release-notes'
import {readEnv} from '@repo/utils'
async function updateChangelog(version: string, notes: string) {
readEnv('SANITY_AUTH_TOKEN')
readEnv('GITHUB_TOKEN')
await createOrUpdateChangelogDocs({
version,
releaseNotes: notes,
dryRun: false,
})
console.log(`Changelog docs updated for ${version}`)
}
updateChangelog('5.24.0', '## What changed\n- Fixed layout bug\n- Improved performance').catch(
console.error,
)
A package in the monorepo needs Vitest with additional exclusions and its own global setup.
// packages/my-package/vitest.config.ts
import {defineConfig} from '../../@repo/test-config/vitest/index.mjs'
export default defineConfig({
test: {
include: ['src/**/*.test.ts', 'src/**/*.spec.ts'],
exclude: ['src/**/__fixtures__/**'],
globals: true,
environment: 'node',
setupFiles: ['./test/setup.ts'],
},
})
@repo/bundle-manager/ - Provides tagVersion and uploadBundles commands for managing Studio CDN bundles; exposes a CLI via bin/bundle-manager.ts and a programmatic API via src/index.ts.@repo/eslint-config/ - Exports a flat ESLint config array combining TypeScript, React, import sorting, Prettier, and Turbo rules for use across all packages.@repo/package.bundle/ - Contains build tooling (src/package.bundle.ts) for bundling individual packages in the monorepo.@repo/package.config/ - Shared package configuration helpers used during build and publish steps.@repo/release-notes/ - Full automation suite for drafting GitHub release notes, writing changelog files, bumping versions, and publishing; exposes both a CLI and a programmatic API.@repo/test-config/ - Shared Vitest configuration factory with monorepo path aliases baked in.@repo/test-dts-exports/ - Utilities for validating that TypeScript declaration exports match what packages advertise.@repo/test-exports/ - Utilities for validating runtime exports of built packages.@repo/tsconfig/ - Base tsconfig.json files extended by all packages for consistent compiler settings.@repo/utils/ - Lightweight runtime helpers: readEnv, loadEnvFiles, sanityIdify, startTimer, MONOREPO_ROOT.@sanity/ - Collection of Sanity-specific packages (types, schema, diff, mutator, vision, etc.) used as peer dependencies throughout the Studio.groq/ - The GROQ query language package consumed by the Studio and user projects.sanity/ - The core Sanity Studio package, the primary consumer-facing entry point.SANITY_AUTH_TOKEN: readEnv throws immediately if the variable is absent; set it in .env or CI secrets before running any bundle-manager or release-notes commands.@repo/eslint-config: The config uses ES module syntax (import/export); your eslint.config.mjs must use .mjs extension or have "type": "module" in package.json.defineConfig from @repo/test-config automatically sets up aliases for sanity, groq, and @sanity/* packages pointing to src/; do not re-declare conflicting aliases or they will override these.dryRun defaulting to false: Both uploadBundles and tagVersion will execute real CDN writes unless dryRun: true is explicitly passed; always gate on an env var in CI pipelines.@repo/tsconfig: The shared tsconfig enables strict mode; consumer packages that extend it and use any casts will see errors; add explicit type annotations rather than suppressing with // @ts-ignore.eslint-plugin-oxlint; if your project does not have an .oxlintrc.json at the monorepo root, the plugin will warn; copy the root .oxlintrc.json from @repo/release-notes/ as a starting template.I have purchased the `user@example.com` source block. The source files are in `source/` and the integration guide is in `USAGE.md`.
Please help me integrate this into my existing Node.js/TypeScript project step by step:
1. Read `USAGE.md` fully before starting.
2. Copy the relevant packages from `source/` into my `packages/` directory.
3. Update my root `tsconfig.json` with the path aliases described in USAGE.md.
4. Wire the shared ESLint config from `source/@repo/eslint-config/index.js` into my `eslint.config.mjs`.
5. Wire the shared Vitest config from `source/@repo/test-config/vitest/index.mjs` into my `vitest.config.ts`.
6. Add a CI script that calls `uploadBundles` and `tagVersion` from `@repo/bundle-manager` after a successful build.
7. Add a post-release script that calls `createOrUpdateChangelogDocs` from `@repo/release-notes`.
8. Use `readEnv` from `@repo/utils` for all environment variable access.
9. Show me the final file tree and any `package.json` changes needed.
Only use exports that appear in USAGE.md. Do not invent any APIs.
See source/LICENSE if present. This block is derived from the sanity ecosystem published by Sanity.io. The upstream package is user@example.com. Refer to the Sanity Studio repository and its LICENSE file for the authoritative license terms.
This product’s unique contribution is clean room implementation of valuable code block into AVCP compatible standard.
完整安装指南与集成提示词将在购买后解锁。
Automation, Utilities & Developer Tools
免费