Skip to content

refactor(scripts): migrate low-hanging JavaScript to TypeScript#4367

Open
cv wants to merge 2 commits into
mainfrom
refactor/migrate-low-hanging-js-to-ts
Open

refactor(scripts): migrate low-hanging JavaScript to TypeScript#4367
cv wants to merge 2 commits into
mainfrom
refactor/migrate-low-hanging-js-to-ts

Conversation

@cv
Copy link
Copy Markdown
Collaborator

@cv cv commented May 27, 2026

Summary

Migrates a small batch of low-hanging JavaScript files to TypeScript while leaving runtime-critical CommonJS entrypoints untouched. This reduces the non-dist JavaScript footprint and puts dev scripts and shim tests under the existing CLI TypeScript check.

Changes

  • Converted developer scripts to TypeScript: scripts/benchmark-sandbox-image-build.ts, scripts/dev-tier-selector.ts, and scripts/watch-fern-preview.ts.
  • Removed the obsolete scripts/convert-docs-to-fern.ts migration helper now that the Fern migration is complete.
  • Updated docs:preview:watch to run the TypeScript watcher with tsx, and hardened its Fern package version validation.
  • Converted the credentials shim and basic runner tests to TypeScript while preserving their existing assertions.
  • Added Biome coverage for the converted root TypeScript tests.
  • Reduced non-dist JavaScript-family files from 42 to 36.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Verification

  • npx prek run --all-files passes
  • npm test passes
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Carlos Villela cvillela@nvidia.com

Summary by CodeRabbit

  • Chores
    • Migrated build and development scripts to TypeScript for improved type safety and stricter validation.
    • Enhanced test suite infrastructure with updated import patterns and configuration tooling.
    • Updated internal documentation references in credential management module.

Review Change Stack

@cv cv self-assigned this May 27, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 27, 2026

📝 Walkthrough

Walkthrough

This PR modernizes build scripts and test infrastructure by converting multiple scripts from CommonJS/untyped JavaScript to typed TypeScript with enhanced validation and module loading patterns. Package.json, biome.json, and test files are updated to support TypeScript execution and improve type safety throughout the codebase.

Changes

Scripts and Tests TypeScript Modernization

Layer / File(s) Summary
Script runner update to tsx
package.json
The docs:preview:watch npm script switches from node scripts/watch-fern-preview.mjs to tsx scripts/watch-fern-preview.ts for TypeScript-native execution.
Fern preview watcher typing and validation
scripts/watch-fern-preview.ts
Shebang is removed; typed state variables for child processes and watchers are added; fern.config.json is parsed and validated with semver regex on version startup; error-guard helpers (NodeError, isNodeError, isIgnorableWatchError) gate error propagation; all helper functions receive explicit parameter and return type signatures.
Sandbox benchmark script TypeScript conversion
scripts/benchmark-sandbox-image-build.ts
Full conversion to typed TypeScript: type aliases for CLI/run/build-data shapes, requireValue helper for argument validation, typed option handling, and explicit signatures for worktree creation, docker build, formatting, and summary helpers while preserving core comparison logic.
Dev tier selector ESM and dependency stubbing
scripts/dev-tier-selector.ts
Converted to ESM using createRequire for node module imports; TypeScript types added for stubbed credential/runner/registry objects and UI/policy interfaces; async error handler now catches errors with explicit unknown type.
Test file imports, typing, and tooling configuration
test/credentials-shim.test.ts, test/runner-basic.test.ts, biome.json
credentials-shim loads credentials via createRequire with a CredentialsShim type for CREDS_DIR/CREDS_FILE access; runner-basic uses named import of runCapture with explicit unknown typing and readonly string[] cast; biome.json explicitly includes both test files in top-level and overrides configuration blocks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#1800: Updates TypeScript credentials and runner test files to load modules via createRequire and named imports, directly aligning with the test infrastructure changes in this PR.

Suggested labels

status: rfr

Suggested reviewers

  • ericksoa

Poem

🐰 Scripts now typed, with validation so keen,
TypeScript's strong guards catch what lurks unseen,
From CommonJS chains, we hop free at last,
ESM and createRequire build our future fast!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: migrating JavaScript scripts and tests to TypeScript, which aligns with the substantial refactoring across multiple script files and test files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/migrate-low-hanging-js-to-ts

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

E2E Advisor Recommendation

