Skip to content

Commit 4328079

Browse files
committed
fix: bundle node icon in published package
tsc does not copy static assets, so dist shipped without hedy.png when built from a clean CI checkout (regressed in 1.3.3, breaking the node icon in n8n). Add a copy-icons build step and a workflow guard that fails the publish if the icon is missing. Also enforce the tag/version match on manual workflow runs. Bump to 1.3.4.
1 parent c1d51ca commit 4328079

5 files changed

Lines changed: 53 additions & 5 deletions

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,14 @@ jobs:
3333
registry-url: 'https://registry.npmjs.org'
3434

3535
- name: Verify tag matches package.json version
36-
if: github.event_name == 'push'
36+
# Runs for both tag pushes and manual dispatch. A manual dispatch from a
37+
# branch ref fails here (its ref name is not v<version>), so the only way
38+
# to publish is from a tag whose name matches package.json — keeping every
39+
# provenance-backed release tied to a tagged commit.
3740
run: |
3841
PKG_VERSION="v$(node -p "require('./package.json').version")"
3942
if [ "$PKG_VERSION" != "$GITHUB_REF_NAME" ]; then
40-
echo "::error::Tag $GITHUB_REF_NAME does not match package.json version $PKG_VERSION"
43+
echo "::error::Ref $GITHUB_REF_NAME does not match package.json version $PKG_VERSION (publish only from a matching tag)"
4144
exit 1
4245
fi
4346
@@ -47,6 +50,10 @@ jobs:
4750
- name: Build
4851
run: npm run build
4952

53+
- name: Verify icon assets are bundled
54+
run: |
55+
test -f dist/nodes/Hedy/hedy.png || { echo "::error::dist/nodes/Hedy/hedy.png is missing — the build did not bundle the node icon"; exit 1; }
56+
5057
- name: Publish to npm with provenance
5158
run: npm publish --provenance --access public
5259
env:

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.3.4] - 2026-06-12
11+
12+
### Fixed
13+
- Bundle the node icon (`hedy.png`) in the published package again. The build now copies icon assets into `dist` (tsc does not), so the icon stopped shipping in 1.3.3 when the package was built from a clean CI checkout. The release workflow also fails fast if the icon is missing from the build output.
14+
15+
### Changed
16+
- The publish workflow enforces the tag/version match on manual runs too, so every provenance-backed release is tied to a matching tag.
17+
- User-Agent header updated to `1.3.4`.
18+
1019
## [1.3.3] - 2026-06-12
1120

1221
### Changed

nodes/Hedy/GenericFunctions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export async function hedyApiRequest(
3434
url: `${baseUrl}${endpoint}`,
3535
headers: {
3636
'Content-Type': 'application/json',
37-
'User-Agent': 'n8n-nodes-hedy/1.3.3',
37+
'User-Agent': 'n8n-nodes-hedy/1.3.4',
3838
},
3939
qs,
4040
body,

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "n8n-nodes-hedy",
3-
"version": "1.3.3",
3+
"version": "1.3.4",
44
"description": "n8n nodes for Hedy - AI-powered meeting intelligence integration",
55
"keywords": [
66
"n8n-community-node-package",
@@ -31,7 +31,7 @@
3131
},
3232
"main": "index.js",
3333
"scripts": {
34-
"build": "tsc",
34+
"build": "tsc && node scripts/copy-icons.mjs",
3535
"dev": "tsc --watch",
3636
"format": "prettier nodes credentials --write",
3737
"lint": "eslint . --ext .ts",

scripts/copy-icons.mjs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copy node/credential icon assets (png, svg) into dist, preserving paths.
2+
//
3+
// tsc only emits JS from TS and does not copy static assets, so without this
4+
// step the published package ships without the `file:hedy.png` icon that both
5+
// nodes declare. That regressed in 1.3.3 (built from a clean CI checkout) and
6+
// is fixed here. Run as part of `npm run build`.
7+
import { readdirSync, mkdirSync, copyFileSync, existsSync } from 'fs';
8+
import { join } from 'path';
9+
10+
const SRC_DIRS = ['nodes', 'credentials'];
11+
const ASSET_EXTENSIONS = ['.png', '.svg'];
12+
13+
let copied = 0;
14+
15+
function walk(dir) {
16+
if (!existsSync(dir)) return;
17+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
18+
const sourcePath = join(dir, entry.name);
19+
if (entry.isDirectory()) {
20+
walk(sourcePath);
21+
} else if (ASSET_EXTENSIONS.some((ext) => entry.name.endsWith(ext))) {
22+
const destPath = join('dist', sourcePath);
23+
mkdirSync(join('dist', dir), { recursive: true });
24+
copyFileSync(sourcePath, destPath);
25+
copied++;
26+
console.log(`copy-icons: ${sourcePath} -> ${destPath}`);
27+
}
28+
}
29+
}
30+
31+
for (const dir of SRC_DIRS) walk(dir);
32+
console.log(`copy-icons: ${copied} asset(s) copied`);

0 commit comments

Comments
 (0)