chore(share): prebuilt template

This commit is contained in:
Elian Doran 2025-06-09 11:00:58 +03:00
parent 11853962b7
commit 2d3265136d
No known key found for this signature in database
3 changed files with 31 additions and 38 deletions

View File

@ -18,6 +18,7 @@
"license": "ISC",
"devDependencies": {
"@digitak/esrun": "^3.2.24",
"@digitalmaas/esbuild-plugin-ejs": "1.0.0",
"@types/swagger-ui": "^3.52.0",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",

View File

@ -1,5 +1,6 @@
import fs from "node:fs";
import path from "node:path";
import ejsPlugin from "@digitalmaas/esbuild-plugin-ejs";
// import {fileURLToPath} from "node:url";
import dotenv from "dotenv";
@ -15,9 +16,30 @@ const rootDir = path.dirname(process.env.npm_package_json!);
dotenv.config();
const modules = ["scripts", "styles"];
const modules = ["scripts", "styles", "templates"];
const entryPoints: {in: string, out: string}[] = [];
const makeEntry = (mod: string) => ({"in": path.join(rootDir, "src", mod, mod === "styles" ? "index.css" : "index.ts"), "out": mod});
function makeEntry(mod: string) {
let entrypoint: string;
switch (mod) {
case "styles":
entrypoint = "index.css";
break;
case "scripts":
entrypoint = "index.ts";
break;
case "templates":
entrypoint = "page.ejs";
break;
default:
throw new Error(`Unknown module type ${mod}.`);
}
return {
"in": path.join(rootDir, "src", mod, entrypoint),
"out": mod
};
}
const modulesRequested = process.argv.filter(a => a.startsWith("--module="));
for (const mod of modulesRequested) {
@ -36,6 +58,9 @@ async function runBuild() {
outdir: path.join(rootDir, "dist"),
format: "cjs",
target: ["chrome96"],
plugins: [
ejsPlugin()
],
loader: {
".png": "dataurl",
".gif": "dataurl",

39
pnpm-lock.yaml generated
View File

@ -473,9 +473,6 @@ importers:
'@braintree/sanitize-url':
specifier: 7.1.1
version: 7.1.1
'@digitalmaas/esbuild-plugin-ejs':
specifier: 1.0.0
version: 1.0.0(esbuild@0.25.5)
'@electron/remote':
specifier: 2.1.2
version: 2.1.2(electron@36.4.0)
@ -1282,6 +1279,9 @@ importers:
'@digitak/esrun':
specifier: ^3.2.24
version: 3.2.26
'@digitalmaas/esbuild-plugin-ejs':
specifier: 1.0.0
version: 1.0.0(esbuild@0.25.5)
'@types/swagger-ui':
specifier: ^3.52.0
version: 3.52.4
@ -1303,9 +1303,6 @@ importers:
highlight.js:
specifier: ^11.8.0
version: 11.11.1
trilium-etapi:
specifier: ^0.1.2
version: 0.1.2
typescript:
specifier: ^5.2.2
version: 5.8.3
@ -5813,9 +5810,6 @@ packages:
canvas-roundrect-polyfill@0.0.1:
resolution: {integrity: sha512-yWq+R3U3jE+coOeEb3a3GgE2j/0MMiDKM/QpLb6h9ihf5fGY9UXtvK9o4vNqjWXoZz7/3EaSVU3IX53TvFFUOw==}
centra@2.7.0:
resolution: {integrity: sha512-PbFMgMSrmgx6uxCdm57RUos9Tc3fclMvhLSATYN39XsDV29B89zZ3KA89jmY0vwSGazyU+uerqwa6t+KaodPcg==}
chai@5.2.0:
resolution: {integrity: sha512-mCuXncKXk5iCLhfhwTc0izo0gtEmpz5CtG2y8GiOINBlMVS6v8TMRc5TaLWKS6692m9+dVVfzgeVxR5UxWHTYw==}
engines: {node: '>=12'}
@ -10037,10 +10031,6 @@ packages:
perfect-freehand@1.2.0:
resolution: {integrity: sha512-h/0ikF1M3phW7CwpZ5MMvKnfpHficWoOEyr//KVNTxV4F6deRK1eYMtHyBKEAKFK0aXIEUK9oBvlF6PNXMDsAw==}
phin@3.7.1:
resolution: {integrity: sha512-GEazpTWwTZaEQ9RhL7Nyz0WwqilbqgLahDM3D0hxWwmVDI52nXEybHqiN6/elwpkJBhcuj+WbBu+QfT0uhPGfQ==}
engines: {node: '>= 8'}
pica@7.1.1:
resolution: {integrity: sha512-WY73tMvNzXWEld2LicT9Y260L43isrZ85tPuqRyvtkljSDLmnNFQmZICt4xUJMVulmcc6L9O7jbBrtx3DOz/YQ==}
@ -12269,10 +12259,6 @@ packages:
resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==}
hasBin: true
trilium-etapi@0.1.2:
resolution: {integrity: sha512-es86UOZaUCmpkdH2xNk5GGusJ2UpfxgqFpWdr7y6j7ZxNHS4q9H1mzKlslT6skTKwqUoFvZSV9jfNEqEwgsAvw==}
engines: {node: '>=16'}
trim-repeated@1.0.0:
resolution: {integrity: sha512-pkonvlKk8/ZuR0D5tLW8ljt5I8kmxp2XKymhepUeOdCEfKpZaktSArkLHZt76OB1ZvO9bssUsDty4SWhLvZpLg==}
engines: {node: '>=0.10.0'}
@ -19386,12 +19372,6 @@ snapshots:
canvas-roundrect-polyfill@0.0.1: {}
centra@2.7.0:
dependencies:
follow-redirects: 1.15.9(debug@4.4.1)
transitivePeerDependencies:
- debug
chai@5.2.0:
dependencies:
assertion-error: 2.0.1
@ -24657,12 +24637,6 @@ snapshots:
perfect-freehand@1.2.0: {}
phin@3.7.1:
dependencies:
centra: 2.7.0
transitivePeerDependencies:
- debug
pica@7.1.1:
dependencies:
glur: 1.1.2
@ -27140,13 +27114,6 @@ snapshots:
tree-kill@1.2.2: {}
trilium-etapi@0.1.2:
dependencies:
'@types/node': 20.17.32
phin: 3.7.1
transitivePeerDependencies:
- debug
trim-repeated@1.0.0:
dependencies:
escape-string-regexp: 1.0.5