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

fix(nova/react): bring back default import for invariant #121

Merged
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
7 changes: 7 additions & 0 deletions change/@nova-react-7777c2ef-6eb5-4013-bbf2-3d51bb071261.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "bring back default import for invariant",
"packageName": "@nova/react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import type { NovaCentralizedCommanding } from "@nova/types";
import * as invariant from "invariant";
import invariant from "invariant";

// Initializing default with null to make sure providers are correctly placed in the tree
const NovaCommandingContext =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react";
import type { NovaEvent, NovaEventing, EventWrapper } from "@nova/types";
import { InputType } from "@nova/types";
import * as invariant from "invariant";
import invariant from "invariant";

// Context is initialized with an empty object and this is null-checked within the hooks
const NovaEventingContext = React.createContext<INovaEventingContext>({});
Expand Down
2 changes: 1 addition & 1 deletion packages/nova-react/src/graphql/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useNovaGraphQL } from "./nova-graphql-provider";
import * as invariant from "invariant";
import invariant from "invariant";

import type { GraphQLTaggedNode } from "./taggedNode";
import type {
Expand Down
2 changes: 1 addition & 1 deletion packages/nova-react/src/graphql/nova-graphql-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import type { NovaGraphQL } from "@nova/types";
import * as invariant from "invariant";
import invariant from "invariant";

// Initializing default with null to make sure providers are correctly placed in the tree
const NovaGraphQLContext = React.createContext<NovaGraphQL | null>(null);
Expand Down
12 changes: 11 additions & 1 deletion scripts/config/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
import * as path from "path";
import type { JestConfigWithTsJest } from "ts-jest";

export default {
const config: JestConfigWithTsJest = {
preset: "ts-jest",
rootDir: process.cwd(),
roots: ["<rootDir>/src"],
testPathIgnorePatterns: ["node_modules", "__generated__"],
testEnvironment: "jsdom",
setupFiles: [path.join(__dirname, "jest.setup.ts")],
globals: {
"ts-jest": {
tsconfig: {
esModuleInterop: true,
},
},
},
};

export default config;
Loading