Skip to content

Commit d23908d

Browse files
committed
feat: enhance project configuration with modern setup
1 parent 0c6225c commit d23908d

15 files changed

+4210
-141
lines changed

.babelrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build
2+
dist
3+
node_modules

.eslintrc

Lines changed: 0 additions & 8 deletions
This file was deleted.

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build
2+
dist
3+
node_modules

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
node_modules
2-
/.nyc_output
1+
/build
32
/coverage
43
/dist
5-
/lib
4+
node_modules

.npmignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
/.nyc_output
2-
/coverage
3-
/dist
1+
package-lock.json
2+
yarn.lock

.travis.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2017 Cheton Wu
3+
Copyright (c) 2017-present Cheton Wu
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

babel.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
extends: '@trendmicro/babel-config',
3+
presets: [
4+
'@babel/preset-env',
5+
],
6+
};

package.json

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,11 @@
22
"name": "cncjs-controller",
33
"version": "1.3.0",
44
"description": "A controller library for event-based communication between client and CNCjs server.",
5-
"main": "lib/index.js",
6-
"scripts": {
7-
"prepublish": "npm run eslint && npm test && npm run clean && npm run build && npm run dist",
8-
"build": "babel --out-dir ./lib ./src",
9-
"dist": "webpack",
10-
"clean": "rm -rf lib/*",
11-
"eslint": "eslint ./src",
12-
"test": "tap test/*.js --node-arg=--require --node-arg=babel-register --node-arg=--require --node-arg=babel-polyfill",
13-
"coveralls": "tap test/*.js --coverage --coverage-report=text-lcov --nyc-arg=--require --nyc-arg=babel-register --nyc-arg=--require --nyc-arg=babel-polyfill | coveralls"
14-
},
15-
"author": "Cheton Wu <[email protected]>",
16-
"contributors": [
17-
{
18-
"name": "Cheton Wu",
19-
"email": "[email protected]",
20-
"url": "https://github.com/cheton"
21-
}
22-
],
5+
"author": "Cheton Wu",
236
"license": "MIT",
247
"repository": {
258
"type": "git",
26-
"url": "git+https://github.com/cncjs/cncjs-controller.git"
9+
"url": "git@github.com:cncjs/cncjs-controller.git"
2710
},
2811
"keywords": [
2912
"cncjs",
@@ -33,25 +16,53 @@
3316
"events",
3417
"client"
3518
],
19+
"scripts": {
20+
"build": "cross-env rollup --config rollup.config.mjs",
21+
"clean": "del build coverage dist",
22+
"eslint": "eslint --ext .js,.jsx,.mjs .",
23+
"pre-push": "bash -c 'echo -e \"=> \\e[1;33m$npm_package_name\\e[0m\"' && yarn run build && yarn run eslint && yarn run test",
24+
"prepublish": "yarn run build",
25+
"test": "jest --maxWorkers=2"
26+
},
27+
"sideEffects": false,
28+
"main": "dist/cjs/index.js",
29+
"module": "dist/esm/index.js",
30+
"files": [
31+
"dist"
32+
],
3633
"dependencies": {},
3734
"devDependencies": {
38-
"babel-cli": "~6.24.1",
39-
"babel-core": "~6.24.1",
40-
"babel-eslint": "~7.2.3",
41-
"babel-preset-es2015": "~6.24.1",
42-
"babel-preset-stage-0": "~6.24.1",
43-
"coveralls": "~2.13.1",
44-
"eslint": "~3.19.0",
45-
"eslint-config-trendmicro": "~0.5.1",
46-
"eslint-plugin-import": "~2.2.0",
47-
"eslint-plugin-jsx-a11y": "~2.2.3",
48-
"eslint-plugin-react": "~6.10.0",
49-
"tap": "~10.3.2",
50-
"webpack": "~3.5.6"
35+
"@babel/cli": "^7.0.0",
36+
"@babel/core": "^7.0.0",
37+
"@babel/eslint-parser": "^7.0.0",
38+
"@babel/eslint-plugin": "^7.0.0",
39+
"@babel/plugin-transform-runtime": "^7.0.0",
40+
"@babel/preset-env": "^7.0.0",
41+
"@rollup/plugin-babel": "^6.0.0",
42+
"@rollup/plugin-node-resolve": "^15.0.0",
43+
"@trendmicro/babel-config": "^1.0.2",
44+
"cross-env": "^7.0.3",
45+
"del-cli": "^5.0.0",
46+
"eslint": "^8.25.0",
47+
"jest": "^29.0.0",
48+
"rollup": "^3"
5149
},
52-
"nyc": {
53-
"exclude": [
54-
"test/index.js"
50+
"jest": {
51+
"collectCoverage": true,
52+
"collectCoverageFrom": [
53+
"<rootDir>/src/**/*.js"
54+
],
55+
"coverageReporters": [
56+
"lcov",
57+
"text",
58+
"html"
59+
],
60+
"modulePathIgnorePatterns": [],
61+
"setupFiles": [],
62+
"setupFilesAfterEnv": [],
63+
"testEnvironment": "node",
64+
"testMatch": [
65+
"<rootDir>/**/__tests__/**/*.test.js"
5566
]
5667
}
5768
}

0 commit comments

Comments
 (0)