Skip to content

Commit

Permalink
refactor: small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkeyl committed Nov 11, 2024
1 parent 1e206ca commit ee9cea1
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 17 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@
},
"type": "module",
"imports": {
"#app": "./src/app/index.ts",
"#index": "./src/index.ts",
"#shared": "./src/shared/index.ts"
"#validators": "./src/validators/index.ts"
},
"exports": {
".": "./index.js",
Expand Down
11 changes: 3 additions & 8 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import alias from '@rollup/plugin-alias';
import typescript from '@rollup/plugin-typescript';

const sourceFolder = 'src';
const appFolder = `${sourceFolder}/app`;
const sharedFolder = `${sourceFolder}/shared`;
const validatorsFolder = `${sourceFolder}/validators`;
const fileFormat = 'es';
const fileName = 'index';
const declarationFile = `${fileName}.d.ts`;
Expand All @@ -28,12 +27,8 @@ export default defineConfig([
alias({
entries: [
{
find: '#app',
replacement: resolve(`${appFolder}/${entryFile}`),
},
{
find: '#shared',
replacement: resolve(`${sharedFolder}/${entryFile}`),
find: '#validators',
replacement: resolve(`${validatorsFolder}/${entryFile}`),
},
],
}),
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { FONT_FILE_NAME_REGEX, selectors } from '#app';
export { FONT_FILE_NAME_REGEX, selectors } from '#validators';
2 changes: 0 additions & 2 deletions src/shared/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ITALIC_REGEX, VARIABLE_REGEX } from '#shared';
import { ITALIC_REGEX } from './italic.ts';
import { VARIABLE_REGEX } from './variable.ts';

const LETTERS_REGEX = '[A-Z][a-z]';
const FONT_FAMILY_REGEX = `^${LETTERS_REGEX}+(${LETTERS_REGEX}+)?`;
Expand Down
2 changes: 2 additions & 0 deletions src/app/index.ts → src/validators/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export { FONT_FILE_NAME_REGEX } from './font-file-name.ts';
export { ITALIC_REGEX } from './italic.ts';
export { selectors } from './selectors.ts';
export { VARIABLE_REGEX } from './variable.ts';
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"module": "NodeNext",
"moduleResolution": "NodeNext",
"paths": {
"#app": ["./src/app/index.ts"],
"#shared": ["./src/shared/index.ts"]
"#validators": ["./src/validators/index.ts"]
},
"rootDir": "src",
"types": ["vitest"],
Expand Down

0 comments on commit ee9cea1

Please sign in to comment.