Compare commits

...
705 Commits
Author SHA1 Message Date
semantic-release-bot 529e6d769b chore(release): 9.28.0 [skip ci]
# [9.28.0](https://github.com/harttle/liquidjs/compare/v9.27.1...v9.28.0) (2021-10-06)

### Bug Fixes

* skip root check for renderFile() ([822ba0b](https://github.com/harttle/liquidjs/commit/822ba0be0f1cfbedd50376aff8ac49eee71bd48c))
* support timezoneOffset for date from scope, [#401](https://github.com/harttle/liquidjs/issues/401) ([fd5ef47](https://github.com/harttle/liquidjs/commit/fd5ef474c36212e6a2446012dcd26bca93f84c7b))

### Features

* `relativeReference` for render/include/layout, [#395](https://github.com/harttle/liquidjs/issues/395) ([a3455eb](https://github.com/harttle/liquidjs/commit/a3455ebd0b207141c34630c0af44d917db2ca1dd))
* implement `forloop.name` as found in ruby shopify/liquid ([6dc7fad](https://github.com/harttle/liquidjs/commit/6dc7fada72467418806c1ee4bd7eaf3003690fe6))
2021-10-06 10:45:13 +00:00
Harttle 822ba0be0f fix: skip root check for renderFile() 2021-10-06 18:38:58 +08:00
Harttle a3455ebd0b feat: relativeReference for render/include/layout, #395
- `relativeReference` is enabled by default, set to `false` to disable
- Referenced files are still constrained within root/partias/layouts
- fix: relative filenames are not constrained (which allows arbitrary filesystem read)

Example Usage:

{% render "../foo/bar.html" %}

Note:

../foo/bar.html' should also be within `partials` (or `root` if `partials` not set)
2021-10-06 17:36:37 +08:00
Harttle 24a19c092a docs: add doc entry for concat filter #397 2021-10-06 16:10:09 +08:00
Harttle fd5ef474c3 fix: support timezoneOffset for date from scope, #401 2021-10-06 15:45:41 +08:00
Harttleandharttle 4f6b88c154 docs: add @bglw as contributor 2021-10-04 21:37:37 +08:00
Liam BigelowandJun Yang 6dc7fada72 feat: implement forloop.name as found in ruby shopify/liquid 2021-10-04 21:33:46 +08:00
semantic-release-bot 3b9c7d6fbe chore(release): 9.27.1 [skip ci]
## [9.27.1](https://github.com/harttle/liquidjs/compare/v9.27.0...v9.27.1) (2021-10-04)

### Bug Fixes

* directory info in lookupError message, [#395](https://github.com/harttle/liquidjs/issues/395) ([92bfc65](https://github.com/harttle/liquidjs/commit/92bfc65e0b1d937c00a8368b272223c702132d23))
2021-10-04 04:16:07 +00:00
Harttle 92bfc65e0b fix: directory info in lookupError message, #395 2021-10-04 12:11:54 +08:00
semantic-release-bot 8348036d45 chore(release): 9.27.0 [skip ci]
# [9.27.0](https://github.com/harttle/liquidjs/compare/v9.26.0...v9.27.0) (2021-10-03)

### Bug Fixes

* remove "stream" dependency in browser bundles, [#396](https://github.com/harttle/liquidjs/issues/396) ([3b5eb66](https://github.com/harttle/liquidjs/commit/3b5eb6664f673c29d74cb7645e01dcbdf43c8343))
* renderToNodeStream() now emit 'error' event instead of throw ([afeef1d](https://github.com/harttle/liquidjs/commit/afeef1d7450b2799b3441b0241d2466b892a27ff))

### Features

* add `layouts`, `partials` apart from `root`, [#395](https://github.com/harttle/liquidjs/issues/395) ([b9ae479](https://github.com/harttle/liquidjs/commit/b9ae479b653a34fadb98c324c4683dd1fdd31af1))
* renderFileToNodeStream(filepath, scope) ([68c4cfc](https://github.com/harttle/liquidjs/commit/68c4cfcfb647c22225dd6edede53ad7a5d7c4485))

### Performance Improvements

* make the most of streamed rendering ([aea3441](https://github.com/harttle/liquidjs/commit/aea34418de24cb85ea1acddf68c3683ce7fc9fa8))
2021-10-03 14:41:57 +00:00
harttle afeef1d745 fix: renderToNodeStream() now emit 'error' event instead of throw 2021-10-03 22:32:00 +08:00
harttle 3b5eb6664f fix: remove "stream" dependency in browser bundles, #396 2021-10-03 21:21:35 +08:00
harttle 68c4cfcfb6 feat: renderFileToNodeStream(filepath, scope) 2021-10-03 21:21:25 +08:00
harttle dd325362f9 chore: perf check, will fail if regression > 3% 2021-10-03 19:07:51 +08:00
harttle b9ae479b65 feat: add layouts, partials apart from root, #395 2021-10-03 18:51:14 +08:00
harttle 0cb520d2d1 chore: perf diff against latest release 2021-10-02 22:17:03 +08:00
Harttle 1689576913 docs: add @n1ru4l and @mattvague to contributors for doc 2021-10-01 19:21:03 +08:00
Harttleandharttle aea34418de perf: make the most of streamed rendering 2021-10-01 18:36:57 +08:00
Harttleandharttle 4358c9630f test: coverage to 100% 2021-10-01 15:55:31 +08:00
Harttleandharttle 9a96b4aba3 docs: update badges 2021-10-01 12:39:02 +08:00
Harttleandharttle 70fdb7af48 chore: try fix ci 2021-10-01 00:52:51 +08:00
semantic-release-bot 5099597634 chore(release): 9.26.0 [skip ci]
# [9.26.0](https://github.com/harttle/liquidjs/compare/v9.25.1...v9.26.0) (2021-09-30)

### Features

* orderedFilterParameters, closes [#312](https://github.com/harttle/liquidjs/issues/312) ([10e8c8f](https://github.com/harttle/liquidjs/commit/10e8c8ff7e1cca6df43087953cd8daf4bd618563))
* stream rendering, closed [#361](https://github.com/harttle/liquidjs/issues/361) fixes [#360](https://github.com/harttle/liquidjs/issues/360) ([9012133](https://github.com/harttle/liquidjs/commit/9012133e0717b1813c6a74a6a282f43ba14d0ada))
* timezoneOffset option to specify output timezone, see [#375](https://github.com/harttle/liquidjs/issues/375) ([6b9f872](https://github.com/harttle/liquidjs/commit/6b9f872bccb4b0c636dc7be2088cafa9bc6c900a))

### Performance Improvements

* improve performance by 4x by simplified parseFile ([24f5346](https://github.com/harttle/liquidjs/commit/24f534608489fccc155f30bbaf37397c46278da6))
* parse filenames in parse() insteadof render() ([8273c17](https://github.com/harttle/liquidjs/commit/8273c17dab3dc09858330ce45e3617a650e7fcaa))
2021-09-30 15:57:39 +00:00
Harttleandharttle d742de79ba docs: update docs for website 2021-09-30 23:52:26 +08:00
Harttleandharttle f0e2e07f0b docs: add @c412216887 and @labnol for docs, see #393 #394 2021-09-30 22:33:52 +08:00
一饮一啄皆是人生andJun Yang 4e5dbe120d Update upcase.md
upcase中文描述中,应该是 对已经是大写的字符没有影响
2021-09-30 22:18:10 +08:00
Amit AgarwalandJun Yang 6a1db537d2 Typo fixed
Staring -> Starring
2021-09-30 22:17:46 +08:00
dependabot[bot]andJun Yang 9517f82caf chore(deps): bump prismjs from 1.24.0 to 1.25.0 in /docs
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.24.0 to 1.25.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.24.0...v1.25.0)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-09-30 22:16:34 +08:00
HarttleandJun Yang 10e8c8ff7e feat: orderedFilterParameters, closes #312 2021-09-30 22:15:09 +08:00
Steve StedmanandJun Yang fb787e8847 Fix: respect parameter order when using "for ... reversed" (#231)
* fix: spelling

* fix: respect param order for reversed

* docs: add for-reversed order details

* perf: improve performance by 4x by simplified parseFile

BREAKING CHANGES:
- previously deprecated `getTemplate()` and `getTemplateSync()` not no longer supported
- `opts` no longer support dynamic set in `parseFile()`, `renderFile()` arguments

* perf: parse filenames in parse() insteadof render()

* docs: update description of LiquidJS

Co-authored-by: harttle <[email protected]>
2021-09-30 22:15:09 +08:00
HarttleandJun Yang 9012133e07 feat: stream rendering, closed #361 fixes #360 2021-09-30 22:15:09 +08:00
harttle abaf4af465 docs: update description of LiquidJS 2021-09-30 22:15:09 +08:00
harttle 8273c17dab perf: parse filenames in parse() insteadof render() 2021-09-30 22:15:09 +08:00
harttle 24f5346084 perf: improve performance by 4x by simplified parseFile
- previously deprecated `getTemplate()` and `getTemplateSync()` not no longer supported
- `opts` no longer support dynamic set in `parseFile()`, `renderFile()` arguments
2021-09-27 23:04:41 +08:00
Harttleandharttle 6b9f872bcc feat: timezoneOffset option to specify output timezone, see #375 2021-09-27 01:54:31 +08:00
dependabot[bot]andJun Yang 91c721e650 chore(deps): bump path-parse from 1.0.6 to 1.0.7 in /docs
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-09-26 20:44:44 +08:00
dependabot[bot]andJun Yang 500d397a5a chore(deps): bump prismjs from 1.23.0 to 1.24.0 in /docs
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.23.0 to 1.24.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.23.0...v1.24.0)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-26 16:52:01 +08:00
harttle 2e004eddf6 docs: add @ilhamdev0 as contributors 2021-07-26 16:40:03 +08:00
ilhamdev0andJun Yang e3bfe86181 Update layout.md 2021-07-25 23:19:10 +08:00
ilhamdev0andJun Yang 804947ebb9 Update layout.md
Fix typo
2021-07-25 23:19:10 +08:00
Raymond CamdenandJun Yang 4fa5313acc Update options.md
Fix typo
2021-07-24 14:23:26 +08:00
harttle f7313fe563 docs: support data field in playground.html 2021-06-20 21:26:16 +08:00
semantic-release-bot 1c64ff051e chore(release): 9.25.1 [skip ci]
## [9.25.1](https://github.com/harttle/liquidjs/compare/v9.25.0...v9.25.1) (2021-06-20)

### Performance Improvements

* add cross-engines benchmark ([cdceb25](https://github.com/harttle/liquidjs/commit/cdceb25d007b3d30a85e51ac538e12297c73bfcf))
2021-06-20 06:23:36 +00:00
harttle c470d1fe9b chore: migrate from Travis CI to Github Actions 2021-06-20 14:21:34 +08:00
harttle cdceb25d00 perf: add cross-engines benchmark 2021-06-20 13:25:08 +08:00
dependabot[bot]andJun Yang cc9b28307c chore(deps): bump striptags from 3.1.1 to 3.2.0 in /docs
Bumps [striptags](https://github.com/ericnorris/striptags) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/ericnorris/striptags/releases)
- [Commits](https://github.com/ericnorris/striptags/compare/v3.1.1...v3.2.0)

---
updated-dependencies:
- dependency-name: striptags
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-06-19 12:10:02 +08:00
dependabot[bot]andJun Yang f2ddd6e459 chore(deps): bump glob-parent from 5.1.1 to 5.1.2 in /docs
Bumps [glob-parent](https://github.com/gulpjs/glob-parent) from 5.1.1 to 5.1.2.
- [Release notes](https://github.com/gulpjs/glob-parent/releases)
- [Changelog](https://github.com/gulpjs/glob-parent/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gulpjs/glob-parent/compare/v5.1.1...v5.1.2)

---
updated-dependencies:
- dependency-name: glob-parent
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-06-12 16:42:19 +08:00
dependabot[bot]andJun Yang ecc40a6012 chore(deps): bump normalize-url from 4.3.0 to 4.5.1
Bumps [normalize-url](https://github.com/sindresorhus/normalize-url) from 4.3.0 to 4.5.1.
- [Release notes](https://github.com/sindresorhus/normalize-url/releases)
- [Commits](https://github.com/sindresorhus/normalize-url/commits)

---
updated-dependencies:
- dependency-name: normalize-url
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-06-12 16:42:08 +08:00
dependabot[bot]andJun Yang 659cfde8e1 chore(deps): bump ws from 6.2.1 to 6.2.2
Bumps [ws](https://github.com/websockets/ws) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/commits)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-06-08 21:35:56 +08:00
dependabot[bot]andJun Yang 0acfb8de4d chore(deps): bump hosted-git-info from 2.7.1 to 2.8.9
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.7.1 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.7.1...v2.8.9)

Signed-off-by: dependabot[bot] <[email protected]>
2021-05-09 20:04:52 +08:00
dependabot[bot]andJun Yang c4b2bfb29b chore(deps): bump lodash from 4.17.19 to 4.17.21 in /docs
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <[email protected]>
2021-05-07 22:36:25 +08:00
semantic-release-bot 0d41f7467e chore(release): 9.25.0 [skip ci]
# [9.25.0](https://github.com/harttle/liquidjs/compare/v9.24.2...v9.25.0) (2021-05-07)

### Features

* when tag with multiple values ([8f9639f](https://github.com/harttle/liquidjs/commit/8f9639f))
2021-05-07 06:03:44 +00:00
dependabot[bot]andJun Yang 1d35e3fcfb chore(deps): bump handlebars from 4.5.3 to 4.7.7
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.5.3 to 4.7.7.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.5.3...v4.7.7)

Signed-off-by: dependabot[bot] <[email protected]>
2021-05-07 14:00:30 +08:00
dependabot[bot]andJun Yang 04c874b174 chore(deps): bump underscore from 1.9.1 to 1.13.1
Bumps [underscore](https://github.com/jashkenas/underscore) from 1.9.1 to 1.13.1.
- [Release notes](https://github.com/jashkenas/underscore/releases)
- [Commits](https://github.com/jashkenas/underscore/compare/1.9.1...1.13.1)

Signed-off-by: dependabot[bot] <[email protected]>
2021-05-07 14:00:01 +08:00
allcontributors[bot]andJun Yang 29f42847a5 docs: update .all-contributorsrc [skip ci] 2021-05-06 22:53:24 +08:00
allcontributors[bot]andJun Yang 426863a9b4 docs: update README.md [skip ci] 2021-05-06 22:53:24 +08:00
Memmie LengletandJun Yang 8f9639f1d6 feat: when tag with multiple values 2021-05-06 22:52:22 +08:00
semantic-release-bot 3e130e01a7 chore(release): 9.24.2 [skip ci]
## [9.24.2](https://github.com/harttle/liquidjs/compare/v9.24.1...v9.24.2) (2021-05-04)

### Bug Fixes

* operator boundary not correctly recognized, fixes [#342](https://github.com/harttle/liquidjs/issues/342) ([3e3d84a](https://github.com/harttle/liquidjs/commit/3e3d84a))
2021-05-04 10:16:44 +00:00
Jun Yang 3e3d84a5ed fix: operator boundary not correctly recognized, fixes #342 2021-05-04 18:13:02 +08:00
dependabot[bot]andJun Yang 69f1a394b1 chore(deps): bump ssri from 6.0.1 to 6.0.2
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <[email protected]>
2021-05-02 15:28:15 +08:00
semantic-release-bot ae8636d95d chore(release): 9.24.1 [skip ci]
## [9.24.1](https://github.com/harttle/liquidjs/compare/v9.24.0...v9.24.1) (2021-05-01)

### Bug Fixes

* make LiquidError context property public ([1fd76ac](https://github.com/harttle/liquidjs/commit/1fd76ac))
2021-05-01 12:03:18 +00:00
Laurin QuastandJun Yang 1fd76acf28 fix: make LiquidError context property public 2021-05-01 20:00:02 +08:00
semantic-release-bot 62f8f707e9 chore(release): 9.24.0 [skip ci]
# [9.24.0](https://github.com/harttle/liquidjs/compare/v9.23.4...v9.24.0) (2021-05-01)

### Features

* add context as a property on the LiquidError error ([9c7cb57](https://github.com/harttle/liquidjs/commit/9c7cb57))
* export errors for better error handling in user-land ([4e394b9](https://github.com/harttle/liquidjs/commit/4e394b9))
2021-05-01 11:11:01 +00:00
Laurin QuastandJun Yang 9c7cb5752b feat: add context as a property on the LiquidError error 2021-05-01 19:07:40 +08:00
Laurin QuastandJun Yang 4e394b9072 feat: export errors for better error handling in user-land 2021-05-01 19:06:33 +08:00
Jun Yang 251a50801c chore: dev via windows+vscode 2021-04-17 11:43:03 +08:00
semantic-release-bot aa5d63fdf7 chore(release): 9.23.4 [skip ci]
## [9.23.4](https://github.com/harttle/liquidjs/compare/v9.23.3...v9.23.4) (2021-04-17)

### Bug Fixes

* capitalize filter not lower case trailing string, fixes [#326](https://github.com/harttle/liquidjs/issues/326) ([6548765](https://github.com/harttle/liquidjs/commit/6548765))
2021-04-17 02:41:31 +00:00
Jun Yang 65487654c4 fix: capitalize filter not lower case trailing string, fixes #326 2021-04-17 10:30:57 +08:00
allcontributors[bot]andJun Yang 8bab7957da docs: update .all-contributorsrc [skip ci] 2021-04-17 10:21:19 +08:00
allcontributors[bot]andJun Yang 666df5a8e6 docs: update README.md [skip ci] 2021-04-17 10:21:19 +08:00
congandJun Yang a4aa9ba0d6 FIX: remove unnecessary code 2021-04-17 10:19:22 +08:00
congandJun Yang f5f54c82bf modified title using passed in variable 2021-04-17 10:19:22 +08:00
congandJun Yang 28f154554b added tsconfig.json 2021-04-17 10:19:22 +08:00
congandJun Yang 2bc03d6a01 added typescript and @types/node packages 2021-04-17 10:19:22 +08:00
ZCandJun Yang 354a971b9e Revert change to line 17
The original is fine, emitter is not needed.
2021-04-17 10:18:39 +08:00
ZCandJun Yang b41be92dfd Update register-filters-tags.md 2021-04-17 10:18:39 +08:00
ZCandJun Yang bad12ea936 Register tags documentation example updated 2021-04-17 10:18:39 +08:00
dependabot[bot]andJun Yang b5a22fa091 chore(deps): bump y18n from 4.0.0 to 4.0.1 in /docs
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <[email protected]>
2021-04-03 00:01:54 +08:00
dependabot[bot]andJun Yang 7d92f25cbb chore(deps): bump y18n from 3.2.1 to 3.2.2
Bumps [y18n](https://github.com/yargs/y18n) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <[email protected]>
2021-04-03 00:01:01 +08:00
harttle 4584867b65 docs: clarification on how to disable tags/filters, see #324 2021-03-21 22:30:53 +08:00
harttle 695e3c18bc docs: add versions to tags/filters, see #305 2021-03-21 22:17:17 +08:00
semantic-release-bot 2133ed20d7 chore(release): 9.23.3 [skip ci]
## [9.23.3](https://github.com/harttle/liquidjs/compare/v9.23.2...v9.23.3) (2021-03-21)

### Bug Fixes

* expose TokenKind ([dbc23e8](https://github.com/harttle/liquidjs/commit/dbc23e8))
2021-03-21 11:32:39 +00:00
Matt Vagueandharttle dbc23e8b04 fix: expose TokenKind 2021-03-21 19:29:00 +08:00
semantic-release-bot 1acace5a16 chore(release): 9.23.2 [skip ci]
## [9.23.2](https://github.com/harttle/liquidjs/compare/v9.23.1...v9.23.2) (2021-03-13)

### Bug Fixes

* comparison for empty/nil, fixes [#321](https://github.com/harttle/liquidjs/issues/321) ([99d14e7](https://github.com/harttle/liquidjs/commit/99d14e7))
* newline_to_br filter should output <br /> instead of <br/>, fixes [#320](https://github.com/harttle/liquidjs/issues/320) ([9a9b792](https://github.com/harttle/liquidjs/commit/9a9b792))
2021-03-13 09:17:50 +00:00
Jun Yang 9a9b792c63 fix: newline_to_br filter should output <br /> instead of <br/>, fixes #320 2021-03-13 17:14:10 +08:00
Jun Yang 99d14e76d7 fix: comparison for empty/nil, fixes #321 2021-03-13 17:14:08 +08:00
dependabot[bot]andJun Yang aff9976042 chore(deps): bump pug-code-gen from 2.0.2 to 2.0.3 in /docs
Bumps [pug-code-gen](https://github.com/pugjs/pug) from 2.0.2 to 2.0.3.
- [Release notes](https://github.com/pugjs/pug/releases)
- [Commits](https://github.com/pugjs/pug/compare/[email protected]@2.0.3)

Signed-off-by: dependabot[bot] <[email protected]>
2021-03-09 22:47:42 +08:00
dependabot[bot]andJun Yang cd8cb39329 chore(deps): bump prismjs from 1.21.0 to 1.23.0 in /docs
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.21.0 to 1.23.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.21.0...v1.23.0)

Signed-off-by: dependabot[bot] <[email protected]>
2021-03-09 22:47:32 +08:00
dependabot[bot]andJun Yang 9ed3b98db3 chore(deps): bump elliptic from 6.5.3 to 6.5.4
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.3...v6.5.4)

Signed-off-by: dependabot[bot] <[email protected]>
2021-03-09 22:47:23 +08:00
semantic-release-bot 151ff4cbf3 chore(release): 9.23.1 [skip ci]
## [9.23.1](https://github.com/harttle/liquidjs/compare/v9.23.0...v9.23.1) (2021-02-19)

### Bug Fixes

* lenientIf not working for the umd bundle, closes [#313](https://github.com/harttle/liquidjs/issues/313) ([2e66e8b](https://github.com/harttle/liquidjs/commit/2e66e8b))
2021-02-19 15:29:27 +00:00
harttle 2e66e8b02e fix: lenientIf not working for the umd bundle, closes #313 2021-02-19 23:10:15 +08:00
semantic-release-bot 24306722ec chore(release): 9.23.0 [skip ci]
# [9.23.0](https://github.com/harttle/liquidjs/compare/v9.22.1...v9.23.0) (2021-02-12)

### Bug Fixes

* respect `fs` in parser options, for [#233](https://github.com/harttle/liquidjs/issues/233) ([4e82da6](https://github.com/harttle/liquidjs/commit/4e82da6))

### Features

* support filters in if/unless/case, see [#287](https://github.com/harttle/liquidjs/issues/287) ([2f059f6](https://github.com/harttle/liquidjs/commit/2f059f6))
* support function calls, closes [#222](https://github.com/harttle/liquidjs/issues/222) ([e37824f](https://github.com/harttle/liquidjs/commit/e37824f))
* support layout none, closes [#299](https://github.com/harttle/liquidjs/issues/299) ([81e11bb](https://github.com/harttle/liquidjs/commit/81e11bb))
2021-02-12 14:28:02 +00:00
harttle 2f059f6a25 feat: support filters in if/unless/case, see #287 2021-02-12 22:22:41 +08:00
harttle 4e82da689e fix: respect fs in parser options, for #233 2021-02-12 15:17:21 +08:00
harttle e37824fd8a feat: support function calls, closes #222 2021-02-12 13:47:30 +08:00
harttle 81e11bb9c4 feat: support layout none, closes #299 2021-02-12 01:57:30 +08:00
semantic-release-bot 71d5d24813 chore(release): 9.22.1 [skip ci]
## [9.22.1](https://github.com/harttle/liquidjs/compare/v9.22.0...v9.22.1) (2021-02-05)

### Bug Fixes

* default to precedence 1 for custom operators ([20f559e](https://github.com/harttle/liquidjs/commit/20f559e))
2021-02-05 16:00:50 +00:00
Jason EtcovitchandJun Yang 20f559e545 fix: default to precedence 1 for custom operators 2021-02-05 23:57:36 +08:00
harttle dce75a1a22 docs: fix get started code block 2021-02-05 09:48:28 +08:00
semantic-release-bot 93ec151374 chore(release): 9.22.0 [skip ci]
# [9.22.0](https://github.com/harttle/liquidjs/compare/v9.21.0...v9.22.0) (2021-02-04)

### Features

* compact filter ([f42c217](https://github.com/harttle/liquidjs/commit/f42c217))
2021-02-04 14:52:00 +00:00
Peter deHaanandJun Yang 29db1bb0e2 Update sidebar.yml
Add `compact` filter to sidebar nav.
2021-02-04 22:48:02 +08:00
harttle f42c217fc0 feat: compact filter 2021-02-04 22:47:34 +08:00
semantic-release-bot ec4a711e00 chore(release): 9.21.0 [skip ci]
# [9.21.0](https://github.com/harttle/liquidjs/compare/v9.20.1...v9.21.0) (2021-02-04)

### Features

* add `operators` option for custom operators ([75591cd](https://github.com/harttle/liquidjs/commit/75591cd))
* create trie programmatically in options ([befc33c](https://github.com/harttle/liquidjs/commit/befc33c))
* export OperatorMap type ([bc87e19](https://github.com/harttle/liquidjs/commit/bc87e19))
* export Operators from operator.ts ([6a7c280](https://github.com/harttle/liquidjs/commit/6a7c280))
* rename to defaultOperators and Operators ([8734e2e](https://github.com/harttle/liquidjs/commit/8734e2e))
2021-02-04 13:51:46 +00:00
Peter deHaanandJun Yang 03893d585e Typo: 'where' filter on filters/overview.md 2021-02-04 21:48:28 +08:00
allcontributors[bot]andJun Yang 3b97c38ee5 docs: update .all-contributorsrc [skip ci] 2021-02-04 09:12:26 +08:00
allcontributors[bot]andJun Yang 48a876db49 docs: update README.md [skip ci] 2021-02-04 09:12:26 +08:00
Jason EtcovitchandJun Yang befc33c4eb feat: create trie programmatically in options 2021-02-04 09:11:28 +08:00
Jason EtcovitchandJun Yang 8734e2e6ce feat: rename to defaultOperators and Operators 2021-02-04 09:11:28 +08:00
Jason EtcovitchandJun Yang 18055c8855 test: add LiquidOptions#operators test 2021-02-04 09:11:28 +08:00
Jason EtcovitchandJun Yang 6a7c280f04 feat: export Operators from operator.ts 2021-02-04 09:11:28 +08:00
Jason EtcovitchandJun Yang bc87e19e3e feat: export OperatorMap type 2021-02-04 09:11:28 +08:00
Jason EtcovitchandJun Yang 75591cdbfc feat: add operators option for custom operators 2021-02-04 09:11:28 +08:00
semantic-release-bot 5901611af5 chore(release): 9.20.1 [skip ci]
## [9.20.1](https://github.com/harttle/liquidjs/compare/v9.20.0...v9.20.1) (2021-01-24)

### Bug Fixes

* allow string literals contain delimiters, fixes [#288](https://github.com/harttle/liquidjs/issues/288) ([9c40da7](https://github.com/harttle/liquidjs/commit/9c40da7))
2021-01-24 04:52:24 +00:00
harttle 9c40da7369 fix: allow string literals contain delimiters, fixes #288 2021-01-24 12:49:19 +08:00
semantic-release-bot 5e7598ce45 chore(release): 9.20.0 [skip ci]
# [9.20.0](https://github.com/harttle/liquidjs/compare/v9.19.0...v9.20.0) (2021-01-23)

### Features

* support `{{block.super}}`, see [#38](https://github.com/harttle/liquidjs/issues/38) ([a3af44d](https://github.com/harttle/liquidjs/commit/a3af44d))
2021-01-23 19:01:03 +00:00
harttle 42591a04d8 docs: update dist links 2021-01-24 02:57:48 +08:00
harttle a3af44dc10 feat: support {{block.super}}, see #38 2021-01-24 02:57:48 +08:00
dependabot[bot]andJun Yang 0e0dc2adf0 chore(deps): bump ini from 1.3.5 to 1.3.7
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <[email protected]>
2021-01-24 02:36:33 +08:00
harttle 7b909c22a1 docs: demo for globals, for #286 2020-12-22 23:19:09 +08:00
semantic-release-bot 626f911503 chore(release): 9.19.0 [skip ci]
# [9.19.0](https://github.com/harttle/liquidjs/compare/v9.18.0...v9.19.0) (2020-12-18)

### Bug Fixes

* lint ([de32259](https://github.com/harttle/liquidjs/commit/de32259))
* move offset adding complexity inside TimezoneDate ([26b2175](https://github.com/harttle/liquidjs/commit/26b2175))
* simpler timezone regex and non-null offset ([e3ecfe3](https://github.com/harttle/liquidjs/commit/e3ecfe3))

### Features

* add preserveTimezones option ([d70cd2a](https://github.com/harttle/liquidjs/commit/d70cd2a))
* parse and handle date timezone offsets ([c16c787](https://github.com/harttle/liquidjs/commit/c16c787))
2020-12-18 14:07:14 +00:00
JoonasandJun Yang de32259bb9 fix: lint 2020-12-18 22:03:58 +08:00
JoonasandJun Yang d70cd2a1ea feat: add preserveTimezones option 2020-12-18 22:03:58 +08:00
JoonasandJun Yang 26b217542b fix: move offset adding complexity inside TimezoneDate 2020-12-18 22:03:58 +08:00
JoonasandJun Yang e3ecfe3adc fix: simpler timezone regex and non-null offset 2020-12-18 22:03:58 +08:00
wyoziandJun Yang c16c787861 feat: parse and handle date timezone offsets 2020-12-18 22:03:58 +08:00
semantic-release-bot 13f5f95d01 chore(release): 9.18.0 [skip ci]
# [9.18.0](https://github.com/harttle/liquidjs/compare/v9.17.0...v9.18.0) (2020-12-17)

### Bug Fixes

* address refactor comments ([6a0ad10](https://github.com/harttle/liquidjs/commit/6a0ad10))

### Features

* add option for keeping variable type in output ([cd92e77](https://github.com/harttle/liquidjs/commit/cd92e77))
2020-12-17 15:17:09 +00:00
harttle c8db5e6259 docs: try fix special chars in changelog.md 2020-12-17 23:08:54 +08:00
allcontributors[bot]andJun Yang 9e511ecd14 docs: update .all-contributorsrc [skip ci] 2020-12-16 10:23:26 +08:00
allcontributors[bot]andJun Yang 45d95bb8d8 docs: update README.md [skip ci] 2020-12-16 10:23:26 +08:00
PixcellandJun Yang 8d3eca6ee2 stringify value in emitter when concatenating it 2020-12-16 10:20:10 +08:00
Alex de WergifosseandJun Yang 6a0ad102a8 fix: address refactor comments 2020-12-16 10:20:10 +08:00
Alex de WergifosseandJun Yang b8e4b3337b test: add tests for keepOutputType option 2020-12-16 10:20:10 +08:00
Alex de WergifosseandJun Yang cd92e77726 feat: add option for keeping variable type in output 2020-12-16 10:20:10 +08:00
allcontributors[bot]andJun Yang e84fbf32ad docs: update .all-contributorsrc [skip ci] 2020-12-14 22:49:50 +08:00
allcontributors[bot]andJun Yang 0266b27838 docs: update README.md [skip ci] 2020-12-14 22:49:50 +08:00
semantic-release-bot 090c88eb92 chore(release): 9.17.0 [skip ci]
# [9.17.0](https://github.com/harttle/liquidjs/compare/v9.16.1...v9.17.0) (2020-12-07)

### Bug Fixes

* elsif is not supported for unless, fixes [#268](https://github.com/harttle/liquidjs/issues/268) ([2bbf501](https://github.com/harttle/liquidjs/commit/2bbf501))
* enforce string-type pattern in `replace`, fixes [#243](https://github.com/harttle/liquidjs/issues/243) ([c8afa39](https://github.com/harttle/liquidjs/commit/c8afa39))
* raw block not ignoring {% characters, fixes [#263](https://github.com/harttle/liquidjs/issues/263) ([a492d8e](https://github.com/harttle/liquidjs/commit/a492d8e))

### Features

* passing liquid to FilterImpl, closes [#277](https://github.com/harttle/liquidjs/issues/277) ([f9f595f](https://github.com/harttle/liquidjs/commit/f9f595f))
2020-12-07 16:34:49 +00:00
harttle e15803fae4 test: fix e2e test 2020-12-08 00:30:32 +08:00
harttle 117673a725 style: make eslint check .ts files 2020-12-08 00:24:07 +08:00
harttle ef43120d6e test: fix test cases after rebase 2020-12-08 00:20:43 +08:00
harttle f9f595f0f4 feat: passing liquid to FilterImpl, closes #277 2020-12-08 00:17:27 +08:00
harttle 2bbf50171b fix: elsif is not supported for unless, fixes #268 2020-12-08 00:16:36 +08:00
harttle a492d8e23d fix: raw block not ignoring {% characters, fixes #263 2020-12-08 00:12:20 +08:00
harttle c8afa39a01 fix: enforce string-type pattern in replace, fixes #243 2020-12-08 00:08:31 +08:00
sschuldenzuckerandJun Yang d8f9091a12 add and use error classes for undefined variables
cleans up funky message-matching code in expression.ts for lenient.
2020-12-06 22:58:08 +08:00
sschuldenzuckerandJun Yang ca18a579a1 Expression: minor type change & simplification
pre-fetching postfix simplifies code for 'lenient'
2020-12-06 22:58:08 +08:00
sschuldenzuckerandJun Yang 6f2b24f7ca implement lenientIf for the unless tag, too 2020-12-06 22:58:08 +08:00
sschuldenzuckerandJun Yang 87d7dd0d37 docs for the lenientIf option 2020-12-06 22:58:08 +08:00
sschuldenzuckerandJun Yang 768fb79e32 Implement lenientIf option (resolve #265; default off)
See description of the option in liquid-options.ts.
2020-12-06 22:58:08 +08:00
sschuldenzuckerandJun Yang c920ebb282 fix test: don't pass {} for Context 2020-12-06 22:58:08 +08:00
Jun YangandGitHub 9706e8b411 docs: add a security policy, see #254 2020-11-29 20:59:00 +08:00
dependabot[bot]andJun Yang 75698eefec chore(deps): bump highlight.js from 9.18.1 to 9.18.5 in /docs
Bumps [highlight.js](https://github.com/highlightjs/highlight.js) from 9.18.1 to 9.18.5.
- [Release notes](https://github.com/highlightjs/highlight.js/releases)
- [Changelog](https://github.com/highlightjs/highlight.js/blob/9.18.5/CHANGES.md)
- [Commits](https://github.com/highlightjs/highlight.js/compare/9.18.1...9.18.5)

Signed-off-by: dependabot[bot] <[email protected]>
2020-11-25 21:56:22 +08:00
dependabot[bot]andJun Yang dfd358c0a2 chore(deps): bump highlight.js from 9.15.9 to 9.18.5
Bumps [highlight.js](https://github.com/highlightjs/highlight.js) from 9.15.9 to 9.18.5.
- [Release notes](https://github.com/highlightjs/highlight.js/releases)
- [Changelog](https://github.com/highlightjs/highlight.js/blob/9.18.5/CHANGES.md)
- [Commits](https://github.com/highlightjs/highlight.js/compare/9.15.9...9.18.5)

Signed-off-by: dependabot[bot] <[email protected]>
2020-11-25 21:55:58 +08:00
dependabot[bot]andJun Yang 4c70946fa1 chore(deps-dev): bump semantic-release from 15.13.19 to 17.2.3
Bumps [semantic-release](https://github.com/semantic-release/semantic-release) from 15.13.19 to 17.2.3.
- [Release notes](https://github.com/semantic-release/semantic-release/releases)
- [Commits](https://github.com/semantic-release/semantic-release/compare/v15.13.19...v17.2.3)

Signed-off-by: dependabot[bot] <[email protected]>
2020-11-20 22:11:04 +08:00
Jun YangandGitHub 9d9c0c1ca7 docs: update the UMD url and jsFiddle demo, see #264 2020-11-08 12:18:37 +08:00
semantic-release-bot a9d3a5a402 chore(release): 9.16.1 [skip ci]
## [9.16.1](https://github.com/harttle/liquidjs/compare/v9.16.0...v9.16.1) (2020-10-09)

### Bug Fixes

* braced property access ([18a807e](https://github.com/harttle/liquidjs/commit/18a807e))
2020-10-09 13:22:06 +00:00
wyoziandJun Yang 30dffb675e Test for broken quoted property access 2020-10-09 21:18:40 +08:00
wyoziandJun Yang e67c3c6924 Make end brace peek stricter and fix the test 2020-10-09 21:18:40 +08:00
wyoziandJun Yang e2e410f334 Add incomplete quoted property access test 2020-10-09 21:18:40 +08:00
wyoziandJun Yang 27ce44238e Test getVariableAsText 2020-10-09 21:18:40 +08:00
wyoziandJun Yang abfaf8a042 Test quoted property access tokenizing 2020-10-09 21:18:40 +08:00
wyoziandJun Yang 18a807ea2e fix: braced property access 2020-10-09 21:18:40 +08:00
harttle a6126c3bea docs: add amit777 as contributor for code 2020-10-08 16:57:59 +08:00
harttle a96d772963 docs: format 2020-10-08 14:40:58 +08:00
semantic-release-bot 732ef2605e chore(release): 9.16.0 [skip ci]
# [9.16.0](https://github.com/harttle/liquidjs/compare/v9.15.1...v9.16.0) (2020-10-08)

### Features

* support jsTruthy, [#255](https://github.com/harttle/liquidjs/issues/255) [#257](https://github.com/harttle/liquidjs/issues/257) ([72ee7b4](https://github.com/harttle/liquidjs/commit/72ee7b4))
2020-10-08 05:15:00 +00:00
harttle 72ee7b4c1e feat: support jsTruthy, #255 #257 2020-10-08 13:11:02 +08:00
Amit GuptaandJun Yang f807383f2a resolved issues raised by hhartle 2020-10-08 12:43:37 +08:00
Amit GuptaandJun Yang 02bfed1c57 Added jsTruthy flag to constuctor in order to enable JS style truthiness evaluation 2020-10-08 12:43:37 +08:00
harttle b11df79b91 test: make it pass regardless timezone, #257 2020-10-08 09:38:10 +08:00
semantic-release-bot 8ee9bd7ba8 chore(release): 9.15.1 [skip ci]
## [9.15.1](https://github.com/harttle/liquidjs/compare/v9.15.0...v9.15.1) (2020-10-03)

### Bug Fixes

* allow quoted variable name in capture, fixes [#252](https://github.com/harttle/liquidjs/issues/252) ([5b3f419](https://github.com/harttle/liquidjs/commit/5b3f419))
2020-10-03 14:06:41 +00:00
harttle 5b3f4195f0 fix: allow quoted variable name in capture, fixes #252 2020-10-03 22:03:17 +08:00
dependabot[bot]andJun Yang 236d971705 chore(deps): bump node-fetch from 2.6.0 to 2.6.1
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot[bot] <[email protected]>
2020-10-03 20:36:06 +08:00
Jun YangandGitHub 0cd4d87d46 docs: update the demo on index page, fixes #247 2020-09-11 22:30:21 +08:00
harttle 1fdfd4a68a docs: show social share on small screens 2020-08-12 20:37:07 +08:00
dependabot[bot]andJun Yang c1f73a9f03 chore(deps): bump prismjs from 1.19.0 to 1.21.0 in /docs
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.19.0 to 1.21.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.19.0...v1.21.0)

Signed-off-by: dependabot[bot] <[email protected]>
2020-08-08 22:14:03 +08:00
semantic-release-bot d8f550e447 chore(release): 9.15.0 [skip ci]
# [9.15.0](https://github.com/harttle/liquidjs/compare/v9.14.1...v9.15.0) (2020-08-04)

### Features

* export toPromise and toValue, see [#158](https://github.com/harttle/liquidjs/issues/158) ([2e5ab98](https://github.com/harttle/liquidjs/commit/2e5ab98))
2020-08-04 16:58:57 +00:00
harttle 2e5ab98bfc feat: export toPromise and toValue, see #158 2020-08-05 00:46:01 +08:00
harttle 0dbb7792d7 docs: fix button style 2020-08-01 22:00:12 +08:00
dependabot[bot]andJun Yang e10ce657dd chore(deps): bump elliptic from 6.5.0 to 6.5.3
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.0 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.0...v6.5.3)

Signed-off-by: dependabot[bot] <[email protected]>
2020-07-30 22:42:19 +08:00
harttle 3713fa08b2 docs: credit Peter deHaan as contributor 2020-07-25 23:31:48 +08:00
harttle c5002d8cad docs: location.hash for source code 2020-07-25 01:23:47 +08:00
dependabot[bot]andJun Yang 00b0a5708c chore(deps): bump lodash from 4.17.15 to 4.17.19 in /docs
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <[email protected]>
2020-07-20 21:14:42 +08:00
semantic-release-bot f82ee8a18c chore(release): 9.14.1 [skip ci]
## [9.14.1](https://github.com/harttle/liquidjs/compare/v9.14.0...v9.14.1) (2020-07-08)

### Bug Fixes

* enumerate Promises (e.g. in for & tablerow) ([#237](https://github.com/harttle/liquidjs/issues/237)) ([941dd66](https://github.com/harttle/liquidjs/commit/941dd66))
2020-07-08 17:40:43 +00:00
dependabot[bot]andJun Yang 632bb6b077 chore(deps): bump npm from 6.13.4 to 6.14.6
Bumps [npm](https://github.com/npm/cli) from 6.13.4 to 6.14.6.
- [Release notes](https://github.com/npm/cli/releases)
- [Changelog](https://github.com/npm/cli/blob/latest/CHANGELOG.md)
- [Commits](https://github.com/npm/cli/compare/v6.13.4...v6.14.6)

Signed-off-by: dependabot[bot] <[email protected]>
2020-07-09 01:36:21 +08:00
allcontributors[bot]GitHuballcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
0b6ee9bca1 docs: add tejasmanohar as a contributor (#238)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2020-06-28 09:57:45 +08:00
Tejas ManoharandGitHub 941dd668fe fix: enumerate Promises (e.g. in for & tablerow) (#237)
* fix: enumerate Promise<array> (e.g. in {% for ... %})

Previously, a Promise of an array was not being enumerated in
{% for %}, for example. This is misleading since the library
handles promises elsewhere (e.g. if you {% assign x = promiseArray %}
and then {% for v in x %}, it worked just fine.

This PR makes Promises of arrays handled by changing toEnumerable
to handle then-ables. This affects other iterators, too, e.g. tablerow,
so I put in a test for that as well.
2020-06-28 09:55:56 +08:00
semantic-release-bot 11ffd65503 chore(release): 9.14.0 [skip ci]
# [9.14.0](https://github.com/harttle/liquidjs/compare/v9.13.0...v9.14.0) (2020-06-25)

### Features

* setup universal browser and node builds ([6cf6ffa](https://github.com/harttle/liquidjs/commit/6cf6ffa))
2020-06-25 12:14:45 +00:00
Jun YangandGitHub ce0280ca9f Merge pull request #235 from harttle/all-contributors/add-TrySound
docs: add TrySound as a contributor
2020-06-25 20:10:15 +08:00
allcontributors[bot]andGitHub 1066ef0f76 docs: update .all-contributorsrc [skip ci] 2020-06-25 12:09:50 +00:00
allcontributors[bot]andGitHub 7b38c28d52 docs: update README.md [skip ci] 2020-06-25 12:09:49 +00:00
Jun YangandGitHub 97e7983bd8 Merge pull request #234 from TrySound/proper-modules
feat: setup universal browser and node builds
2020-06-25 20:08:47 +08:00
Bogdan Chadkin 6cf6ffae90 feat: setup universal browser and node builds
In this diff I fixed es modules distribution for bundlers.

Before we had two problems
- bundlers use "module" field to find es module build
- bundlers cannot use provided es module with node target

In this diff I addressed both of them. Now "main" and "module" fields
points to "node" specific versions. "browser" field provides aliases
with browser compatible builds.

All modern browsers support both "module" and "browser" fields.
2020-06-25 13:30:56 +03:00
semantic-release-bot 04873a4e9c chore(release): 9.13.0 [skip ci]
# [9.13.0](https://github.com/harttle/liquidjs/compare/v9.12.0...v9.13.0) (2020-06-25)

### Features

* async filters, closes [#232](https://github.com/harttle/liquidjs/issues/232) ([e36f3ff](https://github.com/harttle/liquidjs/commit/e36f3ff))
2020-06-25 05:56:31 +00:00
harttle 1a08efd402 docs: better style for API doc 2020-06-25 13:15:02 +08:00
harttle e36f3ff291 feat: async filters, closes #232 2020-06-25 12:30:56 +08:00
harttle f3f017bd37 style: spaces and extra NL 2020-05-30 22:13:20 +08:00
harttle 0d20a344b6 docs: manifest for liquidjs.com 2020-05-23 02:14:23 +08:00
Jun YangandGitHub 3acbdfc1b7 Merge pull request #229 from stedman/patch-1
docs: Add hashes to `for` tag documentation
2020-05-23 01:56:13 +08:00
Anthony CiccarelloandJun Yang ed994bdbd5 fix elsif spelling on tags overview in docs 2020-05-23 01:56:03 +08:00
dependabot[bot]andJun Yang 27a4c7666b chore(deps): bump jquery from 3.4.1 to 3.5.0
Bumps [jquery](https://github.com/jquery/jquery) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/jquery/jquery/releases)
- [Commits](https://github.com/jquery/jquery/compare/3.4.1...3.5.0)

Signed-off-by: dependabot[bot] <[email protected]>
2020-05-23 01:55:30 +08:00
harttle 064ea99f49 docs: add credit for @stedman (#229) and @aciccarello (#223) 2020-05-22 11:44:23 +08:00
harttle 71fb8a8b7c chore: +pre-commit hook, -commitlint on travis 2020-05-22 11:41:32 +08:00
Steve Stedman acdd121a61 docs: Add hashes to for tag documentation
This extremely helpful information was found at https://github.com/Shopify/liquid/wiki/Liquid-for-Designers#allowed-collection-types
2020-05-21 11:11:01 -05:00
semantic-release-bot 2de853e814 chore(release): 9.12.0 [skip ci]
# [9.12.0](https://github.com/harttle/liquidjs/compare/v9.11.11...v9.12.0) (2020-05-15)

### Features

* sort by key, see [#227](https://github.com/harttle/liquidjs/issues/227) ([4f17c94](https://github.com/harttle/liquidjs/commit/4f17c94))
2020-05-15 16:59:44 +00:00
harttle 4f17c94988 feat: sort by key, see #227 2020-05-16 00:54:40 +08:00
semantic-release-bot d39f65c564 chore(release): 9.11.11 [skip ci]
## [9.11.11](https://github.com/harttle/liquidjs/compare/v9.11.10...v9.11.11) (2020-05-01)

### Bug Fixes

* properly treat unicode blanks, fixes [#221](https://github.com/harttle/liquidjs/issues/221) ([673b015](https://github.com/harttle/liquidjs/commit/673b015))
2020-05-01 07:20:59 +00:00
harttle 673b015435 fix: properly treat unicode blanks, fixes #221 2020-04-28 20:55:30 +08:00
harttle 2fa4edaa84 docs: more specific description of strftime 2020-04-19 13:15:11 +08:00
dependabot[bot]andJun Yang 83b46bd25d chore(deps): bump https-proxy-agent from 2.2.2 to 2.2.4
Bumps [https-proxy-agent](https://github.com/TooTallNate/node-https-proxy-agent) from 2.2.2 to 2.2.4.
- [Release notes](https://github.com/TooTallNate/node-https-proxy-agent/releases)
- [Commits](https://github.com/TooTallNate/node-https-proxy-agent/compare/2.2.2...2.2.4)

Signed-off-by: dependabot[bot] <[email protected]>
2020-04-18 14:58:17 +08:00
harttle 4e34e78176 docs: fix docsearch 2020-04-12 20:45:52 +08:00
harttle 3873ba0783 docs: docsearch 2020-04-11 21:52:55 +08:00
dependabot[bot]andJun Yang 4799a98bf9 chore(deps): bump acorn from 3.3.0 to 6.4.1
Bumps [acorn](https://github.com/acornjs/acorn) from 3.3.0 to 6.4.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/3.3.0...6.4.1)

Signed-off-by: dependabot[bot] <[email protected]>
2020-04-04 12:17:47 +08:00
semantic-release-bot 0953680112 chore(release): 9.11.10 [skip ci]
## [9.11.10](https://github.com/harttle/liquidjs/compare/v9.11.9...v9.11.10) (2020-04-03)

### Bug Fixes

* respect cache render options ([a93f11d](https://github.com/harttle/liquidjs/commit/a93f11d))
2020-04-03 15:11:24 +00:00
harttle f6789f517c docs: make it clear for extnames, see #214 2020-04-03 23:08:09 +08:00
allcontributors[bot]andJun Yang 5099b2a762 docs: update README.md [skip ci] 2020-04-03 10:44:38 +08:00
Martin SchusterandJun Yang a93f11d25a fix: respect cache render options 2020-04-03 10:42:32 +08:00
harttle 3cf8072df5 docs: fix news date in liquidjs.com 2020-04-01 14:34:13 +08:00
semantic-release-bot bf609b443b chore(release): 9.11.9 [skip ci]
## [9.11.9](https://github.com/harttle/liquidjs/compare/v9.11.8...v9.11.9) (2020-03-31)

### Bug Fixes

* coerce to Array in `map` and `where` filter ([c923598](https://github.com/harttle/liquidjs/commit/c923598))
2020-03-31 18:26:08 +00:00
harttle c923598b40 fix: coerce to Array in map and where filter 2020-04-01 02:22:44 +08:00
semantic-release-bot d65ed408f0 chore(release): 9.11.8 [skip ci]
## [9.11.8](https://github.com/harttle/liquidjs/compare/v9.11.7...v9.11.8) (2020-03-31)

### Bug Fixes

* throw an error if : omitted unintentionally, [#212](https://github.com/harttle/liquidjs/issues/212), [#208](https://github.com/harttle/liquidjs/issues/208) ([8daf281](https://github.com/harttle/liquidjs/commit/8daf281))
2020-03-31 16:05:54 +00:00
harttle e750c35f8c docs: add @cfjedimaster as a contributor 2020-04-01 00:02:17 +08:00
harttle 8daf281fca fix: throw an error if : omitted unintentionally, #212, #208 2020-03-31 14:05:38 +08:00
harttle c30766ffe1 style: eslint fix docs/ 2020-03-31 01:25:31 +08:00
Raymond CamdenandJun Yang bf23116ce5 Update demo.liquid
Fix typo
2020-03-30 21:17:04 +08:00
harttle 983bcf467a docs: add tutorials/options.md 2020-03-29 22:10:52 +08:00
harttle 9ebf11edcf docs: update README to refer to liquidjs.com 2020-03-28 21:09:08 +08:00
semantic-release-bot 8d0ef21267 chore(release): 9.11.7 [skip ci]
## [9.11.7](https://github.com/harttle/liquidjs/compare/v9.11.6...v9.11.7) (2020-03-28)

### Bug Fixes

* try fix travis ([b3db412](https://github.com/harttle/liquidjs/commit/b3db412))
2020-03-28 10:12:33 +00:00
harttle 687d3ad12a chore: try fix travis again 2020-03-28 18:08:30 +08:00
harttle b3db412428 fix: try fix travis 2020-03-28 17:50:51 +08:00
harttle 3e42d6b1b0 docs: website for LiquidJS 2020-03-28 17:21:07 +08:00
semantic-release-bot 0633dbeabb chore(release): 9.11.6 [skip ci]
## [9.11.6](https://github.com/harttle/liquidjs/compare/v9.11.5...v9.11.6) (2020-03-25)

### Bug Fixes

* default filter not applied for empty array ([c371762](https://github.com/harttle/liquidjs/commit/c371762))
2020-03-25 17:42:48 +00:00
harttle c371762c43 fix: default filter not applied for empty array 2020-03-26 01:39:30 +08:00
semantic-release-bot 94d67d254d chore(release): 9.11.5 [skip ci]
## [9.11.5](https://github.com/harttle/liquidjs/compare/v9.11.4...v9.11.5) (2020-03-24)

### Bug Fixes

* throws on invalid arguments for prepend/append, fixes [#208](https://github.com/harttle/liquidjs/issues/208) ([479c633](https://github.com/harttle/liquidjs/commit/479c633))
2020-03-24 16:29:26 +00:00
harttle 02e6171e25 chore: fix types 2020-03-25 00:25:47 +08:00
harttle 479c63350a fix: throws on invalid arguments for prepend/append, fixes #208 2020-03-24 23:57:26 +08:00
semantic-release-bot 60c14ba057 chore(release): 9.11.4 [skip ci]
## [9.11.4](https://github.com/harttle/liquidjs/compare/v9.11.3...v9.11.4) (2020-03-23)

### Bug Fixes

* return variable name in include error ([93433a8](https://github.com/harttle/liquidjs/commit/93433a8))
2020-03-23 17:31:37 +00:00
harttle c95b5bd718 docs: update README 2020-03-24 01:28:17 +08:00
allcontributors[bot]andJun Yang 4cb713dbf6 docs: update .all-contributorsrc [skip ci] 2020-03-23 23:28:49 +08:00
allcontributors[bot]andJun Yang e97db63249 docs: update README.md [skip ci] 2020-03-23 23:28:49 +08:00
Cristofer GonzalesandJun Yang 93433a8b30 fix: return variable name in include error 2020-03-23 23:26:31 +08:00
harttle 6bf242b9fa docs: reorder badges 2020-03-22 19:05:18 +08:00
Jun Yang c36801640d docs: update README.md to hornor backers 2020-03-17 01:36:07 +08:00
semantic-release-bot 14b04688b5 chore(release): 9.11.3 [skip ci]
## [9.11.3](https://github.com/harttle/liquidjs/compare/v9.11.2...v9.11.3) (2020-03-14)

### Performance Improvements

* introduce AST to avoid reparse ([d2d6a38](https://github.com/harttle/liquidjs/commit/d2d6a38))
* remove instanceof DelimitedToken ([1673e84](https://github.com/harttle/liquidjs/commit/1673e84))
2020-03-14 18:54:31 +00:00
harttle 1673e84e27 perf: remove instanceof DelimitedToken 2020-03-15 02:51:25 +08:00
harttle d2d6a38235 perf: introduce AST to avoid reparse 2020-03-15 02:51:25 +08:00
semantic-release-bot 3b58f1c3f6 chore(release): 9.11.2 [skip ci]
## [9.11.2](https://github.com/harttle/liquidjs/compare/v9.11.1...v9.11.2) (2020-03-14)

### Performance Improvements

* remove transient strings to reduce memory ([3dfdf98](https://github.com/harttle/liquidjs/commit/3dfdf98))
2020-03-14 11:08:23 +00:00
dependabot[bot]andJun Yang dd339dab05 chore(deps): bump acorn from 6.2.1 to 6.4.1
Bumps [acorn](https://github.com/acornjs/acorn) from 6.2.1 to 6.4.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.2.1...6.4.1)

Signed-off-by: dependabot[bot] <[email protected]>
2020-03-14 19:05:10 +08:00
harttle f7ef9b61c1 refactor: remove src/render/value.ts 2020-03-14 19:04:18 +08:00
harttle 3dfdf982c9 perf: remove transient strings to reduce memory 2020-03-14 19:04:18 +08:00
harttle 0f25017d5d test: test case for array index, #201 2020-03-11 01:09:58 +08:00
semantic-release-bot 8f05784a0c chore(release): 9.11.1 [skip ci]
## [9.11.1](https://github.com/harttle/liquidjs/compare/v9.11.0...v9.11.1) (2020-03-09)

### Bug Fixes

* concurrent write on LRU cache ([#200](https://github.com/harttle/liquidjs/issues/200)) ([6de9338](https://github.com/harttle/liquidjs/commit/6de9338))
2020-03-09 17:23:57 +00:00
harttle 76f69db752 style: eslint ignore docs/ 2020-03-10 01:19:40 +08:00
harttle 3aa47f6c85 chore: add todolist for benchmark case 2020-03-10 01:10:13 +08:00
harttle 6de933897e fix: concurrent write on LRU cache (#200) 2020-03-10 01:09:41 +08:00
harttle 06ad0481db docs: fix demos 2020-03-10 01:08:25 +08:00
harttle 2c428221cb test: cases for TagMap 2020-03-07 00:58:39 +08:00
allcontributors[bot]andJun Yang 73dd48861d docs: update .all-contributorsrc [skip ci] 2020-03-05 02:14:49 +08:00
allcontributors[bot]andJun Yang 76087b8ec2 docs: update README.md [skip ci] 2020-03-05 02:14:49 +08:00
semantic-release-bot 4826f48f1c chore(release): 9.11.0 [skip ci]
# [9.11.0](https://github.com/harttle/liquidjs/compare/v9.10.0...v9.11.0) (2020-03-04)

### Bug Fixes

* `Buffer not defined` for browser bundles, fixes [#197](https://github.com/harttle/liquidjs/issues/197) ([65b849c](https://github.com/harttle/liquidjs/commit/65b849c))
* stable sort for undefined keys, fixes [#191](https://github.com/harttle/liquidjs/issues/191) ([f57156b](https://github.com/harttle/liquidjs/commit/f57156b))

### Features

* async cache.read()/write(), remove .has() ([61dac49](https://github.com/harttle/liquidjs/commit/61dac49))
2020-03-04 18:08:40 +00:00
harttle f57156bccd fix: stable sort for undefined keys, fixes #191 2020-03-05 02:04:58 +08:00
harttle 61dac49b04 feat: async cache.read()/write(), remove .has() 2020-03-05 01:47:53 +08:00
harttle 65b849c02a fix: Buffer not defined for browser bundles, fixes #197 2020-03-05 01:46:38 +08:00
semantic-release-bot 607a5cda3f chore(release): 9.10.0 [skip ci]
# [9.10.0](https://github.com/harttle/liquidjs/compare/v9.9.0...v9.10.0) (2020-03-03)

### Features

* support json filter, closes [#192](https://github.com/harttle/liquidjs/issues/192) ([aa27a6c](https://github.com/harttle/liquidjs/commit/aa27a6c))
* with & for in `render` tag, closes [#195](https://github.com/harttle/liquidjs/issues/195) ([6ea6881](https://github.com/harttle/liquidjs/commit/6ea6881))
2020-03-03 23:12:54 +00:00
harttle 6ea6881f08 feat: with & for in render tag, closes #195 2020-03-04 07:08:54 +08:00
harttle aa27a6cd7b feat: support json filter, closes #192 2020-03-04 03:42:18 +08:00
harttle 152778b6e3 docs: include demo for LiquidJS used in browsers, #165 2020-03-03 00:37:37 +08:00
semantic-release-bot 3bf926b434 chore(release): 9.9.0 [skip ci]
# [9.9.0](https://github.com/harttle/liquidjs/compare/v9.8.0...v9.9.0) (2020-03-02)

### Features

* move filters/tags to instances, fixes [#188](https://github.com/harttle/liquidjs/issues/188) ([df8a919](https://github.com/harttle/liquidjs/commit/df8a919))
2020-03-02 16:11:08 +00:00
harttle df8a919f71 feat: move filters/tags to instances, fixes #188 2020-03-03 00:02:29 +08:00
semantic-release-bot f6762078e0 chore(release): 9.8.0 [skip ci]
# [9.8.0](https://github.com/harttle/liquidjs/compare/v9.7.2...v9.8.0) (2020-02-20)

### Features

* "today" when using date filter, fixes [#193](https://github.com/harttle/liquidjs/issues/193) ([185312d](https://github.com/harttle/liquidjs/commit/185312d))
2020-02-20 17:53:27 +00:00
harttle 185312dbff feat: "today" when using date filter, fixes #193 2020-02-21 01:48:10 +08:00
semantic-release-bot 5cd42f4500 chore(release): 9.7.2 [skip ci]
## [9.7.2](https://github.com/harttle/liquidjs/compare/v9.7.1...v9.7.2) (2020-02-20)

### Bug Fixes

* add funding entry to show up in npm fund command ([40095a8](https://github.com/harttle/liquidjs/commit/40095a8))
2020-02-20 17:37:45 +00:00
Zach LeathermanandJun Yang 40095a8e71 fix: add funding entry to show up in npm fund command 2020-02-21 01:33:43 +08:00
semantic-release-bot 14527a2545 chore(release): 9.7.1 [skip ci]
## [9.7.1](https://github.com/harttle/liquidjs/compare/v9.7.0...v9.7.1) (2020-02-19)

### Bug Fixes

* update index.html ([22386b0](https://github.com/harttle/liquidjs/commit/22386b0))
2020-02-19 10:31:46 +00:00
Peter deHaanandharttle 22386b0212 fix: update index.html
Fix a couple of errors that were appearing on https://harttle.land/liquidjs/#feature-list
2020-02-19 18:27:09 +08:00
semantic-release-bot 66541a62fd chore(release): 9.7.0 [skip ci]
# [9.7.0](https://github.com/harttle/liquidjs/compare/v9.6.2...v9.7.0) (2020-02-07)

### Bug Fixes

* expression and string literal parser, [#186](https://github.com/harttle/liquidjs/issues/186) ([fc0cf6f](https://github.com/harttle/liquidjs/commit/fc0cf6f))

### Features

* globals shared between tags, see [#185](https://github.com/harttle/liquidjs/issues/185) ([870e7ec](https://github.com/harttle/liquidjs/commit/870e7ec))
2020-02-07 21:05:21 +00:00
harttle 870e7ec6aa feat: globals shared between tags, see #185 2020-02-08 04:59:23 +08:00
harttle fc0cf6fe7b fix: expression and string literal parser, #186 2020-02-08 03:15:55 +08:00
allcontributors[bot]andJun Yang 46b69db87a docs: update .all-contributorsrc [skip ci] 2020-01-10 11:32:04 +08:00
allcontributors[bot]andJun Yang 9733199dc3 docs: update README.md [skip ci] 2020-01-10 11:32:04 +08:00
semantic-release-bot 1e6e9fe1a9 chore(release): 9.6.2 [skip ci]
## [9.6.2](https://github.com/harttle/liquidjs/compare/v9.6.1...v9.6.2) (2020-01-10)

### Performance Improvements

* prevent multiple case evaluations ([807e840](https://github.com/harttle/liquidjs/commit/807e840))
2020-01-10 03:29:50 +00:00
Martin SchusterandJun Yang 807e840712 perf: prevent multiple case evaluations 2020-01-10 11:25:52 +08:00
harttle a9afc9730c docs: add tgrandgent as contributor 2020-01-04 13:55:14 +08:00
harttle 5f9abdc8c6 test: integration cases for opts.fs, see #181 2020-01-04 13:53:08 +08:00
semantic-release-bot e24d9ab1b6 chore(release): 9.6.1 [skip ci]
## [9.6.1](https://github.com/harttle/liquidjs/compare/v9.6.0...v9.6.1) (2020-01-04)

### Bug Fixes

* add `this` to fs references in parseFile ([4b079c5](https://github.com/harttle/liquidjs/commit/4b079c5))
2020-01-04 04:09:40 +00:00
tgrandgentandJun Yang 4b079c54b1 fix: add this to fs references in parseFile 2020-01-04 12:05:39 +08:00
dependabot[bot]andJun Yang b600028607 chore(deps): bump handlebars from 4.1.0 to 4.5.3
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.0 to 4.5.3.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.1.0...v4.5.3)

Signed-off-by: dependabot[bot] <[email protected]>
2019-12-26 22:50:33 -06:00
semantic-release-bot 5ec3f95317 chore(release): 9.6.0 [skip ci]
# [9.6.0](https://github.com/harttle/liquidjs/compare/v9.5.0...v9.6.0) (2019-12-15)

### Features

* full syntax for strftime, close [#177](https://github.com/harttle/liquidjs/issues/177) ([ba5ff3f](https://github.com/harttle/liquidjs/commit/ba5ff3f))
2019-12-15 02:33:24 +00:00
harttle ba5ff3f41c feat: full syntax for strftime, close #177
- strftime syntax: <flags><width><modifier><conversion>
- new conversions: %n, %t
- fixed conversions: %N
- flags: _ ^ - 0 # :
- modifiers: E, O (ignored)
2019-12-15 02:28:33 +00:00
harttle c69ad538d4 test: remove mock for strftime cases 2019-12-14 18:34:14 +00:00
dependabot[bot]andJun Yang a373e50990 chore(deps): bump npm from 6.10.2 to 6.13.4
Bumps [npm](https://github.com/npm/cli) from 6.10.2 to 6.13.4.
- [Release notes](https://github.com/npm/cli/releases)
- [Changelog](https://github.com/npm/cli/blob/latest/CHANGELOG.md)
- [Commits](https://github.com/npm/cli/compare/v6.10.2...v6.13.4)

Signed-off-by: dependabot[bot] <[email protected]>
2019-12-14 00:28:06 -06:00
semantic-release-bot 90d78ae6d5 chore(release): 9.5.0 [skip ci]
# [9.5.0](https://github.com/harttle/liquidjs/compare/v9.4.2...v9.5.0) (2019-12-12)

### Features

* nested property for the `where` filter, [#178](https://github.com/harttle/liquidjs/issues/178) ([60ec74f](https://github.com/harttle/liquidjs/commit/60ec74f))
2019-12-12 17:21:49 +00:00
harttle 60ec74f55d feat: nested property for the where filter, #178 2019-12-13 01:15:29 +08:00
semantic-release-bot 6502984b50 chore(release): 9.4.2 [skip ci]
## [9.4.2](https://github.com/harttle/liquidjs/compare/v9.4.1...v9.4.2) (2019-11-15)

### Bug Fixes

* reading .first, .last of Array, closes [#175](https://github.com/harttle/liquidjs/issues/175) ([f82da11](https://github.com/harttle/liquidjs/commit/f82da11))
2019-11-15 17:19:40 +00:00
harttle f82da11f5a fix: reading .first, .last of Array, closes #175 2019-11-16 01:14:09 +08:00
semantic-release-bot ef289039fb chore(release): 9.4.1 [skip ci]
## [9.4.1](https://github.com/harttle/liquidjs/compare/v9.4.0...v9.4.1) (2019-11-15)

### Bug Fixes

* remove node dependencies for esm bundle, see [#173](https://github.com/harttle/liquidjs/issues/173) ([04df929](https://github.com/harttle/liquidjs/commit/04df929))
2019-11-15 02:58:48 +00:00
harttle 04df9294b5 fix: remove node dependencies for esm bundle, see #173 2019-11-15 10:53:54 +08:00
semantic-release-bot 79892f6b72 chore(release): 9.4.0 [skip ci]
# [9.4.0](https://github.com/harttle/liquidjs/compare/v9.3.1...v9.4.0) (2019-11-14)

### Features

* add ability to pass JSON context to CLI ([9504e4e](https://github.com/harttle/liquidjs/commit/9504e4e))
2019-11-14 13:18:08 +00:00
allcontributors[bot]andJun Yang 19f3e23b27 docs: update .all-contributorsrc 2019-11-14 07:08:21 -06:00
allcontributors[bot]andJun Yang 993ea20b80 docs: update README.md 2019-11-14 07:08:21 -06:00
harttle 08cbb12228 chore: introduce commit message lint 2019-11-14 21:01:55 +08:00
Brandon Pittmanandharttle 9504e4e45b feat: add ability to pass JSON context to CLI
If you pass a JSON file or JSON string as the first argument to the CLI, you can use variables in your templates that get parsed by the CLI.
2019-11-14 21:01:37 +08:00
semantic-release-bot 0b9b50c5d7 chore(release): 9.3.1 [skip ci]
## [9.3.1](https://github.com/harttle/liquidjs/compare/v9.3.0...v9.3.1) (2019-11-09)

### Bug Fixes

* liquidjs command in /bin/liquid.js, fixes [#169](https://github.com/harttle/liquidjs/issues/169) ([0073b90](https://github.com/harttle/liquidjs/commit/0073b90))
2019-11-09 16:17:47 +00:00
harttle 0073b90b31 fix: liquidjs command in /bin/liquid.js, fixes #169 2019-11-10 00:13:18 +08:00
Jun YangandGitHub 081c432334 docs: update readme 2019-11-09 10:26:58 +08:00
semantic-release-bot 390cd23f5f chore(release): 9.3.0 [skip ci]
# [9.3.0](https://github.com/harttle/liquidjs/compare/v9.2.0...v9.3.0) (2019-11-07)

### Features

* support require.resolve for lookup, see [#168](https://github.com/harttle/liquidjs/issues/168) ([2dd4355](https://github.com/harttle/liquidjs/commit/2dd4355))
2019-11-07 10:51:46 +00:00
harttle 2dd43559b5 feat: support require.resolve for lookup, see #168 2019-11-07 18:46:37 +08:00
dependabot[bot]andJun Yang 5492fb0b17 chore(deps): bump eslint-utils from 1.4.0 to 1.4.3
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.4.0 to 1.4.3.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.4.0...v1.4.3)

Signed-off-by: dependabot[bot] <[email protected]>
2019-11-03 07:51:34 -06:00
semantic-release-bot 1ecff1c341 chore(release): 9.2.0 [skip ci]
# [9.2.0](https://github.com/harttle/liquidjs/compare/v9.1.1...v9.2.0) (2019-10-26)

### Features

* Support for the "render" tag [#163](https://github.com/harttle/liquidjs/issues/163) ([d5e7b04](https://github.com/harttle/liquidjs/commit/d5e7b04))
2019-10-26 16:11:59 +00:00
Jun Yang d5e7b047bb feat: Support for the "render" tag #163 2019-10-27 00:06:16 +08:00
harttle b82fa9ed2b pref: remove await/async from internal async calls 2019-10-26 08:57:33 -05:00
harttle d4ad4b8a8c docs: add .nojekyll 2019-10-24 19:30:46 +08:00
harttle ab8db5394b docs: fix some typos for the website demos 2019-10-20 22:57:28 +08:00
harttle b02a227a81 docs: add home page for API doc 2019-10-20 22:53:29 +08:00
harttle 41a33834e7 docs: add related packages in README 2019-10-19 17:30:49 +08:00
harttle 53e7ea51bd chore: upgrade sinon 2019-10-14 14:56:58 +08:00
harttle ef3e520628 docs: update typedoc 2019-10-14 12:38:18 +08:00
semantic-release-bot be755a900c chore(release): 9.1.1 [skip ci]
## [9.1.1](https://github.com/harttle/liquidjs/compare/v9.1.0...v9.1.1) (2019-10-10)

### Performance Improvements

* add string flattening to reduce retained memory (node only) ([3ad512c](https://github.com/harttle/liquidjs/commit/3ad512c))
2019-10-10 01:39:53 +00:00
Patrick MalouinandJun Yang 3ad512c51c perf: add string flattening to reduce retained memory (node only)
add a memory footprint benchmark
2019-10-10 09:35:15 +08:00
harttle 7bae5bcb79 docs: add demo for React hooks and context (#150) 2019-10-08 21:50:59 +08:00
harttle 3a7ddaa2c3 chore: set demo packages private 2019-10-08 21:50:32 +08:00
semantic-release-bot 362e2d6451 chore(release): 9.1.0 [skip ci]
# [9.1.0](https://github.com/harttle/liquidjs/compare/v9.0.1...v9.1.0) (2019-10-07)

### Features

* alias getTemplate() to parseFile() ([6b83788](https://github.com/harttle/liquidjs/commit/6b83788))
2019-10-07 15:40:44 +00:00
harttle 6b83788077 feat: alias getTemplate() to parseFile()
* deprecate Liquid#getTemplate: use Liquid#parseFile instead
* deprecate Liquid#getTemplateSync: use Liquid#parseFileSync instead
2019-10-07 23:34:12 +08:00
harttle 4f8fc89c6f docs: update reactjs demo for consistant ES6 style 2019-10-07 22:40:36 +08:00
harttle cc8851e56f doc: add Contribute Guidelines 2019-10-05 11:37:59 +08:00
semantic-release-bot 154deeda76 chore(release): 9.0.1 [skip ci]
## [9.0.1](https://github.com/harttle/liquidjs/compare/v9.0.0...v9.0.1) (2019-10-02)

### Bug Fixes

* `unless` content is not waited, fixes [#160](https://github.com/harttle/liquidjs/issues/160) ([d2c8d13](https://github.com/harttle/liquidjs/commit/d2c8d13))
2019-10-02 14:37:23 +00:00
harttle d2c8d133ff fix: unless content is not waited, fixes #160 2019-10-02 22:30:35 +08:00
Jun YangandGitHub 96d98e4ebb doc: update live demo link, see #157 2019-09-14 21:48:22 +08:00
harttle f661cd8b85 doc: fix underscore prefixed doc files by adding .jekyll 2019-08-27 13:07:21 +08:00
harttle 493c4951e1 doc: update typedoc 2019-08-27 12:17:53 +08:00
harttle d3f3d81e2e doc: update typedoc and README.md 2019-08-26 23:31:53 +08:00
semantic-release-bot c2ba1e1f1a chore(release): 9.0.0 [skip ci]
# [9.0.0](https://github.com/harttle/liquidjs/compare/v8.5.3...v9.0.0) (2019-08-26)

### Bug Fixes

* break/continue omitting output before them, [#123](https://github.com/harttle/liquidjs/issues/123) ([ae45c46](https://github.com/harttle/liquidjs/commit/ae45c46))
* reactjs demo during yarn install, fixes [#145](https://github.com/harttle/liquidjs/issues/145) ([b65df44](https://github.com/harttle/liquidjs/commit/b65df44))

### Code Refactoring

* return value of Tag#render is no longer used ([8028f82](https://github.com/harttle/liquidjs/commit/8028f82))

### Features

* renderSync, parseAndRenderSync and renderFileSync, see [#48](https://github.com/harttle/liquidjs/issues/48) ([7fb01ad](https://github.com/harttle/liquidjs/commit/7fb01ad))

### Performance Improvements

* target to es6, fixes [#137](https://github.com/harttle/liquidjs/issues/137) ([3b9fc7e](https://github.com/harttle/liquidjs/commit/3b9fc7e))

### BREAKING CHANGES

* Tag#render now returns void, use emitter argument
to write rendered html.
* ship to Node.js 8, the dist/liquid.cjs.js (main) nolonger
supports Node.js 6, other bundles are also provided via dist/liquid.esm.js, dist/liquid.js (ES5 umd) and liquid.min.js (minified ES5 umd)
* remove default export, now should be used like import
{Liquid} from 'liquidjs'
2019-08-26 15:21:34 +00:00
allcontributors[bot]andJun Yang 31bec7e66e docs: update .all-contributorsrc 2019-08-26 10:16:07 -05:00
allcontributors[bot]andJun Yang 0b6f86d02a docs: update README.md 2019-08-26 10:16:07 -05:00
harttle 28330e1127 chore: fix benchmark 2019-08-26 10:15:43 -05:00
harttle 0426d08fd0 style: fix linting 2019-08-26 10:15:43 -05:00
harttle 7fb01ad69a feat: renderSync, parseAndRenderSync and renderFileSync, see #48 2019-08-26 10:15:43 -05:00
harttle 8028f82499 refactor: return value of Tag#render is no longer used
BREAKING CHANGE: Tag#render now returns void, use emitter argument
to write rendered html.
2019-08-26 10:15:43 -05:00
harttle 76019e9e18 refactor: rewrite expression evaluation, fix #130 2019-08-26 10:15:43 -05:00
semantic-release-botandJun Yang 538610e169 chore(release): 8.5.1 [skip ci]
## [8.5.1](https://github.com/harttle/liquidjs/compare/v8.5.0...v8.5.1) (2019-08-05)

### Bug Fixes

* publish bin directory to npm, fixes [#146](https://github.com/harttle/liquidjs/issues/146) ([a85b650](https://github.com/harttle/liquidjs/commit/a85b650))
2019-08-26 10:15:43 -05:00
harttle b65df447dc fix: reactjs demo during yarn install, fixes #145
simply remove unused dependencies fixes this issue, but I removed
all package-lock.json / yarn.lock since the demo should always be
in sync with the codebase
2019-08-26 10:15:43 -05:00
harttle 3b9fc7e6bf perf: target to es6, fixes #137
BREAKING CHANGE: ship to Node.js 8, the dist/liquid.cjs.js (main) nolonger
supports Node.js 6, other bundles are also provided via dist/liquid.esm.js, dist/liquid.js (ES5 umd) and liquid.min.js (minified ES5 umd)
2019-08-26 10:15:43 -05:00
harttle f35ab6b72e doc: update README and typedoc 2019-08-26 10:15:43 -05:00
harttle ab3b824cf8 style: fix linting 2019-08-26 10:15:43 -05:00
harttle ae45c4622e fix: break/continue omitting output before them, #123
BREAKING CHANGE: remove default export, now should be used like import
{Liquid} from 'liquidjs'
2019-08-26 10:15:43 -05:00
harttle 854e12ba53 refactor: add emitter for code generation 2019-08-26 10:15:43 -05:00
semantic-release-bot ad8e2f7e63 chore(release): 8.5.3 [skip ci]
## [8.5.3](https://github.com/harttle/liquidjs/compare/v8.5.2...v8.5.3) (2019-08-25)

### Bug Fixes

* escape filter when input is undefined ([a00945c](https://github.com/harttle/liquidjs/commit/a00945c))
2019-08-25 09:23:56 +00:00
jamelaitandJun Yang e17bc97d8e fix escape filter with stringify 2019-08-25 04:19:37 -05:00
Jamel AandJun Yang aa15f3dfe1 fixing lint errors 2019-08-25 04:19:37 -05:00
jamelaitandJun Yang a00945cad7 fix: escape filter when input is undefined 2019-08-25 04:19:37 -05:00
allcontributors[bot]andJun Yang 0f4e6d9981 docs: update .all-contributorsrc 2019-08-12 01:54:55 -05:00
allcontributors[bot]andJun Yang db5de49f5e docs: update README.md 2019-08-12 01:54:55 -05:00
semantic-release-bot d50fd1df35 chore(release): 8.5.2 [skip ci]
## [8.5.2](https://github.com/harttle/liquidjs/compare/v8.5.1...v8.5.2) (2019-08-09)

### Bug Fixes

* quotation tokenizing, [#151](https://github.com/harttle/liquidjs/issues/151) ([1e4f237](https://github.com/harttle/liquidjs/commit/1e4f237))
2019-08-09 17:29:27 +00:00
Jun Yang 1e4f237022 fix: quotation tokenizing, #151 2019-08-10 01:24:36 +08:00
Joonas MertanenandJun Yang 9956c53b09 Correctly tokenize quotation marks within single token 2019-08-08 08:08:18 -05:00
Joonas MertanenandJun Yang af841dc872 Add test for property access syntax 2019-08-08 08:08:18 -05:00
Jun YangandGitHub 0408ae7f53 Update README.md 2019-08-06 10:56:03 +08:00
semantic-release-bot 3cf35fd58e chore(release): 8.5.1 [skip ci]
## [8.5.1](https://github.com/harttle/liquidjs/compare/v8.5.0...v8.5.1) (2019-08-05)

### Bug Fixes

* publish bin directory to npm, fixes [#146](https://github.com/harttle/liquidjs/issues/146) ([a85b650](https://github.com/harttle/liquidjs/commit/a85b650))
2019-08-05 17:58:55 +00:00
harttle 58f546ff80 doc: fix doc files with underscores 2019-08-06 01:52:50 +08:00
harttle a85b650ab2 fix: publish bin directory to npm, fixes #146 2019-08-06 01:48:12 +08:00
Jun YangandGitHub d487a2d3ea Create FUNDING.yml 2019-08-06 01:40:34 +08:00
harttle 0b543817ff doc: introduce typedoc and sponsorship, for #126 2019-08-06 01:36:34 +08:00
azuandJun Yang 0d52d570fc docs: fix link in README 2019-08-05 00:23:48 -05:00
semantic-release-bot c354164352 chore(release): 8.5.0 [skip ci]
# [8.5.0](https://github.com/harttle/liquidjs/compare/v8.4.1...v8.5.0) (2019-08-01)

### Features

* CLI support ([fc045b5](https://github.com/harttle/liquidjs/commit/fc045b5))
2019-08-01 05:20:02 +00:00
harttle fc045b5bbc feat: CLI support
echo '{{ "hello" | capitalize }}' | liquidjs
2019-08-01 13:15:55 +08:00
Robin BijlaniandJun Yang c8c6dd8275 Fix: Stringify append and prepend values 2019-07-25 13:12:07 +08:00
semantic-release-bot 49c45a463b chore(release): 8.4.1 [skip ci]
## [8.4.1](https://github.com/harttle/liquidjs/compare/v8.4.0...v8.4.1) (2019-07-22)

### Bug Fixes

* some filters on undefined variable throws, [#140](https://github.com/harttle/liquidjs/issues/140) ([6e6ea0a](https://github.com/harttle/liquidjs/commit/6e6ea0a))
2019-07-22 08:52:48 +00:00
harttle cef5d1aa1a chore: remove support for node_js 6 2019-07-22 16:48:48 +08:00
harttle 6e6ea0ae58 fix: some filters on undefined variable throws, #140 2019-07-22 16:48:48 +08:00
harttle dc9a6e019e doc: make the purpose clear #139 , add plugin list 2019-07-22 02:04:53 +08:00
semantic-release-bot 5adebaa710 chore(release): 8.4.0 [skip ci]
# [8.4.0](https://github.com/harttle/liquidjs/compare/v8.3.0...v8.4.0) (2019-07-06)

### Features

* at_least, at_most, sort_naturual for [#132](https://github.com/harttle/liquidjs/issues/132) ([e6f5f1c](https://github.com/harttle/liquidjs/commit/e6f5f1c))
2019-07-06 06:54:15 +00:00
harttle 34d5af25a4 chore: trying to fix TS4053 2019-07-06 14:49:39 +08:00
harttle 88c89fe3b3 style: introduce @typescript-eslint/recommended 2019-07-06 14:33:34 +08:00
harttle e6f5f1cd85 feat: at_least, at_most, sort_naturual for #132 2019-07-05 12:09:00 +08:00
semantic-release-bot 570400ebcc chore(release): 8.3.0 [skip ci]
# [8.3.0](https://github.com/harttle/liquidjs/compare/v8.2.4...v8.3.0) (2019-06-27)

### Features

* fs option implemented by [#138](https://github.com/harttle/liquidjs/issues/138) ([3f5e23c](https://github.com/harttle/liquidjs/commit/3f5e23c))
2019-06-27 01:47:56 +00:00
Jun Yang 3f5e23c42b feat: fs option implemented by #138 2019-06-27 09:42:29 +08:00
Jun Yang 96c061bee0 style: remove semi 2019-06-27 09:32:51 +08:00
Patrick MalouinandJun Yang edb2cc1f37 Expose fs as an option to override the default implementations 2019-06-27 09:25:17 +08:00
harttle 2ae8c37a4f chore: add @semantic-release/github for notify 2019-06-17 17:24:07 +08:00
semantic-release-bot 0bc5908f17 chore(release): 8.2.4 [skip ci]
## [8.2.4](https://github.com/harttle/liquidjs/compare/v8.2.3...v8.2.4) (2019-06-17)

### Performance Improvements

* improve getTemplate() when cache is enabled ([1ffba2b](https://github.com/harttle/liquidjs/commit/1ffba2b))
2019-06-17 03:10:34 +00:00
Patrick MalouinandJun Yang 1ffba2bc76 perf: improve getTemplate() when cache is enabled
Checking for file existence is unnecessary when cache contains entry.
2019-06-17 11:01:02 +08:00
semantic-release-bot bbebb5515c chore(release): 8.2.3 [skip ci]
## [8.2.3](https://github.com/harttle/liquidjs/compare/v8.2.2...v8.2.3) (2019-05-19)

### Bug Fixes

* reverse filter not pure, see [#126](https://github.com/harttle/liquidjs/issues/126) ([505c408](https://github.com/harttle/liquidjs/commit/505c408))
2019-05-19 06:10:34 +00:00
Jun Yang b14430a161 style: test/integration/builtin/filters/array.ts 2019-05-19 14:05:28 +08:00
Jun Yang 505c408a85 fix: reverse filter not pure, see #126 2019-05-19 13:58:11 +08:00
Jun Yang 224679a7d7 chore: speedup unit test on windows 2019-05-19 13:00:51 +08:00
semantic-release-bot 2cb4bffd3e chore(release): 8.2.2 [skip ci]
## [8.2.2](https://github.com/harttle/liquidjs/compare/v8.2.1...v8.2.2) (2019-05-12)

### Bug Fixes

* date from integer, [#125](https://github.com/harttle/liquidjs/issues/125) ([fdf0043](https://github.com/harttle/liquidjs/commit/fdf0043))
* pass drops directly to filters/tags ([bef2909](https://github.com/harttle/liquidjs/commit/bef2909))
2019-05-12 15:02:33 +00:00
harttle c940e6c997 chore: try to make unit test locale independent 2019-05-12 22:58:29 +08:00
harttle d8ba009773 chore: fix building 2019-05-12 21:29:58 +08:00
harttle fdf0043b9c fix: date from integer, #125 2019-05-12 21:03:35 +08:00
harttle bef290923c fix: pass drops directly to filters/tags 2019-05-12 20:03:32 +08:00
semantic-release-bot 4282accaa2 chore(release): 8.2.1 [skip ci]
## [8.2.1](https://github.com/harttle/liquidjs/compare/v8.2.0...v8.2.1) (2019-04-26)

### Bug Fixes

* `default` filter is not working with an empty string, [#122](https://github.com/harttle/liquidjs/issues/122) ([6075c0a](https://github.com/harttle/liquidjs/commit/6075c0a))
2019-04-26 16:32:20 +00:00
harttle 6075c0a54f fix: default filter is not working with an empty string, #122 2019-04-27 00:26:17 +08:00
semantic-release-bot 87489f6098 chore(release): 8.2.0 [skip ci]
# [8.2.0](https://github.com/harttle/liquidjs/compare/v8.1.0...v8.2.0) (2019-04-17)

### Features

* pass context to filters ([00bc1ef](https://github.com/harttle/liquidjs/commit/00bc1ef))
2019-04-17 02:51:13 +00:00
harttle 6c5dc336e7 chore: fix linting, working on #120 2019-04-17 10:45:02 +08:00
harttle 00bc1efe6a feat: pass context to filters 2019-04-17 10:24:55 +08:00
harttle 6fb4796202 chore: set outDir to dist, see #119 2019-04-16 11:23:29 +08:00
semantic-release-bot 7483613b23 chore(release): 8.1.0 [skip ci]
# [8.1.0](https://github.com/harttle/liquidjs/compare/v8.0.3...v8.1.0) (2019-04-02)

### Features

* where filter, working on [#118](https://github.com/harttle/liquidjs/issues/118) ([daa0b57](https://github.com/harttle/liquidjs/commit/daa0b57))
2019-04-02 04:55:18 +00:00
harttle 7762dd9612 chore: fix linting 2019-04-02 12:10:35 +08:00
Jun Yang daa0b574fc feat: where filter, working on #118
doc: https://shopify.github.io/liquid/filters/where/
ruby impl: https://github.com/Shopify/liquid/blob/14cd011cb5eef042af192ad5294c8f0e1ae89f06/lib/liquid/standardfilters.rb
2019-04-02 00:46:32 +08:00
semantic-release-bot a084183246 chore(release): 8.0.3 [skip ci]
## [8.0.3](https://github.com/harttle/liquidjs/compare/v8.0.2...v8.0.3) (2019-04-01)

### Bug Fixes

* slice filter on negative `begin`, [#117](https://github.com/harttle/liquidjs/issues/117) ([eadb6f3](https://github.com/harttle/liquidjs/commit/eadb6f3))
2019-04-01 03:04:24 +00:00
harttle eadb6f3711 fix: slice filter on negative begin, #117 2019-04-01 10:57:08 +08:00
semantic-release-bot dba26f24e6 chore(release): 8.0.2 [skip ci]
## [8.0.2](https://github.com/harttle/liquidjs/compare/v8.0.1...v8.0.2) (2019-03-25)

### Performance Improvements

* use polymophism instead duck test ([82d7673](https://github.com/harttle/liquidjs/commit/82d7673))
2019-03-25 15:15:04 +00:00
Jun Yang 722da6a7ee doc: update README 2019-03-25 23:01:04 +08:00
harttle 82d7673554 perf: use polymophism instead duck test 2019-03-25 20:11:23 +08:00
harttle 64dd057552 refactor: Context#propertyAccessSeq => parseProp 2019-03-25 10:36:23 +08:00
harttle 45e3c2bb8e refactor: switch Context <-> Scope concepts 2019-03-25 10:36:23 +08:00
Jun Yang 76345a64c3 doc: update README.md 2019-03-23 22:28:33 +08:00
semantic-release-bot 9e69652655 chore(release): 8.0.1 [skip ci]
## [8.0.1](https://github.com/harttle/liquidjs/compare/v8.0.0...v8.0.1) (2019-03-22)

### Bug Fixes

* incorrect scope when using assign with for, fixes [#115](https://github.com/harttle/liquidjs/issues/115) ([defbb58](https://github.com/harttle/liquidjs/commit/defbb58))
2019-03-22 12:48:41 +00:00
harttle defbb58e66 fix: incorrect scope when using assign with for, fixes #115
* remove AssignScope, CaptureScope, IncrementScope, DecrementScope concepts
* introduce Scope.environments for decrement/increment
* assign to scopes[0] for assign/capture
2019-03-22 20:38:54 +08:00
ssendevandJun Yang b7b92c63cf async Register Tags example 2019-03-21 20:46:21 +08:00
ssendevandJun Yang 265534b7b7 Fix Register Tags example 2019-03-21 20:46:21 +08:00
semantic-release-bot 84ea2c7488 chore(release): 8.0.0 [skip ci]
# [8.0.0](https://github.com/harttle/liquidjs/compare/v7.5.1...v8.0.0) (2019-03-10)

### Code Refactoring

* use camelCase for JavaScript APIs ([64e0c87](https://github.com/harttle/liquidjs/commit/64e0c87))

### Features

* promise support for drops, working on [#65](https://github.com/harttle/liquidjs/issues/65) ([4a8088d](https://github.com/harttle/liquidjs/commit/4a8088d))

### BREAKING CHANGES

* Options and method names in JavaScript API are now renamed to cammelCase, for a complete list see #109
2019-03-10 11:28:39 +00:00
Jun Yang 64e0c876e9 refactor: use camelCase for JavaScript APIs
BREAKING CHANGE: Options and method names in JavaScript API are now renamed to cammelCase, for a complete list see #109
2019-03-10 19:21:09 +08:00
Jun Yang 4a8088d4e4 feat: promise support for drops, working on #65 2019-03-10 18:05:52 +08:00
harttle ad0930f152 test: cover parseFilters in template/value.ts 2019-03-06 01:46:35 +08:00
harttle 998832c772 refactor: mv custom filter test 2019-03-06 01:40:31 +08:00
semantic-release-bot 4ba224043b chore(release): 7.5.1 [skip ci]
## [7.5.1](https://github.com/harttle/liquidjs/compare/v7.5.0...v7.5.1) (2019-03-05)

### Bug Fixes

* named params for filters, working on [#113](https://github.com/harttle/liquidjs/issues/113) ([5ffc904](https://github.com/harttle/liquidjs/commit/5ffc904))
2019-03-05 17:39:56 +00:00
harttle 5ffc904f80 fix: named params for filters, working on #113 2019-03-06 01:30:47 +08:00
semantic-release-bot 08646f75b0 chore(release): 7.5.0 [skip ci]
# [7.5.0](https://github.com/harttle/liquidjs/compare/v7.4.0...v7.5.0) (2019-03-01)

### Features

* tablerowloop object ([3647305](https://github.com/harttle/liquidjs/commit/3647305))
2019-03-01 22:06:31 +00:00
Jun Yang 3647305dcf feat: tablerowloop object
See: https://www.rubydoc.info/gems/liquid/Liquid/TablerowloopDrop
2019-03-02 06:00:30 +08:00
Jun Yang cca0306f5b chore: fix mocha pattern for windows
See: https://github.com/mochajs/mocha/issues/2895
2019-03-02 03:57:38 +08:00
Jun Yang eeeacc4492 chore: fix rollup.config.ts 2019-03-02 03:42:57 +08:00
Jun Yang d44e1d727a chore: fix test on windows 10 2019-03-02 03:36:33 +08:00
semantic-release-bot f960904df4 chore(release): 7.4.0 [skip ci]
# [7.4.0](https://github.com/harttle/liquidjs/compare/v7.3.1...v7.4.0) (2019-02-28)

### Bug Fixes

* math filters now return number, resolves [#110](https://github.com/harttle/liquidjs/issues/110) ([b4acdb4](https://github.com/harttle/liquidjs/commit/b4acdb4))

### Features

* exported Drop interface for [#107](https://github.com/harttle/liquidjs/issues/107) ([7bee9fc](https://github.com/harttle/liquidjs/commit/7bee9fc)), closes [#109](https://github.com/harttle/liquidjs/issues/109)
2019-02-28 05:13:55 +00:00
harttle b4acdb463a fix: math filters now return number, resolves #110
* fix linting
* numbers are no longer fixed:
    i.e. {{0.3 | minus 0.1}} now renders as 0.19999
    Stick to JavaScript number behavior, see: 8.0.0
2019-02-28 13:02:51 +08:00
harttle 21d674e22b chore: fix benchmark npm script 2019-02-28 00:05:37 +08:00
harttle 7bee9fc92d feat: exported Drop interface for #107
Deprecate snake_cased options and APIs, sed #109
2019-02-28 00:05:08 +08:00
harttle b69c3a3203 refactor: IDrop interface => abstract method 2019-02-28 00:05:08 +08:00
harttle d5b9916b2f refactor: Drop.prototype.value => valueOf 2019-02-28 00:05:08 +08:00
semantic-release-bot d0118402e4 chore(release): 7.3.1 [skip ci]
## [7.3.1](https://github.com/harttle/liquidjs/compare/v7.3.0...v7.3.1) (2019-02-25)

### Bug Fixes

* **#108:** remove absolute path in emitted d.ts ([53a835a](https://github.com/harttle/liquidjs/commit/53a835a)), closes [#108](https://github.com/harttle/liquidjs/issues/108)
2019-02-25 17:03:07 +00:00
harttle 31bc71d472 chore: fix linting 2019-02-26 00:56:12 +08:00
harttle 53a835ab54 fix(#108): remove absolute path in emitted d.ts 2019-02-26 00:43:30 +08:00
harttle 75b3e15ca9 chore: fix rollup.config.ts types 2019-02-25 00:12:31 +08:00
harttle f34573ee21 chore: stick with es6 for testing 2019-02-24 23:42:44 +08:00
harttle 875f71d5f2 chore: a simple liquid_method_missing case for #97 2019-02-24 23:08:53 +08:00
harttle 407ac6d0a4 refactor: remove /dist from repo 2019-02-24 23:03:12 +08:00
semantic-release-bot f9f35ebd6c chore(release): 7.3.0 [skip ci]
# [7.3.0](https://github.com/harttle/liquidjs/compare/v7.2.2...v7.3.0) (2019-02-24)

### Features

* nil/null/empty/blank literals, resolves [#102](https://github.com/harttle/liquidjs/issues/102) ([88c9e96](https://github.com/harttle/liquidjs/commit/88c9e96))
2019-02-24 13:55:31 +00:00
harttle 88c9e96392 feat: nil/null/empty/blank literals, resolves #102 2019-02-24 21:50:01 +08:00
semantic-release-bot 54b2adce12 chore(release): 7.2.2 [skip ci]
## [7.2.2](https://github.com/harttle/liquidjs/compare/v7.2.1...v7.2.2) (2019-02-23)

### Bug Fixes

* filters break when argument contains [()|, fixes [#89](https://github.com/harttle/liquidjs/issues/89) ([e977669](https://github.com/harttle/liquidjs/commit/e977669))
2019-02-23 22:32:04 +00:00
harttle 542968e133 refactor: remove unused lexical regexps 2019-02-24 06:26:33 +08:00
harttle 3b7351d9a0 chore: fix linting 2019-02-24 05:03:59 +08:00
harttle e977669118 fix: filters break when argument contains [()|, fixes #89 2019-02-24 04:48:42 +08:00
harttle 279458c670 test: add benchmark 2019-02-23 21:57:02 +08:00
semantic-release-bot 37d12a14eb chore(release): 7.2.1 [skip ci]
## [7.2.1](https://github.com/harttle/liquidjs/compare/v7.2.0...v7.2.1) (2019-02-22)

### Bug Fixes

* default length for truncate and truncatewords ([56c7992](https://github.com/harttle/liquidjs/commit/56c7992))
2019-02-22 19:56:16 +00:00
harttle 3cf01603e8 chore: fix linting 2019-02-23 03:50:45 +08:00
harttle 56c7992b76 fix: default length for truncate and truncatewords 2019-02-23 03:11:07 +08:00
harttle 5b6100d12b refactor: strictly typed 2019-02-23 00:49:54 +08:00
Jun YangandGitHub 51f7e66f60 Update CHANGELOG.md 2019-02-21 01:19:25 +08:00
Jun YangandGitHub 952ab6e73b Update CHANGELOG.md 2019-02-21 01:16:32 +08:00
semantic-release-bot 4171b2e023 chore(release): 7.2.0 [skip ci]
# [7.2.0](https://github.com/harttle/liquidjs/compare/v7.1.0...v7.2.0) (2019-02-20)

### Features

* override output/tag delimiter, fixes [#54](https://github.com/harttle/liquidjs/issues/54) ([d20a043](https://github.com/harttle/liquidjs/commit/d20a043))
2019-02-20 17:12:01 +00:00
harttle d20a043fbb feat: override output/tag delimiter, fixes #54 2019-02-21 01:07:32 +08:00
harttle 3dbab238ae BREAKING CHANGE: trim_value_* -> trim_output_* 2019-02-21 01:07:32 +08:00
semantic-release-bot d7d00421e2 chore(release): 7.1.0 [skip ci]
# [7.1.0](https://github.com/harttle/liquidjs/compare/v7.0.2...v7.1.0) (2019-02-20)

### Features

* throw an Error if delimiter not matched ([c33d8f6](https://github.com/harttle/liquidjs/commit/c33d8f6))
2019-02-20 14:45:44 +00:00
harttle c33d8f6828 feat: throw an Error if delimiter not matched 2019-02-20 22:40:09 +08:00
harttle c13a16fdd6 7.0.2 2019-02-20 10:02:10 +08:00
harttle 4bd35de867 chore: use white list to publish npm 2019-02-20 10:01:09 +08:00
harttle 29f53304bc 7.0.1 2019-02-19 23:55:38 +08:00
harttle cbebb00ef1 fix: unit test on Node.js 6 2019-02-19 23:25:08 +08:00
harttle 64a9eb79c5 style: fix unused vars in unit test 2019-02-19 23:01:59 +08:00
harttle 852c6ad453 refactor: remove mock-fs from dev dependency 2019-02-19 22:28:27 +08:00
harttle f432aade6a chore(TypeScript): remove mock-fs 2019-02-17 21:37:13 +08:00
harttle aa49b4f117 chore(TypeScript): fix unit tests and coverage 2019-02-17 20:46:33 +08:00
harttle fc9ebdb90f chore(TypeScript): fix linting and generate .d.ts 2019-02-17 18:20:04 +08:00
harttle 7ee87008c7 chore(TypeScript): demo for typescript 2019-02-17 14:22:13 +08:00
harttle 677e8511e6 chore(TypeScript): refactor objects into classes
fix: `Nil`(null, undefined) now renders as empty string
change: `parser.parseValue()` renamed to `parser.parseOutput`
change: registered tags/filters become static and shared across different liquid instances
2019-02-17 04:55:30 +08:00
semantic-release-bot b51b0dabca chore(release): 7.0.0 [skip ci]
# [7.0.0](https://github.com/harttle/liquidjs/compare/v6.4.3...v7.0.0) (2019-02-14)

### chore

* **TypeScript:** ship Liquid to class ([1cc7249](https://github.com/harttle/liquidjs/commit/1cc7249))

### BREAKING CHANGES

* **TypeScript:** calling `Liquid()` without `new` now becomes invalid
2019-02-14 16:02:23 +00:00
harttle 1cc7249a71 chore(TypeScript): ship Liquid to class
BREAKING CHANGE: calling `Liquid()` without `new` now becomes invalid
2019-02-14 23:53:40 +08:00
harttle a626de632c chore(CI): remove node_js 4 2019-02-14 23:15:29 +08:00
harttle 83a8e2d310 chore(CI): skip unit test on node_js 4 2019-02-14 23:11:13 +08:00
harttle c37b330751 chore(typescript): ship to TypeScript 2019-02-14 22:33:45 +08:00
semantic-release-bot c8de8bcde2 chore(release): 6.4.3 [skip ci]
## [6.4.3](https://github.com/harttle/liquidjs/compare/v6.4.2...v6.4.3) (2019-02-13)

### Bug Fixes

* better index.d.ts and a demo ([2015f68](https://github.com/harttle/liquidjs/commit/2015f68)), closes [#98](https://github.com/harttle/liquidjs/issues/98)
2019-02-13 12:13:27 +00:00
harttle 2015f683b8 fix: better index.d.ts and a demo
The demo is located at demo/typescript/index.ts , working on #98
2019-02-13 20:07:13 +08:00
semantic-release-bot d14f18520b chore(release): 6.4.2 [skip ci]
## [6.4.2](https://github.com/harttle/liquidjs/compare/v6.4.1...v6.4.2) (2019-01-28)

### Bug Fixes

* **CI:** e2e not building cjs ([dde7b3b](https://github.com/harttle/liquidjs/commit/dde7b3b))
2019-01-28 17:34:02 +00:00
Jun Yang c0524a83f3 chore: remove build from e2e, check es5 after published 2019-01-29 01:28:02 +08:00
Jun Yang dde7b3b389 fix(CI): e2e not building cjs 2019-01-29 01:08:52 +08:00
semantic-release-bot 84bbb3432f chore(release): 6.4.1 [skip ci]
## [6.4.1](https://github.com/harttle/liquidjs/compare/v6.4.0...v6.4.1) (2019-01-28)

### Bug Fixes

* regenerator undefined ([a2caeb5](https://github.com/harttle/liquidjs/commit/a2caeb5))
2019-01-28 16:44:56 +00:00
Jun Yang 1c5b934250 chore(CI): update package-lock.json 2019-01-29 00:39:19 +08:00
Jun Yang a2caeb559b fix: regenerator undefined 2019-01-29 00:26:08 +08:00
harttle 81e6861b73 chore(Changelog): add semantic release plugins 2019-01-28 20:33:33 +08:00
harttle 9038d56ce7 chore(Changelog): add @semantic-release/changelog as dev dependency 2019-01-28 20:26:50 +08:00
harttle bad72005fe chore(CI): add @semantic-release/changelog plugin
working on #100
2019-01-28 20:21:16 +08:00
harttle 4dffb27e95 feat(Drop): liquid_method_missing and to_s
close #97
2019-01-28 19:53:04 +08:00
harttle f38ea63c14 chore(CI): mv lint and covereage to test phase 2019-01-28 18:57:25 +08:00
harttle 57bdf17dea chore(CI): downgrade rollup-plugin-babel 2019-01-28 18:46:41 +08:00
harttle 0040485188 chore(CI): skip_cleanup for node_modules 2019-01-28 18:22:20 +08:00
harttle 42d799055a chore(CI): use nodejs_8 for linting 2019-01-28 18:11:25 +08:00
harttle 8a881ac69a style: align to [email protected] 2019-01-28 18:06:47 +08:00
harttle 7a2e036c79 chore(package): update package-lock.json 2019-01-28 17:30:34 +08:00
harttle a31e0c6275 chore(CI): test use build matrix 2019-01-28 17:27:00 +08:00
harttle 7df4d5d62c chore(CI): adjust build matrix 2019-01-28 16:29:59 +08:00
harttle 22b7e55fc9 chore(CI): assign node_js for each script 2019-01-28 15:40:32 +08:00
harttle 0238cf2c44 fix(CI): scirpt for the first stage not defined 2019-01-28 15:26:40 +08:00
harttle 601f2e48fc chore(CI): enable semantic release 2019-01-28 15:18:21 +08:00
harttle 8cb0137362 6.3.0 2019-01-21 15:25:11 +08:00
harttle dee4303fad feature: plugin API, working on #86 2019-01-21 15:24:13 +08:00
harttle 9ba352ef04 6.2.1 2019-01-21 14:54:07 +08:00
harttle 4793a83bd6 fix #101: Slice filter does not work on arrays 2019-01-21 14:52:08 +08:00
harttle af4fe1b330 6.2.0 2019-01-10 13:30:05 +08:00
harttle 5f5c62a51e fix banner link 2019-01-10 13:29:39 +08:00
oott123andJun Yang 21f4d6bf08 export types variable 2019-01-10 13:28:13 +08:00
oott123andJun Yang ba54bec82f feat: add typescript definitions 2019-01-10 13:28:13 +08:00
Jun Yang c2e1bc7055 6.1.1 2018-11-22 09:36:18 +08:00
Andrew BarclayandJun Yang 2055258193 fix assign tag regex to include linebreaks in value 2018-11-22 09:31:22 +08:00
harttle d65ea14b9f 6.1.0 2018-10-14 00:53:43 +08:00
steven anthonyandJun Yang f1b4c4fe14 Added react-liquidjs-demo 2018-10-10 19:59:43 +08:00
harttle 6af631b77b feature: url_decode, working on #94 2018-10-08 10:37:24 +08:00
Jun Yang d504c8107e 6.0.1 2018-10-06 12:20:13 +08:00
Jun Yang c0181aec31 remove dependency from 'util' 2018-10-01 23:08:39 +08:00
Jun Yang 22a7a85d50 test case for Regexp rendering 2018-10-01 23:00:49 +08:00
Jun Yang 044be8253d fixes #91 2018-10-01 22:51:40 +08:00
Jun Yang 8a629980d9 refactor: move fs util into template.js 2018-10-01 22:06:03 +08:00
harttle 5412c5a39f fixes #88 2018-09-29 16:45:11 +08:00
harttle b7445f26d6 6.0.0 2018-08-28 00:37:00 +08:00
harttle 3213c6d23a fix: ci 2018-08-28 00:27:44 +08:00
harttle 829afc24a7 fix: ci 2018-08-28 00:17:26 +08:00
harttle 0049a56864 fix: ci 2018-08-28 00:05:50 +08:00
harttle f8e0587542 fix: ci 2018-08-27 23:54:43 +08:00
harttle c3c57a560b fix: travis 2018-08-27 23:49:11 +08:00
harttle 5378f2709b test: cover all 2018-08-27 23:27:42 +08:00
harttle d6876bd9ec refactor: bundle template.js respectively 2018-08-27 21:37:39 +08:00
harttle 31c39561c9 feature: get nyc, babel and coveralls working 2018-08-26 21:54:35 +08:00
harttle d828c4021e fix: unit test on node6.x 2018-08-21 01:21:30 +08:00
harttle 4d4a2d04ec refactor 2018-08-21 01:18:13 +08:00
harttle bc9d8f92af refactor: import rollup 2018-08-20 23:58:41 +08:00
harttle 4ece4e208f 5.3.0-0 2018-08-17 01:34:57 +08:00
harttle 4ad3d2a52b modified: .eslintignore 2018-08-17 01:34:07 +08:00
harttle fa7cd8f4ff refactor: import babelify 2018-08-17 01:32:16 +08:00
harttle 87360d5207 refactor: mv es5 files to build/ 2018-08-16 23:20:13 +08:00
harttle 19891b2df0 refactor: es6 building and linting 2018-08-16 23:14:12 +08:00
harttle 5f634b0b5e refactor: moving all ES6 files to src/, working on #83 2018-08-16 00:22:46 +08:00
harttle 9f597843c9 5.2.0 2018-08-14 00:12:42 +08:00
harttle 887b736f39 test cases for stringify 2018-08-14 00:11:50 +08:00
harttle 7a3689067b feature: support toLiquid, working on #81 2018-08-14 00:11:50 +08:00
harttle 5b43520d78 feature: variable lookup respects to to_liquid, #81 2018-08-14 00:11:50 +08:00
harttle ea38a9e1f5 refactor: test/render.js use local scope 2018-08-14 00:11:50 +08:00
harttle fa5b731daf fix string type checking and circular reference, working on #81 2018-08-14 00:11:50 +08:00
harttle 96829b5293 fix: express demo, fixes #79 2018-07-25 21:51:42 +08:00
harttle 4cf7215a67 5.1.1 2018-07-24 19:39:12 +08:00
harttle 50006db26d fix: test/util/strftime.js 2018-07-24 19:38:47 +08:00
harttle 2d81223d99 update outdated packages 2018-07-24 19:37:21 +08:00
harttle 3038115c21 5.1.0 2018-07-24 14:53:47 +08:00
harttle fdbf4b838a add package.lock 2018-07-24 14:53:28 +08:00
harttle 7ab0e96419 feature: template string for {%include%} argument, #72 2018-07-24 14:49:23 +08:00
harttle 48484fe52f 5.0.2 2018-07-21 23:42:18 +08:00
harttle 14d1956232 test case for _.forOwn 2018-07-21 23:23:25 +08:00
harttle c3e7859cdd fix: increment/decrement independent from capture, #76 2018-07-21 23:19:28 +08:00
harttle c3de3fbb19 fix: post-increment, pre-decrement working on #76 2018-07-21 22:59:52 +08:00
harttle b5cfd2d2c5 fix: {%assign%} now adds a shading scope 2018-07-21 21:30:40 +08:00
harttle 36f84e4b3c refactor: pop the same context as the pushed one 2018-07-21 17:12:46 +08:00
harttle 63b5658604 refactor: src/scope.js 2018-07-21 17:02:18 +08:00
Ryan KennedyandJun Yang c79700ef1a fix: correctly understand variables with question marks
Fixes #77
2018-07-18 10:15:43 +08:00
harttle 6755462056 5.0.1 2018-07-16 15:04:40 +08:00
harttle 02806b2257 fix #75 2018-07-16 15:02:31 +08:00
harttle d0fb5ccece 5.0.0 2018-07-16 13:41:57 +08:00
harttle b7144f9b75 fix: linting 2018-07-07 01:22:40 +08:00
harttle 88fc05732f fix: tablerow cols defaults to 0, #74 2018-07-07 01:18:11 +08:00
Jun Yang 44b1aac096 remove any-promise, working on #73 2018-06-23 21:55:23 +08:00
Jun Yang 42043b6944 4.0.0 2018-05-12 23:10:36 +08:00
Jun Yang 61f146432d fix #59, divide numbers as it is 2018-05-12 22:58:43 +08:00
Jun Yang 220b705b73 3.1.3 2018-05-12 22:06:35 +08:00
Jun Yang ef85bd9192 fix #67: forloop.last, forloop.rindex, forloop.rindex0 incorrect if loop has a limit 2018-05-12 22:05:16 +08:00
Paul Robert LloydandJun Yang 8e9e10fdb4 Ensure strip_html filter uses same regex as Ruby Liquid 2018-05-09 10:41:25 +08:00
Jun Yang f668a5cc41 3.1.2 2018-04-07 19:49:46 +08:00
Jun Yang 098f5164e7 fix: linting 2018-04-07 19:48:46 +08:00
Jun Yang 432f878bb6 fix: support comma-separated arguments for static partials, fixes #62 2018-04-07 19:45:57 +08:00
Cory MawhorterandJun Yang aa54dad36e fix dupe name bug 2018-04-07 19:36:50 +08:00
Jun Yang c6ff1f7911 3.1.1 2018-03-05 01:34:00 +08:00
Jun Yang 11355cbf09 refactor: remove makefile 2018-03-05 01:31:12 +08:00
Jun Yang 7ccd0cb1e5 fix: branch coverage 2018-03-05 01:20:43 +08:00
Jun Yang 4326c223f3 fix #61: static filename not parsed for subdirectories 2018-03-05 00:58:26 +08:00
Jun Yang 78b6e35fbf fix: file path asserts for windows 2018-03-03 20:01:24 +08:00
Jun YangandGitHub e275368cb3 Update README.md 2018-01-17 11:01:58 +08:00
Jun YangandGitHub ca2b16a583 Update README.md 2018-01-17 10:48:05 +08:00
Jun YangandGitHub 86d0529a5e Update README.md 2018-01-17 10:47:11 +08:00
Jun YangandGitHub 400b93c88d Update README.md 2018-01-17 10:44:11 +08:00
harttle 22b41fd1a8 3.1.0 2018-01-12 10:55:38 +08:00
ChenLandJun Yang d7c7f32d4b make dist 2018-01-12 10:53:43 +08:00
ChenLandJun Yang 925df9a9b5 100% coverage 2018-01-12 10:53:43 +08:00
ChenLandJun Yang 7b696ed0d2 low version, skip tests 2018-01-12 10:53:43 +08:00
ChenLandJun Yang c55f0234eb Add xhr support for render file in browser. 2018-01-12 10:53:43 +08:00
harttle eee5649a47 fix package.json syntax 2017-12-31 12:32:13 +08:00
harttle 1048f4e0ab add engine spec 2017-12-31 12:29:32 +08:00
harttle 5c6d05092f fix: remove let for nodejs 4.x 2017-12-29 12:33:10 +08:00
harttle 900664a26d test cases for #53 2017-12-29 12:17:52 +08:00
harttle 757a06ee83 fix linting 2017-12-29 12:14:01 +08:00
harttle 9f6e9f2f3f 3.0.0 2017-12-23 21:36:37 +08:00
harttle 0f9adfb067 change: remove deprecated features, coverall 2017-12-23 21:31:55 +08:00
harttle dabde0e9e4 2.2.1 2017-12-23 13:01:28 +08:00
harttle bd4e851b3c update babelify 2017-12-23 12:57:19 +08:00
harttle 1d2aece687 2.2.0 2017-12-21 14:10:42 +08:00
harttle ace271c7f0 feature: support static filepath resolving by options.dynamicPartials,
fix #51
2017-12-21 14:09:30 +08:00
Sami KukkonenandJun Yang 4cbfa6d204 Ignore "fs" module in browser environments 2017-12-21 13:09:21 +08:00
harttle 3153f1d4bb 2.1.4 2017-12-10 01:35:21 +08:00
harttle 9cd4f3d904 modified: README.md 2017-12-10 01:35:06 +08:00
harttle 8dd1b3ba99 2.1.3 2017-12-10 01:26:46 +08:00
harttle 11de73a7b1 update doc 2017-12-10 00:30:13 +08:00
harttle 0325eacddf 2.1.2 2017-12-08 10:42:27 +08:00
harttle a21fcf6f87 fix: compatible to nodejs<=4 2017-12-08 10:42:00 +08:00
harttle 7bb2ee2213 2.1.1 2017-12-08 00:29:09 +08:00
harttle b24582c2c4 remove debug message, working on #50 2017-12-08 00:28:51 +08:00
harttle 49cb7a8c36 2.1.0 2017-12-08 00:25:44 +08:00
harttle a4126e7f10 fix: typo in scope.get("liquid") error message, fixes #50 2017-12-08 00:24:23 +08:00
harttle 5196d6ad56 feature: date filter supports utc string now, fixes #49 2017-12-08 00:22:56 +08:00
harttle 6082bf4757 2.0.3 2017-11-27 00:00:09 +08:00
harttle 8efb41a631 use isTruthy for and/or operators, fixes #47 2017-11-26 23:59:50 +08:00
harttle d348edac14 2.0.2 2017-11-06 00:16:51 +08:00
harttle be00f1d385 feature: treat top-level content as anonymous block, fixes #45 2017-11-06 00:14:33 +08:00
harttle 4e132ca1c5 tags: use scope.opts insteadof scope.get('liquid') 2017-11-04 10:46:15 +08:00
harttle 329aea6bd6 2.0.1 2017-10-31 00:11:35 +08:00
harttle 23e7424f9d change: default extname to "", working for #41 2017-10-31 00:10:45 +08:00
harttle 8241625be4 remove publish from version script 2017-10-30 02:24:08 +08:00
harttle d36ec17621 2.0.0 2017-10-30 02:23:36 +08:00
harttle 485424cc89 feature: concat filter 2017-10-30 02:22:56 +08:00
harttle a239389044 docs for #41 2017-10-30 02:07:07 +08:00
harttle e8fa8d32f5 feature: separate options for value/tag trimming, working on #17 2017-10-30 01:46:31 +08:00
harttle 502426f621 mv whiteSpaceCtrl to a separate file 2017-10-30 00:36:21 +08:00
harttle 8c77fc5a3d fix: whiteSpace Ctrl with compliance to shopify/liquid, working on #17 2017-10-30 00:09:29 +08:00
harttle be17d7443c 1.9.7 2017-10-21 10:50:44 +08:00
Mehdi JafferyandJun Yang 118624ca7d Fix to make for tag iterate objects like Shopify liquid.
Ref: https://github.com/Shopify/liquid/wiki/Liquid-for-Designers#allowed-collection-types
2017-10-18 05:41:43 -05:00
harttle d08ad6dc97 fix: error.stack assertion in v8.5 2017-10-06 12:32:06 +08:00
harttle e22870f5d7 fix: broken unit test by UTC time parsing behaviour change 2017-10-06 12:16:03 +08:00
harttle bd6706cf4d update outdated 2017-10-05 08:32:32 +08:00
harttle b71928ffd4 refactor: format 2017-10-05 08:21:32 +08:00
harttle 6f69cd774d 1.9.6 2017-09-15 10:39:18 +08:00
harttle 1b662d374d update outdated dependencies 2017-09-15 10:38:54 +08:00
harttle 6dd6ed176c 1.9.5 2017-08-26 17:58:14 +08:00
harttle 21af8c4d7a fix read/write variable in parent's scope, fix #39 2017-08-26 17:57:43 +08:00
harttle 942a3224a1 1.9.4 2017-08-16 00:07:47 +08:00
harttle 11259fae62 fix stack matching 2017-08-16 00:04:31 +08:00
harttle 030037eedc cover all 2017-08-15 23:52:05 +08:00
harttle 6d59f34fc8 cover all 2017-08-14 22:43:49 +08:00
harttle 72597c52e5 cover all 2017-08-14 22:07:08 +08:00
harttle 7904f823a8 1.9.3 2017-08-04 11:28:02 +08:00
harttle e993118e87 Merge branch 'jaswrks-patch-1' 2017-08-04 11:27:37 +08:00
harttle 4ae63b2899 test cases for #36 2017-08-04 11:27:12 +08:00
jaswrksandGitHub 9f446ad024 Support {{- and -}} for whitespace control.
With this PR it now matches the intended functionality; i.e., https://github.com/harttle/liquidjs/wiki/Whitespace-Control
2017-08-03 06:06:35 -08:00
harttle 6f82b914cb 1.9.2 2017-08-03 13:56:09 +08:00
harttle 31397a4862 update uglify-js 2017-08-03 13:55:46 +08:00
harttle a2a076d038 refactor access seq parsing 2017-08-03 13:46:00 +08:00
jaswrksandGitHub 3dc37bf980 Bug fix for foo.bar[0].foo that is not working.
Corrects a bug where `foo.bar[0].foo` results in error: 'Cannot read property `foo` of undefined', because the sequence contains an empty string; i.e., `seq.push('')` should be avoided.

Another possible solution would be to strip empty strings from the final `seq` variable, but this PR fixes the immediate problem.
2017-08-02 10:37:11 -08:00
harttle 4ee2bc964c upgrade outdated dependencies 2017-07-28 21:25:24 +08:00
wojtask9andJun Yang ea2a5f5c3b add identation value to token (#34)
* add identation value to token

* fix lint problems

* use var instead of let
2017-07-21 12:44:27 +08:00
harttle 52e2be68ab 1.9.1 2017-07-17 01:09:22 +08:00
harttle cbde48971a rename to liquidjs 2017-07-17 01:08:51 +08:00
harttle e91cc8c950 update: auto publish after version 2017-07-14 10:42:01 +08:00
harttle 314aa6b467 1.9.0 2017-07-14 00:37:08 +08:00
harttle 14e53ed3a9 test cases for #32 2017-07-14 00:34:12 +08:00
harttle cf6d3e78fe Merge branch 'object-for-loop' of https://github.com/aleclarson/liquid-node 2017-07-13 23:24:48 +08:00
aleclarson fb52c864b1 Add isPlainObject to 'util/underscore.js' 2017-07-13 10:33:01 -04:00
harttle 9f82aec569 add test case for truncate 2017-07-13 16:28:32 +08:00
Jun YangandGitHub 29fe8dcb4b Merge pull request #31 from aleclarson/remove-stop-skip
Remove unused `stop` and `skip` from `forloop` object
2017-07-13 16:10:10 +08:00
aleclarson 2a16800305 Iterate keys of object when used with for...in loop 2017-07-12 15:33:48 -04:00
aleclarson 154cf379a8 Remove unused stop and skip from forloop object 2017-07-12 15:33:09 -04:00
harttle ed20fe6072 1.8.0 2017-04-24 21:31:56 +08:00
harttle 2632e3e97e eslint 2017-04-24 21:31:30 +08:00
harttle 82f84d96c1 1.7.9 2017-04-20 10:33:49 +08:00
harttle 1126dffd7d fix default filter use isTruthy, working on #30 2017-04-20 10:33:10 +08:00
harttle 07ec997ffd tests for truthy 2017-04-20 10:31:02 +08:00
harttle 79815784c1 1.7.8 2017-04-17 22:56:16 +08:00
harttle 2d793a63fe fix #29 2017-04-17 22:49:53 +08:00
harttle cc2b2ea5d1 1.7.7 2017-04-10 19:07:51 +08:00
Jun YangandGitHub 8ff9eeb51d Merge pull request #28 from wojtask9/master
support multiline tags
2017-04-10 19:06:16 +08:00
wojtask9 3bc7caa387 support multiline tags 2017-04-10 11:58:45 +02:00
harttle 20044c4256 1.7.6 2017-03-21 18:00:27 +08:00
chenosandJun Yang e72f295bd0 Comparison on NULL is always false (#27)
* All values in Liquid are truthy except nil and false.

* The falsy values are null, undefined and false.

* comparison on null
2017-03-21 14:54:26 +08:00
chenosandJun Yang 66774865f4 All values in Liquid are truthy except nil and false. (#26)
* All values in Liquid are truthy except nil and false.

* The falsy values are null, undefined and false.
2017-03-21 12:25:11 +08:00
harttle 2ae6874397 1.7.5 2017-03-20 15:07:10 +08:00
chenosandJun Yang b307f6ffd0 Size can also be used with dot notation (#25)
* Size can also be used with dot notation (for example, {{ my_string.size }}).

* Fixed test failed.

* Optimization
2017-03-20 15:06:32 +08:00
harttle 5b5db616e2 1.7.4 2017-03-16 19:29:16 +08:00
harttle 551a15f373 import value declaration syntax 2017-03-16 19:27:54 +08:00
ChenL 45e0fb21dc Fixed array arguments bug 2017-03-16 19:02:30 +08:00
ChenL 4fc977268f Support create variables on the filter line. 2017-03-16 18:26:10 +08:00
harttle 8231727428 update README 2017-03-16 10:44:21 +08:00
harttle 0a068ac51c 1.7.3 2017-03-16 10:40:27 +08:00
harttle 6f1d6f3d05 Merge branch 'chenos-master' 2017-03-16 10:40:09 +08:00
harttle aa52a31e90 fix: contains return false when left side equals null 2017-03-16 10:39:10 +08:00
ChenL e4056a79ee Test if an array contains a specific number/string. 2017-03-16 10:05:50 +08:00
ChenL f1d68409b1 Do not throw error in contains when variable is illegal. 2017-03-15 21:20:00 +08:00
ChenL 7ad9ce95e9 Illegal expression in contains 2017-03-15 20:38:08 +08:00
harttle ea7e334d87 1.7.2 2017-03-15 17:14:21 +08:00
harttle 4f123c1d6b Merge branch 'chenos-master' 2017-03-15 17:13:58 +08:00
harttle 0f4edc5b53 add unit test for #21 2017-03-15 17:13:05 +08:00
chenosandGitHub 48bee428d5 reversed position
eg:

- reversed limit:4 offset:2
- limit:4 reversed offset:2
- limit:4 offset:2 reversed
2017-03-15 16:59:24 +08:00
Jun YangandGitHub 2d1f05799f Update README.md 2017-02-18 17:14:51 +08:00
harttle dbc18539a0 modified: README.md 2017-02-14 10:57:57 +08:00
harttle 492f56cbfb unit test: multiple hash 2017-02-01 13:49:01 +08:00
harttle 4018ffe68b 1.7.1 2017-01-31 23:17:08 +08:00
harttle 21eefe1d7b do not trim output tags and previous \n, #19 2017-01-31 23:15:23 +08:00
harttle 0c8148c12b 1.7.0 2017-01-31 00:48:26 +08:00
harttle 7f336ded5c fix badges 2017-01-31 00:48:11 +08:00
harttle 5ecca1b761 feature: greedy trim disabled by default, working on #19 2017-01-31 00:07:46 +08:00
harttle af284daf34 1.6.2 2017-01-21 19:41:59 +08:00
harttle 21a5ac7e08 RenderError extends original error 2017-01-21 19:41:19 +08:00
harttle 7d22214cb5 remove strict_* from express arguments 2017-01-02 13:44:33 +08:00
harttle d6ca12f3bd 1.6.1 2016-12-27 00:46:53 +08:00
harttle 84f7a399c5 update README and unit test 2016-12-27 00:33:11 +08:00
harttle 5b5dfd5c00 documents for whitespace control (#17) 2016-12-27 00:09:39 +08:00
harttle d032f7f4d4 1.6.0 2016-12-26 23:38:15 +08:00
harttle 044035b8ed unit tests for #17 2016-12-26 23:37:33 +08:00
harttle 564d9cd9f4 feature: whitespace control, fixes #17 2016-12-26 23:23:58 +08:00
harttle fbb1dc8a36 test cases for filters: string->number convertion, #18 2016-12-15 23:14:49 +08:00
harttle c99dfd69e7 1.5.4 2016-12-15 22:39:52 +08:00
harttle 4719544d49 fix: number convertion for plus filter, closes #18 2016-12-15 22:38:48 +08:00
harttle 2c0ba9bfd9 1.5.3 2016-12-08 23:26:00 +08:00
harttle 89636736a4 robust date filter 2016-12-08 23:25:38 +08:00
harttle deca9677dd modified: README.md 2016-12-05 23:49:07 +08:00
harttle 543368ed89 unit test for original error for {%layout%} 2016-12-01 00:50:36 +08:00
harttle dcd7b01fa4 update tag test 2016-11-16 02:53:30 +08:00
592 changed files with 78715 additions and 7587 deletions
+430
View File
@@ -0,0 +1,430 @@
{
"projectName": "liquidjs",
"projectOwner": "harttle",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"commitConvention": "angular",
"contributors": [
{
"login": "harttle",
"name": "Jun Yang",
"avatar_url": "https://avatars3.githubusercontent.com/u/4427974?v=4",
"profile": "https://harttle.land",
"contributions": [
"maintenance",
"code"
]
},
{
"login": "chenos",
"name": "chenos",
"avatar_url": "https://avatars0.githubusercontent.com/u/2993310?v=4",
"profile": "https://github.com/chenos",
"contributions": [
"code"
]
},
{
"login": "zachleat",
"name": "Zach Leatherman",
"avatar_url": "https://avatars2.githubusercontent.com/u/39355?v=4",
"profile": "https://zachleat.com/",
"contributions": [
"bug"
]
},
{
"login": "thardy",
"name": "Tim Hardy",
"avatar_url": "https://avatars3.githubusercontent.com/u/120636?v=4",
"profile": "https://github.com/thardy",
"contributions": [
"code"
]
},
{
"login": "paulrobertlloyd",
"name": "Paul Robert Lloyd",
"avatar_url": "https://avatars3.githubusercontent.com/u/813383?v=4",
"profile": "https://paulrobertlloyd.com/",
"contributions": [
"code",
"bug"
]
},
{
"login": "aleclarson",
"name": "Alec Larson",
"avatar_url": "https://avatars2.githubusercontent.com/u/1925840?v=4",
"profile": "https://twitter.com/alecdotbiz",
"contributions": [
"code"
]
},
{
"login": "pmalouin",
"name": "Patrick Malouin",
"avatar_url": "https://avatars1.githubusercontent.com/u/1411117?v=4",
"profile": "https://github.com/pmalouin",
"contributions": [
"code",
"doc"
]
},
{
"login": "jaswrks",
"name": "jaswrks",
"avatar_url": "https://avatars3.githubusercontent.com/u/1563559?v=4",
"profile": "https://jaswrks.com",
"contributions": [
"code"
]
},
{
"login": "oott123",
"name": "三三",
"avatar_url": "https://avatars2.githubusercontent.com/u/905663?v=4",
"profile": "https://oott123.com",
"contributions": [
"code",
"ideas"
]
},
{
"login": "ssendev",
"name": "ssendev",
"avatar_url": "https://avatars0.githubusercontent.com/u/450793?v=4",
"profile": "https://github.com/ssendev",
"contributions": [
"code",
"doc"
]
},
{
"login": "wojtask9",
"name": "wojtask9",
"avatar_url": "https://avatars3.githubusercontent.com/u/6099236?v=4",
"profile": "https://github.com/wojtask9",
"contributions": [
"code"
]
},
{
"login": "thelornenelson",
"name": "Andrew Barclay",
"avatar_url": "https://avatars3.githubusercontent.com/u/24596583?v=4",
"profile": "https://github.com/thelornenelson",
"contributions": [
"code"
]
},
{
"login": "cmawhorter",
"name": "Cory Mawhorter",
"avatar_url": "https://avatars2.githubusercontent.com/u/142338?v=4",
"profile": "https://www.stam.pr/",
"contributions": [
"code"
]
},
{
"login": "thehappybug",
"name": "Mehdi Jaffery",
"avatar_url": "https://avatars0.githubusercontent.com/u/3393530?v=4",
"profile": "https://github.com/thehappybug",
"contributions": [
"code"
]
},
{
"login": "robinbijlani",
"name": "Robin Bijlani",
"avatar_url": "https://avatars0.githubusercontent.com/u/2503108?v=4",
"profile": "https://github.com/robinbijlani",
"contributions": [
"code",
"bug"
]
},
{
"login": "ryaninvents",
"name": "Ryan Kennedy",
"avatar_url": "https://avatars3.githubusercontent.com/u/8356669?v=4",
"profile": "https://www.rmkennedy.com",
"contributions": [
"code"
]
},
{
"login": "strax",
"name": "Sami Kukkonen",
"avatar_url": "https://avatars2.githubusercontent.com/u/587213?v=4",
"profile": "https://github.com/strax",
"contributions": [
"code"
]
},
{
"login": "ScottFreeCode",
"name": "Scott Santucci",
"avatar_url": "https://avatars3.githubusercontent.com/u/16506071?v=4",
"profile": "https://ScottFreeCode.github.io/",
"contributions": [
"code"
]
},
{
"login": "stevenanthonyrevo",
"name": "Steven ",
"avatar_url": "https://avatars3.githubusercontent.com/u/8505293?v=4",
"profile": "http://stevenrescigno.com",
"contributions": [
"example",
"code"
]
},
{
"login": "azu",
"name": "azu",
"avatar_url": "https://avatars1.githubusercontent.com/u/19714?v=4",
"profile": "https://efcl.info/",
"contributions": [
"doc"
]
},
{
"login": "wyozi",
"name": "Joonas",
"avatar_url": "https://avatars3.githubusercontent.com/u/4894573?v=4",
"profile": "https://github.com/wyozi",
"contributions": [
"code"
]
},
{
"login": "jamelait",
"name": "Jamel A.",
"avatar_url": "https://avatars1.githubusercontent.com/u/14369255?v=4",
"profile": "https://github.com/jamelait",
"contributions": [
"code"
]
},
{
"login": "brandonpittman",
"name": "Brandon Pittman",
"avatar_url": "https://avatars0.githubusercontent.com/u/967145?v=4",
"profile": "https://brandonpittman.net",
"contributions": [
"code"
]
},
{
"login": "tgrandgent",
"name": "tgrandgent",
"avatar_url": "https://avatars3.githubusercontent.com/u/17069042?v=4",
"profile": "https://github.com/tgrandgent",
"contributions": [
"code"
]
},
{
"login": "mastodon0",
"name": "Martin Schuster",
"avatar_url": "https://avatars1.githubusercontent.com/u/7924332?v=4",
"profile": "https://github.com/mastodon0",
"contributions": [
"code"
]
},
{
"login": "richardo2016",
"name": "Ray",
"avatar_url": "https://avatars0.githubusercontent.com/u/6339390?v=4",
"profile": "http://js.chenlei.me",
"contributions": [
"test",
"code"
]
},
{
"login": "CriGoT",
"name": "Cristofer Gonzales",
"avatar_url": "https://avatars0.githubusercontent.com/u/1936786?v=4",
"profile": "https://github.com/CriGoT",
"contributions": [
"code"
]
},
{
"login": "cfjedimaster",
"name": "Raymond Camden",
"avatar_url": "https://avatars3.githubusercontent.com/u/393660?v=4",
"profile": "https://www.raymondcamden.com",
"contributions": [
"doc"
]
},
{
"login": "stedman",
"name": "Steve Stedman",
"avatar_url": "https://avatars1.githubusercontent.com/u/183122?v=4",
"profile": "https://stedman.dev",
"contributions": [
"doc"
]
},
{
"login": "aciccarello",
"name": "Anthony Ciccarello",
"avatar_url": "https://avatars0.githubusercontent.com/u/11273838?v=4",
"profile": "https://ciccarello.me",
"contributions": [
"doc"
]
},
{
"login": "TrySound",
"name": "Bogdan Chadkin",
"avatar_url": "https://avatars0.githubusercontent.com/u/5635476?v=4",
"profile": "https://twitter.com/IAmTrySound",
"contributions": [
"code"
]
},
{
"login": "tejasmanohar",
"name": "Tejas Manohar",
"avatar_url": "https://avatars0.githubusercontent.com/u/5959235?v=4",
"profile": "https://hightouch.io",
"contributions": [
"code"
]
},
{
"login": "pdehaan",
"name": "Peter deHaan",
"avatar_url": "https://avatars2.githubusercontent.com/u/557895?v=4",
"profile": "http://about.me/peterdehaan",
"contributions": [
"doc"
]
},
{
"login": "amit777",
"name": "amit777",
"avatar_url": "https://avatars0.githubusercontent.com/u/2703309?v=4",
"profile": "https://github.com/amit777",
"contributions": [
"code",
"financial"
]
},
{
"login": "sschuldenzucker",
"name": "Steffen Schuldenzucker",
"avatar_url": "https://avatars3.githubusercontent.com/u/1100776?v=4",
"profile": "http://www.ifi.uzh.ch/en/ce/people/schuldenzucker.html",
"contributions": [
"code"
]
},
{
"login": "Pixcell",
"name": "Pixcell",
"avatar_url": "https://avatars0.githubusercontent.com/u/4005291?v=4",
"profile": "https://github.com/Pixcell",
"contributions": [
"code"
]
},
{
"login": "JasonEtco",
"name": "Jason Etcovitch",
"avatar_url": "https://avatars.githubusercontent.com/u/10660468?v=4",
"profile": "https://jasonet.co",
"contributions": [
"code"
]
},
{
"login": "kayuapi",
"name": "ZC",
"avatar_url": "https://avatars.githubusercontent.com/u/10304328?v=4",
"profile": "https://github.com/kayuapi",
"contributions": [
"doc"
]
},
{
"login": "mems",
"name": "Memmie Lenglet",
"avatar_url": "https://avatars.githubusercontent.com/u/729275?v=4",
"profile": "https://memmie.lenglet.name",
"contributions": [
"code"
]
},
{
"login": "ilhamdev0",
"name": "ilhamdev0",
"avatar_url": "https://avatars.githubusercontent.com/u/57636145?v=4",
"profile": "https://github.com/ilhamdev0",
"contributions": [
"doc"
]
},
{
"login": "c412216887",
"name": "一饮一啄皆是人生",
"avatar_url": "https://avatars.githubusercontent.com/u/29691650?v=4",
"profile": "https://github.com/c412216887",
"contributions": [
"doc"
]
},
{
"login": "labnol",
"name": "Amit Agarwal",
"avatar_url": "https://avatars.githubusercontent.com/u/1344071?v=4",
"profile": "https://digitalinspiration.com/",
"contributions": [
"doc"
]
},
{
"login": "n1ru4l",
"name": "Laurin Quast",
"avatar_url": "https://avatars.githubusercontent.com/u/14338007?v=4",
"profile": "https://n1ru4l.cloud/",
"contributions": [
"code"
]
},
{
"login": "mattvague",
"name": "Matt Vague",
"avatar_url": "https://avatars.githubusercontent.com/u/64985?v=4",
"profile": "https://github.com/mattvague",
"contributions": [
"code"
]
},
{
"login": "bglw",
"name": "Liam Bigelow",
"avatar_url": "https://avatars.githubusercontent.com/u/40188355?v=4",
"profile": "https://github.com/bglw",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
"skipCi": true
}
+5
View File
@@ -0,0 +1,5 @@
node_modules
dist
demo
coverage
docs
+40
View File
@@ -0,0 +1,40 @@
{
"extends": ["standard", "plugin:@typescript-eslint/recommended"],
"env": {
"mocha": true,
"es6": true,
"browser": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"plugins": [
"mocha",
"standard",
"@typescript-eslint",
"promise"
],
"rules": {
"no-var": 2,
"prefer-const": 2,
"no-unused-vars": "off",
"indent": "off",
"no-dupe-class-members": "off",
"no-useless-constructor": "off",
"@typescript-eslint/indent": ["error", 2],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-object-literal-type-assertion": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"import/export": "off",
"@typescript-eslint/no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": false }]
},
"overrides": [{
"files": ["**/*.js", "*.js"],
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
}]
}
+12
View File
@@ -0,0 +1,12 @@
# These are supported funding model platforms
# github: harttle
patreon: harttle
open_collective: liquidjs
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
+30
View File
@@ -0,0 +1,30 @@
name: Check
on: [push, pull_request]
jobs:
release:
name: Check
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 10
- name: Build
run: |
npm ci
npm run build
- name: Test
run: |
npm run lint
npm run test
- name: Coverage
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Performance
run: |
npm run perf:diff
+37
View File
@@ -0,0 +1,37 @@
name: Release
on: workflow_dispatch
jobs:
release:
name: Release
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Build
run: |
npm ci
npm run build
- name: Test
run: |
npm run lint
npm run test
- name: Coverage
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
- name: Publish Docs
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs/public
+13 -34
View File
@@ -1,40 +1,19 @@
# Logs
logs
# logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
# cache
.rpt2_cache
coverage/
.nyc_output/
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# modules
node_modules/
dist/
demo/*/package-lock.json
demo/*/yarn.json
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules
jspm_packages
# Optional npm cache directory
.npm
# Optional REPL history
.node_repl_history
# vim
# editors
.*.swp
.vscode
+4
View File
@@ -0,0 +1,4 @@
module.exports = {
require: "ts-node/register/transpile-only",
reporter: "spec"
}
-1
View File
@@ -1 +0,0 @@
test/
+4
View File
@@ -0,0 +1,4 @@
{
"exclude": ["dist", "test"],
"reporter": ["html", "lcov"]
}
-7
View File
@@ -1,7 +0,0 @@
language: node_js
node_js:
- "4"
before_script:
- npm install -g mocha
after_script:
- NODE_ENV=test ./node_modules/.bin/istanbul cover --report lcovonly ./node_modules/mocha/bin/_mocha -- -R spec --recursive && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
+760
View File
@@ -0,0 +1,760 @@
# [9.28.0](https://github.com/harttle/liquidjs/compare/v9.27.1...v9.28.0) (2021-10-06)
### Bug Fixes
* skip root check for renderFile() ([822ba0b](https://github.com/harttle/liquidjs/commit/822ba0be0f1cfbedd50376aff8ac49eee71bd48c))
* support timezoneOffset for date from scope, [#401](https://github.com/harttle/liquidjs/issues/401) ([fd5ef47](https://github.com/harttle/liquidjs/commit/fd5ef474c36212e6a2446012dcd26bca93f84c7b))
### Features
* `relativeReference` for render/include/layout, [#395](https://github.com/harttle/liquidjs/issues/395) ([a3455eb](https://github.com/harttle/liquidjs/commit/a3455ebd0b207141c34630c0af44d917db2ca1dd))
* implement `forloop.name` as found in ruby shopify/liquid ([6dc7fad](https://github.com/harttle/liquidjs/commit/6dc7fada72467418806c1ee4bd7eaf3003690fe6))
## [9.27.1](https://github.com/harttle/liquidjs/compare/v9.27.0...v9.27.1) (2021-10-04)
### Bug Fixes
* directory info in lookupError message, [#395](https://github.com/harttle/liquidjs/issues/395) ([92bfc65](https://github.com/harttle/liquidjs/commit/92bfc65e0b1d937c00a8368b272223c702132d23))
# [9.27.0](https://github.com/harttle/liquidjs/compare/v9.26.0...v9.27.0) (2021-10-03)
### Bug Fixes
* remove "stream" dependency in browser bundles, [#396](https://github.com/harttle/liquidjs/issues/396) ([3b5eb66](https://github.com/harttle/liquidjs/commit/3b5eb6664f673c29d74cb7645e01dcbdf43c8343))
* renderToNodeStream() now emit 'error' event instead of throw ([afeef1d](https://github.com/harttle/liquidjs/commit/afeef1d7450b2799b3441b0241d2466b892a27ff))
### Features
* add `layouts`, `partials` apart from `root`, [#395](https://github.com/harttle/liquidjs/issues/395) ([b9ae479](https://github.com/harttle/liquidjs/commit/b9ae479b653a34fadb98c324c4683dd1fdd31af1))
* renderFileToNodeStream(filepath, scope) ([68c4cfc](https://github.com/harttle/liquidjs/commit/68c4cfcfb647c22225dd6edede53ad7a5d7c4485))
### Performance Improvements
* make the most of streamed rendering ([aea3441](https://github.com/harttle/liquidjs/commit/aea34418de24cb85ea1acddf68c3683ce7fc9fa8))
# [9.26.0](https://github.com/harttle/liquidjs/compare/v9.25.1...v9.26.0) (2021-09-30)
### Features
* orderedFilterParameters, closes [#312](https://github.com/harttle/liquidjs/issues/312) ([10e8c8f](https://github.com/harttle/liquidjs/commit/10e8c8ff7e1cca6df43087953cd8daf4bd618563))
* stream rendering, closed [#361](https://github.com/harttle/liquidjs/issues/361) fixes [#360](https://github.com/harttle/liquidjs/issues/360) ([9012133](https://github.com/harttle/liquidjs/commit/9012133e0717b1813c6a74a6a282f43ba14d0ada))
* timezoneOffset option to specify output timezone, see [#375](https://github.com/harttle/liquidjs/issues/375) ([6b9f872](https://github.com/harttle/liquidjs/commit/6b9f872bccb4b0c636dc7be2088cafa9bc6c900a))
### Performance Improvements
* improve performance by 4x by simplified parseFile ([24f5346](https://github.com/harttle/liquidjs/commit/24f534608489fccc155f30bbaf37397c46278da6))
* parse filenames in parse() insteadof render() ([8273c17](https://github.com/harttle/liquidjs/commit/8273c17dab3dc09858330ce45e3617a650e7fcaa))
## [9.25.1](https://github.com/harttle/liquidjs/compare/v9.25.0...v9.25.1) (2021-06-20)
### Performance Improvements
* add cross-engines benchmark ([cdceb25](https://github.com/harttle/liquidjs/commit/cdceb25d007b3d30a85e51ac538e12297c73bfcf))
# [9.25.0](https://github.com/harttle/liquidjs/compare/v9.24.2...v9.25.0) (2021-05-07)
### Features
* when tag with multiple values ([8f9639f](https://github.com/harttle/liquidjs/commit/8f9639f))
## [9.24.2](https://github.com/harttle/liquidjs/compare/v9.24.1...v9.24.2) (2021-05-04)
### Bug Fixes
* operator boundary not correctly recognized, fixes [#342](https://github.com/harttle/liquidjs/issues/342) ([3e3d84a](https://github.com/harttle/liquidjs/commit/3e3d84a))
## [9.24.1](https://github.com/harttle/liquidjs/compare/v9.24.0...v9.24.1) (2021-05-01)
### Bug Fixes
* make LiquidError context property public ([1fd76ac](https://github.com/harttle/liquidjs/commit/1fd76ac))
# [9.24.0](https://github.com/harttle/liquidjs/compare/v9.23.4...v9.24.0) (2021-05-01)
### Features
* add context as a property on the LiquidError error ([9c7cb57](https://github.com/harttle/liquidjs/commit/9c7cb57))
* export errors for better error handling in user-land ([4e394b9](https://github.com/harttle/liquidjs/commit/4e394b9))
## [9.23.4](https://github.com/harttle/liquidjs/compare/v9.23.3...v9.23.4) (2021-04-17)
### Bug Fixes
* capitalize filter not lower case trailing string, fixes [#326](https://github.com/harttle/liquidjs/issues/326) ([6548765](https://github.com/harttle/liquidjs/commit/6548765))
## [9.23.3](https://github.com/harttle/liquidjs/compare/v9.23.2...v9.23.3) (2021-03-21)
### Bug Fixes
* expose TokenKind ([dbc23e8](https://github.com/harttle/liquidjs/commit/dbc23e8))
## [9.23.2](https://github.com/harttle/liquidjs/compare/v9.23.1...v9.23.2) (2021-03-13)
### Bug Fixes
* comparison for empty/nil, fixes [#321](https://github.com/harttle/liquidjs/issues/321) ([99d14e7](https://github.com/harttle/liquidjs/commit/99d14e7))
* newline_to_br filter should output <br /> instead of <br/>, fixes [#320](https://github.com/harttle/liquidjs/issues/320) ([9a9b792](https://github.com/harttle/liquidjs/commit/9a9b792))
## [9.23.1](https://github.com/harttle/liquidjs/compare/v9.23.0...v9.23.1) (2021-02-19)
### Bug Fixes
* lenientIf not working for the umd bundle, closes [#313](https://github.com/harttle/liquidjs/issues/313) ([2e66e8b](https://github.com/harttle/liquidjs/commit/2e66e8b))
# [9.23.0](https://github.com/harttle/liquidjs/compare/v9.22.1...v9.23.0) (2021-02-12)
### Bug Fixes
* respect `fs` in parser options, for [#233](https://github.com/harttle/liquidjs/issues/233) ([4e82da6](https://github.com/harttle/liquidjs/commit/4e82da6))
### Features
* support filters in if/unless/case, see [#287](https://github.com/harttle/liquidjs/issues/287) ([2f059f6](https://github.com/harttle/liquidjs/commit/2f059f6))
* support function calls, closes [#222](https://github.com/harttle/liquidjs/issues/222) ([e37824f](https://github.com/harttle/liquidjs/commit/e37824f))
* support layout none, closes [#299](https://github.com/harttle/liquidjs/issues/299) ([81e11bb](https://github.com/harttle/liquidjs/commit/81e11bb))
## [9.22.1](https://github.com/harttle/liquidjs/compare/v9.22.0...v9.22.1) (2021-02-05)
### Bug Fixes
* default to precedence 1 for custom operators ([20f559e](https://github.com/harttle/liquidjs/commit/20f559e))
# [9.22.0](https://github.com/harttle/liquidjs/compare/v9.21.0...v9.22.0) (2021-02-04)
### Features
* compact filter ([f42c217](https://github.com/harttle/liquidjs/commit/f42c217))
# [9.21.0](https://github.com/harttle/liquidjs/compare/v9.20.1...v9.21.0) (2021-02-04)
### Features
* add `operators` option for custom operators ([75591cd](https://github.com/harttle/liquidjs/commit/75591cd))
* create trie programmatically in options ([befc33c](https://github.com/harttle/liquidjs/commit/befc33c))
* export OperatorMap type ([bc87e19](https://github.com/harttle/liquidjs/commit/bc87e19))
* export Operators from operator.ts ([6a7c280](https://github.com/harttle/liquidjs/commit/6a7c280))
* rename to defaultOperators and Operators ([8734e2e](https://github.com/harttle/liquidjs/commit/8734e2e))
## [9.20.1](https://github.com/harttle/liquidjs/compare/v9.20.0...v9.20.1) (2021-01-24)
### Bug Fixes
* allow string literals contain delimiters, fixes [#288](https://github.com/harttle/liquidjs/issues/288) ([9c40da7](https://github.com/harttle/liquidjs/commit/9c40da7))
# [9.20.0](https://github.com/harttle/liquidjs/compare/v9.19.0...v9.20.0) (2021-01-23)
### Features
* support `{{block.super}}`, see [#38](https://github.com/harttle/liquidjs/issues/38) ([a3af44d](https://github.com/harttle/liquidjs/commit/a3af44d))
# [9.19.0](https://github.com/harttle/liquidjs/compare/v9.18.0...v9.19.0) (2020-12-18)
### Bug Fixes
* lint ([de32259](https://github.com/harttle/liquidjs/commit/de32259))
* move offset adding complexity inside TimezoneDate ([26b2175](https://github.com/harttle/liquidjs/commit/26b2175))
* simpler timezone regex and non-null offset ([e3ecfe3](https://github.com/harttle/liquidjs/commit/e3ecfe3))
### Features
* add preserveTimezones option ([d70cd2a](https://github.com/harttle/liquidjs/commit/d70cd2a))
* parse and handle date timezone offsets ([c16c787](https://github.com/harttle/liquidjs/commit/c16c787))
# [9.18.0](https://github.com/harttle/liquidjs/compare/v9.17.0...v9.18.0) (2020-12-17)
### Bug Fixes
* address refactor comments ([6a0ad10](https://github.com/harttle/liquidjs/commit/6a0ad10))
### Features
* add option for keeping variable type in output ([cd92e77](https://github.com/harttle/liquidjs/commit/cd92e77))
# [9.17.0](https://github.com/harttle/liquidjs/compare/v9.16.1...v9.17.0) (2020-12-07)
### Bug Fixes
* elsif is not supported for unless, fixes [#268](https://github.com/harttle/liquidjs/issues/268) ([2bbf501](https://github.com/harttle/liquidjs/commit/2bbf501))
* enforce string-type pattern in `replace`, fixes [#243](https://github.com/harttle/liquidjs/issues/243) ([c8afa39](https://github.com/harttle/liquidjs/commit/c8afa39))
* raw block not ignoring {% characters, fixes [#263](https://github.com/harttle/liquidjs/issues/263) ([a492d8e](https://github.com/harttle/liquidjs/commit/a492d8e))
### Features
* passing liquid to FilterImpl, closes [#277](https://github.com/harttle/liquidjs/issues/277) ([f9f595f](https://github.com/harttle/liquidjs/commit/f9f595f))
## [9.16.1](https://github.com/harttle/liquidjs/compare/v9.16.0...v9.16.1) (2020-10-09)
### Bug Fixes
* braced property access ([18a807e](https://github.com/harttle/liquidjs/commit/18a807e))
# [9.16.0](https://github.com/harttle/liquidjs/compare/v9.15.1...v9.16.0) (2020-10-08)
### Features
* support jsTruthy, [#255](https://github.com/harttle/liquidjs/issues/255) [#257](https://github.com/harttle/liquidjs/issues/257) ([72ee7b4](https://github.com/harttle/liquidjs/commit/72ee7b4))
## [9.15.1](https://github.com/harttle/liquidjs/compare/v9.15.0...v9.15.1) (2020-10-03)
### Bug Fixes
* allow quoted variable name in capture, fixes [#252](https://github.com/harttle/liquidjs/issues/252) ([5b3f419](https://github.com/harttle/liquidjs/commit/5b3f419))
# [9.15.0](https://github.com/harttle/liquidjs/compare/v9.14.1...v9.15.0) (2020-08-04)
### Features
* export toPromise and toValue, see [#158](https://github.com/harttle/liquidjs/issues/158) ([2e5ab98](https://github.com/harttle/liquidjs/commit/2e5ab98))
## [9.14.1](https://github.com/harttle/liquidjs/compare/v9.14.0...v9.14.1) (2020-07-08)
### Bug Fixes
* enumerate Promises (e.g. in for & tablerow) ([#237](https://github.com/harttle/liquidjs/issues/237)) ([941dd66](https://github.com/harttle/liquidjs/commit/941dd66))
# [9.14.0](https://github.com/harttle/liquidjs/compare/v9.13.0...v9.14.0) (2020-06-25)
### Features
* setup universal browser and node builds ([6cf6ffa](https://github.com/harttle/liquidjs/commit/6cf6ffa))
# [9.13.0](https://github.com/harttle/liquidjs/compare/v9.12.0...v9.13.0) (2020-06-25)
### Features
* async filters, closes [#232](https://github.com/harttle/liquidjs/issues/232) ([e36f3ff](https://github.com/harttle/liquidjs/commit/e36f3ff))
# [9.12.0](https://github.com/harttle/liquidjs/compare/v9.11.11...v9.12.0) (2020-05-15)
### Features
* sort by key, see [#227](https://github.com/harttle/liquidjs/issues/227) ([4f17c94](https://github.com/harttle/liquidjs/commit/4f17c94))
## [9.11.11](https://github.com/harttle/liquidjs/compare/v9.11.10...v9.11.11) (2020-05-01)
### Bug Fixes
* properly treat unicode blanks, fixes [#221](https://github.com/harttle/liquidjs/issues/221) ([673b015](https://github.com/harttle/liquidjs/commit/673b015))
## [9.11.10](https://github.com/harttle/liquidjs/compare/v9.11.9...v9.11.10) (2020-04-03)
### Bug Fixes
* respect cache render options ([a93f11d](https://github.com/harttle/liquidjs/commit/a93f11d))
## [9.11.9](https://github.com/harttle/liquidjs/compare/v9.11.8...v9.11.9) (2020-03-31)
### Bug Fixes
* coerce to Array in `map` and `where` filter ([c923598](https://github.com/harttle/liquidjs/commit/c923598))
## [9.11.8](https://github.com/harttle/liquidjs/compare/v9.11.7...v9.11.8) (2020-03-31)
### Bug Fixes
* throw an error if : omitted unintentionally, [#212](https://github.com/harttle/liquidjs/issues/212), [#208](https://github.com/harttle/liquidjs/issues/208) ([8daf281](https://github.com/harttle/liquidjs/commit/8daf281))
## [9.11.7](https://github.com/harttle/liquidjs/compare/v9.11.6...v9.11.7) (2020-03-28)
### Bug Fixes
* try fix travis ([b3db412](https://github.com/harttle/liquidjs/commit/b3db412))
## [9.11.6](https://github.com/harttle/liquidjs/compare/v9.11.5...v9.11.6) (2020-03-25)
### Bug Fixes
* default filter not applied for empty array ([c371762](https://github.com/harttle/liquidjs/commit/c371762))
## [9.11.5](https://github.com/harttle/liquidjs/compare/v9.11.4...v9.11.5) (2020-03-24)
### Bug Fixes
* throws on invalid arguments for prepend/append, fixes [#208](https://github.com/harttle/liquidjs/issues/208) ([479c633](https://github.com/harttle/liquidjs/commit/479c633))
## [9.11.4](https://github.com/harttle/liquidjs/compare/v9.11.3...v9.11.4) (2020-03-23)
### Bug Fixes
* return variable name in include error ([93433a8](https://github.com/harttle/liquidjs/commit/93433a8))
## [9.11.3](https://github.com/harttle/liquidjs/compare/v9.11.2...v9.11.3) (2020-03-14)
### Performance Improvements
* introduce AST to avoid reparse ([d2d6a38](https://github.com/harttle/liquidjs/commit/d2d6a38))
* remove instanceof DelimitedToken ([1673e84](https://github.com/harttle/liquidjs/commit/1673e84))
## [9.11.2](https://github.com/harttle/liquidjs/compare/v9.11.1...v9.11.2) (2020-03-14)
### Performance Improvements
* remove transient strings to reduce memory ([3dfdf98](https://github.com/harttle/liquidjs/commit/3dfdf98))
## [9.11.1](https://github.com/harttle/liquidjs/compare/v9.11.0...v9.11.1) (2020-03-09)
### Bug Fixes
* concurrent write on LRU cache ([#200](https://github.com/harttle/liquidjs/issues/200)) ([6de9338](https://github.com/harttle/liquidjs/commit/6de9338))
# [9.11.0](https://github.com/harttle/liquidjs/compare/v9.10.0...v9.11.0) (2020-03-04)
### Bug Fixes
* `Buffer not defined` for browser bundles, fixes [#197](https://github.com/harttle/liquidjs/issues/197) ([65b849c](https://github.com/harttle/liquidjs/commit/65b849c))
* stable sort for undefined keys, fixes [#191](https://github.com/harttle/liquidjs/issues/191) ([f57156b](https://github.com/harttle/liquidjs/commit/f57156b))
### Features
* async cache.read()/write(), remove .has() ([61dac49](https://github.com/harttle/liquidjs/commit/61dac49))
# [9.10.0](https://github.com/harttle/liquidjs/compare/v9.9.0...v9.10.0) (2020-03-03)
### Features
* support json filter, closes [#192](https://github.com/harttle/liquidjs/issues/192) ([aa27a6c](https://github.com/harttle/liquidjs/commit/aa27a6c))
* with & for in `render` tag, closes [#195](https://github.com/harttle/liquidjs/issues/195) ([6ea6881](https://github.com/harttle/liquidjs/commit/6ea6881))
# [9.9.0](https://github.com/harttle/liquidjs/compare/v9.8.0...v9.9.0) (2020-03-02)
### Features
* move filters/tags to instances, fixes [#188](https://github.com/harttle/liquidjs/issues/188) ([df8a919](https://github.com/harttle/liquidjs/commit/df8a919))
# [9.8.0](https://github.com/harttle/liquidjs/compare/v9.7.2...v9.8.0) (2020-02-20)
### Features
* "today" when using date filter, fixes [#193](https://github.com/harttle/liquidjs/issues/193) ([185312d](https://github.com/harttle/liquidjs/commit/185312d))
## [9.7.2](https://github.com/harttle/liquidjs/compare/v9.7.1...v9.7.2) (2020-02-20)
### Bug Fixes
* add funding entry to show up in npm fund command ([40095a8](https://github.com/harttle/liquidjs/commit/40095a8))
## [9.7.1](https://github.com/harttle/liquidjs/compare/v9.7.0...v9.7.1) (2020-02-19)
### Bug Fixes
* update index.html ([22386b0](https://github.com/harttle/liquidjs/commit/22386b0))
# [9.7.0](https://github.com/harttle/liquidjs/compare/v9.6.2...v9.7.0) (2020-02-07)
### Bug Fixes
* expression and string literal parser, [#186](https://github.com/harttle/liquidjs/issues/186) ([fc0cf6f](https://github.com/harttle/liquidjs/commit/fc0cf6f))
### Features
* globals shared between tags, see [#185](https://github.com/harttle/liquidjs/issues/185) ([870e7ec](https://github.com/harttle/liquidjs/commit/870e7ec))
## [9.6.2](https://github.com/harttle/liquidjs/compare/v9.6.1...v9.6.2) (2020-01-10)
### Performance Improvements
* prevent multiple case evaluations ([807e840](https://github.com/harttle/liquidjs/commit/807e840))
## [9.6.1](https://github.com/harttle/liquidjs/compare/v9.6.0...v9.6.1) (2020-01-04)
### Bug Fixes
* add `this` to fs references in parseFile ([4b079c5](https://github.com/harttle/liquidjs/commit/4b079c5))
# [9.6.0](https://github.com/harttle/liquidjs/compare/v9.5.0...v9.6.0) (2019-12-15)
### Features
* full syntax for strftime, close [#177](https://github.com/harttle/liquidjs/issues/177) ([ba5ff3f](https://github.com/harttle/liquidjs/commit/ba5ff3f))
# [9.5.0](https://github.com/harttle/liquidjs/compare/v9.4.2...v9.5.0) (2019-12-12)
### Features
* nested property for the `where` filter, [#178](https://github.com/harttle/liquidjs/issues/178) ([60ec74f](https://github.com/harttle/liquidjs/commit/60ec74f))
## [9.4.2](https://github.com/harttle/liquidjs/compare/v9.4.1...v9.4.2) (2019-11-15)
### Bug Fixes
* reading .first, .last of Array, closes [#175](https://github.com/harttle/liquidjs/issues/175) ([f82da11](https://github.com/harttle/liquidjs/commit/f82da11))
## [9.4.1](https://github.com/harttle/liquidjs/compare/v9.4.0...v9.4.1) (2019-11-15)
### Bug Fixes
* remove node dependencies for esm bundle, see [#173](https://github.com/harttle/liquidjs/issues/173) ([04df929](https://github.com/harttle/liquidjs/commit/04df929))
# [9.4.0](https://github.com/harttle/liquidjs/compare/v9.3.1...v9.4.0) (2019-11-14)
### Features
* add ability to pass JSON context to CLI ([9504e4e](https://github.com/harttle/liquidjs/commit/9504e4e))
## [9.3.1](https://github.com/harttle/liquidjs/compare/v9.3.0...v9.3.1) (2019-11-09)
### Bug Fixes
* liquidjs command in /bin/liquid.js, fixes [#169](https://github.com/harttle/liquidjs/issues/169) ([0073b90](https://github.com/harttle/liquidjs/commit/0073b90))
# [9.3.0](https://github.com/harttle/liquidjs/compare/v9.2.0...v9.3.0) (2019-11-07)
### Features
* support require.resolve for lookup, see [#168](https://github.com/harttle/liquidjs/issues/168) ([2dd4355](https://github.com/harttle/liquidjs/commit/2dd4355))
## [9.1.1](https://github.com/harttle/liquidjs/compare/v9.1.0...v9.1.1) (2019-10-10)
### Performance Improvements
* add string flattening to reduce retained memory (node only) ([3ad512c](https://github.com/harttle/liquidjs/commit/3ad512c))
# [9.1.0](https://github.com/harttle/liquidjs/compare/v9.0.1...v9.1.0) (2019-10-07)
### Features
* alias getTemplate() to parseFile() ([6b83788](https://github.com/harttle/liquidjs/commit/6b83788))
## [9.0.1](https://github.com/harttle/liquidjs/compare/v9.0.0...v9.0.1) (2019-10-02)
### Bug Fixes
* `unless` content is not waited, fixes [#160](https://github.com/harttle/liquidjs/issues/160) ([d2c8d13](https://github.com/harttle/liquidjs/commit/d2c8d13))
# [9.0.0](https://github.com/harttle/liquidjs/compare/v8.5.3...v9.0.0) (2019-08-26)
### Bug Fixes
* break/continue omitting output before them, [#123](https://github.com/harttle/liquidjs/issues/123) ([ae45c46](https://github.com/harttle/liquidjs/commit/ae45c46))
* reactjs demo during yarn install, fixes [#145](https://github.com/harttle/liquidjs/issues/145) ([b65df44](https://github.com/harttle/liquidjs/commit/b65df44))
### Code Refactoring
* return value of Tag#render is no longer used ([8028f82](https://github.com/harttle/liquidjs/commit/8028f82))
### Features
* renderSync, parseAndRenderSync and renderFileSync, see [#48](https://github.com/harttle/liquidjs/issues/48) ([7fb01ad](https://github.com/harttle/liquidjs/commit/7fb01ad))
### Performance Improvements
* target to es6, fixes [#137](https://github.com/harttle/liquidjs/issues/137) ([3b9fc7e](https://github.com/harttle/liquidjs/commit/3b9fc7e))
### BREAKING CHANGES
* Tag#render now returns void, use emitter argument
to write rendered html.
* ship to Node.js 8, the dist/liquid.cjs.js (main) nolonger
supports Node.js 6, other bundles are also provided via dist/liquid.esm.js, dist/liquid.js (ES5 umd) and liquid.min.js (minified ES5 umd)
* remove default export, now should be used like import
{Liquid} from 'liquidjs'
## [8.5.3](https://github.com/harttle/liquidjs/compare/v8.5.2...v8.5.3) (2019-08-25)
### Bug Fixes
* escape filter when input is undefined ([a00945c](https://github.com/harttle/liquidjs/commit/a00945c))
## [8.5.2](https://github.com/harttle/liquidjs/compare/v8.5.1...v8.5.2) (2019-08-09)
### Bug Fixes
* quotation tokenizing, [#151](https://github.com/harttle/liquidjs/issues/151) ([1e4f237](https://github.com/harttle/liquidjs/commit/1e4f237))
## [8.5.1](https://github.com/harttle/liquidjs/compare/v8.5.0...v8.5.1) (2019-08-05)
### Bug Fixes
* publish bin directory to npm, fixes [#146](https://github.com/harttle/liquidjs/issues/146) ([a85b650](https://github.com/harttle/liquidjs/commit/a85b650))
# [8.5.0](https://github.com/harttle/liquidjs/compare/v8.4.1...v8.5.0) (2019-08-01)
### Features
* CLI support ([fc045b5](https://github.com/harttle/liquidjs/commit/fc045b5))
## [8.4.1](https://github.com/harttle/liquidjs/compare/v8.4.0...v8.4.1) (2019-07-22)
### Bug Fixes
* some filters on undefined variable throws, [#140](https://github.com/harttle/liquidjs/issues/140) ([6e6ea0a](https://github.com/harttle/liquidjs/commit/6e6ea0a))
# [8.4.0](https://github.com/harttle/liquidjs/compare/v8.3.0...v8.4.0) (2019-07-06)
### Features
* at_least, at_most, sort_naturual for [#132](https://github.com/harttle/liquidjs/issues/132) ([e6f5f1c](https://github.com/harttle/liquidjs/commit/e6f5f1c))
# [8.3.0](https://github.com/harttle/liquidjs/compare/v8.2.4...v8.3.0) (2019-06-27)
### Features
* fs option implemented by [#138](https://github.com/harttle/liquidjs/issues/138) ([3f5e23c](https://github.com/harttle/liquidjs/commit/3f5e23c))
## [8.2.4](https://github.com/harttle/liquidjs/compare/v8.2.3...v8.2.4) (2019-06-17)
### Performance Improvements
* improve getTemplate() when cache is enabled ([1ffba2b](https://github.com/harttle/liquidjs/commit/1ffba2b))
## [8.2.3](https://github.com/harttle/liquidjs/compare/v8.2.2...v8.2.3) (2019-05-19)
### Bug Fixes
* reverse filter not pure, see [#126](https://github.com/harttle/liquidjs/issues/126) ([505c408](https://github.com/harttle/liquidjs/commit/505c408))
## [8.2.2](https://github.com/harttle/liquidjs/compare/v8.2.1...v8.2.2) (2019-05-12)
### Bug Fixes
* date from integer, [#125](https://github.com/harttle/liquidjs/issues/125) ([fdf0043](https://github.com/harttle/liquidjs/commit/fdf0043))
* pass drops directly to filters/tags ([bef2909](https://github.com/harttle/liquidjs/commit/bef2909))
## [8.2.1](https://github.com/harttle/liquidjs/compare/v8.2.0...v8.2.1) (2019-04-26)
### Bug Fixes
* `default` filter is not working with an empty string, [#122](https://github.com/harttle/liquidjs/issues/122) ([6075c0a](https://github.com/harttle/liquidjs/commit/6075c0a))
# [8.2.0](https://github.com/harttle/liquidjs/compare/v8.1.0...v8.2.0) (2019-04-17)
### Features
* pass context to filters ([00bc1ef](https://github.com/harttle/liquidjs/commit/00bc1ef))
# [8.1.0](https://github.com/harttle/liquidjs/compare/v8.0.3...v8.1.0) (2019-04-02)
### Features
* where filter, working on [#118](https://github.com/harttle/liquidjs/issues/118) ([daa0b57](https://github.com/harttle/liquidjs/commit/daa0b57))
## [8.0.3](https://github.com/harttle/liquidjs/compare/v8.0.2...v8.0.3) (2019-04-01)
### Bug Fixes
* slice filter on negative `begin`, [#117](https://github.com/harttle/liquidjs/issues/117) ([eadb6f3](https://github.com/harttle/liquidjs/commit/eadb6f3))
## [8.0.2](https://github.com/harttle/liquidjs/compare/v8.0.1...v8.0.2) (2019-03-25)
### Performance Improvements
* use polymophism instead duck test ([82d7673](https://github.com/harttle/liquidjs/commit/82d7673))
## [8.0.1](https://github.com/harttle/liquidjs/compare/v8.0.0...v8.0.1) (2019-03-22)
### Bug Fixes
* incorrect scope when using assign with for, fixes [#115](https://github.com/harttle/liquidjs/issues/115) ([defbb58](https://github.com/harttle/liquidjs/commit/defbb58))
# [8.0.0](https://github.com/harttle/liquidjs/compare/v7.5.1...v8.0.0) (2019-03-10)
### Code Refactoring
* use camelCase for JavaScript APIs ([64e0c87](https://github.com/harttle/liquidjs/commit/64e0c87))
### Features
* promise support for drops, working on [#65](https://github.com/harttle/liquidjs/issues/65) ([4a8088d](https://github.com/harttle/liquidjs/commit/4a8088d))
### BREAKING CHANGES
* Options and method names in JavaScript API are now renamed to cammelCase, for a complete list see #109
## [7.5.1](https://github.com/harttle/liquidjs/compare/v7.5.0...v7.5.1) (2019-03-05)
### Bug Fixes
* named params for filters, working on [#113](https://github.com/harttle/liquidjs/issues/113) ([5ffc904](https://github.com/harttle/liquidjs/commit/5ffc904))
# [7.5.0](https://github.com/harttle/liquidjs/compare/v7.4.0...v7.5.0) (2019-03-01)
### Features
* tablerowloop object ([3647305](https://github.com/harttle/liquidjs/commit/3647305))
# [7.4.0](https://github.com/harttle/liquidjs/compare/v7.3.1...v7.4.0) (2019-02-28)
### Bug Fixes
* math filters now return number, resolves [#110](https://github.com/harttle/liquidjs/issues/110) ([b4acdb4](https://github.com/harttle/liquidjs/commit/b4acdb4))
### Features
* exported Drop interface for [#107](https://github.com/harttle/liquidjs/issues/107) ([7bee9fc](https://github.com/harttle/liquidjs/commit/7bee9fc)), closes [#109](https://github.com/harttle/liquidjs/issues/109)
## [7.3.1](https://github.com/harttle/liquidjs/compare/v7.3.0...v7.3.1) (2019-02-25)
### Bug Fixes
* **#108:** remove absolute path in emitted d.ts ([53a835a](https://github.com/harttle/liquidjs/commit/53a835a)), closes [#108](https://github.com/harttle/liquidjs/issues/108)
# [7.3.0](https://github.com/harttle/liquidjs/compare/v7.2.2...v7.3.0) (2019-02-24)
### Features
* nil/null/empty/blank literals, resolves [#102](https://github.com/harttle/liquidjs/issues/102) ([88c9e96](https://github.com/harttle/liquidjs/commit/88c9e96))
## [7.2.2](https://github.com/harttle/liquidjs/compare/v7.2.1...v7.2.2) (2019-02-23)
### Bug Fixes
* filters break when argument contains [()|, fixes [#89](https://github.com/harttle/liquidjs/issues/89) ([e977669](https://github.com/harttle/liquidjs/commit/e977669))
## [7.2.1](https://github.com/harttle/liquidjs/compare/v7.2.0...v7.2.1) (2019-02-22)
### Bug Fixes
* default length for truncate and truncatewords ([56c7992](https://github.com/harttle/liquidjs/commit/56c7992))
# [7.2.0](https://github.com/harttle/liquidjs/compare/v7.1.0...v7.2.0) (2019-02-20)
### Features
* override output/tag delimiter, fixes [#54](https://github.com/harttle/liquidjs/issues/54) ([d20a043](https://github.com/harttle/liquidjs/commit/d20a043))
### BREAKING CHANGES
* `trim_value_left` option renamed to `trim_output_left`, `trim_value_right` option renamed to `trim_output_right`
# [7.1.0](https://github.com/harttle/liquidjs/compare/v7.0.2...v7.1.0) (2019-02-20)
### Features
* throw an Error if delimiter not matched ([c33d8f6](https://github.com/harttle/liquidjs/commit/c33d8f6))
# [7.0.0](https://github.com/harttle/liquidjs/compare/v6.4.3...v7.0.0) (2019-02-14)
### chore
* **TypeScript:** ship Liquid to class ([1cc7249](https://github.com/harttle/liquidjs/commit/1cc7249))
### BREAKING CHANGES
* **TypeScript:** calling `Liquid()` without `new` now becomes invalid
## [6.4.3](https://github.com/harttle/liquidjs/compare/v6.4.2...v6.4.3) (2019-02-13)
### Bug Fixes
* better index.d.ts and a demo ([2015f68](https://github.com/harttle/liquidjs/commit/2015f68)), closes [#98](https://github.com/harttle/liquidjs/issues/98)
## [6.4.2](https://github.com/harttle/liquidjs/compare/v6.4.1...v6.4.2) (2019-01-28)
### Bug Fixes
* **CI:** e2e not building cjs ([dde7b3b](https://github.com/harttle/liquidjs/commit/dde7b3b))
## [6.4.1](https://github.com/harttle/liquidjs/compare/v6.4.0...v6.4.1) (2019-01-28)
### Bug Fixes
* regenerator undefined ([a2caeb5](https://github.com/harttle/liquidjs/commit/a2caeb5))
+106 -195
View File
@@ -1,219 +1,130 @@
# shopify-liquid
# liquidjs
[![npm version](https://img.shields.io/npm/v/liquidjs.svg?logo=npm&style=flat-square)](https://www.npmjs.org/package/liquidjs)
[![npm downloads](https://img.shields.io/npm/dm/liquidjs.svg?style=flat-square)](https://www.npmjs.org/package/liquidjs)
[![Coverage](https://img.shields.io/coveralls/harttle/liquidjs.svg?style=flat-square)](https://coveralls.io/github/harttle/liquidjs?branch=master)
[![Build Status](https://img.shields.io/github/workflow/status/harttle/liquidjs/Check/master.svg?style=flat-square)](https://github.com/harttle/liquidjs/actions/workflows/check.yml?query=branch%3Amaster)
[![David dependencies](https://img.shields.io/david/harttle/liquidjs.svg?style=flat-square)](https://david-dm.org/harttle/liquidjs)
[![DUB license](https://img.shields.io/dub/l/vibe-d.svg?style=flat-square)](https://github.com/harttle/liquidjs/blob/master/LICENSE)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/harttle/liquidjs)
[![NPM version](https://img.shields.io/npm/v/shopify-liquid.svg?style=flat)](https://www.npmjs.org/package/shopify-liquid)
[![Build Status](https://travis-ci.org/harttle/shopify-liquid.svg?branch=master)](https://travis-ci.org/harttle/shopify-liquid)
[![Coverage Status](https://img.shields.io/coveralls/harttle/shopify-liquid/master.svg)](https://coveralls.io/github/harttle/shopify-liquid?branch=master)
[![Dependency manager](https://img.shields.io/david/harttle/shopify-liquid.svg?style=flat)](https://david-dm.org/harttle/shopify-liquid)
A simple, expressive and safe [Shopify][shopify/liquid] / Github Pages compatible template engine in pure JavaScript.
**The purpose of this repo** is to provide a standard Liquid implementation for the JavaScript community so that [Jekyll sites](https://jekyllrb.com), [Github Pages](https://pages.github.com/) and [Shopify templates](https://themes.shopify.com/) can be ported to Node.js without pain.
A feature-rich Liquid template engine for Node.js and browsers,
with compliance with [the Ruby version][shopify-liquid].
New to Liquid? Here's a live demo: <http://harttle.com/shopify-liquid/>
* [Documentation][doc]
* Please star [LiquidJS on GitHub][github]!
* Support [LiquidJS on Open Collective][oc] or [Patreon][patreon]
> The Liquid template engine is implemented in Ruby originally,
> which is used by [Jekyll][jekyll] and [Github Pages][gh].
<p align="center"><a href="https://liquidjs.com"><img height="155px" width="155px" src="https://liquidjs.com/icon/mstile-310x310.png" alt="logo"></a></p>
Features:
## Installation
* Pretty much [builtin filters](https://github.com/harttle/shopify-liquid/wiki/Builtin-Filters) and [builtin tags](https://github.com/harttle/shopify-liquid/wiki/Builtin-Tags)
* Async rendering, especially for tags
* [any-promise][any-promise]
Installation:
Install from npm in Node.js:
```bash
npm install --save shopify-liquid
npm install --save liquidjs
```
## Render from String
Parse and Render:
```javascript
var Liquid = require('shopify-liquid');
var engine = Liquid();
engine.parseAndRender('{{name | capitalize}}', {name: 'alice'})
.then(function(html){
// html === 'Alice'
});
```
Caching templates:
```javascript
var tpl = engine.parse('{{name | capitalize}}');
engine.render(tpl, {name: 'alice'})
.then(function(html){
// html === 'Alice'
});
```
## Render from File
```javascript
var engine = Liquid({
root: path.resolve(__dirname, 'views/'), // for layouts and includes
extname: '.liquid',
cache: false,
strict_filters: false, // default: false
strict_variables: false // default: false
});
engine.renderFile("hello.liquid", {name: 'alice'})
.then(function(html){
// html === 'Alice'
});
// equivalent to:
engine.renderFile("hello", {name: 'alice'})
.then(function(html){
// html === 'Alice'
});
```
* `root` is a directory or an array of directories to resolve layouts and includes, as well as the filename passed in when calling `.renderFile()`.
If an array, the files are looked up in the order they occur in the array.
Defaults to `process.cwd()`
* `extname` is used to lookup the template file when filepath doesn't include an extension name. Defaults to `.liquid`
* `cache` indicates whether or not to cache resolved templates. Defaults to `false`.
* `strict_filters` is used to enable strict filter existence. If set to `false`, undefined filters will be rendered as empty string. Otherwise, undefined filters will cause an exception. Defaults to `false`.
* `strict_variables` is used to enable strict variable derivation.
If set to `false`, undefined variables will be rendered as empty string.
Otherwise, undefined variables will cause an exception. Defaults to `false`.
## Use with Express.js
```javascript
// register liquid engine
app.engine('liquid', engine.express({
strict_variables: true, // Default: fasle
strict_filters: true // Default: false
}));
app.set('views', './views'); // specify the views directory
app.set('view engine', 'liquid'); // set to default
```
> There's an Express demo [here](demo/express/).
When using with Express.js, partials(includes and layouts) will be looked up in
both Liquid `root` and Express `views` directories.
## Use in Browser
[Download][releases] the dist files and import into your HTML.
And `window.Liquid` is what you want. There's also a [demo](demo/browser/).
Or use the UMD bundle from jsDelivr:
```html
<html lang="en">
<head>
<script src="dist/liquid.min.js"></script>
</head>
<body>
<script>
var engine = window.Liquid();
var src = '{{ name | capitalize}}';
var ctx = {
name: 'welcome to Shopify Liquid'
};
engine.parseAndRender(src, ctx)
.then(function(html) {
// html === Welcome to Shopify Liquid
});
</script>
</body>
</html>
<script src="https://cdn.jsdelivr.net/npm/liquidjs/dist/liquid.browser.min.js"></script>
```
Note: In [IE and Android UC][caniuse-promises] browser, you need a Promise implementation
registered to [any-promise][any-promise].
More details, refer to [The Setup Guide][setup].
## Includes
## Related Packages
```
// file: color.liquid
color: '{{ color }}' shape: '{{ shape }}'
* [gulp-liquidjs](https://www.npmjs.com/package/@tuanpham-dev/gulp-liquidjs): A shopify compatible Liquid template engine for Gulp using liquidjs.
* [grunt-liquify](https://www.npmjs.com/package/grunt-liquify): A Grunt task to process Liquid using liquidjs. Use it to add Liquid magic to your scripts and css assets.
* [react-liquid](https://github.com/aquibm/react-liquid#readme): Liquid templating language component for React
* [@11ty/eleventy](https://www.npmjs.com/package/@11ty/eleventy): A simpler static site generator. An alternative to Jekyll. Written in JavaScript. Transforms a directory of templates (of varying types) into HTML.
// file: theme.liquid
{% assign shape = 'circle' %}
{% include 'color' %}
{% include 'color' with 'red' %}
{% include 'color', color: 'yellow', shape: 'square' %}
```
## Backers
The output will be:
If you love LiquidJS or your company is using LiquidJS? Please consider [support us on Open Collective or Patreon][financial-support].
```
color: '' shape: 'circle'
color: 'red' shape: 'circle'
color: 'yellow' shape: 'square'
```
![backers from open-collective](https://opencollective.com/liquidjs/tiers/backer.svg?avatarHeight=97)
## Layouts
## Contributors ✨
```
// file: default-layout.liquid
Header
{% block content %}My default content{% endblock %}
Footer
Want to contribute? see [Contribution Guidelines][contribution]. Thanks goes to these wonderful people:
// file: page.liquid
{% layout "default-layout" %}
{% block content %}My page content{% endblock %}
```
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://harttle.land"><img src="https://avatars3.githubusercontent.com/u/4427974?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jun Yang</b></sub></a><br /><a href="#maintenance-harttle" title="Maintenance">🚧</a> <a href="https://github.com/harttle/liquidjs/commits?author=harttle" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/chenos"><img src="https://avatars0.githubusercontent.com/u/2993310?v=4?s=100" width="100px;" alt=""/><br /><sub><b>chenos</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=chenos" title="Code">💻</a></td>
<td align="center"><a href="https://zachleat.com/"><img src="https://avatars2.githubusercontent.com/u/39355?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Zach Leatherman</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/issues?q=author%3Azachleat" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/thardy"><img src="https://avatars3.githubusercontent.com/u/120636?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tim Hardy</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=thardy" title="Code">💻</a></td>
<td align="center"><a href="https://paulrobertlloyd.com/"><img src="https://avatars3.githubusercontent.com/u/813383?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Paul Robert Lloyd</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=paulrobertlloyd" title="Code">💻</a> <a href="https://github.com/harttle/liquidjs/issues?q=author%3Apaulrobertlloyd" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://twitter.com/alecdotbiz"><img src="https://avatars2.githubusercontent.com/u/1925840?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Alec Larson</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=aleclarson" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/pmalouin"><img src="https://avatars1.githubusercontent.com/u/1411117?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Patrick Malouin</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=pmalouin" title="Code">💻</a> <a href="https://github.com/harttle/liquidjs/commits?author=pmalouin" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="https://jaswrks.com"><img src="https://avatars3.githubusercontent.com/u/1563559?v=4?s=100" width="100px;" alt=""/><br /><sub><b>jaswrks</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=jaswrks" title="Code">💻</a></td>
<td align="center"><a href="https://oott123.com"><img src="https://avatars2.githubusercontent.com/u/905663?v=4?s=100" width="100px;" alt=""/><br /><sub><b>三三</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=oott123" title="Code">💻</a> <a href="#ideas-oott123" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://github.com/ssendev"><img src="https://avatars0.githubusercontent.com/u/450793?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ssendev</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=ssendev" title="Code">💻</a> <a href="https://github.com/harttle/liquidjs/commits?author=ssendev" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/wojtask9"><img src="https://avatars3.githubusercontent.com/u/6099236?v=4?s=100" width="100px;" alt=""/><br /><sub><b>wojtask9</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=wojtask9" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/thelornenelson"><img src="https://avatars3.githubusercontent.com/u/24596583?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Andrew Barclay</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=thelornenelson" title="Code">💻</a></td>
<td align="center"><a href="https://www.stam.pr/"><img src="https://avatars2.githubusercontent.com/u/142338?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Cory Mawhorter</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=cmawhorter" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/thehappybug"><img src="https://avatars0.githubusercontent.com/u/3393530?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mehdi Jaffery</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=thehappybug" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/robinbijlani"><img src="https://avatars0.githubusercontent.com/u/2503108?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Robin Bijlani</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=robinbijlani" title="Code">💻</a> <a href="https://github.com/harttle/liquidjs/issues?q=author%3Arobinbijlani" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://www.rmkennedy.com"><img src="https://avatars3.githubusercontent.com/u/8356669?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ryan Kennedy</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=ryaninvents" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/strax"><img src="https://avatars2.githubusercontent.com/u/587213?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Sami Kukkonen</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=strax" title="Code">💻</a></td>
<td align="center"><a href="https://ScottFreeCode.github.io/"><img src="https://avatars3.githubusercontent.com/u/16506071?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Scott Santucci</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=ScottFreeCode" title="Code">💻</a></td>
<td align="center"><a href="http://stevenrescigno.com"><img src="https://avatars3.githubusercontent.com/u/8505293?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Steven </b></sub></a><br /><a href="#example-stevenanthonyrevo" title="Examples">💡</a> <a href="https://github.com/harttle/liquidjs/commits?author=stevenanthonyrevo" title="Code">💻</a></td>
<td align="center"><a href="https://efcl.info/"><img src="https://avatars1.githubusercontent.com/u/19714?v=4?s=100" width="100px;" alt=""/><br /><sub><b>azu</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=azu" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/wyozi"><img src="https://avatars3.githubusercontent.com/u/4894573?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Joonas</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=wyozi" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/jamelait"><img src="https://avatars1.githubusercontent.com/u/14369255?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jamel A.</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=jamelait" title="Code">💻</a></td>
<td align="center"><a href="https://brandonpittman.net"><img src="https://avatars0.githubusercontent.com/u/967145?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Brandon Pittman</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=brandonpittman" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/tgrandgent"><img src="https://avatars3.githubusercontent.com/u/17069042?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tgrandgent</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=tgrandgent" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/mastodon0"><img src="https://avatars1.githubusercontent.com/u/7924332?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Martin Schuster</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=mastodon0" title="Code">💻</a></td>
<td align="center"><a href="http://js.chenlei.me"><img src="https://avatars0.githubusercontent.com/u/6339390?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ray</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=richardo2016" title="Tests">⚠️</a> <a href="https://github.com/harttle/liquidjs/commits?author=richardo2016" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/CriGoT"><img src="https://avatars0.githubusercontent.com/u/1936786?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Cristofer Gonzales</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=CriGoT" title="Code">💻</a></td>
<td align="center"><a href="https://www.raymondcamden.com"><img src="https://avatars3.githubusercontent.com/u/393660?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Raymond Camden</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=cfjedimaster" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="https://stedman.dev"><img src="https://avatars1.githubusercontent.com/u/183122?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Steve Stedman</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=stedman" title="Documentation">📖</a></td>
<td align="center"><a href="https://ciccarello.me"><img src="https://avatars0.githubusercontent.com/u/11273838?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Anthony Ciccarello</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=aciccarello" title="Documentation">📖</a></td>
<td align="center"><a href="https://twitter.com/IAmTrySound"><img src="https://avatars0.githubusercontent.com/u/5635476?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Bogdan Chadkin</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=TrySound" title="Code">💻</a></td>
<td align="center"><a href="https://hightouch.io"><img src="https://avatars0.githubusercontent.com/u/5959235?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tejas Manohar</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=tejasmanohar" title="Code">💻</a></td>
<td align="center"><a href="http://about.me/peterdehaan"><img src="https://avatars2.githubusercontent.com/u/557895?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Peter deHaan</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=pdehaan" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/amit777"><img src="https://avatars0.githubusercontent.com/u/2703309?v=4?s=100" width="100px;" alt=""/><br /><sub><b>amit777</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=amit777" title="Code">💻</a> <a href="#financial-amit777" title="Financial">💵</a></td>
<td align="center"><a href="http://www.ifi.uzh.ch/en/ce/people/schuldenzucker.html"><img src="https://avatars3.githubusercontent.com/u/1100776?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Steffen Schuldenzucker</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=sschuldenzucker" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/Pixcell"><img src="https://avatars0.githubusercontent.com/u/4005291?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pixcell</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=Pixcell" title="Code">💻</a></td>
<td align="center"><a href="https://jasonet.co"><img src="https://avatars.githubusercontent.com/u/10660468?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jason Etcovitch</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=JasonEtco" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/kayuapi"><img src="https://avatars.githubusercontent.com/u/10304328?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ZC</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=kayuapi" title="Documentation">📖</a></td>
<td align="center"><a href="https://memmie.lenglet.name"><img src="https://avatars.githubusercontent.com/u/729275?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Memmie Lenglet</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=mems" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/ilhamdev0"><img src="https://avatars.githubusercontent.com/u/57636145?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ilhamdev0</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=ilhamdev0" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/c412216887"><img src="https://avatars.githubusercontent.com/u/29691650?v=4?s=100" width="100px;" alt=""/><br /><sub><b>一饮一啄皆是人生</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=c412216887" title="Documentation">📖</a></td>
<td align="center"><a href="https://digitalinspiration.com/"><img src="https://avatars.githubusercontent.com/u/1344071?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Amit Agarwal</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=labnol" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center"><a href="https://n1ru4l.cloud/"><img src="https://avatars.githubusercontent.com/u/14338007?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Laurin Quast</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=n1ru4l" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/mattvague"><img src="https://avatars.githubusercontent.com/u/64985?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Matt Vague</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=mattvague" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/bglw"><img src="https://avatars.githubusercontent.com/u/40188355?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Liam Bigelow</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=bglw" title="Code">💻</a></td>
</tr>
</table>
The output of `page.liquid`:
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
```
Header
My page content
Footer
```
<!-- ALL-CONTRIBUTORS-LIST:END -->
* It's possible to define multiple blocks.
* block name is optional when there's only one block.
## Register Filters
```javascript
// Usage: {{ name | uppper }}
engine.registerFilter('upper', function(v){
return v.toUpperCase();
});
```
> See existing filter implementations: <https://github.com/harttle/shopify-liquid/blob/master/filters.js>
## Register Tags
```javascript
// Usage: {% upper name%}
engine.registerTag('upper', {
parse: function(tagToken, remainTokens) {
this.str = tagToken.args; // name
},
render: function(scope, hash) {
var str = Liquid.evalValue(this.str, scope); // 'alice'
return Promise.resolve(str.toUpperCase()); // 'Alice'
}
});
```
> See existing tag implementations: <https://github.com/harttle/shopify-liquid/blob/master/tags/>
## Contribution Guide
1. Write a [test][test] to define the feature you want.
2. Just initiate an issue, or optionally:
3. Get your test pass and make a pull request.
[nunjucks]: http://mozilla.github.io/nunjucks/
[liquid-node]: https://github.com/sirlantis/liquid-node
[shopify-liquid]: https://shopify.github.io/liquid/
[jekyll]: http://jekyllrb.com/
[gh]: https://pages.github.com/
[releases]: https://github.com/harttle/shopify-liquid/releases
[any-promise]: https://github.com/kevinbeaty/any-promise
[test]: https://github.com/harttle/shopify-liquid/tree/master/test
[caniuse-promises]: http://caniuse.com/#feat=promises
[shopify/liquid]: https://shopify.github.io/liquid/
[plugins]: https://liquidjs.com/tutorials/plugins.html#Plugin-List
[setup]: https://liquidjs.com/tutorials/setup.html
[doc]: https://liquidjs.com
[github]: https://github.com/harttle/liquidjs
[patreon]: https://www.patreon.com/harttle
[oc]: https://opencollective.com/liquidjs/
[contribution]: https://liquidjs.com/tutorials/contribution-guidelines.html
[financial-support]: https://liquidjs.com/tutorials/contribution-guidelines.html#Financial-Support
+13
View File
@@ -0,0 +1,13 @@
# Security Policy
## Supported Versions
Only the latest major version is supported with security updates. It can be changed if many people are relying on a specific version for some reason. If this is the case, welcome to file an issue.
## Reporting a Vulnerability
Please contact yangjvn@126.com to report a vulnerability.
- It will be fixed very soon (maybe within 1 week or couple of days) if that vulnerability obviously affects common use cases.
- Otherwise, it'll be scheduled with a priority just like requested features (which is lower than bugs).
- If it's declined, you'll receive an email (more oftenly there will be a discuss).
+7
View File
@@ -0,0 +1,7 @@
{
"extends": ["standard"],
"rules": {
"no-unused-expressions": "off",
"@typescript-eslint/no-var-requires": "off"
}
}
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env node
const Benchmark = require('benchmark')
const data = require('./data/todolist.json')
const path = require('path')
const engines = {
handlebars: require('./engines/handlebars'),
liquid: require('./engines/liquid'),
react: require('./engines/react'),
swig: require('./engines/swig')
}
function crossEngines () {
console.log(' cross engines')
console.log('------------------------')
return new Promise(resolve => {
const suit = new Benchmark.Suite('cross engines')
for (const [name, { load, render }] of Object.entries(engines)) {
const tpl = load(path.resolve(__dirname, `templates/todolist`))
suit.add(name, () => render(tpl, data))
}
suit.on('cycle', event => console.log(String(event.target)))
suit.on('complete', resolve)
suit.run({ async: true })
})
}
module.exports = { crossEngines }
+28
View File
@@ -0,0 +1,28 @@
{
"categories": [{
"color": "red",
"id": "CAT1",
"title": "work"
}, {
"color": "red",
"id": "CAT2",
"title": "emergency"
}, {
"color": "green",
"id": "CAT3",
"title": "sport"
}],
"todos": [{
"title": "fork and clone",
"id": "TODO1",
"category": "work"
}, {
"title": "make it better",
"id": "TODO2",
"category": "sport"
}, {
"title": "make a pull request",
"id": "TODO3",
"category": "work"
}]
}
+37
View File
@@ -0,0 +1,37 @@
const Benchmark = require('benchmark')
const { Liquid } = require('..')
const ctx = require('./data/todolist.json')
const { resolve } = require('path')
const engine = new Liquid({
root: resolve(__dirname, 'templates'),
extname: '.liquid'
})
engine.registerTag('header', {
parse: function (token) {
const [key, val] = token.args.split(':')
this[key] = val
},
render: function (ctx) {
const title = this.liquid.evalValue(this.content, ctx)
return `<h1>${title}</h1>`
}
})
function demo () {
console.log(' demo')
console.log('------------------------')
return new Promise(resolve => {
new Benchmark.Suite('demo')
.add('demo', {
defer: true,
fn: d => engine.renderFile('todolist', ctx).then(x => d.resolve(x))
})
.on('cycle', event => console.log(String(event.target)))
.on('complete', resolve)
.run({ 'async': true })
})
}
module.exports = { demo }
+50
View File
@@ -0,0 +1,50 @@
#!/usr/bin/env node
const { performance } = require('perf_hooks')
const path = require('path')
const FILE_LOCAL = process.argv[2]
const FILE_LATEST = process.argv[3]
console.log(`Local: ${FILE_LOCAL}`)
console.log(`Latest: ${FILE_LATEST}`)
const { createEngine } = require('./engines/create-liquid')
const local = createEngine(require(path.resolve(__dirname, '..', FILE_LOCAL)))
const latest = createEngine(require(path.resolve(__dirname, '..', FILE_LOCAL)))
const data = require('./data/todolist.json')
const tpl = path.resolve(__dirname, `templates/todolist`)
const begin = performance.now()
const tplLocal = local.load(tpl)
const tplLatest = latest.load(tpl)
const tasks = [
{
cycles: 0,
time: 0,
fn: () => latest.render(tplLatest, data)
},
{
cycles: 0,
time: 0,
fn: () => local.render(tplLocal, data)
}
]
while (performance.now() - begin < 20e3) {
const task = tasks[Math.floor(Math.random() * 2)]
task.time -= performance.now()
task.fn()
task.time += performance.now()
task.cycles++
}
const [ latestResult, localResult ] = tasks.map(task => {
task.perf = task.cycles * 1000 / task.time
return task
})
const diff = (localResult.perf - latestResult.perf) / latestResult.perf
console.log(`Local: ${localResult.perf.toFixed(3)} ops/s (${localResult.cycles} cycles)`)
console.log(`Latest: ${latestResult.perf.toFixed(3)} ops/s (${latestResult.cycles} cycles)`)
console.log(`Diff: ${(diff * 100).toFixed(3)}%`)
const THRESHOLD_PERCENT = -3
process.exit(diff * 100 < THRESHOLD_PERCENT ? 1 : 0)
+17
View File
@@ -0,0 +1,17 @@
const { readFileSync } = require('fs')
const { join } = require('path')
function createEngine (pkg) {
const liquid = new pkg.Liquid({
root: join(__dirname, '../templates'),
cache: true,
extname: '.liquid'
})
liquid.registerFilter('url', path => `http://example.com${path}`)
return {
load: path => liquid.parse(readFileSync(path + '.liquid', 'utf8')),
render: (tpl, data) => liquid.renderSync(tpl, data)
}
}
module.exports = { createEngine }
+33
View File
@@ -0,0 +1,33 @@
const handlebars = require('handlebars')
const { readFileSync } = require('fs')
const { join } = require('path')
handlebars.registerPartial(
'todo-icon',
readFileSync(join(__dirname, '../templates/todo-icon.hbs'), 'utf8')
)
handlebars.registerHelper('concat', function (...args) {
return args.filter(x => typeof x === 'string').join('')
})
handlebars.registerHelper('url', function (path) {
return `http://example.com${path}`
})
handlebars.registerHelper('inc', function (num) {
return Number(num) + 1
})
handlebars.registerHelper('capitalize', function (str) {
return str[0].toUpperCase() + str.slice(1).toLowerCase()
})
handlebars.registerHelper('upcase', function (str) {
return str.toUpperCase()
})
module.exports = {
load: path => handlebars.compile(readFileSync(path + '.hbs', 'utf8')),
render: (tpl, data) => tpl(data)
}
+3
View File
@@ -0,0 +1,3 @@
const { createEngine } = require('./create-liquid')
module.exports = createEngine(require('../../dist/liquid.node.cjs'))
+20
View File
@@ -0,0 +1,20 @@
const { readFileSync } = require('fs')
const React = require('react')
const ReactDOMServer = require('react-dom/server')
const babel = require('@babel/core')
const requireFromString = require('require-from-string')
const babelConfig = {
presets: ['@babel/preset-react', '@babel/preset-env']
}
module.exports = {
load: path => {
const src = readFileSync(path + '.jsx', 'utf8')
const transformed = babel.transform(src, babelConfig)
return requireFromString(transformed.code)
},
render: (Component, data) => {
return ReactDOMServer.renderToString(React.createElement(Component, data))
}
}
+30
View File
@@ -0,0 +1,30 @@
const swig = require('swig')
swig.setFilter('url', function (path) {
return `http://example.com${path}`
})
swig.setFilter('prepend', function (input, arg) {
return arg + input
})
swig.setFilter('append', function (input, arg) {
return input + arg
})
swig.setFilter('inc', function (num) {
return Number(num) + 1
})
swig.setFilter('capitalize', function (str) {
return str[0].toUpperCase() + str.slice(1).toLowerCase()
})
swig.setFilter('upcase', function (str) {
return str.toUpperCase()
})
module.exports = {
load: path => swig.compileFile(path + '.swig'),
render: (tpl, data) => tpl(data)
}
+17
View File
@@ -0,0 +1,17 @@
const { output } = require('./output')
const { tag } = require('./tag')
const { demo } = require('./demo')
const { layout } = require('./layout')
const { memory } = require('./memory')
const { crossEngines } = require('./cross-engines')
async function main () {
await output()
await tag()
await demo()
await layout()
await memory()
await crossEngines()
}
main()
+39
View File
@@ -0,0 +1,39 @@
const Benchmark = require('benchmark')
const { Liquid } = require('..')
const engineOptions = {
root: __dirname,
extname: '.liquid'
}
const engine = new Liquid(engineOptions)
const cachingEngine = new Liquid({
...engineOptions,
cache: true
})
const template = `
{% layout "./templates/layout.liquid" %}
{% block body %}a small body{% endblock %}
`
function layout () {
console.log(' layout')
console.log('------------------------')
return new Promise(resolve => {
new Benchmark.Suite('layout')
.add('cache=false', {
defer: true,
fn: d => engine.parseAndRender(template, {}).then(x => d.resolve(x))
})
.add('cache=true', {
defer: true,
fn: d => cachingEngine.parseAndRender(template, {}).then(x => d.resolve(x))
})
.on('cycle', event => console.log(String(event.target)))
.on('complete', resolve)
.run({ 'async': true })
})
}
module.exports = { layout }
+62
View File
@@ -0,0 +1,62 @@
const { join } = require('path')
const { readFileSync } = require('fs')
const { getHeapStatistics } = require('v8')
const { Liquid } = require('..')
const engineOptions = {
root: __dirname,
extname: '.liquid'
}
const engine = new Liquid(engineOptions)
const SAMPLE_COUNT = 1024
function memory () {
console.log(' memory')
console.log('------------------------')
html()
todolist()
}
function html () {
const str = readFileSync(join(__dirname, 'templates/lorem-html.liquid'), 'utf8')
global.gc()
const base = getHeapStatistics().used_heap_size
const templates = []
for (let i = 0; i < SAMPLE_COUNT; i++) {
templates.push(engine.parse(str))
}
const diff1 = (getHeapStatistics().used_heap_size - base) / SAMPLE_COUNT
console.log(`[lorem-html ${h(str.length)}][before GC] ${h(diff1)}/tpl (${SAMPLE_COUNT} runs sampled)`)
global.gc()
const diff2 = (getHeapStatistics().used_heap_size - base) / SAMPLE_COUNT
console.log(`[lorem-html ${h(str.length)}][after GC] ${h(diff2)}/tpl (${SAMPLE_COUNT} runs sampled)`)
}
function todolist () {
const str = readFileSync(join(__dirname, 'templates/todolist.liquid'), 'utf8')
global.gc()
const base = getHeapStatistics().used_heap_size
const templates = []
for (let i = 0; i < SAMPLE_COUNT; i++) {
templates.push(engine.parse(str))
}
const diff1 = (getHeapStatistics().used_heap_size - base) / SAMPLE_COUNT
console.log(`[todolist ${h(str.length)}][before GC] ${h(diff1)}/tpl (${SAMPLE_COUNT} runs sampled)`)
global.gc()
const diff2 = (getHeapStatistics().used_heap_size - base) / SAMPLE_COUNT
console.log(`[todolist ${h(str.length)}][after GC] ${h(diff2)}/tpl (${SAMPLE_COUNT} runs sampled)`)
}
function h (size) {
return (size / 1024).toFixed(3) + ' KB'
}
module.exports = { memory }
+29
View File
@@ -0,0 +1,29 @@
const Benchmark = require('benchmark')
const { Liquid } = require('..')
const liquid = new Liquid()
function output () {
console.log(' output')
console.log('------------------------')
return new Promise(resolve => {
new Benchmark.Suite('output')
.add('literal', test('{{false}}{{"foo"}}{{32.322}}'))
.add('truncate', test('{{"foobar" | truncate: 3}}'))
.add('date', test('{{"now" | date: "%d%Y%m"}}'))
.add('escape', test('{{"1<2" | escape}}'))
.add('default', test('{{"" | default: 3}}'))
.on('cycle', (event) => console.log(String(event.target)))
.on('complete', resolve)
.run({ 'async': true })
})
}
function test (str) {
return {
defer: true,
fn: d => liquid.parseAndRender(str).then(x => d.resolve(x))
}
}
module.exports = { output }
+3380
View File
File diff suppressed because it is too large Load Diff
+23
View File
@@ -0,0 +1,23 @@
{
"name": "benchmark",
"private": true,
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node --expose-gc index",
"engines": "node -e 'require(\"./cross-engines\").crossEngines()'"
},
"author": "",
"license": "ISC",
"dependencies": {
"@babel/core": "^7.13.14",
"@babel/preset-env": "^7.13.12",
"@babel/preset-react": "^7.13.13",
"handlebars": "^4.7.7",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"require-from-string": "^2.0.2",
"swig": "^1.4.2"
}
}
+33
View File
@@ -0,0 +1,33 @@
const Benchmark = require('benchmark')
const { Liquid } = require('..')
const liquid = new Liquid()
function tag () {
console.log(' tag')
console.log('------------------------')
return new Promise(resolve => {
new Benchmark.Suite('tag')
.add('if', test('{% if "foobar" %}foo{% endif %}'))
.add('unless', test('{%unless "foo"%}true{%else%}false{%endunless%}'))
.add('for', test('{% for i in (1..3) %}{{fooloop.index}}{% endfor %}'))
.add('switch', test('{%case 3%}{% when 1 %}1{% when 2 %}2{% when 3 %}3{%endcase%}'))
.add('assign', test('{%assign a="foo bar"%}'))
.add('capture', test('{%capture foo%}what is this{%endcapture%}'))
.add('increment', test('{%increment a%}'))
.add('decrement', test('{%decrement a%}'))
.add('tablerow', test('{%tablerow i in (1..10) cols:3%}{%endtablerow%}'))
.on('cycle', (event) => console.log(String(event.target)))
.on('complete', resolve)
.run({ 'async': true })
})
}
function test (str) {
return {
defer: true,
fn: d => liquid.parseAndRender(str).then(x => d.resolve(x))
}
}
module.exports = { tag }
+2
View File
@@ -0,0 +1,2 @@
This is a barely empty layout with a body:
{% block body %}{% endblock %}
+38
View File
@@ -0,0 +1,38 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<!-- You may use a different charset if needed -->
<title>Latin Lipsum - Courtesy generator.lorem-ipsum.info</title>
</head>
<body>
<p>Lorem ipsum dolor sit amet, falli detraxit facilisis sit ex. Nec vidit nihil ut, vis utamur definitionem in. Ancillae phaedrum ut eos. Ne eam errem cotidieque.
</p>
<p>
Sit amet vitae referrentur ad, oportere necessitatibus vituperatoribus vim ne. Audiam quaeque nusquam ei eos, mel ex adhuc prompta complectitur. Decore voluptua cotidieque vel ei, veri novum persecuti te sea. Nisl novum sea cu. Dicta delicatissimi ut est. Et has eripuit impedit mediocrem.
</p>
<p>
Eu vim evertitur argumentum, pro legendos iudicabit voluptatibus ne. Ne alii nullam deserunt duo, vis no animal verterem. Ne quo veniam euripidis. Pri discere mentitum vituperatoribus ne. Meliore corrumpit vim at, has ea admodum convenire.
</p>
<p>
Ne mea alii detraxit electram, his ne epicurei gloriatur consetetur. Ex pro aeque omnes appareat, possit integre accommodare eu quo. Qui in porro molestiae, no sit equidem petentium patrioque, omnes voluptaria vim te. Odio quot rebum ad sed, ei sale reque inani sea.
</p>
<p>
At mea vidit petentium, mei lorem pertinacia signiferumque ne. Per eu dicam postea probatus, sea pericula accusamus omittantur ad. Id mei munere ullamcorper. Oportere ocurreret cu vel. Pri ne dicant soluta graecis, duis ponderum corrumpit sed eu, pro ei rebum vivendum.
</p>
<p>
Eum ea exerci sententiae constituam, ut lorem putant volutpat pro. Vix ex iudicabit salutatus principes, pri nisl erat ut, ne cum persius verterem phaedrum. Vix mundi vitae eu. Vel summo vocent albucius in. Qui omnis partem possim ex, wisi doctus efficiantur cu has. Aperiri denique ea pri, cum dissentias signiferumque eu. Per posse dissentiet necessitatibus id, omnis eleifend te mel.
</p>
<p>
Phaedrum erroribus adolescens ut nec, duo mutat viris id. In tale purto dolores sit, ei consul inermis est, his ea movet expetenda. Cibo scribentur id eam, per an quem iracundia, has erat zril solet eu. Falli fierent ne cum, eam placerat facilisis suscipiantur te. Id quo dicat tractatos definiebas, est copiosae splendide id.
</p>
<p>
Constituto neglegentur qui ne, eum ne putent phaedrum, no quod nominati consulatu per. Mei cu accusam principes interesset, vim fugit abhorreant eu, ludus feugait an sed. Clita expetendis definitionem has in, meis pericula no mea, soluta nemore cotidieque eos cu. Summo populo signiferumque pri eu, eum no labores democritum posidonium, pro ignota adipisci in. Tollit molestie id mei.
</p>
<p>
Ipsum impetus et eam, ei his epicuri instructior. Impedit ullamcorper vim an. Impedit ullamcorper vim an. Et eum senserit sententiae reprimique, quem detracto sententiae at sed, no inermis ocurreret rationibus sea pericula no.
</body></html>
+1
View File
@@ -0,0 +1 @@
<img title="risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices" src="http://images.example.com/{{id}}.png">
+1
View File
@@ -0,0 +1 @@
<img title="risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices" src="http://images.example.com/{{id}}.png">
+1
View File
@@ -0,0 +1 @@
<img title="risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices" src="http://images.example.com/{{todo.id}}.png">
+44
View File
@@ -0,0 +1,44 @@
<section class="todo-list">
<h1>
posuere cubilia Curae; Vestibulum hendrerit malesuada odio. Fusce ut elit
ut augue sollicitudin blandit. Phasellus volutpat lorem. Duis non pede et
neque luctus tincidunt. Duis interdum tempus elit.
<small>Aenean metus. Vestibulum ac lacus. Vivamus porttitor, massa ut.</small>
</h1>
<a href={{url "/add"}} class="todo-add"><i class="fa fa-plus-square"></i>Add Todo</a>
<ul class="filter-category">
{{#each categories }}
<li style="background: {{ color }}">
<a href="/todos/category/{{ id }}">{{ title }}</a>
</li>
{{/each}}
</ul>
{{#each todos }}
<div>
<h2>
Todo {{inc @index}}:
<span class="todo-item content" data-todo-index="{{@index}}">
{{ upcase (concat 'TODO: ' title) }}
</span>
</h2>
{{> todo-icon id=id }}
<p class="description">
Purus eu mi. Proin commodo, massa commodo dapibus elementum,
libero lacus pulvinar eros, ut tincidunt nisl elit ut velit. Cras rutrum
porta purus. Vivamus lorem. Sed turpis enim, faucibus quis, pharetra in,
sagittis sed, magna. Curabitur ultricies felis ut libero. Nullam tincidunt
enim eu nibh. Nunc eget ipsum in sem facilisis convallis. Proin fermentum
</p>
<div class="todo-meta">
{{# if category }}
<span>{{ capitalize category }}</span>
{{/if}}
</div>
<a class="btn btn-primary" href={{ url (concat "/edit/" id) }}><i class="fa fa-pencil"></i> Edit</a>
<a class="btn btn-default"><i class="fa fa-check"></i> Check</a>
<a class="btn ben-danger" href={{ url (concat "/delete/" id) }}><i class="fa fa-trash-o"</i> Trash</a>
</div>
{{/each}}
</section>
+57
View File
@@ -0,0 +1,57 @@
// eslint-disable-next-line
const React = require('react')
function capitalize (str) {
return str[0].toUpperCase() + str.slice(1).toLowerCase()
}
function url (path) {
return `http://example.com${path}`
}
function renderTodoIcon (id) {
return <img title="risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices" src="http://images.example.com/{id}.png"/>
}
module.exports = ({ categories, todos }) => {
return <section className="todo-list">
<h1>
posuere cubilia Curae; Vestibulum hendrerit malesuada odio. Fusce ut elit
ut augue sollicitudin blandit. Phasellus volutpat lorem. Duis non pede et
neque luctus tincidunt. Duis interdum tempus elit.
<small>Aenean metus. Vestibulum ac lacus. Vivamus porttitor, massa ut.</small>
</h1>
<a href={url('/add')} className="todo-add"><i className="fa fa-plus-square"></i>Add Todo</a>
<ul className="filter-category">
{categories.map((item, i) => {
return <li key={i} style={{ background: item.color }}>
<a href={'/todos/category/' + item.id }>{ item.title }</a>
</li>
})}
</ul>
{todos.map((todo, index0) => {
return <div key={index0}>
<h2>
Todo { index0 + 1 }:
<span className="todo-item content" data-todo-index="{{ forloop.index0 }}">
{ ('TODO: ' + todo.title).toUpperCase() }
</span>
</h2>
{ renderTodoIcon(todo.id) }
<p className="description">
Purus eu mi. Proin commodo, massa commodo dapibus elementum,
libero lacus pulvinar eros, ut tincidunt nisl elit ut velit. Cras rutrum
porta purus. Vivamus lorem. Sed turpis enim, faucibus quis, pharetra in,
sagittis sed, magna. Curabitur ultricies felis ut libero. Nullam tincidunt
enim eu nibh. Nunc eget ipsum in sem facilisis convallis. Proin fermentum
</p>
<div className="todo-meta">
{ todo.category ? <span>{capitalize(todo.category)}</span> : '' }
</div>
<a className="btn btn-primary" href={url('/edit/' + todo.id)}><i className="fa fa-pencil"></i> Edit</a>
<a className="btn btn-default"><i className="fa fa-check"></i> Check</a>
<a className="btn ben-danger" href={url('/delete/' + todo.id)}><i className="fa fa-trash-o"></i> Trash</a>
</div>
})}
</section>
}
+44
View File
@@ -0,0 +1,44 @@
<section class="todo-list">
<h1>
posuere cubilia Curae; Vestibulum hendrerit malesuada odio. Fusce ut elit
ut augue sollicitudin blandit. Phasellus volutpat lorem. Duis non pede et
neque luctus tincidunt. Duis interdum tempus elit.
<small>Aenean metus. Vestibulum ac lacus. Vivamus porttitor, massa ut.</small>
</h1>
<a href={{"/add" | url}} class="todo-add"><i class="fa fa-plus-square"></i>Add Todo</a>
<ul class="filter-category">
{% for item in categories %}
<li style="background: {{ item.color }}">
<a href="/todos/category/{{ item.id }}">{{ item.title }}</a>
</li>
{% endfor %}
</ul>
{% for todo in todos %}
<div>
<h2>
Todo {{ forloop.index }}:
<span class="todo-item content" data-todo-index="{{ forloop.index0 }}">
{{ todo.title | prepend: 'TODO: ' | upcase }}
</span>
</h2>
{% render "todo-icon", id:todo.id %}
<p class="description">
Purus eu mi. Proin commodo, massa commodo dapibus elementum,
libero lacus pulvinar eros, ut tincidunt nisl elit ut velit. Cras rutrum
porta purus. Vivamus lorem. Sed turpis enim, faucibus quis, pharetra in,
sagittis sed, magna. Curabitur ultricies felis ut libero. Nullam tincidunt
enim eu nibh. Nunc eget ipsum in sem facilisis convallis. Proin fermentum
</p>
<div class="todo-meta">
{% if todo.category %}
<span>{{ todo.category | capitalize }}</span>
{% endif %}
</div>
<a class="btn btn-primary" href={{"/edit/" | append: todo.id | url }}><i class="fa fa-pencil"></i> Edit</a>
<a class="btn btn-default"><i class="fa fa-check"></i> Check</a>
<a class="btn ben-danger" href={{"/delete/" | append: todo.id | url }}><i class="fa fa-trash-o"</i> Trash</a>
</div>
{% endfor %}
</section>
+44
View File
@@ -0,0 +1,44 @@
<section class="todo-list">
<h1>
posuere cubilia Curae; Vestibulum hendrerit malesuada odio. Fusce ut elit
ut augue sollicitudin blandit. Phasellus volutpat lorem. Duis non pede et
neque luctus tincidunt. Duis interdum tempus elit.
<small>Aenean metus. Vestibulum ac lacus. Vivamus porttitor, massa ut.</small>
</h1>
<a href={{"/add" | url}} class="todo-add"><i class="fa fa-plus-square"></i>Add Todo</a>
<ul class="filter-category">
{% for item in categories %}
<li style="background: {{ item.color }}">
<a href="/todos/category/{{ item.id }}">{{ item.title }}</a>
</li>
{% endfor %}
</ul>
{% for todo in todos %}
<div>
<h2>
Todo {{ loop.index }}:
<span class="todo-item content" data-todo-index="{{ loop.index0 }}">
{{ todo.title | prepend('TODO: ') | upcase }}
</span>
</h2>
{% include "todo-icon.swig" %}
<p class="description">
Purus eu mi. Proin commodo, massa commodo dapibus elementum,
libero lacus pulvinar eros, ut tincidunt nisl elit ut velit. Cras rutrum
porta purus. Vivamus lorem. Sed turpis enim, faucibus quis, pharetra in,
sagittis sed, magna. Curabitur ultricies felis ut libero. Nullam tincidunt
enim eu nibh. Nunc eget ipsum in sem facilisis convallis. Proin fermentum
</p>
<div class="todo-meta">
{% if todo.category %}
<span>{{ todo.category | capitalize }}</span>
{% endif %}
</div>
<a class="btn btn-primary" href={{"/edit/" | append(todo.id) | url }}><i class="fa fa-pencil"></i> Edit</a>
<a class="btn btn-default"><i class="fa fa-check"></i> Check</a>
<a class="btn ben-danger" href={{"/delete/" | append(todo.id) | url }}><i class="fa fa-trash-o"</i> Trash</a>
</div>
{% endfor %}
</section>
+21
View File
@@ -0,0 +1,21 @@
{
"extends": ["standard"],
"env": {
"mocha": true,
"es6": true,
"browser": true,
"node": true
},
"plugins": [
"mocha",
"standard",
"promise"
],
"rules": {
"no-var": 2,
"prefer-const": 2,
"@typescript-eslint/no-var-requires": "off",
"no-unused-vars": "off",
"indent": "off"
}
}
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
rm -rf docs/source/api docs/source/zh-cn/api
typedoc ./src --gitRevision master --out docs/source/api --plugin typedoc-plugin-markdown --theme vuepress
rm docs/source/api/README.md
for file in $(find docs/source/api -name "*.md"); do
sed -i \
-e 's/\(\]([^_)]*\)\/_/\1\//g' \
-e 's/\(\]([^)]*\.\)md/\1html/g' \
-e 's/\](_/\](/g' \
-e 's/{%/{% raw %}{%{% endraw %}/g' \
-e 's/{{/{% raw %}{{{% endraw %}/g' \
-e '1 s/"/\&quot;/g' \
-e '1 s/</\&lt;/g' \
-e '1 s/>/\&gt;/g' \
-e '1 s/\*//g' \
-e '1 s/^# \(.*\)/---\ntitle: "\1"\nauto: true\n---/' \
$file
target=${file/\/_/\/}
if [ "$file" != "$target" ]; then
mv $file $target
fi
done
cp -r docs/source/api docs/source/zh-cn/api
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
cp .all-contributorsrc docs/.all-contributorsrc
sed -i \
-e 's/README.md/docs\/themes\/navy\/layout\/partial\/all-contributors.swig/g' \
-e 's/"contributorsPerLine": 7/"contributorsPerLine": 65535/g' \
docs/.all-contributorsrc
all-contributors --config docs/.all-contributorsrc generate
sed -i 's/<br \/>.*<\/td>/<\/a><\/td>/g' docs/themes/navy/layout/partial/all-contributors.swig
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
./bin/build-contributors.sh
./bin/build-apidoc.sh
cd docs
npm ci
npm run build
cp CNAME public/
cp ../CHANGELOG.md source/tutorials/changelog.md
sed -i \
-e 's/{%/{% raw %}{%{% endraw %}/g' \
-e 's/{{/{% raw %}{{{% endraw %}/g' \
-e '1 s/"/\&quot;/g' \
-e '1 s/</\&lt;/g' \
-e '1 s/>/\&gt;/g' \
source/tutorials/changelog.md
cp source/tutorials/changelog.md source/zh-cn/tutorials/changelog.md
sed -i '1i ---\ntitle: Changelog\nauto: true\n---\n' source/tutorials/changelog.md
sed -i '1i ---\ntitle: 更新日志\nauto: true\n---\n' source/zh-cn/tutorials/changelog.md
if [ "$HEXO_ALGOLIA_INDEXING_KEY" != "" ]; then
npm run index
fi
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Prerequisites:
# 1.imagemagick. try brew install imagemagick
# 2. logo.png in size 512x512
# 3. this script should be run with cwd docs/source/icon/
echo creating apple touch icons...
apple=(57x57 60x60 72x72 76x76 114x114 120x120 144x144 152x152)
for size in "${apple[@]}"; do
echo $size
convert logo.png -resize $size apple-touch-icon-$size.png
done
cp logo.png apple-touch-icon.png
convert logo.png \
\( +clone -alpha extract \
-draw 'fill black polygon 0,0 0,80 80,0 fill white circle 80,80 80,0' \
\( +clone -flip \) -compose Multiply -composite \
\( +clone -flop \) -compose Multiply -composite \
\) -alpha off -compose CopyOpacity -composite apple-touch-icon-precomposed.png
echo creating favicon...
convert logo.png -resize 48x48 ../favicon.ico
favicon=(16x16 32x32 96x96 160x160 196x196)
for size in "${favicon[@]}"; do
echo $size
convert logo.png -resize $size favicon-$size.png
done
echo creating mstile icons...
mstile=(70x70 144x144 150x150 310x310)
for size in "${mstile[@]}"; do
echo $size
convert logo.png -resize $size mstile-$size.png
done
convert mstile-150x150.png -gravity center -background white -extent 310x150 mstile-310x150.png
+43
View File
@@ -0,0 +1,43 @@
#!/usr/bin/env node
const isQuote = c => c === '"' || c === "'"
const isOperator = c => '!=<>'.includes(c)
const isNumber = c => c >= '0' && c <= '9'
const isCharacter = c => (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
const isIdentifier = c => '_-?'.includes(c) || isCharacter(c) || isNumber(c)
const isBlank = c => c === '\n' || c === '\t' || c === ' ' || c === '\r' || c === '\v' || c === '\f'
const isInlineBlank = c => c === '\t' || c === ' ' || c === '\r'
const isSign = c => c === '-' || c === '+'
// See https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/RegExp
const unicodeBlanks = '\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000'
const types = []
for (let i = 0; i < 128; i++) {
const c = String.fromCharCode(i)
let n = 0
if (isIdentifier(c)) n |= 1
if (isOperator(c)) n |= 2
if (isBlank(c)) n |= 4
if (isQuote(c)) n |= 8
if (isInlineBlank(c)) n |= 16
if (isNumber(c)) n |= 32
if (isSign(c)) n |= 64
types.push(n)
}
console.log(`
// **DO NOT CHANGE THIS FILE**
//
// This file is generated by bin/character-gen.js
// bitmask character types to boost performance
export const TYPES = [${types.join(', ')}]
export const IDENTIFIER = 1
export const OPERATOR = 2
export const BLANK = 4
export const QUOTE = 8
export const INLINE_BLANK = 16
export const NUMBER = 32
export const SIGN = 64
`.trim())
console.log([...unicodeBlanks].map(char => `TYPES[${char.charCodeAt(0)}]`).join(' = ') + ' = BLANK')
Executable
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env node
const Liquid = require('..').Liquid
const contextArg = process.argv.slice(2)[0]
let context = {}
if (contextArg) {
if (contextArg.endsWith('.json')) {
const fs = require('fs')
context = JSON.parse(fs.readFileSync(contextArg, 'utf8'))
} else {
context = JSON.parse(contextArg)
}
}
let tpl = ''
process.stdin.on('data', chunk => (tpl += chunk))
process.stdin.on('end', () => render(tpl))
async function render (tpl) {
const liquid = new Liquid()
const html = await liquid.parseAndRender(tpl, context)
process.stdout.write(html)
}
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
VERSION_LATEST=$(cat package.json | grep '"version":' | awk -F'"' '{print $4}')
FILE_LOCAL=dist/liquid.node.cjs.js
FILE_LATEST=dist/liquid.node.cjs.$VERSION_LATEST.js
URL_LATEST=https://unpkg.com/liquidjs@$VERSION_LATEST/dist/liquid.node.cjs.js
if [ ! -f $FILE_LATEST ]; then
curl $URL_LATEST > $FILE_LATEST
fi
if [ ! -f $FILE_LOCAL ]; then
BUNDLES=cjs npm run build:dist
fi
exec node benchmark/diff.js $FILE_LOCAL $FILE_LATEST
+1
View File
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] }
+9
View File
@@ -0,0 +1,9 @@
# LiquidJS for Browsers
## Get Started
```bash
cd demo/browser
npm install
npm start
```
+1
View File
@@ -0,0 +1 @@
access time: {{date|date: "%Y-%m-%d %H:%M:%S"}}
+10 -10
View File
@@ -1,26 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="../../dist/liquid.js"></script>
<title>liquidjs for the browser</title>
<script src="node_modules/liquidjs/dist/liquid.browser.min.js"></script>
</head>
<body>
<h2 id="header"></h2>
<script>
var engine = window.Liquid();
var src = 'Welcome to {{ name | capitalize}}, ' +
'access time: {{date|date: "%Y-%m-%d %H:%M:%S"}}';
var Liquid = window.liquidjs.Liquid
var engine = new Liquid({
extname: '.html',
cache: true
});
var src = "<h2>Welcome to {{ name | capitalize}}, {% include 'date.html' %}</h2>";
var ctx = {
name: 'Liquid',
date: new Date()
};
engine.parseAndRender(src, ctx)
.then(function(html) {
document.getElementById('header').innerHTML = html;
document.body.innerHTML = html
});
</script>
</body>
+16
View File
@@ -0,0 +1,16 @@
{
"name": "liquidjs-demo-browser",
"version": "1.0.0",
"private": true,
"description": "Liquidjs Demo for Browser Usage",
"main": "index.html",
"scripts": {
"start": "http-server -c-1 "
},
"author": "harttle <[email protected]>",
"license": "ISC",
"dependencies": {
"http-server": "^0.11.1",
"liquidjs": "*"
}
}
+9
View File
@@ -0,0 +1,9 @@
# LiquidJS for Express.js
## Get Started
```bash
cd demo/express
npm install
npm start
```
+17 -17
View File
@@ -1,22 +1,22 @@
var express = require('express');
var app = express();
var Liquid = require('../..');
const express = require('express')
const { Liquid } = require('liquidjs')
var engine = Liquid({
root: __dirname, // for layouts and partials
extname: '.liquid'
});
const app = express()
const engine = new Liquid({
root: __dirname, // for layouts and partials
extname: '.liquid'
})
app.engine('liquid', engine.express()); // register liquid engine
app.set('views', ['./partials', './views']); // specify the views directory
app.set('view engine', 'liquid'); // set to default
app.engine('liquid', engine.express()) // register liquid engine
app.set('views', ['./partials', './views']) // specify the views directory
app.set('view engine', 'liquid') // set to default
app.get('/', function (req, res) {
var todos = ['fork and clone', 'make it better', 'make a pull request'];
res.render('todolist', {
todos: todos,
title: 'Welcome to shopify-liquid!'
});
});
const todos = ['fork and clone', 'make it better', 'make a pull request']
res.render('todolist', {
todos: todos,
title: 'Welcome to liquidjs!'
})
})
module.exports = app;
module.exports = app
+3 -4
View File
@@ -1,6 +1,5 @@
const app = require('./app.js');
const app = require('./app.js')
app.listen(3000, function () {
console.log('Example app listening on port 3000!');
});
console.log('Express running: http://localhost:3000')
})
+5 -3
View File
@@ -1,15 +1,17 @@
{
"name": "express-demo",
"version": "1.0.0",
"description": "Express Demo Using Shopify-Liquid",
"private": true,
"description": "Express Demo Using liquidjs",
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "harttle",
"license": "ISC",
"license": "MIT",
"dependencies": {
"express": "^4.14.0"
"express": "^4.14.0",
"liquidjs": "*"
}
}
+2 -2
View File
@@ -1,8 +1,8 @@
{% layout 'layout' %}
<ul>
{% for todo in todolist %}
<li>{% include 'todo' id=forloop.index %}</li>
{% for todo in todos %}
<li>{% include 'todo', id:forloop.index %}</li>
{% endfor %}
</ul>
+9
View File
@@ -0,0 +1,9 @@
# LiquidJS for Node.js
## Get Started
```bash
cd demo/nodejs
npm install
npm start
```
+41
View File
@@ -0,0 +1,41 @@
const { Liquid } = require('liquidjs')
const engine = new Liquid({
extname: '.liquid',
globals: { title: 'LiquidJS Demo' },
// root files for `.render()` and `.parse()`
root: __dirname,
// layout files for `{% layout %}`
layouts: './layouts',
// partial files for `{% include %}` and `{% render %}`
partials: './partials'
})
engine.registerTag('header', {
parse: function (token) {
const [key, val] = token.args.split(':')
this[key] = val
},
render: async function (scope, emitter) {
const title = await this.liquid.evalValue(this.content, scope)
emitter.write(`<h1>${title}</h1>`)
}
})
const ctx = {
todos: ['fork and clone', 'make it better', 'make a pull request']
}
async function main () {
console.log('==========renderFile===========')
const html = await engine.renderFile('todolist', ctx)
console.log(html)
console.log('===========Streamed===========')
const tpls = await engine.parseFile('todolist')
engine.renderToNodeStream(tpls, ctx)
.on('data', data => process.stdout.write(data))
.on('end', () => console.log(''))
}
main()
+7
View File
@@ -0,0 +1,7 @@
<html>
<head><meta name="title" content="{{title}}"></head>
<body>
{% block %}{% endblock %}
{% render "footer.liquid" %}
</body>
</html>
+12
View File
@@ -0,0 +1,12 @@
{
"name": "liquidjs-demo-nodejs",
"description": "Node.js demo for liquidjs",
"private": true,
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"dependencies": {
"liquidjs": "^9.27.0"
}
}
+1
View File
@@ -0,0 +1 @@
<small>{{title}}</small>
+1
View File
@@ -0,0 +1 @@
<li>{{index}} - {{todo}}</li>
+7
View File
@@ -0,0 +1,7 @@
{% layout 'html.liquid' %}
{%header content: title | capitalize%}
<ul>
{% for todo in todos %}
{% render 'todo.liquid' with todo, index: forloop.index%}
{% endfor %}
</ul>
+1
View File
@@ -0,0 +1 @@
SKIP_PREFLIGHT_CHECK=true
+3
View File
@@ -0,0 +1,3 @@
{
"extends": ["react-app"]
}
+21
View File
@@ -0,0 +1,21 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
File diff suppressed because it is too large Load Diff
+28
View File
@@ -0,0 +1,28 @@
{
"name": "react-liquidjs",
"version": "0.1.0",
"private": true,
"dependencies": {
"html-react-parser": "^0.4.7",
"liquidjs": "^9.1.0",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-promise": "^2.0.3",
"react-scripts": "2.0.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {
"@babel/core": "^7.8.7"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

+41
View File
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="result"></div>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
+15
View File
@@ -0,0 +1,15 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
+32
View File
@@ -0,0 +1,32 @@
.App {
text-align: center;
}
.App-logo {
animation: App-logo-spin infinite 20s linear;
height: 40vmin;
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
+23
View File
@@ -0,0 +1,23 @@
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import tpl from './views/demo.liquid';
import Parser from 'html-react-parser';
import { engine } from './engine';
export class App extends Component {
async componentDidMount() {
const html = await engine.renderFile(tpl.toString(), {name: 'alice', logo: logo })
this.setState({ html }) // outputs "Alice"
}
state = { html: '' }
render() {
return (
<div className="App">
{Parser(`${this.state.html}`)}
</div>
);
}
}
+9
View File
@@ -0,0 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div);
});
+41
View File
@@ -0,0 +1,41 @@
/*
* function Component with Hooks: Modify ./index.js to apply this file
*/
import React, { useState, useLayoutEffect } from 'react';
import './App.css';
import logo from './logo.svg';
import tplsrc from './views/showing-click-times.liquid';
import Parser from 'html-react-parser';
import { engine } from './engine';
import { Context } from './Context';
import { ClickButton } from './ClickButton';
const fetchTpl = engine.getTemplate(tplsrc.toString())
export function App() {
const [state, setState] = useState({
logo: logo,
name: 'alice',
clickCount: 0,
html: ''
});
useLayoutEffect(() => {
fetchTpl
.then(tpl => engine.render(tpl, state))
.then(html => setState({...state, html}))
}, [state.clickCount])
return (
<div className="App">
{Parser(`${state.html}`)}
<Context.Provider
value={{
count: () => setState({...state, clickCount: state.clickCount + 1})
}}
>
<ClickButton/>
</Context.Provider>
</div>
);
}
+5
View File
@@ -0,0 +1,5 @@
button {
position: fixed;
right: 20px;
bottom: 20px;
}
+15
View File
@@ -0,0 +1,15 @@
import './ClickButton.css';
import React from 'react';
import { Context } from './Context';
export function ClickButton() {
return (
<Context.Consumer>
{context => (
<button onClick={context.count}>
Click Here!
</button>
)}
</Context.Consumer>
);
};
+3
View File
@@ -0,0 +1,3 @@
import React from "react";
export const Context = React.createContext()
+12
View File
@@ -0,0 +1,12 @@
import path from 'path';
import { Liquid } from 'liquidjs';
export const engine = new Liquid({
root: path.resolve(__dirname, 'views/'), // dirs to lookup layouts/includes
extname: '.liquid' // the extname used for layouts/includes, defaults
});
engine.registerFilter('image', d => {
let img = `<img src="${d}" class="App-logo" alt="logo"></img>`;
return img
})
+14
View File
@@ -0,0 +1,14 @@
body {
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
+13
View File
@@ -0,0 +1,13 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import * as serviceWorker from './serviceWorker';
import { App } from './App';
// import { App } from './AppWithHooks';
ReactDOM.render(<App />, document.getElementById('root'));
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: http://bit.ly/CRA-PWA
serviceWorker.unregister();
+7
View File
@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
<g fill="#61DAFB">
<path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
<circle cx="420.9" cy="296.5" r="45.7"/>
<path d="M520.5 78.1z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

+127
View File
@@ -0,0 +1,127 @@
// In production, we register a service worker to serve assets from local cache.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on the "N+1" visit to a page, since previously
// cached resources are updated in the background.
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
// This link also includes instructions on opting out of this behavior.
const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.1/8 is considered localhost for IPv4.
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
);
export function register(config) {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
if (publicUrl.origin !== window.location.origin) {
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
return;
}
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
if (isLocalhost) {
// This is running on localhost. Let's check if a service worker still exists or not.
checkValidServiceWorker(swUrl, config);
// Add some additional logging to localhost, pointing developers to the
// service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => {
console.log(
'This web app is being served cache-first by a service ' +
'worker. To learn more, visit https://goo.gl/SC7cgQ'
);
});
} else {
// Is not local host. Just register service worker
registerValidSW(swUrl, config);
}
});
}
}
function registerValidSW(swUrl, config) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the old content will have been purged and
// the fresh content will have been added to the cache.
// It's the perfect time to display a "New content is
// available; please refresh." message in your web app.
console.log('New content is available; please refresh.');
// Execute callback
if (config.onUpdate) {
config.onUpdate(registration);
}
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.');
// Execute callback
if (config.onSuccess) {
config.onSuccess(registration);
}
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
}
function checkValidServiceWorker(swUrl, config) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl)
.then(response => {
// Ensure service worker exists, and that we really are getting a JS file.
if (
response.status === 404 ||
response.headers.get('content-type').indexOf('javascript') === -1
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then(registration => {
registration.unregister().then(() => {
window.location.reload();
});
});
} else {
// Service worker found. Proceed as normal.
registerValidSW(swUrl, config);
}
})
.catch(() => {
console.log(
'No internet connection found. App is running in offline mode.'
);
});
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
}
}
+18
View File
@@ -0,0 +1,18 @@
<header className="App-header">
{{ logo | image }}
<h2>Welcome {{name | capitalize}}</h2>
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<p>
You are using liquidjs & Reactjs
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
@@ -0,0 +1,14 @@
<header className="App-header">
{{ logo | image }}
<h2>Welcome {{name | capitalize}}</h2>
<p>Edit <code>src/App.js</code> and save to reload.</p>
<p>You have clicked {{clickCount}} times.</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
+11
View File
@@ -0,0 +1,11 @@
# LiquidJS for TypeScript
LiquidJS is written in TypeScript and type definitions are available in `liquidjs` package.
## Get Started
```bash
cd demo/typescript
npm install
npm start
```
+25
View File
@@ -0,0 +1,25 @@
import { Liquid, TagToken, Context, Emitter } from 'liquidjs'
const engine = new Liquid({
root: __dirname,
extname: '.liquid'
})
engine.registerTag('header', {
parse: function (token: TagToken) {
const [key, val] = token.args.split(':')
this[key] = val
},
render: async function (context: Context, emitter: Emitter) {
const title = await this.liquid.evalValue(this['content'], context)
emitter.write(`<h1>${title}</h1>`)
}
})
const ctx = {
todos: ['fork and clone', 'make it better', 'make a pull request'],
title: 'Welcome to liquidjs!'
}
// console.log('isTruthy:', isTruthy('a string here'));
engine.renderFile('todolist', ctx).then(console.log)
+17
View File
@@ -0,0 +1,17 @@
{
"name": "liquidjs-demo-typescript",
"private": true,
"description": "TypeScript demo for liquidjs",
"main": "index.ts",
"scripts": {
"start": "ts-node index.ts"
},
"dependencies": {
"liquidjs": "*",
"ts-node": "^8.10.2",
"typescript": "^4.2.4"
},
"devDependencies": {
"@types/node": "^14.14.37"
}
}
+7
View File
@@ -0,0 +1,7 @@
{%header content: title | capitalize%}
<ul>
{% for todo in todos %}
<li>{{forloop.index}} - {{todo}}</li>
{% endfor %}
</ul>
+7
View File
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"types": [
"node"
]
}
}
View File
-2498
View File
File diff suppressed because it is too large Load Diff
-2
View File
File diff suppressed because one or more lines are too long
+7
View File
@@ -0,0 +1,7 @@
.all-contributorsrc
source/api/
source/zh-cn/api/
.vuepress
db.json
public
changelog.md
View File
+1
View File
@@ -0,0 +1 @@
liquidjs.com
+32
View File
@@ -0,0 +1,32 @@
title: LiquidJS
subtitle: "A simple, expressive and safe template engine."
description: "LiquidJS is a simple, expressive and safe Shopify / Github Pages compatible template engine in pure JavaScript."
author: Harttle
language: en
timezone: UTC
url: https://liquidjs.com
root: /
permalink: news/:year/:month/:day/:title/
relative_link: true
new_post_name: :year-:month-:day-:title.md # File name of new posts
post_asset_folder: true
per_page: 0
pretty_urls:
trailing_index: false
trailing_html: false
theme: navy
highlight:
enable: true
line_number: false
algolia:
applicationID: 0X19J927JZ
apiKey: 533161d821384919672e4ce8a39451b3
indexName: liquidjs
twitter: harttleharttle
github: harttle/liquidjs
patreon: harttle
oc: liquidjs
+9250
View File
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More