atomsystem 0.1.6 → 0.1.8
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 +37 -0
- package/package.json +7 -6
- package/bin/app-component.js +0 -34
- package/test/files.js +0 -1
package/cli/init.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const inquirer = require("inquirer");
|
|
3
|
+
const { exec } = require("child_process");
|
|
4
|
+
|
|
5
|
+
// 사용자에게 질문을 던져서 Next.js와 React를 설치할지 물어봅니다.
|
|
6
|
+
inquirer
|
|
7
|
+
.prompt([
|
|
8
|
+
{
|
|
9
|
+
type: "confirm",
|
|
10
|
+
name: "installPackages",
|
|
11
|
+
message: "Do you want to install Next.js and React?",
|
|
12
|
+
default: true,
|
|
13
|
+
},
|
|
14
|
+
])
|
|
15
|
+
.then((answers) => {
|
|
16
|
+
if (answers.installPackages) {
|
|
17
|
+
console.log("Installing Next.js and React...");
|
|
18
|
+
|
|
19
|
+
// 두 패키지를 동시에 설치하는 명령어
|
|
20
|
+
exec(
|
|
21
|
+
"npm install next@latest react@latest react-dom@latest",
|
|
22
|
+
(err, stdout, stderr) => {
|
|
23
|
+
if (err) {
|
|
24
|
+
console.error(`Error: ${stderr}`);
|
|
25
|
+
} else {
|
|
26
|
+
console.log(stdout);
|
|
27
|
+
console.log("Installation complete!");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
} else {
|
|
32
|
+
console.log("Installation skipped.");
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
.catch((error) => {
|
|
36
|
+
console.error("Error:", error);
|
|
37
|
+
});
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atomsystem",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
|
-
"atomsystem": "
|
|
6
|
+
"atomsystem-init": "cli/init.js"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
9
|
"bin",
|
|
@@ -22,20 +22,21 @@
|
|
|
22
22
|
"lint": "next lint"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
+
"@tokens-studio/sd-transforms": "^1.2.8",
|
|
25
26
|
"react": "^18.0.0",
|
|
26
27
|
"react-dom": "^18.0.0",
|
|
27
28
|
"sd-tailwindcss-transformer": "^2.0.0",
|
|
28
|
-
"style-dictionary": "^4.2.0"
|
|
29
|
-
"@tokens-studio/sd-transforms": "^1.2.8"
|
|
29
|
+
"style-dictionary": "^4.2.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@next/third-parties": "^15.0.3",
|
|
33
33
|
"@tokens-studio/sd-transforms": "^1.2.8",
|
|
34
34
|
"clsx": "^2.1.1",
|
|
35
35
|
"highlight.js": "^11.11.1",
|
|
36
|
+
"inquirer": "^12.4.2",
|
|
36
37
|
"next": "15.0.3",
|
|
37
|
-
"react": "
|
|
38
|
-
"react-dom": "
|
|
38
|
+
"react": "^18.0.0",
|
|
39
|
+
"react-dom": "^18.0.0",
|
|
39
40
|
"sd-tailwindcss-transformer": "^2.0.0",
|
|
40
41
|
"style-dictionary": "^4.2.0"
|
|
41
42
|
},
|
package/bin/app-component.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const fs = require("fs");
|
|
4
|
-
const path = require("path");
|
|
5
|
-
|
|
6
|
-
// 사용자 입력 (예: "button")
|
|
7
|
-
const componentName = process.argv[2];
|
|
8
|
-
|
|
9
|
-
if (!componentName) {
|
|
10
|
-
console.error(
|
|
11
|
-
"❌ Component name is required! Example: npx atomsystem add button"
|
|
12
|
-
);
|
|
13
|
-
process.exit(1);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// 패키지 내부의 템플릿 폴더
|
|
17
|
-
const srcDir = path.join(__dirname, "..", "app", "Component");
|
|
18
|
-
const srcPath = path.join(srcDir, `${componentName}.tsx`);
|
|
19
|
-
|
|
20
|
-
// 사용자 프로젝트의 대상 폴더
|
|
21
|
-
const destDir = path.join(process.cwd(), "app", "component");
|
|
22
|
-
const destPath = path.join(destDir, `${componentName}.tsx`);
|
|
23
|
-
|
|
24
|
-
if (!fs.existsSync(srcPath)) {
|
|
25
|
-
console.error(`❌ Component "${componentName}" not found in templates!`);
|
|
26
|
-
process.exit(1);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// 대상 폴더가 없으면 생성
|
|
30
|
-
fs.mkdirSync(destDir, { recursive: true });
|
|
31
|
-
|
|
32
|
-
// 파일 복사
|
|
33
|
-
fs.copyFileSync(srcPath, destPath);
|
|
34
|
-
console.log(`✅ ${componentName}.tsx added to app/component`);
|
package/test/files.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
console.log("file!");
|