@gtkx/cli 1.4.0 → 1.6.0
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/README.md +1 -1
- package/dist/builder.d.ts +1 -0
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +2 -2
- package/dist/builder.js.map +1 -1
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -1
- package/dist/codegen/freshness.d.ts.map +1 -1
- package/dist/codegen/freshness.js +2 -1
- package/dist/codegen/freshness.js.map +1 -1
- package/dist/codegen/reference.d.ts +17 -0
- package/dist/codegen/reference.d.ts.map +1 -0
- package/dist/codegen/reference.js +37 -0
- package/dist/codegen/reference.js.map +1 -0
- package/dist/codegen/report.d.ts.map +1 -1
- package/dist/codegen/report.js +17 -3
- package/dist/codegen/report.js.map +1 -1
- package/dist/codegen/run-codegen.d.ts +4 -0
- package/dist/codegen/run-codegen.d.ts.map +1 -1
- package/dist/codegen/run-codegen.js +93 -27
- package/dist/codegen/run-codegen.js.map +1 -1
- package/dist/commands/codegen.js +1 -1
- package/dist/commands/codegen.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +10 -16
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/mcp.d.ts +13 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +68 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/deploy/freedesktop/localize.d.ts +6 -0
- package/dist/deploy/freedesktop/localize.d.ts.map +1 -0
- package/dist/deploy/freedesktop/localize.js +107 -0
- package/dist/deploy/freedesktop/localize.js.map +1 -0
- package/dist/deploy/install-hints.d.ts.map +1 -1
- package/dist/deploy/install-hints.js +5 -0
- package/dist/deploy/install-hints.js.map +1 -1
- package/dist/deploy/notices/gtkx.js +1 -1
- package/dist/deploy/notices/gtkx.js.map +1 -1
- package/dist/deploy/notices/libraries.d.ts.map +1 -1
- package/dist/deploy/notices/libraries.js +2 -1
- package/dist/deploy/notices/libraries.js.map +1 -1
- package/dist/deploy/payload/launcher.d.ts.map +1 -1
- package/dist/deploy/payload/launcher.js +2 -0
- package/dist/deploy/payload/launcher.js.map +1 -1
- package/dist/deploy/payload/stage.d.ts +1 -1
- package/dist/deploy/payload/stage.d.ts.map +1 -1
- package/dist/deploy/payload/stage.js +20 -11
- 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 +87 -15
- package/dist/deploy/run-deploy.js.map +1 -1
- package/dist/deploy/settings/libraries.d.ts.map +1 -1
- package/dist/deploy/settings/libraries.js +7 -9
- package/dist/deploy/settings/libraries.js.map +1 -1
- package/dist/deploy/targets/flatpak-source.d.ts.map +1 -1
- package/dist/deploy/targets/flatpak-source.js +21 -10
- package/dist/deploy/targets/flatpak-source.js.map +1 -1
- package/dist/deploy/tools.d.ts +6 -1
- package/dist/deploy/tools.d.ts.map +1 -1
- package/dist/deploy/tools.js +27 -4
- package/dist/deploy/tools.js.map +1 -1
- package/dist/dev/locale-dir.d.ts +3 -0
- package/dist/dev/locale-dir.d.ts.map +1 -0
- package/dist/dev/locale-dir.js +17 -0
- package/dist/dev/locale-dir.js.map +1 -0
- package/dist/dev/runner-main.d.ts.map +1 -1
- package/dist/dev/runner-main.js +4 -1
- package/dist/dev/runner-main.js.map +1 -1
- package/dist/dev/runner.d.ts.map +1 -1
- package/dist/dev/runner.js +6 -0
- package/dist/dev/runner.js.map +1 -1
- package/dist/dev/vite-dev-server.d.ts +1 -0
- package/dist/dev/vite-dev-server.d.ts.map +1 -1
- package/dist/dev/vite-dev-server.js.map +1 -1
- package/dist/i18n/binding-extractor.d.ts +30 -0
- package/dist/i18n/binding-extractor.d.ts.map +1 -0
- package/dist/i18n/binding-extractor.js +1324 -0
- package/dist/i18n/binding-extractor.js.map +1 -0
- package/dist/i18n/catalog-template.d.ts +3 -0
- package/dist/i18n/catalog-template.d.ts.map +1 -0
- package/dist/i18n/catalog-template.js +18 -0
- package/dist/i18n/catalog-template.js.map +1 -0
- package/dist/i18n/catalogs.d.ts +21 -0
- package/dist/i18n/catalogs.d.ts.map +1 -0
- package/dist/i18n/catalogs.js +139 -0
- package/dist/i18n/catalogs.js.map +1 -0
- package/dist/i18n/extractor-plugin.d.ts +8 -0
- package/dist/i18n/extractor-plugin.d.ts.map +1 -0
- package/dist/i18n/extractor-plugin.js +247 -0
- package/dist/i18n/extractor-plugin.js.map +1 -0
- package/dist/i18n/metadata-templates.d.ts +11 -0
- package/dist/i18n/metadata-templates.d.ts.map +1 -0
- package/dist/i18n/metadata-templates.js +11 -0
- package/dist/i18n/metadata-templates.js.map +1 -0
- package/dist/i18n/source-messages.d.ts +23 -0
- package/dist/i18n/source-messages.d.ts.map +1 -0
- package/dist/i18n/source-messages.js +403 -0
- package/dist/i18n/source-messages.js.map +1 -0
- package/dist/i18n/types.d.ts +10 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/i18n/types.js +108 -0
- package/dist/i18n/types.js.map +1 -0
- package/dist/internal/agent-rules.d.ts +7 -0
- package/dist/internal/agent-rules.d.ts.map +1 -0
- package/dist/internal/agent-rules.js +106 -0
- package/dist/internal/agent-rules.js.map +1 -0
- package/dist/internal/docs-elements.d.ts +8 -0
- package/dist/internal/docs-elements.d.ts.map +1 -0
- package/dist/internal/docs-elements.js +12 -0
- package/dist/internal/docs-elements.js.map +1 -0
- package/dist/internal/source-imports.d.ts +5 -1
- package/dist/internal/source-imports.d.ts.map +1 -1
- package/dist/internal/source-imports.js +25 -47
- package/dist/internal/source-imports.js.map +1 -1
- package/dist/mcp/client-config.d.ts +22 -0
- package/dist/mcp/client-config.d.ts.map +1 -0
- package/dist/mcp/client-config.js +94 -0
- package/dist/mcp/client-config.js.map +1 -0
- package/dist/mcp/client.d.ts +0 -1
- package/dist/mcp/client.d.ts.map +1 -1
- package/dist/mcp/client.js +11 -39
- package/dist/mcp/client.js.map +1 -1
- package/dist/mcp/handlers.d.ts +2 -1
- package/dist/mcp/handlers.d.ts.map +1 -1
- package/dist/mcp/handlers.js.map +1 -1
- package/dist/settings/render.d.ts +4 -1
- package/dist/settings/render.d.ts.map +1 -1
- package/dist/settings/render.js +11 -2
- package/dist/settings/render.js.map +1 -1
- package/dist/settings/schema.d.ts.map +1 -1
- package/dist/settings/schema.js +3 -1
- package/dist/settings/schema.js.map +1 -1
- package/dist/vite-plugins/animated.d.ts +5 -0
- package/dist/vite-plugins/animated.d.ts.map +1 -0
- package/dist/vite-plugins/animated.js +325 -0
- package/dist/vite-plugins/animated.js.map +1 -0
- package/dist/vite-plugins/asset-imports.d.ts.map +1 -1
- package/dist/vite-plugins/asset-imports.js +4 -14
- package/dist/vite-plugins/asset-imports.js.map +1 -1
- package/dist/vite-plugins/i18n.d.ts +5 -0
- package/dist/vite-plugins/i18n.d.ts.map +1 -0
- package/dist/vite-plugins/i18n.js +88 -0
- package/dist/vite-plugins/i18n.js.map +1 -0
- package/dist/vite-plugins/index.d.ts +1 -1
- package/dist/vite-plugins/index.d.ts.map +1 -1
- package/dist/vite-plugins/index.js +5 -1
- package/dist/vite-plugins/index.js.map +1 -1
- package/dist/vite-plugins/resources.d.ts.map +1 -1
- package/dist/vite-plugins/resources.js +12 -57
- package/dist/vite-plugins/resources.js.map +1 -1
- package/dist/vite-plugins/self-contained.d.ts.map +1 -1
- package/dist/vite-plugins/self-contained.js +128 -135
- package/dist/vite-plugins/self-contained.js.map +1 -1
- package/dist/vite-plugins/settings-worker-env.js +2 -2
- package/dist/vite-plugins/settings-worker-env.js.map +1 -1
- package/dist/vite-plugins/settings.d.ts.map +1 -1
- package/dist/vite-plugins/settings.js +2 -1
- package/dist/vite-plugins/settings.js.map +1 -1
- package/package.json +11 -9
- package/src/builder.ts +3 -2
- package/src/cli.ts +5 -0
- package/src/codegen/freshness.ts +2 -1
- package/src/codegen/reference.ts +59 -0
- package/src/codegen/report.ts +18 -3
- package/src/codegen/run-codegen.ts +134 -31
- package/src/commands/codegen.ts +1 -1
- package/src/commands/docs.ts +10 -28
- package/src/commands/mcp.ts +81 -0
- package/src/deploy/freedesktop/localize.ts +144 -0
- package/src/deploy/install-hints.ts +5 -0
- package/src/deploy/notices/gtkx.ts +1 -1
- package/src/deploy/notices/libraries.ts +2 -1
- package/src/deploy/payload/launcher.ts +2 -0
- package/src/deploy/payload/stage.ts +35 -10
- package/src/deploy/run-deploy.ts +128 -13
- package/src/deploy/settings/libraries.ts +7 -10
- package/src/deploy/targets/flatpak-source.ts +33 -10
- package/src/deploy/tools.ts +36 -3
- package/src/dev/locale-dir.ts +22 -0
- package/src/dev/runner-main.ts +4 -1
- package/src/dev/runner.ts +8 -0
- package/src/dev/vite-dev-server.ts +1 -0
- package/src/i18n/binding-extractor.ts +1969 -0
- package/src/i18n/catalog-template.ts +24 -0
- package/src/i18n/catalogs.ts +216 -0
- package/src/i18n/extractor-plugin.ts +413 -0
- package/src/i18n/metadata-templates.ts +29 -0
- package/src/i18n/source-messages.ts +608 -0
- package/src/i18n/types.ts +154 -0
- package/src/internal/agent-rules.ts +135 -0
- package/src/internal/docs-elements.ts +21 -0
- package/src/internal/source-imports.ts +31 -60
- package/src/mcp/client-config.ts +130 -0
- package/src/mcp/client.ts +17 -44
- package/src/mcp/handlers.ts +7 -6
- package/src/settings/render.ts +16 -2
- package/src/settings/schema.ts +3 -1
- package/src/vite-plugins/animated.ts +486 -0
- package/src/vite-plugins/asset-imports.ts +5 -17
- package/src/vite-plugins/i18n.ts +146 -0
- package/src/vite-plugins/index.ts +5 -0
- package/src/vite-plugins/resources.ts +12 -74
- package/src/vite-plugins/self-contained.ts +150 -169
- package/src/vite-plugins/settings-worker-env.ts +2 -2
- package/src/vite-plugins/settings.ts +2 -1
package/dist/commands/codegen.js
CHANGED
|
@@ -9,7 +9,7 @@ const FORCED_WHILE_DISABLED_MESSAGE = "codegen is disabled for this project, so
|
|
|
9
9
|
const codegen = defineCommand({
|
|
10
10
|
meta: {
|
|
11
11
|
name: "codegen",
|
|
12
|
-
description: "Generate
|
|
12
|
+
description: "Generate project bindings, translation catalogs, and TypeScript declarations",
|
|
13
13
|
},
|
|
14
14
|
args: {
|
|
15
15
|
force: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../src/commands/codegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE9D,MAAM,6BAA6B,GAC/B,oFAAoF;IACpF,iGAAiG;IACjG,6BAA6B,CAAC;AAElC,MAAM,OAAO,GAAG,aAAa,CAAC;IAC1B,IAAI,EAAE;QACF,IAAI,EAAE,SAAS;QACf,WAAW,EAAE
|
|
1
|
+
{"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../src/commands/codegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE9D,MAAM,6BAA6B,GAC/B,oFAAoF;IACpF,iGAAiG;IACjG,6BAA6B,CAAC;AAElC,MAAM,OAAO,GAAG,aAAa,CAAC;IAC1B,IAAI,EAAE;QACF,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,8EAA8E;KAC9F;IACD,IA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A6B,CAAC,CAAC;IACnD,CAAC;AACL,CAAC,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import { info } from \"@gtkx/utils\";\nimport { defineCommand } from \"citty\";\nimport { formatCodegenResult } from \"../codegen/report.js\";\nimport { ensureGenerated, isCodegenDisabled, runCodegen } from \"../codegen/run-codegen.js\";\nimport { cwdArg, resolveCwd } from \"../internal/entry-arg.js\";\n\nconst FORCED_WHILE_DISABLED_MESSAGE =\n \"codegen is disabled for this project, so --force has no store to regenerate here. \" +\n \"Remove `codegen: false` from gtkx.config.ts, or run `gtkx codegen --force` where the installed \" +\n \"binding store is generated.\";\n\nconst codegen = defineCommand({\n meta: {\n name: \"codegen\",\n description: \"Generate project bindings, translation catalogs, and TypeScript declarations\",\n },\n args: {\n force: {\n type: \"boolean\",\n description: \"Wipe the generated store and regenerate unconditionally (recover a corrupted store)\",\n default: false,\n },\n ...cwdArg,\n },\n async run({ args }) {\n const cwd = resolveCwd(args);\n const isDisabled = await isCodegenDisabled(cwd);\n checkForce(isDisabled, args.force);\n\n if (isDisabled) {\n await runCodegen({ cwd });\n info(\"codegen: disabled for this project; reusing an installed binding store\");\n\n return;\n }\n\n if (!args.force) {\n const isRan = await ensureGenerated(cwd);\n info(isRan ? \"codegen: regenerated stale bindings\" : \"codegen: bindings up to date\");\n\n return;\n }\n\n const startedAt = Date.now();\n const result = await runCodegen({ cwd, isForced: true });\n const lines = formatCodegenResult(result, Date.now() - startedAt);\n\n for (const line of lines) {\n info(line);\n }\n },\n});\n\nconst checkForce = (isDisabled: boolean, isForced: boolean): void => {\n if (isDisabled && isForced) {\n throw new Error(FORCED_WHILE_DISABLED_MESSAGE);\n }\n};\n\nexport { codegen };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAUA,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;EAmFR,CAAC;AAiCH,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/dist/commands/docs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { mergeOmittedProps,
|
|
1
|
+
import { mergeOmittedProps, resolveGirPath, resolveLibraries } from "@gtkx/codegen";
|
|
2
2
|
import { writeDocs } from "@gtkx/codegen/internal";
|
|
3
3
|
import { loadConfig } from "@gtkx/config";
|
|
4
|
-
import { resolveOmittedProps } from "@gtkx/config/internal";
|
|
4
|
+
import { resolveFuture, resolveOmittedProps } from "@gtkx/config/internal";
|
|
5
5
|
import { info } from "@gtkx/utils";
|
|
6
6
|
import { defineCommand } from "citty";
|
|
7
|
-
import { existsSync } from "node:fs";
|
|
8
7
|
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
8
|
+
import { resolveDocsElements } from "../internal/docs-elements.js";
|
|
9
9
|
import { cwdArg, resolveCwd } from "../internal/entry-arg.js";
|
|
10
10
|
const docs = defineCommand({
|
|
11
11
|
meta: {
|
|
@@ -45,7 +45,8 @@ const docs = defineCommand({
|
|
|
45
45
|
"(Linux: `sudo dnf install gobject-introspection-devel` or " +
|
|
46
46
|
"`sudo apt install libgirepository1.0-dev`), or set `girPath` in gtkx.config.ts.");
|
|
47
47
|
}
|
|
48
|
-
const
|
|
48
|
+
const future = resolveFuture(config.future);
|
|
49
|
+
const libraries = resolveLibraries(config.libraries, girPath, future.isAdwaitaDefault);
|
|
49
50
|
const startedAt = Date.now();
|
|
50
51
|
const outDir = resolveOutDir(cwd, args.out);
|
|
51
52
|
const builtin = await resolveDocsElements(cwd);
|
|
@@ -57,10 +58,11 @@ const docs = defineCommand({
|
|
|
57
58
|
props: builtin.props,
|
|
58
59
|
omittedProps: mergeOmittedProps(builtin.omittedProps, resolveOmittedProps(config.elements)),
|
|
59
60
|
isForced: args.force,
|
|
60
|
-
isByteArrayTyped:
|
|
61
|
-
isValueUnwrapped:
|
|
62
|
-
isFinishTrimmed:
|
|
63
|
-
isInoutInPlace:
|
|
61
|
+
isByteArrayTyped: future.isByteArrayTyped,
|
|
62
|
+
isValueUnwrapped: future.isValueUnwrapped,
|
|
63
|
+
isFinishTrimmed: future.isFinishTrimmed,
|
|
64
|
+
isInoutInPlace: future.isInoutInPlace,
|
|
65
|
+
isTreeShaken: future.isTreeShaken,
|
|
64
66
|
});
|
|
65
67
|
if (!isRegenerated) {
|
|
66
68
|
info(`docs: pages in ${outDir} are up to date`);
|
|
@@ -92,13 +94,5 @@ const resolveOutDir = (cwd, out) => {
|
|
|
92
94
|
throw new Error(`--out must name a directory below the project root ${cwd}, and ${outDirReason(cwd, out, outDir)}. ` +
|
|
93
95
|
"Pass a path such as --out=docs/reference.");
|
|
94
96
|
};
|
|
95
|
-
const resolveDocsElements = async (cwd) => {
|
|
96
|
-
const { gi, reactSubexports } = resolveStore(cwd);
|
|
97
|
-
if (!existsSync(gi.storeDir)) {
|
|
98
|
-
return { props: {}, omittedProps: {} };
|
|
99
|
-
}
|
|
100
|
-
const { props, omittedProps } = await readBuiltinElements(reactSubexports, gi.storeDir);
|
|
101
|
-
return { props, omittedProps };
|
|
102
|
-
};
|
|
103
97
|
export { docs };
|
|
104
98
|
//# sourceMappingURL=docs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAA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AAE,MAAM,CAAC,IAAI;QACpG,2CAA2C,CAC9C,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,IAAI,EAAE,CAAC","sourcesContent":["import { mergeOmittedProps, resolveGirPath, resolveLibraries } from \"@gtkx/codegen\";\nimport { writeDocs } from \"@gtkx/codegen/internal\";\nimport { loadConfig } from \"@gtkx/config\";\nimport { resolveFuture, resolveOmittedProps } from \"@gtkx/config/internal\";\nimport { info } from \"@gtkx/utils\";\nimport { defineCommand } from \"citty\";\nimport { isAbsolute, relative, resolve, sep } from \"node:path\";\nimport { resolveDocsElements } from \"../internal/docs-elements.js\";\nimport { cwdArg, resolveCwd } from \"../internal/entry-arg.js\";\n\nconst docs = defineCommand({\n meta: {\n name: \"docs\",\n description:\n \"Generate markdown reference pages for the JSX elements of the GIR libraries declared in gtkx.config.ts\",\n },\n args: {\n out: {\n type: \"string\",\n description:\n \"Output directory for the generated markdown pages, below the project root. It must be empty \" +\n \"or hold an earlier `gtkx docs` run, whose pages are replaced\",\n default: \"docs/reference\",\n },\n \"base-path\": {\n type: \"string\",\n description: \"URL base path used for links between generated pages\",\n default: \"/reference\",\n },\n force: {\n type: \"boolean\",\n description:\n \"Regenerate even when the pages are up to date with the GIR libraries, the base path, \" +\n \"and the element props the project configures\",\n default: false,\n },\n ...cwdArg,\n },\n async run({ args }) {\n const cwd = resolveCwd(args);\n const { config } = await loadConfig(cwd);\n\n if (config.codegen === false) {\n throw new Error(\n \"codegen is disabled for this project, so there are no GIR libraries to document. \" +\n \"Remove `codegen: false` from gtkx.config.ts to use `gtkx docs`.\",\n );\n }\n\n const girPath = resolveGirPath(config.girPath);\n\n if (girPath.length === 0) {\n throw new Error(\n \"No GIR search paths available. Install gobject-introspection \" +\n \"(Linux: `sudo dnf install gobject-introspection-devel` or \" +\n \"`sudo apt install libgirepository1.0-dev`), or set `girPath` in gtkx.config.ts.\",\n );\n }\n\n const future = resolveFuture(config.future);\n const libraries = resolveLibraries(config.libraries, girPath, future.isAdwaitaDefault);\n const startedAt = Date.now();\n const outDir = resolveOutDir(cwd, args.out);\n const builtin = await resolveDocsElements(cwd);\n\n const { isRegenerated, namespaces } = writeDocs({\n libraries,\n girPath,\n outDir,\n basePath: args[\"base-path\"],\n props: builtin.props,\n omittedProps: mergeOmittedProps(builtin.omittedProps, resolveOmittedProps(config.elements)),\n isForced: args.force,\n isByteArrayTyped: future.isByteArrayTyped,\n isValueUnwrapped: future.isValueUnwrapped,\n isFinishTrimmed: future.isFinishTrimmed,\n isInoutInPlace: future.isInoutInPlace,\n isTreeShaken: future.isTreeShaken,\n });\n\n if (!isRegenerated) {\n info(`docs: pages in ${outDir} are up to date`);\n\n return;\n }\n\n const count = namespaces.reduce((total, namespace) => total + namespace.elements.length, 0);\n\n info(\n `docs: wrote ${String(count)} element pages across ${String(namespaces.length)} namespaces ` +\n `to ${outDir} in ${String(Date.now() - startedAt)}ms`,\n );\n },\n});\n\nconst isBelow = (parent: string, child: string): boolean => {\n const path = relative(parent, child);\n\n return path !== \"\" && path !== \"..\" && !path.startsWith(`..${sep}`) && !isAbsolute(path);\n};\n\nconst outDirReason = (cwd: string, out: string, outDir: string): string => {\n if (out.trim() === \"\") {\n return \"it was empty, which names the project root itself\";\n }\n\n if (outDir === cwd) {\n return \"it names the project root itself\";\n }\n\n return `${outDir} is outside it`;\n};\n\nconst resolveOutDir = (cwd: string, out: string): string => {\n const outDir = out.trim() === \"\" ? cwd : resolve(cwd, out);\n\n if (isBelow(cwd, outDir)) {\n return outDir;\n }\n\n throw new Error(\n `--out must name a directory below the project root ${cwd}, and ${outDirReason(cwd, out, outDir)}. ` +\n \"Pass a path such as --out=docs/reference.\",\n );\n};\n\nexport { docs };\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const mcp: import("citty").CommandDef<{
|
|
2
|
+
readonly cwd: import("citty").StringArgDef;
|
|
3
|
+
readonly tools: {
|
|
4
|
+
readonly type: "string";
|
|
5
|
+
readonly description: string;
|
|
6
|
+
};
|
|
7
|
+
readonly "read-only": {
|
|
8
|
+
readonly type: "boolean";
|
|
9
|
+
readonly description: "Register only the tools that read state, leaving out the ones that drive the app";
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
12
|
+
export { mcp };
|
|
13
|
+
//# sourceMappingURL=mcp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAgCA,QAAA,MAAM,GAAG;;;;;;;;;;EA4BP,CAAC;AAoBH,OAAO,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { info } from "@gtkx/utils";
|
|
2
|
+
import { defineCommand } from "citty";
|
|
3
|
+
import { cwdArg, resolveCwd } from "../internal/entry-arg.js";
|
|
4
|
+
import { CLIENTS, isClientName, writeClientConfig } from "../mcp/client-config.js";
|
|
5
|
+
const clientList = CLIENTS.map((client) => client.name).join(", ");
|
|
6
|
+
const init = defineCommand({
|
|
7
|
+
meta: {
|
|
8
|
+
name: "init",
|
|
9
|
+
description: "Write the gtkx MCP server into an editor's configuration file",
|
|
10
|
+
},
|
|
11
|
+
args: {
|
|
12
|
+
client: {
|
|
13
|
+
type: "string",
|
|
14
|
+
description: `Which editor to configure: one of ${clientList}`,
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
...cwdArg,
|
|
18
|
+
},
|
|
19
|
+
run({ args }) {
|
|
20
|
+
const cwd = resolveCwd(args);
|
|
21
|
+
const name = args.client;
|
|
22
|
+
if (!isClientName(name)) {
|
|
23
|
+
throw new Error(`Unknown --client "${name}". Pass one of ${clientList}.`);
|
|
24
|
+
}
|
|
25
|
+
report(name, writeClientConfig(cwd, name));
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const mcp = defineCommand({
|
|
29
|
+
meta: {
|
|
30
|
+
name: "mcp",
|
|
31
|
+
description: "Run the MCP server that exposes this project's running app and generated API reference",
|
|
32
|
+
},
|
|
33
|
+
args: {
|
|
34
|
+
tools: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "Comma-separated tool name patterns to register, `*` matching any run of characters and a " +
|
|
37
|
+
"leading `!` excluding. Overrides `mcp.tools` in gtkx.config.ts",
|
|
38
|
+
},
|
|
39
|
+
"read-only": {
|
|
40
|
+
type: "boolean",
|
|
41
|
+
description: "Register only the tools that read state, leaving out the ones that drive the app",
|
|
42
|
+
},
|
|
43
|
+
...cwdArg,
|
|
44
|
+
},
|
|
45
|
+
subCommands: { init },
|
|
46
|
+
async run({ args }) {
|
|
47
|
+
const { runMcpServer } = await import("@gtkx/mcp/server");
|
|
48
|
+
await runMcpServer({
|
|
49
|
+
cwd: resolveCwd(args),
|
|
50
|
+
...(args.tools !== undefined && { tools: splitPatterns(args.tools) }),
|
|
51
|
+
...(args["read-only"] !== undefined && { isReadOnly: args["read-only"] }),
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
const splitPatterns = (value) => value.split(",").map((pattern) => pattern.trim()).filter((pattern) => pattern.length > 0);
|
|
56
|
+
const report = (name, result) => {
|
|
57
|
+
if (result.kind === "manual") {
|
|
58
|
+
info(`mcp: ${name} keeps its servers in ${result.path}, which is outside this project. Add:`);
|
|
59
|
+
for (const line of result.snippet.split("\n")) {
|
|
60
|
+
info(`mcp: ${line}`);
|
|
61
|
+
}
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
info(`mcp: ${result.isCreated ? "created" : "updated"} ${result.path} for ${name}`);
|
|
65
|
+
info("mcp: restart the editor for it to pick the server up");
|
|
66
|
+
};
|
|
67
|
+
export { mcp };
|
|
68
|
+
//# sourceMappingURL=mcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC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C,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,IAAI,MAAM,CAAC,IAAI,QAAQ,IAAI,EAAE,CAAC,CAAC;IACpF,IAAI,CAAC,sDAAsD,CAAC,CAAC;AACjE,CAAC,CAAC;AAEF,OAAO,EAAE,GAAG,EAAE,CAAC","sourcesContent":["import { info } from \"@gtkx/utils\";\nimport { defineCommand } from \"citty\";\nimport { cwdArg, resolveCwd } from \"../internal/entry-arg.js\";\nimport { type ClientName, type ClientResult, CLIENTS, isClientName, writeClientConfig } from \"../mcp/client-config.js\";\n\nconst clientList = CLIENTS.map((client) => client.name).join(\", \");\n\nconst init = defineCommand({\n meta: {\n name: \"init\",\n description: \"Write the gtkx MCP server into an editor's configuration file\",\n },\n args: {\n client: {\n type: \"string\",\n description: `Which editor to configure: one of ${clientList}`,\n required: true,\n },\n ...cwdArg,\n },\n run({ args }) {\n const cwd = resolveCwd(args);\n const name = args.client;\n\n if (!isClientName(name)) {\n throw new Error(`Unknown --client \"${name}\". Pass one of ${clientList}.`);\n }\n\n report(name, writeClientConfig(cwd, name));\n },\n});\n\nconst mcp = defineCommand({\n meta: {\n name: \"mcp\",\n description: \"Run the MCP server that exposes this project's running app and generated API reference\",\n },\n args: {\n tools: {\n type: \"string\",\n description:\n \"Comma-separated tool name patterns to register, `*` matching any run of characters and a \" +\n \"leading `!` excluding. Overrides `mcp.tools` in gtkx.config.ts\",\n },\n \"read-only\": {\n type: \"boolean\",\n description: \"Register only the tools that read state, leaving out the ones that drive the app\",\n },\n ...cwdArg,\n },\n subCommands: { init },\n async run({ args }) {\n const { runMcpServer } = await import(\"@gtkx/mcp/server\");\n\n await runMcpServer({\n cwd: resolveCwd(args),\n ...(args.tools !== undefined && { tools: splitPatterns(args.tools) }),\n ...(args[\"read-only\"] !== undefined && { isReadOnly: args[\"read-only\"] }),\n });\n },\n});\n\nconst splitPatterns = (value: string): string[] =>\n value.split(\",\").map((pattern) => pattern.trim()).filter((pattern) => pattern.length > 0);\n\nconst report = (name: ClientName, result: ClientResult): void => {\n if (result.kind === \"manual\") {\n info(`mcp: ${name} keeps its servers in ${result.path}, which is outside this project. Add:`);\n\n for (const line of result.snippet.split(\"\\n\")) {\n info(`mcp: ${line}`);\n }\n\n return;\n }\n\n info(`mcp: ${result.isCreated ? \"created\" : \"updated\"} ${result.path} for ${name}`);\n info(\"mcp: restart the editor for it to pick the server up\");\n};\n\nexport { mcp };\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CatalogProject } from "../../i18n/catalogs.js";
|
|
2
|
+
import type { StagedMetadata } from "../payload/stage.js";
|
|
3
|
+
declare const localizeMetadata: (metadata: StagedMetadata, project: CatalogProject | null) => StagedMetadata;
|
|
4
|
+
declare const extractMetadataMessages: (metadata: StagedMetadata, project: CatalogProject, catalogTemplate?: string) => void;
|
|
5
|
+
export { extractMetadataMessages, localizeMetadata };
|
|
6
|
+
//# sourceMappingURL=localize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localize.d.ts","sourceRoot":"","sources":["../../../src/deploy/freedesktop/localize.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA2D1D,QAAA,MAAM,gBAAgB,GAAI,UAAU,cAAc,EAAE,SAAS,cAAc,GAAG,IAAI,KAAG,cAiCpF,CAAC;AAEF,QAAA,MAAM,uBAAuB,GACzB,UAAU,cAAc,EACxB,SAAS,cAAc,EACvB,kBAAkB,MAAM,KACzB,IAuCF,CAAC;AAEF,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { metadataTemplateFile } from "../../i18n/metadata-templates.js";
|
|
5
|
+
import { runCliTool } from "../../internal/run-cli-tool.js";
|
|
6
|
+
const metadataTemplates = (project, metadata) => {
|
|
7
|
+
const template = (kind, contents) => {
|
|
8
|
+
const { path, relativePath } = metadataTemplateFile(project, kind);
|
|
9
|
+
return { contents, path, relativePath };
|
|
10
|
+
};
|
|
11
|
+
return [
|
|
12
|
+
template("desktop", metadata.desktopEntry),
|
|
13
|
+
template("metainfo.xml", metadata.metainfo),
|
|
14
|
+
...(metadata.mimePackage === null ? [] : [template("mime.xml", metadata.mimePackage)]),
|
|
15
|
+
];
|
|
16
|
+
};
|
|
17
|
+
const mergeCatalogs = (project, workDir, request) => {
|
|
18
|
+
const { extension, mode, stem, template } = request;
|
|
19
|
+
let current = join(workDir, `${stem}-source${extension}`);
|
|
20
|
+
writeFileSync(current, template);
|
|
21
|
+
for (const [index, catalog] of project.catalogs.entries()) {
|
|
22
|
+
const output = join(workDir, `${stem}-${String(index)}${extension}`);
|
|
23
|
+
runCliTool({
|
|
24
|
+
tool: "msgfmt",
|
|
25
|
+
args: [
|
|
26
|
+
mode,
|
|
27
|
+
`--template=${current}`,
|
|
28
|
+
`--locale=${catalog.locale}`,
|
|
29
|
+
`--output-file=${output}`,
|
|
30
|
+
catalog.path,
|
|
31
|
+
],
|
|
32
|
+
target: catalog.path,
|
|
33
|
+
});
|
|
34
|
+
current = output;
|
|
35
|
+
}
|
|
36
|
+
return readFileSync(current, "utf8");
|
|
37
|
+
};
|
|
38
|
+
const localizeMetadata = (metadata, project) => {
|
|
39
|
+
if (project === null || project.catalogs.length === 0) {
|
|
40
|
+
return metadata;
|
|
41
|
+
}
|
|
42
|
+
const workDir = mkdtempSync(join(tmpdir(), "gtkx-deploy-metadata-"));
|
|
43
|
+
try {
|
|
44
|
+
return {
|
|
45
|
+
desktopEntry: mergeCatalogs(project, workDir, {
|
|
46
|
+
mode: "--desktop",
|
|
47
|
+
stem: "application",
|
|
48
|
+
extension: ".desktop",
|
|
49
|
+
template: metadata.desktopEntry,
|
|
50
|
+
}),
|
|
51
|
+
metainfo: mergeCatalogs(project, workDir, {
|
|
52
|
+
mode: "--xml",
|
|
53
|
+
stem: "metainfo",
|
|
54
|
+
extension: ".metainfo.xml",
|
|
55
|
+
template: metadata.metainfo,
|
|
56
|
+
}),
|
|
57
|
+
mimePackage: metadata.mimePackage === null
|
|
58
|
+
? null
|
|
59
|
+
: mergeCatalogs(project, workDir, {
|
|
60
|
+
mode: "--xml",
|
|
61
|
+
stem: "mime",
|
|
62
|
+
extension: ".xml",
|
|
63
|
+
template: metadata.mimePackage,
|
|
64
|
+
}),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
rmSync(workDir, { recursive: true, force: true });
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const extractMetadataMessages = (metadata, project, catalogTemplate) => {
|
|
72
|
+
const potPath = catalogTemplate ?? join(project.poDir, `${project.domain}.pot`);
|
|
73
|
+
if (!existsSync(potPath)) {
|
|
74
|
+
throw new Error(`Cannot add the generated metadata to the missing catalog template: ${potPath}`);
|
|
75
|
+
}
|
|
76
|
+
const templates = metadataTemplates(project, metadata);
|
|
77
|
+
const firstTemplate = templates[0];
|
|
78
|
+
if (firstTemplate === undefined) {
|
|
79
|
+
throw new Error("Cannot extract metadata messages without a generated template");
|
|
80
|
+
}
|
|
81
|
+
const metadataDir = dirname(firstTemplate.path);
|
|
82
|
+
mkdirSync(metadataDir, { recursive: true });
|
|
83
|
+
try {
|
|
84
|
+
for (const template of templates) {
|
|
85
|
+
writeFileSync(template.path, template.contents);
|
|
86
|
+
}
|
|
87
|
+
runCliTool({
|
|
88
|
+
tool: "xgettext",
|
|
89
|
+
args: [
|
|
90
|
+
"--join-existing",
|
|
91
|
+
"--force-po",
|
|
92
|
+
"--from-code=UTF-8",
|
|
93
|
+
`--output=${potPath}`,
|
|
94
|
+
...templates.map((template) => template.relativePath),
|
|
95
|
+
],
|
|
96
|
+
target: potPath,
|
|
97
|
+
options: { cwd: project.root },
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
finally {
|
|
101
|
+
for (const template of templates) {
|
|
102
|
+
rmSync(template.path, { force: true });
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
export { extractMetadataMessages, localizeMetadata };
|
|
107
|
+
//# sourceMappingURL=localize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localize.js","sourceRoot":"","sources":["../../../src/deploy/freedesktop/localize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClG,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAG1C,OAAO,EAAE,oBAAoB,EAA6B,MAAM,kCAAkC,CAAC;AACnG,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAiB5D,MAAM,iBAAiB,GAAG,CAAC,OAAuB,EAAE,QAAwB,EAAsB,EAAE;IAChG,MAAM,QAAQ,GAAG,CAAC,IAA0B,EAAE,QAAgB,EAAoB,EAAE;QAChF,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,oBAAoB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAEnE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IAC5C,CAAC,CAAC;IAEF,OAAO;QACH,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,YAAY,CAAC;QAC1C,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC,QAAQ,CAAC;QAC3C,GAAG,CAAC,QAAQ,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAA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,CAAC,CAAC;IACvD,MAAM,aAAa,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAEnC,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;IACrF,CAAC;IAED,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAChD,SAAS,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE5C,IAAI,CAAC;QACD,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YAC/B,aAAa,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACpD,CAAC;QAED,UAAU,CAAC;YACP,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE;gBACF,iBAAiB;gBACjB,YAAY;gBACZ,mBAAmB;gBACnB,YAAY,OAAO,EAAE;gBACrB,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;aACxD;YACD,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,IAAI,EAAE;SACjC,CAAC,CAAC;IACP,CAAC;YAAS,CAAC;QACP,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YAC/B,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3C,CAAC;IACL,CAAC;AACL,CAAC,CAAC;AAEF,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";\nimport { tmpdir } from \"node:os\";\nimport { dirname, join } from \"node:path\";\nimport type { CatalogProject } from \"../../i18n/catalogs.js\";\nimport type { StagedMetadata } from \"../payload/stage.js\";\nimport { metadataTemplateFile, type MetadataTemplateKind } from \"../../i18n/metadata-templates.js\";\nimport { runCliTool } from \"../../internal/run-cli-tool.js\";\n\ntype MergeMode = \"--desktop\" | \"--xml\";\n\ntype MergeRequest = {\n mode: MergeMode;\n stem: string;\n extension: string;\n template: string;\n};\n\ntype MetadataTemplate = {\n contents: string;\n path: string;\n relativePath: string;\n};\n\nconst metadataTemplates = (project: CatalogProject, metadata: StagedMetadata): MetadataTemplate[] => {\n const template = (kind: MetadataTemplateKind, contents: string): MetadataTemplate => {\n const { path, relativePath } = metadataTemplateFile(project, kind);\n\n return { contents, path, relativePath };\n };\n\n return [\n template(\"desktop\", metadata.desktopEntry),\n template(\"metainfo.xml\", metadata.metainfo),\n ...(metadata.mimePackage === null ? [] : [template(\"mime.xml\", metadata.mimePackage)]),\n ];\n};\n\nconst mergeCatalogs = (project: CatalogProject, workDir: string, request: MergeRequest): string => {\n const { extension, mode, stem, template } = request;\n let current = join(workDir, `${stem}-source${extension}`);\n writeFileSync(current, template);\n\n for (const [index, catalog] of project.catalogs.entries()) {\n const output = join(workDir, `${stem}-${String(index)}${extension}`);\n\n runCliTool({\n tool: \"msgfmt\",\n args: [\n mode,\n `--template=${current}`,\n `--locale=${catalog.locale}`,\n `--output-file=${output}`,\n catalog.path,\n ],\n target: catalog.path,\n });\n\n current = output;\n }\n\n return readFileSync(current, \"utf8\");\n};\n\nconst localizeMetadata = (metadata: StagedMetadata, project: CatalogProject | null): StagedMetadata => {\n if (project === null || project.catalogs.length === 0) {\n return metadata;\n }\n\n const workDir = mkdtempSync(join(tmpdir(), \"gtkx-deploy-metadata-\"));\n\n try {\n return {\n desktopEntry: mergeCatalogs(project, workDir, {\n mode: \"--desktop\",\n stem: \"application\",\n extension: \".desktop\",\n template: metadata.desktopEntry,\n }),\n metainfo: mergeCatalogs(project, workDir, {\n mode: \"--xml\",\n stem: \"metainfo\",\n extension: \".metainfo.xml\",\n template: metadata.metainfo,\n }),\n mimePackage: metadata.mimePackage === null\n ? null\n : mergeCatalogs(project, workDir, {\n mode: \"--xml\",\n stem: \"mime\",\n extension: \".xml\",\n template: metadata.mimePackage,\n }),\n };\n } finally {\n rmSync(workDir, { recursive: true, force: true });\n }\n};\n\nconst extractMetadataMessages = (\n metadata: StagedMetadata,\n project: CatalogProject,\n catalogTemplate?: string,\n): void => {\n const potPath = catalogTemplate ?? join(project.poDir, `${project.domain}.pot`);\n\n if (!existsSync(potPath)) {\n throw new Error(`Cannot add the generated metadata to the missing catalog template: ${potPath}`);\n }\n\n const templates = metadataTemplates(project, metadata);\n const firstTemplate = templates[0];\n\n if (firstTemplate === undefined) {\n throw new Error(\"Cannot extract metadata messages without a generated template\");\n }\n\n const metadataDir = dirname(firstTemplate.path);\n mkdirSync(metadataDir, { recursive: true });\n\n try {\n for (const template of templates) {\n writeFileSync(template.path, template.contents);\n }\n\n runCliTool({\n tool: \"xgettext\",\n args: [\n \"--join-existing\",\n \"--force-po\",\n \"--from-code=UTF-8\",\n `--output=${potPath}`,\n ...templates.map((template) => template.relativePath),\n ],\n target: potPath,\n options: { cwd: project.root },\n });\n } finally {\n for (const template of templates) {\n rmSync(template.path, { force: true });\n }\n }\n};\n\nexport { extractMetadataMessages, localizeMetadata };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-hints.d.ts","sourceRoot":"","sources":["../../src/deploy/install-hints.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"install-hints.d.ts","sourceRoot":"","sources":["../../src/deploy/install-hints.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAmGhD,QAAA,MAAM,mBAAmB,QAAO,aAK/B,CAAC;AAEF,QAAA,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,QAAQ,aAAa,KAAG,MAAM,EAMjE,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -36,8 +36,13 @@ const PACKAGE_FOR_TOOL = {
|
|
|
36
36
|
fedora: "flatpak-builder",
|
|
37
37
|
suse: "flatpak-builder",
|
|
38
38
|
},
|
|
39
|
+
msgfmt: { arch: "gettext", debian: "gettext", fedora: "gettext", suse: "gettext-tools" },
|
|
40
|
+
msginit: { arch: "gettext", debian: "gettext", fedora: "gettext", suse: "gettext-tools" },
|
|
41
|
+
msggrep: { arch: "gettext", debian: "gettext", fedora: "gettext", suse: "gettext-tools" },
|
|
42
|
+
msgmerge: { arch: "gettext", debian: "gettext", fedora: "gettext", suse: "gettext-tools" },
|
|
39
43
|
strip: { arch: "binutils", debian: "binutils", fedora: "binutils", suse: "binutils" },
|
|
40
44
|
tar: { arch: "tar", debian: "tar", fedora: "tar", suse: "tar" },
|
|
45
|
+
xgettext: { arch: "gettext", debian: "gettext", fedora: "gettext", suse: "gettext-tools" },
|
|
41
46
|
};
|
|
42
47
|
const GENERATOR_SOURCE = "git+https://github.com/flatpak/flatpak-builder-tools.git#subdirectory=node";
|
|
43
48
|
const EXTRA_HINTS = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-hints.js","sourceRoot":"","sources":["../../src/deploy/install-hints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAKvC,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAC1C,MAAM,eAAe,GAAG,gCAAgC,CAAC;AACzD,MAAM,MAAM,GAAG,UAAU,CAAC;AAE1B,MAAM,YAAY,GAAkC;IAChD,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,MAAM;IAChB,eAAe,EAAE,MAAM;IACvB,qBAAqB,EAAE,MAAM;IAC7B,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAA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,MAAqB,EAAY,EAAE;IACnE,MAAM,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IACrD,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IACxC,MAAM,OAAO,GAAG,WAAW,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAExG,OAAO,CAAC,GAAG,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AACtD,CAAC,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import { readFileSync } from \"node:fs\";\nimport type { PackageFamily } from \"./types.js\";\n\ntype FamilyPackages = Partial<Record<PackageFamily, string>>;\n\nconst OS_RELEASE_PATH = \"/etc/os-release\";\nconst OS_RELEASE_LINE = /^(?<key>[A-Z_]+)=(?<value>.*)$/;\nconst QUOTED = /^\"(.*)\"$/;\n\nconst FAMILY_BY_ID: Record<string, PackageFamily> = {\n arch: \"arch\",\n debian: \"debian\",\n fedora: \"fedora\",\n manjaro: \"arch\",\n opensuse: \"suse\",\n \"opensuse-leap\": \"suse\",\n \"opensuse-tumbleweed\": \"suse\",\n rhel: \"fedora\",\n sles: \"suse\",\n suse: \"suse\",\n ubuntu: \"debian\",\n};\n\nconst INSTALL_COMMAND: Partial<Record<PackageFamily, string>> = {\n arch: \"sudo pacman -S\",\n debian: \"sudo apt install\",\n fedora: \"sudo dnf install\",\n suse: \"sudo zypper install\",\n};\n\nconst PACKAGE_FOR_TOOL: Record<string, FamilyPackages> = {\n appstreamcli: { arch: \"appstream\", debian: \"appstream\", fedora: \"appstream\", suse: \"AppStream\" },\n \"desktop-file-validate\": {\n arch: \"desktop-file-utils\",\n debian: \"desktop-file-utils\",\n fedora: \"desktop-file-utils\",\n suse: \"desktop-file-utils\",\n },\n file: { arch: \"file\", debian: \"file\", fedora: \"file\", suse: \"file\" },\n \"flatpak-builder\": {\n arch: \"flatpak-builder\",\n debian: \"flatpak-builder\",\n fedora: \"flatpak-builder\",\n suse: \"flatpak-builder\",\n },\n msgfmt: { arch: \"gettext\", debian: \"gettext\", fedora: \"gettext\", suse: \"gettext-tools\" },\n msginit: { arch: \"gettext\", debian: \"gettext\", fedora: \"gettext\", suse: \"gettext-tools\" },\n msggrep: { arch: \"gettext\", debian: \"gettext\", fedora: \"gettext\", suse: \"gettext-tools\" },\n msgmerge: { arch: \"gettext\", debian: \"gettext\", fedora: \"gettext\", suse: \"gettext-tools\" },\n strip: { arch: \"binutils\", debian: \"binutils\", fedora: \"binutils\", suse: \"binutils\" },\n tar: { arch: \"tar\", debian: \"tar\", fedora: \"tar\", suse: \"tar\" },\n xgettext: { arch: \"gettext\", debian: \"gettext\", fedora: \"gettext\", suse: \"gettext-tools\" },\n};\n\nconst GENERATOR_SOURCE = \"git+https://github.com/flatpak/flatpak-builder-tools.git#subdirectory=node\";\n\nconst EXTRA_HINTS: Record<string, string[]> = {\n \"flatpak-builder\": [\"or: flatpak install --user -y flathub org.flatpak.Builder\"],\n \"flatpak-node-generator\": [\n `pipx install ${GENERATOR_SOURCE}`,\n `or, when the installed copy is too old to vendor pnpm: pipx install --force ${GENERATOR_SOURCE}`,\n ],\n};\n\nconst unquote = (value: string): string => QUOTED.exec(value)?.[1] ?? value;\n\nconst readOsReleaseText = (): string => {\n try {\n return readFileSync(OS_RELEASE_PATH, \"utf8\");\n } catch {\n return \"\";\n }\n};\n\nconst osReleaseEntry = (line: string): [string, string] | null => {\n const match = OS_RELEASE_LINE.exec(line.trim());\n\n return match?.groups ? [match.groups.key ?? \"\", unquote(match.groups.value ?? \"\")] : null;\n};\n\nconst readOsRelease = (): Record<string, string> =>\n Object.fromEntries(\n readOsReleaseText()\n .split(\"\\n\")\n .map((line) => osReleaseEntry(line))\n .filter((entry) => entry !== null),\n );\n\nconst familyForIds = (ids: string[]): PackageFamily => {\n for (const id of ids) {\n const family = FAMILY_BY_ID[id];\n\n if (family !== undefined) {\n return family;\n }\n }\n\n return \"unknown\";\n};\n\nconst detectPackageFamily = (): PackageFamily => {\n const release = readOsRelease();\n const like = (release.ID_LIKE ?? \"\").split(\" \").filter((entry) => entry.length > 0);\n\n return familyForIds([release.ID ?? \"\", ...like]);\n};\n\nconst installHints = (tool: string, family: PackageFamily): string[] => {\n const packageName = PACKAGE_FOR_TOOL[tool]?.[family];\n const command = INSTALL_COMMAND[family];\n const install = packageName !== undefined && command !== undefined ? [`${command} ${packageName}`] : [];\n\n return [...install, ...(EXTRA_HINTS[tool] ?? [])];\n};\n\nexport { detectPackageFamily, installHints };\n"]}
|
|
@@ -29,7 +29,7 @@ const summaryFor = (settings, packages) => {
|
|
|
29
29
|
"Section 3.2(a) asks that whoever receives an executable form be told how to obtain the source code,",
|
|
30
30
|
"which is what the source pointer below is for: it leads to the release these files were built from.",
|
|
31
31
|
`The addon also statically links Rust crates GTKX did not write, so ${lib}/${NATIVE_FILENAME} is not`,
|
|
32
|
-
`${LICENSE_NAME} alone. The
|
|
32
|
+
`${LICENSE_NAME} alone. The crates notice below names the licenses those crates carry; it does not`,
|
|
33
33
|
`reproduce their texts, and ${CRATES_MANIFEST} in the source pointed at records which crates went in`,
|
|
34
34
|
"and at which versions.",
|
|
35
35
|
...modulesLine(packages),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gtkx.js","sourceRoot":"","sources":["../../../src/deploy/notices/gtkx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,MAAM,KAAK,GAAG,MAAM,CAAC;AACrB,MAAM,KAAK,GAAG,QAAQ,CAAC;AACvB,MAAM,YAAY,GAAG,SAAS,CAAC;AAC/B,MAAM,WAAW,GA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O,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,OAAO,EAAE,CAAC;AAC5D,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,QAA0B,EAAU,EAAE,CAAC,CAAC;IAC1D,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,cAAc;IACvB,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC;IACjC,SAAS,EAAE,EAAE;IACb,IAAI,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,CAAC,QAAwB,EAAE,QAA0B,EAAiB,EAAE;IACxF,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7D,MAAM,GAAG,GAAG,OAAO,QAAQ,CAAC,UAAU,EAAE,CAAC;IAEzC,OAAO;QACH,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,CAAC,GAAG,GAAG,IAAI,eAAe,EAAE,EAAE,GAAG,GAAG,IAAI,eAAe,EAAE,CAAC;QACjE,OAAO,EAAE,UAAU,CAAC,QAAQ,EAAE,GAAG,CAAC;QAClC,OAAO,EAAE,CAAC;gBACN,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC;gBACxB,OAAO,EAAE,YAAY;gBACrB,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC;gBACtB,SAAS,EAAE,YAAY,CAAC,GAAG,CAAC;gBAC5B,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC;aACrB,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;KACxB,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { sortStrings } from \"@gtkx/utils\";\nimport type { DeploySettings, Notice, NoticeSection } from \"../types.js\";\nimport type { BundledPackage } from \"./packages.js\";\nimport { BUNDLE_FILENAME } from \"../../vite-plugins/esm-extension.js\";\n\nconst TITLE = \"GTKX\";\nconst SCOPE = \"@gtkx/\";\nconst LICENSE_NAME = \"MPL-2.0\";\nconst LICENSE_URL = \"https://www.mozilla.org/MPL/2.0/\";\nconst REPOSITORY_URL = \"https://github.com/gtkx-org/gtkx\";\nconst NATIVE_FILENAME = \"gtkx.node\";\nconst CRATES_SUBJECT = \"Rust crates linked into the GTKX native addon\";\nconst CRATES_LICENSE = \"MIT and Apache-2.0 and ISC and Unicode-3.0\";\nconst CRATES_MANIFEST = \"packages/native/Cargo.toml\";\n\nconst isGtkxPackage = (entry: BundledPackage): boolean => entry.name.startsWith(SCOPE);\n\nconst getVersion = (packages: BundledPackage[]): string | null =>\n packages.map((entry) => entry.version).find((version) => version !== null) ?? null;\n\nconst getRepository = (packages: BundledPackage[]): string =>\n packages.map((entry) => entry.source).find((source) => source !== null) ?? REPOSITORY_URL;\n\nconst sourceFor = (packages: BundledPackage[]): string => {\n const repository = getRepository(packages);\n const version = getVersion(packages);\n\n return version === null ? repository : `${repository}/tree/v${version}`;\n};\n\nconst cratesSourceFor = (packages: BundledPackage[]): string => `${sourceFor(packages)}/${CRATES_MANIFEST}`;\n\nconst modulesLine = (packages: BundledPackage[]): string[] =>\n packages.length === 0 ? [] : [`Modules: ${sortStrings(packages.map((entry) => entry.name)).join(\", \")}.`];\n\nconst summaryFor = (settings: DeploySettings, packages: BundledPackage[]): string[] => {\n const lib = `lib/${settings.binaryName}`;\n\n return [\n \"GTKX is the framework this application is built on. Its JavaScript is compiled into\",\n `${lib}/${BUNDLE_FILENAME}, and its native addon is ${lib}/${NATIVE_FILENAME}.`,\n `The ${LICENSE_NAME} notice below covers the code GTKX wrote, all of which is in both files, and the`,\n `Mozilla Public License 2.0 is published at ${LICENSE_URL}.`,\n \"Section 3.2(a) asks that whoever receives an executable form be told how to obtain the source code,\",\n \"which is what the source pointer below is for: it leads to the release these files were built from.\",\n `The addon also statically links Rust crates GTKX did not write, so ${lib}/${NATIV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SAAS,CAAC,GAAG,CAAC;gBACtB,SAAS,EAAE,YAAY,CAAC,GAAG,CAAC;gBAC5B,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC;aACrB,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;KACxB,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { sortStrings } from \"@gtkx/utils\";\nimport type { DeploySettings, Notice, NoticeSection } from \"../types.js\";\nimport type { BundledPackage } from \"./packages.js\";\nimport { BUNDLE_FILENAME } from \"../../vite-plugins/esm-extension.js\";\n\nconst TITLE = \"GTKX\";\nconst SCOPE = \"@gtkx/\";\nconst LICENSE_NAME = \"MPL-2.0\";\nconst LICENSE_URL = \"https://www.mozilla.org/MPL/2.0/\";\nconst REPOSITORY_URL = \"https://github.com/gtkx-org/gtkx\";\nconst NATIVE_FILENAME = \"gtkx.node\";\nconst CRATES_SUBJECT = \"Rust crates linked into the GTKX native addon\";\nconst CRATES_LICENSE = \"MIT and Apache-2.0 and ISC and Unicode-3.0\";\nconst CRATES_MANIFEST = \"packages/native/Cargo.toml\";\n\nconst isGtkxPackage = (entry: BundledPackage): boolean => entry.name.startsWith(SCOPE);\n\nconst getVersion = (packages: BundledPackage[]): string | null =>\n packages.map((entry) => entry.version).find((version) => version !== null) ?? null;\n\nconst getRepository = (packages: BundledPackage[]): string =>\n packages.map((entry) => entry.source).find((source) => source !== null) ?? REPOSITORY_URL;\n\nconst sourceFor = (packages: BundledPackage[]): string => {\n const repository = getRepository(packages);\n const version = getVersion(packages);\n\n return version === null ? repository : `${repository}/tree/v${version}`;\n};\n\nconst cratesSourceFor = (packages: BundledPackage[]): string => `${sourceFor(packages)}/${CRATES_MANIFEST}`;\n\nconst modulesLine = (packages: BundledPackage[]): string[] =>\n packages.length === 0 ? [] : [`Modules: ${sortStrings(packages.map((entry) => entry.name)).join(\", \")}.`];\n\nconst summaryFor = (settings: DeploySettings, packages: BundledPackage[]): string[] => {\n const lib = `lib/${settings.binaryName}`;\n\n return [\n \"GTKX is the framework this application is built on. Its JavaScript is compiled into\",\n `${lib}/${BUNDLE_FILENAME}, and its native addon is ${lib}/${NATIVE_FILENAME}.`,\n `The ${LICENSE_NAME} notice below covers the code GTKX wrote, all of which is in both files, and the`,\n `Mozilla Public License 2.0 is published at ${LICENSE_URL}.`,\n \"Section 3.2(a) asks that whoever receives an executable form be told how to obtain the source code,\",\n \"which is what the source pointer below is for: it leads to the release these files were built from.\",\n `The addon also statically links Rust crates GTKX did not write, so ${lib}/${NATIVE_FILENAME} is not`,\n `${LICENSE_NAME} alone. The crates notice below names the licenses those crates carry; it does not`,\n `reproduce their texts, and ${CRATES_MANIFEST} in the source pointed at records which crates went in`,\n \"and at which versions.\",\n ...modulesLine(packages),\n ];\n};\n\nconst getText = (packages: BundledPackage[]): string | null =>\n packages.map((entry) => entry.text).find((text) => text !== null) ?? null;\n\nconst getCopyright = (packages: BundledPackage[]): string[] =>\n sortStrings(new Set(packages.flatMap((entry) => entry.copyright)));\n\nconst subjectFor = (packages: BundledPackage[]): string => {\n const version = getVersion(packages);\n\n return version === null ? TITLE : `${TITLE} ${version}`;\n};\n\nconst cratesNotice = (packages: BundledPackage[]): Notice => ({\n subject: CRATES_SUBJECT,\n license: CRATES_LICENSE,\n source: cratesSourceFor(packages),\n copyright: [],\n text: null,\n});\n\nconst gtkxNotices = (settings: DeploySettings, packages: BundledPackage[]): NoticeSection => {\n const own = packages.filter((entry) => isGtkxPackage(entry));\n const lib = `lib/${settings.binaryName}`;\n\n return {\n title: TITLE,\n files: [`${lib}/${NATIVE_FILENAME}`, `${lib}/${BUNDLE_FILENAME}`],\n summary: summaryFor(settings, own),\n notices: [{\n subject: subjectFor(own),\n license: LICENSE_NAME,\n source: sourceFor(own),\n copyright: getCopyright(own),\n text: getText(own),\n }, cratesNotice(own)],\n };\n};\n\nexport { gtkxNotices, isGtkxPackage };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libraries.d.ts","sourceRoot":"","sources":["../../../src/deploy/notices/libraries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAU,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"libraries.d.ts","sourceRoot":"","sources":["../../../src/deploy/notices/libraries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAU,aAAa,EAAE,MAAM,aAAa,CAAC;AAqEzE,QAAA,MAAM,cAAc,GAAI,UAAU,cAAc,KAAG,aASlD,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -25,7 +25,8 @@ const SUMMARY = [
|
|
|
25
25
|
"their own terms; this package does not distribute them at all.",
|
|
26
26
|
"The GTKX native addon does link GLib, GObject and GIO dynamically against the copies already installed",
|
|
27
27
|
"on the system, which makes the addon a work that uses those libraries, and section 6 of the LGPL asks",
|
|
28
|
-
"such a work to carry
|
|
28
|
+
"such a work to carry a notice, the license, and the copyright notices. This is the notice it asks for,",
|
|
29
|
+
"and the license itself is published at",
|
|
29
30
|
`${LGPL_URL},`,
|
|
30
31
|
"and the copyright notice of each library is published with its sources, at the address listed beside",
|
|
31
32
|
"it below. Linking against an installed shared library is the mechanism section 6(b) allows, so the",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libraries.js","sourceRoot":"","sources":["../../../src/deploy/notices/libraries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAS5C,MAAM,KAAK,GAAG,oBAAoB,CAAC;AACnC,MAAM,SAAS,GAAG,gCAAgC,CAAC;AACnD,MAAM,IAAI,GAAG,mBAAmB,CAAC;AACjC,MAAM,QAAQ,GAAG,yDAAyD,CAAC;AAE3E,MAAM,IAAI,GAAoB;IAC1B,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,GAAG,SAAS,OAAO;C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AAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,CAAC;IACd,CAAC;IAED,OAAO,CAAC,kCAAkC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;AAC7G,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,QAAwB,EAAiB,EAAE;IAC/D,MAAM,SAAS,GAAG,aAAa,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAExF,OAAO;QACH,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;QAChD,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;KACrE,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { sortStringsBy } from \"@gtkx/utils\";\nimport type { DeploySettings, Notice, NoticeSection } from \"../types.js\";\n\ntype PlatformLibrary = {\n subject: string;\n license: string;\n source: string;\n};\n\nconst TITLE = \"Platform libraries\";\nconst GNOME_URL = \"https://gitlab.gnome.org/GNOME\";\nconst LGPL = \"LGPL-2.1-or-later\";\nconst LGPL_URL = \"https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html\";\n\nconst GLIB: PlatformLibrary = {\n subject: \"GLib, GObject and GIO\",\n license: LGPL,\n source: `${GNOME_URL}/glib`,\n};\n\nconst KNOWN_LIBRARIES: Record<string, PlatformLibrary> = {\n \"Adw-1\": { subject: \"libadwaita\", license: LGPL, source: `${GNOME_URL}/libadwaita` },\n \"Gtk-4.0\": { subject: \"GTK\", license: LGPL, source: `${GNOME_URL}/gtk` },\n \"GtkSource-5\": { subject: \"GtkSourceView\", license: LGPL, source: `${GNOME_URL}/gtksourceview` },\n \"WebKit-6.0\": {\n subject: \"WebKitGTK\",\n license: \"LGPL-2.1-or-later and BSD-2-Clause\",\n source: \"https://github.com/WebKit/WebKit\",\n },\n};\n\nconst SUMMARY = [\n \"Not one of the libraries below is included in this package. GTKX reaches them through GObject\",\n \"introspection, so they are resolved when the application runs: from the host system for a deb, an rpm\",\n \"or an AppImage, and from the GNOME runtime for a flatpak. Your platform distributes them to you under\",\n \"their own terms; this package does not distribute them at all.\",\n \"The GTKX native addon does link GLib, GObject and GIO dynamically against the copies already installed\",\n \"on the system, which makes the addon a work that uses those libraries, and section 6 of the LGPL asks\",\n \"such a work to carry a notice, the license, and the copyright notices. This is the notice it asks for,\",\n \"and the license itself is published at\",\n `${LGPL_URL},`,\n \"and the copyright notice of each library is published with its sources, at the address listed beside\",\n \"it below. Linking against an installed shared library is the mechanism section 6(b) allows, so the\",\n \"source of the libraries does not have to travel with this package.\",\n];\n\nconst noticeFor = (library: PlatformLibrary): Notice => ({\n subject: library.subject,\n license: library.license,\n source: library.source,\n copyright: [],\n text: null,\n});\n\nconst knownLibraries = (settings: DeploySettings): PlatformLibrary[] =>\n settings.libraries.map((library) => KNOWN_LIBRARIES[library]).filter((library) => library !== undefined);\n\nconst otherLibraries = (settings: DeploySettings): string[] =>\n settings.libraries.filter((library) => KNOWN_LIBRARIES[library] === undefined);\n\nconst otherSummary = (settings: DeploySettings): string[] => {\n const others = otherLibraries(settings);\n\n if (others.length === 0) {\n return [];\n }\n\n return [`This application also declares ${others.join(\", \")}, resolved from the platform the same way.`];\n};\n\nconst libraryNotices = (settings: DeploySettings): NoticeSection => {\n const libraries = sortStringsBy(knownLibraries(settings), (library) => library.subject);\n\n return {\n title: TITLE,\n files: [],\n summary: [...SUMMARY, ...otherSummary(settings)],\n notices: [GLIB, ...libraries].map((library) => noticeFor(library)),\n };\n};\n\nexport { libraryNotices };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../../../src/deploy/payload/launcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,QAAA,MAAM,aAAa,SAAS,CAAC;AAQ7B,QAAA,MAAM,cAAc,GAAI,UAAU,cAAc,KAAG,
|
|
1
|
+
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../../../src/deploy/payload/launcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,QAAA,MAAM,aAAa,SAAS,CAAC;AAQ7B,QAAA,MAAM,cAAc,GAAI,UAAU,cAAc,KAAG,MAelD,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -13,6 +13,8 @@ const renderLauncher = (settings) => {
|
|
|
13
13
|
"set -e",
|
|
14
14
|
'self=$(readlink -f "$0")',
|
|
15
15
|
'prefix=$(dirname "$(dirname "$self")")',
|
|
16
|
+
'GTKX_LOCALE_DIR="$prefix/share/locale"',
|
|
17
|
+
"export GTKX_LOCALE_DIR",
|
|
16
18
|
...(shouldUseCompileCache ? compileCacheLines(settings.binaryName) : []),
|
|
17
19
|
`exec "${libDir}/${NODE_FILENAME}" "${libDir}/${BUNDLE_FILENAME}" "$@"`,
|
|
18
20
|
"",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.js","sourceRoot":"","sources":["../../../src/deploy/payload/launcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,MAAM,aAAa,GAAG,MAAM,CAAC;AAE7B,MAAM,iBAAiB,GAAG,CAAC,UAAkB,EAAY,EAAE,CAAC;IACxD,oDAAoD;IACpD,mCAAmC,UAAU,QAAQ;IACrD,2BAA2B;CAC9B,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,QAAwB,EAAU,EAAE;IACxD,MAAM,MAAM,GAAG,eAAe,QAAQ,CAAC,UAAU,EAAE,CAAC;IACpD,MAAM,qBAAqB,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,qBAAqB,KAAK,KAAK,CAAC;IAEpF,OAAO;QACH,WAAW;QACX,QAAQ;QACR,0BAA0B;QAC1B,wCAAwC;QACxC,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC,iBAAiB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACxE,SAAS,MAAM,IAAI,aAAa,MAAM,MAAM,IAAI,eAAe,QAAQ;QACvE,EAAE;KACL,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import type { DeploySettings } from \"../types.js\";\nimport { BUNDLE_FILENAME } from \"../../vite-plugins/esm-extension.js\";\n\nconst NODE_FILENAME = \"node\";\n\nconst compileCacheLines = (binaryName: string): string[] => [\n \"cache_home=${XDG_CACHE_HOME:-${HOME:-/tmp}/.cache}\",\n `NODE_COMPILE_CACHE=\"$cache_home/${binaryName}/node\"`,\n \"export NODE_COMPILE_CACHE\",\n];\n\nconst renderLauncher = (settings: DeploySettings): string => {\n const libDir = `$prefix/lib/${settings.binaryName}`;\n const shouldUseCompileCache = settings.deploy.node?.shouldUseCompileCache !== false;\n\n return [\n \"#!/bin/sh\",\n \"set -e\",\n 'self=$(readlink -f \"$0\")',\n 'prefix=$(dirname \"$(dirname \"$self\")\")',\n ...(shouldUseCompileCache ? compileCacheLines(settings.binaryName) : []),\n `exec \"${libDir}/${NODE_FILENAME}\" \"${libDir}/${BUNDLE_FILENAME}\" \"$@\"`,\n \"\",\n ].join(\"\\n\");\n};\n\nexport { NODE_FILENAME, renderLauncher };\n"]}
|
|
1
|
+
{"version":3,"file":"launcher.js","sourceRoot":"","sources":["../../../src/deploy/payload/launcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,MAAM,aAAa,GAAG,MAAM,CAAC;AAE7B,MAAM,iBAAiB,GAAG,CAAC,UAAkB,EAAY,EAAE,CAAC;IACxD,oDAAoD;IACpD,mCAAmC,UAAU,QAAQ;IACrD,2BAA2B;CAC9B,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,QAAwB,EAAU,EAAE;IACxD,MAAM,MAAM,GAAG,eAAe,QAAQ,CAAC,UAAU,EAAE,CAAC;IACpD,MAAM,qBAAqB,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,qBAAqB,KAAK,KAAK,CAAC;IAEpF,OAAO;QACH,WAAW;QACX,QAAQ;QACR,0BAA0B;QAC1B,wCAAwC;QACxC,wCAAwC;QACxC,wBAAwB;QACxB,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC,iBAAiB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACxE,SAAS,MAAM,IAAI,aAAa,MAAM,MAAM,IAAI,eAAe,QAAQ;QACvE,EAAE;KACL,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import type { DeploySettings } from \"../types.js\";\nimport { BUNDLE_FILENAME } from \"../../vite-plugins/esm-extension.js\";\n\nconst NODE_FILENAME = \"node\";\n\nconst compileCacheLines = (binaryName: string): string[] => [\n \"cache_home=${XDG_CACHE_HOME:-${HOME:-/tmp}/.cache}\",\n `NODE_COMPILE_CACHE=\"$cache_home/${binaryName}/node\"`,\n \"export NODE_COMPILE_CACHE\",\n];\n\nconst renderLauncher = (settings: DeploySettings): string => {\n const libDir = `$prefix/lib/${settings.binaryName}`;\n const shouldUseCompileCache = settings.deploy.node?.shouldUseCompileCache !== false;\n\n return [\n \"#!/bin/sh\",\n \"set -e\",\n 'self=$(readlink -f \"$0\")',\n 'prefix=$(dirname \"$(dirname \"$self\")\")',\n 'GTKX_LOCALE_DIR=\"$prefix/share/locale\"',\n \"export GTKX_LOCALE_DIR\",\n ...(shouldUseCompileCache ? compileCacheLines(settings.binaryName) : []),\n `exec \"${libDir}/${NODE_FILENAME}\" \"${libDir}/${BUNDLE_FILENAME}\" \"$@\"`,\n \"\",\n ].join(\"\\n\");\n};\n\nexport { NODE_FILENAME, renderLauncher };\n"]}
|
|
@@ -14,6 +14,6 @@ declare const licenseDestination: (settings: DeploySettings) => string;
|
|
|
14
14
|
declare const noticesDestination: (settings: DeploySettings) => string;
|
|
15
15
|
declare const nodeLicenseDestination: (settings: DeploySettings) => string;
|
|
16
16
|
declare const stagePayload: ({ settings, node, metadata }: StageRequest) => StagedFile[];
|
|
17
|
-
declare const stageOverlays: (settings: DeploySettings, notices: NoticeSection[]) => Record<DeployTargetName, StagedFile[]>;
|
|
17
|
+
declare const stageOverlays: (settings: DeploySettings, notices: NoticeSection[], metadata: StagedMetadata) => Record<DeployTargetName, StagedFile[]>;
|
|
18
18
|
export { licenseDestination, nodeLicenseDestination, NOTICES_FILENAME, noticesDestination, type StagedMetadata, stageOverlays, stagePayload, };
|
|
19
19
|
//# sourceMappingURL=stage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../../src/deploy/payload/stage.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAa5G,KAAK,YAAY,GAAG;IAChB,QAAQ,EAAE,cAAc,CAAC;IACzB,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,cAAc,CAAC;CAC5B,CAAC;AAEF,KAAK,cAAc,GAAG;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;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