@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.
- package/dist/catalog.json +32 -0
- package/dist/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +12 -3
- package/dist/index.d.cts +2 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +12 -4
- package/dist/templates/{react-ciderjs → common}/biome.json.ejs +14 -2
- package/dist/templates/html-js/package.json.ejs +10 -11
- package/dist/templates/html-js/rolldown.config.mjs.ejs +7 -23
- package/dist/templates/react/package.json.ejs +19 -20
- package/dist/templates/react/rolldown.config.ts.ejs +1 -13
- package/dist/templates/react/vite.config.ts.ejs +1 -1
- package/dist/templates/react-ciderjs/gasnuki.config.ts.ejs +7 -0
- package/dist/templates/react-ciderjs/package.json.ejs +23 -23
- package/dist/templates/react-ciderjs/rolldown.config.ts.ejs +1 -13
- package/dist/templates/react-ciderjs/server/modules/hello.ts.ejs +10 -0
- package/dist/templates/react-ciderjs/src/generated/router.d.ts.ejs +19 -0
- package/dist/templates/react-ciderjs/src/generated/routes.ts.ejs +34 -0
- package/dist/templates/react-ciderjs/src/index.css.ejs +43 -0
- package/dist/templates/react-ciderjs/src/lib/server.ts.ejs +14 -2
- package/dist/templates/react-ciderjs/src/main.tsx.ejs +12 -8
- package/dist/templates/react-ciderjs/src/{App.tsx.ejs → pages/_root.tsx.ejs} +9 -16
- package/dist/templates/react-ciderjs/src/pages/about.tsx.ejs +1 -0
- package/dist/templates/react-ciderjs/src/pages/detail/user.tsx.ejs +6 -4
- package/dist/templates/react-ciderjs/src/pages/index.tsx.ejs +13 -2
- package/dist/templates/react-ciderjs/types/appsscript/client.ts.ejs +65 -0
- package/dist/templates/react-ciderjs/vite.config.ts.ejs +2 -6
- package/dist/templates/server-js/package.json.ejs +10 -11
- package/dist/templates/server-js/rolldown.config.mjs.ejs +7 -23
- package/dist/templates/server-js/tests/{main.test.js.ejs → app.test.js.ejs} +1 -1
- package/dist/templates/server-ts/package.json.ejs +11 -12
- package/dist/templates/server-ts/rolldown.config.ts.ejs +3 -19
- package/dist/templates/server-ts/tests/{main.test.ts.ejs → app.test.ts.ejs} +1 -1
- package/dist/templates/vue/package.json.ejs +16 -17
- package/dist/templates/vue/rolldown.config.ts.ejs +1 -13
- package/dist/templates/vue/vite.config.ts.ejs +1 -1
- package/dist/templates/vue-ciderjs/gasnuki.config.ts.ejs +7 -0
- package/dist/templates/vue-ciderjs/package.json.ejs +20 -20
- package/dist/templates/vue-ciderjs/rolldown.config.ts.ejs +1 -13
- package/dist/templates/vue-ciderjs/server/modules/hello.ts.ejs +10 -0
- package/dist/templates/vue-ciderjs/src/components/HelloWorld.vue.ejs +11 -2
- package/dist/templates/vue-ciderjs/src/generated/router.d.ts.ejs +19 -0
- package/dist/templates/vue-ciderjs/src/generated/routes.ts.ejs +34 -0
- package/dist/templates/vue-ciderjs/src/lib/server.ts.ejs +14 -2
- package/dist/templates/vue-ciderjs/src/main.ts.ejs +6 -8
- package/dist/templates/vue-ciderjs/src/pages/detail/user.vue.ejs +3 -2
- package/dist/templates/vue-ciderjs/types/appsscript/client.ts.ejs +65 -0
- package/dist/templates/vue-ciderjs/vite.config.ts.ejs +1 -1
- package/package.json +24 -15
- package/dist/templates/html-js/biome.json.ejs +0 -36
- package/dist/templates/react/biome.json.ejs +0 -43
- package/dist/templates/server-js/biome.json.ejs +0 -36
- package/dist/templates/server-ts/biome.json.ejs +0 -36
- package/dist/templates/vue/biome.json.ejs +0 -35
- package/dist/templates/vue-ciderjs/biome.json.ejs +0 -35
- package/dist/templates/vue-ciderjs/src/App.vue.ejs +0 -7
- /package/dist/templates/server-js/src/{main.js.ejs → app.js.ejs} +0 -0
- /package/dist/templates/server-ts/src/{main.ts.ejs → app.ts.ejs} +0 -0
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { useParams } from "@ciderjs/city-gas/react";
|
|
2
|
+
import { z } from "zod";
|
|
2
3
|
|
|
3
|
-
export const
|
|
4
|
-
id:
|
|
5
|
-
};
|
|
4
|
+
export const schema = z.object({
|
|
5
|
+
id: z.string(),
|
|
6
|
+
});
|
|
6
7
|
|
|
7
8
|
export default function Page() {
|
|
8
|
-
const { id } = useParams
|
|
9
|
+
const { id } = useParams("/detail/user");
|
|
9
10
|
return (
|
|
10
11
|
<>
|
|
11
12
|
<h1>
|
|
12
13
|
Detail of User <code>{id}</code>
|
|
13
14
|
</h1>
|
|
15
|
+
<p>Enjoy your code life!</p>
|
|
14
16
|
</>
|
|
15
17
|
);
|
|
16
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
2
|
import reactLogo from "@/assets/react.svg";
|
|
3
3
|
import { parameters } from "@/lib/parameters";
|
|
4
4
|
import { serverScripts } from "@/lib/server";
|
|
@@ -6,6 +6,11 @@ import viteLogo from "/vite.svg";
|
|
|
6
6
|
|
|
7
7
|
export default function Page() {
|
|
8
8
|
const [count, setCount] = useState(0);
|
|
9
|
+
const [member, setMember] = useState<{
|
|
10
|
+
name: string;
|
|
11
|
+
age: number;
|
|
12
|
+
isMember: boolean;
|
|
13
|
+
} | null>(null);
|
|
9
14
|
const [message, setMessage] = useState("Click to say hello");
|
|
10
15
|
|
|
11
16
|
const { userAddress } = parameters;
|
|
@@ -21,6 +26,12 @@ export default function Page() {
|
|
|
21
26
|
}
|
|
22
27
|
};
|
|
23
28
|
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
serverScripts.getHelloMember().then((result) => {
|
|
31
|
+
setMember(result);
|
|
32
|
+
});
|
|
33
|
+
}, []);
|
|
34
|
+
|
|
24
35
|
return (
|
|
25
36
|
<>
|
|
26
37
|
<div>
|
|
@@ -34,7 +45,7 @@ export default function Page() {
|
|
|
34
45
|
<h1>Vite + React</h1>
|
|
35
46
|
<div className="card">
|
|
36
47
|
<button type="button" onClick={() => setCount((count) => count + 1)}>
|
|
37
|
-
count is {count}
|
|
48
|
+
count is {count} by {member?.name ?? "guest"}
|
|
38
49
|
</button>
|
|
39
50
|
<button
|
|
40
51
|
type="button"
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Auto-generated by gasnuki
|
|
2
|
+
// Do NOT edit this file manually.
|
|
3
|
+
|
|
4
|
+
import type { JsonString } from "../../../../../gasnuki/dist/json";
|
|
5
|
+
|
|
6
|
+
export type ServerScripts = {
|
|
7
|
+
sayHello(name: string): string;
|
|
8
|
+
|
|
9
|
+
getHelloMember(): JsonString<{
|
|
10
|
+
name: string;
|
|
11
|
+
age: number;
|
|
12
|
+
isMember: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// Auto-generated Types for GoogleAppsScript in client-side code
|
|
17
|
+
|
|
18
|
+
export type RemoveReturnType<T> = {
|
|
19
|
+
[P in keyof T]: T[P] extends (...args: infer A) => any
|
|
20
|
+
? (...args: A) => void
|
|
21
|
+
: T[P];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
type _AppsScriptRun = RemoveReturnType<ServerScripts> & {
|
|
25
|
+
[key: string]: (...args: any[]) => any;
|
|
26
|
+
withSuccessHandler: <T = string | number | boolean | undefined, U = any>(
|
|
27
|
+
callback: (returnValues: T, userObject?: U) => void,
|
|
28
|
+
) => _AppsScriptRun;
|
|
29
|
+
withFailureHandler: <U = any>(
|
|
30
|
+
callback: (error: Error, userObject?: U) => void,
|
|
31
|
+
) => _AppsScriptRun;
|
|
32
|
+
withUserObject: <U = any>(userObject: U) => _AppsScriptRun;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
type _AppsScriptHistoryFunction = (
|
|
36
|
+
stateObject: object,
|
|
37
|
+
params: object,
|
|
38
|
+
hash: string,
|
|
39
|
+
) => void;
|
|
40
|
+
|
|
41
|
+
interface _WebAppLocationType {
|
|
42
|
+
hash: string;
|
|
43
|
+
parameter: Record<string, string>;
|
|
44
|
+
parameters: Record<string, string[]>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export declare interface GoogleClientSideApi {
|
|
48
|
+
script: {
|
|
49
|
+
run: _AppsScriptRun;
|
|
50
|
+
url: {
|
|
51
|
+
getLocation: (callback: (location: _WebAppLocationType) => void) => void;
|
|
52
|
+
};
|
|
53
|
+
history: {
|
|
54
|
+
push: _AppsScriptHistoryFunction;
|
|
55
|
+
replace: _AppsScriptHistoryFunction;
|
|
56
|
+
setChangeHandler: (
|
|
57
|
+
callback: (e: { state: object; location: _WebAppLocationType }) => void,
|
|
58
|
+
) => void;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare global {
|
|
64
|
+
const google: GoogleClientSideApi;
|
|
65
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="vitest" />
|
|
1
|
+
/// <reference types="vitest/config" />
|
|
2
2
|
|
|
3
3
|
import { cityGasRouter } from "@ciderjs/city-gas/plugin";
|
|
4
4
|
import { gasnuki } from "@ciderjs/gasnuki/vite";
|
|
@@ -22,11 +22,7 @@ export default defineConfig({
|
|
|
22
22
|
react(),
|
|
23
23
|
tsconfigPaths(),
|
|
24
24
|
cityGasRouter(),
|
|
25
|
-
gasnuki(
|
|
26
|
-
srcDir: "server",
|
|
27
|
-
outDir: "types/appsscript",
|
|
28
|
-
outputFile: "client.ts",
|
|
29
|
-
}),
|
|
25
|
+
gasnuki(),
|
|
30
26
|
gas(),
|
|
31
27
|
viteSingleFile(),
|
|
32
28
|
],
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./dist/
|
|
6
|
+
"main": "./dist/app.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"check": "biome check --write",
|
|
9
9
|
"build": "tsc && rolldown -c && cpy src/*.json dist/",
|
|
@@ -11,16 +11,15 @@
|
|
|
11
11
|
"push": "clasp push"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@biomejs/biome": "^2.3.
|
|
15
|
-
"@google/clasp": "^3.1.
|
|
16
|
-
"@
|
|
17
|
-
"@types/
|
|
18
|
-
"@
|
|
19
|
-
"@vitest/coverage-v8": "4.0.8",
|
|
14
|
+
"@biomejs/biome": "^2.3.13",
|
|
15
|
+
"@google/clasp": "^3.1.3",
|
|
16
|
+
"@types/google-apps-script": "^2.0.8",
|
|
17
|
+
"@types/node": "^25.1.0",
|
|
18
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
20
19
|
"cpy-cli": "^6.0.0",
|
|
21
|
-
"rolldown": "1.0.0-
|
|
20
|
+
"rolldown": "1.0.0-rc.2",
|
|
22
21
|
"rolldown-plugin-remove-export": "^0.1.3",
|
|
23
|
-
"vite-tsconfig-paths": "^
|
|
24
|
-
"vitest": "^4.0.
|
|
22
|
+
"vite-tsconfig-paths": "^6.0.5",
|
|
23
|
+
"vitest": "^4.0.18"
|
|
25
24
|
}
|
|
26
|
-
}
|
|
25
|
+
}
|
|
@@ -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 = "
|
|
4
|
+
const outputFile = "app.js";
|
|
7
5
|
|
|
8
6
|
export default defineConfig({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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: "src/app.js",
|
|
8
|
+
output: {
|
|
9
|
+
format: "esm",
|
|
10
|
+
file: `dist/${outputFile}`,
|
|
11
|
+
},
|
|
12
|
+
plugins: [removeExportPlugin(outputFile)],
|
|
29
13
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./dist/
|
|
6
|
+
"main": "./dist/app.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"check": "biome check --write",
|
|
9
9
|
"build": "tsc && rolldown -c && cpy src/*.json dist/",
|
|
@@ -11,17 +11,16 @@
|
|
|
11
11
|
"push": "clasp push"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@biomejs/biome": "^2.3.
|
|
15
|
-
"@google/clasp": "^3.1.
|
|
16
|
-
"@
|
|
17
|
-
"@types/
|
|
18
|
-
"@
|
|
19
|
-
"@vitest/coverage-v8": "4.0.8",
|
|
14
|
+
"@biomejs/biome": "^2.3.13",
|
|
15
|
+
"@google/clasp": "^3.1.3",
|
|
16
|
+
"@types/google-apps-script": "^2.0.8",
|
|
17
|
+
"@types/node": "^25.1.0",
|
|
18
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
20
19
|
"cpy-cli": "^6.0.0",
|
|
21
|
-
"rolldown": "1.0.0-
|
|
20
|
+
"rolldown": "1.0.0-rc.2",
|
|
22
21
|
"rolldown-plugin-remove-export": "^0.1.3",
|
|
23
|
-
"typescript": "
|
|
24
|
-
"vite-tsconfig-paths": "^
|
|
25
|
-
"vitest": "^4.0.
|
|
22
|
+
"typescript": "^5.9.3",
|
|
23
|
+
"vite-tsconfig-paths": "^6.0.5",
|
|
24
|
+
"vitest": "^4.0.18"
|
|
26
25
|
}
|
|
27
|
-
}
|
|
26
|
+
}
|
|
@@ -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 = "
|
|
4
|
+
const outputFile = "app.js";
|
|
7
5
|
|
|
8
6
|
export default defineConfig({
|
|
9
|
-
input: "src/
|
|
7
|
+
input: "src/app.ts",
|
|
10
8
|
output: {
|
|
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, "src"),
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
find: "~",
|
|
23
|
-
replacement: path.resolve(__dirname),
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
}),
|
|
27
|
-
removeExportPlugin(outputFile),
|
|
28
|
-
],
|
|
12
|
+
plugins: [removeExportPlugin(outputFile)],
|
|
29
13
|
});
|
|
@@ -17,29 +17,28 @@
|
|
|
17
17
|
"preview:web": "clasp open-web-app"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"vue": "^3.5.
|
|
20
|
+
"vue": "^3.5.27"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@biomejs/biome": "^2.3.
|
|
24
|
-
"@google/clasp": "^3.1.
|
|
25
|
-
"@
|
|
26
|
-
"@types/
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
29
|
-
"@vitest/coverage-v8": "^4.0.8",
|
|
23
|
+
"@biomejs/biome": "^2.3.13",
|
|
24
|
+
"@google/clasp": "^3.1.3",
|
|
25
|
+
"@types/google-apps-script": "^2.0.8",
|
|
26
|
+
"@types/node": "^25.1.0",
|
|
27
|
+
"@vitejs/plugin-vue": "^6.0.3",
|
|
28
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
30
29
|
"@vue/tsconfig": "^0.8.1",
|
|
31
30
|
"cpy-cli": "^6.0.0",
|
|
32
31
|
"cross-var": "^1.1.0",
|
|
33
32
|
"dotenv-cli": "^11.0.0",
|
|
34
|
-
"rimraf": "^6.1.
|
|
35
|
-
"rolldown": "1.0.0-
|
|
33
|
+
"rimraf": "^6.1.2",
|
|
34
|
+
"rolldown": "1.0.0-rc.2",
|
|
36
35
|
"rolldown-plugin-remove-export": "^0.1.3",
|
|
37
|
-
"typescript": "
|
|
38
|
-
"vite": "^7.1
|
|
39
|
-
"vite-plugin-google-apps-script": "^0.4.
|
|
36
|
+
"typescript": "^5.9.3",
|
|
37
|
+
"vite": "^7.3.1",
|
|
38
|
+
"vite-plugin-google-apps-script": "^0.4.1",
|
|
40
39
|
"vite-plugin-singlefile": "^2.3.0",
|
|
41
|
-
"vite-tsconfig-paths": "^
|
|
42
|
-
"vitest": "^4.0.
|
|
43
|
-
"vue-tsc": "^3.
|
|
40
|
+
"vite-tsconfig-paths": "^6.0.5",
|
|
41
|
+
"vitest": "^4.0.18",
|
|
42
|
+
"vue-tsc": "^3.2.4"
|
|
44
43
|
}
|
|
45
|
-
}
|
|
44
|
+
}
|
|
@@ -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
|
});
|
|
@@ -19,32 +19,32 @@
|
|
|
19
19
|
"preview:web": "clasp open-web-app"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@ciderjs/city-gas": "^
|
|
23
|
-
"@ciderjs/gasnuki": "^0.
|
|
24
|
-
"vue": "^3.5.
|
|
22
|
+
"@ciderjs/city-gas": "^1.1.0",
|
|
23
|
+
"@ciderjs/gasnuki": "^0.5.5",
|
|
24
|
+
"vue": "^3.5.27",
|
|
25
|
+
"zod": "^4.3.6"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
|
-
"@biomejs/biome": "^2.3.
|
|
28
|
-
"@ciderjs/clasp-auth": "^0.
|
|
29
|
-
"@google/clasp": "^3.1.
|
|
30
|
-
"@
|
|
31
|
-
"@types/
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@vitest/coverage-v8": "^4.0.8",
|
|
28
|
+
"@biomejs/biome": "^2.3.13",
|
|
29
|
+
"@ciderjs/clasp-auth": "^0.2.0",
|
|
30
|
+
"@google/clasp": "^3.1.3",
|
|
31
|
+
"@types/google-apps-script": "^2.0.8",
|
|
32
|
+
"@types/node": "^25.1.0",
|
|
33
|
+
"@vitejs/plugin-vue": "^6.0.3",
|
|
34
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
35
35
|
"@vue/tsconfig": "^0.8.1",
|
|
36
36
|
"cpy-cli": "^6.0.0",
|
|
37
37
|
"cross-var": "^1.1.0",
|
|
38
38
|
"dotenv-cli": "^11.0.0",
|
|
39
|
-
"rimraf": "^6.1.
|
|
40
|
-
"rolldown": "1.0.0-
|
|
39
|
+
"rimraf": "^6.1.2",
|
|
40
|
+
"rolldown": "1.0.0-rc.2",
|
|
41
41
|
"rolldown-plugin-remove-export": "^0.1.3",
|
|
42
|
-
"typescript": "
|
|
43
|
-
"vite": "^7.1
|
|
44
|
-
"vite-plugin-google-apps-script": "^0.4.
|
|
42
|
+
"typescript": "^5.9.3",
|
|
43
|
+
"vite": "^7.3.1",
|
|
44
|
+
"vite-plugin-google-apps-script": "^0.4.1",
|
|
45
45
|
"vite-plugin-singlefile": "^2.3.0",
|
|
46
|
-
"vite-tsconfig-paths": "^
|
|
47
|
-
"vitest": "^4.0.
|
|
48
|
-
"vue-tsc": "^3.
|
|
46
|
+
"vite-tsconfig-paths": "^6.0.5",
|
|
47
|
+
"vitest": "^4.0.18",
|
|
48
|
+
"vue-tsc": "^3.2.4"
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ref } from "vue";
|
|
2
|
+
import { onMounted, ref } from "vue";
|
|
3
3
|
import { parameters } from "@/lib/parameters";
|
|
4
4
|
import { serverScripts } from "@/lib/server";
|
|
5
5
|
|
|
@@ -9,6 +9,11 @@ const { userAddress } = parameters;
|
|
|
9
9
|
|
|
10
10
|
const count = ref(0);
|
|
11
11
|
const message = ref("Click to say hello");
|
|
12
|
+
const member = ref<{
|
|
13
|
+
name: string;
|
|
14
|
+
age: number;
|
|
15
|
+
isMember: boolean;
|
|
16
|
+
} | null>(null);
|
|
12
17
|
|
|
13
18
|
const handleHelloButton = async () => {
|
|
14
19
|
message.value = "Waiting...";
|
|
@@ -19,13 +24,17 @@ const handleHelloButton = async () => {
|
|
|
19
24
|
message.value = "Error. Check the console.";
|
|
20
25
|
}
|
|
21
26
|
};
|
|
27
|
+
|
|
28
|
+
onMounted(async () => {
|
|
29
|
+
member.value = await serverScripts.getHelloMember();
|
|
30
|
+
});
|
|
22
31
|
</script>
|
|
23
32
|
|
|
24
33
|
<template>
|
|
25
34
|
<h1>{{ msg }}</h1>
|
|
26
35
|
|
|
27
36
|
<div class="card">
|
|
28
|
-
<button type="button" @click="count++">count is {{ count }}</button>
|
|
37
|
+
<button type="button" @click="count++">count is {{ count }} by {{ member?.name ?? 'Unknown' }}</button>
|
|
29
38
|
<button type="button" @click="handleHelloButton" :style="{ marginLeft: '10px' }">
|
|
30
39
|
{{ message }}
|
|
31
40
|
</button>
|
|
@@ -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_dcf30a05 from "../pages/_root.vue";
|
|
8
|
+
import P_47cca741 from "../pages/about.vue";
|
|
9
|
+
import P_304faeaa, { schema as S_304faeaa } from "../pages/detail/user.vue";
|
|
10
|
+
import P_8661b8c2 from "../pages/index.vue";
|
|
11
|
+
|
|
12
|
+
export const pages = {
|
|
13
|
+
"/about": {
|
|
14
|
+
component: P_47cca741,
|
|
15
|
+
isIndex: false,
|
|
16
|
+
schema: z.object({}),
|
|
17
|
+
},
|
|
18
|
+
"/detail/user": {
|
|
19
|
+
component: P_304faeaa,
|
|
20
|
+
isIndex: false,
|
|
21
|
+
schema: S_304faeaa,
|
|
22
|
+
},
|
|
23
|
+
"/": {
|
|
24
|
+
component: P_8661b8c2,
|
|
25
|
+
isIndex: true,
|
|
26
|
+
schema: z.object({}),
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const specialPages = {
|
|
31
|
+
_root: P_dcf30a05,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const dynamicRoutes = [];
|
|
@@ -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
|
|
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>(
|
|
27
|
+
export const serverScripts = getPromisedServerScripts<ServerScripts>({
|
|
28
|
+
mockupFunctions,
|
|
29
|
+
parseJson: true,
|
|
30
|
+
});
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { createRouter } from "@ciderjs/city-gas";
|
|
2
|
-
import { createRouterPlugin } from "@ciderjs/city-gas/vue";
|
|
2
|
+
import { createRouterPlugin, RouterOutlet } from "@ciderjs/city-gas/vue";
|
|
3
3
|
import { createApp } from "vue";
|
|
4
|
+
import { dynamicRoutes, pages, specialPages } from "./generated/routes";
|
|
4
5
|
import "@/style.css";
|
|
5
|
-
import App from "@/App.vue";
|
|
6
|
-
import { pages, specialPages } from "@/generated/routes";
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
createApp(App).use(createRouterPlugin(router)).mount("#app");
|
|
11
|
-
}
|
|
7
|
+
const router = createRouter(pages, { specialPages, dynamicRoutes });
|
|
8
|
+
const app = createApp(RouterOutlet);
|
|
12
9
|
|
|
13
|
-
|
|
10
|
+
app.use(createRouterPlugin(router));
|
|
11
|
+
app.mount("#app");
|
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
<script setup lang="ts">
|
|
9
9
|
import { useParams } from "@ciderjs/city-gas/vue";
|
|
10
10
|
|
|
11
|
-
const params = useParams
|
|
11
|
+
const params = useParams("/detail/user");
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<script lang="ts">
|
|
15
|
-
|
|
15
|
+
import {z} from 'zod';
|
|
16
|
+
export const schema = z.object({ id: z.string() });
|
|
16
17
|
</script>
|