From 41cff833abdfc4f8ca9b8d426c1b382891fcf934 Mon Sep 17 00:00:00 2001 From: jbukl Date: Thu, 9 Nov 2023 10:19:28 -0500 Subject: Fix hb import for media provider --- .env | 1 + .github/workflows/playwright.yml | 2 -- .vscode/settings.json | 3 --- ext/js/display/display-audio.js | 5 ----- ext/js/display/popup-main.js | 11 ----------- ext/js/pages/settings/dictionary-controller.js | 4 ---- ext/js/pages/settings/popup-preview-frame-main.js | 6 ------ .../sandbox/template-renderer-media-provider.js | 4 +--- package-lock.json | 19 +++++++++++++++++++ package.json | 1 + playwright.config.js | 2 +- 11 files changed, 23 insertions(+), 35 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 00000000..0bba3364 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS=1 \ No newline at end of file diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 3cd8c3b2..9c7bea57 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -9,8 +9,6 @@ jobs: playwright: timeout-minutes: 60 runs-on: ubuntu-latest - env: - PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS: 1 steps: - name: Remove all fonts run: rm -rf /usr/share/fonts diff --git a/.vscode/settings.json b/.vscode/settings.json index 2480961b..aa57bde2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,8 +6,5 @@ "source.fixAll.eslint": true, }, "eslint.format.enable": true, - "playwright.env": { - "PW_EXPERIMENTAL_SERVICE_WORKER_NETWORK_EVENTS": 1 - }, "javascript.preferences.importModuleSpecifierEnding": "js", } diff --git a/ext/js/display/display-audio.js b/ext/js/display/display-audio.js index 6ab5773f..b829dd1a 100644 --- a/ext/js/display/display-audio.js +++ b/ext/js/display/display-audio.js @@ -21,11 +21,6 @@ import {PopupMenu} from '../dom/popup-menu.js'; import {AudioSystem} from '../media/audio-system.js'; import {yomichan} from '../yomichan.js'; -/* global - * AudioSystem - * PopupMenu - */ - export class DisplayAudio { constructor(display) { this._display = display; diff --git a/ext/js/display/popup-main.js b/ext/js/display/popup-main.js index 0599b736..b82458fa 100644 --- a/ext/js/display/popup-main.js +++ b/ext/js/display/popup-main.js @@ -27,17 +27,6 @@ import {DisplayProfileSelection} from './display-profile-selection.js'; import {DisplayResizer} from './display-resizer.js'; import {Display} from './display.js'; -/* global - * Display - * DisplayAnki - * DisplayAudio - * DisplayProfileSelection - * DisplayResizer - * DocumentFocusController - * HotkeyHandler - * JapaneseUtil - */ - (async () => { try { const documentFocusController = new DocumentFocusController(); diff --git a/ext/js/pages/settings/dictionary-controller.js b/ext/js/pages/settings/dictionary-controller.js index a9403e39..05f4f396 100644 --- a/ext/js/pages/settings/dictionary-controller.js +++ b/ext/js/pages/settings/dictionary-controller.js @@ -20,10 +20,6 @@ import {EventListenerCollection, log} from '../../core.js'; import {DictionaryWorker} from '../../language/dictionary-worker.js'; import {yomichan} from '../../yomichan.js'; -/* global - * DictionaryWorker - */ - class DictionaryEntry { constructor(dictionaryController, fragment, index, dictionaryInfo) { this._dictionaryController = dictionaryController; diff --git a/ext/js/pages/settings/popup-preview-frame-main.js b/ext/js/pages/settings/popup-preview-frame-main.js index d10910fc..0b69fea0 100644 --- a/ext/js/pages/settings/popup-preview-frame-main.js +++ b/ext/js/pages/settings/popup-preview-frame-main.js @@ -22,12 +22,6 @@ import {HotkeyHandler} from '../../input/hotkey-handler.js'; import {yomichan} from '../../yomichan.js'; import {PopupPreviewFrame} from './popup-preview-frame.js'; -/* global - * HotkeyHandler - * PopupFactory - * PopupPreviewFrame - */ - (async () => { try { await yomichan.prepare(); diff --git a/ext/js/templates/sandbox/template-renderer-media-provider.js b/ext/js/templates/sandbox/template-renderer-media-provider.js index 9d77dd1f..33ddec21 100644 --- a/ext/js/templates/sandbox/template-renderer-media-provider.js +++ b/ext/js/templates/sandbox/template-renderer-media-provider.js @@ -16,9 +16,7 @@ * along with this program. If not, see . */ -/* global - * Handlebars - */ +import {Handlebars} from '../../../lib/handlebars.js'; export class TemplateRendererMediaProvider { constructor() { diff --git a/package-lock.json b/package-lock.json index daddedb6..03effc13 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "css": "^3.0.0", "dexie": "^3.2.4", "dexie-export-import": "^4.0.7", + "dotenv": "^16.3.1", "esbuild": "^0.19.5", "eslint": "^8.52.0", "eslint-plugin-header": "^3.1.1", @@ -3412,6 +3413,18 @@ "node": ">=12" } }, + "node_modules/dotenv": { + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -11158,6 +11171,12 @@ "webidl-conversions": "^7.0.0" } }, + "dotenv": { + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "dev": true + }, "eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", diff --git a/package.json b/package.json index 1a6ebf84..edb40411 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "css": "^3.0.0", "dexie": "^3.2.4", "dexie-export-import": "^4.0.7", + "dotenv": "^16.3.1", "esbuild": "^0.19.5", "eslint": "^8.52.0", "eslint-plugin-header": "^3.1.1", diff --git a/playwright.config.js b/playwright.config.js index acb3e1af..6bf645c4 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -21,7 +21,7 @@ import {defineConfig, devices} from '@playwright/test'; * Read environment variables from file. * https://github.com/motdotla/dotenv */ -// require('dotenv').config(); +import 'dotenv/config'; /** * @see https://playwright.dev/docs/test-configuration -- cgit v1.2.3