Skip to content

Commit

Permalink
~ big dev deps update
Browse files Browse the repository at this point in the history
  • Loading branch information
dzek69 committed Mar 31, 2024
1 parent 28c4f2c commit cb6f84e
Show file tree
Hide file tree
Showing 14 changed files with 5,465 additions and 5,180 deletions.
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/build-scripts/
/test/

/babel.config.js
/jest.config.cjs
/yarn.lock
/*.tgz
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ The format is based on [EZEZ Changelog](https://ezez.dev/changelog/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [UNRELEASED]
- (nothing yet)

## [5.1.0] - 2024-03-31
### Added
- `timeLeft` property
### Changed
- `restartOnly` methods supports updating timeout and instant first run
- `startOnly` methods supports updating instant first run
### Fixed
- JSDoc is invalid about return types
### Dev
- big dev deps update

## [5.0.0] - 2023-05-07
### Added
Expand Down
3 changes: 3 additions & 0 deletions build-scripts/compile.cjs.after.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import fs from "fs-extra";
import { run } from "./utils.mjs";

const contents = `{"type": "commonjs"}`;

(async () => {
console.info("[CJS compile post-processing started]");
await fs.writeFile("./dist/package.json", contents);
console.info("Written dist/package.json with commonjs type fix");
await run("resolve-tspaths", ["--project", "tsconfig.cjs.json"]);
console.info("Resolved TypeScript import paths");
console.info("[CJS compile post-processing ended]");
})();
4 changes: 3 additions & 1 deletion build-scripts/compile.esm.after.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import fs from "fs-extra";
import {run} from "./utils.mjs";

(async () => {
console.info("[ESM compile post-processing started]");
await run("resolve-tspaths", ["--project", "tsconfig.esm.json"]);
console.info("Resolved TypeScript import paths");
console.info("[ESM compile post-processing ended]");
})();
26 changes: 26 additions & 0 deletions build-scripts/utils.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { spawn } from "child_process";

const run = (command, args) => {
return new Promise((resolve, reject) => {
const cmd = spawn(command, args, {
stdio: ["ignore", "inherit", "inherit"],
});

cmd.on("close", (code) => {
if (!code) {
resolve();
return;
}

reject(new Error(`Program exited with code ${code}`));
});

cmd.on("error", () => {
reject(new Error(`Can't start program`));
});
});
};

export {
run
}
35 changes: 21 additions & 14 deletions jest.config.cjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
module.exports = {
// testMatch: [],
collectCoverageFrom: [
'src/**/*.{mjs,js,jsx,ts,tsx}',
'!**/*.d.ts'
],
setupFiles: [
'<rootDir>/test/bootstrap.cjs'
],
testURL: 'http://localhost:8080',
moduleNameMapper: {
'^(.*)\.js$': '$1',
},
"collectCoverageFrom": [
"src/**/*.{mjs,js,jsx,ts,tsx}",
"!**/*.d.ts"
],
"setupFiles": [
"<rootDir>/test/bootstrap.cjs"
],
"moduleNameMapper": {
"^(.*).js$": "$1"
},
"testEnvironmentOptions": {
"url": "http://localhost:8080"
},
"transform": {
"\\.[jt]sx?$": [
"babel-jest",
{
"configFile": "./test/babel.config.cjs"
}
]
}
};


57 changes: 29 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"name": "oop-timers",
"version": "5.0.0+",
"version": "5.1.0",
"repository": "[email protected]:dzek69/oop-timers.git",
"author": "Jacek Nowacki",
"license": "MIT",
"scripts": {
"test": "NODE_ENV=test jest",
"docs": "typedoc src/index.ts --skipErrorChecking --out docs --includeVersion",
"compile": "yarn compile:esm && yarn compile:cjs",
"compile": "pnpm run compile:esm && pnpm run compile:cjs",
"compile:esm": "rm -rf esm && tsc --project tsconfig.esm.json && node ./build-scripts/compile.esm.after.mjs",
"compile:cjs": "rm -rf dist && tsc --project tsconfig.cjs.json && node ./build-scripts/compile.cjs.after.mjs",
"typecheck": "tsc --noEmit",
"lint": "eslint src --ext .ts,.tsx,.js,.jsx,.mjs",
"lint:fix": "yarn lint --fix",
"prepack": "yarn compile",
"prepublishOnly": "yarn audit && yarn lint && yarn test && yarn docs",
"lint:fix": "pnpm run lint --fix",
"prepack": "pnpm run compile",
"prepublishOnly": "pnpm audit && pnpm run lint && pnpm run test && pnpm run docs",
"start:dev": "nodemon",
"start:dev:compatibility": "TS_NODE_FILES=true yarn start:dev",
"start:dev:compatibility": "TS_NODE_FILES=true pnpm run start:dev",
"prepare": "husky install",
"updates": "npx --yes npm-check-updates --dep prod",
"updates:dev": "npx --yes npm-check-updates --dep dev",
"updates:all": "npx --yes npm-check-updates"
"updates": "pnpm dlx npm-check-updates --dep prod",
"updates:dev": "pnpm dlx npm-check-updates --dep dev",
"updates:all": "pnpm dlx npm-check-updates"
},
"exports": {
".": {
Expand All @@ -35,37 +35,38 @@
"type": "module",
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.21.4",
"@babel/preset-env": "^7.21.4",
"@babel/preset-typescript": "^7.21.4",
"@dzek69/eslint-config-base": "^2.4.0",
"@dzek69/eslint-config-typescript": "^1.1.0",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"@babel/core": "^7.22.20",
"@babel/preset-env": "^7.22.20",
"@babel/preset-typescript": "^7.22.15",
"@dzek69/eslint-config-base": "^2.5.0",
"@dzek69/eslint-config-import": "^1.3.0",
"@dzek69/eslint-config-import-typescript": "^1.0.1",
"@dzek69/eslint-config-typescript": "^1.1.1",
"@knodes/typedoc-plugin-pages": "^0.23.4",
"@types/jest": "^29.5.5",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"babel-plugin-module-extension": "^0.1.3",
"eslint": "^8.38.0",
"eslint": "^8.44.0",
"eslint-plugin-import": "^2.28.1",
"fs-extra": "^11.1.1",
"husky": "^8.0.3",
"jest": "^29.5.0",
"jest": "^29.7.0",
"must": "^0.13.4",
"nodemon": "^2.0.22",
"nodemon": "^3.0.1",
"prettier": "^2.8.8",
"ts-node": "^10.9.1",
"typedoc": "^0.23.0",
"typescript": "^5.0.4",
"@types/jest": "^29.5.0",
"eslint-plugin-import": "^2.27.5",
"@dzek69/eslint-config-import": "^1.2.0",
"@dzek69/eslint-config-import-typescript": "^1.0.0",
"@knodes/typedoc-plugin-pages": "^0.23.4",
"prettier": "^2.8.7"
"typescript": "^5.2.2",
"resolve-tspaths": "^0.8.15"
},
"husky": {
"hooks": {
"pre-push": "yarn prepublishOnly && yarn compile"
"pre-push": "pnpm run prepublishOnly && pnpm run compile"
}
},
"libraryTemplate": {
"version": "3.9.1",
"version": "3.11.2",
"language": "typescript",
"fixDefaultForCommonJS": true,
"jsx": false
Expand Down
Loading

0 comments on commit cb6f84e

Please sign in to comment.