Skip to content

Commit 23e4459

Browse files
committed
[tb/LEMS-2523/merge-get-user-input-map] Merge branch 'main' into tb/LEMS-2523/merge-get-user-input-map
2 parents 1e83417 + fd35e16 commit 23e4459

File tree

209 files changed

+5655
-5391
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+5655
-5391
lines changed

.changeset/little-goats-prove.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.changeset/warm-penguins-tickle.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ module.exports = {
259259
{
260260
allow: [
261261
"**/*.css",
262-
"**/*.less",
263262
"@testing-library/jest-dom",
264263
"@testing-library/jest-dom/extend-expect",
265264
"whatwg-fetch",

.github/workflows/node-ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,14 @@ jobs:
331331
steps.publish-snapshot.outputs.npm_snapshot_tag }}
332332
```
333333
334-
If you are working in Khan Academy's webapp, you can run the below command.
335-
If this is for backend code, change the static flag (-s) from y/yes to n/no.
334+
If you are working in Khan Academy's frontend, you can run the below command.
336335
```sh
337-
./dev/tools/bump_perseus_version.js -s y -t PR${{ github.event.pull_request.number }}
336+
./tools/bump_perseus_version.js -t PR${{ github.event.pull_request.number }}
337+
```
338+
339+
If you are working in Khan Academy's webapp, you can run the below command.
340+
```sh
341+
./dev/tools/bump_perseus_version.js -s n -t PR${{ github.event.pull_request.number }}
338342
```
339343
340344
- name: Create or update npm snapshot comment - failure, snapshot publish failed

.storybook/global.less renamed to .storybook/global.css

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,22 @@
44
* .storybook/preview.js file so that the components can have the same
55
* styles as prod when viewed within Storybook.
66
*/
7-
8-
// Variables
9-
@offBlack: #21242c;
10-
@wonderBlocksFontFamily: "Lato", "Noto Sans", "Helvetica", "Corbel", sans-serif;
11-
127
html,
138
body {
149
height: 100%;
1510
}
16-
1711
body {
18-
font-family: @wonderBlocksFontFamily, "Helvetica", "Corbel", sans-serif;
12+
font-family: "Lato", "Noto Sans", "Helvetica", "Corbel", sans-serif,
13+
"Helvetica", "Corbel", sans-serif;
1914
font-size: 14px;
2015
margin: 0;
21-
color: @offBlack;
16+
color: var(--wb-semanticColor-text-primary);
2217
line-height: 1.4;
2318
min-width: 0;
2419
}
25-
2620
.box-sizing-border-box-reset {
2721
box-sizing: border-box;
2822
}
29-
3023
.box-sizing-border-box-reset * {
3124
box-sizing: inherit;
3225
}

.storybook/main.ts

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,28 @@ import {spacing} from "@khanacademy/wonder-blocks-tokens";
33

44
import type {StorybookConfig} from "@storybook/react-vite";
55

6+
const excludedCssFiles = ["lato.css", "protractor.css", "mafs-styles.css"];
67
// This is a temporary plugin option to mimic what is in PROD in regard to cascade layers.
7-
// Perseus LESS files are wrapped in the 'shared' layer in Webapp.
8-
// To get the same ordering of precedence in Storybook, the imported LESS files need to be wrapped accordingly.
9-
// Once the LESS files have cascade layers included (LEMS-2801),
8+
// Perseus CSS files are wrapped in the 'shared' layer in khan/frontend.
9+
// To get the same ordering of precedence in Storybook, the imported CSS files need to be wrapped accordingly.
10+
// Once the CSS files have cascade layers included (LEMS-2801),
1011
// then the following plugin option should be removed.
11-
const lessWrapper = {
12-
name: "wrap-less-in-layer",
12+
const cssWrapper = {
13+
name: "wrap-css-in-layer",
1314
transform: (code: string, pathname: string) => {
14-
if (pathname.endsWith(".less")) {
15-
const layerStatements =
16-
"@layer reset, shared, legacy;\n@layer shared";
17-
return {
18-
code: `${layerStatements} { ${code} }`,
19-
map: null,
20-
};
15+
if (pathname.endsWith(".css")) {
16+
// Exclude the CSS files that are not part of the shared layer.
17+
if (!excludedCssFiles.some((file) => pathname.endsWith(file))) {
18+
// Exclude any CSS file that already has a layer statement.
19+
if (!code.includes("@layer")) {
20+
const layerStatements =
21+
"@layer reset, shared, legacy;\n@layer shared";
22+
return {
23+
code: `${layerStatements} { ${code} }`,
24+
map: null,
25+
};
26+
}
27+
}
2128
}
2229
},
2330
};
@@ -38,8 +45,11 @@ const config: StorybookConfig = {
3845
// dir.
3946
"../packages/*/src/**/*@(.stories|.fixturestories).@(ts|tsx)",
4047
],
41-
42-
addons: ["@storybook/addon-links", "@storybook/addon-a11y"],
48+
addons: [
49+
"@storybook/addon-a11y",
50+
"@storybook/addon-docs",
51+
"@storybook/addon-links",
52+
],
4353

4454
// NOTE(kevinb): We customize the padding a bit so that so that stories
4555
// using the on-screen keypad render correctly. Storybook adds its own
@@ -81,7 +91,7 @@ const config: StorybookConfig = {
8191
return !file.endsWith(".svg");
8292
},
8393
},
84-
plugins: [lessWrapper],
94+
plugins: [cssWrapper],
8595
});
8696
},
8797
staticDirs: ["../static"],

.storybook/preview.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
storybookDependenciesV2,
1212
} from "../testing/test-dependencies";
1313

14-
import "./global.less";
14+
import "./global.css";
1515
import "./reset.css";
1616

1717
// Import the Wonder Blocks CSS variables
@@ -87,6 +87,9 @@ const preview: Preview = {
8787
value,
8888
})),
8989
},
90+
docs: {
91+
toc: true,
92+
},
9093
},
9194
tags: [
9295
//👇 Enables auto-generated documentation for all stories

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ We use [changesets](https://github.com/changesets/changesets) to help manage our
3939
### Updating Dependencies
4040

4141
If you want to use another library in Perseus, you will need up update the dependencies.
42-
Use `peerDependencies` and `devDependencies` for dependencies that webapp is already using, such as
43-
Wonder Blocks or React.
42+
Use `peerDependencies` and `devDependencies` for dependencies that
43+
khan/frontend is already using, such as Wonder Blocks or React.
4444

4545
1. `cd` into to the package in which you would like to update the dependency.
4646
```
@@ -54,7 +54,7 @@ cd packages/perseus-editor
5454
```
5555
// All dependencies
5656
pnpm add --dev [dependency name]
57-
// Include this too if webapp is using this dependency
57+
// Include this too if khan/frontend is using this dependency
5858
pnpm add --peer [dependency name]
5959
6060
// Example

config/build/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# perseus-build-settings
22

3+
## 0.7.0
4+
5+
### Minor Changes
6+
7+
- [#2489](https://github.com/Khan/perseus/pull/2489) [`d8c99f629`](https://github.com/Khan/perseus/commit/d8c99f629c9439cdf56e96f6a53f6bb28f278e07) Thanks [@mark-fitzgerald](https://github.com/mark-fitzgerald)! - Convert LESS files to pre-built CSS files to simplify our styling framework
8+
39
## 0.6.2
410

511
### Patch Changes

config/build/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "perseus-build-settings",
3-
"version": "0.6.2",
3+
"version": "0.7.0",
44
"license": "MIT",
55
"private": true
66
}

0 commit comments

Comments
 (0)