atomsystem 0.1.36 → 0.1.38
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/cli/init.js +18 -10
- package/package.json +1 -1
package/cli/init.js
CHANGED
|
@@ -17,6 +17,7 @@ const __dirname = path.dirname(__filename);
|
|
|
17
17
|
const packageRoot = path.join(__dirname, "..");
|
|
18
18
|
const tokenFile = path.join(packageRoot, "tokens", "tokens.json");
|
|
19
19
|
const buildFile = path.join(packageRoot, "build", "build-tokens.js");
|
|
20
|
+
const textCssFile = path.join(packageRoot, "css", "text.css");
|
|
20
21
|
|
|
21
22
|
// 프로젝트 루트 경로 (사용자가 실행한 곳)
|
|
22
23
|
const projectRoot = process.cwd();
|
|
@@ -24,6 +25,16 @@ const targetTokenDir = path.join(projectRoot, "tokens");
|
|
|
24
25
|
const targetTokenFile = path.join(targetTokenDir, "tokens.json");
|
|
25
26
|
const targetBuildDir = path.join(projectRoot, "build");
|
|
26
27
|
const targetBuildFile = path.join(targetBuildDir, "build-tokens.js");
|
|
28
|
+
const targetCssDir = path.join(projectRoot, "css");
|
|
29
|
+
const targetTextCssFile = path.join(targetCssDir, "text.css");
|
|
30
|
+
|
|
31
|
+
// 파일 복사 헬퍼: 대상 디렉토리 생성 → 파일 복사 → 로그 출력
|
|
32
|
+
function copyTo(src, dest, label) {
|
|
33
|
+
const dir = path.dirname(dest);
|
|
34
|
+
if (!fs.existsSync(dir)) mkdirSync(dir, { recursive: true });
|
|
35
|
+
copyFileSync(src, dest);
|
|
36
|
+
console.log(`✅ Copied: ${label} -> ${dest}`);
|
|
37
|
+
}
|
|
27
38
|
|
|
28
39
|
// 사용자 프로젝트에 package.json이 존재하는지 먼저 확인 (안전장치)
|
|
29
40
|
const packageJsonPath = path.join(projectRoot, "package.json");
|
|
@@ -118,7 +129,8 @@ export default function RootLayout({ children }: { children: React.ReactNode })
|
|
|
118
129
|
{
|
|
119
130
|
path: path.join(appDir, "globals.css"),
|
|
120
131
|
content: `@import "tailwindcss";
|
|
121
|
-
@import "../build/css/_variables.css"
|
|
132
|
+
@import "../build/css/_variables.css";
|
|
133
|
+
@import "../css/text.css";`,
|
|
122
134
|
},
|
|
123
135
|
{
|
|
124
136
|
path: path.join(appDir, "page.tsx"),
|
|
@@ -131,7 +143,7 @@ export default function Page() {
|
|
|
131
143
|
<main style={{ padding: "40px", minHeight: "100vh", background: "var(--color-bg-wrapper)", transition: "background 0.3s ease" }}>
|
|
132
144
|
<div style={{ maxWidth: "800px", margin: "0 auto", display: "flex", flexDirection: "column", gap: "24px" }}>
|
|
133
145
|
<h1 style={{ fontSize: "var(--font-sizes-h2)", color: "var(--color-text-standard)", margin: 0 }}>Hello, atomsystem!</h1>
|
|
134
|
-
<p style={{
|
|
146
|
+
<p style={{ fontSize: "var(--font-sizes-body)", margin: 0 }}>
|
|
135
147
|
이 화면은 디자인 토큰이 적용된 샘플 화면입니다. 아래 테마를 변경해보세요.
|
|
136
148
|
</p>
|
|
137
149
|
|
|
@@ -252,14 +264,10 @@ export default config;`,
|
|
|
252
264
|
console.log("🚀 Installation skipped.");
|
|
253
265
|
}
|
|
254
266
|
|
|
255
|
-
// ✅
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
if (!fs.existsSync(targetBuildDir)) mkdirSync(targetBuildDir, { recursive: true });
|
|
261
|
-
copyFileSync(buildFile, targetBuildFile);
|
|
262
|
-
console.log(`✅ Copied: build-tokens.js -> ${targetBuildFile}`);
|
|
267
|
+
// ✅ 필수 파일 복사 (Next.js 설치 여부와 관계없이 실행)
|
|
268
|
+
copyTo(tokenFile, targetTokenFile, "tokens/tokens.json");
|
|
269
|
+
copyTo(buildFile, targetBuildFile, "build/build-tokens.js");
|
|
270
|
+
copyTo(textCssFile, targetTextCssFile, "css/text.css");
|
|
263
271
|
|
|
264
272
|
console.log("🚀 Token setup complete!");
|
|
265
273
|
})
|