-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: sort include order so
@root
is always first, then semantic pac…
…kages and then extra packages
- Loading branch information
1 parent
f59fe85
commit 69fa7b3
Showing
1 changed file
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// Imports | ||
import { expandGlob } from "jsr:@std/[email protected]" | ||
import { fromFileUrl } from "jsr:@std/[email protected]" | ||
import { basename, dirname, fromFileUrl } from "jsr:@std/[email protected]" | ||
import { bundle } from "jsr:@libs/bundle@5/css" | ||
import { root as _root } from "./root.ts" | ||
import { version } from "./version.ts" | ||
|
@@ -38,7 +38,25 @@ export async function css({ only = [] as string[], exclude = ["@istanbul-coverag | |
return only.includes(name) | ||
}) | ||
} | ||
files.sort((a, b) => a.path.localeCompare(b.path)) | ||
files.sort((A, B) => { | ||
const a = basename(dirname(A.path)) | ||
const b = basename(dirname(B.path)) | ||
if (a === "@root") { | ||
return -1 | ||
} | ||
if (b === "@root") { | ||
return 1 | ||
} | ||
if ((a.startsWith("@")) && (b.startsWith("@"))) { | ||
return a.localeCompare(b) | ||
} else if (a.startsWith("@")) { | ||
return 1 | ||
} else if (b.startsWith("@")) { | ||
return -1 | ||
} | ||
return 0 | ||
}) | ||
console.log(files) | ||
for (const { path } of files) { | ||
css += await Deno.readTextFile(path) | ||
} | ||
|