Skip to content

Commit

Permalink
refactor!: Migrate from webpack to snowpack for build step (#583)
Browse files Browse the repository at this point in the history
- Move to snowpack for faster more direct modern web build.
  - Use npm-force-resolution to update snowpack's esbuild version. This allows earlier access to new features like top level await.
- Add `checktypes` script since build skips typechecking for speed.
- Remove extraneous export from options.ts
- Update supported chrome version in manifest due to explicit output change.
- Add custom tsconfig.json just for `ts-node` scripts (`update-db`) since `ts-node` doesn't support ES modules.
- Add code for removing test only exports in preparation for unit test setup coming soon.
- Have LitToast shim interface extend Element explicitly since explicit typecheck fails otherwise.

BREAKING CHANGE: This version includes optional chaining requiring Chrome >=80
  • Loading branch information
melink14 authored Jul 16, 2021
1 parent 3b956a0 commit 1bdd3d3
Show file tree
Hide file tree
Showing 12 changed files with 2,740 additions and 14,644 deletions.
10 changes: 6 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,25 @@
"webextensions": true
},
"plugins": ["eslint-plugin-tsdoc", "sort-imports-es6-autofix"],
"ignorePatterns": "dist",
"ignorePatterns": ["dist"],
"rules": {
"tsdoc/syntax": "error",
"linebreak-style": ["error", "unix"],
"no-tabs": "error",
"sort-imports-es6-autofix/sort-imports-es6": "error",
"node/no-unpublished-import": "off",
"unicode-bom": "error",
"promise/prefer-await-to-then": "error",
"@typescript-eslint/unbound-method": "error",
"curly": "error"
},
"overrides": [
{
"files": ["**/*.ts", "**/*.js"],
"files": ["**/*.ts"],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"tsdoc/syntax": "error",
"@typescript-eslint/unbound-method": "error"
}
}
]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ jobs:
node-version: '14'
- run: npm ci
- run: npm run lint
- run: npm run checktypes
- run: npm run build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
dist
.vscode
2 changes: 1 addition & 1 deletion extension/background.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<html>
<head>
<script src="background.js"></script>
<script type="module" src="background.js"></script>
</head>
</html>
1 change: 1 addition & 0 deletions extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"manifest_version": 2,
"name": "rikaikun",
"version": "1.2.6",
"minimum_chrome_version": "80",
"description": "rikaikun shows the reading and English definition of Japanese words when you hover over Japanese text in the browser.",
"icons": {
"48": "images/icon48.png",
Expand Down
4 changes: 2 additions & 2 deletions extension/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type OptionEvent = {
__update: Partial<Config>;
};

export class OptionsForm extends LitElement {
class OptionsForm extends LitElement {
private content: Promise<TemplateResult> = this.fetchAndRender();

render() {
Expand Down Expand Up @@ -393,7 +393,7 @@ customElements.define('options-form', OptionsForm);

// TODO(https://github.com/Victor-Bernabe/lit-toast/issues/2):
// Remove this if the component supports types directly.
interface LitToast {
interface LitToast extends Element {
show(text: string, duration: number): Promise<void>;
}
declare global {
Expand Down
Loading

0 comments on commit 1bdd3d3

Please sign in to comment.