Skip to content

Add TypeScript support with configuration and initial source files#2

Merged
rahul-vyas-dev merged 2 commits intoAOSSIE-Org:mainfrom
rahul-vyas-dev:main
Feb 27, 2026
Merged

Add TypeScript support with configuration and initial source files#2
rahul-vyas-dev merged 2 commits intoAOSSIE-Org:mainfrom
rahul-vyas-dev:main

Conversation

@rahul-vyas-dev
Copy link
Contributor

@rahul-vyas-dev rahul-vyas-dev commented Feb 26, 2026

Adding TS support

Checklist

  • My code follows the project's code style and conventions
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contributing Guidelines

⚠️ AI Notice - Important!

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.

Summary by CodeRabbit

  • Chores
    • Added TypeScript configuration with strict type checking, ES2020 target, and JSX support.
    • Project now includes TypeScript as a development dependency and related tooling.
    • Updated package configuration to point to the new source entry and corrected manifest formatting.
    • Build/output settings adjusted to emit typed declarations and a dedicated output directory.

@github-actions github-actions bot added no-issue-linked PR is not linked to any issue configuration Configuration file changes dependencies Dependency file changes javascript JavaScript/TypeScript code changes size/M Medium PR (51-200 lines changed) repeat-contributor PR from an external contributor who already had PRs merged pending-coderabbit-review labels Feb 26, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e98fd1d and 06d856c.

📒 Files selected for processing (1)
  • tsconfig.json

Walkthrough

Updates add TypeScript support: package.json main now points to src/index.ts, a devDependency for typescript was added, and a new tsconfig.json with strict ES2020/ESNext compiler options and src included was introduced.

Changes

Cohort / File(s) Summary
Package manifest & deps
package.json
Changed main from index.js to src/index.ts; added top-level devDependencies entry with "typescript": "^5.9.3"; adjusted closing of engines block.
TypeScript config
tsconfig.json
Added tsconfig.json with compilerOptions (target ES2020, module ESNext, declaration: true, outDir: dist, strict: true, jsx: react-jsx, moduleResolution: nodenext, esModuleInterop: true, skipLibCheck: true, forceConsistentCasingInFileNames: true) and include: ["src"].

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

Typescript Lang

Poem

🐰 I hopped from JS to typed delight,

src and tsconfig set just right,
Types checked strictly, errors small,
A cosy burrow for code in all,
Nibble bugs away — hooray, good night!

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: adding TypeScript support with both configuration (tsconfig.json) and package.json updates to enable TypeScript development.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
package.json (2)

25-31: ⚠️ Potential issue | 🔴 Critical

main entry point references non-existent TypeScript source; build not configured.

Line 25 points main to src/index.ts, but this file is not included in the files whitelist and Node.js cannot directly execute TypeScript. Additionally, the build script at line 34 is not configured ("build": "echo \"Build step not configured yet\""), so even the dist/ directory listed in files will not be generated. This will cause package resolution failures for all consumers.

Correct the entrypoint to reference the compiled output and configure the build process:

Suggested fix
   "main": "dist/index.js",
+  "types": "dist/index.d.ts",
   "files": [
     "dist",
-    "index.js",
     "README.md",
     "LICENSE"
   ],
   "scripts": {
     "test": "echo \"No tests specified\"",
-    "build": "echo \"Build step not configured yet\""
+    "build": "tsc"
   },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` around lines 25 - 31, The package.json currently points "main"
to a TS source ("src/index.ts") and has a noop "build" script; change "main" to
the compiled entry (e.g., "dist/index.js"), update the "build" script to compile
TypeScript (for example "tsc -p tsconfig.json" or your project's build command)
so dist/ is generated, and add a publishing hook (e.g., "prepublishOnly": "npm
run build") if you want builds before publish; ensure the "files" array still
includes "dist" so the compiled output is packaged.

33-40: ⚠️ Potential issue | 🔴 Critical

Fix TypeScript compilation setup and entry point configuration.

The main entry point is configured to src/index.ts (TypeScript source), but the package must distribute compiled JavaScript. The build script is a placeholder, so compilation never occurs. When installed via npm, consumers will receive TypeScript source files instead of usable JavaScript.

Fixes required:

  1. Add actual TypeScript compilation to the build script
  2. Update main entry point to dist/index.js after compilation
  3. Add prepublishOnly hook to ensure dist/ is generated before publishing
Suggested updates
   "main": "src/index.ts",
+  "main": "dist/index.js",
   "scripts": {
     "test": "echo \"No tests specified\"",
-    "build": "echo \"Build step not configured yet\""
+    "build": "tsc",
+    "prepublishOnly": "npm run build"
   },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` around lines 33 - 40, Update package.json so consumers get
compiled JS: replace the placeholder "build" script with a TypeScript compile
command (e.g., run tsc --project tsconfig.json outputting to dist), change the
"main" field from "src/index.ts" to "dist/index.js", and add a "prepublishOnly"
script that runs the "build" script to ensure dist/ is generated before
publishing; reference the existing "build" script, "main" entry, and add
"prepublishOnly" to guarantee compilation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tsconfig.json`:
- Around line 4-10: Update tsconfig.json to use NodeNext ESM resolution: change
the "moduleResolution" property from "Node" to "NodeNext" and also set the
"module" property to "NodeNext" (currently "ESNext") so TypeScript's module
resolution matches Node's ESM behavior; modify the "module" and
"moduleResolution" entries in tsconfig.json accordingly.

---

Outside diff comments:
In `@package.json`:
- Around line 25-31: The package.json currently points "main" to a TS source
("src/index.ts") and has a noop "build" script; change "main" to the compiled
entry (e.g., "dist/index.js"), update the "build" script to compile TypeScript
(for example "tsc -p tsconfig.json" or your project's build command) so dist/ is
generated, and add a publishing hook (e.g., "prepublishOnly": "npm run build")
if you want builds before publish; ensure the "files" array still includes
"dist" so the compiled output is packaged.
- Around line 33-40: Update package.json so consumers get compiled JS: replace
the placeholder "build" script with a TypeScript compile command (e.g., run tsc
--project tsconfig.json outputting to dist), change the "main" field from
"src/index.ts" to "dist/index.js", and add a "prepublishOnly" script that runs
the "build" script to ensure dist/ is generated before publishing; reference the
existing "build" script, "main" entry, and add "prepublishOnly" to guarantee
compilation.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2ec5238 and e98fd1d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • package.json
  • src/index.ts
  • tsconfig.json

@rahul-vyas-dev rahul-vyas-dev merged commit 8980cd3 into AOSSIE-Org:main Feb 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

configuration Configuration file changes dependencies Dependency file changes javascript JavaScript/TypeScript code changes no-issue-linked PR is not linked to any issue pending-coderabbit-review repeat-contributor PR from an external contributor who already had PRs merged size/M Medium PR (51-200 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant