-
Notifications
You must be signed in to change notification settings - Fork 108
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(format): add prettier to project #284
Conversation
dcadcc7
to
cbecc88
Compare
this commit reworks the pre-existing prettier infrastructure in the project in an attempt to add continuous integration (ci) checks for formatting to the project. prettier and ionic's prettier configuration are added as a top level dependencies to the project, such that lerna can format all projects with a 'prettier' script in the future. by using ionic's prettier configuration, we can converge upon previously agreed upon formatting config. ci is updated to run prettier in parallel with other jobs, allowing us to 'fail-fast' in the event of a formatting error. there is potential room in the future to refactor ci jobs/steps by adding this parallelism, but that was not done here in order to limit the scope of this commit. this commit only handles the angular output target. this allows for incremental improvement/proof-of-concept to get the idea out to the teams managing this project for feedback sooner than later
format the contents of the angular output target using the configuration added in the previous commit.
56e50e5
to
9f68774
Compare
"@stencil/core": "^2.9.0", | ||
"@types/jest": "^26.0.9", | ||
"jest": "^26.3.0", | ||
"lerna": "^4.0.0", | ||
"lerna-changelog": "^1.0.1", | ||
"np": "^6.0.2", | ||
"prettier": "^2.0.5", | ||
"prettier": "2.7.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Locking this as Prettier doesn't necessarily follow semver
"rimraf": "^2.6.3", | ||
"rollup": "^2.23.1", | ||
"semver": "^5.5.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This moved as a result of adding new dependencies via npm
's CLI - might as well keep it 🤷
if (componentCorePackage !== undefined) { | ||
const dirPath = includeImportCustomElements ? `/${customElementsDir || 'components'}` : ''; | ||
importLocation = `${normalizePath(componentCorePackage)}${dirPath}`; | ||
export const createComponentDefinition = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes are a little more palatable if you "ignore whitespace" in GH's diff view
@@ -20,6 +20,9 @@ | |||
"watch": "tsc --watch", | |||
"rollup": "rollup -c", | |||
"version": "npm run build", | |||
"prettier": "npm run prettier.base -- --write", | |||
"prettier.base": "prettier \"./({anguler-output-target,src,test}/**/*.{ts,tsx,js,jsx})|*.{ts,tsx,js,jsx}\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops - I need to change this - should be 'angular-component-lib'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
this commit adds formatting infrastructure to the project for the react, svelte and vue output targets. it also formats each of the output targets mentioned above. this commit is a successor to 19d9f38 (#284), which added formatting infrastructure to the angular output target. the examples are intentionally not included in this commit it an effort to limit scope
Pull request checklist
Please check if your PR fulfills the following requirements:
npm run build
) was run locally for affected output targetsnpm test
) were run locally and passedPull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue URL: #285
What is the new behavior?
this commit reworks the pre-existing prettier infrastructure in the
project in an attempt to add continuous integration (ci) checks for
formatting to the project.
prettier and ionic's prettier configuration are added as a top level
dependencies to the project, such that lerna can format all projects
with a 'prettier' script in the future. by using ionic's prettier
configuration, we can converge upon previously agreed upon formatting
config.
ci is updated to run prettier in parallel with other jobs, allowing us
to 'fail-fast' in the event of a formatting error. there is potential
room in the future to refactor ci jobs/steps by adding this parallelism,
but that was not done here in order to limit the scope of this commit.
this commit only handles the angular output target. this allows for
incremental improvement/proof-of-concept to get the idea out to the
teams managing this project for feedback sooner than later
format the contents of the angular output target using the configuration
added in the previous commit.
Does this introduce a breaking change?
Other information
Looking for feedback/thoughts here from folks more familiar with Lerna setups and whatnot.