added other possible necessary files to output

This commit is contained in:
2026-06-09 18:45:03 +02:00
parent 19edfebb8c
commit 4854d3cca3
6 changed files with 1088 additions and 16 deletions

1
latest/chunk-JOBM76N2.js Normal file
View File

@@ -0,0 +1 @@
import{$d as d,Yd as a,Zd as b,_d as c,ae as e,be as f,ce as g}from"./chunk-SK2T2ZXR.js";export{f as Button,b as ButtonClasses,e as ButtonDirective,d as ButtonIcon,c as ButtonLabel,g as ButtonModule,a as ButtonStyle};

993
latest/chunk-SK2T2ZXR.js Normal file

File diff suppressed because one or more lines are too long

1
latest/chunk-SPIR5TD3.js Normal file
View File

@@ -0,0 +1 @@
import{p as a}from"./chunk-YBGBPGZM.js";import"./chunk-SK2T2ZXR.js";export{a as Base};

62
latest/chunk-YBGBPGZM.js Normal file

File diff suppressed because one or more lines are too long

2
latest/polyfills.js Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,19 +1,32 @@
import { watch } from 'node:fs'; import { watch } from 'node:fs';
import { access, constants, copyFile, mkdir } from 'node:fs/promises'; import { access, constants, copyFile, mkdir, readdir, unlink } from 'node:fs/promises';
import { dirname, join } from 'node:path'; import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url'; import { fileURLToPath } from 'node:url';
const __dirname = dirname(fileURLToPath(import.meta.url)); const __dirname = dirname(fileURLToPath(import.meta.url));
const root = join(__dirname, '..'); const root = join(__dirname, '..');
const source = join(root, 'dist/phx-frontend-plugin-demo/browser/main.js'); const sourceDir = join(root, 'dist/phx-frontend-plugin-demo/browser');
const dest = join(root, 'latest/main.js'); const destDir = join(root, 'latest');
async function copyMainJs() { async function copyJsFiles() {
try { try {
await access(source, constants.F_OK); await access(sourceDir, constants.F_OK);
await mkdir(dirname(dest), { recursive: true }); await mkdir(destDir, { recursive: true });
await copyFile(source, dest);
console.log('[latest] Copied main.js'); const files = (await readdir(sourceDir)).filter((f) => f.endsWith('.js'));
for (const file of files) {
await copyFile(join(sourceDir, file), join(destDir, file));
}
const destFiles = (await readdir(destDir)).filter((f) => f.endsWith('.js'));
for (const file of destFiles) {
if (!files.includes(file)) {
await unlink(join(destDir, file));
}
}
console.log(`[latest] Copied ${files.length} JS file(s)`);
} catch (err) { } catch (err) {
if (err.code !== 'ENOENT') { if (err.code !== 'ENOENT') {
console.error('[latest] Copy failed:', err.message); console.error('[latest] Copy failed:', err.message);
@@ -21,20 +34,20 @@ async function copyMainJs() {
} }
} }
function watchMainJs() { function watchJsFiles() {
let timeout; let timeout;
const debouncedCopy = () => { const debouncedCopy = () => {
clearTimeout(timeout); clearTimeout(timeout);
timeout = setTimeout(copyMainJs, 100); timeout = setTimeout(copyJsFiles, 100);
}; };
const tryWatch = () => { const tryWatch = () => {
access(source, constants.F_OK) access(sourceDir, constants.F_OK)
.then(() => { .then(() => {
copyMainJs(); copyJsFiles();
watch(source, debouncedCopy); watch(sourceDir, debouncedCopy);
console.log('[latest] Watching for main.js changes'); console.log('[latest] Watching for JS changes in dist');
}) })
.catch(() => setTimeout(tryWatch, 500)); .catch(() => setTimeout(tryWatch, 500));
}; };
@@ -43,7 +56,7 @@ function watchMainJs() {
} }
if (process.argv.includes('--watch')) { if (process.argv.includes('--watch')) {
watchMainJs(); watchJsFiles();
} else { } else {
copyMainJs(); copyJsFiles();
} }