byuckchon-frontend-cli 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/package.json +1 -1
- package/src/generators/createBaseFiles.js +20 -10
package/README.md
CHANGED
|
@@ -1,2 +1,26 @@
|
|
|
1
1
|
# byuckchon-frontend-cli
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
[byuckchon](https://www.byuckchon.com) 컨벤션에 맞게 React(Vite) 또는 Next.js(App Router) TypeScript 프로젝트를 생성하는 CLI.
|
|
4
|
+
|
|
5
|
+
## 요구 사항
|
|
6
|
+
|
|
7
|
+
- [Node.js](https://nodejs.org/) (LTS 권장)
|
|
8
|
+
|
|
9
|
+
## 사용법
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx byuckchon-frontend-cli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
프로젝트 이름과 프레임워크를 묻는 프롬프트에 따라 답하면, 현재 디렉터리에 새 폴더가 만들어집니다.
|
|
16
|
+
|
|
17
|
+
생성이 끝나면 안내에 따라 다음을 실행하세요.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
cd <프로젝트-이름>
|
|
21
|
+
npm run dev
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 라이선스
|
|
25
|
+
|
|
26
|
+
MIT
|
package/package.json
CHANGED
|
@@ -342,7 +342,7 @@ StyleDictionary.registerTransform({
|
|
|
342
342
|
.toLowerCase(),
|
|
343
343
|
});
|
|
344
344
|
|
|
345
|
-
// Tailwind
|
|
345
|
+
// color는 Tailwind 유틸리티로, typography는 .text-* 클래스로 생성
|
|
346
346
|
StyleDictionary.registerFormat({
|
|
347
347
|
name: "css/tailwind-theme",
|
|
348
348
|
format: ({ dictionary }) => {
|
|
@@ -357,23 +357,33 @@ StyleDictionary.registerFormat({
|
|
|
357
357
|
if (token.$type === "color") {
|
|
358
358
|
css += \` --color-\${token.name}: \${token.$value};\\n\`;
|
|
359
359
|
}
|
|
360
|
+
});
|
|
361
|
+
css += "}\\n\\n";
|
|
362
|
+
|
|
363
|
+
css += "@layer components {\\n";
|
|
364
|
+
dictionary.allTokens.forEach((token) => {
|
|
360
365
|
if (token.$type === "typography" && token.$value) {
|
|
361
366
|
const typo = token.$value;
|
|
362
|
-
|
|
363
|
-
css += \` --font-family-\${token.name}: \${typo.fontFamily};\\n\`;
|
|
364
|
-
}
|
|
365
|
-
if (typo.fontWeight) {
|
|
366
|
-
css += \` --font-weight-\${token.name}: \${typo.fontWeight};\\n\`;
|
|
367
|
-
}
|
|
367
|
+
css += \` .text-\${token.name} {\\n\`;
|
|
368
368
|
if (typo.fontSize) {
|
|
369
|
-
css += \`
|
|
369
|
+
css += \` font-size: \${withPx(typo.fontSize)};\\n\`;
|
|
370
370
|
}
|
|
371
371
|
if (typo.lineHeight) {
|
|
372
|
-
css += \`
|
|
372
|
+
css += \` line-height: \${withPx(typo.lineHeight)};\\n\`;
|
|
373
|
+
}
|
|
374
|
+
if (typo.letterSpacing) {
|
|
375
|
+
css += \` letter-spacing: \${typo.letterSpacing};\\n\`;
|
|
376
|
+
}
|
|
377
|
+
if (typo.fontWeight) {
|
|
378
|
+
css += \` font-weight: \${typo.fontWeight};\\n\`;
|
|
373
379
|
}
|
|
380
|
+
if (typo.fontFamily) {
|
|
381
|
+
css += \` font-family: \${typo.fontFamily};\\n\`;
|
|
382
|
+
}
|
|
383
|
+
css += " }\\n";
|
|
374
384
|
}
|
|
375
385
|
});
|
|
376
|
-
css += "}\\n
|
|
386
|
+
css += "}\\n";
|
|
377
387
|
|
|
378
388
|
return css;
|
|
379
389
|
},
|