Skip to content

Commit

Permalink
Merge branch 'main' into feature/analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremywiebe committed Aug 21, 2023
2 parents ec50a51 + 5352d51 commit 8ba69c1
Show file tree
Hide file tree
Showing 277 changed files with 2,427 additions and 2,526 deletions.
5 changes: 0 additions & 5 deletions .changeset/brave-mugs-wonder.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/five-meals-wink.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/loud-doors-melt.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/mean-parents-lay.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/nine-guests-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/math-input": minor
---

Handle keypad resize better when it's positioned absolutely
5 changes: 0 additions & 5 deletions .changeset/rich-spies-design.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/seven-trees-design.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/silent-berries-do.md

This file was deleted.

4 changes: 0 additions & 4 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ jobs:
if: (success() || failure()) && steps.js-files.outputs.filtered != '[]'
run: yarn build:types

- name: Build Flow types
if: (success() || failure()) && steps.js-files.outputs.filtered != '[]'
run: yarn build:flowtypes

# Run tests for our target matrix
- id: jest-reset
uses: Khan/actions@filter-files-v0
Expand Down
10 changes: 10 additions & 0 deletions config/build/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# perseus-build-settings

## 0.2.0

### Minor Changes

- 0993a46b: Don't generate Flow types

### Patch Changes

- ce5e6297: Upgrade wonder-blocks deps to package versions without Flow types

## 0.1.0

### Minor Changes
Expand Down
108 changes: 0 additions & 108 deletions config/build/gen-flow-types.ts

This file was deleted.

2 changes: 1 addition & 1 deletion config/build/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "perseus-build-settings",
"version": "0.1.0",
"version": "0.2.0",
"license": "MIT",
"private": true
}
2 changes: 1 addition & 1 deletion config/cypress/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ const dragTo = (node, pos) => {
.trigger("mouseup", {force: true})
.trigger("mouseout", {force: true});
};
// @ts-expect-error [FEI-5003] - TS2769 - No overload matches this call.
// @ts-expect-error - TS2769 - No overload matches this call.
Cypress.Commands.add("dragTo", {prevSubject: true}, dragTo);
12 changes: 6 additions & 6 deletions config/test/test-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
import MutationObserver from "@sheerun/mutationobserver-shim";
import {configure} from "@testing-library/dom"; // eslint-disable-line testing-library/no-dom-import, prettier/prettier
// @ts-expect-error [FEI-5003] - TS2305 - Module '"aphrodite"' has no exported member 'StyleSheetTestUtils'.
// @ts-expect-error - TS2305 - Module '"aphrodite"' has no exported member 'StyleSheetTestUtils'.
import {StyleSheetTestUtils} from "aphrodite";
import Enzyme from "enzyme"; // eslint-disable-line no-restricted-imports
import React16EnzymeAdapter from "enzyme-adapter-react-16"; // eslint-disable-line no-restricted-imports
Expand All @@ -27,7 +27,7 @@ configure({
});

