@ts-for-gir/cli 4.0.0-rc.1 → 4.0.0-rc.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/bin/ts-for-gir +104 -29
  2. package/package.json +10 -10
package/bin/ts-for-gir CHANGED
@@ -7268,7 +7268,7 @@ import { dirname, join } from "node:path";
7268
7268
  import { fileURLToPath } from "node:url";
7269
7269
  function getPackageVersion() {
7270
7270
  if (true) {
7271
- return "4.0.0-rc.1";
7271
+ return "4.0.0-rc.2";
7272
7272
  }
7273
7273
  const currentModulePath = fileURLToPath(import.meta.url);
7274
7274
  const currentDir = dirname(currentModulePath);
@@ -8165,7 +8165,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
8165
8165
  var NEW_LINE_REG_EXP = /[\n\r]+/g;
8166
8166
  function getPackageVersion2() {
8167
8167
  if (true) {
8168
- return "4.0.0-rc.1";
8168
+ return "4.0.0-rc.2";
8169
8169
  }
8170
8170
  const currentModulePath = fileURLToPath2(import.meta.url);
8171
8171
  const currentDir = dirname2(currentModulePath);
@@ -11977,6 +11977,7 @@ var Uint8ArrayType = new NativeType("Uint8Array");
11977
11977
  var BooleanType = new NativeType("boolean");
11978
11978
  var StringType = new NativeType("string");
11979
11979
  var NumberType = new NativeType("number");
11980
+ var BigintOrNumberType = new BinaryType(new NativeType("bigint"), NumberType);
11980
11981
  var NullType = new NativeType("null");
11981
11982
  var VoidType = new NativeType("void");
11982
11983
  var UnknownType = new NativeType("unknown");
@@ -12090,19 +12091,20 @@ function resolvePrimitiveType(name) {
12090
12091
  case "gfloat":
12091
12092
  case "gchar":
12092
12093
  case "guint":
12093
- case "glong":
12094
- case "gulong":
12095
12094
  case "gint":
12096
12095
  case "guint8":
12096
+ case "gdouble":
12097
+ return NumberType;
12098
+ case "glong":
12099
+ case "gulong":
12097
12100
  case "guint64":
12098
12101
  case "gint64":
12099
- case "gdouble":
12100
12102
  case "gssize":
12101
12103
  case "gsize":
12102
12104
  case "time_t":
12103
12105
  // C standard library time type (seconds since Unix epoch)
12104
12106
  case "ulong":
12105
- return NumberType;
12107
+ return BigintOrNumberType;
12106
12108
  case "gboolean":
12107
12109
  return BooleanType;
12108
12110
  case "gpointer":
@@ -12154,6 +12156,19 @@ function resolveDirectedType(type, direction) {
12154
12156
  return type;
12155
12157
  }
12156
12158
  }
12159
+ } else if (type === BigintOrNumberType && direction === "out" /* Out */) {
12160
+ return NumberType;
12161
+ } else if (type instanceof PromiseType) {
12162
+ const resolvedInner = resolveDirectedType(type.type, direction);
12163
+ if (resolvedInner) return new PromiseType(resolvedInner);
12164
+ } else if (type instanceof BinaryType && !(type instanceof NullableType)) {
12165
+ const a = resolveDirectedType(type.a, direction) ?? type.a;
12166
+ const b = resolveDirectedType(type.b, direction) ?? type.b;
12167
+ if (a !== type.a || b !== type.b) return new BinaryType(a, b);
12168
+ } else if (type instanceof OrType && !(type instanceof BinaryType || type instanceof TupleType)) {
12169
+ const types = type.types.map((t) => resolveDirectedType(t, direction) ?? t);
12170
+ if (types.length === 1) return types[0];
12171
+ return new OrType(types[0], ...types.slice(1));
12157
12172
  }
12158
12173
  return null;
12159
12174
  }
@@ -12306,7 +12321,7 @@ function getType(ns, param) {
12306
12321
  } else if (closure != null) {
12307
12322
  variableType = ClosureType.new({ type: variableType, user_data: closure });
12308
12323
  }
