added latest compiled version to git

This commit is contained in:
2026-06-09 17:50:43 +02:00
parent 9df03fba90
commit 1e647b1e32
4 changed files with 2856 additions and 1 deletions

2797
latest/main.js Normal file

File diff suppressed because one or more lines are too long

8
latest/maniest.json Normal file
View File

@@ -0,0 +1,8 @@
{
"path": "https://gitea.phx-erp.de/PHXGMBH/phx-frontend-plugin-webcomponent-demo/raw/branch/master/latest/main.js",
"items": [
{
"tagName": "frontend-plugin-demo"
}
]
}

View File

@@ -4,9 +4,10 @@
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --watch --output-hashing none --configuration production",
"build": "concurrently \"ng build --watch --output-hashing none --configuration production\" \"node scripts/copy-latest.mjs --watch\"",
"test": "ng test",
"build:dev": "ng build --output-hashing none --watch --configuration development",
"copy-latest": "node scripts/copy-latest.mjs",
"serve": "node ./scripts/serve-dist.mjs",
"codegen": "graphql-codegen",
"client": "ng serve --port 4201 --watch --configuration development",

49
scripts/copy-latest.mjs Normal file
View File

@@ -0,0 +1,49 @@
import { watch } from 'node:fs';
import { access, constants, copyFile, mkdir } from 'node:fs/promises';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
const __dirname = dirname(fileURLToPath(import.meta.url));
const root = join(__dirname, '..');
const source = join(root, 'dist/phx-frontend-plugin-demo/browser/main.js');
const dest = join(root, 'latest/main.js');
async function copyMainJs() {
try {
await access(source, constants.F_OK);
await mkdir(dirname(dest), { recursive: true });
await copyFile(source, dest);
console.log('[latest] Copied main.js');
} catch (err) {
if (err.code !== 'ENOENT') {
console.error('[latest] Copy failed:', err.message);
}
}
}
function watchMainJs() {
let timeout;
const debouncedCopy = () => {
clearTimeout(timeout);
timeout = setTimeout(copyMainJs, 100);
};
const tryWatch = () => {
access(source, constants.F_OK)
.then(() => {
copyMainJs();
watch(source, debouncedCopy);
console.log('[latest] Watching for main.js changes');
})
.catch(() => setTimeout(tryWatch, 500));
};
tryWatch();
}
if (process.argv.includes('--watch')) {
watchMainJs();
} else {
copyMainJs();
}