Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change to ECMAScript module from commonJS #6

Merged
merged 4 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// jest.config.ts
import { createDefaultEsmPreset, type JestConfigWithTsJest } from 'ts-jest'

const defaultEsmPreset = createDefaultEsmPreset()

const jestConfig: JestConfigWithTsJest = {
// [...]
...defaultEsmPreset,
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},

}

export default jestConfig
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"private": false,
"scripts": {
"build": "tsc",
"test": "testyts",
"test": "jest",
"doc": "typedoc src/main/ts/TSOFA.ts",
"eslint": "eslint ."
},
Expand Down Expand Up @@ -42,7 +42,8 @@
"eslint-plugin-jsdoc": "^46.8.1",
"eslint-plugin-prefer-arrow": "^1.2.3",
"globals": "^15.9.0",
"testyts": "^1.5.0",
"jest": "^29.7.0",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.1",
"typedoc": "^0.25.6",
"typescript": "^5.2.2",
Expand Down
4 changes: 2 additions & 2 deletions src/main/ts/TSOFA.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TSOFAIllegalParameter } from "./TSOFAIllegalParameter";
import { TSOFAInternalError } from "./TSOFAInternalError";
import { TSOFAIllegalParameter } from "./TSOFAIllegalParameter.js";
import { TSOFAInternalError } from "./TSOFAInternalError.js";
/**
* Typescript implementation of Standards of Fundamental Astronomy. <a href="http://www.iausofa.org/">http://www.iausofa.org/</a>
*
Expand Down
4,134 changes: 1,956 additions & 2,178 deletions src/test/ts/TSOFATest.spec.ts

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion testy.json

This file was deleted.

9 changes: 6 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"module": "ESNext",
"target": "ES2020",
"declaration": true,
"sourceMap": true,
"declarationMap": true,
"esModuleInterop": true,
"strict": false,
"moduleResolution": "Node",
"experimentalDecorators": true,
"lib": [ "es6" ] ,
"outDir": "./dist"
},
"include": [
Expand Down
2,009 changes: 1,908 additions & 101 deletions yarn.lock

Large diffs are not rendered by default.

Loading