codex-wrapped-noyrlimit 1.0.0 → 1.0.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.
@@ -2,12 +2,12 @@
2
2
 
3
3
  import { spawnSync } from "node:child_process";
4
4
  import fs from "node:fs";
5
- import { dirname, join } from "node:path";
6
- import { platform as osPlatform, arch as osArch } from "node:os";
5
+ import path from "node:path";
6
+ import os from "node:os";
7
7
  import { fileURLToPath } from "node:url";
8
8
 
9
9
  const __filename = fileURLToPath(import.meta.url);
10
- const __dirname = dirname(__filename);
10
+ const __dirname = path.dirname(__filename);
11
11
 
12
12
  function run(target) {
13
13
  const result = spawnSync(target, process.argv.slice(2), {
@@ -31,34 +31,36 @@ const archMap = {
31
31
  arm64: "arm64",
32
32
  };
33
33
 
34
- let platform = platformMap[osPlatform()];
34
+ let platform = platformMap[os.platform()];
35
35
  if (!platform) {
36
- platform = osPlatform();
36
+ platform = os.platform();
37
37
  }
38
- let arch = archMap[osArch()];
38
+ let arch = archMap[os.arch()];
39
39
  if (!arch) {
40
- arch = osArch();
40
+ arch = os.arch();
41
41
  }
42
+
42
43
  const base = "codex-wrapped-noyrlimit-" + platform + "-" + arch;
43
- const binary = platform === "windows" ? "codex-wrapped-noyrlimit.exe" : "codex-wrapped-noyrlimit";
44
+ const binary =
45
+ platform === "windows" ? "codex-wrapped-noyrlimit.exe" : "codex-wrapped-noyrlimit";
44
46
 
45
47
  function findBinary(startDir) {
46
48
  let current = startDir;
47
49
  for (;;) {
48
- const modules = join(current, "node_modules");
50
+ const modules = path.join(current, "node_modules");
49
51
  if (fs.existsSync(modules)) {
50
52
  const entries = fs.readdirSync(modules);
51
53
  for (const entry of entries) {
52
54
  if (!entry.startsWith(base)) {
53
55
  continue;
54
56
  }
55
- const candidate = join(modules, entry, "bin", binary);
57
+ const candidate = path.join(modules, entry, "bin", binary);
56
58
  if (fs.existsSync(candidate)) {
57
59
  return candidate;
58
60
  }
59
61
  }
60
62
  }
61
- const parent = dirname(current);
63
+ const parent = path.dirname(current);
62
64
  if (parent === current) {
63
65
  return;
64
66
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "codex-wrapped-noyrlimit",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Generate a personalized Spotify Wrapped-style summary of your Codex usage",
5
5
  "bin": {
6
- "codex-wrapped-noyrlimit": "bin/codex-wrapped-noyrlimit"
6
+ "codex-wrapped-noyrlimit": "bin/codex-wrapped-noyrlimit.mjs"
7
7
  },
8
8
  "scripts": {
9
9
  "postinstall": "node ./postinstall.mjs"