mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 17:11:40 -05:00
Remove @src magic
Unsupported by yarn berry, I think
This commit is contained in:
parent
7f446346a6
commit
e7733b3666
79 changed files with 352 additions and 355 deletions
|
@ -2,33 +2,33 @@
|
|||
|
||||
/* tslint:disable:import-spacing */
|
||||
|
||||
import * as proxy_background from "@src/lib/browser_proxy_background"
|
||||
import * as proxy_background from "./lib/browser_proxy_background"
|
||||
|
||||
import * as controller from "@src/lib/controller"
|
||||
import * as perf from "@src/perf"
|
||||
import { listenForCounters } from "@src/perf"
|
||||
import * as messaging from "@src/lib/messaging"
|
||||
import * as excmds_background from "@src/.excmds_background.generated"
|
||||
import { CmdlineCmds } from "@src/background/commandline_cmds"
|
||||
import { EditorCmds } from "@src/background/editor"
|
||||
import * as convert from "@src/lib/convert"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as dom from "@src/lib/dom"
|
||||
import * as download_background from "@src/background/download_background"
|
||||
import * as itertools from "@src/lib/itertools"
|
||||
import * as keyseq from "@src/lib/keyseq"
|
||||
import * as request from "@src/lib/requests"
|
||||
import * as native from "@src/lib/native"
|
||||
import state from "@src/state"
|
||||
import * as webext from "@src/lib/webext"
|
||||
import { AutoContain } from "@src/lib/autocontainers"
|
||||
import * as extension_info from "@src/lib/extension_info"
|
||||
import * as omnibox from "@src/background/omnibox"
|
||||
import * as controller from "./lib/controller"
|
||||
import * as perf from "./perf"
|
||||
import { listenForCounters } from "./perf"
|
||||
import * as messaging from "./lib/messaging"
|
||||
import * as excmds_background from "./.excmds_background.generated"
|
||||
import { CmdlineCmds } from "./background/commandline_cmds"
|
||||
import { EditorCmds } from "./background/editor"
|
||||
import * as convert from "./lib/convert"
|
||||
import * as config from "./lib/config"
|
||||
import * as dom from "./lib/dom"
|
||||
import * as download_background from "./background/download_background"
|
||||
import * as itertools from "./lib/itertools"
|
||||
import * as keyseq from "./lib/keyseq"
|
||||
import * as request from "./lib/requests"
|
||||
import * as native from "./lib/native"
|
||||
import state from "./state"
|
||||
import * as webext from "./lib/webext"
|
||||
import { AutoContain } from "./lib/autocontainers"
|
||||
import * as extension_info from "./lib/extension_info"
|
||||
import * as omnibox from "./background/omnibox"
|
||||
import * as R from "ramda"
|
||||
import * as webrequests from "@src/background/webrequests"
|
||||
import * as commands from "@src/background/commands"
|
||||
import * as meta from "@src/background/meta"
|
||||
import * as Logging from "@src/lib/logging"
|
||||
import * as webrequests from "./background/webrequests"
|
||||
import * as commands from "./background/commands"
|
||||
import * as meta from "./background/meta"
|
||||
import * as Logging from "./lib/logging"
|
||||
|
||||
// Add various useful modules to the window for debugging
|
||||
;(window as any).tri = Object.assign(Object.create(null), {
|
||||
|
@ -53,7 +53,7 @@ import * as Logging from "@src/lib/logging"
|
|||
meta,
|
||||
})
|
||||
|
||||
import { HintingCmds } from "@src/background/hinting"
|
||||
import { HintingCmds } from "./background/hinting"
|
||||
// Set up our controller to execute background-mode excmds. All code
|
||||
// running from this entry point, which is to say, everything in the
|
||||
// background script, will use the excmds that we give to the module
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { getCommandlineFns } from "@src/lib/commandline_cmds"
|
||||
import { messageActiveTab } from "@src/lib/messaging"
|
||||
import { getCommandlineFns } from "../lib/commandline_cmds"
|
||||
import { messageActiveTab } from "../lib/messaging"
|
||||
|
||||
const functions = getCommandlineFns({} as any)
|
||||
type ft = typeof functions
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { useractions } from "@src/background/user_actions"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as keyseq from "@src/lib/keyseq"
|
||||
import * as controller from "@src/lib/controller"
|
||||
import { useractions } from "../background/user_actions"
|
||||
import * as config from "../lib/config"
|
||||
import * as keyseq from "../lib/keyseq"
|
||||
import * as controller from "../lib/controller"
|
||||
|
||||
function makelistener(commands: Array<browser.commands.Command>) {
|
||||
return (command_name: string) => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as controller from "@src/lib/controller"
|
||||
import * as Native from "@src/lib/native"
|
||||
import * as controller from "../lib/controller"
|
||||
import * as Native from "../lib/native"
|
||||
|
||||
export async function source(filename = "auto") {
|
||||
let rctext = ""
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
* Background download-related functions
|
||||
*/
|
||||
|
||||
import * as Native from "@src/lib/native"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as Native from "../lib/native"
|
||||
import * as config from "../lib/config"
|
||||
import * as R from "ramda"
|
||||
import { getDownloadFilenameForUrl } from "@src/lib/url_util"
|
||||
import { getDownloadFilenameForUrl } from "../lib/url_util"
|
||||
|
||||
/** Construct an object URL string from a given data URL
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { messageActiveTab } from "@src/lib/messaging"
|
||||
import * as _EditorCmds from "@src/lib/editor"
|
||||
import { messageActiveTab } from "../lib/messaging"
|
||||
import * as _EditorCmds from "../lib/editor"
|
||||
|
||||
type cmdsType = typeof _EditorCmds
|
||||
type ArgumentsType<T> = T extends (elem, ...args: infer U) => any ? U : never
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { messageActiveTab } from "@src/lib/messaging"
|
||||
import * as hinting_content from "@src/content/hinting"
|
||||
import { messageActiveTab } from "../lib/messaging"
|
||||
import * as hinting_content from "../content/hinting"
|
||||
|
||||
const functions = hinting_content.getHintCommands()
|
||||
type ft = typeof functions
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { messageTab } from "@src/lib/messaging"
|
||||
import { messageTab } from "../lib/messaging"
|
||||
|
||||
export async function getTridactylTabs(
|
||||
tabs?: browser.tabs.Tab[],
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Allows users to enter tridactyl commands from the omnibox by using
|
||||
* the `:` keyword.
|
||||
*/
|
||||
import * as controller from "@src/lib/controller"
|
||||
import * as controller from "../lib/controller"
|
||||
|
||||
export function inputEnteredListener(
|
||||
input: string,
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
* https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/User_actions
|
||||
*/
|
||||
|
||||
import * as excmds from "@src/.excmds_background.generated"
|
||||
import * as excmds from "../.excmds_background.generated"
|
||||
import * as R from "ramda"
|
||||
import * as config from "@src/lib/config"
|
||||
import { getTridactylTabs } from "@src/background/meta"
|
||||
import * as config from "../lib/config"
|
||||
import { getTridactylTabs } from "../background/meta"
|
||||
|
||||
function escapehatch() {
|
||||
if (config.get("escapehatchsidebarhack") == "true") {
|
||||
|
|
|
@ -17,37 +17,37 @@
|
|||
|
||||
/** Script used in the commandline iframe. Communicates with background. */
|
||||
|
||||
import * as SELF from "@src/commandline_frame"
|
||||
import { CompletionSourceFuse } from "@src/completions"
|
||||
import { AproposCompletionSource } from "@src/completions/Apropos"
|
||||
import { BindingsCompletionSource } from "@src/completions/Bindings"
|
||||
import { BmarkCompletionSource } from "@src/completions/Bmark"
|
||||
import { CompositeCompletionSource } from "@src/completions/Composite"
|
||||
import { ExcmdCompletionSource } from "@src/completions/Excmd"
|
||||
import { ExtensionsCompletionSource } from "@src/completions/Extensions"
|
||||
import { FileSystemCompletionSource } from "@src/completions/FileSystem"
|
||||
import { GuisetCompletionSource } from "@src/completions/Guiset"
|
||||
import { HelpCompletionSource } from "@src/completions/Help"
|
||||
import { HistoryCompletionSource } from "@src/completions/History"
|
||||
import { PreferenceCompletionSource } from "@src/completions/Preferences"
|
||||
import { RssCompletionSource } from "@src/completions/Rss"
|
||||
import { SessionsCompletionSource } from "@src/completions/Sessions"
|
||||
import { SettingsCompletionSource } from "@src/completions/Settings"
|
||||
import { BufferCompletionSource } from "@src/completions/Tab"
|
||||
import { TabAllCompletionSource } from "@src/completions/TabAll"
|
||||
import { ThemeCompletionSource } from "@src/completions/Theme"
|
||||
import { WindowCompletionSource } from "@src/completions/Window"
|
||||
import { contentState } from "@src/content/state_content"
|
||||
import { theme } from "@src/content/styling"
|
||||
import { getCommandlineFns } from "@src/lib/commandline_cmds"
|
||||
import * as tri_editor from "@src/lib/editor"
|
||||
import "@src/lib/html-tagged-template"
|
||||
import Logger from "@src/lib/logging"
|
||||
import * as Messaging from "@src/lib/messaging"
|
||||
import "@src/lib/number.clamp"
|
||||
import * as genericParser from "@src/parsers/genericmode"
|
||||
import * as perf from "@src/perf"
|
||||
import state, * as State from "@src/state"
|
||||
import * as SELF from "./commandline_frame"
|
||||
import { CompletionSourceFuse } from "./completions"
|
||||
import { AproposCompletionSource } from "./completions/Apropos"
|
||||
import { BindingsCompletionSource } from "./completions/Bindings"
|
||||
import { BmarkCompletionSource } from "./completions/Bmark"
|
||||
import { CompositeCompletionSource } from "./completions/Composite"
|
||||
import { ExcmdCompletionSource } from "./completions/Excmd"
|
||||
import { ExtensionsCompletionSource } from "./completions/Extensions"
|
||||
import { FileSystemCompletionSource } from "./completions/FileSystem"
|
||||
import { GuisetCompletionSource } from "./completions/Guiset"
|
||||
import { HelpCompletionSource } from "./completions/Help"
|
||||
import { HistoryCompletionSource } from "./completions/History"
|
||||
import { PreferenceCompletionSource } from "./completions/Preferences"
|
||||
import { RssCompletionSource } from "./completions/Rss"
|
||||
import { SessionsCompletionSource } from "./completions/Sessions"
|
||||
import { SettingsCompletionSource } from "./completions/Settings"
|
||||
import { BufferCompletionSource } from "./completions/Tab"
|
||||
import { TabAllCompletionSource } from "./completions/TabAll"
|
||||
import { ThemeCompletionSource } from "./completions/Theme"
|
||||
import { WindowCompletionSource } from "./completions/Window"
|
||||
import { contentState } from "./content/state_content"
|
||||
import { theme } from "./content/styling"
|
||||
import { getCommandlineFns } from "./lib/commandline_cmds"
|
||||
import * as tri_editor from "./lib/editor"
|
||||
import "./lib/html-tagged-template"
|
||||
import Logger from "./lib/logging"
|
||||
import * as Messaging from "./lib/messaging"
|
||||
import "./lib/number.clamp"
|
||||
import * as genericParser from "./parsers/genericmode"
|
||||
import * as perf from "./perf"
|
||||
import state, * as State from "./state"
|
||||
import * as R from "ramda"
|
||||
import { KeyEventLike } from "./lib/keyseq"
|
||||
|
||||
|
|
|
@ -11,11 +11,11 @@ Concrete completion classes have been moved to src/completions/.
|
|||
*/
|
||||
|
||||
import Fuse from "fuse.js"
|
||||
import { enumerate } from "@src/lib/itertools"
|
||||
import { toNumber } from "@src/lib/convert"
|
||||
import * as aliases from "@src/lib/aliases"
|
||||
import { backoff } from "@src/lib/patience"
|
||||
import * as config from "@src/lib/config"
|
||||
import { enumerate } from "./lib/itertools"
|
||||
import { toNumber } from "./lib/convert"
|
||||
import * as aliases from "./lib/aliases"
|
||||
import { backoff } from "./lib/patience"
|
||||
import * as config from "./lib/config"
|
||||
|
||||
export const DEFAULT_FAVICON = browser.runtime.getURL(
|
||||
"static/defaultFavicon.svg",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as Completions from "@src/completions"
|
||||
import * as Metadata from "@src/.metadata.generated"
|
||||
import * as aliases from "@src/lib/aliases"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as Completions from "../completions"
|
||||
import * as Metadata from "../.metadata.generated"
|
||||
import * as aliases from "../lib/aliases"
|
||||
import * as config from "../lib/config"
|
||||
|
||||
class AproposCompletionOption extends Completions.CompletionOptionHTML
|
||||
implements Completions.CompletionOptionFuse {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as Completions from "@src/completions"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as Binding from "@src/lib/binding"
|
||||
import * as Completions from "../completions"
|
||||
import * as config from "../lib/config"
|
||||
import * as Binding from "../lib/binding"
|
||||
|
||||
class BindingsCompletionOption extends Completions.CompletionOptionHTML
|
||||
implements Completions.CompletionOptionFuse {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as Completions from "@src/completions"
|
||||
import * as providers from "@src/completions/providers"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as Completions from "../completions"
|
||||
import * as providers from "../completions/providers"
|
||||
import * as config from "../lib/config"
|
||||
|
||||
class BmarkCompletionOption
|
||||
extends Completions.CompletionOptionHTML
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import * as Completions from "@src/completions"
|
||||
import * as ExcmdCompletions from "@src/completions/Excmd"
|
||||
import * as Metadata from "@src/.metadata.generated"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as aliases from "@src/lib/aliases"
|
||||
import * as Completions from "../completions"
|
||||
import * as ExcmdCompletions from "../completions/Excmd"
|
||||
import * as Metadata from "../.metadata.generated"
|
||||
import * as config from "../lib/config"
|
||||
import * as aliases from "../lib/aliases"
|
||||
|
||||
const PREFIX = "composite"
|
||||
const regex = new RegExp("^" + PREFIX + " ")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as Completions from "@src/completions"
|
||||
import * as Metadata from "@src/.metadata.generated"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as aliases from "@src/lib/aliases"
|
||||
import * as Completions from "../completions"
|
||||
import * as Metadata from "../.metadata.generated"
|
||||
import * as config from "../lib/config"
|
||||
import * as aliases from "../lib/aliases"
|
||||
|
||||
export class ExcmdCompletionOption extends Completions.CompletionOptionHTML
|
||||
implements Completions.CompletionOptionFuse {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as Extensions from "@src/lib/extension_info"
|
||||
import * as Completions from "@src/completions"
|
||||
import * as Extensions from "../lib/extension_info"
|
||||
import * as Completions from "../completions"
|
||||
|
||||
class ExtensionsCompletionOption extends Completions.CompletionOptionHTML
|
||||
implements Completions.CompletionOptionFuse {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as Completions from "@src/completions"
|
||||
import * as Native from "@src/lib/native"
|
||||
import * as Completions from "../completions"
|
||||
import * as Native from "../lib/native"
|
||||
|
||||
class FileSystemCompletionOption extends Completions.CompletionOptionHTML
|
||||
implements Completions.CompletionOptionFuse {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { activeTabId } from "@src/lib/webext"
|
||||
import * as Messaging from "@src/lib/messaging"
|
||||
import { activeTabId } from "../lib/webext"
|
||||
import * as Messaging from "../lib/messaging"
|
||||
import * as Completions from "../completions"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as config from "../lib/config"
|
||||
|
||||
class FindCompletionOption
|
||||
extends Completions.CompletionOptionHTML
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as Completions from "@src/completions"
|
||||
import { potentialRules, metaRules } from "@src/lib/css_util"
|
||||
import * as Completions from "../completions"
|
||||
import { potentialRules, metaRules } from "../lib/css_util"
|
||||
|
||||
class GuisetCompletionOption extends Completions.CompletionOptionHTML
|
||||
implements Completions.CompletionOptionFuse {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as Completions from "@src/completions"
|
||||
import * as Metadata from "@src/.metadata.generated"
|
||||
import * as aliases from "@src/lib/aliases"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as Completions from "../completions"
|
||||
import * as Metadata from "../.metadata.generated"
|
||||
import * as aliases from "../lib/aliases"
|
||||
import * as config from "../lib/config"
|
||||
|
||||
class HelpCompletionOption extends Completions.CompletionOptionHTML
|
||||
implements Completions.CompletionOptionFuse {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as Completions from "@src/completions"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as providers from "@src/completions/providers"
|
||||
import * as Completions from "../completions"
|
||||
import * as config from "../lib/config"
|
||||
import * as providers from "../completions/providers"
|
||||
|
||||
class HistoryCompletionOption extends Completions.CompletionOptionHTML
|
||||
implements Completions.CompletionOptionFuse {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as Completions from "@src/completions"
|
||||
import * as Native from "@src/lib/native"
|
||||
import * as Completions from "../completions"
|
||||
import * as Native from "../lib/native"
|
||||
|
||||
class PreferenceCompletionOption extends Completions.CompletionOptionHTML
|
||||
implements Completions.CompletionOptionFuse {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as Messaging from "@src/lib/messaging"
|
||||
import * as Completions from "@src/completions"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as Messaging from "../lib/messaging"
|
||||
import * as Completions from "../completions"
|
||||
import * as config from "../lib/config"
|
||||
|
||||
class RssCompletionOption
|
||||
extends Completions.CompletionOptionHTML
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { browserBg } from "@src/lib/webext"
|
||||
import * as Completions from "@src/completions"
|
||||
import * as config from "@src/lib/config"
|
||||
import { browserBg } from "../lib/webext"
|
||||
import * as Completions from "../completions"
|
||||
import * as config from "../lib/config"
|
||||
|
||||
function computeDate(session) {
|
||||
let howLong = Math.round(
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as Completions from "@src/completions"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as metadata from "@src/.metadata.generated"
|
||||
import * as Completions from "../completions"
|
||||
import * as config from "../lib/config"
|
||||
import * as metadata from "../.metadata.generated"
|
||||
|
||||
class SettingsCompletionOption
|
||||
extends Completions.CompletionOptionHTML
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import * as Perf from "@src/perf"
|
||||
import { browserBg } from "@src/lib/webext"
|
||||
import { enumerate } from "@src/lib/itertools"
|
||||
import * as Containers from "@src/lib/containers"
|
||||
import * as Completions from "@src/completions"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as Messaging from "@src/lib/messaging"
|
||||
import * as Perf from "../perf"
|
||||
import { browserBg } from "../lib/webext"
|
||||
import { enumerate } from "../lib/itertools"
|
||||
import * as Containers from "../lib/containers"
|
||||
import * as Completions from "../completions"
|
||||
import * as config from "../lib/config"
|
||||
import * as Messaging from "../lib/messaging"
|
||||
|
||||
class BufferCompletionOption
|
||||
extends Completions.CompletionOptionHTML
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import * as Perf from "@src/perf"
|
||||
import { browserBg } from "@src/lib/webext"
|
||||
import * as Containers from "@src/lib/containers"
|
||||
import * as Completions from "@src/completions"
|
||||
import * as Messaging from "@src/lib/messaging"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as Perf from "../perf"
|
||||
import { browserBg } from "../lib/webext"
|
||||
import * as Containers from "../lib/containers"
|
||||
import * as Completions from "../completions"
|
||||
import * as Messaging from "../lib/messaging"
|
||||
import * as config from "../lib/config"
|
||||
|
||||
class TabAllCompletionOption
|
||||
extends Completions.CompletionOptionHTML
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as Completions from "@src/completions"
|
||||
import { staticThemes } from "@src/.metadata.generated"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as Completions from "../completions"
|
||||
import { staticThemes } from "../.metadata.generated"
|
||||
import * as config from "../lib/config"
|
||||
|
||||
export class ThemeCompletionOption
|
||||
extends Completions.CompletionOptionHTML
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { browserBg } from "@src/lib/webext"
|
||||
import * as Completions from "@src/completions"
|
||||
import { browserBg } from "../lib/webext"
|
||||
import * as Completions from "../completions"
|
||||
|
||||
class WindowCompletionOption
|
||||
extends Completions.CompletionOptionHTML
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as config from "@src/lib/config"
|
||||
import { browserBg } from "@src/lib/webext"
|
||||
import * as config from "../lib/config"
|
||||
import { browserBg } from "../lib/webext"
|
||||
|
||||
export function newtaburl() {
|
||||
// In the nonewtab version, this will return `null` and upset getURL.
|
||||
|
|
|
@ -9,12 +9,12 @@ if ((window as any).tridactyl_content_lock !== undefined) {
|
|||
// Be careful: typescript elides imports that appear not to be used if they're
|
||||
// assigned to a name. If you want an import just for its side effects, make
|
||||
// sure you import it like this:
|
||||
import "@src/lib/html-tagged-template"
|
||||
/* import "@src/content/commandline_content" */
|
||||
/* import "@src/excmds_content" */
|
||||
/* import "@src/content/hinting" */
|
||||
import * as config from "@src/lib/config"
|
||||
import * as Logging from "@src/lib/logging"
|
||||
import "./lib/html-tagged-template"
|
||||
/* import "./content/commandline_content" */
|
||||
/* import "./excmds_content" */
|
||||
/* import "./content/hinting" */
|
||||
import * as config from "./lib/config"
|
||||
import * as Logging from "./lib/logging"
|
||||
const logger = new Logging.Logger("content")
|
||||
logger.debug("Tridactyl content script loaded, boss!")
|
||||
|
||||
|
@ -22,15 +22,15 @@ logger.debug("Tridactyl content script loaded, boss!")
|
|||
import {
|
||||
contentState,
|
||||
addContentStateChangedListener,
|
||||
} from "@src/content/state_content"
|
||||
} from "./content/state_content"
|
||||
|
||||
import { CmdlineCmds } from "@src/content/commandline_cmds"
|
||||
import { EditorCmds } from "@src/content/editor"
|
||||
import { CmdlineCmds } from "./content/commandline_cmds"
|
||||
import { EditorCmds } from "./content/editor"
|
||||
|
||||
import { getAllDocumentFrames } from "@src/lib/dom"
|
||||
import { getAllDocumentFrames } from "./lib/dom"
|
||||
|
||||
import state from "@src/state"
|
||||
import { EditorCmds as editor } from "@src/content/editor"
|
||||
import state from "./state"
|
||||
import { EditorCmds as editor } from "./content/editor"
|
||||
/* tslint:disable:import-spacing */
|
||||
|
||||
config.getAsync("superignore").then(async TRI_DISABLE => {
|
||||
|
@ -40,31 +40,31 @@ config.getAsync("superignore").then(async TRI_DISABLE => {
|
|||
// here.
|
||||
|
||||
if (TRI_DISABLE === "true") return
|
||||
const controller = await import("@src/lib/controller")
|
||||
const excmds_content = await import("@src/.excmds_content.generated")
|
||||
const hinting_content = await import("@src/content/hinting")
|
||||
const controller = await import("./lib/controller")
|
||||
const excmds_content = await import("./.excmds_content.generated")
|
||||
const hinting_content = await import("./content/hinting")
|
||||
// Hook the keyboard up to the controller
|
||||
const ContentController = await import("@src/content/controller_content")
|
||||
const ContentController = await import("./content/controller_content")
|
||||
// Add various useful modules to the window for debugging
|
||||
const commandline_content = await import("@src/content/commandline_content")
|
||||
const convert = await import("@src/lib/convert")
|
||||
const dom = await import("@src/lib/dom")
|
||||
const excmds = await import("@src/.excmds_content.generated")
|
||||
const finding_content = await import("@src/content/finding")
|
||||
const itertools = await import("@src/lib/itertools")
|
||||
const messaging = await import("@src/lib/messaging")
|
||||
const State = await import("@src/state")
|
||||
const webext = await import("@src/lib/webext")
|
||||
const perf = await import("@src/perf")
|
||||
const keyseq = await import("@src/lib/keyseq")
|
||||
const native = await import("@src/lib/native")
|
||||
const styling = await import("@src/content/styling")
|
||||
const updates = await import("@src/lib/updates")
|
||||
const urlutils = await import("@src/lib/url_util")
|
||||
const scrolling = await import("@src/content/scrolling")
|
||||
const commandline_content = await import("./content/commandline_content")
|
||||
const convert = await import("./lib/convert")
|
||||
const dom = await import("./lib/dom")
|
||||
const excmds = await import("./.excmds_content.generated")
|
||||
const finding_content = await import("./content/finding")
|
||||
const itertools = await import("./lib/itertools")
|
||||
const messaging = await import("./lib/messaging")
|
||||
const State = await import("./state")
|
||||
const webext = await import("./lib/webext")
|
||||
const perf = await import("./perf")
|
||||
const keyseq = await import("./lib/keyseq")
|
||||
const native = await import("./lib/native")
|
||||
const styling = await import("./content/styling")
|
||||
const updates = await import("./lib/updates")
|
||||
const urlutils = await import("./lib/url_util")
|
||||
const scrolling = await import("./content/scrolling")
|
||||
const R = await import("ramda")
|
||||
const visual = await import("@src/lib/visual")
|
||||
const metadata = await import("@src/.metadata.generated")
|
||||
const visual = await import("./lib/visual")
|
||||
const metadata = await import("./.metadata.generated")
|
||||
|
||||
controller.setExCmds({
|
||||
"": excmds_content,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { getCommandlineFns } from "@src/lib/commandline_cmds"
|
||||
import { messageOwnTab } from "@src/lib/messaging"
|
||||
import { getCommandlineFns } from "../lib/commandline_cmds"
|
||||
import { messageOwnTab } from "../lib/messaging"
|
||||
|
||||
const functions = getCommandlineFns({} as any)
|
||||
type ft = typeof functions
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/** Inject an input element into unsuspecting webpages and provide an API for interaction with tridactyl */
|
||||
|
||||
import Logger from "@src/lib/logging"
|
||||
import * as config from "@src/lib/config"
|
||||
import { theme } from "@src/content/styling"
|
||||
import Logger from "../lib/logging"
|
||||
import * as config from "../lib/config"
|
||||
import { theme } from "../content/styling"
|
||||
const logger = new Logger("messaging")
|
||||
const cmdline_logger = new Logger("cmdline")
|
||||
|
||||
|
@ -138,6 +138,6 @@ export function executeWithoutCommandLine(fn) {
|
|||
return result
|
||||
}
|
||||
|
||||
import * as Messaging from "@src/lib/messaging"
|
||||
import * as SELF from "@src/content/commandline_content"
|
||||
import * as Messaging from "../lib/messaging"
|
||||
import * as SELF from "../content/commandline_content"
|
||||
Messaging.addListener("commandline_content", Messaging.attributeCaller(SELF))
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { isTextEditable } from "@src/lib/dom"
|
||||
import { contentState, ModeName } from "@src/content/state_content"
|
||||
import Logger from "@src/lib/logging"
|
||||
import * as controller from "@src/lib/controller"
|
||||
import { KeyEventLike, ParserResponse } from "@src/lib/keyseq"
|
||||
import { deepestShadowRoot } from "@src/lib/dom"
|
||||
import { isTextEditable } from "../lib/dom"
|
||||
import { contentState, ModeName } from "../content/state_content"
|
||||
import Logger from "../lib/logging"
|
||||
import * as controller from "../lib/controller"
|
||||
import { KeyEventLike, ParserResponse } from "../lib/keyseq"
|
||||
import { deepestShadowRoot } from "../lib/dom"
|
||||
|
||||
import * as hinting from "@src/content/hinting"
|
||||
import * as gobblemode from "@src/parsers/gobblemode"
|
||||
import * as generic from "@src/parsers/genericmode"
|
||||
import * as nmode from "@src/parsers/nmode"
|
||||
import * as hinting from "../content/hinting"
|
||||
import * as gobblemode from "../parsers/gobblemode"
|
||||
import * as generic from "../parsers/genericmode"
|
||||
import * as nmode from "../parsers/nmode"
|
||||
|
||||
const logger = new Logger("controller")
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@ import {
|
|||
messageOwnTab,
|
||||
addListener,
|
||||
attributeCaller,
|
||||
} from "@src/lib/messaging"
|
||||
import * as DOM from "@src/lib/dom"
|
||||
import * as _EditorCmds from "@src/lib/editor"
|
||||
} from "../lib/messaging"
|
||||
import * as DOM from "../lib/dom"
|
||||
import * as _EditorCmds from "../lib/editor"
|
||||
|
||||
export const EditorCmds = new Proxy(_EditorCmds, {
|
||||
get(target, property) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import * as config from "@src/lib/config"
|
||||
import * as DOM from "@src/lib/dom"
|
||||
import { browserBg, activeTabId } from "@src/lib/webext"
|
||||
import state from "@src/state"
|
||||
import * as State from "@src/state"
|
||||
import * as config from "../lib/config"
|
||||
import * as DOM from "../lib/dom"
|
||||
import { browserBg, activeTabId } from "../lib/webext"
|
||||
import state from "../state"
|
||||
import * as State from "../state"
|
||||
|
||||
// The host is the shadow root of a span used to contain all highlighting
|
||||
// elements. This is the least disruptive way of highlighting text in a page.
|
||||
|
|
|
@ -25,22 +25,22 @@
|
|||
Redraw on reflow
|
||||
*/
|
||||
|
||||
import * as DOM from "@src/lib/dom"
|
||||
import { log } from "@src/lib/math"
|
||||
import * as DOM from "../lib/dom"
|
||||
import { log } from "../lib/math"
|
||||
import {
|
||||
permutationsWithReplacement,
|
||||
islice,
|
||||
izip,
|
||||
map,
|
||||
} from "@src/lib/itertools"
|
||||
import { contentState } from "@src/content/state_content"
|
||||
import * as config from "@src/lib/config"
|
||||
import Logger from "@src/lib/logging"
|
||||
} from "../lib/itertools"
|
||||
import { contentState } from "../content/state_content"
|
||||
import * as config from "../lib/config"
|
||||
import Logger from "../lib/logging"
|
||||
import * as R from "ramda"
|
||||
|
||||
/** @hidden */
|
||||
const logger = new Logger("hinting")
|
||||
import * as keyseq from "@src/lib/keyseq"
|
||||
import * as keyseq from "../lib/keyseq"
|
||||
|
||||
/** Calclate the distance between two segments.
|
||||
* @hidden
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import * as config from "@src/lib/config"
|
||||
import * as config from "../lib/config"
|
||||
|
||||
type scrollingDirection = "scrollLeft" | "scrollTop"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import Logger from "@src/lib/logging"
|
||||
import Logger from "../lib/logging"
|
||||
const logger = new Logger("state")
|
||||
|
||||
export type ModeName =
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { staticThemes } from "@src/.metadata.generated"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as Logging from "@src/lib/logging"
|
||||
import { browserBg, ownTabId } from "@src/lib/webext"
|
||||
import { staticThemes } from "../.metadata.generated"
|
||||
import * as config from "../lib/config"
|
||||
import * as Logging from "../lib/logging"
|
||||
import { browserBg, ownTabId } from "../lib/webext"
|
||||
|
||||
const logger = new Logging.Logger("styling")
|
||||
|
||||
|
|
|
@ -73,27 +73,27 @@
|
|||
// {{{ setup
|
||||
|
||||
// Shared
|
||||
import * as Messaging from "@src/lib/messaging"
|
||||
import { ownWinTriIndex, getTriVersion, browserBg, activeTab, activeTabId, activeTabContainerId, openInNewTab, openInNewWindow, openInTab, queryAndURLwrangler } from "@src/lib/webext"
|
||||
import * as Container from "@src/lib/containers"
|
||||
import state from "@src/state"
|
||||
import { contentState, ModeName } from "@src/content/state_content"
|
||||
import * as UrlUtil from "@src/lib/url_util"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as aliases from "@src/lib/aliases"
|
||||
import * as Logging from "@src/lib/logging"
|
||||
import { AutoContain } from "@src/lib/autocontainers"
|
||||
import * as Messaging from "./lib/messaging"
|
||||
import { ownWinTriIndex, getTriVersion, browserBg, activeTab, activeTabId, activeTabContainerId, openInNewTab, openInNewWindow, openInTab, queryAndURLwrangler } from "./lib/webext"
|
||||
import * as Container from "./lib/containers"
|
||||
import state from "./state"
|
||||
import { contentState, ModeName } from "./content/state_content"
|
||||
import * as UrlUtil from "./lib/url_util"
|
||||
import * as config from "./lib/config"
|
||||
import * as aliases from "./lib/aliases"
|
||||
import * as Logging from "./lib/logging"
|
||||
import { AutoContain } from "./lib/autocontainers"
|
||||
import * as CSS from "css"
|
||||
import * as Perf from "@src/perf"
|
||||
import * as Metadata from "@src/.metadata.generated"
|
||||
import * as Perf from "./perf"
|
||||
import * as Metadata from "./.metadata.generated"
|
||||
import { ObjectType } from "../compiler/types/ObjectType"
|
||||
import * as Native from "@src/lib/native"
|
||||
import * as TTS from "@src/lib/text_to_speech"
|
||||
import * as excmd_parser from "@src/parsers/exmode"
|
||||
import * as escape from "@src/lib/escape"
|
||||
import * as Native from "./lib/native"
|
||||
import * as TTS from "./lib/text_to_speech"
|
||||
import * as excmd_parser from "./parsers/exmode"
|
||||
import * as escape from "./lib/escape"
|
||||
import semverCompare from "semver-compare"
|
||||
import * as hint_util from "@src/lib/hint_util"
|
||||
import { OpenMode } from "@src/lib/hint_util"
|
||||
import * as hint_util from "./lib/hint_util"
|
||||
import { OpenMode } from "./lib/hint_util"
|
||||
|
||||
/**
|
||||
* This is used to drive some excmd handling in `composite`.
|
||||
|
@ -104,10 +104,10 @@ let ALL_EXCMDS
|
|||
|
||||
// The entry-point script will make sure this has the right set of
|
||||
// excmds, so we can use it without futher configuration.
|
||||
import * as controller from "@src/lib/controller"
|
||||
import * as controller from "./lib/controller"
|
||||
|
||||
//#content_helper
|
||||
import { generator as KEY_MUNCHER } from "@src/content/controller_content"
|
||||
import { generator as KEY_MUNCHER } from "./content/controller_content"
|
||||
|
||||
/**
|
||||
* Used to store the types of the parameters for each excmd for
|
||||
|
@ -125,20 +125,20 @@ const TRI_VERSION = getTriVersion()
|
|||
|
||||
//#content_helper
|
||||
// {
|
||||
import "@src/lib/number.clamp"
|
||||
import * as CTSELF from "@src/.excmds_content.generated"
|
||||
import { CmdlineCmds as CtCmdlineCmds } from "@src/background/commandline_cmds"
|
||||
import { EditorCmds as CtEditorCmds } from "@src/background/editor"
|
||||
import * as DOM from "@src/lib/dom"
|
||||
import * as CommandLineContent from "@src/content/commandline_content"
|
||||
import * as scrolling from "@src/content/scrolling"
|
||||
import { ownTab } from "@src/lib/webext"
|
||||
import { wrap_input, getLineAndColNumber, rot13_helper, jumble_helper } from "@src/lib/editor_utils"
|
||||
import * as finding from "@src/content/finding"
|
||||
import "./lib/number.clamp"
|
||||
import * as CTSELF from "./.excmds_content.generated"
|
||||
import { CmdlineCmds as CtCmdlineCmds } from "./background/commandline_cmds"
|
||||
import { EditorCmds as CtEditorCmds } from "./background/editor"
|
||||
import * as DOM from "./lib/dom"
|
||||
import * as CommandLineContent from "./content/commandline_content"
|
||||
import * as scrolling from "./content/scrolling"
|
||||
import { ownTab } from "./lib/webext"
|
||||
import { wrap_input, getLineAndColNumber, rot13_helper, jumble_helper } from "./lib/editor_utils"
|
||||
import * as finding from "./content/finding"
|
||||
import * as toys from "./content/toys"
|
||||
import * as hinting from "@src/content/hinting"
|
||||
import * as gobbleMode from "@src/parsers/gobblemode"
|
||||
import * as nMode from "@src/parsers/nmode"
|
||||
import * as hinting from "./content/hinting"
|
||||
import * as gobbleMode from "./parsers/gobblemode"
|
||||
import * as nMode from "./parsers/nmode"
|
||||
|
||||
ALL_EXCMDS = {
|
||||
"": CTSELF,
|
||||
|
@ -147,26 +147,26 @@ ALL_EXCMDS = {
|
|||
}
|
||||
// }
|
||||
|
||||
import { mapstrToKeyseq, mozMapToMinimalKey, minimalKeyToMozMap } from "@src/lib/keyseq"
|
||||
import { mapstrToKeyseq, mozMapToMinimalKey, minimalKeyToMozMap } from "./lib/keyseq"
|
||||
|
||||
//#background_helper
|
||||
// {
|
||||
|
||||
// tslint:disable-next-line:no-unused-declaration
|
||||
import "@src/lib/number.mod"
|
||||
import "./lib/number.mod"
|
||||
|
||||
import * as BGSELF from "@src/.excmds_background.generated"
|
||||
import { CmdlineCmds as BgCmdlineCmds } from "@src/background/commandline_cmds"
|
||||
import { EditorCmds as BgEditorCmds } from "@src/background/editor"
|
||||
import { EditorCmds } from "@src/background/editor"
|
||||
import { firefoxVersionAtLeast } from "@src/lib/webext"
|
||||
import { parse_bind_args, modeMaps } from "@src/lib/binding"
|
||||
import * as rc from "@src/background/config_rc"
|
||||
import * as css_util from "@src/lib/css_util"
|
||||
import * as Updates from "@src/lib/updates"
|
||||
import * as Extensions from "@src/lib/extension_info"
|
||||
import * as webrequests from "@src/background/webrequests"
|
||||
import * as commandsHelper from "@src/background/commands"
|
||||
import * as BGSELF from "./.excmds_background.generated"
|
||||
import { CmdlineCmds as BgCmdlineCmds } from "./background/commandline_cmds"
|
||||
import { EditorCmds as BgEditorCmds } from "./background/editor"
|
||||
import { EditorCmds } from "./background/editor"
|
||||
import { firefoxVersionAtLeast } from "./lib/webext"
|
||||
import { parse_bind_args, modeMaps } from "./lib/binding"
|
||||
import * as rc from "./background/config_rc"
|
||||
import * as css_util from "./lib/css_util"
|
||||
import * as Updates from "./lib/updates"
|
||||
import * as Extensions from "./lib/extension_info"
|
||||
import * as webrequests from "./background/webrequests"
|
||||
import * as commandsHelper from "./background/commands"
|
||||
|
||||
ALL_EXCMDS = {
|
||||
"": BGSELF,
|
||||
|
@ -1276,7 +1276,7 @@ export async function reloadallbut(hard = false) {
|
|||
}
|
||||
|
||||
//#background_helper
|
||||
import { getTridactylTabs } from "@src/background/meta"
|
||||
import { getTridactylTabs } from "./background/meta"
|
||||
/** Reloads all tabs which Tridactyl isn't loaded in */
|
||||
//#background
|
||||
export async function reloaddead(hard = false) {
|
||||
|
@ -3245,7 +3245,7 @@ export async function shellescape(...quoteme: string[]) {
|
|||
}
|
||||
|
||||
//#background_helper
|
||||
import { useractions } from "@src/background/user_actions"
|
||||
import { useractions } from "./background/user_actions"
|
||||
|
||||
/**
|
||||
* Magic escape hatch: if Tridactyl can't run in the current tab, return to a tab in the current window where Tridactyl can run, making such a tab if it doesn't currently exist. If Tridactyl can run in the current tab, return focus to the document body from e.g. the URL bar or a video player.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// This file is only loaded in tridacyl's help pages
|
||||
|
||||
import * as config from "@src/lib/config"
|
||||
import { modeMaps } from "@src/lib/binding"
|
||||
import * as config from "./lib/config"
|
||||
import { modeMaps } from "./lib/binding"
|
||||
|
||||
/** Create the element that should contain keybinding information */
|
||||
function initTridactylSettingElem(
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import * as config from "@src/lib/config"
|
||||
import * as config from "../lib/config"
|
||||
|
||||
/**
|
||||
* Expands the alias in the provided exstr recursively. Does nothing if
|
||||
|
|
|
@ -22,10 +22,10 @@
|
|||
|
||||
*/
|
||||
|
||||
import * as Config from "@src/lib/config"
|
||||
import * as Container from "@src/lib/containers"
|
||||
import * as Logging from "@src/lib/logging"
|
||||
import * as ExtensionInfo from "@src/lib/extension_info"
|
||||
import * as Config from "../lib/config"
|
||||
import * as Container from "../lib/containers"
|
||||
import * as Logging from "../lib/logging"
|
||||
import * as ExtensionInfo from "../lib/extension_info"
|
||||
|
||||
const logger = new Logging.Logger("containers")
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
import { mapstrToKeyseq } from "@src/lib/keyseq"
|
||||
import { mapstrToKeyseq } from "../lib/keyseq"
|
||||
|
||||
export const mode2maps = new Map([
|
||||
["normal", "nmaps"],
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { message } from "@src/lib/messaging"
|
||||
import { message } from "../lib/messaging"
|
||||
|
||||
const browserProxy = new Proxy(Object.create(null), {
|
||||
get(target, api) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { messageOwnTab } from "@src/lib/messaging"
|
||||
import * as State from "@src/state"
|
||||
import { contentState } from "@src/content/state_content"
|
||||
import { messageOwnTab } from "../lib/messaging"
|
||||
import * as State from "../state"
|
||||
import { contentState } from "../content/state_content"
|
||||
|
||||
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
*
|
||||
*/
|
||||
import * as R from "ramda"
|
||||
import * as binding from "@src/lib/binding"
|
||||
import * as platform from "@src/lib/platform"
|
||||
import * as binding from "../lib/binding"
|
||||
import * as platform from "../lib/platform"
|
||||
import { DeepPartial } from "tsdef"
|
||||
|
||||
/* Remove all nulls from objects recursively
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { browserBg } from "@src/lib/webext"
|
||||
import { browserBg } from "../lib/webext"
|
||||
import Fuse from "fuse.js"
|
||||
import * as Logging from "@src/lib/logging"
|
||||
import * as Logging from "../lib/logging"
|
||||
const logger = new Logging.Logger("containers")
|
||||
|
||||
// As per Mozilla specification: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/contextualIdentities/ContextualIdentity
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import Logger from "@src/lib/logging"
|
||||
import { parser as exmode_parser } from "@src/parsers/exmode"
|
||||
import * as State from "@src/state"
|
||||
import state from "@src/state"
|
||||
import Logger from "../lib/logging"
|
||||
import { parser as exmode_parser } from "../parsers/exmode"
|
||||
import * as State from "../state"
|
||||
import state from "../state"
|
||||
|
||||
const logger = new Logger("controller")
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import * as config from "@src/lib/config"
|
||||
import state from "@src/state"
|
||||
import * as State from "@src/state"
|
||||
import * as Logging from "@src/lib/logging"
|
||||
import * as config from "../lib/config"
|
||||
import state from "../state"
|
||||
import * as State from "../state"
|
||||
import * as Logging from "../lib/logging"
|
||||
import {
|
||||
activeTabId,
|
||||
openInNewTab,
|
||||
activeTabContainerId,
|
||||
inContentScript,
|
||||
} from "@src/lib/webext"
|
||||
} from "../lib/webext"
|
||||
const logger = new Logging.Logger("dom")
|
||||
|
||||
// From saka-key lib/dom.js, under Apachev2
|
||||
|
|
|
@ -26,7 +26,7 @@ import {
|
|||
wordAfterPos,
|
||||
rot13_helper,
|
||||
jumble_helper
|
||||
} from "@src/lib/editor_utils"
|
||||
} from "../lib/editor_utils"
|
||||
|
||||
/**
|
||||
* Behaves like readline's [delete_char](http://web.mit.edu/gnu/doc/html/rlman_1.html#SEC14), i.e. deletes the character to the right of the caret.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// We have a single dependency on config: getting the value of the WORDPATTERN setting
|
||||
// Perhaps we could find a way to get rid of it?
|
||||
import * as config from "@src/lib/config"
|
||||
import * as config from "../lib/config"
|
||||
|
||||
export type editor_function = (
|
||||
text: string,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as escape from "@src/lib/escape"
|
||||
import * as escape from "../lib/escape"
|
||||
|
||||
import { testAll } from "@src/lib/test_utils"
|
||||
import { testAll } from "../lib/test_utils"
|
||||
|
||||
testAll(escape.sh, [
|
||||
["foo&rm -rf", "'foo&rm -rf'"],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/** Testing the new argument parser for :hint */
|
||||
|
||||
import { OpenMode, HintConfig } from "@src/lib/hint_util"
|
||||
import { OpenMode, HintConfig } from "../lib/hint_util"
|
||||
|
||||
expect.extend({
|
||||
toMatchOptions(received: HintConfig, expected: any) {
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
* Helper types for :hint
|
||||
*/
|
||||
|
||||
import Logger from "@src/lib/logging"
|
||||
import * as DOM from "@src/lib/dom"
|
||||
import * as hinting from "@src/content/hinting"
|
||||
import Logger from "../lib/logging"
|
||||
import * as DOM from "../lib/dom"
|
||||
import * as hinting from "../content/hinting"
|
||||
|
||||
/**
|
||||
* Open mode: how to act on the selected hintable element
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import "@src/lib/number.mod"
|
||||
import "../lib/number.mod"
|
||||
|
||||
export function head<T>(iterable: Iterable<T>) {
|
||||
const iterator = iterable[Symbol.iterator]()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { testAll, testAllObject } from "@src/lib/test_utils"
|
||||
import * as ks from "@src/lib/keyseq"
|
||||
import { mapstrToKeyseq as mks } from "@src/lib/keyseq"
|
||||
import { testAll, testAllObject } from "../lib/test_utils"
|
||||
import * as ks from "../lib/keyseq"
|
||||
import { mapstrToKeyseq as mks } from "../lib/keyseq"
|
||||
|
||||
function mk(k, mod?: ks.KeyModifiers) {
|
||||
return new ks.MinimalKey(k, mod)
|
||||
|
|
|
@ -21,11 +21,11 @@
|
|||
*/
|
||||
|
||||
/** */
|
||||
import { filter, find, izip } from "@src/lib/itertools"
|
||||
import { Parser } from "@src/lib/nearley_utils"
|
||||
import * as config from "@src/lib/config"
|
||||
import { filter, find, izip } from "../lib/itertools"
|
||||
import { Parser } from "../lib/nearley_utils"
|
||||
import * as config from "../lib/config"
|
||||
import * as R from "ramda"
|
||||
import grammar from "@src/grammars/.bracketexpr.generated"
|
||||
import grammar from "../grammars/.bracketexpr.generated"
|
||||
const bracketexpr_grammar = grammar
|
||||
const bracketexpr_parser = new Parser(bracketexpr_grammar)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Helper functions for logging
|
||||
*/
|
||||
|
||||
import * as Config from "@src/lib/config"
|
||||
import * as Config from "../lib/config"
|
||||
|
||||
const LevelToNum = new Map<Config.LoggingLevel, number>()
|
||||
LevelToNum.set("never", 0)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { browserBg, activeTabId, ownTabId, getContext } from "@src/lib/webext"
|
||||
import * as Messages from "@src/message_protocols"
|
||||
import Logger from "@src/lib/logging"
|
||||
import { browserBg, activeTabId, ownTabId, getContext } from "../lib/webext"
|
||||
import * as Messages from "../message_protocols"
|
||||
import Logger from "../lib/logging"
|
||||
const logger = new Logger("messaging")
|
||||
|
||||
export type TabMessageType =
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/** Some real tests for mod and also an example of how to unit test. */
|
||||
|
||||
import { euclid_mod, knuth_mod, my_mod } from "@src/lib/number.mod"
|
||||
import { euclid_mod, knuth_mod, my_mod } from "../lib/number.mod"
|
||||
|
||||
expect.extend({
|
||||
/** Expect equal to all values in array */
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
*/
|
||||
|
||||
import semverCompare from "semver-compare"
|
||||
import * as config from "@src/lib/config"
|
||||
import { browserBg, getContext } from "@src/lib/webext"
|
||||
import * as config from "../lib/config"
|
||||
import { browserBg, getContext } from "../lib/webext"
|
||||
|
||||
import Logger from "@src/lib/logging"
|
||||
import Logger from "../lib/logging"
|
||||
const logger = new Logger("native")
|
||||
|
||||
const NATIVE_NAME = "tridactyl"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as csp from "csp-serdes"
|
||||
import Logger from "@src/lib/logging"
|
||||
import Logger from "../lib/logging"
|
||||
|
||||
const logger = new Logger("requests")
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** Functions to deal with text to speech in Tridactyl
|
||||
*/
|
||||
|
||||
import * as Config from "@src/lib/config"
|
||||
import * as Config from "../lib/config"
|
||||
|
||||
/** Find the voice object for a voice name
|
||||
*
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
*/
|
||||
|
||||
import SemverCompare from "semver-compare"
|
||||
import * as Config from "@src/lib/config"
|
||||
import * as Logging from "@src/lib/logging"
|
||||
import { getTriVersion } from "@src/lib/webext"
|
||||
import * as Config from "../lib/config"
|
||||
import * as Logging from "../lib/logging"
|
||||
import { getTriVersion } from "../lib/webext"
|
||||
|
||||
const logger = new Logging.Logger("updates")
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/** Some tests for URL utilities */
|
||||
|
||||
import * as UrlUtil from "@src/lib/url_util"
|
||||
import * as UrlUtil from "../lib/url_util"
|
||||
|
||||
function test_increment() {
|
||||
let cases = [
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import * as convert from "@src/lib/convert"
|
||||
import browserProxy from "@src/lib/browser_proxy"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as UrlUtil from "@src/lib/url_util"
|
||||
import { sleep } from "@src/lib/patience"
|
||||
import * as convert from "../lib/convert"
|
||||
import browserProxy from "../lib/browser_proxy"
|
||||
import * as config from "../lib/config"
|
||||
import * as UrlUtil from "../lib/url_util"
|
||||
import { sleep } from "../lib/patience"
|
||||
|
||||
export function inContentScript() {
|
||||
return getContext() === "content"
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
// This file re-exports types for message protocols for background, content and commandline contexts
|
||||
|
||||
export { Messages as Background } from "@src/background"
|
||||
export { Messages as Background } from "./background"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// This file is only included in newtab.html, after content.js has been loaded
|
||||
|
||||
import * as Messaging from "@src/lib/messaging"
|
||||
import * as config from "@src/lib/config"
|
||||
import { getPrettyTriVersion } from "@src/lib/webext"
|
||||
import * as Messaging from "./lib/messaging"
|
||||
import * as config from "./lib/config"
|
||||
import { getPrettyTriVersion } from "./lib/webext"
|
||||
|
||||
// These functions work with the elements created by tridactyl/scripts/newtab.md.sh
|
||||
function getChangelogDiv() {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/** Ex Mode (AKA cmd mode) */
|
||||
|
||||
import { FunctionType } from "../../compiler/types/AllTypes"
|
||||
import { everything as metadata } from "@src/.metadata.generated"
|
||||
import * as aliases from "@src/lib/aliases"
|
||||
import * as Logging from "@src/lib/logging"
|
||||
import { everything as metadata } from "../.metadata.generated"
|
||||
import * as aliases from "../lib/aliases"
|
||||
import * as Logging from "../lib/logging"
|
||||
|
||||
const logger = new Logging.Logger("exmode")
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/** Tridactyl helper mode */
|
||||
|
||||
import * as keyseq from "@src/lib/keyseq"
|
||||
import * as keyseq from "../lib/keyseq"
|
||||
|
||||
export function parser(conf, keys): keyseq.ParserResponse {
|
||||
const maps = keyseq.keyMap(conf)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { contentState } from "@src/content/state_content"
|
||||
import { isSimpleKey, KeyEventLike } from "@src/lib/keyseq"
|
||||
import { contentState } from "../content/state_content"
|
||||
import { isSimpleKey, KeyEventLike } from "../lib/keyseq"
|
||||
|
||||
/** Simple container for the gobble state. */
|
||||
class GobbleState {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/** Accept n [mode] commands then execute the other command */
|
||||
|
||||
import { contentState } from "@src/content/state_content"
|
||||
import * as keyseq from "@src/lib/keyseq"
|
||||
import { mode2maps } from "@src/lib/binding"
|
||||
import { contentState } from "../content/state_content"
|
||||
import * as keyseq from "../lib/keyseq"
|
||||
import { mode2maps } from "../lib/binding"
|
||||
|
||||
/** Simple container for the nmode state. */
|
||||
class NModeState {
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
* 6. Use getEntries to retrieve data from the statsLogger.
|
||||
*/
|
||||
|
||||
import * as messaging from "@src/lib/messaging"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as math from "@src/lib/math"
|
||||
import * as logging from "@src/lib/logging"
|
||||
import * as messaging from "./lib/messaging"
|
||||
import * as config from "./lib/config"
|
||||
import * as math from "./lib/math"
|
||||
import * as logging from "./lib/logging"
|
||||
|
||||
const logger = new logging.Logger("performance")
|
||||
|
||||
|
|
10
src/state.ts
10
src/state.ts
|
@ -3,16 +3,16 @@
|
|||
*
|
||||
* __NB__: Here be dragons.
|
||||
*
|
||||
* In the background script, "state" can be used as a normal object. Just "import state from "@src/state"
|
||||
* In the background script, "state" can be used as a normal object. Just "import state from "./state"
|
||||
*
|
||||
* In the content scripts, "state" can be set as a normal object and changes will propagate to the background script.
|
||||
*
|
||||
* In the content scripts, "state" must be read using "import * as State from "@src/state" and "State.getAsync(property)". If you read it directly with `state` you should get an error at runtime. Certain methods like `concat` will not throw an error but their behaviour is not defined and should be avoided.
|
||||
* In the content scripts, "state" must be read using "import * as State from "./state" and "State.getAsync(property)". If you read it directly with `state` you should get an error at runtime. Certain methods like `concat` will not throw an error but their behaviour is not defined and should be avoided.
|
||||
*/
|
||||
|
||||
import Logger from "@src/lib/logging"
|
||||
import * as messaging from "@src/lib/messaging"
|
||||
import { notBackground } from "@src/lib/webext"
|
||||
import Logger from "./lib/logging"
|
||||
import * as messaging from "./lib/messaging"
|
||||
import { notBackground } from "./lib/webext"
|
||||
import * as R from "ramda"
|
||||
|
||||
const logger = new Logger("state")
|
||||
|
|
|
@ -15,10 +15,7 @@
|
|||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "src/",
|
||||
"types": ["@types/firefox-webext-browser"],
|
||||
"paths": {
|
||||
"@src/*": ["*"]
|
||||
}
|
||||
"types": ["@types/firefox-webext-browser"]
|
||||
},
|
||||
"include": [
|
||||
"./src/**/*"
|
||||
|
|
Loading…
Add table
Reference in a new issue