@gjsify/cli 0.4.28 → 0.4.30

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 (82) hide show
  1. package/dist/cli.gjs.mjs +132 -132
  2. package/lib/actions/barrels-generate.js +1 -5
  3. package/lib/actions/build.d.ts +3 -3
  4. package/lib/actions/build.js +56 -64
  5. package/lib/bundler-pick.d.ts +3 -3
  6. package/lib/bundler-pick.js +5 -6
  7. package/lib/commands/build.d.ts +1 -1
  8. package/lib/commands/build.js +37 -31
  9. package/lib/commands/check.js +3 -3
  10. package/lib/commands/create.d.ts +1 -1
  11. package/lib/commands/dlx.d.ts +1 -1
  12. package/lib/commands/fix.js +33 -23
  13. package/lib/commands/flatpak/build.js +6 -2
  14. package/lib/commands/flatpak/check.js +9 -3
  15. package/lib/commands/flatpak/ci.js +1 -2
  16. package/lib/commands/flatpak/deps.js +1 -2
  17. package/lib/commands/flatpak/diff.js +2 -6
  18. package/lib/commands/flatpak/init.js +19 -19
  19. package/lib/commands/flatpak/release.js +2 -2
  20. package/lib/commands/flatpak/scaffold.js +3 -11
  21. package/lib/commands/flatpak/sync-flathub.js +5 -9
  22. package/lib/commands/flatpak/utils.js +1 -6
  23. package/lib/commands/foreach.d.ts +1 -1
  24. package/lib/commands/foreach.js +5 -14
  25. package/lib/commands/format.js +54 -41
  26. package/lib/commands/generate-installer.d.ts +1 -1
  27. package/lib/commands/gettext.d.ts +1 -1
  28. package/lib/commands/gettext.js +8 -15
  29. package/lib/commands/gresource.d.ts +1 -1
  30. package/lib/commands/gresource.js +8 -13
  31. package/lib/commands/gsettings.d.ts +1 -1
  32. package/lib/commands/gsettings.js +7 -8
  33. package/lib/commands/info.d.ts +1 -1
  34. package/lib/commands/install.d.ts +1 -1
  35. package/lib/commands/install.js +45 -13
  36. package/lib/commands/lint.d.ts +1 -1
  37. package/lib/commands/lint.js +22 -22
  38. package/lib/commands/pack.d.ts +1 -1
  39. package/lib/commands/pack.js +29 -17
  40. package/lib/commands/publish.d.ts +1 -1
  41. package/lib/commands/publish.js +17 -18
  42. package/lib/commands/run.d.ts +1 -1
  43. package/lib/commands/run.js +2 -6
  44. package/lib/commands/self-update.d.ts +1 -1
  45. package/lib/commands/self-update.js +1 -3
  46. package/lib/commands/showcase.d.ts +1 -1
  47. package/lib/commands/showcase.js +1 -1
  48. package/lib/commands/system-check.d.ts +1 -1
  49. package/lib/commands/system-check.js +8 -11
  50. package/lib/commands/test.js +12 -8
  51. package/lib/commands/uninstall.d.ts +1 -1
  52. package/lib/commands/uninstall.js +1 -3
  53. package/lib/commands/upgrade.d.ts +1 -1
  54. package/lib/commands/upgrade.js +109 -120
  55. package/lib/commands/workspace.d.ts +1 -1
  56. package/lib/commands/workspace.js +1 -3
  57. package/lib/config.js +18 -13
  58. package/lib/index.js +3 -1
  59. package/lib/templates/install.mjs.tmpl +20 -14
  60. package/lib/templates/oxfmtrc.tmpl +54 -0
  61. package/lib/templates/oxlintrc.json.tmpl +35 -0
  62. package/lib/types/command.d.ts +1 -1
  63. package/lib/types/config-data.d.ts +23 -13
  64. package/lib/types/cosmiconfig-result.d.ts +1 -1
  65. package/lib/utils/check-system-deps.js +10 -4
  66. package/lib/utils/detect-native-packages.js +1 -1
  67. package/lib/utils/dlx-cache.js +2 -7
  68. package/lib/utils/install-backend-native.d.ts +2 -2
  69. package/lib/utils/install-backend-native.js +112 -58
  70. package/lib/utils/install-backend.js +2 -1
  71. package/lib/utils/install-global.js +1 -3
  72. package/lib/utils/normalize-bundler-options.js +52 -17
  73. package/lib/utils/oxc-resolve.d.ts +63 -0
  74. package/lib/utils/oxc-resolve.js +264 -0
  75. package/lib/utils/pkg-json-edit.js +1 -6
  76. package/lib/utils/run-gjs.js +1 -4
  77. package/lib/utils/run-lifecycle-script.js +3 -7
  78. package/lib/utils/workspace-root.js +3 -1
  79. package/package.json +17 -17
  80. package/lib/templates/biome.json.tmpl +0 -79
  81. package/lib/utils/biome-resolve.d.ts +0 -47
  82. package/lib/utils/biome-resolve.js +0 -204
