Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools update #384

Closed
wants to merge 6 commits into from
Closed

Tools update #384

wants to merge 6 commits into from

Conversation

chris-pardy
Copy link
Collaborator

This Updates the build tooling significantly

  • Build via tsup
  • Linting via eslint
  • Autoformatting with prettier
  • Testing via vitest
  • examples are run with tsx

Copy link
Owner

@CacheControl CacheControl left a comment

Choose a reason for hiding this comment

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

@chris-pardy fine with this in general.

Can we aim to get CI passing?

@@ -9,50 +8,52 @@
* DEBUG=json-rules-engine node ./examples/01-hello-world.js
*/

require('colors')
const { Engine } = require('json-rules-engine')
import "colors";
Copy link
Owner

Choose a reason for hiding this comment

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

Tell me more about the change to .mts decision specifically for examples - the idea of the examples is to cater to the lowest common denominator. Seems like we're narrowing the audience by moving away from .js?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess this is more of a question of what the "lowest common denominator" is in 2024?
For instance should the examples be common js with require statements or can we safely move to module syntax. Node's had support for modules for some time now and with a move to drop the EOL versions of node I think using the module syntax is probably ok.
I think for most people Typescript is the default choice in this day-and-age so it's probably worth having some examples in Typescript. I could see an argument made for actually having both.

Copy link
Owner

Choose a reason for hiding this comment

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

@chris-pardy ty, makes sense. I no longer work in this ecosystem, so I'll defer to your judgement on this.

@chris-pardy
Copy link
Collaborator Author

@chris-pardy fine with this in general.

Can we aim to get CI passing?

Yes, We need to drop support for node 14 & 16 which I'm going to do. I'll add an engines field to the package.json as well.

Switch to Prettier and ESLint for tooling.
Vitest can test all the files, including testing the types.
Move to tsup to build and bundle
@chris-pardy chris-pardy deleted the branch CacheControl:v7 October 24, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants