Skip to content

Conversation

@lukeocodes
Copy link
Contributor

Proposed changes

First wave of generated changes pre-configuration using Fern. Work to do.

Types of changes

What types of changes does your code introduce to the community JavaScript SDK?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update or tests (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • I have lint'ed all of my code using repo standards
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 25, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch next-v5

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Comment on lines +7 to +19
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up node
uses: actions/setup-node@v3

- name: Compile
run: yarn && yarn build

test:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 14 days ago

To fix the problem, add an explicit permissions block to the workflow file to specify the minimum required permissions for the GITHUB_TOKEN. Since none of the jobs shown adds/updates any repository data (issues, PRs, contents, etc.), only contents: read is needed. The best and simplest way is to add a permissions: block at the root of the workflow, so it applies to all jobs unless overridden.

Where to change:
Edit the start of .github/workflows/ci.yml, after the name and before or after the on: block (YAML allows both positions, but commonly put after name: and before on: for clarity).

What else is needed:
No methods, imports, or definitions are needed. Only the new YAML block is inserted.


Suggested changeset 1
.github/workflows/ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,4 +1,6 @@
 name: ci
+permissions:
+  contents: read
 
 on: [push]
 
EOF
@@ -1,4 +1,6 @@
name: ci
permissions:
contents: read

on: [push]

Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +20 to +30
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up node
uses: actions/setup-node@v3

- name: Compile
run: yarn && yarn test

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 14 days ago

The best way to address this issue is to add a permissions block either to the root level of the workflow file (so it applies to all jobs), or to each job individually. Since neither job requires write access — only source code checkout and typical compile/test steps are performed — the minimal required permission is contents: read. To fix, add a permissions block at the root of .github/workflows/ci.yml (e.g., after the name: or on: block, before jobs:). No changes are needed elsewhere. The fix is a single YAML block addition.


Suggested changeset 1
.github/workflows/ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -2,6 +2,9 @@
 
 on: [push]
 
+permissions:
+  contents: read
+
 jobs:
   compile:
     runs-on: ubuntu-latest
EOF
@@ -2,6 +2,9 @@

on: [push]

permissions:
contents: read

jobs:
compile:
runs-on: ubuntu-latest
Copilot is powered by AI and may make mistakes. Always verify output.

// Handle dynamic imports (yield import, await import, regular import())
const dynamicRegex = new RegExp(
`(yield\\s+import|await\\s+import|import)\\s*\\(\\s*['"](\\.\\.\?\\/[^'"]+)(\\${oldExt})['"]\\s*\\)`,

Check failure

Code scanning / CodeQL

Useless regular-expression character escape High

The escape sequence '?' is equivalent to just '?', so the sequence may still represent a meta-character when it is used in a
regular expression
.

Copilot Autofix

AI 14 days ago

To fix this problem, replace the unnecessary escape sequence \? in the regular expression string (line 59) with the correct regex that matches either ./ or ../ prefixes. This means we want either one or two dots followed by a slash. The best regex is \.{1,2}/, which matches ./ or ../. Update the string literal in the RegExp constructor in both staticRegex and dynamicRegex patterns, if necessary. Only update this in the code region provided, and do not change logic elsewhere.

Suggested changeset 1
scripts/rename-to-esm-files.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/scripts/rename-to-esm-files.js b/scripts/rename-to-esm-files.js
--- a/scripts/rename-to-esm-files.js
+++ b/scripts/rename-to-esm-files.js
@@ -51,12 +51,12 @@
     // Update each extension type defined in the map
     for (const [oldExt, newExt] of Object.entries(extensionMap)) {
         // Handle static imports/exports
-        const staticRegex = new RegExp(`(import|export)(.+from\\s+['"])(\\.\\.?\\/[^'"]+)(\\${oldExt})(['"])`, "g");
+        const staticRegex = new RegExp(`(import|export)(.+from\\s+['"])(\\.{1,2}\\/[^'"]+)(\\${oldExt})(['"])`, "g");
         newContent = newContent.replace(staticRegex, `$1$2$3${newExt}$5`);
 
         // Handle dynamic imports (yield import, await import, regular import())
         const dynamicRegex = new RegExp(
-            `(yield\\s+import|await\\s+import|import)\\s*\\(\\s*['"](\\.\\.\?\\/[^'"]+)(\\${oldExt})['"]\\s*\\)`,
+            `(yield\\s+import|await\\s+import|import)\\s*\\(\\s*['"](\\.{1,2}\\/[^'"]+)(\\${oldExt})['"]\\s*\\)`,
             "g",
         );
         newContent = newContent.replace(dynamicRegex, `$1("$2${newExt}")`);
EOF
@@ -51,12 +51,12 @@
// Update each extension type defined in the map
for (const [oldExt, newExt] of Object.entries(extensionMap)) {
// Handle static imports/exports
const staticRegex = new RegExp(`(import|export)(.+from\\s+['"])(\\.\\.?\\/[^'"]+)(\\${oldExt})(['"])`, "g");
const staticRegex = new RegExp(`(import|export)(.+from\\s+['"])(\\.{1,2}\\/[^'"]+)(\\${oldExt})(['"])`, "g");
newContent = newContent.replace(staticRegex, `$1$2$3${newExt}$5`);

// Handle dynamic imports (yield import, await import, regular import())
const dynamicRegex = new RegExp(
`(yield\\s+import|await\\s+import|import)\\s*\\(\\s*['"](\\.\\.\?\\/[^'"]+)(\\${oldExt})['"]\\s*\\)`,
`(yield\\s+import|await\\s+import|import)\\s*\\(\\s*['"](\\.{1,2}\\/[^'"]+)(\\${oldExt})['"]\\s*\\)`,
"g",
);
newContent = newContent.replace(dynamicRegex, `$1("$2${newExt}")`);
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants