@ts-for-gir/cli 4.0.1 → 4.0.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.
- package/bin/ts-for-gir +13 -4
- package/bin/ts-for-gir-gjs +334 -334
- package/dist-templates/types-gjsify/package.json +4 -4
- package/dist-templates/types-locally/package.json +1 -1
- package/dist-templates/types-npm/package.json +3 -3
- package/dist-templates/types-workspace/package.json +1 -1
- package/package.json +11 -11
- package/src/commands/self-update.ts +28 -2
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@biomejs/biome": "^2.4.13",
|
|
16
|
-
"@gjsify/cli": "^0.4.
|
|
16
|
+
"@gjsify/cli": "^0.4.25",
|
|
17
17
|
"typescript": "^6.0.2"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@girs/adw-1": "^1.10.0-4.0.0-rc.17",
|
|
21
|
-
"@girs/gio-2.0": "^2.88.0-4.0.
|
|
22
|
-
"@girs/gjs": "^4.0.
|
|
23
|
-
"@girs/glib-2.0": "^2.88.0-4.0.
|
|
21
|
+
"@girs/gio-2.0": "^2.88.0-4.0.1",
|
|
22
|
+
"@girs/gjs": "^4.0.1",
|
|
23
|
+
"@girs/glib-2.0": "^2.88.0-4.0.1",
|
|
24
24
|
"@girs/gtk-4.0": "^4.23.0-4.0.0-rc.17"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@girs/adw-1": "^1.10.0-4.0.0-rc.17",
|
|
18
|
-
"@girs/gio-2.0": "^2.88.0-4.0.
|
|
19
|
-
"@girs/gjs": "^4.0.
|
|
20
|
-
"@girs/glib-2.0": "^2.88.0-4.0.
|
|
18
|
+
"@girs/gio-2.0": "^2.88.0-4.0.1",
|
|
19
|
+
"@girs/gjs": "^4.0.1",
|
|
20
|
+
"@girs/glib-2.0": "^2.88.0-4.0.1",
|
|
21
21
|
"@girs/gtk-4.0": "^4.23.0-4.0.0-rc.17"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ts-for-gir/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.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",
|
|
@@ -164,15 +164,15 @@
|
|
|
164
164
|
".": "./src/index.ts"
|
|
165
165
|
},
|
|
166
166
|
"devDependencies": {
|
|
167
|
-
"@gi.ts/parser": "^4.0.
|
|
168
|
-
"@gjsify/cli": "^0.4.
|
|
169
|
-
"@ts-for-gir/generator-base": "^4.0.
|
|
170
|
-
"@ts-for-gir/generator-html-doc": "^4.0.
|
|
171
|
-
"@ts-for-gir/generator-json": "^4.0.
|
|
172
|
-
"@ts-for-gir/generator-typescript": "^4.0.
|
|
173
|
-
"@ts-for-gir/lib": "^4.0.
|
|
174
|
-
"@ts-for-gir/reporter": "^4.0.
|
|
175
|
-
"@ts-for-gir/tsconfig": "^4.0.
|
|
167
|
+
"@gi.ts/parser": "^4.0.2",
|
|
168
|
+
"@gjsify/cli": "^0.4.25",
|
|
169
|
+
"@ts-for-gir/generator-base": "^4.0.2",
|
|
170
|
+
"@ts-for-gir/generator-html-doc": "^4.0.2",
|
|
171
|
+
"@ts-for-gir/generator-json": "^4.0.2",
|
|
172
|
+
"@ts-for-gir/generator-typescript": "^4.0.2",
|
|
173
|
+
"@ts-for-gir/lib": "^4.0.2",
|
|
174
|
+
"@ts-for-gir/reporter": "^4.0.2",
|
|
175
|
+
"@ts-for-gir/tsconfig": "^4.0.2",
|
|
176
176
|
"@types/ejs": "^3.1.5",
|
|
177
177
|
"@types/inquirer": "^9.0.9",
|
|
178
178
|
"@types/node": "^25.6.2",
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
},
|
|
184
184
|
"dependencies": {
|
|
185
185
|
"@inquirer/prompts": "^8.4.2",
|
|
186
|
-
"@ts-for-gir/templates": "^4.0.
|
|
186
|
+
"@ts-for-gir/templates": "^4.0.2",
|
|
187
187
|
"colorette": "^2.0.20",
|
|
188
188
|
"cosmiconfig": "^9.0.1",
|
|
189
189
|
"ejs": "^5.0.2",
|
|
@@ -17,11 +17,37 @@ const GJS_ASSET_NAME = "ts-for-gir-gjs";
|
|
|
17
17
|
function getCurrentBinaryPath(): string | null {
|
|
18
18
|
const p = process.argv[1] ?? null;
|
|
19
19
|
if (!p) return null;
|
|
20
|
-
// Refuse to update in dev mode
|
|
21
|
-
|
|
20
|
+
// Refuse to update in dev mode — running from a source `.ts` file or
|
|
21
|
+
// from a project-local `node_modules/` (in which case the user should
|
|
22
|
+
// update via their package manager, not by replacing the binary in
|
|
23
|
+
// place).
|
|
24
|
+
if (p.endsWith(".ts")) return null;
|
|
25
|
+
if (p.includes("/node_modules/") && !isGjsifyGlobalLocation(p)) return null;
|
|
22
26
|
return p;
|
|
23
27
|
}
|
|
24
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Recognise the gjsify-install global location (`~/.local/share/gjsify/global/
|
|
31
|
+
* node_modules/<pkg>/...`, set up by `gjsify install -g` and `install.js`).
|
|
32
|
+
*
|
|
33
|
+
* The previous broad `path.includes("node_modules")` check rejected this
|
|
34
|
+
* location alongside genuine project-local installs, even though the
|
|
35
|
+
* gjsify-global location IS the canonical install spot for `ts-for-gir
|
|
36
|
+
* self-update`. The fix: only refuse updates for paths that contain
|
|
37
|
+
* `node_modules` AND aren't under the gjsify-global root.
|
|
38
|
+
*
|
|
39
|
+
* Matches both XDG_DATA_HOME-rooted and the documented fallback
|
|
40
|
+
* (`$HOME/.local/share/gjsify/global/`).
|
|
41
|
+
*/
|
|
42
|
+
function isGjsifyGlobalLocation(p: string): boolean {
|
|
43
|
+
const xdgData = process.env.XDG_DATA_HOME;
|
|
44
|
+
const home = process.env.HOME;
|
|
45
|
+
const candidates: string[] = [];
|
|
46
|
+
if (xdgData) candidates.push(`${xdgData}/gjsify/global/`);
|
|
47
|
+
if (home) candidates.push(`${home}/.local/share/gjsify/global/`);
|
|
48
|
+
return candidates.some((root) => p.startsWith(root));
|
|
49
|
+
}
|
|
50
|
+
|
|
25
51
|
async function fetchJson(url: string): Promise<unknown> {
|
|
26
52
|
const headers: Record<string, string> = {
|
|
27
53
|
Accept: "application/vnd.github.v3+json",
|