mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
fix(#108): remove absolute path in emitted d.ts
This commit is contained in:
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
import * as Benchmark from 'benchmark'
|
import * as Benchmark from 'benchmark'
|
||||||
import Liquid from 'src/liquid'
|
import Liquid from '../src/liquid'
|
||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../src/parser/tag-token'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../src/scope/scope'
|
||||||
|
|
||||||
const engine = new Liquid({
|
const engine = new Liquid({
|
||||||
root: __dirname,
|
root: __dirname,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Liquid from '../../dist/liquid.js'
|
import Liquid from 'liquidjs'
|
||||||
|
|
||||||
const engine = new Liquid({
|
const engine = new Liquid({
|
||||||
root: __dirname,
|
root: __dirname,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
declare module 'rollup-plugin-uglify' {
|
declare module 'rollup-plugin-uglify' {
|
||||||
export function uglify (): any
|
export function uglify (): any
|
||||||
}
|
}
|
||||||
declare module 'rollup-plugin-shim' {
|
declare module 'rollup-plugin-alias' {
|
||||||
export default function shim(options: any): any
|
export default function alias(options: any): any
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+8
-41
@@ -413,12 +413,6 @@
|
|||||||
"parse5": "4.0.0"
|
"parse5": "4.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@types/json5": {
|
|
||||||
"version": "0.0.29",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
|
|
||||||
"integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"@types/mime": {
|
"@types/mime": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.1.tgz",
|
||||||
@@ -3565,15 +3559,6 @@
|
|||||||
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=",
|
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"json5": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
|
|
||||||
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"minimist": "1.2.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"jsonfile": {
|
"jsonfile": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
|
||||||
@@ -9151,11 +9136,14 @@
|
|||||||
"acorn": "6.1.0"
|
"acorn": "6.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rollup-plugin-shim": {
|
"rollup-plugin-alias": {
|
||||||
"version": "1.0.0",
|
"version": "1.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/rollup-plugin-shim/-/rollup-plugin-shim-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/rollup-plugin-alias/-/rollup-plugin-alias-1.5.1.tgz",
|
||||||
"integrity": "sha512-rZqFD43y4U9nSqVq3iyWBiDwmBQJY8Txi04yI9jTKD3xcl7CbFjh1qRpQshUB3sONLubDzm7vJiwB+1MEGv67w==",
|
"integrity": "sha512-pQTYBRNfLedoVOO7AYHNegIavEIp4jKTga5jUi1r//KYgHKGWgG4qJXYhbcWKt2k1FwGlR5wCYoY+IFkme0t4A==",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"slash": "2.0.0"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"rollup-plugin-typescript2": {
|
"rollup-plugin-typescript2": {
|
||||||
"version": "0.19.2",
|
"version": "0.19.2",
|
||||||
@@ -10224,27 +10212,6 @@
|
|||||||
"yn": "3.0.0"
|
"yn": "3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tsconfig-paths": {
|
|
||||||
"version": "3.8.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.8.0.tgz",
|
|
||||||
"integrity": "sha512-zZEYFo4sjORK8W58ENkRn9s+HmQFkkwydDG7My5s/fnfr2YYCaiyXe/HBUcIgU8epEKOXwiahOO+KZYjiXlWyQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@types/json5": "0.0.29",
|
|
||||||
"deepmerge": "2.2.1",
|
|
||||||
"json5": "1.0.1",
|
|
||||||
"minimist": "1.2.0",
|
|
||||||
"strip-bom": "3.0.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"deepmerge": {
|
|
||||||
"version": "2.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.2.1.tgz",
|
|
||||||
"integrity": "sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA==",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tslib": {
|
"tslib": {
|
||||||
"version": "1.9.3",
|
"version": "1.9.3",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",
|
||||||
|
|||||||
+1
-2
@@ -76,7 +76,7 @@
|
|||||||
"nyc": "^13.1.0",
|
"nyc": "^13.1.0",
|
||||||
"regenerator-runtime": "^0.12.1",
|
"regenerator-runtime": "^0.12.1",
|
||||||
"rollup": "^1.1.2",
|
"rollup": "^1.1.2",
|
||||||
"rollup-plugin-shim": "^1.0.0",
|
"rollup-plugin-alias": "^1.5.1",
|
||||||
"rollup-plugin-typescript2": "^0.19.2",
|
"rollup-plugin-typescript2": "^0.19.2",
|
||||||
"rollup-plugin-uglify": "^6.0.2",
|
"rollup-plugin-uglify": "^6.0.2",
|
||||||
"semantic-release": "^15.13.3",
|
"semantic-release": "^15.13.3",
|
||||||
@@ -84,7 +84,6 @@
|
|||||||
"sinon-chai": "^3.3.0",
|
"sinon-chai": "^3.3.0",
|
||||||
"supertest": "^3.4.2",
|
"supertest": "^3.4.2",
|
||||||
"ts-node": "^8.0.2",
|
"ts-node": "^8.0.2",
|
||||||
"tsconfig-paths": "^3.8.0",
|
|
||||||
"tslib": "^1.9.3",
|
"tslib": "^1.9.3",
|
||||||
"typescript": "^3.3.3"
|
"typescript": "^3.3.3"
|
||||||
},
|
},
|
||||||
|
|||||||
+6
-9
@@ -1,9 +1,8 @@
|
|||||||
import shim from 'rollup-plugin-shim'
|
import alias from 'rollup-plugin-alias'
|
||||||
import { uglify } from 'rollup-plugin-uglify'
|
import { uglify } from 'rollup-plugin-uglify'
|
||||||
import pkg from './package.json'
|
import pkg from './package.json'
|
||||||
import typescript from 'rollup-plugin-typescript2'
|
import typescript from 'rollup-plugin-typescript2'
|
||||||
|
|
||||||
const fake = { fs: `export default {}`, path: `export default {}` }
|
|
||||||
const version = process.env.VERSION || pkg.version
|
const version = process.env.VERSION || pkg.version
|
||||||
const sourcemap = true
|
const sourcemap = true
|
||||||
const banner = `/*
|
const banner = `/*
|
||||||
@@ -14,7 +13,7 @@ const banner = `/*
|
|||||||
const treeshake = {
|
const treeshake = {
|
||||||
propertyReadSideEffects: false
|
propertyReadSideEffects: false
|
||||||
}
|
}
|
||||||
const input = 'src/liquid.ts'
|
const input = './src/liquid.ts'
|
||||||
|
|
||||||
export default [{
|
export default [{
|
||||||
output: [{
|
output: [{
|
||||||
@@ -46,15 +45,14 @@ export default [{
|
|||||||
banner
|
banner
|
||||||
}],
|
}],
|
||||||
plugins: [
|
plugins: [
|
||||||
shim(fake),
|
alias({ resolve: ['.ts'], './fs/node': './fs/browser' }),
|
||||||
typescript({
|
typescript({
|
||||||
tsconfigOverride: {
|
tsconfigOverride: {
|
||||||
include: [ 'src' ],
|
include: [ 'src' ],
|
||||||
exclude: [ 'test', 'benchmark' ],
|
exclude: [ 'test', 'benchmark' ],
|
||||||
compilerOptions: {
|
compilerOptions: {
|
||||||
target: 'es5',
|
target: 'es5',
|
||||||
module: 'ES2015',
|
module: 'ES2015'
|
||||||
paths: { 'src/fs': ['src/fs/browser'] }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -69,15 +67,14 @@ export default [{
|
|||||||
sourcemap
|
sourcemap
|
||||||
}],
|
}],
|
||||||
plugins: [
|
plugins: [
|
||||||
shim(fake),
|
alias({ resolve: ['.ts'], './fs/node': './fs/browser' }),
|
||||||
typescript({
|
typescript({
|
||||||
tsconfigOverride: {
|
tsconfigOverride: {
|
||||||
include: [ 'src' ],
|
include: [ 'src' ],
|
||||||
exclude: [ 'test', 'benchmark' ],
|
exclude: [ 'test', 'benchmark' ],
|
||||||
compilerOptions: {
|
compilerOptions: {
|
||||||
target: 'es5',
|
target: 'es5',
|
||||||
module: 'ES2015',
|
module: 'ES2015'
|
||||||
paths: { 'src/fs': ['src/fs/browser'] }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { last } from 'src/util/underscore'
|
import { last } from '../../util/underscore'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
'join': (v: any[], arg: string) => v.join(arg === undefined ? ' ' : arg),
|
'join': (v: any[], arg: string) => v.join(arg === undefined ? ' ' : arg),
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import strftime from 'src/util/strftime'
|
import strftime from '../../util/strftime'
|
||||||
import { isString } from 'src/util/underscore'
|
import { isString } from '../../util/underscore'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
'date': (v: string | Date, arg: string) => {
|
'date': (v: string | Date, arg: string) => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { isTruthy } from 'src/render/syntax'
|
import { isTruthy } from '../../render/syntax'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
'default': <T1, T2>(v: T1, arg: T2): T1 | T2 => isTruthy(v) ? v : arg
|
'default': <T1, T2>(v: T1, arg: T2): T1 | T2 => isTruthy(v) ? v : arg
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { FilterImpl } from 'src/template/filter/filter-impl'
|
import { FilterImpl } from '../../template/filter/filter-impl'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
'append': (v: string, arg: string) => v + arg,
|
'append': (v: string, arg: string) => v + arg,
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import assert from 'src/util/assert'
|
import assert from '../../util/assert'
|
||||||
import { identifier } from 'src/parser/lexical'
|
import { identifier } from '../../parser/lexical'
|
||||||
import { AssignScope } from 'src/scope/scopes'
|
import { AssignScope } from '../../scope/scopes'
|
||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../../parser/tag-token'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../scope/scope'
|
||||||
import ITagImplOptions from 'src/template/tag/itag-impl-options'
|
import ITagImplOptions from '../../template/tag/itag-impl-options'
|
||||||
|
|
||||||
const re = new RegExp(`(${identifier.source})\\s*=([^]*)`)
|
const re = new RegExp(`(${identifier.source})\\s*=([^]*)`)
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import BlockMode from 'src/scope/block-mode'
|
import BlockMode from '../../scope/block-mode'
|
||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../../parser/tag-token'
|
||||||
import Token from 'src/parser/token'
|
import Token from '../../parser/token'
|
||||||
import ITemplate from 'src/template/itemplate'
|
import ITemplate from '../../template/itemplate'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../scope/scope'
|
||||||
import ITagImplOptions from 'src/template/tag/itag-impl-options'
|
import ITagImplOptions from '../../template/tag/itag-impl-options'
|
||||||
import ParseStream from 'src/parser/parse-stream'
|
import ParseStream from '../../parser/parse-stream'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
parse: function (token: TagToken, remainTokens: Token[]) {
|
parse: function (token: TagToken, remainTokens: Token[]) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { RenderBreakError } from 'src/util/error'
|
import { RenderBreakError } from '../../util/error'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
render: async function () {
|
render: async function () {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import assert from 'src/util/assert'
|
import assert from '../../util/assert'
|
||||||
import { identifier } from 'src/parser/lexical'
|
import { identifier } from '../../parser/lexical'
|
||||||
import { CaptureScope } from 'src/scope/scopes'
|
import { CaptureScope } from '../../scope/scopes'
|
||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../../parser/tag-token'
|
||||||
import Token from 'src/parser/token'
|
import Token from '../../parser/token'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../scope/scope'
|
||||||
import ITagImplOptions from 'src/template/tag/itag-impl-options'
|
import ITagImplOptions from '../../template/tag/itag-impl-options'
|
||||||
|
|
||||||
const re = new RegExp(`(${identifier.source})`)
|
const re = new RegExp(`(${identifier.source})`)
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { evalExp } from 'src/render/syntax'
|
import { evalExp } from '../../render/syntax'
|
||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../../parser/tag-token'
|
||||||
import Token from 'src/parser/token'
|
import Token from '../../parser/token'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../scope/scope'
|
||||||
import ITemplate from 'src/template/itemplate'
|
import ITemplate from '../../template/itemplate'
|
||||||
import ITagImplOptions from 'src/template/tag/itag-impl-options'
|
import ITagImplOptions from '../../template/tag/itag-impl-options'
|
||||||
import ParseStream from 'src/parser/parse-stream'
|
import ParseStream from '../../parser/parse-stream'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
parse: function (tagToken: TagToken, remainTokens: Token[]) {
|
parse: function (tagToken: TagToken, remainTokens: Token[]) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../../parser/tag-token'
|
||||||
import Token from 'src/parser/token'
|
import Token from '../../parser/token'
|
||||||
import ITagImplOptions from 'src/template/tag/itag-impl-options'
|
import ITagImplOptions from '../../template/tag/itag-impl-options'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
parse: function (tagToken: TagToken, remainTokens: Token[]) {
|
parse: function (tagToken: TagToken, remainTokens: Token[]) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { RenderBreakError } from 'src/util/error'
|
import { RenderBreakError } from '../../util/error'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
render: async function () {
|
render: async function () {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import assert from 'src/util/assert'
|
import assert from '../../util/assert'
|
||||||
import { value as rValue } from 'src/parser/lexical'
|
import { value as rValue } from '../../parser/lexical'
|
||||||
import { evalValue } from 'src/render/syntax'
|
import { evalValue } from '../../render/syntax'
|
||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../../parser/tag-token'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../scope/scope'
|
||||||
import ITagImplOptions from 'src/template/tag/itag-impl-options'
|
import ITagImplOptions from '../../template/tag/itag-impl-options'
|
||||||
|
|
||||||
const groupRE = new RegExp(`^(?:(${rValue.source})\\s*:\\s*)?(.*)$`)
|
const groupRE = new RegExp(`^(?:(${rValue.source})\\s*:\\s*)?(.*)$`)
|
||||||
const candidatesRE = new RegExp(rValue.source, 'g')
|
const candidatesRE = new RegExp(rValue.source, 'g')
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import assert from 'src/util/assert'
|
import assert from '../../util/assert'
|
||||||
import { identifier } from 'src/parser/lexical'
|
import { identifier } from '../../parser/lexical'
|
||||||
import { CaptureScope, AssignScope, DecrementScope } from 'src/scope/scopes'
|
import { CaptureScope, AssignScope, DecrementScope } from '../../scope/scopes'
|
||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../../parser/tag-token'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../scope/scope'
|
||||||
import ITagImplOptions from 'src/template/tag/itag-impl-options'
|
import ITagImplOptions from '../../template/tag/itag-impl-options'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
parse: function (token: TagToken) {
|
parse: function (token: TagToken) {
|
||||||
|
|||||||
+12
-12
@@ -1,15 +1,15 @@
|
|||||||
import { mapSeries } from 'src/util/promise'
|
import { mapSeries } from '../../util/promise'
|
||||||
import { isString, isObject, isArray } from 'src/util/underscore'
|
import { isString, isObject, isArray } from '../../util/underscore'
|
||||||
import { evalExp } from 'src/render/syntax'
|
import { evalExp } from '../../render/syntax'
|
||||||
import assert from 'src/util/assert'
|
import assert from '../../util/assert'
|
||||||
import { identifier, value, hash } from 'src/parser/lexical'
|
import { identifier, value, hash } from '../../parser/lexical'
|
||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../../parser/tag-token'
|
||||||
import Token from 'src/parser/token'
|
import Token from '../../parser/token'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../scope/scope'
|
||||||
import Hash from 'src/template/tag/hash'
|
import Hash from '../../template/tag/hash'
|
||||||
import ITemplate from 'src/template/itemplate'
|
import ITemplate from '../../template/itemplate'
|
||||||
import ITagImplOptions from 'src/template/tag/itag-impl-options'
|
import ITagImplOptions from '../../template/tag/itag-impl-options'
|
||||||
import ParseStream from 'src/parser/parse-stream'
|
import ParseStream from '../../parser/parse-stream'
|
||||||
|
|
||||||
const re = new RegExp(`^(${identifier.source})\\s+in\\s+` +
|
const re = new RegExp(`^(${identifier.source})\\s+in\\s+` +
|
||||||
`(${value.source})` +
|
`(${value.source})` +
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { evalExp, isTruthy } from 'src/render/syntax'
|
import { evalExp, isTruthy } from '../../render/syntax'
|
||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../../parser/tag-token'
|
||||||
import Token from 'src/parser/token'
|
import Token from '../../parser/token'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../scope/scope'
|
||||||
import ITemplate from 'src/template/itemplate'
|
import ITemplate from '../../template/itemplate'
|
||||||
import ITagImplOptions from 'src/template/tag/itag-impl-options'
|
import ITagImplOptions from '../../template/tag/itag-impl-options'
|
||||||
import ParseStream from 'src/parser/parse-stream'
|
import ParseStream from '../../parser/parse-stream'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
parse: function (tagToken: TagToken, remainTokens: Token[]) {
|
parse: function (tagToken: TagToken, remainTokens: Token[]) {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import assert from 'src/util/assert'
|
import assert from '../../util/assert'
|
||||||
import { value, quotedLine } from 'src/parser/lexical'
|
import { value, quotedLine } from '../../parser/lexical'
|
||||||
import { evalValue } from 'src/render/syntax'
|
import { evalValue } from '../../render/syntax'
|
||||||
import BlockMode from 'src/scope/block-mode'
|
import BlockMode from '../../scope/block-mode'
|
||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../../parser/tag-token'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../scope/scope'
|
||||||
import Hash from 'src/template/tag/hash'
|
import Hash from '../../template/tag/hash'
|
||||||
import ITagImplOptions from 'src/template/tag/itag-impl-options'
|
import ITagImplOptions from '../../template/tag/itag-impl-options'
|
||||||
|
|
||||||
const staticFileRE = /[^\s,]+/
|
const staticFileRE = /[^\s,]+/
|
||||||
const withRE = new RegExp(`with\\s+(${value.source})`)
|
const withRE = new RegExp(`with\\s+(${value.source})`)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import assert from 'src/util/assert'
|
import assert from '../../util/assert'
|
||||||
import { identifier } from 'src/parser/lexical'
|
import { identifier } from '../../parser/lexical'
|
||||||
import { CaptureScope, AssignScope, IncrementScope } from 'src/scope/scopes'
|
import { CaptureScope, AssignScope, IncrementScope } from '../../scope/scopes'
|
||||||
import ITagImplOptions from 'src/template/tag/itag-impl-options'
|
import ITagImplOptions from '../../template/tag/itag-impl-options'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
parse: function (token) {
|
parse: function (token) {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import tablerow from './tablerow'
|
|||||||
import unless from './unless'
|
import unless from './unless'
|
||||||
import Break from './break'
|
import Break from './break'
|
||||||
import Continue from './continue'
|
import Continue from './continue'
|
||||||
import ITagImplOptions from 'src/template/tag/itag-impl-options'
|
import ITagImplOptions from '../../template/tag/itag-impl-options'
|
||||||
|
|
||||||
const tags: { [key: string]: ITagImplOptions } = {
|
const tags: { [key: string]: ITagImplOptions } = {
|
||||||
assign, 'for': For, capture, 'case': Case, comment, include, decrement, increment, cycle, 'if': If, layout, block, raw, tablerow, unless, 'break': Break, 'continue': Continue
|
assign, 'for': For, capture, 'case': Case, comment, include, decrement, increment, cycle, 'if': If, layout, block, raw, tablerow, unless, 'break': Break, 'continue': Continue
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import assert from 'src/util/assert'
|
import assert from '../../util/assert'
|
||||||
import { value as rValue } from 'src/parser/lexical'
|
import { value as rValue } from '../../parser/lexical'
|
||||||
import { evalValue } from 'src/render/syntax'
|
import { evalValue } from '../../render/syntax'
|
||||||
import BlockMode from 'src/scope/block-mode'
|
import BlockMode from '../../scope/block-mode'
|
||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../../parser/tag-token'
|
||||||
import Token from 'src/parser/token'
|
import Token from '../../parser/token'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../scope/scope'
|
||||||
import Hash from 'src/template/tag/hash'
|
import Hash from '../../template/tag/hash'
|
||||||
import ITagImplOptions from 'src/template/tag/itag-impl-options'
|
import ITagImplOptions from '../../template/tag/itag-impl-options'
|
||||||
|
|
||||||
const staticFileRE = /\S+/
|
const staticFileRE = /\S+/
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../../parser/tag-token'
|
||||||
import Token from 'src/parser/token'
|
import Token from '../../parser/token'
|
||||||
import ITagImplOptions from 'src/template/tag/itag-impl-options'
|
import ITagImplOptions from '../../template/tag/itag-impl-options'
|
||||||
|
|
||||||
export default <ITagImplOptions>{
|
export default <ITagImplOptions>{
|
||||||
parse: function (tagToken: TagToken, remainTokens: Token[]) {
|
parse: function (tagToken: TagToken, remainTokens: Token[]) {
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { mapSeries } from 'src/util/promise'
|
import { mapSeries } from '../../util/promise'
|
||||||
import assert from 'src/util/assert'
|
import assert from '../../util/assert'
|
||||||
import { evalExp } from 'src/render/syntax'
|
import { evalExp } from '../../render/syntax'
|
||||||
import { identifier, value, hash } from 'src/parser/lexical'
|
import { identifier, value, hash } from '../../parser/lexical'
|
||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../../parser/tag-token'
|
||||||
import Token from 'src/parser/token'
|
import Token from '../../parser/token'
|
||||||
import ITemplate from 'src/template/itemplate'
|
import ITemplate from '../../template/itemplate'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../scope/scope'
|
||||||
import Hash from 'src/template/tag/hash'
|
import Hash from '../../template/tag/hash'
|
||||||
import ITagImplOptions from 'src/template/tag/itag-impl-options'
|
import ITagImplOptions from '../../template/tag/itag-impl-options'
|
||||||
import ParseStream from 'src/parser/parse-stream'
|
import ParseStream from '../../parser/parse-stream'
|
||||||
|
|
||||||
const re = new RegExp(`^(${identifier.source})\\s+in\\s+` +
|
const re = new RegExp(`^(${identifier.source})\\s+in\\s+` +
|
||||||
`(${value.source})` +
|
`(${value.source})` +
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { evalExp, isFalsy } from 'src/render/syntax'
|
import { evalExp, isFalsy } from '../../render/syntax'
|
||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../../parser/tag-token'
|
||||||
import Token from 'src/parser/token'
|
import Token from '../../parser/token'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../scope/scope'
|
||||||
import ITagImplOptions from 'src/template/tag/itag-impl-options'
|
import ITagImplOptions from '../../template/tag/itag-impl-options'
|
||||||
import ParseStream from 'src/parser/parse-stream'
|
import ParseStream from '../../parser/parse-stream'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
parse: function (tagToken: TagToken, remainTokens: Token[]) {
|
parse: function (tagToken: TagToken, remainTokens: Token[]) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { isNil, isString } from 'src/util/underscore'
|
import { isNil, isString } from '../util/underscore'
|
||||||
import { isDrop } from 'src/drop/idrop'
|
import { isDrop } from '../drop/idrop'
|
||||||
import { EmptyDrop } from 'src/drop/empty-drop'
|
import { EmptyDrop } from '../drop/empty-drop'
|
||||||
|
|
||||||
export class BlankDrop extends EmptyDrop {
|
export class BlankDrop extends EmptyDrop {
|
||||||
equals (value: any) {
|
equals (value: any) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Drop } from './drop'
|
import { Drop } from './drop'
|
||||||
import { IComparable } from './icomparable'
|
import { IComparable } from './icomparable'
|
||||||
import { isObject, isString, isArray } from 'src/util/underscore'
|
import { isObject, isString, isArray } from '../util/underscore'
|
||||||
import { IDrop } from 'src/drop/idrop'
|
import { IDrop } from '../drop/idrop'
|
||||||
|
|
||||||
export class EmptyDrop extends Drop implements IDrop, IComparable {
|
export class EmptyDrop extends Drop implements IDrop, IComparable {
|
||||||
equals (value: any) {
|
equals (value: any) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { isFunction } from 'src/util/underscore'
|
import { isFunction } from '../util/underscore'
|
||||||
|
|
||||||
export interface IComparable {
|
export interface IComparable {
|
||||||
equals: (rhs: any) => boolean
|
equals: (rhs: any) => boolean
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import { Drop } from './drop'
|
import { Drop } from './drop'
|
||||||
import { isFunction } from 'src/util/underscore'
|
import { isFunction } from '../util/underscore'
|
||||||
|
|
||||||
export interface IDrop {
|
export interface IDrop {
|
||||||
value(): any
|
value(): any
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Drop } from './drop'
|
import { Drop } from './drop'
|
||||||
import { IComparable } from './icomparable'
|
import { IComparable } from './icomparable'
|
||||||
import { isNil } from 'src/util/underscore'
|
import { isNil } from '../util/underscore'
|
||||||
import { IDrop, isDrop } from 'src/drop/idrop'
|
import { IDrop, isDrop } from '../drop/idrop'
|
||||||
import { BlankDrop } from 'src/drop/blank-drop'
|
import { BlankDrop } from '../drop/blank-drop'
|
||||||
|
|
||||||
export class NullDrop extends Drop implements IDrop, IComparable {
|
export class NullDrop extends Drop implements IDrop, IComparable {
|
||||||
equals (value: any) {
|
equals (value: any) {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import Scope from './scope/scope'
|
import Scope from './scope/scope'
|
||||||
import * as Types from './types'
|
import * as Types from './types'
|
||||||
import fs from 'src/fs'
|
import fs from './fs/node'
|
||||||
import * as _ from './util/underscore'
|
import * as _ from './util/underscore'
|
||||||
import ITemplate from './template/itemplate'
|
import ITemplate from './template/itemplate'
|
||||||
import Tokenizer from './parser/tokenizer'
|
import Tokenizer from './parser/tokenizer'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import Token from './token'
|
import Token from './token'
|
||||||
import { last } from 'src/util/underscore'
|
import { last } from '../util/underscore'
|
||||||
|
|
||||||
export default class DelimitedToken extends Token {
|
export default class DelimitedToken extends Token {
|
||||||
trimLeft: boolean
|
trimLeft: boolean
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import Token from 'src/parser/token'
|
import Token from '../parser/token'
|
||||||
import ITemplate from 'src/template/itemplate'
|
import ITemplate from '../template/itemplate'
|
||||||
import TagToken from './tag-token'
|
import TagToken from './tag-token'
|
||||||
|
|
||||||
type ParseToken = ((token: Token, remainTokens: Array<Token>) => ITemplate)
|
type ParseToken = ((token: Token, remainTokens: Array<Token>) => ITemplate)
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { ParseError } from '../util/error'
|
import { ParseError } from '../util/error'
|
||||||
import Liquid from 'src/liquid'
|
import Liquid from '../liquid'
|
||||||
import ParseStream from './parse-stream'
|
import ParseStream from './parse-stream'
|
||||||
import Token from './token'
|
import Token from './token'
|
||||||
import TagToken from './tag-token'
|
import TagToken from './tag-token'
|
||||||
import OutputToken from './output-token'
|
import OutputToken from './output-token'
|
||||||
import Tag from 'src/template/tag/tag'
|
import Tag from '../template/tag/tag'
|
||||||
import Output from 'src/template/output'
|
import Output from '../template/output'
|
||||||
import HTML from 'src/template/html'
|
import HTML from '../template/html'
|
||||||
import ITemplate from 'src/template/itemplate'
|
import ITemplate from '../template/itemplate'
|
||||||
|
|
||||||
export default class Parser {
|
export default class Parser {
|
||||||
liquid: Liquid
|
liquid: Liquid
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import DelimitedToken from './delimited-token'
|
import DelimitedToken from './delimited-token'
|
||||||
import { TokenizationError } from 'src/util/error'
|
import { TokenizationError } from '../util/error'
|
||||||
import * as lexical from './lexical'
|
import * as lexical from './lexical'
|
||||||
|
|
||||||
export default class TagToken extends DelimitedToken {
|
export default class TagToken extends DelimitedToken {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import HTMLToken from './html-token'
|
|||||||
import TagToken from './tag-token'
|
import TagToken from './tag-token'
|
||||||
import Token from './token'
|
import Token from './token'
|
||||||
import OutputToken from './output-token'
|
import OutputToken from './output-token'
|
||||||
import { TokenizationError } from 'src/util/error'
|
import { TokenizationError } from '../util/error'
|
||||||
import { NormalizedFullOptions, applyDefault } from '../liquid-options'
|
import { NormalizedFullOptions, applyDefault } from '../liquid-options'
|
||||||
|
|
||||||
enum ParseState { HTML, OUTPUT, TAG }
|
enum ParseState { HTML, OUTPUT, TAG }
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import DelimitedToken from 'src/parser/delimited-token'
|
import DelimitedToken from '../parser/delimited-token'
|
||||||
import Token from 'src/parser/token'
|
import Token from '../parser/token'
|
||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../parser/tag-token'
|
||||||
import { NormalizedFullOptions } from 'src/liquid-options'
|
import { NormalizedFullOptions } from '../liquid-options'
|
||||||
|
|
||||||
export default function whiteSpaceCtrl (tokens: Token[], options: NormalizedFullOptions) {
|
export default function whiteSpaceCtrl (tokens: Token[], options: NormalizedFullOptions) {
|
||||||
options = { greedy: true, ...options }
|
options = { greedy: true, ...options }
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { RenderError } from 'src/util/error'
|
import { RenderError } from '../util/error'
|
||||||
import assert from 'src/util/assert'
|
import assert from '../util/assert'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../scope/scope'
|
||||||
import ITemplate from 'src/template/itemplate'
|
import ITemplate from '../template/itemplate'
|
||||||
|
|
||||||
export default class Render {
|
export default class Render {
|
||||||
async renderTemplates (templates: ITemplate[], scope: Scope) {
|
async renderTemplates (templates: ITemplate[], scope: Scope) {
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import * as lexical from '../parser/lexical'
|
import * as lexical from '../parser/lexical'
|
||||||
import assert from '../util/assert'
|
import assert from '../util/assert'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../scope/scope'
|
||||||
import { range, last } from 'src/util/underscore'
|
import { range, last } from '../util/underscore'
|
||||||
import { isComparable } from 'src/drop/icomparable'
|
import { isComparable } from '../drop/icomparable'
|
||||||
import { NullDrop } from 'src/drop/null-drop'
|
import { NullDrop } from '../drop/null-drop'
|
||||||
import { EmptyDrop } from 'src/drop/empty-drop'
|
import { EmptyDrop } from '../drop/empty-drop'
|
||||||
import { BlankDrop } from 'src/drop/blank-drop'
|
import { BlankDrop } from '../drop/blank-drop'
|
||||||
import { isDrop } from 'src/drop/idrop'
|
import { isDrop } from '../drop/idrop'
|
||||||
|
|
||||||
const binaryOperators: {[key: string]: (lhs: any, rhs: any) => boolean} = {
|
const binaryOperators: {[key: string]: (lhs: any, rhs: any) => boolean} = {
|
||||||
'==': (l: any, r: any) => {
|
'==': (l: any, r: any) => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { evalValue } from 'src/render/syntax'
|
import { evalValue } from '../../render/syntax'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../scope/scope'
|
||||||
import { FilterImpl } from './filter-impl'
|
import { FilterImpl } from './filter-impl'
|
||||||
|
|
||||||
export default class Filter {
|
export default class Filter {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import Template from 'src/template/template'
|
import Template from '../template/template'
|
||||||
import ITemplate from 'src/template/itemplate'
|
import ITemplate from '../template/itemplate'
|
||||||
import HTMLToken from 'src/parser/html-token'
|
import HTMLToken from '../parser/html-token'
|
||||||
|
|
||||||
export default class extends Template<HTMLToken> implements ITemplate {
|
export default class extends Template<HTMLToken> implements ITemplate {
|
||||||
str: string
|
str: string
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import Scope from 'src/scope/scope'
|
import Scope from '../scope/scope'
|
||||||
import Token from 'src/parser/token'
|
import Token from '../parser/token'
|
||||||
|
|
||||||
export default interface ITemplate {
|
export default interface ITemplate {
|
||||||
token: Token;
|
token: Token;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import Value from './value'
|
import Value from './value'
|
||||||
import { stringify } from 'src/util/underscore'
|
import { stringify } from '../util/underscore'
|
||||||
import Template from 'src/template/template'
|
import Template from '../template/template'
|
||||||
import ITemplate from 'src/template/itemplate'
|
import ITemplate from '../template/itemplate'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../scope/scope'
|
||||||
import OutputToken from 'src/parser/output-token'
|
import OutputToken from '../parser/output-token'
|
||||||
|
|
||||||
export default class Output extends Template<OutputToken> implements ITemplate {
|
export default class Output extends Template<OutputToken> implements ITemplate {
|
||||||
value: Value
|
value: Value
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { hashCapture } from 'src/parser/lexical'
|
import { hashCapture } from '../../parser/lexical'
|
||||||
import { evalValue } from 'src/render/syntax'
|
import { evalValue } from '../../render/syntax'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../scope/scope'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Key-Value Pairs Representing Tag Arguments
|
* Key-Value Pairs Representing Tag Arguments
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../scope/scope'
|
||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../../parser/tag-token'
|
||||||
import Token from 'src/parser/token'
|
import Token from '../../parser/token'
|
||||||
import Hash from 'src/template/tag/hash'
|
import Hash from '../../template/tag/hash'
|
||||||
import ITagImpl from './itag-impl'
|
import ITagImpl from './itag-impl'
|
||||||
|
|
||||||
export default interface ITagImplOptions {
|
export default interface ITagImplOptions {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../liquid'
|
||||||
import ITagImplOptions from './itag-impl-options'
|
import ITagImplOptions from './itag-impl-options'
|
||||||
|
|
||||||
export default interface ITagImpl extends ITagImplOptions {
|
export default interface ITagImpl extends ITagImplOptions {
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { create, stringify } from 'src/util/underscore'
|
import { create, stringify } from '../../util/underscore'
|
||||||
import assert from 'src/util/assert'
|
import assert from '../../util/assert'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../scope/scope'
|
||||||
import ITagImpl from './itag-impl'
|
import ITagImpl from './itag-impl'
|
||||||
import ITagImplOptions from './itag-impl-options'
|
import ITagImplOptions from './itag-impl-options'
|
||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../liquid'
|
||||||
import Hash from './hash'
|
import Hash from './hash'
|
||||||
import Template from 'src/template/template'
|
import Template from '../../template/template'
|
||||||
import ITemplate from 'src/template/itemplate'
|
import ITemplate from '../../template/itemplate'
|
||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../../parser/tag-token'
|
||||||
import Token from 'src/parser/token'
|
import Token from '../../parser/token'
|
||||||
|
|
||||||
export default class Tag extends Template<TagToken> implements ITemplate {
|
export default class Tag extends Template<TagToken> implements ITemplate {
|
||||||
name: string
|
name: string
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { evalExp } from 'src/render/syntax'
|
import { evalExp } from '../render/syntax'
|
||||||
import Filter from './filter/filter'
|
import Filter from './filter/filter'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../scope/scope'
|
||||||
|
|
||||||
enum ParseState {
|
enum ParseState {
|
||||||
INIT = 0,
|
INIT = 0,
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
import * as _ from './underscore'
|
import * as _ from './underscore'
|
||||||
import Token from 'src/parser/token'
|
import Token from '../parser/token'
|
||||||
import ITemplate from 'src/template/itemplate'
|
import ITemplate from '../template/itemplate'
|
||||||
|
|
||||||
abstract class LiquidError extends Error {
|
abstract class LiquidError extends Error {
|
||||||
private token: Token
|
private token: Token
|
||||||
|
|||||||
@@ -62,13 +62,6 @@ export function isArray (value: any): value is any[] {
|
|||||||
return toStr.call(value) === '[object Array]'
|
return toStr.call(value) === '[object Array]'
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isError (value: any): value is Error {
|
|
||||||
const signature = toStr.call(value)
|
|
||||||
// [object XXXError]
|
|
||||||
return signature.substr(-6, 5) === 'Error' ||
|
|
||||||
(typeof value.message === 'string' && typeof value.name === 'string')
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Iterates over own enumerable string keyed properties of an object and invokes iteratee for each property.
|
* Iterates over own enumerable string keyed properties of an object and invokes iteratee for each property.
|
||||||
* The iteratee is invoked with three arguments: (value, key, object).
|
* The iteratee is invoked with three arguments: (value, key, object).
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { test } from 'test/stub/render'
|
import { test } from '../../../stub/render'
|
||||||
|
|
||||||
describe('filters/array', function () {
|
describe('filters/array', function () {
|
||||||
describe('join', function () {
|
describe('join', function () {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { test, ctx } from 'test/stub/render'
|
import { test, ctx } from '../../../stub/render'
|
||||||
|
|
||||||
describe('filters/date', function () {
|
describe('filters/date', function () {
|
||||||
it('should support date: %a %b %d %Y', function () {
|
it('should support date: %a %b %d %Y', function () {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { test } from 'test/stub/render'
|
import { test } from '../../../stub/render'
|
||||||
|
|
||||||
describe('filters/html', function () {
|
describe('filters/html', function () {
|
||||||
describe('escape', function () {
|
describe('escape', function () {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { test } from 'test/stub/render'
|
import { test } from '../../../stub/render'
|
||||||
|
|
||||||
describe('filters/math', function () {
|
describe('filters/math', function () {
|
||||||
describe('abs', function () {
|
describe('abs', function () {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { test } from 'test/stub/render'
|
import { test } from '../../../stub/render'
|
||||||
|
|
||||||
describe('filters/object', function () {
|
describe('filters/object', function () {
|
||||||
describe('default', function () {
|
describe('default', function () {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { test } from 'test/stub/render'
|
import { test } from '../../../stub/render'
|
||||||
|
|
||||||
describe('filters/string', function () {
|
describe('filters/string', function () {
|
||||||
describe('append', function () {
|
describe('append', function () {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { test } from 'test/stub/render'
|
import { test } from '../../../stub/render'
|
||||||
|
|
||||||
describe('filters/url', function () {
|
describe('filters/url', function () {
|
||||||
describe('url_decode', function () {
|
describe('url_decode', function () {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../../src/liquid'
|
||||||
import { expect, use } from 'chai'
|
import { expect, use } from 'chai'
|
||||||
import * as chaiAsPromised from 'chai-as-promised'
|
import * as chaiAsPromised from 'chai-as-promised'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../../src/liquid'
|
||||||
import { expect, use } from 'chai'
|
import { expect, use } from 'chai'
|
||||||
import * as chaiAsPromised from 'chai-as-promised'
|
import * as chaiAsPromised from 'chai-as-promised'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../../src/liquid'
|
||||||
import { expect, use } from 'chai'
|
import { expect, use } from 'chai'
|
||||||
import * as chaiAsPromised from 'chai-as-promised'
|
import * as chaiAsPromised from 'chai-as-promised'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../../src/liquid'
|
||||||
import { expect, use } from 'chai'
|
import { expect, use } from 'chai'
|
||||||
import * as chaiAsPromised from 'chai-as-promised'
|
import * as chaiAsPromised from 'chai-as-promised'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../../src/liquid'
|
||||||
import { expect, use } from 'chai'
|
import { expect, use } from 'chai'
|
||||||
import * as chaiAsPromised from 'chai-as-promised'
|
import * as chaiAsPromised from 'chai-as-promised'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../../src/liquid'
|
||||||
import { expect, use } from 'chai'
|
import { expect, use } from 'chai'
|
||||||
import * as chaiAsPromised from 'chai-as-promised'
|
import * as chaiAsPromised from 'chai-as-promised'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../../src/liquid'
|
||||||
import { expect, use } from 'chai'
|
import { expect, use } from 'chai'
|
||||||
import * as chaiAsPromised from 'chai-as-promised'
|
import * as chaiAsPromised from 'chai-as-promised'
|
||||||
import { Context } from 'src/scope/scope'
|
import { Context } from '../../../../src/scope/scope'
|
||||||
|
|
||||||
use(chaiAsPromised)
|
use(chaiAsPromised)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../../src/liquid'
|
||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
|
|
||||||
describe('tags/if', function () {
|
describe('tags/if', function () {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../../src/liquid'
|
||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { mock, restore } from 'test/stub/mockfs'
|
import { mock, restore } from '../../../stub/mockfs'
|
||||||
|
|
||||||
describe('tags/include', function () {
|
describe('tags/include', function () {
|
||||||
let liquid: Liquid
|
let liquid: Liquid
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../../src/liquid'
|
||||||
import { expect, use } from 'chai'
|
import { expect, use } from 'chai'
|
||||||
import * as chaiAsPromised from 'chai-as-promised'
|
import * as chaiAsPromised from 'chai-as-promised'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../../src/liquid'
|
||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { mock, restore } from 'test/stub/mockfs'
|
import { mock, restore } from '../../../stub/mockfs'
|
||||||
|
|
||||||
describe('tags/layout', function () {
|
describe('tags/layout', function () {
|
||||||
let liquid: Liquid
|
let liquid: Liquid
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../../src/liquid'
|
||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
|
|
||||||
describe('tags/raw', function () {
|
describe('tags/raw', function () {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../../src/liquid'
|
||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
|
|
||||||
describe('tags/tablerow', function () {
|
describe('tags/tablerow', function () {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../../src/liquid'
|
||||||
import { expect, use } from 'chai'
|
import { expect, use } from 'chai'
|
||||||
import * as chaiAsPromised from 'chai-as-promised'
|
import * as chaiAsPromised from 'chai-as-promised'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../src/liquid'
|
||||||
|
|
||||||
describe('drop/blank-drop', function () {
|
describe('drop/blank-drop', function () {
|
||||||
let liquid: Liquid
|
let liquid: Liquid
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../src/liquid'
|
||||||
|
|
||||||
describe('drop/empty-drop', function () {
|
describe('drop/empty-drop', function () {
|
||||||
let liquid: Liquid
|
let liquid: Liquid
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../src/liquid'
|
||||||
|
|
||||||
describe('drop/null-drop', function () {
|
describe('drop/null-drop', function () {
|
||||||
let liquid: Liquid
|
let liquid: Liquid
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../src/liquid'
|
||||||
import { mock, restore } from 'test/stub/mockfs'
|
import { mock, restore } from '../../stub/mockfs'
|
||||||
|
|
||||||
describe('LiquidOptions#cache', function () {
|
describe('LiquidOptions#cache', function () {
|
||||||
let engine: Liquid
|
let engine: Liquid
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../src/liquid'
|
||||||
|
|
||||||
describe('LiquidOptions#*_delimiter_*', function () {
|
describe('LiquidOptions#*_delimiter_*', function () {
|
||||||
it('should respect tag_delimiter_*', async function () {
|
it('should respect tag_delimiter_*', async function () {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { normalize } from 'src/liquid-options'
|
import { normalize } from '../../../src/liquid-options'
|
||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
|
|
||||||
describe('LiquidOptions', function () {
|
describe('LiquidOptions', function () {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../src/liquid'
|
||||||
import * as chai from 'chai'
|
import * as chai from 'chai'
|
||||||
import { mock, restore } from 'test/stub/mockfs'
|
import { mock, restore } from '../../stub/mockfs'
|
||||||
|
|
||||||
const expect = chai.expect
|
const expect = chai.expect
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../src/liquid'
|
||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
|
|
||||||
describe('LiquidOptions#strict_*', function () {
|
describe('LiquidOptions#strict_*', function () {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../src/liquid'
|
||||||
|
|
||||||
describe('LiquidOptions#trimming', function () {
|
describe('LiquidOptions#trimming', function () {
|
||||||
const ctx = { name: 'harttle' }
|
const ctx = { name: 'harttle' }
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../src/liquid'
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
import { mock, restore } from 'test/stub/mockfs'
|
import { mock, restore } from '../../stub/mockfs'
|
||||||
|
|
||||||
let engine = new Liquid()
|
let engine = new Liquid()
|
||||||
const strictEngine = new Liquid({
|
const strictEngine = new Liquid({
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
--require ts-node/register
|
--require ts-node/register
|
||||||
--require tsconfig-paths/register
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import { isString, forOwn } from 'src/util/underscore'
|
import { isString, forOwn } from '../../src/util/underscore'
|
||||||
import fs from 'src/fs'
|
import fs from '../../src/fs/node'
|
||||||
|
|
||||||
type fileDescriptor = { mode: string, content: string }
|
type fileDescriptor = { mode: string, content: string }
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../src/liquid'
|
||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
|
|
||||||
const liquid = new Liquid()
|
const liquid = new Liquid()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import fs from 'src/fs/browser'
|
import fs from '../../../src/fs/browser'
|
||||||
import * as sinon from 'sinon'
|
import * as sinon from 'sinon'
|
||||||
import { expect, use } from 'chai'
|
import { expect, use } from 'chai'
|
||||||
import * as chaiAsPromised from 'chai-as-promised'
|
import * as chaiAsPromised from 'chai-as-promised'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import fs from 'src/fs/node'
|
import fs from '../../../src/fs/node'
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
import { expect, use } from 'chai'
|
import { expect, use } from 'chai'
|
||||||
import * as chaiAsPromised from 'chai-as-promised'
|
import * as chaiAsPromised from 'chai-as-promised'
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as chai from 'chai'
|
import * as chai from 'chai'
|
||||||
|
|
||||||
const expect = chai.expect
|
const expect = chai.expect
|
||||||
const lexical = require('src/parser/lexical')
|
const lexical = require('../../../src/parser/lexical')
|
||||||
|
|
||||||
describe('lexical', function () {
|
describe('lexical', function () {
|
||||||
it('should test range literal', function () {
|
it('should test range literal', function () {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import Tokenizer from 'src/parser/tokenizer'
|
import Tokenizer from '../../../src/parser/tokenizer'
|
||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../../../src/parser/tag-token'
|
||||||
import OutputToken from 'src/parser/output-token'
|
import OutputToken from '../../../src/parser/output-token'
|
||||||
import HTMLToken from 'src/parser/html-token'
|
import HTMLToken from '../../../src/parser/html-token'
|
||||||
|
|
||||||
describe('tokenizer', function () {
|
describe('tokenizer', function () {
|
||||||
const tokenizer = new Tokenizer()
|
const tokenizer = new Tokenizer()
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../../src/scope/scope'
|
||||||
import Token from 'src/parser/token'
|
import Token from '../../../src/parser/token'
|
||||||
import Tag from 'src/template/tag/tag'
|
import Tag from '../../../src/template/tag/tag'
|
||||||
import Filter from 'src/template/filter/filter'
|
import Filter from '../../../src/template/filter/filter'
|
||||||
import Render from 'src/render/render'
|
import Render from '../../../src/render/render'
|
||||||
import HTML from 'src/template/html'
|
import HTML from '../../../src/template/html'
|
||||||
|
|
||||||
describe('render', function () {
|
describe('render', function () {
|
||||||
let render: Render
|
let render: Render
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../../src/scope/scope'
|
||||||
import { expect } from 'chai'
|
import { expect } from 'chai'
|
||||||
import { evalExp, evalValue, isTruthy } from 'src/render/syntax'
|
import { evalExp, evalValue, isTruthy } from '../../../src/render/syntax'
|
||||||
|
|
||||||
describe('render/syntax', function () {
|
describe('render/syntax', function () {
|
||||||
let scope: Scope
|
let scope: Scope
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as chai from 'chai'
|
import * as chai from 'chai'
|
||||||
import Scope, { Context } from 'src/scope/scope'
|
import Scope, { Context } from '../../../src/scope/scope'
|
||||||
|
|
||||||
const expect = chai.expect
|
const expect = chai.expect
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import * as chai from 'chai'
|
import * as chai from 'chai'
|
||||||
import * as sinon from 'sinon'
|
import * as sinon from 'sinon'
|
||||||
import * as sinonChai from 'sinon-chai'
|
import * as sinonChai from 'sinon-chai'
|
||||||
import Filter from 'src/template/filter/filter'
|
import Filter from '../../../../src/template/filter/filter'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../../../src/scope/scope'
|
||||||
|
|
||||||
chai.use(sinonChai)
|
chai.use(sinonChai)
|
||||||
const expect = chai.expect
|
const expect = chai.expect
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import * as chai from 'chai'
|
import * as chai from 'chai'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../../src/scope/scope'
|
||||||
import Output from 'src/template/output'
|
import Output from '../../../src/template/output'
|
||||||
import OutputToken from 'src/parser/output-token'
|
import OutputToken from '../../../src/parser/output-token'
|
||||||
import Filter from 'src/template/filter/filter'
|
import Filter from '../../../src/template/filter/filter'
|
||||||
|
|
||||||
const expect = chai.expect
|
const expect = chai.expect
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import * as chai from 'chai'
|
import * as chai from 'chai'
|
||||||
import Tag from 'src/template/tag/tag'
|
import Tag from '../../../src/template/tag/tag'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../../src/scope/scope'
|
||||||
import * as sinon from 'sinon'
|
import * as sinon from 'sinon'
|
||||||
import * as sinonChai from 'sinon-chai'
|
import * as sinonChai from 'sinon-chai'
|
||||||
import Liquid from 'src/liquid'
|
import Liquid from '../../../src/liquid'
|
||||||
import TagToken from 'src/parser/tag-token'
|
import TagToken from '../../../src/parser/tag-token'
|
||||||
|
|
||||||
chai.use(sinonChai)
|
chai.use(sinonChai)
|
||||||
const expect = chai.expect
|
const expect = chai.expect
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import * as chai from 'chai'
|
import * as chai from 'chai'
|
||||||
import * as sinonChai from 'sinon-chai'
|
import * as sinonChai from 'sinon-chai'
|
||||||
import * as sinon from 'sinon'
|
import * as sinon from 'sinon'
|
||||||
import Scope from 'src/scope/scope'
|
import Scope from '../../../src/scope/scope'
|
||||||
import Filter from 'src/template/filter/filter'
|
import Filter from '../../../src/template/filter/filter'
|
||||||
import Value from 'src/template/value'
|
import Value from '../../../src/template/value'
|
||||||
|
|
||||||
chai.use(sinonChai)
|
chai.use(sinonChai)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as chai from 'chai'
|
import * as chai from 'chai'
|
||||||
import assert from 'src/util/assert'
|
import assert from '../../../src/util/assert'
|
||||||
|
|
||||||
const expect = chai.expect
|
const expect = chai.expect
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const expect = chai.expect
|
|||||||
chai.use(sinonChai)
|
chai.use(sinonChai)
|
||||||
chai.use(chaiAsPromised)
|
chai.use(chaiAsPromised)
|
||||||
|
|
||||||
const P = require('src/util/promise')
|
const P = require('../../../src/util/promise')
|
||||||
|
|
||||||
describe('util/promise', function () {
|
describe('util/promise', function () {
|
||||||
describe('.mapSeries()', async function () {
|
describe('.mapSeries()', async function () {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user