package/lib/config.js CHANGED
@@ -41,7 +41,10 @@ function merge(target, ...sources) {
41
41
  return target;
42
42
  }
43
43
  function isPlainObject(val) {
44
- return typeof val === 'object' && val !== null && !Array.isArray(val) && Object.getPrototypeOf(val) === Object.prototype;
44
+ return (typeof val === 'object' &&
45
+ val !== null &&
46
+ !Array.isArray(val) &&
47
+ Object.getPrototypeOf(val) === Object.prototype);
45
48
  }
46
49
  /**
47
50
  * Read a dotted path (`a.b.c`) from a plain object. Returns `undefined` for
@@ -85,13 +88,12 @@ export class Config {
85
88
  // package.json#gjsify exists.
86
89
  const fileExplorer = cosmiconfig(APP_NAME, {
87
90
  ...this.loadOptions,
88
- searchPlaces: (this.loadOptions.searchPlaces ?? defaultSearchPlaces(APP_NAME))
89
- .filter((p) => p !== 'package.json'),
91
+ searchPlaces: (this.loadOptions.searchPlaces ?? defaultSearchPlaces(APP_NAME)).filter((p) => p !== 'package.json'),
90
92
  });
91
- const fileResult = await fileExplorer.search(searchFrom);
93
+ const fileResult = (await fileExplorer.search(searchFrom));
92
94
  const merged = {};
93
95
  try {
94
- const pkg = await this.readPackageJSON(searchFrom);
96
+ const pkg = (await this.readPackageJSON(searchFrom));
95
97
  if (isPlainObject(pkg?.gjsify))
96
98
  merge(merged, pkg.gjsify);
97
99
  }
@@ -125,8 +127,8 @@ export class Config {
125
127
  const configFile = await this.load(process.cwd());
126
128
  const configData = { ...configFile.config };
127
129
  const configFilePath = configFile.filepath || process.cwd();
128
- const pkg = await this.readPackageJSON(configFilePath);
129
- const tsConfig = await this.readTSConfig(configFilePath);
130
+ const pkg = (await this.readPackageJSON(configFilePath));
131
+ const tsConfig = (await this.readTSConfig(configFilePath));
130
132
  tsConfig.reflection ||= cliArgs.reflection;
131
133
  // TODO replace with `cliArgs.logLevel`
132
134
  configData.verbose = cliArgs.verbose || false;
@@ -141,12 +143,15 @@ export class Config {
141
143
  const raw = Array.isArray(cliArgs.excludeGlobals)
142
144
  ? cliArgs.excludeGlobals.join(',')
143
145
  : String(cliArgs.excludeGlobals);
144
- const ids = raw.split(',').map((s) => s.trim()).filter(Boolean);
146
+ const ids = raw
147
+ .split(',')
148
+ .map((s) => s.trim())
149
+ .filter(Boolean);
145
150
  if (ids.length)
146
151
  configData.excludeGlobals = [...(configData.excludeGlobals ?? []), ...ids];
147
152
  }
148
- merge(configData.library ??= {}, pkg, configData.library);
149
- merge(configData.typescript ??= {}, tsConfig, configData.typescript);
153
+ merge((configData.library ??= {}), pkg, configData.library);
154
+ merge((configData.typescript ??= {}), tsConfig, configData.typescript);
150
155
  // Parse `KEY=VALUE` style flags into Record<string, string>.
151
156
  // - `--define`: VALUE is a JS expression (string literals must be
152
157
  // pre-quoted by the caller, e.g. `'"1.2.3"'`).
@@ -170,7 +175,7 @@ export class Config {
170
175
  const defineMap = parseKvPairs(cliArgs.define ?? [], 'define');
171
176
  const aliasMap = parseKvPairs(cliArgs.alias ?? [], 'alias');
172
177
  if (Object.keys(aliasMap).length) {
173
- configData.aliases = { ...(configData.aliases ?? {}), ...aliasMap };
178
+ configData.aliases = { ...configData.aliases, ...aliasMap };
174
179
  }
175
180
  // Resolve `defineFromPackageJson` / `defineFromEnv` into raw
176
181
  // KEY=<JSON-stringified value> entries that get merged into the
@@ -289,14 +294,14 @@ export class Config {
289
294
  // CLI --define wins over package.json/env (manual overrides during
290
295
  // debugging beat declarative config).
291
296
  transform.define = {
292
- ...(transform.define ?? {}),
297
+ ...transform.define,
293
298
  ...fromPkgDefines,
294
299
  ...fromEnvDefines,
295
300
  ...defineMap,
296
301
  };
297
302
  }
298
303
  if (configData.verbose)
299
- console.debug("configData", configData);
304
+ console.debug('configData', configData);
300
305
  return configData;
301
306
  }
302
307
  }
package/lib/index.js CHANGED
@@ -18,7 +18,9 @@ function runtimeLabel() {
18
18
  return `GJS ${Math.floor(v / 10000)}.${Math.floor((v % 10000) / 100)}.${v % 100} (SpiderMonkey)`;
19
19
  }
20
20
  }
21
- catch { /* not GJS */ }
21
+ catch {
22
+ /* not GJS */
23
+ }
22
24
  if (typeof process !== 'undefined' && typeof process.versions?.node === 'string') {
23
25
  return `Node.js ${process.version}`;
24
26
  }
