From bbaa93ab046914eaf3c2138b5832f616207eb65e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Oddsson?= Date: Wed, 8 May 2024 22:27:03 +0200 Subject: [PATCH] Cleanup karma and rollup (#52) * remove unused karma config * remove rollup * update CI action --- .github/workflows/nodejs.yml | 23 +++---- karma.conf.cjs | 19 ------ package-lock.json | 128 ----------------------------------- package.json | 7 +- rollup.config.js | 11 --- 5 files changed, 11 insertions(+), 177 deletions(-) delete mode 100644 karma.conf.cjs delete mode 100644 rollup.config.js diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index b0631c1..3720810 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -1,4 +1,4 @@ -name: Build +name: Test on: pull_request: @@ -7,36 +7,33 @@ on: - main jobs: - build: - name: Build + test: + name: Test runs-on: ubuntu-latest steps: - name: Get sources - uses: actions/checkout@v1 + uses: actions/checkout@v4 - name: Restore npm cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - - uses: actions/cache@v2 + - uses: actions/cache@v4 with: path: node_modules key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node-modules- - - name: Use Node.js 16 - uses: actions/setup-node@v3 + - name: Use Node.js 22 + uses: actions/setup-node@v4 with: - node-version: '16' + node-version: "22" - name: Install dependencies - run: npm install - - - name: Build - run: npm run build --if-present + run: npm ci - name: Test run: npm run test diff --git a/karma.conf.cjs b/karma.conf.cjs deleted file mode 100644 index c63fb1c..0000000 --- a/karma.conf.cjs +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = function configureKarma(config) { - config.set({ - basePath: '', - browsers: [ 'ChromeHeadless' ], - logLevel: process.env.npm_config_debug ? config.LOG_DEBUG : config.LOG_INFO, - frameworks: [ 'mocha' ], - files: [ { pattern: './dist/test.bundle.js', type: 'module' } ], - reporters: [ 'progress', 'coverage' ], - coverageReporter: { - type: 'lcov', - dir: 'coverage', - }, - port: 9876, - colors: true, - concurrency: 3, - autoWatch: false, - singleRun: true, - }); -}; diff --git a/package-lock.json b/package-lock.json index 55be490..f4a6fe6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,8 +7,6 @@ "name": "check-error", "license": "MIT", "devDependencies": { - "@rollup/plugin-commonjs": "^21.0.0", - "@rollup/plugin-node-resolve": "^13.0.5", "@web/test-runner": "^0.17.0", "browserify": "^13.0.0", "browserify-istanbul": "^1.0.0", @@ -17,7 +15,6 @@ "eslint-plugin-filenames": "^0.2.0", "ghooks": "^1.0.1", "mocha": "^9.1.2", - "rollup": "^2.58.0", "semantic-release": "^4.3.5", "simple-assert": "^2.0.0", "validate-commit-msg": "^2.3.1" @@ -342,70 +339,6 @@ "node": ">=12" } }, - "node_modules/@rollup/plugin-commonjs": { - "version": "21.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-21.0.0.tgz", - "integrity": "sha512-XDQimjHl0kNotAV5lLo34XoygaI0teqiKGJ100B3iCU8+15YscJPeqk2KqkqD3NIe1H8ZTUo5lYjUFZyEgASTw==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^3.1.0", - "commondir": "^1.0.1", - "estree-walker": "^2.0.1", - "glob": "^7.1.6", - "is-reference": "^1.2.1", - "magic-string": "^0.25.7", - "resolve": "^1.17.0" - }, - "engines": { - "node": ">= 8.0.0" - }, - "peerDependencies": { - "rollup": "^2.38.3" - } - }, - "node_modules/@rollup/plugin-node-resolve": { - "version": "13.0.5", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.0.5.tgz", - "integrity": "sha512-mVaw6uxtvuGx/XCI4qBQXsDZJUfyx5vp39iE0J/7Hd6wDhEbjHr6aES7Nr9yWbuE0BY+oKp6N7Bq6jX5NCGNmQ==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^3.1.0", - "@types/resolve": "1.17.1", - "builtin-modules": "^3.1.0", - "deepmerge": "^4.2.2", - "is-module": "^1.0.0", - "resolve": "^1.19.0" - }, - "engines": { - "node": ">= 10.0.0" - }, - "peerDependencies": { - "rollup": "^2.42.0" - } - }, - "node_modules/@rollup/pluginutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", - "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", - "dev": true, - "dependencies": { - "@types/estree": "0.0.39", - "estree-walker": "^1.0.1", - "picomatch": "^2.2.2" - }, - "engines": { - "node": ">= 8.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0" - } - }, - "node_modules/@rollup/pluginutils/node_modules/estree-walker": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", - "dev": true - }, "node_modules/@semantic-release/commit-analyzer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-2.0.0.tgz", @@ -549,12 +482,6 @@ "integrity": "sha512-epMsEE85fi4lfmJUH/89/iV/LI+F5CvNIvmgs5g5jYFPfhO2S/ae8WSsLOKWdwtoaZw9Q2IhJ4tQ5tFCcS/4HA==", "dev": true }, - "node_modules/@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true - }, "node_modules/@types/express": { "version": "4.17.17", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz", @@ -682,15 +609,6 @@ "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", "dev": true }, - "node_modules/@types/resolve": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", - "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/send": { "version": "0.17.1", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.1.tgz", @@ -2407,12 +2325,6 @@ "node": ">=12.17" } }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -4770,15 +4682,6 @@ "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", "dev": true }, - "node_modules/is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "dev": true, - "dependencies": { - "@types/estree": "*" - } - }, "node_modules/is-resolvable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", @@ -5654,15 +5557,6 @@ "yallist": "^2.1.2" } }, - "node_modules/magic-string": { - "version": "0.25.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", - "dev": true, - "dependencies": { - "sourcemap-codec": "^1.4.4" - } - }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -7669,21 +7563,6 @@ "inherits": "^2.0.1" } }, - "node_modules/rollup": { - "version": "2.58.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.58.0.tgz", - "integrity": "sha512-NOXpusKnaRpbS7ZVSzcEXqxcLDOagN6iFS8p45RkoiMqPHDLwJm758UF05KlMoCRbLBTZsPOIa887gZJ1AiXvw==", - "dev": true, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=10.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, "node_modules/run-async": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", @@ -8069,13 +7948,6 @@ "node": ">=0.10.0" } }, - "node_modules/sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "deprecated": "Please use @jridgewell/sourcemap-codec instead", - "dev": true - }, "node_modules/spawn-command": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2.tgz", diff --git a/package.json b/package.json index 4f002d5..7e14202 100644 --- a/package.json +++ b/package.json @@ -26,11 +26,9 @@ "url": "git+ssh://git@github.com/chaijs/check-error.git" }, "scripts": { - "build": "rollup -c rollup.config.js", "lint": "eslint --ignore-path .gitignore index.js test/", - "prepublish": "npm run build", "semantic-release": "semantic-release pre && npm publish && semantic-release post", - "pretest": "npm run lint && npm run build", + "pretest": "npm run lint", "test": "npm run test:node && npm run test:browser", "test:browser": "web-test-runner", "test:node": "mocha" @@ -58,8 +56,6 @@ } }, "devDependencies": { - "@rollup/plugin-commonjs": "^21.0.0", - "@rollup/plugin-node-resolve": "^13.0.5", "@web/test-runner": "^0.17.0", "browserify": "^13.0.0", "browserify-istanbul": "^1.0.0", @@ -68,7 +64,6 @@ "eslint-plugin-filenames": "^0.2.0", "ghooks": "^1.0.1", "mocha": "^9.1.2", - "rollup": "^2.58.0", "semantic-release": "^4.3.5", "simple-assert": "^2.0.0", "validate-commit-msg": "^2.3.1" diff --git a/rollup.config.js b/rollup.config.js deleted file mode 100644 index 7eb8df8..0000000 --- a/rollup.config.js +++ /dev/null @@ -1,11 +0,0 @@ -import { nodeResolve } from '@rollup/plugin-node-resolve'; -import commonjs from '@rollup/plugin-commonjs'; - -export default { - input: './test/index.js', - output: { - file: './dist/test.bundle.js', - format: 'es', - }, - plugins: [ nodeResolve(), commonjs() ], -};