@extenso/init 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/bpp.yml +34 -0
- package/entries/background.ts +3 -0
- package/entries/content.ts +11 -0
- package/entries/contents/inline.tsx +17 -0
- package/entries/contents/overlay.tsx +22 -0
- package/entries/newtab.tsx +28 -0
- package/entries/options.tsx +28 -0
- package/entries/popup.tsx +28 -0
- package/index.json +1 -0
- package/package.json +18 -0
- package/templates/README.md +33 -0
- package/templates/assets/icon.png +0 -0
- package/templates/tsconfig.json +11 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Plasmo Corp. <foss@plasmo.com> (https://www.plasmo.com) and contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/bpp.yml
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: "Submit to Web Store"
|
|
2
|
+
on:
|
|
3
|
+
workflow_dispatch:
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
build:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- uses: actions/checkout@v3
|
|
10
|
+
- name: Cache pnpm modules
|
|
11
|
+
uses: actions/cache@v3
|
|
12
|
+
with:
|
|
13
|
+
path: ~/.pnpm-store
|
|
14
|
+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
15
|
+
restore-keys: |
|
|
16
|
+
${{ runner.os }}-
|
|
17
|
+
- uses: pnpm/action-setup@v2.4.1
|
|
18
|
+
with:
|
|
19
|
+
version: latest
|
|
20
|
+
run_install: true
|
|
21
|
+
- name: Use Node.js 20.x
|
|
22
|
+
uses: actions/setup-node@v3.5.1
|
|
23
|
+
with:
|
|
24
|
+
node-version: 20.x
|
|
25
|
+
cache: "pnpm"
|
|
26
|
+
- name: Build the extension
|
|
27
|
+
run: pnpm build
|
|
28
|
+
- name: Package the extension into a zip artifact
|
|
29
|
+
run: pnpm package
|
|
30
|
+
- name: Browser Platform Publish
|
|
31
|
+
uses: PlasmoHQ/bpp@v3
|
|
32
|
+
with:
|
|
33
|
+
keys: ${{ secrets.SUBMIT_KEYS }}
|
|
34
|
+
artifact: build/chrome-mv3-prod.zip
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PlasmoCSConfig } from "@extenso/cli"
|
|
2
|
+
|
|
3
|
+
export const config: PlasmoCSConfig = {
|
|
4
|
+
matches: ["https://www.plasmo.com/*"]
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
window.addEventListener("load", () => {
|
|
8
|
+
console.log("content script loaded")
|
|
9
|
+
|
|
10
|
+
document.body.style.background = "pink"
|
|
11
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PlasmoCSConfig, PlasmoGetInlineAnchor } from "@extenso/cli"
|
|
2
|
+
|
|
3
|
+
export const config: PlasmoCSConfig = {
|
|
4
|
+
matches: ["https://www.plasmo.com/*"]
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const getInlineAnchor: PlasmoGetInlineAnchor = () =>
|
|
8
|
+
document.querySelector("#supercharge > h2 > span")
|
|
9
|
+
|
|
10
|
+
// Use this to optimize unmount lookups
|
|
11
|
+
export const getShadowHostId = () => "plasmo-inline-example-unique-id"
|
|
12
|
+
|
|
13
|
+
const PlasmoInline = () => {
|
|
14
|
+
return <button>Custom button</button>
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default PlasmoInline
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PlasmoCSConfig, PlasmoGetOverlayAnchor } from "@extenso/cli"
|
|
2
|
+
|
|
3
|
+
export const config: PlasmoCSConfig = {
|
|
4
|
+
matches: ["https://www.plasmo.com/*"]
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const getOverlayAnchor: PlasmoGetOverlayAnchor = async () =>
|
|
8
|
+
document.querySelector<HTMLElement>("#pricing")
|
|
9
|
+
|
|
10
|
+
const PlasmoPricingExtra = () => {
|
|
11
|
+
return (
|
|
12
|
+
<span
|
|
13
|
+
style={{
|
|
14
|
+
background: "white",
|
|
15
|
+
padding: 12
|
|
16
|
+
}}>
|
|
17
|
+
HELLO WORLD
|
|
18
|
+
</span>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default PlasmoPricingExtra
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useState } from "react"
|
|
2
|
+
|
|
3
|
+
function IndexNewtab() {
|
|
4
|
+
const [data, setData] = useState("")
|
|
5
|
+
|
|
6
|
+
return (
|
|
7
|
+
<div
|
|
8
|
+
style={{
|
|
9
|
+
display: "flex",
|
|
10
|
+
flexDirection: "column",
|
|
11
|
+
padding: 16
|
|
12
|
+
}}>
|
|
13
|
+
<h2>
|
|
14
|
+
Welcome to your{" "}
|
|
15
|
+
<a href="https://www.plasmo.com" target="_blank">
|
|
16
|
+
Plasmo
|
|
17
|
+
</a>{" "}
|
|
18
|
+
Extension!
|
|
19
|
+
</h2>
|
|
20
|
+
<input onChange={(e) => setData(e.target.value)} value={data} />
|
|
21
|
+
<a href="https://docs.plasmo.com" target="_blank">
|
|
22
|
+
View Docs
|
|
23
|
+
</a>
|
|
24
|
+
</div>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default IndexNewtab
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useState } from "react"
|
|
2
|
+
|
|
3
|
+
function IndexOptions() {
|
|
4
|
+
const [data, setData] = useState("")
|
|
5
|
+
|
|
6
|
+
return (
|
|
7
|
+
<div
|
|
8
|
+
style={{
|
|
9
|
+
display: "flex",
|
|
10
|
+
flexDirection: "column",
|
|
11
|
+
padding: 16
|
|
12
|
+
}}>
|
|
13
|
+
<h2>
|
|
14
|
+
Welcome to your{" "}
|
|
15
|
+
<a href="https://www.plasmo.com" target="_blank">
|
|
16
|
+
Plasmo
|
|
17
|
+
</a>{" "}
|
|
18
|
+
Extension!
|
|
19
|
+
</h2>
|
|
20
|
+
<input onChange={(e) => setData(e.target.value)} value={data} />
|
|
21
|
+
<a href="https://docs.plasmo.com" target="_blank">
|
|
22
|
+
View Docs
|
|
23
|
+
</a>
|
|
24
|
+
</div>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default IndexOptions
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useState } from "react"
|
|
2
|
+
|
|
3
|
+
function IndexPopup() {
|
|
4
|
+
const [data, setData] = useState("")
|
|
5
|
+
|
|
6
|
+
return (
|
|
7
|
+
<div
|
|
8
|
+
style={{
|
|
9
|
+
display: "flex",
|
|
10
|
+
flexDirection: "column",
|
|
11
|
+
padding: 16
|
|
12
|
+
}}>
|
|
13
|
+
<h2>
|
|
14
|
+
Welcome to your{" "}
|
|
15
|
+
<a href="https://www.plasmo.com" target="_blank">
|
|
16
|
+
Plasmo
|
|
17
|
+
</a>{" "}
|
|
18
|
+
Extension!
|
|
19
|
+
</h2>
|
|
20
|
+
<input onChange={(e) => setData(e.target.value)} value={data} />
|
|
21
|
+
<a href="https://docs.plasmo.com" target="_blank">
|
|
22
|
+
View Docs
|
|
23
|
+
</a>
|
|
24
|
+
</div>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default IndexPopup
|
package/index.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@extenso/init",
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "Plasmo init template files",
|
|
5
|
+
"files": [
|
|
6
|
+
"entries",
|
|
7
|
+
"templates",
|
|
8
|
+
"bpp.yml"
|
|
9
|
+
],
|
|
10
|
+
"main": "index.json",
|
|
11
|
+
"author": "Plasmo Corp. <foss@plasmo.com>",
|
|
12
|
+
"homepage": "https://docs.plasmo.com/",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/Extension-Master/extenso.git"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
This is a [Plasmo extension](https://docs.plasmo.com/) project bootstrapped with [`plasmo init`](https://www.npmjs.com/package/plasmo).
|
|
2
|
+
|
|
3
|
+
## Getting Started
|
|
4
|
+
|
|
5
|
+
First, run the development server:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm dev
|
|
9
|
+
# or
|
|
10
|
+
npm run dev
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
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`.
|
|
14
|
+
|
|
15
|
+
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.
|
|
16
|
+
|
|
17
|
+
For further guidance, [visit our Documentation](https://docs.plasmo.com/)
|
|
18
|
+
|
|
19
|
+
## Making production build
|
|
20
|
+
|
|
21
|
+
Run the following:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pnpm build
|
|
25
|
+
# or
|
|
26
|
+
npm run build
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
This should create a production bundle for your extension, ready to be zipped and published to the stores.
|
|
30
|
+
|
|
31
|
+
## Submit to the webstores
|
|
32
|
+
|
|
33
|
+
The easiest way to deploy your Plasmo extension is to use the built-in [bpp](https://github.com/marketplace/actions/browser-platform-publisher) 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!
|
|
Binary file
|