Skip to content

Commit

Permalink
fix: fix cli as .mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
tianyingchun committed Aug 12, 2024
1 parent 2fa9d23 commit 6d35faf
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/good-tables-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hyperse/vitest-coverage-reporter": patch
---

change cli as `.mjs`
2 changes: 1 addition & 1 deletion bin/generate-coverage-report.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node

import { main } from '../dist/main.js';
import { main } from '../dist/main.mjs';

main(process.argv.slice(2));
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/main.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { MockInstance } from 'vitest';
import * as pullChanges from '../src/inputs/getPullChanges.js';
import * as parseJsonReports from '../src/inputs/parseVitestJsonFinalReport.js';
import * as readOptions from '../src/inputs/readOptions.js';
import { main } from '../src/main.js';
import { main } from '../src/main.mjs';
import * as generateBadges from '../src/report/generateBadges.js';
import { GenerateBadgesOptions } from '../src/report/generateBadges.js';
import { JsonSummary } from '../src/types/JsonSummary.js';
Expand Down
8 changes: 7 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@
"jsx": "preserve"
},
"exclude": ["**/node_modules", "**/.*/", "dist", "build"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "vitest.config.mts"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"vitest.config.mts",
"src/main.mts"
]
}
4 changes: 2 additions & 2 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ export default defineConfig((options) => [
},
{
dts: false,
entry: ['src/main.ts'],
entry: ['src/main.mts'],
splitting: false,
sourcemap: !options.watch,
clean: true,
minify: false, //!options.watch,
treeshake: true,
tsconfig: './tsconfig.build.json',
format: ['cjs'],
format: ['esm'],
},
]);

0 comments on commit 6d35faf

Please sign in to comment.