Skip to content

Commit 6bdc5e7

Browse files
refactor: use tsc for types and explicit .js imports
Reworked the build pipeline to run Vite for JS output and `tsc --project tsconfig.build.json` for declaration generation, replacing `vite-plugin-dts` with native TypeScript emit settings. Internal source imports/exports were updated to explicit `.js` specifiers across configs, providers, renders, and entrypoints to align ESM output and TS 7 behavior. Dev dependencies were also simplified (removing dts/api-extractor-related tooling and unused lint plugin) while upgrading TypeScript to ^7.0.0.
1 parent 58244b7 commit 6bdc5e7

31 files changed

Lines changed: 123 additions & 1089 deletions

package-lock.json

Lines changed: 33 additions & 1000 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 & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
"dist"
3838
],
3939
"scripts": {
40-
"build": "vite build",
40+
"build": "npm-run-all build:js build:types",
41+
"build:js": "vite build",
42+
"build:types": "tsc --project tsconfig.build.json",
4143
"dev": "tsx src/cli.ts",
4244
"test": "npm-run-all test:unit test:report test:lint test:typecheck",
4345
"test:unit": "jest --coverage",
@@ -65,14 +67,11 @@
6567
"@codecov/vite-plugin": "2.0.1",
6668
"@eslint/js": "^10.0.1",
6769
"@fast-csv/parse": "^5.0.7",
68-
"@microsoft/api-extractor": "7.58.12",
6970
"@types/d3-hierarchy": "^3.1.7",
7071
"@types/node": "^25.9.1",
71-
"@typescript/native": "npm:typescript@^7.0.0",
7272
"bumpp": "^12.0.0",
7373
"d3-hierarchy": "^3.1.2",
7474
"eslint": "^10.4.0",
75-
"eslint-plugin-jest": "29.15.5",
7675
"globals": "17.7.0",
7776
"jest": "30.4.2",
7877
"jest-environment-jsdom": "30.4.1",
@@ -82,9 +81,8 @@
8281
"npm-run-all2": "9.0.2",
8382
"p-limit": "^7.3.0",
8483
"tsx": "^4.22.3",
85-
"typescript": "^5.9.3",
86-
"vite": "6.4.3",
87-
"vite-plugin-dts": "5.0.3"
84+
"typescript": "^7.0.0",
85+
"vite": "6.4.3"
8886
},
8987
"jest": {
9088
"collectCoverageFrom": [

src/cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Sponsorship } from './types'
1+
import type { Sponsorship } from './types.js'
22
import { Buffer } from 'node:buffer'
33

44
export function stringifyCache(cache: Sponsorship[]): string {

src/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type { ContribkitConfig } from './types'
1+
import type { ContribkitConfig } from './types.js'
22
import cac from 'cac'
33
import { version } from '../package.json'
4-
import { run } from './run'
4+
import { run } from './run.js'
55

66
const RE_FILTER = /^(<=?|>=?)(\d+)$/
77
const cli = cac('contributors-svg')

src/configs/credentials.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ContribkitConfig } from '../types'
1+
import type { ContribkitConfig } from '../types.js'
22
import process from 'node:process'
33
import dotenv from 'dotenv'
44

src/configs/defaults.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { ContribkitConfig, Tier } from '../types'
2-
import { tierPresets } from './tier-presets'
1+
import type { ContribkitConfig, Tier } from '../types.js'
2+
import { tierPresets } from './tier-presets.js'
33

44
export const defaultTiers: Tier[] = [
55
{

src/configs/env.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type { ContribkitConfig, GitHubAccountType } from '../types'
1+
import type { ContribkitConfig, GitHubAccountType } from '../types.js'
22
import process from 'node:process'
33
import dotenv from 'dotenv'
4-
import { loadEnvCredentials, pruneUndefined } from './credentials'
4+
import { loadEnvCredentials, pruneUndefined } from './credentials.js'
55

66
export interface EnvConfig {
77
config: Partial<ContribkitConfig>

src/configs/fallback.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { svgToPng } from '../processing/image'
1+
import { svgToPng } from '../processing/image.js'
22

33
const fallback = `
44
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 135.47 135.47">

src/configs/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import type { ContribkitConfig, Sponsorship, Tier, TierPartition } from '../types'
1+
import type { ContribkitConfig, Sponsorship, Tier, TierPartition } from '../types.js'
22
import { loadConfig as _loadConfig } from 'unconfig'
3-
import { defaultConfig } from './defaults'
4-
import { loadEnv } from './env'
5-
import { FALLBACK_AVATAR } from './fallback'
3+
import { defaultConfig } from './defaults.js'
4+
import { loadEnv } from './env.js'
5+
import { FALLBACK_AVATAR } from './fallback.js'
66

7-
export * from './defaults'
8-
export * from './fallback'
9-
export * from './tier-presets'
7+
export * from './defaults.js'
8+
export * from './fallback.js'
9+
export * from './tier-presets.js'
1010

1111
export function defineConfig(config: ContribkitConfig): ContribkitConfig {
1212
return config

src/configs/tier-presets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { BadgePreset } from '../types'
1+
import type { BadgePreset } from '../types.js'
22

33
const none: BadgePreset = {
44
avatar: {

0 commit comments

Comments
 (0)