Skip to content

Commit

Permalink
chore: willboosterify this repo (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
exKAZUu authored May 21, 2021
1 parent f0507f5 commit e5c2a2c
Show file tree
Hide file tree
Showing 17 changed files with 327 additions and 338 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,10 @@ fabric.properties

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

### VisualStudioCode Patch ###
Expand Down
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "root": true, "extends": ["@willbooster/eslint-config-ts"] }
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,10 @@ fabric.properties

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

### VisualStudioCode Patch ###
Expand Down
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn typecheck
1 change: 0 additions & 1 deletion .huskyrc.json

This file was deleted.

2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,10 @@ fabric.properties

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

### VisualStudioCode Patch ###
Expand Down
3 changes: 0 additions & 3 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
defaultSemverRangePrefix: ''

nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: '@yarnpkg/plugin-typescript'

yarnPath: .yarn/releases/yarn-2.4.1.cjs
39 changes: 22 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@
"build-common": "yarn recreate-dist && rollup -c",
"build-dev": "cross-env NODE_ENV=development yarn build-common",
"cleanup": "yarn format && yarn lint-fix",
"format": "sort-package-json && yarn prettier",
"lint": "eslint \"./{packages/*/,}{src,__tests__}/**/*.{js,jsx,svelte,ts,tsx}\"",
"format": "sort-package-json && yarn prettify",
"lint": "eslint --color \"./{src,__tests__}/**/*.{js,jsx,ts,tsx}\"",
"lint-fix": "yarn lint --fix",
"package": "rm -f \"*.tgz\" \"*.zip\" && yarn pack && yarn build && cd dist && bestzip ../dist.zip *",
"prettier": "prettier --write \"**/{.*/,}*.{css,htm,html,js,json,jsx,md,scss,svelte,ts,tsx,vue,yaml,yml}\" \"!**/test-fixtures/**\"",
"recreate-dist": "rm -Rf dist && mkdir dist && cp -r src/popup.html icon manifest.json dist/",
"release": "dotenv -- semantic-release",
"release-test": "yarn release -d",
"start": "cross-env NODE_ENV=development yarn build-common -w",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit --Pretty",
"postinstall": "husky install",
"prettify": "prettier --color --write \"**/{.*/,}*.{css,htm,html,js,json,json5,jsx,md,scss,ts,tsx,vue,yaml,yml}\" \"!**/test-fixtures/**\""
},
"prettier": "@willbooster/prettier-config",
"dependencies": {
Expand All @@ -48,35 +49,39 @@
"@rollup/plugin-node-resolve": "13.0.0",
"@tsconfig/svelte": "1.0.10",
"@types/chrome": "0.0.133",
"@types/eslint": "7",
"@types/jquery": "3.5.5",
"@types/micromatch": "4",
"@types/sass": "1.16.0",
"@typescript-eslint/eslint-plugin": "4.20.0",
"@typescript-eslint/parser": "4.20.0",
"@willbooster/eslint-config-ts": "6.2.1",
"@typescript-eslint/eslint-plugin": "4.24.0",
"@typescript-eslint/parser": "4.24.0",
"@willbooster/eslint-config-ts": "6.3.0",
"@willbooster/prettier-config": "6.2.1",
"@willbooster/renovate-config": "6.2.1",
"@willbooster/renovate-config": "6.3.0",
"babel-plugin-transform-remove-console": "6.9.4",
"bestzip": "2.2.0",
"cross-env": "7.0.3",
"dotenv-cli": "4.0.0",
"eslint": "7.23.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-prettier": "3.3.1",
"eslint": "7.26.0",
"eslint-config-prettier": "8.3.0",
"eslint-import-resolver-node": "0.3.4",
"eslint-plugin-import": "2.23.2",
"eslint-plugin-svelte3": "3.1.2",
"husky": "4.3.8",
"lint-staged": "10.5.4",
"prettier": "2.2.1",
"husky": "6.0.0",
"lint-staged": "11.0.0",
"micromatch": "4.0.4",
"pinst": "2.1.6",
"prettier": "2.3.0",
"prettier-plugin-svelte": "2.2.0",
"rollup": "2.44.0",
"rollup-plugin-svelte": "7.1.0",
"sass": "1.32.8",
"semantic-release": "17.4.2",
"semantic-release-chrome": "1.1.3",
"semantic-release-firefox-add-on": "0.2.8",
"sort-package-json": "1.49.0",
"sort-package-json": "1.50.0",
"svelte": "3.35.0",
"svelte-preprocess": "4.6.9",
"typescript": "4.2.3"
"typescript": "4.2.4"
}
}
3 changes: 2 additions & 1 deletion src/content_scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import $ from 'jquery';

