corvid-local-site
Advanced tools
Comparing version 0.1.11 to 0.1.12
{ | ||
"name": "corvid-local-site", | ||
"version": "0.1.11", | ||
"version": "0.1.12", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -27,9 +27,14 @@ const path = require("path"); | ||
const stylesPath = path.join("frontend", "styles"); | ||
const sitePath = path.join("frontend", "site"); | ||
const routersPath = path.join("frontend", "routers"); | ||
const menusPath = path.join("frontend", "menus"); | ||
const pagesPath = path.join("frontend", "pages"); | ||
const lightboxesPath = path.join("frontend", "lightboxes"); | ||
const PATH_SRC = ""; // TODO: will be added | ||
const PATH_FRONTEND = path.join(PATH_SRC, "frontend"); | ||
const PATH_BACKEND = path.join(PATH_SRC, "backend"); | ||
const PATH_PUBLIC = path.join(PATH_SRC, "public"); | ||
const PATH_STYLES = path.join(PATH_FRONTEND, "styles"); | ||
const PATH_SITE = path.join(PATH_FRONTEND, "site"); | ||
const PATH_ROUTERS = path.join(PATH_FRONTEND, "routers"); | ||
const PATH_MENUS = path.join(PATH_FRONTEND, "menus"); | ||
const PATH_PAGES = path.join(PATH_FRONTEND, "pages"); | ||
const PATH_LIGHTBOXES = path.join(PATH_FRONTEND, "lightboxes"); | ||
const wixFilePath = (filename, parentPath = "") => | ||
@@ -43,3 +48,3 @@ path.join(parentPath, `${filename}.${wixFileExtension}`); | ||
const stylesFile = (name, content) => wixFile(stylesPath, name, content); | ||
const stylesFile = (name, content) => wixFile(PATH_STYLES, name, content); | ||
const colors = content => stylesFile("colors", content); | ||
@@ -50,3 +55,3 @@ const fonts = content => stylesFile("fonts", content); | ||
const siteFile = (name, content) => wixFile(sitePath, name, content); | ||
const siteFile = (name, content) => wixFile(PATH_SITE, name, content); | ||
const commonComponents = content => siteFile("commonComponents", content); | ||
@@ -59,8 +64,8 @@ const multilingualInfo = content => siteFile("multilingualInfo", content); | ||
const router = router => | ||
wixFile(routersPath, router.prefix, omit_(router, "prefix")); | ||
wixFile(PATH_ROUTERS, router.prefix, omit_(router, "prefix")); | ||
const menu = menu => wixFile(menusPath, menu.menuId, omit_(menu, "menuId")); | ||
const menu = menu => wixFile(PATH_MENUS, menu.menuId, omit_(menu, "menuId")); | ||
const page = page => ({ | ||
path: path.join(pagesPath, pageFileName(page)), | ||
path: path.join(PATH_PAGES, pageFileName(page)), | ||
content: stringify(page) | ||
@@ -70,3 +75,3 @@ }); | ||
const pageCode = (page, code) => ({ | ||
path: path.join(pagesPath, pageCodeFileName(page)), | ||
path: path.join(PATH_PAGES, pageCodeFileName(page)), | ||
content: code | ||
@@ -81,3 +86,3 @@ }); | ||
const lightbox = lightbox => ({ | ||
path: path.join(lightboxesPath, lightboxFileName(lightbox)), | ||
path: path.join(PATH_LIGHTBOXES, lightboxFileName(lightbox)), | ||
content: stringify(lightbox) | ||
@@ -87,3 +92,3 @@ }); | ||
const lighboxCode = (lightbox, code) => ({ | ||
path: path.join(lightboxesPath, lightboxCodeFileName(lightbox)), | ||
path: path.join(PATH_LIGHTBOXES, lightboxCodeFileName(lightbox)), | ||
content: code | ||
@@ -101,2 +106,14 @@ }); | ||
const backendCodeFile = ({ path: relativePath, content }) => | ||
codeFile({ | ||
path: path.join(PATH_BACKEND, relativePath), | ||
content | ||
}); | ||
const publicCodeFile = ({ path: relativePath, content }) => | ||
codeFile({ | ||
path: path.join(PATH_PUBLIC, relativePath), | ||
content | ||
}); | ||
const collectionSchema = ({ collectionName, schema }) => | ||
@@ -139,4 +156,4 @@ codeFile({ | ||
[sc.dataFromMasterPage]: dataFromMasterPage, | ||
[sc.publicCode]: codeFile, | ||
[sc.backendCode]: codeFile, | ||
[sc.publicCode]: publicCodeFile, | ||
[sc.backendCode]: backendCodeFile, | ||
[sc.collectionSchema]: collectionSchema, | ||
@@ -143,0 +160,0 @@ [sc.masterPageCode]: masterPageCode, |
Sorry, the diff of this file is not supported yet
35443
939