Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further strict null checks #8371

Merged
merged 80 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from 78 commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
cf8fdb9
getToken/refreshToken
Apr 22, 2024
c48b8f3
src/background/requests.ts
Apr 22, 2024
619e8be
src/contentScript/pageEditor/elementPicker.ts
Apr 22, 2024
96786b0
src/background/partnerIntegrations.ts
Apr 22, 2024
19c60ed
whoops
Apr 22, 2024
fa36bd6
cleanup
Apr 22, 2024
0cdffaf
fix widget and getScopeAndId
Apr 22, 2024
6d37d22
auto-add
Apr 22, 2024
a51514f
src/extensionConsole/pages/mods/GetStartedView.tsx
Apr 22, 2024
48fc706
src/mods/useModViewItems.tsx
Apr 22, 2024
b5b5427
test memo compare dependencies
Apr 22, 2024
e7be3b6
fix scopeAndId tests
Apr 22, 2024
f43adb6
autosuggest
Apr 23, 2024
5eaf7ee
src/background/backgroundPlatform.ts
Apr 23, 2024
ca34895
src/background/restrictUnauthenticatedUrlAccess.ts
Apr 23, 2024
8e45b83
src/bricks/effects/insertHtml.ts
Apr 23, 2024
2cf5876
./bricks/effects/runSubTour.ts
Apr 23, 2024
dce3731
./bricks/effects/scrollIntoView.ts
Apr 23, 2024
58816ce
src/bricks/transformers/controlFlow/WithAsyncModVariable.ts
Apr 23, 2024
80d4a78
mod state / variable context
Apr 23, 2024
ff3aec4
src/bricks/transformers/RunMetadataTransformer.ts
Apr 23, 2024
6c042c6
src/bricks/transformers/splitText.ts
Apr 23, 2024
751dafe
src/components/fields/schemaFields/widgets/varPopup/useTreeRow.ts
Apr 23, 2024
a6c200d
src/components/walkthroughModal/WalkthroughModalApp.tsx
Apr 23, 2024
158020a
src/extensionConsole/pages/brickEditor/BrickHistory.tsx
Apr 23, 2024
6fec24f
fix test
Apr 23, 2024
faef79c
src/extensionConsole/pages/mods/utils/exportBlueprint.ts
Apr 23, 2024
4be6ec3
src/extensionConsole/pages/mods/utils/exportBlueprint.ts
Apr 23, 2024
c570dd7
src/pageScript/elementInfo.ts
Apr 23, 2024
680b86d
src/sidebar/LoginPanel.tsx
Apr 23, 2024
4d45f78
src/testUtils/factories/authFactories.ts
Apr 23, 2024
dddf4b2
src/bricks/effects/attachAutocomplete.ts
Apr 23, 2024
75ee849
more bricks
Apr 23, 2024
f551c8d
fix test
Apr 23, 2024
7be7af1
src/components/fields/schemaFields/fieldTestUtils.ts
Apr 23, 2024
8d01818
add a bunch more
Apr 23, 2024
8cf8705
the rest
Apr 23, 2024
ec7c7c0
cleanup
Apr 23, 2024
134796a
fix lint
Apr 23, 2024
806f211
wip
Apr 23, 2024
db7463e
Merge branch 'main' into dev/strict-null-checks-even-moar
Apr 23, 2024
9b7dd2d
remove file
Apr 23, 2024
e60c85c
remove logs
Apr 23, 2024
597e651
fix factory
Apr 23, 2024
5c7e39e
update counts
grahamlangford Apr 24, 2024
5eb2eb6
extensionPagePlatform
grahamlangford Apr 24, 2024
051ed5f
partnerIntegrations
grahamlangford Apr 24, 2024
bae732a
update counts
grahamlangford Apr 24, 2024
5620c5c
Merge branch 'main' of github.com:pixiebrix/pixiebrix-extension into …
grahamlangford Apr 24, 2024
a93f471
finding cycles
grahamlangford Apr 24, 2024
4d6a41c
documenting cycle
grahamlangford Apr 24, 2024
b4177f5
move starterbricks into separate folders
grahamlangford Apr 24, 2024
d327b91
extract shared types from contextmenu
grahamlangford Apr 24, 2024
2a34559
migrate shared types for menuItemExtension
grahamlangford Apr 24, 2024
be1660b
migrate panel types; migrate more contextMenu types
grahamlangford Apr 24, 2024
da3eaf2
migrate more menuitem types
grahamlangford Apr 24, 2024
ca930a9
migrate quickbar types
grahamlangford Apr 24, 2024
b0b5512
migrate quickbar provider types
grahamlangford Apr 24, 2024
562e0c5
migrate sidebar types
grahamlangford Apr 24, 2024
f268c2a
migrate tour types
grahamlangford Apr 24, 2024
62025ff
update file paths
grahamlangford Apr 24, 2024
147ca6a
auto-add
grahamlangford Apr 24, 2024
01a0ad7
fix types
grahamlangford Apr 24, 2024
4345ca3
auto-add
grahamlangford Apr 24, 2024
420f50e
cleanup
grahamlangford Apr 24, 2024
33c914c
more contentScript messenger migrations
grahamlangford Apr 24, 2024
a0e3074
Merge branch 'main' of github.com:pixiebrix/pixiebrix-extension into …
grahamlangford Apr 24, 2024
fa81576
selectElement
grahamlangford Apr 24, 2024
d2f5ed3
insertPanel
grahamlangford Apr 24, 2024
eb07504
insertButton
grahamlangford Apr 24, 2024
228e5a6
move insertButton to strict registration
grahamlangford Apr 24, 2024
7914e4d
eliminate cycle
grahamlangford Apr 24, 2024
87d94d7
auto-add
grahamlangford Apr 24, 2024
26e6bce
migrate more registration methods
grahamlangford Apr 24, 2024
73740f6
auto-add
grahamlangford Apr 24, 2024
5abd4fd
update counts
grahamlangford Apr 25, 2024
c090f84
Merge branch 'main' of github.com:pixiebrix/pixiebrix-extension into …
grahamlangford Apr 29, 2024
bff2840
remove comments
grahamlangford Apr 29, 2024
91856c5
address pr comments
grahamlangford Apr 29, 2024
5aacdea
Merge branch 'main' into strictNullChecks-insertPanel
grahamlangford Apr 29, 2024
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
13 changes: 0 additions & 13 deletions src/background/messenger/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,9 @@ export const contextMenus = {
preload: getMethod("PRELOAD_CONTEXT_MENUS", bg),
};

