diff --git a/vuu-ui/package-lock.json b/vuu-ui/package-lock.json
index 7e2004311..d4c10225d 100644
--- a/vuu-ui/package-lock.json
+++ b/vuu-ui/package-lock.json
@@ -1397,9 +1397,10 @@
}
},
"node_modules/@mdx-js/rollup": {
- "version": "3.0.0",
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/@mdx-js/rollup/-/rollup-3.0.1.tgz",
+ "integrity": "sha512-j0II91OCm4ld+l5QVgXXMQGxVVcAWIQJakYWi1dv5pefDHASJyCYER2TsdH7Alf958GoFSM7ugukWyvDq/UY4A==",
"dev": true,
- "license": "MIT",
"dependencies": {
"@mdx-js/mdx": "^3.0.0",
"@rollup/pluginutils": "^5.0.0",
@@ -10454,6 +10455,39 @@
"version": "1.14.1",
"license": "0BSD"
},
+ "node_modules/tsx": {
+ "version": "4.19.2",
+ "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.2.tgz",
+ "integrity": "sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==",
+ "dev": true,
+ "dependencies": {
+ "esbuild": "~0.23.0",
+ "get-tsconfig": "^4.7.5"
+ },
+ "bin": {
+ "tsx": "dist/cli.mjs"
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.3"
+ }
+ },
+ "node_modules/tsx/node_modules/fsevents": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
"node_modules/tunnel-agent": {
"version": "0.6.0",
"dev": true,
@@ -11903,10 +11937,11 @@
"react-router-dom": "^6.2.1"
},
"devDependencies": {
- "@mdx-js/esbuild": "^3.0.1",
- "@mdx-js/rollup": "3.0.0",
+ "@mdx-js/esbuild": "3.1.0",
+ "@mdx-js/rollup": "3.0.1",
"@rollup/plugin-json": "^6.1.0",
- "@rollup/plugin-node-resolve": "^15.2.3"
+ "@rollup/plugin-node-resolve": "^15.2.3",
+ "tsx": "^4.19.1"
}
},
"showcase/node_modules/@salt-ds/theme": {
diff --git a/vuu-ui/package.json b/vuu-ui/package.json
index 01abb7dcd..ee774ee3b 100644
--- a/vuu-ui/package.json
+++ b/vuu-ui/package.json
@@ -40,7 +40,7 @@
"type-defs": "node ./scripts/build-all-type-defs.mjs",
"showcase": "cd showcase && npm run showcase",
"showcase:preview": "serve ./showcase/dist -p 4173",
- "showcase:build": "npm run build:worker && cd showcase && node scripts/build.mjs",
+ "showcase:build": "npm run build:worker && cd showcase && tsx scripts/build.ts",
"test:cypress": "npm run build:worker && cypress run --component --browser chrome --headless",
"test:cypress:local": "cypress open --component --browser chrome",
"test:vite": "npm run build:worker && vitest run",
diff --git a/vuu-ui/showcase/.gitignore b/vuu-ui/showcase/.gitignore
index ea571ae22..435ba83eb 100644
--- a/vuu-ui/showcase/.gitignore
+++ b/vuu-ui/showcase/.gitignore
@@ -1,5 +1 @@
-<<<<<<< HEAD
-!templates/index.html
-=======
-!templates/index.html
->>>>>>> 7590e3f973ef0c9b6070abaac9c592190cd65e6f
+.showcase
\ No newline at end of file
diff --git a/vuu-ui/showcase/index.html b/vuu-ui/showcase/index.html
index 93aa3315c..000aeca9c 100644
--- a/vuu-ui/showcase/index.html
+++ b/vuu-ui/showcase/index.html
@@ -1,15 +1,24 @@
-
+
-
-
-
- Vite Showcase
+ Vuu Showcase
+
-
diff --git a/vuu-ui/showcase/package.json b/vuu-ui/showcase/package.json
index 7f9ee15ed..40dfb711e 100644
--- a/vuu-ui/showcase/package.json
+++ b/vuu-ui/showcase/package.json
@@ -8,8 +8,7 @@
"build": "node ./scripts/build.mjs",
"dev": "vite",
"docs": "node ./scripts/build-docs.mjs",
- "showcase": "node ./scripts/showcase.mjs",
- "stories": "node ./scripts/parse-stories.mjs"
+ "showcase": "tsx ./scripts/showcase.ts"
},
"keywords": [],
"author": "heswell",
@@ -33,9 +32,10 @@
"react-router-dom": "^6.2.1"
},
"devDependencies": {
- "@mdx-js/esbuild": "^3.0.1",
- "@mdx-js/rollup": "3.0.0",
+ "@mdx-js/esbuild": "3.1.0",
+ "@mdx-js/rollup": "3.0.1",
"@rollup/plugin-json": "^6.1.0",
- "@rollup/plugin-node-resolve": "^15.2.3"
+ "@rollup/plugin-node-resolve": "^15.2.3",
+ "tsx": "^4.19.1"
}
}
diff --git a/vuu-ui/showcase/public/favicon-16x16.png b/vuu-ui/showcase/public/favicon-16x16.png
deleted file mode 100644
index f85891bba..000000000
Binary files a/vuu-ui/showcase/public/favicon-16x16.png and /dev/null differ
diff --git a/vuu-ui/showcase/public/favicon-32x32.png b/vuu-ui/showcase/public/favicon-32x32.png
deleted file mode 100644
index 84d627f7a..000000000
Binary files a/vuu-ui/showcase/public/favicon-32x32.png and /dev/null differ
diff --git a/vuu-ui/showcase/public/favicon.ico b/vuu-ui/showcase/public/favicon.ico
deleted file mode 100644
index cc26fb39d..000000000
Binary files a/vuu-ui/showcase/public/favicon.ico and /dev/null differ
diff --git a/vuu-ui/showcase/public/manifest.json b/vuu-ui/showcase/public/manifest.json
deleted file mode 100644
index fa99de77d..000000000
--- a/vuu-ui/showcase/public/manifest.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "",
- "short_name": "",
- "icons": [
- {
- "src": "/android-chrome-192x192.png",
- "sizes": "192x192",
- "type": "image/png"
- },
- {
- "src": "/android-chrome-512x512.png",
- "sizes": "512x512",
- "type": "image/png"
- }
- ],
- "theme_color": "#ffffff",
- "background_color": "#ffffff",
- "display": "standalone"
-}
diff --git a/vuu-ui/showcase/scripts/build-docs.mjs b/vuu-ui/showcase/scripts/build-docs.mjs
deleted file mode 100644
index 4a9540a7f..000000000
--- a/vuu-ui/showcase/scripts/build-docs.mjs
+++ /dev/null
@@ -1,43 +0,0 @@
-import esbuild from "esbuild";
-import mdx from "@mdx-js/esbuild";
-import fs from "fs";
-import path from "path";
-
-const targetDir = "./src/examples";
-
-const build = async (path) => {
- await esbuild.build({
- entryPoints: [path],
- outfile: path.replace(".mdx", ".js"),
- format: "esm",
- plugins: [
- mdx({
- /* jsxImportSource: …, otherOptions… */
- }),
- ],
- });
-};
-
-const buildAll = async (paths) => {
- for (const path of paths) {
- await build(path);
- }
-};
-
-async function findAllMdxDocs(dir, results = []) {
- const rootPath = path.resolve(dir);
- fs.readdirSync(rootPath).forEach((element) => {
- const childPath = path.join(rootPath, element);
- if (fs.lstatSync(childPath).isDirectory()) {
- findAllMdxDocs(childPath, results);
- } else if (childPath.endsWith(".mdx")) {
- results.push(childPath);
- }
- });
- return results;
-}
-
-const mdxDocs = await findAllMdxDocs(targetDir);
-
-// await buildAll(mdxDocs);
-export default async () => buildAll(mdxDocs);
diff --git a/vuu-ui/showcase/scripts/build.mjs b/vuu-ui/showcase/scripts/build.ts
similarity index 73%
rename from vuu-ui/showcase/scripts/build.mjs
rename to vuu-ui/showcase/scripts/build.ts
index 747d71025..8047d7d9e 100644
--- a/vuu-ui/showcase/scripts/build.mjs
+++ b/vuu-ui/showcase/scripts/build.ts
@@ -5,24 +5,31 @@ import {
formatDuration,
padRight,
readPackageJson,
+ writeFile,
writeMetaFile,
} from "../../scripts/utils.mjs";
import { build } from "../../scripts/esbuild.mjs";
import { buildFileList } from "./build-file-list.mjs";
import fs from "fs";
import path from "path";
+import { treeSourceFromFileSystem } from "./treeSourceFromFileSystem";
+import mdx from "@mdx-js/esbuild";
const indexFiles = buildFileList("./src/examples", /index.ts$/);
const examples = buildFileList("./src/examples", /examples.tsx$/);
+const mdxFiles = buildFileList("./src/examples", /.mdx$/);
const features = buildFileList("./src/features", /feature.tsx$/);
+console.log({ mdxFiles });
+
// TODO use a separate build call for each theme, without bundling
const themes = ["./src/themes/salt-theme.ts", "./src/themes/vuu-theme.ts"];
-const entryPoints = ["src/main.tsx"]
+const entryPoints = ["src/index-main.tsx", "src/index-standalone.tsx"]
.concat(indexFiles)
.concat(features)
.concat(examples)
+ .concat(mdxFiles)
.concat(themes);
const cssInlinePlugin = {
@@ -37,7 +44,7 @@ const cssInlinePlugin = {
const css = await fs.promises.readFile(args.path, "utf8");
// css = await esbuild.transform(css, { loader: "css", minify: true });
return { loader: "text", contents: css };
- }
+ },
);
},
};
@@ -48,16 +55,25 @@ const HTML_TEMPLATE = `
-
-
-
-
+
Vite Showcase
+
-