Commit Graph

479 Commits

Author SHA1 Message Date
Chauncey McAskill
5dd3fa843f Add support for watching multiple view paths
Added routine to convert `paths.views` into an array.

Supports a single path as a string, a map of paths, or a list of paths:

```json
"views": "./views/boilerplate/template"
```

```json
"views": {
    "src": "./views/boilerplate/template"
}
```

```json
"views": [
    "./views/boilerplate/template"
]
```
2021-12-03 11:55:35 -05:00
Chauncey McAskill
a5623d3122 Improve comments in watch.js 2021-12-03 11:52:27 -05:00
Chauncey McAskill
67e1fae8f4 Update block comment in styles.js 2021-11-03 17:08:38 -04:00
Chauncey McAskill
a95fe4523c Update postcss.js
Remove extraneous `null` assignment on optional exports.
2021-11-03 16:50:08 -04:00
Chauncey McAskill
eadc414329 Fix merging of default options for PostCSS
Amends 9e3d304654
2021-11-03 16:16:08 -04:00
Chauncey McAskill
b19c18b18c Update NPM dependencies
Updated:
- autoprefixer v10.3.7 → v10.4.0
- browser-sync v2.26.13 → v2.27.7
- esbuild v0.13.4 → v0.13.12
- postcss v8.3.9 → v8.3.11
2021-11-03 13:21:11 -04:00
Chauncey McAskill
db85740a18 Merge pull request #96 from locomotivemtl/mcaskill-refactor-build-options 2021-11-03 13:16:43 -04:00
Chauncey McAskill
5c24fabaa2 Compile assets 2021-11-03 10:50:33 -04:00
Chauncey McAskill
9e3d304654 Add support for task options
Added support for customizing processors in `scripts.js` (esbuild), `styles.js` (node-sass, postcss, autoprefixer), and `svgs.js` (svg-mixer), via arguments for the exported task functions.

Added:
- Constants to decouple shared default options, options for development, and options for production.
- Constants to export default options for development and production as an array of arguments to pass to task functions.

Changed:
- watch.js to apply development args to tasks
2021-11-03 10:49:35 -04:00
Chauncey McAskill
6ded72bc79 Refactor postcss.js
Moved creation of Processor from utility file to styles.js to allow for future customization of `postcss` and `autoprefixer`.
2021-11-03 10:49:35 -04:00
Chauncey McAskill
2a97183d39 Revert NPM lock file version 2
Amends 2316219201
2021-10-29 11:26:12 -04:00
Deven Caron
2316219201 Update Locomotive Scroll package 2021-10-27 10:34:37 -04:00
Deven Caron
d99a69f212 Fix undefined target on LS instance lazyLoad args 2021-10-27 10:33:44 -04:00
Deven Caron
8bc79f715e Merge pull request #97 from locomotivemtl/devenini-add-lazy-loading-utils
Add lazy loading utils & implement in Scroll.js
2021-10-20 14:46:51 -04:00
Deven Caron
62601f22ed Build assets 2021-10-19 14:49:56 -04:00
Deven Caron
082f3b5827 Replace queryClosestParent with Element.prototype.closest 2021-10-19 14:46:38 -04:00
Deven Caron
df567220d5 Syntax changes & coding style 2021-10-19 14:45:24 -04:00
Deven Caron
7d35dcbf28 Precise usage & better comments 2021-10-19 14:41:43 -04:00
Deven Caron
8b40b1a92e build assets 2021-10-18 16:45:40 -04:00
Deven Caron
f2b657568a Add image lazyloading utils 2021-10-18 16:45:31 -04:00
Deven Caron
a28848e8aa Remove toggleLazy call
Adapt lazy-load markup
Add svg viewbox ratio example
2021-10-18 16:44:41 -04:00
Deven Caron
b881003705 Fix stylesheet wrong id 2021-10-18 16:42:36 -04:00
Chauncey McAskill
b55e625457 Improve notification.js
Added:
- Support for passing a callback to node-notifier.
- Shorter timeout on notifications (~12 s → ~5 s).
2021-10-12 16:12:29 -04:00
Chauncey McAskill
25ef6675af Fix syntax of styles.js
Amends 7df0481d05
2021-10-12 16:04:29 -04:00
Chauncey McAskill
7df0481d05 Change writeFile promises in styles.js
Await results of `writeFile()` calls for easier readability of operations.
2021-10-12 12:52:36 -04:00
Chauncey McAskill
e53efd6ebc Update NPM dependencies
Updated:
- autoprefixer v10.3.6 → v10.3.7
- esbuild v0.13.3 → v0.13.4
- postcss v8.3.8 → v8.3.9

Added:
- npm v6.0
2021-10-12 12:52:35 -04:00
Chauncey McAskill
14ec69f26d Update NPM dependencies
Updated:
- autoprefixer v10.3.5 → v10.3.6
- esbuild v0.13.0 → v0.13.3
- postcss v8.3.7 → v8.3.8
2021-10-01 14:12:37 -04:00
Chauncey McAskill
fa8aa98595 Add missing constraints to NPM dependencies
Updated:
- locomotive-scroll v4.1.2
- normalize.css v8.0.1
- svg4everybody v2.1.9
2021-10-01 14:04:27 -04:00
Chauncey McAskill
b24b4e10c4 Update NPM manifest 2021-10-01 14:03:41 -04:00
Chauncey McAskill
21f6acf4a6 Update NPM dependencies
Updated:
- autoprefixer v10.3.4 → v10.3.5
- esbuild v0.12.28 → v0.13.0
- postcss v8.3.6 → v8.3.7
2021-09-22 13:26:28 -04:00
Chauncey McAskill
bbbb49f30b Merge pull request #95 from locomotivemtl/mcaskill-refactor-build
Refactor build tasks and config file
2021-09-21 17:58:47 -04:00
Chauncey McAskill
99e1b3fa93 Change tasks to be the default exports 2021-09-21 17:53:46 -04:00
Chauncey McAskill
548b2c604b Fix messages in styles.js
Fixed:
- Expected file extension from `outfile` for variable `name`.
- Expected structure of `err` in main catch (`err.formatted` is only available when thrown by node-sass).
- Context of error messages when writing final CSS and source map to disk.
2021-09-21 17:53:46 -04:00
Chauncey McAskill
ec9228a337 Refactor glob.js
Added function `importGlob()` to enclose operations and improve error handling.
2021-09-21 17:52:32 -04:00
Chauncey McAskill
8dec2c69fe Improve syntax of glob.js
Changed:
- Renamed variables for clarity.

Fixed:
- Block comment for `createArrayableGlob()`.
2021-09-21 17:52:17 -04:00
Chauncey McAskill
3a65683fd8 Compile assets 2021-09-21 17:52:17 -04:00
Chauncey McAskill
1a2cc7b6ac Fix bad paths in watch.js
Amends d4ded2a64e

Fixed:
- Invalid paths to watch.

Changed:
- Replaced risky string concatenation with Node.js' `path.join()` function.
2021-09-20 17:29:41 -04:00
Chauncey McAskill
e7935211cd Replace non-breaking space in JS imports 2021-09-20 10:54:56 -04:00
Chauncey McAskill
7e8a21f698 Update README and Boilerplate occurrences
Changed "Configuration" section to instruct developers on what occurrences to rename throughout the package.
2021-09-18 01:16:44 -04:00
Chauncey McAskill
7e30939b14 Update Node constraint in README
Amends 1203e54277
2021-09-18 01:16:44 -04:00
Chauncey McAskill
655031cd1b Clean-up README 2021-09-18 01:16:44 -04:00
Chauncey McAskill
d4ded2a64e Refactor build tasks and config file
Changed:
- Renamed 'mconfig.json' to 'loconfig.json'.
- Renamed 'concat.js' to 'concats.js' to represent flexible functionality.
- loconfig.json: Base paths are nested under "paths".
- loconfig.json: Paths for tasks are nested under "tasks".
- Refactored each task to process corresponding entries under "tasks" in 'loconfig.json'.
- watch.js: Changed concats watch to use task's includes.

Added:
- tiny-glob v0.2.9
- Utility 'glob.js' to use dynamic imports to fetch an available glob function from node modules.
- Utility 'template.js' to provide a function to render template tags (`{% ... %}`) in tasks.
- concats.js: Support for concatenating groupes of files.
- scripts.js: Support for ESBuild's "outdir" option.
2021-09-18 01:16:44 -04:00
Chauncey McAskill
589ec99135 Move tasks to a dedicated directory
Moved concat.js, scripts.js, styles.js, svgs.js to 'build/tasks/' directory.
2021-09-18 01:16:44 -04:00
Chauncey McAskill
84286fef66 Improve notification.js
Added:
- Block comment
- Support for additional node-notifier properties.
2021-09-18 01:16:44 -04:00
Chauncey McAskill
6e50bc202d Refactor styles.js
Changed:
- Replaced "fs" callback API with "fs/promises" promise API to centralize catching of errors and easier readability of file.
- Prefixed "fs/promises" with 'node:' URI scheme to target Node.js builtin modules.
- Promisified `sass.render`.
2021-09-18 01:16:44 -04:00
Chauncey McAskill
91109c5221 Refactor concat.js
Changed:
- Replaced "fs" callback API with "fs/promises" promise API to centralize catching of errors and easier readability of file.
- Prefixed "fs/promises" with 'node:' URI scheme to target Node.js builtin modules.
2021-09-18 01:16:44 -04:00
Chauncey McAskill
834c6165b0 Refactor postcss.js
Decoupled import routine from final export to provide a shared instance of the PostCSS processor and for easier readability of file.
2021-09-18 01:16:44 -04:00
Chauncey McAskill
ffece71aac Improve message.js
Added:
- Types "notice" and "warning".
- Support for all but the "waiting" message type to stop a timer.

Changed:
- Improved colors of message types.
- Improved handling of PostCSS errors in styles.js.
2021-09-18 01:16:44 -04:00
Chauncey McAskill
454ae64d07 Make postcss optional in styles.js
Added:
- Utility 'postcss.js' to use dynamic imports to fetch PostCSS and Autoprefixer, if available, and build the Processor object.
- Function `saveStylesheet()` in 'styles.js' to decouple the writing of CSS files and source maps.
- Condition to process with PostCSS if it's available.
2021-09-18 01:16:44 -04:00
Chauncey McAskill
7479444572 Change tasks to async functions 2021-09-18 01:16:44 -04:00