Conflict investigation - #230
Closed
matt-bernhardt wants to merge 44 commits into
Closed
matt-bernhardt wants to merge 44 commits into
matt-bernhardt wants to merge 44 commits into
Conversation
This sets up a root-level package.json that will manage all the plugins' internal dependencies via workspaces. It allows us to only have one package-lock.json file, rather than one per plugin, which makes keeping dependencies in sync across plugins easier to achieve. It also saves a bit of space in the respository, as these files can be tens of thousands of lines long and largely duplicative.
** Why are these changes being introduced: We already have a plugin that implements the hours ecosystem, so it makes sense to define the new hours block for the homepage within that plugin, rather than in a separate plugin. ** How does this address that need: This moves the content of the hours block into the existing hours plugin. As part of this move, a few things get adjusted: * Package.json at the repostitory root gets the new plugin path added to its list of workspaces * Because the hours plugin already uses the src/ folder to define PHP classes, it doesn't make sense to re-use that location for the block source files. We instead take a page from WordPress itself, and place those materials in the blocks/ folder. * Because the path to the block materials changes, we need to update the package.json file in the plugin to pass the --source-path argument to the build and start scripts. * The PHP script at the plugin root needs to merge with the existing plugin. The only unique part from the new plugin is the block block registration function (which is hooked to the init action) - so we use that and leave the rest of the boilerplate behind. * The readme.txt file from the old plugin is no longer needed, as this is a file we don't really use in this monorepo. * We also re-run the build command to make sure that everything is wired up correctly. This updates the hash and index.js file. * All of this means we bump the plugin version number. ** Document any side effects to this change: Hopefully none...
(Squashed to remove build artifacts for on block)
Moving to a single blocks plugin
This moves the source materials for the hours block into the new mitlib-blocks plugin - block.json - edit.js - editor.scss - index.js - save.js - style.scss It doesn't touch the built materials, that will happen in a future commit
Now that the hours block has been relocated into the new plugin, and the naming convention for folders in that plugin have been udpated, there are a few cleanup tasks that are necessary for everything to function: - package.json at the root level now only lists a single workspace, as the hours plugin no longer has one - package.json within mitlib-blocks needs to be told where to find the block materials - The hours plugin itself no longer needs a register_blocks function, nor does it need package.json or .gitignore - The text-domain value for the hours block needs to be updated to use its new home - The mitlib-blocks gitignore needs to ignore .map files There is an additional side effect in this commit, which is not strictly related but seems like a good idea at this point: - The PHPCS configuration now ignores materials in a build/ folder, as these are not meant to be run through any sort of static code analysis. Squash me
This also removes the deprecated build materials from the hours plugin
Move Hours block into new block plugin
Let editor select a featured librarian from the block editor
Most of these blocks don't use this boilerplate file, which only had a console.log statement. In those cases, we remove the file entirely, as well as the entry in block.json which called for it to be loaded.
These blocks aren't part of a javascript application stack, so there is no need to declare an entry point into their materials.
The boilerplace declares wordpress dependencies to _always_ use the latest version, which causes problems in our CI workflow because a new release may have become available between when the developer started a branch and when the CI runs to evaluate it. Keeping branches short-lived is only a partial solution. The more robust option is to declare our dependencies using a predictable version. This provides for consistency between environments (among developers, and with our CI workflows). The cost of this is that we need to manage dependency updates ourselves, but this is already something we are doing.
The javascript community has a set of formatting rules which they've adopted, and their tooling will automatically apply that formatting. This commit applies the changes necessary for `npm run lint:js` to return no output. (We can tweak the rules that it applies as we go forward - some of these seem pretty silly to me - but having those discussions will take time to reflect and reach consensus, and we want to get this branch done quickly for the moment.
This is part of the NPM linter, but there were so many of these changes that it seemed better to split them out into their own commit.
Use of ' instead of ' causes complaints by the linter...
The boilerplate included an import of useBlockProps - but then did not actually make use of it. Our choice is to either finish the implementation, or to stop importing it in the first place. I initially tried to actually implement this library for the blocks that are not rendered via render.php, but this resulted in editor-facing styles leaking out to the public UI. Instead, I've opted to remove the import entirely. It does not appear to impact how our defined options are updated via the editor interface, so I don't think this is something we need at this time.
The featured collection never passes any output through a translation function, so we do not need to import it in the first place.
This is the same fixup step for the PHP files as we previously took for the JS files. Run the linter, note what it complains about, and then fix those lines until the linter reports no output.
This keeps everything in sync with the latest releases of our tooling
There was a problem hiding this comment.
Found 1 issue across 1 rule.
Reviewed by AccessLint, which checks every pull request for accessibility issues.
| ?> | ||
|
|
||
| </div> | ||
| <span class="hero-image-credit">from the <a href="https://archivesspace.mit.edu/repositories/2/resources/603">Harold E. Edgerton papers</a></span> |
There was a problem hiding this comment.
WCAG 4.1.2: Focusable element inside a "img" role whose children are presentational.
Elements with a role that makes children presentational must not contain focusable content.
Details
Roles like button, checkbox, img, tab, and others make their children presentational — hidden from assistive technologies. If those children are focusable, keyboard users can reach elements that screen reader users cannot perceive. Move focusable content outside the parent or remove the focusability.
Member
Author
|
This has been superseded by other cleanup work. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is meant for an investigation into a merge conflict.