if (typeof window !== "undefined") {
// @ts-expect-error [FEI-5003] - TS2322 - Type '() => { removeAllRanges: () => void; }' is not assignable to type '(() => Selection | null) & (() => Selection | null)'.
// @ts-expect-error - TS2322 - Type '() => { removeAllRanges: () => void; }' is not assignable to type '(() => Selection | null) & (() => Selection | null)'.
window.getSelection = () => {
return {
removeAllRanges: () => {},
Expand All @@ -46,7 +46,7 @@ if (typeof window !== "undefined") {
// redirecting to the right place.
/* eslint-disable no-restricted-syntax */
const oldLocation = window.location;
// @ts-expect-error [FEI-5003] - TS2790 - The operand of a 'delete' operator must be optional.
// @ts-expect-error - TS2790 - The operand of a 'delete' operator must be optional.
delete window.location;
const mockedLocation = new URL("http://localhost:8081");
window.location = {
Expand All @@ -63,7 +63,7 @@ if (typeof window !== "undefined") {

// Override window.alert which doesn't exist in node and log any
// alerts to the console instead.
// @ts-expect-error [FEI-5003] - TS2790 - The operand of a 'delete' operator must be optional.
// @ts-expect-error - TS2790 - The operand of a 'delete' operator must be optional.
delete window.alert;
window.alert = function (message: any) {
// eslint-disable-next-line no-console
Expand Down Expand Up @@ -132,7 +132,7 @@ const reportUnhandledConsoleWarnAndErrors = (
// custom handling.
if (process.env.GLOBAL_CONSOLE_MOCK !== "false") {
globalThis.console.error = (...args) => {
// @ts-expect-error [FEI-5003] - TS2556 - A spread argument must either have a tuple type or be passed to a rest parameter.
// @ts-expect-error - TS2556 - A spread argument must either have a tuple type or be passed to a rest parameter.
reportUnhandledConsoleWarnAndErrors("error", ...args);
};
globalThis.console.warn = (...args) => {
Expand Down Expand Up @@ -182,7 +182,7 @@ if (process.env.GLOBAL_CONSOLE_MOCK !== "false") {
!isReactUnsafe(message, args[1]) ||
isReportableReactUnsafe(message, args[1])
) {
// @ts-expect-error [FEI-5003] - TS2556 - A spread argument must either have a tuple type or be passed to a rest parameter.
// @ts-expect-error - TS2556 - A spread argument must either have a tuple type or be passed to a rest parameter.
reportUnhandledConsoleWarnAndErrors("warn", ...args);
}
};
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
"eslint-plugin-storybook": "^0.5.7",
"eslint-plugin-testing-library": "^5.0.0",
"fast-glob": "^3.2.11",
"flowgen": "git+https://[email protected]/Khan/flowgen.git#a098eaf64c752760c2ec5dc003062e3ad26e42b5",
"jest": "^29.0.1",
"jest-environment-jsdom": "^28.0.2",
"jest-enzyme": "^7.1.2",
Expand Down Expand Up @@ -127,7 +126,6 @@
"gen:parsers": "yarn --cwd packages/kas gen:parsers",
"build": "yarn gen:parsers && rollup -c config/build/rollup.config.js",
"build:types": "yarn tsc --build tsconfig-build.json",
"build:flowtypes": "config/build/gen-flow-types.ts",
"build:prodsizecheck": "yarn gen:parsers && rollup -c config/build/rollup.config.js --configEnvironment='production'",
"watch": "rollup -c config/build/rollup.config.js --watch",
"clean": "rm -rf packages/*/dist && rm -rf packages/*/node_modules && rm -rf .nyc_output && rm -f packages/*/*.tsbuildinfo",
Expand All @@ -136,7 +134,7 @@
"extract-strings": "utils/extract-strings.ts",
"lint": "eslint . --ext .js --ext .jsx --ext .ts --ext .tsx",
"lint:timing": "cross-env TIMING=1 yarn lint",
"publish:ci": "utils/pre-publish-check-ci.ts && git diff --stat --exit-code HEAD && yarn build && yarn build:types && yarn build:flowtypes && yarn extract-strings && changeset publish",
"publish:ci": "utils/pre-publish-check-ci.ts && git diff --stat --exit-code HEAD && yarn build && yarn build:types && yarn extract-strings && changeset publish",
"sloc": "sloc packages --exclude node_modules",
"test": "yarn jest",
"test:no-console-mock": "cross-env GLOBAL_CONSOLE_MOCK=false yarn jest",
Expand Down
2 changes: 1 addition & 1 deletion packages/kas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"dependencies": {},
"devDependencies": {
"jison": "0.4.15",
"perseus-build-settings": "^0.1.0",
"perseus-build-settings": "^0.2.0",
"underscore": "1.4.4"
},
"peerDependencies": {
Expand Down
6 changes: 6 additions & 0 deletions packages/kmath/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @khanacademy/kmath

## 0.1.2

### Patch Changes

- ce5e6297: Upgrade wonder-blocks deps to package versions without Flow types

## 0.1.1

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/kmath/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Khan Academy's Javascript Numeric Math Utilities",
"author": "Khan Academy",
"license": "MIT",
"version": "0.1.1",
"version": "0.1.2",
"publishConfig": {
"access": "public"
},
Expand All @@ -22,7 +22,7 @@
},
"dependencies": {},
"devDependencies": {
"perseus-build-settings": "^0.1.0",
"perseus-build-settings": "^0.2.0",
"underscore": "1.4.4"
},
"peerDependencies": {
Expand Down
16 changes: 8 additions & 8 deletions packages/kmath/src/vector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,25 @@ export function dot(a: Vector, b: Vector): number {
*/
export function add<V extends Vector>(...vecs: ReadonlyArray<V>): V {
const zipped = _.zip(...vecs);
// @ts-expect-error [FEI-5003] - TS2322 - Type 'number[]' is not assignable to type 'V'.
// @ts-expect-error - TS2322 - Type 'number[]' is not assignable to type 'V'.
return zipped.map(arraySum);
}

export function subtract<V extends Vector>(v1: V, v2: V): V {
// @ts-expect-error [FEI-5003] - TS2322 - Type 'number[]' is not assignable to type 'V'.
// @ts-expect-error - TS2322 - Type 'number[]' is not assignable to type 'V'.
return _.zip(v1, v2).map((dim) => dim[0] - dim[1]);
}

export function negate<V extends Vector>(v: V): V {
// @ts-expect-error [FEI-5003] - TS2322 - Type 'number[]' is not assignable to type 'V'.
// @ts-expect-error - TS2322 - Type 'number[]' is not assignable to type 'V'.
return v.map((x) => {
return -x;
});
}

// Scale a vector
export function scale<V extends Vector>(v1: V, scalar: number): V {
// @ts-expect-error [FEI-5003] - TS2322 - Type 'number[]' is not assignable to type 'V'.
// @ts-expect-error - TS2322 - Type 'number[]' is not assignable to type 'V'.
return v1.map((x) => {
return x * scalar;
});
Expand Down Expand Up @@ -204,27 +204,27 @@ export function projection<V extends Vector>(v1: V, v2: V): V {

// Round each number to a certain number of decimal places
export function round<V extends Vector>(vec: V, precision: V | number): V {
// @ts-expect-error [FEI-5003] - TS2322 - Type 'number[]' is not assignable to type 'V'.
// @ts-expect-error - TS2322 - Type 'number[]' is not assignable to type 'V'.
return vec.map((elem, i) => knumber.round(elem, precision[i] || precision));
}

// Round each number to the nearest increment
export function roundTo<V extends Vector>(vec: V, increment: V | number): V {
// @ts-expect-error [FEI-5003] - TS2322 - Type 'number[]' is not assignable to type 'V'.
// @ts-expect-error - TS2322 - Type 'number[]' is not assignable to type 'V'.
return vec.map((elem, i) =>
knumber.roundTo(elem, increment[i] || increment),
);
}

export function floorTo<V extends Vector>(vec: V, increment: V | number): V {
// @ts-expect-error [FEI-5003] - TS2322 - Type 'number[]' is not assignable to type 'V'.
// @ts-expect-error - TS2322 - Type 'number[]' is not assignable to type 'V'.
return vec.map((elem, i) =>
knumber.floorTo(elem, increment[i] || increment),
);
}

export function ceilTo<V extends Vector>(vec: V, increment: V | number): V {
// @ts-expect-error [FEI-5003] - TS2322 - Type 'number[]' is not assignable to type 'V'.
// @ts-expect-error - TS2322 - Type 'number[]' is not assignable to type 'V'.
return vec.map((elem, i) =>
knumber.ceilTo(elem, increment[i] || increment),
);
Expand Down
Loading

0 comments on commit 8ba69c1

Please sign in to comment.