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

fix(deps): major dependency upgrades #76

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

9 changes: 5 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,26 @@ jobs:
fail-fast: false
matrix:
language: [ 'javascript' ]
node-version: ['20']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
- name: Cache node modules (if needed)
uses: actions/cache@v2
uses: actions/cache@v4
id: cache
with:
path: node_modules
Expand All @@ -62,4 +63,4 @@ jobs:
- name: Build TypeScript
run: yarn build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
7 changes: 3 additions & 4 deletions .github/workflows/gh_pages_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ jobs:
publish_doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
node-version: "20"
- name: Install package
run: yarn install
- name: Build TS
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/npm_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
name: npm
url: https://www.npmjs.com/package/bloom-filters
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/npm_test_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
# since last mocha version is compatible for node 12.0.0+ we remove 10.x matrix
# Only LTS major version
node-version: ['12', '14', '16', 'lts/*']
# Only maintenance and LTS major versions
node-version: ['20', '22', '23']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@v4
id: cache
with:
path: node_modules
Expand Down
87 changes: 87 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
const tseslint = require('@typescript-eslint/eslint-plugin')
const prettier = require('eslint-plugin-prettier')
const parser = require('@typescript-eslint/parser')
const node = require('eslint-plugin-node')
const { fixupPluginRules } = require('@eslint/compat')
const js = require('@eslint/js')
const globals = require('globals')


module.exports = [
js.configs.recommended,
{
files: ['src/**/*.ts'],
ignores: [
'dist/',
'docs/',
'build/',
'node_modules/',
'.github',
],
languageOptions: {
parser,
parserOptions: {
ecmaVersion: '2015',
project: 'tsconfig.json'
},
globals: {
...globals.browser,
...globals.amd,
...globals.mocha,
...globals.node,
...globals.nodeBuiltin,
}
},
plugins: {
'@typescript-eslint': tseslint,
prettier: fixupPluginRules(prettier),
node: fixupPluginRules(node),
},
settings: {
node: {
allowModules: [],
resolvePaths: [
'./src'
],
tryExtensions: [
'.ts',
'.js'
]
}
},
rules: {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error"],
'node/no-unsupported-features/es-syntax': [
'error',
{
ignores: [
'modules'
]
}
],
'node/no-unsupported-features/es-builtins': [
'error',
{
ignores: []
}
],
'node/no-unpublished-require': [
'error',
{
allowModules: [
'mocha',
'chai',
'random'
]
}
]
}
}
]






