{"id":602,"date":"2025-07-27T12:59:02","date_gmt":"2025-07-27T03:59:02","guid":{"rendered":"https:\/\/tako.nakano.net\/blog\/?p=602"},"modified":"2025-07-27T12:59:02","modified_gmt":"2025-07-27T03:59:02","slug":"aside-tips-part-1","status":"publish","type":"post","link":"https:\/\/tako.nakano.net\/blog\/2025\/07\/aside-tips-part-1\/","title":{"rendered":"ASIDE \u3092\u5229\u7528\u3057\u3066\u3001TypeScript \u3067 Google Apps Script (GAS) \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b\u969b\u306b\u77e5\u3063\u3066\u304a\u304f\u3068\u826f\u3044\u3053\u3068 \u305d\u306e1"},"content":{"rendered":"<h1>ASIDE \u3092\u5229\u7528\u3057\u3066\u3001TypeScript \u3067 Google Apps Script (GAS) \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b\u969b\u306b\u77e5\u3063\u3066\u304a\u304f\u3068\u826f\u3044\u3053\u3068 \u305d\u306e1<\/h1>\n<p>English follows Japanese.<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>ASIDE \u3092\u5229\u7528\u3057\u3066\u3001TypeScript \u3067 GAS \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b\u969b\u306b\u77e5\u3063\u3066\u304a\u304f\u3068\u826f\u3044\u3053\u3068\u3092\u4eca\u56de\u306f2\u3064\u7d39\u4ecb\u3059\u308b\u3002<\/p>\n<ol>\n<li>\u5916\u90e8\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u4f7f\u3063\u3066\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u306b\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u5185\u5bb9\u3092\u542b\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u308b<\/li>\n<li>\u5916\u90e8\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u305d\u306e\u307e\u307e\u3067\u306f GAS \u306e\u74b0\u5883\u3067\u52d5\u304b\u306a\u3044\u30b3\u30fc\u30c9\u3067\u3082\u300ctarget \u3092\u30c0\u30a6\u30f3\u30b0\u30ec\u30fc\u30c9\u300d\u3059\u308b\u3053\u3068\u3067 GAS \u306e\u74b0\u5883\u3067\u52d5\u304f\u3088\u3046\u306b\u3067\u304d\u308b<\/li>\n<\/ol>\n<p>\u300c\u305d\u306e1\u300d\u3068\u3057\u3066\u3044\u308b\u304c\u3001\u5168\u4f55\u56de\u306b\u306a\u308b\u304b\u306f\u672a\u5b9a\u3067\u3042\u308b\u3002<\/p>\n<h2>\u4f8b\u3068\u3057\u3066\u6271\u3046\u30b7\u30b9\u30c6\u30e0<\/h2>\n<ul>\n<li>ASIDE \u3092\u5229\u7528\u3057\u3066\u521d\u671f\u8a2d\u5b9a\u3092\u884c\u3063\u305f<\/li>\n<li>xstate \u3068\u3044\u3046\u72b6\u614b\u9077\u79fb\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5229\u7528\u3057\u3066\u3001\u30ab\u30a6\u30f3\u30bf\u30fc\u306e\u72b6\u614b\u9077\u79fb\u3092\u7ba1\u7406\u3059\u308b\n<ul>\n<li><code>package.json<\/code> \u306b <code>xstate<\/code> \u3092\u8ffd\u52a0\u3057\u3066\u3044\u308b<\/li>\n<li><code>xstate<\/code> \u306f 5.20.1 \u3067\u691c\u8a3c<\/li>\n<\/ul>\n<\/li>\n<li>\u30ed\u30fc\u30ab\u30eb\u3067\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u306f\u554f\u984c\u306a\u304f\u3067\u304d\u308b\n<ul>\n<li>ASIDE \u306b <code>jest<\/code> \u306b\u3088\u308b\u30c6\u30b9\u30c8\u74b0\u5883\u304c\u6a19\u6e96\u3067\u542b\u307e\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u308c\u306b\u4e57\u3063\u304b\u308b<\/li>\n<\/ul>\n<\/li>\n<li>\u4f5c\u6210\u3057\u305f\u95a2\u6570\u3092\u542b\u3081\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092 <code>npm run deploy<\/code> \u3057\u3088\u3046\u3068\u3059\u308b\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b\uff08\u5f8c\u3067\u7d39\u4ecb\uff09\n<ul>\n<li>\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u542b\u3081\u308b\u305f\u3081\u306e\u8a2d\u5b9a<\/li>\n<li>\u74b0\u5883\u306e\u4e92\u63db\u6027\u306e\u554f\u984c<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u30ed\u30fc\u30ab\u30eb\u3067\u306f\u3001Node.js \u306e 22.17.1 \u3092\u5229\u7528\u3057\u305f\u3002<\/p>\n<h2>\u53c2\u8003: ASIDE \u306e\u521d\u671f\u8a2d\u5b9a<\/h2>\n<p>Node.js \u306e\u5b9f\u884c\u74b0\u5883\u306e\u69cb\u7bc9\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u7d39\u4ecb\u3057\u306a\u3044\u3002<\/p>\n<p><code>npx @google\/aside init<\/code> \u3092\u5b9f\u884c\u3057\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u521d\u671f\u5316\u3059\u308b\u3002\u3053\u3061\u3089\u3082\u3001\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u7d39\u4ecb\u3057\u306a\u3044\u3002<\/p>\n<p>\u30e9\u30a4\u30bb\u30f3\u30b9\u3092\u542b\u3081\u308b\u305f\u3081\u306e\u30d5\u30a1\u30a4\u30eb\u3084\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u4e0d\u8981\u306a\u306e\u3067\u9664\u3044\u305f\u3002\u3053\u3053\u3082\u7701\u7565\u3059\u308b\u3002<\/p>\n<p>\u3053\u306e\u6642\u70b9\u306e commit hash \u304c <a href=\"https:\/\/github.com\/takotakot\/misc\/commit\/4929c3cfe50c8248f88d64973015f0375157efe8\"><code>4929c3cfe50c8248f88d64973015f0375157efe8<\/code><\/a> \u3067\u3042\u308b\u3002<\/p>\n<h2>\u5916\u90e8\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u5229\u7528<\/h2>\n<p>i18next \u3092\u4f7f\u3063\u305f\u5148\u4f8b\u304c\u3001<a href=\"https:\/\/zenn.dev\/cloud_ace\/articles\/773666f01034cb\">GAS \u3067\u591a\u8a00\u8a9e\u5bfe\u5fdc\u3084\u3063\u3066\u307f\u305f<\/a> \u3068\u3057\u3066\u3001\u30af\u30e9\u30a6\u30c9\u30a8\u30fc\u30b9\u682a\u5f0f\u4f1a\u793e\u306e\u89d2\u8c37\u306b\u3088\u3063\u3066\u7d39\u4ecb\u3055\u308c\u3066\u3044\u308b\u3002\u57fa\u672c\u7684\u306b\u306f\u305d\u308c\u3068\u540c\u3058\u3088\u3046\u306a\u3053\u3068\u3092\u3059\u308b\u3002@suzukenz(Kenji Suzuki) \u306b\u3088\u308b Clasp \u3068 babel \u306e\u7d44\u307f\u5408\u308f\u305b\u4f8b\u304c<a href=\"https:\/\/qiita.com\/suzukenz\/items\/dbe13d5f8884752a37f8\">[Clasp] Google Apps Script \u3067 npm install \u3057\u305f package \u3092\u5229\u7528\u3059\u308b<\/a>\u306b\u3042\u308b\u306a\u3069\u3001\u6bd4\u8f03\u7684\u5b9f\u8df5\u3055\u308c\u3066\u304d\u305f\u6280\u8853\u3067\u306f\u3042\u308b\u3002<\/p>\n<p>\u307e\u305a\u306f <code>xstate<\/code> \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b(<a href=\"https:\/\/github.com\/takotakot\/misc\/commit\/be41b65253778be4d678ea821b14ec87585bfcfe\"><code>be41b65253778be4d678ea821b14ec87585bfcfe<\/code><\/a>)\u3002<\/p>\n<pre><code class=\"language-shell\">npm install xstate<\/code><\/pre>\n<p><code>xstate<\/code> \u3092\u5229\u7528\u3057\u305f\u30b3\u30fc\u30c9\u3092 <code>src\/counter.ts<\/code> \u306b\u66f8\u3044\u305f\u3002\u307e\u305f\u3001\u30c6\u30b9\u30c8\u3092 <code>test\/counter.test.ts<\/code> \u306b\u66f8\u3044\u305f(<a href=\"https:\/\/github.com\/takotakot\/misc\/commit\/c5a5bf6bf7e8c124f5b2358ca5079230ad712334\"><code>c5a5bf6bf7e8c124f5b2358ca5079230ad712334<\/code><\/a>)\u3002<\/p>\n<pre><code class=\"language-shell\">npm run test<\/code><\/pre>\n<p>\u3067\u554f\u984c\u306a\u304f\u30c6\u30b9\u30c8\u304c\u901a\u308b\u3002<\/p>\n<p><code>src\/index.ts<\/code> \u306b\u3001GAS \u306e\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u547c\u3073\u51fa\u3055\u308c\u308b\u95a2\u6570\u3092\u8ffd\u52a0\u3057\u305f(<a href=\"https:\/\/github.com\/takotakot\/misc\/commit\/242c61bb8a3f813cc712f59a3bc70cacb7060f1b\"><code>242c61bb8a3f813cc712f59a3bc70cacb7060f1b<\/code><\/a>)\u3002<br \/>\n\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u5074\u304b\u3089\u5b9f\u884c\u3057\u305f\u3044\u5834\u5408\u306f\u3001<code>ui<\/code> \u95a2\u9023\u306e\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3092\u524a\u9664\u3059\u308b\u3068\u826f\u3044\u3002<\/p>\n<pre><code class=\"language-typescript\">import { createActor } from &#039;xstate&#039;;\nimport { counterMachine } from &#039;.\/counter&#039;;\n\n\/**\n * \u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092\u958b\u3044\u305f\u3068\u304d\u306b\u81ea\u52d5\u5b9f\u884c\u3055\u308c\u308b GAS \u30a8\u30f3\u30c8\u30ea\u30dd\u30a4\u30f3\u30c8\n *\/\n\/\/ eslint-disable-next-line @typescript-eslint\/no-unused-vars\nfunction onOpen(): void {\n  const ui = SpreadsheetApp.getUi();\n  ui.createMenu(&#039;Menu&#039;)\n    .addItem(&#039;execute counter function&#039;, executeCounterFunction.name)\n    .addToUi();\n}\n\n\/**\n * \u30ab\u30a6\u30f3\u30bf\u30fc\u95a2\u6570\u306e\u5b9f\u884c\n *\n * GAS \u30e1\u30cb\u30e5\u30fc\u304b\u3089\u547c\u3073\u51fa\u3055\u308c\u308b\n *\/\nfunction executeCounterFunction() {\n  \/\/ const ui = SpreadsheetApp.getUi();\n\n  const actor = createActor(counterMachine);\n  actor.start();\n  actor.send({ type: &#039;INCREMENT&#039; });\n  let snapshot = actor.getSnapshot();\n  console.log(snapshot.context.count);\n  \/\/ ui.prompt(`Current count: ${snapshot.context.count}`);\n\n  actor.send({ type: &#039;INCREMENT&#039; });\n  snapshot = actor.getSnapshot();\n  console.log(snapshot.context.count);\n  \/\/ ui.prompt(`Current count: ${snapshot.context.count}`);\n\n  actor.stop();\n}\n<\/code><\/pre>\n<p>\u3053\u306e\u6642\u70b9\u3067 <code>npm run deploy<\/code> \u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u51fa\u529b\u304c\u5f97\u3089\u308c\u308b\u3002<\/p>\n<pre><code class=\"language-text\">\n> type-script-gas-downgrade@0.0.0 deploy\n> npm run lint &amp;&amp; npm run test &amp;&amp; npm run build &amp;&amp; ncp .clasp-dev.json .clasp.json &amp;&amp; clasp push -f\n\n> type-script-gas-downgrade@0.0.0 lint\n> eslint --fix --no-error-on-unmatched-pattern src\/ test\/\n\n=============\n\nWARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint\/typescript-estree.\n\nYou may find that it works just fine, or you may not.\n\nSUPPORTED TYPESCRIPT VERSIONS: &gt;=3.3.1 &lt;5.2.0\n\nYOUR TYPESCRIPT VERSION: 5.8.3\n\nPlease only submit bug reports when using the officially supported version.\n\n=============\n(node:337893) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.\n(Use `node --trace-deprecation ...` to show where the warning was created)\n\n> type-script-gas-downgrade@0.0.0 test\n> jest test\/ --passWithNoTests --detectOpenHandles\n\n PASS  test\/counter.test.ts\n  counterMachine\n    \u2713 should have initial count 0 (4 ms)\n    \u2713 should increment count on INCREMENT (1 ms)\n    \u2713 should reset count to 0 on RESET (1 ms)\n\nTest Suites: 1 passed, 1 total\nTests:       3 passed, 3 total\nSnapshots:   0 total\nTime:        1.063 s, estimated 2 s\nRan all test suites matching test\/.\n\n> type-script-gas-downgrade@0.0.0 build\n> npm run clean &amp;&amp; npm run bundle &amp;&amp; ncp appsscript.json dist\/appsscript.json\n\n> type-script-gas-downgrade@0.0.0 clean\n> rimraf build dist\n\n> type-script-gas-downgrade@0.0.0 bundle\n> rollup --no-treeshake -c rollup.config.mjs\n\nsrc\/index.ts \u2192 dist...\n(!) Unresolved dependencies\nhttps:\/\/rollupjs.org\/troubleshooting\/#warning-treating-module-as-external-dependency\nxstate (imported by &quot;src\/counter.ts&quot; and &quot;src\/index.ts&quot;)\ncreated dist in 1s\nSyntax error: SyntaxError: Cannot use import statement outside a module line: 1 file: index.gs<\/code><\/pre>\n<p>\u6700\u5f8c\u306e\u884c:<\/p>\n<pre><code class=\"language-text\">Syntax error: SyntaxError: Cannot use import statement outside a module line: 1 file: index.gs<\/code><\/pre>\n<p>\u306e\u90e8\u5206\u304c\u30a8\u30e9\u30fc\u3067\u3042\u308b\u3002\u751f\u6210\u3055\u308c\u305f <code>dist\/index.js<\/code> \u3092\u898b\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u884c\u304c\u30d5\u30a1\u30a4\u30eb\u5192\u982d\u306b\u5b58\u5728\u3057\u3066\u3044\u308b<\/p>\n<pre><code class=\"language-javascript\">import { createMachine, assign, createActor } from &#039;xstate&#039;;<\/code><\/pre>\n<p>GAS \u3067\u306f\u3001\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u304c\u3059\u3079\u3066\u8aad\u307f\u8fbc\u307e\u308c\u308b\u304c\u3001<code>import<\/code> \u306e\u4ed5\u7d44\u307f\u306f\u306a\u3044\u306e\u3067\u3001\u5229\u7528\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u5185\u5bb9\u3092\u3059\u3079\u3066\u542b\u3081\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<p><code>@rollup\/plugin-node-resolve<\/code> \u3092\u4f7f\u3046\u3068\u3001\u4f9d\u5b58\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3001<code>node_modules<\/code> \u4ee5\u4e0b\u306b\u3042\u308b\u3082\u306e\u3092\u3001rollup \u6642\u306b\u4e00\u7dd2\u306b\u542b\u3081\u3066\u304f\u308c\u308b\u3002<\/p>\n<p>\uff08\u591a\u5206 <code>--save-dev<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u3051\u305f\u65b9\u304c\u826f\u3044\u3051\u3069\uff09\u4ee5\u4e0b\u3092\u5b9f\u884c\u3057\u3066\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u8ffd\u52a0\u3059\u308b(<a href=\"https:\/\/github.com\/takotakot\/misc\/commit\/6fac9473e58016f17456660636cfb9ecb4744fba\"><code>6fac9473e58016f17456660636cfb9ecb4744fba<\/code><\/a>)\u3002<\/p>\n<pre><code class=\"language-shell\">npm install @rollup\/plugin-node-resolve<\/code><\/pre>\n<p>\u305d\u306e\u5f8c\u3001<code>rollup.config.mjs<\/code> \u306b <code>import nodeResolve from &#039;@rollup\/plugin-node-resolve&#039;;<\/code> \u3068 <code>nodeResolve(),<\/code> \u3092\u8ffd\u52a0\u3059\u308b(<a href=\"https:\/\/github.com\/takotakot\/misc\/commit\/38d5dee2e4df3e6adf737abff136f3ce420c54fe\"><code>38d5dee2e4df3e6adf737abff136f3ce420c54fe<\/code><\/a>)\u3002<\/p>\n<p>\u3059\u308b\u3068\u3001<code>npm run deploy<\/code> \u3092\u5b9f\u884c\u3057\u305f\u3068\u304d\u306b\u3001\u51fa\u529b\u306e\u6700\u5f8c\u306e\u90e8\u5206\u304c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n<pre><code class=\"language-text\">src\/index.ts \u2192 dist...\ncreated dist in 1.9s\nSyntax error: ParseError: Unexpected token = line: 984 file: index.gs<\/code><\/pre>\n<p>\u5185\u5bb9\u306e\u8ffd\u52a0\u81ea\u4f53\u306f\u3067\u304d\u3066\u3044\u308b\u304c\u3001GAS \u5185\u306e V8 \u304c\u7279\u5b9a\u306e\u6587\u6cd5\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u3002\u3061\u306a\u307f\u306b\u3001984 \u884c\u76ee\u306f<\/p>\n<pre><code class=\"language-javascript\">reportError ||= !errorListener;<\/code><\/pre>\n<p>\u3067\u3042\u308b\u3002<\/p>\n<p>\u3072\u3068\u3064\u76ee\u306e\u8a71\u984c\u3001\u300c\u5916\u90e8\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u4f7f\u3063\u3066\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u306b\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u5185\u5bb9\u3092\u542b\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u300d\u306b\u3064\u3044\u3066\u306f\u89e3\u6c7a\u3057\u305f\u304c\u3001\u5bfe\u5fdc\u3057\u3066\u3044\u308b JavaScript \u306e\uff08\u6587\u6cd5\uff09\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u554f\u984c\u304c\u6b8b\u3063\u3066\u3044\u308b\u3002<\/p>\n<h2>target \u3092\u30c0\u30a6\u30f3\u30b0\u30ec\u30fc\u30c9<\/h2>\n<p>ES3, ES5, ES2015 \u2026\u304c\u4f55\u306a\u306e\u304b\u306b\u3064\u3044\u3066\u306f\u3001\u3053\u3053\u3067\u306f\u89e6\u308c\u306a\u3044\u3002<\/p>\n<p>\u307e\u305a\u3001\u300c\u81ea\u5206\u3067\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3067\u304d\u308b\u7bc4\u56f2\u306e\u30b3\u30fc\u30c9\u300d\u306b\u3064\u3044\u3066\u306f\u3001<code>tsconfig.json<\/code> \u306e <code>target<\/code> \u3092 <code>es2019<\/code> \u7b49\u306b\u6307\u5b9a\u3057\u3001TypeScript \u304b\u3089 JavaScript \u306b\u5909\u63db\u3059\u308b\u6bb5\u968e\u3067\u30c0\u30a6\u30f3\u30b0\u30ec\u30fc\u30c9\u3059\u308c\u3070\u89e3\u6c7a\u3059\u308b\u3002<\/p>\n<p>2025-07 \u306e\u6642\u70b9\u3067\u3001ASIDE \u304c\u63d0\u4f9b\u3059\u308b <a href=\"https:\/\/github.com\/google\/aside\/blob\/475f83f18ffc6ccc68ef0f12096053c4951a3830\/tsconfig.json\"><code>tsconfig.json<\/code><\/a> \u3092\u898b\u308b\u3068\u3001<code>&quot;target&quot;: &quot;es2020&quot;,<\/code> \u3068\u306a\u3063\u3066\u3044\u308b\u3002\u3053\u308c\u3092 2019 \u306b\u3059\u308c\u3070\u826f\u3044\u3068\u3044\u3046\u308f\u3051\u3067\u3042\u308b\u3002<\/p>\n<p>\u4e0a\u8a18\u306e\u624b\u6cd5\u306f\u3001\u682a\u5f0f\u4f1a\u793eCureApp \u306e @shinout(\u3057\u3093 \u3059\u305a\u304d) \u306b\u3088\u308b<a href=\"https:\/\/qiita.com\/shinout\/items\/ab69b78205a2c44e1360\">clasp push\u3067\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u305f\u3089tsconfig.json\u306etarget\u3092\u4e0b\u3052\u3088\u3002<\/a>\u3084\u3001\u3086\u3067\u306b\u3088\u308b<a href=\"https:\/\/zenn.dev\/agdf\/scraps\/8ff2337e695eb2\">GAS\u306b\u304a\u3051\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5236\u4f5c\u624b\u6cd5\u306e\u898b\u76f4\u3057<\/a>\u3067\u65e2\u306b\u7d39\u4ecb\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<p>\u4eca\u56de\u306e\u554f\u984c\u306f\u305d\u308c\u3067\u306f\u89e3\u6c7a\u3057\u306a\u3044\u3002<\/p>\n<p><code>xstate<\/code> \u306e\u30b3\u30fc\u30c9\u306f\u3001\u300c\u5916\u90e8\u300d\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u3042\u308a\u3001<code>tsconfig.json<\/code> \u306e <code>target<\/code> \u3092\u5909\u66f4\u3057\u3066\u3082\u3001<code>xstate<\/code> \u306e\u30b3\u30fc\u30c9\u306f\u5909\u308f\u3089\u306a\u3044\u3002\u3064\u307e\u308a\u3001<code>xstate<\/code> \u306e\u30b3\u30fc\u30c9\u304c GAS \u306e V8 \u304c\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u6587\u6cd5\u3092\u4f7f\u3063\u3066\u3044\u308b\u305f\u3081\u306b\u3001\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>\u30d0\u30f3\u30c9\u30e9\u306e <code>rollup<\/code> \u306e\u8a2d\u5b9a\u3067\u3001<code>babel<\/code> \u3092\u8ffd\u52a0\u3057\u3001preset \u306b node \u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001<code>dist<\/code> \u306b\u51fa\u529b\u3055\u308c\u308b\u30b3\u30fc\u30c9\u306e\u3001JavaScript \u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u4e0b\u3052\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<p>\u5177\u4f53\u7684\u306b\u306f\u4ee5\u4e0b\u306e\u3053\u3068\u3092\u884c\u3046\u3068\u826f\u3044(<a href=\"https:\/\/github.com\/takotakot\/misc\/commit\/d8c8db3685d4ee362a7d14a301959ccee45dbd6f\"><code>d8c8db3685d4ee362a7d14a301959ccee45dbd6f<\/code><\/a>):<\/p>\n<pre><code class=\"language-shell\">npm install @rollup\/plugin-babel @babel\/preset-env<\/code><\/pre>\n<p><code>rollup.config.mjs<\/code> \u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b <code>babel<\/code> \u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3059\u308b\u3002Node.js 16\u7cfb\u306b\u4e0a\u3052\u3066\u3057\u307e\u3046\u3068\u30c0\u30e1\u3060\u3063\u305f\u306e\u3067\u300114.21 \u3092\u6307\u5b9a\u3057\u305f(<a href=\"https:\/\/github.com\/takotakot\/misc\/commit\/8ea27ac9ca8cf510b42c02f597c778ca9121c6ef\"><code>8ea27ac9ca8cf510b42c02f597c778ca9121c6ef<\/code><\/a>)\u3002<\/p>\n<pre><code class=\"language-javascript\">import babel from &quot;@rollup\/plugin-babel&quot;;\n\/\/ ...\n  plugins: [\n    \/\/ ...\n    babel({\n      babelHelpers: &#039;bundled&#039;,\n      presets: [\n        [\n          &#039;@babel\/preset-env&#039;,\n          {\n            targets: {\n              node: &#039;14.21&#039;\n            },\n          }\n        ]\n      ]\n    }),\n  ]<\/code><\/pre>\n<p>\u3053\u3046\u3057\u305f\u5f8c\u306b <code>npm run deploy<\/code> \u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u51fa\u529b\u306e\u6700\u7d42\u90e8\u5206\u304c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u5316\u3059\u308b\u3002<\/p>\n<pre><code class=\"language-text\">src\/index.ts \u2192 dist...\ncreated dist in 2.6s\nPushed 2 files.\n\u2514\u2500 dist\/appsscript.json\n\u2514\u2500 dist\/index.js<\/code><\/pre>\n<p>\u3053\u308c\u3067\u3001<code>dist\/index.js<\/code> \u306e\u5185\u5bb9\u304c GAS \u306e V8 \u304c\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u6587\u6cd5\u306b\u5909\u63db\u3055\u308c\u3066\u3044\u3066\u3001\u305d\u306e\u5185\u5bb9\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u66f4\u65b0\u3055\u308c\u305f\u3002<\/p>\n<h2>\u53c2\u8003\u6587\u732e<\/h2>\n<ul>\n<li><a href=\"https:\/\/zenn.dev\/cloud_ace\/articles\/773666f01034cb\">GAS \u3067\u591a\u8a00\u8a9e\u5bfe\u5fdc\u3084\u3063\u3066\u307f\u305f<\/a> \u89d2\u8c37<\/li>\n<li><a href=\"https:\/\/qiita.com\/suzukenz\/items\/dbe13d5f8884752a37f8\">[Clasp] Google Apps Script \u3067 npm install \u3057\u305f package \u3092\u5229\u7528\u3059\u308b<\/a> @suzukenz(Kenji Suzuki)<\/li>\n<li><a href=\"https:\/\/qiita.com\/shinout\/items\/ab69b78205a2c44e1360\">clasp push\u3067\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u305f\u3089tsconfig.json\u306etarget\u3092\u4e0b\u3052\u3088\u3002<\/a> @shinout(\u3057\u3093 \u3059\u305a\u304d)<\/li>\n<li><a href=\"https:\/\/zenn.dev\/agdf\/scraps\/8ff2337e695eb2\">GAS\u306b\u304a\u3051\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5236\u4f5c\u624b\u6cd5\u306e\u898b\u76f4\u3057<\/a> \u3086\u3067<\/li>\n<\/ul>\n<p><!--\n\u30102024\u5e74\u7248\u3011GAS+Vue.js(3.x)\u306eclasp\u3068TypeScript\u5feb\u9069\u30ed\u30fc\u30ab\u30eb\u958b\u767a\u74b0\u5883\u69cb\u7bc9\nhttps:\/\/qiita.com\/take_me\/items\/019478780932fde12144\n--><\/p>\n<hr \/>\n<h1>Essential Tips for Developing Google Apps Script (GAS) Applications with TypeScript and ASIDE: Part 1<\/h1>\n<h2>Summary<\/h2>\n<p>This article covers two key techniques for developing Google Apps Script (GAS) applications with TypeScript using ASIDE:<\/p>\n<ol>\n<li><strong>Bundling External Packages<\/strong>: How to incorporate npm packages into your application code.<\/li>\n<li><strong>Ensuring Compatibility<\/strong>: How to make external packages compatible with the GAS environment by transpiling them to an older JavaScript target, even if they don&#8217;t work out-of-the-box.<\/li>\n<\/ol>\n<p>Although this is labeled as &quot;Part 1&quot;, the total number of parts is undecided.<\/p>\n<h2>Example System<\/h2>\n<ul>\n<li>The project was initialized using ASIDE<\/li>\n<li>We&#8217;ll use the <code>xstate<\/code> library to manage the state transitions of a simple counter\n<ul>\n<li><code>xstate<\/code> is added to <code>package.json<\/code><\/li>\n<li>Verified with xstate version 5.20.1<\/li>\n<\/ul>\n<\/li>\n<li>Local tests run successfully\n<ul>\n<li>We&#8217;ll leverage the default <code>jest<\/code> testing environment provided by ASIDE<\/li>\n<\/ul>\n<\/li>\n<li>Attempting to deploy the application with <code>npm run deploy<\/code> results in an error (which we will analyze later). This is due to:\n<ul>\n<li>The need for specific settings to bundle packages.<\/li>\n<li>Environment compatibility issues.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Locally, Node.js version 22.17.1 was used.<\/p>\n<h2>Reference: Initial Setup of ASIDE<\/h2>\n<p>A guide on setting up the Node.js runtime environment is beyond the scope of this article.<\/p>\n<p>The project is initialized by running <code>npx @google\/aside init<\/code>. We will also skip the detailed explanation of this process.<\/p>\n<p>Files and packages related to licensing were removed as they are not needed for this example.<\/p>\n<p>The commit hash at this point is <a href=\"https:\/\/github.com\/takotakot\/misc\/commit\/4929c3cfe50c8248f88d64973015f0375157efe8\"><code>4929c3cfe50c8248f88d64973015f0375157efe8<\/code><\/a>.<\/p>\n<h2>Using External Packages<\/h2>\n<p>A similar approach was demonstrated by Kadotani of Cloud Ace Inc. in their article &quot;<a href=\"https:\/\/zenn.dev\/cloud_ace\/articles\/773666f01034cb\">GAS \u3067\u591a\u8a00\u8a9e\u5bfe\u5fdc\u3084\u3063\u3066\u307f\u305f<\/a>,&quot; which uses i18next. This technique of bundling dependencies is relatively common, with other examples like @suzukenz&#8217;s (Kenji Suzuki) article on combining Clasp and Babel, &quot;[Clasp] Google Apps Script \u3067 npm install \u3057\u305f package \u3092\u5229\u7528\u3059\u308b](<a href=\"https:\/\/qiita.com\/suzukenz\/items\/dbe13d5f8884752a37f8\">https:\/\/qiita.com\/suzukenz\/items\/dbe13d5f8884752a37f8<\/a>)&quot;.<\/p>\n<p>First, install <code>xstate<\/code> (<a href=\"https:\/\/github.com\/takotakot\/misc\/commit\/be41b65253778be4d678ea821b14ec87585bfcfe\"><code>be41b65253778be4d678ea821b14ec87585bfcfe<\/code><\/a>):<\/p>\n<pre><code class=\"language-shell\">npm install xstate<\/code><\/pre>\n<p>We&#8217;ll write the <code>xstate<\/code> logic in <code>src\/counter.ts<\/code> and its corresponding tests in <code>test\/counter.test.ts<\/code> (<a href=\"https:\/\/github.com\/takotakot\/misc\/commit\/c5a5bf6bf7e8c124f5b2358ca5079230ad712334\"><code>c5a5bf6bf7e8c124f5b2358ca5079230ad712334<\/code><\/a>). Running <code>npm run test<\/code> confirms the tests pass successfully.<\/p>\n<p>Next, we add a function to <code>src\/index.ts<\/code> that will be called from the GAS menu (<a href=\"https:\/\/github.com\/takotakot\/misc\/commit\/242c61bb8a3f813cc712f59a3bc70cacb7060f1b\"><code>242c61bb8a3f813cc712f59a3bc70cacb7060f1b<\/code><\/a>). To run this from the spreadsheet UI, uncomment the lines related to the <code>ui<\/code> object.<\/p>\n<pre><code class=\"language-typescript\">import { createActor } from &#039;xstate&#039;;\nimport { counterMachine } from &#039;.\/counter&#039;;\n\n\/**\n * GAS entry point automatically executed when opening the spreadsheet\n *\/\n\/\/ eslint-disable-next-line @typescript-eslint\/no-unused-vars\nfunction onOpen(): void {\n  const ui = SpreadsheetApp.getUi();\n  ui.createMenu(&#039;Menu&#039;)\n    .addItem(&#039;execute counter function&#039;, executeCounterFunction.name)\n    .addToUi();\n}\n\n\/**\n * Execute counter function\n *\n * Called from the GAS menu\n *\/\nfunction executeCounterFunction() {\n  \/\/ const ui = SpreadsheetApp.getUi();\n\n  const actor = createActor(counterMachine);\n  actor.start();\n  actor.send({ type: &#039;INCREMENT&#039; });\n  let snapshot = actor.getSnapshot();\n  console.log(snapshot.context.count);\n  \/\/ ui.prompt(`Current count: ${snapshot.context.count}`);\n\n  actor.send({ type: &#039;INCREMENT&#039; });\n  snapshot = actor.getSnapshot();\n  console.log(snapshot.context.count);\n  \/\/ ui.prompt(`Current count: ${snapshot.context.count}`);\n\n  actor.stop();\n}<\/code><\/pre>\n<pre><code class=\"language-text\">\n> type-script-gas-downgrade@0.0.0 deploy\n> npm run lint &amp;&amp; npm run test &amp;&amp; npm run build &amp;&amp; ncp .clasp-dev.json .clasp.json &amp;&amp; clasp push -f\n\n> type-script-gas-downgrade@0.0.0 lint\n> eslint --fix --no-error-on-unmatched-pattern src\/ test\/\n\n=============\n\nWARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint\/typescript-estree.\n\nYou may find that it works just fine, or you may not.\n\nSUPPORTED TYPESCRIPT VERSIONS: &gt;=3.3.1 &lt;5.2.0\n\nYOUR TYPESCRIPT VERSION: 5.8.3\n\nPlease only submit bug reports when using the officially supported version.\n\n=============\n(node:337893) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.\n(Use `node --trace-deprecation ...` to show where the warning was created)\n\n> type-script-gas-downgrade@0.0.0 test\n> jest test\/ --passWithNoTests --detectOpenHandles\n\n PASS  test\/counter.test.ts\n  counterMachine\n    \u2713 should have initial count 0 (4 ms)\n    \u2713 should increment count on INCREMENT (1 ms)\n    \u2713 should reset count to 0 on RESET (1 ms)\n\nTest Suites: 1 passed, 1 total\nTests:       3 passed, 3 total\nSnapshots:   0 total\nTime:        1.063 s, estimated 2 s\nRan all test suites matching test\/.\n\n> type-script-gas-downgrade@0.0.0 build\n> npm run clean &amp;&amp; npm run bundle &amp;&amp; ncp appsscript.json dist\/appsscript.json\n\n> type-script-gas-downgrade@0.0.0 clean\n> rimraf build dist\n\n> type-script-gas-downgrade@0.0.0 bundle\n> rollup --no-treeshake -c rollup.config.mjs\n\nsrc\/index.ts \u2192 dist...\n(!) Unresolved dependencies\nhttps:\/\/rollupjs.org\/troubleshooting\/#warning-treating-module-as-external-dependency\nxstate (imported by &quot;src\/counter.ts&quot; and &quot;src\/index.ts&quot;)\ncreated dist in 1s\nSyntax error: SyntaxError: Cannot use import statement outside a module line: 1 file: index.gs<\/code><\/pre>\n<p>At this point, running <code>npm run deploy<\/code> fails with the following error at the end of the output:<\/p>\n<pre><code class=\"language-text\">Syntax error: SyntaxError: Cannot use import statement outside a module line: 1 file: index.gs<\/code><\/pre>\n<p>Looking at the generated <code>dist\/index.js<\/code>, we find this line at the top:<\/p>\n<pre><code class=\"language-javascript\">import { createMachine, assign, createActor } from &#039;xstate&#039;;<\/code><\/pre>\n<p>The GAS runtime loads all script files but doesn&#8217;t support ES module <code>import<\/code> statements. Therefore, all library code must be bundled into a single file.<\/p>\n<p>To solve this, we can use <code>@rollup\/plugin-node-resolve<\/code>. This Rollup plugin finds dependencies in <code>node_modules<\/code> and includes them in the final bundle.<\/p>\n<p>Install the plugin (maybe it&#8217;s recommended to use the <code>--save-dev<\/code> option) (<a href=\"https:\/\/github.com\/takotakot\/misc\/commit\/6fac9473e58016f17456660636cfb9ecb4744fba\"><code>6fac9473e58016f17456660636cfb9ecb4744fba<\/code><\/a>):<\/p>\n<pre><code class=\"language-shell\">npm install @rollup\/plugin-node-resolve<\/code><\/pre>\n<p>Then, add <code>import nodeResolve from &#039;@rollup\/plugin-node-resolve&#039;;<\/code> and <code>nodeResolve(),<\/code> to <code>rollup.config.mjs<\/code>(<a href=\"https:\/\/github.com\/takotakot\/misc\/commit\/38d5dee2e4df3e6adf737abff136f3ce420c54fe\"><code>38d5dee2e4df3e6adf737abff136f3ce420c54fe<\/code><\/a>).<\/p>\n<p>Now, running <code>npm run deploy<\/code> again, we encounter a different error:<\/p>\n<pre><code class=\"language-text\">src\/index.ts \u2192 dist...\ncreated dist in 1.9s\nSyntax error: ParseError: Unexpected token = line: 984 file: index.gs<\/code><\/pre>\n<p>The package is now bundled, but we&#8217;ve hit another issue: the GAS V8 runtime doesn&#8217;t support some modern JavaScript syntax. The problematic code on line 984 is a logical OR assignment (<code>||=<\/code>):<\/p>\n<pre><code class=\"language-javascript\">reportError ||= !errorListener;<\/code><\/pre>\n<p>We&#8217;ve solved our first problem: bundling external packages. However, we now face a new challenge related to JavaScript syntax compatibility.<\/p>\n<h2>Downgrading the Target<\/h2>\n<p>A detailed explanation of JavaScript versions (ES3, ES5, ES2015, etc.) is outside the scope of this article.<\/p>\n<p>For your own source code, this type of issue can typically be resolved by setting the <code>target<\/code> in <code>tsconfig.json<\/code> to an older version like <code>es2019<\/code>. This instructs the TypeScript compiler to output JavaScript compatible with that version. As of 2025-05, the <a href=\"https:\/\/github.com\/google\/aside\/blob\/475f83f18ffc6ccc68ef0f12096053c4951a3830\/tsconfig.json\"><code>tsconfig.json<\/code><\/a> provided by ASIDE defaults to <code>&quot;target&quot;: &quot;es2020&quot;<\/code>, so simply changing this would be the solution in that case. This method has been previously described in articles: &quot;<a href=\"https:\/\/qiita.com\/shinout\/items\/ab69b78205a2c44e1360\">clasp push\u3067\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u305f\u3089tsconfig.json\u306etarget\u3092\u4e0b\u3052\u3088\u3002<\/a>&quot; by @shinout(\u3057\u3093 \u3059\u305a\u304d) and &quot;<a href=\"https:\/\/zenn.dev\/agdf\/scraps\/8ff2337e695eb2\">GAS\u306b\u304a\u3051\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5236\u4f5c\u624b\u6cd5\u306e\u898b\u76f4\u3057<\/a>&quot; by Yude.<\/p>\n<p>However, this approach won&#8217;t solve our current problem.<\/p>\n<p>The <code>xstate<\/code> package is an external dependency. Changing our project&#8217;s <code>tsconfig.json<\/code> doesn&#8217;t affect the code within <code>node_modules<\/code>. The error originates from <code>xstate<\/code> itself using modern syntax that the GAS V8 runtime doesn&#8217;t support.<\/p>\n<p>The solution is to use Babel with Rollup. By adding <code>@rollup\/plugin-babel<\/code> and configuring it with <code>@babel\/preset-env<\/code>, we can transpile not only our code but also our dependencies to an older, more compatible version of JavaScript.<\/p>\n<p>Specifically, you&#8217;ll need to install the following packages (<a href=\"https:\/\/github.com\/takotakot\/misc\/commit\/d8c8db3685d4ee362a7d14a301959ccee45dbd6f\"><code>d8c8db3685d4ee362a7d14a301959ccee45dbd6f<\/code><\/a>):<\/p>\n<pre><code class=\"language-shell\">npm install @rollup\/plugin-babel @babel\/preset-env<\/code><\/pre>\n<p>Then, add the Babel plugin configuration to <code>rollup.config.mjs<\/code>. Note that targeting Node.js 16 didn&#8217;t resolve the issue in my testing; Node.js 14.21 was required for compatibility (<a href=\"https:\/\/github.com\/takotakot\/misc\/commit\/8ea27ac9ca8cf510b42c02f597c778ca9121c6ef\"><code>8ea27ac9ca8cf510b42c02f597c778ca9121c6ef<\/code><\/a>).<\/p>\n<pre><code class=\"language-javascript\">import babel from &quot;@rollup\/plugin-babel&quot;;\n\/\/ ...\n  plugins: [\n    \/\/ ...\n    babel({\n      babelHelpers: &#039;bundled&#039;,\n      presets: [\n        [\n          &#039;@babel\/preset-env&#039;,\n          {\n            targets: {\n              node: &#039;14.21&#039;\n            },\n          }\n        ]\n      ]\n    }),\n  ]<\/code><\/pre>\n<p>With this configuration in place, running <code>npm run deploy<\/code> finally succeeds:<\/p>\n<pre><code class=\"language-text\">src\/index.ts \u2192 dist...\ncreated dist in 2.6s\nPushed 2 files.\n\u2514\u2500 dist\/appsscript.json\n\u2514\u2500 dist\/index.js<\/code><\/pre>\n<p>This process transpiles the entire bundle, including <code>xstate<\/code>, into syntax compatible with the GAS V8 runtime. The script is now successfully deployed and updated.<\/p>\n<h2>References<\/h2>\n<ul>\n<li>Tried Multilingual Support in GAS <a href=\"https:\/\/zenn.dev\/cloud_ace\/articles\/773666f01034cb\">GAS \u3067\u591a\u8a00\u8a9e\u5bfe\u5fdc\u3084\u3063\u3066\u307f\u305f<\/a> Kadotani \u89d2\u8c37<\/li>\n<li>[Clasp] Using npm installed packages in Google Apps Script <a href=\"https:\/\/qiita.com\/suzukenz\/items\/dbe13d5f8884752a37f8\">[Clasp] Google Apps Script \u3067 npm install \u3057\u305f package \u3092\u5229\u7528\u3059\u308b<\/a> @suzukenz(Kenji Suzuki)<\/li>\n<li>If you get an error with clasp push, lower the target in tsconfig.json. <a href=\"https:\/\/qiita.com\/shinout\/items\/ab69b78205a2c44e1360\">clasp push\u3067\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u305f\u3089tsconfig.json\u306etarget\u3092\u4e0b\u3052\u3088\u3002<\/a> @shinout(\u3057\u3093 \u3059\u305a\u304d)<\/li>\n<li>Review of application development methods in GAS <a href=\"https:\/\/zenn.dev\/agdf\/scraps\/8ff2337e695eb2\">GAS\u306b\u304a\u3051\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5236\u4f5c\u624b\u6cd5\u306e\u898b\u76f4\u3057<\/a> Yude \u3086\u3067<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>ASIDE \u3092\u5229\u7528\u3057\u3066\u3001TypeScript \u3067 Google Apps Script (GAS) \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b\u969b\u306b\u77e5\u3063\u3066\u304a\u304f\u3068\u826f\u3044\u3053\u3068 \u305d\u306e1 English follows Japanese. \u307e\u3068\u3081  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[7,28],"tags":[],"class_list":["post-602","post","type-post","status-publish","format-standard","hentry","category-google","category-google-apps-script-gas"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4dIdP-9I","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/posts\/602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/comments?post=602"}],"version-history":[{"count":3,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/posts\/602\/revisions"}],"predecessor-version":[{"id":605,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/posts\/602\/revisions\/605"}],"wp:attachment":[{"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/media?parent=602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/categories?post=602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tako.nakano.net\/blog\/wp-json\/wp\/v2\/tags?post=602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}