@acrylblends/blends-frame 0.1.2 → 0.1.4

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/lib/index.js CHANGED
@@ -2014,11 +2014,19 @@ function ghApiWrites(args) {
2014
2014
  }
2015
2015
  /** A rehearsal that sends nothing: `git push --dry-run` (or `-n`), `npm publish --dry-run`. */
2016
2016
  const rehearses = (args, short) => args.some((word) => word === "--dry-run" || short !== void 0 && word === short);
2017
+ /** The app's share command told to send (`--confirm`), through a package manager's `run share` or `node plugins/save/share-cli.ts`. Without `--confirm` it only shows the plan. */
2018
+ function sharesConfirmed(name, args) {
2019
+ if (!args.some((word) => word === "--confirm" || word.startsWith("--confirm="))) return false;
2020
+ if (args.some((word) => /(?:^|[\\/])share-cli\.[cm]?[jt]s$/u.test(word))) return true;
2021
+ const plain = args.filter((word) => !word.startsWith("-"));
2022
+ return PACKAGE_MANAGERS.has(name) && (plain[0] === "share" || plain[0] === "run" && plain[1] === "share");
2023
+ }
2017
2024
  /** What one simple command sends out, as the person would name it; undefined when it sends nothing. */
2018
2025
  function outwardOf(words) {
2019
2026
  const [first, ...args] = fromProgram(words);
2020
2027
  if (first === void 0) return void 0;
2021
2028
  const name = program(first);
2029
+ if (sharesConfirmed(name, args)) return "share the app";
2022
2030
  if (name === "git") return gitSubcommand(args) === "push" && !rehearses(args, "-n") ? "git push" : void 0;
2023
2031
  if (name === "gh") {
2024
2032
  const [group, verb] = args.filter((word) => !word.startsWith("-"));