@sanity/plugin-kit 3.1.7 → 3.1.8
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.
- package/assets/inject/semver-workflow/.github/workflows/main.yml +13 -10
- package/dist/_chunks/{cli-7e8e9944.js → cli-1ce85141.js} +7 -7
- package/dist/_chunks/cli-1ce85141.js.map +1 -0
- package/dist/_chunks/{init-09ede150.js → init-421e0ef6.js} +4 -4
- package/dist/_chunks/init-421e0ef6.js.map +1 -0
- package/dist/_chunks/{init-2e964d91.js → init-7720227c.js} +5 -5
- package/dist/_chunks/init-7720227c.js.map +1 -0
- package/dist/_chunks/{inject-998410a7.js → inject-445cd51e.js} +4 -4
- package/dist/_chunks/{inject-998410a7.js.map → inject-445cd51e.js.map} +1 -1
- package/dist/_chunks/{link-watch-aff484af.js → link-watch-5f7a51e1.js} +4 -4
- package/dist/_chunks/link-watch-5f7a51e1.js.map +1 -0
- package/dist/_chunks/{package-a73ac254.js → package-179a4767.js} +3 -3
- package/dist/_chunks/package-179a4767.js.map +1 -0
- package/dist/_chunks/{package-9a9abcc4.js → package-3fb8d98c.js} +26 -21
- package/dist/_chunks/{package-9a9abcc4.js.map → package-3fb8d98c.js.map} +1 -1
- package/dist/_chunks/{ts-01bd6fdc.js → ts-7864bea1.js} +3 -3
- package/dist/_chunks/ts-7864bea1.js.map +1 -0
- package/dist/_chunks/{verify-package-8b8b38d4.js → verify-package-42e90251.js} +4 -4
- package/dist/_chunks/verify-package-42e90251.js.map +1 -0
- package/dist/_chunks/{verify-studio-541170dd.js → verify-studio-321d7af6.js} +4 -4
- package/dist/_chunks/verify-studio-321d7af6.js.map +1 -0
- package/dist/_chunks/{version-acdf225d.js → version-af10f730.js} +3 -3
- package/dist/_chunks/version-af10f730.js.map +1 -0
- package/dist/cli.js +1 -1
- package/package.json +24 -20
- package/src/actions/inject.ts +4 -4
- package/src/actions/link-watch.ts +2 -2
- package/src/actions/verify/types.ts +1 -1
- package/src/actions/verify/validations.ts +13 -13
- package/src/actions/verify/verify-common.ts +4 -4
- package/src/actions/verify-package.ts +6 -6
- package/src/actions/verify-studio.ts +3 -3
- package/src/cli.ts +1 -1
- package/src/cmds/init.ts +2 -2
- package/src/cmds/inject.ts +1 -1
- package/src/cmds/version.ts +1 -1
- package/src/npm/package.ts +12 -12
- package/src/npm/publish.ts +1 -1
- package/src/npm/resolveLatestVersions.ts +1 -1
- package/src/presets/presets.ts +2 -2
- package/src/presets/renovatebot.ts +1 -1
- package/src/presets/semver-workflow.ts +3 -3
- package/src/presets/ui-workshop.ts +2 -2
- package/src/presets/ui.ts +4 -4
- package/src/sanity/manifest.ts +18 -18
- package/src/util/files.ts +4 -4
- package/src/util/prompt.ts +1 -1
- package/src/util/user.ts +2 -2
- package/dist/_chunks/cli-7e8e9944.js.map +0 -1
- package/dist/_chunks/init-09ede150.js.map +0 -1
- package/dist/_chunks/init-2e964d91.js.map +0 -1
- package/dist/_chunks/link-watch-aff484af.js.map +0 -1
- package/dist/_chunks/package-a73ac254.js.map +0 -1
- package/dist/_chunks/ts-01bd6fdc.js.map +0 -1
- package/dist/_chunks/verify-package-8b8b38d4.js.map +0 -1
- package/dist/_chunks/verify-studio-541170dd.js.map +0 -1
- package/dist/_chunks/version-acdf225d.js.map +0 -1
package/src/npm/package.ts
CHANGED
|
@@ -54,7 +54,7 @@ export async function getPackage(opts: ManifestOptions): Promise<PackageJson> {
|
|
|
54
54
|
} catch (err: any) {
|
|
55
55
|
if (err.code === 'ENOENT') {
|
|
56
56
|
throw new Error(
|
|
57
|
-
`No package.json found. package.json is required to publish to npm. Use \`${cliName} init\` for a new plugin, or \`npm init\` for an existing one
|
|
57
|
+
`No package.json found. package.json is required to publish to npm. Use \`${cliName} init\` for a new plugin, or \`npm init\` for an existing one`,
|
|
58
58
|
)
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -113,7 +113,7 @@ function validatePackageName(manifest: PackageJson) {
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
const valid: {validForNewPackages?: boolean; errors: string[]} = validateNpmPackageName(
|
|
116
|
-
manifest.name
|
|
116
|
+
manifest.name,
|
|
117
117
|
)
|
|
118
118
|
if (!valid.validForNewPackages) {
|
|
119
119
|
throw new Error(`Invalid package.json: "name" is invalid: ${valid.errors.join(', ')}`)
|
|
@@ -122,7 +122,7 @@ function validatePackageName(manifest: PackageJson) {
|
|
|
122
122
|
const isScoped = manifest.name[0] === '@'
|
|
123
123
|
if (!isScoped && !manifest.name.startsWith('sanity-plugin-')) {
|
|
124
124
|
throw new Error(
|
|
125
|
-
`Invalid package.json: "name" should be prefixed with "sanity-plugin-" (or scoped - @your-company/plugin-name)
|
|
125
|
+
`Invalid package.json: "name" should be prefixed with "sanity-plugin-" (or scoped - @your-company/plugin-name)`,
|
|
126
126
|
)
|
|
127
127
|
}
|
|
128
128
|
}
|
|
@@ -157,7 +157,7 @@ async function validatePaths(manifest: PackageJson, options: ManifestOptions) {
|
|
|
157
157
|
// instead we want to target `./dist/MyComponent.js` which is the location it'll be compiled to
|
|
158
158
|
if (!options?.flags?.allowSourceTarget && paths && withinSourceDir(manifestValue)) {
|
|
159
159
|
throw new Error(
|
|
160
|
-
`Invalid package.json: "${key}" points to file within source (uncompiled) directory. Use --allow-source-target if you really want to do this
|
|
160
|
+
`Invalid package.json: "${key}" points to file within source (uncompiled) directory. Use --allow-source-target if you really want to do this.`,
|
|
161
161
|
)
|
|
162
162
|
}
|
|
163
163
|
|
|
@@ -171,7 +171,7 @@ async function validatePaths(manifest: PackageJson, options: ManifestOptions) {
|
|
|
171
171
|
!(await willExist(manifestValue))
|
|
172
172
|
) {
|
|
173
173
|
throw new Error(
|
|
174
|
-
`Invalid package.json: "${key}" points to file that will not exist after compiling
|
|
174
|
+
`Invalid package.json: "${key}" points to file that will not exist after compiling`,
|
|
175
175
|
)
|
|
176
176
|
}
|
|
177
177
|
|
|
@@ -185,7 +185,7 @@ async function validatePaths(manifest: PackageJson, options: ManifestOptions) {
|
|
|
185
185
|
throw new Error(
|
|
186
186
|
inOutDir
|
|
187
187
|
? `Invalid package.json: "${key}" points to file that does not exist, and "paths" is not configured to compile to this location`
|
|
188
|
-
: `Invalid package.json: "${key}" points to file that does not exist, and no equivalent is found in source directory
|
|
188
|
+
: `Invalid package.json: "${key}" points to file that does not exist, and no equivalent is found in source directory`,
|
|
189
189
|
)
|
|
190
190
|
}
|
|
191
191
|
}
|
|
@@ -237,7 +237,7 @@ export async function writePackageJson(data: PackageData, options: InjectOptions
|
|
|
237
237
|
'eslint',
|
|
238
238
|
'eslint-config-sanity',
|
|
239
239
|
'eslint-plugin-react',
|
|
240
|
-
'eslint-plugin-react-hooks'
|
|
240
|
+
'eslint-plugin-react-hooks',
|
|
241
241
|
)
|
|
242
242
|
|
|
243
243
|
if (usePrettier) {
|
|
@@ -256,7 +256,7 @@ export async function writePackageJson(data: PackageData, options: InjectOptions
|
|
|
256
256
|
...(addDeps || {}),
|
|
257
257
|
...(await resolveLatestVersions(defaultDependencies)),
|
|
258
258
|
},
|
|
259
|
-
forcedPackageVersions
|
|
259
|
+
forcedPackageVersions,
|
|
260
260
|
)
|
|
261
261
|
const devDependencies = forceDependencyVersions(
|
|
262
262
|
{
|
|
@@ -264,7 +264,7 @@ export async function writePackageJson(data: PackageData, options: InjectOptions
|
|
|
264
264
|
...(prev.devDependencies || {}),
|
|
265
265
|
...(await resolveLatestVersions([...newDevDependencies, ...defaultDevDependencies])),
|
|
266
266
|
},
|
|
267
|
-
forcedDevPackageVersions
|
|
267
|
+
forcedDevPackageVersions,
|
|
268
268
|
)
|
|
269
269
|
const peerDependencies = forceDependencyVersions(
|
|
270
270
|
{
|
|
@@ -272,7 +272,7 @@ export async function writePackageJson(data: PackageData, options: InjectOptions
|
|
|
272
272
|
...(addPeers || {}),
|
|
273
273
|
...(await resolveLatestVersions(defaultPeerDependencies)),
|
|
274
274
|
},
|
|
275
|
-
forcedPeerPackageVersions
|
|
275
|
+
forcedPeerPackageVersions,
|
|
276
276
|
)
|
|
277
277
|
|
|
278
278
|
const source = flags.typescript ? './src/index.ts' : './src/index.js'
|
|
@@ -375,7 +375,7 @@ export function addScript(cmd: string, existing: string) {
|
|
|
375
375
|
export async function addPackageJsonScripts(
|
|
376
376
|
manifest: PackageJson,
|
|
377
377
|
options: InjectOptions,
|
|
378
|
-
updateScripts: (currentScripts: Record<string, string>) => Record<string, string
|
|
378
|
+
updateScripts: (currentScripts: Record<string, string>) => Record<string, string>,
|
|
379
379
|
) {
|
|
380
380
|
const originalScripts = manifest.scripts || {}
|
|
381
381
|
const scripts = updateScripts({...originalScripts})
|
|
@@ -424,7 +424,7 @@ export function sortKeys<T extends Record<string, unknown>>(unordered: T): T {
|
|
|
424
424
|
/** @internal */
|
|
425
425
|
export function forceDependencyVersions(
|
|
426
426
|
deps: Record<string, string>,
|
|
427
|
-
versions = forcedPackageVersions
|
|
427
|
+
versions = forcedPackageVersions,
|
|
428
428
|
): Record<string, string> {
|
|
429
429
|
const entries = Object.entries(deps).map((entry) => {
|
|
430
430
|
const [pkg] = entry
|
package/src/npm/publish.ts
CHANGED
package/src/presets/presets.ts
CHANGED
|
@@ -38,8 +38,8 @@ function presetsFromInput(inputPresets: string[] | undefined): Preset[] {
|
|
|
38
38
|
if (unknownPresets.length) {
|
|
39
39
|
throw new Error(
|
|
40
40
|
`Unknown --preset(s): [${unknownPresets.join(', ')}]. Must be one of: [${presetNames.join(
|
|
41
|
-
', '
|
|
42
|
-
)}]
|
|
41
|
+
', ',
|
|
42
|
+
)}]`,
|
|
43
43
|
)
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -67,8 +67,8 @@ async function addDevDependencies(options: InjectOptions) {
|
|
|
67
67
|
Please confer
|
|
68
68
|
https://github.com/sanity-io/plugin-kit/blob/main/docs/semver-workflow.md#manual-steps-after-inject
|
|
69
69
|
to finalize configuration for this preset.
|
|
70
|
-
`.trim()
|
|
71
|
-
)
|
|
70
|
+
`.trim(),
|
|
71
|
+
),
|
|
72
72
|
)
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -79,7 +79,7 @@ async function updateReadme(options: InjectOptions) {
|
|
|
79
79
|
const readme = (await readFile(readmePath, 'utf8').catch(errorToUndefined)) ?? ''
|
|
80
80
|
|
|
81
81
|
const {v3Banner, install, usage, developTest, license, releaseSnippet} = await readmeSnippets(
|
|
82
|
-
options
|
|
82
|
+
options,
|
|
83
83
|
)
|
|
84
84
|
|
|
85
85
|
const prependSections = missingSections(readme, [v3Banner, install, usage])
|
|
@@ -27,8 +27,8 @@ async function applyPreset(options: InjectOptions) {
|
|
|
27
27
|
Please confer
|
|
28
28
|
https://github.com/sanity-io/plugin-kit/blob/main/docs/ui-workshop.md#manual-steps-after-inject
|
|
29
29
|
to finalize configuration for this preset.
|
|
30
|
-
`.trim()
|
|
31
|
-
)
|
|
30
|
+
`.trim(),
|
|
31
|
+
),
|
|
32
32
|
)
|
|
33
33
|
}
|
|
34
34
|
|
package/src/presets/ui.ts
CHANGED
|
@@ -27,8 +27,8 @@ async function addDependencies(options: InjectOptions) {
|
|
|
27
27
|
...pkg.dependencies,
|
|
28
28
|
...(await resolveDependencyList()),
|
|
29
29
|
},
|
|
30
|
-
forcedPackageVersions
|
|
31
|
-
)
|
|
30
|
+
forcedPackageVersions,
|
|
31
|
+
),
|
|
32
32
|
)
|
|
33
33
|
const newPkg = {...pkg}
|
|
34
34
|
newPkg.dependencies = newDeps
|
|
@@ -44,8 +44,8 @@ async function addDevDependencies(options: InjectOptions) {
|
|
|
44
44
|
...pkg.devDependencies,
|
|
45
45
|
...(await resolveDevDependencyList()),
|
|
46
46
|
},
|
|
47
|
-
forcedDevPackageVersions
|
|
48
|
-
)
|
|
47
|
+
forcedDevPackageVersions,
|
|
48
|
+
),
|
|
49
49
|
)
|
|
50
50
|
const newPkg = {...pkg}
|
|
51
51
|
newPkg.devDependencies = newDeps
|
package/src/sanity/manifest.ts
CHANGED
|
@@ -70,7 +70,7 @@ export async function readManifest(options: ManifestOptions) {
|
|
|
70
70
|
} catch (err: any) {
|
|
71
71
|
if (err.code === 'ENOENT') {
|
|
72
72
|
throw new Error(
|
|
73
|
-
`No sanity.json found. sanity.json is required for plugins to function. Use \`${pkg.binname} init\` for a new plugin, or create an empty \`sanity.json\` with an empty object (\`{}\`) for existing ones
|
|
73
|
+
`No sanity.json found. sanity.json is required for plugins to function. Use \`${pkg.binname} init\` for a new plugin, or create an empty \`sanity.json\` with an empty object (\`{}\`) for existing ones.`,
|
|
74
74
|
)
|
|
75
75
|
}
|
|
76
76
|
|
|
@@ -122,7 +122,7 @@ function validateProjectManifest(manifest: SanityV2Manifest) {
|
|
|
122
122
|
|
|
123
123
|
export async function validatePluginManifest(
|
|
124
124
|
manifest: SanityV2Manifest,
|
|
125
|
-
options: {basePath: string}
|
|
125
|
+
options: {basePath: string},
|
|
126
126
|
) {
|
|
127
127
|
const disallowed = Object.keys(manifest)
|
|
128
128
|
.filter((key) => disallowedPluginProps.includes(key))
|
|
@@ -134,7 +134,7 @@ export async function validatePluginManifest(
|
|
|
134
134
|
throw new Error(
|
|
135
135
|
`Invalid sanity.json: Key${plural} ${joined} ${
|
|
136
136
|
plural ? 'are' : 'is'
|
|
137
|
-
} not allowed in a plugin manifest
|
|
137
|
+
} not allowed in a plugin manifest`,
|
|
138
138
|
)
|
|
139
139
|
}
|
|
140
140
|
|
|
@@ -156,13 +156,13 @@ export async function validatePaths(manifest: SanityV2Manifest, options: {basePa
|
|
|
156
156
|
|
|
157
157
|
if (typeof manifest.paths.compiled !== 'string') {
|
|
158
158
|
throw new Error(
|
|
159
|
-
`Invalid sanity.json: "paths" must have a (string) "compiled" property if declared
|
|
159
|
+
`Invalid sanity.json: "paths" must have a (string) "compiled" property if declared`,
|
|
160
160
|
)
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
if (typeof manifest.paths.source !== 'string') {
|
|
164
164
|
throw new Error(
|
|
165
|
-
`Invalid sanity.json: "paths" must have a (string) "source" property if declared
|
|
165
|
+
`Invalid sanity.json: "paths" must have a (string) "source" property if declared`,
|
|
166
166
|
)
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -178,7 +178,7 @@ export async function validatePaths(manifest: SanityV2Manifest, options: {basePa
|
|
|
178
178
|
|
|
179
179
|
if (!srcStats?.isDirectory()) {
|
|
180
180
|
throw new Error(
|
|
181
|
-
`sanity.json references "source" path which is not a directory: "${sourcePath}"
|
|
181
|
+
`sanity.json references "source" path which is not a directory: "${sourcePath}"`,
|
|
182
182
|
)
|
|
183
183
|
}
|
|
184
184
|
}
|
|
@@ -213,7 +213,7 @@ async function validatePart(part: Record<string, any>, index: number, options: M
|
|
|
213
213
|
async function validatePartFiles(
|
|
214
214
|
part: {path?: string} | undefined,
|
|
215
215
|
index: number,
|
|
216
|
-
options: ManifestOptions
|
|
216
|
+
options: ManifestOptions,
|
|
217
217
|
) {
|
|
218
218
|
const {verifyCompiledParts, verifySourceParts, paths} = options
|
|
219
219
|
if (!part?.path) {
|
|
@@ -224,8 +224,8 @@ async function validatePartFiles(
|
|
|
224
224
|
if (paths?.source && ext && ext !== '.js' && buildExtensions.includes(ext)) {
|
|
225
225
|
throw new Error(
|
|
226
226
|
`Invalid sanity.json: Part path has extension which is not applicable after compiling. ${ext} becomes .js after compiling. Specify filename without extension (${path.basename(
|
|
227
|
-
part.path
|
|
228
|
-
)}) (parts[${index}])
|
|
227
|
+
part.path,
|
|
228
|
+
)}) (parts[${index}])`,
|
|
229
229
|
)
|
|
230
230
|
}
|
|
231
231
|
|
|
@@ -242,13 +242,13 @@ async function validatePartFiles(
|
|
|
242
242
|
throw new Error(
|
|
243
243
|
`Invalid sanity.json: Part path references file that does not exist in source directory (${
|
|
244
244
|
paths?.source || paths?.basePath
|
|
245
|
-
}) (parts[${index}])
|
|
245
|
+
}) (parts[${index}])`,
|
|
246
246
|
)
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
if (verifyCompiledParts && !outDirExists) {
|
|
250
250
|
throw new Error(
|
|
251
|
-
`Invalid sanity.json: Part path references file ("${part.path}") that does not exist in compiled directory (${paths?.compiled}) (parts[${index}])
|
|
251
|
+
`Invalid sanity.json: Part path references file ("${part.path}") that does not exist in compiled directory (${paths?.compiled}) (parts[${index}])`,
|
|
252
252
|
)
|
|
253
253
|
}
|
|
254
254
|
}
|
|
@@ -256,18 +256,18 @@ async function validatePartFiles(
|
|
|
256
256
|
function validatePartNames(
|
|
257
257
|
part: {name?: string; implements?: string} | undefined,
|
|
258
258
|
index: number,
|
|
259
|
-
options: ManifestOptions
|
|
259
|
+
options: ManifestOptions,
|
|
260
260
|
) {
|
|
261
261
|
const pluginName = options.pluginName ? options.pluginName.replace(/^sanity-plugin-/, '') : ''
|
|
262
262
|
if (!part?.name || !part?.name?.startsWith(`part:${pluginName}/`)) {
|
|
263
263
|
throw new Error(
|
|
264
|
-
`Invalid sanity.json: "name" must be prefixed with "part:${pluginName}/" - got "${part?.name}" (parts[${index}])
|
|
264
|
+
`Invalid sanity.json: "name" must be prefixed with "part:${pluginName}/" - got "${part?.name}" (parts[${index}])`,
|
|
265
265
|
)
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
if (!part?.implements?.startsWith('part:')) {
|
|
269
269
|
throw new Error(
|
|
270
|
-
`Invalid sanity.json: "implements" must be prefixed with "part:" - got "${part?.implements}" (parts[${index}])
|
|
270
|
+
`Invalid sanity.json: "implements" must be prefixed with "part:" - got "${part?.implements}" (parts[${index}])`,
|
|
271
271
|
)
|
|
272
272
|
}
|
|
273
273
|
}
|
|
@@ -283,7 +283,7 @@ function validateAllowedPartKeys(part: Record<string, any>, index: number) {
|
|
|
283
283
|
throw new Error(
|
|
284
284
|
`Invalid sanity.json: Key${plural} ${joined} ${
|
|
285
285
|
plural ? 'are' : 'is'
|
|
286
|
-
} not allowed in a part declaration (parts[${index}])
|
|
286
|
+
} not allowed in a part declaration (parts[${index}])`,
|
|
287
287
|
)
|
|
288
288
|
}
|
|
289
289
|
}
|
|
@@ -297,7 +297,7 @@ function validatePartStringValues(part: Record<string, any>, index: number) {
|
|
|
297
297
|
const plural = nonStrings.length > 1 ? 's' : ''
|
|
298
298
|
const joined = nonStrings.join(', ')
|
|
299
299
|
throw new Error(
|
|
300
|
-
`Invalid sanity.json: Key${plural} ${joined} should be of type string (parts[${index}])
|
|
300
|
+
`Invalid sanity.json: Key${plural} ${joined} should be of type string (parts[${index}])`,
|
|
301
301
|
)
|
|
302
302
|
}
|
|
303
303
|
}
|
|
@@ -317,13 +317,13 @@ export function getReferencesPartPaths(manifest: SanityV2Manifest, basePath: str
|
|
|
317
317
|
.map((partPath) =>
|
|
318
318
|
path.isAbsolute(partPath)
|
|
319
319
|
? partPath // Not sure if this ever happens, but :shrugs:
|
|
320
|
-
: path.resolve(compiledPath, partPath)
|
|
320
|
+
: path.resolve(compiledPath, partPath),
|
|
321
321
|
)
|
|
322
322
|
}
|
|
323
323
|
|
|
324
324
|
export async function hasSanityJson(basePath: string) {
|
|
325
325
|
const file = await readJsonFile<{root?: boolean}>(path.join(basePath, 'sanity.json')).catch(
|
|
326
|
-
errorToUndefined
|
|
326
|
+
errorToUndefined,
|
|
327
327
|
)
|
|
328
328
|
return {exists: Boolean(file), isRoot: Boolean(file && file.root)}
|
|
329
329
|
}
|
package/src/util/files.ts
CHANGED
|
@@ -20,7 +20,7 @@ export const writeFile = util.promisify(fs.writeFile)
|
|
|
20
20
|
export function hasSourceEquivalent(compiledFile: string, paths: ManifestPaths) {
|
|
21
21
|
if (!paths.source) {
|
|
22
22
|
return fileExists(
|
|
23
|
-
path.isAbsolute(compiledFile) ? compiledFile : path.resolve(paths.basePath, compiledFile)
|
|
23
|
+
path.isAbsolute(compiledFile) ? compiledFile : path.resolve(paths.basePath, compiledFile),
|
|
24
24
|
)
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -47,7 +47,7 @@ export function hasSourceEquivalent(compiledFile: string, paths: ManifestPaths)
|
|
|
47
47
|
export async function hasSourceFile(filePath: string, paths?: ManifestPaths) {
|
|
48
48
|
if (!paths?.source) {
|
|
49
49
|
return fileExists(
|
|
50
|
-
path.isAbsolute(filePath) ? filePath : path.resolve(paths?.basePath ?? '', filePath)
|
|
50
|
+
path.isAbsolute(filePath) ? filePath : path.resolve(paths?.basePath ?? '', filePath),
|
|
51
51
|
)
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -67,7 +67,7 @@ export async function hasSourceFile(filePath: string, paths?: ManifestPaths) {
|
|
|
67
67
|
export function hasCompiledFile(filePath: string, paths?: ManifestPaths) {
|
|
68
68
|
if (!paths?.compiled) {
|
|
69
69
|
return fileExists(
|
|
70
|
-
path.isAbsolute(filePath) ? filePath : path.resolve(paths?.basePath ?? '', filePath)
|
|
70
|
+
path.isAbsolute(filePath) ? filePath : path.resolve(paths?.basePath ?? '', filePath),
|
|
71
71
|
)
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -113,7 +113,7 @@ export function writeJsonFile(filePath: string, content: Record<string, unknown>
|
|
|
113
113
|
export async function writeFileWithOverwritePrompt(
|
|
114
114
|
filePath: string,
|
|
115
115
|
content: string,
|
|
116
|
-
options: {default?: any; force?: boolean} & fs.ObjectEncodingOptions
|
|
116
|
+
options: {default?: any; force?: boolean} & fs.ObjectEncodingOptions,
|
|
117
117
|
) {
|
|
118
118
|
const {default: defaultVal, force = false, ...writeOptions} = options
|
|
119
119
|
const withinCwd = filePath.startsWith(process.cwd())
|
package/src/util/prompt.ts
CHANGED
|
@@ -15,7 +15,7 @@ export async function prompt(
|
|
|
15
15
|
default?: any
|
|
16
16
|
filter?: (val: any) => any
|
|
17
17
|
validate?: (val: any) => boolean | string
|
|
18
|
-
}
|
|
18
|
+
},
|
|
19
19
|
) {
|
|
20
20
|
const type = options.choices ? 'list' : options.type
|
|
21
21
|
const result = await inquirer.prompt([{...options, type, message, name: 'single'}])
|
package/src/util/user.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface User {
|
|
|
15
15
|
|
|
16
16
|
export async function getUserInfo(
|
|
17
17
|
{requireUserConfirmation, flags}: InjectOptions,
|
|
18
|
-
pkg?: PackageJson
|
|
18
|
+
pkg?: PackageJson,
|
|
19
19
|
): Promise<User | undefined> {
|
|
20
20
|
const userInfo =
|
|
21
21
|
getPackageUserInfo({author: flags.author ?? pkg?.author}) ||
|
|
@@ -73,7 +73,7 @@ async function promptForInfo(defValue?: User) {
|
|
|
73
73
|
async function getSanityUserInfo(): Promise<User | undefined> {
|
|
74
74
|
try {
|
|
75
75
|
const data = await readJsonFile<{authToken?: string}>(
|
|
76
|
-
path.join(xdgBasedir.config ?? '', 'sanity', 'config.json')
|
|
76
|
+
path.join(xdgBasedir.config ?? '', 'sanity', 'config.json'),
|
|
77
77
|
)
|
|
78
78
|
const token = data?.authToken
|
|
79
79
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-7e8e9944.js","sources":["../../src/util/log.ts","../../src/cmds/index.ts","../../src/sharedFlags.ts","../../src/constants.ts","../../src/cli.ts"],"sourcesContent":["// Note: This is _specifically_ meant for CLI usage,\n// I realize that \"singletons\" are bad.\n\nimport chalk from 'chalk'\n\nlet beQuiet = false\nlet beVerbose = false\n\nfunction setVerbosity({verbose, silent}: {verbose: boolean; silent: boolean}) {\n if (silent) {\n beVerbose = false\n beQuiet = true\n } else if (verbose) {\n beVerbose = true\n beQuiet = false\n }\n}\n\nexport default {\n setVerbosity: setVerbosity,\n\n // Bypasses any checks, prints regardless (only use for things like `cli --version`)\n msg: (msg: any, ...args: any[]) => !beQuiet && console.log(msg, ...args),\n\n // Debug only printed on --verbose\n debug: (msg: any, ...args: any[]) =>\n !beQuiet && beVerbose && console.debug(`${chalk.bgBlack.white('[debug]')} ${msg}`, ...args),\n\n // Success messages only printed if not --silent\n success: (msg: any, ...args: any[]) =>\n !beQuiet && console.info(`${chalk.bgBlack.greenBright('[success]')} ${msg}`, ...args),\n\n // Info only printed if not --silent (\"standard\" level)\n info: (msg: any, ...args: any[]) =>\n !beQuiet && console.info(`${chalk.bgBlack.cyanBright('[info]')} ${msg}`, ...args),\n\n // Warning only printed if not --silent\n warn: (msg: any, ...args: any[]) =>\n !beQuiet && console.warn(`${chalk.bgBlack.yellowBright('[warn]')} ${msg}`, ...args),\n\n // Errors are always printed\n error: (msg: any, ...args: any[]) =>\n console.error(`${chalk.bgBlack.redBright('[error]')} ${msg}`, ...args),\n}\n","export default {\n init: async (options: {argv: string[]}) => {\n await (await import('./init')).default(options)\n },\n inject: async (options: {argv: string[]}) => {\n await (await import('./inject')).default(options)\n },\n 'link-watch': async (options: {argv: string[]}) => {\n await (await import('./link-watch')).default(options)\n },\n 'verify-package': async (options: {argv: string[]}) => {\n await (await import('./verify-package')).default(options)\n },\n 'verify-studio': async (options: {argv: string[]}) => {\n await (await import('./verify-studio')).default(options)\n },\n version: async (options: {argv: string[]}) => {\n await (await import('./version')).default(options)\n },\n}\n","export default {\n debug: {\n default: false,\n type: 'boolean',\n },\n silent: {\n type: 'boolean',\n default: false,\n },\n verbose: {\n type: 'boolean',\n default: false,\n },\n} as const\n","export const cliName = '@sanity/plugin-kit'\n\nexport const urls = {\n refDocs: 'https://beta.sanity.io/docs/reference',\n migrationGuideStudio: 'https://beta.sanity.io/docs/platform/v2-to-v3',\n migrationGuidePlugin: 'https://beta.sanity.io/docs/platform/v2-to-v3/plugins',\n pluginReadme: 'https://github.com/sanity-io/plugin-kit',\n incompatiblePlugin: 'https://github.com/sanity-io/incompatible-plugin',\n sanityExchange: 'https://www.sanity.io/exchange',\n linterPackage: 'https://github.com/sanity-io/eslint-config-no-v2-imports',\n}\n\nexport const incompatiblePluginPackage = '@sanity/incompatible-plugin'\n\nexport const defaultOutDir = 'dist'\n","import meow from 'meow'\nimport log from './util/log'\nimport commands from './cmds'\nimport sharedFlags from './sharedFlags'\nimport {cliName} from './constants'\n\nexport async function cliEntry(argv = process.argv, autoExit = true) {\n const cli = meow(\n `\n\tUsage\n\t $ ${cliName} [--help] [--debug] <command> [<args>]\n\n These are common commands used in various situations:\n\n init Create a new Sanity plugin\n inject Inject config into an existing Sanity v3 plugin\n verify-package Check that a Sanity plugin package follows V3 conventions. Prints upgrade steps.\n verify-studio Check that a Sanity Studio follows V3 conventions. Prints upgrade steps.\n link-watch Recompiles plugin automatically on changes and runs yalc push --publish\n version Show the version of ${cliName} currently installed\n\n Options\n --silent Do not print info and warning messages\n --verbose Log everything. This option conflicts with --silent\n --debug Print stack trace on errors\n --version Output the version number\n --help Output usage information\n\n Examples\n # Init a new plugin in current directory\n $ ${cliName} init\n\n # Init a new plugin in my-sanity-plugin directory\n $ ${cliName} init my-sanity-plugin\n\n # Check that a Sanity plugin package in current directory follows V3 conventions\n $ ${cliName} verify-package\n\n # Check that a Sanity Studio in current directory follows V3 conventions\n $ ${cliName} verify-studio\n`,\n {\n autoHelp: false,\n flags: sharedFlags,\n argv: argv.slice(2),\n }\n )\n\n const commandName = cli.input[0]\n if (!commandName) {\n cli.showHelp() // Exits\n }\n\n if (!(commandName in commands)) {\n console.error(`Unknown command \"${commandName}\"`)\n cli.showHelp() // Exits\n }\n\n if (cli.flags.silent && cli.flags.verbose) {\n log.error(`--silent and --verbose are mutually exclusive`)\n cli.showHelp() // Exits\n }\n\n // Lazy-load command\n const cmd = commands[commandName as keyof typeof commands]\n\n try {\n log.setVerbosity(cli.flags)\n await cmd({argv: argv.slice(3)})\n } catch (err: any) {\n log.error(err instanceof TypeError || cli.flags.debug ? err.stack : err.message)\n\n // eslint-disable-next-line no-process-exit\n process.exit(1)\n }\n}\n"],"names":["beQuiet","beVerbose","setVerbosity","verbose","silent","log","msg","args","console","debug","chalk","bgBlack","white","success","info","default","greenBright","cyanBright","warn","yellowBright","error","redBright","commands","init","options","Promise","resolve","then","require","inject","version","sharedFlags","type","cliName","urls","refDocs","migrationGuideStudio","migrationGuidePlugin","pluginReadme","incompatiblePlugin","sanityExchange","linterPackage","incompatiblePluginPackage","defaultOutDir","cliEntry","argv","process","autoExit","cli","meow","autoHelp","flags","slice","commandName","input","showHelp","cmd","err","TypeError","stack","message","exit"],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,OAAA,4BAGPkB,OAAA,gjBASmCA,OAAA,qYAWlCA,OAAA,mFAGAA,OAAA,mIAGAA,OAAA,qHAGAA,OAAA,uBAEJ;IACEiB,QAAU,EAAA,KAAA;IACVC,KAAO,EAAApB,WAAA;IACPc,IAAA,EAAMA,IAAK,CAAAO,KAAA,CAAM,CAAC;EACpB,CAAA,CACF;EAEM,MAAAC,WAAA,GAAcL,GAAI,CAAAM,KAAA,CAAM,CAAC,CAAA;EAC/B,IAAI,CAACD,WAAa,EAAA;IAChBL,GAAA,CAAIO,QAAS,EAAA;EACf;EAEI,IAAA,EAAEF,eAAe/B,QAAW,CAAA,EAAA;IACtBd,OAAA,CAAAY,KAAA,6BAA0BiC,WAAc,QAAA;IAChDL,GAAA,CAAIO,QAAS,EAAA;EACf;EAEA,IAAIP,GAAI,CAAAG,KAAA,CAAM/C,MAAU,IAAA4C,GAAA,CAAIG,MAAMhD,OAAS,EAAA;IACzCE,GAAA,CAAIe,sDAAqD;IACzD4B,GAAA,CAAIO,QAAS,EAAA;EACf;EAGM,MAAAC,GAAA,GAAMlC,SAAS+B,WAAoC,CAAA;EAErD,IAAA;IACEhD,GAAA,CAAAH,YAAA,CAAa8C,IAAIG,KAAK,CAAA;IAC1B,MAAMK,IAAI;MAACX,IAAA,EAAMA,KAAKO,KAAM,CAAA,CAAC;KAAE,CAAA;WACxBK,GAAP,EAAA;IACIpD,GAAA,CAAAe,KAAA,CAAMqC,eAAeC,SAAa,IAAAV,GAAA,CAAIG,MAAM1C,KAAQ,GAAAgD,GAAA,CAAIE,KAAQ,GAAAF,GAAA,CAAIG,OAAO,CAAA;IAG/Ed,OAAA,CAAQe,KAAK,CAAC,CAAA;EAChB;AACF;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init-09ede150.js","sources":["../../src/npm/manager.ts","../../src/cmds/init.ts"],"sourcesContent":["import execa from 'execa'\nimport {prompt} from '../util/prompt'\n\nexport function npmIsAvailable() {\n return execa('npm', ['-v'])\n .then(() => true)\n .catch(() => false)\n}\n\nexport function yarnIsAvailable() {\n return execa('yarn', ['-v'])\n .then(() => true)\n .catch(() => false)\n}\n\nexport function pnpmAvailable() {\n return execa('pnpm', ['-v'])\n .then(() => true)\n .catch(() => false)\n}\n\nexport async function promptForPackageManager() {\n const [npm, yarn, pnpm] = await Promise.all([\n npmIsAvailable(),\n yarnIsAvailable(),\n pnpmAvailable(),\n ])\n\n const choices = [npm && 'npm', yarn && 'yarn', pnpm && 'pnpm'].filter(Boolean)\n if (choices.length < 2) {\n return choices[0] || 'npm'\n }\n\n return prompt('Which package manager do you prefer?', {\n choices: choices.map((value) => ({value, name: value})),\n default: choices[0],\n })\n}\n\nexport async function installDependencies(pm: string, {cwd}: {cwd?: string}) {\n const proc = execa(pm, ['install'], {cwd, stdio: 'inherit'})\n const {exitCode} = await proc\n return exitCode <= 0\n}\n","import path from 'path'\nimport meow from 'meow'\nimport log from '../util/log'\nimport {init, initFlags} from '../actions/init'\nimport {isEmptyish, ensureDir} from '../util/files'\nimport {installDependencies, promptForPackageManager} from '../npm/manager'\nimport {findStudioV3Config, hasSanityJson} from '../sanity/manifest'\nimport {prompt} from '../util/prompt'\nimport {cliName} from '../constants'\nimport {presetHelpList} from '../presets/presets'\n\nconst description = `Initialize a new Sanity plugin`\n\nconst help = `\nUsage\n $ ${cliName} init [dir] [<args>]\n\nOptions\n --no-eslint Disables ESLint config and dependencies from being added\n --no-prettier Disables prettier config and dependencies from being added\n --no-typescript Disables typescript config and dependencies from being added\n --no-license Disables LICENSE + package.json license field from being added\n --no-editorconfig Disables .editorconfig from being added\n --no-gitignore Disables .gitignore from being added\n --no-scripts Disables scripts from being added to package.json\n --no-install Disables automatically running package manager install\n\n --name [package-name] Use the provided package-name\n --author [name] Use the provided author\n --repo [url] Use the provided repo url\n --license [spdx] Use the license with the given SPDX identifier\n --force No promt when overwriting files\n\n --preset [preset-name] Adds config and files from a named preset. --preset can be supplied multiple times.\n The following presets are available:\n${presetHelpList(30)}\n\nExamples\n # Initialize a new plugin in the current directory\n $ ${cliName} init\n\n # Initialize a plugin in the directory ~/my-plugin\n $ ${cliName} init ~/my-plugin\n\n # Don't add eslint or prettier\n $ ${cliName} init --no-eslint --no-prettier\n`\n\nasync function run({argv}: {argv: string[]}) {\n const cli = meow(help, {flags: initFlags, argv, description})\n const basePath = path.resolve(cli.input[0] || process.cwd())\n\n const {exists, isRoot} = await hasSanityJson(basePath)\n if (exists && isRoot) {\n throw new Error(\n `sanity.json has a \"root\" property set to true - are you trying to init into a studio instead of a plugin?`\n )\n }\n\n const {v3ConfigFile} = await findStudioV3Config(basePath)\n if (v3ConfigFile) {\n throw new Error(\n `${v3ConfigFile} exsists - are you trying to init into a studio instead of a plugin?`\n )\n }\n\n log.info('Initializing new plugin in \"%s\"', basePath)\n if (\n !cli.flags.force &&\n !(await isEmptyish(basePath)) &&\n !(await prompt('Directory is not empty, proceed?', {type: 'confirm', default: false}))\n ) {\n log.error('Directory is not empty. Cancelled.')\n return\n }\n\n await ensureDir(basePath)\n await init({basePath, flags: cli.flags})\n if (cli.flags.install) {\n if (await installDependencies(await promptForPackageManager(), {cwd: basePath})) {\n log.info('Done!')\n } else {\n log.error('Failed to install dependencies, try manually running `npm install`')\n }\n } else {\n log.info('Dependency installation skipped.')\n }\n}\n\nexport default run\n"],"names":["npmIsAvailable","execa","then","catch","yarnIsAvailable","pnpmAvailable","promptForPackageManager","npm","yarn","pnpm","Promise","all","choices","filter","Boolean","length","prompt","map","value","name","default","installDependencies","pm","cwd","proc","stdio","exitCode","description","help","cliName","presetHelpList","run","argv","cli","meow","flags","initFlags","basePath","path","resolve","input","process","exists","isRoot","hasSanityJson","Error","v3ConfigFile","findStudioV3Config","log","info","force","isEmptyish","type","error","ensureDir","init","install"],"mappings":";;;;;;;;;;;;;;;;AAGO,SAASA,cAAiB,GAAA;EAC/B,OAAOC,sBAAM,CAAA,KAAA,EAAO,CAAC,IAAI,CAAC,CAAA,CACvBC,IAAK,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