@fern-api/generator-cli 0.1.1 → 0.1.3

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 (2) hide show
  1. package/dist/cli.cjs +27 -659
  2. package/package.json +3 -3
package/dist/cli.cjs CHANGED
@@ -5035,9 +5035,9 @@ var require_ms = __commonJS({
5035
5035
  }
5036
5036
  });
5037
5037
 
5038
- // ../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js
5038
+ // ../../node_modules/.pnpm/debug@4.4.1_supports-color@5.5.0/node_modules/debug/src/common.js
5039
5039
  var require_common = __commonJS({
5040
- "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js"(exports2, module2) {
5040
+ "../../node_modules/.pnpm/debug@4.4.1_supports-color@5.5.0/node_modules/debug/src/common.js"(exports2, module2) {
5041
5041
  "use strict";
5042
5042
  function setup(env2) {
5043
5043
  createDebug.debug = createDebug;
@@ -5139,7 +5139,7 @@ var require_common = __commonJS({
5139
5139
  createDebug.namespaces = namespaces;
5140
5140
  createDebug.names = [];
5141
5141
  createDebug.skips = [];
5142
- const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
5142
+ const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
5143
5143
  for (const ns of split) {
5144
5144
  if (ns[0] === "-") {
5145
5145
  createDebug.skips.push(ns.slice(1));
@@ -5213,9 +5213,9 @@ var require_common = __commonJS({
5213
5213
  }
5214
5214
  });
5215
5215
 
5216
- // ../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js
5216
+ // ../../node_modules/.pnpm/debug@4.4.1_supports-color@5.5.0/node_modules/debug/src/browser.js
5217
5217
  var require_browser = __commonJS({
5218
- "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js"(exports2, module2) {
5218
+ "../../node_modules/.pnpm/debug@4.4.1_supports-color@5.5.0/node_modules/debug/src/browser.js"(exports2, module2) {
5219
5219
  "use strict";
5220
5220
  exports2.formatArgs = formatArgs;
5221
5221
  exports2.save = save;
@@ -5358,7 +5358,7 @@ var require_browser = __commonJS({
5358
5358
  function load() {
5359
5359
  let r;
5360
5360
  try {
5361
- r = exports2.storage.getItem("debug");
5361
+ r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
5362
5362
  } catch (error) {
5363
5363
  }
5364
5364
  if (!r && typeof process !== "undefined" && "env" in process) {
@@ -5493,9 +5493,9 @@ var require_supports_color = __commonJS({
5493
5493
  }
5494
5494
  });
5495
5495
 
5496
- // ../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js
5496
+ // ../../node_modules/.pnpm/debug@4.4.1_supports-color@5.5.0/node_modules/debug/src/node.js
5497
5497
  var require_node = __commonJS({
5498
- "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js"(exports2, module2) {
5498
+ "../../node_modules/.pnpm/debug@4.4.1_supports-color@5.5.0/node_modules/debug/src/node.js"(exports2, module2) {
5499
5499
  "use strict";
5500
5500
  var tty = require("tty");
5501
5501
  var util = require("util");
@@ -5668,9 +5668,9 @@ var require_node = __commonJS({
5668
5668
  }
5669
5669
  });
5670
5670
 
5671
- // ../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js
5671
+ // ../../node_modules/.pnpm/debug@4.4.1_supports-color@5.5.0/node_modules/debug/src/index.js
5672
5672
  var require_src = __commonJS({
5673
- "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js"(exports2, module2) {
5673
+ "../../node_modules/.pnpm/debug@4.4.1_supports-color@5.5.0/node_modules/debug/src/index.js"(exports2, module2) {
5674
5674
  "use strict";
5675
5675
  if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
5676
5676
  module2.exports = require_browser();
@@ -5736,644 +5736,6 @@ var require_dist = __commonJS({
5736
5736
  }
5737
5737
  });
5738
5738
 
5739
- // ../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js
5740
- var require_ms2 = __commonJS({
5741
- "../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js"(exports2, module2) {
5742
- "use strict";
5743
- var s = 1e3;
5744
- var m = s * 60;
5745
- var h = m * 60;
5746
- var d = h * 24;
5747
- var w = d * 7;
5748
- var y = d * 365.25;
5749
- module2.exports = function(val, options) {
5750
- options = options || {};
5751
- var type = typeof val;
5752
- if (type === "string" && val.length > 0) {
5753
- return parse(val);
5754
- } else if (type === "number" && isFinite(val)) {
5755
- return options.long ? fmtLong(val) : fmtShort(val);
5756
- }
5757
- throw new Error(
5758
- "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
5759
- );
5760
- };
5761
- function parse(str) {
5762
- str = String(str);
5763
- if (str.length > 100) {
5764
- return;
5765
- }
5766
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
5767
- str
5768
- );
5769
- if (!match) {
5770
- return;
5771
- }
5772
- var n = parseFloat(match[1]);
5773
- var type = (match[2] || "ms").toLowerCase();
5774
- switch (type) {
5775
- case "years":
5776
- case "year":
5777
- case "yrs":
5778
- case "yr":
5779
- case "y":
5780
- return n * y;
5781
- case "weeks":
5782
- case "week":
5783
- case "w":
5784
- return n * w;
5785
- case "days":
5786
- case "day":
5787
- case "d":
5788
- return n * d;
5789
- case "hours":
5790
- case "hour":
5791
- case "hrs":
5792
- case "hr":
5793
- case "h":
5794
- return n * h;
5795
- case "minutes":
5796
- case "minute":
5797
- case "mins":
5798
- case "min":
5799
- case "m":
5800
- return n * m;
5801
- case "seconds":
5802
- case "second":
5803
- case "secs":
5804
- case "sec":
5805
- case "s":
5806
- return n * s;
5807
- case "milliseconds":
5808
- case "millisecond":
5809
- case "msecs":
5810
- case "msec":
5811
- case "ms":
5812
- return n;
5813
- default:
5814
- return void 0;
5815
- }
5816
- }
5817
- function fmtShort(ms) {
5818
- var msAbs = Math.abs(ms);
5819
- if (msAbs >= d) {
5820
- return Math.round(ms / d) + "d";
5821
- }
5822
- if (msAbs >= h) {
5823
- return Math.round(ms / h) + "h";
5824
- }
5825
- if (msAbs >= m) {
5826
- return Math.round(ms / m) + "m";
5827
- }
5828
- if (msAbs >= s) {
5829
- return Math.round(ms / s) + "s";
5830
- }
5831
- return ms + "ms";
5832
- }
5833
- function fmtLong(ms) {
5834
- var msAbs = Math.abs(ms);
5835
- if (msAbs >= d) {
5836
- return plural(ms, msAbs, d, "day");
5837
- }
5838
- if (msAbs >= h) {
5839
- return plural(ms, msAbs, h, "hour");
5840
- }
5841
- if (msAbs >= m) {
5842
- return plural(ms, msAbs, m, "minute");
5843
- }
5844
- if (msAbs >= s) {
5845
- return plural(ms, msAbs, s, "second");
5846
- }
5847
- return ms + " ms";
5848
- }
5849
- function plural(ms, msAbs, n, name) {
5850
- var isPlural = msAbs >= n * 1.5;
5851
- return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
5852
- }
5853
- }
5854
- });
5855
-
5856
- // ../../node_modules/.pnpm/debug@4.3.4_supports-color@5.5.0/node_modules/debug/src/common.js
5857
- var require_common2 = __commonJS({
5858
- "../../node_modules/.pnpm/debug@4.3.4_supports-color@5.5.0/node_modules/debug/src/common.js"(exports2, module2) {
5859
- "use strict";
5860
- function setup(env2) {
5861
- createDebug.debug = createDebug;
5862
- createDebug.default = createDebug;
5863
- createDebug.coerce = coerce;
5864
- createDebug.disable = disable;
5865
- createDebug.enable = enable;
5866
- createDebug.enabled = enabled;
5867
- createDebug.humanize = require_ms2();
5868
- createDebug.destroy = destroy;
5869
- Object.keys(env2).forEach((key) => {
5870
- createDebug[key] = env2[key];
5871
- });
5872
- createDebug.names = [];
5873
- createDebug.skips = [];
5874
- createDebug.formatters = {};
5875
- function selectColor(namespace) {
5876
- let hash = 0;
5877
- for (let i = 0; i < namespace.length; i++) {
5878
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
5879
- hash |= 0;
5880
- }
5881
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
5882
- }
5883
- createDebug.selectColor = selectColor;
5884
- function createDebug(namespace) {
5885
- let prevTime;
5886
- let enableOverride = null;
5887
- let namespacesCache;
5888
- let enabledCache;
5889
- function debug2(...args) {
5890
- if (!debug2.enabled) {
5891
- return;
5892
- }
5893
- const self = debug2;
5894
- const curr = Number(/* @__PURE__ */ new Date());
5895
- const ms = curr - (prevTime || curr);
5896
- self.diff = ms;
5897
- self.prev = prevTime;
5898
- self.curr = curr;
5899
- prevTime = curr;
5900
- args[0] = createDebug.coerce(args[0]);
5901
- if (typeof args[0] !== "string") {
5902
- args.unshift("%O");
5903
- }
5904
- let index = 0;
5905
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format3) => {
5906
- if (match === "%%") {
5907
- return "%";
5908
- }
5909
- index++;
5910
- const formatter = createDebug.formatters[format3];
5911
- if (typeof formatter === "function") {
5912
- const val = args[index];
5913
- match = formatter.call(self, val);
5914
- args.splice(index, 1);
5915
- index--;
5916
- }
5917
- return match;
5918
- });
5919
- createDebug.formatArgs.call(self, args);
5920
- const logFn = self.log || createDebug.log;
5921
- logFn.apply(self, args);
5922
- }
5923
- debug2.namespace = namespace;
5924
- debug2.useColors = createDebug.useColors();
5925
- debug2.color = createDebug.selectColor(namespace);
5926
- debug2.extend = extend;
5927
- debug2.destroy = createDebug.destroy;
5928
- Object.defineProperty(debug2, "enabled", {
5929
- enumerable: true,
5930
- configurable: false,
5931
- get: () => {
5932
- if (enableOverride !== null) {
5933
- return enableOverride;
5934
- }
5935
- if (namespacesCache !== createDebug.namespaces) {
5936
- namespacesCache = createDebug.namespaces;
5937
- enabledCache = createDebug.enabled(namespace);
5938
- }
5939
- return enabledCache;
5940
- },
5941
- set: (v) => {
5942
- enableOverride = v;
5943
- }
5944
- });
5945
- if (typeof createDebug.init === "function") {
5946
- createDebug.init(debug2);
5947
- }
5948
- return debug2;
5949
- }
5950
- function extend(namespace, delimiter) {
5951
- const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
5952
- newDebug.log = this.log;
5953
- return newDebug;
5954
- }
5955
- function enable(namespaces) {
5956
- createDebug.save(namespaces);
5957
- createDebug.namespaces = namespaces;
5958
- createDebug.names = [];
5959
- createDebug.skips = [];
5960
- let i;
5961
- const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
5962
- const len = split.length;
5963
- for (i = 0; i < len; i++) {
5964
- if (!split[i]) {
5965
- continue;
5966
- }
5967
- namespaces = split[i].replace(/\*/g, ".*?");
5968
- if (namespaces[0] === "-") {
5969
- createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$"));
5970
- } else {
5971
- createDebug.names.push(new RegExp("^" + namespaces + "$"));
5972
- }
5973
- }
5974
- }
5975
- function disable() {
5976
- const namespaces = [
5977
- ...createDebug.names.map(toNamespace),
5978
- ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace)
5979
- ].join(",");
5980
- createDebug.enable("");
5981
- return namespaces;
5982
- }
5983
- function enabled(name) {
5984
- if (name[name.length - 1] === "*") {
5985
- return true;
5986
- }
5987
- let i;
5988
- let len;
5989
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
5990
- if (createDebug.skips[i].test(name)) {
5991
- return false;
5992
- }
5993
- }
5994
- for (i = 0, len = createDebug.names.length; i < len; i++) {
5995
- if (createDebug.names[i].test(name)) {
5996
- return true;
5997
- }
5998
- }
5999
- return false;
6000
- }
6001
- function toNamespace(regexp) {
6002
- return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
6003
- }
6004
- function coerce(val) {
6005
- if (val instanceof Error) {
6006
- return val.stack || val.message;
6007
- }
6008
- return val;
6009
- }
6010
- function destroy() {
6011
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
6012
- }
6013
- createDebug.enable(createDebug.load());
6014
- return createDebug;
6015
- }
6016
- module2.exports = setup;
6017
- }
6018
- });
6019
-
6020
- // ../../node_modules/.pnpm/debug@4.3.4_supports-color@5.5.0/node_modules/debug/src/browser.js
6021
- var require_browser2 = __commonJS({
6022
- "../../node_modules/.pnpm/debug@4.3.4_supports-color@5.5.0/node_modules/debug/src/browser.js"(exports2, module2) {
6023
- "use strict";
6024
- exports2.formatArgs = formatArgs;
6025
- exports2.save = save;
6026
- exports2.load = load;
6027
- exports2.useColors = useColors;
6028
- exports2.storage = localstorage();
6029
- exports2.destroy = /* @__PURE__ */ (() => {
6030
- let warned = false;
6031
- return () => {
6032
- if (!warned) {
6033
- warned = true;
6034
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
6035
- }
6036
- };
6037
- })();
6038
- exports2.colors = [
6039
- "#0000CC",
6040
- "#0000FF",
6041
- "#0033CC",
6042
- "#0033FF",
6043
- "#0066CC",
6044
- "#0066FF",
6045
- "#0099CC",
6046
- "#0099FF",
6047
- "#00CC00",
6048
- "#00CC33",
6049
- "#00CC66",
6050
- "#00CC99",
6051
- "#00CCCC",
6052
- "#00CCFF",
6053
- "#3300CC",
6054
- "#3300FF",
6055
- "#3333CC",
6056
- "#3333FF",
6057
- "#3366CC",
6058
- "#3366FF",
6059
- "#3399CC",
6060
- "#3399FF",
6061
- "#33CC00",
6062
- "#33CC33",
6063
- "#33CC66",
6064
- "#33CC99",
6065
- "#33CCCC",
6066
- "#33CCFF",
6067
- "#6600CC",
6068
- "#6600FF",
6069
- "#6633CC",
6070
- "#6633FF",
6071
- "#66CC00",
6072
- "#66CC33",
6073
- "#9900CC",
6074
- "#9900FF",
6075
- "#9933CC",
6076
- "#9933FF",
6077
- "#99CC00",
6078
- "#99CC33",
6079
- "#CC0000",
6080
- "#CC0033",
6081
- "#CC0066",
6082
- "#CC0099",
6083
- "#CC00CC",
6084
- "#CC00FF",
6085
- "#CC3300",
6086
- "#CC3333",
6087
- "#CC3366",
6088
- "#CC3399",
6089
- "#CC33CC",
6090
- "#CC33FF",
6091
- "#CC6600",
6092
- "#CC6633",
6093
- "#CC9900",
6094
- "#CC9933",
6095
- "#CCCC00",
6096
- "#CCCC33",
6097
- "#FF0000",
6098
- "#FF0033",
6099
- "#FF0066",
6100
- "#FF0099",
6101
- "#FF00CC",
6102
- "#FF00FF",
6103
- "#FF3300",
6104
- "#FF3333",
6105
- "#FF3366",
6106
- "#FF3399",
6107
- "#FF33CC",
6108
- "#FF33FF",
6109
- "#FF6600",
6110
- "#FF6633",
6111
- "#FF9900",
6112
- "#FF9933",
6113
- "#FFCC00",
6114
- "#FFCC33"
6115
- ];
6116
- function useColors() {
6117
- if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
6118
- return true;
6119
- }
6120
- if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
6121
- return false;
6122
- }
6123
- return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
6124
- typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
6125
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
6126
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
6127
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
6128
- }
6129
- function formatArgs(args) {
6130
- args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
6131
- if (!this.useColors) {
6132
- return;
6133
- }
6134
- const c = "color: " + this.color;
6135
- args.splice(1, 0, c, "color: inherit");
6136
- let index = 0;
6137
- let lastC = 0;
6138
- args[0].replace(/%[a-zA-Z%]/g, (match) => {
6139
- if (match === "%%") {
6140
- return;
6141
- }
6142
- index++;
6143
- if (match === "%c") {
6144
- lastC = index;
6145
- }
6146
- });
6147
- args.splice(lastC, 0, c);
6148
- }
6149
- exports2.log = console.debug || console.log || (() => {
6150
- });
6151
- function save(namespaces) {
6152
- try {
6153
- if (namespaces) {
6154
- exports2.storage.setItem("debug", namespaces);
6155
- } else {
6156
- exports2.storage.removeItem("debug");
6157
- }
6158
- } catch (error) {
6159
- }
6160
- }
6161
- function load() {
6162
- let r;
6163
- try {
6164
- r = exports2.storage.getItem("debug");
6165
- } catch (error) {
6166
- }
6167
- if (!r && typeof process !== "undefined" && "env" in process) {
6168
- r = process.env.DEBUG;
6169
- }
6170
- return r;
6171
- }
6172
- function localstorage() {
6173
- try {
6174
- return localStorage;
6175
- } catch (error) {
6176
- }
6177
- }
6178
- module2.exports = require_common2()(exports2);
6179
- var { formatters } = module2.exports;
6180
- formatters.j = function(v) {
6181
- try {
6182
- return JSON.stringify(v);
6183
- } catch (error) {
6184
- return "[UnexpectedJSONParseError]: " + error.message;
6185
- }
6186
- };
6187
- }
6188
- });
6189
-
6190
- // ../../node_modules/.pnpm/debug@4.3.4_supports-color@5.5.0/node_modules/debug/src/node.js
6191
- var require_node2 = __commonJS({
6192
- "../../node_modules/.pnpm/debug@4.3.4_supports-color@5.5.0/node_modules/debug/src/node.js"(exports2, module2) {
6193
- "use strict";
6194
- var tty = require("tty");
6195
- var util = require("util");
6196
- exports2.init = init;
6197
- exports2.log = log;
6198
- exports2.formatArgs = formatArgs;
6199
- exports2.save = save;
6200
- exports2.load = load;
6201
- exports2.useColors = useColors;
6202
- exports2.destroy = util.deprecate(
6203
- () => {
6204
- },
6205
- "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
6206
- );
6207
- exports2.colors = [6, 2, 3, 4, 5, 1];
6208
- try {
6209
- const supportsColor = require_supports_color();
6210
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
6211
- exports2.colors = [
6212
- 20,
6213
- 21,
6214
- 26,
6215
- 27,
6216
- 32,
6217
- 33,
6218
- 38,
6219
- 39,
6220
- 40,
6221
- 41,
6222
- 42,
6223
- 43,
6224
- 44,
6225
- 45,
6226
- 56,
6227
- 57,
6228
- 62,
6229
- 63,
6230
- 68,
6231
- 69,
6232
- 74,
6233
- 75,
6234
- 76,
6235
- 77,
6236
- 78,
6237
- 79,
6238
- 80,
6239
- 81,
6240
- 92,
6241
- 93,
6242
- 98,
6243
- 99,
6244
- 112,
6245
- 113,
6246
- 128,
6247
- 129,
6248
- 134,
6249
- 135,
6250
- 148,
6251
- 149,
6252
- 160,
6253
- 161,
6254
- 162,
6255
- 163,
6256
- 164,
6257
- 165,
6258
- 166,
6259
- 167,
6260
- 168,
6261
- 169,
6262
- 170,
6263
- 171,
6264
- 172,
6265
- 173,
6266
- 178,
6267
- 179,
6268
- 184,
6269
- 185,
6270
- 196,
6271
- 197,
6272
- 198,
6273
- 199,
6274
- 200,
6275
- 201,
6276
- 202,
6277
- 203,
6278
- 204,
6279
- 205,
6280
- 206,
6281
- 207,
6282
- 208,
6283
- 209,
6284
- 214,
6285
- 215,
6286
- 220,
6287
- 221
6288
- ];
6289
- }
6290
- } catch (error) {
6291
- }
6292
- exports2.inspectOpts = Object.keys(process.env).filter((key) => {
6293
- return /^debug_/i.test(key);
6294
- }).reduce((obj, key) => {
6295
- const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
6296
- return k.toUpperCase();
6297
- });
6298
- let val = process.env[key];
6299
- if (/^(yes|on|true|enabled)$/i.test(val)) {
6300
- val = true;
6301
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
6302
- val = false;
6303
- } else if (val === "null") {
6304
- val = null;
6305
- } else {
6306
- val = Number(val);
6307
- }
6308
- obj[prop] = val;
6309
- return obj;
6310
- }, {});
6311
- function useColors() {
6312
- return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd);
6313
- }
6314
- function formatArgs(args) {
6315
- const { namespace: name, useColors: useColors2 } = this;
6316
- if (useColors2) {
6317
- const c = this.color;
6318
- const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
6319
- const prefix = ` ${colorCode};1m${name} \x1B[0m`;
6320
- args[0] = prefix + args[0].split("\n").join("\n" + prefix);
6321
- args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
6322
- } else {
6323
- args[0] = getDate() + name + " " + args[0];
6324
- }
6325
- }
6326
- function getDate() {
6327
- if (exports2.inspectOpts.hideDate) {
6328
- return "";
6329
- }
6330
- return (/* @__PURE__ */ new Date()).toISOString() + " ";
6331
- }
6332
- function log(...args) {
6333
- return process.stderr.write(util.format(...args) + "\n");
6334
- }
6335
- function save(namespaces) {
6336
- if (namespaces) {
6337
- process.env.DEBUG = namespaces;
6338
- } else {
6339
- delete process.env.DEBUG;
6340
- }
6341
- }
6342
- function load() {
6343
- return process.env.DEBUG;
6344
- }
6345
- function init(debug2) {
6346
- debug2.inspectOpts = {};
6347
- const keys = Object.keys(exports2.inspectOpts);
6348
- for (let i = 0; i < keys.length; i++) {
6349
- debug2.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
6350
- }
6351
- }
6352
- module2.exports = require_common2()(exports2);
6353
- var { formatters } = module2.exports;
6354
- formatters.o = function(v) {
6355
- this.inspectOpts.colors = this.useColors;
6356
- return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
6357
- };
6358
- formatters.O = function(v) {
6359
- this.inspectOpts.colors = this.useColors;
6360
- return util.inspect(v, this.inspectOpts);
6361
- };
6362
- }
6363
- });
6364
-
6365
- // ../../node_modules/.pnpm/debug@4.3.4_supports-color@5.5.0/node_modules/debug/src/index.js
6366
- var require_src3 = __commonJS({
6367
- "../../node_modules/.pnpm/debug@4.3.4_supports-color@5.5.0/node_modules/debug/src/index.js"(exports2, module2) {
6368
- "use strict";
6369
- if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
6370
- module2.exports = require_browser2();
6371
- } else {
6372
- module2.exports = require_node2();
6373
- }
6374
- }
6375
- });
6376
-
6377
5739
  // ../../node_modules/.pnpm/@kwsites+promise-deferred@1.1.1/node_modules/@kwsites/promise-deferred/dist/index.js
6378
5740
  var require_dist2 = __commonJS({
6379
5741
  "../../node_modules/.pnpm/@kwsites+promise-deferred@1.1.1/node_modules/@kwsites/promise-deferred/dist/index.js"(exports2) {
@@ -8061,7 +7423,7 @@ var import_rest = require("@octokit/rest");
8061
7423
 
8062
7424
  // ../../node_modules/.pnpm/simple-git@3.24.0/node_modules/simple-git/dist/esm/index.js
8063
7425
  var import_file_exists = __toESM(require_dist(), 1);
8064
- var import_debug = __toESM(require_src3(), 1);
7426
+ var import_debug = __toESM(require_src(), 1);
8065
7427
  var import_child_process = require("child_process");
8066
7428
  var import_promise_deferred = __toESM(require_dist2(), 1);
8067
7429
  var import_promise_deferred2 = __toESM(require_dist2(), 1);
@@ -12607,9 +11969,12 @@ var ClonedRepository = class {
12607
11969
  await this.git.cwd(this.clonePath);
12608
11970
  await this.git.add(files);
12609
11971
  }
11972
+ async fileExists({ relativeFilePath }) {
11973
+ return await doesPathExist2(import_path6.default.join(this.clonePath, relativeFilePath));
11974
+ }
12610
11975
  async restoreFiles({ files, staged }) {
12611
11976
  await this.git.cwd(this.clonePath);
12612
- const args = ["restore"];
11977
+ const args = ["restore --source=HEAD"];
12613
11978
  if (staged) {
12614
11979
  args.push("--staged");
12615
11980
  }
@@ -12746,10 +12111,10 @@ var GitHub = class {
12746
12111
  const branch = this.githubConfig.branch ?? await repository.getDefaultBranch();
12747
12112
  await repository.checkout(branch);
12748
12113
  await repository.pull(branch);
12749
- const fernIgnore = await repository.getFernignore();
12114
+ const fernIgnoreFiles = await this.getFernignoreFiles(repository);
12750
12115
  await repository.overwriteLocalContents(sourceDirectory);
12751
12116
  await repository.add(".");
12752
- await this.restoreFernignoreFiles(repository, fernIgnore);
12117
+ await this.restoreFiles(repository, fernIgnoreFiles);
12753
12118
  await repository.commit("SDK Generation");
12754
12119
  await repository.push();
12755
12120
  } catch (error) {
@@ -12772,10 +12137,10 @@ var GitHub = class {
12772
12137
  await repository.checkout(baseBranch);
12773
12138
  await repository.pull(baseBranch);
12774
12139
  await repository.checkout(prBranch);
12775
- const fernIgnore = await repository.getFernignore();
12140
+ const fernIgnoreFiles = await this.getFernignoreFiles(repository);
12776
12141
  await repository.overwriteLocalContents(sourceDirectory);
12777
12142
  await repository.add(".");
12778
- await this.restoreFernignoreFiles(repository, fernIgnore);
12143
+ await this.restoreFiles(repository, fernIgnoreFiles);
12779
12144
  await repository.commit("SDK Generation");
12780
12145
  await repository.push();
12781
12146
  const octokit = new import_rest.Octokit({
@@ -12811,22 +12176,25 @@ var GitHub = class {
12811
12176
  async release() {
12812
12177
  console.log("TODO: Implement release");
12813
12178
  }
12814
- getFernignoreFiles(fernignore) {
12179
+ async getFernignoreFiles(repository) {
12180
+ const fernignore = await repository.getFernignore();
12181
+ if (fernignore === void 0) {
12182
+ return [];
12183
+ }
12815
12184
  const fernignoreLines = fernignore.split("\n");
12816
12185
  const fernignoreFiles = [];
12817
12186
  for (const line of fernignoreLines) {
12818
12187
  const trimmedLine = line.trim();
12819
- if (!trimmedLine.startsWith("#") && trimmedLine.length > 0) {
12188
+ if (!trimmedLine.startsWith("#") && trimmedLine.length > 0 && !await repository.fileExists({ relativeFilePath: trimmedLine })) {
12820
12189
  fernignoreFiles.push(trimmedLine);
12821
12190
  }
12822
12191
  }
12823
12192
  return fernignoreFiles;
12824
12193
  }
12825
- async restoreFernignoreFiles(repository, fernignore) {
12826
- if (fernignore === void 0) {
12194
+ async restoreFiles(repository, files) {
12195
+ if (files.length === 0) {
12827
12196
  return;
12828
12197
  }
12829
- const files = this.getFernignoreFiles(fernignore);
12830
12198
  await repository.restoreFiles({ files, staged: true });
12831
12199
  await repository.restoreFiles({ files });
12832
12200
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fern-api/generator-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "main": "dist/cli.cjs",
6
6
  "source": "src/index.ts",
@@ -24,7 +24,7 @@
24
24
  "test:update": "vitest -u --run --passWithNoTests --globals --disable-console-intercept"
25
25
  },
26
26
  "dependencies": {
27
- "@octokit/rest": "^17.8.0",
27
+ "@octokit/rest": "^20.1.2",
28
28
  "es-toolkit": "^1.32.0"
29
29
  },
30
30
  "devDependencies": {
@@ -39,7 +39,7 @@
39
39
  "tmp-promise": "^3.0.3",
40
40
  "tsup": "^8.3.5",
41
41
  "typescript": "4.9.5",
42
- "vitest": "^3.0.5",
42
+ "vitest": "^3.2.4",
43
43
  "yargs": "^17.4.1"
44
44
  }
45
45
  }