@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
@@ -0,0 +1,45 @@
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": "vue-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
+ "dependencies": {
20
+ "vue": "^3.5.22"
21
+ },
22
+ "devDependencies": {
23
+ "@biomejs/biome": "^2.3.4",
24
+ "@google/clasp": "^3.1.1",
25
+ "@rollup/plugin-alias": "^6.0.0",
26
+ "@types/google-apps-script": "^2.0.7",
27
+ "@types/node": "^24.6.0",
28
+ "@vitejs/plugin-vue": "^6.0.1",
29
+ "@vitest/coverage-v8": "^4.0.8",
30
+ "@vue/tsconfig": "^0.8.1",
31
+ "cpy-cli": "^6.0.0",
32
+ "cross-var": "^1.1.0",
33
+ "dotenv-cli": "^11.0.0",
34
+ "rimraf": "^6.1.0",
35
+ "rolldown": "1.0.0-beta.47",
36
+ "rolldown-plugin-remove-export": "^0.1.3",
37
+ "typescript": "~5.9.3",
38
+ "vite": "^7.1.7",
39
+ "vite-plugin-google-apps-script": "^0.4.0",
40
+ "vite-plugin-singlefile": "^2.3.0",
41
+ "vite-tsconfig-paths": "^5.1.4",
42
+ "vitest": "^4.0.8",
43
+ "vue-tsc": "^3.1.0"
44
+ }
45
+ }
@@ -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="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,25 @@
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 = "app.js";
7
+
8
+ export default defineConfig({
9
+ input: "server/app.ts",
10
+ output: {
11
+ format: "esm",
12
+ file: `dist/${outputFile}`,
13
+ },
14
+ plugins: [
15
+ alias({
16
+ entries: [
17
+ {
18
+ find: "~",
19
+ replacement: path.resolve(__dirname),
20
+ },
21
+ ],
22
+ }),
23
+ removeExportPlugin(outputFile),
24
+ ],
25
+ });
@@ -0,0 +1,29 @@
1
+ import type { ServerParams, WebAppParams } from "~/types/appsscript/server";
2
+
3
+ export * from "./modules/hello";
4
+
5
+ const SITE_TITLE = "<%= projectName %>";
6
+
7
+ /**
8
+ * Procedure to handle GET requests when published as a web app
9
+ */
10
+ export function doGet(e: WebAppParams) {
11
+ const htmlTemplate = HtmlService.createTemplateFromFile("index");
12
+ const title = SITE_TITLE;
13
+ const userAddress = Session.getActiveUser().getEmail();
14
+
15
+ // set initial data for front-end
16
+ htmlTemplate.parameters = JSON.stringify({
17
+ ...e,
18
+ siteTitle: title,
19
+ userAddress: userAddress,
20
+ } satisfies ServerParams);
21
+
22
+ const htmlOutput = htmlTemplate.evaluate();
23
+ htmlOutput.setTitle(title);
24
+ htmlOutput.addMetaTag(
25
+ "viewport",
26
+ "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui",
27
+ );
28
+ return htmlOutput;
29
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "timeZone": "Asia/Tokyo",
3
+ "dependencies": {
4
+ "libraries": []
5
+ },
6
+ "exceptionLogging": "STACKDRIVER",
7
+ "runtimeVersion": "V8",
8
+ "webapp": {
9
+ "executeAs": "USER_ACCESSING",
10
+ "access": "ANYONE"
11
+ }
12
+ }
@@ -0,0 +1,3 @@
1
+ export function sayHello(name: string): string {
2
+ return `Hello, ${name}!`;
3
+ }
@@ -0,0 +1,30 @@
1
+ <script setup lang="ts">
2
+ import HelloWorld from "@/components/HelloWorld.vue";
3
+ </script>
4
+
5
+ <template>
6
+ <div>
7
+ <a href="https://vite.dev" target="_blank">
8
+ <img src="/vite.svg" class="logo" alt="Vite logo" />
9
+ </a>
10
+ <a href="https://vuejs.org/" target="_blank">
11
+ <img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
12
+ </a>
13
+ </div>
14
+ <HelloWorld msg="Vite + Vue" />
15
+ </template>
16
+
17
+ <style scoped>
18
+ .logo {
19
+ height: 6em;
20
+ padding: 1.5em;
21
+ will-change: filter;
22
+ transition: filter 300ms;
23
+ }
24
+ .logo:hover {
25
+ filter: drop-shadow(0 0 2em #646cffaa);
26
+ }
27
+ .logo.vue:hover {
28
+ filter: drop-shadow(0 0 2em #42b883aa);
29
+ }
30
+ </style>
@@ -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="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
@@ -0,0 +1,60 @@
1
+ <script setup lang="ts">
2
+ import { ref } from "vue";
3
+ import { parameters } from "@/lib/parameters";
4
+
5
+ defineProps<{ msg: string }>();
6
+
7
+ const { userAddress } = parameters;
8
+
9
+ const count = ref(0);
10
+ const message = ref("Click to say hello");
11
+
12
+ const handleHelloButton = () => {
13
+ message.value = "Waiting...";
14
+ if (!("google" in globalThis)) {
15
+ message.value = "Error. `google` is not defined";
16
+ return;
17
+ }
18
+ google.script.run
19
+ .withSuccessHandler((result: string) => {
20
+ message.value = result;
21
+ })
22
+ .withFailureHandler((error) => {
23
+ console.error(error);
24
+ message.value = "Error. Check the console.";
25
+ })
26
+ .sayHello?.(userAddress);
27
+ };
28
+ </script>
29
+
30
+ <template>
31
+ <h1>{{ msg }}</h1>
32
+
33
+ <div class="card">
34
+ <button type="button" @click="count++">count is {{ count }}</button>
35
+ <button type="button" @click="handleHelloButton" :style="{ marginLeft: '10px' }">
36
+ {{ message }}
37
+ </button>
38
+ <p>
39
+ Edit
40
+ <code>components/HelloWorld.vue</code> to test HMR
41
+ </p>
42
+ </div>
43
+
44
+ <p>
45
+ Check out
46
+ <a href="https://vuejs.org/guide/quick-start.html#local" target="_blank">create-vue</a>, the official Vue + Vite
47
+ starter
48
+ </p>
49
+ <p>
50
+ Learn more about IDE Support for Vue in the
51
+ <a href="https://vuejs.org/guide/scaling-up/tooling.html#ide-support" target="_blank">Vue Docs Scaling up Guide</a>.
52
+ </p>
53
+ <p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
54
+ </template>
55
+
56
+ <style scoped>
57
+ .read-the-docs {
58
+ color: #888;
59
+ }
60
+ </style>
@@ -0,0 +1,20 @@
1
+ import type { ServerParams } from "~/types/appsscript/server";
2
+
3
+ let parameters: ServerParams = {} as ServerParams;
4
+
5
+ try {
6
+ const parametersJson = "<?!= JSON.stringify(parameters) ?>";
7
+ parameters = JSON.parse(
8
+ parametersJson.slice(1, parametersJson.length - 1).replace(/\\"/g, '"'),
9
+ );
10
+ } catch {
11
+ // mockup parameters to simulate as server access
12
+ parameters = {
13
+ ...parameters,
14
+ parameter: {},
15
+ siteTitle: "Mockup Site Title",
16
+ userAddress: "mock-user@example.com",
17
+ };
18
+ }
19
+
20
+ export { parameters };
@@ -0,0 +1,5 @@
1
+ import { createApp } from "vue";
2
+ import "./style.css";
3
+ import App from "./App.vue";
4
+
5
+ createApp(App).mount("#app");
@@ -0,0 +1,79 @@
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
+ button {
39
+ border-radius: 8px;
40
+ border: 1px solid transparent;
41
+ padding: 0.6em 1.2em;
42
+ font-size: 1em;
43
+ font-weight: 500;
44
+ font-family: inherit;
45
+ background-color: #1a1a1a;
46
+ cursor: pointer;
47
+ transition: border-color 0.25s;
48
+ }
49
+ button:hover {
50
+ border-color: #646cff;
51
+ }
52
+ button:focus,
53
+ button:focus-visible {
54
+ outline: 4px auto -webkit-focus-ring-color;
55
+ }
56
+
57
+ .card {
58
+ padding: 2em;
59
+ }
60
+
61
+ #app {
62
+ max-width: 1280px;
63
+ margin: 0 auto;
64
+ padding: 2rem;
65
+ text-align: center;
66
+ }
67
+
68
+ @media (prefers-color-scheme: light) {
69
+ :root {
70
+ color: #213547;
71
+ background-color: #ffffff;
72
+ }
73
+ a:hover {
74
+ color: #747bff;
75
+ }
76
+ button {
77
+ background-color: #f9f9f9;
78
+ }
79
+ }
@@ -0,0 +1,9 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { sayHello } from "~/server/modules/hello";
3
+
4
+ describe("hello", () => {
5
+ it("should say hello", () => {
6
+ const name = "world";
7
+ expect(sayHello(name)).toBe(`Hello, ${name}!`);
8
+ });
9
+ });
@@ -0,0 +1,21 @@
1
+ {
2
+ "extends": "@vue/tsconfig/tsconfig.dom.json",
3
+ "compilerOptions": {
4
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
+ "types": ["vite/client", "@types/google-apps-script"],
6
+
7
+ /* Linting */
8
+ "strict": true,
9
+ "noUnusedLocals": true,
10
+ "noUnusedParameters": true,
11
+ "erasableSyntaxOnly": true,
12
+ "noFallthroughCasesInSwitch": true,
13
+ "noUncheckedSideEffectImports": true,
14
+
15
+ "paths": {
16
+ "@/*": ["./src/*"],
17
+ "~/*": ["./*"]
18
+ }
19
+ },
20
+ "include": ["src", "tests", "server", "types"]
21
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ { "path": "./tsconfig.app.json" },
5
+ { "path": "./tsconfig.node.json" }
6
+ ],
7
+ "compilerOptions": {
8
+ "paths": {
9
+ "@/*": ["./src/*"],
10
+ "~/*": ["./*"]
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
+ "target": "ES2023",
5
+ "lib": ["ES2023"],
6
+ "module": "ESNext",
7
+ "types": ["node"],
8
+ "skipLibCheck": true,
9
+
10
+ /* Bundler mode */
11
+ "moduleResolution": "bundler",
12
+ "allowImportingTsExtensions": true,
13
+ "verbatimModuleSyntax": true,
14
+ "moduleDetection": "force",
15
+ "noEmit": true,
16
+
17
+ /* Linting */
18
+ "strict": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "erasableSyntaxOnly": true,
22
+ "noFallthroughCasesInSwitch": true,
23
+ "noUncheckedSideEffectImports": true
24
+ },
25
+ "include": ["rolldown.config.ts", "vite.config.ts"]
26
+ }
@@ -0,0 +1,44 @@
1
+ // sample code from https://developers.google.com/apps-script/guides/web-apps
2
+
3
+ type _AppsScriptRun = {
4
+ [key: string]: (...args: any[]) => any;
5
+ withSuccessHandler: <T = string | number | boolean | undefined, U = any>(
6
+ callback: (returnValues: T, userObject?: U) => void,
7
+ ) => _AppsScriptRun;
8
+ withFailureHandler: <U = any>(
9
+ callback: (error: Error, userObject?: U) => void,
10
+ ) => _AppsScriptRun;
11
+ withUserObject: <U = any>(userObject: U) => _AppsScriptRun;
12
+ };
13
+
14
+ type _AppsScriptHistoryFunction = (
15
+ stateObject: object,
16
+ params: object,
17
+ hash: string,
18
+ ) => void;
19
+
20
+ interface _WebAppLocationType {
21
+ hash: string;
22
+ parameter: Record<string, string>;
23
+ parameters: Record<string, string[]>;
24
+ }
25
+
26
+ export declare interface GoogleClientSideApi {
27
+ script: {
28
+ run: _AppsScriptRun;
29
+ url: {
30
+ getLocation: (callback: (location: _WebAppLocationType) => void) => void;
31
+ };
32
+ history: {
33
+ push: _AppsScriptHistoryFunction;
34
+ replace: _AppsScriptHistoryFunction;
35
+ setChangeHandler: (
36
+ callback: (e: { state: object; location: _WebAppLocationType }) => void,
37
+ ) => void;
38
+ };
39
+ };
40
+ }
41
+
42
+ declare global {
43
+ const google: GoogleClientSideApi;
44
+ }
@@ -0,0 +1,10 @@
1
+ export interface WebAppParams<T extends string = string>
2
+ extends GoogleAppsScript.Events.DoGet {
3
+ parameter: Record<T, string>;
4
+ parameters: Record<T, string[]>;
5
+ }
6
+
7
+ export type ServerParams = WebAppParams & {
8
+ siteTitle: string;
9
+ userAddress: string;
10
+ };
@@ -0,0 +1,19 @@
1
+ /// <reference types="vitest" />
2
+
3
+ import vue from "@vitejs/plugin-vue";
4
+ import { defineConfig } from "vite";
5
+ import { gas } from "vite-plugin-google-apps-script";
6
+ import { viteSingleFile } from "vite-plugin-singlefile";
7
+ import tsconfigPaths from "vite-tsconfig-paths";
8
+
9
+ // https://vite.dev/config/
10
+ export default defineConfig({
11
+ plugins: [
12
+ vue(),
13
+ tsconfigPaths({
14
+ loose: true,
15
+ }),
16
+ gas(),
17
+ viteSingleFile(),
18
+ ],
19
+ });
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/clasp.json",
3
+ "scriptId": "{{ input your script id of apps-script }}",
4
+ "rootDir": "dist"
5
+ }
@@ -0,0 +1 @@
1
+ GAS_DEPLOYMENT_ID=input your deployment id
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["Vue.volar"]
3
+ }
@@ -0,0 +1,14 @@
1
+ # Vue 3 + TypeScript + Vite
2
+
3
+ This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4
+
5
+ Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).
6
+
7
+ ## Using Clasp authentication in CI/CD workflow with @ciderjs/clasp-auth
8
+
9
+ You can upload your Clasp authentication json file to your Github repository, and use it in CI/CD cycle.
10
+
11
+ 0. Log in with @google/clasp, GitHub CLI
12
+ 1. `pnpm run auth repoOwner/repoName` * replace with repository name
13
+ 2. Push code, and set Version Tag in GitHub
14
+ 3. ...and your codes are pushed and deployed to Apps-Script!
@@ -0,0 +1,35 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.3.4/schema.json",
3
+ "vcs": {
4
+ "enabled": true,
5
+ "clientKind": "git",
6
+ "useIgnoreFile": true
7
+ },
8
+ "files": {
9
+ "ignoreUnknown": false
10
+ },
11
+ "formatter": {
12
+ "enabled": true,
13
+ "indentStyle": "space",
14
+ "indentWidth": 2
15
+ },
16
+ "linter": {
17
+ "enabled": true,
18
+ "rules": {
19
+ "recommended": true
20
+ }
21
+ },
22
+ "javascript": {
23
+ "formatter": {
24
+ "quoteStyle": "double"
25
+ }
26
+ },
27
+ "assist": {
28
+ "enabled": true,
29
+ "actions": {
30
+ "source": {
31
+ "organizeImports": "on"
32
+ }
33
+ }
34
+ }
35
+ }
@@ -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.ts"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,50 @@
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": "vue-tsc -b && vite build",
10
+ "build": "rimraf dist && pnpm run build:front && pnpm run build:server",
11
+ "check": "biome check --write",
12
+ "generate": "gasnuki",
13
+ "test": "vitest run --coverage",
14
+ "auth": "clasp-auth upload",
15
+ "push": "clasp push",
16
+ "deploy": "clasp create-deployment",
17
+ "update": "dotenv cross-var \"clasp update-deployment $GAS_DEPLOYMENT_ID\"",
18
+ "preview:local": "vite preview",
19
+ "preview:web": "clasp open-web-app"
20
+ },
21
+ "dependencies": {
22
+ "@ciderjs/city-gas": "^0.2.0",
23
+ "@ciderjs/gasnuki": "^0.3.2",
24
+ "vue": "^3.5.22"
25
+ },
26
+ "devDependencies": {
27
+ "@biomejs/biome": "^2.3.4",
28
+ "@ciderjs/clasp-auth": "^0.1.3",
29
+ "@google/clasp": "^3.1.1",
30
+ "@rollup/plugin-alias": "^6.0.0",
31
+ "@types/google-apps-script": "^2.0.7",
32
+ "@types/node": "^24.6.0",
33
+ "@vitejs/plugin-vue": "^6.0.1",
34
+ "@vitest/coverage-v8": "^4.0.8",
35
+ "@vue/tsconfig": "^0.8.1",
36
+ "cpy-cli": "^6.0.0",
37
+ "cross-var": "^1.1.0",
38
+ "dotenv-cli": "^11.0.0",
39
+ "rimraf": "^6.1.0",
40
+ "rolldown": "1.0.0-beta.47",
41
+ "rolldown-plugin-remove-export": "^0.1.3",
42
+ "typescript": "~5.9.3",
43
+ "vite": "^7.1.7",
44
+ "vite-plugin-google-apps-script": "^0.4.0",
45
+ "vite-plugin-singlefile": "^2.3.0",
46
+ "vite-tsconfig-paths": "^5.1.4",
47
+ "vitest": "^4.0.8",
48
+ "vue-tsc": "^3.1.0"
49
+ }
50
+ }
@@ -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="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,25 @@
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 = "app.js";
7
+
8
+ export default defineConfig({
9
+ input: "server/app.ts",
10
+ output: {
11
+ format: "esm",
12
+ file: `dist/${outputFile}`,
13
+ },
14
+ plugins: [
15
+ alias({
16
+ entries: [
17
+ {
18
+ find: "~",
19
+ replacement: path.resolve(__dirname),
20
+ },
21
+ ],
22
+ }),
23
+ removeExportPlugin(outputFile),
24
+ ],
25
+ });