mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
Fixes tgfont build & readds it to the normal TGUI compilation (#96853)
## About The Pull Request It was calling the `tgfont:build` script in `tgui/package.json` which didn't exist because the `bun()` function has the directory hardcoded to `./tgui`. So, I added an arg to specify the dir. Here's proof that it works: <img width="913" height="762" alt="image" src="https://github.com/user-attachments/assets/6f787173-d18a-448e-ba43-d1660f77df7e" /> I also removed the unused `tgui-bench` & `tgui-sonar` .cmds since their functionality was removed a year ago
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
@echo off
|
||||
call "%~dp0\..\tools\build\build.bat" --wait-on-error tgui-bench %*
|
||||
pause
|
||||
@@ -1,2 +0,0 @@
|
||||
@echo off
|
||||
call "%~dp0\..\tools\build\build.bat" --wait-on-error tgui-sonar %*
|
||||
@@ -1,8 +1,7 @@
|
||||
/datum/asset/simple/namespaced/tgfont
|
||||
assets = list(
|
||||
"tgfont.eot" = file("tgui/packages/tgfont/static/tgfont.eot"),
|
||||
"tgfont.woff2" = file("tgui/packages/tgfont/static/tgfont.woff2"),
|
||||
"tgfont.woff2" = file("tgui/packages/tgfont/dist/tgfont.woff2"),
|
||||
)
|
||||
parents = list(
|
||||
"tgfont.css" = file("tgui/packages/tgfont/static/tgfont.css"),
|
||||
"tgfont.css" = file("tgui/packages/tgfont/dist/tgfont.css"),
|
||||
)
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
@font-face {
|
||||
font-family: "tgfont";
|
||||
src: url("tgfont.woff2?t=1747971548188") format("woff2");
|
||||
}
|
||||
|
||||
[class^="tg-"],
|
||||
[class*=" tg-"] {
|
||||
/* biome-ignore lint/complexity/noImportantStyles: Just leave it */
|
||||
font-family: "tgfont" !important;
|
||||
font-size: inherit;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
:root {
|
||||
/* biome-ignore-start lint/suspicious/noUselessEscapeInString: The escapes are needed */
|
||||
--tg-air-tank-slash: "\ea01";
|
||||
--tg-air-tank: "\ea02";
|
||||
--tg-bad-touch: "\ea03";
|
||||
--tg-image-minus: "\ea04";
|
||||
--tg-image-plus: "\ea05";
|
||||
--tg-nanotrasen-logo: "\ea06";
|
||||
--tg-non-binary: "\ea07";
|
||||
--tg-prosthetic-full: "\ea08";
|
||||
--tg-prosthetic-leg: "\ea09";
|
||||
--tg-sound-minus: "\ea0a";
|
||||
--tg-sound-plus: "\ea0b";
|
||||
--tg-syndicate-logo: "\ea0c";
|
||||
/* biome-ignore-end lint/suspicious/noUselessEscapeInString: The escapes are needed */
|
||||
}
|
||||
.tg-air-tank-slash::before {
|
||||
content: var(--tg-air-tank-slash);
|
||||
}
|
||||
.tg-air-tank::before {
|
||||
content: var(--tg-air-tank);
|
||||
}
|
||||
.tg-bad-touch::before {
|
||||
content: var(--tg-bad-touch);
|
||||
}
|
||||
.tg-image-minus::before {
|
||||
content: var(--tg-image-minus);
|
||||
}
|
||||
.tg-image-plus::before {
|
||||
content: var(--tg-image-plus);
|
||||
}
|
||||
.tg-nanotrasen-logo::before {
|
||||
content: var(--tg-nanotrasen-logo);
|
||||
}
|
||||
.tg-non-binary::before {
|
||||
content: var(--tg-non-binary);
|
||||
}
|
||||
.tg-prosthetic-full::before {
|
||||
content: var(--tg-prosthetic-full);
|
||||
}
|
||||
.tg-prosthetic-leg::before {
|
||||
content: var(--tg-prosthetic-leg);
|
||||
}
|
||||
.tg-sound-minus::before {
|
||||
content: var(--tg-sound-minus);
|
||||
}
|
||||
.tg-sound-plus::before {
|
||||
content: var(--tg-sound-plus);
|
||||
}
|
||||
.tg-syndicate-logo::before {
|
||||
content: var(--tg-syndicate-logo);
|
||||
}
|
||||
Binary file not shown.
+13
-24
@@ -10,7 +10,7 @@
|
||||
import fs from 'node:fs';
|
||||
import Bun from 'bun';
|
||||
import Juke from './juke/index.js';
|
||||
import { bun, bunRoot } from './lib/bun';
|
||||
import { bun } from './lib/bun';
|
||||
import { DreamDaemon, DreamMaker, NamedVersionFile } from './lib/byond';
|
||||
import { downloadFile } from './lib/download';
|
||||
import { formatDeps } from './lib/helpers';
|
||||
@@ -94,7 +94,7 @@ export const CutterTarget = new Juke.Target({
|
||||
const temp_path = `${cutter_path}_temp`; // yes this means its file extension is .exe_temp I don't really care
|
||||
await downloadFile(download_from, temp_path);
|
||||
fs.copyFileSync(temp_path, cutter_path);
|
||||
fs.rmSync(temp_path)
|
||||
fs.rmSync(temp_path);
|
||||
if (process.platform !== 'win32') {
|
||||
await Juke.exec('chmod', ['+x', cutter_path]);
|
||||
}
|
||||
@@ -290,7 +290,7 @@ export const BunTarget = new Juke.Target({
|
||||
parameters: [CiParameter],
|
||||
inputs: ['tgui/**/package.json'],
|
||||
executes: () => {
|
||||
return bun('install', '--frozen-lockfile', '--ignore-scripts');
|
||||
return bun('./tgui', 'install', '--frozen-lockfile', '--ignore-scripts');
|
||||
},
|
||||
});
|
||||
|
||||
@@ -301,7 +301,7 @@ export const BiomeInstallTarget = new Juke.Target({
|
||||
return Juke.glob('node_modules/@biomejs/**').length === 0;
|
||||
},
|
||||
executes: () => {
|
||||
return bunRoot('install');
|
||||
return bun('.', 'install');
|
||||
},
|
||||
});
|
||||
|
||||
@@ -315,18 +315,7 @@ export const TgFontTarget = new Juke.Target({
|
||||
'tgui/packages/tgfont/dist/tgfont.css',
|
||||
'tgui/packages/tgfont/dist/tgfont.woff2',
|
||||
],
|
||||
executes: async () => {
|
||||
await bun('tgfont:build');
|
||||
fs.mkdirSync('tgui/packages/tgfont/static', { recursive: true });
|
||||
fs.copyFileSync(
|
||||
'tgui/packages/tgfont/dist/tgfont.css',
|
||||
'tgui/packages/tgfont/static/tgfont.css',
|
||||
);
|
||||
fs.copyFileSync(
|
||||
'tgui/packages/tgfont/dist/tgfont.woff2',
|
||||
'tgui/packages/tgfont/static/tgfont.woff2',
|
||||
);
|
||||
},
|
||||
executes: () => bun('./tgui/packages/tgfont', 'tgfont:build'),
|
||||
});
|
||||
|
||||
export const TguiTarget = new Juke.Target({
|
||||
@@ -344,23 +333,23 @@ export const TguiTarget = new Juke.Target({
|
||||
'tgui/public/tgui-say.bundle.css',
|
||||
'tgui/public/tgui-say.bundle.js',
|
||||
],
|
||||
executes: () => bun('tgui:build'),
|
||||
executes: () => bun('./tgui', 'tgui:build'),
|
||||
});
|
||||
|
||||
export const TguiTscTarget = new Juke.Target({
|
||||
dependsOn: [BunTarget],
|
||||
executes: () => bun('tgui:tsc'),
|
||||
executes: () => bun('./tgui', 'tgui:tsc'),
|
||||
});
|
||||
|
||||
export const TguiTestTarget = new Juke.Target({
|
||||
parameters: [CiParameter],
|
||||
dependsOn: [BunTarget],
|
||||
executes: () => bun('tgui:test'),
|
||||
executes: () => bun('./tgui', 'tgui:test'),
|
||||
});
|
||||
|
||||
export const BiomeCheckTarget = new Juke.Target({
|
||||
dependsOn: [BunTarget, BiomeInstallTarget],
|
||||
executes: () => bunRoot('tgui:lint'),
|
||||
executes: () => bun('.', 'tgui:lint'),
|
||||
});
|
||||
|
||||
export const TguiLintTarget = new Juke.Target({
|
||||
@@ -369,12 +358,12 @@ export const TguiLintTarget = new Juke.Target({
|
||||
|
||||
export const TguiDevTarget = new Juke.Target({
|
||||
dependsOn: [BunTarget],
|
||||
executes: ({ args }) => bun('tgui:dev', ...args),
|
||||
executes: ({ args }) => bun('./tgui', 'tgui:dev', ...args),
|
||||
});
|
||||
|
||||
export const TguiAnalyzeTarget = new Juke.Target({
|
||||
dependsOn: [BunTarget],
|
||||
executes: () => bun('tgui:analyze'),
|
||||
executes: () => bun('./tgui', 'tgui:analyze'),
|
||||
});
|
||||
|
||||
export const TestTarget = new Juke.Target({
|
||||
@@ -386,7 +375,7 @@ export const LintTarget = new Juke.Target({
|
||||
});
|
||||
|
||||
export const BuildTarget = new Juke.Target({
|
||||
dependsOn: [TguiTarget, DmTarget],
|
||||
dependsOn: [TguiTarget, TgFontTarget, DmTarget],
|
||||
});
|
||||
|
||||
export const ServerTarget = new Juke.Target({
|
||||
@@ -438,7 +427,7 @@ export const CleanAllTarget = new Juke.Target({
|
||||
});
|
||||
|
||||
export const TgsTarget = new Juke.Target({
|
||||
dependsOn: [TguiTarget],
|
||||
dependsOn: [TguiTarget, TgFontTarget],
|
||||
executes: async () => {
|
||||
Juke.logger.info('Prepending TGS define');
|
||||
prependDefines('TGS');
|
||||
|
||||
+3
-15
@@ -3,26 +3,14 @@ import Juke from '../juke/index.js';
|
||||
|
||||
let hasInstallFolder = false;
|
||||
|
||||
export function bun(...args: any[]): Promise<Juke.ExecReturn> {
|
||||
export function bun(dir: string, ...args: any[]): Promise<Juke.ExecReturn> {
|
||||
if (!hasInstallFolder) {
|
||||
mkdirSync('./tgui/node_modules/', { recursive: true });
|
||||
mkdirSync(`${dir}/node_modules/`, { recursive: true });
|
||||
hasInstallFolder = true;
|
||||
}
|
||||
|
||||
return Juke.exec('bun', [...args.filter((arg) => typeof arg === 'string')], {
|
||||
cwd: './tgui',
|
||||
shell: true,
|
||||
});
|
||||
}
|
||||
|
||||
export function bunRoot(...args: any[]): Promise<Juke.ExecReturn> {
|
||||
if (!hasInstallFolder) {
|
||||
mkdirSync('./node_modules/', { recursive: true });
|
||||
hasInstallFolder = true;
|
||||
}
|
||||
|
||||
return Juke.exec('bun', [...args.filter((arg) => typeof arg === 'string')], {
|
||||
cwd: './',
|
||||
cwd: dir,
|
||||
shell: true,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user