Svelte + Vite frontend with a Google Apps Script deployment flow powered by clasp.
npm install
npm run dev- Enable the Apps Script API:
https://script.google.com/home/usersettings - Sign in with clasp:
npm run gas:login- Connect this repo to a script project.
Create a new Apps Script project:
npx clasp create --rootDir . --project ./appscript --title "Internship Management System"Or clone an existing Apps Script project:
npx clasp clone YOUR_SCRIPT_ID --rootDir . --project ./appscriptIf you prefer to create the config manually, copy appscript/.clasp.json.example to appscript/.clasp.json and replace YOUR_SCRIPT_ID.
After the one-time clasp login + project link setup, your daily command can just be:
npm run deploy:gasThat command will:
- build the Svelte app
- generate the Apps Script-ready files in
appscript/ clasp pushthe generated code to your linked Google Apps Script project
Important:
- this pushes the code currently in your local working folder in VS Code
- it does not automatically deploy a Git branch unless that branch is the one currently checked out locally
- if you switch branches locally, then
npm run deploy:gaswill push that branch's current files
Generate the Apps Script-ready output:
npm run build:gasPush the generated appscript/ files to Apps Script:
npm run push:gasCreate or update a deployment:
npm run release:gasOpen the linked Apps Script project:
npm run gas:openvite buildcreates the production frontend indist/scripts/prepare-gas.mjsconverts that build into a self-containedappscript/Index.htmlappscript/Code.jsserves the app as a Google Apps Script web appappscript/appsscript.jsondefines the Apps Script manifest
After npm run gas:push, deploy from the Apps Script editor:
- Open
Deploy > New deployment - Choose
Web app - Select the execution account and access level
- Click
Deploy
You can also create a deployment from the CLI with npm run release:gas (or npm run gas:deploy), then manage web app settings in the Apps Script UI if needed.