create-ait-app 0.0.1 → 0.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 +35 -49
- package/package.json +2 -6
- package/src/cli.js +52 -0
- package/src/main.js +88 -396
- package/src/sample-configs.js +140 -0
- package/src/sample-inject.js +65 -0
- package/src/scaffold.js +111 -0
- package/src/skills.js +66 -0
- package/src/templates.js +88 -0
- package/src/utils/copy-dir.js +19 -0
- package/src/utils/fetch-text.js +47 -0
- package/src/utils/package-name.js +26 -0
- package/templates/js/eslint.config.js +14 -0
- package/templates/js/index.html +12 -0
- package/templates/js/package.json +20 -0
- package/templates/js/samples/iaa/src/lib/inAppAds.js +119 -0
- package/templates/js/samples/iaa/src/pages/InAppAdsPage.js +83 -0
- package/templates/js/samples/iap/src/lib/inAppPurchase.js +105 -0
- package/templates/js/samples/iap/src/pages/InAppPurchasePage.js +102 -0
- package/templates/js/src/app.js +58 -0
- package/templates/js/src/main.js +2 -0
- package/templates/js/vite.config.js +3 -0
- package/templates/react/README.md +26 -0
- package/templates/react/eslint.config.js +30 -0
- package/templates/react/granite.config.ts +20 -0
- package/templates/react/index.html +12 -0
- package/templates/react/package.json +27 -0
- package/templates/react/public/appsintoss-logo.png +0 -0
- package/templates/react/samples/iaa/src/hooks/useInAppAds.js +102 -0
- package/templates/react/samples/iaa/src/pages/InAppAdsPage.css +72 -0
- package/templates/react/samples/iaa/src/pages/InAppAdsPage.jsx +75 -0
- package/templates/react/samples/iap/public/icon-document.png +0 -0
- package/templates/react/samples/iap/src/hooks/useInAppPurchase.js +95 -0
- package/templates/react/samples/iap/src/pages/InAppPurchasePage.css +115 -0
- package/templates/react/samples/iap/src/pages/InAppPurchasePage.jsx +115 -0
- package/templates/react/src/App.css +104 -0
- package/templates/react/src/App.jsx +45 -0
- package/templates/react/src/index.css +27 -0
- package/templates/react/src/main.jsx +10 -0
- package/templates/react/vite.config.js +6 -0
- package/templates/react-ts/README.md +26 -0
- package/templates/react-ts/eslint.config.js +28 -0
- package/templates/react-ts/granite.config.ts +20 -0
- package/templates/react-ts/index.html +12 -0
- package/templates/react-ts/public/appsintoss-logo.png +0 -0
- package/templates/react-ts/samples/iaa/src/pages/InAppAdsPage.css +72 -0
- package/templates/react-ts/samples/iap/public/icon-document.png +0 -0
- package/templates/react-ts/samples/iap/src/pages/InAppPurchasePage.css +115 -0
- package/templates/react-ts/src/App.css +104 -0
- package/templates/react-ts/src/index.css +27 -0
- package/templates/react-ts/src/vite-env.d.ts +6 -0
- package/templates/react-ts/tsconfig.app.json +22 -0
- package/templates/react-ts/tsconfig.json +7 -0
- package/templates/react-ts/tsconfig.node.json +20 -0
- package/templates/react-ts/vite.config.ts +6 -0
- package/templates/react-ts-tds/README.md +26 -0
- package/templates/react-ts-tds/granite.config.ts +20 -0
- package/templates/react-ts-tds/package.json +35 -0
- package/templates/react-ts-tds/public/appsintoss-logo.png +0 -0
- package/templates/ts/README.md +26 -0
- package/templates/ts/eslint.config.js +15 -0
- package/templates/ts/granite.config.ts +20 -0
- package/templates/ts/index.html +12 -0
- package/templates/ts/package.json +22 -0
- package/templates/ts/public/appsintoss-logo.png +0 -0
- package/templates/ts/samples/iaa/src/lib/inAppAds.ts +132 -0
- package/templates/ts/samples/iaa/src/pages/InAppAdsPage.css +72 -0
- package/templates/ts/samples/iaa/src/pages/InAppAdsPage.ts +85 -0
- package/templates/ts/samples/iap/public/icon-document.png +0 -0
- package/templates/ts/samples/iap/src/lib/inAppPurchase.ts +114 -0
- package/templates/ts/samples/iap/src/pages/InAppPurchasePage.css +115 -0
- package/templates/ts/samples/iap/src/pages/InAppPurchasePage.ts +105 -0
- package/templates/ts/src/App.css +104 -0
- package/templates/ts/src/app.ts +60 -0
- package/templates/ts/src/index.css +27 -0
- package/templates/ts/src/main.ts +2 -0
- package/templates/ts/src/vite-env.d.ts +1 -0
- package/templates/ts/tsconfig.app.json +22 -0
- package/templates/ts/tsconfig.json +7 -0
- package/templates/ts/tsconfig.node.json +20 -0
- package/templates/ts/vite.config.ts +3 -0
- /package/{template → templates/js}/README.md +0 -0
- /package/{template → templates/js}/granite.config.ts +0 -0
- /package/{template → templates/js}/public/appsintoss-logo.png +0 -0
- /package/{template/__default/__samples → templates/js/samples}/iaa/src/pages/InAppAdsPage.css +0 -0
- /package/{template/__default/__samples → templates/js/samples}/iap/public/icon-document.png +0 -0
- /package/{template/__default/__samples → templates/js/samples}/iap/src/pages/InAppPurchasePage.css +0 -0
- /package/{template/__default → templates/js}/src/App.css +0 -0
- /package/{template/__default → templates/js}/src/index.css +0 -0
- /package/{template → templates/react-ts}/package.json +0 -0
- /package/{template/__default/__samples → templates/react-ts/samples}/iaa/src/hooks/useInAppAds.tsx +0 -0
- /package/{template/__default/__samples → templates/react-ts/samples}/iaa/src/pages/InAppAdsPage.tsx +0 -0
- /package/{template/__default/__samples → templates/react-ts/samples}/iap/src/hooks/useInAppPurchase.ts +0 -0
- /package/{template/__default/__samples → templates/react-ts/samples}/iap/src/pages/InAppPurchasePage.tsx +0 -0
- /package/{template/__default → templates/react-ts}/src/App.tsx +0 -0
- /package/{template/__default → templates/react-ts}/src/main.tsx +0 -0
- /package/{template → templates/react-ts-tds}/eslint.config.js +0 -0
- /package/{template → templates/react-ts-tds}/index.html +0 -0
- /package/{template/__tds/__samples → templates/react-ts-tds/samples}/iaa/src/hooks/useInAppAds.tsx +0 -0
- /package/{template/__tds/__samples → templates/react-ts-tds/samples}/iaa/src/pages/InAppAdsPage.tsx +0 -0
- /package/{template/__tds/__samples → templates/react-ts-tds/samples}/iap/public/icon-document.png +0 -0
- /package/{template/__tds/__samples → templates/react-ts-tds/samples}/iap/src/hooks/useInAppPurchase.ts +0 -0
- /package/{template/__tds/__samples → templates/react-ts-tds/samples}/iap/src/pages/InAppPurchasePage.tsx +0 -0
- /package/{template/__tds → templates/react-ts-tds}/src/App.css +0 -0
- /package/{template/__tds → templates/react-ts-tds}/src/App.tsx +0 -0
- /package/{template/__tds → templates/react-ts-tds}/src/index.css +0 -0
- /package/{template/__tds → templates/react-ts-tds}/src/main.tsx +0 -0
- /package/{template → templates/react-ts-tds}/src/vite-env.d.ts +0 -0
- /package/{template → templates/react-ts-tds}/tsconfig.app.json +0 -0
- /package/{template → templates/react-ts-tds}/tsconfig.json +0 -0
- /package/{template → templates/react-ts-tds}/tsconfig.node.json +0 -0
- /package/{template → templates/react-ts-tds}/vite.config.ts +0 -0
package/README.md
CHANGED
|
@@ -1,75 +1,57 @@
|
|
|
1
1
|
# create-ait-app
|
|
2
2
|
|
|
3
3
|
앱인토스(Apps in Toss) 프로젝트를 빠르게 시작할 수 있는 CLI 도구예요.
|
|
4
|
-
Vite 기반 React
|
|
4
|
+
Vite 기반 **React** 또는 **Vanilla** 프로젝트를 생성하고, TDS·인앱결제·인앱광고 예제 등을 선택적으로 추가할 수 있어요.
|
|
5
5
|
|
|
6
|
-
##
|
|
6
|
+
## 빠르게 시작하기
|
|
7
7
|
|
|
8
8
|
```bash
|
|
9
9
|
npx create-ait-app my-app
|
|
10
|
+
cd my-app
|
|
11
|
+
npm run dev
|
|
10
12
|
```
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
패키지 매니저는 생성 시 선택한 값에 맞게 `yarn dev`, `pnpm dev` 등으로 실행하면 돼요.
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
## 대화형 설정
|
|
17
|
+
|
|
18
|
+
`npx create-ait-app`을 실행하면 아래 항목을 순서대로 선택할 수 있어요.
|
|
19
|
+
|
|
20
|
+
1. **패키지 매니저** — npm, yarn, pnpm
|
|
21
|
+
2. **프로젝트 템플릿** — `react-ts` / `react` / `js` / `ts`
|
|
22
|
+
3. **TDS (Toss Design System)** — `react-ts` 선택 시에만 표시돼요 (선택, 기본값: 사용 안 함)
|
|
23
|
+
4. **AI Skills** — Cursor / Claude Code / Codex용 SDK 문서 파일 추가 여부
|
|
24
|
+
5. **예제 코드** — 인앱결제(`iap`), 인앱광고(`iaa`) 샘플 추가 (복수 선택 가능)
|
|
18
25
|
|
|
19
26
|
## CLI 옵션
|
|
20
27
|
|
|
21
|
-
프롬프트 없이 한 줄로
|
|
28
|
+
프롬프트 없이 한 줄로 생성할 수도 있어요.
|
|
22
29
|
|
|
23
30
|
```bash
|
|
24
|
-
create-ait-app my-app --inline --pm yarn --
|
|
31
|
+
create-ait-app my-app --inline --pm yarn --sample iap,iaa
|
|
25
32
|
```
|
|
26
33
|
|
|
27
|
-
| 옵션
|
|
28
|
-
|
|
|
29
|
-
| `--inline`
|
|
30
|
-
| `--pm <name>`
|
|
31
|
-
| `--
|
|
32
|
-
| `--
|
|
33
|
-
| `--
|
|
34
|
-
| `--
|
|
35
|
-
| `--
|
|
34
|
+
| 옵션 | 설명 |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| `--inline` | 대화형 질문을 생략하고 옵션만으로 설정해요 (미지정 항목은 모두 `n`이에요) |
|
|
37
|
+
| `--pm <name>` | 패키지 매니저를 지정해요 (`npm`, `yarn`, `pnpm`) |
|
|
38
|
+
| `--template <name>` | 템플릿을 지정해요 (`js`, `ts`, `react`, `react-ts` / 기본값: `react-ts`) |
|
|
39
|
+
| `--tds` | `react-ts` 템플릿에서 TDS를 사용해요 (다른 템플릿에서는 무시돼요) |
|
|
40
|
+
| `--skills` | AI를 위한 Skills 파일을 추가해요 |
|
|
41
|
+
| `--ai <name>` | 사용할 AI 도구를 지정해요 (`cursor`, `claude`, `codex`) |
|
|
42
|
+
| `--sample <name>` | 예제 코드를 추가해요 (`iap`, `iaa` / 복수: `iap,iaa`) |
|
|
43
|
+
| `--help` | 도움말을 출력해요 |
|
|
36
44
|
|
|
37
|
-
|
|
45
|
+
### TDS (Toss Design System)
|
|
38
46
|
|
|
39
|
-
|
|
40
|
-
- **예제 코드**를 선택한 경우에만 `src/hooks/`, `src/pages/` 및 해당 파일들이 추가됩니다.
|
|
47
|
+
TDS는 토스에서 제공하는 디자인 시스템 컴포넌트 모음이에요. React를 필수로 사용해야 해요.
|
|
41
48
|
|
|
42
|
-
|
|
43
|
-
my-app/
|
|
44
|
-
├── src/
|
|
45
|
-
│ ├── App.tsx
|
|
46
|
-
│ ├── App.css
|
|
47
|
-
│ ├── main.tsx
|
|
48
|
-
│ ├── index.css
|
|
49
|
-
│ ├── vite-env.d.ts
|
|
50
|
-
│ ├── hooks/ # --sample iap/iaa 선택 시에만 추가
|
|
51
|
-
│ └── pages/ # --sample iap/iaa 선택 시에만 추가
|
|
52
|
-
├── public/
|
|
53
|
-
├── granite.config.ts
|
|
54
|
-
├── package.json
|
|
55
|
-
├── vite.config.ts
|
|
56
|
-
├── tsconfig.json
|
|
57
|
-
└── README.md
|
|
58
|
-
```
|
|
49
|
+
TDS 사용은 앱인토스 개발에 필수가 아니에요. `react-ts` 템플릿을 선택한 경우에만 `--tds` 옵션이나 대화형 프롬프트에서 TDS 사용 여부를 물어봐요.
|
|
59
50
|
|
|
60
|
-
##
|
|
51
|
+
## 생성되는 프로젝트
|
|
61
52
|
|
|
62
|
-
|
|
63
|
-
# 의존성 설치
|
|
64
|
-
npm install
|
|
53
|
+
기본 템플릿은 헤더, 개발자센터·커뮤니티 링크 등 최소 구성만 포함해요. `--sample`로 예제를 선택한 경우 `src/pages/`가 추가되고, React 템플릿은 `src/hooks/`, Vanilla(`js`/`ts`) 템플릿은 `src/lib/`가 추가돼요.
|
|
65
54
|
|
|
66
|
-
# 로컬에서 CLI 테스트
|
|
67
|
-
npm link
|
|
68
|
-
create-ait-app test-project
|
|
69
|
-
|
|
70
|
-
# 링크 해제
|
|
71
|
-
npm unlink -g create-ait-app
|
|
72
|
-
```
|
|
73
55
|
|
|
74
56
|
## 관련 링크
|
|
75
57
|
|
|
@@ -77,3 +59,7 @@ npm unlink -g create-ait-app
|
|
|
77
59
|
- [앱인토스 개발자센터](https://developers-apps-in-toss.toss.im/)
|
|
78
60
|
- [앱인토스 개발자 커뮤니티](https://techchat-apps-in-toss.toss.im/)
|
|
79
61
|
- [AI를 위한 LLMs 문서](https://developers-apps-in-toss.toss.im/development/llms.html)
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
이 CLI 도구에 기여하고 싶다면 [CONTRIBUTING.md](./CONTRIBUTING.md)를 참고해 주세요.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-ait-app",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Create AIT App scaffolding tool",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -17,14 +17,10 @@
|
|
|
17
17
|
"bin": {
|
|
18
18
|
"create-ait-app": "./bin/index.js"
|
|
19
19
|
},
|
|
20
|
-
"scripts": {
|
|
21
|
-
"test": "node -c ./bin/index.js && node -c ./src/main.js",
|
|
22
|
-
"prepublishOnly": "npm run test"
|
|
23
|
-
},
|
|
24
20
|
"files": [
|
|
25
21
|
"bin",
|
|
26
22
|
"src",
|
|
27
|
-
"
|
|
23
|
+
"templates"
|
|
28
24
|
],
|
|
29
25
|
"dependencies": {
|
|
30
26
|
"@inquirer/prompts": "^7.10.1"
|
package/src/cli.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
function parseArgs(argv) {
|
|
2
|
+
const args = { _: [], sample: [] };
|
|
3
|
+
for (let i = 0; i < argv.length; i++) {
|
|
4
|
+
if (argv[i] === "--pm" && argv[i + 1]) {
|
|
5
|
+
args.pm = argv[++i];
|
|
6
|
+
} else if (argv[i] === "--ai" && argv[i + 1]) {
|
|
7
|
+
args.ai = argv[++i];
|
|
8
|
+
} else if (
|
|
9
|
+
argv[i] === "--sample" &&
|
|
10
|
+
argv[i + 1] &&
|
|
11
|
+
!argv[i + 1].startsWith("--")
|
|
12
|
+
) {
|
|
13
|
+
args.sample.push(...argv[++i].split(","));
|
|
14
|
+
} else if (argv[i] === "--template" && argv[i + 1]) {
|
|
15
|
+
args.template = argv[++i];
|
|
16
|
+
} else if (argv[i].startsWith("--")) {
|
|
17
|
+
args[argv[i].slice(2)] = true;
|
|
18
|
+
} else {
|
|
19
|
+
args._.push(argv[i]);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return args;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function printHelp() {
|
|
26
|
+
console.log(`
|
|
27
|
+
사용법: create-ait-app [project-name] [options]
|
|
28
|
+
|
|
29
|
+
options:
|
|
30
|
+
--inline 질문을 생략하고 옵션만으로 설정합니다 (옵션 미지정 시 모두 n)
|
|
31
|
+
--pm <name> 패키지 매니저를 지정합니다 (npm, yarn, pnpm)
|
|
32
|
+
--template <name> 템플릿을 지정합니다 (기본값: react-ts)
|
|
33
|
+
--tds react-ts 템플릿에서 TDS를 사용합니다 (다른 템플릿에서는 무시)
|
|
34
|
+
--skills AI를 위한 skills 파일을 추가합니다
|
|
35
|
+
--ai <name> AI 도구를 지정합니다 (cursor, claude, codex)
|
|
36
|
+
--sample <name> 예제 코드를 추가합니다 (iap, iaa / 복수선택: iap,iaa)
|
|
37
|
+
--help 이 도움말을 출력합니다
|
|
38
|
+
|
|
39
|
+
templates:
|
|
40
|
+
react-ts React + TypeScript (기본)
|
|
41
|
+
react React + JavaScript
|
|
42
|
+
js Vanilla JavaScript
|
|
43
|
+
ts Vanilla TypeScript
|
|
44
|
+
|
|
45
|
+
links:
|
|
46
|
+
앱인토스 콘솔 https://apps-in-toss.toss.im/
|
|
47
|
+
앱인토스 개발자센터 https://developers-apps-in-toss.toss.im/
|
|
48
|
+
앱인토스 개발자 커뮤니티 https://techchat-apps-in-toss.toss.im/
|
|
49
|
+
`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
module.exports = { parseArgs, printHelp };
|