@@ -45,14 +45,17 @@ Gio._promisify(Gio.Subprocess.prototype, 'wait_check_async');
45
45
  // Substituted by `gjsify generate-installer` for end-user apps.
46
46
  const DEFAULT_TARGET = '@gjsify/cli';
47
47
  const DEFAULT_BIN_NAME = 'gjsify';
48
- const DEFAULT_BOOTSTRAP_URL =
49
- 'https://github.com/gjsify/gjsify/releases/latest/download/cli.gjs.mjs';
48
+ const DEFAULT_BOOTSTRAP_URL = 'https://github.com/gjsify/gjsify/releases/latest/download/cli.gjs.mjs';
50
49
  const DEFAULT_BOOTSTRAP_SHA256_URL = `${DEFAULT_BOOTSTRAP_URL}.sha256`;
51
50
 
52
51
  const USER_AGENT = 'gjsify-installer/1.0';
53
52
 
54
- function info(msg) { print(`[gjsify] ${msg}`); }
55
- function error(msg) { printerr(`[gjsify] ERROR: ${msg}`); }
53
+ function info(msg) {
54
+ print(`[gjsify] ${msg}`);
55
+ }
56
+ function error(msg) {
57
+ printerr(`[gjsify] ERROR: ${msg}`);
58
+ }
56
59
 
