@fern-api/generator-cli 0.9.2 → 0.9.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.
Files changed (3) hide show
  1. package/dist/api.js +491 -151
  2. package/dist/cli.js +2837 -2011
  3. package/package.json +2 -2
package/dist/api.js CHANGED
@@ -38,8 +38,8 @@ var require_ms = __commonJS({
38
38
  var m = s * 60;
39
39
  var h = m * 60;
40
40
  var d = h * 24;
41
- var w = d * 7;
42
- var y = d * 365.25;
41
+ var w2 = d * 7;
42
+ var y2 = d * 365.25;
43
43
  module2.exports = function(val, options) {
44
44
  options = options || {};
45
45
  var type = typeof val;
@@ -71,11 +71,11 @@ var require_ms = __commonJS({
71
71
  case "yrs":
72
72
  case "yr":
73
73
  case "y":
74
- return n * y;
74
+ return n * y2;
75
75
  case "weeks":
76
76
  case "week":
77
77
  case "w":
78
- return n * w;
78
+ return n * w2;
79
79
  case "days":
80
80
  case "day":
81
81
  case "d":
@@ -232,8 +232,8 @@ var require_common = __commonJS({
232
232
  }
233
233
  return enabledCache;
234
234
  },
235
- set: (v) => {
236
- enableOverride = v;
235
+ set: (v2) => {
236
+ enableOverride = v2;
237
237
  }
238
238
  });
239
239
  if (typeof createDebug.init === "function") {
@@ -440,8 +440,8 @@ var require_browser = __commonJS({
440
440
  if (!this.useColors) {
441
441
  return;
442
442
  }
443
- const c = "color: " + this.color;
444
- args.splice(1, 0, c, "color: inherit");
443
+ const c2 = "color: " + this.color;
444
+ args.splice(1, 0, c2, "color: inherit");
445
445
  let index = 0;
446
446
  let lastC = 0;
447
447
  args[0].replace(/%[a-zA-Z%]/g, (match) => {
@@ -453,7 +453,7 @@ var require_browser = __commonJS({
453
453
  lastC = index;
454
454
  }
455
455
  });
456
- args.splice(lastC, 0, c);
456
+ args.splice(lastC, 0, c2);
457
457
  }
458
458
  exports2.log = console.debug || console.log || (() => {
459
459
  });
@@ -468,15 +468,15 @@ var require_browser = __commonJS({
468
468
  }
469
469
  }
470
470
  function load() {
471
- let r;
471
+ let r2;
472
472
  try {
473
- r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
473
+ r2 = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
474
474
  } catch (error) {
475
475
  }
476
- if (!r && typeof process !== "undefined" && "env" in process) {
477
- r = process.env.DEBUG;
476
+ if (!r2 && typeof process !== "undefined" && "env" in process) {
477
+ r2 = process.env.DEBUG;
478
478
  }
479
- return r;
479
+ return r2;
480
480
  }
481
481
  function localstorage() {
482
482
  try {
@@ -486,9 +486,9 @@ var require_browser = __commonJS({
486
486
  }
487
487
  module2.exports = require_common()(exports2);
488
488
  var { formatters } = module2.exports;
489
- formatters.j = function(v) {
489
+ formatters.j = function(v2) {
490
490
  try {
491
- return JSON.stringify(v);
491
+ return JSON.stringify(v2);
492
492
  } catch (error) {
493
493
  return "[UnexpectedJSONParseError]: " + error.message;
494
494
  }
@@ -697,8 +697,8 @@ var require_node = __commonJS({
697
697
  exports2.inspectOpts = Object.keys(process.env).filter((key) => {
698
698
  return /^debug_/i.test(key);
699
699
  }).reduce((obj, key) => {
700
- const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
701
- return k.toUpperCase();
700
+ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_2, k2) => {
701
+ return k2.toUpperCase();
702
702
  });
703
703
  let val = process.env[key];
704
704
  if (/^(yes|on|true|enabled)$/i.test(val)) {
@@ -719,8 +719,8 @@ var require_node = __commonJS({
719
719
  function formatArgs(args) {
720
720
  const { namespace: name, useColors: useColors2 } = this;
721
721
  if (useColors2) {
722
- const c = this.color;
723
- const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
722
+ const c2 = this.color;
723
+ const colorCode = "\x1B[3" + (c2 < 8 ? c2 : "8;5;" + c2);
724
724
  const prefix = ` ${colorCode};1m${name} \x1B[0m`;
725
725
  args[0] = prefix + args[0].split("\n").join("\n" + prefix);
726
726
  args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
@@ -756,13 +756,13 @@ var require_node = __commonJS({
756
756
  }
757
757
  module2.exports = require_common()(exports2);
758
758
  var { formatters } = module2.exports;
759
- formatters.o = function(v) {
759
+ formatters.o = function(v2) {
760
760
  this.inspectOpts.colors = this.useColors;
761
- return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
761
+ return util.inspect(v2, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
762
762
  };
763
- formatters.O = function(v) {
763
+ formatters.O = function(v2) {
764
764
  this.inspectOpts.colors = this.useColors;
765
- return util.inspect(v, this.inspectOpts);
765
+ return util.inspect(v2, this.inspectOpts);
766
766
  };
767
767
  }
768
768
  });
@@ -904,13 +904,393 @@ module.exports = __toCommonJS(api_exports2);
904
904
  var import_promises = require("fs/promises");
905
905
  var import_path = __toESM(require("path"), 1);
906
906
 
907
- // ../../node_modules/.pnpm/simple-git@3.33.0/node_modules/simple-git/dist/esm/index.js
907
+ // ../../node_modules/.pnpm/simple-git@3.35.2/node_modules/simple-git/dist/esm/index.js
908
908
  var import_node_buffer = require("buffer");
909
909
  var import_file_exists = __toESM(require_dist(), 1);
910
+
911
+ // ../../node_modules/.pnpm/@simple-git+args-pathspec@1.0.2/node_modules/@simple-git/args-pathspec/dist/index.mjs
912
+ var t = /* @__PURE__ */ new WeakMap();
913
+ function c(...n) {
914
+ const e = new String(n);
915
+ return t.set(e, n), e;
916
+ }
917
+ function r(n) {
918
+ return n instanceof String && t.has(n);
919
+ }
920
+ function o(n) {
921
+ return t.get(n) ?? [];
922
+ }
923
+
924
+ // ../../node_modules/.pnpm/simple-git@3.35.2/node_modules/simple-git/dist/esm/index.js
910
925
  var import_debug = __toESM(require_src(), 1);
911
926
  var import_child_process = require("child_process");
912
927
  var import_promise_deferred = __toESM(require_dist2(), 1);
913
928
  var import_node_path = require("path");
929
+
930
+ // ../../node_modules/.pnpm/@simple-git+argv-parser@1.0.3/node_modules/@simple-git/argv-parser/dist/index.mjs
931
+ function* w(e, t2) {
932
+ const n = t2 === "global";
933
+ for (const o2 of e)
934
+ o2.isGlobal === n && (yield o2);
935
+ }
936
+ var x = /* @__PURE__ */ new Set([
937
+ "--add",
938
+ "--edit",
939
+ "--remove-section",
940
+ "--rename-section",
941
+ "--replace-all",
942
+ "--unset",
943
+ "--unset-all",
944
+ "-e"
945
+ ]);
946
+ var S = /* @__PURE__ */ new Set([
947
+ "--get",
948
+ "--get-all",
949
+ "--get-color",
950
+ "--get-colorbool",
951
+ "--get-regexp",
952
+ "--get-urlmatch",
953
+ "--list",
954
+ "-l"
955
+ ]);
956
+ var k = /* @__PURE__ */ new Set([
957
+ "edit",
958
+ "remove-section",
959
+ "rename-section",
960
+ "set",
961
+ "unset"
962
+ ]);
963
+ var y = /* @__PURE__ */ new Set(["get", "get-color", "get-colorbool", "list"]);
964
+ function C(e, t2) {
965
+ for (const { name: o2 } of w(e, "task")) {
966
+ if (x.has(o2))
967
+ return f(true, t2);
968
+ if (S.has(o2))
969
+ return f(false, t2);
970
+ }
971
+ const n = t2.at(0)?.toLowerCase();
972
+ return n === void 0 ? null : k.has(n) ? f(true, t2.slice(1)) : y.has(n) ? f(false, t2.slice(1)) : t2.length === 1 ? f(false, t2) : f(true, t2);
973
+ }
974
+ function f(e = false, t2 = []) {
975
+ const n = t2.at(0)?.toLowerCase();
976
+ return n === void 0 ? null : {
977
+ isWrite: e,
978
+ isRead: !e,
979
+ key: n,
980
+ value: t2.at(1)
981
+ };
982
+ }
983
+ function N(e, t2) {
984
+ return t2.isWrite && t2.value !== void 0 ? { key: t2.key, value: t2.value, scope: e } : { key: t2.key, scope: e };
985
+ }
986
+ function P(e) {
987
+ const t2 = e?.indexOf("=") || -1;
988
+ return !e || t2 < 0 ? null : {
989
+ key: e.slice(0, t2).trim().toLowerCase(),
990
+ value: e.slice(t2 + 1)
991
+ };
992
+ }
993
+ function U(e) {
994
+ for (const { name: t2 } of w(e, "task"))
995
+ switch (t2) {
996
+ case "--global":
997
+ return "global";
998
+ case "--system":
999
+ return "system";
1000
+ case "--worktree":
1001
+ return "worktree";
1002
+ case "--local":
1003
+ return "local";
1004
+ case "--file":
1005
+ case "-f":
1006
+ return "file";
1007
+ }
1008
+ return "local";
1009
+ }
1010
+ function A({ name: e }) {
1011
+ if (e === "-c" || e === "--config")
1012
+ return "inline";
1013
+ if (e === "--config-env")
1014
+ return "env";
1015
+ }
1016
+ function* F(e) {
1017
+ for (const t2 of e) {
1018
+ const n = A(t2), o2 = n && P(t2.value);
1019
+ o2 && (yield {
1020
+ ...o2,
1021
+ scope: n
1022
+ });
1023
+ }
1024
+ }
1025
+ function M(e, t2, n) {
1026
+ const o2 = {
1027
+ read: [],
1028
+ write: [...F(t2)]
1029
+ };
1030
+ return e === "config" && G(
1031
+ o2,
1032
+ U(t2),
1033
+ C(t2, n)
1034
+ ), o2;
1035
+ }
1036
+ function G(e, t2, n) {
1037
+ if (n === null)
1038
+ return;
1039
+ const o2 = N(t2, n);
1040
+ n.isWrite ? e.write.push(o2) : e.read.push(o2);
1041
+ }
1042
+ var v = {
1043
+ short: /* @__PURE__ */ new Map([
1044
+ ["c", true]
1045
+ // -c <k=v> set config key for this invocation
1046
+ ])
1047
+ };
1048
+ var O = {
1049
+ short: new Map([
1050
+ ["C", true],
1051
+ // -C <path> change working directory
1052
+ ["P", false],
1053
+ // -P no pager (alias for --no-pager)
1054
+ ["h", false],
1055
+ // -h help
1056
+ ["p", false],
1057
+ // -p paginate
1058
+ ["v", false],
1059
+ // -v version
1060
+ ...v.short.entries()
1061
+ ]),
1062
+ long: /* @__PURE__ */ new Set([
1063
+ "attr-source",
1064
+ "config-env",
1065
+ "exec-path",
1066
+ "git-dir",
1067
+ "list-cmds",
1068
+ "namespace",
1069
+ "super-prefix",
1070
+ "work-tree"
1071
+ ])
1072
+ };
1073
+ var E = {
1074
+ clone: {
1075
+ short: /* @__PURE__ */ new Map([
1076
+ ["b", true],
1077
+ // -b <branch>
1078
+ ["j", true],
1079
+ // -j <n> parallel jobs
1080
+ ["l", false],
1081
+ // -l local
1082
+ ["n", false],
1083
+ // -n no-checkout
1084
+ ["o", true],
1085
+ // -o <name> remote name
1086
+ ["q", false],
1087
+ // -q quiet
1088
+ ["s", false],
1089
+ // -s shared
1090
+ ["u", true]
1091
+ // -u <upload-pack>
1092
+ ]),
1093
+ long: /* @__PURE__ */ new Set(["branch", "config", "jobs", "origin", "upload-pack", "u"])
1094
+ },
1095
+ commit: {
1096
+ short: /* @__PURE__ */ new Map([
1097
+ ["C", true],
1098
+ // -C <commit> reuse message
1099
+ ["F", true],
1100
+ // -F <file> read message from file
1101
+ ["c", true],
1102
+ // -c <commit> reedit message
1103
+ ["m", true],
1104
+ // -m <msg>
1105
+ ["t", true]
1106
+ // -t <template>
1107
+ ]),
1108
+ long: /* @__PURE__ */ new Set(["file", "message", "reedit-message", "reuse-message", "template"])
1109
+ },
1110
+ config: {
1111
+ short: /* @__PURE__ */ new Map([
1112
+ ["e", false],
1113
+ // -e open editor
1114
+ ["f", true],
1115
+ // -f <file>
1116
+ ["l", false]
1117
+ // -l list
1118
+ ]),
1119
+ long: /* @__PURE__ */ new Set(["blob", "comment", "default", "file", "type", "value"])
1120
+ },
1121
+ fetch: {
1122
+ short: /* @__PURE__ */ new Map(),
1123
+ long: /* @__PURE__ */ new Set(["upload-pack"])
1124
+ },
1125
+ pull: {
1126
+ short: /* @__PURE__ */ new Map(),
1127
+ long: /* @__PURE__ */ new Set(["upload-pack"])
1128
+ },
1129
+ push: {
1130
+ short: /* @__PURE__ */ new Map(),
1131
+ long: /* @__PURE__ */ new Set(["exec", "receive-pack"])
1132
+ }
1133
+ };
1134
+ var I = { short: /* @__PURE__ */ new Map(), long: /* @__PURE__ */ new Set() };
1135
+ function L(e) {
1136
+ const t2 = E[e ?? ""] ?? I;
1137
+ return {
1138
+ short: new Map([...v.short.entries(), ...t2.short.entries()]),
1139
+ long: t2.long
1140
+ };
1141
+ }
1142
+ function b(e, t2 = O) {
1143
+ if (e.startsWith("--")) {
1144
+ const n = e.indexOf("=");
1145
+ if (n > 2)
1146
+ return [{ name: e.slice(0, n), value: e.slice(n + 1), needsNext: false }];
1147
+ const o2 = e.slice(2);
1148
+ return [{ name: e, needsNext: t2.long.has(o2) }];
1149
+ }
1150
+ if (e.length === 2) {
1151
+ const n = e.charAt(1), o2 = t2.short.get(n);
1152
+ return [{ name: e, needsNext: o2 === true }];
1153
+ }
1154
+ return R(e, t2.short);
1155
+ }
1156
+ function R(e, t2) {
1157
+ const n = e.slice(1).split(""), o2 = [];
1158
+ for (let a = 0; a < n.length; a++) {
1159
+ const s = n[a], r2 = t2.get(s);
1160
+ if (r2 === void 0)
1161
+ return [{ name: e, needsNext: false }];
1162
+ if (r2) {
1163
+ const l = n.slice(a + 1).join("");
1164
+ if (l && ![...l].every((h) => t2.has(h)))
1165
+ return o2.push({ name: `-${s}`, value: l, needsNext: false }), o2;
1166
+ }
1167
+ o2.push({ name: `-${s}`, needsNext: r2 });
1168
+ }
1169
+ return o2;
1170
+ }
1171
+ function W(e, t2 = []) {
1172
+ let n = 0;
1173
+ for (; n < e.length; ) {
1174
+ const o2 = String(e[n]);
1175
+ if (!o2.startsWith("-") || o2.length < 2) break;
1176
+ const a = b(o2);
1177
+ let s = n + 1;
1178
+ for (const r2 of a) {
1179
+ const l = {
1180
+ name: r2.name,
1181
+ value: r2.value,
1182
+ absorbedNext: false,
1183
+ isGlobal: true
1184
+ };
1185
+ r2.needsNext && l.value === void 0 && s < e.length && (l.value = String(e[s]), l.absorbedNext = true, s++), t2.push(l);
1186
+ }
1187
+ n = s;
1188
+ }
1189
+ return { flags: t2, taskIndex: n };
1190
+ }
1191
+ function _(e, t2, n = []) {
1192
+ const o2 = L(t2), a = [], s = [];
1193
+ let r2 = 0;
1194
+ for (; r2 < e.length; ) {
1195
+ const l = e[r2];
1196
+ if (r(l)) {
1197
+ s.push(...o(l)), r2++;
1198
+ continue;
1199
+ }
1200
+ const u = String(l);
1201
+ if (u === "--") {
1202
+ for (let c2 = r2 + 1; c2 < e.length; c2++) {
1203
+ const i = e[c2];
1204
+ r(i) ? s.push(...o(i)) : s.push(String(i));
1205
+ }
1206
+ break;
1207
+ }
1208
+ if (!u.startsWith("-") || u.length < 2) {
1209
+ a.push(u), r2++;
1210
+ continue;
1211
+ }
1212
+ const h = b(u, o2);
1213
+ let d = r2 + 1;
1214
+ for (const c2 of h) {
1215
+ const i = {
1216
+ name: c2.name,
1217
+ value: c2.value,
1218
+ absorbedNext: false,
1219
+ isGlobal: false
1220
+ };
1221
+ c2.needsNext && i.value === void 0 && d < e.length && !r(e[d]) && (i.value = String(e[d]), i.absorbedNext = true, d++), n.push(i);
1222
+ }
1223
+ r2 = d;
1224
+ }
1225
+ return { flags: n, positionals: a, pathspecs: s };
1226
+ }
1227
+ function* T({ write: e }) {
1228
+ for (const t2 of e)
1229
+ for (const n of $) {
1230
+ const o2 = n(t2.key);
1231
+ o2 && (yield o2);
1232
+ }
1233
+ }
1234
+ function g(e, t2, n = String(e)) {
1235
+ const o2 = typeof e == "string" ? new RegExp(`\\s*${e}`, "i") : e;
1236
+ return function(s) {
1237
+ if (o2.test(s))
1238
+ return {
1239
+ category: t2,
1240
+ message: `Configuring ${n} is not permitted without enabling ${t2}`
1241
+ };
1242
+ };
1243
+ }
1244
+ var $ = [
1245
+ g(
1246
+ /^\s*protocol(.[a-z]+)?.allow/i,
1247
+ "allowUnsafeProtocolOverride",
1248
+ "protocol.allow"
1249
+ ),
1250
+ g("core.sshCommand", "allowUnsafeSshCommand"),
1251
+ g("core.fsmonitor", "allowUnsafeFsMonitor"),
1252
+ g("core.gitProxy", "allowUnsafeGitProxy"),
1253
+ g("core.hooksPath", "allowUnsafeHooksPath"),
1254
+ g("diff.external", "allowUnsafeDiffExternal")
1255
+ ];
1256
+ function* j(e, t2) {
1257
+ for (const n of t2)
1258
+ /^--(upload|receive)-pack/.test(n.name) && (yield {
1259
+ category: "allowUnsafePack",
1260
+ message: "Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack"
1261
+ }), e === "clone" && (/^-\w*u/.test(n.name) || n.name === "--u") && (yield {
1262
+ category: "allowUnsafePack",
1263
+ message: "Use of clone with option -u is not permitted without enabling allowUnsafePack"
1264
+ }), e === "push" && /^--exec/.test(n.name) && (yield {
1265
+ category: "allowUnsafePack",
1266
+ message: "Use of push with option --exec is not permitted without enabling allowUnsafePack"
1267
+ });
1268
+ }
1269
+ function B(e, t2, n) {
1270
+ const o2 = [
1271
+ ...j(e, t2),
1272
+ ...T(n)
1273
+ ];
1274
+ return {
1275
+ categories: o2.reduce((s, r2) => s.add(r2.category), /* @__PURE__ */ new Set()),
1276
+ vulnerabilities: o2
1277
+ };
1278
+ }
1279
+ function V(...e) {
1280
+ const { flags: t2, taskIndex: n } = W(e), o2 = n < e.length ? String(e[n]).toLowerCase() : null, a = o2 !== null ? e.slice(n + 1) : [], { positionals: s, pathspecs: r2 } = _(a, o2, t2), l = M(o2, t2, s);
1281
+ return {
1282
+ task: o2,
1283
+ flags: t2.map(D),
1284
+ paths: r2,
1285
+ config: l,
1286
+ vulnerabilities: B(o2, t2, l)
1287
+ };
1288
+ }
1289
+ function D({ value: e, name: t2 }) {
1290
+ return e !== void 0 ? { name: t2, value: e } : { name: t2 };
1291
+ }
1292
+
1293
+ // ../../node_modules/.pnpm/simple-git@3.35.2/node_modules/simple-git/dist/esm/index.js
914
1294
  var import_promise_deferred2 = __toESM(require_dist2(), 1);
915
1295
  var import_node_events = require("events");
916
1296
  var __defProp2 = Object.defineProperty;
@@ -936,24 +1316,6 @@ var __copyProps2 = (to, from, except, desc) => {
936
1316
  return to;
937
1317
  };
938
1318
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
939
- function pathspec(...paths) {
940
- const key = new String(paths);
941
- cache.set(key, paths);
942
- return key;
943
- }
944
- function isPathSpec(path3) {
945
- return path3 instanceof String && cache.has(path3);
946
- }
947
- function toPaths(pathSpec) {
948
- return cache.get(pathSpec) || [];
949
- }
950
- var cache;
951
- var init_pathspec = __esm({
952
- "src/lib/args/pathspec.ts"() {
953
- "use strict";
954
- cache = /* @__PURE__ */ new WeakMap();
955
- }
956
- });
957
1319
  var GitError;
958
1320
  var init_git_error = __esm({
959
1321
  "src/lib/errors/git-error.ts"() {
@@ -1129,7 +1491,7 @@ function filterType(input, filter, def) {
1129
1491
  return arguments.length > 2 ? def : void 0;
1130
1492
  }
1131
1493
  function filterPrimitives(input, omit) {
1132
- const type = isPathSpec(input) ? "string" : typeof input;
1494
+ const type = r(input) ? "string" : typeof input;
1133
1495
  return /number|string|boolean/.test(type) && (!omit || !omit.includes(type));
1134
1496
  }
1135
1497
  function filterPlainObject(input) {
@@ -1146,7 +1508,6 @@ var filterHasLength;
1146
1508
  var init_argument_filters = __esm({
1147
1509
  "src/lib/utils/argument-filters.ts"() {
1148
1510
  "use strict";
1149
- init_pathspec();
1150
1511
  init_util();
1151
1512
  filterArray = (input) => {
1152
1513
  return Array.isArray(input);
@@ -1155,7 +1516,7 @@ var init_argument_filters = __esm({
1155
1516
  return typeof input === "number";
1156
1517
  };
1157
1518
  filterString = (input) => {
1158
- return typeof input === "string" || isPathSpec(input);
1519
+ return typeof input === "string" || r(input);
1159
1520
  };
1160
1521
  filterStringOrStringArray = (input) => {
1161
1522
  return filterString(input) || Array.isArray(input) && input.every(filterString);
@@ -1253,7 +1614,7 @@ function createInstanceConfig(...options) {
1253
1614
  const baseDir = process.cwd();
1254
1615
  const config = Object.assign(
1255
1616
  { baseDir, ...defaultOptions },
1256
- ...options.filter((o) => typeof o === "object" && o)
1617
+ ...options.filter((o2) => typeof o2 === "object" && o2)
1257
1618
  );
1258
1619
  config.baseDir = config.baseDir || baseDir;
1259
1620
  config.trimmed = config.trimmed === true;
@@ -1277,14 +1638,14 @@ function appendTaskOptions(options, commands = []) {
1277
1638
  }
1278
1639
  return Object.keys(options).reduce((commands2, key) => {
1279
1640
  const value = options[key];
1280
- if (isPathSpec(value)) {
1641
+ if (r(value)) {
1281
1642
  commands2.push(value);
1282
1643
  } else if (filterPrimitives(value, ["boolean"])) {
1283
1644
  commands2.push(key + "=" + value);
1284
1645
  } else if (Array.isArray(value)) {
1285
- for (const v of value) {
1286
- if (!filterPrimitives(v, ["string", "number"])) {
1287
- commands2.push(key + "=" + v);
1646
+ for (const v2 of value) {
1647
+ if (!filterPrimitives(v2, ["string", "number"])) {
1648
+ commands2.push(key + "=" + v2);
1288
1649
  }
1289
1650
  }
1290
1651
  } else {
@@ -1323,7 +1684,6 @@ var init_task_options = __esm({
1323
1684
  "use strict";
1324
1685
  init_argument_filters();
1325
1686
  init_util();
1326
- init_pathspec();
1327
1687
  }
1328
1688
  });
1329
1689
  function callTaskParser(parser4, streams) {
@@ -2998,7 +3358,7 @@ function parseLogOptions(opt = {}, customArgs = []) {
2998
3358
  suffix.push(`${opt.from || ""}${rangeOperator}${opt.to || ""}`);
2999
3359
  }
3000
3360
  if (filterString(opt.file)) {
3001
- command.push("--follow", pathspec(opt.file));
3361
+ command.push("--follow", c(opt.file));
3002
3362
  }
3003
3363
  appendTaskOptions(userOptions(opt), command);
3004
3364
  return {
@@ -3041,7 +3401,6 @@ var init_log = __esm({
3041
3401
  "src/lib/tasks/log.ts"() {
3042
3402
  "use strict";
3043
3403
  init_log_format();
3044
- init_pathspec();
3045
3404
  init_parse_list_log_summary();
3046
3405
  init_utils();
3047
3406
  init_task();
@@ -3530,7 +3889,7 @@ function parser3(indexX, indexY, handler) {
3530
3889
  return [`${indexX}${indexY}`, handler];
3531
3890
  }
3532
3891
  function conflicts(indexX, ...indexY) {
3533
- return indexY.map((y) => parser3(indexX, y, (result, file) => result.conflicted.push(file)));
3892
+ return indexY.map((y2) => parser3(indexX, y2, (result, file) => result.conflicted.push(file)));
3534
3893
  }
3535
3894
  function splitLine(result, lineStr) {
3536
3895
  const trimmed2 = lineStr.trim();
@@ -3820,11 +4179,10 @@ var init_clone = __esm({
3820
4179
  "use strict";
3821
4180
  init_task();
3822
4181
  init_utils();
3823
- init_pathspec();
3824
4182
  cloneTask = (repo, directory, customArgs) => {
3825
4183
  const commands = ["clone", ...customArgs];
3826
- filterString(repo) && commands.push(pathspec(repo));
3827
- filterString(directory) && commands.push(pathspec(directory));
4184
+ filterString(repo) && commands.push(c(repo));
4185
+ filterString(directory) && commands.push(c(directory));
3828
4186
  return straightThroughStringTask(commands);
3829
4187
  };
3830
4188
  cloneMirrorTask = (repo, directory, customArgs) => {
@@ -4235,7 +4593,7 @@ function deleteBranchTask(branch, forceDelete = false) {
4235
4593
  parser(stdOut, stdErr) {
4236
4594
  return parseBranchDeletions(stdOut, stdErr).branches[branch];
4237
4595
  },
4238
- onError({ exitCode, stdErr, stdOut }, error, _, fail) {
4596
+ onError({ exitCode, stdErr, stdOut }, error, _2, fail) {
4239
4597
  if (!hasBranchDeletionError(String(error), exitCode)) {
4240
4598
  return fail(error);
4241
4599
  }
@@ -4565,16 +4923,16 @@ var init_sub_module = __esm({
4565
4923
  init_task();
4566
4924
  }
4567
4925
  });
4568
- function singleSorted(a, b) {
4926
+ function singleSorted(a, b2) {
4569
4927
  const aIsNum = Number.isNaN(a);
4570
- const bIsNum = Number.isNaN(b);
4928
+ const bIsNum = Number.isNaN(b2);
4571
4929
  if (aIsNum !== bIsNum) {
4572
4930
  return aIsNum ? 1 : -1;
4573
4931
  }
4574
- return aIsNum ? sorted(a, b) : 0;
4932
+ return aIsNum ? sorted(a, b2) : 0;
4575
4933
  }
4576
- function sorted(a, b) {
4577
- return a === b ? 0 : a > b ? 1 : -1;
4934
+ function sorted(a, b2) {
4935
+ return a === b2 ? 0 : a > b2 ? 1 : -1;
4578
4936
  }
4579
4937
  function trimmed(input) {
4580
4938
  return input.trim();
@@ -5027,7 +5385,6 @@ var require_git = __commonJS2({
5027
5385
  module2.exports = Git2;
5028
5386
  }
5029
5387
  });
5030
- init_pathspec();
5031
5388
  init_git_error();
5032
5389
  var GitConstructError = class extends GitError {
5033
5390
  constructor(config, message) {
@@ -5077,74 +5434,16 @@ function abortPlugin(signal) {
5077
5434
  };
5078
5435
  return [onSpawnBefore, onSpawnAfter];
5079
5436
  }
5080
- function isConfigSwitch(arg) {
5081
- return typeof arg === "string" && arg.trim().toLowerCase() === "-c";
5082
- }
5083
- function isCloneUploadPackSwitch(char, arg) {
5084
- if (typeof arg !== "string" || !arg.includes(char)) {
5085
- return false;
5086
- }
5087
- const cleaned = arg.trim().replace(/\0/g, "");
5088
- return /^(--no)?-{1,2}[\dlsqvnobucj]+(\s|$)/.test(cleaned);
5089
- }
5090
- function preventConfigBuilder(config, setting, message = String(config)) {
5091
- const regex = typeof config === "string" ? new RegExp(`\\s*${config}`, "i") : config;
5092
- return function preventCommand(options, arg, next) {
5093
- if (options[setting] !== true && isConfigSwitch(arg) && regex.test(next)) {
5094
- throw new GitPluginError(
5095
- void 0,
5096
- "unsafe",
5097
- `Configuring ${message} is not permitted without enabling ${setting}`
5098
- );
5099
- }
5100
- };
5101
- }
5102
- var preventUnsafeConfig = [
5103
- preventConfigBuilder(
5104
- /^\s*protocol(.[a-z]+)?.allow/i,
5105
- "allowUnsafeProtocolOverride",
5106
- "protocol.allow"
5107
- ),
5108
- preventConfigBuilder("core.sshCommand", "allowUnsafeSshCommand"),
5109
- preventConfigBuilder("core.gitProxy", "allowUnsafeGitProxy"),
5110
- preventConfigBuilder("core.hooksPath", "allowUnsafeHooksPath"),
5111
- preventConfigBuilder("diff.external", "allowUnsafeDiffExternal")
5112
- ];
5113
- function preventUploadPack(arg, method) {
5114
- if (/^\s*--(upload|receive)-pack/.test(arg)) {
5115
- throw new GitPluginError(
5116
- void 0,
5117
- "unsafe",
5118
- `Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack`
5119
- );
5120
- }
5121
- if (method === "clone" && isCloneUploadPackSwitch("u", arg)) {
5122
- throw new GitPluginError(
5123
- void 0,
5124
- "unsafe",
5125
- `Use of clone with option -u is not permitted without enabling allowUnsafePack`
5126
- );
5127
- }
5128
- if (method === "push" && /^\s*--exec\b/.test(arg)) {
5129
- throw new GitPluginError(
5130
- void 0,
5131
- "unsafe",
5132
- `Use of push with option --exec is not permitted without enabling allowUnsafePack`
5133
- );
5134
- }
5135
- }
5136
- function blockUnsafeOperationsPlugin({
5137
- allowUnsafePack = false,
5138
- ...options
5139
- } = {}) {
5437
+ function blockUnsafeOperationsPlugin(options = {}) {
5140
5438
  return {
5141
5439
  type: "spawn.args",
5142
- action(args, context) {
5143
- args.forEach((current, index) => {
5144
- const next = index < args.length ? args[index + 1] : "";
5145
- allowUnsafePack || preventUploadPack(current, context.method);
5146
- preventUnsafeConfig.forEach((helper) => helper(options, current, next));
5147
- });
5440
+ action(args) {
5441
+ const parsed = V(...args);
5442
+ for (const vulnerability of parsed.vulnerabilities.vulnerabilities) {
5443
+ if (options[vulnerability.category] !== true) {
5444
+ throw new GitPluginError(void 0, "unsafe", vulnerability.message);
5445
+ }
5446
+ }
5148
5447
  return args;
5149
5448
  }
5150
5449
  };
@@ -5409,7 +5708,6 @@ function timeoutPlugin({
5409
5708
  };
5410
5709
  }
5411
5710
  }
5412
- init_pathspec();
5413
5711
  function suffixPathsPlugin() {
5414
5712
  return {
5415
5713
  type: "spawn.args",
@@ -5421,13 +5719,13 @@ function suffixPathsPlugin() {
5421
5719
  }
5422
5720
  for (let i = 0; i < data.length; i++) {
5423
5721
  const param = data[i];
5424
- if (isPathSpec(param)) {
5425
- append2(toPaths(param));
5722
+ if (r(param)) {
5723
+ append2(o(param));
5426
5724
  continue;
5427
5725
  }
5428
5726
  if (param === "--") {
5429
5727
  append2(
5430
- data.slice(i + 1).flatMap((item) => isPathSpec(item) && toPaths(item) || item)
5728
+ data.slice(i + 1).flatMap((item) => r(item) && o(item) || item)
5431
5729
  );
5432
5730
  break;
5433
5731
  }
@@ -6600,6 +6898,7 @@ var JsonError = class _JsonError extends Error {
6600
6898
  this.errors = errors;
6601
6899
  Object.setPrototypeOf(this, _JsonError.prototype);
6602
6900
  }
6901
+ errors;
6603
6902
  };
6604
6903
 
6605
6904
  // src/configuration/sdk/core/schemas/builders/schema-utils/ParseError.ts
@@ -6609,6 +6908,7 @@ var ParseError = class _ParseError extends Error {
6609
6908
  this.errors = errors;
6610
6909
  Object.setPrototypeOf(this, _ParseError.prototype);
6611
6910
  }
6911
+ errors;
6612
6912
  };
6613
6913
 
6614
6914
  // src/configuration/sdk/core/schemas/builders/schema-utils/getSchemaUtils.ts
@@ -8288,6 +8588,7 @@ var StreamWriter = class extends Writer {
8288
8588
  this.stream = stream;
8289
8589
  this.stream = stream;
8290
8590
  }
8591
+ stream;
8291
8592
  async write(content) {
8292
8593
  return new Promise((resolve4, reject) => {
8293
8594
  const handleError = (err) => {
@@ -8422,7 +8723,7 @@ var BlockList = class {
8422
8723
  addBlock(block) {
8423
8724
  if (this.hasBlock(block.id)) {
8424
8725
  console.warn(`[readme] Duplicate block with id "${block.id}" detected; overriding with latest content`);
8425
- this.blocks = this.blocks.filter((b) => b.id !== block.id);
8726
+ this.blocks = this.blocks.filter((b2) => b2.id !== block.id);
8426
8727
  }
8427
8728
  this.ids.add(block.id);
8428
8729
  this.blocks.push(block);
@@ -8437,7 +8738,7 @@ var BlockList = class {
8437
8738
  insertBlock(block, precedingBlockId) {
8438
8739
  if (this.hasBlock(block.id)) {
8439
8740
  console.warn(`[readme] Duplicate block with id "${block.id}" detected; overriding with latest content`);
8440
- this.blocks = this.blocks.filter((b) => b.id !== block.id);
8741
+ this.blocks = this.blocks.filter((b2) => b2.id !== block.id);
8441
8742
  this.ids.delete(block.id);
8442
8743
  }
8443
8744
  if (precedingBlockId === void 0) {
@@ -8449,7 +8750,7 @@ var BlockList = class {
8449
8750
  }
8450
8751
  this.ids.add(block.id);
8451
8752
  this.blocks.splice(
8452
- this.blocks.findIndex((b) => b.id === precedingBlockId),
8753
+ this.blocks.findIndex((b2) => b2.id === precedingBlockId),
8453
8754
  0,
8454
8755
  block
8455
8756
  );
@@ -9309,8 +9610,8 @@ function pascalCase(s) {
9309
9610
  function getMajorVersion(version) {
9310
9611
  return version.split(".")[0] ?? "0";
9311
9612
  }
9312
- function assertNever(x) {
9313
- throw new Error(`unexpected value: ${JSON.stringify(x)}`);
9613
+ function assertNever(x2) {
9614
+ throw new Error(`unexpected value: ${JSON.stringify(x2)}`);
9314
9615
  }
9315
9616
  function toScreamingSnakeCase(s) {
9316
9617
  return s.toUpperCase().replace(/ /g, "_");
@@ -9953,6 +10254,8 @@ var BaseStep = class {
9953
10254
  this.outputDir = outputDir;
9954
10255
  this.logger = logger;
9955
10256
  }
10257
+ outputDir;
10258
+ logger;
9956
10259
  };
9957
10260
 
9958
10261
  // src/pipeline/steps/GithubStep.ts
@@ -9961,6 +10264,7 @@ var GithubStep = class extends BaseStep {
9961
10264
  super(outputDir, logger);
9962
10265
  this.config = config;
9963
10266
  }
10267
+ config;
9964
10268
  name = "github";
9965
10269
  async execute(context) {
9966
10270
  const replayResult = context.previousStepResults.replay;
@@ -10191,7 +10495,8 @@ var import_path5 = require("path");
10191
10495
  var import_fs2 = require("fs");
10192
10496
  var import_promises3 = require("fs/promises");
10193
10497
  var import_path4 = require("path");
10194
- var REPLAY_FERNIGNORE_ENTRIES = [".fern/replay.lock"];
10498
+ var REPLAY_FERNIGNORE_ENTRIES = [".fern/replay.lock", ".fern/replay.yml", ".gitattributes"];
10499
+ var GITATTRIBUTES_ENTRIES = [".fern/replay.lock linguist-generated=true"];
10195
10500
  async function ensureReplayFernignoreEntries(outputDir) {
10196
10501
  const fernignorePath = (0, import_path4.join)(outputDir, ".fernignore");
10197
10502
  let content = "";
@@ -10208,6 +10513,20 @@ async function ensureReplayFernignoreEntries(outputDir) {
10208
10513
  }
10209
10514
  return false;
10210
10515
  }
10516
+ async function ensureGitattributesEntries(outputDir) {
10517
+ const gitattributesPath = (0, import_path4.join)(outputDir, ".gitattributes");
10518
+ let content = "";
10519
+ try {
10520
+ content = await (0, import_promises3.readFile)(gitattributesPath, "utf-8");
10521
+ } catch {
10522
+ }
10523
+ const lines = content.split("\n");
10524
+ const toAdd = GITATTRIBUTES_ENTRIES.filter((entry) => !lines.some((line) => line.trim() === entry));
10525
+ if (toAdd.length > 0) {
10526
+ const suffix = content.length > 0 && !content.endsWith("\n") ? "\n" : "";
10527
+ await (0, import_promises3.writeFile)(gitattributesPath, content + suffix + toAdd.join("\n") + "\n", "utf-8");
10528
+ }
10529
+ }
10211
10530
  function ensureReplayFernignoreEntriesSync(outputDir) {
10212
10531
  const fernignorePath = (0, import_path4.join)(outputDir, ".fernignore");
10213
10532
  let content = "";
@@ -10221,6 +10540,19 @@ function ensureReplayFernignoreEntriesSync(outputDir) {
10221
10540
  (0, import_fs2.writeFileSync)(fernignorePath, content + suffix + toAdd.join("\n") + "\n", "utf-8");
10222
10541
  }
10223
10542
  }
10543
+ function ensureGitattributesEntriesSync(outputDir) {
10544
+ const gitattributesPath = (0, import_path4.join)(outputDir, ".gitattributes");
10545
+ let content = "";
10546
+ if ((0, import_fs2.existsSync)(gitattributesPath)) {
10547
+ content = (0, import_fs2.readFileSync)(gitattributesPath, "utf-8");
10548
+ }
10549
+ const lines = content.split("\n");
10550
+ const toAdd = GITATTRIBUTES_ENTRIES.filter((entry) => !lines.some((line) => line.trim() === entry));
10551
+ if (toAdd.length > 0) {
10552
+ const suffix = content.length > 0 && !content.endsWith("\n") ? "\n" : "";
10553
+ (0, import_fs2.writeFileSync)(gitattributesPath, content + suffix + toAdd.join("\n") + "\n", "utf-8");
10554
+ }
10555
+ }
10224
10556
 
10225
10557
  // src/replay/replay-run.ts
10226
10558
  async function replayRun(params) {
@@ -10251,7 +10583,7 @@ async function replayRun(params) {
10251
10583
  if (lockManager.exists()) {
10252
10584
  const lock = lockManager.read();
10253
10585
  previousGenerationSha = lock.current_generation;
10254
- const latestGen = lock.generations.find((g) => g.commit_sha === lock.current_generation);
10586
+ const latestGen = lock.generations.find((g2) => g2.commit_sha === lock.current_generation);
10255
10587
  prevBaseBranchHead = latestGen?.base_branch_head ?? null;
10256
10588
  }
10257
10589
  } catch {
@@ -10318,7 +10650,7 @@ async function replayRun(params) {
10318
10650
  if (freshLockManager.exists()) {
10319
10651
  const freshLock = freshLockManager.read();
10320
10652
  currentGenerationSha = freshLock.current_generation;
10321
- const latestGen = freshLock.generations.find((g) => g.commit_sha === freshLock.current_generation);
10653
+ const latestGen = freshLock.generations.find((g2) => g2.commit_sha === freshLock.current_generation);
10322
10654
  if (latestGen?.base_branch_head) {
10323
10655
  resolvedBaseBranchHead = latestGen.base_branch_head;
10324
10656
  }
@@ -10326,6 +10658,7 @@ async function replayRun(params) {
10326
10658
  } catch {
10327
10659
  }
10328
10660
  const fernignoreUpdated = await ensureReplayFernignoreEntries(outputDir);
10661
+ await ensureGitattributesEntries(outputDir);
10329
10662
  return {
10330
10663
  report,
10331
10664
  fernignoreUpdated,
@@ -10367,6 +10700,10 @@ var ReplayStep = class extends BaseStep {
10367
10700
  this.generatorVersions = generatorVersions;
10368
10701
  this.generatorName = generatorName;
10369
10702
  }
10703
+ config;
10704
+ cliVersion;
10705
+ generatorVersions;
10706
+ generatorName;
10370
10707
  name = "replay";
10371
10708
  async execute(_context) {
10372
10709
  const result = await replayRun({
@@ -10410,9 +10747,9 @@ var ReplayStep = class extends BaseStep {
10410
10747
  patchId: info.patchId,
10411
10748
  patchMessage: info.patchMessage,
10412
10749
  files: info.files,
10413
- conflictDetails: info.conflictDetails.map((f) => ({
10414
- file: f.file,
10415
- conflictReason: f.conflictReason
10750
+ conflictDetails: info.conflictDetails.map((f2) => ({
10751
+ file: f2.file,
10752
+ conflictReason: f2.conflictReason
10416
10753
  }))
10417
10754
  })),
10418
10755
  warnings: report.warnings
@@ -10447,6 +10784,8 @@ var PostGenerationPipeline = class {
10447
10784
  this.steps.push(new GithubStep(config.outputDir, this.logger, config.github));
10448
10785
  }
10449
10786
  }
10787
+ config;
10788
+ logger;
10450
10789
  steps = [];
10451
10790
  async run() {
10452
10791
  if (this.config.github?.enabled) {
@@ -10524,6 +10863,7 @@ async function replayInit(params) {
10524
10863
  return { bootstrap: bootstrapResult, fernignoreEntries: [] };
10525
10864
  }
10526
10865
  ensureReplayFernignoreEntriesSync(repoPath);
10866
+ ensureGitattributesEntriesSync(repoPath);
10527
10867
  const lockfilePath = (0, import_path6.join)(repoPath, ".fern", "replay.lock");
10528
10868
  const lockfileContent = (0, import_fs4.existsSync)(lockfilePath) ? (0, import_fs4.readFileSync)(lockfilePath, "utf-8") : void 0;
10529
10869
  const replayYmlPath = (0, import_path6.join)(repoPath, ".fern", "replay.yml");
@@ -10540,7 +10880,7 @@ function formatBootstrapSummary(result) {
10540
10880
  const entries2 = [];
10541
10881
  const bs = result.bootstrap;
10542
10882
  if (!bs.generationCommit) {
10543
- const lockfileExists = bs.warnings.some((w) => w.includes("lockfile already exists"));
10883
+ const lockfileExists = bs.warnings.some((w2) => w2.includes("lockfile already exists"));
10544
10884
  if (lockfileExists) {
10545
10885
  entries2.push({
10546
10886
  level: "warn",
@@ -10588,8 +10928,8 @@ function formatBootstrapSummary(result) {
10588
10928
  }
10589
10929
  if (bs.warnings.length > 0) {
10590
10930
  entries2.push({ level: "info", message: "\nWarnings:" });
10591
- for (const w of bs.warnings) {
10592
- entries2.push({ level: "warn", message: ` ${w}` });
10931
+ for (const w2 of bs.warnings) {
10932
+ entries2.push({ level: "warn", message: ` ${w2}` });
10593
10933
  }
10594
10934
  }
10595
10935
  return entries2;
@@ -10632,8 +10972,8 @@ function buildPrBody(result) {
10632
10972
  if (result.warnings.length > 0) {
10633
10973
  lines.push("### Warnings");
10634
10974
  lines.push("");
10635
- for (const w of result.warnings) {
10636
- lines.push(`- ${w}`);
10975
+ for (const w2 of result.warnings) {
10976
+ lines.push(`- ${w2}`);
10637
10977
  }
10638
10978
  lines.push("");
10639
10979
  }