diff --git a/packages/sandcastle/scripts/buildGallery.js b/packages/sandcastle/scripts/buildGallery.js index eaa1dceeafb..16d5e0cca41 100644 --- a/packages/sandcastle/scripts/buildGallery.js +++ b/packages/sandcastle/scripts/buildGallery.js @@ -118,8 +118,17 @@ export async function buildGalleryList(options = {}) { }; const galleryFiles = await globby( - galleryFilesPattern.map((pattern) => join(rootDirectory, pattern, "**/*")), + galleryFilesPattern.map((pattern) => + // globby can only work with paths using '/' but node on windows uses '\' + // convert them right before passing to globby to ensure all joins work as expected + join(rootDirectory, pattern, "**/*").replaceAll("\\", "/"), + ), ); + if (galleryFiles.length === 0) { + console.warn( + "Did not find any gallery files. Please check the configuration is correct", + ); + } const yamlFiles = galleryFiles.filter((path) => basename(path).match(galleryItemConfig), ); diff --git a/packages/sandcastle/scripts/typescriptCompile.js b/packages/sandcastle/scripts/typescriptCompile.js index 22d667f485e..7c6a8a5c5a5 100644 --- a/packages/sandcastle/scripts/typescriptCompile.js +++ b/packages/sandcastle/scripts/typescriptCompile.js @@ -9,8 +9,8 @@ import { fileURLToPath } from "node:url"; * @returns {number} exit code from the tsc command */ export default async function typescriptCompile(configPath) { - const tsPath = import.meta.resolve("typescript"); - const binPath = fileURLToPath(join(tsPath, "../../bin/tsc")); + const tsPath = fileURLToPath(import.meta.resolve("typescript")); + const binPath = join(tsPath, "../../bin/tsc"); return new Promise((resolve, reject) => { const ls = spawn(binPath, ["-p", configPath]); diff --git a/scripts/buildSandcastle.js b/scripts/buildSandcastle.js index f8a917b7b3e..fff83105220 100644 --- a/scripts/buildSandcastle.js +++ b/scripts/buildSandcastle.js @@ -10,15 +10,6 @@ import { buildGalleryList } from "../packages/sandcastle/scripts/buildGallery.js const __dirname = dirname(fileURLToPath(import.meta.url)); const projectRoot = join(__dirname, ".."); -// async function importSandcastleBuildFunctions() { -// // Import asynchronously, for now, because this script is not included or run in the release zip; -// const buildGalleryScriptPath = join( -// __dirname, -// "../packages/sandcastle/index.js", -// ); -// return await import(pathToFileURL(buildGalleryScriptPath).href); -// } - /** * Parses Sandcastle config file and returns its values. * @returns {Promise>} A promise that resolves to the config values. @@ -52,10 +43,7 @@ export async function buildSandcastleApp({ outputToBuildDir, includeDevelopment, }) { - // const { join, dirname } = path; const __dirname = dirname(fileURLToPath(import.meta.url)); - // const { createSandcastleConfig, buildStatic } = - // await importSandcastleBuildFunctions(); const version = await getVersion(); let config; if (outputToBuildDir) { @@ -168,8 +156,6 @@ export async function buildSandcastleGallery({ metadata, } = gallery ?? {}; - // const { buildGalleryList } = await importSandcastleBuildFunctions(); - await buildGalleryList({ rootDirectory, publicDirectory: outputDir,