@ciderjs/gasbombe 0.2.9 → 0.3.1

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 (166) hide show
  1. package/README.ja.md +9 -4
  2. package/README.md +9 -4
  3. package/dist/cli.cjs +46 -5
  4. package/dist/cli.mjs +46 -5
  5. package/dist/index.cjs +1 -1
  6. package/dist/index.d.cts +1 -1
  7. package/dist/index.d.mts +1 -1
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.mjs +1 -1
  10. package/dist/templates/html-js/biome.json.ejs +36 -0
  11. package/dist/templates/html-js/index.html.ejs +13 -0
  12. package/dist/templates/html-js/package.json.ejs +33 -0
  13. package/dist/templates/html-js/rolldown.config.mjs.ejs +29 -0
  14. package/dist/templates/html-js/server/app.js.ejs +27 -0
  15. package/dist/templates/html-js/server/modules/hello.js.ejs +3 -0
  16. package/dist/templates/html-js/src/counter.js.ejs +9 -0
  17. package/dist/templates/html-js/src/javascript.svg.ejs +1 -0
  18. package/dist/templates/html-js/src/main.js.ejs +27 -0
  19. package/dist/templates/html-js/src/say.js.ejs +23 -0
  20. package/dist/templates/html-js/src/style.css.ejs +96 -0
  21. package/dist/templates/html-js/tsconfig.json.ejs +34 -0
  22. package/dist/templates/html-js/vitest.config.js.ejs +11 -0
  23. package/dist/templates/react/.env.ejs +1 -0
  24. package/dist/templates/{react-tsx → react}/README.md.ejs +0 -1
  25. package/dist/templates/react/biome.json.ejs +43 -0
  26. package/dist/templates/react/index.html.ejs +13 -0
  27. package/dist/templates/{react-tsx → react}/package.json.ejs +0 -2
  28. package/dist/templates/react/public/vite.svg.ejs +1 -0
  29. package/dist/templates/react/rolldown.config.ts.ejs +25 -0
  30. package/dist/templates/react/server/app.ts.ejs +29 -0
  31. package/dist/templates/react/server/appsscript.json.ejs +12 -0
  32. package/dist/templates/react/server/modules/hello.ts.ejs +3 -0
  33. package/dist/templates/react/src/App.css.ejs +42 -0
  34. package/dist/templates/react/src/App.tsx.ejs +63 -0
  35. package/dist/templates/react/src/assets/react.svg.ejs +1 -0
  36. package/dist/templates/react/src/index.css.ejs +68 -0
  37. package/dist/templates/react/src/lib/parameters.ts.ejs +20 -0
  38. package/dist/templates/react/src/main.tsx.ejs +11 -0
  39. package/dist/templates/react/src/vite-env.d.ts.ejs +1 -0
  40. package/dist/templates/react/tests/server/modules/hello.spec.ts.ejs +9 -0
  41. package/dist/templates/react/tsconfig.app.json.ejs +31 -0
  42. package/dist/templates/react/tsconfig.json.ejs +13 -0
  43. package/dist/templates/react/tsconfig.node.json.ejs +25 -0
  44. package/dist/templates/{react-tsx → react}/types/appsscript/client.ts.ejs +2 -15
  45. package/dist/templates/react/types/appsscript/server.ts.ejs +10 -0
  46. package/dist/templates/react/vite.config.ts.ejs +20 -0
  47. package/dist/templates/react-ciderjs/.github/workflows/appsscript.yml.ejs +45 -0
  48. package/dist/templates/react-ciderjs/README.md.ejs +20 -0
  49. package/dist/templates/{react-tsx → react-ciderjs}/biome.json.ejs +3 -25
  50. package/dist/templates/react-ciderjs/package.json.ejs +51 -0
  51. package/dist/templates/react-ciderjs/public/vite.svg.ejs +1 -0
  52. package/dist/templates/react-ciderjs/rolldown.config.ts.ejs +25 -0
  53. package/dist/templates/{react-tsx → react-ciderjs}/server/app.ts.ejs +6 -6
  54. package/dist/templates/react-ciderjs/server/appsscript.json.ejs +12 -0
  55. package/dist/templates/react-ciderjs/src/App.tsx.ejs +49 -0
  56. package/dist/templates/{react-tsx → react-ciderjs}/src/lib/parameters.ts.ejs +4 -4
  57. package/dist/templates/{react-tsx → react-ciderjs}/src/lib/server.ts.ejs +2 -2
  58. package/dist/templates/react-ciderjs/src/main.tsx.ejs +11 -0
  59. package/dist/templates/react-ciderjs/src/pages/about.tsx.ejs +7 -0
  60. package/dist/templates/react-ciderjs/src/pages/detail/user.tsx.ejs +16 -0
  61. package/dist/templates/{react-tsx/src/App.tsx.ejs → react-ciderjs/src/pages/index.tsx.ejs} +10 -13
  62. package/dist/templates/react-ciderjs/tests/server/modules/hello.spec.ts.ejs +9 -0
  63. package/dist/templates/react-ciderjs/tests/src/lib/server.spec.ts.ejs +8 -0
  64. package/dist/templates/react-ciderjs/vite.config.ts.ejs +33 -0
  65. package/dist/templates/server-js/biome.json.ejs +36 -0
  66. package/dist/templates/server-js/package.json.ejs +26 -0
  67. package/dist/templates/server-js/rolldown.config.mjs.ejs +29 -0
  68. package/dist/templates/server-js/src/main.js.ejs +5 -0
  69. package/dist/templates/server-js/src/modules/hello.js.ejs +3 -0
  70. package/dist/templates/server-js/tests/main.test.js.ejs +15 -0
  71. package/dist/templates/server-js/tsconfig.json.ejs +34 -0
  72. package/dist/templates/server-js/vitest.config.js.ejs +11 -0
  73. package/dist/templates/server-ts/.clasp.json.ejs +5 -0
  74. package/dist/templates/server-ts/README.md.ejs +7 -0
  75. package/dist/templates/{vanilla-ts → server-ts}/biome.json.ejs +2 -2
  76. package/dist/templates/{vanilla-ts → server-ts}/package.json.ejs +8 -9
  77. package/dist/templates/server-ts/rolldown.config.ts.ejs +29 -0
  78. package/dist/templates/server-ts/src/appsscript.json.ejs +8 -0
  79. package/dist/templates/server-ts/src/main.ts.ejs +5 -0
  80. package/dist/templates/server-ts/tests/main.test.ts.ejs +15 -0
  81. package/dist/templates/server-ts/vitest.config.ts.ejs +11 -0
  82. package/dist/templates/vue/.clasp.json.ejs +5 -0
  83. package/dist/templates/vue/.env.ejs +1 -0
  84. package/dist/templates/vue/.vscode/extensions.json.ejs +3 -0
  85. package/dist/templates/vue/README.md.ejs +5 -0
  86. package/dist/templates/vue/biome.json.ejs +35 -0
  87. package/dist/templates/vue/index.html.ejs +13 -0
  88. package/dist/templates/vue/package.json.ejs +45 -0
  89. package/dist/templates/vue/public/vite.svg.ejs +1 -0
  90. package/dist/templates/vue/rolldown.config.ts.ejs +25 -0
  91. package/dist/templates/vue/server/app.ts.ejs +29 -0
  92. package/dist/templates/vue/server/appsscript.json.ejs +12 -0
  93. package/dist/templates/vue/server/modules/hello.ts.ejs +3 -0
  94. package/dist/templates/vue/src/App.vue.ejs +30 -0
  95. package/dist/templates/vue/src/assets/vue.svg.ejs +1 -0
  96. package/dist/templates/vue/src/components/HelloWorld.vue.ejs +60 -0
  97. package/dist/templates/vue/src/lib/parameters.ts.ejs +20 -0
  98. package/dist/templates/vue/src/main.ts.ejs +5 -0
  99. package/dist/templates/vue/src/style.css.ejs +79 -0
  100. package/dist/templates/vue/tests/server/modules/hello.spec.ts.ejs +9 -0
  101. package/dist/templates/vue/tsconfig.app.json.ejs +21 -0
  102. package/dist/templates/vue/tsconfig.json.ejs +13 -0
  103. package/dist/templates/vue/tsconfig.node.json.ejs +26 -0
  104. package/dist/templates/vue/types/appsscript/client.ts.ejs +44 -0
  105. package/dist/templates/vue/types/appsscript/server.ts.ejs +10 -0
  106. package/dist/templates/vue/vite.config.ts.ejs +19 -0
  107. package/dist/templates/vue-ciderjs/.clasp.json.ejs +5 -0
  108. package/dist/templates/vue-ciderjs/.env.ejs +1 -0
  109. package/dist/templates/vue-ciderjs/.vscode/extensions.json.ejs +3 -0
  110. package/dist/templates/vue-ciderjs/README.md.ejs +14 -0
  111. package/dist/templates/vue-ciderjs/biome.json.ejs +35 -0
  112. package/dist/templates/vue-ciderjs/index.html.ejs +13 -0
  113. package/dist/templates/vue-ciderjs/package.json.ejs +50 -0
  114. package/dist/templates/vue-ciderjs/public/vite.svg.ejs +1 -0
  115. package/dist/templates/vue-ciderjs/rolldown.config.ts.ejs +25 -0
  116. package/dist/templates/vue-ciderjs/server/app.ts.ejs +29 -0
  117. package/dist/templates/vue-ciderjs/server/appsscript.json.ejs +12 -0
  118. package/dist/templates/vue-ciderjs/server/modules/hello.ts.ejs +3 -0
  119. package/dist/templates/vue-ciderjs/src/App.vue.ejs +7 -0
  120. package/dist/templates/vue-ciderjs/src/assets/vue.svg.ejs +1 -0
  121. package/dist/templates/vue-ciderjs/src/components/HelloWorld.vue.ejs +54 -0
  122. package/dist/templates/vue-ciderjs/src/components/Navigation.vue.ejs +23 -0
  123. package/dist/templates/vue-ciderjs/src/lib/parameters.ts.ejs +20 -0
  124. package/dist/templates/vue-ciderjs/src/lib/server.ts.ejs +18 -0
  125. package/dist/templates/vue-ciderjs/src/main.ts.ejs +13 -0
  126. package/dist/templates/vue-ciderjs/src/pages/_root.vue.ejs +40 -0
  127. package/dist/templates/vue-ciderjs/src/pages/about.vue.ejs +9 -0
  128. package/dist/templates/vue-ciderjs/src/pages/detail/user.vue.ejs +16 -0
  129. package/dist/templates/vue-ciderjs/src/pages/index.vue.ejs +7 -0
  130. package/dist/templates/vue-ciderjs/src/style.css.ejs +79 -0
  131. package/dist/templates/vue-ciderjs/tests/server/modules/hello.spec.ts.ejs +9 -0
  132. package/dist/templates/vue-ciderjs/tests/src/lib/server.spec.ts.ejs +8 -0
  133. package/dist/templates/vue-ciderjs/tsconfig.app.json.ejs +21 -0
  134. package/dist/templates/vue-ciderjs/tsconfig.json.ejs +13 -0
  135. package/dist/templates/vue-ciderjs/tsconfig.node.json.ejs +26 -0
  136. package/dist/templates/vue-ciderjs/types/appsscript/server.ts.ejs +10 -0
  137. package/dist/templates/vue-ciderjs/vite.config.ts.ejs +27 -0
  138. package/package.json +17 -12
  139. package/dist/templates/react-tsx/rolldown.config.ts.ejs +0 -25
  140. package/dist/templates/react-tsx/src/main.tsx.ejs +0 -11
  141. package/dist/templates/react-tsx/tests/server/modules/hello.spec.ts.ejs +0 -9
  142. package/dist/templates/react-tsx/tests/src/lib/server.spec.ts.ejs +0 -8
  143. package/dist/templates/react-tsx/vite.config.ts.ejs +0 -31
  144. package/dist/templates/vanilla-ts/rolldown.config.ts.ejs +0 -29
  145. package/dist/templates/vanilla-ts/src/main.ts.ejs +0 -5
  146. package/dist/templates/vanilla-ts/tests/main.test.ts.ejs +0 -15
  147. package/dist/templates/vanilla-ts/vitest.config.ts.ejs +0 -11
  148. /package/dist/templates/{react-tsx → html-js}/public/vite.svg.ejs +0 -0
  149. /package/dist/templates/{react-tsx → html-js}/server/appsscript.json.ejs +0 -0
  150. /package/dist/templates/{vanilla-ts → react}/.clasp.json.ejs +0 -0
  151. /package/dist/templates/{react-tsx → react-ciderjs}/.clasp.json.ejs +0 -0
  152. /package/dist/templates/{react-tsx → react-ciderjs}/.env.ejs +0 -0
  153. /package/dist/templates/{react-tsx → react-ciderjs}/index.html.ejs +0 -0
  154. /package/dist/templates/{react-tsx → react-ciderjs}/server/modules/hello.ts.ejs +0 -0
  155. /package/dist/templates/{react-tsx → react-ciderjs}/src/App.css.ejs +0 -0
  156. /package/dist/templates/{react-tsx → react-ciderjs}/src/assets/react.svg.ejs +0 -0
  157. /package/dist/templates/{react-tsx → react-ciderjs}/src/index.css.ejs +0 -0
  158. /package/dist/templates/{react-tsx → react-ciderjs}/src/vite-env.d.ts.ejs +0 -0
  159. /package/dist/templates/{react-tsx → react-ciderjs}/tsconfig.app.json.ejs +0 -0
  160. /package/dist/templates/{react-tsx → react-ciderjs}/tsconfig.json.ejs +0 -0
  161. /package/dist/templates/{react-tsx → react-ciderjs}/tsconfig.node.json.ejs +0 -0
  162. /package/dist/templates/{react-tsx → react-ciderjs}/types/appsscript/server.ts.ejs +0 -0
  163. /package/dist/templates/{vanilla-ts → server-js}/README.md.ejs +0 -0
  164. /package/dist/templates/{vanilla-ts → server-js}/src/appsscript.json.ejs +0 -0
  165. /package/dist/templates/{vanilla-ts → server-ts}/src/modules/hello.ts.ejs +0 -0
  166. /package/dist/templates/{vanilla-ts → server-ts}/tsconfig.json.ejs +0 -0
