@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,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,7 @@
1
+ <template>
2
+ <RouterOutlet />
3
+ </template>
4
+
5
+ <script setup lang="ts">
6
+ import { RouterOutlet } from "@ciderjs/city-gas/vue";
7
+ </script>
@@ -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,54 @@
1
+ <script setup lang="ts">
2
+ import { ref } from "vue";
3
+ import { parameters } from "@/lib/parameters";
4
+ import { serverScripts } from "@/lib/server";
5
+
6
+ defineProps<{ msg: string }>();
7
+
8
+ const { userAddress } = parameters;
9
+
10
+ const count = ref(0);
11
+ const message = ref("Click to say hello");
12
+
13
+ const handleHelloButton = async () => {
14
+ message.value = "Waiting...";
15
+ try {
16
+ message.value = await serverScripts.sayHello(userAddress);
17
+ } catch (error) {
18
+ console.error(error);
19
+ message.value = "Error. Check the console.";
20
+ }
21
+ };
22
+ </script>
23
+
24
+ <template>
25
+ <h1>{{ msg }}</h1>
26
+
27
+ <div class="card">
28
+ <button type="button" @click="count++">count is {{ count }}</button>
29
+ <button type="button" @click="handleHelloButton" :style="{ marginLeft: '10px' }">
30
+ {{ message }}
31
+ </button>
32
+ <p>
33
+ Edit
34
+ <code>components/HelloWorld.vue</code> to test HMR
35
+ </p>
36
+ </div>
37
+
38
+ <p>
39
+ Check out
40
+ <a href="https://vuejs.org/guide/quick-start.html#local" target="_blank">create-vue</a>, the official Vue + Vite
41
+ starter
42
+ </p>
43
+ <p>
44
+ Learn more about IDE Support for Vue in the
45
+ <a href="https://vuejs.org/guide/scaling-up/tooling.html#ide-support" target="_blank">Vue Docs Scaling up Guide</a>.
46
+ </p>
47
+ <p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
48
+ </template>
49
+
50
+ <style scoped>
51
+ .read-the-docs {
52
+ color: #888;
53
+ }
54
+ </style>
@@ -0,0 +1,23 @@
1
+ <template>
2
+ <nav>
3
+ <button type="button" @click="goHome">Go Home</button>
4
+ <button type="button" @click="goAbout">Go About</button>
5
+ <button type="button" @click="goUser">Go User 123</button>
6
+ </nav>
7
+ </template>
8
+
9
+ <script setup lang="ts">
10
+ import { useNavigate } from "@ciderjs/city-gas/vue";
11
+
12
+ const navigate = useNavigate();
13
+
14
+ const goHome = () => navigate("/");
15
+ const goAbout = () => navigate("/about");
16
+ const goUser = () => navigate("/detail/user", { id: "123" });
17
+ </script>
18
+
19
+ <style scoped>
20
+ button {
21
+ margin-right: 10px;
22
+ }
23
+ </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,18 @@
1
+ import {
2
+ getPromisedServerScripts,
3
+ type PartialScriptType,
4
+ } from "@ciderjs/gasnuki/promise";
5
+ import type { ServerScripts } from "~/types/appsscript/client";
6
+
7
+ // mockup function to simulate as fetching appsscript time
8
+ export const sleep = (ms: number) =>
9
+ new Promise((resolve) => setTimeout(resolve, ms));
10
+
11
+ const mockup: PartialScriptType<ServerScripts> = {
12
+ sayHello: async (name) => {
13
+ await sleep(1000);
14
+ return `Hello, ${name}!`;
15
+ },
16
+ };
17
+
18
+ export const serverScripts = getPromisedServerScripts<ServerScripts>(mockup);
@@ -0,0 +1,13 @@
1
+ import { createRouter } from "@ciderjs/city-gas";
2
+ import { createRouterPlugin } from "@ciderjs/city-gas/vue";
3
+ import { createApp } from "vue";
4
+ import "@/style.css";
5
+ import App from "@/App.vue";
6
+ import { pages, specialPages } from "@/generated/routes";
7
+
8
+ function main() {
9
+ const router = createRouter(pages, { specialPages });
10
+ createApp(App).use(createRouterPlugin(router)).mount("#app");
11
+ }
12
+
13
+ main();
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <div>
3
+ <header>
4
+ <Navigation />
5
+ </header>
6
+ <main>
7
+ <div>
8
+ <a href="https://vite.dev" target="_blank">
9
+ <img src="/vite.svg" class="logo" alt="Vite logo" />
10
+ </a>
11
+ <a href="https://vuejs.org/" target="_blank">
12
+ <img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
13
+ </a>
14
+ </div>
15
+ <slot />
16
+ </main>
17
+ <footer>Footer</footer>
18
+ </div>
19
+ </template>
20
+
21
+ <script setup lang="ts">
22
+ import Navigation from "@/components/Navigation.vue";
23
+ </script>
24
+
25
+ <style scoped>
26
+ .logo {
27
+ height: 6em;
28
+ padding: 1.5em;
29
+ will-change: filter;
30
+ transition: filter 300ms;
31
+ }
32
+
33
+ .logo:hover {
34
+ filter: drop-shadow(0 0 2em #646cffaa);
35
+ }
36
+
37
+ .logo.vue:hover {
38
+ filter: drop-shadow(0 0 2em #42b883aa);
39
+ }
40
+ </style>
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <div>
3
+ <h2>About Page</h2>
4
+ <p>This is the about page.</p>
5
+ </div>
6
+ </template>
7
+
8
+ <script setup lang="ts">
9
+ </script>
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <div>
3
+ <h2>User Show Page</h2>
4
+ <p>User ID: {{ params.id }}</p>
5
+ </div>
6
+ </template>
7
+
8
+ <script setup lang="ts">
9
+ import { useParams } from "@ciderjs/city-gas/vue";
10
+
11
+ const params = useParams<"/detail/user">();
12
+ </script>
13
+
14
+ <script lang="ts">
15
+ export const params = { id: 'string' };
16
+ </script>
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <HelloWorld msg="Hello CiderJS!" />
3
+ </template>
4
+
5
+ <script setup lang="ts">
6
+ import HelloWorld from "@/components/HelloWorld.vue";
7
+ </script>
@@ -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,8 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { serverScripts } from "@/lib/server";
3
+
4
+ describe("server", () => {
5
+ it("should be defined", () => {
6
+ expect(serverScripts).toBeDefined();
7
+ });
8
+ });
@@ -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,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,27 @@
1
+ /// <reference types="vitest" />
2
+
3
+ import { cityGasRouter } from "@ciderjs/city-gas/plugin";
4
+ import { gasnuki } from "@ciderjs/gasnuki/vite";
5
+ import vue from "@vitejs/plugin-vue";
6
+ import { defineConfig } from "vite";
7
+ import { gas } from "vite-plugin-google-apps-script";
8
+ import { viteSingleFile } from "vite-plugin-singlefile";
9
+ import tsconfigPaths from "vite-tsconfig-paths";
10
+
11
+ // https://vite.dev/config/
12
+ export default defineConfig({
13
+ plugins: [
14
+ vue(),
15
+ tsconfigPaths({
16
+ loose: true,
17
+ }),
18
+ cityGasRouter(),
19
+ gasnuki({
20
+ srcDir: "server",
21
+ outDir: "types/appsscript",
22
+ outputFile: "client.ts",
23
+ }),
24
+ gas(),
25
+ viteSingleFile(),
26
+ ],
27
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ciderjs/gasbombe",
3
- "version": "0.2.9",
3
+ "version": "0.3.1",
4
4
  "description": "A TypeScript Project Generator for GoogleAppsScript, available as CLI",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -39,22 +39,27 @@
39
39
  "url": "https://github.com/luthpg/gasbombe/issues"
40
40
  },
41
41
  "homepage": "https://github.com/luthpg/gasbombe#readme",
42
- "dependencies": {
42
+ "devDependencies": {
43
+ "@biomejs/biome": "^2.3.4",
43
44
  "@inquirer/prompts": "^7.9.0",
44
- "commander": "^14.0.1",
45
+ "@types/ejs": "^3.1.5",
46
+ "@types/node": "^24.10.0",
47
+ "@typescript/native-preview": "7.0.0-dev.20251108.1",
48
+ "@vitest/coverage-v8": "4.0.8",
49
+ "commander": "^14.0.2",
45
50
  "consola": "^3.4.2",
46
51
  "ejs": "^3.1.10",
47
- "glob": "^11.0.3"
48
- },
49
- "devDependencies": {
50
- "@biomejs/biome": "^2.2.6",
51
- "@types/ejs": "^3.1.5",
52
- "@types/node": "^24.8.1",
53
- "@typescript/native-preview": "7.0.0-dev.20251018.1",
54
- "@vitest/coverage-v8": "3.2.4",
52
+ "glob": "^11.0.3",
55
53
  "jiti": "^2.6.1",
56
54
  "typescript": "^5.9.3",
57
55
  "unbuild": "^3.6.1",
58
- "vitest": "^3.2.4"
56
+ "vitest": "^4.0.8"
57
+ },
58
+ "peerDependencies": {
59
+ "@inquirer/prompts": "^7",
60
+ "commander": "^14",
61
+ "consola": "^3",
62
+ "ejs": "^3",
63
+ "glob": "^11"
59
64
  }
60
65
  }
@@ -1,25 +0,0 @@
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
- });
@@ -1,11 +0,0 @@
1
- import { StrictMode } from 'react';
2
- import { createRoot } from 'react-dom/client';
3
- import './index.css';
4
- import App from './App.tsx';
5
-
6
- // biome-ignore lint/style/noNonNullAssertion: root is not null
7
- createRoot(document.getElementById('root')!).render(
8
- <StrictMode>
9
- <App />
10
- </StrictMode>,
11
- );
@@ -1,9 +0,0 @@
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
- });
@@ -1,8 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { serverScripts } from '@/lib/server';
3
-
4
- describe('server', () => {
5
- it('should be defined', () => {
6
- expect(serverScripts).toBeDefined();
7
- });
8
- });
@@ -1,31 +0,0 @@
1
- /// <reference types="vitest" />
2
-
3
- import { gasnuki } from '@ciderjs/gasnuki/vite';
4
- import react from '@vitejs/plugin-react';
5
- import { defineConfig } from 'vite';
6
- import { gas } from 'vite-plugin-google-apps-script';
7
- import { viteSingleFile } from 'vite-plugin-singlefile';
8
- import tsconfigPaths from 'vite-tsconfig-paths';
9
-
10
- // https://vite.dev/config/
11
- export default defineConfig({
12
- build: {
13
- outDir: 'dist',
14
- },
15
- test: {
16
- coverage: {
17
- include: ['src/**/*.ts', 'src/**/*.tsx', 'server/**/*.ts'],
18
- },
19
- },
20
- plugins: [
21
- react(),
22
- tsconfigPaths(),
23
- gasnuki({
24
- srcDir: 'server',
25
- outDir: 'types/appsscript',
26
- outputFile: 'client.ts',
27
- }),
28
- gas(),
29
- viteSingleFile(),
30
- ],
31
- });
@@ -1,29 +0,0 @@
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.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, 'src'),
20
- },
21
- {
22
- find: '~',
23
- replacement: path.resolve(__dirname),
24
- },
25
- ],
26
- }),
27
- removeExportPlugin(outputFile),
28
- ],
29
- });
@@ -1,5 +0,0 @@
1
- import { useHello } from '@/modules/hello';
2
-
3
- export function myFunction() {
4
- Logger.log(useHello('world'));
5
- }
@@ -1,15 +0,0 @@
1
- import { describe, expect, test, vi } from 'vitest';
2
- import { myFunction } from '@/main';
3
- import { useHello } from '@/modules/hello';
4
-
5
- describe('main', () => {
6
- test('useHello', () => {
7
- expect(useHello('world')).toBe('Hello world');
8
- });
9
-
10
- test('myFunction', () => {
11
- vi.stubGlobal('Logger', { log: vi.fn() });
12
- myFunction();
13
- expect(Logger.log).toHaveBeenCalledWith('Hello world');
14
- });
15
- });