import { Constants } from './constants';
import { CodeBlockFinder } from './finder/codeBlockFinder';
import type { DiffFinder, CodeFinder } from './finder/finder';
import { GitHubFileViewFinder, GitHubPullRequestDiffFinder } from './finder/gitHubFinder';
import { DescriptionMutator } from './mutator/descriptionMutator';
import { DiffMutator } from './mutator/diffMutator';

import type { DiffFinder, CodeFinder } from './finder/finder';

const sleep = (msec: number): Promise<void> => new Promise((resolve) => setTimeout(resolve, msec));

const allCodeFinders = [new CodeBlockFinder(), new GitHubFileViewFinder()] as const;
Expand Down
3 changes: 2 additions & 1 deletion src/finder/codeBlockFinder.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Constants } from '../constants';
import { INCLUDE_REGEX, INCLUDESUB_REGEX } from '../directiveRegexes';

import type { CodeFinder, UmlCodeContent } from './finder';
import { extractSubIncludedText } from './finderUtil';

import type { CodeFinder, UmlCodeContent } from './finder';

export class CodeBlockFinder implements CodeFinder {
private readonly URL_REGEX = /^(file|https?):\/\/.+$/;

Expand Down
3 changes: 2 additions & 1 deletion src/finder/gitHubFinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import $ from 'jquery';
import { Constants } from '../constants';
import { INCLUDE_REGEX, INCLUDESUB_REGEX } from '../directiveRegexes';

import type { DiffFinder, CodeFinder, UmlCodeContent, UmlDiffContent } from './finder';
import { extractSubIncludedText } from './finderUtil';

import type { DiffFinder, CodeFinder, UmlCodeContent, UmlDiffContent } from './finder';

export class GitHubFileViewFinder implements CodeFinder {
private readonly URL_REGEX = /^https:\/\/github\.com\/.*\/.*\.(plantuml|pu|puml|wsd)(\?.*)?$/;

Expand Down
4 changes: 2 additions & 2 deletions src/mutator/descriptionMutator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { CodeFinder } from '../finder/finder';

import { markAsIgnore, setDblclickHandlers, textToImage } from './mutatorUtil';

import type { CodeFinder } from '../finder/finder';

export const DescriptionMutator = {
async embedPlantUmlImages(finders: CodeFinder[], webPageUrl: string, $root: JQuery<Node>): Promise<void> {
await Promise.all(
Expand Down
4 changes: 2 additions & 2 deletions src/mutator/diffMutator.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import $ from 'jquery';

import type { DiffFinder } from '../finder/finder';

import { markAsIgnore, setDblclickHandlers, textsToImages } from './mutatorUtil';

import type { DiffFinder } from '../finder/finder';

export const DiffMutator = {
async embedPlantUmlImages(diffFinders: DiffFinder[], webPageUrl: string, $root: JQuery<Node>): Promise<void> {
await Promise.all(
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"extends": "@tsconfig/svelte/tsconfig.json",
"compilerOptions": {
"moduleResolution": "node",
"alwaysStrict": true,
Expand All @@ -14,5 +13,6 @@
"target": "esnext",
"module": "esnext"
},
"include": ["src/**/*", "__tests__/**/*", "./node_modules/@types", "./@types"]
"include": ["src/**/*", "__tests__/**/*", "./node_modules/@types", "./@types"],
"extends": "@tsconfig/svelte/tsconfig.json"
}
Loading

0 comments on commit e5c2a2c

Please sign in to comment.