@ts-for-gir/cli 4.0.0-beta.43 → 4.0.0-beta.44

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 +19 -30
  2. package/package.json +10 -10
package/bin/ts-for-gir CHANGED
@@ -29,12 +29,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  mod
30
30
  ));
31
31
 
32
- // ../../.yarn/cache/lodash-npm-4.17.23-50bdb1c01a-82504c8825.zip/node_modules/lodash/lodash.js
32
+ // ../../.yarn/cache/lodash-npm-4.17.21-6382451519-c08619c038.zip/node_modules/lodash/lodash.js
33
33
  var require_lodash = __commonJS({
34
- "../../.yarn/cache/lodash-npm-4.17.23-50bdb1c01a-82504c8825.zip/node_modules/lodash/lodash.js"(exports2, module) {
34
+ "../../.yarn/cache/lodash-npm-4.17.21-6382451519-c08619c038.zip/node_modules/lodash/lodash.js"(exports2, module) {
35
35
  (function() {
36
36
  var undefined2;
37
- var VERSION = "4.17.23";
37
+ var VERSION = "4.17.21";
38
38
  var LARGE_ARRAY_SIZE = 200;
39
39
  var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
40
40
  var HASH_UNDEFINED = "__lodash_hash_undefined__";
@@ -1962,28 +1962,8 @@ var require_lodash = __commonJS({
1962
1962
  }
1963
1963
  function baseUnset(object, path) {
1964
1964
  path = castPath(path, object);
1965
- var index = -1, length = path.length;
1966
- if (!length) {
1967
- return true;
1968
- }
1969
- var isRootPrimitive = object == null || typeof object !== "object" && typeof object !== "function";
1970
- while (++index < length) {
1971
- var key = path[index];
1972
- if (typeof key !== "string") {
1973
- continue;
1974
- }
1975
- if (key === "__proto__" && !hasOwnProperty.call(object, "__proto__")) {
1976
- return false;
1977
- }
1978
- if (key === "constructor" && index + 1 < length && typeof path[index + 1] === "string" && path[index + 1] === "prototype") {
1979
- if (isRootPrimitive && index === 0) {
1980
- continue;
1981
- }
1982
- return false;
1983
- }
1984
- }
1985
- var obj = parent(object, path);
1986
- return obj == null || delete obj[toKey(last(path))];
1965
+ object = parent(object, path);
1966
+ return object == null || delete object[toKey(last(path))];
1987
1967
  }
1988
1968
  function baseUpdate(object, path, updater, customizer) {
1989
1969
  return baseSet(object, path, updater(baseGet(object, path)), customizer);
@@ -7270,7 +7250,7 @@ import { dirname, join } from "node:path";
7270
7250
  import { fileURLToPath } from "node:url";
7271
7251
  function getPackageVersion() {
7272
7252
  if (true) {
7273
- return "4.0.0-beta.43";
7253
+ return "4.0.0-beta.44";
7274
7254
  }
7275
7255
  const currentModulePath = fileURLToPath(import.meta.url);
7276
7256
  const currentDir = dirname(currentModulePath);
@@ -8166,7 +8146,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
8166
8146
  var NEW_LINE_REG_EXP = /[\n\r]+/g;
8167
8147
  function getPackageVersion2() {
8168
8148
  if (true) {
8169
- return "4.0.0-beta.43";
8149
+ return "4.0.0-beta.44";
8170
8150
  }
8171
8151
  const currentModulePath = fileURLToPath2(import.meta.url);
8172
8152
  const currentDir = dirname2(currentModulePath);
@@ -10841,7 +10821,7 @@ var printGirDocComment = (tsDoc, config) => {
10841
10821
  }
10842
10822
  return desc.join("\n");
10843
10823
  };
10844
- var isIntrospectable = (e) => !e || !e.$ || !e.$.introspectable || e.$.introspectable === "1";
10824
+ var isIntrospectable = (e) => !e?.$?.introspectable || e.$.introspectable === "1";
10845
10825
  var isDeprecated = (e) => e?.$ && e.$.deprecated === "1";
10846
10826
  var deprecatedVersion = (e) => e?.$?.["deprecated-version"];
10847
10827
  var introducedVersion = (e) => e?.$?.version;
@@ -18452,12 +18432,16 @@ function inject(registry) {
18452
18432
  }
18453
18433
 
18454
18434
  // ../lib/src/validators/class.ts
18435
+ var INTROSPECTABLE_EXEMPT_METHODS = /* @__PURE__ */ new Set(["ref", "unref", "copy", "free", "destroy"]);
18455
18436
  var filterIntrospectableClassMembers = (node) => {
18456
18437
  node.fields = node.fields.filter((field) => field.isIntrospectable);
18457
18438
  node.props = node.props.filter((prop) => prop.isIntrospectable);
18458
18439
  node.callbacks = node.callbacks.filter((prop) => prop.isIntrospectable);
18459
18440
  node.constructors = node.constructors.filter((prop) => prop.isIntrospectable);
18460
- node.members = node.members.filter((prop) => prop.isIntrospectable);
18441
+ const isRecord = node instanceof IntrospectedRecord;
18442
+ node.members = node.members.filter(
18443
+ (member) => member.isIntrospectable || isRecord && INTROSPECTABLE_EXEMPT_METHODS.has(member.name)
18444
+ );
18461
18445
  return node;
18462
18446
  };
18463
18447
  var PROTECTED_FIELD_NAMES = ["parent_instance", "parent", "parent_class", "object_class"];
@@ -21568,6 +21552,11 @@ export const ${node.name}: ${node.name}Namespace & {
21568
21552
  }
21569
21553
  const Type = type.resolve(this.namespace, this.options).rootPrint(this.namespace, this.options) || "any";
21570
21554
  if (construct) {
21555
+ const unwrapped = type.deepUnwrap();
21556
+ if (unwrapped instanceof TypeIdentifier && unwrapped.is("GObject", "GType")) {
21557
+ const gtypeNamespace = this.namespace.namespace === "GObject" ? "" : "GObject.";
21558
+ return [`${name}: ${gtypeNamespace}GTypeInput;`];
21559
+ }
21571
21560
  return [`${name}: ${Type};`];
21572
21561
  }
21573
21562
  if (printAsProperty) {
@@ -24914,7 +24903,7 @@ import { fileURLToPath as fileURLToPath4 } from "node:url";
24914
24903
  import { i18n, JSX as JSX8, ReflectionKind as ReflectionKind4 } from "typedoc";
24915
24904
  function getTsForGirVersion() {
24916
24905
  if (true) {
24917
- return "4.0.0-beta.43";
24906
+ return "4.0.0-beta.44";
24918
24907
  }
24919
24908
  const __dirname3 = dirname7(fileURLToPath4(import.meta.url));
24920
24909
  return JSON.parse(readFileSync6(join13(__dirname3, "..", "..", "package.json"), "utf8")).version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-for-gir/cli",
3
- "version": "4.0.0-beta.43",
3
+ "version": "4.0.0-beta.44",
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-beta.43",
56
- "@ts-for-gir/generator-base": "^4.0.0-beta.43",
57
- "@ts-for-gir/generator-html-doc": "^4.0.0-beta.43",
58
- "@ts-for-gir/generator-json": "^4.0.0-beta.43",
59
- "@ts-for-gir/generator-typescript": "^4.0.0-beta.43",
60
- "@ts-for-gir/lib": "^4.0.0-beta.43",
61
- "@ts-for-gir/reporter": "^4.0.0-beta.43",
62
- "@ts-for-gir/tsconfig": "^4.0.0-beta.43",
55
+ "@gi.ts/parser": "^4.0.0-beta.44",
56
+ "@ts-for-gir/generator-base": "^4.0.0-beta.44",
57
+ "@ts-for-gir/generator-html-doc": "^4.0.0-beta.44",
58
+ "@ts-for-gir/generator-json": "^4.0.0-beta.44",
59
+ "@ts-for-gir/generator-typescript": "^4.0.0-beta.44",
60
+ "@ts-for-gir/lib": "^4.0.0-beta.44",
61
+ "@ts-for-gir/reporter": "^4.0.0-beta.44",
62
+ "@ts-for-gir/tsconfig": "^4.0.0-beta.44",
63
63
  "@types/ejs": "^3.1.5",
64
64
  "@types/inquirer": "^9.0.9",
65
65
  "@types/node": "^24.12.0",
@@ -69,7 +69,7 @@
69
69
  },
70
70
  "dependencies": {
71
71
  "@inquirer/prompts": "^8.3.2",
72
- "@ts-for-gir/templates": "^4.0.0-beta.43",
72
+ "@ts-for-gir/templates": "^4.0.0-beta.44",
73
73
  "colorette": "^2.0.20",
74
74
  "cosmiconfig": "^9.0.1",
75
75
  "ejs": "^5.0.1",