@lightdash/cli 0.2399.0 → 0.2399.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"installSkills.d.ts","sourceRoot":"","sources":["../../src/handlers/installSkills.ts"],"names":[],"mappings":"AAYA,KAAK,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE/C,KAAK,oBAAoB,GAAG;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAsMF,eAAO,MAAM,oBAAoB,YACpB,oBAAoB,KAC9B,OAAO,CAAC,IAAI,CA8Dd,CAAC"}
1
+ {"version":3,"file":"installSkills.d.ts","sourceRoot":"","sources":["../../src/handlers/installSkills.ts"],"names":[],"mappings":"AAYA,KAAK,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE/C,KAAK,oBAAoB,GAAG;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAuMF,eAAO,MAAM,oBAAoB,YACpB,oBAAoB,KAC9B,OAAO,CAAC,IAAI,CA8Dd,CAAC"}
@@ -83,11 +83,9 @@ async function fetchFileContent(downloadUrl) {
83
83
  }
84
84
  return response.text();
85
85
  }
86
- async function resolveSymlinkTarget(symlinkPath, target) {
87
- // Resolve the symlink relative to its location
88
- const symlinkDir = path.dirname(symlinkPath);
89
- const resolvedPath = path.posix.normalize(path.posix.join(symlinkDir, target));
90
- return resolvedPath;
86
+ function resolveSymlinkTarget(symlinkPath, target) {
87
+ const symlinkDir = path.posix.dirname(symlinkPath);
88
+ return path.posix.normalize(path.posix.join(symlinkDir, target.trim()));
91
89
  }
92
90
  /* eslint-disable no-await-in-loop */
93
91
  // Sequential downloads are intentional to avoid GitHub rate limits and handle symlinks
@@ -107,7 +105,7 @@ async function downloadSkillFiles(repoPath, localDir, visited = new Set()) {
107
105
  }
108
106
  else if (item.type === 'symlink' && item.target) {
109
107
  // Resolve the symlink and fetch the actual content
110
- const resolvedPath = await resolveSymlinkTarget(item.path, item.target);
108
+ const resolvedPath = resolveSymlinkTarget(item.path, item.target);
111
109
  globalState_1.default.debug(`> Resolving symlink: ${item.path} -> ${resolvedPath}`);
112
110
  // Check if the target is a directory or file by fetching it
113
111
  try {
@@ -136,8 +134,13 @@ async function downloadSkillFiles(repoPath, localDir, visited = new Set()) {
136
134
  }
137
135
  }
138
136
  else if (item.type === 'file' && item.download_url) {
139
- const content = await fetchFileContent(item.download_url);
140
- // Ensure parent directory exists
137
+ let content = await fetchFileContent(item.download_url);
138
+ // GitHub returns symlink content as the target path - resolve it
139
+ if (content.startsWith('../') || content.startsWith('./')) {
140
+ const resolvedPath = resolveSymlinkTarget(item.path, content);
141
+ globalState_1.default.debug(`> Resolving symlink: ${item.path} -> ${resolvedPath}`);
142
+ content = await fetchFileContent(`${GITHUB_RAW_BASE}/${resolvedPath}`);
143
+ }
141
144
  fs.mkdirSync(path.dirname(localPath), { recursive: true });
142
145
  fs.writeFileSync(localPath, content);
143
146
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/cli",
3
- "version": "0.2399.0",
3
+ "version": "0.2399.2",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,8 +38,8 @@
38
38
  "unique-names-generator": "^4.7.1",
39
39
  "uuid": "^11.0.3",
40
40
  "yaml": "^2.7.0",
41
- "@lightdash/common": "0.2399.0",
42
- "@lightdash/warehouses": "0.2399.0"
41
+ "@lightdash/warehouses": "0.2399.2",
42
+ "@lightdash/common": "0.2399.2"
43
43
  },
44
44
  "description": "Lightdash CLI tool",
45
45
  "devDependencies": {