Skip to content

Commit

Permalink
release: v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
justorez committed Jan 10, 2024
1 parent 720ff9f commit d23b512
Show file tree
Hide file tree
Showing 38 changed files with 5,593 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dist
node_modules
*.md
*.json
*.html
*.d.ts
**/*.js
# .eslintrc.cjs
28 changes: 28 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
env: {
webextensions: true,
browser: true,
es2021: true
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:vue/vue3-recommended',
'prettier'
],
overrides: [],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 'latest',
sourceType: 'module'
},
plugins: ['@typescript-eslint', 'vue'],
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'vue/multi-word-component-names': 'off',
'no-unref': 'off',
'no-undef': 'off'
}
}
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github:
patreon: Justorez
open_collective:
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt:
otechie: # Replace with a single Otechie username
custom: # Replace with a single custom sponsorship URL
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: build
'on':
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
lint_and_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Install node v20
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'

- run: pnpm install
- run: pnpm run lint
- run: pnpm run build
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: release
'on':
push:
tags:
- "v*.*.*"

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: 'bash'

jobs:
draft_release:
permissions:
contents: write # Allows this job to create releases

strategy:
fail-fast: true
matrix:
# os: [macos-latest, ubuntu-latest, windows-latest]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
timeout-minutes: 5

steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Install node v20
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'

- run: pnpm install

- name: Get package version
id: get-version
run: echo "::set-output name=version::$(node -p "require('./package.json').version")"

- run: pnpm run build
- run: zip -r dist-v${{ steps.get-version.outputs.version }}.zip dist

- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.get-version.outputs.version }}
name: v${{ steps.get-version.outputs.version }}
draft: true
files: dist-v${{ steps.get-version.outputs.version }}.zip
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shamefully-hoist=true
strict-peer-dependencies=false
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
auto-imports.d.ts
components.d.ts
pnpm-lock.yaml
yarn.lock
node_modules/
10 changes: 10 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
quoteProps: 'as-needed',
semi: false,
// singleAttributePerLine: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'none',
useTabs: false,
htmlWhitespaceSensitivity: 'ignore'
}
13 changes: 13 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"recommendations": [
"bradlc.vscode-tailwindcss",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"mikestead.dotenv",
"sdras.vue-vscode-snippets",
"Vue.volar",
"mrniamster.daisyui-snippets",
"oxc.oxc-vscode",
"mrmlnc.vscode-scss"
]
}
38 changes: 38 additions & 0 deletions manifest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { defineManifest } from '@crxjs/vite-plugin'
// @ts-ignore
import packageJson from './package.json'

const { version, name, description, displayName } = packageJson
// Convert from Semver (example: 0.1.0-beta6)
const [major, minor, patch, label = '0'] = version
// can only contain digits, dots, or dash
.replace(/[^\d.-]+/g, '')
// split into version parts
.split(/[.-]/)

export default defineManifest(async (env) => ({
name: env.mode === 'staging' ? `[INTERNAL] ${name}` : displayName || name,
description,
// up to four numbers separated by dots
version: `${major}.${minor}.${patch}.${label}`,
// semver is OK in "version_name"
version_name: version,
manifest_version: 3,
icons: {
16: 'public/icons/200.png',
48: 'public/icons/200.png',
128: 'public/icons/200.png'
},
action: {
default_popup: 'src/popup/index.html'
},
host_permissions: [
'*://*.douban.com/*',
],
permissions: [
'storage',
'cookies',
'activeTab'
],
web_accessible_resources: [],
}))
68 changes: 68 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"private": true,
"displayName": "豆瓣小组评论举报工具",
"name": "douban-group-reporter-webext",
"description": "💢批量举报豆瓣小组帖子的评论",
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint . --fix --ext js,mjs,cjs,ts,mts,cts,vue",
"preview": "vite preview"
},
"dependencies": {
"axios": "^1.6.5",
"cheerio": "1.0.0-rc.12",
"vue": "^3.4.6",
"vue-router": "^4.2.5"
},
"devDependencies": {
"@crxjs/vite-plugin": "^2.0.0-beta.21",
"@iconify-json/mdi": "^1.1.64",
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/typography": "^0.5.10",
"@types/eslint": "^8.56.1",
"@types/eslint-config-prettier": "^6.11.3",
"@types/node": "^20.10.7",
"@typescript-eslint/eslint-plugin": "^6.18.0",
"@typescript-eslint/parser": "^6.18.0",
"@vitejs/plugin-vue": "^4.6.2",
"@vue/compiler-sfc": "^3.4.6",
"@vueuse/core": "^10.7.1",
"autoprefixer": "^10.4.16",
"chrome-types": "^0.1.248",
"daisyui": "^4.5.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-vue": "^9.19.2",
"postcss": "^8.4.33",
"prettier": "^3.1.1",
"prettier-plugin-tailwindcss": "^0.5.11",
"sass": "^1.69.7",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3",
"unplugin-auto-import": "^0.17.3",
"unplugin-icons": "^0.18.2",
"unplugin-vue-components": "^0.26.0",
"vite": "^4.5.1",
"vite-plugin-pages": "^0.32.0",
"vite-plugin-vue-devtools": "^7.0.6",
"vue-tsc": "^1.8.27",
"webext-bridge": "^6.0.1"
},
"overrides": {
"@crxjs/vite-plugin": "$@crxjs/vite-plugin"
},
"pnpm": {
"overrides": {},
"peerDependencyRules": {
"allowAny": [],
"allowedDeprecatedVersions": {
"sourcemap-codec": "1.4.8"
},
"allowedVersions": {},
"ignoreMissing": []
}
}
}
Loading

0 comments on commit d23b512

Please sign in to comment.