@gtkx/cli 1.6.0 → 2.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/README.md +5 -5
  2. package/dist/codegen/freshness.d.ts.map +1 -1
  3. package/dist/codegen/freshness.js +45 -16
  4. package/dist/codegen/freshness.js.map +1 -1
  5. package/dist/codegen/reference.d.ts.map +1 -1
  6. package/dist/codegen/reference.js +1 -7
  7. package/dist/codegen/reference.js.map +1 -1
  8. package/dist/codegen/report.d.ts.map +1 -1
  9. package/dist/codegen/report.js +5 -16
  10. package/dist/codegen/report.js.map +1 -1
  11. package/dist/codegen/run-codegen.d.ts +3 -5
  12. package/dist/codegen/run-codegen.d.ts.map +1 -1
  13. package/dist/codegen/run-codegen.js +23 -100
  14. package/dist/codegen/run-codegen.js.map +1 -1
  15. package/dist/codegen/store-resolver.d.ts +0 -1
  16. package/dist/codegen/store-resolver.d.ts.map +1 -1
  17. package/dist/codegen/store-resolver.js +8 -17
  18. package/dist/codegen/store-resolver.js.map +1 -1
  19. package/dist/commands/docs.d.ts.map +1 -1
  20. package/dist/commands/docs.js +5 -15
  21. package/dist/commands/docs.js.map +1 -1
  22. package/dist/deploy/freedesktop/copyright.d.ts.map +1 -1
  23. package/dist/deploy/freedesktop/copyright.js +2 -13
  24. package/dist/deploy/freedesktop/copyright.js.map +1 -1
  25. package/dist/deploy/freedesktop/xml.d.ts.map +1 -1
  26. package/dist/deploy/freedesktop/xml.js +21 -25
  27. package/dist/deploy/freedesktop/xml.js.map +1 -1
  28. package/dist/deploy/node-runtime/license.d.ts.map +1 -1
  29. package/dist/deploy/node-runtime/license.js +2 -9
  30. package/dist/deploy/node-runtime/license.js.map +1 -1
  31. package/dist/deploy/notices/packages.d.ts.map +1 -1
  32. package/dist/deploy/notices/packages.js +3 -10
  33. package/dist/deploy/notices/packages.js.map +1 -1
  34. package/dist/deploy/payload/copy-tree.d.ts.map +1 -1
  35. package/dist/deploy/payload/copy-tree.js +3 -3
  36. package/dist/deploy/payload/copy-tree.js.map +1 -1
  37. package/dist/deploy/payload/stage.d.ts.map +1 -1
  38. package/dist/deploy/payload/stage.js +1 -3
  39. package/dist/deploy/payload/stage.js.map +1 -1
  40. package/dist/deploy/settings/build-manifest.d.ts.map +1 -1
  41. package/dist/deploy/settings/build-manifest.js +4 -15
  42. package/dist/deploy/settings/build-manifest.js.map +1 -1
  43. package/dist/deploy/settings/libraries.d.ts.map +1 -1
  44. package/dist/deploy/settings/libraries.js +2 -19
  45. package/dist/deploy/settings/libraries.js.map +1 -1
  46. package/dist/deploy/settings/paths.d.ts +1 -2
  47. package/dist/deploy/settings/paths.d.ts.map +1 -1
  48. package/dist/deploy/settings/paths.js +5 -15
  49. package/dist/deploy/settings/paths.js.map +1 -1
  50. package/dist/deploy/settings/screenshots.d.ts.map +1 -1
  51. package/dist/deploy/settings/screenshots.js +6 -31
  52. package/dist/deploy/settings/screenshots.js.map +1 -1
  53. package/dist/deploy/targets/flatpak-pnpm.js +4 -4
  54. package/dist/deploy/targets/flatpak-pnpm.js.map +1 -1
  55. package/dist/deploy/targets/flatpak-source.d.ts.map +1 -1
  56. package/dist/deploy/targets/flatpak-source.js +4 -4
  57. package/dist/deploy/targets/flatpak-source.js.map +1 -1
  58. package/dist/deploy/targets/flatpak-sources.js +1 -1
  59. package/dist/deploy/targets/flatpak-sources.js.map +1 -1
  60. package/dist/dev/runner-main.d.ts.map +1 -1
  61. package/dist/dev/runner-main.js +1 -2
  62. package/dist/dev/runner-main.js.map +1 -1
  63. package/dist/dev/schema-dir.d.ts +1 -1
  64. package/dist/dev/schema-dir.d.ts.map +1 -1
  65. package/dist/dev/schema-dir.js +2 -4
  66. package/dist/dev/schema-dir.js.map +1 -1
  67. package/dist/i18n/catalogs.d.ts.map +1 -1
  68. package/dist/i18n/catalogs.js +2 -1
  69. package/dist/i18n/catalogs.js.map +1 -1
  70. package/dist/i18n/metadata-templates.d.ts.map +1 -1
  71. package/dist/i18n/metadata-templates.js +2 -1
  72. package/dist/i18n/metadata-templates.js.map +1 -1
  73. package/dist/i18n/source-messages.d.ts +3 -21
  74. package/dist/i18n/source-messages.d.ts.map +1 -1
  75. package/dist/i18n/source-messages.js +66 -85
  76. package/dist/i18n/source-messages.js.map +1 -1
  77. package/dist/i18n/types.d.ts +6 -7
  78. package/dist/i18n/types.d.ts.map +1 -1
  79. package/dist/i18n/types.js +83 -96
  80. package/dist/i18n/types.js.map +1 -1
  81. package/dist/internal/docs-elements.js +2 -2
  82. package/dist/internal/docs-elements.js.map +1 -1
  83. package/dist/internal/icon-path.d.ts.map +1 -1
  84. package/dist/internal/icon-path.js +5 -16
  85. package/dist/internal/icon-path.js.map +1 -1
  86. package/dist/internal/source-imports.d.ts.map +1 -1
  87. package/dist/internal/source-imports.js +10 -41
  88. package/dist/internal/source-imports.js.map +1 -1
  89. package/dist/settings/render.d.ts +0 -1
  90. package/dist/settings/render.d.ts.map +1 -1
  91. package/dist/settings/render.js +1 -11
  92. package/dist/settings/render.js.map +1 -1
  93. package/dist/settings/schema.d.ts +2 -2
  94. package/dist/settings/schema.d.ts.map +1 -1
  95. package/dist/settings/schema.js +21 -62
  96. package/dist/settings/schema.js.map +1 -1
  97. package/dist/vite-plugins/asset-imports.d.ts +1 -2
  98. package/dist/vite-plugins/asset-imports.d.ts.map +1 -1
  99. package/dist/vite-plugins/asset-imports.js +19 -32
  100. package/dist/vite-plugins/asset-imports.js.map +1 -1
  101. package/dist/vite-plugins/asset-specifier.d.ts +1 -3
  102. package/dist/vite-plugins/asset-specifier.d.ts.map +1 -1
  103. package/dist/vite-plugins/asset-specifier.js +1 -4
  104. package/dist/vite-plugins/asset-specifier.js.map +1 -1
  105. package/dist/vite-plugins/i18n.d.ts.map +1 -1
  106. package/dist/vite-plugins/i18n.js +2 -1
  107. package/dist/vite-plugins/i18n.js.map +1 -1
  108. package/dist/vite-plugins/index.d.ts.map +1 -1
  109. package/dist/vite-plugins/index.js +2 -4
  110. package/dist/vite-plugins/index.js.map +1 -1
  111. package/dist/vite-plugins/resources.d.ts.map +1 -1
  112. package/dist/vite-plugins/resources.js +32 -97
  113. package/dist/vite-plugins/resources.js.map +1 -1
  114. package/dist/vite-plugins/settings-worker-env.d.ts.map +1 -1
  115. package/dist/vite-plugins/settings-worker-env.js +2 -4
  116. package/dist/vite-plugins/settings-worker-env.js.map +1 -1
  117. package/dist/vite-plugins/settings.d.ts +1 -2
  118. package/dist/vite-plugins/settings.d.ts.map +1 -1
  119. package/dist/vite-plugins/settings.js +8 -14
  120. package/dist/vite-plugins/settings.js.map +1 -1
  121. package/dist/vite-plugins/undeclared-library.d.ts.map +1 -1
  122. package/dist/vite-plugins/undeclared-library.js +10 -13
  123. package/dist/vite-plugins/undeclared-library.js.map +1 -1
  124. package/dist/vite-plugins/worker.d.ts.map +1 -1
  125. package/dist/vite-plugins/worker.js +0 -1
  126. package/dist/vite-plugins/worker.js.map +1 -1
  127. package/package.json +21 -15
  128. package/src/codegen/freshness.ts +66 -17
  129. package/src/codegen/reference.ts +1 -8
  130. package/src/codegen/report.ts +5 -21
  131. package/src/codegen/run-codegen.ts +28 -145
  132. package/src/codegen/store-resolver.ts +8 -24
  133. package/src/commands/docs.ts +5 -17
  134. package/src/deploy/freedesktop/copyright.ts +2 -14
  135. package/src/deploy/freedesktop/xml.ts +24 -32
  136. package/src/deploy/node-runtime/license.ts +2 -8
  137. package/src/deploy/notices/packages.ts +3 -11
  138. package/src/deploy/payload/copy-tree.ts +3 -4
  139. package/src/deploy/payload/stage.ts +2 -6
  140. package/src/deploy/settings/build-manifest.ts +4 -16
  141. package/src/deploy/settings/libraries.ts +1 -22
  142. package/src/deploy/settings/paths.ts +6 -16
  143. package/src/deploy/settings/screenshots.ts +8 -46
  144. package/src/deploy/targets/flatpak-pnpm.ts +4 -4
  145. package/src/deploy/targets/flatpak-source.ts +4 -4
  146. package/src/deploy/targets/flatpak-sources.ts +1 -1
  147. package/src/dev/runner-main.ts +1 -2
  148. package/src/dev/schema-dir.ts +2 -4
  149. package/src/i18n/catalogs.ts +2 -1
  150. package/src/i18n/metadata-templates.ts +2 -1
  151. package/src/i18n/source-messages.ts +77 -115
  152. package/src/i18n/types.ts +97 -131
  153. package/src/internal/docs-elements.ts +2 -2
  154. package/src/internal/icon-path.ts +6 -19
  155. package/src/internal/source-imports.ts +14 -50
  156. package/src/settings/render.ts +1 -13
  157. package/src/settings/schema.ts +19 -81
  158. package/src/vite-plugins/asset-imports.ts +20 -44
  159. package/src/vite-plugins/asset-specifier.ts +0 -5
  160. package/src/vite-plugins/i18n.ts +2 -1
  161. package/src/vite-plugins/index.ts +2 -4
  162. package/src/vite-plugins/resources.ts +37 -140
  163. package/src/vite-plugins/settings-worker-env.ts +2 -4
  164. package/src/vite-plugins/settings.ts +11 -20
  165. package/src/vite-plugins/undeclared-library.ts +14 -20
  166. package/src/vite-plugins/worker.ts +0 -1
  167. package/dist/i18n/binding-extractor.d.ts +0 -30
  168. package/dist/i18n/binding-extractor.d.ts.map +0 -1
  169. package/dist/i18n/binding-extractor.js +0 -1324
  170. package/dist/i18n/binding-extractor.js.map +0 -1
  171. package/dist/i18n/extractor-plugin.d.ts +0 -8
  172. package/dist/i18n/extractor-plugin.d.ts.map +0 -1
  173. package/dist/i18n/extractor-plugin.js +0 -247
  174. package/dist/i18n/extractor-plugin.js.map +0 -1
  175. package/dist/internal/data-dir.d.ts +0 -4
  176. package/dist/internal/data-dir.d.ts.map +0 -1
  177. package/dist/internal/data-dir.js +0 -52
  178. package/dist/internal/data-dir.js.map +0 -1
  179. package/dist/vite-plugins/animated.d.ts +0 -5
  180. package/dist/vite-plugins/animated.d.ts.map +0 -1
  181. package/dist/vite-plugins/animated.js +0 -325
  182. package/dist/vite-plugins/animated.js.map +0 -1
  183. package/src/i18n/binding-extractor.ts +0 -1969
  184. package/src/i18n/extractor-plugin.ts +0 -413
  185. package/src/internal/data-dir.ts +0 -70
  186. package/src/vite-plugins/animated.ts +0 -486
