Skip to content

Commit

Permalink
Rewrite the whole project with Typescript (#93)
Browse files Browse the repository at this point in the history
* Rewrite whole project with Typescript

* Update linting

* Minor change

* Update CI

* Fix error message

* Minor change

* Stricter typing in benchmarks script

* Minor changes
  • Loading branch information
mondeja authored May 11, 2022
1 parent 5e3fcaf commit 3ff4528
Show file tree
Hide file tree
Showing 23 changed files with 541 additions and 290 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ jobs:
run: npm ci
- name: Lint
run: npm run lint
- name: Check format
run: npm run format:check

npm:
if: startsWith(github.ref, 'refs/tags/')
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

set -e

run-s build examples test
run-s build test
git add .
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/common.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const svgPathBbox = require("../dist/cjs");
const svgPathBbox = require("../dist/wrapper.js");

console.log(svgPathBbox("M0 0H3V6Z"));
3 changes: 3 additions & 0 deletions examples/esm.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import svgPathBbox from "../dist/wrapper.js";

console.log(svgPathBbox("M0 0H3V6Z"));
3 changes: 0 additions & 3 deletions examples/esm/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions examples/esm/package.json

This file was deleted.

5 changes: 3 additions & 2 deletions jest.config.js → jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
testEnvironment: "node",
export default {
preset: "ts-jest",
collectCoverage: true,
coverageDirectory: "<rootDir>/tests/coverage",
collectCoverageFrom: ["src/*.ts"],
};
Loading

0 comments on commit 3ff4528

Please # to comment.