117 changes: 36 additions & 81 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"type": "commonjs",
"scripts": {
"build": "tsc",
"pretest": "yarn lint && yarn build",
"pretest": "yarn clean && yarn lint && yarn build",
"test": "mocha test/**/*-test.js --trace-deprecation --timeout=60000",
"doc": "typedoc --sort alphabetical --out docs/ --emit both --includeVersion src/api.ts",
"lint": "yarn prettier && yarn slint",
"slint": "eslint --fix src/**/*.ts",
"slint": "eslint src --fix",
"prettier": "prettier --config package.json --write \"(src|test)/**/*.(t|j)s\"",
"clean": "rimraf docs/ dist/ build/",
"compile": "tsc"
Expand Down Expand Up @@ -47,36 +47,47 @@
},
"homepage": "https://github.com/Callidon/bloom-filters#readme",
"devDependencies": {
"@eslint/compat": "^1.2.2",
"@types/cuint": "^0.2.X",
"@types/lodash": "^4.14.X",
"@types/lodash.eq": "^4.0.X",
"@types/lodash.indexof": "^4.0.X",
"@types/node": "^17.0.17",
"@types/seedrandom": "^3.0.8",
"@types/lodash": "^4.17.13",
"@types/lodash.eq": "^4.0.9",
"@types/lodash.indexof": "^4.0.9",
"@types/lodash.random": "^3.2.9",
"@types/lodash.sortedindexby": "^4.6.9",
"@types/node": "^22.9.0",
"@types/xxhashjs": "^0.2.X",
"@typescript-eslint/eslint-plugin": "^5.11.0",
"@typescript-eslint/parser": "^5.11.0",
"chai": "^4.3.6",
"eslint": "^8.9.0",
"eslint-config-prettier": "^8.3.0",
"@typescript-eslint/eslint-plugin": "^8.13.0",
"@typescript-eslint/parser": "^8.13.0",
"chai": "4",
"eslint": "^9.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"mocha": "^9.2.0",
"prettier": "^2.5.1",
"random": "^3.0.6",
"rimraf": "^3.0.2",
"typedoc": "^0.22.11",
"typedoc-plugin-missing-exports": "^0.22.6",
"typescript": "^4.5.5"
"eslint-plugin-prettier": "^5.2.1",
"globals": "^15.12.0",
"lodash.intersection": "^4.4.0",
"lodash.range": "^3.2.0",
"lodash.union": "^4.6.0",
"mocha": "^10.8.2",
"prettier": "^3.3.3",
"random": "5.1.1",
"rimraf": "^6.0.1",
"typedoc": "0.26.11",
"typedoc-plugin-missing-exports": "^3.0.0",
"typescript": "^5.6.3"
},
"resolutions": {
"mocha/glob": "^11"
},
"dependencies": {
"@types/seedrandom": "3.0.8",
"base64-arraybuffer": "^1.0.2",
"is-buffer": "^2.0.5",
"lodash": "^4.17.15",
"lodash.eq": "^4.0.0",
"lodash.indexof": "^4.0.5",
"lodash.eq": "4.0.0",
"lodash.indexof": "4.0.5",
"lodash.random": "3.2.0",
"lodash.sortedindexby": "4.6.0",
"long": "^5.2.0",
"reflect-metadata": "^0.1.13",
"reflect-metadata": "^0.2.2",
"seedrandom": "^3.0.5",
"xxhashjs": "^0.2.2"
},
Expand All @@ -89,63 +100,7 @@
"trailingComma": "es5",
"arrowParens": "avoid"
},
"eslintConfig": {
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2015,
"project": "tsconfig.json"
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:node/recommended",
"prettier",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"plugins": [
"@typescript-eslint",
"prettier"
],
"globals": {
"chai": "readonly",
"it": "readonly",
"expect": "readonly",
"describe": "readonly"
},
"settings": {
"node": {
"allowModules": [],
"resolvePaths": [
"./src"
],
"tryExtensions": [
".ts"
]
}
},
"rules": {
"node/no-unsupported-features/es-syntax": [
"error",
{
"ignores": [
"modules"
]
}
],
"node/no-unpublished-require": [
"error",
{
"allowModules": [
"mocha",
"chai",
"random"
]
}
]
}
},
"engines": {
"node": ">=12"
"node": ">=20"
}
}
4 changes: 4 additions & 0 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

// For documentation
export {type HashableInput as HashableInput} from './utils'

// API
export {default as BaseFilter} from './base-filter'
export {default as BloomFilter} from './bloom/bloom-filter'
export {default as BitSet} from './bloom/bit-set'
Expand Down
3 changes: 1 addition & 2 deletions src/base-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export default abstract class BaseFilter {
/**
* Save the current structure as a JSON
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
public saveAsJSON(): any {
throw new Error('not-implemented')
}
Expand All @@ -87,7 +86,7 @@ export default abstract class BaseFilter {
* @param json the JSON object to load
* @return Return the Object loaded from the provided JSON object
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public static fromJSON(json: JSON): any {
throw new Error(`not-implemented`)
}
Expand Down
4 changes: 2 additions & 2 deletions src/bloom/bit-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export default class BitSet {

/**
* Returns the index of the maximum bit in the number, or -1 for 0
* @bits an unsigned 8-bit number
* @param bits an unsigned 8-bit number
* ```js
* @example
* BitSet.highBit(0) // returns -1
Expand All @@ -155,7 +155,7 @@ export default class BitSet {

/**
* Returns the number of true bits in the number
* @bits an unsigned 8-bit number
* @param bits an unsigned 8-bit number
* @example
* ```js
* BitSet.countBits(0) // returns 0
Expand Down
2 changes: 1 addition & 1 deletion src/bloom/counting-bloom-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export default class CountingBloomFilter

/**
* Check if another Counting Bloom Filter is equal to this one
* @param filter - The filter to compare to this one
* @param other - The filter to compare to this one
* @return True if they are equal, false otherwise
*/
public equals(other: CountingBloomFilter): boolean {
Expand Down
2 changes: 1 addition & 1 deletion src/bloom/partitioned-bloom-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export default class PartitionedBloomFilter

/**
* Check if another Partitioned Bloom Filter is equal to this one
* @param filter - The filter to compare to this one
* @param other - The filter to compare to this one
* @return True if they are equal, false otherwise
*/
public equals(other: PartitionedBloomFilter): boolean {
Expand Down
Loading
Loading