Skip to content

Commit

Permalink
Added more utilities and prepare for release beta.12
Browse files Browse the repository at this point in the history
  • Loading branch information
thewebartisan7 committed Oct 31, 2022
1 parent 2035928 commit 8f04b92
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 4 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.0-beta.12 (2022-10-31)

* Added more utilities

## 1.0.0-beta.11 (2022-10-30)

* Add new options to pass utilities methods to script like lodash `mergeWith` and `template`
Expand Down
4 changes: 4 additions & 0 deletions docs-src/md/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.0-beta.12 (2022-10-31)

* Added more utilities
*
## 1.0.0-beta.11 (2022-10-30)

* Add new options to pass utilities methods to script like lodash `mergeWith` and `template`
Expand Down
2 changes: 1 addition & 1 deletion docs-src/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1 class="display-1 fw-bold mb-4">Build the web with PostHTML</h1>
</div>

<p class="text-muted">
Currently <strong>v1.0.0-beta.11</strong>
Currently <strong>v1.0.0-beta.12</strong>
<span class="px-1">·</span>
<a href="#" class="link-secondary" data-bs-toggle="modal" data-bs-target="#modalWithComponents">Changelog</a>
</p>
Expand Down
8 changes: 8 additions & 0 deletions docs/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ <h5 class="modal-title" id="modalWithComponentsLabel">Changelog</h5>
</div>
<!-- /.modal-header -->
<div class="modal-body">
<h2 id="1.0.0-beta.12-(2022-10-31)" tabindex="-1">
<a class="header-anchor" href="#1.0.0-beta.12-(2022-10-31)">#</a>
1.0.0-beta.12 (2022-10-31)
</h2>
<ul>
<li>Added more utilities</li>
<li></li>
</ul>
<h2 id="1.0.0-beta.11-(2022-10-30)" tabindex="-1">
<a class="header-anchor" href="#1.0.0-beta.11-(2022-10-30)">#</a>
1.0.0-beta.11 (2022-10-30)
Expand Down
8 changes: 8 additions & 0 deletions docs/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,14 @@ <h5 class="modal-title" id="modalWithComponentsLabel">Changelog</h5>
</div>
<!-- /.modal-header -->
<div class="modal-body">
<h2 id="1.0.0-beta.12-(2022-10-31)" tabindex="-1">
<a class="header-anchor" href="#1.0.0-beta.12-(2022-10-31)">#</a>
1.0.0-beta.12 (2022-10-31)
</h2>
<ul>
<li>Added more utilities</li>
<li></li>
</ul>
<h2 id="1.0.0-beta.11-(2022-10-30)" tabindex="-1">
<a class="header-anchor" href="#1.0.0-beta.11-(2022-10-30)">#</a>
1.0.0-beta.11 (2022-10-30)
Expand Down
10 changes: 9 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ <h1 class="display-1 fw-bold mb-4">Build the web with PostHTML</h1>
</div>
<p class="text-muted">
Currently
<strong>v1.0.0-beta.11</strong>
<strong>v1.0.0-beta.12</strong>
<span class="px-1">·</span>
<a href="#" class="link-secondary" data-bs-toggle="modal" data-bs-target="#modalWithComponents">Changelog</a>
</p>
Expand Down Expand Up @@ -93,6 +93,14 @@ <h5 class="modal-title" id="modalWithComponentsLabel">Changelog</h5>
</div>
<!-- /.modal-header -->
<div class="modal-body">
<h2 id="1.0.0-beta.12-(2022-10-31)" tabindex="-1">
<a class="header-anchor" href="#1.0.0-beta.12-(2022-10-31)">#</a>
1.0.0-beta.12 (2022-10-31)
</h2>
<ul>
<li>Added more utilities</li>
<li></li>
</ul>
<h2 id="1.0.0-beta.11-(2022-10-30)" tabindex="-1">
<a class="header-anchor" href="#1.0.0-beta.11-(2022-10-30)">#</a>
1.0.0-beta.11 (2022-10-30)
Expand Down
8 changes: 8 additions & 0 deletions docs/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@ <h5 class="modal-title" id="modalWithComponentsLabel">Changelog</h5>
</div>
<!-- /.modal-header -->
<div class="modal-body">
<h2 id="1.0.0-beta.12-(2022-10-31)" tabindex="-1">
<a class="header-anchor" href="#1.0.0-beta.12-(2022-10-31)">#</a>
1.0.0-beta.12 (2022-10-31)
</h2>
<ul>
<li>Added more utilities</li>
<li></li>
</ul>
<h2 id="1.0.0-beta.11-(2022-10-30)" tabindex="-1">
<a class="header-anchor" href="#1.0.0-beta.11-(2022-10-30)">#</a>
1.0.0-beta.11 (2022-10-30)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "posthtml-component",
"version": "1.0.0-beta.11",
"version": "1.0.0-beta.12",
"description": "PostHTML Components Blade-like with slots, attributes as props and custom tag",
"license": "MIT",
"repository": "thewebartisan7/posthtml-components",
Expand Down
27 changes: 26 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,19 @@ const processProps = require('./process-props');
const processAttributes = require('./process-attributes');
const {processPushes, processStacks} = require('./process-stacks');
const {setFilledSlots, processSlotContent, processFillContent} = require('./process-slots');
const defaults = require('lodash/defaults');
const assignWith = require('lodash/assignWith');
const mergeWith = require('lodash/mergeWith');
const template = require('lodash/template');
const get = require('lodash/get');
const has = require('lodash/has');
const isObjectLike = require('lodash/isObjectLike');
const isArray = require('lodash/isArray');
const isEmpty = require('lodash/isEmpty');
const isBoolean = require('lodash/isBoolean');
const isUndefined = require('lodash/isUndefined'); // value === undefined
const isNull = require('lodash/isNull'); // value === null
const isNil = require('lodash/isNil'); // value == null

// const {inspect} = require('util');
// const debug = true;
Expand Down Expand Up @@ -45,7 +56,21 @@ module.exports = (options = {}) => tree => {
options.plugins = options.plugins || [];
options.attrsParserRules = options.attrsParserRules || {};
options.strict = typeof options.strict === 'undefined' ? true : options.strict;
options.utilities = options.utilities || {merge: mergeWith, template};
options.utilities = options.utilities || {
defaults,
assign: assignWith,
merge: mergeWith,
template,
get,
has,
isObject: isObjectLike,
isArray,
isEmpty,
isBoolean,
isUndefined,
isNull,
isNil
};

// Merge customizer callback passed to lodash mergeWith
// for merge attribute `props` and all attributes starting with `merge:`
Expand Down

0 comments on commit 8f04b92

Please sign in to comment.