12309
- if (parameter.$ && (parameter.$.direction === "inout" /* Inout */ || parameter.$.direction === "out" /* Out */) && (nullable || allowNone) && !(variableType instanceof NativeType)) {
12324
+ if (parameter.$ && (parameter.$.direction === "inout" /* Inout */ || parameter.$.direction === "out" /* Out */) && (nullable || allowNone) && !(variableType instanceof NativeType) && variableType !== BigintOrNumberType) {
12310
12325
  return new NullableType(variableType);
12311
12326
  }
12312
12327
  if ((!parameter.$?.direction || parameter.$.direction === "in" /* In */) && nullable) {
@@ -21064,12 +21079,12 @@ var SignalGenerator = class {
21064
21079
  const gobjectRef = this.namespace.namespace === "GObject" ? "" : "GObject.";
21065
21080
  cbType = `(pspec: ${gobjectRef}ParamSpec) => void`;
21066
21081
  } else if (signalInfo.signal) {
21067
- const paramTypes = signalInfo.signal.parameters.map((p, idx) => `arg${idx}: ${this.core.generateType(p.type)}`).join(", ");
21082
+ const paramTypes = signalInfo.signal.parameters.map((p, idx) => `arg${idx}: ${this.core.generateDirectedType(p.type, "out" /* Out */)}`).join(", ");
21068
21083
  let returnType = signalInfo.signal.return_type;
21069
21084
  if (signalInfo.signal.return_type.equals(BooleanType)) {
21070
21085
  returnType = new BinaryType(BooleanType, VoidType);
21071
21086
  }
21072
- const returnTypeStr = this.core.generateType(returnType);
21087
+ const returnTypeStr = this.core.generateDirectedType(returnType, "in" /* In */);
21073
21088
  cbType = `(${paramTypes}) => ${returnTypeStr}`;
21074
21089
  } else {
21075
21090
  const paramTypes = signalInfo.parameterTypes?.map((type, idx) => `arg${idx}: ${type}`) || [];
@@ -21581,13 +21596,15 @@ export const ${node.name}: ${node.name}Namespace & {
21581
21596
  }
21582
21597
  }
21583
21598
  const Type = type.resolve(this.namespace, this.options).rootPrint(this.namespace, this.options) || "any";
21599
+ const GetterType = this.generateDirectedType(type, "out" /* Out */) || Type;
21600
+ const SetterType = this.generateDirectedType(type, "in" /* In */) || Type;
21584
21601
  if (construct) {
21585
21602
  const unwrapped = type.deepUnwrap();
21586
21603
  if (unwrapped instanceof TypeIdentifier && unwrapped.is("GObject", "GType")) {
21587
21604
  const gtypeNamespace = this.namespace.namespace === "GObject" ? "" : "GObject.";
21588
21605
  return [`${name}: ${gtypeNamespace}GTypeInput;`];
21589
21606
  }
21590
- return [`${name}: ${Type};`];
21607
+ return [`${name}: ${SetterType};`];
21591
21608
  }
21592
21609
  if (printAsProperty) {
21593
21610
  desc.push(`${getterSetterAnnotation}${indent} ${name}: ${Type};`);
@@ -21595,13 +21612,13 @@ export const ${node.name}: ${node.name}Namespace & {
21595
21612
  }
21596
21613
  if (hasGetter && hasSetter) {
21597
21614
  desc.push(
21598
- `${getterAnnotation}${indent}get ${name}(): ${Type};`,
21599
- `${setterAnnotation}${indent}set ${name}(val: ${Type});`
21615
+ `${getterAnnotation}${indent}get ${name}(): ${GetterType};`,
21616
+ `${setterAnnotation}${indent}set ${name}(val: ${SetterType});`
21600
21617
  );
21601
21618
  } else if (hasGetter) {
21602
- desc.push(`${getterSetterAnnotation}${indent}get ${name}(): ${Type};`);
21619
+ desc.push(`${getterSetterAnnotation}${indent}get ${name}(): ${GetterType};`);
21603
21620
  } else {
21604
- desc.push(`${getterSetterAnnotation}${indent}set ${name}(val: ${Type});`);
21621
+ desc.push(`${getterSetterAnnotation}${indent}set ${name}(val: ${SetterType});`);
21605
21622
  }
21606
21623
  return desc;
21607
21624
  }
@@ -21627,7 +21644,7 @@ export const ${node.name}: ${node.name}Namespace & {
21627
21644
  type = type.unwrap();
21628
21645
  }
21629
21646
  }
21630
- const typeStr = this.generateType(type);
21647
+ const typeStr = this.generateDirectedType(type, "out" /* Out */);
21631
21648
  desc.push(`${indent}${commentOut}${staticStr}${readonly}${name}${affix}: ${typeStr}`);
21632
21649
  return desc;
21633
21650
  }