// Use this instead: `import reportError from "@/telemetry/reportError"`
// export const recordError = getNotifier("RECORD_ERROR", bg);

export const initTelemetry = getNotifier("INIT_TELEMETRY", bg);
export const sendDeploymentAlert = getNotifier("SEND_DEPLOYMENT_ALERT", bg);

export const getUserData = getMethod("GET_USER_DATA", bg);

export const installStarterBlueprints = getMethod(
"INSTALL_STARTER_BLUEPRINTS",
bg,
);

export const ping = getMethod("PING", bg);

export const collectPerformanceDiagnostics = getMethod(
"COLLECT_PERFORMANCE_DIAGNOSTICS",
bg,
);
27 changes: 3 additions & 24 deletions src/background/messenger/registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,16 @@ import {
ensureContextMenu,
preloadContextMenus,
uninstallContextMenu,
} from "@/background/contextMenus"; // 205 strictNullCheck errors
} from "@/background/contextMenus"; // 201 strictNullCheck errors
import {
requestRunInAllFrames,
requestRunInOtherTabs,
requestRunInOpener,
requestRunInTarget,
requestRunInTop,
} from "@/background/executor"; // Depends on contentScript/messenger to pass strictNullCheck
import { removeExtensionForEveryTab } from "@/background/removeExtensionForEveryTab"; // 207 strictNullCheck errors
import { debouncedActivateStarterMods as installStarterBlueprints } from "@/background/starterMods"; // 211 strictNullCheck errors
import {
collectPerformanceDiagnostics,
initTelemetry,
pong,
recordEvent,
sendDeploymentAlert,
} from "@/background/telemetry"; // Depends on contentScript/messenger to pass strictNullCheck
import { removeExtensionForEveryTab } from "@/background/removeExtensionForEveryTab"; // 203 strictNullCheck errors
import { debouncedActivateStarterMods as installStarterBlueprints } from "@/background/starterMods"; // 209 strictNullCheck errors

