Skip to content

Commit

Permalink
chore: removing old dependencies and update others
Browse files Browse the repository at this point in the history
  • Loading branch information
nmccready committed Sep 13, 2024
1 parent 2a50d49 commit e4e2574
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_call:
push:
pull_request:
branches: ["main"]
branches: ["master"]

jobs:
commitlint:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: release

on:
push:
branches: ["main"]
branches: ["master"]
tags-ignore: ['**']

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: tests
on:
workflow_call:
pull_request:
branches: ["main"]
branches: ["master"]

jobs:
test:
Expand Down
32 changes: 0 additions & 32 deletions _jest.config.no

This file was deleted.

22 changes: 15 additions & 7 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
/** @type {import('ts-jest').JestConfigWithTsJest} * */
module.exports = {
testEnvironment: 'node',
transform: {
'^.+.tsx?$': ['ts-jest', {}],
},
testMatch: ['**/?(*.)+(spec|test).[tj]s?(x)'],
const toNotIgnore = {
modules: [].join('|'),
};

const toExport = {
roots: ['<rootDir>'],
transformIgnorePatterns: ['node_modules', '/<rootDir>/lib', '/<rootDir>/(?!src)'],
verbose: true,
testRegex: '(/test/.*(test|spec))\\.[jt]sx?$',
};

if (toNotIgnore.modules.length) {
toExport.transformIgnorePatterns.push(`/node_modules/(?!(${toNotIgnore.modules}))`);
}

module.exports = toExport;
21 changes: 8 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@
"umd"
],
"scripts": {
"build": "npx tsc",
"build": "rollup -c ./rollup.config.js",
"coveralls": "cat ./coverage/lcov.info | coveralls",
"docs:api:markdown": "npx typedoc --theme markdown --exclude ./src/test --out ./docs/api ./src",
"docs:api:website": "npx typedoc --exclude ./src/test --out docs ./src",
"jest": "npx ts-jest",
"jest": "npx jest",
"lint": "eslint --ext .js,.ts,.tsx *.js src test --color",
"mocha": "mocha",
"prepare": "npx sort-package-json",
"roll:it": "rollup -c ./rollup.config.ts",
"test": "npm run lint && npm run jest",
"test": "npm run build && npm run jest",
"test:ci": "npm run build && npm run test --coverage && npm run coveralls",
"preversion": "npm run build"
},
Expand All @@ -43,26 +42,22 @@
"@biiaidt/node-memwatch": "2.0.1",
"@commitlint/cli": "^19",
"@commitlint/config-conventional": "^19",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-typescript": "^11.1.6",
"@types/debug": "^4",
"@types/jest": "^29.5.13",
"@znemz/js-common-eslint-config": "^0.2.2",
"@znemz/react-extras-jest": "1.5.1",
"JSONStream": "1.X",
"commitlint": "19",
"config": "^3.2.2",
"coveralls": "^3.0.4",
"del": "^4.1.1",
"esm": "^3.2.22",
"gulp": "^4.0.2",
"gulp-run": "^1.7.1",
"gulp-typescript": "^5.0.1",
"hook-std": "0.X",
"jest": "^29.7.0",
"jest-extended": "^0.11.5",
"JSONStream": "1.X",
"prettier": "^1.18.2",
"rollup": "4.21.3",
"sort-package-json": "^2.10.1",
"ts-jest": "^29.2.5",
"typedoc": "0.26.7",
"typedoc-plugin-markdown": "^4.2.7",
"typescript": "^4.2.4"
},
"engines": {
Expand Down
28 changes: 28 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const typescript = require('@rollup/plugin-typescript');
const commonjs = require('@rollup/plugin-commonjs');

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

module.exports = {
external: ['memoizee'],
input: 'src/index.ts',
output: [
{
file: pkg.umd,
format: 'umd',
name: 'DebugFabulous',
globals: {
memoizee: 'memoizee',
},
},
{
file: pkg.main,
format: 'commonjs',
name: 'DebugFabulous',
globals: {
memoizee: 'memoizee',
},
},
],
plugins: [commonjs(), typescript()],
};
2 changes: 1 addition & 1 deletion test/helpers/watchLeaks.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ const watchLeaks = () => {
return new memwatch.HeapDiff();
};

export default watchLeaks;
module.exports = watchLeaks;
10 changes: 5 additions & 5 deletions test/index.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import hook from 'hook-std';
import config from 'config';
import watchLeaks from './helpers/watchLeaks';
const hook = require('hook-std');
const config = require('config');
const watchLeaks = require('./helpers/watchLeaks');

/* eslint-disable no-console */
const heapDiff = watchLeaks();
Expand Down Expand Up @@ -33,11 +33,11 @@ describe('index / spawn', () => {

describe('namespacing', () => {
beforeEach(() => {
const origDebug = require('../src')();
const origDebug = require('../lib')();
origDebug.save('root*');
origDebug.enable(origDebug.load());

rootDbg = require('../src').spawnable('root', origDebug);
rootDbg = require('../lib').spawnable('root', origDebug);
// console.log(rootDbg);
});

Expand Down
12 changes: 6 additions & 6 deletions test/lazyEval.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import hook from 'hook-std';
import config from 'config';
import watchLeaks from './helpers/watchLeaks';
const hook = require('hook-std');
const config = require('config');
const watchLeaks = require('./helpers/watchLeaks');

const debugFact = require('../src/debugFabFactory')();
const debugFact = require('../lib')();

/* eslint-disable no-console */
const heapDiff = watchLeaks();
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('lazyEval', () => {
return 'crap';
});
unhook();
expect(called).toBeFalse();
expect(called).toEqual(false);
});

it('normal', () => {
Expand All @@ -143,7 +143,7 @@ describe('lazyEval', () => {

debug('crap');
unhook();
expect(called).toBeFalse();
expect(called).toEqual(false);
});
});
});
2 changes: 1 addition & 1 deletion test/spawn.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import debugFabAPI from '../src';
const debugFabAPI = require('../lib');

const origDebug = debugFabAPI();
origDebug.save('root*');
Expand Down
9 changes: 5 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
"noLib": false,
"emitDecoratorMetadata": true,
"noImplicitAny": false,
"module": "commonjs",
"module": "ESNext",
"target": "ES2020",
"experimentalDecorators": true,
"sourceMap": false,
"declaration": true,
"noResolve": false,
"moduleResolution": "node",
"outDir": ".tmp"
}
"outDir": ".tmp",
"allowJs": true,
},
"exclude": ["node_modules", ".tmp", "jest.config.js"]
}

0 comments on commit e4e2574

Please sign in to comment.