@@ -1,6 +1,6 @@
1
- import { isRecord, sortStrings } from "@gtkx/utils";
1
+ import { isPathInside, isRecord, sortStrings } from "@gtkx/utils";
2
2
  import { existsSync, readFileSync, statSync } from "node:fs";
3
- import { isAbsolute, join, relative, resolve, sep } from "node:path";
3
+ import { isAbsolute, join, resolve } from "node:path";
4
4
  import type { DeploySettings } from "../types.js";
5
5
  import {
6
6
  BUILD_MANIFEST_FILENAME,
@@ -67,19 +67,7 @@ const parseBuildManifest = (value: unknown, path: string): BuildManifest => {
67
67
  };
68
68
  };
69
69
 
70
- const isFile = (path: string): boolean => {
71
- try {
72
- return statSync(path, { throwIfNoEntry: false })?.isFile() === true;
73
- } catch {
74
- return false;
75
- }
76
- };
77
-
78
- const isInsideProject = (root: string, filePath: string): boolean => {
79
- const rel = relative(root, filePath);
80
-
81
- return rel.length > 0 && rel !== ".." && !rel.startsWith(`..${sep}`) && !isAbsolute(rel);
82
- };
70
+ const isFile = (path: string): boolean => statSync(path, { throwIfNoEntry: false })?.isFile() === true;
83
71
 