import { setCopilotProcessData } from "@/background/partnerHandlers"; // Depends on contentScript/messenger to pass strictNullCheck

Expand All @@ -60,20 +53,13 @@ declare global {

INSTALL_STARTER_BLUEPRINTS: typeof installStarterBlueprints;

PING: typeof pong;
COLLECT_PERFORMANCE_DIAGNOSTICS: typeof collectPerformanceDiagnostics;

REMOVE_EXTENSION_EVERY_TAB: typeof removeExtensionForEveryTab;

REQUEST_RUN_IN_OPENER: typeof requestRunInOpener;
REQUEST_RUN_IN_TARGET: typeof requestRunInTarget;
REQUEST_RUN_IN_TOP: typeof requestRunInTop;
REQUEST_RUN_IN_OTHER_TABS: typeof requestRunInOtherTabs;
REQUEST_RUN_IN_ALL_FRAMES: typeof requestRunInAllFrames;

RECORD_EVENT: typeof recordEvent;
INIT_TELEMETRY: typeof initTelemetry;
SEND_DEPLOYMENT_ALERT: typeof sendDeploymentAlert;
}
}

Expand All @@ -87,19 +73,12 @@ export default function registerMessenger(): void {
UNINSTALL_CONTEXT_MENU: uninstallContextMenu,
ENSURE_CONTEXT_MENU: ensureContextMenu,

PING: pong,
COLLECT_PERFORMANCE_DIAGNOSTICS: collectPerformanceDiagnostics,

REMOVE_EXTENSION_EVERY_TAB: removeExtensionForEveryTab,

REQUEST_RUN_IN_OPENER: requestRunInOpener,
REQUEST_RUN_IN_TARGET: requestRunInTarget,
REQUEST_RUN_IN_TOP: requestRunInTop,
REQUEST_RUN_IN_OTHER_TABS: requestRunInOtherTabs,
REQUEST_RUN_IN_ALL_FRAMES: requestRunInAllFrames,

RECORD_EVENT: recordEvent,
INIT_TELEMETRY: initTelemetry,
SEND_DEPLOYMENT_ALERT: sendDeploymentAlert,
});
}
12 changes: 12 additions & 0 deletions src/background/messenger/strict/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,15 @@ export const performConfiguredRequestInBackground = getMethod(

export const getPartnerPrincipals = getMethod("GET_PARTNER_PRINCIPALS", bg);
export const launchAuthIntegration = getMethod("LAUNCH_AUTH_INTEGRATION", bg);

export const ping = getMethod("PING", bg);
export const collectPerformanceDiagnostics = getMethod(
"COLLECT_PERFORMANCE_DIAGNOSTICS",
bg,
);

// Use this instead: `import reportError from "@/telemetry/reportError"`
// export const recordError = getNotifier("RECORD_ERROR", bg);

export const initTelemetry = getNotifier("INIT_TELEMETRY", bg);
export const sendDeploymentAlert = getNotifier("SEND_DEPLOYMENT_ALERT", bg);
19 changes: 19 additions & 0 deletions src/background/messenger/strict/registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ import {
launchAuthIntegration,
} from "@/background/partnerIntegrations";
import { getAvailableVersion } from "@/background/installer";
import {
collectPerformanceDiagnostics,
initTelemetry,
pong,
recordEvent,
sendDeploymentAlert,
} from "@/background/telemetry";

expectContext("background");

Expand Down Expand Up @@ -110,6 +117,12 @@ declare global {
LAUNCH_AUTH_INTEGRATION: typeof launchAuthIntegration;

GET_AVAILABLE_VERSION: typeof getAvailableVersion;

PING: typeof pong;
COLLECT_PERFORMANCE_DIAGNOSTICS: typeof collectPerformanceDiagnostics;
RECORD_EVENT: typeof recordEvent;
INIT_TELEMETRY: typeof initTelemetry;
SEND_DEPLOYMENT_ALERT: typeof sendDeploymentAlert;
}
}

