Skip to content

Commit

Permalink
refactor: remove index
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkeyl committed Aug 30, 2024
1 parent 736ec3a commit dc50a04
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/eslint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
run: pnpm i

- name: Lint
run: pnpm eslint src/index.ts
run: pnpm eslint src/**/*.ts
3 changes: 3 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ jobs:
- name: Build
run: pnpm build

- name: Pretty
run: pnpm prettier index.d.ts --write

- name: Create Release
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
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 @@ -37,7 +37,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,25 +8,26 @@ 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([
{
external: ['@archoleat/notifier', '@archoleat/reglib', 'node:path'],
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/validate-font-file-name.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { beforeEach, describe, expect, test as spec } from 'vitest';

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

describe('Validate Font File Name', () => {
let validate: Function;
Expand Down
File renamed without changes.

0 comments on commit dc50a04

Please sign in to comment.