forked from PlasmoHQ/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
166 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
#cache | ||
.turbo | ||
.next | ||
.vercel | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
|
||
# local env files | ||
.env* | ||
|
||
out/ | ||
build/ | ||
dist/ | ||
|
||
# plasmo - https://www.plasmo.com | ||
.plasmo | ||
|
||
# bpp - http://bpp.browser.market/ | ||
keys.json | ||
|
||
# typescript | ||
.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* @type {import('prettier').Options} | ||
*/ | ||
module.exports = { | ||
printWidth: 80, | ||
tabWidth: 2, | ||
useTabs: false, | ||
semi: false, | ||
singleQuote: false, | ||
trailingComma: "none", | ||
bracketSpacing: true, | ||
bracketSameLine: true, | ||
plugins: [require.resolve("@plasmohq/prettier-plugin-sort-imports")], | ||
importOrder: ["^@plasmohq/(.*)$", "^~(.*)$", "^[./]"], | ||
importOrderSeparation: true, | ||
importOrderSortSpecifiers: true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
This is a [Plasmo extension](https://docs.plasmo.com/) project bootstrapped with [`plasmo init`](https://www.npmjs.com/package/plasmo). | ||
|
||
## Getting Started | ||
|
||
First, run the development server: | ||
|
||
```bash | ||
pnpm dev | ||
# or | ||
npm run dev | ||
``` | ||
|
||
Open your browser and load the appropriate development build. For example, if you are developing for the chrome browser, using manifest v3, use: `build/chrome-mv3-dev`. | ||
|
||
You can start editing the popup by modifying `popup.tsx`. It should auto-update as you make changes. To add an options page, simply add a `options.tsx` file to the root of the project, with a react component default exported. Likewise to add a content page, add a `content.ts` file to the root of the project, importing some module and do some logic, then reload the extension on your browser. | ||
|
||
For further guidance, [visit our Documentation](https://docs.plasmo.com/) | ||
|
||
## Making production build | ||
|
||
Run the following: | ||
|
||
```bash | ||
pnpm build | ||
# or | ||
npm run build | ||
``` | ||
|
||
This should create a production bundle for your extension, ready to be zipped and published to the stores. | ||
|
||
## Submit to the webstores | ||
|
||
The easiest way to deploy your Plasmo extension is to use the built-in [bpp](https://bpp.browser.market) GitHub action. Prior to using this action however, make sure to build your extension and upload the first version to the store to establish the basic credentials. Then, simply follow [this setup instruction](https://docs.plasmo.com/framework/workflows/submit) and you should be on your way for automated submission! |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "with-sidepanel", | ||
"displayName": "With sidepanel", | ||
"version": "0.0.1", | ||
"description": "Using side-panel API in an extension", | ||
"author": "Plasmo Corp. <[email protected]>", | ||
"scripts": { | ||
"dev": "plasmo dev", | ||
"build": "plasmo build", | ||
"package": "plasmo package" | ||
}, | ||
"dependencies": { | ||
"plasmo": "workspace:*", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0" | ||
}, | ||
"devDependencies": { | ||
"@plasmohq/prettier-plugin-sort-imports": "workspace:*", | ||
"@types/chrome": "0.0.239", | ||
"@types/node": "20.3.2", | ||
"@types/react": "18.2.14", | ||
"@types/react-dom": "18.2.6", | ||
"prettier": "2.8.8", | ||
"typescript": "5.1.6" | ||
}, | ||
"manifest": { | ||
"host_permissions": [ | ||
"https://*/*" | ||
] | ||
}, | ||
"contributors": [ | ||
"louisgv" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { useState } from "react" | ||
|
||
function IndexSidePanel() { | ||
const [data, setData] = useState("") | ||
|
||
return ( | ||
<div | ||
style={{ | ||
display: "flex", | ||
flexDirection: "column", | ||
padding: 16 | ||
}}> | ||
<h2> | ||
Welcome to your | ||
<a href="https://www.plasmo.com" target="_blank"> | ||
{" "} | ||
Plasmo | ||
</a>{" "} | ||
Extension! | ||
</h2> | ||
<input onChange={(e) => setData(e.target.value)} value={data} /> | ||
<a href="https://docs.plasmo.com" target="_blank"> | ||
View Docs | ||
</a> | ||
</div> | ||
) | ||
} | ||
|
||
export default IndexSidePanel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "plasmo/templates/tsconfig.base", | ||
"exclude": ["node_modules"], | ||
"include": [".plasmo/index.d.ts", "./**/*.ts", "./**/*.tsx"], | ||
"compilerOptions": { | ||
"paths": { | ||
"~*": ["./*"] | ||
}, | ||
"baseUrl": "." | ||
} | ||
} |