1
0
mirror of https://github.com/locomotivemtl/locomotive-boilerplate.git synced 2026-01-15 00:55:08 +08:00
Commit Graph

690 Commits

Author SHA1 Message Date
Chauncey McAskill
48bd911804 Refactor template.js
Added:
- Function `resolve()` to process any template tags (in a string) in objects and arrays.

Changed:
- Renamed function `template()` to `resolveValue()`.
- Replaced default export `resolveValue()` with new function `resolve()`.
2022-03-22 16:33:19 -04:00
Chauncey McAskill
d49d3eabb2 Add file comment to notification.js 2022-03-22 16:32:24 -04:00
Chauncey McAskill
28aa6c7de6 Update NPM dependencies
Resolves #105

Updated:
- autoprefixer v10.4.2 → v10.4.4
- browser-sync v2.27.7 → v2.27.9
- esbuild v0.14.21 → v0.14.27
- postcss v8.4.6 → v8.4.12
2022-03-21 17:24:10 -04:00
Chauncey McAskill
38dd28832e Update NPM dependencies
Resolves #102

Updated:
- esbuild v0.14.14 → v0.14.21
- locomotive-scroll v4.1.3 → v4.1.4
- node-notifier v10.0.0 → v10.0.1
- postcss v8.4.5 → v8.4.6
2022-02-15 09:27:37 -05:00
Chauncey McAskill
757c26c772 Fix glob.js file comment 2022-02-15 09:16:03 -05:00
Chauncey McAskill
5e07473396 Make glob optional in concats.js
Added:
- Condition to process includes with glob if it's available.

Changed:
- Utility 'glob.js' to not throw an error if a glob function is unavailable.
2022-02-08 15:18:18 -05:00
Chauncey McAskill
c9056b27d8 Add support for removing duplicates in concats.js
Added:
- Argument `concatOptions` to `concatFiles()` function to customize concatenation.
- Option 'removeDuplicates' to `concatOptions` to remove duplicate paths from the array of globbed paths. Defaults to `true`.

The 'removeDuplicates' is useful for customizing the order of files to concatenate, in which globbing will usually sort paths alphabetically.

This option is convenient when the installed glob library does not support removing duplicates on their own (feature supported in 'fast-glob' and 'glob').

Example:

```
/assets/scripts/vendors/a.js
/assets/scripts/vendors/b.js
/assets/scripts/vendors/c.js
/assets/scripts/vendors/d.js
```

```json
"concats": [
    {
        "includes": [
            "{% paths.scripts.src %}/vendors/c.js",
            "{% paths.scripts.src %}/vendors/*.js"
        ],
        "outfile": "{% paths.scripts.dest %}/vendors.js"
    }
]
```
2022-02-08 14:46:34 -05:00
Chauncey McAskill
38a6c73d2f Add support for customizing glob in concats.js
Added:
- Argument `globOptions` to `concatFiles()` function to customize glob library.
2022-02-08 14:40:00 -05:00
Chauncey McAskill
9d18205b0f Update NPM dependencies
Updated:
- autoprefixer v10.4.0 → v10.4.2
- esbuild v0.13.12 → v0.14.14
- node-sass v6.0.1 → v7.0.1
- postcss v8.3.11 → v8.4.5
2022-01-28 16:00:57 -05:00
Chauncey McAskill
1e7e90c8aa Add support for custom task labels
If ever the basename from the outfile or outdir is an insufficient description.

Example:

```json
"concats": [
    {
        "label": "third-parties",
        "includes": [
            "{% paths.scripts.src %}/vendors/*.js"
        ],
        "outfile": "{% paths.scripts.dest %}/vendors.js"
    }
]
```
2021-12-17 10:39:35 -05:00
Chauncey McAskill
47007cddaf Fix glob.js
Amends 8dec2c69fe

Fixed:
- Forgot to rename all occurrences of 'modules' with 'candidates'.
2021-12-03 15:10:21 -05:00
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