itismyskillmarket 1.1.2 → 1.1.3
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.
- package/dist/index.js +4 -2
- package/package.json +1 -1
- package/src/commands/ls.ts +1 -1
- package/src/commands/npm.ts +3 -1
package/dist/index.js
CHANGED
|
@@ -138,7 +138,9 @@ async function searchSkillmarketPackages() {
|
|
|
138
138
|
try {
|
|
139
139
|
const result = JSON.parse(data);
|
|
140
140
|
for (const item of result.objects || []) {
|
|
141
|
-
|
|
141
|
+
if (item?.package?.name) {
|
|
142
|
+
packages.push(item.package.name);
|
|
143
|
+
}
|
|
142
144
|
}
|
|
143
145
|
resolve(packages);
|
|
144
146
|
} catch {
|
|
@@ -185,7 +187,7 @@ async function listSkills(options) {
|
|
|
185
187
|
const info = await fetchNpmPackage(pkgName);
|
|
186
188
|
if (info) {
|
|
187
189
|
const latestVersion = info["dist-tags"]?.latest;
|
|
188
|
-
const pkg = info.versions[latestVersion];
|
|
190
|
+
const pkg = info.versions?.[latestVersion];
|
|
189
191
|
console.log(` ${info.name}@${latestVersion}`);
|
|
190
192
|
console.log(` ${pkg?.description || "No description"}`);
|
|
191
193
|
console.log();
|
package/package.json
CHANGED
package/src/commands/ls.ts
CHANGED
|
@@ -124,7 +124,7 @@ export async function listSkills(options: LsOptions): Promise<void> {
|
|
|
124
124
|
const latestVersion = info['dist-tags']?.latest;
|
|
125
125
|
|
|
126
126
|
// 获取该版本的详细信息
|
|
127
|
-
const pkg = info.versions[latestVersion];
|
|
127
|
+
const pkg = info.versions?.[latestVersion];
|
|
128
128
|
|
|
129
129
|
// 打印包名和版本
|
|
130
130
|
console.log(` ${info.name}@${latestVersion}`);
|
package/src/commands/npm.ts
CHANGED
|
@@ -208,7 +208,9 @@ export async function searchSkillmarketPackages(): Promise<string[]> {
|
|
|
208
208
|
// 提取所有匹配的包名
|
|
209
209
|
// npm search 返回结构: { objects: [{ package: { name: "..." } }] }
|
|
210
210
|
for (const item of result.objects || []) {
|
|
211
|
-
|
|
211
|
+
if (item?.package?.name) {
|
|
212
|
+
packages.push(item.package.name);
|
|
213
|
+
}
|
|
212
214
|
}
|
|
213
215
|
|
|
214
216
|
resolve(packages);
|