Skip to content

Commit

Permalink
- upgraded ts-library-template (yarn -> pnpm, deps, support for paths…
Browse files Browse the repository at this point in the history
…, etc.)
  • Loading branch information
dzek69 committed Aug 22, 2023
1 parent 93e5122 commit 11011ea
Show file tree
Hide file tree
Showing 14 changed files with 5,655 additions and 5,225 deletions.
5 changes: 2 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@
"react": {
"createClass": "createReactClass",
"pragma": "React",
"version": "detect",
"flowVersion": "detect"
"version": "detect"
},
"propWrapperFunctions": []
}
}
}
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [UNRELEASED]
(nothing yet)

## [1.1.3+]
### Dev
- upgraded ts-library-template (yarn -> pnpm, deps, support for paths, etc.)

## [1.1.3] - 2023-07-03
### Fixed
- `useGeolocation` causing blinking GPS icon on mobile
Expand Down
33 changes: 0 additions & 33 deletions babel.config.js

This file was deleted.

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: 4 additions & 0 deletions build-scripts/compile.esm.after.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
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]");
})();
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"
}
]
}
};


43 changes: 22 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"name": "@ezez/hooks",
"version": "1.1.3",
"version": "1.1.3+",
"repository": "[email protected]:dzek69/ezez-hooks.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 compile:esm && pnpm 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 lint --fix",
"prepack": "pnpm compile",
"prepublishOnly": "pnpm audit && pnpm lint && pnpm test && pnpm docs",
"prepare": "husky install",
"start:dev": "next dev",
"start:dev:compatibility": "TS_NODE_FILES=true yarn start:dev",
"start:dev:compatibility": "TS_NODE_FILES=true pnpm start:dev",
"updates": "npx --yes npm-check-updates --dep prod",
"updates:dev": "npx --yes npm-check-updates --dep dev",
"updates:all": "npx --yes npm-check-updates"
Expand All @@ -37,46 +37,47 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@babel/core": "^7.22.1",
"@babel/preset-env": "^7.22.4",
"@babel/preset-typescript": "^7.21.5",
"@dzek69/eslint-config-base": "^2.4.0",
"@dzek69/eslint-config-import": "^1.2.0",
"@dzek69/eslint-config-import-typescript": "^1.0.0",
"@babel/core": "^7.22.8",
"@babel/preset-env": "^7.22.7",
"@babel/preset-typescript": "^7.22.5",
"@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-react": "^1.2.2",
"@dzek69/eslint-config-typescript": "^1.1.0",
"@dzek69/eslint-config-typescript": "^1.1.1",
"@ezez/utils": "^1.8.0",
"@knodes/typedoc-plugin-pages": "^0.23.4",
"@types/jest": "^29.5.2",
"@types/react": "^18.2.8",
"@types/react-dom": "^18.2.4",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"babel-plugin-module-extension": "^0.1.3",
"babel-plugin-module-resolver": "^5.0.0",
"eslint": "^8.38.0",
"eslint": "^8.44.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.6.0",
"fs-extra": "^11.1.1",
"husky": "^8.0.3",
"jest": "^29.5.0",
"jest": "^29.6.1",
"must": "^0.13.4",
"next": "^13.4.4",
"next": "^13.4.9",
"nodemon": "^2.0.22",
"prettier": "^2.8.8",
"sass": "^1.35.2",
"ts-node": "^10.9.1",
"typedoc": "^0.23.28",
"typescript": "^5.1.3"
"typescript": "^5.1.3",
"resolve-tspaths": "^0.8.14"
},
"husky": {
"hooks": {
"pre-push": "yarn prepublishOnly && yarn compile"
"pre-push": "pnpm prepublishOnly && pnpm compile"
}
},
"libraryTemplate": {
"version": "3.10.0",
"version": "3.11.1",
"language": "typescript",
"fixDefaultForCommonJS": true,
"jsx": true
Expand Down
Loading

0 comments on commit 11011ea

Please sign in to comment.