Skip to content

Commit

Permalink
Merge branch 'next' into sdx-1576-dev-server-stop-error-simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanl17 authored Sep 26, 2024
2 parents 6e54679 + 7aed0c0 commit aa4d272
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const myStringType = defineArrayMember({
})

export default defineType({
liveEdit: true,
name: 'simpleBlock',
title: 'Simple block',
type: 'document',
Expand Down
1 change: 1 addition & 0 deletions packages/@repo/package.bundle/src/package.bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const defaultConfig: UserConfig = {
plugins: [react(), tsconfigPaths()],
build: {
emptyOutDir: true,
sourcemap: true,
lib: {
entry: {},
formats: ['es'],
Expand Down
1 change: 0 additions & 1 deletion packages/@sanity/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"esbuild-register": "^3.5.0",
"get-it": "^8.6.5",
"groq-js": "^1.13.0",
"node-machine-id": "^1.1.12",
"pkg-dir": "^5.0.0",
"prettier": "^3.3.0",
"semver": "^7.3.5",
Expand Down
2 changes: 0 additions & 2 deletions packages/@sanity/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import path from 'node:path'

import chalk from 'chalk'
import dotenv from 'dotenv'
import {machineId} from 'node-machine-id'
import resolveFrom from 'resolve-from'

import {CliCommand} from './__telemetry__/cli.telemetry'
Expand Down Expand Up @@ -85,7 +84,6 @@ export async function runCli(cliRoot: string, {cliVersion}: {cliVersion: string}
)

telemetry.updateUserProperties({
deviceId: await machineId(),
runtimeVersion: process.version,
runtime: detectRuntime(),
cliVersion: pkg.version,
Expand Down
1 change: 0 additions & 1 deletion packages/@sanity/cli/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ export interface CliBaseCommandContext {
}

export interface TelemetryUserProperties {
deviceId: string
runtime: string
runtimeVersion: string
cliVersion: string
Expand Down
36 changes: 12 additions & 24 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions scripts/uploadBundles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ const corePkgs = ['sanity', '@sanity/vision'] as const

const appVersion = 'v1'

const mimeTypes: Record<string, string | undefined> = {
'.mjs': 'application/javascript',
'.map': 'application/json',
}

/**
* Replaces all slashes with double underscores
*/
Expand Down Expand Up @@ -60,16 +65,22 @@ async function copyPackages() {
packageVersions.set(pkg, version)

// Convert slashes to double underscores
// Needed for `@sanity/vision`
// Needed for `@sanity/vision` and other scoped packages
const cleanDir = cleanDirName(pkg)

for await (const filePath of getFiles(`packages/${pkg}/dist`)) {
try {
const fileName = path.basename(filePath)
const ext = path.extname(fileName)
const contentType = mimeTypes[ext]
if (!contentType) {
throw new Error(`Unknown content type for file ${filePath}`)
}

const options: UploadOptions = {
destination: `modules/${appVersion}/${cleanDir}/${version}/bare/${fileName}`,
gzip: true,
contentType: 'application/javascript',
contentType,
metadata: {
// 1 year cache
cacheControl: 'public, max-age=31536000, immutable',
Expand Down

0 comments on commit aa4d272

Please sign in to comment.