{"_id":"@biva8710/gas-sheet-driver","_rev":"10-b9f72568e47cc3a7a5a23ed2af8de018","name":"@biva8710/gas-sheet-driver","dist-tags":{"latest":"0.1.5"},"versions":{"0.1.0":{"name":"@biva8710/gas-sheet-driver","version":"0.1.0","keywords":["google-apps-script","gas","local-development","vite","sqlite","spreadsheet","google-sheets"],"author":{"name":"biva8710"},"license":"MIT","_id":"@biva8710/gas-sheet-driver@0.1.0","maintainers":[{"name":"biva8710","email":"biva8710@gmail.com"}],"dist":{"shasum":"605a3811afa4c97c2b2664c874ad3b69a2178ec3","tarball":"https://registry.npmjs.org/@biva8710/gas-sheet-driver/-/gas-sheet-driver-0.1.0.tgz","fileCount":26,"integrity":"sha512-1rYdaQmLNnwKPRLBU0XmZoYQdEbAVWel+KnbLU/6T5w+4wVPOjh2jS/+JVw4EzLToGPKfzsSzmMr6/lRj/6yRw==","signatures":[{"sig":"MEQCIGfA9ffpvBlQl6htyBydN6EMyhKXF2IsHYWloGjnnggxAiBAE4FG/rBDIklUIbj/aCVqdrbkxcoG2ccmWb5aAy57tw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":480432},"main":"dist/index.js","type":"commonjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./vite":{"types":"./dist/vite-plugin.d.ts","import":"./dist/vite-plugin.mjs","require":"./dist/vite-plugin.js"}},"gitHead":"4e62ce6caf01da762ee6f1a90f017ffdac302ec3","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"biva8710","email":"biva8710@gmail.com"},"_npmVersion":"11.8.0","description":"Google Apps Script bridge driver for local development, enabling seamless execution with Vite and SQLite persistence.","directories":{},"_nodeVersion":"22.21.1","dependencies":{"better-sqlite3":"^12.6.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vite":"^7.3.1","vitest":"^4.0.18","typescript":"^5.9.3","@types/node":"^25.2.0","@types/better-sqlite3":"^7.6.13","@types/google-apps-script":"^2.0.8"},"_npmOperationalInternal":{"tmp":"tmp/gas-sheet-driver_0.1.0_1770272907774_0.6797408254941639","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@biva8710/gas-sheet-driver","version":"0.1.1","keywords":["google-apps-script","gas","local-development","vite","sqlite","spreadsheet","google-sheets"],"author":{"name":"biva8710"},"license":"MIT","_id":"@biva8710/gas-sheet-driver@0.1.1","maintainers":[{"name":"biva8710","email":"biva8710@gmail.com"}],"dist":{"shasum":"beebcfb5ca690c1ed65d700100e58589de6db02d","tarball":"https://registry.npmjs.org/@biva8710/gas-sheet-driver/-/gas-sheet-driver-0.1.1.tgz","fileCount":26,"integrity":"sha512-yW0LQbijo9FFiamjAWURYl1uBvqW4ecefyWhBSzKZiC/WloF6/gFqVZGG838FFvYlov3yIvHvVDhy7pyEHLjUQ==","signatures":[{"sig":"MEUCIQDTW4KY8KjAEp03XWO3jY8ncAhJjnhIun/q01vFESi/BAIgXjSt9aLIRwCVlrnrOnBmifTBECQoD0EtrAhuGHeGdsI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":488959},"main":"dist/index.js","type":"commonjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./vite":{"types":"./dist/vite-plugin.d.ts","import":"./dist/vite-plugin.mjs","require":"./dist/vite-plugin.js"}},"gitHead":"18c45e14bf5979f2345fb3c60046065302552f79","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"biva8710","email":"biva8710@gmail.com"},"_npmVersion":"11.8.0","description":"Google Apps Script bridge driver for local development, enabling seamless execution with Vite and SQLite persistence.","directories":{},"_nodeVersion":"22.21.1","dependencies":{"better-sqlite3":"^12.6.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vite":"^7.3.1","vitest":"^4.0.18","typescript":"^5.9.3","@types/node":"^25.2.0","@types/better-sqlite3":"^7.6.13","@types/google-apps-script":"^2.0.8"},"_npmOperationalInternal":{"tmp":"tmp/gas-sheet-driver_0.1.1_1770283724436_0.608463952152505","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@biva8710/gas-sheet-driver","version":"0.1.2","keywords":["google-apps-script","gas","local-development","vite","sqlite","spreadsheet","google-sheets"],"author":{"name":"biva8710"},"license":"MIT","_id":"@biva8710/gas-sheet-driver@0.1.2","maintainers":[{"name":"biva8710","email":"biva8710@gmail.com"}],"dist":{"shasum":"7fd3b4b3f6f66e7476d575c243f71bd2e412c7f8","tarball":"https://registry.npmjs.org/@biva8710/gas-sheet-driver/-/gas-sheet-driver-0.1.2.tgz","fileCount":26,"integrity":"sha512-+e8AeT8KA3gt8YDJGDoqjX+MX9cWiMMqtiTjzhr1FW+n2qFujGw1AJx3AMTgvgYWt0z5zmsXW6gSJlg8JaN2zg==","signatures":[{"sig":"MEYCIQCctFkVtVr7Q/ZzQt0dh9wAwAMtUvNl9otvTmhqTqxjdAIhAJ6piIJ6Ds3jYALSXyl+wviGhRwwInxIrgYCf9GnOeww","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":751301},"main":"dist/index.js","type":"commonjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./vite":{"types":"./dist/vite-plugin.d.ts","import":"./dist/vite-plugin.mjs","require":"./dist/vite-plugin.js"}},"gitHead":"18a621a763014e6e5f98ebe05f72c1d7df888cad","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"biva8710","email":"biva8710@gmail.com"},"_npmVersion":"11.8.0","description":"Google Apps Script bridge driver for local development, enabling seamless execution with Vite and SQLite persistence.","directories":{},"_nodeVersion":"22.21.1","dependencies":{"esbuild":"^0.27.2","better-sqlite3":"^12.6.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vite":"^7.3.1","vitest":"^4.0.18","typescript":"^5.9.3","@types/node":"^25.2.0","@types/better-sqlite3":"^7.6.13","@types/google-apps-script":"^2.0.8"},"_npmOperationalInternal":{"tmp":"tmp/gas-sheet-driver_0.1.2_1770285609307_0.30245091823900205","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@biva8710/gas-sheet-driver","version":"0.1.3","keywords":["google-apps-script","gas","local-development","vite","sqlite","spreadsheet","google-sheets"],"author":{"name":"biva8710"},"license":"MIT","_id":"@biva8710/gas-sheet-driver@0.1.3","maintainers":[{"name":"biva8710","email":"biva8710@gmail.com"}],"dist":{"shasum":"957707f2cc3cb42bf92ff28b25cf9bc3255b24c2","tarball":"https://registry.npmjs.org/@biva8710/gas-sheet-driver/-/gas-sheet-driver-0.1.3.tgz","fileCount":27,"integrity":"sha512-9zeFQxW5Bylm4FH5uH5vM5hBnAOfAE1YtRL2ELzOL35w08BTpH3ZaeO9ZNLevW+h9XYlZGJtTiONqtty58OKYA==","signatures":[{"sig":"MEYCIQD4Cct6kepGyTnJBYrz2gEPQIvy5Xp2JaClDRcpL7P1mgIhAP+BbBP6XtmIZP+cSA9ONDT314W42aNg3y22/afh1gR4","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":757368},"main":"dist/index.js","type":"commonjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./vite":{"types":"./dist/vite-plugin.d.ts","import":"./dist/vite-plugin.mjs","require":"./dist/vite-plugin.js"}},"gitHead":"d795645f1115ab9cb129fc6beb4acdead227384e","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"biva8710","email":"biva8710@gmail.com"},"_npmVersion":"11.8.0","description":"Google Apps Script bridge driver for local development, enabling seamless execution with Vite and SQLite persistence.","directories":{},"_nodeVersion":"22.21.1","dependencies":{"esbuild":"^0.27.2","better-sqlite3":"^12.6.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vite":"^7.3.1","vitest":"^4.0.18","typescript":"^5.9.3","@types/node":"^25.2.0","@types/better-sqlite3":"^7.6.13","@types/google-apps-script":"^2.0.8"},"_npmOperationalInternal":{"tmp":"tmp/gas-sheet-driver_0.1.3_1770457294651_0.8779450522352583","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@biva8710/gas-sheet-driver","version":"0.1.4","keywords":["google-apps-script","gas","local-development","vite","sqlite","spreadsheet","google-sheets"],"author":{"name":"biva8710"},"license":"MIT","_id":"@biva8710/gas-sheet-driver@0.1.4","maintainers":[{"name":"biva8710","email":"biva8710@gmail.com"}],"homepage":"https://github.com/biva8710/gas-sheet-driver#readme","bugs":{"url":"https://github.com/biva8710/gas-sheet-driver/issues"},"dist":{"shasum":"b2229d5bc7b19351fc1f57aa9cd9ed0f0e1083ed","tarball":"https://registry.npmjs.org/@biva8710/gas-sheet-driver/-/gas-sheet-driver-0.1.4.tgz","fileCount":27,"integrity":"sha512-m2X5SKBeKLs2XpQNH1tpUSJqEIzEbnLrfo2Xh+Y37YoZVkr3kUG3aBb4vmSQF/a0kvtL/sERom2TMPcMgBgV0g==","signatures":[{"sig":"MEUCIFRsL/uj3bEonsZC+bac8nZL3KO9iHswlIUAmetDbrsfAiEA7qxspEPbKzMLvwVhd9Yvm1JM0NscI4TZDRfRhoFOPOk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":757627},"main":"dist/index.js","type":"commonjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./vite":{"types":"./dist/vite-plugin.d.ts","import":"./dist/vite-plugin.mjs","require":"./dist/vite-plugin.js"}},"gitHead":"55ce0a5f7b1d148c8768a9405daac307309dd5b4","scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"biva8710","email":"biva8710@gmail.com"},"repository":{"url":"git+https://github.com/biva8710/gas-sheet-driver.git","type":"git"},"_npmVersion":"11.8.0","description":"Google Apps Script bridge driver for local development, enabling seamless execution with Vite and SQLite persistence.","directories":{},"_nodeVersion":"22.21.1","dependencies":{"esbuild":"^0.27.2","better-sqlite3":"^12.6.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vite":"^7.3.1","vitest":"^4.0.18","typescript":"^5.9.3","@types/node":"^25.2.0","@types/better-sqlite3":"^7.6.13","@types/google-apps-script":"^2.0.8"},"_npmOperationalInternal":{"tmp":"tmp/gas-sheet-driver_0.1.4_1770457572144_0.5759035930269436","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@biva8710/gas-sheet-driver","version":"0.1.5","description":"Google Apps Script bridge driver for local development, enabling seamless execution with Vite and SQLite persistence.","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./vite":{"types":"./dist/vite-plugin.d.ts","import":"./dist/vite-plugin.mjs","require":"./dist/vite-plugin.js"}},"publishConfig":{"access":"public"},"scripts":{"dev":"tsup --watch","build":"tsup","prepublishOnly":"npm run build","test":"vitest run","test:watch":"vitest"},"keywords":["google-apps-script","gas","local-development","vite","sqlite","spreadsheet","google-sheets"],"repository":{"type":"git","url":"git+https://github.com/biva8710/gas-sheet-driver.git"},"bugs":{"url":"https://github.com/biva8710/gas-sheet-driver/issues"},"homepage":"https://github.com/biva8710/gas-sheet-driver#readme","author":{"name":"biva8710"},"license":"MIT","type":"commonjs","dependencies":{"better-sqlite3":"^12.6.2","esbuild":"^0.27.2"},"devDependencies":{"@types/better-sqlite3":"^7.6.13","@types/google-apps-script":"^2.0.8","@types/node":"^25.2.0","tsup":"^8.5.1","typescript":"^5.9.3","vite":"^7.3.1","vitest":"^4.0.18"},"_id":"@biva8710/gas-sheet-driver@0.1.5","gitHead":"c0dfc76b64320aef9948da1b88aac30a6db6e61a","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-gBiNE3jXUq2yYX8QMaMvG8vQ8s5dIuiBwtbYqtXlHB9JKQ+2IwRuunvS27WiQpd+Gj0kdul87SZrXjoWDtPfCA==","shasum":"4abf1b5d47300903f689beef85947d89d8a8cd99","tarball":"https://registry.npmjs.org/@biva8710/gas-sheet-driver/-/gas-sheet-driver-0.1.5.tgz","fileCount":27,"unpackedSize":759299,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICH+deO0WyDpbivp8WRt+y6X6760lpxIPQmkFluBup2YAiAmB4E8gP59fwIOCpCINLYiqO32HIdXJ5kOByZj+Fn80Q=="}]},"_npmUser":{"name":"biva8710","email":"biva8710@gmail.com"},"directories":{},"maintainers":[{"name":"biva8710","email":"biva8710@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gas-sheet-driver_0.1.5_1782295163224_0.23563441250438877"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-05T06:28:27.695Z","modified":"2026-06-24T09:59:23.486Z","1.0.0":"2026-02-05T05:52:18.469Z","0.1.0":"2026-02-05T06:28:27.960Z","0.1.1":"2026-02-05T09:28:44.587Z","0.1.2":"2026-02-05T10:00:09.451Z","0.1.3":"2026-02-07T09:41:34.842Z","0.1.4":"2026-02-07T09:46:12.349Z","0.1.5":"2026-06-24T09:59:23.393Z"},"bugs":{"url":"https://github.com/biva8710/gas-sheet-driver/issues"},"author":{"name":"biva8710"},"license":"MIT","homepage":"https://github.com/biva8710/gas-sheet-driver#readme","keywords":["google-apps-script","gas","local-development","vite","sqlite","spreadsheet","google-sheets"],"repository":{"type":"git","url":"git+https://github.com/biva8710/gas-sheet-driver.git"},"description":"Google Apps Script bridge driver for local development, enabling seamless execution with Vite and SQLite persistence.","maintainers":[{"name":"biva8710","email":"biva8710@gmail.com"}],"readme":"# @biva8710/gas-sheet-driver\n\n`@biva8710/gas-sheet-driver` is a toolkit designed to modernize the Google Apps Script (GAS) development experience.\nBy integrating with Vite, it allows you to fully run and test server-side logic, including Spreadsheet operations, in a local environment (Node.js + SQLite).\n\n[🇯🇵 日本語ドキュメント (Japanese Docs)](./README.ja.md)\n\n## Features\n\n- ⚡ **Zero Config Vite Plugin**: Automatically sets up a GAS execution environment (`google.script.run` emulation) on your local server just by adding the plugin.\n- 🔋 **SpreadsheetApp on SQLite**: Performs spreadsheet read/write operations against a local SQLite database. No need to worry about production API quotas during development.\n- 🔄 **Universal Code**: Server-side code (`.js` / `.ts`) runs on both GAS and local environments without any specific rewriting.\n\n## Installation\n\nThis package is intended for **development environments only**.\n\n```bash\nnpm install -D @biva8710/gas-sheet-driver\n```\n\n## Usage\n\n### 1. Vite Configuration (vite.config.ts)\n\nImporting the Vite plugin will automatically launch the backend GAS logic alongside your local server.\n\n```typescript\nimport { defineConfig } from 'vite';\nimport { gasPlugin } from '@biva8710/gas-sheet-driver/vite';\n\nexport default defineConfig({\n  plugins: [\n    gasPlugin({\n      // Directory containing GAS code (or array of file paths)\n      // default: uses rootDir from .clasp.json\n      // include: ['./src'],\n\n      // Local DB file path\n      // default: local-dev.db\n      // defaultSpreadsheet: 'local-dev.db',\n      \n      // Initial values injected into PropertiesService.getScriptProperties()\n      // default: {}\n      // mockProperties: { SSID: 'DEV_SHEET_ID' }\n    })\n  ]\n});\n```\n\n### 2. Client-Side Implementation (GasBridge)\n\nUse `GasBridge.run` instead of `google.script.run`.\nIt supports Promise-based calls and syntax similar to native GAS global function calls.\n\n```typescript\nimport { GasBridge } from '@biva8710/gas-sheet-driver';\n\nasync function loadData() {\n  try {\n    // Seamlessly call server-side function getDayStatus(date)\n    const data = await GasBridge.run.getDayStatus('2026/02/05'); \n    console.log(data);\n  } catch (error) {\n    console.error(error);\n  }\n}\n```\n\n### 3. Environment Variables & Mock Settings (.env support)\n\nIf you place a `.env` file in your project root, the plugin will automatically load it and inject it into `PropertiesService.getScriptProperties()`.\n\n```env\n# .env example\nSSID=your_spreadsheet_id_for_dev\nADMIN_EMAILS=admin@example.com,test@example.com\n```\n\nIf used with `mockProperties` in the Vite config, `mockProperties` values take precedence (overwrite).\n\n```typescript\ngasPlugin({\n  // Explicit mock settings (prioritized over .env)\n  mockProperties: {\n    DEBUG: 'true'\n  }\n})\n```\n\n### 4. Server-Side Implementation (GAS)\n\nWrite code just like normal GAS. The SQLite driver is automatically injected during local execution.\n\n```javascript\nfunction getDayStatus(dateStr) {\n  const ss = SpreadsheetApp.getActiveSpreadsheet();\n  const sheet = ss.getSheetByName('2024_01');\n  // ...\n  return result;\n}\n```\n\n## Supported Features (Emulation)\n\nCurrently, a subset of the following features is supported:\n\n- **SpreadsheetApp**:\n  - `openById`, `getActiveSpreadsheet`\n  - `getSheetByName`, `insertSheet`, `deleteSheet`\n  - `getRange`, `getDataRange`\n  - `getValues`, `setValues`, `clear`\n- **PropertiesService**: `getScriptProperties` (Mock)\n- **Utilities**: `formatDate` (Mock)\n- **Session**: `getActiveUser`, `getScriptTimeZone` (Mock)\n- **Logger**: `log` (aliased to `console.log`)\n\n## TIPS: Customizing Mocks\n\nIf the default mocks are insufficient, or if you want to test specific behaviors, you can use the `onContextReady` hook to directly extend or overwrite GAS global objects.\n\n```typescript\ngasPlugin({\n  onContextReady: (gasContext) => {\n    // Example: Overwrite Session.getActiveUser() behavior\n    gasContext.Session = {\n      getActiveUser: () => ({ \n        getEmail: () => 'admin@example.com' \n      })\n    };\n    \n    // Example: Add a custom class not yet supported\n    gasContext.MailApp = {\n      sendEmail: (to, subject, body) => {\n        console.log(`[MockMail] To: ${to}, Subject: ${subject}`);\n      }\n    };\n  }\n})\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}