Skip to content

Commit 71b615f

Browse files
url handling
1 parent a148526 commit 71b615f

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

.changeset/fix-cli-url-handling.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@walkeros/cli': patch
3+
---
4+
5+
Fix URL handling in resolveAsset - URLs are now passed through unchanged instead
6+
of being mangled into invalid filesystem paths

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
exit $EXIT_CODE
9595
fi
9696
# Extract published packages for PR comment
97-
PUBLISHED=$(echo "$OUTPUT" | grep -E "^@walkeros/|^walkeros" | head -20 || true)
97+
PUBLISHED=$(echo "$OUTPUT" | grep -E "^@walkeros/|^walkeros" | head -20 | sed 's/^/- /' || true)
9898
echo "published<<EOF" >> $GITHUB_OUTPUT
9999
echo "$PUBLISHED" >> $GITHUB_OUTPUT
100100
echo "EOF" >> $GITHUB_OUTPUT
@@ -204,6 +204,7 @@ jobs:
204204
205205
BODY="$EMOJI **$TITLE**
206206
207+
**Packages**
207208
${{ steps.publish.outputs.published }}
208209
209210
Install: \`npm i @walkeros/core$INSTALL_TAG\`$DOCKER_SECTION"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { resolveAsset } from '../../core/asset-resolver.js';
2+
3+
describe('resolveAsset', () => {
4+
describe('URL handling', () => {
5+
it('should preserve HTTPS URLs as-is', () => {
6+
const url = 'https://www.walkeros.io/flows/gcp-bigquery.json';
7+
expect(resolveAsset(url, 'config')).toBe(url);
8+
});
9+
10+
it('should preserve HTTP URLs as-is', () => {
11+
const url = 'http://example.com/config.json';
12+
expect(resolveAsset(url, 'config')).toBe(url);
13+
});
14+
});
15+
});

packages/cli/src/core/asset-resolver.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import { fileURLToPath } from 'url';
99
import { existsSync } from 'fs';
1010
import path from 'path';
11+
import { isUrl } from '../config/utils.js';
1112

1213
/**
1314
* Cached asset directory to avoid repeated filesystem checks
@@ -65,6 +66,11 @@ export function resolveAsset(
6566
assetType: AssetType,
6667
baseDir?: string,
6768
): string {
69+
// URL → pass through unchanged
70+
if (isUrl(assetPath)) {
71+
return assetPath;
72+
}
73+
6874
// Bare name → package asset (examples directory)
6975
if (!assetPath.includes('/') && !assetPath.includes('\\')) {
7076
const assetDir = getAssetDir();

0 commit comments

Comments
 (0)