Skip to content
This repository was archived by the owner on Apr 29, 2025. It is now read-only.

Commit f05d375

Browse files
committed
refactor: update esbuild and build process
1 parent 779ecca commit f05d375

File tree

9 files changed

+326
-272
lines changed

9 files changed

+326
-272
lines changed

.github/actions/bump-manifest-version.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ jobs:
4343

4444
- name: Run build
4545
run: pnpm build
46-
47-
- name: Bump manifest version
48-
run: node .github/actions/bump-manifest-version.js
4946
env:
5047
TGT_RELEASE_VERSION: ${{ github.ref_name }}
5148

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
.yarn.installed
2+
fxmanifest.lua
3+
14
# Logs
25
logs
36
*.log

.yarn.installed

Lines changed: 0 additions & 1 deletion
This file was deleted.

build.js

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,73 @@
1-
const { build } = require('esbuild');
1+
import { build } from 'esbuild';
2+
import { readFileSync, writeFileSync } from 'fs';
3+
4+
const packageJson = JSON.parse(readFileSync('package.json', { encoding: 'utf8' }));
5+
const version = process.env.TGT_RELEASE_VERSION;
6+
7+
if (version) {
8+
packageJson.version = version.replace('v', '');
9+
writeFileSync('package.json', JSON.stringify(packageJson, null, 2));
10+
}
11+
12+
writeFileSync(
13+
'.yarn.installed',
14+
new Date().toLocaleString('en-AU', {
15+
timeZone: 'UTC',
16+
timeStyle: 'long',
17+
dateStyle: 'full',
18+
})
19+
);
20+
21+
writeFileSync(
22+
'fxmanifest.lua',
23+
`fx_version 'cerulean'
24+
game 'common'
25+
use_experimental_fxv2_oal 'yes'
26+
lua54 'yes'
27+
28+
name '${packageJson.name}'
29+
author '${packageJson.author}'
30+
version '${packageJson.version}'
31+
license '${packageJson.license}'
32+
repository '${packageJson.repository.url}'
33+
description '${packageJson.description}'
34+
35+
dependencies {
36+
'/server:7290',
37+
}
38+
39+
client_script 'ui.lua'
40+
server_script 'dist/build.js'
41+
42+
files {
43+
'web/build/index.html',
44+
'web/build/**/*'
45+
}
46+
47+
ui_page 'web/build/index.html'
48+
49+
provide 'mysql-async'
50+
provide 'ghmattimysql'
51+
52+
convar_category 'OxMySQL' {
53+
'Configuration',
54+
{
55+
{ 'Connection string', 'mysql_connection_string', 'CV_STRING', 'mysql://user:password@localhost/database' },
56+
{ 'Debug', 'mysql_debug', 'CV_BOOL', 'false' }
57+
}
58+
}
59+
`
60+
);
261

362
build({
4-
entryPoints: ['./src/index.ts'],
5-
outfile: 'dist/build.js',
663
bundle: true,
64+
entryPoints: [`./src/index.ts`],
65+
outfile: `dist/build.js`,
66+
keepNames: true,
67+
dropLabels: ['DEV'],
68+
legalComments: 'inline',
769
platform: 'node',
70+
target: ['node16'],
71+
format: 'cjs',
872
logLevel: 'info',
973
});

fxmanifest.lua

Lines changed: 0 additions & 33 deletions
This file was deleted.

package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
{
22
"name": "oxmysql",
3-
"version": "2.3.4",
3+
"version": "2.7.7",
44
"description": "FXServer to MySQL communication via node-mysql2",
5-
"repository": "[email protected]:overextended/oxmysql.git",
6-
"author": "dunak-debug <[email protected]>",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/overextended/oxmysql.git"
8+
},
9+
"bugs": "https://github.com/overextended/oxmysql/issues",
10+
"author": "Overextended",
711
"license": "LGPL-3.0-or-later",
12+
"type": "module",
813
"main": "lib/MySQL.js",
914
"types": "lib/MySQL.d.ts",
1015
"files": [
@@ -29,10 +34,10 @@
2934
"prettier": "^2.8.8"
3035
},
3136
"devDependencies": {
32-
"esbuild": "^0.14.54",
37+
"esbuild": "^0.20.0",
3338
"lerna": "^4.0.0",
3439
"postinstall-postinstall": "^2.1.0",
3540
"pretty-quick": "^3.1.3",
36-
"typescript": "^4.9.5"
41+
"typescript": "^5.3.3"
3742
}
3843
}

0 commit comments

Comments
 (0)