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

Migrate to TypeScript and add type definitions #1

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
26 changes: 12 additions & 14 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
module.exports = {
extends: 'google',
env: {
node: true,
mocha: true
},
root: true,
parser: '@typescript-eslint/parser',
plugins: [
'pabigot'
'@typescript-eslint',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'guard-for-in': 'off',
'prefer-rest-params': 'off',
'prefer-spread': 'off',
Expand All @@ -23,12 +27,6 @@ module.exports = {
'no-irregular-whitespace': ['error', {skipComments: true}],
'no-multi-spaces': ['error', {ignoreEOLComments: true}],
'operator-linebreak': ['error', 'before'],
'pabigot/affixed-ids': ['error', {
allowedSuffixes: [
'_dCel',
'_ppt'
]
}],
quotes: ['error', 'single', {
avoidEscape: true,
allowTemplateLiterals: true
Expand All @@ -40,6 +38,6 @@ module.exports = {
yoda: ['error', 'always', {exceptRange: true}]
},
parserOptions: {
sourceType: 'module'
project: './tsconfig.json',
}
}
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/CHANGELOG.html
/coverage/
/node_modules/
/lib/
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ node_js:
- "node"
- "8"
- "6"
- "4"
after_success:
- npm run eslint
- npm run coveralls
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# Change Log

## [3.0.0] - 2021-07-08

* **API** Renamed `const` function to [constant][doc:constant].
* Migrate to TypeScript and make type definitions available from npm.

## [2.0.0] - 2021-07-08

* Improve [browser compatibility][pr#28] by adding a browser polyfill
for the Node browser module and loosening types from Buffer to Uint8Array.

## [1.2.2] - 2021-07-05

* Improve [browser compatibility][pr#26] by eliminating a dependence on
* Improve [browser compatibility][pr#27] by eliminating a dependence on
the Node assert module.

## [1.2.1] - 2021-04-29
Expand Down
30 changes: 20 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "buffer-layout",
"version": "1.2.2",
"version": "3.0.0",
"description": "Translation between JavaScript values and Buffers",
"keywords": [
"Buffer",
Expand All @@ -17,24 +17,34 @@
"license": "MIT",
"author": "Peter A. Bigot <pab@pabigot.com>",
"main": "./lib/Layout.js",
"types": "./lib/Layout.d.ts",
"files": [
"/lib"
],
"dependencies": {
"buffer": "~6.0.3"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.28.2",
"@typescript-eslint/parser": "^4.28.2",
"coveralls": "^3.0.0",
"eslint": "~4.18.2",
"eslint-config-google": "~0.9.1",
"eslint-plugin-pabigot": "~1.1.0",
"eslint": "~7.30.0",
"istanbul": "~0.4.5",
"jsdoc": "~3.5.5",
"lodash": "~4.17.5",
"mocha": "~5.0.4"
"mocha": "~5.0.4",
"typescript": "~4.3.5"
},
"engines": {
"node": ">=4.5"
"node": ">=5.10"
},
"scripts": {
"coverage": "istanbul cover _mocha -- -u tdd",
"coveralls": "istanbul cover _mocha --report lcovonly -- -u tdd && cat ./coverage/lcov.info | coveralls",
"eslint": "eslint lib/ test/",
"build": "tsc",
"coverage": "npm run build && istanbul cover _mocha -- -u tdd",
"coveralls": "npm run build && istanbul cover _mocha --report lcovonly -- -u tdd && cat ./coverage/lcov.info | coveralls",
"eslint": "eslint src/ --ext .ts",
"jsdoc": "jsdoc -c jsdoc/conf.json",
"test": "mocha -u tdd"
"prepare": "npm run build",
"test": "npm run build && mocha -u tdd"
}
}
Loading