Skip to content
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
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {

// Transform ES modules from these packages
transformIgnorePatterns: [
'node_modules/(?!(@mui|@emotion|@testing-library|@dnd-kit|@hello-pangea|@tiptap|konva|react-konva|d3-.*|internmap|@mapbox/point-geometry)(/|$))',
'node_modules/(?!(@mui|@emotion|@testing-library|@dnd-kit|@hello-pangea|@tiptap|lodash-es|konva|react-konva|d3-.*|internmap|@mapbox/point-geometry)(/|$))',
],

// Custom resolver to handle node: protocol imports
Expand Down
2 changes: 1 addition & 1 deletion old-packages/graph-lines/configure/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import debug from 'debug';

import defaultValues from './defaults';
import defaults from 'lodash/defaults';
import { defaults } from 'lodash-es';

const log = debug('pie-elements:graph-lines:configure');

Expand Down
2 changes: 1 addition & 1 deletion old-packages/graph-lines/controller/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import debug from 'debug';
import { getFeedbackForCorrectness } from '@pie-lib/feedback';
import { lineUtils as utils } from '@pie-lib/charting';
import isEmpty from 'lodash/isEmpty';
import { isEmpty } from 'lodash-es';

const log = debug('@pie-element:graph-lines:controller');

Expand Down
2 changes: 1 addition & 1 deletion old-packages/inline-choice/configure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@pie-lib/config-ui": "11.36.0-mui-update.0",
"@pie-lib/scoring-config": "3.33.0-mui-update.0",
"debug": "^3.1.0",
"lodash": "^4.17.15",
"lodash-es": "^4.17.23",
"prop-types": "^15.8.1",
"react": "^16.8.1",
"react-dom": "^16.8.1"
Expand Down
3 changes: 1 addition & 2 deletions old-packages/inline-choice/configure/src/root.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import Main from './main';
import cloneDeep from 'lodash/cloneDeep';
import { cloneDeep, max } from 'lodash-es';
import PropTypes from 'prop-types';
import max from 'lodash/max';

export default class Root extends React.Component {
static propTypes = {
Expand Down
2 changes: 1 addition & 1 deletion old-packages/inline-choice/controller/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import debug from 'debug';
import isEmpty from 'lodash/isEmpty';
import { isEmpty } from 'lodash-es';

import defaults from './defaults';

Expand Down
2 changes: 1 addition & 1 deletion old-packages/point-intercept/controller/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isEmpty from 'lodash/isEmpty';
import { isEmpty } from 'lodash-es';
import { getFeedbackForCorrectness } from '@pie-lib/feedback';

const getResponseCorrectness = (correctResponseWithLabels, points, graph, partialScores) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as feedbackMapper from '../feedback-mapper';
import _ from 'lodash';

describe('feedback-mapper', () => {
describe('modelToFeedbackConfig', () => {
Expand Down
2 changes: 1 addition & 1 deletion old-packages/text-entry/configure/src/model-config.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Typography from '@material-ui/core/Typography';
import { NChoice, InputCheckbox } from '@pie-lib/config-ui';
import TextField from '@material-ui/core/TextField';
import { withStyles } from '@material-ui/core/styles';
import range from 'lodash/range';
import { range } from 'lodash-es';
import Box from './box';
import PropTypes from 'prop-types';

Expand Down
2 changes: 1 addition & 1 deletion old-packages/text-entry/controller/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isEmpty from 'lodash/isEmpty';
import { isEmpty } from 'lodash-es';
import { getFeedbackForCorrectness } from '@pie-lib/feedback';

const process = (v, ignoreCase, ignoreWhitespace) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/boilerplate-item-type/configure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@pie-lib/editable-html-tip-tap": "1.1.1-next.1",
"@pie-lib/render-ui": "5.1.1-next.0",
"debug": "^4.1.1",
"lodash": "^4.17.15",
"lodash-es": "^4.17.23",
"prop-types": "^15.6.2",
"react": "18.2.0",
"react-dom": "18.2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ jest.mock('@pie-lib/config-ui', () => ({
},
}));

jest.mock('lodash/debounce', () => (fn) => fn);
jest.mock('lodash-es', () => ({
debounce: jest.fn((fn) => fn),
cloneDeep: jest.fn((value) => JSON.parse(JSON.stringify(value))),
}));

const theme = createTheme();

Expand Down Expand Up @@ -43,7 +46,7 @@ describe('design', () => {
onModelChanged={onChange}
onConfigurationChanged={onChangeConfig}
/>
</ThemeProvider>
</ThemeProvider>,
);
};

Expand Down
2 changes: 1 addition & 1 deletion packages/boilerplate-item-type/configure/src/design.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { styled } from '@mui/material/styles';
import cloneDeep from 'lodash/cloneDeep';
import { cloneDeep } from 'lodash-es';
import { settings, layout } from '@pie-lib/config-ui';
import { InputContainer } from '@pie-lib/render-ui'
import EditableHtml from '@pie-lib/editable-html-tip-tap';
Expand Down
6 changes: 2 additions & 4 deletions packages/boilerplate-item-type/controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
"module": "src/index.js",
"dependencies": {
"debug": "^4.1.1",
"lodash": "^4.17.15"
},
"devDependencies": {
"lodash": "^4.17.15"
"lodash-es": "^4.17.23"
},
"devDependencies": {},
"author": "",
"license": "ISC"
}
2 changes: 1 addition & 1 deletion packages/boilerplate-item-type/controller/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import isEmpty from 'lodash/isEmpty';
import { isEmpty } from 'lodash-es';
import defaults from './defaults';

export const getCorrectness = (model) => {

Check warning on line 4 in packages/boilerplate-item-type/controller/src/index.js

View workflow job for this annotation

GitHub Actions / test

'model' is defined but never used
const correctnessCondition = 'c';

switch (correctnessCondition) {
Expand Down Expand Up @@ -68,7 +68,7 @@
});
};

export const validate = (model = {}, config = {}) => {

Check warning on line 71 in packages/boilerplate-item-type/controller/src/index.js

View workflow job for this annotation

GitHub Actions / test

'config' is assigned a value but never used

Check warning on line 71 in packages/boilerplate-item-type/controller/src/index.js

View workflow job for this annotation

GitHub Actions / test

'model' is assigned a value but never used
const errors = {};

return errors;
Expand Down
2 changes: 1 addition & 1 deletion packages/boilerplate-item-type/src/print.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import debounce from 'lodash/debounce';
import { debounce } from 'lodash-es';
import Main from './main';
import { renderMath } from '@pie-lib/math-rendering';
import debug from 'debug';
Expand Down
2 changes: 1 addition & 1 deletion packages/categorize/configure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@pie-lib/render-ui": "5.1.1-next.0",
"@pie-lib/translator": "3.1.1-next.0",
"debug": "^4.1.1",
"lodash": "^4.17.15",
"lodash-es": "^4.17.23",
"prop-types": "^15.6.2",
"react": "18.2.0",
"react-dom": "18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/categorize/configure/src/design/builder.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cloneDeep from 'lodash/cloneDeep';
import { cloneDeep } from 'lodash-es';

export const buildCategories = (categories, choices, correctResponse) => {
const clonedCategories = cloneDeep(categories);
Expand Down
2 changes: 1 addition & 1 deletion packages/categorize/controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@pie-lib/controller-utils": "1.1.1-next.0",
"@pie-lib/feedback": "1.1.1-next.0",
"@pie-lib/translator": "3.1.1-next.0",
"lodash": "^4.17.15"
"lodash-es": "^4.17.23"
},
"version": "9.0.0-beta.1",
"description": "",
Expand Down
2 changes: 1 addition & 1 deletion packages/categorize/controller/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isEmpty from 'lodash/isEmpty';
import { isEmpty } from 'lodash-es';
import { buildState, score } from '@pie-lib/categorize';
import { getFeedbackForCorrectness } from '@pie-lib/feedback';
import { lockChoices, getShuffledChoices, partialScoring } from '@pie-lib/controller-utils';
Expand Down
2 changes: 1 addition & 1 deletion packages/categorize/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@pie-lib/render-ui": "5.1.1-next.0",
"@pie-lib/translator": "3.1.1-next.0",
"debug": "^4.1.1",
"lodash": "^4.17.15",
"lodash-es": "^4.17.23",
"prop-types": "^15.6.1",
"react": "18.3.1",
"react-dom": "18.3.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { getUpdatedCategories } from '../correct-response';
import cloneDeep from 'lodash/cloneDeep';
import { cloneDeep } from 'lodash-es';

jest.mock('@pie-lib/charting', () => ({
Chart: (props) => <div data-testid="chart">{props.children}</div>,
Expand Down
5 changes: 2 additions & 3 deletions packages/charting/configure/src/correct-response.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import { styled } from '@mui/material/styles';
import { Chart } from '@pie-lib/charting';
import isEqual from 'lodash/isEqual';
import cloneDeep from 'lodash/cloneDeep';
import { cloneDeep, isEqual } from 'lodash-es';

import Typography from '@mui/material/Typography';

Expand Down Expand Up @@ -205,7 +204,7 @@ export class CorrectResponse extends React.Component {
<span>Use the tools below to define the correct answer.</span>
</Typography>

{(identicalError || categoriesError) ? (
{identicalError || categoriesError ? (
<ChartError key={`correct-response-graph-${model.correctAnswer.name}`}>
<Chart
chartType={model.chartType}
Expand Down
2 changes: 1 addition & 1 deletion packages/charting/configure/src/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// this file is almost duplicated from graphing/configure/src/utils.js; the same logic must be used in charting
import isEqual from 'lodash/isEqual';
import { isEqual } from 'lodash-es';

const VALID_GRID_VALUES = [
0.01, 0.02, 0.04, 0.05, 0.0625, 0.1, 0.125, 0.2, 0.25, 0.5, 1, 2, 3, 4, 5, 8, 10, 12, 15, 20, 40, 50, 64, 100, 500,
Expand Down
2 changes: 1 addition & 1 deletion packages/charting/controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@pie-lib/controller-utils": "1.1.1-next.0",
"debug": "^4.1.1",
"lodash": "^4.17.15"
"lodash-es": "^4.17.23"
},
"devDependencies": {
"babel-jest": "^29.7.0",
Expand Down
16 changes: 7 additions & 9 deletions packages/charting/controller/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import debug from 'debug';
import isEqual from 'lodash/isEqual';
import isEmpty from 'lodash/isEmpty';
import pick from 'lodash/pick';
import { isEmpty, isEqual, pick } from 'lodash-es';
import defaults from './defaults';

import { partialScoring } from '@pie-lib/controller-utils';
Expand All @@ -16,12 +14,12 @@ export const checkLabelsEquality = (givenAnswerLabel, correctAnswerLabel) =>
export const setCorrectness = (answers, partialScoring) =>
answers
? answers.map((answer) => ({
...answer,
correctness: {
value: partialScoring ? 'incorrect' : 'correct',
label: partialScoring ? 'incorrect' : 'correct',
},
}))
...answer,
correctness: {
value: partialScoring ? 'incorrect' : 'correct',
label: partialScoring ? 'incorrect' : 'correct',
},
}))
: [];

export const normalize = (question) => ({ ...defaults, ...question });
Expand Down
2 changes: 1 addition & 1 deletion packages/charting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@pie-lib/math-rendering": "4.1.1-next.0",
"@pie-lib/render-ui": "5.1.1-next.0",
"debug": "^4.1.1",
"lodash": "^4.17.15",
"lodash-es": "^4.17.23",
"react": "18.3.1",
"react-dom": "18.3.1"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/charting/src/__tests__/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { render } from '@testing-library/react';
import { ThemeProvider, createTheme } from '@mui/material/styles';
import { Main } from '../main';

jest.mock('lodash/uniq', () => {
return () => [];
});
jest.mock('lodash-es', () => ({
uniq: jest.fn(() => []),
}));

jest.mock('@pie-lib/charting', () => ({
Chart: (props) => <div data-testid="chart">{props.children}</div>,
Expand Down Expand Up @@ -74,7 +74,7 @@ describe('Main', () => {
return render(
<ThemeProvider theme={theme}>
<Main {...combinedProps} />
</ThemeProvider>
</ThemeProvider>,
);
};

Expand Down
2 changes: 1 addition & 1 deletion packages/charting/src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { styled } from '@mui/material/styles';
import { color, Collapsible, hasText, PreviewPrompt, UiLayout, hasMedia } from '@pie-lib/render-ui';
import { Chart, chartTypes, KeyLegend } from '@pie-lib/charting';
import isEqual from 'lodash/isEqual';
import { isEqual } from 'lodash-es';
import CorrectAnswerToggle from '@pie-lib/correct-answer-toggle';

const StyledUiLayout = styled(UiLayout)({
Expand Down
2 changes: 1 addition & 1 deletion packages/complex-rubric/configure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@pie-lib/render-ui": "5.1.1-next.0",
"@pie-lib/rubric": "1.1.1-next.0",
"debug": "^4.1.1",
"lodash": "^4.17.15",
"lodash-es": "^4.17.23",
"prop-types": "^15.6.2",
"react": "18.2.0",
"react-dom": "18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/complex-rubric/configure/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createRoot } from 'react-dom/client';
import RubricConfigure from '@pie-element/rubric/configure/lib';
import MultiTraitRubricConfigure from '@pie-element/multi-trait-rubric/configure/lib';
import debug from 'debug';
import defaults from 'lodash/defaults';
import { defaults } from 'lodash-es';
import Main from './main';
import sensibleDefaults from './defaults';

Expand Down
2 changes: 1 addition & 1 deletion packages/complex-rubric/controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"lodash": "^4.17.15"
"lodash-es": "^4.17.23"
},
"author": "",
"license": "ISC",
Expand Down
2 changes: 1 addition & 1 deletion packages/complex-rubric/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@pie-lib/rubric": "1.1.1-next.0",
"classnames": "^2.2.5",
"debug": "^4.1.1",
"lodash": "^4.17.11",
"lodash-es": "^4.17.23",
"prop-types": "^15.7.2"
},
"gitHead": "a15dd0ea81626703eb753bc0ab4c81bb2a96d58d",
Expand Down
2 changes: 1 addition & 1 deletion packages/drag-in-the-blank/configure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@pie-lib/editable-html-tip-tap": "1.1.1-next.1",
"@pie-lib/math-rendering": "4.1.1-next.0",
"debug": "^4.1.1",
"lodash": "^4.17.15",
"lodash-es": "^4.17.23",
"prop-types": "^15.6.2",
"react": "18.2.0",
"react-dom": "18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/drag-in-the-blank/configure/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { createRoot } from 'react-dom/client';
import { renderMath } from '@pie-lib/math-rendering';
import Main from './main';
import debug from 'debug';
import defaults from 'lodash/defaults';
import { defaults } from 'lodash-es';

import sensibleDefaults from './defaults';
import { processMarkup, createSlateMarkup } from './markupUtils';
Expand Down
2 changes: 1 addition & 1 deletion packages/drag-in-the-blank/configure/src/markupUtils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import escape from 'lodash/escape';
import { escape } from 'lodash-es';

export const createElementFromHTML = (htmlString) => {
const div = document.createElement('div');
Expand Down
2 changes: 1 addition & 1 deletion packages/drag-in-the-blank/controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dependencies": {
"@pie-lib/controller-utils": "1.1.1-next.0",
"debug": "^4.1.1",
"lodash": "^4.17.15",
"lodash-es": "^4.17.23",
"type-of": "^2.0.1"
}
}
2 changes: 1 addition & 1 deletion packages/drag-in-the-blank/controller/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isEmpty from 'lodash/isEmpty';
import { isEmpty } from 'lodash-es';
import { getAllCorrectResponses, choiceIsEmpty } from './utils';
import { lockChoices, getShuffledChoices, partialScoring } from '@pie-lib/controller-utils';
import defaults from './defaults';
Expand Down
3 changes: 1 addition & 2 deletions packages/drag-in-the-blank/controller/src/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import cloneDeep from 'lodash/cloneDeep';
import reduce from 'lodash/reduce';
import { cloneDeep, reduce } from 'lodash-es';

const replaceHtmlRegex = /<(?!img)[^>]*>?/gm;

Expand Down
2 changes: 1 addition & 1 deletion packages/drag-in-the-blank/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@pie-lib/mask-markup": "2.1.1-next.1",
"@pie-lib/math-rendering": "4.1.1-next.0",
"@pie-lib/render-ui": "5.1.1-next.0",
"lodash": "^4.17.10",
"lodash-es": "^4.17.23",
"prop-types": "^15.6.1",
"react": "18.3.1",
"react-dom": "18.3.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/drawing-response/configure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@pie-lib/config-ui": "12.1.1-next.1",
"@pie-lib/editable-html-tip-tap": "1.1.1-next.1",
"debug": "^4.1.1",
"lodash": "^4.17.15",
"lodash-es": "^4.17.23",
"prop-types": "^15.7.2",
"react": "18.2.0",
"react-dom": "18.2.0"
Expand Down
Loading
Loading