create-ait-app 0.0.2 → 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.
Files changed (112) hide show
  1. package/README.md +38 -38
  2. package/package.json +5 -8
  3. package/src/cli.js +52 -0
  4. package/src/main.js +95 -444
  5. package/src/sample-configs.js +140 -0
  6. package/src/sample-inject.js +65 -0
  7. package/src/scaffold.js +111 -0
  8. package/src/skills.js +66 -0
  9. package/src/templates.js +88 -0
  10. package/src/utils/copy-dir.js +19 -0
  11. package/src/utils/fetch-text.js +47 -0
  12. package/src/utils/package-name.js +26 -0
  13. package/templates/js/eslint.config.js +14 -0
  14. package/templates/js/index.html +12 -0
  15. package/templates/js/package.json +20 -0
  16. package/templates/js/samples/iaa/src/lib/inAppAds.js +119 -0
  17. package/templates/js/samples/iaa/src/pages/InAppAdsPage.js +83 -0
  18. package/templates/js/samples/iap/src/lib/inAppPurchase.js +105 -0
  19. package/templates/js/samples/iap/src/pages/InAppPurchasePage.js +102 -0
  20. package/templates/js/src/app.js +58 -0
  21. package/templates/js/src/main.js +2 -0
  22. package/templates/js/vite.config.js +3 -0
  23. package/templates/react/README.md +26 -0
  24. package/templates/react/eslint.config.js +30 -0
  25. package/templates/react/granite.config.ts +20 -0
  26. package/templates/react/index.html +12 -0
  27. package/templates/react/package.json +27 -0
  28. package/templates/react/public/appsintoss-logo.png +0 -0
  29. package/templates/react/samples/iaa/src/hooks/useInAppAds.js +102 -0
  30. package/templates/react/samples/iaa/src/pages/InAppAdsPage.css +72 -0
  31. package/templates/react/samples/iaa/src/pages/InAppAdsPage.jsx +75 -0
  32. package/templates/react/samples/iap/public/icon-document.png +0 -0
  33. package/templates/react/samples/iap/src/hooks/useInAppPurchase.js +95 -0
  34. package/templates/react/samples/iap/src/pages/InAppPurchasePage.css +115 -0
  35. package/templates/react/samples/iap/src/pages/InAppPurchasePage.jsx +115 -0
  36. package/templates/react/src/App.css +104 -0
  37. package/templates/react/src/App.jsx +45 -0
  38. package/templates/react/src/index.css +27 -0
  39. package/templates/react/src/main.jsx +10 -0
  40. package/templates/react/vite.config.js +6 -0
  41. package/templates/react-ts/README.md +26 -0
  42. package/templates/react-ts/eslint.config.js +28 -0
  43. package/templates/react-ts/granite.config.ts +20 -0
  44. package/templates/react-ts/index.html +12 -0
  45. package/templates/react-ts/public/appsintoss-logo.png +0 -0
  46. package/templates/react-ts/samples/iaa/src/pages/InAppAdsPage.css +72 -0
  47. package/templates/react-ts/samples/iap/public/icon-document.png +0 -0
  48. package/templates/react-ts/samples/iap/src/pages/InAppPurchasePage.css +115 -0
  49. package/templates/react-ts/src/App.css +104 -0
  50. package/templates/react-ts/src/index.css +27 -0
  51. package/templates/react-ts/src/vite-env.d.ts +6 -0
  52. package/templates/react-ts/tsconfig.app.json +22 -0
  53. package/templates/react-ts/tsconfig.json +7 -0
  54. package/templates/react-ts/tsconfig.node.json +20 -0
  55. package/templates/react-ts/vite.config.ts +6 -0
  56. package/templates/react-ts-tds/README.md +26 -0
  57. package/templates/react-ts-tds/granite.config.ts +20 -0
  58. package/templates/react-ts-tds/package.json +35 -0
  59. package/templates/react-ts-tds/public/appsintoss-logo.png +0 -0
  60. package/templates/ts/README.md +26 -0
  61. package/templates/ts/eslint.config.js +15 -0
  62. package/templates/ts/granite.config.ts +20 -0
  63. package/templates/ts/index.html +12 -0
  64. package/templates/ts/package.json +22 -0
  65. package/templates/ts/public/appsintoss-logo.png +0 -0
  66. package/templates/ts/samples/iaa/src/lib/inAppAds.ts +132 -0
  67. package/templates/ts/samples/iaa/src/pages/InAppAdsPage.css +72 -0
  68. package/templates/ts/samples/iaa/src/pages/InAppAdsPage.ts +85 -0
  69. package/templates/ts/samples/iap/public/icon-document.png +0 -0
  70. package/templates/ts/samples/iap/src/lib/inAppPurchase.ts +114 -0
  71. package/templates/ts/samples/iap/src/pages/InAppPurchasePage.css +115 -0
  72. package/templates/ts/samples/iap/src/pages/InAppPurchasePage.ts +105 -0
  73. package/templates/ts/src/App.css +104 -0
  74. package/templates/ts/src/app.ts +60 -0
  75. package/templates/ts/src/index.css +27 -0
  76. package/templates/ts/src/main.ts +2 -0
  77. package/templates/ts/src/vite-env.d.ts +1 -0
  78. package/templates/ts/tsconfig.app.json +22 -0
  79. package/templates/ts/tsconfig.json +7 -0
  80. package/templates/ts/tsconfig.node.json +20 -0
  81. package/templates/ts/vite.config.ts +3 -0
  82. /package/{template → templates/js}/README.md +0 -0
  83. /package/{template → templates/js}/granite.config.ts +0 -0
  84. /package/{template → templates/js}/public/appsintoss-logo.png +0 -0
  85. /package/{template/__default/__samples → templates/js/samples}/iaa/src/pages/InAppAdsPage.css +0 -0
  86. /package/{template/__default/__samples → templates/js/samples}/iap/public/icon-document.png +0 -0
  87. /package/{template/__default/__samples → templates/js/samples}/iap/src/pages/InAppPurchasePage.css +0 -0
  88. /package/{template/__default → templates/js}/src/App.css +0 -0
  89. /package/{template/__default → templates/js}/src/index.css +0 -0
  90. /package/{template → templates/react-ts}/package.json +0 -0
  91. /package/{template/__default/__samples → templates/react-ts/samples}/iaa/src/hooks/useInAppAds.tsx +0 -0
  92. /package/{template/__default/__samples → templates/react-ts/samples}/iaa/src/pages/InAppAdsPage.tsx +0 -0
  93. /package/{template/__default/__samples → templates/react-ts/samples}/iap/src/hooks/useInAppPurchase.ts +0 -0
  94. /package/{template/__default/__samples → templates/react-ts/samples}/iap/src/pages/InAppPurchasePage.tsx +0 -0
  95. /package/{template/__default → templates/react-ts}/src/App.tsx +0 -0
  96. /package/{template/__default → templates/react-ts}/src/main.tsx +0 -0
  97. /package/{template → templates/react-ts-tds}/eslint.config.js +0 -0
  98. /package/{template → templates/react-ts-tds}/index.html +0 -0
  99. /package/{template/__tds/__samples → templates/react-ts-tds/samples}/iaa/src/hooks/useInAppAds.tsx +0 -0
  100. /package/{template/__tds/__samples → templates/react-ts-tds/samples}/iaa/src/pages/InAppAdsPage.tsx +0 -0
  101. /package/{template/__tds/__samples → templates/react-ts-tds/samples}/iap/public/icon-document.png +0 -0
  102. /package/{template/__tds/__samples → templates/react-ts-tds/samples}/iap/src/hooks/useInAppPurchase.ts +0 -0
  103. /package/{template/__tds/__samples → templates/react-ts-tds/samples}/iap/src/pages/InAppPurchasePage.tsx +0 -0
  104. /package/{template/__tds → templates/react-ts-tds}/src/App.css +0 -0
  105. /package/{template/__tds → templates/react-ts-tds}/src/App.tsx +0 -0
  106. /package/{template/__tds → templates/react-ts-tds}/src/index.css +0 -0
  107. /package/{template/__tds → templates/react-ts-tds}/src/main.tsx +0 -0
  108. /package/{template → templates/react-ts-tds}/src/vite-env.d.ts +0 -0
  109. /package/{template → templates/react-ts-tds}/tsconfig.app.json +0 -0
  110. /package/{template → templates/react-ts-tds}/tsconfig.json +0 -0
  111. /package/{template → templates/react-ts-tds}/tsconfig.node.json +0 -0
  112. /package/{template → templates/react-ts-tds}/vite.config.ts +0 -0
