1tube 0.1.17 → 0.1.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "1tube",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "private": false,
5
5
  "description": "Self-hosted Supabase Edge Functions gateway for Deno, plus an ESLint plugin for consumers",
6
6
  "license": "MIT",
@@ -484,13 +484,23 @@ export class RuntimeOverrideStore {
484
484
  if (extracted.length > 0) return { source: "sourcemap", files: extracted };
485
485
  }
486
486
 
487
- const bundleFile = entry.moduleFiles[0] ?? entry.bundleFile;
488
- const bundle = await readTextIfExists(join(prebuiltDir, bundleFile));
489
- if (bundle !== null) {
487
+ const emittedFiles = [...new Set(entry.moduleFiles.length ? entry.moduleFiles : [entry.bundleFile])];
488
+ const emittedSources: EditableSourceFile[] = [];
489
+ for (const moduleFile of emittedFiles) {
490
+ const bundle = await readTextIfExists(join(prebuiltDir, moduleFile));
491
+ if (bundle !== null) {
492
+ emittedSources.push({
493
+ path: moduleFile,
494
+ content: bundle,
495
+ language: langFor(moduleFile),
496
+ });
497
+ }
498
+ }
499
+ if (emittedSources.length > 0) {
490
500
  return {
491
501
  source: "bundle",
492
- files: [{ path: basename(bundleFile), content: bundle, language: "javascript" }],
493
- warning: "Authored source was not packaged with this firmware; showing emitted JS fallback.",
502
+ files: emittedSources.sort((a, b) => emittedSortKey(entry.bundleFile, a.path).localeCompare(emittedSortKey(entry.bundleFile, b.path))),
503
+ warning: "Authored source was not packaged with this firmware; showing emitted JS fallback modules.",
494
504
  };
495
505
  }
496
506
  return {
@@ -553,6 +563,12 @@ function sourceSortKey(path: string): string {
553
563
  return `5:${path}`;
554
564
  }
555
565
 
566
+ function emittedSortKey(entryFile: string, path: string): string {
567
+ if (path === entryFile) return `0:${path}`;
568
+ if (basename(path) === basename(entryFile)) return `1:${path}`;
569
+ return `5:${path}`;
570
+ }
571
+
556
572
  function defaultManifestForFile(): Record<string, unknown> {
557
573
  const manifest = defaultManifest();
558
574
  return {