Skip to content

Commit

Permalink
typescriptify (#70)
Browse files Browse the repository at this point in the history
* typescriptify

* add types key to package.json

* add some comments

* use a const enum for internal token types

* same argument order all around
  • Loading branch information
goto-bus-stop committed Jan 22, 2020
1 parent b5de27b commit adbe1f6
Show file tree
Hide file tree
Showing 9 changed files with 301 additions and 213 deletions.
5 changes: 2 additions & 3 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"include": ["src/**/*.js"],
"include": ["src/*.ts", "dist/*.js"],
"lines": 100,
"branches": 100,
"statements": 100,
"functions": 100,
"reporter": ["lcov"],
"check-coverage": true,
"sourceMap": false,
"instrument": false
"sourceMap": true
}
23 changes: 6 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,23 @@
"author": "Renée Kooi <renee@kooi.me>",
"main": "dist/u-wave-parse-chat-markup.js",
"module": "dist/u-wave-parse-chat-markup.mjs",
"jsnext:main": "src/index.js",
"types": "dist/index.d.ts",
"repository": "u-wave/parse-chat-markup",
"keywords": [
"u-wave"
],
"bugs": "https://github.com/u-wave/parse-chat-markup/issues",
"homepage": "https://github.com/u-wave/parse-chat-markup#readme",
"scripts": {
"prepublish": "npm run build",
"build": "rollup -c",
"test:lint": "eslint .",
"test:mocha": "cross-env BABEL_ENV=test mocha",
"cov": "nyc npm run test:mocha",
"test": "npm run cov && npm run test:lint"
"prepare": "rollup -c",
"test": "npm run prepare && nyc mocha"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/register": "^7.0.0",
"babel-plugin-istanbul": "^6.0.0",
"chai": "^4.1.2",
"cross-env": "^6.0.0",
"eslint": "^6.0.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-plugin-import": "^2.18.2",
"mocha": "^6.0.0",
"nyc": "^15.0.0",
"rollup": "^1.0.0",
"rollup-plugin-babel": "^4.0.2"
"rollup": "^1.29.1",
"rollup-plugin-typescript2": "^0.25.3",
"typescript": "^3.7.5"
}
}
6 changes: 3 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import babel from 'rollup-plugin-babel';
import typescript from 'rollup-plugin-typescript2';

const pkg = require('./package.json');

export default {
input: './src/index.js',
input: './src/index.ts',
output: [
{ format: 'cjs', file: pkg.main, exports: 'named' },
{ format: 'es', file: pkg.module },
],
plugins: [
babel(),
typescript(),
],
};
185 changes: 0 additions & 185 deletions src/index.js

This file was deleted.

0 comments on commit adbe1f6

Please sign in to comment.