Skip to content

Commit

Permalink
fix(esm): add .js extension to imports (#75)
Browse files Browse the repository at this point in the history
This will output ESM valid imports.
  • Loading branch information
omichelsen authored Jul 13, 2024
1 parent da8ee8a commit e10de90
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/compare.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { compareVersions } from './compareVersions';
import { CompareOperator } from './utils';
import { compareVersions } from './compareVersions.js';
import { CompareOperator } from './utils.js';

/**
* Compare [semver](https://semver.org/) version strings using the specified operator.
Expand Down
2 changes: 1 addition & 1 deletion src/compareVersions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { compareSegments, validateAndParse } from './utils';
import { compareSegments, validateAndParse } from './utils.js';

/**
* Compare [semver](https://semver.org/) version strings to find greater, equal or lesser.
Expand Down
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { compare } from './compare';
export { compareVersions } from './compareVersions';
export { satisfies } from './satisfies';
export { CompareOperator } from './utils';
export { validate, validateStrict } from './validate';
export { compare } from './compare.js';
export { compareVersions } from './compareVersions.js';
export { satisfies } from './satisfies.js';
export { CompareOperator } from './utils.js';
export { validate, validateStrict } from './validate.js';
4 changes: 2 additions & 2 deletions src/satisfies.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { compare } from './compare';
import { CompareOperator, compareSegments, validateAndParse } from './utils';
import { compare } from './compare.js';
import { CompareOperator, compareSegments, validateAndParse } from './utils.js';

/**
* Match [npm semver](https://docs.npmjs.com/cli/v6/using-npm/semver) version range.
Expand Down
2 changes: 1 addition & 1 deletion src/validate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { semver } from './utils';
import { semver } from './utils.js';

/**
* Validate [semver](https://semver.org/) version strings.
Expand Down
34 changes: 16 additions & 18 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
{
"compilerOptions": {
"declaration": true,
"esModuleInterop": true,
"module": "UMD",
"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": ".",
"sourceMap": true,
"strict": true,
"target": "ES5"
},
"include": [
"src/index.ts"
],
"exclude": [
"./src/test/**/*",
"node_modules"
]
"compilerOptions": {
"declaration": true,
"esModuleInterop": true,
"module": "UMD",
"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": ".",
"sourceMap": true,
"strict": true,
"target": "ES5"
},
"include": ["src/index.ts"],
"exclude": ["./src/test/**/*", "node_modules"],
"ts-node": {
"experimentalResolver": true
}
}

0 comments on commit e10de90

Please sign in to comment.