Skip to content

Commit 8e4e95a

Browse files
authored
Packages/aiinfo/coursea11ychecker (#200)
* aiinfo@2.10.1 * nutritionfacts@2.0.14 * remove default exports * update dependencies * default chuck sizes * merge chunking to root confing * lint * update cache * lint * release * lint
1 parent b4c8501 commit 8e4e95a

30 files changed

Lines changed: 7604 additions & 3555 deletions

File tree

apps/nutritionfacts/coverage/coverage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
coverage:
22
totals:
3-
statements: 7.38%
3+
statements: 7.9%
44
branches: 2.99%
55
functions: 8.33%
6-
lines: 7.64%
7-
total: 6.59%
6+
lines: 8.18%
7+
total: 6.85%
88
src:
99
totals:
1010
statements: 30.63%

apps/nutritionfacts/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@instructure.ai/nutritionfacts",
3-
"version": "2.0.13",
3+
"version": "2.0.14",
44
"private": true,
55
"repository": {
66
"type": "git",
@@ -19,9 +19,9 @@
1919
},
2020
"dependencies": {
2121
"@instructure.ai/aiinfo": "workspace:^",
22-
"@instructure/ui": "^11.2.0",
23-
"react": "^19.2.3",
24-
"react-dom": "^19.2.3"
22+
"@instructure/ui": "^11.6.0",
23+
"react": "^19.2.4",
24+
"react-dom": "^19.2.4"
2525
},
2626
"devDependencies": {
2727
"@instructure.ai/shared-configs": "workspace:^"

apps/nutritionfacts/src/app.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { EmbedControl, LinkControl } from "./components/export";
99
import { NutritionFactsForm, getLayoutFromParams } from "./components/layout";
1010

1111
const App: FC = () => {
12-
const searchParams = new URLSearchParams(window.location.search);
12+
const searchParams = new URLSearchParams(globalThis.location.search);
1313
const id = searchParams.get("id")?.toLowerCase();
1414

1515
const [product, setProduct] = useState<AiInfoFeatureProps | undefined>(undefined);
@@ -41,11 +41,11 @@ const App: FC = () => {
4141
const [isInIframe, setIsInIframe] = useState(false);
4242

4343
useEffect(() => {
44-
setIsInIframe(window.self !== window.top);
44+
setIsInIframe(globalThis.self !== window.top);
4545
}, []);
4646

4747
useEffect(() => {
48-
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
48+
const mediaQuery = globalThis.matchMedia("(prefers-color-scheme: dark)");
4949
setIsDark(mediaQuery.matches);
5050

5151
const handler = (e: MediaQueryListEvent) => setIsDark(e.matches);

apps/nutritionfacts/src/assets/consts.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { CanvasBug, IgniteBug, InstructureBug, MasteryBug, ParchmentBug } from "
66
import { type SVGWrapperProps } from "./";
77

88
const baseUrl =
9-
typeof window !== "undefined"
10-
? `${window.location.origin}${window.location.pathname}`
9+
typeof globalThis.window !== "undefined"
10+
? `${globalThis.location.origin}${globalThis.location.pathname}`
1111
: "https://instructure.ai/nutritionfacts";
1212

1313
const brands: Record<

apps/nutritionfacts/src/components/layout/getLayoutFromParams.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { type PageLayout } from "../../types";
22

33
export function getLayoutFromParams(defaultLayout: PageLayout) {
4-
const params = new URLSearchParams(window.location.search);
4+
const params = new URLSearchParams(globalThis.location.search);
55
const newLayout = { ...defaultLayout };
66

77
const keys: (keyof PageLayout)[] = ["copyright", "disclaimer", "revision", "permissions"];

apps/nutritionfacts/src/components/layout/presets.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ const Presets = ({ setProduct, product }: PresetsProps) => {
7070
}
7171
if (data.id && products[data.id]) {
7272
setProduct(products[data.id]);
73-
const url = new URL(window.location.href);
73+
const url = new URL(globalThis.location.href);
7474
url.searchParams.set("id", data.id);
75-
window.history.replaceState({}, "", url.toString());
75+
globalThis.history.replaceState({}, "", url.toString());
7676
}
7777
};
7878

apps/nutritionfacts/src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const mountApp = () => {
2323
);
2424
};
2525

26-
if (typeof window !== "undefined" && import.meta.env?.MODE !== "test") {
26+
if (typeof globalThis.window !== "undefined" && import.meta.env?.MODE !== "test") {
2727
mountApp();
2828
}
2929

apps/nutritionfacts/src/types.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44
import { type Dispatch, type SetStateAction } from "react";
55
import { type NutritionFactsProps } from "@instructure/ui";
66

7-
type StateProp<Type, Key extends string> = {
8-
[key in Key]: Type;
9-
} & {
10-
[key in `set${Capitalize<Key>}`]: Dispatch<SetStateAction<Type>>;
11-
};
7+
type StateProp<Type, Key extends string> = Record<Key, Type> &
8+
Record<`set${Capitalize<Key>}`, Dispatch<SetStateAction<Type>>>;
129

1310
interface PageLayout {
1411
disclaimer: boolean;

apps/nutritionfacts/tests/readme.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { name } from "../package.json" with { type: "json" };
66

77
const pkgRoot = new URL("..", import.meta.url);
88

9-
const readReadme = async () => readFile(new URL("./README.md", pkgRoot), "utf8");
9+
const readReadme = async () => readFile(new URL("README.md", pkgRoot), "utf8");
1010

1111
describe("rEADME.md", () => {
1212
it('starts with "# <package name>"', async () => {

apps/nutritionfacts/vite.config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import baseConfig from "@instructure.ai/shared-configs/react";
21
import { defineConfig, mergeConfig } from "vite";
2+
import baseConfig from "@instructure.ai/shared-configs/react";
33

44
export default mergeConfig(
55
baseConfig,

0 commit comments

Comments
 (0)