@series-inc/stowkit-cli 0.6.18 → 0.6.19

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.
@@ -40,6 +40,8 @@ export interface RegistryPackage {
40
40
  tags: string[];
41
41
  latest: string;
42
42
  versions: Record<string, RegistryVersion>;
43
+ /** Pack-level thumbnail filename (e.g. "thumbnail.webp"), uploaded during publish */
44
+ thumbnail?: string;
43
45
  }
44
46
  export interface Registry {
45
47
  schemaVersion: number;
package/dist/publish.js CHANGED
@@ -321,6 +321,23 @@ export async function publishPackage(projectDir, opts = {}) {
321
321
  const receiptPath = `${uploadPrefix}/assets-package.json`;
322
322
  await gcs.upload(receiptPath, JSON.stringify(pkg, null, 2), 'application/json');
323
323
  totalDone++;
324
+ // Step 12b: Upload pack-level thumbnail if present in project root
325
+ let packThumbnail;
326
+ for (const candidate of ['thumbnail.webp', 'thumbnail.png', 'thumbnail.jpg']) {
327
+ const thumbPath = path.join(projectDir, candidate);
328
+ try {
329
+ const thumbData = new Uint8Array(await fs.readFile(thumbPath));
330
+ const ext = candidate.split('.').pop();
331
+ const mime = ext === 'webp' ? 'image/webp' : ext === 'png' ? 'image/png' : 'image/jpeg';
332
+ const objectPath = `${uploadPrefix}/${candidate}`;
333
+ await gcs.upload(objectPath, thumbData, mime);
334
+ packThumbnail = candidate;
335
+ totalDone++;
336
+ log(` Uploaded pack thumbnail: ${candidate} (${formatBytes(thumbData.length)})`);
337
+ break;
338
+ }
339
+ catch { /* file doesn't exist, try next */ }
340
+ }
324
341
  // Step 13: Update and upload registry
325
342
  log('Updating registry...');
326
343
  if (!registry.packages[pkg.name]) {
@@ -338,6 +355,8 @@ export async function publishPackage(projectDir, opts = {}) {
338
355
  regPkg.description = pkg.description;
339
356
  regPkg.author = pkg.author;
340
357
  regPkg.tags = pkg.tags ?? [];
358
+ if (packThumbnail)
359
+ regPkg.thumbnail = packThumbnail;
341
360
  emitProgress({ phase: 'registry', done: totalDone, total: totalUploads, message: 'Updating registry...' });
342
361
  await gcs.uploadWithGeneration('registry.json', JSON.stringify(registry, null, 2), generation);
343
362
  totalDone++;
package/dist/store.d.ts CHANGED
@@ -23,6 +23,8 @@ export interface PackageInfo {
23
23
  versions: string[];
24
24
  assetCount: number;
25
25
  totalSize: number;
26
+ /** Full URL to pack-level thumbnail, if uploaded */
27
+ thumbnailUrl?: string;
26
28
  }
27
29
  export declare function searchAssets(registry: Registry, query: string, opts?: {
28
30
  type?: string;
package/dist/store.js CHANGED
@@ -184,8 +184,12 @@ function scoreAsset(terms, asset, pkg, pkgName, skipPkgMeta = false) {
184
184
  }
185
185
  // ─── List Packages ───────────────────────────────────────────────────────────
186
186
  export function listPackages(registry) {
187
+ const bucket = DEFAULT_BUCKET;
187
188
  return Object.entries(registry.packages).map(([name, pkg]) => {
188
189
  const ver = pkg.versions[pkg.latest];
190
+ const thumbnailUrl = pkg.thumbnail
191
+ ? `https://storage.googleapis.com/${bucket}/packages/${name}/${pkg.latest}/${pkg.thumbnail}`
192
+ : undefined;
189
193
  return {
190
194
  name,
191
195
  description: pkg.description,
@@ -195,6 +199,7 @@ export function listPackages(registry) {
195
199
  versions: Object.keys(pkg.versions),
196
200
  assetCount: ver?.assets.length ?? 0,
197
201
  totalSize: ver?.totalSize ?? 0,
202
+ thumbnailUrl,
198
203
  };
199
204
  });
200
205
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@series-inc/stowkit-cli",
3
- "version": "0.6.18",
3
+ "version": "0.6.19",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "stowkit": "./dist/cli.js"
@@ -17,7 +17,7 @@
17
17
  "dev": "tsc --watch"
18
18
  },
19
19
  "dependencies": {
20
- "@series-inc/stowkit-packer-gui": "^0.1.17",
20
+ "@series-inc/stowkit-packer-gui": "^0.1.18",
21
21
  "@series-inc/stowkit-editor": "^0.1.8",
22
22
  "draco3d": "^1.5.7",
23
23
  "fbx-parser": "^2.1.3",