@sanity/cli 6.7.1 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -78,7 +78,6 @@ import { getAppEnvironmentVariables, getStudioEnvironmentVariables } from './get
|
|
|
78
78
|
const filePath = rawFilePath.startsWith('\u0000') ? rawFilePath.slice('\u0000'.length) : rawFilePath;
|
|
79
79
|
return {
|
|
80
80
|
name: path.isAbsolute(filePath) ? path.relative(cwd, filePath) : filePath,
|
|
81
|
-
originalLength: chunkModule.originalLength,
|
|
82
81
|
renderedLength: chunkModule.renderedLength
|
|
83
82
|
};
|
|
84
83
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/actions/build/buildStaticFiles.ts"],"sourcesContent":["import path from 'node:path'\n\nimport {\n buildDebug,\n copyDir,\n extendViteConfigWithUserConfig,\n finalizeViteConfig,\n getViteConfig,\n writeFavicons,\n writeSanityRuntime,\n} from '@sanity/cli-build/_internal/build'\nimport {type CliConfig, type UserViteConfig} from '@sanity/cli-core'\nimport {type PluginOptions as ReactCompilerConfig} from 'babel-plugin-react-compiler'\nimport {build} from 'vite'\n\nimport {\n getAppEnvironmentVariables,\n getStudioEnvironmentVariables,\n} from './getEnvironmentVariables.js'\n\nexport interface ChunkModule {\n name: string\n
|
|
1
|
+
{"version":3,"sources":["../../../src/actions/build/buildStaticFiles.ts"],"sourcesContent":["import path from 'node:path'\n\nimport {\n buildDebug,\n copyDir,\n extendViteConfigWithUserConfig,\n finalizeViteConfig,\n getViteConfig,\n writeFavicons,\n writeSanityRuntime,\n} from '@sanity/cli-build/_internal/build'\nimport {type CliConfig, type UserViteConfig} from '@sanity/cli-core'\nimport {type PluginOptions as ReactCompilerConfig} from 'babel-plugin-react-compiler'\nimport {build} from 'vite'\n\nimport {\n getAppEnvironmentVariables,\n getStudioEnvironmentVariables,\n} from './getEnvironmentVariables.js'\n\nexport interface ChunkModule {\n name: string\n renderedLength: number\n}\n\nexport interface ChunkStats {\n modules: ChunkModule[]\n name: string\n}\n\ninterface StaticBuildOptions {\n basePath: string\n cwd: string\n outputDir: string\n\n appTitle?: string\n autoUpdatesCssUrls?: string[]\n entry?: string\n importMap?: {imports?: Record<string, string>}\n isApp?: boolean\n minify?: boolean\n profile?: boolean\n reactCompiler?: ReactCompilerConfig\n schemaExtraction?: CliConfig['schemaExtraction']\n sourceMap?: boolean\n vite?: UserViteConfig\n}\n\n/**\n * Builds static files\n *\n * @internal\n */\nexport async function buildStaticFiles(\n options: StaticBuildOptions,\n): Promise<{chunks: ChunkStats[]}> {\n const {\n appTitle,\n autoUpdatesCssUrls,\n basePath,\n cwd,\n entry,\n importMap,\n isApp,\n minify = true,\n outputDir,\n reactCompiler,\n schemaExtraction,\n sourceMap = false,\n vite: extendViteConfig,\n } = options\n\n buildDebug('Writing Sanity runtime files')\n await writeSanityRuntime({\n appTitle,\n basePath,\n cwd,\n entry,\n isApp,\n reactStrictMode: false,\n watch: false,\n })\n\n function getEnvironmentVariables() {\n return isApp\n ? getAppEnvironmentVariables({jsonEncode: true, prefix: 'process.env.'})\n : getStudioEnvironmentVariables({jsonEncode: true, prefix: 'process.env.'})\n }\n\n buildDebug('Resolving vite config')\n const mode = 'production'\n let viteConfig = await getViteConfig({\n autoUpdatesCssUrls,\n basePath,\n cwd,\n getEnvironmentVariables,\n importMap,\n isApp,\n minify,\n mode,\n outputDir,\n reactCompiler,\n schemaExtraction,\n sourceMap,\n })\n\n if (extendViteConfig) {\n viteConfig = await extendViteConfigWithUserConfig(\n {command: 'build', mode},\n viteConfig,\n extendViteConfig,\n )\n viteConfig = await finalizeViteConfig(viteConfig)\n }\n\n const fromPath = path.join(cwd, 'static')\n // Copy files placed in /static to the built /static\n buildDebug(`Copying static files from ${fromPath} to output dir`)\n const staticPath = path.join(outputDir, 'static')\n await copyDir(fromPath, staticPath)\n\n // Write favicons, not overwriting ones that already exist, to static folder\n buildDebug('Writing favicons to output dir')\n const faviconBasePath = `${basePath.replace(/\\/+$/, '')}/static`\n await writeFavicons(faviconBasePath, staticPath)\n\n buildDebug('Bundling using vite')\n const bundle = await build(viteConfig)\n buildDebug('Bundling complete')\n\n // For typescript only - this shouldn't ever be the case given we're not watching\n if (Array.isArray(bundle) || !('output' in bundle)) {\n return {chunks: []}\n }\n\n const stats: ChunkStats[] = []\n for (const chunk of bundle.output) {\n if (chunk.type !== 'chunk') {\n continue\n }\n\n stats.push({\n modules: Object.entries(chunk.modules).map(([rawFilePath, chunkModule]) => {\n const filePath = rawFilePath.startsWith('\\u0000')\n ? rawFilePath.slice('\\u0000'.length)\n : rawFilePath\n\n return {\n name: path.isAbsolute(filePath) ? path.relative(cwd, filePath) : filePath,\n renderedLength: chunkModule.renderedLength,\n }\n }),\n name: chunk.name,\n })\n }\n\n return {chunks: stats}\n}\n"],"names":["path","buildDebug","copyDir","extendViteConfigWithUserConfig","finalizeViteConfig","getViteConfig","writeFavicons","writeSanityRuntime","build","getAppEnvironmentVariables","getStudioEnvironmentVariables","buildStaticFiles","options","appTitle","autoUpdatesCssUrls","basePath","cwd","entry","importMap","isApp","minify","outputDir","reactCompiler","schemaExtraction","sourceMap","vite","extendViteConfig","reactStrictMode","watch","getEnvironmentVariables","jsonEncode","prefix","mode","viteConfig","command","fromPath","join","staticPath","faviconBasePath","replace","bundle","Array","isArray","chunks","stats","chunk","output","type","push","modules","Object","entries","map","rawFilePath","chunkModule","filePath","startsWith","slice","length","name","isAbsolute","relative","renderedLength"],"mappings":"AAAA,OAAOA,UAAU,YAAW;AAE5B,SACEC,UAAU,EACVC,OAAO,EACPC,8BAA8B,EAC9BC,kBAAkB,EAClBC,aAAa,EACbC,aAAa,EACbC,kBAAkB,QACb,oCAAmC;AAG1C,SAAQC,KAAK,QAAO,OAAM;AAE1B,SACEC,0BAA0B,EAC1BC,6BAA6B,QACxB,+BAA8B;AA8BrC;;;;CAIC,GACD,OAAO,eAAeC,iBACpBC,OAA2B;IAE3B,MAAM,EACJC,Q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,QAAsB,EAAE;IAC9B,KAAK,MAAMC,SAASL,OAAOM,MAAM,CAAE;QACjC,IAAID,MAAME,IAAI,KAAK,SAAS;YAC1B;QACF;QAEAH,MAAMI,IAAI,CAAC;YACTC,SAASC,OAAOC,OAAO,CAACN,MAAMI,OAAO,EAAEG,GAAG,CAAC,CAAC,CAACC,aAAaC,YAAY;gBACpE,MAAMC,WAAWF,YAAYG,UAAU,CAAC,YACpCH,YAAYI,KAAK,CAAC,SAASC,MAAM,IACjCL;gBAEJ,OAAO;oBACLM,MAAM3D,KAAK4D,UAAU,CAACL,YAAYvD,KAAK6D,QAAQ,CAAC7C,KAAKuC,YAAYA;oBACjEO,gBAAgBR,YAAYQ,cAAc;gBAC5C;YACF;YACAH,MAAMd,MAAMc,IAAI;QAClB;IACF;IAEA,OAAO;QAAChB,QAAQC;IAAK;AACvB"}
|
package/oclif.manifest.json
CHANGED
|
@@ -313,6 +313,7 @@
|
|
|
313
313
|
"args": {
|
|
314
314
|
"checks": {
|
|
315
315
|
"description": "Checks to enable (defaults to all). Valid: cli",
|
|
316
|
+
"multiple": true,
|
|
316
317
|
"name": "checks",
|
|
317
318
|
"required": false
|
|
318
319
|
}
|
|
@@ -749,6 +750,7 @@
|
|
|
749
750
|
"args": {
|
|
750
751
|
"packages": {
|
|
751
752
|
"description": "Packages to install",
|
|
753
|
+
"multiple": true,
|
|
752
754
|
"name": "packages",
|
|
753
755
|
"required": false
|
|
754
756
|
}
|
|
@@ -5114,5 +5116,5 @@
|
|
|
5114
5116
|
]
|
|
5115
5117
|
}
|
|
5116
5118
|
},
|
|
5117
|
-
"version": "
|
|
5119
|
+
"version": "7.0.0"
|
|
5118
5120
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Sanity CLI tool for managing Sanity projects and organizations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -51,22 +51,22 @@
|
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@oclif/core": "^4.11.
|
|
55
|
-
"@oclif/plugin-help": "^6.2.
|
|
56
|
-
"@oclif/plugin-not-found": "^3.2.
|
|
57
|
-
"@sanity/client": "^7.22.
|
|
58
|
-
"@sanity/codegen": "^6.1.
|
|
54
|
+
"@oclif/core": "^4.11.4",
|
|
55
|
+
"@oclif/plugin-help": "^6.2.50",
|
|
56
|
+
"@oclif/plugin-not-found": "^3.2.87",
|
|
57
|
+
"@sanity/client": "^7.22.1",
|
|
58
|
+
"@sanity/codegen": "^6.1.1",
|
|
59
59
|
"@sanity/descriptors": "^1.3.0",
|
|
60
60
|
"@sanity/export": "^6.2.0",
|
|
61
61
|
"@sanity/generate-help-url": "^4.0.0",
|
|
62
62
|
"@sanity/id-utils": "^1.0.0",
|
|
63
|
-
"@sanity/import": "^6.0.
|
|
63
|
+
"@sanity/import": "^6.0.2",
|
|
64
64
|
"@sanity/migrate": "^6.1.2",
|
|
65
|
-
"@sanity/runtime-cli": "^15.1.
|
|
66
|
-
"@sanity/schema": "^5.
|
|
67
|
-
"@sanity/telemetry": "^
|
|
65
|
+
"@sanity/runtime-cli": "^15.1.3",
|
|
66
|
+
"@sanity/schema": "^5.30.0",
|
|
67
|
+
"@sanity/telemetry": "^1.1.0",
|
|
68
68
|
"@sanity/template-validator": "^3.1.0",
|
|
69
|
-
"@sanity/types": "^5.
|
|
69
|
+
"@sanity/types": "^5.30.0",
|
|
70
70
|
"@sanity/worker-channels": "^2.0.0",
|
|
71
71
|
"@vercel/frameworks": "3.21.1",
|
|
72
72
|
"chokidar": "^5.0.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"execa": "^9.6.0",
|
|
79
79
|
"form-data": "^4.0.5",
|
|
80
80
|
"get-latest-version": "^6.0.1",
|
|
81
|
-
"groq-js": "^1.30.
|
|
81
|
+
"groq-js": "^1.30.2",
|
|
82
82
|
"gunzip-maybe": "^1.4.2",
|
|
83
83
|
"import-meta-resolve": "^4.2.0",
|
|
84
84
|
"is-installed-globally": "^1.0.0",
|
|
@@ -97,9 +97,9 @@
|
|
|
97
97
|
"pluralize-esm": "^9.0.5",
|
|
98
98
|
"pretty-ms": "^9.3.0",
|
|
99
99
|
"promise-props-recursive": "^2.0.2",
|
|
100
|
-
"react": "^19.2.
|
|
101
|
-
"react-dom": "^19.2.
|
|
102
|
-
"react-is": "^19.2.
|
|
100
|
+
"react": "^19.2.6",
|
|
101
|
+
"react-dom": "^19.2.6",
|
|
102
|
+
"react-is": "^19.2.6",
|
|
103
103
|
"rxjs": "^7.8.2",
|
|
104
104
|
"semver": "^7.7.4",
|
|
105
105
|
"skills": "^1.5.7",
|
|
@@ -108,18 +108,18 @@
|
|
|
108
108
|
"tar-fs": "^3.1.2",
|
|
109
109
|
"tar-stream": "^3.1.8",
|
|
110
110
|
"tinyglobby": "^0.2.16",
|
|
111
|
-
"tsx": "^4.
|
|
111
|
+
"tsx": "^4.22.4",
|
|
112
112
|
"typeid-js": "^1.2.0",
|
|
113
|
-
"vite": "^
|
|
113
|
+
"vite": "^8.0.16",
|
|
114
114
|
"which": "^6.0.1",
|
|
115
115
|
"yaml": "^2.8.4",
|
|
116
116
|
"zod": "^4.3.6",
|
|
117
|
-
"@sanity/cli-build": "^0.
|
|
118
|
-
"@sanity/cli-core": "^
|
|
117
|
+
"@sanity/cli-build": "^1.0.0",
|
|
118
|
+
"@sanity/cli-core": "^2.0.0"
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
121
121
|
"@eslint/compat": "^2.0.5",
|
|
122
|
-
"@sanity/pkg-utils": "^10.
|
|
122
|
+
"@sanity/pkg-utils": "^10.5.2",
|
|
123
123
|
"@sanity/ui": "^3.2.0",
|
|
124
124
|
"@swc/cli": "^0.8.1",
|
|
125
125
|
"@swc/core": "^1.15.33",
|
|
@@ -130,30 +130,37 @@
|
|
|
130
130
|
"@types/minimist": "^1.2.5",
|
|
131
131
|
"@types/node": "^20.19.41",
|
|
132
132
|
"@types/picomatch": "^4.0.3",
|
|
133
|
-
"@types/react": "^19.2.
|
|
133
|
+
"@types/react": "^19.2.16",
|
|
134
134
|
"@types/react-dom": "^19.2.3",
|
|
135
135
|
"@types/react-is": "^19.2.0",
|
|
136
136
|
"@types/semver": "^7.7.1",
|
|
137
137
|
"@types/tar-fs": "^2.0.4",
|
|
138
138
|
"@types/tar-stream": "^3.1.4",
|
|
139
139
|
"@types/which": "^3.0.4",
|
|
140
|
-
"@vitest/coverage-istanbul": "^4.1.
|
|
140
|
+
"@vitest/coverage-istanbul": "^4.1.8",
|
|
141
141
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
142
142
|
"eslint": "^10.2.1",
|
|
143
143
|
"jsdom": "^29.1.1",
|
|
144
|
-
"nock": "^14.0.
|
|
145
|
-
"oclif": "^4.23.
|
|
146
|
-
"publint": "^0.3.
|
|
144
|
+
"nock": "^14.0.15",
|
|
145
|
+
"oclif": "^4.23.10",
|
|
146
|
+
"publint": "^0.3.21",
|
|
147
147
|
"rimraf": "^6.0.1",
|
|
148
|
-
"sanity": "^5.
|
|
148
|
+
"sanity": "^5.30.0",
|
|
149
149
|
"typescript": "^5.9.3",
|
|
150
|
-
"
|
|
151
|
-
"vitest": "^4.1.5",
|
|
152
|
-
"@repo/package.config": "0.0.1",
|
|
150
|
+
"vitest": "^4.1.8",
|
|
153
151
|
"@repo/tsconfig": "3.70.0",
|
|
154
|
-
"@
|
|
152
|
+
"@repo/package.config": "0.0.1",
|
|
153
|
+
"@sanity/cli-test": "1.0.0",
|
|
155
154
|
"@sanity/eslint-config-cli": "1.1.1"
|
|
156
155
|
},
|
|
156
|
+
"peerDependencies": {
|
|
157
|
+
"babel-plugin-react-compiler": "*"
|
|
158
|
+
},
|
|
159
|
+
"peerDependenciesMeta": {
|
|
160
|
+
"babel-plugin-react-compiler": {
|
|
161
|
+
"optional": true
|
|
162
|
+
}
|
|
163
|
+
},
|
|
157
164
|
"engines": {
|
|
158
165
|
"node": ">=20.19.1 <22 || >=22.12"
|
|
159
166
|
},
|