Skip to content

Conversation

@dijitali
Copy link
Contributor

Fixes

Description

Reintroduces Prettier in a similar manner to the search repo as recommended in #520 (comment)

Technical details

Docker and prettier config lifted directly from search repo. Only modifications are:

  • upgrade from node:bullseye-slim to node:bookworm-slim image
  • update prettierignore paths for vocabulary files in this repo

Tests

Follow the steps added to the README.md and confirm the experience is as expected.

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main or master).
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no
    visible errors.

Developer Certificate of Origin

For the purposes of this DCO, "license" is equivalent to "license or public domain dedication," and "open source license" is equivalent to "open content license or public domain dedication."

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@dijitali dijitali requested review from a team as code owners June 24, 2025 09:13
@dijitali dijitali requested review from TimidRobot, obulat and possumbilities and removed request for a team June 24, 2025 09:13
@netlify
Copy link

netlify bot commented Jun 24, 2025

Deploy Preview for creativecommons-chooser ready!

Name Link
🔨 Latest commit af9ac2d
🔍 Latest deploy log https://app.netlify.com/projects/creativecommons-chooser/deploys/6895e4764fafed0008102e24
😎 Deploy Preview https://deploy-preview-580--creativecommons-chooser.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@possumbilities
Copy link
Contributor

@dijitali Hi and thanks for this.

The introduction of the docker web server here seems out of scope for the original Issue, which is just about implementing prettier only. I think the prettier node setup is all that would be needed to satisfy the requirements here.

Though, its reasonable to create another Issue around Dockerizing the repo into a webserver vs opening a static file as an option, but we'd want to keep each scope of work separate here I believe.

@dijitali
Copy link
Contributor Author

dijitali commented Aug 7, 2025

Ah gotcha. Removed the web server bits now.

Now the project is so simplified with #570, it could just be simpler and more maintainable to leave docker out altogether and just say something like:

format with npx prettier@3 ./src --write

But 🤷, might be good to have a web server to catch CORS issues and the like.

@possumbilities
Copy link
Contributor

@dijitali It's fair. It's an evolving situation. Thanks for reducing it down!

Can you also remove the changes to the /src directory in this PR? I'm going to work on an updated config file for how we're treating HTML formatting especially with prettier; and I'd like to wait to apply prettier until that's documented in an Issue and gotten another PR merged in, rather than doing the reformat in this PR right away.


For example: for input fields breaking attributes into newlines can be useful, but doing it other places can be cumbersome and harder for direct edit HTML. The balance with anything like prettier is that it often seems to lean a bit toward sorting out generated HTML in systems where the input lang is written in something else (like JS or Python, etc.).

In the case of the Chooser we're writing HTML directly and I'd like it to be more friendly do direct editing and I'm not sure that some of the settings we have in the Search Portal are the greatest at that at the moment.

@dijitali
Copy link
Contributor Author

dijitali commented Aug 8, 2025

Sure thing, have reverted dd86dab.

@possumbilities possumbilities merged commit d1362ff into creativecommons:main Aug 8, 2025
4 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in possumbilities Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[Feature] enable Prettier to run automatically

2 participants