57
60
  function parseArgs() {
58
61
  const argv = system?.programArgs ?? [];
@@ -63,9 +66,8 @@ function parseArgs() {
63
66
  let bootstrapUrl = GLib.getenv('GJSIFY_INSTALL_BOOTSTRAP_URL') || DEFAULT_BOOTSTRAP_URL;
64
67
  let bootstrapSha256Url = GLib.getenv('GJSIFY_INSTALL_BOOTSTRAP_SHA256_URL');
65
68
  if (bootstrapSha256Url === null || bootstrapSha256Url === undefined) {
66
- bootstrapSha256Url = bootstrapUrl === DEFAULT_BOOTSTRAP_URL
67
- ? DEFAULT_BOOTSTRAP_SHA256_URL
68
- : `${bootstrapUrl}.sha256`;
69
+ bootstrapSha256Url =
70
+ bootstrapUrl === DEFAULT_BOOTSTRAP_URL ? DEFAULT_BOOTSTRAP_SHA256_URL : `${bootstrapUrl}.sha256`;
69
71
  }
70
72
  for (let i = 0; i < argv.length; i++) {
71
73
  const a = argv[i];
@@ -154,8 +156,7 @@ function sha256Hex(bytes) {
154
156
  function cacheDir() {
155
157
  const override = GLib.getenv('GJSIFY_INSTALL_BOOTSTRAP_CACHE');
156
158
  if (override) return override;
157
- const xdg = GLib.getenv('XDG_CACHE_HOME') ||
158
- GLib.build_filenamev([GLib.get_home_dir(), '.cache']);
159
+ const xdg = GLib.getenv('XDG_CACHE_HOME') || GLib.build_filenamev([GLib.get_home_dir(), '.cache']);
159
160
  return GLib.build_filenamev([xdg, 'gjsify', 'bootstrap']);
160
161
  }
161
162
 
@@ -164,9 +165,7 @@ function ensureDir(dir) {
164
165
  }
165
166
 
166
167
  function writeBytes(path, bytes) {
167
- Gio.File.new_for_path(path).replace_contents(
168
- bytes, null, false, Gio.FileCreateFlags.REPLACE_DESTINATION, null,
169
- );
168
+ Gio.File.new_for_path(path).replace_contents(bytes, null, false, Gio.FileCreateFlags.REPLACE_DESTINATION, null);
170
169
  }
171
170
 
172
171
  async function downloadBootstrap(session, bootstrapUrl, sha256Url) {
@@ -190,7 +189,11 @@ async function downloadBootstrap(session, bootstrapUrl, sha256Url) {
190
189
  }
191
190
  }
192
191
  const dir = cacheDir();
193
- try { ensureDir(dir); } catch { /* exists */ }
192
+ try {
193
+ ensureDir(dir);
194
+ } catch {
195
+ /* exists */
196
+ }
194
197
  const bundlePath = GLib.build_filenamev([dir, 'cli.gjs.mjs']);
195
198
  writeBytes(bundlePath, bundleBytes);
196
199
  info(`Bootstrap cached at ${bundlePath} (${bundleBytes.length} bytes)`);
@@ -220,7 +223,10 @@ async function runInstall(bundlePath, spec) {
220
223
 
221
224
  async function main() {
222
225
  const opts = parseArgs();
223
- if (opts.help) { printUsage(); exit(0); }
226
+ if (opts.help) {
227
+ printUsage();
228
+ exit(0);
229
+ }
224
230
  checkGjsVersion();
225
231
 
226
232
  const session = new Soup.Session();
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "./node_modules/oxfmt/configuration_schema.json",
3
+ "useTabs": false,
4
+ "tabWidth": 4,
5
+ "printWidth": 120,
6
+ "singleQuote": true,
7
+ "jsxSingleQuote": false,
8
+ "quoteProps": "as-needed",
9
+ "trailingComma": "all",
10
+ "semi": true,
11
+ "arrowParens": "always",
12
+ "bracketSameLine": false,
13
+ "bracketSpacing": true,
14
+ "ignorePatterns": [
15
+ "**/*.json",
16
+ "**/*.jsonc",
17
+ "**/*.json5",
18
+ "**/*.css",
19
+ "**/*.scss",
20
+ "**/*.sass",
21
+ "**/*.less",
22
+ "**/*.html",
23
+ "**/*.htm",
24
+ "**/*.md",
25
+ "**/*.mdx",
26
+ "**/*.yml",
27
+ "**/*.yaml",
28
+ "**/*.vue",
29
+ "**/*.svelte",
30
+ "**/*.toml",
31
+ "**/*.graphql",
32
+ "**/*.gql",
33
+ "**/node_modules",
34
+ "**/dist",
35
+ "**/lib",
36
+ "**/build",
37
+ "**/build-dir",
38
+ "**/builddir",
39
+ "**/flatpak-build",
40
+ "**/.flatpak-builder",
41
+ "**/repo",
42
+ "**/coverage",
43
+ "**/refs",
44
+ "**/@types",
45
+ "**/templates",
46
+ "**/prebuilds",
47
+ "**/cli.gjs.mjs",
48
+ "**/test.gjs.mjs",
49
+ "**/test.node.mjs",
50
+ "**/*.gresource",
51
+ "**/*.compiled",
52
+ "**/*.metainfo.xml"
53
+ ]
54
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
3
+ "categories": {
4
+ "correctness": "error"
5
+ },
6
+ "rules": {
7
+ "typescript/consistent-type-imports": "warn",
8
+ "typescript/no-explicit-any": "warn",
9
+ "typescript/no-non-null-assertion": "off",
10
+ "unicorn/prefer-node-protocol": "error",
11
+ "eslint/no-unused-vars": "warn"
12
+ },
13
+ "ignorePatterns": [
14
+ "**/node_modules",
15
+ "**/dist",
16
+ "**/lib",
17
+ "**/build",
18
+ "**/build-dir",
19
+ "**/builddir",
20
+ "**/flatpak-build",
21
+ "**/.flatpak-builder",
22
+ "**/repo",
23
+ "**/coverage",
24
+ "**/refs",
25
+ "**/@types",
26
+ "**/templates",
27
+ "**/prebuilds",
28
+ "**/cli.gjs.mjs",
29
+ "**/test.gjs.mjs",
30
+ "**/test.node.mjs",
31
+ "**/*.gresource",
32
+ "**/*.compiled",
33
+ "**/*.metainfo.xml"
34
+ ]
35
+ }
@@ -1,5 +1,5 @@
1
1
  import type { ArgumentsCamelCase, MiddlewareFunction, BuilderCallback } from 'yargs';
2
- export interface Command<T = any, U = T> {
2
+ export interface Command<T = unknown, U = T> {
3
3
  command: string | ReadonlyArray<string>;
4
4
  description: string;
5
5
  builder?: BuilderCallback<T, U>;
@@ -165,20 +165,30 @@ export interface ConfigData {
165
165
  }>;
166
166
  /**
167
167
  * Extension → loader-kind map for files Rolldown does not classify
168
- * natively. Currently only `'text'` is implemented — the file's content
169
- * becomes the JS string default export (`export default "<content>"`).
170
- * Replaces the legacy esbuild `loader: { '.ui': 'text' }` pattern.
168
+ * natively. Replaces the legacy esbuild `loader: { '.ui': 'text', '.png': 'dataurl' }`
169
+ * pattern.
170
+ *
171
+ * Loader kinds:
172
+ * `'text'` — file contents as a JS string default export
173
+ * (`export default "<source>"`). Good for GLSL shaders,
174
+ * `.ui` GtkBuilder XML, `.asm`, etc.
175
+ * `'dataurl'` — `data:<mime>;base64,<b64>` string default export.
176
+ * MIME is inferred from the extension (.png → image/png,
177
+ * .jpg → image/jpeg, .gif → image/gif, .svg → image/svg+xml,
178
+ * .webp → image/webp, fallback application/octet-stream).
179
+ * Good for Excalibur's `ImageSource` and any library that
180
+ * accepts a data: URL rather than a separate asset file.
171
181
  *
172
182
  * Example:
173
183
  * ```jsonc
174
- * "loaders": { ".ui": "text", ".asm": "text" }
184
+ * "loaders": { ".ui": "text", ".glsl": "text", ".png": "dataurl" }
175
185
  * ```
176
186
  *
177
187
  * Lives at the top level (not under `bundler`) so it doesn't leak into
178
- * Rolldown's options on pass-through; the CLI converts it into a
179
- * `text-loader` plugin prepended to the bundler's plugin chain.
188
+ * Rolldown's options on pass-through; the CLI converts it into a plugin
189
+ * prepended to the bundler's plugin chain.
180
190
  */
181
- loaders?: Record<string, 'text'>;
191
+ loaders?: Record<string, 'text' | 'dataurl'>;
182
192
  /**
183
193
  * Flatpak-related configuration consumed by `gjsify flatpak <sub>`.
184
194
  * Lives in its own top-level namespace so the bundler config doesn't
@@ -188,8 +198,8 @@ export interface ConfigData {
188
198
  flatpak?: ConfigDataFlatpak;
189
199
  /**
190
200
  * Format/lint config consumed by `gjsify format` / `gjsify lint` /
191
- * `gjsify fix`. Thin shell — Biome's own `biome.json` is the real
192
- * configuration file; we only need a pointer here.
201
+ * `gjsify fix`. Thin shell — oxc's own `.oxfmtrc.json` / `.oxlintrc.json`
202
+ * are the real configuration files; we only need a pointer here.
193
203
  */
194
204
  format?: ConfigDataFormat;
195
205
  /**
@@ -198,12 +208,12 @@ export interface ConfigData {
198
208
  */
199
209
  test?: ConfigDataTest;
200
210
  }
201
- /** Optional pointer to a non-default biome.json. */
211
+ /** Optional pointer to a non-default oxc config file. */
202
212
  export interface ConfigDataFormat {
203
213
  /**
204
- * Path to biome.json. Default: walks up from cwd to find one;
205
- * falls back to the recommended template shipped with `gjsify`
206
- * (writable via `gjsify format --init`).
214
+ * Path to an `.oxfmtrc.json` / `.oxlintrc.json`. Default: walks up from
215
+ * cwd to find one; falls back to the recommended templates shipped with
216
+ * `gjsify` (writable via `gjsify format --init`).
207
217
  */
208
218
  configPath?: string;
209
219
  }
@@ -1,4 +1,4 @@
1
- export type CosmiconfigResult<C = any> = {
1
+ export type CosmiconfigResult<C = unknown> = {
2
2
  config: C;
3
3
  filepath: string;
4
4
  isEmpty?: boolean;
@@ -29,7 +29,7 @@ function checkBinary(id, name, binary, versionArgs, severity, parseVersion, requ
29
29
  const out = tryExecFile(binary, versionArgs);
30
30
  if (out === null)
31
31
  return { id, name, found: false, severity, requiredBy };
32
- const version = parseVersion ? parseVersion(out) : out.split('\n')[0] ?? out;
32
+ const version = parseVersion ? parseVersion(out) : (out.split('\n')[0] ?? out);
33
33
  return { id, name, found: true, version, severity, requiredBy };
34
34
  }
35
35
  /** Check a pkg-config library. pkg-config --modversion returns version on stdout. */
@@ -51,7 +51,9 @@ function checkNpmPackage(id, name, packageName, cwd, severity, requiredBy) {
51
51
  requireFromCwd.resolve(packageName);
52
52
  return { id, name, found: true, severity, requiredBy };
53
53
  }
54
- catch { /* not in project, try CLI fallback */ }
54
+ catch {
55
+ /* not in project, try CLI fallback */
56
+ }
55
57
  // 2. Fallback: CLI's own node_modules
56
58
  try {
57
59
  const requireFromCli = createRequire(import.meta.url);
@@ -156,7 +158,9 @@ function discoverGjsifyPackages(cwd) {
156
158
  try {
157
159
  topPkg = JSON.parse(readFileSync(pkgJsonPath, 'utf-8'));
158
160
  }
159
- catch { /* ignore */ }
161
+ catch {
162
+ /* ignore */
163
+ }
160
164
  const directDeps = {
161
165
  ...topPkg.dependencies,
162
166
  ...topPkg.devDependencies,
@@ -169,7 +173,9 @@ function discoverGjsifyPackages(cwd) {
169
173
  }
170
174
  }
171
175
  }
172
- catch { /* ignore */ }
176
+ catch {
177
+ /* ignore */
178
+ }
173
179
  // Also include direct deps even if node_modules walk failed
174
180
  for (const dep of Object.keys(directDeps)) {
175
181
  if (dep.startsWith('@gjsify/'))
@@ -131,7 +131,7 @@ export function detectNativePackages(startDir) {
131
131
  * Prepends the new paths to any existing values from the environment.
132
132
  */
133
133
  export function buildNativeEnv(packages) {
134
- const dirs = packages.map(p => p.prebuildsDir);
134
+ const dirs = packages.map((p) => p.prebuildsDir);
135
135
  const existing_ld = process.env['LD_LIBRARY_PATH'] ?? '';
136
136
  const existing_gi = process.env['GI_TYPELIB_PATH'] ?? '';
137
137
  const LD_LIBRARY_PATH = [...dirs, ...(existing_ld ? [existing_ld] : [])].join(':');
@@ -84,13 +84,8 @@ export function symlinkSwap(cacheDir, prepareDir) {
84
84
  const linkPath = join(cacheDir, 'pkg');
85
85
  const tmpName = `pkg.tmp-${Date.now().toString(16)}-${process.pid.toString(16)}`;
86
86
  const tmpLink = join(cacheDir, tmpName);
87
- try {
88
- symlinkSync(prepareDir, tmpLink, 'dir');
89
- }
90
- catch (err) {
91
- // If we cannot even create the tmp link, give up.
92
- throw err;
93
- }
87
+ // If we cannot even create the tmp link, give up (the error propagates).
88
+ symlinkSync(prepareDir, tmpLink, 'dir');
94
89
  try {
95
90
  renameSync(tmpLink, linkPath);
96
91
  }
@@ -1,5 +1,5 @@
1
- import { type Packument } from "@gjsify/npm-registry";
2
- import type { InstallOptions } from "./install-backend.ts";
1
+ import { type Packument } from '@gjsify/npm-registry';
2
+ import type { InstallOptions } from './install-backend.ts';
3
3
  interface ParsedSpec {
4
4
  name: string;
5
5
  range: string;