-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: @modern-kit/utils SubPath 적용 (#690)
* refac(react): subPath 적용 리팩토링 * chore: utils SubPath 적용 * docs: README에 SubPath 가이드 추가 * chore: changesetlog 추가
- Loading branch information
Showing
23 changed files
with
453 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@modern-kit/utils': major | ||
--- | ||
|
||
chore: @modern-kit/utils SubPath 제공 - @ssi0214 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const getEntryFileNames = (name, format, path) => { | ||
const cleanName = name.replace(`${path}-`, ''); | ||
return `${path}/${cleanName}/index.${format}`; | ||
}; | ||
|
||
export const getFormatEntryFileNames = (chunkInfo, format) => { | ||
const prefixMap = { | ||
array: 'array', | ||
clipboard: 'clipboard', | ||
common: 'common', | ||
date: 'date', | ||
device: 'device', | ||
file: 'file', | ||
formatter: 'formatter', | ||
math: 'math', | ||
object: 'object', | ||
regex: 'regex', | ||
storage: 'storage', | ||
string: 'string', | ||
style: 'style', | ||
validator: 'validator', | ||
}; | ||
|
||
for (const [key, value] of Object.entries(prefixMap)) { | ||
if (chunkInfo.name === `${key}-index`) { | ||
return `${key}/index.${format}`; | ||
} | ||
|
||
if (chunkInfo.name.startsWith(value)) { | ||
return getEntryFileNames(chunkInfo.name, format, key); | ||
} | ||
} | ||
|
||
return `[name].${format}`; // 기본 파일 이름 | ||
}; | ||
|
||
export const getSubEntryMap = (keys, path) => { | ||
return keys.reduce((acc, entry) => { | ||
acc[`${path}-${entry}`] = `./src/${path}/${entry}`; | ||
return acc; | ||
}, {}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.