@moneko/core 3.9.0 → 3.9.1-beta.0

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.
package/lib/paths.js CHANGED
@@ -1 +1 @@
1
- import e from"url";import{createDirAll as o,directoryExists as c}from"@moneko/mdx";let t=JSON.parse(process.env.npm_config_argv||"{}")?.original;export const yarnArgv={};t?.forEach(e=>{let o=e.split("=");Object.assign(yarnArgv,{[o[0]]:o[1]||!0})});export const CUSTOMCONFIG=process.env.npm_config_config||yarnArgv.config;let a=process.cwd(),n=`${a}/node_modules/.cache/.mo`;c(n)||o(n);export default{corePath:e.fileURLToPath(new URL(".",import.meta.url)),programPath:a,webpackCachePath:`${a}/node_modules/.temp_cache`,cachePath:n,httpCachePath:`${a}/node_modules/.cache/http`,swcCachePath:`${a}/node_modules/.swc`,configPath:`${a}/config/index.ts`,customConfigPath:`${a}/config/${CUSTOMCONFIG}.ts`,coveragePath:`${a}/coverage/clover.xml`,pagesPath:`${a}/src/pages`,componentsPath:`${a}/components`};
1
+ import e from"url";let o=JSON.parse(process.env.npm_config_argv||"{}")?.original;export const yarnArgv={};o?.forEach(e=>{let o=e.split("=");Object.assign(yarnArgv,{[o[0]]:o[1]||!0})});export const CUSTOMCONFIG=process.env.npm_config_config||yarnArgv.config;let c=process.cwd(),t=`${c}/node_modules/.cache/.mo`;export default{corePath:e.fileURLToPath(new URL(".",import.meta.url)),programPath:c,webpackCachePath:`${c}/node_modules/.temp_cache`,cachePath:t,httpCachePath:`${c}/node_modules/.cache/http`,swcCachePath:`${c}/node_modules/.swc`,configPath:`${c}/config/index.ts`,customConfigPath:`${c}/config/${CUSTOMCONFIG}.ts`,coveragePath:`${c}/coverage/clover.xml`,pagesPath:`${c}/src/pages`,componentsPath:`${c}/components`};
package/lib/seo.js CHANGED
@@ -1 +1 @@
1
- import{join as t}from"path";import{createDirAll as o,directoryExists as r,saveFileSync as m}from"@moneko/mdx";import{outputConfig as e}from"./common.js";import{CONFIG as i}from"./config.js";import{resolveProgramPath as s}from"./utils.js";import{routes as p}from"./vm/routes.js";export default(()=>{let{domain:n,nojekyll:a,path:f}=i.seo||{},h=f&&s(f)||e?.path;if(!n||!h)return;r(h)||o(h);let l=i.basename,c=l.endsWith("/")?l:`${l}/`;m(t(h,"CNAME"),n),m(t(h,"robots"),`Sitemap: https://${n}${c}sitemap.txt`);let j=[];!function t(o){o.forEach(o=>{j.push(`https://${n}${c}${o.key}`),Array.isArray(o.children)&&t(o.children)})}(p),m(t(h,"sitemap.txt"),j.join("\n")),a&&m(t(h,".nojekyll"),"")});
1
+ import{join as t}from"path";import{saveFileSync as o}from"@moneko/mdx";import{outputConfig as r}from"./common.js";import{CONFIG as m}from"./config.js";import{resolveProgramPath as e}from"./utils.js";import{routes as i}from"./vm/routes.js";export default(()=>{let{domain:s,nojekyll:p,path:n}=m.seo||{},a=n&&e(n)||r?.path;if(!s||!a)return;let f=m.basename,h=f.endsWith("/")?f:`${f}/`;o(t(a,"CNAME"),s),o(t(a,"robots"),`Sitemap: https://${s}${h}sitemap.txt`);let l=[];!function t(o){o.forEach(o=>{l.push(`https://${s}${h}${o.key}`),Array.isArray(o.children)&&t(o.children)})}(i),o(t(a,"sitemap.txt"),l.join("\n")),p&&o(t(a,".nojekyll"),"")});
package/lib/vm/routes.js CHANGED
@@ -1 +1 @@
1
- import{fileExists as e,scanFolder as r}from"@moneko/mdx";import{getTree as o,mergeRouter as t,watchFiles as s}from"./utils.js";import{CONFIG as p}from"../config.js";import m from"../paths.js";import{FRAMEWORK as u,FRAMEWORKNAME as i,createElement as a,isDev as f,isLibrary as n,isReact as l,isSolid as c}from"../process-env.js";import $ from"../reactive-object.js";let x=e(`${p.alias["@"]}/router/index.ts`),d=`${c?"() => ":""}${a}(SuspenseComp, { comp: $1 })`,g=`import { ${a} } from "${i}";import SuspenseComp from "@app/suspense";${l?'import prefix from "@app/prefix-router";':""}`;x&&(g+='import merge from "@app/merge-router";import customRouter from "@/router";'),["react","solid"].includes(u)||(d="$1",g="");export const routesModuleName="@app/routes";export const route=new $({[routesModuleName]:"export default []"});export let routes=[];let h=n?m.componentsPath:m.pagesPath,j=n?/(?<!README\.mdx?)$/:/(?<!index\.tsx?)$/,M=n?"@pkg":"@/pages";function N(e){var r;routes=t(o({base:h,files:e,alia:M}),"key"),route.setData(routesModuleName,(r=JSON.stringify(routes).replace(/"rr\((.+?)\)rr"/g,d).slice(1,-1),`${g}const routes = [{ path: "/", children: [${c?'{ path: "/" },':""} ${r}] }];const _routes = ${x?'merge([...routes, ...customRouter], "path")':"routes"};export default ${l?"prefix(_routes)":"_routes"};`))}let k=r(h).filter(e=>!j.test(e));N(k),f&&s(h,j,N,k);
1
+ import{generateRouter as e,generateRouterLibrary as t,scanFolder as o}from"@moneko/mdx";import{getTree as r,mergeRouter as s,watchFiles as a}from"./utils.js";import{CONFIG as m}from"../config.js";import p from"../paths.js";import{FRAMEWORK as i,isDev as u,isLibrary as n}from"../process-env.js";import l from"../reactive-object.js";export const routesModuleName="@app/routes";export const route=new l({[routesModuleName]:"export default []"});export let routes=[];let f=n?p.componentsPath:p.pagesPath,c=n?/(?<!README\.mdx?)$/:/(?<!index\.tsx?)$/,x=n?"@pkg":"@/pages",d=n?t:e;function j(e){routes=s(r({base:f,files:e,alia:x}),"key"),route.setData(routesModuleName,d(p.componentsPath,`${m.alias["@"]}/router/index.ts`,i,m.alias["@"]))}let g=o(f).filter(e=>!c.test(e));j(g),u&&a(f,c,j,g);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "3.9.0",
3
+ "version": "3.9.1-beta.0",
4
4
  "description": "core",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",
@@ -13,7 +13,7 @@
13
13
  "author": "moneko",
14
14
  "license": "MIT",
15
15
  "dependencies": {
16
- "@moneko/mdx": "0.1.13",
16
+ "@moneko/mdx": "0.1.14",
17
17
  "@swc/core": "1.3.100",
18
18
  "@swc/css": "0.0.28",
19
19
  "@swc/helpers": "0.5.3",