Skip to content

Commit 5787e8e

Browse files
committed
Fix npm install by requiring the linux payload
The 0.129.10 meta package put the only published linux-x64 native payload in optionalDependencies. Some global installs can leave that optional alias missing, which makes the launcher fail before it can find the native codex binary. When the release script is explicitly constrained to a platform payload, emit a hard dependency instead. Keep the default multi-platform path optional so full platform builds can still skip incompatible native packages. Also bump the release version to 0.129.11 for the npm recovery publish.
1 parent 908402a commit 5787e8e

4 files changed

Lines changed: 126 additions & 117 deletions

File tree

codex-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@leonw24/open-codex",
3-
"version": "0.129.10",
3+
"version": "0.129.11",
44
"license": "Apache-2.0",
55
"bin": {
66
"open-codex": "bin/codex.js"

codex-cli/scripts/build_npm_package.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ def platform_packages_for_meta() -> list[str]:
116116
return packages
117117

118118

119+
def platform_dependencies_are_required() -> bool:
120+
return bool(os.environ.get("CODEX_NPM_PLATFORM_PACKAGES"))
121+
122+
119123
def parse_args() -> argparse.Namespace:
120124
parser = argparse.ArgumentParser(description="Build or stage the Codex CLI npm package.")
121125
parser.add_argument(
@@ -335,7 +339,12 @@ def stage_sources(staging_dir: Path, version: str, package: str) -> None:
335339

336340
if package == "codex":
337341
package_json["files"] = ["bin"]
338-
package_json["optionalDependencies"] = {
342+
dependency_key = (
343+
"dependencies"
344+
if platform_dependencies_are_required()
345+
else "optionalDependencies"
346+
)
347+
package_json[dependency_key] = {
339348
CODEX_PLATFORM_PACKAGES[platform_package]["npm_name"]: (
340349
f"npm:{CODEX_NPM_NAME}@"
341350
f"{compute_platform_package_version(version, CODEX_PLATFORM_PACKAGES[platform_package]['npm_tag'])}"

0 commit comments

Comments
 (0)