appwrite / appwrite/templates

Enhancement: Add TypeScript definitions (IntelliSense) to Node.js starter

Open
#344 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
174
Forks
129
Avg merge
2h 46m
Merged PRs (30d)
3

Description

### 🔖 Enhancement description

Currently, the Node.js starter function template lacks autocomplete support. I propose adding a types.d.ts file to the starter template and a reference in index.js. This will provide users with immediate IntelliSense for req, res, log, and error out of the box without requiring a build step or a full TypeScript configuration.

### 🎤 Pitch

The Problem: Developers working with the current Node.js starter often have to switch between their editor and the documentation to recall specific properties of the context object (e.g., distinguishing between req.bodyJson, req.bodyText, or remembering res.json() signatures). This creates friction for new users and increases the chance of minor syntax errors during the "Hello World" phase.

The Solution: By including a lightweight types.d.ts definition file and adding a JSDoc reference (/// ) to the top of index.js, we can leverage VS Code's native ability to provide IntelliSense for JavaScript files.

Key Benefits:

Improved DX: Users get self-documenting code with autocomplete for request headers, response methods, and environment variables.

Zero Config: This works natively in Node.js without needing tsconfig.json, compilation steps, or additional dependencies.

Non-Breaking: This change is purely additive and does not alter the runtime behavior of the function.

I have the types.d.ts definition file ready and tested locally. I would be happy to open a PR for this if assigned.

### 👀 Have you spent some time to check if this issue has been raised before?

- [x] I checked and didn't find similar issue

### 🏢 Have you read the Code of Conduct?

- [x] I have read the [Code of Conduct](https://github.com/appwrite/.github/blob/main/CODE_OF_CONDUCT.md)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.