From 37af49996f7dde853fdbd6ca6989ae2af366bbdb Mon Sep 17 00:00:00 2001 From: Espen Hovlandsdal Date: Wed, 8 Sep 2021 13:18:36 +0200 Subject: [PATCH] chore(import-cli): upgrade meow dependency --- packages/@sanity/import-cli/package.json | 2 +- .../@sanity/import-cli/src/sanity-import.js | 59 +++++++++++++++---- 2 files changed, 48 insertions(+), 13 deletions(-) diff --git a/packages/@sanity/import-cli/package.json b/packages/@sanity/import-cli/package.json index ae7d203c140..e5376775a3f 100644 --- a/packages/@sanity/import-cli/package.json +++ b/packages/@sanity/import-cli/package.json @@ -27,7 +27,7 @@ "dependencies": { "@sanity/client": "2.18.0", "@sanity/import": "2.18.0", - "meow": "^3.7.0", + "meow": "^9.0.0", "ora": "^2.1.0", "pretty-ms": "^7.0.1", "simple-get": "^4.0.0" diff --git a/packages/@sanity/import-cli/src/sanity-import.js b/packages/@sanity/import-cli/src/sanity-import.js index a49006667af..6144eb10521 100755 --- a/packages/@sanity/import-cli/src/sanity-import.js +++ b/packages/@sanity/import-cli/src/sanity-import.js @@ -43,18 +43,53 @@ const cli = meow( --token = SANITY_IMPORT_TOKEN `, { - boolean: [ - 'replace', - 'missing', - 'allow-failing-assets', - 'allow-assets-in-different-dataset', - 'replace-assets', - ], - alias: { - p: 'project', - d: 'dataset', - t: 'token', - c: 'asset-concurrency', + flags: { + // Required, but validated below for better error output + project: { + type: 'string', + alias: 'p', + }, + + dataset: { + type: 'string', + alias: 'd', + }, + + token: { + type: 'string', + alias: 't', + }, + + // Optional + replace: { + type: 'boolean', + default: false, + }, + + missing: { + type: 'boolean', + default: false, + }, + + allowFailingAssets: { + type: 'boolean', + default: false, + }, + + allowAssetsInDifferentDataset: { + type: 'boolean', + default: false, + }, + + replaceAssets: { + type: 'boolean', + default: false, + }, + + assetConcurrency: { + type: 'number', + alias: 'c', + }, }, } )