{"id":13433678,"url":"https://github.com/rossmoody/ts-extension-starter","last_synced_at":"2025-07-11T02:37:02.439Z","repository":{"id":39705302,"uuid":"474693121","full_name":"rossmoody/ts-extension-starter","owner":"rossmoody","description":"A bare bones starter repo for building Chrome v3 manifest extensions using Typescript, React, and Rollup.","archived":false,"fork":false,"pushed_at":"2022-07-03T05:38:25.000Z","size":175,"stargazers_count":30,"open_issues_count":3,"forks_count":11,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-31T22:34:52.949Z","etag":null,"topics":["boilerplate","chrome-extension","manifest-v3","react","rollup","starter","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rossmoody.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-27T16:24:02.000Z","updated_at":"2024-09-11T13:44:02.000Z","dependencies_parsed_at":"2022-08-28T12:20:56.844Z","dependency_job_id":null,"html_url":"https://github.com/rossmoody/ts-extension-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossmoody%2Fts-extension-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossmoody%2Fts-extension-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossmoody%2Fts-extension-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossmoody%2Fts-extension-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rossmoody","download_url":"https://codeload.github.com/rossmoody/ts-extension-starter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253747444,"owners_count":21957757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boilerplate","chrome-extension","manifest-v3","react","rollup","starter","typescript"],"created_at":"2024-07-31T02:01:32.878Z","updated_at":"2025-05-12T13:29:11.119Z","avatar_url":"https://github.com/rossmoody.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# TypeScript, React, Rollup, and Chrome v3 Manifest Starter\n\nThis is a bare bones starter for building React/Typescript extensions for Chrome\nusing `manifest_version: 3`.\n\nUnder the hood, this starter leans pretty heavily on the infrastructure from\n[Extend Chrome](https://www.extend-chrome.dev/rollup-plugin). The primary\ndifference is this starter integrates some foundational code and manifest\nconfiguration for v3 which I couldn't find in the boilerplate examples they\noffer.\n\n## Notes\n\nIn my tinkering with this starter there are a few notes that I find helpful.\n\n### 1. Manually bundle files\n\nIf you reference files that can't be automatically recognized, use the\n`web_accessible_resources` property in manifest to explicitly bundle them.\n\n```json\n\"web_accessible_resources\": [\n    {\n      \"resources\": [\n        \"pages/popup/index.html\",\n        \"pages/popup/App.tsx\",\n        \"pages/popup/index.tsx\"\n      ],\n      \"matches\": [\n        \"\u003call_urls\u003e\"\n      ]\n    }\n  ]\n```\n\n### 2. Split v2 and v3 manifests\n\nThough a little hacky, I have had some success generating v2 and v3 manifests\nwith a little customization to this starter. The approach can be\n[seen on my extension Link Roamer](https://github.com/rossmoody/link-roamer/blob/main/rollup.config.js).\n\nThe premise is pretty simple: hook into a specific string value throughout your\napp and programmatically fire v2 or v3 API methods depending on the build\nenvironment.\n\nIn this way,\n[functions can be conditionally](https://github.com/rossmoody/link-roamer/blob/main/src/scripts/Chrome.ts)\ncompiled.\n\n```js\nif ('isV3Manifest') {\n  return (\n    await chrome.scripting.executeScript({\n      target: { tabId },\n      func,\n    })\n  )[0].result\n} else {\n  return (\n    await browser.tabs.executeScript(tabId, {\n      code: `(${func})()`,\n    })\n  )[0]\n}\n```\n\n## Development\n\nFor development with automatic reloading:\n\n```sh\nnpm run start\n```\n\nOpen the [Extensions Dashboard](chrome://extensions), enable \"Developer mode\",\nclick \"Load unpacked\", and choose the `dist` folder.\n\nWhen you make changes in `src` the background script and any content script will\nreload automatically.\n\n## Production\n\nWhen it's time to publish your Chrome extension, make a production build to\nsubmit to the Chrome Web Store. This boilerplate will use the version in\n`package.json`, unless you add a version to `src/manifest.json`.\n\n\u003e Make sure you have updated the name and version of your extension in\n\u003e `package.json`.\n\nRun the following line:\n\n```sh\nyarn build\n```\n\nThis will create a ZIP file with your package name and version in the `releases`\nfolder.\n\n---\n\n## More apps by me\n\nI like making things. [Check out what I'm up to lately](https://rossmoody.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frossmoody%2Fts-extension-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frossmoody%2Fts-extension-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frossmoody%2Fts-extension-starter/lists"}