fix
This commit is contained in:
parent
dfb72d130c
commit
53768ba0d7
File diff suppressed because one or more lines are too long
|
|
@ -15,6 +15,65 @@ export const ensureFiles = async (path: string, id_site: string) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
const pkg = Bun.file(dir.data(`${path}/package.json`));
|
||||||
|
if (!(await pkg.exists())) {
|
||||||
|
await Bun.write(
|
||||||
|
pkg,
|
||||||
|
JSON.stringify({
|
||||||
|
name: "site-" + id_site,
|
||||||
|
scripts: {
|
||||||
|
startup:
|
||||||
|
"ulimit -c 0; tailwindcss --watch -i ./app/css/global.css -o ./app/css/build.css --minify",
|
||||||
|
},
|
||||||
|
dependencies: {},
|
||||||
|
})
|
||||||
|
);
|
||||||
|
const imports = [
|
||||||
|
"@floating-ui/react",
|
||||||
|
"@paralleldrive/cuid2",
|
||||||
|
"@radix-ui/react-dropdown-menu",
|
||||||
|
"@radix-ui/react-label",
|
||||||
|
"@radix-ui/react-navigation-menu",
|
||||||
|
"@radix-ui/react-popover",
|
||||||
|
"@radix-ui/react-slider",
|
||||||
|
"@radix-ui/react-slot",
|
||||||
|
"@radix-ui/react-switch",
|
||||||
|
"@radix-ui/react-tabs",
|
||||||
|
"@types/file-saver",
|
||||||
|
"@types/lodash.capitalize",
|
||||||
|
"@types/lodash.get",
|
||||||
|
"@types/react",
|
||||||
|
"@types/react-dom",
|
||||||
|
"any-date-parser",
|
||||||
|
"chart.js",
|
||||||
|
"class-variance-authority",
|
||||||
|
"clsx",
|
||||||
|
"date-fns",
|
||||||
|
"embla-carousel-react",
|
||||||
|
"exceljs",
|
||||||
|
"lodash.capitalize",
|
||||||
|
"lodash.get",
|
||||||
|
"lucide-react",
|
||||||
|
"next-themes",
|
||||||
|
"quill",
|
||||||
|
"react",
|
||||||
|
"react-arborist",
|
||||||
|
"react-chartjs-2",
|
||||||
|
"react-data-grid",
|
||||||
|
"react-day-picker",
|
||||||
|
"react-resizable-panels",
|
||||||
|
"sonner",
|
||||||
|
"tailwind-merge",
|
||||||
|
];
|
||||||
|
|
||||||
|
let proc = Bun.spawn([`npm`, `install`, ...imports], {
|
||||||
|
stdio: ["inherit", "pipe", "pipe"],
|
||||||
|
cwd: dir.data(path),
|
||||||
|
});
|
||||||
|
|
||||||
|
await proc.exited;
|
||||||
|
}
|
||||||
|
|
||||||
for await (const t of templates) {
|
for await (const t of templates) {
|
||||||
const f = t.replaceAll("_", ".");
|
const f = t.replaceAll("_", ".");
|
||||||
const to = dir.data(path + `/${f}`);
|
const to = dir.data(path + `/${f}`);
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -218,13 +218,30 @@ export const devItem = (
|
||||||
get childs() {
|
get childs() {
|
||||||
const item = mitem?.toJSON() as IItem;
|
const item = mitem?.toJSON() as IItem;
|
||||||
|
|
||||||
|
if (item.component?.id) {
|
||||||
|
const child = item.component?.props.child;
|
||||||
|
if (child.content) {
|
||||||
|
const m = mitem
|
||||||
|
.get("component")
|
||||||
|
?.get("props")
|
||||||
|
?.get("child")
|
||||||
|
?.get("content");
|
||||||
|
if (m) {
|
||||||
|
return [devItem(metas, m, page_id)];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
if (item.childs) {
|
if (item.childs) {
|
||||||
return item.childs.map((e) => {
|
return item.childs
|
||||||
|
.map((e) => {
|
||||||
if (e) {
|
if (e) {
|
||||||
const m = metas[e.id];
|
const m = metas[e.id];
|
||||||
if (m && m.mitem) return devItem(metas, m.mitem, page_id);
|
if (m && m.mitem) return devItem(metas, m.mitem, page_id);
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
.filter((e) => e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue