@ciderjs/gasbombe 0.3.2 → 0.4.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 (60) hide show
  1. package/dist/catalog.json +32 -0
  2. package/dist/cli.cjs +1 -1
  3. package/dist/cli.mjs +1 -1
  4. package/dist/index.cjs +12 -3
  5. package/dist/index.d.cts +2 -1
  6. package/dist/index.d.mts +2 -1
  7. package/dist/index.d.ts +2 -1
  8. package/dist/index.mjs +12 -4
  9. package/dist/templates/{react-ciderjs → common}/biome.json.ejs +14 -2
  10. package/dist/templates/html-js/package.json.ejs +10 -11
  11. package/dist/templates/html-js/rolldown.config.mjs.ejs +7 -23
  12. package/dist/templates/react/package.json.ejs +19 -20
  13. package/dist/templates/react/rolldown.config.ts.ejs +1 -13
  14. package/dist/templates/react/vite.config.ts.ejs +1 -1
  15. package/dist/templates/react-ciderjs/gasnuki.config.ts.ejs +7 -0
  16. package/dist/templates/react-ciderjs/package.json.ejs +23 -23
  17. package/dist/templates/react-ciderjs/rolldown.config.ts.ejs +1 -13
  18. package/dist/templates/react-ciderjs/server/modules/hello.ts.ejs +10 -0
  19. package/dist/templates/react-ciderjs/src/generated/router.d.ts.ejs +19 -0
  20. package/dist/templates/react-ciderjs/src/generated/routes.ts.ejs +34 -0
  21. package/dist/templates/react-ciderjs/src/index.css.ejs +43 -0
  22. package/dist/templates/react-ciderjs/src/lib/server.ts.ejs +14 -2
  23. package/dist/templates/react-ciderjs/src/main.tsx.ejs +12 -8
  24. package/dist/templates/react-ciderjs/src/{App.tsx.ejs → pages/_root.tsx.ejs} +9 -16
  25. package/dist/templates/react-ciderjs/src/pages/about.tsx.ejs +1 -0
  26. package/dist/templates/react-ciderjs/src/pages/detail/user.tsx.ejs +6 -4
  27. package/dist/templates/react-ciderjs/src/pages/index.tsx.ejs +13 -2
  28. package/dist/templates/react-ciderjs/types/appsscript/client.ts.ejs +65 -0
  29. package/dist/templates/react-ciderjs/vite.config.ts.ejs +2 -6
  30. package/dist/templates/server-js/package.json.ejs +10 -11
  31. package/dist/templates/server-js/rolldown.config.mjs.ejs +7 -23
  32. package/dist/templates/server-js/tests/{main.test.js.ejs → app.test.js.ejs} +1 -1
  33. package/dist/templates/server-ts/package.json.ejs +11 -12
  34. package/dist/templates/server-ts/rolldown.config.ts.ejs +3 -19
  35. package/dist/templates/server-ts/tests/{main.test.ts.ejs → app.test.ts.ejs} +1 -1
  36. package/dist/templates/vue/package.json.ejs +16 -17
  37. package/dist/templates/vue/rolldown.config.ts.ejs +1 -13
  38. package/dist/templates/vue/vite.config.ts.ejs +1 -1
  39. package/dist/templates/vue-ciderjs/gasnuki.config.ts.ejs +7 -0
  40. package/dist/templates/vue-ciderjs/package.json.ejs +20 -20
  41. package/dist/templates/vue-ciderjs/rolldown.config.ts.ejs +1 -13
  42. package/dist/templates/vue-ciderjs/server/modules/hello.ts.ejs +10 -0
  43. package/dist/templates/vue-ciderjs/src/components/HelloWorld.vue.ejs +11 -2
  44. package/dist/templates/vue-ciderjs/src/generated/router.d.ts.ejs +19 -0
  45. package/dist/templates/vue-ciderjs/src/generated/routes.ts.ejs +34 -0
  46. package/dist/templates/vue-ciderjs/src/lib/server.ts.ejs +14 -2
  47. package/dist/templates/vue-ciderjs/src/main.ts.ejs +6 -8
  48. package/dist/templates/vue-ciderjs/src/pages/detail/user.vue.ejs +3 -2
  49. package/dist/templates/vue-ciderjs/types/appsscript/client.ts.ejs +65 -0
  50. package/dist/templates/vue-ciderjs/vite.config.ts.ejs +1 -1
  51. package/package.json +24 -15
  52. package/dist/templates/html-js/biome.json.ejs +0 -36
  53. package/dist/templates/react/biome.json.ejs +0 -43
  54. package/dist/templates/server-js/biome.json.ejs +0 -36
  55. package/dist/templates/server-ts/biome.json.ejs +0 -36
  56. package/dist/templates/vue/biome.json.ejs +0 -35
  57. package/dist/templates/vue-ciderjs/biome.json.ejs +0 -35
  58. package/dist/templates/vue-ciderjs/src/App.vue.ejs +0 -7
  59. /package/dist/templates/server-js/src/{main.js.ejs → app.js.ejs} +0 -0
  60. /package/dist/templates/server-ts/src/{main.ts.ejs → app.ts.ejs} +0 -0
