From 3b9d50417d1a0496b6f2cff400ac62157fa4da02 Mon Sep 17 00:00:00 2001 From: philc Date: Tue, 6 May 2025 10:09:36 +0200 Subject: [PATCH] timer in runindex odmdb abd duist package json for wwws --- apxtri/models/Odmdb.js | 4 +++- apxtri/models/Wwws.js | 11 +++++++---- package.json | 12 ++++++------ 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/apxtri/models/Odmdb.js b/apxtri/models/Odmdb.js index 11b6a6c..471742f 100644 --- a/apxtri/models/Odmdb.js +++ b/apxtri/models/Odmdb.js @@ -788,7 +788,7 @@ Odmdb.cud = (objectPathname, crud, itm, role, runindex = true) => { * */ Odmdb.runidx = (objectPathname, schema) => { - //if (log) console.log(currentmod, `idx for ${objectPathname}`); + const starttime=process.hrtime.bigint(); if (!schema || !schema.apxid) { const getschema = Odmdb.Schema(objectPathname, true); if (getschema.status != 200) { @@ -898,6 +898,8 @@ Odmdb.runidx = (objectPathname, schema) => { ventil[n].data ); }); + const duration= Number(process.hrtime.bigint()-starttime)/1e6; + if (log) console.log(currentmod, `idx for ${objectPathname} elapse time: ${duration.toFixed(3)} ms`); }; module.exports = Odmdb; diff --git a/apxtri/models/Wwws.js b/apxtri/models/Wwws.js index 23b33eb..a2ac857 100644 --- a/apxtri/models/Wwws.js +++ b/apxtri/models/Wwws.js @@ -100,8 +100,8 @@ Wwws.getwco = (wconame, ctx) => { : webpageinit; // check that webconf for tailwindcsscontent property exist for this wco request const pathtocheckfortw = [ - `../adminapi/objects/wco/${wconame}/*.{html,js,mustache}`, - `../${ctx.tribe}/objects/wwws/${ctx.xapp}/src/**/*.{html,js,mustache}`, + `../../../../../../../adminapi/objects/wco/${wconame}/*.{html,js,mustache}`, + `../../../../../../../${ctx.tribe}/objects/wwws/${ctx.xapp}/src/**/*.{html,js,mustache}`, ]; if (!webpage.tailwindcsscontent) { webpage.tailwindcsscontent = []; @@ -202,8 +202,11 @@ Wwws.getwco = (wconame, ctx) => { // save the conf for update localdb when the web page request it fs.outputJSONSync(webconf, webpage, { spaces: 2 }); // create a text file with component to watch for tailwind - - fs.outputFileSync(`../${ctx.tribe}/objects/wwws/${ctx.xapp}/src/static/css/watchtailwind.txt`,webpage.tailwindcsscontent.join("\n"),"utf-8"); + let sourcetw="" + webpage.tailwindcsscontent.forEach(s=>{ + sourcetw+=`@source "${s}";\n` + }) + fs.outputFileSync(`../${ctx.tribe}/objects/wwws/${ctx.xapp}/src/static/css/sourcetw.css`,sourcetw,"utf-8"); return { status: 200, ref: "Wwws", diff --git a/package.json b/package.json index fc062e7..3e9ee3a 100755 --- a/package.json +++ b/package.json @@ -19,9 +19,9 @@ "publishtestwall": "scp -r /media/phil/usbfarm/apxtowns/dev-ants/tribes/$space phil@wall-ants://home/phil/apxtowns/testwall-ants/tribes/$space/..", "publishwall": "scp -r /media/phil/usbfarm/apxtowns/dev-ants/tribes/$space phil@wall-ants://home/phil/apxtowns/wall-ants/tribes/$space/..", "publishhouse": "scp -r /media/phil/usbfarm/apxtowns/dev-ants/tribes/$space phil@house-ants://home/phil/apxtowns/house-ants/tribes/$space/..", - "src":"echo '$tribe -- $webapp'", - "src:css": "npx @tailwindcss/cli -i ../$tribe/objects/wwws/$webapp/src/static/css/input.css -o ../$tribe/objects/wwws/$webapp/src/static/css/output.css --watch --config ../$tribe/objects/wwws/$webapp/tailwind.config.js", - "dist:css": "node apxtri/models/Wwws.js $tribe $webapp dist && tailwindcss --minify -c ../$tribe/objects/wwws/$webapp/tailwind.config.js -i ../$tribe/objects/wwws/$webapp/src/static/css/twdevstyle.css -o ../$tribe/objects/wwws/$webapp/dist/static/css/twstyle.css" + "src": "echo '$tribe -- $webapp'", + "src:css": "npx @tailwindcss/cli -i ../$tribe/objects/wwws/$webapp/src/static/css/input.css -o ../$tribe/objects/wwws/$webapp/src/static/css/output.css --watch", + "dist:jscss": "node apxtri/models/Wwws.js $tribe $webapp dist && tailwindcss --minify -c ../$tribe/objects/wwws/$webapp/tailwind.config.js -i ../$tribe/objects/wwws/$webapp/src/static/css/twdevstyle.css -o ../$tribe/objects/wwws/$webapp/dist/static/css/twstyle.css" }, "commentscript": "cf wiki apxtri doc for details: yarn startpm2 -n teswallants, yarn pm2 stop testwallants, yarn pm2 delete testwallants, yarn pm2 logs --lines 200 testwall, yarn pm2 monit -n testwallants, yarn pm2 save tribe=tribeid yarn apidoc to build apidoc // space=adminapi/www/cdn/apidoc yarn publishtestwall ", "maintainers": [ @@ -55,13 +55,13 @@ }, "license": "MIT", "dependencies": { - "@tailwindcss/typography": "^0.5.16", + "@tailwindcss/cli": "^4.1.4", "apidoc": "^1.2.0", "async": "^3.2.0", "axios": "^1.7.8", "bcrypt": "^5.0.0", "cors": "^2.8.4", - "daisyui": "^5.0.12", + "daisyui": "^5.0.28", "dayjs": "^1.11.13", "dns-sync": "^0.2.1", "express": "^4.21.1", @@ -81,7 +81,7 @@ "sharp": "^0.33.5", "smtp-client": "^0.4.0", "stripe": "^17.3.1", - "tailwindcss": "^4.0.15", + "tailwindcss": "^4.1.4", "uuid": "^11.0.2" }, "devDependencies": {