@gjsify/vite-plugin-gjsify 0.64.12 → 0.64.13-next.283
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/lib/index.d.ts +17 -0
- package/lib/index.js +7 -1
- package/package.json +10 -9
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Plugin } from 'vite';
|
|
2
|
+
import { type NativescriptLocaleOptions } from '@gjsify/rolldown-plugin-gjsify';
|
|
2
3
|
export interface GjsifyBrowserOptions {
|
|
3
4
|
/**
|
|
4
5
|
* Enable Deepkit type reflection (`@deepkit/type` runtime types). Off by
|
|
@@ -75,6 +76,22 @@ export interface GjsifyNativescriptOptions {
|
|
|
75
76
|
* `gi://` line). Off by default: it makes the widget toolkit a build-time dependency.
|
|
76
77
|
*/
|
|
77
78
|
giRenderer?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Compile `poDirectory/<lang>.po` into `locale/<lang>/LC_MESSAGES/<domain>.mo` assets of the
|
|
81
|
+
* build, so the Android GLib gettext finds them under `<filesDir>/app/locale` — the Vite mirror
|
|
82
|
+
* of `gjsify build --app nativescript`'s `nativescriptLocale`. Needs `msgfmt` on PATH.
|
|
83
|
+
*/
|
|
84
|
+
locale?: NativescriptLocaleOptions;
|
|
85
|
+
/**
|
|
86
|
+
* The GI namespaces this app's APK carries beyond the core set the runtime already
|
|
87
|
+
* holds (`GLib`, `GObject`, `Gio`, …) — `Ns` or `Ns-Version`, e.g. `['Soup-3.0']`.
|
|
88
|
+
* The Vite mirror of `gjsify build --app nativescript`'s `nativescript.giNamespaces`
|
|
89
|
+
* (ADR 0117 § 2): the declaration DECIDES what the AAR is built with, and this build
|
|
90
|
+
* refuses to emit a bundle that imports a namespace the declaration omits — because
|
|
91
|
+
* an APK carries its whole GI stack or does without it, and the missing typelib
|
|
92
|
+
* would surface as a throw on the device.
|
|
93
|
+
*/
|
|
94
|
+
giNamespaces?: string[];
|
|
78
95
|
}
|
|
79
96
|
/**
|
|
80
97
|
* Returns the Vite plugin array that brings `gjsify build --app nativescript`'s
|
package/lib/index.js
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
import { createRequire } from 'node:module';
|
|
41
41
|
import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
|
42
42
|
import * as nodePath from 'node:path';
|
|
43
|
-
import { gjsImportsEmptyPlugin, giRendererPlugin, platformResolvePlugin, nativescriptSuffixChain, browserSuffixChain, BROWSER_REFUSED_SUFFIXES, detectNativescriptPlatform, nativescriptPlatformDefines, cssAsStringPlugin, gresourcePlugin, gschemaPlugin, GSCHEMA_REGISTER, } from '@gjsify/rolldown-plugin-gjsify';
|
|
43
|
+
import { gjsImportsEmptyPlugin, giRendererPlugin, platformResolvePlugin, nativescriptSuffixChain, browserSuffixChain, BROWSER_REFUSED_SUFFIXES, detectNativescriptPlatform, nativescriptPlatformDefines, cssAsStringPlugin, gresourcePlugin, gschemaPlugin, GSCHEMA_REGISTER, nativescriptLocalePlugin, nativescriptGiSelectionPlugin, } from '@gjsify/rolldown-plugin-gjsify';
|
|
44
44
|
import blueprintPlugin from '@gjsify/vite-plugin-blueprint';
|
|
45
45
|
import { deepkitPlugin } from '@gjsify/rolldown-plugin-deepkit';
|
|
46
46
|
import { ALIASES_NODE_FOR_NATIVESCRIPT, GI_RENDERERS } from '@gjsify/resolve-npm';
|
|
@@ -465,6 +465,12 @@ export function gjsifyNativescript(options = {}) {
|
|
|
465
465
|
gresourcePlugin({ compressed: 'strip' }),
|
|
466
466
|
// `import './x.gschema.xml?schema'` registers the schema (ADR 0099 § 1), as `--app nativescript`.
|
|
467
467
|
gschemaPlugin({ mode: 'emit', register: GSCHEMA_REGISTER.nativescript }),
|
|
468
|
+
...(options.locale ? [nativescriptLocalePlugin(options.locale)] : []),
|
|
469
|
+
// ADR 0117 § 2's gate, on this path too: the NS CLI drives Vite, so without this
|
|
470
|
+
// `giNamespaces` is a key the config loader accepts and nothing acts on.
|
|
471
|
+
...(options.giNamespaces
|
|
472
|
+
? [nativescriptGiSelectionPlugin({ declared: options.giNamespaces })]
|
|
473
|
+
: []),
|
|
468
474
|
deepkitPlugin({ reflection: options.reflection }),
|
|
469
475
|
configPlugin,
|
|
470
476
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/vite-plugin-gjsify",
|
|
3
|
-
"version": "0.64.
|
|
3
|
+
"version": "0.64.13-next.283",
|
|
4
4
|
"description": "Vite plugin presets mirroring `gjsify build --app browser` / `--app nativescript` — dev (Vite/HMR) parity with the gjsify CLI targets.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
],
|
|
44
44
|
"license": "MIT",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@gjsify/empty": "
|
|
47
|
-
"@gjsify/resolve-npm": "
|
|
48
|
-
"@gjsify/rolldown-plugin-deepkit": "
|
|
49
|
-
"@gjsify/rolldown-plugin-gjsify": "
|
|
50
|
-
"@gjsify/vite-plugin-blueprint": "
|
|
46
|
+
"@gjsify/empty": "0.64.13-next.283",
|
|
47
|
+
"@gjsify/resolve-npm": "0.64.13-next.283",
|
|
48
|
+
"@gjsify/rolldown-plugin-deepkit": "0.64.13-next.283",
|
|
49
|
+
"@gjsify/rolldown-plugin-gjsify": "0.64.13-next.283",
|
|
50
|
+
"@gjsify/vite-plugin-blueprint": "0.64.13-next.283"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"vite": "^8.1.3"
|
|
@@ -58,13 +58,14 @@
|
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@gjsify/cli": "
|
|
62
|
-
"@gjsify/unit": "
|
|
61
|
+
"@gjsify/cli": "0.64.13-next.283",
|
|
62
|
+
"@gjsify/unit": "0.64.13-next.283",
|
|
63
63
|
"@types/node": "^25.9.2",
|
|
64
64
|
"typescript": "^6.0.3",
|
|
65
65
|
"vite": "^8.1.3"
|
|
66
66
|
},
|
|
67
67
|
"gjsify": {
|
|
68
68
|
"tier": 1
|
|
69
|
-
}
|
|
69
|
+
},
|
|
70
|
+
"gitHead": "05fae97125a374e84bf57c2d2d086fb53523f205"
|
|
70
71
|
}
|