@@ -21764,10 +21781,10 @@ export const ${node.name}: ${node.name}Namespace & {
21764
21781
  }
21765
21782
  return def;
21766
21783
  }
21767
- generateParameter(tsParam) {
21784
+ generateParameter(tsParam, direction = "in" /* In */) {
21768
21785
  const types = tsParam.type;
21769
21786
  const name = tsParam.name;
21770
- const typeStr = this.generateDirectedType(types, "in" /* In */);
21787
+ const typeStr = this.generateDirectedType(types, direction);
21771
21788
  const optional = tsParam.isOptional && !tsParam.isVarArgs;
21772
21789
  const affix = optional ? "?" : "";
21773
21790
  const prefix = tsParam.isVarArgs ? "..." : "";
@@ -21802,18 +21819,18 @@ export const ${node.name}: ${node.name}Namespace & {
21802
21819
  }
21803
21820
  return "";
21804
21821
  }
21805
- generateFunctionReturn(tsFunction) {
21822
+ generateFunctionReturn(tsFunction, direction = "out" /* Out */) {
21806
21823
  if (tsFunction.name === "constructor") {
21807
21824
  return "";
21808
21825
  }
21809
- const typeStr = this.generateDirectedType(tsFunction.return(), "out" /* Out */);
21826
+ const typeStr = this.generateDirectedType(tsFunction.return(), direction);
21810
21827
  const outputParameters = tsFunction.output_parameters;
21811
21828
  if (outputParameters.length > 0) {
21812
21829
  const excludeActualReturnValueFromArray = typeStr === "void" || typeStr === "";
21813
21830
  const returns = [
21814
21831
  ...excludeActualReturnValueFromArray ? [] : [`${typeStr}`],
21815
21832
  ...outputParameters.map((op) => {
21816
- return resolveDirectedType(op.type, "out" /* Out */)?.resolve(this.namespace, this.options) ?? op.type.resolve(this.namespace, this.options);
21833
+ return resolveDirectedType(op.type, direction)?.resolve(this.namespace, this.options) ?? op.type.resolve(this.namespace, this.options);
21817
21834
  }).map((p) => p.rootPrint(this.namespace, this.options))
21818
21835
  ];
21819
21836
  if (returns.length > 1) {
@@ -21834,6 +21851,9 @@ export const ${node.name}: ${node.name}Namespace & {
21834
21851
  const isStatic = tsFunction instanceof IntrospectedStaticClassFunction;
21835
21852
  const isGlobal = !(tsFunction instanceof IntrospectedClassFunction);
21836
21853
  const isArrowType = tsFunction instanceof IntrospectedCallback || tsFunction instanceof IntrospectedClassCallback;
21854
+ const isReversedDirection = tsFunction instanceof IntrospectedVirtualClassFunction;
21855
+ const inParamDirection = isReversedDirection ? "out" /* Out */ : "in" /* In */;
21856
+ const returnDirection = isReversedDirection ? "in" /* In */ : "out" /* Out */;
21837
21857
  const { parameters: inParams } = tsFunction;
21838
21858
  def.push(
21839
21859
  ...this.addGirDocComment(
@@ -21858,7 +21878,7 @@ export const ${node.name}: ${node.name}Namespace & {
21858
21878
  if (isGlobal) {
21859
21879
  exportStr = !this.config.noNamespace ? "" : "export ";
21860
21880
  }
21861
- const returnType = this.generateFunctionReturn(tsFunction);
21881
+ const returnType = this.generateFunctionReturn(tsFunction, returnDirection);
21862
21882
  let retSep = "";
21863
21883
  if (returnType) {
21864
21884
  if (isArrowType) {
@@ -21871,7 +21891,10 @@ export const ${node.name}: ${node.name}Namespace & {
21871
21891
  if (isInvalid(name) && !isGlobal) {
21872
21892
  name = `["${name}"]`;
21873
21893
  }
21874
- const inParamsDef = this.generateInParameters(inParams);
21894
+ const inParamsDef = [];
21895
+ for (const inParam of inParams) {
21896
+ inParamsDef.push(...this.generateParameter(inParam, inParamDirection));
21897
+ }
21875
21898
  def.push(
21876
21899
  `${indent}${commentOut}${exportStr}${staticStr}${globalStr}${name}${genericStr}(${inParamsDef.join(
21877
21900
  ", "
@@ -21902,7 +21925,10 @@ export const ${node.name}: ${node.name}Namespace & {
21902
21925
  name = removeNamespace(name, tsCallback.namespace.namespace);
21903
21926
  if (classModuleName) name = removeClassModule(name, classModuleName);
21904
21927
  const genericParameters = this.generateGenericParameters(generics);
21905
- const inParamsDef = this.generateInParameters(inParams);
21928
+ const inParamsDef = [];
21929
+ for (const inParam of inParams) {
21930
+ inParamsDef.push(...this.generateParameter(inParam, "out" /* Out */));
21931
+ }
21906
21932
  const interfaceHead = `${name}${genericParameters}`;
21907
21933
  def.push(this.generateExport("interface", `${interfaceHead}`, "{", indentCount));
21908
21934
  def.push(`${indentBody}(${inParamsDef.join(", ")}): ${returnTypeStr}`);
@@ -21974,7 +22000,7 @@ export const ${node.name}: ${node.name}Namespace & {
21974
22000
  const indent = generateIndent(indentCount);
21975
22001
  const exp = !this.config.noNamespace ? "" : "export ";
21976
22002
  const ComputedName = generateMemberName(tsConst);
21977
- const typeStr = this.generateType(tsConst.type);
22003
+ const typeStr = this.generateType(resolveDirectedType(tsConst.type, "out" /* Out */) ?? tsConst.type);
21978
22004
  desc.push(`${indent}${exp}const ${ComputedName}: ${typeStr}`);
21979
22005
  return desc;
21980
22006
  }
@@ -22928,6 +22954,7 @@ var MUTTER_COMMON = {
22928
22954
  browseUrl: "https://gitlab.gnome.org/GNOME/mutter/",
22929
22955
  repositoryUrl: "https://gitlab.gnome.org/GNOME/mutter.git",
22930
22956
  license: "GPL-2.0-or-later",
22957
+ iconFile: "mutter-r.svg",
22931
22958
  category: "GNOME Shell"
22932
22959
  };
22933
22960
  var SHELL_COMMON = {
@@ -22936,6 +22963,7 @@ var SHELL_COMMON = {
22936
22963
  browseUrl: "https://gitlab.gnome.org/GNOME/gnome-shell/",
22937
22964
  repositoryUrl: "https://gitlab.gnome.org/GNOME/gnome-shell.git",
22938
22965
  license: "GPL-2.0-or-later",
22966
+ iconFile: "gnome-shell-r.svg",
22939
22967
  category: "GNOME Shell"
22940
22968
  };
22941
22969
  var meta = {
@@ -23262,6 +23290,7 @@ var gtksource5 = {
23262
23290
  repositoryUrl: "https://gitlab.gnome.org/GNOME/gtksourceview.git",
23263
23291
  license: "LGPL-2.1-or-later",
23264
23292
  cDocsUrl: "https://gnome.pages.gitlab.gnome.org/gtksourceview/gtksourceview5/",
23293
+ iconFile: "gtksourceview-r.svg",
23265
23294
  category: "GNOME Desktop"
23266
23295
  };
23267
23296
  var shumate = {
@@ -23274,6 +23303,7 @@ var shumate = {
23274
23303
  repositoryUrl: "https://gitlab.gnome.org/GNOME/libshumate.git",
23275
23304
  license: "LGPL-2.1-or-later",
23276
23305
  cDocsUrl: "https://gnome.pages.gitlab.gnome.org/libshumate/",
23306
+ iconFile: "libshumate-r.svg",
23277
23307
  category: "GNOME Desktop"
23278
23308
  };
23279
23309
  var notify = {
@@ -23469,6 +23499,7 @@ var tsparql = {
23469
23499
  repositoryUrl: "https://gitlab.gnome.org/GNOME/tracker.git",
23470
23500
  license: "LGPL-2.1-or-later",
23471
23501
  cDocsUrl: "https://gnome.pages.gitlab.gnome.org/tracker/docs/developer/",
23502
+ iconFile: "tracker-r.svg",
23472
23503
  category: "Data & Markup"
23473
23504
  };
23474
23505
  var template = {
@@ -23537,6 +23568,7 @@ var polkit = {
23537
23568
  browseUrl: "https://gitlab.freedesktop.org/polkit/polkit/",
23538
23569
  repositoryUrl: "https://gitlab.freedesktop.org/polkit/polkit.git",
23539
23570
  license: "LGPL-2.0-or-later",
23571
+ iconFile: "polkit-r.svg",
23540
23572
  category: "Security"
23541
23573
  };
23542
23574
  var polkitAgent = {
@@ -23548,6 +23580,7 @@ var polkitAgent = {
23548
23580
  browseUrl: "https://gitlab.freedesktop.org/polkit/polkit/",
23549
23581
  repositoryUrl: "https://gitlab.freedesktop.org/polkit/polkit.git",
23550
23582
  license: "LGPL-2.0-or-later",
23583
+ iconFile: "polkit-r.svg",
23551
23584
  category: "Security"
23552
23585
  };
23553
23586
  var nm = {
@@ -23640,6 +23673,7 @@ var xdp = {
23640
23673
  browseUrl: "https://github.com/flatpak/libportal/",
23641
23674
  repositoryUrl: "https://github.com/flatpak/libportal.git",
23642
23675
  license: "LGPL-3.0-or-later",
23676
+ iconFile: "libportal-r.svg",
23643
23677
  category: "System"
23644
23678
  };
23645
23679
  var xdpGtk4 = {
@@ -23651,6 +23685,7 @@ var xdpGtk4 = {
23651
23685
  browseUrl: "https://github.com/flatpak/libportal/",
23652
23686
  repositoryUrl: "https://github.com/flatpak/libportal.git",
23653
23687
  license: "LGPL-3.0-or-later",
23688
+ iconFile: "libportal-r.svg",
23654
23689
  category: "System"
23655
23690
  };
23656
23691
  var rsvg = {
@@ -23663,6 +23698,7 @@ var rsvg = {
23663
23698
  repositoryUrl: "https://gitlab.gnome.org/GNOME/librsvg.git",
23664
23699
  license: "LGPL-2.1-or-later",
23665
23700
  cDocsUrl: "https://gnome.pages.gitlab.gnome.org/librsvg/doc/rsvg/",
23701
+ iconFile: "librsvg-r.svg",
23666
23702
  category: "Graphics"
23667
23703
  };
23668
23704
  var gl = {
@@ -23730,6 +23766,7 @@ var goa = {
23730
23766
  repositoryUrl: "https://gitlab.gnome.org/GNOME/gnome-online-accounts.git",
23731
23767
  license: "LGPL-2.0-or-later",
23732
23768
  cDocsUrl: "https://gnome.pages.gitlab.gnome.org/gnome-online-accounts/goa/",
23769
+ iconFile: "goa-r.svg",
23733
23770
  category: "Web"
23734
23771
  };
23735
23772
  var rest = {
@@ -24217,6 +24254,10 @@ var TypeDocPipeline = class {
24217
24254
  );
24218
24255
  result.project.packageVersion = module.libraryVersion.toString();
24219
24256
  this.registerGirMetadata(result.app, module);
24257
+ const nsMeta = this.buildNamespaceMetadata(module);
24258
+ for (const child of result.project.children ?? []) {
24259
+ child.girNamespaceMetadata ??= nsMeta;
24260
+ }
24220
24261
  return result;
24221
24262
  }
24222
24263
  /**
@@ -24294,6 +24335,7 @@ var TypeDocPipeline = class {
24294
24335
  [new TSConfigReader()]
24295
24336
  );
24296
24337
  this.fixExportImportReferences(result.project);
24338
+ this.enrichModuleReflections(result.project);
24297
24339
  return result;
24298
24340
  }
24299
24341
  /**
@@ -24339,7 +24381,8 @@ var TypeDocPipeline = class {
24339
24381
  ...existing,
24340
24382
  displayName: existing.displayName ?? meta2.displayName,
24341
24383
  description: existing.description ?? meta2.description,
24342
- logoUrl: existing.logoUrl ?? meta2.logoUrl,
24384
+ logoUrl: existing.logoUrl ?? meta2.logoUrl ?? (meta2.iconFile ? `assets/library-icons/${meta2.iconFile}` : void 0),
24385
+ iconFile: existing.iconFile ?? meta2.iconFile,
24343
24386
  websiteUrl: existing.websiteUrl ?? meta2.websiteUrl,
24344
24387
  cDocsUrl: existing.cDocsUrl ?? meta2.cDocsUrl,
24345
24388
  license: existing.license ?? meta2.license,
@@ -24347,6 +24390,27 @@ var TypeDocPipeline = class {
24347
24390
  };
24348
24391
  }
24349
24392
  }
24393
+ /**
24394
+ * Attach metadata to module reflections by matching against known GIR modules.
24395
+ * Used in combined mode where modules are discovered via "packages" entry point strategy.
24396
+ */
24397
+ enrichModuleReflections(project) {
24398
+ if (!project.children) return;
24399
+ const metaByImportName = /* @__PURE__ */ new Map();
24400
+ for (const module of this.modules) {
24401
+ metaByImportName.set(module.importName, this.buildNamespaceMetadata(module));
24402
+ }
24403
+ for (const child of project.children) {
24404
+ const enriched = child;
24405
+ if (enriched.girNamespaceMetadata?.category) continue;
24406
+ const scopeMatch = child.name.match(/^@[^/]+\/(.+)$/);
24407
+ const importName = scopeMatch ? scopeMatch[1] : child.name.toLowerCase();
24408
+ const nsMeta = metaByImportName.get(importName);
24409
+ if (nsMeta) {
24410
+ enriched.girNamespaceMetadata ??= nsMeta;
24411
+ }
24412
+ }
24413
+ }
24350
24414
  async cleanup() {
24351
24415
  if (this.tempDir) {
24352
24416
  await rm(this.tempDir, { recursive: true, force: true });
@@ -24642,7 +24706,8 @@ var TypeDocPipeline = class {
24642
24706
  packageVersion: pkgJson?.version,
24643
24707
  displayName: meta2?.displayName,
24644
24708
  description: meta2?.description ?? pkgJson?.description,
24645
- logoUrl: meta2?.logoUrl,
24709
+ logoUrl: meta2?.logoUrl ?? (meta2?.iconFile ? `assets/library-icons/${meta2.iconFile}` : void 0),
24710
+ iconFile: meta2?.iconFile,
24646
24711
  websiteUrl: meta2?.websiteUrl ?? pkgJson?.homepage,
24647
24712
  cDocsUrl: meta2?.cDocsUrl,
24648
24713
  license: meta2?.license ?? pkgJson?.license,
@@ -24744,7 +24809,7 @@ var JsonDefinitionGenerator = class _JsonDefinitionGenerator {
24744
24809
  };
24745
24810
 
24746
24811
  // ../typedoc-theme/src/theme.ts
24747
- import { copyFileSync, writeFileSync as writeFileSync3 } from "node:fs";
24812
+ import { copyFileSync, existsSync as existsSync3, mkdirSync, readdirSync, writeFileSync as writeFileSync3 } from "node:fs";
24748
24813
  import { dirname as dirname8, join as join14 } from "node:path";
24749
24814
  import { fileURLToPath as fileURLToPath5 } from "node:url";
24750
24815
  import { DefaultTheme, RendererEvent } from "typedoc";
@@ -25628,7 +25693,7 @@ import { fileURLToPath as fileURLToPath4 } from "node:url";
25628
25693
  import { i18n, JSX as JSX8, ReflectionKind as ReflectionKind4 } from "typedoc";
25629
25694
  function getTsForGirVersion() {
25630
25695
  if (true) {
25631
- return "4.0.0-rc.1";
25696
+ return "4.0.0-rc.2";
25632
25697
  }
25633
25698
  const __dirname3 = dirname7(fileURLToPath4(import.meta.url));
25634
25699
  return JSON.parse(readFileSync6(join13(__dirname3, "..", "..", "package.json"), "utf8")).version;
@@ -25707,7 +25772,7 @@ function giDocgenModuleInfo(context, mod, nsMeta) {
25707
25772
  var giDocgenSidebar = (context, props) => {
25708
25773
  const owningModule = findOwningModule(props.model);
25709
25774
  const nsMeta = owningModule ? getGirNamespaceMetadata(props.model) : void 0;
25710
- const logoUrl = nsMeta?.logoUrl || context.relativeURL("assets/logo_x4.png", true);
25775
+ const logoUrl = nsMeta?.logoUrl ? nsMeta.logoUrl.startsWith("http://") || nsMeta.logoUrl.startsWith("https://") ? nsMeta.logoUrl : context.relativeURL(nsMeta.logoUrl, true) : context.relativeURL("assets/logo_x4.png", true);
25711
25776
  const logoAlt = nsMeta?.displayName || nsMeta?.namespace || "GJS TypeScript Definitions";
25712
25777
  const logoHref = owningModule ? context.urlTo(owningModule) : context.relativeURL("index.html", true);
25713
25778
  const subtitleTarget = nsMeta ? (nsMeta.displayName || nsMeta.packageName).toUpperCase() : "GJS";
@@ -26095,6 +26160,16 @@ var GiDocgenTheme = class extends DefaultTheme {
26095
26160
  for (const file of FAVICON_FILES) {
26096
26161
  copyFileSync(join14(faviconDir, file), join14(assetsDir, file));
26097
26162
  }
26163
+ const iconsSourceDir = join14(__dirname2, "..", "..", "..", "refs", "library-icons", "library-icons");
26164
+ const iconsOutputDir = join14(assetsDir, "library-icons");
26165
+ if (existsSync3(iconsSourceDir)) {
26166
+ mkdirSync(iconsOutputDir, { recursive: true });
26167
+ for (const file of readdirSync(iconsSourceDir)) {
26168
+ if (file.endsWith("-r.svg")) {
26169
+ copyFileSync(join14(iconsSourceDir, file), join14(iconsOutputDir, file));
26170
+ }
26171
+ }
26172
+ }
26098
26173
  const projectName = event.project.name || "TS for GIR";
26099
26174
  const manifest = {
26100
26175
  name: `TypeScript type definitions for ${projectName}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-for-gir/cli",
3
- "version": "4.0.0-rc.1",
3
+ "version": "4.0.0-rc.2",
4
4
  "description": "TypeScript type definition generator for GObject introspection GIR files",
5
5
  "main": "src/index.ts",
6
6
  "module": "src/index.ts",
@@ -52,14 +52,14 @@
52
52
  ".": "./src/index.ts"
53
53
  },
54
54
  "devDependencies": {
55
- "@gi.ts/parser": "^4.0.0-rc.1",
56
- "@ts-for-gir/generator-base": "^4.0.0-rc.1",
57
- "@ts-for-gir/generator-html-doc": "^4.0.0-rc.1",
58
- "@ts-for-gir/generator-json": "^4.0.0-rc.1",
59
- "@ts-for-gir/generator-typescript": "^4.0.0-rc.1",
60
- "@ts-for-gir/lib": "^4.0.0-rc.1",
61
- "@ts-for-gir/reporter": "^4.0.0-rc.1",
62
- "@ts-for-gir/tsconfig": "^4.0.0-rc.1",
55
+ "@gi.ts/parser": "^4.0.0-rc.2",
56
+ "@ts-for-gir/generator-base": "^4.0.0-rc.2",
57
+ "@ts-for-gir/generator-html-doc": "^4.0.0-rc.2",
58
+ "@ts-for-gir/generator-json": "^4.0.0-rc.2",
59
+ "@ts-for-gir/generator-typescript": "^4.0.0-rc.2",
60
+ "@ts-for-gir/lib": "^4.0.0-rc.2",
61
+ "@ts-for-gir/reporter": "^4.0.0-rc.2",
62
+ "@ts-for-gir/tsconfig": "^4.0.0-rc.2",
63
63
  "@types/ejs": "^3.1.5",
64
64
  "@types/inquirer": "^9.0.9",
65
65
  "@types/node": "^24.12.2",
@@ -69,7 +69,7 @@
69
69
  },
70
70
  "dependencies": {
71
71
  "@inquirer/prompts": "^8.3.2",
72
- "@ts-for-gir/templates": "^4.0.0-rc.1",
72
+ "@ts-for-gir/templates": "^4.0.0-rc.2",
73
73
  "colorette": "^2.0.20",
74
74
  "cosmiconfig": "^9.0.1",
75
75
  "ejs": "^5.0.1",