Skip to content

Conversation

@Segmentational
Copy link

The following PR relates to a simple TypeScript implementation using express@5.0.

Additionally, example (found in examples/typescript) includes a tsconfig.json that compiles down to ES5 JavaScript. A merge request I made previously had failed some tests relating to version limitations (node), so this should handle that case.

However, the compiled JavaScript and other generated assets are set to be tracked via VCS (git). It's of normal operation to usually untrack them via including *.js in the .gitignore.

We can later add a .gitignore in the example folder itself. But I do want to see what the GitHub actions returns with. If appropriate, I'll update/discuss changes to these tests to account for the typescript example.


Discussion

Looking at the other example folders, often they are without README.mds, package.jsons, etc. etc.

While totally fine, the example this PR relates to, as well as another I have outstanding, perhaps could be exceptions. I know the package maintainers and other contributors see, almost daily, issues & questions relating to ESM, TypeScript, and even both.

Providing examples, like this one, hopefully will make everyone's life a bit easier :D.

@Segmentational
Copy link
Author

Nice, seems to have passed

@Segmentational
Copy link
Author

@bozzelliandrea, thank you for the feedback; I've since updated with your recommended changes, and point of replacing require with import.

Sorry my response took so long, I'll try and get back sooner next time around :D.

P.S. I updated the tsconfig.json and package.json to align much closer to what a standard, default configuration would look like. Notice, too, the latest package version reference(s).

Using latest is to avoid (haha hopefully) any technical debt down the road with issues coming through asking to update the typescript example.

Segmentational and others added 2 commits July 15, 2022 01:38
- Updated `README.md` to better reflect context
- Removed unnecessary instruction
Copy link

@bozzelliandrea bozzelliandrea left a comment

Choose a reason for hiding this comment

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

@Segmentational everything looks ok and clean, nice work! 😃

Just my curiosity, what does CJS mean?

@Segmentational
Copy link
Author

@Segmentational everything looks ok and clean, nice work! 😃

Just my curiosity, what does CJS mean?

@bozzelliandrea, sorry for the delayed response... I just moved halfway across the united states, so that took a little time haha.

Yeah, "CJS" can be seen in a few odd places in the node official documentation. The first example, although referenced as a file extension, can be seen here:

I'm unsure of the exact other places, but essentially it's a shorthand sometimes used to describe the commonjs javascript module type.

@Segmentational
Copy link
Author

Segmentational commented Dec 8, 2025

Hello!

So it's been quite some time, but I have a colleague who was looking for a simple TS example. I got curious, and remembered this PR.

Are there any outstanding issues? It's likely the tsconfig.json is outdated. I can update that.

@dougwilson, are you still the maintainer here?

One question: is this example outside the scope of the project?

I have no issue closing this PR if there isn't interest in a typescript example.

But if there is, maybe we can reconsider a merge at some future release point.

Edit*: Last note, there's also a committed artifact, which is incorrect. the gitignore should be updated before this would get merged, but again, if there isn't any interest in typescript here -- we should just close this before any more work is done

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants