Skip to content

Commit 3f1bd04

Browse files
committed
chore: create patches folder
1 parent 4625aa4 commit 3f1bd04

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

src/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ async function emitDom() {
9898
const deprecatedInfo = await readInputJSON("deprecatedMessage.json");
9999
const documentationFromMDN = await generateDescriptions();
100100
const removedItems = await readInputJSON("removedTypes.jsonc");
101-
const addedItemsKDL = await readKDL(inputFolder, "addedTypes.kdl");
101+
const addedItemsKDL = await readKDL("addedTypes.kdl");
102102

103103
async function readInputJSON(filename: string) {
104104
const content = await fs.readFile(new URL(filename, inputFolder), "utf8");

src/build/patches.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,7 @@ async function getAllKDLFileURLs(folder: URL, file: string): Promise<URL[]> {
113113
for (const entry of entries) {
114114
const child = new URL(entry.name + "/", folder);
115115

116-
if (
117-
entry.isDirectory() &&
118-
!child.pathname.includes("mdn") &&
119-
!child.pathname.includes("idl")
120-
) {
116+
if (entry.isDirectory()) {
121117
results.push(...(await getAllKDLFileURLs(child, file)));
122118
} else if (entry.isFile() && entry.name == file) {
123119
results.push(new URL(entry.name, folder));
@@ -138,10 +134,8 @@ export async function readInputKDL(fileUrl: URL): Promise<any> {
138134
/**
139135
* Read, parse, and merge all KDL files under the input folder.
140136
*/
141-
export default async function readKDL(
142-
inputFolder: URL,
143-
file: string,
144-
): Promise<any> {
137+
export default async function readKDL(file: string): Promise<any> {
138+
const inputFolder = new URL("../inputfiles/patches/", import.meta.url);
145139
const fileUrls = await getAllKDLFileURLs(inputFolder, file);
146140

147141
const parsedContents = await Promise.all(fileUrls.map(readInputKDL));

0 commit comments

Comments
 (0)