From b176a8ec3f032a330f2f9f2d7b0ada84f5f6b6d9 Mon Sep 17 00:00:00 2001 From: jbukl Date: Thu, 9 Nov 2023 10:19:28 -0500 Subject: [PATCH] Fix hb import for media provider --- .env | 1 + .github/workflows/playwright.yml | 2 -- .vscode/settings.json | 3 -- ext/js/display/display-audio.js | 13 +++----- ext/js/display/popup-main.js | 31 ++++++------------- .../pages/settings/dictionary-controller.js | 10 ++---- .../settings/popup-preview-frame-main.js | 16 +++------- .../template-renderer-media-provider.js | 4 +-- package-lock.json | 19 ++++++++++++ package.json | 3 ++ playwright.config.js | 4 +-- 11 files changed, 48 insertions(+), 58 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000000..0bba336491 --- /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 3cd8c3b2a0..9c7bea577b 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 2480961b96..aa57bde2a3 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 6ab5773fff..2c1856b8bd 100644 --- a/ext/js/display/display-audio.js +++ b/ext/js/display/display-audio.js @@ -16,15 +16,10 @@ * along with this program. If not, see . */ -import {EventListenerCollection} from '../core.js'; -import {PopupMenu} from '../dom/popup-menu.js'; -import {AudioSystem} from '../media/audio-system.js'; -import {yomichan} from '../yomichan.js'; - -/* global - * AudioSystem - * PopupMenu - */ +import { EventListenerCollection } from '../core.js'; +import { PopupMenu } from '../dom/popup-menu.js'; +import { AudioSystem } from '../media/audio-system.js'; +import { yomichan } from '../yomichan.js'; export class DisplayAudio { constructor(display) { diff --git a/ext/js/display/popup-main.js b/ext/js/display/popup-main.js index 0599b736b1..29177f750b 100644 --- a/ext/js/display/popup-main.js +++ b/ext/js/display/popup-main.js @@ -16,27 +16,16 @@ * along with this program. If not, see . */ -import {log} from '../core.js'; -import {DocumentFocusController} from '../dom/document-focus-controller.js'; -import {HotkeyHandler} from '../input/hotkey-handler.js'; -import {JapaneseUtil} from '../language/sandbox/japanese-util.js'; -import {yomichan} from '../yomichan.js'; -import {DisplayAnki} from './display-anki.js'; -import {DisplayAudio} from './display-audio.js'; -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 - */ +import { log } from '../core.js'; +import { DocumentFocusController } from '../dom/document-focus-controller.js'; +import { HotkeyHandler } from '../input/hotkey-handler.js'; +import { JapaneseUtil } from '../language/sandbox/japanese-util.js'; +import { yomichan } from '../yomichan.js'; +import { DisplayAnki } from './display-anki.js'; +import { DisplayAudio } from './display-audio.js'; +import { DisplayProfileSelection } from './display-profile-selection.js'; +import { DisplayResizer } from './display-resizer.js'; +import { Display } from './display.js'; (async () => { try { diff --git a/ext/js/pages/settings/dictionary-controller.js b/ext/js/pages/settings/dictionary-controller.js index a9403e39f5..61c2ffd98c 100644 --- a/ext/js/pages/settings/dictionary-controller.js +++ b/ext/js/pages/settings/dictionary-controller.js @@ -16,13 +16,9 @@ * along with this program. If not, see . */ -import {EventListenerCollection, log} from '../../core.js'; -import {DictionaryWorker} from '../../language/dictionary-worker.js'; -import {yomichan} from '../../yomichan.js'; - -/* global - * DictionaryWorker - */ +import { EventListenerCollection, log } from '../../core.js'; +import { DictionaryWorker } from '../../language/dictionary-worker.js'; +import { yomichan } from '../../yomichan.js'; class DictionaryEntry { constructor(dictionaryController, fragment, index, dictionaryInfo) { diff --git a/ext/js/pages/settings/popup-preview-frame-main.js b/ext/js/pages/settings/popup-preview-frame-main.js index d10910fc47..3a05dbe7a3 100644 --- a/ext/js/pages/settings/popup-preview-frame-main.js +++ b/ext/js/pages/settings/popup-preview-frame-main.js @@ -16,17 +16,11 @@ * along with this program. If not, see . */ -import {PopupFactory} from '../../app/popup-factory.js'; -import {log} from '../../core.js'; -import {HotkeyHandler} from '../../input/hotkey-handler.js'; -import {yomichan} from '../../yomichan.js'; -import {PopupPreviewFrame} from './popup-preview-frame.js'; - -/* global - * HotkeyHandler - * PopupFactory - * PopupPreviewFrame - */ +import { PopupFactory } from '../../app/popup-factory.js'; +import { log } from '../../core.js'; +import { HotkeyHandler } from '../../input/hotkey-handler.js'; +import { yomichan } from '../../yomichan.js'; +import { PopupPreviewFrame } from './popup-preview-frame.js'; (async () => { try { diff --git a/ext/js/templates/sandbox/template-renderer-media-provider.js b/ext/js/templates/sandbox/template-renderer-media-provider.js index 9d77dd1fbe..d5033571ae 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 daddedb605..f3d6a17560 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,9 @@ "name": "yomitan", "version": "0.0.0", "license": "GPL-3.0-or-later", + "dependencies": { + "dotenv": "^16.3.1" + }, "devDependencies": { "@playwright/test": "^1.39.0", "@types/node": "^20.8.10", @@ -3412,6 +3415,17 @@ "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==", + "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 +11172,11 @@ "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==" + }, "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 1a6ebf84f8..0287a8a357 100644 --- a/package.json +++ b/package.json @@ -60,5 +60,8 @@ "stylelint-config-recommended": "^13.0.0", "vitest": "^0.34.6", "wanakana": "^5.2.0" + }, + "dependencies": { + "dotenv": "^16.3.1" } } diff --git a/playwright.config.js b/playwright.config.js index acb3e1afdd..24f38bc8c4 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -15,13 +15,13 @@ * along with this program. If not, see . */ // @ts-check -import {defineConfig, devices} from '@playwright/test'; +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