Skip to content

Commit

Permalink
Merge pull request #4 from michael-freling/refactor/plasmo
Browse files Browse the repository at this point in the history
Introduce Plasmo
  • Loading branch information
michael-freling authored Jul 6, 2024
2 parents 3155936 + 8460bb0 commit e88d871
Show file tree
Hide file tree
Showing 25 changed files with 8,746 additions and 6,415 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
EXTENSION_ID=agkhggiaggmkehmjgbohkmemeafjlfoc
PLASMO_PUBLIC_EXTENSION_ID=agkhggiaggmkehmjgbohkmemeafjlfoc
CRX_PUBLIC_KEY=key
27 changes: 23 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,44 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
environment: production
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8
run_install: false

- uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
cache: "pnpm"

- name: Install dependencies
run: npm install
run: pnpm install

- name: "Create .env file"
run: |
touch .env
echo "# GitHub actions secrets: https://github.com/michael-freling/chrome-extension-anime-spoiler-blocker/settings/environments/3359267164/edit" >> .env
echo "PLASMO_PUBLIC_EXTENSION_ID=$PLASMO_PUBLIC_EXTENSION_ID" >> .env
echo "CRX_PUBLIC_KEY=$CRX_PUBLIC_KEY" >> .env
env:
PLASMO_PUBLIC_EXTENSION_ID: ${{ vars.PLASMO_PUBLIC_EXTENSION_ID }}
CRX_PUBLIC_KEY: ${{ secrets.CRX_PUBLIC_KEY }}

- name: Build
run: npm run build
run: pnpm build

# Create a GitHub release from the dist and a tag
# https://github.com/ncipollo/release-action
# https://earthly.dev/blog/github-action-artifacts/
- run: zip -r extension.zip dist/
- run: zip -r extension.zip build/
- uses: ncipollo/release-action@v1
with:
artifacts: "extension.zip"
# Following fields are for debugging
# allowUpdates: true
# tag: "v0.0.1"
# tag: "v0.1.1"
24 changes: 20 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,40 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8
run_install: false

- uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
cache: "pnpm"

- name: Install dependencies
run: npm install
run: pnpm install
- name: Run tests
run: npm run build
run: pnpm build

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8
run_install: false

- uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
cache: "pnpm"

- name: Install dependencies
run: npm install
run: pnpm install
- name: Run tests
run: npm test
run: pnpm test
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dist
build
node_modules

.env
.plasmo
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Chrome Extension Anime Spoiler Blocker
# Browser Extension Anime Spoiler Blocker

> [!WARNING]
> This is still under development and it's still experimental phase.
This is a Chrome extension to block spoilers for anime in some services.
This is a brwwser extension to block spoilers for anime in some services.
There are a few features supported to block spoilers

1. Keep the history of the last episode of a season for each anime you watched
Expand Down
6 changes: 0 additions & 6 deletions assets/options.html

This file was deleted.

13 changes: 0 additions & 13 deletions assets/popup.html

This file was deleted.

7 changes: 3 additions & 4 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { Config } from "@jest/types";
import type { Config } from "jest";

// Sync object
const config: Config.InitialOptions = {
// https://github.com/PlasmoHQ/examples/blob/main/with-jest/jest.config.mjs
const config: Config = {
verbose: true,
transform: {
"^.+\\.tsx?$": "ts-jest",
},
testEnvironment: "jsdom",
};

export default config;
39 changes: 0 additions & 39 deletions manifest.json

This file was deleted.

Loading

0 comments on commit e88d871

Please sign in to comment.