Skip to content

Commit 3df780f

Browse files
committed
Drop CommonJS support
1 parent 9212c50 commit 3df780f

22 files changed

+66
-173
lines changed

.github/CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ If you wish to contribute to the **Float Toolkit** codebase, feel free to fork t
1111
1. Refer to the [documentation](https://float-toolkit.web.app) to make sure the error is actually a bug and not a mistake of your own.
1212
1. Make sure the issue hasn't already been reported or suggested.
1313
1. Fork and clone the repository, and checkout the corresponding branch (`docs` for documentation, `master` for anything else). **DO NOT** modify the `stable` branch.
14-
1. Make your changes (if necessary, add or modify documentation and tests to cover your changes).
14+
1. Make your changes (add or modify tests and documentation comments as necessary to cover your changes).
1515
1. Run `npm run buildWithDocs` (or VSCode task _NPM: Build and generate documentation_) to run the tests and build the package and documentation (you can use `npm link` to try it locally).
1616
1. [Submit a pull request](https://github.com/float-toolkit/core/compare).
17+
18+
**IMPORTANT: Every `import` statement in source code files (not test files) must include a `.js` file extension.**

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,4 @@ Before creating an issue, please consider the following:
117117
- Refer to the [documentation](https://float-toolkit.web.app) to make sure the error is actually a bug and not a mistake of your own.
118118
- Make sure the issue hasn't already been reported or suggested.
119119
- After following these steps, you can file an issue using one of our [templates](https://github.com/float-toolkit/core/issues/new/choose). Please make sure to follow our [Code of Conduct](https://github.com/float-toolkit/core/blob/master/.github/CODE_OF_CONDUCT.md).
120-
- If you wish to [submit a pull request](https://github.com/float-toolkit/core/compare) alongside your issue, please follow our [contribution guidelines](https://github.com/float-toolkit/core/blob/master/.github/CONTRIBUTING.md) .
120+
- If you wish to [submit a pull request](https://github.com/float-toolkit/core/compare) alongside your issue, please follow our [contribution guidelines](https://github.com/float-toolkit/core/blob/master/.github/CONTRIBUTING.md).

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ const config = {
2020
},
2121
};
2222

23-
module.exports = config;
23+
export default config;

package-lock.json

Lines changed: 0 additions & 107 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
{
22
"name": "@float-toolkit/core",
33
"version": "2.0.0",
4-
"description": "Float Toolkit is a Node.js package for working with floating-point numbers.",
4+
"description": "Float Toolkit is an NPM package for working with floating-point numbers.",
55
"main": "./dist/index.js",
6-
"module": "./dist/index.mjs",
6+
"type": "module",
77
"types": "./typings/index.d.ts",
88
"exports": {
99
".": {
10-
"require": "./dist/index.js",
11-
"import": "./dist/index.mjs"
10+
"import": "./dist/index.js"
1211
}
1312
},
1413
"scripts": {
15-
"build": "rm -rf dist typings && npm run format && npm test && tsc && gen-esm-wrapper dist dist/index.mjs",
14+
"build": "rm -rf dist typings && npm run format && npm test && tsc && node dist/index.js",
1615
"format": "prettier --write .",
1716
"docs": "rm -rf docs && npm run format && npm test && typedoc",
1817
"buildWithDocs": "rm -rf docs && npm run build && typedoc",
@@ -30,8 +29,7 @@
3029
"round",
3130
"math",
3231
"no-dependencies",
33-
"dependency-less",
34-
"Node.js"
32+
"dependency-less"
3533
],
3634
"author": "LuisFerLCC",
3735
"license": "Apache-2.0",
@@ -41,7 +39,6 @@
4139
"homepage": "https://float-toolkit.web.app/",
4240
"devDependencies": {
4341
"@types/node": "^17.0.35",
44-
"gen-esm-wrapper": "^1.1.3",
4542
"jest": "^28.1.0",
4643
"jest-ts-webcompat-resolver": "^1.0.0",
4744
"prettier": "^2.6.2",

src/eval/isValidPrecision.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { precisionRange } from "../precisionRange";
1+
import { precisionRange } from "../precisionRange.js";
22

3-
import { isNumber } from "./isNumber";
3+
import { isNumber } from "./isNumber.js";
44

55
/**
66
* @internal

src/eval/validateNumbersArray.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { isNumbersArray } from "./isNumbersArray";
1+
import { isNumbersArray } from "./isNumbersArray.js";
22

3-
import { throwNumbersError } from "../errors/throwNumbersError";
3+
import { throwNumbersError } from "../errors/throwNumbersError.js";
44

55
/**
66
* @internal

src/eval/validateOptions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import FloatToolkit from "..";
2-
import { defaultOptions } from "../defaultOptions";
1+
import FloatToolkit from "../index.js";
2+
import { defaultOptions } from "../defaultOptions.js";
33

4-
import { FloatToolkitError } from "../errors/FloatToolkitError";
4+
import { FloatToolkitError } from "../errors/FloatToolkitError.js";
55

66
/**
77
* @internal

src/functions/add.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import FloatToolkit from "..";
1+
import FloatToolkit from "../index.js";
22

3-
import { addArrayItem } from "./addArrayItem";
3+
import { addArrayItem } from "./addArrayItem.js";
44

5-
import { validateNumbersArray } from "../eval/validateNumbersArray";
5+
import { validateNumbersArray } from "../eval/validateNumbersArray.js";
66

77
/**
88
* @internal

src/functions/addArrayItem.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import FloatToolkit from "..";
1+
import FloatToolkit from "../index.js";
22

3-
import { round } from "./round";
3+
import { round } from "./round.js";
44

5-
import { getMaxPrecision } from "../get-precision/getMaxPrecision";
5+
import { getMaxPrecision } from "../get-precision/getMaxPrecision.js";
66

77
/**
88
* @internal

0 commit comments

Comments
 (0)