kysely-gen 0.1.0 → 0.2.2

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.js +152 -5
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -9984,6 +9984,153 @@ var source_default = chalk;
9984
9984
  // node_modules/ora/index.js
9985
9985
  import process8 from "node:process";
9986
9986
 
9987
+ // node_modules/chalk/source/index.js
9988
+ var { stdout: stdoutColor2, stderr: stderrColor2 } = supports_color_default;
9989
+ var GENERATOR2 = Symbol("GENERATOR");
9990
+ var STYLER2 = Symbol("STYLER");
9991
+ var IS_EMPTY2 = Symbol("IS_EMPTY");
9992
+ var levelMapping2 = [
9993
+ "ansi",
9994
+ "ansi",
9995
+ "ansi256",
9996
+ "ansi16m"
9997
+ ];
9998
+ var styles3 = Object.create(null);
9999
+ var applyOptions2 = (object, options = {}) => {
10000
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
10001
+ throw new Error("The `level` option should be an integer from 0 to 3");
10002
+ }
10003
+ const colorLevel = stdoutColor2 ? stdoutColor2.level : 0;
10004
+ object.level = options.level === undefined ? colorLevel : options.level;
10005
+ };
10006
+ var chalkFactory2 = (options) => {
10007
+ const chalk2 = (...strings) => strings.join(" ");
10008
+ applyOptions2(chalk2, options);
10009
+ Object.setPrototypeOf(chalk2, createChalk2.prototype);
10010
+ return chalk2;
10011
+ };
10012
+ function createChalk2(options) {
10013
+ return chalkFactory2(options);
10014
+ }
10015
+ Object.setPrototypeOf(createChalk2.prototype, Function.prototype);
10016
+ for (const [styleName, style] of Object.entries(ansi_styles_default)) {
10017
+ styles3[styleName] = {
10018
+ get() {
10019
+ const builder = createBuilder2(this, createStyler2(style.open, style.close, this[STYLER2]), this[IS_EMPTY2]);
10020
+ Object.defineProperty(this, styleName, { value: builder });
10021
+ return builder;
10022
+ }
10023
+ };
10024
+ }
10025
+ styles3.visible = {
10026
+ get() {
10027
+ const builder = createBuilder2(this, this[STYLER2], true);
10028
+ Object.defineProperty(this, "visible", { value: builder });
10029
+ return builder;
10030
+ }
10031
+ };
10032
+ var getModelAnsi2 = (model, level, type, ...arguments_) => {
10033
+ if (model === "rgb") {
10034
+ if (level === "ansi16m") {
10035
+ return ansi_styles_default[type].ansi16m(...arguments_);
10036
+ }
10037
+ if (level === "ansi256") {
10038
+ return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
10039
+ }
10040
+ return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
10041
+ }
10042
+ if (model === "hex") {
10043
+ return getModelAnsi2("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
10044
+ }
10045
+ return ansi_styles_default[type][model](...arguments_);
10046
+ };
10047
+ var usedModels2 = ["rgb", "hex", "ansi256"];
10048
+ for (const model of usedModels2) {
10049
+ styles3[model] = {
10050
+ get() {
10051
+ const { level } = this;
10052
+ return function(...arguments_) {
10053
+ const styler = createStyler2(getModelAnsi2(model, levelMapping2[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER2]);
10054
+ return createBuilder2(this, styler, this[IS_EMPTY2]);
10055
+ };
10056
+ }
10057
+ };
10058
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
10059
+ styles3[bgModel] = {
10060
+ get() {
10061
+ const { level } = this;
10062
+ return function(...arguments_) {
10063
+ const styler = createStyler2(getModelAnsi2(model, levelMapping2[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER2]);
10064
+ return createBuilder2(this, styler, this[IS_EMPTY2]);
10065
+ };
10066
+ }
10067
+ };
10068
+ }
10069
+ var proto2 = Object.defineProperties(() => {}, {
10070
+ ...styles3,
10071
+ level: {
10072
+ enumerable: true,
10073
+ get() {
10074
+ return this[GENERATOR2].level;
10075
+ },
10076
+ set(level) {
10077
+ this[GENERATOR2].level = level;
10078
+ }
10079
+ }
10080
+ });
10081
+ var createStyler2 = (open, close, parent) => {
10082
+ let openAll;
10083
+ let closeAll;
10084
+ if (parent === undefined) {
10085
+ openAll = open;
10086
+ closeAll = close;
10087
+ } else {
10088
+ openAll = parent.openAll + open;
10089
+ closeAll = close + parent.closeAll;
10090
+ }
10091
+ return {
10092
+ open,
10093
+ close,
10094
+ openAll,
10095
+ closeAll,
10096
+ parent
10097
+ };
10098
+ };
10099
+ var createBuilder2 = (self, _styler, _isEmpty) => {
10100
+ const builder = (...arguments_) => applyStyle2(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
10101
+ Object.setPrototypeOf(builder, proto2);
10102
+ builder[GENERATOR2] = self;
10103
+ builder[STYLER2] = _styler;
10104
+ builder[IS_EMPTY2] = _isEmpty;
10105
+ return builder;
10106
+ };
10107
+ var applyStyle2 = (self, string) => {
10108
+ if (self.level <= 0 || !string) {
10109
+ return self[IS_EMPTY2] ? "" : string;
10110
+ }
10111
+ let styler = self[STYLER2];
10112
+ if (styler === undefined) {
10113
+ return string;
10114
+ }
10115
+ const { openAll, closeAll } = styler;
10116
+ if (string.includes("\x1B")) {
10117
+ while (styler !== undefined) {
10118
+ string = stringReplaceAll(string, styler.close, styler.open);
10119
+ styler = styler.parent;
10120
+ }
10121
+ }
10122
+ const lfIndex = string.indexOf(`
10123
+ `);
10124
+ if (lfIndex !== -1) {
10125
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
10126
+ }
10127
+ return openAll + string + closeAll;
10128
+ };
10129
+ Object.defineProperties(createChalk2.prototype, styles3);
10130
+ var chalk2 = createChalk2();
10131
+ var chalkStderr2 = createChalk2({ level: stderrColor2 ? stderrColor2.level : 0 });
10132
+ var source_default2 = chalk2;
10133
+
9987
10134
  // node_modules/cli-cursor/index.js
9988
10135
  import process5 from "node:process";
9989
10136
 
@@ -12413,7 +12560,7 @@ class Ora {
12413
12560
  const { frames } = this.#spinner;
12414
12561
  let frame = frames[this.#frameIndex];
12415
12562
  if (this.color) {
12416
- frame = source_default[this.color](frame);
12563
+ frame = source_default2[this.color](frame);
12417
12564
  }
12418
12565
  const fullPrefixText = this.#getFullPrefixText(this.#prefixText, " ");
12419
12566
  const fullText = typeof this.text === "string" ? " " + this.text : "";
@@ -12573,11 +12720,11 @@ function isPlainObject(obj) {
12573
12720
  if (Object.getPrototypeOf(obj) === null) {
12574
12721
  return true;
12575
12722
  }
12576
- let proto2 = obj;
12577
- while (Object.getPrototypeOf(proto2) !== null) {
12578
- proto2 = Object.getPrototypeOf(proto2);
12723
+ let proto3 = obj;
12724
+ while (Object.getPrototypeOf(proto3) !== null) {
12725
+ proto3 = Object.getPrototypeOf(proto3);
12579
12726
  }
12580
- return Object.getPrototypeOf(obj) === proto2;
12727
+ return Object.getPrototypeOf(obj) === proto3;
12581
12728
  }
12582
12729
  function getLast(arr) {
12583
12730
  return arr[arr.length - 1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kysely-gen",
3
- "version": "0.1.0",
3
+ "version": "0.2.2",
4
4
  "description": "Modern PostgreSQL type generator for Kysely - Built with Bun and TDD",
5
5
  "type": "module",
6
6
  "license": "MIT",