Skip to content

Commit

Permalink
refactor: small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkeyl committed Aug 5, 2024
1 parent a01eb89 commit 6583ca2
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 34 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ on:
paths:
- package.json
- src/**/*.ts
- src/shared/types/*.d.ts
push:
branches:
- main
paths:
- package.json
- src/**/*.ts
- src/shared/types/*.d.ts

permissions:
actions: read
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Lint
uses: pre-commit/action@v3.0.1
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# directories
# Directories
node_modules
8 changes: 4 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# directories
# Directories
.husky

# files
# Files
*.md
pnpm-lock.yaml

# *rc
.czrc
.ecrc

# configs
# Configs
.editorconfig
.gitattributes

# ignores
# Ignores
.gitignore
.prettierignore
.remarkignore
1 change: 1 addition & 0 deletions .remarkignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Files
CHANGELOG.md
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,14 @@
"devDependencies": {
"@archoleat/commitlint-define-config": "^1.0.7",
"@archoleat/eslint-flat-compatibility": "^1.1.6",
"@archoleat/semantic-release-define-config": "^1.1.8",
"@archoleat/semantic-release-define-config": "^1.1.11",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@commitlint/types": "^19.0.3",
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-typescript": "^11.1.6",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/node": "^22.1.0",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@vitest/coverage-v8": "^2.0.5",
Expand Down
31 changes: 14 additions & 17 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 16 additions & 8 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,25 @@ import alias from '@rollup/plugin-alias';
import typescript from '@rollup/plugin-typescript';

const sourceFolder = 'src';
const featuresFolder = `${sourceFolder}/features`;
const sharedFolder = `${sourceFolder}/shared`;
const typesFolder = `${sharedFolder}/types`;

const fileName = 'index';
const indexFile = `${fileName}.ts`;
const declarationFile = `${fileName}.d.ts`;
const outputFile = `${fileName}.js`;

const fileFormat = 'es';

export default defineConfig([
{
external: ['chalk'],
external: ['chalk', 'node-notifier'],
plugins: [typescript(), minify()],
input: `${sourceFolder}/${indexFile}`,
output: {
file: `${fileName}.js`,
format: 'es',
file: outputFile,
format: fileFormat,
},
},
{
Expand All @@ -28,24 +36,24 @@ export default defineConfig([
entries: [
{
find: '#features',
replacement: resolve(`${sourceFolder}/features/${indexFile}`),
replacement: resolve(`${featuresFolder}/${indexFile}`),
},
{
find: '#shared',
replacement: resolve(`${sourceFolder}/shared/${indexFile}`),
replacement: resolve(`${sharedFolder}/${indexFile}`),
},
{
find: '#types',
replacement: resolve(`${sourceFolder}/shared/types/${fileName}.d.ts`),
replacement: resolve(`${sharedFolder}/${declarationFile}`),
},
],
}),
dts(),
],
input: `${sourceFolder}/${indexFile}`,
output: {
file: `${fileName}.d.ts`,
format: 'es',
file: declarationFile,
format: fileFormat,
},
},
]);

0 comments on commit 6583ca2

Please sign in to comment.