-
Notifications
You must be signed in to change notification settings - Fork 23
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
build(improvements) #602
Merged
Merged
build(improvements) #602
Conversation
This file contains 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
…in development By default the nunjucks environment loads components from the ./package directory. This means changes to a component won't be loaded in development. This PR updates the nunjucks environment to load from the ./src directoy when the ENV var is det to dev
When aliasing git commit to git cz alongside the pre-commit-hook would cause the interactive prompt to run twice. This Pr updates the pre-commit-hook to only run if a commit message has not already been provided
… src directory Documentation examples by default load components from the built /package directory. This PR adds the ability to pass an ENV='dev' flag to the eleventy command to enable loading of components direct from the /src directory. This also adds a gulp watcher to rebuild the package css and js files during development. This needs further work! We have three file watchers running in parallel to build/rebuild the docs site in development. (11ty, webpack, and gulp) It would be good if we could use just one!
We were using 3 build tools in combination: 11ty, webpack, and gulp. This was overly complex, a bit unnecessary, and was slow. Webpack was only really being used to copy files - which can very easily eb done by gulp. This PR removes the webpack dependency and pipeline in favour of gulp. the pipeline is now setup such that any changes in dev for a component will trigger a rebuild of the assets and the 11ty docs making working on a component much faster as changes to both nunjucks templates and js/scss files trigger a reload in the browser.
chrispymm
force-pushed
the
update-build-pipeline
branch
from
July 4, 2024 14:29
7be620b
to
50998c6
Compare
chrispymm
force-pushed
the
update-build-pipeline
branch
from
July 4, 2024 14:47
3b96d0a
to
1e4c6ec
Compare
gregtyler
reviewed
Jul 5, 2024
chrispymm
force-pushed
the
update-build-pipeline
branch
from
July 5, 2024 14:11
e379edf
to
50bcc69
Compare
gregtyler
approved these changes
Jul 5, 2024
chrispymm
force-pushed
the
update-build-pipeline
branch
from
July 5, 2024 16:00
50bcc69
to
2dd36cf
Compare
🎉 This PR is included in version 2.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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 PR updates the build pipeline to improve a few things:
Husky
The change to the husky config prevents double-prompting which occurs when
git commit
is aliased togit cz
.Drop Webpack
Previously there were 3 build tools 11ty, gulp, and webpack. With gulp handling the build & dist bundle of the package, 11ty handling the docs templates and webpack handling the docs site assets.
Webpack was mostly being used solely for copying files - which seems slightly overkill. Also using 3 tools was slow, and due to the parallel nature of the task would often result in multiple reloads. So this PR moves the tasks done by webpack to 11ty and gulp.
Dev reloading
Previously, changes to the
src/component
files would not be watched and picked up in the dev site, making local dev a bit slow.This PR adds the ability to pass an
ENV='dev'
environment variable to 11ty, which modifies the nunjucks environment to look in thesrc/
directory for nunjucks templates. Allowing for 11ty to rebuild when a change is made to them.The changes in this PR mean that now 11ty is responsible for watching and building the docs site assets, and gulp now has the
build:docs
task to copy the assets required for the site, and thewatch:package
task to watch for changes in the componentscss
andjs
files.In order to achieve this, the
assets
directory has been moved within thedocs
directory, to place it within 11ty's watch scope.Gulp does not copy across the
all.js
file fromsrc
, 11ty is configured to watch theall.js
file. When gulp builds the package files, generatingall.js
this triggers an 11ty rebuild.This means that now, any change to any
.njk
,.md
,.js
or.scss
file will trigger a fast rebuild and reload of the site in dev.