@plus-experience/design-system-carbon 0.2.3 → 0.2.4
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/bin/setup.js +15 -8
- package/package.json +1 -1
package/bin/setup.js
CHANGED
|
@@ -17,6 +17,17 @@ function log(msg) {
|
|
|
17
17
|
|
|
18
18
|
console.log("\ndesign-system v2 (Carbon) 세팅 시작...\n");
|
|
19
19
|
|
|
20
|
+
// app 디렉토리 감지 (src/app/ vs app/)
|
|
21
|
+
function getAppDir() {
|
|
22
|
+
const srcApp = path.join(cwd, "src", "app");
|
|
23
|
+
if (fs.existsSync(srcApp)) return srcApp;
|
|
24
|
+
return path.join(cwd, "app");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const appDir = getAppDir();
|
|
28
|
+
if (!fs.existsSync(appDir)) fs.mkdirSync(appDir, { recursive: true });
|
|
29
|
+
log(`앱 디렉토리: ${path.relative(cwd, appDir)}/`);
|
|
30
|
+
|
|
20
31
|
// 1. design-system-carbon 설치
|
|
21
32
|
run("npm install @plus-experience/design-system-carbon");
|
|
22
33
|
log("@plus-experience/design-system-carbon 설치");
|
|
@@ -28,18 +39,14 @@ if (!pkg.dependencies?.next) {
|
|
|
28
39
|
log("next, react, react-dom 설치");
|
|
29
40
|
}
|
|
30
41
|
|
|
31
|
-
// 4. UI 의존성 (Carbon + utilities)
|
|
32
|
-
run("npm install @carbon/react @carbon/icons-react clsx tailwind-merge next-themes date-fns recharts");
|
|
42
|
+
// 4. UI 의존성 (Carbon + utilities + fonts)
|
|
43
|
+
run("npm install @carbon/react @carbon/icons-react @ibm/plex clsx tailwind-merge next-themes date-fns recharts");
|
|
33
44
|
log("Carbon + UI 의존성 설치");
|
|
34
45
|
|
|
35
46
|
// 5. dev 의존성 (sass)
|
|
36
47
|
run("npm install -D sass");
|
|
37
48
|
log("sass 설치");
|
|
38
49
|
|
|
39
|
-
// 6. globals.css 복사
|
|
40
|
-
const appDir = path.join(cwd, "app");
|
|
41
|
-
if (!fs.existsSync(appDir)) fs.mkdirSync(appDir, { recursive: true });
|
|
42
|
-
|
|
43
50
|
const srcCss = path.join(cwd, "node_modules/@plus-experience/design-system-carbon/app/globals.css");
|
|
44
51
|
if (fs.existsSync(srcCss)) {
|
|
45
52
|
let cssContent = fs.readFileSync(srcCss, "utf8");
|
|
@@ -187,7 +194,7 @@ function patchNextConfig() {
|
|
|
187
194
|
}
|
|
188
195
|
|
|
189
196
|
function patchLayoutFont() {
|
|
190
|
-
const layoutCandidates = ["app/layout.tsx", "app/layout.jsx", "app/layout.js"];
|
|
197
|
+
const layoutCandidates = ["src/app/layout.tsx", "src/app/layout.jsx", "src/app/layout.js", "app/layout.tsx", "app/layout.jsx", "app/layout.js"];
|
|
191
198
|
let layoutPath = null;
|
|
192
199
|
for (const name of layoutCandidates) {
|
|
193
200
|
const p = path.join(cwd, name);
|
|
@@ -220,7 +227,7 @@ function patchLayoutFont() {
|
|
|
220
227
|
}
|
|
221
228
|
|
|
222
229
|
function patchLayout() {
|
|
223
|
-
const layoutCandidates = ["app/layout.tsx", "app/layout.jsx", "app/layout.js"];
|
|
230
|
+
const layoutCandidates = ["src/app/layout.tsx", "src/app/layout.jsx", "src/app/layout.js", "app/layout.tsx", "app/layout.jsx", "app/layout.js"];
|
|
224
231
|
let layoutPath = null;
|
|
225
232
|
for (const name of layoutCandidates) {
|
|
226
233
|
const p = path.join(cwd, name);
|