diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index bed0fb0..da5ed11 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -48,6 +48,9 @@ jobs: - name: Install Dependencies run: pnpm i + - name: Pretty + run: pnpm prettier index.d.ts --write + - name: Create Release env: GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} diff --git a/lint-staged.config.js b/lint-staged.config.js index 3d66b65..a2063fc 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,4 +1,4 @@ export default { '*': 'prettier --write', - 'src/index.ts': 'eslint --fix', + 'src/**/*.ts': 'eslint --fix', }; diff --git a/package.json b/package.json index 208bb5b..ab41baa 100644 --- a/package.json +++ b/package.json @@ -36,8 +36,8 @@ "type": "module", "types": "index.d.ts", "imports": { - "#src": "./src/index.ts", - "#types": "./src/types/index.ts" + "#app": "./src/app.ts", + "#types/*": "./src/types/*" }, "exports": { ".": "./index.js" diff --git a/rollup.config.ts b/rollup.config.ts index 25e141a..d4a2d87 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -12,16 +12,17 @@ const sourceFolder = 'src'; const typesFolder = `${sourceFolder}/types`; const fileFormat = 'es'; -const fileName = 'index'; +const entryFileName = 'app'; +const outputFileName = 'index'; -const declarationFile = `${fileName}.d.ts`; -const indexFile = `${fileName}.ts`; -const outputFile = `${fileName}.js`; +const declarationFile = `${outputFileName}.d.ts`; +const entryFile = `${entryFileName}.ts`; +const outputFile = `${outputFileName}.js`; export default defineConfig([ { plugins: [typescript(), minify()], - input: `${sourceFolder}/${indexFile}`, + input: `${sourceFolder}/${entryFile}`, output: { file: outputFile, format: fileFormat, @@ -33,13 +34,13 @@ export default defineConfig([ entries: [ { find: '#types', - replacement: resolve(`${typesFolder}/${indexFile}`), + replacement: resolve(typesFolder), }, ], }), dts(), ], - input: `${sourceFolder}/${indexFile}`, + input: `${sourceFolder}/${entryFile}`, output: { file: declarationFile, format: fileFormat, diff --git a/specs/define-config.spec.ts b/specs/define-config.spec.ts index 2dcbc68..cbae339 100644 --- a/specs/define-config.spec.ts +++ b/specs/define-config.spec.ts @@ -1,8 +1,8 @@ import { describe, expectTypeOf, test as spec } from 'vitest'; -import { UserConfig } from '#types'; +import { UserConfig } from '#types/user-config.ts'; -import { defineConfig } from '#src'; +import { defineConfig } from '#app'; describe('Semantic Release Config', () => { spec('empty config', async () => { diff --git a/src/index.ts b/src/app.ts similarity index 79% rename from src/index.ts rename to src/app.ts index d16c89b..6163f7b 100644 --- a/src/index.ts +++ b/src/app.ts @@ -1,4 +1,4 @@ -import type { UserConfig } from '#types'; +import type { UserConfig } from '#types/user-config.ts'; /** * Define an Semantic Release config. diff --git a/src/types/index.ts b/src/types/index.ts deleted file mode 100644 index 363d8dd..0000000 --- a/src/types/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { UserConfig } from './user-config.d.ts'; diff --git a/tsconfig.node.json b/tsconfig.node.json index 27c1270..2df9181 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -14,7 +14,7 @@ "module": "NodeNext", "moduleResolution": "NodeNext", "paths": { - "#types": ["./src/types/index.d.ts"] + "#types/*": ["./src/types/*"] }, "rootDir": "src", "types": ["vitest"],