Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/client/firefox.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow

const { setupCommands, clientCommands } = require("./firefox/commands");
const { setupEvents, clientEvents } = require("./firefox/events");
import { setupCommands, clientCommands } from "./firefox/commands";
import { setupEvents, clientEvents } from "./firefox/events";

export async function onConnect(connection: any, actions: Object) {
const {
Expand Down
17 changes: 9 additions & 8 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
// @flow

const React = require("react");
const ReactDOM = require("react-dom");
import React from "react";
import ReactDOM from "react-dom";

import { bootstrap, L10N, unmountRoot } from "devtools-launchpad";
import { isFirefoxPanel } from "devtools-config";

import { onConnect } from "./client";
import { teardownWorkers } from "./utils/bootstrap";

//
// if (process.env.NODE_ENV !== "production") {
// const Perf = require("react-addons-perf");
// window.Perf = Perf;
// }

const { bootstrap, L10N, unmountRoot } = require("devtools-launchpad");
const { isFirefoxPanel } = require("devtools-config");

const { onConnect } = require("./client");
const { teardownWorkers } = require("./utils/bootstrap");

if (isFirefoxPanel()) {
module.exports = {
bootstrap: ({
Expand Down
2 changes: 1 addition & 1 deletion src/test/fixtures/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const foobar = require("./foobar.json");
import foobar from "./foobar.json";

module.exports = {
foobar
Expand Down
4 changes: 2 additions & 2 deletions src/test/integration/runner.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require("mocha/mocha");
const expect = require("expect.js");
import expect from "expect.js";
let { prefs } = require("../../utils/prefs");

const tests = require("./tests/index");
import tests from "./tests/index";
Object.assign(window, { prefs }, tests);

window.ok = function ok(expected) {
Expand Down
14 changes: 5 additions & 9 deletions src/test/tests-framework.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
const {
startSourceMapWorker,
stopSourceMapWorker
} = require("devtools-source-map");
import { startSourceMapWorker, stopSourceMapWorker } from "devtools-source-map";

const {
import {
startPrettyPrintWorker,
stopPrettyPrintWorker
} = require("../utils/pretty-print");
} from "../utils/pretty-print";

const { startParserWorker, stopParserWorker } = require("../utils/parser");

const { getValue } = require("devtools-config");
import { startParserWorker, stopParserWorker } from "../utils/parser";
import { getValue } from "devtools-config";

beforeAll(() => {
startSourceMapWorker(getValue("workers.sourceMapURL"));
Expand Down
9 changes: 4 additions & 5 deletions src/test/tests-setup.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
global.Worker = require("workerjs");

const path = require("path");
const getConfig = require("../../bin/getConfig");
const { setConfig } = require("devtools-config");
const { readFileSync } = require("fs");

import path from "path";
import getConfig from "../../bin/getConfig";
import { setConfig } from "devtools-config";
import { readFileSync } from "fs";
const rootPath = path.join(__dirname, "../../");

const envConfig = getConfig();
Expand Down
4 changes: 2 additions & 2 deletions src/utils/parser/tests/helpers/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require("fs");
const path = require("path");
import fs from "fs";
import path from "path";

export function getSourceText(name, type = "js") {
const text = fs.readFileSync(
Expand Down
6 changes: 4 additions & 2 deletions src/utils/prefs.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// @flow

var { PrefsHelper } = require("devtools-modules");
const { Services: { pref } } = require("devtools-modules");
const { isDevelopment } = require("devtools-config");
const { Services, PrefsHelper } = require("devtools-modules");

const prefsSchemaVersion = "1.0.0";

const pref = Services.pref;

if (isDevelopment()) {
pref("devtools.debugger.client-source-maps-enabled", true);
pref("devtools.debugger.pause-on-exceptions", false);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/scopes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow

import toPairs from "lodash/toPairs";
const get = require("lodash/get");
import get from "lodash/get";

import type { Frame, Pause, Scope } from "debugger-html";

Expand Down
4 changes: 2 additions & 2 deletions src/utils/tests/build-query.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const escapeRegExp = require("lodash/escapeRegExp");
const { buildQuery } = require("../editor");
import escapeRegExp from "lodash/escapeRegExp";
import { buildQuery } from "../editor";

describe("build-query", () => {
it("case-sensitive, whole-word, regex search", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/tests/fromJS.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const fromJS = require("../fromJS");
import fromJS from "../fromJS";

const preview = {
kind: "ArrayLike",
Expand Down
2 changes: 1 addition & 1 deletion src/utils/tests/scopes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { getSpecialVariables, getScopes } = require("../scopes");
import { getSpecialVariables, getScopes } from "../scopes";

const errorGrip = {
type: "object",
Expand Down
4 changes: 2 additions & 2 deletions src/utils/tests/source-search.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { countMatches } = require("../editor");
const { getMatchIndex } = require("../editor/source-search");
import { countMatches } from "../editor";
import { getMatchIndex } from "../editor/source-search";

describe("source-search", () => {
describe("countMatches", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/tests/source.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { getFilename, getMode } = require("../source.js");
import { getFilename, getMode } from "../source.js";

describe("sources", () => {
describe("getFilename", () => {
Expand Down
6 changes: 3 additions & 3 deletions src/utils/tests/sources-tree.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { Map } = require("immutable");
const {
import { Map } from "immutable";
import {
createNode,
nodeHasChildren,
addToTree,
Expand All @@ -8,7 +8,7 @@ const {
getURL,
isExactUrlMatch,
isDirectory
} = require("../sources-tree.js");
} from "../sources-tree.js";

describe("sources-tree", () => {
const abcSource = Map({
Expand Down