[docx] Fix matpel code error

This commit is contained in:
Fernando 2023-05-17 13:04:11 -05:00
parent 4437a6856f
commit 74f8009083
23 changed files with 63 additions and 104 deletions

View File

@ -5,12 +5,10 @@
pnpm i pnpm i
# Build Nestjs # Build Nestjs
pnpm build pnpm build
# Build JSX files # Build JSX files and hydration
node ./esbuild-prod.js node ./esbuild-prod.js
# Build hydration script
node ./esbuild-client-prod.js
# Build tailwind # Build tailwind
./node_modules/.bin/tailwindcss -i static/tailwind.css -o ./static/styles.css --minify ./node_modules/.bin/tailwindcss -i static/tailwind.css -o ./static/styles.css --minify
# Send to remote # Send to remote
scp -r /home/mario/carpeta usuario@dominio.com:/home/usuario # scp -r /home/mario/carpeta usuario@dominio.com:/home/usuario

View File

@ -1,22 +0,0 @@
const { build } = require("esbuild");
const { solidPlugin } = require("esbuild-plugin-solid");
build({
platform: "browser",
entryPoints: [
"src/views/hydration.ts",
],
bundle: true,
minify: true,
logLevel: "info",
plugins: [
solidPlugin({
solid: {
generate: "dom",
hydratable: true,
},
})
],
outdir: "static",
format: "cjs",
});

View File

@ -1,27 +0,0 @@
const { context } = require("esbuild");
const { solidPlugin } = require("esbuild-plugin-solid");
(async () => {
const ctx = await context({
platform: "browser",
entryPoints: [
"src/views/hydration.ts",
],
bundle: true,
minify: false,
logLevel: "info",
plugins: [
solidPlugin({
solid: {
generate: "dom",
hydratable: true,
},
})
],
outdir: "static",
format: "cjs",
});
await ctx.watch();
console.log("Watching hydration script...");
})();

View File

@ -24,3 +24,23 @@ const { glob } = require("glob");
format: "cjs", format: "cjs",
}); });
})(); })();
build({
platform: "browser",
entryPoints: [
"src/views/hydration.ts",
],
bundle: true,
minify: true,
logLevel: "info",
plugins: [
solidPlugin({
solid: {
generate: "dom",
hydratable: true,
},
})
],
outdir: "static",
format: "cjs",
});

View File

@ -4,6 +4,9 @@ const path = require("path");
const fs = require("fs"); const fs = require("fs");
const { glob } = require("glob"); const { glob } = require("glob");
/**
* Compile JSX files
*/
(async() => { (async() => {
const files = await glob("dist/**/*.jsx"); const files = await glob("dist/**/*.jsx");
console.log(files); console.log(files);
@ -25,53 +28,33 @@ const { glob } = require("glob");
}); });
await ctx.watch(); await ctx.watch();
console.log("Watching..."); console.log("Watching Solid JSX...");
})(); })();
/* /**
glob("dist/** /*.jsx") * Generate hydration script
.then((files) => {
build({
platform: "node",
entryPoints: files,
bundle: false,
minify: false,
logLevel: "info",
plugins: [solidPlugin({
solid: {
generate: "ssr",
hydratable: true,
},
})],
outdir: "dist/src",
format: "cjs",
});
});
*/ */
(async () => {
/* const ctx = await context({
build({ platform: "browser",
platform: "node",
entryPoints: [ entryPoints: [
"src/main.ts", "src/views/hydration.ts",
], ],
bundle: true, bundle: true,
minify: false, minify: false,
logLevel: "info", logLevel: "info",
plugins: [solidPlugin({ plugins: [
solidPlugin({
solid: { solid: {
generate: "ssr", generate: "dom",
hydratable: true, hydratable: true,
}, },
})], })
outdir: "dist",
format: "cjs",
external: [
"@nestjs/*",
"@fastify/*",
"class-validator",
"class-transformer",
"cache-manager",
], ],
outdir: "static",
format: "cjs",
}); });
*/
await ctx.watch();
console.log("Watching hydration script...");
})();

View File

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

Before

Width:  |  Height:  |  Size: 153 KiB

After

Width:  |  Height:  |  Size: 153 KiB

View File

Before

Width:  |  Height:  |  Size: 245 KiB

After

Width:  |  Height:  |  Size: 245 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -17,9 +17,7 @@
"test:cov": "jest --coverage", "test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json", "test:e2e": "jest --config ./test/jest-e2e.json",
"ssr:watch": "node esbuild.js", "ssr": "concurrently \"node esbuild.js\" \"tailwindcss -i static/tailwind.css -o ./static/styles.css --watch\"",
"ssr:hydration": "node esbuild-client.js",
"ssr": "concurrently \"node esbuild.js\" \"node esbuild-client.js\" \"tailwindcss -i static/tailwind.css -o ./static/styles.css --watch\"",
"tailwind": "tailwindcss -i static/tailwind.css -o ./static/styles.css --watch", "tailwind": "tailwindcss -i static/tailwind.css -o ./static/styles.css --watch",
"docx": "tsc docx/main.ts && node docx/main.js" "docx": "tsc docx/main.ts && node docx/main.js"
}, },

7
sql/Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM mysql:debian
# docker run --name eegsac -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456789 -d mysql:debian
# sudo docker exec -it CONTAINER bash
# mysql -u root --password=123456789
# cat backup.sql | sudo docker exec -i d53031d77ce5 /usr/bin/mysql -u root --password=123456789 educa7ls_plataforma

View File

@ -235,10 +235,6 @@ export async function matpelCert(props: CertData): Promise<Buffer> {
horizontal: FrameAnchorType.MARGIN, horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN, vertical: FrameAnchorType.MARGIN,
}, },
alignment: {
x: HorizontalPositionAlign.CENTER,
y: VerticalPositionAlign.TOP,
},
}, },
children: [ children: [
new TextRun({ new TextRun({

View File

@ -29,7 +29,8 @@ type ImgConfig = {
export function getImage(data: ImgConfig): ImageRun { export function getImage(data: ImgConfig): ImageRun {
return new ImageRun({ return new ImageRun({
data: fs.readFileSync(join(__dirname, "img", data.name)), // Magic path, based on dist folder
data: fs.readFileSync(join(__dirname, "..", "..", "..", "img", data.name)),
transformation: { transformation: {
height: cm(data.height), height: cm(data.height),
width: cm(data.width), width: cm(data.width),

View File

@ -1,3 +1,8 @@
/**
* This file generates a hidration script, which must
* then be sent to the client.
*/
import {hydrate} from "solid-js/web"; import {hydrate} from "solid-js/web";
import {Certs} from "./Certs"; import {Certs} from "./Certs";