package/README.ja.md CHANGED
@@ -13,8 +13,13 @@
13
13
 
14
14
  * **CLIツール**: 対話型のコマンドラインプロンプトにより、プロジェクトのセットアップをガイドします。
15
15
  * **テンプレート**:
16
- * Vanilla TypeScript
17
- * React with TSX
16
+ * サーバーサイドTypeScript
17
+ * サーバーサイドJavaScript
18
+ * React
19
+ * React with CiderJS
20
+ * Vue
21
+ * Vue with CiderJS
22
+ * HTML/JS
18
23
  * **パッケージマネージャーのサポート**: npm、Yarn、pnpmに対応しています。
19
24
 
20
25
  ## **使用方法**
@@ -56,13 +61,13 @@ gasbombe
56
61
 
57
62
  ```bash
58
63
  # 例: pnpmを使用して新しいReactプロジェクトを作成し、同時に新しいApps Scriptプロジェクトも作成する
59
- gasbombe --name my-react-app --template react-tsx --clasp create --pkg pnpm
64
+ gasbombe --name my-react-app --template react --clasp create --pkg pnpm
60
65
  ```
61
66
 
62
67
  | オプション | エイリアス | 引数 | 説明 | 選択肢 |
63
68
  | :--- | :--- | :--- | :--- | :--- |
