Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhooks committed Mar 20, 2023
1 parent 592cd69 commit d2ddc69
Show file tree
Hide file tree
Showing 9 changed files with 209 additions and 80 deletions.
13 changes: 8 additions & 5 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{
"presets": [
[ "@babel/env", {
"modules": false
} ],
"@babel/preset-typescript"
"@babel/preset-typescript",
[
"@babel/env",
{
"modules": false
}
]
],
"env": {
"test": {
"presets": [ "@babel/env" ]
"presets": ["@babel/preset-typescript", "@babel/env"]
}
}
}
14 changes: 3 additions & 11 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
{
"root": true,
"extends": ["eslint:recommended", "prettier", "plugin:@typescript-eslint/recommended"],
"plugins": ["prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"project": ["./tsconfig.json", "./tsconfig.eslint.json"]
},
"extends": "@aduth/eslint-config",
"env": {
"es6": true,
"browser": true,
"mocha": true,
"node": true
},
"rules": {
"prettier/prettier": "error"
"no-redeclare": "off",
"@typescript-eslint/no-redeclare": "error"
}
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/es/*
!/es/index.d.ts
node_modules/
*.log
dist/
3 changes: 3 additions & 0 deletions mocha-setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import register from '@babel/register';

register({ extensions: ['.ts'] });
46 changes: 46 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 13 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@
"src"
],
"scripts": {
"build:es": "babel src/ --extensions \".js,.ts,\" --out-dir es",
"build:es": "babel src/ --extensions '.ts' --out-dir es",
"build:umd": "rollup -c",
"build:types": "tsc -b",
"build": "npm run build:es && npm run build:umd",
"build:types": "tsc -b tsconfig.decl.json",
"build": "npm run build:es && npm run build:umd && npm run build:types",
"dev": "rollup -c -w",
"lint": "eslint . --ignore-pattern dist --ignore-pattern es",
"unit-test": "NODE_ENV=test mocha --require @babel/register",
"test": "npm run unit-test && npm run lint",
"unit-test": "NODE_ENV=test mocha -r jsdom-global/register -r @babel/register -r ./mocha-setup.js --extension ts",
"typecheck": "tsc",
"test": "npm run unit-test && npm run lint && npm run typecheck",
"prepublishOnly": "npm run build"
},
"author": {
Expand All @@ -36,6 +37,7 @@
},
"license": "MIT",
"devDependencies": {
"@aduth/eslint-config": "^4.4.1",
"@babel/cli": "^7.20.7",
"@babel/core": "^7.20.12",
"@babel/preset-env": "^7.20.2",
Expand All @@ -44,13 +46,16 @@
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-terser": "^0.4.0",
"@typescript-eslint/eslint-plugin": "^5.53.0",
"@typescript-eslint/parser": "^5.53.0",
"@types/chai": "^4.3.4",
"@types/mocha": "^10.0.1",
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "^5.55.0",
"chai": "^4.3.7",
"eslint": "^8.34.0",
"eslint-config-prettier": "^8.6.0",
"eslint-config-prettier": "^8.7.0",
"eslint-plugin-prettier": "^4.2.1",
"jsdom": "^21.1.0",
"jsdom-global": "^3.0.2",
"mocha": "^10.2.0",
"prettier": "^2.8.4",
"rollup": "^3.15.0",
Expand Down
8 changes: 4 additions & 4 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ export default [
},
plugins: [
nodeResolve({
extensions: ['.js', '.ts'],
extensions: ['.ts'],
}),
babel({
extensions: ['.js', '.ts'],
extensions: ['.ts'],
babelHelpers: 'bundled',
exclude: 'node_modules/**',
presets: ['@babel/preset-typescript'],
Expand All @@ -31,10 +31,10 @@ export default [
},
plugins: [
nodeResolve({
extensions: ['.js', '.ts'],
extensions: ['.ts'],
}),
babel({
extensions: ['.js', '.ts'],
extensions: ['.ts'],
babelHelpers: 'bundled',
exclude: 'node_modules/**',
presets: ['@babel/preset-typescript'],
Expand Down
Loading

0 comments on commit d2ddc69

Please sign in to comment.