From 6583ca21ffe3ce5f633a4b64e54f2a53f89710a4 Mon Sep 17 00:00:00 2001 From: Almanov Nikita <131481562+nikkeyl@users.noreply.github.com> Date: Mon, 5 Aug 2024 20:58:36 +0300 Subject: [PATCH] refactor: small changes --- .github/workflows/codeql.yaml | 2 ++ .github/workflows/pre-commit.yaml | 2 -- .gitignore | 2 +- .prettierignore | 8 ++++---- .remarkignore | 1 + package.json | 3 +-- pnpm-lock.yaml | 31 ++++++++++++++----------------- rollup.config.ts | 24 ++++++++++++++++-------- 8 files changed, 39 insertions(+), 34 deletions(-) diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index 9b7d939..66e1aa3 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -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 diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index ffc4367..ba5c599 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -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 diff --git a/.gitignore b/.gitignore index 9b4f555..23cad9a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -# directories +# Directories node_modules diff --git a/.prettierignore b/.prettierignore index 50c7545..615eba1 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,7 +1,7 @@ -# directories +# Directories .husky -# files +# Files *.md pnpm-lock.yaml @@ -9,11 +9,11 @@ pnpm-lock.yaml .czrc .ecrc -# configs +# Configs .editorconfig .gitattributes -# ignores +# Ignores .gitignore .prettierignore .remarkignore diff --git a/.remarkignore b/.remarkignore index 1b763b1..1eee9e5 100644 --- a/.remarkignore +++ b/.remarkignore @@ -1 +1,2 @@ +# Files CHANGELOG.md diff --git a/package.json b/package.json index 64114a7..4da4342 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "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", @@ -77,7 +77,6 @@ "@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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cbb4b41..4add97c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,8 +19,8 @@ importers: specifier: ^1.1.6 version: 1.1.6 '@archoleat/semantic-release-define-config': - specifier: ^1.1.8 - version: 1.1.8(semantic-release@24.0.0(typescript@5.5.4)) + specifier: ^1.1.11 + version: 1.1.11(semantic-release@24.0.0(typescript@5.5.4)) '@commitlint/cli': specifier: ^19.3.0 version: 19.3.0(@types/node@22.1.0)(typescript@5.5.4) @@ -42,9 +42,6 @@ importers: '@semantic-release/git': specifier: ^10.0.1 version: 10.0.1(semantic-release@24.0.0(typescript@5.5.4)) - '@types/node': - specifier: ^22.1.0 - version: 22.1.0 '@typescript-eslint/eslint-plugin': specifier: ^7.18.0 version: 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4) @@ -147,8 +144,8 @@ packages: resolution: {integrity: sha512-gu8PQv6hWh2DEm2FONtAPDvv1odZXCADshCyvouYzFNscEgMLW0zwbfv6d6pAlsk7uY9+V05R/tz0qv0Sy4mzg==} engines: {node: '>=20.0.0', npm: '>=10.0.0', pnpm: '>=8.0.0'} - '@archoleat/semantic-release-define-config@1.1.8': - resolution: {integrity: sha512-/Ht+Ds517toYhBMLSgwVX6LbD9OHMin2b8DUFc3UTu3mSu5yj8JQY4Vw8Uy4/msDiQQhURVfF5a9Icre7YHjdA==} + '@archoleat/semantic-release-define-config@1.1.11': + resolution: {integrity: sha512-OREIKuHiSvDJm5J4C//Zpzxurp73lZ7iYEj/3kXBUBVWKNE3M8rsTt97jeh3mSrnoH9ZRkI4M1TlVOlNmH1JNA==} engines: {node: '>=20.0.0', pnpm: '>=9.0.0'} peerDependencies: semantic-release: ^23.0.0 || ^24.0.0 @@ -1057,8 +1054,8 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - caniuse-lite@1.0.30001647: - resolution: {integrity: sha512-n83xdNiyeNcHpzWY+1aFbqCK7LuLfBricc4+alSQL2Xb6OR3XpnQAmlDG+pQcdTfiHRuLcQ96VOfrPSGiNJYSg==} + caniuse-lite@1.0.30001649: + resolution: {integrity: sha512-fJegqZZ0ZX8HOWr6rcafGr72+xcgJKI9oWfDW5DrD7ExUtgZC7a7R7ZYmZqplh7XDocFdGeIFn7roAxhOeYrPQ==} ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} @@ -1259,8 +1256,8 @@ packages: resolution: {integrity: sha512-lOETlkIeYSJWcbbcvjRKGxVMXJR+8+OQb/mTPbA4ObPMytYIsUbuOE0Jzy60hjARYszq1id0j8KgVhC+WGZVTg==} engines: {node: '>=12'} - core-js-compat@3.37.1: - resolution: {integrity: sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg==} + core-js-compat@3.38.0: + resolution: {integrity: sha512-75LAicdLa4OJVwFxFbQR3NdnZjNgX6ILpVcVzcC4T2smerB5lELMrJQQQoWV6TiuC/vlaFqgU2tKQx9w5s0e0A==} core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} @@ -4027,7 +4024,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@archoleat/semantic-release-define-config@1.1.8(semantic-release@24.0.0(typescript@5.5.4))': + '@archoleat/semantic-release-define-config@1.1.11(semantic-release@24.0.0(typescript@5.5.4))': dependencies: semantic-release: 24.0.0(typescript@5.5.4) @@ -4632,7 +4629,7 @@ snapshots: '@types/concat-stream@2.0.3': dependencies: - '@types/node': 22.1.0 + '@types/node': 20.14.14 '@types/conventional-commits-parser@5.0.0': dependencies: @@ -4998,7 +4995,7 @@ snapshots: browserslist@4.23.3: dependencies: - caniuse-lite: 1.0.30001647 + caniuse-lite: 1.0.30001649 electron-to-chromium: 1.5.4 node-releases: 2.0.18 update-browserslist-db: 1.1.0(browserslist@4.23.3) @@ -5026,7 +5023,7 @@ snapshots: callsites@3.1.0: {} - caniuse-lite@1.0.30001647: {} + caniuse-lite@1.0.30001649: {} ccount@2.0.1: {} @@ -5244,7 +5241,7 @@ snapshots: convert-hrtime@5.0.0: {} - core-js-compat@3.37.1: + core-js-compat@3.38.0: dependencies: browserslist: 4.23.3 @@ -5614,7 +5611,7 @@ snapshots: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) ci-info: 4.0.0 clean-regexp: 1.0.0 - core-js-compat: 3.37.1 + core-js-compat: 3.38.0 eslint: 8.57.0 esquery: 1.6.0 globals: 15.9.0 diff --git a/rollup.config.ts b/rollup.config.ts index 71a4522..332a749 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -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, }, }, { @@ -28,15 +36,15 @@ 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}`), }, ], }), @@ -44,8 +52,8 @@ export default defineConfig([ ], input: `${sourceFolder}/${indexFile}`, output: { - file: `${fileName}.d.ts`, - format: 'es', + file: declarationFile, + format: fileFormat, }, }, ]);