64
69
  | `--name` | `-n` | `[projectName]` | 生成するプロジェクトの名前。 | - |
65
- | `--template` | `-t` | `[templateType]` | 使用するプロジェクトテンプレート。 | `vanilla-ts`, `react-tsx` |
70
+ | `--template` | `-t` | `[templateType]` | 使用するプロジェクトテンプレート。 | `server-ts`, `server-js`, `react`, `react-ciderjs`, `vue`, `vue-ciderjs`, `html-js` |
66
71
  | `--clasp` | `-c` | `[claspOption]` | `.clasp.json`のセットアップ方法。<br/>`create`と`list`は事前にclaspへのログインが必要です。 | `create`, `list`, `input`, `skip` |
67
72
  | `--pkg` | `-p` | `[packageManager]` | 使用するパッケージマネージャー。 | `npm`, `pnpm`, `yarn` |
68
73
  | `--skipInstall` | | | 依存関係のインストールをスキップします。 | - |
package/README.md CHANGED
@@ -13,8 +13,13 @@ This project provides a command-line interface (CLI) to scaffold new TypeScript
13
13
 
14
14
  * **CLI Tool**: Interactive command-line prompts to guide you through project setup.
15
15
  * **Templates**:
16
- * Vanilla TypeScript
17
- * React with TSX
16
+ * Server-side TypeScript
17
+ * Server-side JavaScript
18
+ * React
19
+ * React with CiderJS
20
+ * Vue
21
+ * Vue with CiderJS
22
+ * HTML/JS
18
23
  * **Package Manager Support**: Works with npm, Yarn, and pnpm.