@@ -0,0 +1,104 @@
1
+ #root {
2
+ width: 100%;
3
+ min-height: 100vh;
4
+ box-sizing: border-box;
5
+ padding: 24px;
6
+ }
7
+
8
+ @media (min-width: 481px) {
9
+ #root {
10
+ background-color: #ffffff;
11
+ max-width: 480px;
12
+ margin: 0 auto;
13
+ }
14
+ }
15
+
16
+ .app {
17
+ display: flex;
18
+ flex-direction: column;
19
+ }
20
+
21
+ .app-header {
22
+ display: flex;
23
+ flex-direction: column;
24
+ gap: 12px;
25
+ padding: 24px 0;
26
+ }
27
+
28
+ .page-title {
29
+ margin: 0;
30
+ font-size: 24px;
31
+ font-weight: 600;
32
+ color: #333d4b;
33
+ }
34
+
35
+ .page-subtitle {
36
+ margin: 0;
37
+ font-size: 18px;
38
+ color: #4e5968;
39
+ }
40
+
41
+ .app-actions {
42
+ display: flex;
43
+ flex-direction: column;
44
+ gap: 16px;
45
+ padding: 24px 0;
46
+ }
47
+
48
+ .app-button {
49
+ width: 100%;
50
+ border: none;
51
+ border-radius: 16px;
52
+ padding: 20px;
53
+ font-size: 18px;
54
+ font-weight: 500;
55
+ cursor: pointer;
56
+ display: flex;
57
+ align-items: center;
58
+ justify-content: center;
59
+ box-sizing: border-box;
60
+ text-decoration: none;
61
+ }
62
+
63
+ .app-button:active {
64
+ transform: scale(0.96);
65
+ transition: transform 0.1s ease;
66
+ }
67
+
68
+ .app-button-primary {
69
+ background-color: #ebf2ff;
70
+ color: #2272eb;
71
+ }
72
+
73
+ .app-button-primary:hover {
74
+ background-color: #c9e2ff;
75
+ }
76
+
77
+ .app-button-ghost {
78
+ background-color: #f2f4f6;
79
+ color: #4b5563;
80
+ }
81
+
82
+ .app-button-ghost:hover {
83
+ background-color: #e5e8eb;
84
+ }
85
+
86
+ .text-button {
87
+ background: none;
88
+ border: none;
89
+ cursor: pointer;
90
+ font-size: 18px;
91
+ color: #3182f6;
92
+ }
93
+
94
+ .app-logo-wrap {
95
+ position: fixed;
96
+ bottom: 24px;
97
+ left: 50%;
98
+ transform: translateX(-50%);
99
+ }
100
+
101
+ .logo {
102
+ width: 160px;
103
+ height: auto;
104
+ }
@@ -0,0 +1,60 @@
1
+ import "./App.css";
2
+ {{SAMPLE_IMPORTS}}
3
+
4
+ let currentPage: string | null = null;
5
+
6
+ function renderHome() {
7
+ const root = document.getElementById("root");
8
+ if (!root) return;
9
+
10
+ root.innerHTML = `
11
+ <div class="app">
12
+ <header class="app-header">
13
+ <h1 class="page-title">반가워요</h1>
14
+ <p class="page-subtitle">앱인토스 개발을 시작해 보세요.</p>
15
+ </header>
16
+
17
+ <div class="app-actions">
18
+ <a
19
+ class="app-button app-button-primary"
20
+ href="https://developers-apps-in-toss.toss.im"
21
+ target="_blank"
22
+ rel="noopener noreferrer"
23
+ >
24
+ 개발자센터
25
+ </a>
26
+ <a
27
+ class="app-button app-button-primary"
28
+ href="https://techchat-apps-in-toss.toss.im"
29
+ target="_blank"
30
+ rel="noopener noreferrer"
31
+ >
32
+ 개발자 커뮤니티
33
+ </a>
34
+ {{SAMPLE_BUTTONS}}
35
+ </div>
36
+
37
+ <div class="app-logo-wrap">
38
+ <img
39
+ class="logo"
40
+ src="${import.meta.env.BASE_URL}appsintoss-logo.png"
41
+ alt="apps in toss"
42
+ />
43
+ </div>
44
+ </div>
45
+ `;
46
+
47
+ root.querySelectorAll<HTMLButtonElement>("[data-page]").forEach((button) => {
48
+ button.addEventListener("click", () => {
49
+ currentPage = button.dataset.page ?? null;
50
+ render();
51
+ });
52
+ });
53
+ }
54
+
55
+ function render() {
56
+ {{SAMPLE_ROUTES}}
57
+ renderHome();
58
+ }
59
+
60
+ render();
@@ -0,0 +1,27 @@
1
+ :root {
2
+ font-family: sans-serif;
3
+ }
4
+
5
+ * {
6
+ -webkit-tap-highlight-color: transparent;
7
+ }
8
+
9
+ body {
10
+ margin: 0;
11
+ min-width: 320px;
12
+ min-height: 100vh;
13
+ }
14
+
15
+ @media (min-width: 481px) {
16
+ body {
17
+ display: flex;
18
+ justify-content: center;
19
+ align-items: flex-start;
20
+ background-color: #f5f5f5;
21
+ }
22
+ }
23
+
24
+ h1 {
25
+ font-size: 3.2em;
26
+ line-height: 1.1;
27
+ }
@@ -0,0 +1,2 @@
1
+ import "./index.css";
2
+ import "./app.ts";
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsBuildInfo",
4
+ "target": "ES2020",
5
+ "useDefineForClassFields": true,
6
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
7
+ "module": "ESNext",
8
+ "skipLibCheck": true,
9
+ "moduleResolution": "bundler",
10
+ "allowImportingTsExtensions": true,
11
+ "isolatedModules": true,
12
+ "moduleDetection": "force",
13
+ "noEmit": true,
14
+ "jsx": "react-jsx",
15
+ "strict": true,
16
+ "noUnusedLocals": true,
17
+ "noUnusedParameters": true,
18
+ "noFallthroughCasesInSwitch": true,
19
+ "noUncheckedSideEffectImports": true
20
+ },
21
+ "include": ["src"]
22
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ { "path": "./tsconfig.app.json" },
5
+ { "path": "./tsconfig.node.json" }
6
+ ]
7
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsBuildInfo",
4
+ "target": "ES2022",
5
+ "lib": ["ES2023"],
6
+ "module": "ESNext",
7
+ "skipLibCheck": true,
8
+ "moduleResolution": "bundler",
9
+ "allowImportingTsExtensions": true,
10
+ "isolatedModules": true,
11
+ "moduleDetection": "force",
12
+ "noEmit": true,
13
+ "strict": true,
14
+ "noUnusedLocals": true,
15
+ "noUnusedParameters": true,
16
+ "noFallthroughCasesInSwitch": true,
17
+ "noUncheckedSideEffectImports": true
18
+ },
19
+ "include": ["vite.config.ts"]
20
+ }
@@ -0,0 +1,3 @@
1
+ import { defineConfig } from "vite";
2
+
3
+ export default defineConfig({});
File without changes
File without changes
File without changes
File without changes