Required E2E: None
Optional E2E: None

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • None. No E2E is recommended. The only touched runtime/security file has a comment-only change, while the remaining changes are docs/developer tooling, lint/test inclusion, package script wiring for docs preview, and test file TypeScript conversions. These changes cannot affect installer/onboarding, sandbox lifecycle, credentials behavior, network policy, inference routing, deployment, or assistant user flows.

Optional E2E

  • None.

New E2E recommendations

  • None.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

E2E Scenario Advisor Recommendation

Required scenario E2E: None
Optional scenario E2E: None

Workflow run

Full scenario advisor summary

E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required scenario E2E

  • None. No scenario workflow, scenario metadata, scenario runtime, or validation-suite files changed.

Optional scenario E2E

  • None.

Relevant changed files

  • None.

@cv cv requested review from ericksoa and miyoungc May 27, 2026 23:03
@cv cv added the v0.0.55 Release target label May 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

PR Review Advisor

Findings: 0 needs attention, 1 worth checking, 0 nice ideas
Since last review: 3 prior items resolved, 0 still apply, 1 new item found

Review findings

🛠️ Needs attention

  • None.

🔎 Worth checking

  • PR scope says convert-docs-to-fern was converted, but the script is deleted (scripts/convert-docs-to-fern.mjs): The PR body lists `scripts/convert-docs-to-fern.ts` as a converted developer script, but the diff deletes `scripts/convert-docs-to-fern.mjs` and no replacement `scripts/convert-docs-to-fern.ts` exists. Repository search did not find remaining references, so deletion may be intentional, but the stated acceptance/scope does not match the patch.
    • Recommendation: Update the PR description to say the one-shot docs conversion script was removed, or add the intended TypeScript replacement if the script should still exist.
    • Evidence: Diff shows `scripts/convert-docs-to-fern.mjs` deleted with 341 removed lines and no added `scripts/convert-docs-to-fern.ts`; repository grep found no remaining `convert-docs-to-fern` references.

🌱 Nice ideas

  • None.
Since last review details

Current findings:

  • PR scope says convert-docs-to-fern was converted, but the script is deleted (scripts/convert-docs-to-fern.mjs): The PR body lists `scripts/convert-docs-to-fern.ts` as a converted developer script, but the diff deletes `scripts/convert-docs-to-fern.mjs` and no replacement `scripts/convert-docs-to-fern.ts` exists. Repository search did not find remaining references, so deletion may be intentional, but the stated acceptance/scope does not match the patch.
    • Recommendation: Update the PR description to say the one-shot docs conversion script was removed, or add the intended TypeScript replacement if the script should still exist.
    • Evidence: Diff shows `scripts/convert-docs-to-fern.mjs` deleted with 341 removed lines and no added `scripts/convert-docs-to-fern.ts`; repository grep found no remaining `convert-docs-to-fern` references.

Workflow run details

