Compare commits

..

1 Commits

Author SHA1 Message Date
jjspace b6b83e3cfd
Merge d8a7e22f04 into 41a0f18ba9 2025-11-25 13:05:18 -05:00
3 changed files with 18 additions and 13 deletions

View File

@ -118,17 +118,8 @@ export async function buildGalleryList(options = {}) {
};
const galleryFiles = await globby(
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("\\", "/"),
),
galleryFilesPattern.map((pattern) => join(rootDirectory, pattern, "**/*")),
);
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),
);

View File

@ -9,10 +9,10 @@ import { fileURLToPath } from "node:url";
* @returns {number} exit code from the tsc command
*/
export default async function typescriptCompile(configPath) {
const tsPath = fileURLToPath(import.meta.resolve("typescript"));
const binPath = join(tsPath, "../../bin/tsc");
const tsPath = import.meta.resolve("typescript");
const binPath = fileURLToPath(join(tsPath, "../../bin/tsc"));
return new Promise((resolve, reject) => {
const ls = spawn(process.execPath, [binPath, "-p", configPath]);
const ls = spawn(binPath, ["-p", configPath]);
ls.stdout.on("data", (data) => {
console.log(`stdout: ${data}`);

View File

@ -10,6 +10,15 @@ 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<Record<string,any>>} A promise that resolves to the config values.
@ -43,7 +52,10 @@ 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) {
@ -156,6 +168,8 @@ export async function buildSandcastleGallery({
metadata,
} = gallery ?? {};
// const { buildGalleryList } = await importSandcastleBuildFunctions();
await buildGalleryList({
rootDirectory,
publicDirectory: outputDir,