Expand Down Expand Up @@ -163,5 +176,11 @@ export default function registerMessenger(): void {
LAUNCH_AUTH_INTEGRATION: launchAuthIntegration,

GET_AVAILABLE_VERSION: getAvailableVersion,

PING: pong,
COLLECT_PERFORMANCE_DIAGNOSTICS: collectPerformanceDiagnostics,
RECORD_EVENT: recordEvent,
INIT_TELEMETRY: initTelemetry,
SEND_DEPLOYMENT_ALERT: sendDeploymentAlert,
});
}
2 changes: 1 addition & 1 deletion src/bricks/transformers/extensionDiagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { TransformerABC } from "@/types/bricks/transformerTypes";
import { type Schema } from "@/types/schemaTypes";
import { getDiagnostics as collectFrameDiagnostics } from "@/contentScript/performanceMonitoring";
import { collectPerformanceDiagnostics as collectExtensionDiagnostics } from "@/background/messenger/api";
import { collectPerformanceDiagnostics as collectExtensionDiagnostics } from "@/background/messenger/strict/api";
import { propertiesToSchema } from "@/utils/schemaUtils";

class ExtensionDiagnostics extends TransformerABC {
Expand Down
2 changes: 1 addition & 1 deletion src/contentScript/contentScriptCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import registerBuiltinBricks from "@/bricks/registerBuiltinBricks";
import registerContribBlocks from "@/contrib/registerContribBlocks";
import brickRegistry from "@/bricks/registry";
import { initNavigation } from "@/contentScript/lifecycle";
import { initTelemetry } from "@/background/messenger/api";
import { initTelemetry } from "@/background/messenger/strict/api";
import { initToaster } from "@/utils/notify";
import { initPartnerIntegrations } from "@/contentScript/partnerIntegrations";
import {
Expand Down
3 changes: 0 additions & 3 deletions src/contentScript/messenger/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ export const removeInstalledExtension = getNotifier(
export const resetTab = getNotifier("RESET_TAB");
export const toggleQuickBar = getMethod("TOGGLE_QUICK_BAR");

export const insertPanel = getMethod("INSERT_PANEL");
export const insertButton = getMethod("INSERT_BUTTON");

export const runBlock = getMethod("RUN_SINGLE_BLOCK");
export const runRendererBlock = getMethod("RUN_RENDERER_BLOCK");

Expand Down
14 changes: 3 additions & 11 deletions src/contentScript/messenger/registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,19 @@ import {
queueReactivateTab,
reactivateTab,
removePersistedExtension,
} from "@/contentScript/lifecycle"; // 203 strictNullCheck errors
import { insertPanel } from "@/contentScript/pageEditor/insertPanel"; // 31 strictNullCheck errors
import { insertButton } from "@/contentScript/pageEditor/insertButton"; // 37 strictNullCheck errors
} from "@/contentScript/lifecycle"; // 202 strictNullCheck errors
import {
clearDynamicElements,
disableOverlay,
enableOverlay,
runExtensionPointReader,
updateDynamicElement,
} from "@/contentScript/pageEditor/dynamic"; // 206 strictNullCheck errors
} from "@/contentScript/pageEditor/dynamic"; // 205 strictNullCheck errors
import {
runBlockPreview,
resetTab,
runRendererBlock,
} from "@/contentScript/pageEditor"; // 208 strictNullCheck errors
} from "@/contentScript/pageEditor"; // 207 strictNullCheck errors
import { runBrick } from "@/contentScript/executor"; // Depends on background/messenger to pass strictNullCheck
import {
runHeadlessPipeline,
Expand All @@ -63,9 +61,6 @@ declare global {
REMOVE_INSTALLED_EXTENSION: typeof removePersistedExtension;
RESET_TAB: typeof resetTab;

INSERT_PANEL: typeof insertPanel;
INSERT_BUTTON: typeof insertButton;

RUN_SINGLE_BLOCK: typeof runBlockPreview;
RUN_RENDERER_BLOCK: typeof runRendererBlock;

Expand Down Expand Up @@ -96,9 +91,6 @@ export default function registerMessenger(): void {
REMOVE_INSTALLED_EXTENSION: removePersistedExtension,
RESET_TAB: resetTab,

INSERT_PANEL: insertPanel,
INSERT_BUTTON: insertButton,

RUN_SINGLE_BLOCK: runBlockPreview,
RUN_RENDERER_BLOCK: runRendererBlock,

Expand Down
3 changes: 3 additions & 0 deletions src/contentScript/messenger/strict/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ export const reloadMarketplaceEnhancements = getMethod(
);
export const getAttributeExamples = getMethod("GET_ATTRIBUTE_EXAMPLES");
export const selectElement = getMethod("SELECT_ELEMENT");

export const insertPanel = getMethod("INSERT_PANEL");
export const insertButton = getMethod("INSERT_BUTTON");
6 changes: 6 additions & 0 deletions src/contentScript/messenger/strict/registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ import { cancelSelect } from "@/contentScript/pageEditor/elementPicker";
import { reloadActivationEnhancements } from "@/contentScript/loadActivationEnhancementsCore";
import { getAttributeExamples } from "@/contentScript/pageEditor/elementInformation";
import selectElement from "@/contentScript/pageEditor/selectElement";
import { insertPanel } from "@/contentScript/pageEditor/insertPanel";
import { insertButton } from "@/contentScript/pageEditor/insertButton";

declare global {
interface MessengerMethods {
Expand Down Expand Up @@ -81,6 +83,8 @@ declare global {
RELOAD_MARKETPLACE_ENHANCEMENTS: typeof reloadActivationEnhancements;
GET_ATTRIBUTE_EXAMPLES: typeof getAttributeExamples;
SELECT_ELEMENT: typeof selectElement;
INSERT_PANEL: typeof insertPanel;
INSERT_BUTTON: typeof insertButton;
}
}
export default function registerMessenger(): void {
Expand Down Expand Up @@ -114,5 +118,7 @@ export default function registerMessenger(): void {
RELOAD_MARKETPLACE_ENHANCEMENTS: reloadActivationEnhancements,
GET_ATTRIBUTE_EXAMPLES: getAttributeExamples,
SELECT_ELEMENT: selectElement,
INSERT_PANEL: insertPanel,
INSERT_BUTTON: insertButton,
});
}
13 changes: 9 additions & 4 deletions src/contentScript/pageEditor/insertButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function insertButton(
"./beautify"
);

let selected;
let selected: HTMLElement[];
if (useNewFilter) {
const { elements } = await userSelectElement({
filter: `:is(a, button):not(${PRIVATE_ATTRIBUTES_SELECTOR})`,
Expand All @@ -52,14 +52,20 @@ export async function insertButton(
// if the parent is BUTTON, the user probably just selected the wrong thing
if (
selected.length === 1 &&
["A", "BUTTON"].includes(selected[0].parentElement?.tagName)
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unnecessary-type-assertion -- length check
["A", "BUTTON"].includes(selected[0]!.parentElement?.tagName ?? "")
) {
selected = [selected[0].parentElement];
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unnecessary-type-assertion -- verified above
selected = [selected[0]!.parentElement!];
}
}

const { container, selectors: containerSelectors } = findContainer(selected);

if (!containerSelectors[0]) {
throw new Error("No selector found for the button");
}

console.debug("insertButton", { container, selected });

const element: ButtonSelectionResult = {
Expand All @@ -75,7 +81,6 @@ export async function insertButton(
wrap_line_length: 80,
wrap_attributes: "force",
}),
shadowDOM: null,
position: "append",
},
containerInfo: await pageScript.getElementInfo({
Expand Down
4 changes: 4 additions & 0 deletions src/contentScript/pageEditor/insertPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export async function insertPanel(): Promise<PanelSelectionResult> {
const { elements: selected } = await userSelectElement();
const { container, selectors } = findContainer(selected);

if (!selectors[0]) {
throw new Error("No selector found for the panel");
}

return {
uuid: uuidv4(),
panel: {
Expand Down
2 changes: 1 addition & 1 deletion src/contentScript/performanceMonitoring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import { ping } from "@/background/messenger/api";
import { ping } from "@/background/messenger/strict/api";
import { isContextInvalidatedError } from "@/errors/contextInvalidated";
import { isLoadedInIframe } from "@/utils/iframeUtils";
import { getSettingsState } from "@/store/settings/settingsStorage";
Expand Down
2 changes: 1 addition & 1 deletion src/extensionConsole/options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { render } from "react-dom";
import React from "react";
import App from "@/extensionConsole/App";
import { initToaster } from "@/utils/notify";
import { initTelemetry } from "@/background/messenger/api";
import { initTelemetry } from "@/background/messenger/strict/api";
import { initMessengerLogging } from "@/development/messengerLogging";
import { initPerformanceMonitoring } from "@/telemetry/performance";
import { initRuntimeLogging } from "@/development/runtimeLogging";
Expand Down
8 changes: 1 addition & 7 deletions src/extensionConsole/pages/mods/ModsPageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@ import OnboardingView from "@/extensionConsole/pages/mods/onboardingView/Onboard
import EmptyView from "@/extensionConsole/pages/mods/emptyView/EmptyView";
import GetStartedView from "@/extensionConsole/pages/mods/GetStartedView";
import useOnboarding from "@/extensionConsole/pages/mods/onboardingView/useOnboarding";
import { type TableInstance } from "react-table";
import { type ModViewItem } from "@/types/modTypes";
import { type ModsPageContentProps } from "@/extensionConsole/pages/mods/modsPageTypes";

export type ModsPageContentProps = {
tableInstance: TableInstance<ModViewItem>;
width: number;
height: number;
};
const ModsPageContent: React.VoidFunctionComponent<ModsPageContentProps> = ({
tableInstance,
width,
Expand Down
2 changes: 1 addition & 1 deletion src/extensionConsole/pages/mods/gridView/GridView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import ListGroupHeader from "@/extensionConsole/pages/mods/listView/ListGroupHea
import { uuidv4 } from "@/types/helpers";
import { getUniqueId } from "@/utils/modUtils";
import GridCardErrorBoundary from "@/extensionConsole/pages/mods/gridView/GridCardErrorBoundary";
import { type ModsPageContentProps } from "@/extensionConsole/pages/mods/ModsPageContent";
import { type ModsPageContentProps } from "@/extensionConsole/pages/mods/modsPageTypes";

/**
* Expands `react-table` rows recursively in chunks of
Expand Down
2 changes: 1 addition & 1 deletion src/extensionConsole/pages/mods/listView/ListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { VariableSizeList as List } from "react-window";
import ListGroupHeader from "@/extensionConsole/pages/mods/listView/ListGroupHeader";
import { uuidv4 } from "@/types/helpers";
import ListItemErrorBoundary from "@/extensionConsole/pages/mods/listView/ListItemErrorBoundary";
import { type ModsPageContentProps } from "@/extensionConsole/pages/mods/ModsPageContent";
import { type ModsPageContentProps } from "@/extensionConsole/pages/mods/modsPageTypes";

const ROW_HEIGHT_PX = 90;
const HEADER_ROW_HEIGHT_PX = 43;
Expand Down
25 changes: 25 additions & 0 deletions src/extensionConsole/pages/mods/modsPageTypes.ts
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulling this out eliminates the cycle but doesn't do much to make the individual files easier to strict null check

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (C) 2024 PixieBrix, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import { type ModViewItem } from "@/types/modTypes";
import { type TableInstance } from "react-table";

export type ModsPageContentProps = {
tableInstance: TableInstance<ModViewItem>;
width: number;
height: number;
};
2 changes: 1 addition & 1 deletion src/pageEditor/starterBricks/menuItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { getDomain } from "@/permissions/patterns";
import { faMousePointer } from "@fortawesome/free-solid-svg-icons";
import { type ElementConfig } from "@/pageEditor/starterBricks/elementConfig";
import MenuItemConfiguration from "@/pageEditor/tabs/menuItem/MenuItemConfiguration";
import { insertButton } from "@/contentScript/messenger/api";
import { insertButton } from "@/contentScript/messenger/strict/api";
import {
type ButtonDefinition,
type ButtonSelectionResult,
Expand Down
2 changes: 1 addition & 1 deletion src/pageEditor/starterBricks/panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { getDomain } from "@/permissions/patterns";
import { faWindowMaximize } from "@fortawesome/free-solid-svg-icons";
import { type ElementConfig } from "@/pageEditor/starterBricks/elementConfig";
import PanelConfiguration from "@/pageEditor/tabs/panel/PanelConfiguration";
import { insertPanel } from "@/contentScript/messenger/api";
import { insertPanel } from "@/contentScript/messenger/strict/api";
import {
type DynamicDefinition,
type PanelSelectionResult,
Expand Down
Loading
Loading