@@ -0,0 +1,32 @@
1
+ {
2
+ "@biomejs/biome": "^2.3.13",
3
+ "@ciderjs/city-gas": "^1.1.0",
4
+ "@ciderjs/clasp-auth": "^0.2.0",
5
+ "@ciderjs/gasnuki": "^0.5.5",
6
+ "@google/clasp": "^3.1.3",
7
+ "@types/google-apps-script": "^2.0.8",
8
+ "@types/node": "^25.1.0",
9
+ "@types/react": "^19.2.10",
10
+ "@types/react-dom": "^19.2.3",
11
+ "@vitejs/plugin-react": "^5.1.2",
12
+ "@vitejs/plugin-vue": "^6.0.3",
13
+ "@vitest/coverage-v8": "^4.0.18",
14
+ "@vue/tsconfig": "^0.8.1",
15
+ "cpy-cli": "^6.0.0",
16
+ "cross-var": "^1.1.0",
17
+ "dotenv-cli": "^11.0.0",
18
+ "react": "^19.2.4",
19
+ "react-dom": "^19.2.4",
20
+ "rimraf": "^6.1.2",
21
+ "rolldown": "1.0.0-rc.2",
22
+ "rolldown-plugin-remove-export": "^0.1.3",
23
+ "typescript": "^5.9.3",
24
+ "vite": "^7.3.1",
25
+ "vite-plugin-google-apps-script": "^0.4.1",
26
+ "vite-plugin-singlefile": "^2.3.0",
27
+ "vite-tsconfig-paths": "^6.0.5",
28
+ "vitest": "^4.0.18",
29
+ "vue": "^3.5.27",
30
+ "vue-tsc": "^3.2.4",
31
+ "zod": "^4.3.6"
32
+ }
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.3.2";
14
+ const version = "0.4.1";
15
15
 
16
16
  async function main() {
17
17
  const program = new commander.Command();
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.3.2";
12
+ const version = "0.4.1";
13
13
 
14
14
  async function main() {
15
15
  const program = new Command();
package/dist/index.cjs CHANGED
@@ -14,13 +14,15 @@ const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
14
14
  const path__default = /*#__PURE__*/_interopDefaultCompat(path);
15
15
  const ejs__default = /*#__PURE__*/_interopDefaultCompat(ejs);
16
16
 
17
+ function isWindows() {
18
+ return process.platform === "win32";
19
+ }
17
20
  async function runCommand(command, args, cwd, capture = false) {
18
21
  return new Promise((resolve, reject) => {
19
- const isWindows = process.platform === "win32";
20
22
  const child = node_child_process.spawn(command, args, {
21
23
  cwd,
22
24
  stdio: capture ? "pipe" : "inherit",
23
- shell: isWindows
25
+ shell: isWindows()
24
26
  });
25
27
  let stdout = "";
26
28
  let stderr = "";
@@ -177,6 +179,9 @@ async function generateProject({
177
179
  const templateBaseDir = path__default.resolve(__dirname, "..", "dist", "templates");
178
180
  const commonTemplateDir = path__default.resolve(templateBaseDir, "common");
179
181
  const specificTemplateDir = path__default.resolve(templateBaseDir, templateType);
182
+ const catalogPath = path__default.resolve(__dirname, "..", "dist", "catalog.json");
183
+ const catalogJson = await fs__default.readFile(catalogPath, "utf-8");
184
+ const catalog = JSON.parse(catalogJson);
180
185
  consola.consola.start(
181
186
  `Creating a new Project for GoogleAppsScript in ${outputDir}...`
182
187
  );
@@ -205,7 +210,10 @@ async function generateProject({
205
210
  }
206
211
  await fs__default.mkdir(outputDir, { recursive: true });
207
212
  consola.consola.info(`Generating project files from template '${templateType}'...`);
208
- const ejsData = { projectName };
213
+ const ejsData = {
214
+ projectName,
215
+ biomeVersion: catalog["@biomejs/biome"]?.replace("^", "") || "2.0.0"
216
+ };
209
217
  const templateDirs = [commonTemplateDir, specificTemplateDir];
210
218
  for (const dir of templateDirs) {
211
219
  const files = await glob.glob("./**/*", {
@@ -277,4 +285,5 @@ To get started, write your GAS code in \`src/\`!`);
277
285
  }
278
286
 
279
287
  exports.generateProject = generateProject;
288
+ exports.isWindows = isWindows;
280
289
  exports.runCommand = runCommand;
package/dist/index.d.cts CHANGED
@@ -10,7 +10,8 @@ interface ProjectOptions {
10
10
  install: boolean;
11
11
  }
12
12
 
13
+ declare function isWindows(): boolean;
13
14
  declare function runCommand(command: string, args: string[], cwd: string, capture?: boolean): Promise<string>;
14
15
  declare function generateProject({ projectName, packageManager, templateType, clasp, claspProjectId, install, }: ProjectOptions): Promise<void>;
15
16
 
16
- export { generateProject, runCommand };
17
+ export { generateProject, isWindows, runCommand };
package/dist/index.d.mts CHANGED
@@ -10,7 +10,8 @@ interface ProjectOptions {
10
10
  install: boolean;
11
11
  }
12
12
 
13
+ declare function isWindows(): boolean;
13
14
  declare function runCommand(command: string, args: string[], cwd: string, capture?: boolean): Promise<string>;
14
15
  declare function generateProject({ projectName, packageManager, templateType, clasp, claspProjectId, install, }: ProjectOptions): Promise<void>;
15
16
 
16
- export { generateProject, runCommand };
17
+ export { generateProject, isWindows, runCommand };
package/dist/index.d.ts CHANGED
@@ -10,7 +10,8 @@ interface ProjectOptions {
10
10
  install: boolean;
11
11
  }
12
12
 
13
+ declare function isWindows(): boolean;
13
14
  declare function runCommand(command: string, args: string[], cwd: string, capture?: boolean): Promise<string>;
14
15
  declare function generateProject({ projectName, packageManager, templateType, clasp, claspProjectId, install, }: ProjectOptions): Promise<void>;
15
16
 
16
- export { generateProject, runCommand };
17
+ export { generateProject, isWindows, runCommand };
package/dist/index.mjs CHANGED
@@ -15,13 +15,15 @@ import __cjs_mod__ from 'module';
15
15
  const __filename = __cjs_url__.fileURLToPath(import.meta.url);
16
16
  const __dirname = __cjs_path__.dirname(__filename);
17
17
  const require = __cjs_mod__.createRequire(import.meta.url);
18
+ function isWindows() {
19
+ return process.platform === "win32";
20
+ }
18
21
  async function runCommand(command, args, cwd, capture = false) {
19
22
  return new Promise((resolve, reject) => {
20
- const isWindows = process.platform === "win32";
21
23
  const child = spawn(command, args, {
22
24
  cwd,
23
25
  stdio: capture ? "pipe" : "inherit",
24
- shell: isWindows
26
+ shell: isWindows()
25
27
  });
26
28
  let stdout = "";
27
29
  let stderr = "";
@@ -178,6 +180,9 @@ async function generateProject({
178
180
  const templateBaseDir = path.resolve(__dirname, "..", "dist", "templates");
179
181
  const commonTemplateDir = path.resolve(templateBaseDir, "common");
180
182
  const specificTemplateDir = path.resolve(templateBaseDir, templateType);
183
+ const catalogPath = path.resolve(__dirname, "..", "dist", "catalog.json");
184
+ const catalogJson = await fs.readFile(catalogPath, "utf-8");
185
+ const catalog = JSON.parse(catalogJson);
181
186
  consola.start(
182
187
  `Creating a new Project for GoogleAppsScript in ${outputDir}...`
183
188
  );
@@ -206,7 +211,10 @@ async function generateProject({
206
211
  }
207
212
  await fs.mkdir(outputDir, { recursive: true });
208
213
  consola.info(`Generating project files from template '${templateType}'...`);
209
- const ejsData = { projectName };
214
+ const ejsData = {
215
+ projectName,
216
+ biomeVersion: catalog["@biomejs/biome"]?.replace("^", "") || "2.0.0"
217
+ };
210
218
  const templateDirs = [commonTemplateDir, specificTemplateDir];
211
219
  for (const dir of templateDirs) {
212
220
  const files = await glob("./**/*", {
@@ -277,4 +285,4 @@ To get started, write your GAS code in \`src/\`!`);
277
285
  }
278
286
  }
279
287
 
280
- export { generateProject, runCommand };
288
+ export { generateProject, isWindows, runCommand };
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.3.4/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/<%= biomeVersion %>/schema.json",
3
3
  "vcs": {
4
4
  "enabled": false,
5
5
  "clientKind": "git",
@@ -39,5 +39,17 @@
39
39
  "organizeImports": "on"
40
40
  }
41
41
  }
42
- }
42
+ },
43
+ "overrides": [
44
+ {
45
+ "includes": ["server/**/*"],
46
+ "linter": {
47
+ "rules": {
48
+ "correctness": {
49
+ "noUnusedVariables": "info"
50
+ }
51
+ }
52
+ }
53
+ }
54
+ ]
43
55
  }
@@ -17,17 +17,16 @@
17
17
  "preview:web": "clasp open-web-app"
18
18
  },
19
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",
20
+ "@biomejs/biome": "^2.3.13",
21
+ "@google/clasp": "^3.1.3",
22
+ "@types/google-apps-script": "^2.0.8",
23
+ "@types/node": "^25.1.0",
25
24
  "cpy-cli": "^6.0.0",
26
- "rimraf": "^6.1.0",
27
- "rolldown": "1.0.0-beta.47",
25
+ "rimraf": "^6.1.2",
26
+ "rolldown": "1.0.0-rc.2",
28
27
  "rolldown-plugin-remove-export": "^0.1.3",
29
- "vite": "^7.1.7",
30
- "vite-tsconfig-paths": "^5.1.4",
31
- "vitest": "^4.0.8"
28
+ "vite": "^7.3.1",
29
+ "vite-tsconfig-paths": "^6.0.5",
30
+ "vitest": "^4.0.18"
32
31
  }
33
- }
32
+ }
@@ -1,29 +1,13 @@
1
- import path from "node:path";
2
- import alias from "@rollup/plugin-alias";
3
1
  import { defineConfig } from "rolldown";
4
2
  import { removeExportPlugin } from "rolldown-plugin-remove-export";
5
3
 
6
- const outputFile = "index.js";
4
+ const outputFile = "app.js";
7
5
 
8
6
  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
- ],
7
+ input: "server/app.js",
8
+ output: {
9
+ format: "esm",
10
+ file: `dist/${outputFile}`,
11
+ },
12
+ plugins: [removeExportPlugin(outputFile)],
29
13
  });
@@ -17,30 +17,29 @@
17
17
  "preview:web": "clasp open-web-app"
18
18
  },
19
19
  "dependencies": {
20
- "react": "^19.2.0",
21
- "react-dom": "^19.2.0"
20
+ "react": "^19.2.4",
21
+ "react-dom": "^19.2.4"
22
22
  },
23
23
  "devDependencies": {
24
- "@biomejs/biome": "^2.2.6",
25
- "@google/clasp": "^3.1.0",
26
- "@rollup/plugin-alias": "^5.1.1",
27
- "@types/google-apps-script": "^2.0.5",
28
- "@types/node": "^24.8.1",
29
- "@types/react": "^19.2.2",
30
- "@types/react-dom": "^19.2.2",
31
- "@vitejs/plugin-react": "^5.0.4",
32
- "@vitest/coverage-v8": "3.2.4",
24
+ "@biomejs/biome": "^2.3.13",
25
+ "@google/clasp": "^3.1.3",
26
+ "@types/google-apps-script": "^2.0.8",
27
+ "@types/node": "^25.1.0",
28
+ "@types/react": "^19.2.10",
29
+ "@types/react-dom": "^19.2.3",
30
+ "@vitejs/plugin-react": "^5.1.2",
31
+ "@vitest/coverage-v8": "^4.0.18",
33
32
  "cpy-cli": "^6.0.0",
34
33
  "cross-var": "^1.1.0",
35
- "dotenv-cli": "^10.0.0",
36
- "rimraf": "^6.0.1",
37
- "rolldown": "1.0.0-beta.43",
34
+ "dotenv-cli": "^11.0.0",
35
+ "rimraf": "^6.1.2",
36
+ "rolldown": "1.0.0-rc.2",
38
37
  "rolldown-plugin-remove-export": "^0.1.3",
39
- "typescript": "~5.9.3",
40
- "vite": "^7.1.10",
41
- "vite-plugin-google-apps-script": "^0.4.0",
38
+ "typescript": "^5.9.3",
39
+ "vite": "^7.3.1",
40
+ "vite-plugin-google-apps-script": "^0.4.1",
42
41
  "vite-plugin-singlefile": "^2.3.0",
43
- "vite-tsconfig-paths": "^5.1.4",
44
- "vitest": "^3.2.4"
42
+ "vite-tsconfig-paths": "^6.0.5",
43
+ "vitest": "^4.0.18"
45
44
  }
46
- }
45
+ }
@@ -1,5 +1,3 @@
1
- import path from "node:path";
2
- import alias from "@rollup/plugin-alias";
3
1
  import { defineConfig } from "rolldown";
4
2
  import { removeExportPlugin } from "rolldown-plugin-remove-export";
5
3
 
@@ -11,15 +9,5 @@ export default defineConfig({
11
9
  format: "esm",
12
10
  file: `dist/${outputFile}`,
13
11
  },
14
- plugins: [
15
- alias({
16
- entries: [
17
- {
18
- find: "~",
19
- replacement: path.resolve(__dirname),
20
- },
21
- ],
22
- }),
23
- removeExportPlugin(outputFile),
24
- ],
12
+ plugins: [removeExportPlugin(outputFile)],
25
13
  });
@@ -1,4 +1,4 @@
1
- /// <reference types="vitest" />
1
+ /// <reference types="vitest/config" />
2
2
 
3
3
  import react from "@vitejs/plugin-react";
4
4
  import { defineConfig } from "vite";
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from "@ciderjs/gasnuki";
2
+
3
+ export default defineConfig({
4
+ srcDir: "server",
5
+ outDir: "types/appsscript",
6
+ outputFile: "client.ts",
7
+ });
@@ -19,33 +19,33 @@
19
19
  "preview:web": "clasp open-web-app"
20
20
  },
21
21
  "dependencies": {
22
- "@ciderjs/city-gas": "^0.2.0",
23
- "@ciderjs/gasnuki": "^0.3.2",
24
- "react": "^19.2.0",
25
- "react-dom": "^19.2.0"
22
+ "@ciderjs/city-gas": "^1.1.0",
23
+ "@ciderjs/gasnuki": "^0.5.5",
24
+ "react": "^19.2.4",
25
+ "react-dom": "^19.2.4",
26
+ "zod": "^4.3.6"
26
27
  },
27
28
  "devDependencies": {
28
- "@biomejs/biome": "^2.2.6",
29
- "@ciderjs/clasp-auth": "^0.1.3",
30
- "@google/clasp": "^3.1.0",
31
- "@rollup/plugin-alias": "^5.1.1",
32
- "@types/google-apps-script": "^2.0.5",
33
- "@types/node": "^24.8.1",
34
- "@types/react": "^19.2.2",
35
- "@types/react-dom": "^19.2.2",
36
- "@vitejs/plugin-react": "^5.0.4",
37
- "@vitest/coverage-v8": "3.2.4",
29
+ "@biomejs/biome": "^2.3.13",
30
+ "@ciderjs/clasp-auth": "^0.2.0",
31
+ "@google/clasp": "^3.1.3",
32
+ "@types/google-apps-script": "^2.0.8",
33
+ "@types/node": "^25.1.0",
34
+ "@types/react": "^19.2.10",
35
+ "@types/react-dom": "^19.2.3",
36
+ "@vitejs/plugin-react": "^5.1.2",
37
+ "@vitest/coverage-v8": "^4.0.18",
38
38
  "cpy-cli": "^6.0.0",
39
39
  "cross-var": "^1.1.0",
40
- "dotenv-cli": "^10.0.0",
41
- "rimraf": "^6.0.1",
42
- "rolldown": "1.0.0-beta.43",
40
+ "dotenv-cli": "^11.0.0",
41
+ "rimraf": "^6.1.2",
42
+ "rolldown": "1.0.0-rc.2",
43
43
  "rolldown-plugin-remove-export": "^0.1.3",
44
- "typescript": "~5.9.3",
45
- "vite": "^7.1.10",
46
- "vite-plugin-google-apps-script": "^0.4.0",
44
+ "typescript": "^5.9.3",
45
+ "vite": "^7.3.1",
46
+ "vite-plugin-google-apps-script": "^0.4.1",
47
47
  "vite-plugin-singlefile": "^2.3.0",
48
- "vite-tsconfig-paths": "^5.1.4",
49
- "vitest": "^3.2.4"
48
+ "vite-tsconfig-paths": "^6.0.5",
49
+ "vitest": "^4.0.18"
50
50
  }
51
- }
51
+ }
@@ -1,5 +1,3 @@
1
- import path from "node:path";
2
- import alias from "@rollup/plugin-alias";
3
1
  import { defineConfig } from "rolldown";
4
2
  import { removeExportPlugin } from "rolldown-plugin-remove-export";
5
3
 
@@ -11,15 +9,5 @@ export default defineConfig({
11
9
  format: "esm",
12
10
  file: `dist/${outputFile}`,
13
11
  },
14
- plugins: [
15
- alias({
16
- entries: [
17
- {
18
- find: "~",
19
- replacement: path.resolve(__dirname),
20
- },
21
- ],
22
- }),
23
- removeExportPlugin(outputFile),
24
- ],
12
+ plugins: [removeExportPlugin(outputFile)],
25
13
  });
@@ -1,3 +1,13 @@
1
+ import { serialize } from "@ciderjs/gasnuki/json";
2
+
1
3
  export function sayHello(name: string): string {
2
4
  return `Hello, ${name}!`;
3
5
  }
6
+
7
+ export function getHelloMember() {
8
+ return serialize({
9
+ name: "John Doe",
10
+ age: 30,
11
+ isMember: true,
12
+ });
13
+ }
@@ -0,0 +1,19 @@
1
+ // Auto-generated by @ciderjs/city-gas
2
+ // @ts-nocheck
3
+ /* eslint-disable */
4
+ /* biome-ignore: auto generated file */
5
+
6
+ export type RouteNames = "/about" | "/detail/user" | "/";
7
+
8
+ export interface RouteParams {
9
+ "/about": {};
10
+ "/detail/user": { id: string };
11
+ "/": {};
12
+ }
13
+
14
+ declare module "@ciderjs/city-gas" {
15
+ interface Register {
16
+ RouteNames: RouteNames;
17
+ RouteParams: RouteParams;
18
+ }
19
+ }
@@ -0,0 +1,34 @@
1
+ // Auto-generated by @ciderjs/city-gas
2
+ // @ts-nocheck
3
+ /* eslint-disable */
4
+ /* biome-ignore: auto generated file */
5
+
6
+ import { z } from "zod";
7
+ import P_b15baaaf from "../pages/_root.tsx";
8
+ import P_d39c764f from "../pages/about.tsx";
9
+ import P_ccc244b1, { schema as S_ccc244b1 } from "../pages/detail/user.tsx";
10
+ import P_15d2a633 from "../pages/index.tsx";
11
+
12
+ export const pages = {
13
+ "/about": {
14
+ component: P_d39c764f,
15
+ isIndex: false,
16
+ schema: z.object({}),
17
+ },
18
+ "/detail/user": {
19
+ component: P_ccc244b1,
20
+ isIndex: false,
21
+ schema: S_ccc244b1,
22
+ },
23
+ "/": {
24
+ component: P_15d2a633,
25
+ isIndex: true,
26
+ schema: z.object({}),
27
+ },
28
+ };
29
+
30
+ export const specialPages = {
31
+ _root: P_b15baaaf,
32
+ };
33
+
34
+ export const dynamicRoutes = [];
@@ -66,3 +66,46 @@ button:focus-visible {
66
66
  background-color: #f9f9f9;
67
67
  }
68
68
  }
69
+
70
+ #root {
71
+ max-width: 1280px;
72
+ margin: 0 auto;
73
+ padding: 2rem;
74
+ text-align: center;
75
+ }
76
+
77
+ .logo {
78
+ height: 6em;
79
+ padding: 1.5em;
80
+ will-change: filter;
81
+ transition: filter 300ms;
82
+ }
83
+ .logo:hover {
84
+ filter: drop-shadow(0 0 2em #646cffaa);
85
+ }
86
+ .logo.react:hover {
87
+ filter: drop-shadow(0 0 2em #61dafbaa);
88
+ }
89
+
90
+ @keyframes logo-spin {
91
+ from {
92
+ transform: rotate(0deg);
93
+ }
94
+ to {
95
+ transform: rotate(360deg);
96
+ }
97
+ }
98
+
99
+ @media (prefers-reduced-motion: no-preference) {
100
+ a:nth-of-type(2) .logo {
101
+ animation: logo-spin infinite 20s linear;
102
+ }
103
+ }
104
+
105
+ .card {
106
+ padding: 2em;
107
+ }
108
+
109
+ .read-the-docs {
110
+ color: #888;
111
+ }
@@ -1,3 +1,4 @@
1
+ import { serialize } from "@ciderjs/gasnuki/json";
1
2
  import {
2
3
  getPromisedServerScripts,
3
4
  type PartialScriptType,
@@ -8,11 +9,22 @@ import type { ServerScripts } from "~/types/appsscript/client";
8
9
  export const sleep = (ms: number) =>
9
10
  new Promise((resolve) => setTimeout(resolve, ms));
10
11
 
11
- const mockup: PartialScriptType<ServerScripts> = {
12
+ const mockupFunctions: PartialScriptType<ServerScripts> = {
12
13
  sayHello: async (name) => {
13
14
  await sleep(1000);
14
15
  return `Hello, ${name}!`;
15
16
  },
17
+ getHelloMember: async () => {
18
+ await sleep(1000);
19
+ return serialize({
20
+ name: "John Doe",
21
+ age: 30,
22
+ isMember: true,
23
+ });
24
+ },
16
25
  };
17
26
 
18
- export const serverScripts = getPromisedServerScripts<ServerScripts>(mockup);
27
+ export const serverScripts = getPromisedServerScripts<ServerScripts>({
28
+ mockupFunctions,
29
+ parseJson: true,
30
+ });
@@ -1,11 +1,15 @@
1
- import { StrictMode } from "react";
2
- import { createRoot } from "react-dom/client";
1
+ import { createRouter } from "@ciderjs/city-gas";
2
+ import { RouterProvider } from "@ciderjs/city-gas/react";
3
+ import React from "react";
4
+ import ReactDOM from "react-dom/client";
5
+ import { dynamicRoutes, pages, specialPages } from "./generated/routes";
3
6
  import "./index.css";
4
- import App from "./App.tsx";
5
7
 
6
- // biome-ignore lint/style/noNonNullAssertion: root is not null
7
- createRoot(document.getElementById("root")!).render(
8
- <StrictMode>
9
- <App />
10
- </StrictMode>,
8
+ const router = createRouter(pages, { specialPages, dynamicRoutes });
9
+
10
+ // biome-ignore lint/style/noNonNullAssertion: root element is always present
11
+ ReactDOM.createRoot(document.getElementById("root")!).render(
12
+ <React.StrictMode>
13
+ <RouterProvider router={router} />
14
+ </React.StrictMode>,
11
15
  );
@@ -1,11 +1,4 @@
1
- import { createRouter } from "@ciderjs/city-gas";
2
- import {
3
- RouterOutlet,
4
- RouterProvider,
5
- useNavigate,
6
- } from "@ciderjs/city-gas/react";
7
- import { pages } from "@/generated/routes";
8
- import "@/App.css";
1
+ import { useNavigate } from "@ciderjs/city-gas/react";
9
2
 
10
3
  function Navigation() {
11
4
  const navigate = useNavigate();
@@ -35,15 +28,15 @@ function Navigation() {
35
28
  );
36
29
  }
37
30
 
38
- function App() {
39
- const router = createRouter(pages);
40
-
31
+ export default function RootLayout({
32
+ children,
33
+ }: {
34
+ children: React.ReactNode;
35
+ }) {
41
36
  return (
42
- <RouterProvider router={router}>
37
+ <div>
43
38
  <Navigation />
44
- <RouterOutlet />
45
- </RouterProvider>
39
+ <main>{children}</main>
40
+ </div>
46
41
  );
47
42
  }
48
-
49
- export default App;
@@ -2,6 +2,7 @@ export default function Page() {
2
2
  return (
3
3
  <>
4
4
  <h1>About</h1>
5
+ <p>Enjoy your code life!</p>
5
6
  </>
6
7
  );
7
8
  }