@gtkx/cli 1.2.0 → 1.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.
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +2 -0
- package/dist/builder.js.map +1 -1
- package/dist/deploy/freedesktop/copyright.d.ts +2 -2
- package/dist/deploy/freedesktop/copyright.d.ts.map +1 -1
- package/dist/deploy/freedesktop/copyright.js +105 -14
- package/dist/deploy/freedesktop/copyright.js.map +1 -1
- package/dist/deploy/node-runtime/download.d.ts +5 -1
- package/dist/deploy/node-runtime/download.d.ts.map +1 -1
- package/dist/deploy/node-runtime/download.js +6 -3
- package/dist/deploy/node-runtime/download.js.map +1 -1
- package/dist/deploy/node-runtime/index.d.ts +2 -1
- package/dist/deploy/node-runtime/index.d.ts.map +1 -1
- package/dist/deploy/node-runtime/index.js +10 -9
- package/dist/deploy/node-runtime/index.js.map +1 -1
- package/dist/deploy/node-runtime/license.d.ts +4 -0
- package/dist/deploy/node-runtime/license.d.ts.map +1 -0
- package/dist/deploy/node-runtime/license.js +19 -0
- package/dist/deploy/node-runtime/license.js.map +1 -0
- package/dist/deploy/notices/collect.d.ts +8 -0
- package/dist/deploy/notices/collect.d.ts.map +1 -0
- package/dist/deploy/notices/collect.js +17 -0
- package/dist/deploy/notices/collect.js.map +1 -0
- package/dist/deploy/notices/dependencies.d.ts +5 -0
- package/dist/deploy/notices/dependencies.d.ts.map +1 -0
- package/dist/deploy/notices/dependencies.js +39 -0
- package/dist/deploy/notices/dependencies.js.map +1 -0
- package/dist/deploy/notices/gtkx.d.ts +6 -0
- package/dist/deploy/notices/gtkx.d.ts.map +1 -0
- package/dist/deploy/notices/gtkx.js +68 -0
- package/dist/deploy/notices/gtkx.js.map +1 -0
- package/dist/deploy/notices/libraries.d.ts +4 -0
- package/dist/deploy/notices/libraries.d.ts.map +1 -0
- package/dist/deploy/notices/libraries.js +60 -0
- package/dist/deploy/notices/libraries.js.map +1 -0
- package/dist/deploy/notices/node-runtime.d.ts +4 -0
- package/dist/deploy/notices/node-runtime.d.ts.map +1 -0
- package/dist/deploy/notices/node-runtime.js +78 -0
- package/dist/deploy/notices/node-runtime.js.map +1 -0
- package/dist/deploy/notices/packages.d.ts +13 -0
- package/dist/deploy/notices/packages.d.ts.map +1 -0
- package/dist/deploy/notices/packages.js +115 -0
- package/dist/deploy/notices/packages.js.map +1 -0
- package/dist/deploy/notices/render.d.ts +4 -0
- package/dist/deploy/notices/render.d.ts.map +1 -0
- package/dist/deploy/notices/render.js +41 -0
- package/dist/deploy/notices/render.js.map +1 -0
- package/dist/deploy/notices/text.d.ts +5 -0
- package/dist/deploy/notices/text.d.ts.map +1 -0
- package/dist/deploy/notices/text.js +34 -0
- package/dist/deploy/notices/text.js.map +1 -0
- package/dist/deploy/payload/copy-tree.d.ts +2 -1
- package/dist/deploy/payload/copy-tree.d.ts.map +1 -1
- package/dist/deploy/payload/copy-tree.js +3 -1
- package/dist/deploy/payload/copy-tree.js.map +1 -1
- package/dist/deploy/payload/stage.d.ts +7 -3
- package/dist/deploy/payload/stage.d.ts.map +1 -1
- package/dist/deploy/payload/stage.js +25 -14
- package/dist/deploy/payload/stage.js.map +1 -1
- package/dist/deploy/run-deploy.d.ts.map +1 -1
- package/dist/deploy/run-deploy.js +22 -5
- package/dist/deploy/run-deploy.js.map +1 -1
- package/dist/deploy/settings/extra-files.d.ts +4 -0
- package/dist/deploy/settings/extra-files.d.ts.map +1 -0
- package/dist/deploy/settings/extra-files.js +11 -0
- package/dist/deploy/settings/extra-files.js.map +1 -0
- package/dist/deploy/settings/index.d.ts.map +1 -1
- package/dist/deploy/settings/index.js +2 -1
- package/dist/deploy/settings/index.js.map +1 -1
- package/dist/deploy/settings/package-manifest.d.ts +1 -0
- package/dist/deploy/settings/package-manifest.d.ts.map +1 -1
- package/dist/deploy/settings/package-manifest.js +7 -0
- package/dist/deploy/settings/package-manifest.js.map +1 -1
- package/dist/deploy/settings/paths.d.ts +2 -1
- package/dist/deploy/settings/paths.d.ts.map +1 -1
- package/dist/deploy/settings/paths.js +1 -1
- package/dist/deploy/settings/paths.js.map +1 -1
- package/dist/deploy/targets/flatpak-manifest.d.ts +3 -1
- package/dist/deploy/targets/flatpak-manifest.d.ts.map +1 -1
- package/dist/deploy/targets/flatpak-manifest.js +50 -4
- package/dist/deploy/targets/flatpak-manifest.js.map +1 -1
- package/dist/deploy/targets/flatpak-source.d.ts.map +1 -1
- package/dist/deploy/targets/flatpak-source.js +55 -1
- package/dist/deploy/targets/flatpak-source.js.map +1 -1
- package/dist/deploy/types.d.ts +22 -2
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/deploy/types.js.map +1 -1
- package/dist/vite-plugins/bundled-packages.d.ts +5 -0
- package/dist/vite-plugins/bundled-packages.d.ts.map +1 -0
- package/dist/vite-plugins/bundled-packages.js +63 -0
- package/dist/vite-plugins/bundled-packages.js.map +1 -0
- package/package.json +9 -9
- package/src/builder.ts +2 -0
- package/src/deploy/freedesktop/copyright.ts +153 -18
- package/src/deploy/node-runtime/download.ts +13 -4
- package/src/deploy/node-runtime/index.ts +17 -11
- package/src/deploy/node-runtime/license.ts +24 -0
- package/src/deploy/notices/collect.ts +26 -0
- package/src/deploy/notices/dependencies.ts +53 -0
- package/src/deploy/notices/gtkx.ts +92 -0
- package/src/deploy/notices/libraries.ts +81 -0
- package/src/deploy/notices/node-runtime.ts +101 -0
- package/src/deploy/notices/packages.ts +168 -0
- package/src/deploy/notices/render.ts +52 -0
- package/src/deploy/notices/text.ts +42 -0
- package/src/deploy/payload/copy-tree.ts +5 -1
- package/src/deploy/payload/stage.ts +40 -16
- package/src/deploy/run-deploy.ts +27 -5
- package/src/deploy/settings/extra-files.ts +21 -0
- package/src/deploy/settings/index.ts +2 -1
- package/src/deploy/settings/package-manifest.ts +10 -0
- package/src/deploy/settings/paths.ts +1 -1
- package/src/deploy/targets/flatpak-manifest.ts +69 -4
- package/src/deploy/targets/flatpak-source.ts +87 -1
- package/src/deploy/types.ts +27 -1
- package/src/vite-plugins/bundled-packages.ts +95 -0
- package/LICENSE +0 -373
|
@@ -8,8 +8,55 @@ const DEFAULT_RUNTIME_VERSION = "50";
|
|
|
8
8
|
const DEFAULT_SDK = "org.gnome.Sdk";
|
|
9
9
|
const DEFAULT_FINISH_ARGS = ["--share=ipc", "--socket=wayland", "--socket=fallback-x11", "--device=dri"];
|
|
10
10
|
const DEFAULT_CLEANUP = ["/include", "/share/pkgconfig", "*.la", "*.a"];
|
|
11
|
+
const DISPLAY_SOCKETS = ["fallback-x11", "wayland", "x11"];
|
|
12
|
+
const SOCKET_ARG = "--socket=";
|
|
13
|
+
const NO_SOCKET_ARG = "--nosocket=";
|
|
14
|
+
const NEGATED_ARGS = [
|
|
15
|
+
["--device=", "--nodevice="],
|
|
16
|
+
["--share=", "--unshare="],
|
|
17
|
+
[SOCKET_ARG, NO_SOCKET_ARG],
|
|
18
|
+
];
|
|
11
19
|
const branchFor = (settings) => settings.deploy.flatpak?.branch ?? DEFAULT_BRANCH;
|
|
12
20
|
const isSourceMode = (settings) => settings.deploy.flatpak?.mode === "source";
|
|
21
|
+
const negationFor = (arg) => {
|
|
22
|
+
const negated = NEGATED_ARGS.find(([prefix]) => arg.startsWith(prefix));
|
|
23
|
+
if (negated === undefined) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const [prefix, negation] = negated;
|
|
27
|
+
return `${negation}${arg.slice(prefix.length)}`;
|
|
28
|
+
};
|
|
29
|
+
const mergeArgs = (defaults, overrides) => {
|
|
30
|
+
const kept = defaults.filter((arg) => {
|
|
31
|
+
const negation = negationFor(arg);
|
|
32
|
+
return negation === null || !overrides.includes(negation);
|
|
33
|
+
});
|
|
34
|
+
return [...new Set([...kept, ...overrides])];
|
|
35
|
+
};
|
|
36
|
+
const finishArgsFor = (settings) => mergeArgs(DEFAULT_FINISH_ARGS, settings.deploy.flatpak?.finishArgs ?? []);
|
|
37
|
+
const cleanupFor = (settings) => {
|
|
38
|
+
const cleanup = settings.deploy.flatpak?.cleanup;
|
|
39
|
+
if (cleanup === undefined) {
|
|
40
|
+
return DEFAULT_CLEANUP;
|
|
41
|
+
}
|
|
42
|
+
return cleanup.length === 0 ? [] : mergeArgs(DEFAULT_CLEANUP, cleanup);
|
|
43
|
+
};
|
|
44
|
+
const grantedSockets = (args) => {
|
|
45
|
+
const granted = new Set();
|
|
46
|
+
for (const arg of args) {
|
|
47
|
+
if (arg.startsWith(SOCKET_ARG)) {
|
|
48
|
+
granted.add(arg.slice(SOCKET_ARG.length));
|
|
49
|
+
}
|
|
50
|
+
if (arg.startsWith(NO_SOCKET_ARG)) {
|
|
51
|
+
granted.delete(arg.slice(NO_SOCKET_ARG.length));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return granted;
|
|
55
|
+
};
|
|
56
|
+
const hasDisplaySocket = (args) => {
|
|
57
|
+
const granted = grantedSockets(args);
|
|
58
|
+
return DISPLAY_SOCKETS.some((socket) => granted.has(socket));
|
|
59
|
+
};
|
|
13
60
|
const sdkExtensionsFor = (settings) => {
|
|
14
61
|
const flatpak = settings.deploy.flatpak ?? {};
|
|
15
62
|
const nodeExtension = isSourceMode(settings) ? [nodeExtensionFor(settings)] : [];
|
|
@@ -34,15 +81,14 @@ const runtimeKeys = (settings) => {
|
|
|
34
81
|
};
|
|
35
82
|
const renderFlatpakManifest = (payload) => {
|
|
36
83
|
const settings = payload.settings;
|
|
37
|
-
const flatpak = settings.deploy.flatpak ?? {};
|
|
38
84
|
return {
|
|
39
85
|
id: settings.applicationId,
|
|
40
86
|
...runtimeKeys(settings),
|
|
41
87
|
command: settings.binaryName,
|
|
42
|
-
"finish-args":
|
|
43
|
-
cleanup:
|
|
88
|
+
"finish-args": finishArgsFor(settings),
|
|
89
|
+
cleanup: cleanupFor(settings),
|
|
44
90
|
modules: modulesFor(payload),
|
|
45
91
|
};
|
|
46
92
|
};
|
|
47
|
-
export { branchFor, renderFlatpakManifest };
|
|
93
|
+
export { branchFor, finishArgsFor, hasDisplaySocket, renderFlatpakManifest };
|
|
48
94
|
//# sourceMappingURL=flatpak-manifest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatpak-manifest.js","sourceRoot":"","sources":["../../../src/deploy/targets/flatpak-manifest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAIxD,MAAM,cAAc,GAAG,QAAQ,CAAC;AAChC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAC7C,MAAM,uBAAuB,GAAG,IAAI,CAAC;AACrC,MAAM,WAAW,GAAG,eAAe,CAAC;AACpC,MAAM,mBAAmB,GAAG,CAAC,aAAa,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,cAAc,CAAC,CAAC;AACzG,MAAM,eAAe,GAAG,CAAC,UAAU,EAAE,kBAAkB,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"flatpak-manifest.js","sourceRoot":"","sources":["../../../src/deploy/targets/flatpak-manifest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAIxD,MAAM,cAAc,GAAG,QAAQ,CAAC;AAChC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAC7C,MAAM,uBAAuB,GAAG,IAAI,CAAC;AACrC,MAAM,WAAW,GAAG,eAAe,CAAC;AACpC,MAAM,mBAAmB,GAA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IAC9C,MAAM,UAAU,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAE9C,OAAO;QACH,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,eAAe;QAC3C,iBAAiB,EAAE,OAAO,CAAC,cAAc,IAAI,uBAAuB;QACpE,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,WAAW;QAC/B,GAAG,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC;QACjC,GAAG,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC,WAAW,CAAC;QAChD,GAAG,QAAQ,CAAC,gBAAgB,EAAE,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC;KAClF,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAG,CAAC,OAAsB,EAAmB,EAAE;IACtE,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAElC,OAAO;QACH,EAAE,EAAE,QAAQ,CAAC,aAAa;QAC1B,GAAG,WAAW,CAAC,QAAQ,CAAC;QACxB,OAAO,EAAE,QAAQ,CAAC,UAAU;QAC5B,aAAa,EAAE,aAAa,CAAC,QAAQ,CAAC;QACtC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC;QAC7B,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;KAC/B,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,CAAC","sourcesContent":["import type { DeployPayload, DeploySettings } from \"../types.js\";\nimport { optional } from \"../nfpm/optional.js\";\nimport { flatpakPrebuiltModule } from \"./flatpak-prebuilt.js\";\nimport { flatpakSourceModule } from \"./flatpak-source.js\";\nimport { nodeExtensionFor } from \"./flatpak-sources.js\";\n\ntype FlatpakManifest = Record<string, unknown>;\n\nconst DEFAULT_BRANCH = \"stable\";\nconst DEFAULT_RUNTIME = \"org.gnome.Platform\";\nconst DEFAULT_RUNTIME_VERSION = \"50\";\nconst DEFAULT_SDK = \"org.gnome.Sdk\";\nconst DEFAULT_FINISH_ARGS = [\"--share=ipc\", \"--socket=wayland\", \"--socket=fallback-x11\", \"--device=dri\"];\nconst DEFAULT_CLEANUP = [\"/include\", \"/share/pkgconfig\", \"*.la\", \"*.a\"];\nconst DISPLAY_SOCKETS = [\"fallback-x11\", \"wayland\", \"x11\"];\nconst SOCKET_ARG = \"--socket=\";\nconst NO_SOCKET_ARG = \"--nosocket=\";\n\nconst NEGATED_ARGS: [string, string][] = [\n [\"--device=\", \"--nodevice=\"],\n [\"--share=\", \"--unshare=\"],\n [SOCKET_ARG, NO_SOCKET_ARG],\n];\n\nconst branchFor = (settings: DeploySettings): string => settings.deploy.flatpak?.branch ?? DEFAULT_BRANCH;\nconst isSourceMode = (settings: DeploySettings): boolean => settings.deploy.flatpak?.mode === \"source\";\n\nconst negationFor = (arg: string): string | null => {\n const negated = NEGATED_ARGS.find(([prefix]) => arg.startsWith(prefix));\n\n if (negated === undefined) {\n return null;\n }\n\n const [prefix, negation] = negated;\n\n return `${negation}${arg.slice(prefix.length)}`;\n};\n\nconst mergeArgs = (defaults: string[], overrides: string[]): string[] => {\n const kept = defaults.filter((arg) => {\n const negation = negationFor(arg);\n\n return negation === null || !overrides.includes(negation);\n });\n\n return [...new Set([...kept, ...overrides])];\n};\n\nconst finishArgsFor = (settings: DeploySettings): string[] =>\n mergeArgs(DEFAULT_FINISH_ARGS, settings.deploy.flatpak?.finishArgs ?? []);\n\nconst cleanupFor = (settings: DeploySettings): string[] => {\n const cleanup = settings.deploy.flatpak?.cleanup;\n\n if (cleanup === undefined) {\n return DEFAULT_CLEANUP;\n }\n\n return cleanup.length === 0 ? [] : mergeArgs(DEFAULT_CLEANUP, cleanup);\n};\n\nconst grantedSockets = (args: string[]): Set<string> => {\n const granted: Set<string> = new Set();\n\n for (const arg of args) {\n if (arg.startsWith(SOCKET_ARG)) {\n granted.add(arg.slice(SOCKET_ARG.length));\n }\n\n if (arg.startsWith(NO_SOCKET_ARG)) {\n granted.delete(arg.slice(NO_SOCKET_ARG.length));\n }\n }\n\n return granted;\n};\n\nconst hasDisplaySocket = (args: string[]): boolean => {\n const granted = grantedSockets(args);\n\n return DISPLAY_SOCKETS.some((socket) => granted.has(socket));\n};\n\nconst sdkExtensionsFor = (settings: DeploySettings): string[] => {\n const flatpak = settings.deploy.flatpak ?? {};\n const nodeExtension = isSourceMode(settings) ? [nodeExtensionFor(settings)] : [];\n\n return [...nodeExtension, ...(flatpak.sdkExtensions ?? [])];\n};\n\nconst modulesFor = (payload: DeployPayload): unknown[] => {\n const settings = payload.settings;\n const own = isSourceMode(settings) ? flatpakSourceModule(payload) : flatpakPrebuiltModule(payload);\n\n return [...(settings.deploy.flatpak?.modules ?? []), own];\n};\n\nconst runtimeKeys = (settings: DeploySettings): FlatpakManifest => {\n const flatpak = settings.deploy.flatpak ?? {};\n const extensions = sdkExtensionsFor(settings);\n\n return {\n runtime: flatpak.runtime ?? DEFAULT_RUNTIME,\n \"runtime-version\": flatpak.runtimeVersion ?? DEFAULT_RUNTIME_VERSION,\n sdk: flatpak.sdk ?? DEFAULT_SDK,\n ...optional(\"base\", flatpak.base),\n ...optional(\"base-version\", flatpak.baseVersion),\n ...optional(\"sdk-extensions\", extensions.length === 0 ? undefined : extensions),\n };\n};\n\nconst renderFlatpakManifest = (payload: DeployPayload): FlatpakManifest => {\n const settings = payload.settings;\n\n return {\n id: settings.applicationId,\n ...runtimeKeys(settings),\n command: settings.binaryName,\n \"finish-args\": finishArgsFor(settings),\n cleanup: cleanupFor(settings),\n modules: modulesFor(payload),\n };\n};\n\nexport { branchFor, finishArgsFor, hasDisplaySocket, renderFlatpakManifest };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatpak-source.d.ts","sourceRoot":"","sources":["../../../src/deploy/targets/flatpak-source.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flatpak-source.d.ts","sourceRoot":"","sources":["../../../src/deploy/targets/flatpak-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,aAAa,CAAC;AAejE,OAAO,EAAe,KAAK,aAAa,EAA2C,MAAM,uBAAuB,CAAC;AA6MjH,QAAA,MAAM,mBAAmB,GAAI,SAAS,aAAa,KAAG,aA0CrD,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
2
|
+
import { posix, relative, resolve } from "node:path";
|
|
2
3
|
import { listFilesRecursive } from "../../internal/list-files.js";
|
|
3
4
|
import { BUNDLE_FILENAME } from "../../vite-plugins/esm-extension.js";
|
|
4
5
|
import { renderDbusService } from "../freedesktop/dbus-service.js";
|
|
5
6
|
import { renderDesktopEntry } from "../freedesktop/desktop-entry.js";
|
|
6
7
|
import { renderMetainfo } from "../freedesktop/metainfo.js";
|
|
8
|
+
import { renderMimePackage } from "../freedesktop/mime-package.js";
|
|
7
9
|
import { optional } from "../nfpm/optional.js";
|
|
10
|
+
import { renderNotices } from "../notices/render.js";
|
|
11
|
+
import { executableModeFor } from "../payload/copy-tree.js";
|
|
8
12
|
import { iconPathFor } from "../payload/icons.js";
|
|
9
13
|
import { renderLauncher } from "../payload/launcher.js";
|
|
14
|
+
import { licenseDestination, nodeLicenseDestination, NOTICES_FILENAME, noticesDestination } from "../payload/stage.js";
|
|
15
|
+
import { isInside } from "../settings/paths.js";
|
|
10
16
|
import { pnpmPathFor, pnpmSources } from "./flatpak-pnpm.js";
|
|
11
17
|
import { DESTINATION, postInstallCommands, validationCommands } from "./flatpak-prebuilt.js";
|
|
12
18
|
import { detectPackageManager, GENERATED_SOURCES, installCommandFor, nodeExtensionPathFor, pnpmPinFor, resolveGitSource, } from "./flatpak-sources.js";
|
|
@@ -17,6 +23,7 @@ const NPM_CACHE_DIR = "flatpak-node/npm-cache";
|
|
|
17
23
|
const YARN_MIRROR_DIR = "flatpak-node/yarn-mirror";
|
|
18
24
|
const PLAIN_ARGUMENT = /^[\w./-]+$/;
|
|
19
25
|
const QUOTE_ESCAPE = String.raw `'\''`;
|
|
26
|
+
const OCTAL_RADIX = 8;
|
|
20
27
|
const inlineSource = (fileName, contents) => ({
|
|
21
28
|
type: "inline",
|
|
22
29
|
"dest-filename": fileName,
|
|
@@ -45,10 +52,18 @@ const activationSource = (settings) => settings.isDbusActivatable
|
|
|
45
52
|
const activationInstallCommands = (settings) => settings.isDbusActivatable
|
|
46
53
|
? [installCommand(`${settings.applicationId}.service`, `${DESTINATION}/share/dbus-1/services/${settings.applicationId}.service`, "m644")]
|
|
47
54
|
: [];
|
|
55
|
+
const mimeSources = (settings) => {
|
|
56
|
+
const contents = renderMimePackage(settings);
|
|
57
|
+
return contents === null ? [] : [inlineSource(`${settings.applicationId}.xml`, contents)];
|
|
58
|
+
};
|
|
59
|
+
const mimeInstallCommands = (settings) => settings.fileAssociations.length === 0
|
|
60
|
+
? []
|
|
61
|
+
: [installCommand(`${settings.applicationId}.xml`, `${DESTINATION}/share/mime/packages/${settings.applicationId}.xml`, "m644")];
|
|
48
62
|
const metadataInstallCommands = (settings) => [
|
|
49
63
|
installCommand(`${settings.applicationId}.desktop`, `${DESTINATION}/share/applications/${settings.applicationId}.desktop`, "m644"),
|
|
50
64
|
installCommand(`${settings.applicationId}.metainfo.xml`, `${DESTINATION}/share/metainfo/${settings.applicationId}.metainfo.xml`, "m644"),
|
|
51
65
|
...activationInstallCommands(settings),
|
|
66
|
+
...mimeInstallCommands(settings),
|
|
52
67
|
];
|
|
53
68
|
const schemaInstallCommands = (settings) => settings.paths.schemaFiles.map((file) => {
|
|
54
69
|
const name = posix.basename(file);
|
|
@@ -65,6 +80,40 @@ const iconInstallCommands = (settings) => {
|
|
|
65
80
|
}
|
|
66
81
|
return listFilesRecursive(iconsDir).map((icon) => iconInstallCommand(settings, icon.absPath, icon.rel));
|
|
67
82
|
};
|
|
83
|
+
const assertInsideProject = (settings, installed) => {
|
|
84
|
+
const { resolved } = installed;
|
|
85
|
+
const target = existsSync(resolved) ? realpathSync(resolved) : resolved;
|
|
86
|
+
if (isInside(settings.paths.root, target)) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
throw new Error(`Cannot install "${installed.destination}" from "${installed.source}": a source-mode manifest builds from ` +
|
|
90
|
+
`your git checkout, so every file it installs has to live inside ${settings.paths.root} and be committed. ` +
|
|
91
|
+
"Move it into the project, or drop it from the source build.");
|
|
92
|
+
};
|
|
93
|
+
const licenseInstallCommands = (settings) => {
|
|
94
|
+
const licenseFile = settings.paths.licenseFile;
|
|
95
|
+
if (licenseFile === null) {
|
|
96
|
+
return [];
|
|
97
|
+
}
|
|
98
|
+
const destination = licenseDestination(settings);
|
|
99
|
+
assertInsideProject(settings, { destination, source: licenseFile, resolved: licenseFile });
|
|
100
|
+
const target = `${DESTINATION}/${shellArgument(destination)}`;
|
|
101
|
+
return [installCommand(projectRelative(settings, licenseFile), target, "m644")];
|
|
102
|
+
};
|
|
103
|
+
const noticesInstallCommands = (settings) => {
|
|
104
|
+
const extensionLicense = `${nodeExtensionPathFor(settings)}/LICENSE`;
|
|
105
|
+
const nodeTarget = `${DESTINATION}/${shellArgument(nodeLicenseDestination(settings))}`;
|
|
106
|
+
return [
|
|
107
|
+
installCommand(NOTICES_FILENAME, `${DESTINATION}/${shellArgument(noticesDestination(settings))}`, "m644"),
|
|
108
|
+
`test ! -f ${extensionLicense} || ${installCommand(extensionLicense, nodeTarget, "m644")}`,
|
|
109
|
+
];
|
|
110
|
+
};
|
|
111
|
+
const extraFileInstallCommands = (settings) => settings.extraFiles.map((file) => {
|
|
112
|
+
const resolved = resolve(settings.paths.root, file.source);
|
|
113
|
+
assertInsideProject(settings, { destination: file.destination, source: file.source, resolved });
|
|
114
|
+
const mode = file.mode ?? executableModeFor(resolved);
|
|
115
|
+
return installCommand(projectRelative(settings, resolved), `${DESTINATION}/${shellArgument(file.destination)}`, `m${mode.toString(OCTAL_RADIX)}`);
|
|
116
|
+
});
|
|
68
117
|
const moduleDirFor = (settings) => `${MODULE_BUILD_ROOT}/${settings.binaryName}`;
|
|
69
118
|
const offlineEnvFor = (manager, settings) => {
|
|
70
119
|
if (manager === "pnpm") {
|
|
@@ -99,7 +148,9 @@ const flatpakSourceModule = (payload) => {
|
|
|
99
148
|
GENERATED_SOURCES,
|
|
100
149
|
inlineSource(`${settings.applicationId}.desktop`, renderDesktopEntry(settings)),
|
|
101
150
|
inlineSource(`${settings.applicationId}.metainfo.xml`, renderMetainfo(settings)),
|
|
151
|
+
...mimeSources(settings),
|
|
102
152
|
inlineSource(LAUNCHER_FILENAME, renderLauncher(settings)),
|
|
153
|
+
inlineSource(NOTICES_FILENAME, renderNotices(settings, payload.notices)),
|
|
103
154
|
...activationSource(settings),
|
|
104
155
|
],
|
|
105
156
|
"build-commands": [
|
|
@@ -109,6 +160,9 @@ const flatpakSourceModule = (payload) => {
|
|
|
109
160
|
...metadataInstallCommands(settings),
|
|
110
161
|
...schemaInstallCommands(settings),
|
|
111
162
|
...iconInstallCommands(settings),
|
|
163
|
+
...licenseInstallCommands(settings),
|
|
164
|
+
...noticesInstallCommands(settings),
|
|
165
|
+
...extraFileInstallCommands(settings),
|
|
112
166
|
...(settings.deploy.flatpak?.buildCommands ?? []),
|
|
113
167
|
...validationCommands(settings),
|
|
114
168
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatpak-source.js","sourceRoot":"","sources":["../../../src/deploy/targets/flatpak-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gC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,CAAC;YAC/E,YAAY,CAAC,GAAG,QAAQ,CAAC,aAAa,eAAe,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;YAChF,YAAY,CAAC,iBAAiB,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;YACzD,GAAG,gBAAgB,CAAC,QAAQ,CAAC;SAChC;QACD,gBAAgB,EAAE;YACd,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC;YACpC,gBAAgB;YAChB,GAAG,sBAAsB,CAAC,QAAQ,EAAE,iBAAiB,CAAC;YACtD,GAAG,uBAAuB,CAAC,QAAQ,CAAC;YACpC,GAAG,qBAAqB,CAAC,QAAQ,CAAC;YAClC,GAAG,mBAAmB,CAAC,QAAQ,CAAC;YAChC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,aAAa,IAAI,EAAE,CAAC;YACjD,GAAG,kBAAkB,CAAC,QAAQ,CAAC;SAClC;QACD,GAAG,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC;KAClF,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC","sourcesContent":["import { posix, relative } from \"node:path\";\nimport type { DeployPayload, DeploySettings } from \"../types.js\";\nimport { listFilesRecursive } from \"../../internal/list-files.js\";\nimport { BUNDLE_FILENAME } from \"../../vite-plugins/esm-extension.js\";\nimport { renderDbusService } from \"../freedesktop/dbus-service.js\";\nimport { renderDesktopEntry } from \"../freedesktop/desktop-entry.js\";\nimport { renderMetainfo } from \"../freedesktop/metainfo.js\";\nimport { optional } from \"../nfpm/optional.js\";\nimport { iconPathFor } from \"../payload/icons.js\";\nimport { renderLauncher } from \"../payload/launcher.js\";\nimport { pnpmPathFor, type PnpmPin, pnpmSources } from \"./flatpak-pnpm.js\";\nimport { DESTINATION, type FlatpakModule, postInstallCommands, validationCommands } from \"./flatpak-prebuilt.js\";\nimport {\n detectPackageManager,\n GENERATED_SOURCES,\n installCommandFor,\n nodeExtensionPathFor,\n type PackageManager,\n pnpmPinFor,\n resolveGitSource,\n} from \"./flatpak-sources.js\";\n\nconst LAUNCHER_FILENAME = \"launcher.sh\";\nconst MODULE_BUILD_ROOT = \"/run/build\";\nconst RUNTIME_PREFIX = \"/app\";\nconst NPM_CACHE_DIR = \"flatpak-node/npm-cache\";\nconst YARN_MIRROR_DIR = \"flatpak-node/yarn-mirror\";\nconst PLAIN_ARGUMENT = /^[\\w./-]+$/;\nconst QUOTE_ESCAPE = String.raw`'\\''`;\n\nconst inlineSource = (fileName: string, contents: string): FlatpakModule => ({\n type: \"inline\",\n \"dest-filename\": fileName,\n contents,\n});\n\nconst projectRelative = (settings: DeploySettings, path: string): string =>\n relative(settings.paths.root, path).replaceAll(\"\\\\\", \"/\");\n\nconst shellArgument = (value: string): string =>\n PLAIN_ARGUMENT.test(value) ? value : `'${value.split(\"'\").join(QUOTE_ESCAPE)}'`;\n\nconst pathArgument = (value: string): string => shellArgument(value.startsWith(\"-\") ? `./${value}` : value);\n\nconst installCommand = (source: string, destination: string, mode: string): string =>\n `install -D${mode} ${pathArgument(source)} ${destination}`;\n\nconst runtimeInstallCommands = (settings: DeploySettings, nodeExtensionPath: string): string[] => {\n const lib = `${DESTINATION}/lib/${settings.binaryName}`;\n\n return [\n installCommand(`${nodeExtensionPath}/bin/node`, `${lib}/node`, \"m755\"),\n installCommand(`dist/${BUNDLE_FILENAME}`, `${lib}/${BUNDLE_FILENAME}`, \"m644\"),\n installCommand(\"dist/gtkx.node\", `${lib}/gtkx.node`, \"m755\"),\n \"test ! -f dist/gtkx.gresource || \" + installCommand(\"dist/gtkx.gresource\", `${lib}/gtkx.gresource`, \"m644\"),\n \"test ! -f dist/gschemas.compiled || \" +\n installCommand(\"dist/gschemas.compiled\", `${lib}/gschemas.compiled`, \"m644\"),\n `test ! -d dist/assets || cp -a dist/assets ${lib}/assets`,\n installCommand(LAUNCHER_FILENAME, `${DESTINATION}/bin/${settings.binaryName}`, \"m755\"),\n ];\n};\n\nconst activationSource = (settings: DeploySettings): FlatpakModule[] =>\n settings.isDbusActivatable\n ? [inlineSource(`${settings.applicationId}.service`, renderDbusService(settings, RUNTIME_PREFIX))]\n : [];\n\nconst activationInstallCommands = (settings: DeploySettings): string[] =>\n settings.isDbusActivatable\n ? [installCommand(\n `${settings.applicationId}.service`,\n `${DESTINATION}/share/dbus-1/services/${settings.applicationId}.service`,\n \"m644\",\n )]\n : [];\n\nconst metadataInstallCommands = (settings: DeploySettings): string[] => [\n installCommand(\n `${settings.applicationId}.desktop`,\n `${DESTINATION}/share/applications/${settings.applicationId}.desktop`,\n \"m644\",\n ),\n installCommand(\n `${settings.applicationId}.metainfo.xml`,\n `${DESTINATION}/share/metainfo/${settings.applicationId}.metainfo.xml`,\n \"m644\",\n ),\n ...activationInstallCommands(settings),\n];\n\nconst schemaInstallCommands = (settings: DeploySettings): string[] =>\n settings.paths.schemaFiles.map((file) => {\n const name = posix.basename(file);\n\n return installCommand(\n projectRelative(settings, file),\n `${DESTINATION}/share/glib-2.0/schemas/${shellArgument(name)}`,\n \"m644\",\n );\n });\n\nconst iconInstallCommand = (settings: DeploySettings, source: string, rel: string): string =>\n installCommand(\n projectRelative(settings, source),\n `${DESTINATION}/share/icons/${shellArgument(rel.replaceAll(\"\\\\\", \"/\"))}`,\n \"m644\",\n );\n\nconst iconInstallCommands = (settings: DeploySettings): string[] => {\n const { iconsDir, iconFile } = settings.paths;\n\n if (iconFile !== null) {\n return [iconInstallCommand(settings, iconFile, iconPathFor(settings, iconFile))];\n }\n\n if (iconsDir === null) {\n return [];\n }\n\n return listFilesRecursive(iconsDir).map((icon) => iconInstallCommand(settings, icon.absPath, icon.rel));\n};\n\nconst moduleDirFor = (settings: DeploySettings): string => `${MODULE_BUILD_ROOT}/${settings.binaryName}`;\n\nconst offlineEnvFor = (manager: PackageManager, settings: DeploySettings): Record<string, string> => {\n if (manager === \"pnpm\") {\n return {};\n }\n\n if (manager === \"yarn\") {\n return { YARN_OFFLINE_MIRROR: `${moduleDirFor(settings)}/${YARN_MIRROR_DIR}` };\n }\n\n return { npm_config_cache: `${moduleDirFor(settings)}/${NPM_CACHE_DIR}`, npm_config_offline: \"true\" };\n};\n\nconst appendPathFor = (settings: DeploySettings, pin: PnpmPin | null, nodeExtensionPath: string): string =>\n pin === null\n ? `${nodeExtensionPath}/bin`\n : `${pnpmPathFor(moduleDirFor(settings))}:${nodeExtensionPath}/bin`;\n\nconst flatpakSourceModule = (payload: DeployPayload): FlatpakModule => {\n const settings = payload.settings;\n const manager = detectPackageManager(settings);\n const pin = pnpmPinFor(settings, manager);\n const postInstall = postInstallCommands(payload);\n const nodeExtensionPath = nodeExtensionPathFor(settings);\n\n return {\n name: settings.binaryName,\n buildsystem: \"simple\",\n \"build-options\": {\n \"append-path\": appendPathFor(settings, pin, nodeExtensionPath),\n env: { npm_config_nodedir: nodeExtensionPath, ...offlineEnvFor(manager, settings) },\n strip: false,\n \"no-debuginfo\": true,\n },\n sources: [\n resolveGitSource(settings),\n ...(pin === null ? [] : pnpmSources(pin, moduleDirFor(settings))),\n GENERATED_SOURCES,\n inlineSource(`${settings.applicationId}.desktop`, renderDesktopEntry(settings)),\n inlineSource(`${settings.applicationId}.metainfo.xml`, renderMetainfo(settings)),\n inlineSource(LAUNCHER_FILENAME, renderLauncher(settings)),\n ...activationSource(settings),\n ],\n \"build-commands\": [\n installCommandFor(settings, manager),\n \"npx gtkx build\",\n ...runtimeInstallCommands(settings, nodeExtensionPath),\n ...metadataInstallCommands(settings),\n ...schemaInstallCommands(settings),\n ...iconInstallCommands(settings),\n ...(settings.deploy.flatpak?.buildCommands ?? []),\n ...validationCommands(settings),\n ],\n ...optional(\"post-install\", postInstall.length === 0 ? undefined : postInstall),\n };\n};\n\nexport { flatpakSourceModule };\n"]}
|
|
1
|
+
{"version":3,"file":"flatpak-source.js","sourceRoot":"","sources":["../../../src/deploy/targets/flatpak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C,gBAAgB,EAAE,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YACxE,GAAG,gBAAgB,CAAC,QAAQ,CAAC;SAChC;QACD,gBAAgB,EAAE;YACd,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC;YACpC,gBAAgB;YAChB,GAAG,sBAAsB,CAAC,QAAQ,EAAE,iBAAiB,CAAC;YACtD,GAAG,uBAAuB,CAAC,QAAQ,CAAC;YACpC,GAAG,qBAAqB,CAAC,QAAQ,CAAC;YAClC,GAAG,mBAAmB,CAAC,QAAQ,CAAC;YAChC,GAAG,sBAAsB,CAAC,QAAQ,CAAC;YACnC,GAAG,sBAAsB,CAAC,QAAQ,CAAC;YACnC,GAAG,wBAAwB,CAAC,QAAQ,CAAC;YACrC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,aAAa,IAAI,EAAE,CAAC;YACjD,GAAG,kBAAkB,CAAC,QAAQ,CAAC;SAClC;QACD,GAAG,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC;KAClF,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC","sourcesContent":["import { existsSync, realpathSync } from \"node:fs\";\nimport { posix, relative, resolve } from \"node:path\";\nimport type { DeployPayload, DeploySettings } from \"../types.js\";\nimport { listFilesRecursive } from \"../../internal/list-files.js\";\nimport { BUNDLE_FILENAME } from \"../../vite-plugins/esm-extension.js\";\nimport { renderDbusService } from \"../freedesktop/dbus-service.js\";\nimport { renderDesktopEntry } from \"../freedesktop/desktop-entry.js\";\nimport { renderMetainfo } from \"../freedesktop/metainfo.js\";\nimport { renderMimePackage } from \"../freedesktop/mime-package.js\";\nimport { optional } from \"../nfpm/optional.js\";\nimport { renderNotices } from \"../notices/render.js\";\nimport { executableModeFor } from \"../payload/copy-tree.js\";\nimport { iconPathFor } from \"../payload/icons.js\";\nimport { renderLauncher } from \"../payload/launcher.js\";\nimport { licenseDestination, nodeLicenseDestination, NOTICES_FILENAME, noticesDestination } from \"../payload/stage.js\";\nimport { isInside } from \"../settings/paths.js\";\nimport { pnpmPathFor, type PnpmPin, pnpmSources } from \"./flatpak-pnpm.js\";\nimport { DESTINATION, type FlatpakModule, postInstallCommands, validationCommands } from \"./flatpak-prebuilt.js\";\nimport {\n detectPackageManager,\n GENERATED_SOURCES,\n installCommandFor,\n nodeExtensionPathFor,\n type PackageManager,\n pnpmPinFor,\n resolveGitSource,\n} from \"./flatpak-sources.js\";\n\ntype InstalledFile = {\n destination: string;\n source: string;\n resolved: string;\n};\n\nconst LAUNCHER_FILENAME = \"launcher.sh\";\nconst MODULE_BUILD_ROOT = \"/run/build\";\nconst RUNTIME_PREFIX = \"/app\";\nconst NPM_CACHE_DIR = \"flatpak-node/npm-cache\";\nconst YARN_MIRROR_DIR = \"flatpak-node/yarn-mirror\";\nconst PLAIN_ARGUMENT = /^[\\w./-]+$/;\nconst QUOTE_ESCAPE = String.raw`'\\''`;\nconst OCTAL_RADIX = 8;\n\nconst inlineSource = (fileName: string, contents: string): FlatpakModule => ({\n type: \"inline\",\n \"dest-filename\": fileName,\n contents,\n});\n\nconst projectRelative = (settings: DeploySettings, path: string): string =>\n relative(settings.paths.root, path).replaceAll(\"\\\\\", \"/\");\n\nconst shellArgument = (value: string): string =>\n PLAIN_ARGUMENT.test(value) ? value : `'${value.split(\"'\").join(QUOTE_ESCAPE)}'`;\n\nconst pathArgument = (value: string): string => shellArgument(value.startsWith(\"-\") ? `./${value}` : value);\n\nconst installCommand = (source: string, destination: string, mode: string): string =>\n `install -D${mode} ${pathArgument(source)} ${destination}`;\n\nconst runtimeInstallCommands = (settings: DeploySettings, nodeExtensionPath: string): string[] => {\n const lib = `${DESTINATION}/lib/${settings.binaryName}`;\n\n return [\n installCommand(`${nodeExtensionPath}/bin/node`, `${lib}/node`, \"m755\"),\n installCommand(`dist/${BUNDLE_FILENAME}`, `${lib}/${BUNDLE_FILENAME}`, \"m644\"),\n installCommand(\"dist/gtkx.node\", `${lib}/gtkx.node`, \"m755\"),\n \"test ! -f dist/gtkx.gresource || \" + installCommand(\"dist/gtkx.gresource\", `${lib}/gtkx.gresource`, \"m644\"),\n \"test ! -f dist/gschemas.compiled || \" +\n installCommand(\"dist/gschemas.compiled\", `${lib}/gschemas.compiled`, \"m644\"),\n `test ! -d dist/assets || cp -a dist/assets ${lib}/assets`,\n installCommand(LAUNCHER_FILENAME, `${DESTINATION}/bin/${settings.binaryName}`, \"m755\"),\n ];\n};\n\nconst activationSource = (settings: DeploySettings): FlatpakModule[] =>\n settings.isDbusActivatable\n ? [inlineSource(`${settings.applicationId}.service`, renderDbusService(settings, RUNTIME_PREFIX))]\n : [];\n\nconst activationInstallCommands = (settings: DeploySettings): string[] =>\n settings.isDbusActivatable\n ? [installCommand(\n `${settings.applicationId}.service`,\n `${DESTINATION}/share/dbus-1/services/${settings.applicationId}.service`,\n \"m644\",\n )]\n : [];\n\nconst mimeSources = (settings: DeploySettings): FlatpakModule[] => {\n const contents = renderMimePackage(settings);\n\n return contents === null ? [] : [inlineSource(`${settings.applicationId}.xml`, contents)];\n};\n\nconst mimeInstallCommands = (settings: DeploySettings): string[] =>\n settings.fileAssociations.length === 0\n ? []\n : [installCommand(\n `${settings.applicationId}.xml`,\n `${DESTINATION}/share/mime/packages/${settings.applicationId}.xml`,\n \"m644\",\n )];\n\nconst metadataInstallCommands = (settings: DeploySettings): string[] => [\n installCommand(\n `${settings.applicationId}.desktop`,\n `${DESTINATION}/share/applications/${settings.applicationId}.desktop`,\n \"m644\",\n ),\n installCommand(\n `${settings.applicationId}.metainfo.xml`,\n `${DESTINATION}/share/metainfo/${settings.applicationId}.metainfo.xml`,\n \"m644\",\n ),\n ...activationInstallCommands(settings),\n ...mimeInstallCommands(settings),\n];\n\nconst schemaInstallCommands = (settings: DeploySettings): string[] =>\n settings.paths.schemaFiles.map((file) => {\n const name = posix.basename(file);\n\n return installCommand(\n projectRelative(settings, file),\n `${DESTINATION}/share/glib-2.0/schemas/${shellArgument(name)}`,\n \"m644\",\n );\n });\n\nconst iconInstallCommand = (settings: DeploySettings, source: string, rel: string): string =>\n installCommand(\n projectRelative(settings, source),\n `${DESTINATION}/share/icons/${shellArgument(rel.replaceAll(\"\\\\\", \"/\"))}`,\n \"m644\",\n );\n\nconst iconInstallCommands = (settings: DeploySettings): string[] => {\n const { iconsDir, iconFile } = settings.paths;\n\n if (iconFile !== null) {\n return [iconInstallCommand(settings, iconFile, iconPathFor(settings, iconFile))];\n }\n\n if (iconsDir === null) {\n return [];\n }\n\n return listFilesRecursive(iconsDir).map((icon) => iconInstallCommand(settings, icon.absPath, icon.rel));\n};\n\nconst assertInsideProject = (settings: DeploySettings, installed: InstalledFile): void => {\n const { resolved } = installed;\n const target = existsSync(resolved) ? realpathSync(resolved) : resolved;\n\n if (isInside(settings.paths.root, target)) {\n return;\n }\n\n throw new Error(\n `Cannot install \"${installed.destination}\" from \"${installed.source}\": a source-mode manifest builds from ` +\n `your git checkout, so every file it installs has to live inside ${settings.paths.root} and be committed. ` +\n \"Move it into the project, or drop it from the source build.\",\n );\n};\n\nconst licenseInstallCommands = (settings: DeploySettings): string[] => {\n const licenseFile = settings.paths.licenseFile;\n\n if (licenseFile === null) {\n return [];\n }\n\n const destination = licenseDestination(settings);\n assertInsideProject(settings, { destination, source: licenseFile, resolved: licenseFile });\n const target = `${DESTINATION}/${shellArgument(destination)}`;\n\n return [installCommand(projectRelative(settings, licenseFile), target, \"m644\")];\n};\n\nconst noticesInstallCommands = (settings: DeploySettings): string[] => {\n const extensionLicense = `${nodeExtensionPathFor(settings)}/LICENSE`;\n const nodeTarget = `${DESTINATION}/${shellArgument(nodeLicenseDestination(settings))}`;\n\n return [\n installCommand(NOTICES_FILENAME, `${DESTINATION}/${shellArgument(noticesDestination(settings))}`, \"m644\"),\n `test ! -f ${extensionLicense} || ${installCommand(extensionLicense, nodeTarget, \"m644\")}`,\n ];\n};\n\nconst extraFileInstallCommands = (settings: DeploySettings): string[] =>\n settings.extraFiles.map((file) => {\n const resolved = resolve(settings.paths.root, file.source);\n assertInsideProject(settings, { destination: file.destination, source: file.source, resolved });\n const mode = file.mode ?? executableModeFor(resolved);\n\n return installCommand(\n projectRelative(settings, resolved),\n `${DESTINATION}/${shellArgument(file.destination)}`,\n `m${mode.toString(OCTAL_RADIX)}`,\n );\n });\n\nconst moduleDirFor = (settings: DeploySettings): string => `${MODULE_BUILD_ROOT}/${settings.binaryName}`;\n\nconst offlineEnvFor = (manager: PackageManager, settings: DeploySettings): Record<string, string> => {\n if (manager === \"pnpm\") {\n return {};\n }\n\n if (manager === \"yarn\") {\n return { YARN_OFFLINE_MIRROR: `${moduleDirFor(settings)}/${YARN_MIRROR_DIR}` };\n }\n\n return { npm_config_cache: `${moduleDirFor(settings)}/${NPM_CACHE_DIR}`, npm_config_offline: \"true\" };\n};\n\nconst appendPathFor = (settings: DeploySettings, pin: PnpmPin | null, nodeExtensionPath: string): string =>\n pin === null\n ? `${nodeExtensionPath}/bin`\n : `${pnpmPathFor(moduleDirFor(settings))}:${nodeExtensionPath}/bin`;\n\nconst flatpakSourceModule = (payload: DeployPayload): FlatpakModule => {\n const settings = payload.settings;\n const manager = detectPackageManager(settings);\n const pin = pnpmPinFor(settings, manager);\n const postInstall = postInstallCommands(payload);\n const nodeExtensionPath = nodeExtensionPathFor(settings);\n\n return {\n name: settings.binaryName,\n buildsystem: \"simple\",\n \"build-options\": {\n \"append-path\": appendPathFor(settings, pin, nodeExtensionPath),\n env: { npm_config_nodedir: nodeExtensionPath, ...offlineEnvFor(manager, settings) },\n strip: false,\n \"no-debuginfo\": true,\n },\n sources: [\n resolveGitSource(settings),\n ...(pin === null ? [] : pnpmSources(pin, moduleDirFor(settings))),\n GENERATED_SOURCES,\n inlineSource(`${settings.applicationId}.desktop`, renderDesktopEntry(settings)),\n inlineSource(`${settings.applicationId}.metainfo.xml`, renderMetainfo(settings)),\n ...mimeSources(settings),\n inlineSource(LAUNCHER_FILENAME, renderLauncher(settings)),\n inlineSource(NOTICES_FILENAME, renderNotices(settings, payload.notices)),\n ...activationSource(settings),\n ],\n \"build-commands\": [\n installCommandFor(settings, manager),\n \"npx gtkx build\",\n ...runtimeInstallCommands(settings, nodeExtensionPath),\n ...metadataInstallCommands(settings),\n ...schemaInstallCommands(settings),\n ...iconInstallCommands(settings),\n ...licenseInstallCommands(settings),\n ...noticesInstallCommands(settings),\n ...extraFileInstallCommands(settings),\n ...(settings.deploy.flatpak?.buildCommands ?? []),\n ...validationCommands(settings),\n ],\n ...optional(\"post-install\", postInstall.length === 0 ? undefined : postInstall),\n };\n};\n\nexport { flatpakSourceModule };\n"]}
|
package/dist/deploy/types.d.ts
CHANGED
|
@@ -15,10 +15,24 @@ type StagedFile = {
|
|
|
15
15
|
};
|
|
16
16
|
type NodeRuntime = {
|
|
17
17
|
path: string;
|
|
18
|
+
licenseFile: string | null;
|
|
18
19
|
version: string;
|
|
19
20
|
glibcFloor: string | null;
|
|
20
21
|
isStripped: boolean;
|
|
21
22
|
};
|
|
23
|
+
type Notice = {
|
|
24
|
+
subject: string;
|
|
25
|
+
license: string;
|
|
26
|
+
source: string | null;
|
|
27
|
+
copyright: string[];
|
|
28
|
+
text: string | null;
|
|
29
|
+
};
|
|
30
|
+
type NoticeSection = {
|
|
31
|
+
title: string;
|
|
32
|
+
files: string[];
|
|
33
|
+
summary: string[];
|
|
34
|
+
notices: Notice[];
|
|
35
|
+
};
|
|
22
36
|
type DeployDeveloper = {
|
|
23
37
|
id: string | null;
|
|
24
38
|
name: string;
|
|
@@ -42,6 +56,11 @@ type DeployFileAssociation = {
|
|
|
42
56
|
mimeType: string;
|
|
43
57
|
description: string | null;
|
|
44
58
|
};
|
|
59
|
+
type DeployExtraFile = {
|
|
60
|
+
destination: string;
|
|
61
|
+
source: string;
|
|
62
|
+
mode: number | null;
|
|
63
|
+
};
|
|
45
64
|
type DeployDesktopAction = {
|
|
46
65
|
id: string;
|
|
47
66
|
name: string;
|
|
@@ -108,7 +127,7 @@ type DeploySettings = {
|
|
|
108
127
|
desktopActions: DeployDesktopAction[];
|
|
109
128
|
desktopEntry: Record<string, string>;
|
|
110
129
|
isDbusActivatable: boolean;
|
|
111
|
-
extraFiles:
|
|
130
|
+
extraFiles: DeployExtraFile[];
|
|
112
131
|
versions: DeployVersions;
|
|
113
132
|
arch: DeployArch;
|
|
114
133
|
paths: DeployPaths;
|
|
@@ -119,6 +138,7 @@ type DeployPayload = {
|
|
|
119
138
|
settings: DeploySettings;
|
|
120
139
|
node: NodeRuntime | null;
|
|
121
140
|
stage: StagedFile[];
|
|
141
|
+
notices: NoticeSection[];
|
|
122
142
|
overlays: Record<DeployTargetName, StagedFile[]>;
|
|
123
143
|
};
|
|
124
144
|
type DeployManifest = {
|
|
@@ -136,5 +156,5 @@ type DeployTarget = {
|
|
|
136
156
|
render: (payload: DeployPayload) => DeployManifest[];
|
|
137
157
|
pack: (payload: DeployPayload, manifests: DeployManifest[]) => Promise<DeployArtifact[]>;
|
|
138
158
|
};
|
|
139
|
-
export type { DeployArch, DeployArtifact, DeployConfig, DeployDesktopAction, DeployDeveloper, DeployFileAssociation, DeployManifest, DeployPaths, DeployPayload, DeployRelease, DeployScreenshot, DeploySettings, DeployTarget, DeployTargetName, DeployTool, DeployVersions, NodeRuntime, PackageFamily, StagedFile, };
|
|
159
|
+
export type { DeployArch, DeployArtifact, DeployConfig, DeployDesktopAction, DeployDeveloper, DeployExtraFile, DeployFileAssociation, DeployManifest, DeployPaths, DeployPayload, DeployRelease, DeployScreenshot, DeploySettings, DeployTarget, DeployTargetName, DeployTool, DeployVersions, NodeRuntime, Notice, NoticeSection, PackageFamily, StagedFile, };
|
|
140
160
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/deploy/types.ts"],"names":[],"mappings":"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E,MAAM,CAAC;IACf,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,EAAE,CAAC;IACrD,IAAI,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;CAC5F,CAAC;AAEF,YAAY,EACR,UAAU,EACV,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,WAAW,EACX,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,WAAW,EACX,MAAM,EACN,aAAa,EACb,aAAa,EACb,UAAU,GACb,CAAC"}
|
package/dist/deploy/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/deploy/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Config } from \"@gtkx/config\";\n\ntype DeployConfig = NonNullable<Config[\"deploy\"]>;\ntype DeployTargetName = NonNullable<DeployConfig[\"targets\"]>[number];\ntype PackageFamily = \"arch\" | \"debian\" | \"fedora\" | \"suse\" | \"unknown\";\n\ntype DeployTool = {\n command: string;\n purpose: string;\n isOptional: boolean;\n isPresent?: () => boolean;\n};\n\ntype StagedFile = {\n rel: string;\n abs: string;\n mode: number;\n};\n\ntype NodeRuntime = {\n path: string;\n version: string;\n glibcFloor: string | null;\n isStripped: boolean;\n};\n\ntype DeployDeveloper = {\n id: string | null;\n name: string;\n email: string | null;\n};\n\ntype DeployScreenshot = {\n url: string;\n caption: string | null;\n isDefault: boolean;\n};\n\ntype DeployRelease = {\n version: string;\n date: string;\n type: string | null;\n urgency: string | null;\n notes: string[];\n url: string | null;\n};\n\ntype DeployFileAssociation = {\n extension: string;\n mimeType: string;\n description: string | null;\n};\n\ntype DeployDesktopAction = {\n id: string;\n name: string;\n args: string[];\n icon: string | null;\n};\n\ntype DeployVersions = {\n upstream: string;\n packageVersion: string;\n debRevision: string;\n rpmRelease: string;\n epoch: number | null;\n};\n\ntype DeployArch = {\n deb: string;\n rpm: string;\n flatpak: string;\n appimage: string;\n node: string;\n};\n\ntype DeployPaths = {\n root: string;\n dist: string;\n outDir: string;\n metadata: string;\n runtime: string;\n stage: string;\n overlay: string;\n targets: string;\n output: string;\n dataDir: string | null;\n iconsDir: string | null;\n iconFile: string | null;\n licenseFile: string | null;\n schemaFiles: string[];\n};\n\ntype DeploySettings = {\n applicationId: string;\n binaryName: string;\n name: string;\n genericName: string | null;\n summary: string;\n description: string[];\n keywords: string[];\n categories: string[];\n mimeTypes: string[];\n developer: DeployDeveloper;\n license: string;\n metadataLicense: string;\n copyright: string;\n homepage: string | null;\n urls: Record<string, string>;\n screenshots: DeployScreenshot[];\n branding: { light: string; dark: string } | null;\n contentRating: Record<string, string>;\n releases: DeployRelease[];\n execArgs: string[];\n execToken: string | null;\n fileAssociations: DeployFileAssociation[];\n protocols: string[];\n desktopActions: DeployDesktopAction[];\n desktopEntry: Record<string, string>;\n isDbusActivatable: boolean;\n extraFiles:
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/deploy/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Config } from \"@gtkx/config\";\n\ntype DeployConfig = NonNullable<Config[\"deploy\"]>;\ntype DeployTargetName = NonNullable<DeployConfig[\"targets\"]>[number];\ntype PackageFamily = \"arch\" | \"debian\" | \"fedora\" | \"suse\" | \"unknown\";\n\ntype DeployTool = {\n command: string;\n purpose: string;\n isOptional: boolean;\n isPresent?: () => boolean;\n};\n\ntype StagedFile = {\n rel: string;\n abs: string;\n mode: number;\n};\n\ntype NodeRuntime = {\n path: string;\n licenseFile: string | null;\n version: string;\n glibcFloor: string | null;\n isStripped: boolean;\n};\n\ntype Notice = {\n subject: string;\n license: string;\n source: string | null;\n copyright: string[];\n text: string | null;\n};\n\ntype NoticeSection = {\n title: string;\n files: string[];\n summary: string[];\n notices: Notice[];\n};\n\ntype DeployDeveloper = {\n id: string | null;\n name: string;\n email: string | null;\n};\n\ntype DeployScreenshot = {\n url: string;\n caption: string | null;\n isDefault: boolean;\n};\n\ntype DeployRelease = {\n version: string;\n date: string;\n type: string | null;\n urgency: string | null;\n notes: string[];\n url: string | null;\n};\n\ntype DeployFileAssociation = {\n extension: string;\n mimeType: string;\n description: string | null;\n};\n\ntype DeployExtraFile = {\n destination: string;\n source: string;\n mode: number | null;\n};\n\ntype DeployDesktopAction = {\n id: string;\n name: string;\n args: string[];\n icon: string | null;\n};\n\ntype DeployVersions = {\n upstream: string;\n packageVersion: string;\n debRevision: string;\n rpmRelease: string;\n epoch: number | null;\n};\n\ntype DeployArch = {\n deb: string;\n rpm: string;\n flatpak: string;\n appimage: string;\n node: string;\n};\n\ntype DeployPaths = {\n root: string;\n dist: string;\n outDir: string;\n metadata: string;\n runtime: string;\n stage: string;\n overlay: string;\n targets: string;\n output: string;\n dataDir: string | null;\n iconsDir: string | null;\n iconFile: string | null;\n licenseFile: string | null;\n schemaFiles: string[];\n};\n\ntype DeploySettings = {\n applicationId: string;\n binaryName: string;\n name: string;\n genericName: string | null;\n summary: string;\n description: string[];\n keywords: string[];\n categories: string[];\n mimeTypes: string[];\n developer: DeployDeveloper;\n license: string;\n metadataLicense: string;\n copyright: string;\n homepage: string | null;\n urls: Record<string, string>;\n screenshots: DeployScreenshot[];\n branding: { light: string; dark: string } | null;\n contentRating: Record<string, string>;\n releases: DeployRelease[];\n execArgs: string[];\n execToken: string | null;\n fileAssociations: DeployFileAssociation[];\n protocols: string[];\n desktopActions: DeployDesktopAction[];\n desktopEntry: Record<string, string>;\n isDbusActivatable: boolean;\n extraFiles: DeployExtraFile[];\n versions: DeployVersions;\n arch: DeployArch;\n paths: DeployPaths;\n libraries: string[];\n deploy: DeployConfig;\n};\n\ntype DeployPayload = {\n settings: DeploySettings;\n node: NodeRuntime | null;\n stage: StagedFile[];\n notices: NoticeSection[];\n overlays: Record<DeployTargetName, StagedFile[]>;\n};\n\ntype DeployManifest = {\n path: string;\n contents: string;\n};\n\ntype DeployArtifact = {\n path: string;\n size: number;\n};\n\ntype DeployTarget = {\n name: DeployTargetName;\n prefix: string;\n tools: DeployTool[];\n render: (payload: DeployPayload) => DeployManifest[];\n pack: (payload: DeployPayload, manifests: DeployManifest[]) => Promise<DeployArtifact[]>;\n};\n\nexport type {\n DeployArch,\n DeployArtifact,\n DeployConfig,\n DeployDesktopAction,\n DeployDeveloper,\n DeployExtraFile,\n DeployFileAssociation,\n DeployManifest,\n DeployPaths,\n DeployPayload,\n DeployRelease,\n DeployScreenshot,\n DeploySettings,\n DeployTarget,\n DeployTargetName,\n DeployTool,\n DeployVersions,\n NodeRuntime,\n Notice,\n NoticeSection,\n PackageFamily,\n StagedFile,\n};\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Plugin } from "vite";
|
|
2
|
+
declare const BUNDLED_PACKAGES_FILENAME = "gtkx-packages.json";
|
|
3
|
+
declare function gtkxBundledPackages(root: string): Plugin;
|
|
4
|
+
export { BUNDLED_PACKAGES_FILENAME, gtkxBundledPackages };
|
|
5
|
+
//# sourceMappingURL=bundled-packages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundled-packages.d.ts","sourceRoot":"","sources":["../../src/vite-plugins/bundled-packages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAmBnC,QAAA,MAAM,yBAAyB,uBAAuB,CAAC;AAoDvD,iBAAS,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAqBjD;AAED,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { isRecord, sortStringsBy } from "@gtkx/utils";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join, relative, resolve } from "node:path";
|
|
4
|
+
import { stripQuery } from "./strip-query.js";
|
|
5
|
+
const BUNDLED_PACKAGES_FILENAME = "gtkx-packages.json";
|
|
6
|
+
const MANIFEST_FILENAME = "package.json";
|
|
7
|
+
const DEFAULT_OUT_DIR = "dist";
|
|
8
|
+
const JSON_INDENT = 4;
|
|
9
|
+
const identityIn = (dir) => {
|
|
10
|
+
try {
|
|
11
|
+
const parsed = JSON.parse(readFileSync(join(dir, MANIFEST_FILENAME), "utf8"));
|
|
12
|
+
if (!isRecord(parsed) || typeof parsed.name !== "string") {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return { name: parsed.name, version: typeof parsed.version === "string" ? parsed.version : null };
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const packageIn = (dir) => {
|
|
22
|
+
const identity = identityIn(dir);
|
|
23
|
+
if (identity !== null) {
|
|
24
|
+
return { ...identity, dir };
|
|
25
|
+
}
|
|
26
|
+
const parent = dirname(dir);
|
|
27
|
+
return parent === dir ? null : packageIn(parent);
|
|
28
|
+
};
|
|
29
|
+
const packageForModule = (id) => {
|
|
30
|
+
const path = stripQuery(id);
|
|
31
|
+
return path.startsWith("/") ? packageIn(dirname(path)) : null;
|
|
32
|
+
};
|
|
33
|
+
const keyFor = (entry) => `${entry.name}@${entry.version ?? ""}`;
|
|
34
|
+
const relativeTo = (outDir, entry) => ({
|
|
35
|
+
...entry,
|
|
36
|
+
dir: relative(outDir, entry.dir),
|
|
37
|
+
});
|
|
38
|
+
const renderPackages = (outDir, ids) => {
|
|
39
|
+
const found = ids.map((id) => packageForModule(id)).filter((entry) => entry !== null);
|
|
40
|
+
const unique = new Map(found.map((entry) => [keyFor(entry), entry]));
|
|
41
|
+
const packages = sortStringsBy(unique.values(), keyFor).map((entry) => relativeTo(outDir, entry));
|
|
42
|
+
return `${JSON.stringify({ packages }, null, JSON_INDENT)}\n`;
|
|
43
|
+
};
|
|
44
|
+
function gtkxBundledPackages(root) {
|
|
45
|
+
const state = { outDir: join(root, DEFAULT_OUT_DIR) };
|
|
46
|
+
return {
|
|
47
|
+
name: "gtkx:bundled-packages",
|
|
48
|
+
apply: "build",
|
|
49
|
+
configResolved(config) {
|
|
50
|
+
state.outDir = resolve(config.root, config.build.outDir);
|
|
51
|
+
},
|
|
52
|
+
generateBundle(_options, bundle) {
|
|
53
|
+
const ids = Object.values(bundle).flatMap((output) => (output.type === "chunk" ? output.moduleIds : []));
|
|
54
|
+
this.emitFile({
|
|
55
|
+
type: "asset",
|
|
56
|
+
fileName: BUNDLED_PACKAGES_FILENAME,
|
|
57
|
+
source: renderPackages(state.outDir, ids),
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export { BUNDLED_PACKAGES_FILENAME, gtkxBundledPackages };
|
|
63
|
+
//# sourceMappingURL=bundled-packages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundled-packages.js","sourceRoot":"","sources":["../../src/vite-plugins/bundled-packages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAe9C,MAAM,yBAAyB,GAAG,oBAAoB,CAAC;AACvD,MAAM,iBAAiB,GAAG,cAAc,CAAC;AACzC,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB,MAAM,UAAU,GAAG,CAAC,GAAW,EAA0B,EAAE;IACvD,IAAI,CAAC;QACD,MAAM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M,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7D,CAAC;QAED,cAAc,CAAC,QAAQ,EAAE,MAAM;YAC3B,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAEzG,IAAI,CAAC,QAAQ,CAAC;gBACV,IAAI,EAAE,OAAO;gBACb,QAAQ,EAAE,yBAAyB;gBACnC,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC;aAC5C,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;AACN,CAAC;AAED,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,CAAC","sourcesContent":["import type { Plugin } from \"vite\";\nimport { isRecord, sortStringsBy } from \"@gtkx/utils\";\nimport { readFileSync } from \"node:fs\";\nimport { dirname, join, relative, resolve } from \"node:path\";\nimport { stripQuery } from \"./strip-query.js\";\n\ntype PackageIdentity = {\n name: string;\n version: string | null;\n};\n\ntype RecordedPackage = PackageIdentity & {\n dir: string;\n};\n\ntype PackagesState = {\n outDir: string;\n};\n\nconst BUNDLED_PACKAGES_FILENAME = \"gtkx-packages.json\";\nconst MANIFEST_FILENAME = \"package.json\";\nconst DEFAULT_OUT_DIR = \"dist\";\nconst JSON_INDENT = 4;\n\nconst identityIn = (dir: string): PackageIdentity | null => {\n try {\n const parsed: unknown = JSON.parse(readFileSync(join(dir, MANIFEST_FILENAME), \"utf8\"));\n\n if (!isRecord(parsed) || typeof parsed.name !== \"string\") {\n return null;\n }\n\n return { name: parsed.name, version: typeof parsed.version === \"string\" ? parsed.version : null };\n } catch {\n return null;\n }\n};\n\nconst packageIn = (dir: string): RecordedPackage | null => {\n const identity = identityIn(dir);\n\n if (identity !== null) {\n return { ...identity, dir };\n }\n\n const parent = dirname(dir);\n\n return parent === dir ? null : packageIn(parent);\n};\n\nconst packageForModule = (id: string): RecordedPackage | null => {\n const path = stripQuery(id);\n\n return path.startsWith(\"/\") ? packageIn(dirname(path)) : null;\n};\n\nconst keyFor = (entry: RecordedPackage): string => `${entry.name}@${entry.version ?? \"\"}`;\n\nconst relativeTo = (outDir: string, entry: RecordedPackage): RecordedPackage => ({\n ...entry,\n dir: relative(outDir, entry.dir),\n});\n\nconst renderPackages = (outDir: string, ids: string[]): string => {\n const found = ids.map((id) => packageForModule(id)).filter((entry) => entry !== null);\n const unique: Map<string, RecordedPackage> = new Map(found.map((entry) => [keyFor(entry), entry]));\n const packages = sortStringsBy(unique.values(), keyFor).map((entry) => relativeTo(outDir, entry));\n\n return `${JSON.stringify({ packages }, null, JSON_INDENT)}\\n`;\n};\n\nfunction gtkxBundledPackages(root: string): Plugin {\n const state: PackagesState = { outDir: join(root, DEFAULT_OUT_DIR) };\n\n return {\n name: \"gtkx:bundled-packages\",\n apply: \"build\",\n\n configResolved(config) {\n state.outDir = resolve(config.root, config.build.outDir);\n },\n\n generateBundle(_options, bundle) {\n const ids = Object.values(bundle).flatMap((output) => (output.type === \"chunk\" ? output.moduleIds : []));\n\n this.emitFile({\n type: \"asset\",\n fileName: BUNDLED_PACKAGES_FILENAME,\n source: renderPackages(state.outDir, ids),\n });\n },\n };\n}\n\nexport { BUNDLED_PACKAGES_FILENAME, gtkxBundledPackages };\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gtkx/cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Command-line tool and Vite plugin stack that scaffolds, develops, builds, and documents GTKX applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gtkx",
|
|
@@ -73,19 +73,19 @@
|
|
|
73
73
|
"react-refresh": "^0.18.0",
|
|
74
74
|
"vite": "^8.2.1",
|
|
75
75
|
"yaml": "^2.9.0",
|
|
76
|
-
"@gtkx/
|
|
77
|
-
"@gtkx/
|
|
78
|
-
"@gtkx/utils": "1.2.
|
|
79
|
-
"@gtkx/
|
|
80
|
-
"@gtkx/
|
|
81
|
-
"
|
|
82
|
-
"
|
|
76
|
+
"@gtkx/config": "1.2.2",
|
|
77
|
+
"@gtkx/runtime": "1.2.2",
|
|
78
|
+
"@gtkx/utils": "1.2.2",
|
|
79
|
+
"@gtkx/mcp": "1.2.2",
|
|
80
|
+
"@gtkx/codegen": "1.2.2",
|
|
81
|
+
"create-gtkx": "1.2.2",
|
|
82
|
+
"@gtkx/vitest": "1.2.2"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@types/babel__core": "^7.20.5",
|
|
86
86
|
"@types/react-refresh": "^0.14.7",
|
|
87
87
|
"vitest": "^4.1.10",
|
|
88
|
-
"@gtkx/testing": "1.2.
|
|
88
|
+
"@gtkx/testing": "1.2.2"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"react": "^19"
|
package/src/builder.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { join, posix } from "node:path";
|
|
2
2
|
import { type InlineConfig, mergeConfig, build as viteBuild } from "vite";
|
|
3
3
|
import { gtkxBuiltUrl } from "./vite-plugins/built-url.js";
|
|
4
|
+
import { gtkxBundledPackages } from "./vite-plugins/bundled-packages.js";
|
|
4
5
|
import { BUNDLE_FILENAME, ESM_EXTENSION } from "./vite-plugins/esm-extension.js";
|
|
5
6
|
import { gtkxVitePlugins } from "./vite-plugins/index.js";
|
|
6
7
|
import { gtkxNative } from "./vite-plugins/native.js";
|
|
@@ -42,6 +43,7 @@ const build = async (options: BuildOptions): Promise<string> => {
|
|
|
42
43
|
gtkxWorker(),
|
|
43
44
|
gtkxBuiltUrl(assetBase),
|
|
44
45
|
gtkxNative(root),
|
|
46
|
+
gtkxBundledPackages(root),
|
|
45
47
|
gtkxSelfContained(),
|
|
46
48
|
],
|
|
47
49
|
build: {
|