Compare commits

...
Author SHA1 Message Date
Yang JunandCursor 9babd79de1 fix(release): skip git plugin on next for protected branch publishing
Co-authored-by: Cursor <[email protected]>
2026-07-07 00:23:52 +08:00
Yang JunandCursor 995a2ab496 chore(next): merge master for v11 alpha preview baseline
Co-authored-by: Cursor <[email protected]>
2026-07-07 00:21:42 +08:00
Yang Jun b9d02811a9 chore: update to Node.js LTS 2026-01-11 18:20:46 +08:00
Yang Jun ac0a7c5837 feat!: setup next branch for v11 alpha releases
BREAKING CHANGE: This sets up the next branch for v11.x alpha/preview releases with semantic-release configuration
2026-01-10 00:25:18 +08:00
17 changed files with 67 additions and 91 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
node-version: 'latest'
- name: Install dependencies
run: npm ci
- name: Build
+1 -1
View File
@@ -12,7 +12,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
node-version: 'latest'
- name: Install dependencies
run: npm ci
- name: Test
+1 -1
View File
@@ -12,7 +12,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
node-version: 'latest'
- name: Build
run: |
npm ci
+1 -1
View File
@@ -12,7 +12,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
node-version: 'latest'
- name: Install dependencies
run: npm ci
- name: Lint
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
node-version: 'latest'
- name: Download artifacts
uses: actions/download-artifact@v4
with:
+1 -6
View File
@@ -24,12 +24,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
if [ ${{ github.ref == 'refs/heads/master' }} ]; then
npx semantic-release
else
npx semantic-release --dry-run
fi
run: npx semantic-release
- name: Archive npm failure logs
uses: actions/upload-artifact@v4
if: failure()
+4 -14
View File
@@ -7,20 +7,10 @@ jobs:
matrix:
os: [ubuntu-latest]
timezone: [Etc/GMT, Asia/Shanghai, America/New_York]
node-version: [22]
node-version: [latest]
include:
- os: macos-latest
timezone: America/New_York
node-versoin: 22
- os: ubuntu-latest
timezone: Etc/GMT
node-version: 20
- os: ubuntu-latest
timezone: Asia/Shanghai
node-version: 18
- os: ubuntu-latest
timezone: Asia/Shanghai
node-version: 16
node-version: lts/*
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
@@ -39,7 +29,7 @@ jobs:
name: dist-${{ matrix.os }}
path: dist
- name: Run Test
run: TZ=${{ matrix.timezone }} npm test
run: TZ=${{ matrix.timezone || 'Etc/GMT' }} npm test
- name: Archive npm failure logs
uses: actions/upload-artifact@v4
if: failure()
@@ -57,7 +47,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22
node-version: latest
- name: Download artifacts
uses: actions/download-artifact@v4
with:
+40
View File
@@ -0,0 +1,40 @@
const gitPlugin = [
'@semantic-release/git',
{
assets: ['package.json', 'package-lock.json', 'CHANGELOG.md'],
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
}
]
const githubPlugin = [
'@semantic-release/github',
{
assets: [
{ path: 'dist/*.umd.js', label: 'liquid.js' },
{ path: 'dist/*.min.js', label: 'liquid.min.js' },
{ path: 'dist/*.min.js.map', label: 'liquid.min.js.map' }
]
}
]
const basePlugins = [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/changelog',
'@semantic-release/npm'
]
// next is branch-protected (PR-only); skip @semantic-release/git there and publish to npm only.
const onMaster = process.env.GITHUB_REF === 'refs/heads/master'
module.exports = {
branches: [
'master',
{ name: 'next', prerelease: 'alpha' }
],
plugins: [
...basePlugins,
...(onMaster ? [gitPlugin] : []),
githubPlugin
]
}
+1 -1
View File
@@ -64,7 +64,7 @@
"typescript": "^4.5.3"
},
"engines": {
"node": ">=16"
"node": ">=20"
},
"funding": {
"type": "opencollective",
+1 -40
View File
@@ -12,7 +12,7 @@
},
"types": "dist/index.d.ts",
"engines": {
"node": ">=16"
"node": ">=20"
},
"scripts": {
"lint": "eslint \"**/*.mjs\" \"**/*.ts\" .",
@@ -121,45 +121,6 @@
"dependencies": {
"commander": "^10.0.0"
},
"release": {
"branch": "master",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": [
"package.json",
"package-lock.json",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "dist/*.umd.js",
"label": "liquid.js"
},
{
"path": "dist/*.min.js",
"label": "liquid.min.js"
},
{
"path": "dist/*.min.js.map",
"label": "liquid.min.js.map"
}
]
}
]
]
},
"publishConfig": {
"provenance": true
},
+4 -4
View File
@@ -89,7 +89,7 @@ const nodeEsm = {
plugins: [
versionInjection,
replace(esmRequire),
typescript(tsconfig('es6'))
typescript(tsconfig('ES2020'))
],
treeshake,
input
@@ -108,7 +108,7 @@ const browserEsm = {
replace(browserBase64),
replace(browserCrypto),
replace(browserStream),
typescript(tsconfig('es6'))
typescript(tsconfig('ES2020'))
],
treeshake,
input
@@ -128,7 +128,7 @@ const browserUmd = {
replace(browserBase64),
replace(browserCrypto),
replace(browserStream),
typescript(tsconfig('es5'))
typescript(tsconfig('ES2020'))
],
treeshake,
input
@@ -148,7 +148,7 @@ const browserMin = {
replace(browserBase64),
replace(browserCrypto),
replace(browserStream),
typescript(tsconfig('es5')),
typescript(tsconfig('ES2020')),
uglify()
],
treeshake,
-5
View File
@@ -2,11 +2,6 @@ import * as base64 from './base64-impl-browser'
import { JSDOM } from 'jsdom'
describe('base64-impl/browser', function () {
if (+(process.version.match(/^v(\d+)/) as RegExpMatchArray)[1] < 8) {
console.info('jsdom not supported, skipping base64-impl-browser...')
return
}
beforeEach(function () {
const dom = new JSDOM(``, {
url: 'https://example.com/',
-4
View File
@@ -3,10 +3,6 @@ import * as sinon from 'sinon'
import { JSDOM } from 'jsdom'
describe('fs/browser', function () {
if (+(process.version.match(/^v(\d+)/) as RegExpMatchArray)[1] < 8) {
console.info('jsdom not supported, skipping template-browser...')
return
}
beforeEach(function () {
const dom = new JSDOM(``, {
url: 'https://example.com/foo/bar/',
+1 -1
View File
@@ -46,7 +46,7 @@ export function * sort_natural<T> (this: FilterImpl, arr: T[], property?: string
return yield * sortBy.call(this, arr, property, caseInsensitiveCompare)
}
export const size = (v: string | any[]) => (v && v.length) || 0
export const size = (v: string | any[]) => v?.length || 0
export function * map (this: FilterImpl, arr: Scope[], property: string): IterableIterator<unknown> {
const results = []
+4 -4
View File
@@ -204,11 +204,11 @@ export const defaultOptions: NormalizedFullOptions = {
}
export function normalize (options: LiquidOptions): NormalizedFullOptions {
if (options.hasOwnProperty('root')) {
if (!options.hasOwnProperty('partials')) options.partials = options.root
if (!options.hasOwnProperty('layouts')) options.layouts = options.root
if ('root' in options) {
if (!('partials' in options)) options.partials = options.root
if (!('layouts' in options)) options.layouts = options.root
}
if (options.hasOwnProperty('cache')) {
if ('cache' in options) {
let cache: LiquidCache | undefined
if (typeof options.cache === 'number') cache = options.cache > 0 ? new LRU(options.cache) : undefined
else if (typeof options.cache === 'object') cache = options.cache
+2 -4
View File
@@ -1,10 +1,9 @@
import { Drop } from '../drop/drop'
export const toString = Object.prototype.toString
export const hasOwnProperty = Object.prototype.hasOwnProperty
const toLowerCase = String.prototype.toLowerCase
export const hasOwnProperty = Object.hasOwnProperty
export function isString (value: any): value is string {
return typeof value === 'string'
}
@@ -90,8 +89,7 @@ export function isUndefined (value: any): boolean {
}
export function isArray (value: any): value is any[] {
// be compatible with IE 8
return toString.call(value) === '[object Array]'
return Array.isArray(value)
}
export function isArrayLike (value: any): value is any[] {
+4 -3
View File
@@ -1,8 +1,9 @@
{
"compilerOptions": {
"target": "es6",
"module":"CommonJS",
"lib": ["es2015", "es2016", "es2017", "dom"],
"target": "ES2020",
"module":"ES2020",
"lib": ["ES2020", "dom"],
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist",
"declaration": true,