atomsystem 0.1.45 → 0.1.47
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/dist/index.js +187 -118
- package/package.json +12 -14
package/dist/index.js
CHANGED
|
@@ -1,108 +1,76 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __esm = (fn, res) => function __init() {
|
|
5
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
6
|
+
};
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
2
11
|
|
|
3
12
|
// node_modules/tsup/assets/esm_shims.js
|
|
4
13
|
import path from "path";
|
|
5
14
|
import { fileURLToPath } from "url";
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import { Command as Command3 } from "commander";
|
|
12
|
-
|
|
13
|
-
// src/commands/add.ts
|
|
14
|
-
import { Command } from "commander";
|
|
15
|
-
import fs from "fs";
|
|
16
|
-
import path2 from "path";
|
|
17
|
-
import prompts from "prompts";
|
|
18
|
-
import { z } from "zod";
|
|
15
|
+
var init_esm_shims = __esm({
|
|
16
|
+
"node_modules/tsup/assets/esm_shims.js"() {
|
|
17
|
+
"use strict";
|
|
18
|
+
}
|
|
19
|
+
});
|
|
19
20
|
|
|
20
21
|
// src/utils/logger.ts
|
|
21
22
|
import chalk from "chalk";
|
|
22
|
-
var logger
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
23
|
+
var logger;
|
|
24
|
+
var init_logger = __esm({
|
|
25
|
+
"src/utils/logger.ts"() {
|
|
26
|
+
"use strict";
|
|
27
|
+
init_esm_shims();
|
|
28
|
+
logger = {
|
|
29
|
+
error(...args) {
|
|
30
|
+
console.error(chalk.red(...args));
|
|
31
|
+
},
|
|
32
|
+
warn(...args) {
|
|
33
|
+
console.warn(chalk.yellow(...args));
|
|
34
|
+
},
|
|
35
|
+
info(...args) {
|
|
36
|
+
console.info(chalk.cyan(...args));
|
|
37
|
+
},
|
|
38
|
+
success(...args) {
|
|
39
|
+
console.log(chalk.green(...args));
|
|
40
|
+
},
|
|
41
|
+
log(...args) {
|
|
42
|
+
console.log(...args);
|
|
43
|
+
},
|
|
44
|
+
break() {
|
|
45
|
+
console.log("");
|
|
46
|
+
}
|
|
47
|
+
};
|
|
40
48
|
}
|
|
41
|
-
};
|
|
49
|
+
});
|
|
42
50
|
|
|
43
|
-
// src/
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"CodeBlock",
|
|
53
|
-
"Navigation",
|
|
54
|
-
"Sidebar",
|
|
55
|
-
"Input",
|
|
56
|
-
"Theme",
|
|
57
|
-
"Tab",
|
|
58
|
-
"Toast",
|
|
59
|
-
"Pagination",
|
|
60
|
-
"Table",
|
|
61
|
-
"Modal",
|
|
62
|
-
"TOC",
|
|
63
|
-
"Dropdown"
|
|
64
|
-
];
|
|
65
|
-
var dependenciesMap = {
|
|
66
|
-
Theme: ["Button", "Form", "Modal"]
|
|
67
|
-
};
|
|
68
|
-
var addOptionsSchema = z.object({
|
|
69
|
-
components: z.array(z.string()).optional(),
|
|
70
|
-
all: z.boolean(),
|
|
71
|
-
cwd: z.string()
|
|
51
|
+
// src/utils/component.ts
|
|
52
|
+
var component_exports = {};
|
|
53
|
+
__export(component_exports, {
|
|
54
|
+
addComponent: () => addComponent,
|
|
55
|
+
baseDir: () => baseDir,
|
|
56
|
+
components: () => components,
|
|
57
|
+
dependenciesMap: () => dependenciesMap,
|
|
58
|
+
templateDir: () => templateDir,
|
|
59
|
+
updateGlobalsCss: () => updateGlobalsCss
|
|
72
60
|
});
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
let selectedComponents = options.components || [];
|
|
81
|
-
if (options.all) {
|
|
82
|
-
selectedComponents = components;
|
|
83
|
-
}
|
|
84
|
-
if (selectedComponents.length === 0) {
|
|
85
|
-
const { components: promptedComponents } = await prompts({
|
|
86
|
-
type: "multiselect",
|
|
87
|
-
name: "components",
|
|
88
|
-
message: "\uCD94\uAC00\uD560 \uCEF4\uD3EC\uB10C\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694:",
|
|
89
|
-
choices: components.map((comp) => ({ title: comp, value: comp }))
|
|
90
|
-
});
|
|
91
|
-
selectedComponents = promptedComponents;
|
|
92
|
-
}
|
|
93
|
-
if (!selectedComponents || selectedComponents.length === 0) {
|
|
94
|
-
logger.warn("\uC120\uD0DD\uB41C \uCEF4\uD3EC\uB10C\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
const addedComponents = /* @__PURE__ */ new Set();
|
|
98
|
-
for (const comp of selectedComponents) {
|
|
99
|
-
addComponent(comp, options.cwd, addedComponents);
|
|
100
|
-
}
|
|
101
|
-
} catch (error) {
|
|
102
|
-
logger.error("\uCEF4\uD3EC\uB10C\uD2B8 \uCD94\uAC00 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.");
|
|
103
|
-
logger.error(error);
|
|
61
|
+
import fs from "fs";
|
|
62
|
+
import path2 from "path";
|
|
63
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
64
|
+
function getBaseDir() {
|
|
65
|
+
const isBuilt = path2.basename(__dirname2) === "dist" || fs.existsSync(path2.join(__dirname2, "index.js"));
|
|
66
|
+
if (isBuilt) {
|
|
67
|
+
return path2.join(__dirname2, "..");
|
|
104
68
|
}
|
|
105
|
-
|
|
69
|
+
if (path2.basename(__dirname2) === "utils" || path2.basename(__dirname2) === "commands") {
|
|
70
|
+
return path2.join(__dirname2, "..", "..");
|
|
71
|
+
}
|
|
72
|
+
return path2.join(__dirname2, "..", "..");
|
|
73
|
+
}
|
|
106
74
|
function addComponent(comp, cwd, addedComponents) {
|
|
107
75
|
if (addedComponents.has(comp)) return;
|
|
108
76
|
addedComponents.add(comp);
|
|
@@ -132,7 +100,7 @@ function addComponent(comp, cwd, addedComponents) {
|
|
|
132
100
|
}
|
|
133
101
|
}
|
|
134
102
|
} else {
|
|
135
|
-
logger.error(`\u274C ${comp} \uCEF4\uD3EC\uB10C\uD2B8\uAC00 atomsystem\uC5D0 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4
|
|
103
|
+
logger.error(`\u274C ${comp} \uCEF4\uD3EC\uB10C\uD2B8\uAC00 atomsystem\uC5D0 \uC874\uC7AC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4: ${comp}`);
|
|
136
104
|
}
|
|
137
105
|
}
|
|
138
106
|
function updateGlobalsCss(comp, cssFileName, cwd) {
|
|
@@ -163,16 +131,108 @@ function updateGlobalsCss(comp, cssFileName, cwd) {
|
|
|
163
131
|
${importLine}`);
|
|
164
132
|
}
|
|
165
133
|
}
|
|
134
|
+
var __filename2, __dirname2, baseDir, templateDir, components, dependenciesMap;
|
|
135
|
+
var init_component = __esm({
|
|
136
|
+
"src/utils/component.ts"() {
|
|
137
|
+
"use strict";
|
|
138
|
+
init_esm_shims();
|
|
139
|
+
init_logger();
|
|
140
|
+
__filename2 = fileURLToPath2(import.meta.url);
|
|
141
|
+
__dirname2 = path2.dirname(__filename2);
|
|
142
|
+
baseDir = getBaseDir();
|
|
143
|
+
templateDir = path2.join(baseDir, "app", "templates");
|
|
144
|
+
logger.info(`\u{1F50D} Debug: baseDir=${baseDir}`);
|
|
145
|
+
logger.info(`\u{1F50D} Debug: templateDir=${templateDir}`);
|
|
146
|
+
components = [
|
|
147
|
+
"Button",
|
|
148
|
+
"Badge",
|
|
149
|
+
"Card",
|
|
150
|
+
"Collapse",
|
|
151
|
+
"CodeBlock",
|
|
152
|
+
"Navigation",
|
|
153
|
+
"Sidebar",
|
|
154
|
+
"Input",
|
|
155
|
+
"Theme",
|
|
156
|
+
"Tab",
|
|
157
|
+
"Toast",
|
|
158
|
+
"Pagination",
|
|
159
|
+
"Table",
|
|
160
|
+
"Modal",
|
|
161
|
+
"TOC",
|
|
162
|
+
"Dropdown"
|
|
163
|
+
];
|
|
164
|
+
dependenciesMap = {
|
|
165
|
+
Theme: ["Button", "Form", "Modal"]
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// src/index.ts
|
|
171
|
+
init_esm_shims();
|
|
172
|
+
import { Command as Command3 } from "commander";
|
|
173
|
+
|
|
174
|
+
// src/commands/add.ts
|
|
175
|
+
init_esm_shims();
|
|
176
|
+
init_logger();
|
|
177
|
+
init_component();
|
|
178
|
+
import { Command } from "commander";
|
|
179
|
+
import path3 from "path";
|
|
180
|
+
import prompts from "prompts";
|
|
181
|
+
import { z } from "zod";
|
|
182
|
+
var addOptionsSchema = z.object({
|
|
183
|
+
components: z.array(z.string()).optional(),
|
|
184
|
+
all: z.boolean(),
|
|
185
|
+
cwd: z.string()
|
|
186
|
+
});
|
|
187
|
+
var add = new Command().name("add").description("\uD504\uB85C\uC81D\uD2B8\uC5D0 \uCEF4\uD3EC\uB10C\uD2B8\uB97C \uCD94\uAC00\uD569\uB2C8\uB2E4.").argument("[components...]", "\uCD94\uAC00\uD560 \uCEF4\uD3EC\uB10C\uD2B8 \uC774\uB984 \uBAA9\uB85D").option("-a, --all", "\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uBAA8\uB4E0 \uCEF4\uD3EC\uB10C\uD2B8\uB97C \uCD94\uAC00\uD569\uB2C8\uB2E4.", false).option("-c, --cwd <cwd>", "\uC791\uC5C5 \uB514\uB809\uD1A0\uB9AC \uACBD\uB85C", process.cwd()).action(async (componentsArg, opts) => {
|
|
188
|
+
try {
|
|
189
|
+
const options = addOptionsSchema.parse({
|
|
190
|
+
components: componentsArg,
|
|
191
|
+
...opts,
|
|
192
|
+
cwd: path3.resolve(opts.cwd)
|
|
193
|
+
});
|
|
194
|
+
let selectedComponents = options.components || [];
|
|
195
|
+
if (options.all) {
|
|
196
|
+
selectedComponents = components;
|
|
197
|
+
}
|
|
198
|
+
if (selectedComponents.length === 0) {
|
|
199
|
+
const { components: promptedComponents } = await prompts({
|
|
200
|
+
type: "multiselect",
|
|
201
|
+
name: "components",
|
|
202
|
+
message: "\uCD94\uAC00\uD560 \uCEF4\uD3EC\uB10C\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694:",
|
|
203
|
+
choices: components.map((comp) => ({ title: comp, value: comp }))
|
|
204
|
+
});
|
|
205
|
+
selectedComponents = promptedComponents;
|
|
206
|
+
}
|
|
207
|
+
if (!selectedComponents || selectedComponents.length === 0) {
|
|
208
|
+
logger.warn("\uC120\uD0DD\uB41C \uCEF4\uD3EC\uB10C\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
const addedComponents = /* @__PURE__ */ new Set();
|
|
212
|
+
for (const comp of selectedComponents) {
|
|
213
|
+
addComponent(comp, options.cwd, addedComponents);
|
|
214
|
+
}
|
|
215
|
+
} catch (error) {
|
|
216
|
+
logger.error("\uCEF4\uD3EC\uB10C\uD2B8 \uCD94\uAC00 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.");
|
|
217
|
+
logger.error(error);
|
|
218
|
+
}
|
|
219
|
+
});
|
|
166
220
|
|
|
167
221
|
// src/commands/init.ts
|
|
222
|
+
init_esm_shims();
|
|
223
|
+
init_logger();
|
|
224
|
+
init_component();
|
|
168
225
|
import { Command as Command2 } from "commander";
|
|
169
226
|
import fs2 from "fs";
|
|
170
|
-
import
|
|
227
|
+
import path4 from "path";
|
|
171
228
|
import { exec } from "child_process";
|
|
172
229
|
import { promisify } from "util";
|
|
173
230
|
import ora from "ora";
|
|
174
231
|
import prompts2 from "prompts";
|
|
232
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
175
233
|
import { z as z2 } from "zod";
|
|
234
|
+
var __filename3 = fileURLToPath3(import.meta.url);
|
|
235
|
+
var __dirname3 = path4.dirname(__filename3);
|
|
176
236
|
var execPromise = promisify(exec);
|
|
177
237
|
var initOptionsSchema = z2.object({
|
|
178
238
|
cwd: z2.string(),
|
|
@@ -182,10 +242,10 @@ var init = new Command2().name("init").description("\uD504\uB85C\uC81D\uD2B8\uB9
|
|
|
182
242
|
try {
|
|
183
243
|
const options = initOptionsSchema.parse({
|
|
184
244
|
...opts,
|
|
185
|
-
cwd:
|
|
245
|
+
cwd: path4.resolve(opts.cwd)
|
|
186
246
|
});
|
|
187
247
|
const projectRoot = options.cwd;
|
|
188
|
-
const packageJsonPath =
|
|
248
|
+
const packageJsonPath = path4.join(projectRoot, "package.json");
|
|
189
249
|
if (!fs2.existsSync(packageJsonPath)) {
|
|
190
250
|
logger.error("\u274C \uC624\uB958: \uD604\uC7AC \uB514\uB809\uD1A0\uB9AC\uC5D0\uC11C package.json\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
191
251
|
logger.info("'npm init'\uC744 \uBA3C\uC800 \uC2E4\uD589\uD55C \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694.");
|
|
@@ -201,7 +261,7 @@ var init = new Command2().name("init").description("\uD504\uB85C\uC81D\uD2B8\uB9
|
|
|
201
261
|
const pkgSpinner = ora("Next.js\uC640 React \uC124\uCE58 \uC911...").start();
|
|
202
262
|
try {
|
|
203
263
|
await execPromise(
|
|
204
|
-
"npm install next@latest react@latest react-dom@latest tailwindcss @tailwindcss/postcss postcss clsx react-modal typescript @types/react @types/node @types/react-dom @types/react-modal",
|
|
264
|
+
"npm install next@latest react@latest react-dom@latest tailwindcss @tailwindcss/postcss postcss clsx react-modal typescript @types/react @types/node @types/react-dom @types/react-modal --legacy-peer-deps",
|
|
205
265
|
{ cwd: projectRoot }
|
|
206
266
|
);
|
|
207
267
|
pkgSpinner.succeed("Next.js\uC640 React \uC124\uCE58 \uC644\uB8CC!");
|
|
@@ -212,7 +272,7 @@ var init = new Command2().name("init").description("\uD504\uB85C\uC81D\uD2B8\uB9
|
|
|
212
272
|
}
|
|
213
273
|
const sdSpinner = ora("style-dictionary \uC124\uCE58 \uC911...").start();
|
|
214
274
|
try {
|
|
215
|
-
await execPromise("npm install style-dictionary -D", { cwd: projectRoot });
|
|
275
|
+
await execPromise("npm install style-dictionary -D --legacy-peer-deps", { cwd: projectRoot });
|
|
216
276
|
sdSpinner.succeed("style-dictionary \uC124\uCE58 \uC644\uB8CC!");
|
|
217
277
|
} catch (err) {
|
|
218
278
|
sdSpinner.fail("style-dictionary \uC124\uCE58 \uC911 \uC624\uB958 \uBC1C\uC0DD");
|
|
@@ -221,7 +281,7 @@ var init = new Command2().name("init").description("\uD504\uB85C\uC81D\uD2B8\uB9
|
|
|
221
281
|
}
|
|
222
282
|
const gsSpinner = ora("gsap Animation \uC124\uCE58 \uC911...").start();
|
|
223
283
|
try {
|
|
224
|
-
await execPromise("npm install gsap", { cwd: projectRoot });
|
|
284
|
+
await execPromise("npm install gsap --legacy-peer-deps", { cwd: projectRoot });
|
|
225
285
|
gsSpinner.succeed("gsap Animation \uC124\uCE58 \uC644\uB8CC!");
|
|
226
286
|
} catch (err) {
|
|
227
287
|
gsSpinner.fail("gsap Animation \uC124\uCE58 \uC911 \uC624\uB958 \uBC1C\uC0DD");
|
|
@@ -245,11 +305,11 @@ var init = new Command2().name("init").description("\uD504\uB85C\uC81D\uD2B8\uB9
|
|
|
245
305
|
logger.error("\u274C package.json \uC5C5\uB370\uC774\uD2B8 \uC624\uB958:", err);
|
|
246
306
|
return;
|
|
247
307
|
}
|
|
248
|
-
const appDir =
|
|
308
|
+
const appDir = path4.join(projectRoot, "app");
|
|
249
309
|
if (!fs2.existsSync(appDir)) fs2.mkdirSync(appDir, { recursive: true });
|
|
250
310
|
const files = [
|
|
251
311
|
{
|
|
252
|
-
path:
|
|
312
|
+
path: path4.join(appDir, "layout.tsx"),
|
|
253
313
|
content: `import { ThemeProvider } from "./components/Theme/Theme";
|
|
254
314
|
import "./globals.css";
|
|
255
315
|
|
|
@@ -266,13 +326,13 @@ export default function RootLayout({ children }: { children: React.ReactNode })
|
|
|
266
326
|
}`
|
|
267
327
|
},
|
|
268
328
|
{
|
|
269
|
-
path:
|
|
329
|
+
path: path4.join(appDir, "globals.css"),
|
|
270
330
|
content: `@import "tailwindcss";
|
|
271
331
|
@import "../build/css/_variables.css";
|
|
272
332
|
@import "../css/text.css";`
|
|
273
333
|
},
|
|
274
334
|
{
|
|
275
|
-
path:
|
|
335
|
+
path: path4.join(appDir, "page.tsx"),
|
|
276
336
|
content: `import { ThemeSelector } from "./components/Theme/Theme";
|
|
277
337
|
import { Button } from "./components/Button/Button";
|
|
278
338
|
import { Card, CardHeader, CardContent, CardFooter } from "./components/Card/Card";
|
|
@@ -312,7 +372,7 @@ export default function Page() {
|
|
|
312
372
|
}`
|
|
313
373
|
},
|
|
314
374
|
{
|
|
315
|
-
path:
|
|
375
|
+
path: path4.join(projectRoot, "tsconfig.json"),
|
|
316
376
|
content: JSON.stringify({
|
|
317
377
|
compilerOptions: {
|
|
318
378
|
target: "ES2017",
|
|
@@ -338,14 +398,14 @@ export default function Page() {
|
|
|
338
398
|
}, null, 2)
|
|
339
399
|
},
|
|
340
400
|
{
|
|
341
|
-
path:
|
|
401
|
+
path: path4.join(projectRoot, "next.config.ts"),
|
|
342
402
|
content: `import type { NextConfig } from "next";
|
|
343
403
|
|
|
344
404
|
const nextConfig: NextConfig = { reactStrictMode: false };
|
|
345
405
|
export default nextConfig;`
|
|
346
406
|
},
|
|
347
407
|
{
|
|
348
|
-
path:
|
|
408
|
+
path: path4.join(projectRoot, "postcss.config.mjs"),
|
|
349
409
|
content: `/** @type {import('postcss-load-config').Config} */
|
|
350
410
|
const config = { plugins: { "@tailwindcss/postcss": {} } };
|
|
351
411
|
export default config;`
|
|
@@ -355,7 +415,7 @@ export default config;`
|
|
|
355
415
|
fs2.writeFileSync(file.path, file.content);
|
|
356
416
|
logger.info(`\u2705 \uD30C\uC77C \uC0DD\uC131: ${file.path}`);
|
|
357
417
|
}
|
|
358
|
-
const buildTokensPath =
|
|
418
|
+
const buildTokensPath = path4.join(projectRoot, "build", "build-tokens.js");
|
|
359
419
|
if (fs2.existsSync(buildTokensPath)) {
|
|
360
420
|
const spin = ora("\uB514\uC790\uC778 \uD1A0\uD070 \uBE4C\uB4DC \uC911...").start();
|
|
361
421
|
try {
|
|
@@ -367,14 +427,19 @@ export default config;`
|
|
|
367
427
|
}
|
|
368
428
|
}
|
|
369
429
|
}
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
const tokenFile =
|
|
373
|
-
const buildFile =
|
|
374
|
-
const textCssFile =
|
|
375
|
-
copyFile(tokenFile,
|
|
376
|
-
copyFile(buildFile,
|
|
377
|
-
copyFile(textCssFile,
|
|
430
|
+
const { baseDir: pkgRoot } = await Promise.resolve().then(() => (init_component(), component_exports));
|
|
431
|
+
logger.info(`\u{1F50D} Debug: pkgRoot=${pkgRoot}`);
|
|
432
|
+
const tokenFile = path4.join(pkgRoot, "tokens", "tokens.json");
|
|
433
|
+
const buildFile = path4.join(pkgRoot, "build", "build-tokens.js");
|
|
434
|
+
const textCssFile = path4.join(pkgRoot, "css", "text.css");
|
|
435
|
+
copyFile(tokenFile, path4.join(projectRoot, "tokens", "tokens.json"));
|
|
436
|
+
copyFile(buildFile, path4.join(projectRoot, "build", "build-tokens.js"));
|
|
437
|
+
copyFile(textCssFile, path4.join(projectRoot, "css", "text.css"));
|
|
438
|
+
const addedComponents = /* @__PURE__ */ new Set();
|
|
439
|
+
logger.info("\u23F3 \uAE30\uBCF8 \uB370\uBAA8 \uCEF4\uD3EC\uB10C\uD2B8 \uC124\uCE58 \uC911...");
|
|
440
|
+
addComponent("Button", projectRoot, addedComponents);
|
|
441
|
+
addComponent("Theme", projectRoot, addedComponents);
|
|
442
|
+
addComponent("Card", projectRoot, addedComponents);
|
|
378
443
|
logger.success("\u{1F680} Atomsystem \uCD08\uAE30 \uC124\uC815 \uC644\uB8CC!");
|
|
379
444
|
} catch (error) {
|
|
380
445
|
logger.error("\uCD08\uAE30\uD654 \uC911 \uC624\uB958 \uBC1C\uC0DD:");
|
|
@@ -382,7 +447,7 @@ export default config;`
|
|
|
382
447
|
}
|
|
383
448
|
});
|
|
384
449
|
function copyFile(src, dest) {
|
|
385
|
-
const dir =
|
|
450
|
+
const dir = path4.dirname(dest);
|
|
386
451
|
if (!fs2.existsSync(dir)) fs2.mkdirSync(dir, { recursive: true });
|
|
387
452
|
if (fs2.existsSync(src)) {
|
|
388
453
|
fs2.copyFileSync(src, dest);
|
|
@@ -395,8 +460,12 @@ function copyFile(src, dest) {
|
|
|
395
460
|
// src/index.ts
|
|
396
461
|
import { readFileSync } from "fs";
|
|
397
462
|
import { join } from "path";
|
|
463
|
+
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
464
|
+
import { dirname } from "path";
|
|
465
|
+
var __filename4 = fileURLToPath4(import.meta.url);
|
|
466
|
+
var __dirname4 = dirname(__filename4);
|
|
398
467
|
async function main() {
|
|
399
|
-
const packageJsonPath = join(
|
|
468
|
+
const packageJsonPath = join(__dirname4, "..", "package.json");
|
|
400
469
|
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
401
470
|
const program = new Command3().name("atomsystem").description("Atom Ground Design System CLI").version(packageJson.version);
|
|
402
471
|
program.addCommand(add);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atomsystem",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.47",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://system.atomground.com",
|
|
6
6
|
"bin": {
|
|
@@ -20,12 +20,10 @@
|
|
|
20
20
|
"start": "next start",
|
|
21
21
|
"lint": "next lint",
|
|
22
22
|
"token-build": "node build/build-tokens.js",
|
|
23
|
-
"cli:build": "tsup src/index.ts --format esm --clean --shims --target node20",
|
|
23
|
+
"cli:build": "tsup src/index.ts --format esm --clean --shims --target node20 --no-splitting",
|
|
24
24
|
"cli:dev": "tsx src/index.ts"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"react": "^18.0.0",
|
|
28
|
-
"react-dom": "^18.0.0",
|
|
29
27
|
"sd-tailwindcss-transformer": "^2.0.0",
|
|
30
28
|
"style-dictionary": "^4.2.0"
|
|
31
29
|
},
|
|
@@ -39,7 +37,7 @@
|
|
|
39
37
|
"@mui/material": "^7.3.9",
|
|
40
38
|
"@next/mdx": "^15.4.6",
|
|
41
39
|
"@next/third-parties": "^15.0.3",
|
|
42
|
-
"@tailwindcss/postcss": "^4.
|
|
40
|
+
"@tailwindcss/postcss": "^4.2.2",
|
|
43
41
|
"@tokens-studio/sd-transforms": "^1.3.0",
|
|
44
42
|
"@types/mdx": "^2.0.13",
|
|
45
43
|
"chalk": "^5.6.2",
|
|
@@ -49,11 +47,11 @@
|
|
|
49
47
|
"highlight.js": "^11.11.1",
|
|
50
48
|
"inquirer": "^12.4.2",
|
|
51
49
|
"lucide-react": "^1.7.0",
|
|
52
|
-
"next": "
|
|
50
|
+
"next": "^16.2.4",
|
|
53
51
|
"ora": "^9.3.0",
|
|
54
52
|
"prompts": "^2.4.2",
|
|
55
|
-
"react": "^
|
|
56
|
-
"react-dom": "^
|
|
53
|
+
"react": "^19.2.5",
|
|
54
|
+
"react-dom": "^19.2.5",
|
|
57
55
|
"react-modal": "^3.16.3",
|
|
58
56
|
"react-responsive": "^10.0.1",
|
|
59
57
|
"remark-gfm": "^4.0.1",
|
|
@@ -63,21 +61,21 @@
|
|
|
63
61
|
"zod": "^4.3.6"
|
|
64
62
|
},
|
|
65
63
|
"devDependencies": {
|
|
66
|
-
"@types/node": "^20",
|
|
64
|
+
"@types/node": "^20.19.39",
|
|
67
65
|
"@types/prompts": "^2.4.9",
|
|
68
|
-
"@types/react": "^18",
|
|
69
|
-
"@types/react-dom": "^18",
|
|
66
|
+
"@types/react": "^18.3.28",
|
|
67
|
+
"@types/react-dom": "^18.3.7",
|
|
70
68
|
"@types/react-modal": "^3.16.3",
|
|
71
69
|
"@vitest/browser": "^3.1.1",
|
|
72
70
|
"@vitest/coverage-v8": "^3.1.1",
|
|
73
71
|
"eslint": "^8",
|
|
74
72
|
"eslint-config-next": "15.0.3",
|
|
75
73
|
"playwright": "^1.51.1",
|
|
76
|
-
"postcss": "^8.5.
|
|
77
|
-
"tailwindcss": "^4.
|
|
74
|
+
"postcss": "^8.5.10",
|
|
75
|
+
"tailwindcss": "^4.2.2",
|
|
78
76
|
"tsup": "^8.5.1",
|
|
79
77
|
"tsx": "^4.21.0",
|
|
80
|
-
"typescript": "^5",
|
|
78
|
+
"typescript": "^5.9.3",
|
|
81
79
|
"vitest": "^3.1.1"
|
|
82
80
|
}
|
|
83
81
|
}
|