Skip to content
Snippets Groups Projects
Verified Commit d609e5e2 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

chore: update build script

parent 0975ce26
No related branches found
No related tags found
No related merge requests found
...@@ -3,17 +3,14 @@ import {normalize,join} from "path"; ...@@ -3,17 +3,14 @@ import {normalize,join} from "path";
import { opendirSync, writeFileSync, readFileSync } from "fs"; import { opendirSync, writeFileSync, readFileSync } from "fs";
import { extname, relative } from "path"; import { extname, relative } from "path";
let exportLines = [] let exportLines = [];
const regex = /^\s*(?<exp>(export\s+{[^}]+)})/gm; const regex = /^\s*(?<exp>(export\s+{[^}]+)})/gm;
function scanSymbols(root) { function scanSymbols(root) {
let f; let f;
const dir = opendirSync(root); const dir = opendirSync(root);
while ((f = dir.readSync()) !== null) { while ((f = dir.readSync()) !== null) {
if (f.isDirectory()) { if (f.isDirectory()) {
scanSymbols(join(root, f.name)); scanSymbols(join(root, f.name));
continue; continue;
...@@ -23,16 +20,18 @@ function scanSymbols(root) { ...@@ -23,16 +20,18 @@ function scanSymbols(root) {
if (f.name === "monster.mjs") continue; if (f.name === "monster.mjs") continue;
if ((extname(f.name) !== ".mjs")) { if (extname(f.name) !== ".mjs") {
continue; continue;
} }
if (f.path.endsWith("/stylesheet")||f.path.endsWith("stylesheet/mixin")) { const path = f?.path || f?.parentPath || f?.name;
if (path.endsWith("/stylesheet") || path.endsWith("stylesheet/mixin")) {
continue; continue;
} }
const fn = join(root, f.name); const fn = join(root, f.name);
let content = readFileSync(fn, 'utf8'); let content = readFileSync(fn, "utf8");
let m; let m;
while ((m = regex.exec(content)) !== null) { while ((m = regex.exec(content)) !== null) {
...@@ -40,19 +39,22 @@ function scanSymbols(root) { ...@@ -40,19 +39,22 @@ function scanSymbols(root) {
if (!exp) { if (!exp) {
continue; continue;
} }
exportLines.push("__PLACEHOLDER__" + " from \"./" + relative(sourcePath, fn) + "\";"); exportLines.push(
"__PLACEHOLDER__" + ' from "./' + relative(sourcePath, fn) + '";',
);
} }
} }
dir.closeSync(); dir.closeSync();
} }
scanSymbols(normalize(sourcePath)) scanSymbols(normalize(sourcePath));
const content = exportLines.join("\n"); const content = exportLines.join("\n");
const copyRightYear = new Date().getFullYear(); const copyRightYear = new Date().getFullYear();
const licenseText = license.replace("{{copyRightYear}}", copyRightYear); const licenseText = license.replace("{{copyRightYear}}", copyRightYear);
let fileContent=`${licenseText}// THIS FILE IS AUTOGENERATED. DO NOT EDIT THIS FILE DIRECTLY. let fileContent =
`${licenseText}// THIS FILE IS AUTOGENERATED. DO NOT EDIT THIS FILE DIRECTLY.
/** /**
* Main namespace for Monster. * Main namespace for Monster.
...@@ -60,7 +62,9 @@ let fileContent=`${licenseText}// THIS FILE IS AUTOGENERATED. DO NOT EDIT THIS F ...@@ -60,7 +62,9 @@ let fileContent=`${licenseText}// THIS FILE IS AUTOGENERATED. DO NOT EDIT THIS F
* @namespace Monster * @namespace Monster
* @author schukai GmbH * @author schukai GmbH
*/ */
` + content.replace(/__PLACEHOLDER__/gm, "export *") + ` ` +
content.replace(/__PLACEHOLDER__/gm, "export *") +
`
export { Monster }; export { Monster };
...@@ -75,7 +79,5 @@ export { Monster }; ...@@ -75,7 +79,5 @@ export { Monster };
class Monster {} class Monster {}
`; `;
// write fileContent to file // write fileContent to file
writeFileSync(sourcePath + "/monster.mjs", fileContent, 'utf8') writeFileSync(sourcePath + "/monster.mjs", fileContent, "utf8");
...@@ -26,8 +26,8 @@ in ...@@ -26,8 +26,8 @@ in
exit 1 exit 1
fi fi
## update monser.mjs ## update monster.mjs
echo_step "Updating monser.mjs" echo_step "Updating monster.mjs"
if ! ${pkgs'.projectNodeJS}/bin/node "./development/scripts/buildMonsterFile.mjs" if ! ${pkgs'.projectNodeJS}/bin/node "./development/scripts/buildMonsterFile.mjs"
then then
echo_fail "Failed to update monser.mjs" echo_fail "Failed to update monser.mjs"
......
This diff is collapsed.
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
"author": "schukai GmbH", "author": "schukai GmbH",
"license": "AGPL 3.0", "license": "AGPL 3.0",
"dependencies": { "dependencies": {
"@floating-ui/dom": "^1.7.0", "@floating-ui/dom": "^1.7.1",
"@popperjs/core": "^2.11.8" "@popperjs/core": "^2.11.8"
}, },
"devDependencies": { "devDependencies": {
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
"@playwright/test": "^1.52.0", "@playwright/test": "^1.52.0",
"@roarr/cli": "^5.12.4", "@roarr/cli": "^5.12.4",
"autoprefixer": "^10.4.21", "autoprefixer": "^10.4.21",
"browserslist": "^4.24.5", "browserslist": "^4.25.0",
"btoa": "^1.2.1", "btoa": "^1.2.1",
"c8": "^10.1.3", "c8": "^10.1.3",
"chai": "^5.2.0", "chai": "^5.2.0",
...@@ -60,18 +60,18 @@ ...@@ -60,18 +60,18 @@
"cssnano": "^7.0.7", "cssnano": "^7.0.7",
"dom-storage": "^2.1.0", "dom-storage": "^2.1.0",
"element-internals-polyfill": "^3.0.2", "element-internals-polyfill": "^3.0.2",
"esbuild": "^0.25.4", "esbuild": "^0.25.5",
"espree": "^10.3.0", "espree": "^10.3.0",
"estraverse": "^5.3.0", "estraverse": "^5.3.0",
"flow-bin": "^0.270.0", "flow-bin": "^0.272.2",
"fs": "0.0.1-security", "fs": "0.0.1-security",
"glob": "^11.0.2", "glob": "^11.0.2",
"graphviz": "^0.0.9", "graphviz": "^0.0.9",
"jsdom": "^26.1.0", "jsdom": "^26.1.0",
"jsdom-global": "^3.0.2", "jsdom-global": "^3.0.2",
"mocha": "^11.2.2", "mocha": "^11.5.0",
"playwright": "^1.52.0", "playwright": "^1.52.0",
"postcss": "^8.5.3", "postcss": "^8.5.4",
"postcss-fluid": "^1.4.2", "postcss-fluid": "^1.4.2",
"postcss-for": "^2.1.1", "postcss-for": "^2.1.1",
"postcss-import": "^16.1.0", "postcss-import": "^16.1.0",
...@@ -81,9 +81,9 @@ ...@@ -81,9 +81,9 @@
"postcss-nesting": "^13.0.1", "postcss-nesting": "^13.0.1",
"postcss-normalize": "^13.0.1", "postcss-normalize": "^13.0.1",
"postcss-responsive-type": "^1.0.0", "postcss-responsive-type": "^1.0.0",
"postcss-rtlcss": "^5.7.0", "postcss-rtlcss": "^5.7.1",
"postcss-strip-units": "^2.0.1", "postcss-strip-units": "^2.0.1",
"puppeteer": "^24.8.2", "puppeteer": "^24.10.0",
"sinon": "^20.0.0", "sinon": "^20.0.0",
"turbowatch": "^2.29.4", "turbowatch": "^2.29.4",
"url": "^0.11.4", "url": "^0.11.4",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment