@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.
- package/README.ja.md +9 -4
- package/README.md +9 -4
- package/dist/cli.cjs +46 -5
- package/dist/cli.mjs +46 -5
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/templates/html-js/biome.json.ejs +36 -0
- package/dist/templates/html-js/index.html.ejs +13 -0
- package/dist/templates/html-js/package.json.ejs +33 -0
- package/dist/templates/html-js/rolldown.config.mjs.ejs +29 -0
- package/dist/templates/html-js/server/app.js.ejs +27 -0
- package/dist/templates/html-js/server/modules/hello.js.ejs +3 -0
- package/dist/templates/html-js/src/counter.js.ejs +9 -0
- package/dist/templates/html-js/src/javascript.svg.ejs +1 -0
- package/dist/templates/html-js/src/main.js.ejs +27 -0
- package/dist/templates/html-js/src/say.js.ejs +23 -0
- package/dist/templates/html-js/src/style.css.ejs +96 -0
- package/dist/templates/html-js/tsconfig.json.ejs +34 -0
- package/dist/templates/html-js/vitest.config.js.ejs +11 -0
- package/dist/templates/react/.env.ejs +1 -0
- package/dist/templates/{react-tsx → react}/README.md.ejs +0 -1
- package/dist/templates/react/biome.json.ejs +43 -0
- package/dist/templates/react/index.html.ejs +13 -0
- package/dist/templates/{react-tsx → react}/package.json.ejs +0 -2
- package/dist/templates/react/public/vite.svg.ejs +1 -0
- package/dist/templates/react/rolldown.config.ts.ejs +25 -0
- package/dist/templates/react/server/app.ts.ejs +29 -0
- package/dist/templates/react/server/appsscript.json.ejs +12 -0
- package/dist/templates/react/server/modules/hello.ts.ejs +3 -0
- package/dist/templates/react/src/App.css.ejs +42 -0
- package/dist/templates/react/src/App.tsx.ejs +63 -0
- package/dist/templates/react/src/assets/react.svg.ejs +1 -0
- package/dist/templates/react/src/index.css.ejs +68 -0
- package/dist/templates/react/src/lib/parameters.ts.ejs +20 -0
- package/dist/templates/react/src/main.tsx.ejs +11 -0
- package/dist/templates/react/src/vite-env.d.ts.ejs +1 -0
- package/dist/templates/react/tests/server/modules/hello.spec.ts.ejs +9 -0
- package/dist/templates/react/tsconfig.app.json.ejs +31 -0
- package/dist/templates/react/tsconfig.json.ejs +13 -0
- package/dist/templates/react/tsconfig.node.json.ejs +25 -0
- package/dist/templates/{react-tsx → react}/types/appsscript/client.ts.ejs +2 -15
- package/dist/templates/react/types/appsscript/server.ts.ejs +10 -0
- package/dist/templates/react/vite.config.ts.ejs +20 -0
- package/dist/templates/react-ciderjs/.github/workflows/appsscript.yml.ejs +45 -0
- package/dist/templates/react-ciderjs/README.md.ejs +20 -0
- package/dist/templates/{react-tsx → react-ciderjs}/biome.json.ejs +3 -25
- package/dist/templates/react-ciderjs/package.json.ejs +51 -0
- package/dist/templates/react-ciderjs/public/vite.svg.ejs +1 -0
- package/dist/templates/react-ciderjs/rolldown.config.ts.ejs +25 -0
- package/dist/templates/{react-tsx → react-ciderjs}/server/app.ts.ejs +6 -6
- package/dist/templates/react-ciderjs/server/appsscript.json.ejs +12 -0
- package/dist/templates/react-ciderjs/src/App.tsx.ejs +49 -0
- package/dist/templates/{react-tsx → react-ciderjs}/src/lib/parameters.ts.ejs +4 -4
- package/dist/templates/{react-tsx → react-ciderjs}/src/lib/server.ts.ejs +2 -2
- package/dist/templates/react-ciderjs/src/main.tsx.ejs +11 -0
- package/dist/templates/react-ciderjs/src/pages/about.tsx.ejs +7 -0
- package/dist/templates/react-ciderjs/src/pages/detail/user.tsx.ejs +16 -0
- package/dist/templates/{react-tsx/src/App.tsx.ejs → react-ciderjs/src/pages/index.tsx.ejs} +10 -13
- package/dist/templates/react-ciderjs/tests/server/modules/hello.spec.ts.ejs +9 -0
- package/dist/templates/react-ciderjs/tests/src/lib/server.spec.ts.ejs +8 -0
- package/dist/templates/react-ciderjs/vite.config.ts.ejs +33 -0
- package/dist/templates/server-js/biome.json.ejs +36 -0
- package/dist/templates/server-js/package.json.ejs +26 -0
- package/dist/templates/server-js/rolldown.config.mjs.ejs +29 -0
- package/dist/templates/server-js/src/main.js.ejs +5 -0
- package/dist/templates/server-js/src/modules/hello.js.ejs +3 -0
- package/dist/templates/server-js/tests/main.test.js.ejs +15 -0
- package/dist/templates/server-js/tsconfig.json.ejs +34 -0
- package/dist/templates/server-js/vitest.config.js.ejs +11 -0
- package/dist/templates/server-ts/.clasp.json.ejs +5 -0
- package/dist/templates/server-ts/README.md.ejs +7 -0
- package/dist/templates/{vanilla-ts → server-ts}/biome.json.ejs +2 -2
- package/dist/templates/{vanilla-ts → server-ts}/package.json.ejs +8 -9
- package/dist/templates/server-ts/rolldown.config.ts.ejs +29 -0
- package/dist/templates/server-ts/src/appsscript.json.ejs +8 -0
- package/dist/templates/server-ts/src/main.ts.ejs +5 -0
- package/dist/templates/server-ts/tests/main.test.ts.ejs +15 -0
- package/dist/templates/server-ts/vitest.config.ts.ejs +11 -0
- package/dist/templates/vue/.clasp.json.ejs +5 -0
- package/dist/templates/vue/.env.ejs +1 -0
- package/dist/templates/vue/.vscode/extensions.json.ejs +3 -0
- package/dist/templates/vue/README.md.ejs +5 -0
- package/dist/templates/vue/biome.json.ejs +35 -0
- package/dist/templates/vue/index.html.ejs +13 -0
- package/dist/templates/vue/package.json.ejs +45 -0
- package/dist/templates/vue/public/vite.svg.ejs +1 -0
- package/dist/templates/vue/rolldown.config.ts.ejs +25 -0
- package/dist/templates/vue/server/app.ts.ejs +29 -0
- package/dist/templates/vue/server/appsscript.json.ejs +12 -0
- package/dist/templates/vue/server/modules/hello.ts.ejs +3 -0
- package/dist/templates/vue/src/App.vue.ejs +30 -0
- package/dist/templates/vue/src/assets/vue.svg.ejs +1 -0
- package/dist/templates/vue/src/components/HelloWorld.vue.ejs +60 -0
- package/dist/templates/vue/src/lib/parameters.ts.ejs +20 -0
- package/dist/templates/vue/src/main.ts.ejs +5 -0
- package/dist/templates/vue/src/style.css.ejs +79 -0
- package/dist/templates/vue/tests/server/modules/hello.spec.ts.ejs +9 -0
- package/dist/templates/vue/tsconfig.app.json.ejs +21 -0
- package/dist/templates/vue/tsconfig.json.ejs +13 -0
- package/dist/templates/vue/tsconfig.node.json.ejs +26 -0
- package/dist/templates/vue/types/appsscript/client.ts.ejs +44 -0
- package/dist/templates/vue/types/appsscript/server.ts.ejs +10 -0
- package/dist/templates/vue/vite.config.ts.ejs +19 -0
- package/dist/templates/vue-ciderjs/.clasp.json.ejs +5 -0
- package/dist/templates/vue-ciderjs/.env.ejs +1 -0
- package/dist/templates/vue-ciderjs/.vscode/extensions.json.ejs +3 -0
- package/dist/templates/vue-ciderjs/README.md.ejs +14 -0
- package/dist/templates/vue-ciderjs/biome.json.ejs +35 -0
- package/dist/templates/vue-ciderjs/index.html.ejs +13 -0
- package/dist/templates/vue-ciderjs/package.json.ejs +50 -0
- package/dist/templates/vue-ciderjs/public/vite.svg.ejs +1 -0
- package/dist/templates/vue-ciderjs/rolldown.config.ts.ejs +25 -0
- package/dist/templates/vue-ciderjs/server/app.ts.ejs +29 -0
- package/dist/templates/vue-ciderjs/server/appsscript.json.ejs +12 -0
- package/dist/templates/vue-ciderjs/server/modules/hello.ts.ejs +3 -0
- package/dist/templates/vue-ciderjs/src/App.vue.ejs +7 -0
- package/dist/templates/vue-ciderjs/src/assets/vue.svg.ejs +1 -0
- package/dist/templates/vue-ciderjs/src/components/HelloWorld.vue.ejs +54 -0
- package/dist/templates/vue-ciderjs/src/components/Navigation.vue.ejs +23 -0
- package/dist/templates/vue-ciderjs/src/lib/parameters.ts.ejs +20 -0
- package/dist/templates/vue-ciderjs/src/lib/server.ts.ejs +18 -0
- package/dist/templates/vue-ciderjs/src/main.ts.ejs +13 -0
- package/dist/templates/vue-ciderjs/src/pages/_root.vue.ejs +40 -0
- package/dist/templates/vue-ciderjs/src/pages/about.vue.ejs +9 -0
- package/dist/templates/vue-ciderjs/src/pages/detail/user.vue.ejs +16 -0
- package/dist/templates/vue-ciderjs/src/pages/index.vue.ejs +7 -0
- package/dist/templates/vue-ciderjs/src/style.css.ejs +79 -0
- package/dist/templates/vue-ciderjs/tests/server/modules/hello.spec.ts.ejs +9 -0
- package/dist/templates/vue-ciderjs/tests/src/lib/server.spec.ts.ejs +8 -0
- package/dist/templates/vue-ciderjs/tsconfig.app.json.ejs +21 -0
- package/dist/templates/vue-ciderjs/tsconfig.json.ejs +13 -0
- package/dist/templates/vue-ciderjs/tsconfig.node.json.ejs +26 -0
- package/dist/templates/vue-ciderjs/types/appsscript/server.ts.ejs +10 -0
- package/dist/templates/vue-ciderjs/vite.config.ts.ejs +27 -0
- package/package.json +17 -12
- package/dist/templates/react-tsx/rolldown.config.ts.ejs +0 -25
- package/dist/templates/react-tsx/src/main.tsx.ejs +0 -11
- package/dist/templates/react-tsx/tests/server/modules/hello.spec.ts.ejs +0 -9
- package/dist/templates/react-tsx/tests/src/lib/server.spec.ts.ejs +0 -8
- package/dist/templates/react-tsx/vite.config.ts.ejs +0 -31
- package/dist/templates/vanilla-ts/rolldown.config.ts.ejs +0 -29
- package/dist/templates/vanilla-ts/src/main.ts.ejs +0 -5
- package/dist/templates/vanilla-ts/tests/main.test.ts.ejs +0 -15
- package/dist/templates/vanilla-ts/vitest.config.ts.ejs +0 -11
- /package/dist/templates/{react-tsx → html-js}/public/vite.svg.ejs +0 -0
- /package/dist/templates/{react-tsx → html-js}/server/appsscript.json.ejs +0 -0
- /package/dist/templates/{vanilla-ts → react}/.clasp.json.ejs +0 -0
- /package/dist/templates/{react-tsx → react-ciderjs}/.clasp.json.ejs +0 -0
- /package/dist/templates/{react-tsx → react-ciderjs}/.env.ejs +0 -0
- /package/dist/templates/{react-tsx → react-ciderjs}/index.html.ejs +0 -0
- /package/dist/templates/{react-tsx → react-ciderjs}/server/modules/hello.ts.ejs +0 -0
- /package/dist/templates/{react-tsx → react-ciderjs}/src/App.css.ejs +0 -0
- /package/dist/templates/{react-tsx → react-ciderjs}/src/assets/react.svg.ejs +0 -0
- /package/dist/templates/{react-tsx → react-ciderjs}/src/index.css.ejs +0 -0
- /package/dist/templates/{react-tsx → react-ciderjs}/src/vite-env.d.ts.ejs +0 -0
- /package/dist/templates/{react-tsx → react-ciderjs}/tsconfig.app.json.ejs +0 -0
- /package/dist/templates/{react-tsx → react-ciderjs}/tsconfig.json.ejs +0 -0
- /package/dist/templates/{react-tsx → react-ciderjs}/tsconfig.node.json.ejs +0 -0
- /package/dist/templates/{react-tsx → react-ciderjs}/types/appsscript/server.ts.ejs +0 -0
- /package/dist/templates/{vanilla-ts → server-js}/README.md.ejs +0 -0
- /package/dist/templates/{vanilla-ts → server-js}/src/appsscript.json.ejs +0 -0
- /package/dist/templates/{vanilla-ts → server-ts}/src/modules/hello.ts.ejs +0 -0
- /package/dist/templates/{vanilla-ts → server-ts}/tsconfig.json.ejs +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { ServerParams, WebAppParams } from
|
|
1
|
+
import type { ServerParams, WebAppParams } from "~/types/appsscript/server";
|
|
2
2
|
|
|
3
|
-
export * from
|
|
3
|
+
export * from "./modules/hello";
|
|
4
4
|
|
|
5
|
-
const SITE_TITLE =
|
|
5
|
+
const SITE_TITLE = "<%= projectName %>";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Procedure to handle GET requests when published as a web app
|
|
9
9
|
*/
|
|
10
10
|
export function doGet(e: WebAppParams) {
|
|
11
|
-
const htmlTemplate = HtmlService.createTemplateFromFile(
|
|
11
|
+
const htmlTemplate = HtmlService.createTemplateFromFile("index");
|
|
12
12
|
const title = SITE_TITLE;
|
|
13
13
|
const userAddress = Session.getActiveUser().getEmail();
|
|
14
14
|
|
|
@@ -22,8 +22,8 @@ export function doGet(e: WebAppParams) {
|
|
|
22
22
|
const htmlOutput = htmlTemplate.evaluate();
|
|
23
23
|
htmlOutput.setTitle(title);
|
|
24
24
|
htmlOutput.addMetaTag(
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
"viewport",
|
|
26
|
+
"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui",
|
|
27
27
|
);
|
|
28
28
|
return htmlOutput;
|
|
29
29
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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";
|
|
9
|
+
|
|
10
|
+
function Navigation() {
|
|
11
|
+
const navigate = useNavigate();
|
|
12
|
+
return (
|
|
13
|
+
<div style={{ marginBottom: "1rem" }}>
|
|
14
|
+
<button
|
|
15
|
+
type="button"
|
|
16
|
+
style={{ marginRight: "1rem" }}
|
|
17
|
+
onClick={() => navigate("/")}
|
|
18
|
+
>
|
|
19
|
+
Home
|
|
20
|
+
</button>
|
|
21
|
+
<button
|
|
22
|
+
type="button"
|
|
23
|
+
style={{ marginRight: "1rem" }}
|
|
24
|
+
onClick={() => navigate("/about")}
|
|
25
|
+
>
|
|
26
|
+
About
|
|
27
|
+
</button>
|
|
28
|
+
<button
|
|
29
|
+
type="button"
|
|
30
|
+
onClick={() => navigate("/detail/user", { id: "1" })}
|
|
31
|
+
>
|
|
32
|
+
Detail of User <code>1</code>
|
|
33
|
+
</button>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function App() {
|
|
39
|
+
const router = createRouter(pages);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<RouterProvider router={router}>
|
|
43
|
+
<Navigation />
|
|
44
|
+
<RouterOutlet />
|
|
45
|
+
</RouterProvider>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default App;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ServerParams } from
|
|
1
|
+
import type { ServerParams } from "~/types/appsscript/server";
|
|
2
2
|
|
|
3
3
|
let parameters: ServerParams = {} as ServerParams;
|
|
4
4
|
|
|
5
5
|
try {
|
|
6
|
-
const parametersJson =
|
|
6
|
+
const parametersJson = "<?!= JSON.stringify(parameters) ?>";
|
|
7
7
|
parameters = JSON.parse(
|
|
8
8
|
parametersJson.slice(1, parametersJson.length - 1).replace(/\\"/g, '"'),
|
|
9
9
|
);
|
|
@@ -12,8 +12,8 @@ try {
|
|
|
12
12
|
parameters = {
|
|
13
13
|
...parameters,
|
|
14
14
|
parameter: {},
|
|
15
|
-
siteTitle:
|
|
16
|
-
userAddress:
|
|
15
|
+
siteTitle: "Mockup Site Title",
|
|
16
|
+
userAddress: "mock-user@example.com",
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getPromisedServerScripts,
|
|
3
3
|
type PartialScriptType,
|
|
4
|
-
} from
|
|
5
|
-
import type { ServerScripts } from
|
|
4
|
+
} from "@ciderjs/gasnuki/promise";
|
|
5
|
+
import type { ServerScripts } from "~/types/appsscript/client";
|
|
6
6
|
|
|
7
7
|
// mockup function to simulate as fetching appsscript time
|
|
8
8
|
export const sleep = (ms: number) =>
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useParams } from "@ciderjs/city-gas/react";
|
|
2
|
+
|
|
3
|
+
export const params = {
|
|
4
|
+
id: "string",
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export default function Page() {
|
|
8
|
+
const { id } = useParams<"/detail/user">();
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<h1>
|
|
12
|
+
Detail of User <code>{id}</code>
|
|
13
|
+
</h1>
|
|
14
|
+
</>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { useState } from
|
|
2
|
-
import reactLogo from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { serverScripts } from '@/lib/server';
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import reactLogo from "@/assets/react.svg";
|
|
3
|
+
import { parameters } from "@/lib/parameters";
|
|
4
|
+
import { serverScripts } from "@/lib/server";
|
|
5
|
+
import viteLogo from "/vite.svg";
|
|
7
6
|
|
|
8
|
-
function
|
|
7
|
+
export default function Page() {
|
|
9
8
|
const [count, setCount] = useState(0);
|
|
10
|
-
const [message, setMessage] = useState(
|
|
9
|
+
const [message, setMessage] = useState("Click to say hello");
|
|
11
10
|
|
|
12
11
|
const { userAddress } = parameters;
|
|
13
12
|
|
|
14
13
|
const handleHelloButton = async () => {
|
|
15
14
|
try {
|
|
16
|
-
setMessage(
|
|
15
|
+
setMessage("Waiting...");
|
|
17
16
|
const result = await serverScripts.sayHello(userAddress);
|
|
18
17
|
setMessage(result);
|
|
19
18
|
} catch (error) {
|
|
20
19
|
console.error(error);
|
|
21
|
-
setMessage(
|
|
20
|
+
setMessage("Error. Check the console.");
|
|
22
21
|
}
|
|
23
22
|
};
|
|
24
23
|
|
|
@@ -40,7 +39,7 @@ function App() {
|
|
|
40
39
|
<button
|
|
41
40
|
type="button"
|
|
42
41
|
onClick={handleHelloButton}
|
|
43
|
-
style={{ marginLeft:
|
|
42
|
+
style={{ marginLeft: "10px" }}
|
|
44
43
|
>
|
|
45
44
|
{message}
|
|
46
45
|
</button>
|
|
@@ -54,5 +53,3 @@ function App() {
|
|
|
54
53
|
</>
|
|
55
54
|
);
|
|
56
55
|
}
|
|
57
|
-
|
|
58
|
-
export default App;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="vitest" />
|
|
2
|
+
|
|
3
|
+
import { cityGasRouter } from "@ciderjs/city-gas/plugin";
|
|
4
|
+
import { gasnuki } from "@ciderjs/gasnuki/vite";
|
|
5
|
+
import react from "@vitejs/plugin-react";
|
|
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
|
+
build: {
|
|
14
|
+
outDir: "dist",
|
|
15
|
+
},
|
|
16
|
+
test: {
|
|
17
|
+
coverage: {
|
|
18
|
+
include: ["src/**/*.ts", "src/**/*.tsx", "server/**/*.ts"],
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
plugins: [
|
|
22
|
+
react(),
|
|
23
|
+
tsconfigPaths(),
|
|
24
|
+
cityGasRouter(),
|
|
25
|
+
gasnuki({
|
|
26
|
+
srcDir: "server",
|
|
27
|
+
outDir: "types/appsscript",
|
|
28
|
+
outputFile: "client.ts",
|
|
29
|
+
}),
|
|
30
|
+
gas(),
|
|
31
|
+
viteSingleFile(),
|
|
32
|
+
],
|
|
33
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.3.4/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": false,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"useIgnoreFile": false
|
|
7
|
+
},
|
|
8
|
+
"files": {
|
|
9
|
+
"ignoreUnknown": false,
|
|
10
|
+
"includes": ["src/**/*", "tests/**/*", "types/**/*", "./*.js", "./*.json"]
|
|
11
|
+
},
|
|
12
|
+
"formatter": {
|
|
13
|
+
"enabled": true,
|
|
14
|
+
"indentStyle": "space",
|
|
15
|
+
"indentWidth": 2
|
|
16
|
+
},
|
|
17
|
+
"linter": {
|
|
18
|
+
"enabled": true,
|
|
19
|
+
"rules": {
|
|
20
|
+
"recommended": true
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"javascript": {
|
|
24
|
+
"formatter": {
|
|
25
|
+
"quoteStyle": "double"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"assist": {
|
|
29
|
+
"enabled": true,
|
|
30
|
+
"actions": {
|
|
31
|
+
"source": {
|
|
32
|
+
"organizeImports": "on"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= projectName %>",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"check": "biome check --write",
|
|
9
|
+
"build": "tsc && rolldown -c && cpy src/*.json dist/",
|
|
10
|
+
"test": "vitest run --coverage",
|
|
11
|
+
"push": "clasp push"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@biomejs/biome": "^2.3.4",
|
|
15
|
+
"@google/clasp": "^3.1.1",
|
|
16
|
+
"@rollup/plugin-alias": "^6.0.0",
|
|
17
|
+
"@types/google-apps-script": "^2.0.7",
|
|
18
|
+
"@types/node": "^24.10.0",
|
|
19
|
+
"@vitest/coverage-v8": "4.0.8",
|
|
20
|
+
"cpy-cli": "^6.0.0",
|
|
21
|
+
"rolldown": "1.0.0-beta.47",
|
|
22
|
+
"rolldown-plugin-remove-export": "^0.1.3",
|
|
23
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
24
|
+
"vitest": "^4.0.8"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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.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
|
+
],
|
|
29
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2022",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "esnext",
|
|
6
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"moduleDetection": "force",
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
|
|
16
|
+
/* Linting */
|
|
17
|
+
"strict": true,
|
|
18
|
+
"noUnusedLocals": true,
|
|
19
|
+
"noUnusedParameters": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"noUncheckedSideEffectImports": true,
|
|
22
|
+
|
|
23
|
+
"allowJs": true,
|
|
24
|
+
"checkJs": false,
|
|
25
|
+
"types": ["node", "google-apps-script"],
|
|
26
|
+
|
|
27
|
+
// Aliases
|
|
28
|
+
"paths": {
|
|
29
|
+
"@/*": ["./src/*"],
|
|
30
|
+
"~/*": ["./*"]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"include": ["src", "tests", "types", "./*.ts"]
|
|
34
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/2.
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.3.4/schema.json",
|
|
3
3
|
"vcs": {
|
|
4
4
|
"enabled": false,
|
|
5
5
|
"clientKind": "git",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"javascript": {
|
|
24
24
|
"formatter": {
|
|
25
|
-
"quoteStyle": "
|
|
25
|
+
"quoteStyle": "double"
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"assist": {
|
|
@@ -10,19 +10,18 @@
|
|
|
10
10
|
"test": "vitest run --coverage",
|
|
11
11
|
"push": "clasp push"
|
|
12
12
|
},
|
|
13
|
-
"dependencies": {},
|
|
14
13
|
"devDependencies": {
|
|
15
|
-
"@biomejs/biome": "^2.
|
|
16
|
-
"@google/clasp": "^3.1.
|
|
17
|
-
"@rollup/plugin-alias": "^
|
|
18
|
-
"@types/google-apps-script": "^2.0.
|
|
19
|
-
"@types/node": "^24.
|
|
20
|
-
"@vitest/coverage-v8": "
|
|
14
|
+
"@biomejs/biome": "^2.3.4",
|
|
15
|
+
"@google/clasp": "^3.1.1",
|
|
16
|
+
"@rollup/plugin-alias": "^6.0.0",
|
|
17
|
+
"@types/google-apps-script": "^2.0.7",
|
|
18
|
+
"@types/node": "^24.10.0",
|
|
19
|
+
"@vitest/coverage-v8": "4.0.8",
|
|
21
20
|
"cpy-cli": "^6.0.0",
|
|
22
|
-
"rolldown": "1.0.0-beta.
|
|
21
|
+
"rolldown": "1.0.0-beta.47",
|
|
23
22
|
"rolldown-plugin-remove-export": "^0.1.3",
|
|
24
23
|
"typescript": "~5.9.3",
|
|
25
24
|
"vite-tsconfig-paths": "^5.1.4",
|
|
26
|
-
"vitest": "^
|
|
25
|
+
"vitest": "^4.0.8"
|
|
27
26
|
}
|
|
28
27
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
GAS_DEPLOYMENT_ID=input your deployment id
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Vue 3 + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
|
4
|
+
|
|
5
|
+
Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.3.4/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"useIgnoreFile": true
|
|
7
|
+
},
|
|
8
|
+
"files": {
|
|
9
|
+
"ignoreUnknown": false
|
|
10
|
+
},
|
|
11
|
+
"formatter": {
|
|
12
|
+
"enabled": true,
|
|
13
|
+
"indentStyle": "space",
|
|
14
|
+
"indentWidth": 2
|
|
15
|
+
},
|
|
16
|
+
"linter": {
|
|
17
|
+
"enabled": true,
|
|
18
|
+
"rules": {
|
|
19
|
+
"recommended": true
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"javascript": {
|
|
23
|
+
"formatter": {
|
|
24
|
+
"quoteStyle": "double"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"assist": {
|
|
28
|
+
"enabled": true,
|
|
29
|
+
"actions": {
|
|
30
|
+
"source": {
|
|
31
|
+
"organizeImports": "on"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title><%= projectName %></title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="app"></div>
|
|
11
|
+
<script type="module" src="/src/main.ts"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|