Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(repo): add prettier infrastructure #1047

Merged
merged 2 commits into from
Jan 16, 2024
Merged

chore(repo): add prettier infrastructure #1047

merged 2 commits into from
Jan 16, 2024

Conversation

rwaskiewicz
Copy link
Contributor

@rwaskiewicz rwaskiewicz commented Feb 22, 2023

this commit adds prettier infrastructure to the project. prettier was
previously a dependency of the project, but was not being used. similar
to other stencil projects, this commit uses ionic's prettier
configuration for consistent formatting.

three npm scripts have been added for prettier:

  1. prettier.base to serve as a single source of truth for common
    settings, such as directories to format
  2. prettier.dry-run to act as a non-mutating prettier run. used in ci
  3. prettier to format and write changes back to disk

to start, we shall only format configuration scripts (JavaScript +
TypeScript). at the time of this writing, there are:

  • two previous major iterations of the docs (v2, v3)
  • nine minor iterations for stencil v4
  • the next section of the documentation (slated for stencil v4.10.0)
    at this time, i would prefer to minimize churn related to formatting
    these 12 directories (2 + 9 + 1). perhaps shortly after the release of
    stencil v5 (where the v4 documentation is collapsed into one directory)
    will we consider either formatting all major version directories, or
    just the v5 directory.

prettier and the ionic prettier configuration dependencies have been
moved to dev-dependencies, as they are not needed in the production
build of the site.

a ci workflow (main.yml) has been added to kick off a dry-run of
prettier. should any files not be properly formatted, the workflow shall
fail. the intent is to block landing code on this check in github.

the second commit runs the formatter.

@vercel
Copy link

vercel bot commented Feb 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stencil-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 16, 2024 9:12pm

},
"dependencies": {
"@docusaurus/core": "^3.0.1",
"@docusaurus/remark-plugin-npm2yarn": "^3.0.1",
"@ionic/prettier-config": "^4.0.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just moving these to devDependencies here

@rwaskiewicz rwaskiewicz changed the title prettier infra chore(repo): add prettier infrastructure Jan 5, 2024
@rwaskiewicz rwaskiewicz marked this pull request as ready for review January 5, 2024 19:25
@rwaskiewicz rwaskiewicz requested a review from a team as a code owner January 5, 2024 19:25
@rwaskiewicz rwaskiewicz requested review from christian-bromann, alicewriteswrongs and jaredcbaum and removed request for a team January 5, 2024 19:25
Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👌

this commit adds prettier infrastructure to the project. prettier was
previously a dependency of the project, but was not being used. similar
to other stencil projects, this commit uses ionic's prettier
configuration for consistent formatting.

three npm scripts have been added for prettier:
1. `prettier.base` to serve as a single source of truth for common
   settings, such as directories to format
2. `prettier.dry-run` to act as a non-mutating prettier run. used in ci
3. `prettier` to format and write changes back to disk

to start, we shall only format configuration scripts (JavaScript +
TypeScript). at the time of this writing, there are:
- two previous major iterations of the docs (v2, v3)
- nine minor iterations for stencil v4
- the `next` section of the documentation (slated for stencil v4.10.0)
at this time, i would prefer to minimize churn related to formatting
these 12 directories (2 + 9 + 1). perhaps shortly after the release of
stencil v5 (where the v4 documentation is collapsed into one directory)
will we consider either formatting all major version directories, or
just the v5 directory.

prettier and the ionic prettier configuration dependencies have been
moved to `dev-dependencies`, as they are not needed in the production
build of the site.

a ci workflow (`main.yml`) has been added to kick off a dry-run of
prettier. should any files not be properly formatted, the workflow shall
fail. the intent is to block landing code on this check in github.
@rwaskiewicz rwaskiewicz merged commit 648648d into main Jan 16, 2024
4 checks passed
@rwaskiewicz rwaskiewicz deleted the prettier branch January 16, 2024 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants