pmsec 0.13.0 → 0.14.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmsec",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/tools/bun.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { bunConfigPath } from "../util/paths.mjs";
2
2
  import { readSafe, writeAtomic } from "../util/io.mjs";
3
3
  import { readKey, setKey, removeKey } from "../util/lines.mjs";
4
+ import { readExtras, applyExtras, removeExtras } from "../util/extras.mjs";
4
5
  import { buildPreflight } from "../util/version.mjs";
5
6
 
6
7
  export const name = "bun";
@@ -8,7 +9,9 @@ export const key = "minimumReleaseAge";
8
9
  export const section = "install";
9
10
  export const docs = "https://bun.com/docs/runtime/bunfig#install";
10
11
  export const minBin = [1, 3, 0];
11
- export const extras = [];
12
+ export const extras = [
13
+ { key: "ignoreScripts", expected: "true", line: "ignoreScripts = true", section },
14
+ ];
12
15
 
13
16
  export function path(ctx) { return bunConfigPath(ctx.env, ctx.home); }
14
17
 
@@ -20,12 +23,17 @@ export async function read(ctx) {
20
23
  const raw = await readSafe(p);
21
24
  const value = readKey(raw, key, { section });
22
25
  const seconds = value === null ? null : Number(value);
23
- return { path: p, configured: value, days: seconds === null || Number.isNaN(seconds) ? null : Math.floor(seconds / 86400), extras: [] };
26
+ return {
27
+ path: p, configured: value,
28
+ days: seconds === null || Number.isNaN(seconds) ? null : Math.floor(seconds / 86400),
29
+ extras: readExtras(raw, extras),
30
+ };
24
31
  }
25
32
 
26
33
  export async function write(days, ctx) {
27
34
  const p = path(ctx);
28
- const text = setKey(await readSafe(p), key, `${key} = ${days * 86400}`, { section });
35
+ let text = setKey(await readSafe(p), key, `${key} = ${days * 86400}`, { section });
36
+ text = applyExtras(text, extras);
29
37
  await writeAtomic(p, text);
30
38
  return { path: p };
31
39
  }
@@ -33,7 +41,9 @@ export async function write(days, ctx) {
33
41
  export async function unset(ctx) {
34
42
  const p = path(ctx);
35
43
  const before = await readSafe(p);
36
- const { text: after, removed } = removeKey(before, key, { section });
37
- if (removed) await writeAtomic(p, after);
44
+ const cooldown = removeKey(before, key, { section });
45
+ const ex = removeExtras(cooldown.text, extras);
46
+ const removed = cooldown.removed || ex.removed;
47
+ if (removed) await writeAtomic(p, ex.text);
38
48
  return { path: p, removed };
39
49
  }
@@ -9,7 +9,8 @@ export const section = "settings";
9
9
  export const docs = "https://mise.jdx.dev/configuration/settings.html#minimum_release_age";
10
10
  export const minBin = [2026, 4, 22];
11
11
  export const extras = [
12
- { key: "paranoid", expected: "true", line: "paranoid = true", section }
12
+ { key: "paranoid", expected: "true", line: "paranoid = true", section },
13
+ { key: "gpg_verify", expected: "true", line: "gpg_verify = true", section },
13
14
  ];
14
15
 
15
16
  export function path(ctx) { return miseConfigPath(ctx.env, ctx.home, ctx.platform); }
package/src/tools/npm.mjs CHANGED
@@ -11,7 +11,9 @@ export const minBin = [11, 10, 0];
11
11
  export const extras = [
12
12
  { key: "audit-level", expected: "high", line: "audit-level=high" },
13
13
  { key: "allow-git", expected: "root", line: "allow-git=root" },
14
- { key: "allow-remote", expected: "root", line: "allow-remote=root" }
14
+ { key: "allow-remote", expected: "root", line: "allow-remote=root" },
15
+ { key: "allow-file", expected: "root", line: "allow-file=root" },
16
+ { key: "allow-directory", expected: "root", line: "allow-directory=root" },
15
17
  ];
16
18
 
17
19
  export function path(ctx) { return npmrcPath(ctx.env, ctx.home); }
package/src/tools/uv.mjs CHANGED
@@ -1,13 +1,16 @@
1
1
  import { uvConfigPath } from "../util/paths.mjs";
2
2
  import { readSafe, writeAtomic } from "../util/io.mjs";
3
3
  import { readKey, setKey, removeKey } from "../util/lines.mjs";
4
+ import { readExtras, applyExtras, removeExtras } from "../util/extras.mjs";
4
5
  import { buildPreflight } from "../util/version.mjs";
5
6
 
6
7
  export const name = "uv";
7
8
  export const key = "exclude-newer";
8
9
  export const docs = "https://docs.astral.sh/uv/reference/settings/#exclude-newer";
9
10
  export const minBin = [0, 9, 17];
10
- export const extras = [];
11
+ export const extras = [
12
+ { key: "index-strategy", expected: '"first-index"', line: 'index-strategy = "first-index"' },
13
+ ];
11
14
 
12
15
  export function path(ctx) { return uvConfigPath(ctx.env, ctx.home, ctx.platform); }
13
16
 
@@ -26,12 +29,13 @@ export async function read(ctx) {
26
29
  const p = path(ctx);
27
30
  const raw = await readSafe(p);
28
31
  const value = readKey(raw, key);
29
- return { path: p, configured: value, days: parseDays(value), extras: [] };
32
+ return { path: p, configured: value, days: parseDays(value), extras: readExtras(raw, extras) };
30
33
  }
31
34
 
32
35
  export async function write(days, ctx) {
33
36
  const p = path(ctx);
34
- const text = setKey(await readSafe(p), key, `${key} = "${days} days"`);
37
+ let text = setKey(await readSafe(p), key, `${key} = "${days} days"`);
38
+ text = applyExtras(text, extras);
35
39
  await writeAtomic(p, text);
36
40
  return { path: p };
37
41
  }
@@ -39,7 +43,9 @@ export async function write(days, ctx) {
39
43
  export async function unset(ctx) {
40
44
  const p = path(ctx);
41
45
  const before = await readSafe(p);
42
- const { text: after, removed } = removeKey(before, key);
43
- if (removed) await writeAtomic(p, after);
46
+ const cooldown = removeKey(before, key);
47
+ const ex = removeExtras(cooldown.text, extras);
48
+ const removed = cooldown.removed || ex.removed;
49
+ if (removed) await writeAtomic(p, ex.text);
44
50
  return { path: p, removed };
45
51
  }