@cfdez11/vex 0.10.7 → 0.10.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -25,4 +25,4 @@ export const routes = ${JSON.stringify(serverRoutes,null,2)};
|
|
|
25
25
|
${clientRoutes.join(`,
|
|
26
26
|
`)}
|
|
27
27
|
];
|
|
28
|
-
`;await writeFile(path.join(GENERATED_DIR,"services","_routes.js"),clientFileCode)}function getOriginalRoutePath(filePath){let route=filePath.replace(PAGES_DIR,"").replace("/page.vex","");return route.startsWith("/")||(route="/"+route),route}async function getPageFiles({layouts=!1}={}){return(await readDirectoryRecursive(PAGES_DIR)).filter(file=>file.fullpath.endsWith("page.vex")||layouts&&file.name==="layout.vex")}function getRoutePath(filePath){let route=filePath.replace(PAGES_DIR,"").replace("/page.vex","");return route=route.replace(/\[([^\]]+)\]/g,":$1"),route.startsWith("/")||(route="/"+route),route}async function saveClientComponentModule(componentName,jsModuleCode){const outputPath=path.join(CLIENT_COMPONENTS_DIR,`${componentName}.js`);await writeFile(outputPath,jsModuleCode,"utf-8")}async function getImportData(importPath,callerFilePath=null){let resolvedPath;importPath.startsWith("vex/server/")
|
|
28
|
+
`;await writeFile(path.join(GENERATED_DIR,"services","_routes.js"),clientFileCode)}function getOriginalRoutePath(filePath){let route=filePath.replace(PAGES_DIR,"").replace("/page.vex","");return route.startsWith("/")||(route="/"+route),route}async function getPageFiles({layouts=!1}={}){return(await readDirectoryRecursive(PAGES_DIR)).filter(file=>file.fullpath.endsWith("page.vex")||layouts&&file.name==="layout.vex")}function getRoutePath(filePath){let route=filePath.replace(PAGES_DIR,"").replace("/page.vex","");return route=route.replace(/\[([^\]]+)\]/g,":$1"),route.startsWith("/")||(route="/"+route),route}async function saveClientComponentModule(componentName,jsModuleCode){const outputPath=path.join(CLIENT_COMPONENTS_DIR,`${componentName}.js`);await writeFile(outputPath,jsModuleCode,"utf-8")}async function getImportData(importPath,callerFilePath=null){let resolvedPath;if(importPath.startsWith("vex/server/"))resolvedPath=path.resolve(FRAMEWORK_DIR,importPath.replace("vex/server/","server/"));else if(importPath.startsWith("vex/"))resolvedPath=path.resolve(FRAMEWORK_DIR,"client/services",importPath.replace("vex/",""));else if(importPath.startsWith("@/")||importPath==="@")resolvedPath=path.resolve(SRC_DIR,importPath.replace(/^@\//,"").replace(/^@$/,""));else if((importPath.startsWith("./")||importPath.startsWith("../"))&&callerFilePath)resolvedPath=path.resolve(path.dirname(callerFilePath),importPath);else{if(!importPath.startsWith(".")&&!importPath.startsWith("/"))return{path:importPath,fileUrl:importPath,importPath};resolvedPath=path.resolve(ROOT_DIR,importPath)}resolvedPath&&existsSync(resolvedPath)&&statSync(resolvedPath).isDirectory()&&(resolvedPath=path.join(resolvedPath,"index.js"));const fileUrl=pathToFileURL(resolvedPath).href;return{path:resolvedPath,fileUrl,importPath}}export{CLIENT_COMPONENTS_DIR,CLIENT_DIR,CLIENT_SERVICES_DIR,PAGES_DIR,PROJECT_ROOT,ROOT_HTML_DIR,SERVER_APP_DIR,SRC_DIR,USER_GENERATED_DIR,WATCH_IGNORE,WATCH_IGNORE_FILES,adjustClientModulePath,fileExists,generateComponentId,getComponentHtmlDisk,getComponentNameFromPath,getImportData,getLayoutPaths,getOriginalRoutePath,getPageFiles,getPagePath,getRelativePath,getRootTemplate,getRoutePath,initializeDirectories,markComponentHtmlStale,readDirectoryRecursive,readFile,saveClientComponentModule,saveClientRoutesFile,saveComponentHtmlDisk,saveServerRoutesFile,writeFile};
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cfdez11/vex",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.10",
|
|
4
4
|
"description": "A vanilla JavaScript meta-framework with file-based routing, SSR/CSR/SSG/ISR and Vue-like reactivity",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/@cfdez11/vexjs"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://www.vexjs.com/",
|
|
5
10
|
"type": "module",
|
|
6
11
|
"main": "./dist/server/index.js",
|
|
7
12
|
"exports": {
|