@eziapp-org/builder 0.0.0-beta.3 → 0.0.0-beta.5
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/dist/src/builder.d.ts +0 -1
- package/dist/src/builder.js +11 -4
- package/package.json +2 -2
package/dist/src/builder.d.ts
CHANGED
package/dist/src/builder.js
CHANGED
|
@@ -50,9 +50,11 @@ const { red, green, yellow, blue, bold } = chalk_1.default;
|
|
|
50
50
|
const packagers = {
|
|
51
51
|
windows: "../packagers/windows/main"
|
|
52
52
|
};
|
|
53
|
+
const eziDevExePaths = {
|
|
54
|
+
windows: path.join(__dirname, "../bin/eziapp-npm-dev-winx64.exe")
|
|
55
|
+
};
|
|
53
56
|
class Builder {
|
|
54
57
|
constructor(config) {
|
|
55
|
-
this.eziDevExePath = path.join(__dirname, "../bin/eziapp-npm-dev-winx64.exe");
|
|
56
58
|
this.mode = config.mode || (0, utils_1.getArg)("--mode") || 'debug';
|
|
57
59
|
this.platform = config.platform || (0, utils_1.getArg)("--platform") || (0, utils_1.getCurrentPlatformName)();
|
|
58
60
|
this.viteConfigPath = path.join(process.cwd(), config.viteConfigPath ?? "vite.config.js");
|
|
@@ -141,10 +143,10 @@ class Builder {
|
|
|
141
143
|
console.log(green("✓ assets generated."));
|
|
142
144
|
}
|
|
143
145
|
async genIcon() {
|
|
144
|
-
|
|
145
|
-
if (!iconPath) {
|
|
146
|
+
if (!(this.eziConfig.application.icon)) {
|
|
146
147
|
return;
|
|
147
148
|
}
|
|
149
|
+
const iconPath = path.join("public", this.eziConfig.application.icon);
|
|
148
150
|
try {
|
|
149
151
|
const resizedPngBuffer = await (0, sharp_1.default)(iconPath)
|
|
150
152
|
.resize(256, 256, { fit: 'cover' })
|
|
@@ -181,6 +183,11 @@ class Builder {
|
|
|
181
183
|
await packager.package();
|
|
182
184
|
}
|
|
183
185
|
async dev() {
|
|
186
|
+
const devExePath = eziDevExePaths[this.platform];
|
|
187
|
+
if (!devExePath) {
|
|
188
|
+
console.error(red(`✗ Unsupported platform: ${this.platform}`));
|
|
189
|
+
process.exit(1);
|
|
190
|
+
}
|
|
184
191
|
const startTime = Date.now();
|
|
185
192
|
const server = await (0, vite_1.createServer)();
|
|
186
193
|
await server.listen();
|
|
@@ -202,7 +209,7 @@ class Builder {
|
|
|
202
209
|
}
|
|
203
210
|
fs.writeFileSync(eziConfigJsonPath, JSON.stringify(devEziConfig, null, 4), { encoding: "utf-8" });
|
|
204
211
|
const appName = devEziConfig?.application?.name || "EziApplication";
|
|
205
|
-
const child = (0, child_process_1.spawn)(
|
|
212
|
+
const child = (0, child_process_1.spawn)(devExePath, [
|
|
206
213
|
'--configpath',
|
|
207
214
|
eziConfigJsonPath,
|
|
208
215
|
'--cwd',
|
package/package.json
CHANGED