This is an automated advisory review. A human maintainer must make the final merge decision.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/benchmark-sandbox-image-build.ts`:
- Around line 41-47: The requireValue function currently treats tokens starting
with '-' as valid values, so when a flag is followed by another flag (e.g.,
--current-repo --cache) it should throw; update requireValue to check that the
captured value exists and does not start with '-' (or '--') and throw the same
Missing value error if it does. Apply the same validation wherever requireValue
is used (see the call sites around lines referenced) to ensure flag-shaped
tokens are rejected as option values.
- Around line 89-93: makeTempWorktree currently creates a temp dir
(worktreeRoot) then calls run("git", ["worktree", "add", ...]) and if that run
throws the temp dir is left behind; wrap the git call in a try/catch (or
try/finally) inside makeTempWorktree, and on any failure remove the created
directory (use fs.rmSync or fs.rmdirSync with recursive true for compatibility)
before rethrowing the error so the temp worktree is cleaned up; keep
worktreeRoot and the run(...) call names as the anchor points for the change.

In `@scripts/convert-docs-to-fern.ts`:
- Around line 89-93: The bug is that skillPriority can be undefined when nothing
is present, so the subsequent check (skillPriority !== "") still passes and
emits an empty skill.priority; fix by ensuring skillPriority is a true
empty-string fallback or by making the condition null-safe: set skillPriority =
firstPresent(nestedValue(metadata, "skill", "priority"),
metadata.skill_priority) ?? "" (or alternatively change the write condition to
check for null/undefined and emptiness, e.g. skillPriority != null &&
skillPriority !== "") so the exporter only writes skill.priority when a real
value exists; refer to the skillPriority variable, the firstPresent function,
nestedValue, and metadata.skill_priority to locate the code to change.

In `@scripts/watch-fern-preview.ts`:
- Around line 28-31: The current check allows whitespace-only versions because
it tests fernConfig.version without trimming; update the validation to trim the
value first and reject empty trimmed strings, then assign the trimmed result to
fernVersion so downstream uses (fernVersion and any construction like
`fern-api@${fernVersion}`) receive the cleaned value; specifically, replace the
validation of fernConfig.version with logic that computes const trimmedVersion =
fernConfig.version?.trim(), throws if typeof trimmedVersion !== "string" or
trimmedVersion.length === 0, and then set fernVersion = trimmedVersion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: fe8f6aa3-328b-41cd-a4c5-b3aa173795e2

📥 Commits

Reviewing files that changed from the base of the PR and between da3bb3a and 8f063d3.

📒 Files selected for processing (7)
  • package.json
  • scripts/benchmark-sandbox-image-build.ts
  • scripts/convert-docs-to-fern.ts
  • scripts/dev-tier-selector.ts
  • scripts/watch-fern-preview.ts
  • test/credentials-shim.test.ts
  • test/runner-basic.test.ts

Comment thread scripts/benchmark-sandbox-image-build.ts
Comment thread scripts/benchmark-sandbox-image-build.ts
Comment thread scripts/convert-docs-to-fern.ts Outdated
Comment thread scripts/watch-fern-preview.ts Outdated
Comment thread scripts/convert-docs-to-fern.ts Outdated
@@ -3,20 +3,42 @@

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cv we can remove this file entirely, as we're done with the Fern migration.

@cv
Copy link
Copy Markdown
Collaborator Author

cv commented May 27, 2026

Addressed the PR feedback in 4b68528:

  • Rejected flag-shaped values in the sandbox image benchmark arg parser.
  • Cleaned up the temporary worktree directory if git worktree add fails.
  • Removed the obsolete docs-to-Fern conversion helper per @miyoungc, so the skill.priority exporter comment is no longer applicable.
  • Trimmed and exact-semver validated the Fern preview package version before passing it to npx.
  • Added Biome coverage for the converted root TypeScript tests.
  • Replaced the stale credentials test filename reference with a durable comment.

Re-ran:

  • npm run typecheck:cli
  • targeted Vitest for the migrated tests
  • npx prek run --all-files
  • npm test

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
biome.json (1)

23-24: ⚡ Quick win

Prefer a test/**/*.ts glob over per-file test entries.

These explicit paths are easy to miss during future test additions. Using a TS glob in both include blocks keeps lint coverage consistent as more tests migrate.

Proposed diff
   "files": {
     "ignoreUnknown": true,
     "includes": [
@@
-      "test/credentials-shim.test.ts",
-      "test/runner-basic.test.ts",
+      "test/**/*.ts",
@@
   "overrides": [
     {
       "includes": [
@@
-        "test/credentials-shim.test.ts",
-        "test/runner-basic.test.ts",
+        "test/**/*.ts",

Also applies to: 100-101

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@biome.json` around lines 23 - 24, Replace the explicit test file entries
("test/credentials-shim.test.ts", "test/runner-basic.test.ts", and the other
per-file strings seen in the include arrays) with a single glob pattern
"test/**/*.ts" in both include blocks so new tests are picked up automatically;
locate the include arrays that currently list those filenames and update them to
the glob pattern to ensure consistent lint/test coverage as tests are added or
moved.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/watch-fern-preview.ts`:
- Around line 29-30: The semver test on trimmedFernVersion allows numeric
identifiers with leading zeros; replace the current regex used in the if test
with one that enforces numeric identifiers to be either "0" or non-zero-starting
(no leading zeros) for major/minor/patch and for numeric prerelease identifiers
(e.g., use a pattern that uses (?:0|[1-9]\d*) for numeric parts and applies that
rule inside the prerelease group), then throw the same Error when the tightened
regex test fails.

---

Nitpick comments:
In `@biome.json`:
- Around line 23-24: Replace the explicit test file entries
("test/credentials-shim.test.ts", "test/runner-basic.test.ts", and the other
per-file strings seen in the include arrays) with a single glob pattern
"test/**/*.ts" in both include blocks so new tests are picked up automatically;
locate the include arrays that currently list those filenames and update them to
the glob pattern to ensure consistent lint/test coverage as tests are added or
moved.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f6f210d4-0e0d-41b3-9f35-d65f313574fa

📥 Commits

Reviewing files that changed from the base of the PR and between 8f063d3 and 4b68528.

📒 Files selected for processing (4)
  • biome.json
  • scripts/benchmark-sandbox-image-build.ts
  • scripts/watch-fern-preview.ts
  • src/lib/credentials/store.ts
✅ Files skipped from review due to trivial changes (1)
  • src/lib/credentials/store.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/benchmark-sandbox-image-build.ts

Comment on lines +29 to +30
if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(trimmedFernVersion)) {
throw new Error("fern.config.json must contain an exact semver version");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

SemVer 2.0.0: are leading zeros allowed in MAJOR.MINOR.PATCH (e.g., 01.2.3)?

💡 Result:

No, leading zeros are not allowed in the MAJOR.MINOR.PATCH components of a version number under SemVer 2.0.0 [1][2]. The official Semantic Versioning 2.0.0 specification explicitly states: "A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes [1][3]." This rule ensures that version numbers are parsed and sorted consistently, as leading zeros can cause ambiguity in numerical comparisons [4]. Additionally, the specification applies the same restriction to numeric identifiers within pre-release versions, which also must not include leading zeros [1][4].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show SPDX + the semver validation area
nl -ba scripts/watch-fern-preview.ts | sed -n '1,80p'

# Extract the current regex line(s) for quick reference
rg -n "trimmedFernVersion|fern\.config\.json|semver" -n scripts/watch-fern-preview.ts

# Quick semver regex behavior check (no package deps)
node <<'NODE'
const current = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
const proposed = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-(?:0|[1-9]\d*|[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/
const cases = [
  "1.2.3",
  "01.2.3",
  "1.02.3",
  "1.2.03",
  "0.0.0",
  "1.2.3-alpha",
  "1.2.3-alpha.1",
  "1.2.3+build.1",
  "1.2.3-alpha.01", // prerelease numeric identifier with leading zero
  "1.2.3+01.2"      // build metadata leading zeros (SemVer allows in build identifiers)
];
for (const s of cases) {
  console.log(
    s.padEnd(16),
    "current=", current.test(s),
    "proposed=", proposed.test(s)
  );
}
NODE

Repository: NVIDIA/NemoClaw

Length of output: 102


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show top portion (including SPDX + nearby validation code)
sed -n '1,120p' scripts/watch-fern-preview.ts

# Locate the semver validation lines
rg -n "trimmedFernVersion|fern\.config\.json|\\^\\d+\\.\\d+\\.\\d+|semver" scripts/watch-fern-preview.ts

# Quick semver regex behavior check (no deps)
node <<'NODE'
const current = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
const proposed = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-(?:0|[1-9]\d*|[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/
const cases = [
  "1.2.3",
  "01.2.3",
  "1.02.3",
  "1.2.03",
  "0.0.0",
  "1.2.3-alpha",
  "1.2.3-alpha.1",
  "1.2.3+build.1",
  "1.2.3-alpha.01", // prerelease numeric identifier with leading zero
  "1.2.3+01.2"      // build metadata leading zeros (allowed in SemVer build identifiers)
];
for (const s of cases) {
  console.log(
    s.padEnd(16),
    "current=", current.test(s),
    "proposed=", proposed.test(s)
  );
}
NODE

Repository: NVIDIA/NemoClaw

Length of output: 4243


scripts/watch-fern-preview.ts: tighten semver regex to reject leading zeros in numeric identifiers

The current regex accepts non-SemVer numeric identifiers like 01.2.3 (and 1.2.3-alpha.01), while the thrown error says the file must contain an “exact semver version” (regex located at lines 29-30).

Suggested patch
-if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(trimmedFernVersion)) {
+if (
+  !/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-(?:0|[1-9]\d*|[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/.test(
+    trimmedFernVersion,
+  )
+) {
   throw new Error("fern.config.json must contain an exact semver version");
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(trimmedFernVersion)) {
throw new Error("fern.config.json must contain an exact semver version");
if (
!/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-(?:0|[1-9]\d*|[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/.test(
trimmedFernVersion,
)
) {
throw new Error("fern.config.json must contain an exact semver version");
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/watch-fern-preview.ts` around lines 29 - 30, The semver test on
trimmedFernVersion allows numeric identifiers with leading zeros; replace the
current regex used in the if test with one that enforces numeric identifiers to
be either "0" or non-zero-starting (no leading zeros) for major/minor/patch and
for numeric prerelease identifiers (e.g., use a pattern that uses (?:0|[1-9]\d*)
for numeric parts and applies that rule inside the prerelease group), then throw
the same Error when the tightened regex test fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v0.0.55 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants