Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: check node@14 on pipeline, #728 #731

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"prefer-const": 2,
"no-unused-vars": "off",
"indent": "off",
"no-mixed-operators": "off",
"no-dupe-class-members": "off",
"no-useless-constructor": "off",
"@typescript-eslint/indent": ["error", 2],
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@ jobs:
name: Test
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest]
timezone: [Etc/GMT, Asia/Shanghai, America/New_York]
node-version: [22]
include:
- os: macos-latest
timezone: America/New_York
node-versoin: 22
- os: ubuntu-latest
timezone: Etc/GMT
node-version: 16
- os: ubuntu-latest
timezone: Asia/Shanghai
node-version: 14
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
Expand All @@ -16,7 +27,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Download artifacts
Expand Down
7 changes: 7 additions & 0 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ const browserStream = {
delimiters: ['', ''],
'./streamed-emitter': '../build/streamed-emitter-browser'
}
const browserPerf = {
include: ['./src/context/context.ts', './src/render/render.ts'],
'node:perf_hooks': '../build/perf_hooks-browser'
}
const esmRequire = {
include: './src/fs/node.ts',
delimiters: ['', ''],
Expand Down Expand Up @@ -95,6 +99,7 @@ const browserEsm = {
versionInjection,
replace(browserFS),
replace(browserStream),
replace(browserPerf),
typescript(tsconfig('es6'))
],
treeshake,
Expand All @@ -113,6 +118,7 @@ const browserUmd = {
versionInjection,
replace(browserFS),
replace(browserStream),
replace(browserPerf),
typescript(tsconfig('es5'))
],
treeshake,
Expand All @@ -131,6 +137,7 @@ const browserMin = {
versionInjection,
replace(browserFS),
replace(browserStream),
replace(browserPerf),
typescript(tsconfig('es5')),
uglify()
],
Expand Down
5 changes: 5 additions & 0 deletions src/build/perf_hooks-browser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const polyfill = {
now: () => Date.now()
}

export const performance = typeof window === 'object' && window.performance || polyfill
19 changes: 19 additions & 0 deletions src/parser/parser.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Parser } from './parser'
import { Liquid, TokenKind } from '..'

describe('Parser', () => {
it('should coerce input to string', () => {
const parser = new Parser(new Liquid())
const templates = parser.parse({} as any)
expect(templates.length).toEqual(1)
expect(templates[0]).toMatchObject({
str: '[object Object]',
token: {
kind: TokenKind.HTML,
input: '[object Object]',
begin: 0,
end: 15
}
})
})
})
5 changes: 2 additions & 3 deletions test/e2e/drop.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Liquid } from '../../src/liquid'
import { Drop } from '../../src/drop/drop'
import { Drop, Liquid } from '../..'

class SettingsDrop extends Drop {
private foo = 'FOO'
public foo = 'FOO'
public bar () {
return 'BAR'
}
Expand Down
Loading