launchset 0.0.0-stage → 1.2.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.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +100 -2
  3. package/dist/appstore-bVSJnUv2.js +143 -0
  4. package/dist/cli.js +6889 -0
  5. package/dist/errors-CHdD4g_K.js +58 -0
  6. package/dist/gitlab-child-girdQprO.js +6071 -0
  7. package/dist/http-dQt8kfON.js +127 -0
  8. package/dist/index.d.ts +854 -0
  9. package/dist/index.js +29 -0
  10. package/dist/init-Cv748KKZ.js +8222 -0
  11. package/dist/launchset.schema.json +1473 -0
  12. package/dist/play-D7nv0n-W.js +123 -0
  13. package/dist/prompts-S8h8cgml.js +52 -0
  14. package/dist/schema-CKljQNeI.js +1202 -0
  15. package/dist/store-BCwWrhhY.js +73 -0
  16. package/package.json +88 -4
  17. package/skills/launchset/AGENTS-snippet.md +24 -0
  18. package/skills/launchset/SKILL.md +205 -0
  19. package/skills/launchset-adopt/SKILL.md +222 -0
  20. package/templates/gitlab/child/build.yml +17 -0
  21. package/templates/gitlab/child/cli.yml +14 -0
  22. package/templates/gitlab/child/comment.yml +14 -0
  23. package/templates/gitlab/child/finalize.yml +14 -0
  24. package/templates/gitlab/child/header.yml +4 -0
  25. package/templates/gitlab/child/include.yml +6 -0
  26. package/templates/gitlab/child/nothing.yml +11 -0
  27. package/templates/gitlab/gitlab-ci.yml +23 -0
  28. package/templates/gitlab/launchset-preview.yml +62 -0
  29. package/templates/gitlab/launchset-targets.yml +44 -0
  30. package/templates/gitlab/launchset.yml +133 -0
  31. package/templates/gitlab/targets/android.yml +25 -0
  32. package/templates/gitlab/targets/custom-npm.yml +15 -0
  33. package/templates/gitlab/targets/custom.yml +23 -0
  34. package/templates/gitlab/targets/docker.yml +23 -0
  35. package/templates/gitlab/targets/ios.yml +33 -0
  36. package/templates/gitlab/targets/web.yml +13 -0
  37. package/templates/launchset-readme.md +23 -0
  38. package/templates/workflows/launchset-check.yml +33 -0
  39. package/templates/workflows/launchset-preview.yml +157 -0
  40. package/templates/workflows/launchset-release.yml +181 -0
  41. package/templates/workflows/snippets/android.yml +41 -0
  42. package/templates/workflows/snippets/custom-example.yml +12 -0
  43. package/templates/workflows/snippets/custom-npm.yml +19 -0
  44. package/templates/workflows/snippets/custom.yml +9 -0
  45. package/templates/workflows/snippets/docker-login.yml +9 -0
  46. package/templates/workflows/snippets/docker.yml +17 -0
  47. package/templates/workflows/snippets/ios.yml +46 -0
  48. package/templates/workflows/snippets/web.yml +20 -0
@@ -0,0 +1,58 @@
1
+ // src/core/errors.ts
2
+ /**
3
+ * A failure the user can act on: the message says what is wrong and where (file, field,
4
+ * line), `hint` says what to do. `code` is a stable kebab-case identifier for tests,
5
+ * JSON output and the action's job summary.
6
+ */
7
+ var LaunchsetError = class extends Error {
8
+ code;
9
+ hint;
10
+ constructor(code, message, options = {}) {
11
+ super(message, options.cause === void 0 ? void 0 : { cause: options.cause });
12
+ this.name = "LaunchsetError";
13
+ this.code = code;
14
+ if (options.hint !== void 0) this.hint = options.hint;
15
+ }
16
+ };
17
+ /**
18
+ * Marks error classes outside core that say what went wrong themselves (git, GitHub, verify
19
+ * and stamp errors): {@link describeError} treats them as expected, not as bugs.
20
+ */
21
+ const EXPECTED_ERROR = Symbol.for("launchset.expected-error");
22
+ /** True for errors meant for the user (as opposed to bugs). */
23
+ function isLaunchsetError(error) {
24
+ return error instanceof LaunchsetError;
25
+ }
26
+ /** The message of an error, or the thrown value as text. */
27
+ function errorMessage(error) {
28
+ return error instanceof Error ? error.message : String(error);
29
+ }
30
+ /** The message with the error's hint on a `Hint:` line, for warnings that quote an error. */
31
+ function messageWithHint(error) {
32
+ const { message, hint } = describeError(error);
33
+ return hint ? `${message}\nHint: ${hint}` : message;
34
+ }
35
+ /** A hint embedded in the message (`…\nHint: …`), as errors from before hints were apart. */
36
+ const EMBEDDED_HINT = /\nHint: /;
37
+ /**
38
+ * The message and hint of any thrown value. The error's own `hint` wins; a hint embedded in
39
+ * the message is split off, so it's shown once either way.
40
+ */
41
+ function describeError(error) {
42
+ const text = errorMessage(error);
43
+ const match = EMBEDDED_HINT.exec(text);
44
+ const message = match ? text.slice(0, match.index) : text;
45
+ const embedded = match ? text.slice(match.index + match[0].length).trim() : "";
46
+ const own = error?.hint;
47
+ const hint = typeof own === "string" && own.trim() !== "" ? own.trim() : embedded;
48
+ const expected = error instanceof LaunchsetError || typeof error === "object" && error !== null && (EXPECTED_ERROR in error || "hint" in error);
49
+ return hint ? {
50
+ message,
51
+ hint,
52
+ expected
53
+ } : {
54
+ message,
55
+ expected
56
+ };
57
+ }
58
+ export { isLaunchsetError as a, errorMessage as i, LaunchsetError as n, messageWithHint as o, describeError as r, EXPECTED_ERROR as t };