@ciderjs/gasbombe 0.2.8 → 0.3.0

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 (120) 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/react/.env.ejs +1 -0
  11. package/dist/templates/{react-tsx → react}/README.md.ejs +0 -1
  12. package/dist/templates/react/biome.json.ejs +43 -0
  13. package/dist/templates/react/index.html.ejs +13 -0
  14. package/dist/templates/{react-tsx → react}/package.json.ejs +0 -2
  15. package/dist/templates/react/public/vite.svg.ejs +1 -0
  16. package/dist/templates/react/rolldown.config.ts.ejs +25 -0
  17. package/dist/templates/react/server/app.ts.ejs +29 -0
  18. package/dist/templates/react/server/appsscript.json.ejs +12 -0
  19. package/dist/templates/react/server/modules/hello.ts.ejs +3 -0
  20. package/dist/templates/react/src/App.css.ejs +42 -0
  21. package/dist/templates/react/src/App.tsx.ejs +63 -0
  22. package/dist/templates/react/src/assets/react.svg.ejs +1 -0
  23. package/dist/templates/react/src/index.css.ejs +68 -0
  24. package/dist/templates/react/src/lib/parameters.ts.ejs +20 -0
  25. package/dist/templates/react/src/main.tsx.ejs +11 -0
  26. package/dist/templates/react/src/vite-env.d.ts.ejs +1 -0
  27. package/dist/templates/react/tests/server/modules/hello.spec.ts.ejs +9 -0
  28. package/dist/templates/react/tsconfig.app.json.ejs +31 -0
  29. package/dist/templates/react/tsconfig.json.ejs +13 -0
  30. package/dist/templates/react/tsconfig.node.json.ejs +25 -0
  31. package/dist/templates/{react-tsx → react}/types/appsscript/client.ts.ejs +2 -15
  32. package/dist/templates/react/types/appsscript/server.ts.ejs +10 -0
  33. package/dist/templates/react/vite.config.ts.ejs +20 -0
  34. package/dist/templates/react-ciderjs/.github/workflows/appsscript.yml.ejs +45 -0
  35. package/dist/templates/react-ciderjs/README.md.ejs +20 -0
  36. package/dist/templates/{react-tsx → react-ciderjs}/biome.json.ejs +3 -25
  37. package/dist/templates/react-ciderjs/package.json.ejs +51 -0
  38. package/dist/templates/react-ciderjs/rolldown.config.ts.ejs +25 -0
  39. package/dist/templates/{react-tsx → react-ciderjs}/server/app.ts.ejs +6 -6
  40. package/dist/templates/react-ciderjs/src/App.tsx.ejs +49 -0
  41. package/dist/templates/{react-tsx → react-ciderjs}/src/lib/parameters.ts.ejs +4 -4
  42. package/dist/templates/{react-tsx → react-ciderjs}/src/lib/server.ts.ejs +2 -2
  43. package/dist/templates/react-ciderjs/src/main.tsx.ejs +11 -0
  44. package/dist/templates/react-ciderjs/src/pages/about.tsx.ejs +7 -0
  45. package/dist/templates/react-ciderjs/src/pages/detail/user.tsx.ejs +16 -0
  46. package/dist/templates/{react-tsx/src/App.tsx.ejs → react-ciderjs/src/pages/index.tsx.ejs} +10 -13
  47. package/dist/templates/react-ciderjs/tests/server/modules/hello.spec.ts.ejs +9 -0
  48. package/dist/templates/react-ciderjs/tests/src/lib/server.spec.ts.ejs +8 -0
  49. package/dist/templates/react-ciderjs/vite.config.ts.ejs +33 -0
  50. package/dist/templates/server-js/biome.json.ejs +36 -0
  51. package/dist/templates/server-js/package.json.ejs +26 -0
  52. package/dist/templates/server-js/rolldown.config.mjs.ejs +29 -0
  53. package/dist/templates/server-js/src/main.js.ejs +5 -0
  54. package/dist/templates/server-js/src/modules/hello.js.ejs +3 -0
  55. package/dist/templates/server-js/tests/main.test.js.ejs +15 -0
  56. package/dist/templates/server-js/tsconfig.json.ejs +34 -0
  57. package/dist/templates/server-js/vitest.config.js.ejs +11 -0
  58. package/dist/templates/server-ts/.clasp.json.ejs +5 -0
  59. package/dist/templates/server-ts/README.md.ejs +7 -0
  60. package/dist/templates/{vanilla-ts → server-ts}/biome.json.ejs +2 -2
  61. package/dist/templates/{vanilla-ts → server-ts}/package.json.ejs +8 -9
  62. package/dist/templates/server-ts/rolldown.config.ts.ejs +29 -0
  63. package/dist/templates/server-ts/src/appsscript.json.ejs +8 -0
  64. package/dist/templates/server-ts/src/main.ts.ejs +5 -0
  65. package/dist/templates/server-ts/tests/main.test.ts.ejs +15 -0
  66. package/dist/templates/server-ts/vitest.config.ts.ejs +11 -0
  67. package/dist/templates/vue/.clasp.json.ejs +5 -0
  68. package/dist/templates/vue/.env.ejs +1 -0
  69. package/dist/templates/vue/.vscode/extensions.json.ejs +3 -0
  70. package/dist/templates/vue/README.md.ejs +5 -0
  71. package/dist/templates/vue/biome.json.ejs +35 -0
  72. package/dist/templates/vue/index.html.ejs +13 -0
  73. package/dist/templates/vue/package.json.ejs +45 -0
  74. package/dist/templates/vue/public/vite.svg.ejs +1 -0
  75. package/dist/templates/vue/rolldown.config.ts.ejs +25 -0
  76. package/dist/templates/vue/server/app.ts.ejs +29 -0
  77. package/dist/templates/vue/server/appsscript.json.ejs +12 -0
  78. package/dist/templates/vue/server/modules/hello.ts.ejs +3 -0
  79. package/dist/templates/vue/src/App.vue.ejs +30 -0
  80. package/dist/templates/vue/src/assets/vue.svg.ejs +1 -0
  81. package/dist/templates/vue/src/components/HelloWorld.vue.ejs +60 -0
  82. package/dist/templates/vue/src/lib/parameters.ts.ejs +20 -0
  83. package/dist/templates/vue/src/main.ts.ejs +5 -0
  84. package/dist/templates/vue/src/style.css.ejs +79 -0
  85. package/dist/templates/vue/tests/server/modules/hello.spec.ts.ejs +9 -0
  86. package/dist/templates/vue/tsconfig.app.json.ejs +21 -0
  87. package/dist/templates/vue/tsconfig.json.ejs +13 -0
  88. package/dist/templates/vue/tsconfig.node.json.ejs +26 -0
  89. package/dist/templates/vue/types/appsscript/client.ts.ejs +44 -0
  90. package/dist/templates/vue/types/appsscript/server.ts.ejs +10 -0
  91. package/dist/templates/vue/vite.config.ts.ejs +19 -0
  92. package/package.json +17 -12
  93. package/dist/templates/react-tsx/rolldown.config.ts.ejs +0 -25
  94. package/dist/templates/react-tsx/src/main.tsx.ejs +0 -11
  95. package/dist/templates/react-tsx/tests/server/modules/hello.spec.ts.ejs +0 -9
  96. package/dist/templates/react-tsx/tests/src/lib/server.spec.ts.ejs +0 -8
  97. package/dist/templates/react-tsx/vite.config.ts.ejs +0 -31
  98. package/dist/templates/vanilla-ts/rolldown.config.ts.ejs +0 -29
  99. package/dist/templates/vanilla-ts/src/main.ts.ejs +0 -5
  100. package/dist/templates/vanilla-ts/tests/main.test.ts.ejs +0 -15
  101. package/dist/templates/vanilla-ts/vitest.config.ts.ejs +0 -11
  102. /package/dist/templates/{vanilla-ts → react}/.clasp.json.ejs +0 -0
  103. /package/dist/templates/{react-tsx → react-ciderjs}/.clasp.json.ejs +0 -0
  104. /package/dist/templates/{react-tsx → react-ciderjs}/.env.ejs +0 -0
  105. /package/dist/templates/{react-tsx → react-ciderjs}/index.html.ejs +0 -0
  106. /package/dist/templates/{react-tsx → react-ciderjs}/public/vite.svg.ejs +0 -0
  107. /package/dist/templates/{react-tsx → react-ciderjs}/server/appsscript.json.ejs +0 -0
  108. /package/dist/templates/{react-tsx → react-ciderjs}/server/modules/hello.ts.ejs +0 -0
  109. /package/dist/templates/{react-tsx → react-ciderjs}/src/App.css.ejs +0 -0
  110. /package/dist/templates/{react-tsx → react-ciderjs}/src/assets/react.svg.ejs +0 -0
  111. /package/dist/templates/{react-tsx → react-ciderjs}/src/index.css.ejs +0 -0
  112. /package/dist/templates/{react-tsx → react-ciderjs}/src/vite-env.d.ts.ejs +0 -0
  113. /package/dist/templates/{react-tsx → react-ciderjs}/tsconfig.app.json.ejs +0 -0
  114. /package/dist/templates/{react-tsx → react-ciderjs}/tsconfig.json.ejs +0 -0
  115. /package/dist/templates/{react-tsx → react-ciderjs}/tsconfig.node.json.ejs +0 -0
  116. /package/dist/templates/{react-tsx → react-ciderjs}/types/appsscript/server.ts.ejs +0 -0
  117. /package/dist/templates/{vanilla-ts → server-js}/README.md.ejs +0 -0
  118. /package/dist/templates/{vanilla-ts → server-js}/src/appsscript.json.ejs +0 -0
  119. /package/dist/templates/{vanilla-ts → server-ts}/src/modules/hello.ts.ejs +0 -0
  120. /package/dist/templates/{vanilla-ts → server-ts}/tsconfig.json.ejs +0 -0
@@ -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
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ciderjs/gasbombe",
3
- "version": "0.2.8",
3
+ "version": "0.3.0",
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 = 'index.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
- });
@@ -1,11 +0,0 @@
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/**/*.ts'],
8
- },
9
- },
10
- plugins: [tsconfigPaths()],
11
- });