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

code moved to modern ESM format #150

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4d05456
feat: converted library to use ES Modules and exports both CJS and ES…
yankeeinlondon Jul 20, 2022
e1af204
chore: enforcing linting rules across all files
yankeeinlondon Jul 20, 2022
3512b3d
chore: linting configs to bring current
yankeeinlondon Jul 20, 2022
54808d3
fix: import parse fn from correct location
yankeeinlondon Jul 20, 2022
86fdb1b
feat: updated to all deps to latest including major version bumps
yankeeinlondon Jul 20, 2022
7ae81fd
chore: added bumpp util and release script target
yankeeinlondon Jul 20, 2022
c623c0d
fix: fixed release script to point correctly at test and audit
yankeeinlondon Jul 20, 2022
e360140
chore: updated README and CHANGELOG
yankeeinlondon Jul 20, 2022
1302806
chore: temp removed gitignore for dist folder so that I may link to g…
yankeeinlondon Jul 20, 2022
27514d2
chore: ensure all imports use filename extension
yankeeinlondon Jul 25, 2022
6cc8b34
chore: publishing as my own repo while PR is being considered
yankeeinlondon Jul 25, 2022
b339e54
export both named "matter" and default
yankeeinlondon Jul 25, 2022
c5c8260
chore: changed export logic and modified types file to match
yankeeinlondon Jul 25, 2022
c43b954
chore: expose default export
yankeeinlondon Jul 25, 2022
8d90163
chore: updated deps
yankeeinlondon Dec 14, 2022
b42f6a7
fix: remove requires of node modules and replace with modern import s…
yankeeinlondon Dec 14, 2022
732a235
refactor: moved all testing over to Vitest
yankeeinlondon Dec 15, 2022
de9b905
chore: there are two tests that I have skipped because I don't have …
yankeeinlondon Dec 15, 2022
49252e2
chore: finalize TS refactor
yankeeinlondon Dec 15, 2022
49694f9
fix: switched linting over to modern TS rules and delinted using this
yankeeinlondon Dec 15, 2022
832bf19
chore: update scripts
yankeeinlondon Dec 15, 2022
dfb8766
chore: release v6.0.0
yankeeinlondon Dec 15, 2022
a63d3fc
refactor: export to only ESM module format
yankeeinlondon Dec 15, 2022
ef688cb
chore: release v6.1.0
yankeeinlondon Dec 15, 2022
a83cda2
fix: made sure typings reference was valid reference to types file
yankeeinlondon Dec 15, 2022
86dc577
chore: release v6.1.1
yankeeinlondon Dec 15, 2022
5924ae4
feat: updated all deps to latest
yankeeinlondon Nov 25, 2023
602bc23
chore: release v6.2.0
yankeeinlondon Nov 25, 2023
ab99d4a
chore: using replaceAll over replace function
yankeeinlondon Nov 25, 2023
9133e3e
chore: release v6.2.1
yankeeinlondon Nov 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
209 changes: 85 additions & 124 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,131 +1,92 @@
{
"extends": [
"eslint:recommended",
"./package.json"
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:unicorn/recommended"
],

"env": {
"browser": false,
"es6": true,
"node": true,
"mocha": true
},

"parserOptions":{
"ecmaVersion": 9,
"plugins": [
"@typescript-eslint",
"import",
"promise",
"unicorn"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"parser": "@typescript-eslint/parser",
"sourceType": "module",
"ecmaFeatures": {
"modules": true,
"experimentalObjectRestSpread": true
}
},

"globals": {
"document": false,
"navigator": false,
"window": false
"ecmaVersion": 12
},

"rules": {
"accessor-pairs": 2,
"arrow-spacing": [2, { "before": true, "after": true }],
"block-spacing": [2, "always"],
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
"comma-dangle": [2, "never"],
"comma-spacing": [2, { "before": false, "after": true }],
"comma-style": [2, "last"],
"constructor-super": 2,
"curly": [2, "multi-line"],
"dot-location": [2, "property"],
"eol-last": 2,
"eqeqeq": [2, "allow-null"],
"generator-star-spacing": [2, { "before": true, "after": true }],
"handle-callback-err": [2, "^(err|error)$" ],
"indent": [2, 2, { "SwitchCase": 1 }],
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
"keyword-spacing": [2, { "before": true, "after": true }],
"new-cap": [2, { "newIsCap": true, "capIsNew": false }],
"new-parens": 2,
"no-array-constructor": 2,
"no-caller": 2,
"no-class-assign": 2,
"no-cond-assign": 2,
"no-const-assign": 2,
"no-control-regex": 2,
"no-debugger": 2,
"no-delete-var": 2,
"no-dupe-args": 2,
"no-dupe-class-members": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty-character-class": 2,
"no-eval": 2,
"no-ex-assign": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-extra-boolean-cast": 2,
"no-extra-parens": [2, "functions"],
"no-fallthrough": 2,
"no-floating-decimal": 2,
"no-func-assign": 2,
"no-implied-eval": 2,
"no-inner-declarations": [2, "functions"],
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-iterator": 2,
"no-label-var": 2,
"no-labels": 2,
"no-lone-blocks": 2,
"no-mixed-spaces-and-tabs": 2,
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-multiple-empty-lines": [2, { "max": 1 }],
"no-native-reassign": 0,
"no-negated-in-lhs": 2,
"no-new": 2,
"no-new-func": 2,
"no-new-object": 2,
"no-new-require": 2,
"no-new-wrappers": 2,
"no-obj-calls": 2,
"no-octal": 2,
"no-octal-escape": 2,
"no-proto": 0,
"no-redeclare": 2,
"no-regex-spaces": 2,
"no-return-assign": 2,
"no-self-compare": 2,
"no-sequences": 2,
"no-shadow-restricted-names": 2,
"no-spaced-func": 2,
"no-sparse-arrays": 2,
"no-this-before-super": 2,
"no-throw-literal": 2,
"no-trailing-spaces": 0,
"no-undef": 2,
"no-undef-init": 2,
"no-unexpected-multiline": 2,
"no-unneeded-ternary": [2, { "defaultAssignment": false }],
"no-unreachable": 2,
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
"no-useless-call": 0,
"no-with": 2,
"one-var": [0, { "initialized": "never" }],
"operator-linebreak": [0, "after", { "overrides": { "?": "before", ":": "before" } }],
"padded-blocks": [0, "never"],
"quotes": [2, "single", "avoid-escape"],
"radix": 2,
"semi": [2, "always"],
"semi-spacing": [2, { "before": false, "after": true }],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, "never"],
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-unary-ops": [2, { "words": true, "nonwords": false }],
"spaced-comment": [0, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!", ","] }],
"use-isnan": 2,
"valid-typeof": 2,
"wrap-iife": [2, "any"],
"yoda": [2, "never"]
"prefer-const": "error",
"semi": [
"error",
"always"
],
"quotes": [
"warn",
"double",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
"no-unused-vars": "off",
"curly": "error",
"brace-style": [
"error",
"1tbs",
{
"allowSingleLine": true
}
],
// our use of `-spec` files for testing prevents us using this
"unicorn/filename-case": "off",
// reduce has been getting a bad rap lately; its true that often
// a filter or map would be clearer and equally as effective but
// there are still some legit cases to use reduce
"unicorn/no-array-reduce": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/no-null": "off",
"no-nested-ternary": "off",
// doesn't play well with prettier
"unicorn/no-nested-ternary": "off",
// this is kind of nice sometimes
"unicorn/no-array-callback-reference": "off",
"unicorn/prefer-logical-operator-over-ternary": "off",
// we need exceptions to be only "warn" because
// there are valid use cases for generic variables being
// used before being defined
"no-use-before-define": [
"warn"
],
"@typescript-eslint/semi": [
"error",
"always"
],
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/member-delimiter-style": [
"error",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
// "cases" allows for graceful use of that variable
// name in Typescript test cases
"@typescript-eslint/no-unused-vars": [
"error",
{
"varsIgnorePattern": "cases|^_",
"argsIgnorePattern": "^_"
}
]
}
}
}
17 changes: 17 additions & 0 deletions .github/workflows/features.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI (features & PRs)

on:
push:
branches:
- feature/*

pull_request:
branches:
- main
- master
- develop
- feature/*

jobs:
testing:
uses: yankeeinlondon/gha/.github/workflows/test.yml@main
33 changes: 33 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Continuous Integration

on:
push:
branches:
- main
- master

jobs:
testing:
uses: yankeeinlondon/gha/.github/workflows/test.yml@main

publish:
name: npm
if: contains(github.event.head_commit.message, 'release v')
needs:
- testing
uses: yankeeinlondon/gha/.github/workflows/npm.yml@main
with:
nodeVersion: 16
secrets:
npm_token: ${{secrets.NPM_TOKEN}}

do_not_publish:
if: ( !contains(github.event.head_commit.message, 'release v') )
needs:
- testing
name: npm / no publication
runs-on: ubuntu-latest
steps:
- name: Done
run: |
echo "no publication to NPM required"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ vendor
temp
tmp
TODO.md
package-lock.json
package-lock.json
.tsbuildinfo
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# Release history

## 5.0.0 - 2022-07-20

- Core code moved to ES Modules syntax
- All dependencies updated to latest versions (including some major version bumps)
- Library now exports ESM, CJS, and types
- Note: _types_ were manually handcrafted in prior releases but not included in the package.json's "types" property.

## 4.0.0 - 2018-04-01

### Breaking changes

- Now requires node v4 or higher.

- Now requires node v4 or higher.

## 3.0.0 - 2017-06-30

Expand Down