Bug 1669956 - [devtools] Fix require paths in reps folder. r=jdescottes.

Differential Revision: https://phabricator.services.mozilla.com/D93358
This commit is contained in:
Nicolas Chevobbe 2020-10-14 11:24:21 +00:00
parent 7d6dc35518
commit 15547ae76c
15 changed files with 28 additions and 28 deletions

View file

@ -4,7 +4,7 @@
const { MODE } = require("./reps/constants");
const { REPS, getRep } = require("./reps/rep");
const objectInspector = require("./object-inspector");
const objectInspector = require("./object-inspector/index");
const {
parseURLEncodedText,

View file

@ -2,8 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
const { Component, createFactory, createElement } = require("react");
const { connect } = require("react-redux");
const {
Component,
createFactory,
createElement,
} = require("devtools/client/shared/vendor/react");
const { connect } = require("devtools/client/shared/vendor/react-redux");
const actions = require("../actions");
const selectors = require("../reducer");
@ -14,8 +18,7 @@ require("./ObjectInspector.css");
const ObjectInspectorItem = createFactory(require("./ObjectInspectorItem"));
const Utils = require("../utils");
const Utils = require("../utils/index");
const { renderRep, shouldRenderRootsInReps } = Utils;
const {
getChildrenWithEvaluations,

View file

@ -2,16 +2,15 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
const { Component } = require("react");
const dom = require("react-dom-factories");
const { Component } = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
import Services from "devtools-services";
const { appinfo } = Services;
const isMacOS = appinfo.OS === "Darwin";
const Services = require("Services");
const isMacOS = Services.appinfo.OS === "Darwin";
const { MODE } = require("../../reps/constants");
const Utils = require("../utils");
const Utils = require("../utils/index");
const {
getValue,

View file

@ -3,7 +3,7 @@
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
const ObjectInspector = require("./components/ObjectInspector");
const utils = require("./utils");
const utils = require("./utils/index");
const reducer = require("./reducer");
const actions = require("./actions");

View file

@ -3,12 +3,10 @@
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
const { mount } = require("enzyme");
const React = require("react");
const { createFactory } = require("devtools/client/shared/vendor/react");
const { createFactory } = React;
const { Provider } = require("react-redux");
const { combineReducers } = require("redux");
const { Provider } = require("devtools/client/shared/vendor/react-redux");
const { combineReducers } = require("devtools/client/shared/vendor/redux");
const { thunk } = require("../../shared/redux/middleware/thunk");
const {

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
const Utils = require("../../utils");
const Utils = require("../../utils/index");
const { createNode, getChildren, makeNodesForEntries } = Utils.node;
const { shouldLoadItemEntries } = Utils.loadProperties;

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
const Utils = require("../../utils");
const Utils = require("../../utils/index");
const { createNode } = Utils.node;
const { shouldLoadItemFullText } = Utils.loadProperties;

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
const Utils = require("../../utils");
const Utils = require("../../utils/index");
const {
createNode,
createGetterNode,

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
const Utils = require("../../utils");
const Utils = require("../../utils/index");
const {
createNode,
createGetterNode,

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
const Utils = require("../../utils");
const Utils = require("../../utils/index");
const {
createNode,
createGetterNode,

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
const Utils = require("../../utils");
const Utils = require("../../utils/index");
const {
createNode,
createGetterNode,

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
const Utils = require("../../utils");
const Utils = require("../../utils/index");
const { shouldRenderRootsInReps } = Utils;
const nullStubs = require("../../../reps/stubs/null");

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
function documentHasSelection(doc = document): boolean {
function documentHasSelection(doc = document) {
const selection = doc.defaultView.getSelection();
if (!selection) {
return false;

View file

@ -11,7 +11,7 @@ const { expectActorAttribute } = require("./test-helpers");
const { ErrorRep } = REPS;
const { MODE } = require("../constants");
const stubs = require("../stubs/error");
const dom = require("react-dom-factories");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
describe("Error - Simple error", () => {
// Test object = `new Error("Error message")`

View file

@ -2,13 +2,13 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
const PropTypes = require("prop-types");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const { wrapRender } = require("../reps/rep-utils");
const { MODE } = require("../reps/constants");
const { ModePropType } = require("../reps/array");
const dom = require("react-dom-factories");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const { span } = dom;
GripLengthBubble.propTypes = {