From 02f9c885aca363d4bd723621eccd37dedca561fc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Dec 2024 05:22:54 +0000 Subject: [PATCH 1/2] Bump prettier from 2.8.1 to 3.4.1 Bumps [prettier](https://github.com/prettier/prettier) from 2.8.1 to 3.4.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.1...3.4.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 13 +++++++------ package.json | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index fb5edfb..d336bb0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "devDependencies": { "husky": "^9.1.5", "lint-staged": "^15.2.10", - "prettier": "2.8.1" + "prettier": "3.4.1" } }, "demo": { @@ -17909,15 +17909,16 @@ } }, "node_modules/prettier": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.1.tgz", - "integrity": "sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.1.tgz", + "integrity": "sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==", "dev": true, + "license": "MIT", "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" diff --git a/package.json b/package.json index caf1d73..64de7be 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "devDependencies": { "husky": "^9.1.5", "lint-staged": "^15.2.10", - "prettier": "2.8.1" + "prettier": "3.4.1" }, "lint-staged": { "**/*": "prettier --write --ignore-unknown" From 649cef8f621a0b26648692d9805bded14b149e9c Mon Sep 17 00:00:00 2001 From: David Liu Date: Sun, 1 Dec 2024 12:14:49 -0500 Subject: [PATCH 2/2] Prettier changes --- .github/PULL_REQUEST_TEMPLATE.md | 24 ++-- CHANGELOG.md | 110 +++++++++--------- demo/src/html/index.html | 2 +- docs/docs/02-object_structure.md | 42 +++---- docs/docs/03-automation_algorithms.md | 32 ++--- docs/docs/04-style.md | 12 +- .../src/tests/__snapshots__/snapshot.html | 2 +- webstepper/CHANGELOG.md | 8 +- webstepper/src/html/index.html | 2 +- 9 files changed, 117 insertions(+), 117 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 3b5f20f..994560f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -31,21 +31,21 @@ _(Complete each of the following items for your pull request. Indicate that you Before opening your pull request: -- [ ] I have performed a self-review of my changes. - - Check that all changed files included in this pull request are intentional changes. - - Check that all changes are relevant to the purpose of this pull request, as described above. -- [ ] I have added tests for my changes, if applicable. - - This is **required** for all bug fixes and new features. -- [ ] I have updated the project documentation, if applicable. - - This is **required** for new features. -- [ ] If this is my first contribution, I have added myself to the list of contributors. -- [ ] I have updated the project Changelog (this is required for all changes). +- [ ] I have performed a self-review of my changes. + - Check that all changed files included in this pull request are intentional changes. + - Check that all changes are relevant to the purpose of this pull request, as described above. +- [ ] I have added tests for my changes, if applicable. + - This is **required** for all bug fixes and new features. +- [ ] I have updated the project documentation, if applicable. + - This is **required** for new features. +- [ ] If this is my first contribution, I have added myself to the list of contributors. +- [ ] I have updated the project Changelog (this is required for all changes). After opening your pull request: -- [ ] I have verified that the CI tests have passed. -- [ ] I have reviewed the test coverage changes reported by Coveralls. -- [ ] I have [requested a review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review) from a project maintainer. +- [ ] I have verified that the CI tests have passed. +- [ ] I have reviewed the test coverage changes reported by Coveralls. +- [ ] I have [requested a review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review) from a project maintainer. ## Questions and Comments diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d88c21..96305c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### ✨ Enhancements -- Added a batch mode to allow multiple snapshots as inputs to `draw` function +- Added a batch mode to allow multiple snapshots as inputs to `draw` function ### 🐛 Bug fixes @@ -23,119 +23,119 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### ✨ Enhancements -- Added transparent and dark mode versions of the logos! -- Added functionality to set a default width for automatic-layout diagrams if not specified, - and to crop unused space if necessary. +- Added transparent and dark mode versions of the logos! +- Added functionality to set a default width for automatic-layout diagrams if not specified, + and to crop unused space if necessary. ### 🐛 Bug fixes -- Fixed a bug where the `Download JSON` button would not download the JSON currently inside the input box. -- Made sure file input would reset when file input dialog was closed. -- Fixed a bug where the styles in `DisplaySettings.roughjs_config` were not applied. -- Fixed a bug where passing an empty array as objects will crash the program. -- Fixed a bug where the text may go outside of the box when it has a text font set +- Fixed a bug where the `Download JSON` button would not download the JSON currently inside the input box. +- Made sure file input would reset when file input dialog was closed. +- Fixed a bug where the styles in `DisplaySettings.roughjs_config` were not applied. +- Fixed a bug where passing an empty array as objects will crash the program. +- Fixed a bug where the text may go outside of the box when it has a text font set ### 📚 Documentation and demo website changes -- Made text input box use a monospace font -- Disabled download buttons when there is no input/output. -- Added a dialog to the file input section. -- Made improvements to the dark mode version of the website. +- Made text input box use a monospace font +- Disabled download buttons when there is no input/output. +- Added a dialog to the file input section. +- Made improvements to the dark mode version of the website. ### 🔧 Internal changes -- Added better typing. -- Added a page for viewing Jest SVG snapshots. -- Added a plugin for prettifying Jest SVG outputs. +- Added better typing. +- Added a page for viewing Jest SVG snapshots. +- Added a plugin for prettifying Jest SVG outputs. ## [0.3.2] - 2024-09-14 ### ✨ Enhancements -- Added MemoryViz logo images! +- Added MemoryViz logo images! ### 🐛 Bug fixes -- Fixed an an issue with the `--output` flag not outputting results in the correct location. +- Fixed an an issue with the `--output` flag not outputting results in the correct location. ### 📚 Documentation and demo website changes -- Reformatted demo website to horizontal layout. -- Added more documentation for the `--output` flag. -- Added zoom functionality to output canvas. +- Reformatted demo website to horizontal layout. +- Added more documentation for the `--output` flag. +- Added zoom functionality to output canvas. ### 🔧 Internal changes -- Update GitHub Actions workflow to execute build on every pull request (and deployment only on changes to `master`) -- Create dependabot group for `@docusaurus` dependencies -- Create dependabot group for `@mui` dependencies +- Update GitHub Actions workflow to execute build on every pull request (and deployment only on changes to `master`) +- Create dependabot group for `@docusaurus` dependencies +- Create dependabot group for `@mui` dependencies ## [0.3.1] - 2024-08-02 ### 🐛 Bug fixes -- Ensured built package files under `dist/` were correctly updated +- Ensured built package files under `dist/` were correctly updated ### 🔧 Internal changes -- Updated most package dependencies +- Updated most package dependencies ## [0.3.0] - 2024-08-02 ### ✨ Enhancements -- Changed the `filePath` argument in the MemoryViz CLI to be optional and added `--output` option. +- Changed the `filePath` argument in the MemoryViz CLI to be optional and added `--output` option. ### 🐛 Bug fixes -- Fixed issue where object boxes would be drawn on top of stack frames in diagrams with large left margins. +- Fixed issue where object boxes would be drawn on top of stack frames in diagrams with large left margins. ### 🔧 Internal changes -- Moved global style attributes to CSS embedded in generated SVGs. +- Moved global style attributes to CSS embedded in generated SVGs. ## [0.2.0] - 2024-06-28 ### 🚨 Breaking changes -- Changed the `name` attribute to `type` when drawing objects. -- Removed the `isClass` and `stack_frame` attributes and embedded them as the types `.class` and `.frame`. -- Renamed the input for blank objects from `BLANK` to `.blank`. -- Created new type `.blank-frame` to denote blank stack frames. -- Replaced `seed` configuration option with general configuration option `roughjs_config`. +- Changed the `name` attribute to `type` when drawing objects. +- Removed the `isClass` and `stack_frame` attributes and embedded them as the types `.class` and `.frame`. +- Renamed the input for blank objects from `BLANK` to `.blank`. +- Created new type `.blank-frame` to denote blank stack frames. +- Replaced `seed` configuration option with general configuration option `roughjs_config`. ### ✨ Enhancements -- Created a CLI for MemoryViz. -- Added `--height` and `--width` options to MemoryViz CLI. -- Added `--roughjs_config` option to MemoryViz CLI. +- Created a CLI for MemoryViz. +- Added `--height` and `--width` options to MemoryViz CLI. +- Added `--roughjs_config` option to MemoryViz CLI. ### 🐛 Bug fixes -- Fixed a bug where box fill colours would cover box text, and changed the implementation of `hide` style option. -- Removed double quotes when rendering objects of type `None`. -- Removed double quotes when rendering objects that are not of type `str`. -- Fixed issue where diagrams would not render when width inputs to `draw()` were too small. +- Fixed a bug where box fill colours would cover box text, and changed the implementation of `hide` style option. +- Removed double quotes when rendering objects of type `None`. +- Removed double quotes when rendering objects that are not of type `str`. +- Fixed issue where diagrams would not render when width inputs to `draw()` were too small. ### 📚 Documentation and demo website changes -- Added documentation page for the MemoryViz CLI. +- Added documentation page for the MemoryViz CLI. ### 🔧 Internal changes -- Added a changelog and pull request template. -- Modified `roughjs` import to be compatible with Jest's `moduleNameMapper` config option. -- Added instructions on the `memory-viz/README.md` for running the test suite. -- Fix CI build action for demo website. -- Added data type and manual layout tests for the `draw` function. -- Updated file paths for example files under docs to import the correct file. -- Added style and automatic layout tests for the `draw` function. -- Updated documentation, tests, and examples to reflect the `isClass` attribute being optional and set to `false` by default. -- Removed unused imports in `demo_C.js`. -- Added type interfaces and type annotations to `style.ts`. -- Added `DrawnEntity` type annotations to source code files. -- Adopted Commander.js library for the MemoryViz CLI. -- Added `autofix.ci` to the CI workflow. +- Added a changelog and pull request template. +- Modified `roughjs` import to be compatible with Jest's `moduleNameMapper` config option. +- Added instructions on the `memory-viz/README.md` for running the test suite. +- Fix CI build action for demo website. +- Added data type and manual layout tests for the `draw` function. +- Updated file paths for example files under docs to import the correct file. +- Added style and automatic layout tests for the `draw` function. +- Updated documentation, tests, and examples to reflect the `isClass` attribute being optional and set to `false` by default. +- Removed unused imports in `demo_C.js`. +- Added type interfaces and type annotations to `style.ts`. +- Added `DrawnEntity` type annotations to source code files. +- Adopted Commander.js library for the MemoryViz CLI. +- Added `autofix.ci` to the CI workflow. ## [0.1.0] - 2024-04-16 diff --git a/demo/src/html/index.html b/demo/src/html/index.html index 417cd48..3ace9cb 100644 --- a/demo/src/html/index.html +++ b/demo/src/html/index.html @@ -1,4 +1,4 @@ - + diff --git a/docs/docs/02-object_structure.md b/docs/docs/02-object_structure.md index 9d9780d..d878ebb 100644 --- a/docs/docs/02-object_structure.md +++ b/docs/docs/02-object_structure.md @@ -10,27 +10,27 @@ the array of objects to be drawn. To be successfully rendered, the array must contain objects that strictly follow a specific structure. Every object must contain the following attributes: -- `type` - `string`: Specifies whether a class, stack frame, or object is being drawn. To draw a class, input `.class` and to draw a stack frame, input `.frame`. If an object is being drawn, input the type of the object. -- `name` - `string`: The name of the class or stack frame to be drawn. Note that this attribute is only - applicable if the object's type is `.class` or `.frame`. Otherwise, this attribute can be excluded from the input. -- If the user wants to hardcode the coordinates (implying the `automation` parameter of `draw` is false), each object - must include `x` and `y` attributes (for x-y coordinates). -- `id` - `string`|`number`: Denotes the id value of this object. If we are to draw a stack frame, then this MUST be `null`. -- `value` - `*`: Denotes the value of the object. This could be anything, from an empty string to a JS object, - which would be passed for the purpose of drawing a user-defined class object, a - stack frame, or a dictionary. - **Note that in such cases where we want to draw a 'container' - object (an object that contains other objects), we pass a _JS object_ where the keys are the - attributes/variables and the values are the id's of the corresponding objects (not the - objects themselves)**. -- `show_indexes` - `boolean`: This is applicable only when drawing tuples or lists (when drawSequence - method will be used). It denotes whether the memory box of the underlying - sequence will include indices (for sequences) or not. This - has a default value of `false`, and it should be manually set to `true` - only if the object corresponds to a sequence (list or - tuple). -- `style` - `object` | `array`: A JS object or array specifying the "style" of the object. See `style.md` for information - on the required structure (also see `presets.md` for the full capabilities). +- `type` - `string`: Specifies whether a class, stack frame, or object is being drawn. To draw a class, input `.class` and to draw a stack frame, input `.frame`. If an object is being drawn, input the type of the object. +- `name` - `string`: The name of the class or stack frame to be drawn. Note that this attribute is only + applicable if the object's type is `.class` or `.frame`. Otherwise, this attribute can be excluded from the input. +- If the user wants to hardcode the coordinates (implying the `automation` parameter of `draw` is false), each object + must include `x` and `y` attributes (for x-y coordinates). +- `id` - `string`|`number`: Denotes the id value of this object. If we are to draw a stack frame, then this MUST be `null`. +- `value` - `*`: Denotes the value of the object. This could be anything, from an empty string to a JS object, + which would be passed for the purpose of drawing a user-defined class object, a + stack frame, or a dictionary. + **Note that in such cases where we want to draw a 'container' + object (an object that contains other objects), we pass a _JS object_ where the keys are the + attributes/variables and the values are the id's of the corresponding objects (not the + objects themselves)**. +- `show_indexes` - `boolean`: This is applicable only when drawing tuples or lists (when drawSequence + method will be used). It denotes whether the memory box of the underlying + sequence will include indices (for sequences) or not. This + has a default value of `false`, and it should be manually set to `true` + only if the object corresponds to a sequence (list or + tuple). +- `style` - `object` | `array`: A JS object or array specifying the "style" of the object. See `style.md` for information + on the required structure (also see `presets.md` for the full capabilities). ### Examples diff --git a/docs/docs/03-automation_algorithms.md b/docs/docs/03-automation_algorithms.md index 3716e62..8272d64 100644 --- a/docs/docs/03-automation_algorithms.md +++ b/docs/docs/03-automation_algorithms.md @@ -79,22 +79,22 @@ Below we thoroughly describe the steps for each of the two functions: with dimensions, and is sorted by descending height), and let the current object be denoted as `obj`: -- If `obj` fits horizontally (which is determined by checking - if the top-right coordinate of the last iteration's object, - plus some padding, plus the width of `obj` is less than the - width of the entire canvas), **equip `obj` with the (top-left) - coordinates** it would take if it were drawn. -- If `obj` does NOT fit horizontally, we move to a new row. - The height of the new row will be the height of the current - object that does not fit (plus some padding), `obj`, since (due to the sorting - in step 2) `obj` is tallest amongst all remaining objects - (so it just makes sense to the make this the height of - the row itself). - Again, **equip `obj` with the (top-left) coordinates** it - would take if it were drawn (in this case, the x-coordinate - would go back to the initial state since we moved to a new row, - and the y-coordinate would increase by the height of the - _previous_ row). +- If `obj` fits horizontally (which is determined by checking + if the top-right coordinate of the last iteration's object, + plus some padding, plus the width of `obj` is less than the + width of the entire canvas), **equip `obj` with the (top-left) + coordinates** it would take if it were drawn. +- If `obj` does NOT fit horizontally, we move to a new row. + The height of the new row will be the height of the current + object that does not fit (plus some padding), `obj`, since (due to the sorting + in step 2) `obj` is tallest amongst all remaining objects + (so it just makes sense to the make this the height of + the row itself). + Again, **equip `obj` with the (top-left) coordinates** it + would take if it were drawn (in this case, the x-coordinate + would go back to the initial state since we moved to a new row, + and the y-coordinate would increase by the height of the + _previous_ row). 4. Return the mutated list of objects. diff --git a/docs/docs/04-style.md b/docs/docs/04-style.md index 0078b26..58890e0 100644 --- a/docs/docs/04-style.md +++ b/docs/docs/04-style.md @@ -35,12 +35,12 @@ Object. To better illustrate this, here is an example: Crucially, each of the attributes in the `style` object (if user passes in an Object) refer themselves to another object: -- Text-related attributes can contain any attribute specified in the - documentation of the text element for svg graphics, found on - https://developer.mozilla.org/en-US/docs/Web/SVG/Element/text. -- Box-related attributes can contain any styling attributes specified in the - documentation of the rough library, found on https://roughjs.com/ and - https://github.com/rough-stuff/rough/wiki. +- Text-related attributes can contain any attribute specified in the + documentation of the text element for svg graphics, found on + https://developer.mozilla.org/en-US/docs/Web/SVG/Element/text. +- Box-related attributes can contain any styling attributes specified in the + documentation of the rough library, found on https://roughjs.com/ and + https://github.com/rough-stuff/rough/wiki. ## Insights for the Implementation diff --git a/memory-viz/src/tests/__snapshots__/snapshot.html b/memory-viz/src/tests/__snapshots__/snapshot.html index 7d5ed08..286c3f3 100644 --- a/memory-viz/src/tests/__snapshots__/snapshot.html +++ b/memory-viz/src/tests/__snapshots__/snapshot.html @@ -1,4 +1,4 @@ - + diff --git a/webstepper/CHANGELOG.md b/webstepper/CHANGELOG.md index 4d50f21..c9db1ce 100755 --- a/webstepper/CHANGELOG.md +++ b/webstepper/CHANGELOG.md @@ -9,8 +9,8 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### ✨ Enhancements -- Launchd an initial prototype! -- Improved UI to indicate when the end of the program is reached. +- Launchd an initial prototype! +- Improved UI to indicate when the end of the program is reached. ### 🐛 Bug fixes @@ -18,5 +18,5 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### 🔧 Internal changes -- Added a script for installing the Webstepper build to a specified path. -- Updated to use the window object to serve app data. +- Added a script for installing the Webstepper build to a specified path. +- Updated to use the window object to serve app data. diff --git a/webstepper/src/html/index.html b/webstepper/src/html/index.html index 417cd48..3ace9cb 100644 --- a/webstepper/src/html/index.html +++ b/webstepper/src/html/index.html @@ -1,4 +1,4 @@ - +