19
24
 
20
25
  ## **Usage**
@@ -56,13 +61,13 @@ You can bypass the interactive prompts by providing command-line options. This i
56
61
 
57
62
  ```bash
58
63
  # Example: Create a new React project with pnpm, creating a new Apps Script project along with it
59
- gasbombe --name my-react-app --template react-tsx --clasp create --pkg pnpm
64
+ gasbombe --name my-react-app --template react --clasp create --pkg pnpm
60
65
  ```
61
66
 
62
67
  | Option | Alias | Argument | Description | Choices |
63
68
  | :--- | :--- | :--- | :--- | :--- |
64
69
  | `--name` | `-n` | `[projectName]` | The name of the project to generate. | - |
65
- | `--template` | `-t` | `[templateType]` | The project template to use. | `vanilla-ts`, `react-tsx` |
70
+ | `--template` | `-t` | `[templateType]` | The project template to use. | `server-ts`, `server-js`, `react`, `react-ciderjs`, `vue`, `vue-ciderjs`, `html-js` |
66
71
  | `--clasp` | `-c` | `[claspOption]` | How to set up the `.clasp.json` file.<br/>`create` and `list` require prior login to clasp. | `create`, `list`, `input`, `skip` |
67
72
  | `--pkg` | `-p` | `[packageManager]` | The package manager to use. | `npm`, `pnpm`, `yarn` |
68
73
  | `--skipInstall` | | | Skip installing dependencies. | - |
package/dist/cli.cjs CHANGED
@@ -11,7 +11,7 @@ require('consola');
11
11
  require('ejs');
12
12
  require('glob');
13
13
 
14
- const version = "0.2.9";
14
+ const version = "0.3.1";
15
15
 
