Skip to content
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
5 changes: 3 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module.exports = {
"src/**/*.ts",
"!src/**/*.d.ts",
"!src/desktop/preload.ts",
"!src/cli/index.ts",
"!src/browser/api.ts",
"!src/cli/**/*",
"!src/desktop/main.ts",
],
setupFilesAfterEnv: ["<rootDir>/tests/setup.ts"],
Expand All @@ -22,7 +23,7 @@ module.exports = {
target: "ES2020",
module: "ESNext",
moduleResolution: "node",
lib: ["ES2020", "DOM", "ES2022.Intl"],
lib: ["ES2023", "DOM", "ES2022.Intl"],
esModuleInterop: true,
allowSyntheticDefaultImports: true,
},
Expand Down
4 changes: 2 additions & 2 deletions src/browser/components/hooks/useGitBranchDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const SECTION_MARKERS = {
dirtyStart: "__MUX_BRANCH_DATA__BEGIN_DIRTY_FILES__",
dirtyEnd: "__MUX_BRANCH_DATA__END_DIRTY_FILES__",
} as const;

const isDevelopment = import.meta.env.DEV;
// eslint-disable-next-line no-restricted-globals, no-restricted-syntax
const isDevelopment = process.env.NODE_ENV !== "production";

function debugAssert(condition: unknown, message: string): void {
if (!condition && isDevelopment) {
Expand Down
6 changes: 4 additions & 2 deletions src/browser/stores/MapStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export class MapStore<K, V> {
*/
get(key: K, compute: () => V): V {
// DEV-mode: Track render depth to detect bump() during render
if (import.meta.env.DEV) {
// eslint-disable-next-line no-restricted-globals, no-restricted-syntax
if (process.env.NODE_ENV !== "production") {
this.renderDepth++;
try {
return this.getImpl(key, compute);
Expand Down Expand Up @@ -109,7 +110,8 @@ export class MapStore<K, V> {
*/
bump(key: K): void {
// DEV-mode guard: detect bump() during render
if (import.meta.env.DEV && this.renderDepth > 0) {
// eslint-disable-next-line no-restricted-globals, no-restricted-syntax
if (process.env.NODE_ENV !== "production" && this.renderDepth > 0) {
const error = new Error(
`[MapStore] bump() called during render! This will cause infinite loops.\n` +
`Key: ${String(key)}\n` +
Expand Down