From c27ee11bc69ff9dcf89814f9f66b4e1b3508f129 Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 23 Oct 2024 12:55:23 -0500 Subject: [PATCH] Revert process check (#1784) (#1790) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary: Reverts #1784 because it broke (static) Storybook Author: handeyeco Reviewers: jeremywiebe Required Reviewers: Approved By: jeremywiebe Checks: ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ gerald, 🚫 Publish npm snapshot (ubuntu-latest, 20.x), 🚫 Check for .changeset entries for all changed files (ubuntu-latest, 20.x), 🚫 Cypress (ubuntu-latest, 20.x), 🚫 Check builds for changes in size (ubuntu-latest, 20.x), 🚫 Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ gerald, 🚫 Publish npm snapshot (ubuntu-latest, 20.x), 🚫 Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), 🚫 Check builds for changes in size (ubuntu-latest, 20.x), 🚫 Cypress (ubuntu-latest, 20.x), 🚫 Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ gerald, 🚫 Publish npm snapshot (ubuntu-latest, 20.x), 🚫 Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), 🚫 Cypress (ubuntu-latest, 20.x), 🚫 Check for .changeset entries for all changed files (ubuntu-latest, 20.x), 🚫 Check builds for changes in size (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ gerald Pull Request URL: https://github.com/Khan/perseus/pull/1790 --- .changeset/{polite-pigs-look.md => slow-mails-vanish.md} | 2 +- packages/math-input/src/components/i18n-context.tsx | 3 +-- packages/perseus/src/components/i18n-context.tsx | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) rename .changeset/{polite-pigs-look.md => slow-mails-vanish.md} (58%) diff --git a/.changeset/polite-pigs-look.md b/.changeset/slow-mails-vanish.md similarity index 58% rename from .changeset/polite-pigs-look.md rename to .changeset/slow-mails-vanish.md index 43179cfe8b..e62b57fcb6 100644 --- a/.changeset/polite-pigs-look.md +++ b/.changeset/slow-mails-vanish.md @@ -3,4 +3,4 @@ "@khanacademy/perseus": patch --- -Check for process before accessing properties on it +Revert process check PR (#1784) diff --git a/packages/math-input/src/components/i18n-context.tsx b/packages/math-input/src/components/i18n-context.tsx index ffb60d1092..582f982ffa 100644 --- a/packages/math-input/src/components/i18n-context.tsx +++ b/packages/math-input/src/components/i18n-context.tsx @@ -18,8 +18,7 @@ type I18nContextType = { // @ts-expect-error - TS2322 - Type 'Context<{ strings: {}; locale: string; }>' is not assignable to type 'Context'. export const MathInputI18nContext: React.Context = React.createContext( - typeof process !== "undefined" && - (process.env.NODE_ENV === "test" || process.env.STORYBOOK) + process.env.NODE_ENV === "test" || process.env.STORYBOOK ? { strings: mockStrings, locale: "en", diff --git a/packages/perseus/src/components/i18n-context.tsx b/packages/perseus/src/components/i18n-context.tsx index 5218c056a0..26b72cb592 100644 --- a/packages/perseus/src/components/i18n-context.tsx +++ b/packages/perseus/src/components/i18n-context.tsx @@ -18,8 +18,7 @@ type I18nContextType = { // @ts-expect-error - TS2322 - Type 'Context<{ strings: {}; locale: string; }>' is not assignable to type 'Context'. export const PerseusI18nContext: React.Context = React.createContext( - typeof process !== "undefined" && - (process.env.NODE_ENV === "test" || process.env.STORYBOOK) + process.env.NODE_ENV === "test" || process.env.STORYBOOK ? { strings: mockStrings, locale: "en",