Sandbox script folders (#1837)

* Move scripts

* Update paths

* Fix ordering

* Simplify eslint rules
This commit is contained in:
toasted-nutbread 2021-07-17 17:10:25 -04:00 committed by GitHub
parent 74381302c7
commit fafa746a63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 37 additions and 55 deletions

View File

@ -110,13 +110,7 @@
{
"files": [
"ext/js/core.js",
"ext/js/data/anki-note-data-creator.js",
"ext/js/display/pronunciation-generator.js",
"ext/js/display/structured-content-generator.js",
"ext/js/dom/css-style-applier.js",
"ext/js/language/dictionary-data-util.js",
"ext/js/templates/template-renderer.js",
"ext/js/templates/template-renderer-media-provider.js"
"ext/js/**/sandbox/**/*.js"
],
"env": {
"webextensions": false
@ -126,13 +120,7 @@
"files": ["ext/**/*.js"],
"excludedFiles": [
"ext/js/core.js",
"ext/js/data/anki-note-data-creator.js",
"ext/js/display/pronunciation-generator.js",
"ext/js/display/structured-content-generator.js",
"ext/js/dom/css-style-applier.js",
"ext/js/language/dictionary-data-util.js",
"ext/js/templates/template-renderer.js",
"ext/js/templates/template-renderer-media-provider.js"
"ext/js/**/sandbox/**/*.js"
],
"globals": {
"serializeError": "readonly",
@ -159,13 +147,7 @@
"excludedFiles": [
"ext/js/core.js",
"ext/js/yomichan.js",
"ext/js/data/anki-note-data-creator.js",
"ext/js/display/pronunciation-generator.js",
"ext/js/display/structured-content-generator.js",
"ext/js/dom/css-style-applier.js",
"ext/js/language/dictionary-data-util.js",
"ext/js/templates/template-renderer.js",
"ext/js/templates/template-renderer-media-provider.js"
"ext/js/**/sandbox/**/*.js"
],
"globals": {
"yomichan": "readonly"
@ -217,9 +199,9 @@
"ext/js/general/regex-util.js",
"ext/js/general/text-source-map.js",
"ext/js/language/deinflector.js",
"ext/js/language/dictionary-data-util.js",
"ext/js/language/dictionary-database.js",
"ext/js/language/japanese-util.js",
"ext/js/language/sandbox/dictionary-data-util.js",
"ext/js/language/sandbox/japanese-util.js",
"ext/js/language/translator.js",
"ext/js/media/audio-downloader.js",
"ext/js/media/media-util.js",

View File

@ -45,17 +45,17 @@ class TranslatorVM extends DatabaseVM {
async prepare(dictionaryDirectory, dictionaryName) {
this.execute([
'js/core.js',
'js/data/anki-note-data-creator.js',
'js/data/sandbox/anki-note-data-creator.js',
'js/data/database.js',
'js/data/json-schema.js',
'js/general/cache-map.js',
'js/general/regex-util.js',
'js/general/text-source-map.js',
'js/language/deinflector.js',
'js/language/dictionary-data-util.js',
'js/language/sandbox/dictionary-data-util.js',
'js/language/dictionary-importer.js',
'js/language/dictionary-database.js',
'js/language/japanese-util.js',
'js/language/sandbox/japanese-util.js',
'js/language/translator.js',
'js/media/media-util.js'
]);

View File

@ -3,7 +3,7 @@
## Helpers
Yomichan supports several custom Handlebars helpers for rendering templates.
The source code for these templates can be found [here](../ext/js/templates/template-renderer.js).
The source code for these templates can be found [here](../ext/js/templates/sandbox/template-renderer.js).
### `dumpObject`

View File

@ -42,9 +42,9 @@
<script src="/js/general/regex-util.js"></script>
<script src="/js/general/text-source-map.js"></script>
<script src="/js/language/deinflector.js"></script>
<script src="/js/language/dictionary-data-util.js"></script>
<script src="/js/language/dictionary-database.js"></script>
<script src="/js/language/japanese-util.js"></script>
<script src="/js/language/sandbox/dictionary-data-util.js"></script>
<script src="/js/language/sandbox/japanese-util.js"></script>
<script src="/js/language/translator.js"></script>
<script src="/js/media/audio-downloader.js"></script>
<script src="/js/media/media-util.js"></script>

View File

@ -110,9 +110,9 @@
<script src="/js/display/display-resizer.js"></script>
<script src="/js/display/element-overflow-controller.js"></script>
<script src="/js/display/option-toggle-hotkey-handler.js"></script>
<script src="/js/display/pronunciation-generator.js"></script>
<script src="/js/display/query-parser.js"></script>
<script src="/js/display/structured-content-generator.js"></script>
<script src="/js/display/sandbox/pronunciation-generator.js"></script>
<script src="/js/display/sandbox/structured-content-generator.js"></script>
<script src="/js/dom/document-focus-controller.js"></script>
<script src="/js/dom/document-util.js"></script>
<script src="/js/dom/dom-text-scanner.js"></script>
@ -125,8 +125,8 @@
<script src="/js/input/hotkey-handler.js"></script>
<script src="/js/input/hotkey-help-controller.js"></script>
<script src="/js/input/hotkey-util.js"></script>
<script src="/js/language/dictionary-data-util.js"></script>
<script src="/js/language/japanese-util.js"></script>
<script src="/js/language/sandbox/dictionary-data-util.js"></script>
<script src="/js/language/sandbox/japanese-util.js"></script>
<script src="/js/language/text-scanner.js"></script>
<script src="/js/media/audio-system.js"></script>
<script src="/js/media/media-loader.js"></script>

View File

@ -94,12 +94,12 @@
<script src="/js/display/display-notification.js"></script>
<script src="/js/display/element-overflow-controller.js"></script>
<script src="/js/display/option-toggle-hotkey-handler.js"></script>
<script src="/js/display/pronunciation-generator.js"></script>
<script src="/js/display/query-parser.js"></script>
<script src="/js/display/sandbox/pronunciation-generator.js"></script>
<script src="/js/display/sandbox/structured-content-generator.js"></script>
<script src="/js/display/search-action-popup-controller.js"></script>
<script src="/js/display/search-display-controller.js"></script>
<script src="/js/display/search-persistent-state-controller.js"></script>
<script src="/js/display/structured-content-generator.js"></script>
<script src="/js/dom/document-focus-controller.js"></script>
<script src="/js/dom/document-util.js"></script>
<script src="/js/dom/dom-text-scanner.js"></script>
@ -111,8 +111,8 @@
<script src="/js/input/hotkey-handler.js"></script>
<script src="/js/input/hotkey-help-controller.js"></script>
<script src="/js/input/hotkey-util.js"></script>
<script src="/js/language/dictionary-data-util.js"></script>
<script src="/js/language/japanese-util.js"></script>
<script src="/js/language/sandbox/dictionary-data-util.js"></script>
<script src="/js/language/sandbox/japanese-util.js"></script>
<script src="/js/language/text-scanner.js"></script>
<script src="/js/media/audio-system.js"></script>
<script src="/js/media/media-loader.js"></script>

View File

@ -3449,10 +3449,10 @@
<script src="/js/general/object-property-accessor.js"></script>
<script src="/js/general/task-accumulator.js"></script>
<script src="/js/input/hotkey-util.js"></script>
<script src="/js/language/dictionary-data-util.js"></script>
<script src="/js/language/dictionary-database.js"></script>
<script src="/js/language/dictionary-importer.js"></script>
<script src="/js/language/japanese-util.js"></script>
<script src="/js/language/sandbox/dictionary-data-util.js"></script>
<script src="/js/language/sandbox/japanese-util.js"></script>
<script src="/js/media/audio-system.js"></script>
<script src="/js/media/media-util.js"></script>
<script src="/js/media/text-to-speech-audio.js"></script>

View File

@ -39,9 +39,9 @@ self.importScripts(
'/js/general/regex-util.js',
'/js/general/text-source-map.js',
'/js/language/deinflector.js',
'/js/language/dictionary-data-util.js',
'/js/language/dictionary-database.js',
'/js/language/japanese-util.js',
'/js/language/sandbox/dictionary-data-util.js',
'/js/language/sandbox/japanese-util.js',
'/js/language/translator.js',
'/js/media/audio-downloader.js',
'/js/media/media-util.js',

View File

@ -17,16 +17,16 @@
<!-- Scripts -->
<script src="/lib/handlebars.min.js"></script>
<script src="/js/data/anki-note-data-creator.js"></script>
<script src="/js/display/structured-content-generator.js"></script>
<script src="/js/dom/css-style-applier.js"></script>
<script src="/js/language/dictionary-data-util.js"></script>
<script src="/js/language/japanese-util.js"></script>
<script src="/js/templates/template-renderer.js"></script>
<script src="/js/templates/template-renderer-frame-api.js"></script>
<script src="/js/templates/template-renderer-media-provider.js"></script>
<script src="/js/data/sandbox/anki-note-data-creator.js"></script>
<script src="/js/display/sandbox/structured-content-generator.js"></script>
<script src="/js/dom/sandbox/css-style-applier.js"></script>
<script src="/js/language/sandbox/dictionary-data-util.js"></script>
<script src="/js/language/sandbox/japanese-util.js"></script>
<script src="/js/templates/sandbox/template-renderer.js"></script>
<script src="/js/templates/sandbox/template-renderer-frame-api.js"></script>
<script src="/js/templates/sandbox/template-renderer-media-provider.js"></script>
<script src="/js/templates/template-renderer-frame-main.js"></script>
<script src="/js/templates/sandbox/template-renderer-frame-main.js"></script>
</body>
</html>

View File

@ -43,10 +43,10 @@ async function createVM() {
vm.execute([
'js/data/anki-note-builder.js',
'js/data/anki-util.js',
'js/dom/css-style-applier.js',
'js/display/structured-content-generator.js',
'js/templates/template-renderer.js',
'js/templates/template-renderer-media-provider.js',
'js/dom/sandbox/css-style-applier.js',
'js/display/sandbox/structured-content-generator.js',
'js/templates/sandbox/template-renderer.js',
'js/templates/sandbox/template-renderer-media-provider.js',
'lib/handlebars.min.js'
]);

View File

@ -22,7 +22,7 @@ const {VM} = require('../dev/vm');
const vm = new VM();
vm.execute([
'lib/wanakana.min.js',
'js/language/japanese-util.js',
'js/language/sandbox/japanese-util.js',
'js/general/text-source-map.js'
]);
const [JapaneseUtil, TextSourceMap, wanakana] = vm.get(['JapaneseUtil', 'TextSourceMap', 'wanakana']);