@tbsten/mir 0.0.2-alpha02 → 0.0.2-alpha04
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/dist/cli.js +19 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -410,6 +410,21 @@ async function publishSnippet(name, opts2 = {}, cwd = process.cwd(), configPath)
|
|
|
410
410
|
const definition = parseSnippetYaml(yamlContent);
|
|
411
411
|
const config = loadMirConfig(configPath ? { configPath } : { cwd });
|
|
412
412
|
const registryEntry = resolvePublishRegistry(config, opts2.registry);
|
|
413
|
+
if (opts2.interactive !== false) {
|
|
414
|
+
const registryDisplay = registryEntry.url || resolveRegistryPath(registryEntry);
|
|
415
|
+
const shouldProceed = await confirm(
|
|
416
|
+
`
|
|
417
|
+
Snippet: ${name}
|
|
418
|
+
Location: ${dirPath}
|
|
419
|
+
Registry: ${registryDisplay}
|
|
420
|
+
|
|
421
|
+
\u3053\u308C\u3067\u516C\u958B\u3057\u3066\u3044\u3044?`
|
|
422
|
+
);
|
|
423
|
+
if (!shouldProceed) {
|
|
424
|
+
info(t4("publish.cancelled"));
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
413
428
|
if (registryEntry.url) {
|
|
414
429
|
if (!registryEntry.publish_token) {
|
|
415
430
|
throw new Error(t4("error.publish-token-required"));
|
|
@@ -465,6 +480,9 @@ Examples:
|
|
|
465
480
|
mir publish react-hook --force
|
|
466
481
|
mir publish my-component --registry custom
|
|
467
482
|
mir publish react-hook --no-interactive`).action(async (name, opts2) => {
|
|
483
|
+
if (process.argv.includes("--no-interactive")) {
|
|
484
|
+
opts2.interactive = false;
|
|
485
|
+
}
|
|
468
486
|
let snippetName = name;
|
|
469
487
|
if (!snippetName) {
|
|
470
488
|
const snippets = listLocalSnippets(process.cwd());
|
|
@@ -1829,7 +1847,7 @@ function getLocaleFromEnv() {
|
|
|
1829
1847
|
|
|
1830
1848
|
// src/cli.ts
|
|
1831
1849
|
var program = new Command();
|
|
1832
|
-
program.name("mir").description("\u30B9\u30CB\u30DA\u30C3\u30C8\u3092\u914D\u5E03\u30FB\u53D6\u5F97\u3059\u308B CLI \u30C4\u30FC\u30EB").version("0.0.2-
|
|
1850
|
+
program.name("mir").description("\u30B9\u30CB\u30DA\u30C3\u30C8\u3092\u914D\u5E03\u30FB\u53D6\u5F97\u3059\u308B CLI \u30C4\u30FC\u30EB").version("0.0.2-alpha04", "-v, -V, --version").showHelpAfterError(true).option("--config <path>", "\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u30D1\u30B9 (\u30C7\u30D5\u30A9\u30EB\u30C8: ~/.mir/config.yaml)").option("--locale <lang>", "UI \u8A00\u8A9E (ja|en)").option("--no-interactive", "\u975E\u5BFE\u8A71\u30E2\u30FC\u30C9");
|
|
1833
1851
|
var opts = program.opts();
|
|
1834
1852
|
var locale = "en";
|
|
1835
1853
|
if (opts.locale) {
|