From a055c1631555508a8f40022ada6093cdf8e0ea2c Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Wed, 2 Jul 2025 15:26:43 -0700 Subject: [PATCH 1/3] include bad comment in error message --- src/default-matcher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/default-matcher.js b/src/default-matcher.js index 4023c67..bab8676 100644 --- a/src/default-matcher.js +++ b/src/default-matcher.js @@ -24,7 +24,7 @@ module.exports = function defaultMatcher(text) { let match = text.match(/^# ([^#]+) (?:# ([^#]+) )?#$/); if (match === null) { if (text.match(/(^\s*#)|(#\s*$)/)) { - throw new Error('This comment looks kind of like a template comment, but not precisely; this is probably a bug.'); + throw new Error(`This comment looks kind of like a template comment, but not precisely; this is probably a bug: ${JSON.stringify(text)}`); } return null; } From 5228cbabba40ce1f177a1ab835608012e5b1434a Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Wed, 2 Jul 2025 15:19:33 -0700 Subject: [PATCH 2/3] add publish job and bump versions in check job --- .github/workflows/check.yml | 8 ++++---- .github/workflows/publish.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index bac7a18..00350d8 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -31,16 +31,16 @@ jobs: strategy: matrix: - node: [14, 16, 18] + node: [20, 24] name: Check - node ${{ matrix.node }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup node - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..619e02c --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,26 @@ +name: publish + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: '24' + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: npm ci + + - name: Publish + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_FOR_SHAPESECURITY_USER }} \ No newline at end of file From 78adc46eed9bdde1cf6453d80bcd1093b2595c90 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Wed, 2 Jul 2025 15:23:55 -0700 Subject: [PATCH 3/3] Version 3.0.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0ed2f9b..d7201b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "shift-template", - "version": "2.0.0", + "version": "3.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "shift-template", - "version": "2.0.0", + "version": "3.0.0", "license": "Apache-2.0", "dependencies": { "shift-ast": "7.0.0", diff --git a/package.json b/package.json index dccf651..0607b91 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shift-template", - "version": "2.0.0", + "version": "3.0.0", "description": "Shift format AST-based template system for JavaScript", "author": "Shape Security", "homepage": "https://github.com/shapesecurity/shift-template-js",