Skip to content

Commit

Permalink
refactor(core): complete refactoring
Browse files Browse the repository at this point in the history
Switch to TypeScript, embrace last Node streams and improve the API surface.

BREAKING CHANGE: Support only Node20+, use ESM, API surface changed. By updating assume you could
have a lot of work to do.
  • Loading branch information
nfroidure committed Jul 18, 2024
1 parent d086aec commit a969877
Show file tree
Hide file tree
Showing 23 changed files with 10,231 additions and 4,552 deletions.
10 changes: 8 additions & 2 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# This file is automatically generated by a `metapak`
# module. Do not change it elsewhere, changes would
# module. Do not change it here, your changes would
# be overridden.

engines:
eslint:
enabled: true

ratings:
paths:
- "src/*.js tests/*.mocha.js"
- "'src/**/*.ts'"
## Exclude test files.
exclude_patterns:
- "dist/"
- "**/node_modules/"
- "src/**/*.tests.ts"
17 changes: 0 additions & 17 deletions .eslintrc.js

This file was deleted.

5 changes: 2 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
*.md text eol=lf
*.html text eol=lf
*.js text eol=lf
# Enforce Unix newlines
* text=auto eol=lf
11 changes: 5 additions & 6 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Code of Conduct

Be kind, except if i behave like an asshole,
if so, tell me by linking to this file.
Be kind, except if I behave like an asshole, if so, tell me by linking to this
file.

I try hard to automate things so that you cannot
create noises without really willing to do so.
I try hard to document and automate things so that you cannot create noises
without really willing to do so.

This is why i'll just delete issues/comments
making be sad.
This is why I'll just delete issues/comments making be sad.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Contributing to this project requires you to be
a gentleman.

By contributing you must agree with publishing your
changes int the same license than the actual code.
changes into the same license that apply to the current code.

You will find the license in the LICENSE file at
the root of this repository.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [nfroidure]
14 changes: 7 additions & 7 deletions .github/ISSUE_TEMPLATE
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Before doing so, there are a few checks to do in
Beware that you also can create a pull request
if you know how to solve the issue.

Finally scroll down if you asking for a feature ;)
Finally scroll down if you are asking for a new feature ;)

-->

I'm a gentledev i:
I'm a gentledev I:
- [ ] fully read the README recently
- [ ] searched for existing issues
- [ ] checked i'm up to date with the latest version of the project
- [ ] checked I'm up to date with the latest version of the project

### Expected behavior

Expand All @@ -35,16 +35,16 @@ I'm a gentledev i:
```
<paste here>
```
If the result is lower than 6.9.5, there is
poor chances i even have a look to it. Please,
If the result is lower than 20.11.1, there is
poor chances I even have a look to it. Please,
use the last [NodeJS LTS version](https://nodejs.org/en/).

## Feature request
<!--

If you think a feature need to be added, your suggestions
are welcome. Beware though that:
- I try to keep my module simple so please ensure the requested
- I try to keep my modules simple so please ensure the requested
feature is really related to this module. If not, you may
instead create a module that augment/work with this one,
- I am not your employee so keep calm and be aware that your
Expand All @@ -56,4 +56,4 @@ If you think a feature need to be added, your suggestions

### Use cases

- [ ] I will/have implement the feature
- [ ] I will/did implement the feature
9 changes: 5 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Fixes #
- [ ] I made some tests for my changes
- [ ] I added my name in the
[contributors](https://docs.npmjs.com/files/package.json#people-fields-author-contributors)
field of the package.json file
field of the `package.json` file. Beware to use the same format than for the author field
for the entries so that you'll get a mention in the `README.md` with a link to your website.

### License
To get your contribution merged, you must check the following.
Expand All @@ -34,9 +35,9 @@ If you already maintain several NPM modules / NodeJS
project, making significant changes on one of my modules
automatically legitimates you as a core developer.

This is because i could die or even not give a shit to
this project someday and i don't want people to get
stuck.
This is because I could die or even not give a shit to
this project someday and I don't want people to get
stuck in such cases.

If you want to help, fill the following with to get
GitHub/NPM r/w access.
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This file is automatically generated by a `metapak`
# module. Do not change it here, your changes would
# be overridden.

name: Node.js CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run pre-commit tests
run: npm run precz
95 changes: 90 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,36 @@
# module. Do not change it elsewhere, changes would
# be overridden.

# Created by https://www.gitignore.io/api/osx,node,linux

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
Expand All @@ -21,27 +42,91 @@ coverage
# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

### OSX ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


# End of https://www.gitignore.io/api/osx,node,linux

# Coveralls key
.coveralls.yml

# Dist files
# Project custom ignored file
dist
7 changes: 0 additions & 7 deletions .prettierrc.js

This file was deleted.

7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"gruntfuggly.todo-tree"
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
Loading

0 comments on commit a969877

Please sign in to comment.