@dpuse/dpuse-development 1.0.139 → 1.0.140
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/README.md +1 -1
- package/dist/dpuse-development.es.js +35 -31
- package/dist/dpuse-development.es.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
|
|
|
83
83
|
| ↳ documentDependencies.ts | `▒▒▒░░░░░░░░░░░░░░░░░` 17.4% · 11.4 kB |
|
|
84
84
|
| ↳ documentQualitySecurity.ts | `▒▒▒░░░░░░░░░░░░░░░░░` 15.2% · 9.9 kB |
|
|
85
85
|
| ↳ documentBundleSizes.ts | `▒▒▒░░░░░░░░░░░░░░░░░` 13.8% · 9.0 kB |
|
|
86
|
-
| ↳ checkConfigFiles.ts | `▒░░░░░░░░░░░░░░░░░░░` 5.
|
|
86
|
+
| ↳ checkConfigFiles.ts | `▒░░░░░░░░░░░░░░░░░░░` 5.7% · 3.8 kB |
|
|
87
87
|
| ↳ rustCrates.ts | `▒░░░░░░░░░░░░░░░░░░░` 5.3% · 3.4 kB |
|
|
88
88
|
| ↳ documentUsage.ts | `▒░░░░░░░░░░░░░░░░░░░` 4.1% · 2.7 kB |
|
|
89
89
|
| ↳ cloudflare.ts | `▒░░░░░░░░░░░░░░░░░░░` 3.4% · 2.2 kB |
|
|
@@ -1383,8 +1383,12 @@ async function xr() {
|
|
|
1383
1383
|
}
|
|
1384
1384
|
//#endregion
|
|
1385
1385
|
//#region src/utilities/cloudflare.ts
|
|
1386
|
-
var Sr =
|
|
1387
|
-
|
|
1386
|
+
var Sr = {
|
|
1387
|
+
".css": "text/css",
|
|
1388
|
+
".js": "application/javascript",
|
|
1389
|
+
".wasm": "application/wasm"
|
|
1390
|
+
}, Cr = "dpuse-sample-data-eu";
|
|
1391
|
+
async function wr() {
|
|
1388
1392
|
let e = await C("config.json"), t = {
|
|
1389
1393
|
body: JSON.stringify(e),
|
|
1390
1394
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1392,12 +1396,12 @@ async function Cr() {
|
|
|
1392
1396
|
}, n = await fetch(`https://api.dpuse.app/configs/${e.id}`, t);
|
|
1393
1397
|
if (!n.ok) throw Error(await n.text());
|
|
1394
1398
|
}
|
|
1395
|
-
async function
|
|
1396
|
-
let n = await
|
|
1397
|
-
for (let [e, t] of r) await
|
|
1399
|
+
async function Tr(e, t) {
|
|
1400
|
+
let n = await Ar(`${e}/${t}`, t), r = Map.groupBy(n, ({ key: e }) => c(e));
|
|
1401
|
+
for (let [e, t] of r) await kr(t, ["--content-type", e]);
|
|
1398
1402
|
}
|
|
1399
|
-
async function
|
|
1400
|
-
await
|
|
1403
|
+
async function Er(e) {
|
|
1404
|
+
await Tr(e, "application"), await Tr(e, "fileStore"), await kr(["applicationIndex.json", "fileStoreIndex.json"].map((t) => ({
|
|
1401
1405
|
file: `${e}/${t}`,
|
|
1402
1406
|
key: t
|
|
1403
1407
|
})), [
|
|
@@ -1407,7 +1411,7 @@ async function Tr(e) {
|
|
|
1407
1411
|
"no-cache"
|
|
1408
1412
|
]);
|
|
1409
1413
|
}
|
|
1410
|
-
async function
|
|
1414
|
+
async function Dr(e) {
|
|
1411
1415
|
let t = e.id, n = {
|
|
1412
1416
|
body: JSON.stringify(e),
|
|
1413
1417
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1415,13 +1419,13 @@ async function Er(e) {
|
|
|
1415
1419
|
}, r = await fetch(`https://api.dpuse.app/configs/${t}`, n);
|
|
1416
1420
|
if (!r.ok) throw Error(await r.text());
|
|
1417
1421
|
}
|
|
1418
|
-
async function
|
|
1422
|
+
async function Or(e, t) {
|
|
1419
1423
|
let n = `v${e.version ?? "unknown"}`;
|
|
1420
1424
|
async function r(e, r = "") {
|
|
1421
1425
|
let i = await ee(e, { withFileTypes: !0 });
|
|
1422
1426
|
for (let a of i) {
|
|
1423
1427
|
if (a.isDirectory() || a.name.endsWith(".map")) continue;
|
|
1424
|
-
let i = `${e}/${a.name}`, o = r ? `${r}/${a.name}` : a.name, s = `${t}_${n}/${o}`.replaceAll("\\", "/"), c = a.name
|
|
1428
|
+
let i = `${e}/${a.name}`, o = r ? `${r}/${a.name}` : a.name, s = `${t}_${n}/${o}`.replaceAll("\\", "/"), c = Sr[E.extname(a.name)] ?? "application/octet-stream";
|
|
1425
1429
|
console.info(`⚙️ Uploading '${o}' → '${s}'...`), await b(void 0, "wrangler", [
|
|
1426
1430
|
"r2",
|
|
1427
1431
|
"object",
|
|
@@ -1429,7 +1433,7 @@ async function Dr(e, t) {
|
|
|
1429
1433
|
s,
|
|
1430
1434
|
`--file=${i}`,
|
|
1431
1435
|
"--content-type",
|
|
1432
|
-
|
|
1436
|
+
c,
|
|
1433
1437
|
"--jurisdiction=eu",
|
|
1434
1438
|
"--remote"
|
|
1435
1439
|
]);
|
|
@@ -1437,7 +1441,7 @@ async function Dr(e, t) {
|
|
|
1437
1441
|
}
|
|
1438
1442
|
await r("dist");
|
|
1439
1443
|
}
|
|
1440
|
-
async function
|
|
1444
|
+
async function kr(e, t) {
|
|
1441
1445
|
if (e.length === 0) return;
|
|
1442
1446
|
let n = await T.mkdtemp(E.join(ge.tmpdir(), "dpuse-r2-bulk-")), r = E.join(n, "files.json");
|
|
1443
1447
|
try {
|
|
@@ -1445,7 +1449,7 @@ async function Or(e, t) {
|
|
|
1445
1449
|
"r2",
|
|
1446
1450
|
"bulk",
|
|
1447
1451
|
"put",
|
|
1448
|
-
|
|
1452
|
+
Cr,
|
|
1449
1453
|
"--filename",
|
|
1450
1454
|
r,
|
|
1451
1455
|
...t,
|
|
@@ -1459,12 +1463,12 @@ async function Or(e, t) {
|
|
|
1459
1463
|
});
|
|
1460
1464
|
}
|
|
1461
1465
|
}
|
|
1462
|
-
async function
|
|
1466
|
+
async function Ar(e, t) {
|
|
1463
1467
|
let n = await ee(e), r = [];
|
|
1464
1468
|
for (let i of n) {
|
|
1465
1469
|
if (i.startsWith(".")) continue;
|
|
1466
1470
|
let n = `${e}/${i}`, a = `${t}/${i}`;
|
|
1467
|
-
(await h(n)).isDirectory() ? r.push(...await
|
|
1471
|
+
(await h(n)).isDirectory() ? r.push(...await Ar(n, a)) : r.push({
|
|
1468
1472
|
file: n,
|
|
1469
1473
|
key: a
|
|
1470
1474
|
});
|
|
@@ -1473,7 +1477,7 @@ async function kr(e, t) {
|
|
|
1473
1477
|
}
|
|
1474
1478
|
//#endregion
|
|
1475
1479
|
//#region src/actions/publishProject.ts
|
|
1476
|
-
async function
|
|
1480
|
+
async function jr() {
|
|
1477
1481
|
try {
|
|
1478
1482
|
l("Publish Project");
|
|
1479
1483
|
let e = await C("package.json"), t = await C("config.json"), n = g(t.id);
|
|
@@ -1483,24 +1487,24 @@ async function Ar() {
|
|
|
1483
1487
|
"app",
|
|
1484
1488
|
"kb"
|
|
1485
1489
|
].includes(n.publishedTo);
|
|
1486
|
-
i && await r("2️⃣ Deploy", "npm", ["run", "deploy"]), await
|
|
1490
|
+
i && await r("2️⃣ Deploy", "npm", ["run", "deploy"]), await Mr(i ? "3️⃣ " : "2️⃣ ", e, t, n), n.publishedTo === "sampleData" && (w("3️⃣ Upload sample data"), await Er("public")), x(`Project version '${e.version ?? "unknown"}' published.`);
|
|
1487
1491
|
} catch (e) {
|
|
1488
1492
|
console.error("❌ Error publishing project", e), process.exit(1);
|
|
1489
1493
|
}
|
|
1490
1494
|
}
|
|
1491
|
-
async function
|
|
1492
|
-
if (r.typeId === "app") w(`${e} Register module`), await
|
|
1493
|
-
else if (r.typeId === "engine") w(`${e} Register module`), await
|
|
1495
|
+
async function Mr(e, t, n, r) {
|
|
1496
|
+
if (r.typeId === "app") w(`${e} Register module`), await wr();
|
|
1497
|
+
else if (r.typeId === "engine") w(`${e} Register module`), await Or(t, `dpuse-engine-eu/${r.uploadGroupName ?? "unknown"}`), await Dr(n);
|
|
1494
1498
|
else if (r.uploadGroupName === void 0) w(`${e} Registration NOT required`);
|
|
1495
1499
|
else {
|
|
1496
1500
|
w(`${e} Register module`);
|
|
1497
1501
|
let i = n.id.split("-").slice(2).join("-");
|
|
1498
|
-
await
|
|
1502
|
+
await Or(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await Dr(n);
|
|
1499
1503
|
}
|
|
1500
1504
|
}
|
|
1501
1505
|
//#endregion
|
|
1502
1506
|
//#region src/actions/releaseProject.ts
|
|
1503
|
-
async function
|
|
1507
|
+
async function Nr(e = "MIT", t = !1) {
|
|
1504
1508
|
try {
|
|
1505
1509
|
l("Release Project");
|
|
1506
1510
|
let n = await C("package.json"), i = await C("config.json"), a = g(i.id);
|
|
@@ -1514,7 +1518,7 @@ async function Mr(e = "MIT", t = !1) {
|
|
|
1514
1518
|
"push",
|
|
1515
1519
|
"origin",
|
|
1516
1520
|
"main:main"
|
|
1517
|
-
]), await
|
|
1521
|
+
]), await Mr("8️⃣ ", n, o, a), a.publishedTo === "npm") {
|
|
1518
1522
|
let e = `v${n.version ?? "unknown"}`;
|
|
1519
1523
|
await r("9️⃣ Trigger GitHub release", "gh", [
|
|
1520
1524
|
"release",
|
|
@@ -1533,7 +1537,7 @@ async function Mr(e = "MIT", t = !1) {
|
|
|
1533
1537
|
}
|
|
1534
1538
|
//#endregion
|
|
1535
1539
|
//#region src/actions/syncProjectWithGitHub.ts
|
|
1536
|
-
async function
|
|
1540
|
+
async function Pr() {
|
|
1537
1541
|
try {
|
|
1538
1542
|
l("Synchronise Project with GitHub");
|
|
1539
1543
|
let e = await C("package.json"), t = await C("config.json"), n = g(t.id);
|
|
@@ -1552,12 +1556,12 @@ async function Nr() {
|
|
|
1552
1556
|
}
|
|
1553
1557
|
//#endregion
|
|
1554
1558
|
//#region src/actions/testProject.ts
|
|
1555
|
-
var
|
|
1559
|
+
var Fr = [
|
|
1556
1560
|
"1️⃣ ",
|
|
1557
1561
|
"2️⃣ ",
|
|
1558
1562
|
"3️⃣ ",
|
|
1559
1563
|
"4️⃣ "
|
|
1560
|
-
],
|
|
1564
|
+
], Ir = [{
|
|
1561
1565
|
id: "unit",
|
|
1562
1566
|
label: "Run unit tests",
|
|
1563
1567
|
command: "vitest",
|
|
@@ -1570,13 +1574,13 @@ var Pr = [
|
|
|
1570
1574
|
arguments: ["test", "--pass-with-no-tests"],
|
|
1571
1575
|
configFileName: "playwright.config.ts"
|
|
1572
1576
|
}];
|
|
1573
|
-
async function
|
|
1577
|
+
async function Lr(e = ["unit"]) {
|
|
1574
1578
|
try {
|
|
1575
1579
|
l("Test Project");
|
|
1576
1580
|
let n = 0;
|
|
1577
|
-
for (let i of
|
|
1581
|
+
for (let i of Ir) {
|
|
1578
1582
|
if (!e.includes(i.id) || await t(i.configFileName) === null) continue;
|
|
1579
|
-
let a = `${
|
|
1583
|
+
let a = `${Fr[n] ?? ""} ${i.label}`;
|
|
1580
1584
|
await r(a, i.command, i.arguments), n += 1;
|
|
1581
1585
|
}
|
|
1582
1586
|
if (n === 0) {
|
|
@@ -1590,7 +1594,7 @@ async function Ir(e = ["unit"]) {
|
|
|
1590
1594
|
}
|
|
1591
1595
|
//#endregion
|
|
1592
1596
|
//#region src/actions/triggerGitHubRelease.ts
|
|
1593
|
-
async function
|
|
1597
|
+
async function Rr() {
|
|
1594
1598
|
try {
|
|
1595
1599
|
l("Trigger GitHub Release");
|
|
1596
1600
|
let e = `v${(await C("package.json")).version ?? "unknown"}`;
|
|
@@ -1608,4 +1612,4 @@ async function Lr() {
|
|
|
1608
1612
|
}
|
|
1609
1613
|
}
|
|
1610
1614
|
//#endregion
|
|
1611
|
-
export { ye as auditDependencies, Te as buildProject, ze as checkProject, yr as documentProject, br as formatCode, xr as lintCode,
|
|
1615
|
+
export { ye as auditDependencies, Te as buildProject, ze as checkProject, yr as documentProject, br as formatCode, xr as lintCode, jr as publishProject, Nr as releaseProject, c as resolveSampleDataContentType, Pr as syncProjectWithGitHub, Lr as testProject, Rr as triggerGitHubRelease, Tr as uploadDirectoryToR2 };
|