diff --git a/.gitignore b/.gitignore index a547bf3..251ce6d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ pnpm-debug.log* lerna-debug.log* node_modules -dist dist-ssr *.local diff --git a/dist/fileUtils.d.ts b/dist/fileUtils.d.ts new file mode 100644 index 0000000..54a72fe --- /dev/null +++ b/dist/fileUtils.d.ts @@ -0,0 +1,4 @@ +export declare function ensureDirExists(dirPath: string): void; +export declare function writeFile(filePath: string, content: string): void; +export declare function cleanupDir(dirPath: string): void; +//# sourceMappingURL=fileUtils.d.ts.map \ No newline at end of file diff --git a/dist/fileUtils.d.ts.map b/dist/fileUtils.d.ts.map new file mode 100644 index 0000000..291cb59 --- /dev/null +++ b/dist/fileUtils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"fileUtils.d.ts","sourceRoot":"","sources":["../src/fileUtils.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,QAI9C;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAE1D;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,QAMzC"} \ No newline at end of file diff --git a/dist/fileUtils.js b/dist/fileUtils.js new file mode 100644 index 0000000..fd88d6d --- /dev/null +++ b/dist/fileUtils.js @@ -0,0 +1,18 @@ +import fs from "fs"; +export function ensureDirExists(dirPath) { + if (!fs.existsSync(dirPath)) { + fs.mkdirSync(dirPath, { recursive: true }); + } +} +export function writeFile(filePath, content) { + fs.writeFileSync(filePath, content, "utf8"); +} +export function cleanupDir(dirPath) { + try { + fs.rmSync(dirPath, { recursive: true, force: true }); + } + catch (err) { + console.error(`Failed to delete directory ${dirPath}:`, err); + } +} +//# sourceMappingURL=fileUtils.js.map \ No newline at end of file diff --git a/dist/fileUtils.js.map b/dist/fileUtils.js.map new file mode 100644 index 0000000..c91fa56 --- /dev/null +++ b/dist/fileUtils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fileUtils.js","sourceRoot":"","sources":["../src/fileUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,QAAgB,EAAE,OAAe;IACzD,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,IAAI,CAAC;QACH,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,8BAA8B,OAAO,GAAG,EAAE,GAAG,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..dcc3bfa --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,8 @@ +import { Plugin } from "vite"; +interface MetaMapPluginOptions { + pageTemplateFilePath: string; + pageMetaMapFilePath: string; +} +declare function metaMapPlugin(options: MetaMapPluginOptions): Plugin; +export default metaMapPlugin; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/index.d.ts.map b/dist/index.d.ts.map new file mode 100644 index 0000000..5d52685 --- /dev/null +++ b/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAS9B,UAAU,oBAAoB;IAC5B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,iBAAS,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CA8B5D;AAED,eAAe,aAAa,CAAC"} \ No newline at end of file diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..0920334 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,24 @@ +import { returnEntryChunkData, generateHtmlPages, } from "./metaMapPluginLogic.js"; +function metaMapPlugin(options) { + let outDir; + let base; + let generatedEntryChunks; + return { + name: "vite-plugin-react-meta-map", + configResolved(resolvedConfig) { + // get the output directory from Vite config + outDir = resolvedConfig.build.outDir; + base = resolvedConfig.base; + }, + generateBundle(_, bundle) { + // track entry point assets generated by vite + generatedEntryChunks = returnEntryChunkData(bundle); + }, + async closeBundle() { + const { pageTemplateFilePath, pageMetaMapFilePath } = options; + await generateHtmlPages(outDir, base, pageTemplateFilePath, pageMetaMapFilePath, generatedEntryChunks); + }, + }; +} +export default metaMapPlugin; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..91121b5 --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AAOjC,SAAS,aAAa,CAAC,OAA6B;IAClD,IAAI,MAAc,CAAC;IACnB,IAAI,IAAY,CAAC;IACjB,IAAI,oBAAsC,CAAC;IAE3C,OAAO;QACL,IAAI,EAAE,4BAA4B;QAElC,cAAc,CAAC,cAAc;YAC3B,4CAA4C;YAC5C,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC;YACrC,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;QAC7B,CAAC;QAED,cAAc,CAAC,CAAC,EAAE,MAAoB;YACpC,6CAA6C;YAC7C,oBAAoB,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC;QACtD,CAAC;QAED,KAAK,CAAC,WAAW;YACf,MAAM,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC;YAC9D,MAAM,iBAAiB,CACrB,MAAM,EACN,IAAI,EACJ,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,CACrB,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAED,eAAe,aAAa,CAAC"} \ No newline at end of file diff --git a/dist/metaMapPluginLogic.d.ts b/dist/metaMapPluginLogic.d.ts new file mode 100644 index 0000000..4c9a192 --- /dev/null +++ b/dist/metaMapPluginLogic.d.ts @@ -0,0 +1,10 @@ +import { OutputBundle } from "rollup"; +export interface EntryChunkData { + fileName: string; + imports: string[]; + modules: string[]; + css: string[]; +} +export declare function returnEntryChunkData(bundle: OutputBundle): EntryChunkData[]; +export declare function generateHtmlPages(outDir: string, base: string, pageTemplateFilePath: string, pageMetaMapFilePath: string, generatedEntryChunks: EntryChunkData[]): Promise; +//# sourceMappingURL=metaMapPluginLogic.d.ts.map \ No newline at end of file diff --git a/dist/metaMapPluginLogic.d.ts.map b/dist/metaMapPluginLogic.d.ts.map new file mode 100644 index 0000000..5e8d70e --- /dev/null +++ b/dist/metaMapPluginLogic.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"metaMapPluginLogic.d.ts","sourceRoot":"","sources":["../src/metaMapPluginLogic.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,GAAG,EAAE,MAAM,EAAE,CAAC;CACf;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,oBAcxD;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,oBAAoB,EAAE,MAAM,EAC5B,mBAAmB,EAAE,MAAM,EAC3B,oBAAoB,EAAE,cAAc,EAAE,iBAoHvC"} \ No newline at end of file diff --git a/dist/metaMapPluginLogic.js b/dist/metaMapPluginLogic.js new file mode 100644 index 0000000..1e9cf15 --- /dev/null +++ b/dist/metaMapPluginLogic.js @@ -0,0 +1,104 @@ +import path from "path"; +import { pathToFileURL } from "url"; +import { build } from "esbuild"; +import React from "react"; +import ReactDOMServer from "react-dom/server"; +import * as fileUtils from "./fileUtils.js"; +export function returnEntryChunkData(bundle) { + const entryChunkData = []; + for (const [, chunk] of Object.entries(bundle)) { + if (chunk.type === "chunk") { + if (chunk.isEntry) + entryChunkData.push({ + fileName: chunk.fileName, + imports: chunk.imports, + modules: Object.keys(chunk.modules), + css: Array.from(chunk.viteMetadata?.importedCss || []), + }); + } + } + return entryChunkData; +} +export async function generateHtmlPages(outDir, base, pageTemplateFilePath, pageMetaMapFilePath, generatedEntryChunks) { + // ensure output directory exists + const resolvedOutDir = path.resolve(outDir); + fileUtils.ensureDirExists(resolvedOutDir); + // generate temp output directory path for bundled files + const tempBundleOutputDir = path.join(resolvedOutDir, `temp-bundle-${Date.now()}`); + // bundle user files + await build({ + entryPoints: [pageTemplateFilePath, pageMetaMapFilePath], + outdir: tempBundleOutputDir, + bundle: true, + platform: "node", + format: "esm", + external: ["react", "react-dom"], + entryNames: "[name]", + }); + // construct the bundled output file URL + const getFileUrl = (filePath) => { + const { name } = path.parse(filePath); + const fullPath = path.join(tempBundleOutputDir, name + ".js"); + return pathToFileURL(fullPath).href; + }; + // get URLs for both PageTemplate and pages files + const pageTemplateUrl = getFileUrl(pageTemplateFilePath); + const pageMetaMapUrl = getFileUrl(pageMetaMapFilePath); + // import the PageTemplate and pages from their respective files + const { default: PageTemplate } = await import(pageTemplateUrl); + const { pages } = await import(pageMetaMapUrl); + // cycle through page meta data and inject into PageTemplate component via props + pages.forEach((page) => { + let html = ReactDOMServer.renderToString(React.createElement(PageTemplate, page)); + // check if the generated HTML contains ' id="root"' + if (!html.includes(' id="root"')) { + throw new Error(`Error: The vite-plugin-react-meta-map's PageTemplate does not contain ' id="root"'. Ensure that the PageTemplate renders an element with id="root".`); + } + // ensure that `page` contains `url` and `bundleEntryPoint` properties + if (!("url" in page)) { + throw new Error(`Error: The vite-plugin-react-meta-map's pageMetaMap does not contain the "url" property. The "url" property is required to know each page's relative .html file path (ie: "index.html").`); + } + if (!("bundleEntryPoint" in page)) { + throw new Error(`Error: The vite-plugin-react-meta-map's pageMetaMap does not contain the "bundleEntryPoint" property. The "bundleEntryPoint" property is required to know which bundle entry file to load for each page (ie: "/src/main.tsx").`); + } + // inject the correct bundle assets into the head section + const htmlStart = html.indexOf(""); + const htmlBeforeHeadClose = html.slice(0, htmlStart); + const htmlAfterHeadClose = html.slice(htmlStart); + const assetTags = []; + let entryPointmatchFound = false; + generatedEntryChunks.forEach((chunk) => { + const isMatchingEntryPoint = chunk.modules.some((modulePath) => { + const normalizedModulePath = modulePath.replace(/\\/g, "/"); + const normalizedEntryPoint = page.bundleEntryPoint.replace(/\\/g, "/"); + return normalizedModulePath.endsWith(normalizedEntryPoint); + }); + if (isMatchingEntryPoint) { + entryPointmatchFound = true; + // include script tag for entry chunk + assetTags.push(``); + // include preload links for imports + for (const importFile of chunk.imports) { + assetTags.push(``); + } + // include CSS links + for (const cssFile of chunk.css) { + assetTags.push(``); + } + } + }); + // ensure page's entry point file found + if (!entryPointmatchFound) { + throw new Error(`Error: "bundleEntryPoint" set for ${page.url} in the vite-plugin-react-meta-map's pageMetaMap could not be found in the Vite bundle as an entry point. Ensure that the "bundleEntryPoint" is set to an existing bundle entry point file (ie: "/src/main.tsx").`); + } + html = htmlBeforeHeadClose + assetTags.join("") + htmlAfterHeadClose; + const filePath = path.join(resolvedOutDir, page.url); + const directoryPath = path.dirname(filePath); + fileUtils.ensureDirExists(directoryPath); + // create .html file + fileUtils.writeFile(filePath, `${html}`); + }); + // clean up the temporary dir using the callback method + fileUtils.cleanupDir(tempBundleOutputDir); +} +//# sourceMappingURL=metaMapPluginLogic.js.map \ No newline at end of file diff --git a/dist/metaMapPluginLogic.js.map b/dist/metaMapPluginLogic.js.map new file mode 100644 index 0000000..040847f --- /dev/null +++ b/dist/metaMapPluginLogic.js.map @@ -0,0 +1 @@ +{"version":3,"file":"metaMapPluginLogic.js","sourceRoot":"","sources":["../src/metaMapPluginLogic.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAS5C,MAAM,UAAU,oBAAoB,CAAC,MAAoB;IACvD,MAAM,cAAc,GAAqB,EAAE,CAAC;IAC5C,KAAK,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/C,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC3B,IAAI,KAAK,CAAC,OAAO;gBACf,cAAc,CAAC,IAAI,CAAC;oBAClB,QAAQ,EAAE,KAAK,CAAC,QAAQ;oBACxB,OAAO,EAAE,KAAK,CAAC,OAAO;oBACtB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;oBACnC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,WAAW,IAAI,EAAE,CAAC;iBACvD,CAAC,CAAC;QACP,CAAC;IACH,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,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