Skip to content

Commit c6a6ef1

Browse files
authored
chore: check node@14 on pipeline, #728 (#731)
1 parent 6fb707f commit c6a6ef1

File tree

6 files changed

+47
-5
lines changed

6 files changed

+47
-5
lines changed

.eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"prefer-const": 2,
2424
"no-unused-vars": "off",
2525
"indent": "off",
26+
"no-mixed-operators": "off",
2627
"no-dupe-class-members": "off",
2728
"no-useless-constructor": "off",
2829
"@typescript-eslint/indent": ["error", 2],

.github/workflows/test.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,19 @@ jobs:
55
name: Test
66
strategy:
77
matrix:
8-
os: [ubuntu-latest, macos-latest]
8+
os: [ubuntu-latest]
99
timezone: [Etc/GMT, Asia/Shanghai, America/New_York]
10+
node-version: [22]
11+
include:
12+
- os: macos-latest
13+
timezone: America/New_York
14+
node-versoin: 22
15+
- os: ubuntu-latest
16+
timezone: Etc/GMT
17+
node-version: 16
18+
- os: ubuntu-latest
19+
timezone: Asia/Shanghai
20+
node-version: 14
1021
runs-on: ${{ matrix.os }}
1122
steps:
1223
- name: Checkout
@@ -16,7 +27,7 @@ jobs:
1627
- name: Setup Node.js
1728
uses: actions/setup-node@v3
1829
with:
19-
node-version: '20'
30+
node-version: ${{ matrix.node-version }}
2031
- name: Install dependencies
2132
run: npm ci
2233
- name: Download artifacts

rollup.config.mjs

+7
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ const browserStream = {
5050
delimiters: ['', ''],
5151
'./streamed-emitter': '../build/streamed-emitter-browser'
5252
}
53+
const browserPerf = {
54+
include: ['./src/context/context.ts', './src/render/render.ts'],
55+
'node:perf_hooks': '../build/perf_hooks-browser'
56+
}
5357
const esmRequire = {
5458
include: './src/fs/node.ts',
5559
delimiters: ['', ''],
@@ -95,6 +99,7 @@ const browserEsm = {
9599
versionInjection,
96100
replace(browserFS),
97101
replace(browserStream),
102+
replace(browserPerf),
98103
typescript(tsconfig('es6'))
99104
],
100105
treeshake,
@@ -113,6 +118,7 @@ const browserUmd = {
113118
versionInjection,
114119
replace(browserFS),
115120
replace(browserStream),
121+
replace(browserPerf),
116122
typescript(tsconfig('es5'))
117123
],
118124
treeshake,
@@ -131,6 +137,7 @@ const browserMin = {
131137
versionInjection,
132138
replace(browserFS),
133139
replace(browserStream),
140+
replace(browserPerf),
134141
typescript(tsconfig('es5')),
135142
uglify()
136143
],

src/build/perf_hooks-browser.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const polyfill = {
2+
now: () => Date.now()
3+
}
4+
5+
export const performance = typeof window === 'object' && window.performance || polyfill

src/parser/parser.spec.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Parser } from './parser'
2+
import { Liquid, TokenKind } from '..'
3+
4+
describe('Parser', () => {
5+
it('should coerce input to string', () => {
6+
const parser = new Parser(new Liquid())
7+
const templates = parser.parse({} as any)
8+
expect(templates.length).toEqual(1)
9+
expect(templates[0]).toMatchObject({
10+
str: '[object Object]',
11+
token: {
12+
kind: TokenKind.HTML,
13+
input: '[object Object]',
14+
begin: 0,
15+
end: 15
16+
}
17+
})
18+
})
19+
})

test/e2e/drop.spec.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { Liquid } from '../../src/liquid'
2-
import { Drop } from '../../src/drop/drop'
1+
import { Drop, Liquid } from '../..'
32

43
class SettingsDrop extends Drop {
5-
private foo = 'FOO'
4+
public foo = 'FOO'
65
public bar () {
76
return 'BAR'
87
}

0 commit comments

Comments
 (0)