84
72
  const resolveRecordedSchema = (root: string, manifestPath: string, entry: string): string => {
85
73
  if (isAbsolute(entry) || !entry.endsWith(SCHEMA_SUFFIX)) {
@@ -88,7 +76,7 @@ const resolveRecordedSchema = (root: string, manifestPath: string, entry: string
88
76
 
89
77
  const filePath = resolve(root, entry);
90
78
 
91
- if (!isInsideProject(root, filePath)) {
79
+ if (!isPathInside(root, filePath)) {
92
80
  throw new Error(`Cannot deploy: ${manifestPath} records a GSettings schema outside the project.`);
93
81
  }
94
82
 
@@ -3,10 +3,8 @@ import {
3
3
  resolveLibraries as expandLibraries,
4
4
  type GeneratedLibraries,
5
5
  readGeneratedLibraries,
6
- resolveGirPath,
7
6
  resolveStore,
8
7
  } from "@gtkx/codegen";
9
- import { resolveFuture } from "@gtkx/config/internal";
10
8
 
11
9
  type ResolvedLibraries = {
12
10
  libraries: string[];
@@ -21,28 +19,9 @@ const generatedLibraries = (root: string): GeneratedLibraries | null => {
21
19
  }
22
20
  };
23
21
 
24
- const discoveredLibraries = (config: Config, isAdwaitaDefault: boolean): string[] | null => {
25
- try {
26
- return expandLibraries(config.libraries, resolveGirPath(config.girPath), isAdwaitaDefault);
27
- } catch {
28
- return null;
29
- }
30
- };
31
-
32
- const configLibraries = (config: Config): string[] => {
33
- const { isAdwaitaDefault } = resolveFuture(config.future);
34
- const libraries = config.libraries;
35
-
36
- if (Array.isArray(libraries)) {
37
- return expandLibraries(libraries, [], isAdwaitaDefault);
38
- }
39
-
40
- return discoveredLibraries(config, isAdwaitaDefault) ?? expandLibraries(undefined, [], isAdwaitaDefault);
41
- };
42
-
43
22
  const resolveLibraries = (root: string, config: Config): ResolvedLibraries => {
44
23
  const generated = generatedLibraries(root);
45
- const libraries = generated?.libraries ?? configLibraries(config);
24
+ const libraries = generated?.libraries ?? expandLibraries(config.libraries);
46
25
  const deploy = config.deploy ?? {};
47
26
 
48
27
  return {
@@ -1,6 +1,7 @@
1
1
  import type { Config } from "@gtkx/config";
2
+ import { isPathInside } from "@gtkx/utils";
2
3
  import { statSync } from "node:fs";
3
- import { isAbsolute, join, relative, resolve } from "node:path";
4
+ import { join, resolve } from "node:path";
4
5
  import type { DeployConfig, DeployPaths } from "../types.js";
5
6
  import { resolveApplicationIcon } from "../../internal/icon-path.js";
6
7
 
@@ -16,30 +17,19 @@ const DEFAULT_OUT_DIR = "build";
16
17
  const DIST_DIR = "dist";
17
18
  const LICENSE_CANDIDATES = ["LICENSE", "LICENSE.md", "LICENSE.txt", "COPYING", "COPYING.md"];
18
19
 
19
- const isInside = (parent: string, candidate: string): boolean => {
20
- const rel = relative(parent, candidate);
21
-
22
- return rel.length > 0 && !rel.startsWith("..") && !isAbsolute(rel);
23
- };
24
-
25
20
  const resolveOutDir = ({ root, deploy, outDirOverride }: PathsRequest): string => {
26
21
  const configured = outDirOverride ?? deploy.outDir ?? DEFAULT_OUT_DIR;
27
22
  const outDir = resolve(root, configured);
28
23
 
29
- if (!isInside(root, outDir)) {
24
+ if (!isPathInside(root, outDir)) {
30
25
  throw new Error(`Cannot use "${configured}" as the deploy output directory: it is outside ${root}`);
31
26
  }
32
27
 
33
28
  return outDir;
34
29
  };
35
30
 
36
- const existingFile = (path: string): string | null => {
37
- try {
38
- return statSync(path, { throwIfNoEntry: false })?.isFile() === true ? path : null;
39
- } catch {
40
- return null;
41
- }
42
- };
31
+ const existingFile = (path: string): string | null =>
32
+ statSync(path, { throwIfNoEntry: false })?.isFile() === true ? path : null;
43
33
 
44
34
  const resolveLicenseFile = (root: string, configured: string | undefined): string | null => {
45
35
  if (configured !== undefined) {
@@ -75,4 +65,4 @@ const resolvePaths = (request: PathsRequest): DeployPaths => {
75
65
  };
76
66
  };
77
67
 
78
- export { isInside, resolvePaths };
68
+ export { resolvePaths };
@@ -1,3 +1,4 @@
1
+ import hostedGitInfo from "hosted-git-info";
1
2
  import type { DeployConfig, DeployScreenshot } from "../types.js";
2
3
  import { gitRemoteUrl, runGit } from "../git.js";
3
4
 
@@ -6,23 +7,9 @@ type ScreenshotRequest = {
6
7
  deploy: DeployConfig;
7
8
  };
8
9
 
9
- type RemoteParts = {
10
- host: string;
11
- owner: string;
12
- repo: string;
13
- };
14
-
15
10
  const DEFAULT_BRANCH = "main";
16
- const GIT_SUFFIX = ".git";
17
- const PORTED_HOST = /^([^/]*):\d+(?=\/|$)/;
18
- const SCHEME_SEPARATOR = "://";
19
11
  const TRAILING_SLASH = "/";
20
12
 
21
- const RAW_BASE_BY_HOST: Record<string, (owner: string, repo: string, branch: string) => string> = {
22
- "github.com": (owner, repo, branch) => `https://raw.githubusercontent.com/${owner}/${repo}/${branch}`,
23
- "gitlab.com": (owner, repo, branch) => `https://gitlab.com/${owner}/${repo}/-/raw/${branch}`,
24
- };
25
-
26
13
  const readRepositoryPrefix = (root: string): string =>
27
14
  trimTrailingSlash(runGit(root, ["rev-parse", "--show-prefix"]) ?? "");
28
15
 
@@ -35,29 +22,6 @@ const trimLeadingSlash = (value: string): string => {
35
22
  return withoutDot.startsWith(TRAILING_SLASH) ? withoutDot.slice(1) : withoutDot;
36
23
  };
37
24
 
38
- const afterMarker = (value: string, marker: string): string => {
39
- const index = value.indexOf(marker);
40
-
41
- return index === -1 ? value : value.slice(index + marker.length);
42
- };
43
-
44
- const normalizeLocation = (trimmed: string): string => {
45
- const location = afterMarker(afterMarker(trimmed, SCHEME_SEPARATOR), "@");
46
-
47
- return trimmed.includes(SCHEME_SEPARATOR) ? location.replace(PORTED_HOST, "$1") : location.replace(":", "/");
48
- };
49
-
50
- const parseRemote = (remote: string): RemoteParts | null => {
51
- const trimmed = remote.endsWith(GIT_SUFFIX) ? remote.slice(0, -GIT_SUFFIX.length) : remote;
52
- const [host, owner, repo, ...extra] = normalizeLocation(trimmed).split("/");
53
-
54
- if (repo === undefined || extra.length > 0) {
55
- return null;
56
- }
57
-
58
- return { host: host ?? "", owner: owner ?? "", repo };
59
- };
60
-
61
25
  const readDefaultBranch = (root: string): string => {
62
26
  const head = runGit(root, ["symbolic-ref", "--short", "refs/remotes/origin/HEAD"]);
63
27
 
@@ -70,16 +34,16 @@ const readDefaultBranch = (root: string): string => {
70
34
  return separator === -1 ? head : head.slice(separator + 1);
71
35
  };
72
36
 
73
- const baseForRemote = (remote: string, branch: string): string | null => {
74
- const parts = parseRemote(remote);
37
+ const baseForRemote = (root: string, remote: string): string | null => {
38
+ const repository = hostedGitInfo.fromUrl(remote);
75
39
 
76
- if (parts === null) {
40
+ if (repository === undefined || (repository.type !== "github" && repository.type !== "gitlab")) {
77
41
  return null;
78
42
  }
79
43
 
80
- const build = RAW_BASE_BY_HOST[parts.host];
81
-
82
- return build === undefined ? null : build(parts.owner, parts.repo, branch);
44
+ return trimTrailingSlash(
45
+ repository.file(readRepositoryPrefix(root), { committish: readDefaultBranch(root) }),
46
+ );
83
47
  };
84
48
 
85
49
  const resolveScreenshotBaseUrl = ({ root, deploy }: ScreenshotRequest): string | null => {
@@ -88,10 +52,8 @@ const resolveScreenshotBaseUrl = ({ root, deploy }: ScreenshotRequest): string |
88
52
  }
89
53
 
90
54
  const remote = gitRemoteUrl(root);
91
- const base = remote === null ? null : baseForRemote(remote, readDefaultBranch(root));
92
- const prefix = base === null ? "" : readRepositoryPrefix(root);
93
55
 
94
- return base === null || prefix.length === 0 ? base : `${base}/${prefix}`;
56
+ return remote === null ? null : baseForRemote(root, remote);
95
57
  };
96
58
 
97
59
  const urlForScreenshot = (file: string, baseUrl: string | null): string => {
@@ -9,12 +9,12 @@ type PnpmPin = {
9
9
  sha512: string;
10
10
  };
11
11
 
12
- const PNPM_VERSION = "11.22.0";
12
+ const PNPM_VERSION = "11.25.0";
13
13
  const PNPM_MAJOR = 11;
14
- const PNPM_MINOR = 22;
14
+ const PNPM_MINOR = 25;
15
15
 
16
- const PNPM_SHA512 = "1ff870c4c6133dfd88fb2afc46dd13d47f09c9794b438c6fdb47ca98caf3bc16381ee0be9" +
17
- "3a091b8e3824cf01f889f46d7d9e20910fb0be1ab0fb5baa80dd621";
16
+ const PNPM_SHA512 = "5cde925b4f075f725eb71fbae18a42ffe784524789f19b61c731cb8721ec28aaee160e01a" +
17
+ "8d5af4fedb2a42cdbf300efe23db356b0d4a17b4d63e11f8ab7c956";
18
18
 
19
19
  const PNPM_DIR = "flatpak-pnpm";
20
20
  const PNPM_COMMAND = "pnpm";
@@ -1,3 +1,4 @@
1
+ import { isPathInside, toPosixPath } from "@gtkx/utils";
1
2
  import { existsSync, readFileSync, realpathSync } from "node:fs";
2
3
  import { posix, relative, resolve } from "node:path";
3
4
  import type { DeployPayload, DeploySettings } from "../types.js";
@@ -11,7 +12,6 @@ import { executableModeFor } from "../payload/copy-tree.js";
11
12
  import { iconPathFor } from "../payload/icons.js";
12
13
  import { renderLauncher } from "../payload/launcher.js";
13
14
  import { licenseDestination, nodeLicenseDestination, NOTICES_FILENAME, noticesDestination } from "../payload/stage.js";
14
- import { isInside } from "../settings/paths.js";
15
15
  import { pnpmPathFor, type PnpmPin, pnpmSources } from "./flatpak-pnpm.js";
16
16
  import { DESTINATION, type FlatpakModule, postInstallCommands, validationCommands } from "./flatpak-prebuilt.js";
17
17
  import {
@@ -46,7 +46,7 @@ const inlineSource = (fileName: string, contents: string): FlatpakModule => ({
46
46
  });
47
47
 
48
48
  const projectRelative = (settings: DeploySettings, path: string): string =>
49
- relative(settings.paths.root, path).replaceAll("\\", "/");
49
+ toPosixPath(relative(settings.paths.root, path));
50
50
 
51
51
  const shellArgument = (value: string): string =>
52
52
  PLAIN_ARGUMENT.test(value) ? value : `'${value.split("'").join(QUOTE_ESCAPE)}'`;
@@ -155,7 +155,7 @@ const schemaInstallCommands = (settings: DeploySettings): string[] =>
155
155
  const iconInstallCommand = (settings: DeploySettings, source: string, rel: string): string =>
156
156
  installCommand(
157
157
  projectRelative(settings, source),
158
- `${DESTINATION}/share/icons/${shellArgument(rel.replaceAll("\\", "/"))}`,
158
+ `${DESTINATION}/share/icons/${shellArgument(toPosixPath(rel))}`,
159
159
  "m644",
160
160
  );
161
161
 
@@ -177,7 +177,7 @@ const assertInsideProject = (settings: DeploySettings, installed: InstalledFile)
177
177
  const { resolved } = installed;
178
178
  const target = existsSync(resolved) ? realpathSync(resolved) : resolved;
179
179
 
180
- if (isInside(settings.paths.root, target)) {
180
+ if (isPathInside(settings.paths.root, target)) {
181
181
  return;
182
182
  }
183
183
 
@@ -26,7 +26,7 @@ type GitRevision = {
26
26
  const GENERATED_SOURCES = "generated-sources.json";
27
27
  const COMMIT_PEEL = "^{commit}";
28
28
  const FETCHABLE_URL = /^https?:\/\//;
29
- const DEFAULT_NODE_EXTENSION = "org.freedesktop.Sdk.Extension.node24";
29
+ const DEFAULT_NODE_EXTENSION = "org.freedesktop.Sdk.Extension.node26";
30
30
  const NODE_EXTENSION_PREFIX = "org.freedesktop.Sdk.Extension.";
31
31
  const SDK_EXTENSION_ROOT = "/usr/lib/sdk";
32
32
 
@@ -1,5 +1,4 @@
1
1
  import { loadConfig } from "@gtkx/config";
2
- import { resolveFuture } from "@gtkx/config/internal";
3
2
  import { error } from "@gtkx/utils";
4
3
  import { resolve } from "node:path";
5
4
  import { DEV_ENTRY_ENV } from "./entry-env.js";
@@ -25,7 +24,7 @@ const main = async (): Promise<void> => {
25
24
 
26
25
  const { config, root } = await loadConfig(cwd, { mode: "development" });
27
26
  prepareDevLocaleDir(root, config.applicationId);
28
- prepareDevSchemaDir(root, resolveFuture(config.future).isResourceImported);
27
+ prepareDevSchemaDir(root);
29
28
  prepareDevIconDir(root, config.applicationId, config.applicationIcon);
30
29
  const entryPath = resolve(cwd, entryArg);
31
30
  const { defaultDevRunnerDeps } = await import("./runner-deps.js");
@@ -1,9 +1,7 @@
1
- import { resolveDataDir } from "../internal/data-dir.js";
2
1
  import { prependSchemaDir, stageAndCompileProjectSchemas } from "../settings/schema.js";
3
2
 
4
- const prepareDevSchemaDir = (root: string, isV2ResourceImports: boolean): string | null => {
5
- const dataDir = isV2ResourceImports ? null : resolveDataDir(root);
6
- const dir = stageAndCompileProjectSchemas(root, dataDir);
3
+ const prepareDevSchemaDir = (root: string): string | null => {
4
+ const dir = stageAndCompileProjectSchemas(root);
7
5
 
8
6
  if (dir === null) {
9
7
  return null;
@@ -1,3 +1,4 @@
1
+ import { isPathInside } from "@gtkx/utils";
1
2
  import {
2
3
  chmodSync,
3
4
  existsSync,
@@ -198,7 +199,7 @@ const isCatalogSource = (root: string, path: string): boolean => {
198
199
  const sourcePath = isAbsolute(path) ? resolve(path) : resolve(projectRoot, path);
199
200
  const poPath = relative(join(projectRoot, PO_DIRNAME), sourcePath);
200
201
 
201
- if (poPath === "" || poPath === ".." || poPath.startsWith(`..${sep}`) || isAbsolute(poPath)) {
202
+ if (!isPathInside(join(projectRoot, PO_DIRNAME), sourcePath)) {
202
203
  return false;
203
204
  }
204
205
 
@@ -1,3 +1,4 @@
1
+ import { toPosixPath } from "@gtkx/utils";
1
2
  import { join, relative } from "node:path";
2
3
  import type { CatalogProject } from "./catalogs.js";
3
4
 
@@ -14,7 +15,7 @@ const METADATA_TEMPLATE_DIRNAME = ".gtkx-metadata";
14
15
 
15
16
  const metadataTemplateFile = (project: CatalogProject, kind: MetadataTemplateKind): MetadataTemplateFile => {
16
17
  const path = join(project.poDir, METADATA_TEMPLATE_DIRNAME, `${project.domain}.template.${kind}`);
17
- const relativePath = relative(project.root, path).replaceAll("\\", "/");
18
+ const relativePath = toPosixPath(relative(project.root, path));
18
19
 
19
20
  return { kind, path, relativePath };
20
21
  };