Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: harttle/liquidjs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v10.6.2
Choose a base ref
...
head repository: harttle/liquidjs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v10.7.0
Choose a head ref
  • 9 commits
  • 12 files changed
  • 7 contributors

Commits on Mar 19, 2023

  1. docs: update docs pipeline

    harttle committed Mar 19, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    pflorek Patrick Florek
    Copy the full SHA
    04d62f0 View commit details

Commits on Mar 20, 2023

  1. Update differences.md

    - Shopify also has `json` filter, I think it is equivalent to liquidJS `json`
    bangank36 authored and harttle committed Mar 20, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    pflorek Patrick Florek
    Copy the full SHA
    e50267f View commit details
  2. chore: add PR title checker

    harttle committed Mar 20, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    pflorek Patrick Florek
    Copy the full SHA
    b9f8d85 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    75aba92 View commit details
  4. Copy the full SHA
    8037f7b View commit details

Commits on Mar 21, 2023

  1. Copy the full SHA
    7b87ea8 View commit details
  2. fix: update remove.md (#601)

    The output was wrong. Filter would replace the rain all over the text.
    mahyar-pasarzangene authored Mar 21, 2023
    1
    Copy the full SHA
    1bddd60 View commit details
  3. docs: add mahyar-pasarzangene as a contributor for doc (#602)

    * docs: update README.md [skip ci]
    
    * docs: update .all-contributorsrc [skip ci]
    
    ---------
    
    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
    allcontributors[bot] authored Mar 21, 2023
    Copy the full SHA
    b2a1dc9 View commit details
  4. chore(release): 10.7.0 [skip ci]

    # [10.7.0](v10.6.2...v10.7.0) (2023-03-21)
    
    ### Bug Fixes
    
    * update remove.md ([#601](#601)) ([1bddd60](1bddd60))
    
    ### Features
    
    * JSON format by `space` in `json` filter ([7b87ea8](7b87ea8))
    semantic-release-bot committed Mar 21, 2023
    Copy the full SHA
    c2a8365 View commit details
18 changes: 18 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -549,6 +549,24 @@
"contributions": [
"code"
]
},
{
"login": "bangank36",
"name": "BaNgan",
"avatar_url": "https://avatars.githubusercontent.com/u/10071857?v=4",
"profile": "https://github.com/bangank36",
"contributions": [
"doc"
]
},
{
"login": "mahyar-pasarzangene",
"name": "Mahyar Pasarzangene",
"avatar_url": "https://avatars.githubusercontent.com/u/16485039?v=4",
"profile": "https://github.com/mahyar-pasarzangene",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7,
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ jobs:
- name: Build
run: |
npm ci
npm run build:docs
npm run build
- name: Publish
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
17 changes: 17 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "PR Title Checker"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# [10.7.0](https://github.com/harttle/liquidjs/compare/v10.6.2...v10.7.0) (2023-03-21)


### Bug Fixes

* update remove.md ([#601](https://github.com/harttle/liquidjs/issues/601)) ([1bddd60](https://github.com/harttle/liquidjs/commit/1bddd60b0191032d324526292027bc7fcd190dc1))


### Features

* JSON format by `space` in `json` filter ([7b87ea8](https://github.com/harttle/liquidjs/commit/7b87ea82d3d63420e548743c5a84a073f0cdad22))

## [10.6.2](https://github.com/harttle/liquidjs/compare/v10.6.1...v10.6.2) (2023-03-19)


2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -156,6 +156,8 @@ Want to contribute? see [Contribution Guidelines][contribution]. Thanks goes to
<td align="center" valign="top" width="14.28%"><a href="http://slavv.com/"><img src="https://avatars.githubusercontent.com/u/713329?v=4?s=100" width="100px;" alt="Slav Ivanov"/><br /><sub><b>Slav Ivanov</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=slavivanov" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://www.orgflow.io/"><img src="https://avatars.githubusercontent.com/u/3889090?v=4?s=100" width="100px;" alt="Daniel Rosenberg"/><br /><sub><b>Daniel Rosenberg</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=DaRosenberg" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/bobgubko"><img src="https://avatars.githubusercontent.com/u/733312?v=4?s=100" width="100px;" alt="bobgubko"/><br /><sub><b>bobgubko</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=bobgubko" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/bangank36"><img src="https://avatars.githubusercontent.com/u/10071857?v=4?s=100" width="100px;" alt="BaNgan"/><br /><sub><b>BaNgan</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=bangank36" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/mahyar-pasarzangene"><img src="https://avatars.githubusercontent.com/u/16485039?v=4?s=100" width="100px;" alt="Mahyar Pasarzangene"/><br /><sub><b>Mahyar Pasarzangene</b></sub></a><br /><a href="https://github.com/harttle/liquidjs/commits?author=mahyar-pasarzangene" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>
2 changes: 1 addition & 1 deletion docs/source/filters/remove.md
Original file line number Diff line number Diff line change
@@ -13,5 +13,5 @@ Input

Output
```text
I strained to see the t through the
I sted to see the t through the
```
1 change: 0 additions & 1 deletion docs/source/tutorials/differences.md
Original file line number Diff line number Diff line change
@@ -30,7 +30,6 @@ Though we're trying to be compatible with the Ruby version, there are still some
* Sort stability. The [sort][sort] stability is also not defined in both shopify/liquid and LiquidJS, but it's [considered stable][stable-sort] for LiquidJS in Node.js 12+ and Google Chrome 70+.
* Trailing unmatched characters inside filters are allowed in shopify/liquid but not in LiquidJS. It means filter arguments without a colon like `{%raw%}{{ "a b" | split " "}}{%endraw%}` will throw an error in LiquidJS. This is intended to improve Liquid usability, see [#208][#208] and [#212][#212].
* LiquidJS has additional tags: [layout][layout] and corresponding `block` tag.
* LiquidJS has additional filters: [json][json].
* LiquidJS [date][date] filter supports `%q` for date ordinals like `{{ '2023/02/02' | date: '%d%q of %b'}}` => `02nd of Feb`

[date]: https://liquidjs.com/filters/date.html
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "liquidjs",
"version": "10.6.2",
"version": "10.7.0",
"description": "A simple, expressive and safe Shopify / Github Pages compatible template engine in pure JavaScript.",
"main": "dist/liquid.node.cjs.js",
"module": "dist/liquid.node.esm.js",
4 changes: 2 additions & 2 deletions src/filters/misc.ts
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@ export function Default<T1 extends boolean, T2> (this: FilterImpl, value: T1, de
return isFalsy(value, this.context) ? defaultValue : value
}

export function json (value: any) {
return JSON.stringify(value)
export function json (value: any, space = 0) {
return JSON.stringify(value, null, space)
}

export const raw = {
2 changes: 1 addition & 1 deletion src/util/timezone-date.spec.ts
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ describe('TimezoneDate', () => {
})
it('should support .toLocaleTimeString()', () => {
const date = new TimezoneDate('2021-10-06T00:00:00.001+00:00', -480)
expect(date.toLocaleTimeString('en-US')).toBe('8:00:00 AM')
expect(date.toLocaleTimeString('en-US')).toMatch(/^8:00:00\sAM$/)
expect(() => date.toLocaleDateString()).not.toThrow()
})
it('should support .toLocaleDateString()', () => {
5 changes: 5 additions & 0 deletions test/integration/filters/misc.spec.ts
Original file line number Diff line number Diff line change
@@ -24,5 +24,10 @@ describe('filters/object', function () {
it('should stringify number', async () => expect(await liquid.parseAndRender('{{2 | json}}')).toBe('2'))
it('should stringify object', async () => expect(await liquid.parseAndRender('{{obj | json}}', { obj: { foo: 'bar' } })).toBe('{"foo":"bar"}'))
it('should stringify array', async () => expect(await liquid.parseAndRender('{{arr | json}}', { arr: [-2, 'a'] })).toBe('[-2,"a"]'))
it('should support space', () => {
const scope = { obj: { foo: 'foo', bar: 'bar' } }
const result = '{\n "foo": "foo",\n "bar": "bar"\n}'
expect(liquid.parseAndRenderSync('{{obj | json: 4}}', scope)).toBe(result)
})
})
})