Skip to content

refactor: remove index file #88

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

Merged
merged 1 commit into from
Aug 30, 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
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
branches:
- main
paths:
- src/index.ts
- src/**/*.ts
push:
branches:
- main
paths:
- src/index.ts
- src/**/*.ts

permissions:
actions: read
Expand Down
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
'*': 'prettier --write',
'src/index.ts': 'eslint --fix',
'src/**/*.ts': 'eslint --fix',
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"type": "module",
"types": "index.d.ts",
"imports": {
"#src": "./src/index.ts"
"#app": "./src/app.ts"
},
"exports": {
".": "./index.js"
Expand Down
13 changes: 7 additions & 6 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,25 @@ import typescript from '@rollup/plugin-typescript';
const sourceFolder = 'src';

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,
},
},
{
plugins: [dts()],
input: `${sourceFolder}/${indexFile}`,
input: `${sourceFolder}/${entryFile}`,
output: {
file: declarationFile,
format: fileFormat,
Expand Down
2 changes: 1 addition & 1 deletion specs/define-config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { describe, expectTypeOf, test as spec } from 'vitest';

import type { UserConfig } from '@commitlint/types';

import { defineConfig } from '#src';
import { defineConfig } from '#app';

describe('Commitlint Config', () => {
spec('empty config', async () => {
Expand Down
File renamed without changes.