16
16
  async function main() {
17
17
  const program = new commander.Command();
@@ -26,7 +26,7 @@ async function main() {
26
26
  ""
27
27
  ).option(
28
28
  "-t, --template [templateType]",
29
- 'Project template label ("vanilla-ts" | "react-tsx")',
29
+ 'Project template label ("vanilla-ts" | "vanilla-js" | "react-tsx")',
30
30
  ""
31
31
  ).option(
32
32
  "-c, --clasp [claspSetupCommand]",
@@ -65,11 +65,52 @@ async function main() {
65
65
  templateType ||= await prompts.select({
66
66
  message: "Choice project template...",
67
67
  choices: [
68
- { name: "vanilla-ts", value: "vanilla-ts" },
69
- { name: "react-tsx", value: "react-tsx" }
68
+ {
69
+ name: "ts",
70
+ value: "server-ts",
71
+ description: "TypeScript (only Server-Side)"
72
+ },
73
+ {
74
+ name: "js",
75
+ value: "server-js",
76
+ description: "JavaScript (only Server-Side)"
77
+ },
78
+ {
79
+ name: "react",
80
+ value: "react",
81
+ description: "TSX-React (Client-Side & Server-Side)"
82
+ },
83
+ {
84
+ name: "react-ciderjs",
85
+ value: "react-ciderjs",
86
+ description: "TSX-React with CiderJS (Client-Side & Server-Side)"
87
+ },
88
+ {
89
+ name: "vue",
90
+ value: "vue",
91
+ description: "Vue3 (Client-Side & Server-Side)"
92
+ },
93
+ {
94
+ name: "vue-ciderjs",
95
+ value: "vue-ciderjs",
96
+ description: "Vue3 with CiderJS (Client-Side & Server-Side)"
97
+ },
98
+ {
99
+ name: "html-js",
100
+ value: "html-js",
101
+ description: "HTML with JavaScript (Client-Side & Server-Side)"
102
+ }
70
103
  ]
71
104
  });
72
- const templateTypes = ["vanilla-ts", "react-tsx"];
105
+ const templateTypes = [
106
+ "server-ts",
107
+ "server-js",
108
+ "react",
109
+ "react-ciderjs",
110
+ "vue",
111
+ "vue-ciderjs",
112
+ "html-js"
113
+ ];
73
114
  if (!templateTypes.includes(templateType)) {
74
115
  throw Error("Invalid project template");
75
116
  }
package/dist/cli.mjs CHANGED
@@ -9,7 +9,7 @@ import 'consola';
9
9
  import 'ejs';
10
10
  import 'glob';
11
11
 
12
- const version = "0.2.9";
12
+ const version = "0.3.1";
13
13
 
14
14
  async function main() {
15
15
  const program = new Command();
@@ -24,7 +24,7 @@ async function main() {
24
24
  ""
25
25
  ).option(
26
26
  "-t, --template [templateType]",
27
- 'Project template label ("vanilla-ts" | "react-tsx")',
27
+ 'Project template label ("vanilla-ts" | "vanilla-js" | "react-tsx")',
28
28
  ""
29
29
  ).option(
30
30
  "-c, --clasp [claspSetupCommand]",
@@ -63,11 +63,52 @@ async function main() {
63
63
  templateType ||= await select({
64
64
  message: "Choice project template...",
65
65
  choices: [
66
- { name: "vanilla-ts", value: "vanilla-ts" },
67
- { name: "react-tsx", value: "react-tsx" }
66
+ {
67
+ name: "ts",
68
+ value: "server-ts",
69
+ description: "TypeScript (only Server-Side)"
70
+ },
71
+ {
72
+ name: "js",
73
+ value: "server-js",
74
+ description: "JavaScript (only Server-Side)"
75
+ },
76
+ {
77
+ name: "react",
78
+ value: "react",
79
+ description: "TSX-React (Client-Side & Server-Side)"
80
+ },
81
+ {
82
+ name: "react-ciderjs",
83
+ value: "react-ciderjs",
84
+ description: "TSX-React with CiderJS (Client-Side & Server-Side)"
85
+ },
86
+ {
87
+ name: "vue",
88
+ value: "vue",
89
+ description: "Vue3 (Client-Side & Server-Side)"
90
+ },
91
+ {
92
+ name: "vue-ciderjs",
93
+ value: "vue-ciderjs",
94
+ description: "Vue3 with CiderJS (Client-Side & Server-Side)"
95
+ },
96
+ {
97
+ name: "html-js",
98
+ value: "html-js",
99
+ description: "HTML with JavaScript (Client-Side & Server-Side)"
100
+ }
68
101
  ]
69
102
  });
70
- const templateTypes = ["vanilla-ts", "react-tsx"];
103
+ const templateTypes = [
104
+ "server-ts",
105
+ "server-js",
106
+ "react",
107
+ "react-ciderjs",
108
+ "vue",
109
+ "vue-ciderjs",
110
+ "html-js"
111
+ ];
71
112
  if (!templateTypes.includes(templateType)) {
72
113
  throw Error("Invalid project template");
73
114
  }
package/dist/index.cjs CHANGED
@@ -260,7 +260,7 @@ async function generateProject({
260
260
  const messages = [];
261
261
  projectName !== "." && messages.push(` cd ${projectName}`);
262
262
  !install && messages.push(` ${packageManager} install`);
263
- templateType !== "vanilla-ts" && messages.push(` ${packageManager} dev`);
263
+ !["server-ts", "server-js"].includes(templateType) && messages.push(` ${packageManager} dev`);
264
264
  if (messages.length > 0) {
265
265
  consola.consola.log(`
266
266
  To get started, run:
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  type PackageManager = 'npm' | 'pnpm' | 'yarn';
2
- type TemplateType = 'vanilla-ts' | 'react-tsx';
2
+ type TemplateType = 'server-ts' | 'server-js' | 'react' | 'react-ciderjs' | 'vue' | 'vue-ciderjs' | 'html-js';
3
3
  type ClaspOption = 'create' | 'list' | 'input' | 'skip';
4
4
  interface ProjectOptions {
5
5
  projectName: string;
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  type PackageManager = 'npm' | 'pnpm' | 'yarn';
2
- type TemplateType = 'vanilla-ts' | 'react-tsx';
2
+ type TemplateType = 'server-ts' | 'server-js' | 'react' | 'react-ciderjs' | 'vue' | 'vue-ciderjs' | 'html-js';
3
3
  type ClaspOption = 'create' | 'list' | 'input' | 'skip';
4
4
  interface ProjectOptions {
5
5
  projectName: string;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  type PackageManager = 'npm' | 'pnpm' | 'yarn';
2
- type TemplateType = 'vanilla-ts' | 'react-tsx';
2
+ type TemplateType = 'server-ts' | 'server-js' | 'react' | 'react-ciderjs' | 'vue' | 'vue-ciderjs' | 'html-js';
3
3
  type ClaspOption = 'create' | 'list' | 'input' | 'skip';
4
4
  interface ProjectOptions {
5
5
  projectName: string;
package/dist/index.mjs CHANGED
@@ -261,7 +261,7 @@ async function generateProject({
261
261
  const messages = [];
262
262
  projectName !== "." && messages.push(` cd ${projectName}`);
263
263
  !install && messages.push(` ${packageManager} install`);
264
- templateType !== "vanilla-ts" && messages.push(` ${packageManager} dev`);
264
+ !["server-ts", "server-js"].includes(templateType) && messages.push(` ${packageManager} dev`);
265
265
  if (messages.length > 0) {
266
266
  consola.log(`
267
267
  To get started, run:
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.3.4/schema.json",
3
+ "vcs": {
4
+ "enabled": false,
5
+ "clientKind": "git",
6
+ "useIgnoreFile": false
7
+ },
8
+ "files": {
9
+ "ignoreUnknown": false,
10
+ "includes": ["src/**/*", "tests/**/*", "types/**/*", "./*.js", "./*.json"]
11
+ },
12
+ "formatter": {
13
+ "enabled": true,
14
+ "indentStyle": "space",
15
+ "indentWidth": 2
16
+ },
17
+ "linter": {
18
+ "enabled": true,
19
+ "rules": {
20
+ "recommended": true
21
+ }
22
+ },
23
+ "javascript": {
24
+ "formatter": {
25
+ "quoteStyle": "double"
26
+ }
27
+ },
28
+ "assist": {
29
+ "enabled": true,
30
+ "actions": {
31
+ "source": {
32
+ "organizeImports": "on"
33
+ }
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title><%= projectName %></title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/src/main.js"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "<%= projectName %>",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build:server": "rolldown -c && cpy server/*.json dist/",
9
+ "build:front": "tsc -b && vite build",
10
+ "build": "rimraf dist && pnpm run build:front && pnpm run build:server",
11
+ "check": "biome check --write",
12
+ "test": "vitest run --coverage",
13
+ "push": "clasp push",
14
+ "deploy": "clasp create-deployment",
15
+ "update": "dotenv cross-var \"clasp update-deployment $GAS_DEPLOYMENT_ID\"",
16
+ "preview:local": "vite preview",
17
+ "preview:web": "clasp open-web-app"
18
+ },
19
+ "devDependencies": {
20
+ "@biomejs/biome": "^2.3.4",
21
+ "@google/clasp": "^3.1.1",
22
+ "@rollup/plugin-alias": "^6.0.0",
23
+ "@types/google-apps-script": "^2.0.7",
24
+ "@types/node": "^24.10.0",
25
+ "cpy-cli": "^6.0.0",
26
+ "rimraf": "^6.1.0",
27
+ "rolldown": "1.0.0-beta.47",
28
+ "rolldown-plugin-remove-export": "^0.1.3",
29
+ "vite": "^7.1.7",
30
+ "vite-tsconfig-paths": "^5.1.4",
31
+ "vitest": "^4.0.8"
32
+ }
33
+ }
@@ -0,0 +1,29 @@
1
+ import path from "node:path";
2
+ import alias from "@rollup/plugin-alias";
3
+ import { defineConfig } from "rolldown";
4
+ import { removeExportPlugin } from "rolldown-plugin-remove-export";
5
+
6
+ const outputFile = "index.js";
7
+
8
+ export default defineConfig({
9
+ input: "src/main.js",
10
+ output: {
11
+ format: "esm",
12
+ file: `dist/${outputFile}`,
13
+ },
14
+ plugins: [
15
+ alias({
16
+ entries: [
17
+ {
18
+ find: "@",
19
+ replacement: path.resolve(import.meta.dirname, "src"),
20
+ },
21
+ {
22
+ find: "~",
23
+ replacement: path.resolve(import.meta.dirname),
24
+ },
25
+ ],
26
+ }),
27
+ removeExportPlugin(outputFile),
28
+ ],
29
+ });
@@ -0,0 +1,27 @@
1
+ export * from "./modules/hello";
2
+
3
+ const SITE_TITLE = "<%= projectName %>";
4
+
5
+ /**
6
+ * Procedure to handle GET requests when published as a web app
7
+ */
8
+ export function doGet(e) {
9
+ const htmlTemplate = HtmlService.createTemplateFromFile("index");
10
+ const title = SITE_TITLE;
11
+ const userAddress = Session.getActiveUser().getEmail();
12
+
13
+ // set initial data for front-end
14
+ htmlTemplate.parameters = JSON.stringify({
15
+ ...e,
16
+ siteTitle: title,
17
+ userAddress: userAddress,
18
+ });
19
+
20
+ const htmlOutput = htmlTemplate.evaluate();
21
+ htmlOutput.setTitle(title);
22
+ htmlOutput.addMetaTag(
23
+ "viewport",
24
+ "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui",
25
+ );
26
+ return htmlOutput;
27
+ }
@@ -0,0 +1,3 @@
1
+ export function sayHello(name) {
2
+ return `Hello, ${name}!`;
3
+ }
@@ -0,0 +1,9 @@
1
+ export function setupCounter(element) {
2
+ let counter = 0;
3
+ const setCounter = (count) => {
4
+ counter = count;
5
+ element.innerHTML = `count is ${counter}`;
6
+ };
7
+ element.addEventListener("click", () => setCounter(counter + 1));
8
+ setCounter(0);
9
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="32" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path fill="#F7DF1E" d="M0 0h256v256H0V0Z"></path><path d="m67.312 213.932l19.59-11.856c3.78 6.701 7.218 12.371 15.465 12.371c7.905 0 12.89-3.092 12.89-15.12v-81.798h24.057v82.138c0 24.917-14.606 36.259-35.916 36.259c-19.245 0-30.416-9.967-36.087-21.996m85.07-2.576l19.588-11.341c5.157 8.421 11.859 14.607 23.715 14.607c9.969 0 16.325-4.984 16.325-11.858c0-8.248-6.53-11.17-17.528-15.98l-6.013-2.58c-17.357-7.387-28.87-16.667-28.87-36.257c0-18.044 13.747-31.792 35.228-31.792c15.294 0 26.292 5.328 34.196 19.247l-18.732 12.03c-4.125-7.389-8.591-10.31-15.465-10.31c-7.046 0-11.514 4.468-11.514 10.31c0 7.217 4.468 10.14 14.778 14.608l6.014 2.577c20.45 8.765 31.963 17.7 31.963 37.804c0 21.654-17.012 33.51-39.867 33.51c-22.339 0-36.774-10.654-43.819-24.574"></path></svg>
@@ -0,0 +1,27 @@
1
+ import "./style.css";
2
+ import viteLogo from "/vite.svg";
3
+ import { setupCounter } from "./counter.js";
4
+ import javascriptLogo from "./javascript.svg";
5
+ import { setupSayHello } from "./say.js";
6
+
7
+ document.querySelector("#app").innerHTML = `
8
+ <div>
9
+ <a href="https://vite.dev" target="_blank">
10
+ <img src="${viteLogo}" class="logo" alt="Vite logo" />
11
+ </a>
12
+ <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript" target="_blank">
13
+ <img src="${javascriptLogo}" class="logo vanilla" alt="JavaScript logo" />
14
+ </a>
15
+ <h1>Hello Vite!</h1>
16
+ <div class="card">
17
+ <button id="counter" type="button"></button>
18
+ <button id="say-hello" type="button"></button>
19
+ </div>
20
+ <p class="read-the-docs">
21
+ Click on the Vite logo to learn more
22
+ </p>
23
+ </div>
24
+ `;
25
+
26
+ setupCounter(document.querySelector("#counter"));
27
+ setupSayHello(document.querySelector("#say-hello"));
@@ -0,0 +1,23 @@
1
+ export function setupSayHello(element) {
2
+ let message = "Click to say hello";
3
+ element.innerHTML = message;
4
+ const handleSayHello = () => {
5
+ if (!("google" in globalThis)) {
6
+ message = "Error. `google` is not defined";
7
+ element.innerHTML = message;
8
+ return;
9
+ }
10
+ google.script.run
11
+ .withSuccessHandler((result) => {
12
+ message = result;
13
+ element.innerHTML = message;
14
+ })
15
+ .withFailureHandler((error) => {
16
+ console.error(error);
17
+ message = "Error. Check the console.";
18
+ element.innerHTML = message;
19
+ })
20
+ .sayHello(userAddress);
21
+ };
22
+ element.addEventListener("click", handleSayHello);
23
+ }
@@ -0,0 +1,96 @@
1
+ :root {
2
+ font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
3
+ line-height: 1.5;
4
+ font-weight: 400;
5
+
6
+ color-scheme: light dark;
7
+ color: rgba(255, 255, 255, 0.87);
8
+ background-color: #242424;
9
+
10
+ font-synthesis: none;
11
+ text-rendering: optimizeLegibility;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ }
15
+
16
+ a {
17
+ font-weight: 500;
18
+ color: #646cff;
19
+ text-decoration: inherit;
20
+ }
21
+ a:hover {
22
+ color: #535bf2;
23
+ }
24
+
25
+ body {
26
+ margin: 0;
27
+ display: flex;
28
+ place-items: center;
29
+ min-width: 320px;
30
+ min-height: 100vh;
31
+ }
32
+
33
+ h1 {
34
+ font-size: 3.2em;
35
+ line-height: 1.1;
36
+ }
37
+
38
+ #app {
39
+ max-width: 1280px;
40
+ margin: 0 auto;
41
+ padding: 2rem;
42
+ text-align: center;
43
+ }
44
+
45
+ .logo {
46
+ height: 6em;
47
+ padding: 1.5em;
48
+ will-change: filter;
49
+ transition: filter 300ms;
50
+ }
51
+ .logo:hover {
52
+ filter: drop-shadow(0 0 2em #646cffaa);
53
+ }
54
+ .logo.vanilla:hover {
55
+ filter: drop-shadow(0 0 2em #f7df1eaa);
56
+ }
57
+
58
+ .card {
59
+ padding: 2em;
60
+ }
61
+
62
+ .read-the-docs {
63
+ color: #888;
64
+ }
65
+
66
+ button {
67
+ border-radius: 8px;
68
+ border: 1px solid transparent;
69
+ padding: 0.6em 1.2em;
70
+ font-size: 1em;
71
+ font-weight: 500;
72
+ font-family: inherit;
73
+ background-color: #1a1a1a;
74
+ cursor: pointer;
75
+ transition: border-color 0.25s;
76
+ }
77
+ button:hover {
78
+ border-color: #646cff;
79
+ }
80
+ button:focus,
81
+ button:focus-visible {
82
+ outline: 4px auto -webkit-focus-ring-color;
83
+ }
84
+
85
+ @media (prefers-color-scheme: light) {
86
+ :root {
87
+ color: #213547;
88
+ background-color: #ffffff;
89
+ }
90
+ a:hover {
91
+ color: #747bff;
92
+ }
93
+ button {
94
+ background-color: #f9f9f9;
95
+ }
96
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2022",
4
+ "useDefineForClassFields": true,
5
+ "module": "esnext",
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
+ "skipLibCheck": true,
8
+
9
+ /* Bundler mode */
10
+ "moduleResolution": "bundler",
11
+ "allowImportingTsExtensions": true,
12
+ "isolatedModules": true,
13
+ "moduleDetection": "force",
14
+ "noEmit": true,
15
+
16
+ /* Linting */
17
+ "strict": true,
18
+ "noUnusedLocals": true,
19
+ "noUnusedParameters": true,
20
+ "noFallthroughCasesInSwitch": true,
21
+ "noUncheckedSideEffectImports": true,
22
+
23
+ "allowJs": true,
24
+ "checkJs": false,
25
+ "types": ["node", "google-apps-script"],
26
+
27
+ // Aliases
28
+ "paths": {
29
+ "@/*": ["./src/*"],
30
+ "~/*": ["./*"]
31
+ }
32
+ },
33
+ "include": ["src", "tests", "types", "./*.*js"]
34
+ }
@@ -0,0 +1,11 @@
1
+ import tsconfigPaths from "vite-tsconfig-paths";
2
+ import { defineConfig } from "vitest/config";
3
+
4
+ export default defineConfig({
5
+ test: {
6
+ coverage: {
7
+ include: ["src/**/*"],
8
+ },
9
+ },
10
+ plugins: [tsconfigPaths()],
11
+ });
@@ -0,0 +1 @@
1
+ GAS_DEPLOYMENT_ID=input your deployment id
@@ -6,5 +6,4 @@ Currently, these plugins are available:
6
6
 
7
7
  - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
8
8
  - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
- - [@ciderjs/gasnuki](https://github.com/luthpg/gasnuki) for Type Definition Bridge
10
9
  - [rolldown](https://github.com/rolldown/rolldown) for transpile TypeScript files and bundle files
@@ -0,0 +1,43 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.3.4/schema.json",
3
+ "vcs": {
4
+ "enabled": false,
5
+ "clientKind": "git",
6
+ "useIgnoreFile": false
7
+ },
8
+ "files": {
9
+ "ignoreUnknown": false,
10
+ "includes": [
11
+ "src/**/*",
12
+ "server/**/*",
13
+ "tests/**/*",
14
+ "types/**/*",
15
+ "./*.ts",
16
+ "./*.json"
17
+ ]
18
+ },
19
+ "formatter": {
20
+ "enabled": true,
21
+ "indentStyle": "space",
22
+ "indentWidth": 2
23
+ },
24
+ "linter": {
25
+ "enabled": true,
26
+ "rules": {
27
+ "recommended": true
28
+ }
29
+ },
30
+ "javascript": {
31
+ "formatter": {
32
+ "quoteStyle": "double"
33
+ }
34
+ },
35
+ "assist": {
36
+ "enabled": true,
37
+ "actions": {
38
+ "source": {
39
+ "organizeImports": "on"
40
+ }
41
+ }
42
+ }
43
+ }