@atom-js-org/cli 0.5.3-alpha.2 → 0.5.3-alpha.4
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/package.json +1 -1
- package/src/build.cjs +12 -0
package/package.json
CHANGED
package/src/build.cjs
CHANGED
|
@@ -222,15 +222,18 @@ async function vendorFramework(appDir, project, target) {
|
|
|
222
222
|
};
|
|
223
223
|
if (target === 'windows') {
|
|
224
224
|
pkg.dependencies['@webviewjs/webview'] = '0.4.0';
|
|
225
|
+
pkg.dependencies.koffi = '3.1.2';
|
|
225
226
|
delete pkg.dependencies['webview-nodejs'];
|
|
226
227
|
if (pkg.optionalDependencies) delete pkg.optionalDependencies['webview-nodejs'];
|
|
227
228
|
} else if (target === 'linux' && process.env.ATOM_SKIP_WEBVIEW_CHECK !== '1') {
|
|
228
229
|
pkg.dependencies['webview-nodejs'] = '0.5.0';
|
|
229
230
|
delete pkg.dependencies['@webviewjs/webview'];
|
|
231
|
+
delete pkg.dependencies.koffi;
|
|
230
232
|
if (pkg.optionalDependencies) delete pkg.optionalDependencies['webview-nodejs'];
|
|
231
233
|
} else {
|
|
232
234
|
delete pkg.dependencies['webview-nodejs'];
|
|
233
235
|
delete pkg.dependencies['@webviewjs/webview'];
|
|
236
|
+
delete pkg.dependencies.koffi;
|
|
234
237
|
if (pkg.optionalDependencies) delete pkg.optionalDependencies['webview-nodejs'];
|
|
235
238
|
}
|
|
236
239
|
pkg.overrides = { ...(pkg.overrides || {}), tar: '7.5.20' };
|
|
@@ -272,6 +275,15 @@ async function installProductionDependencies(appDir, skipInstall, target) {
|
|
|
272
275
|
if (!fs.existsSync(bindingPath)) {
|
|
273
276
|
throw new Error('@webviewjs/webview was not installed. Remove node_modules and package-lock.json, then retry the build.');
|
|
274
277
|
}
|
|
278
|
+
const nativeDragPath = path.join(appDir, 'node_modules', 'koffi');
|
|
279
|
+
if (!fs.existsSync(nativeDragPath)) {
|
|
280
|
+
throw new Error('koffi was not installed. AtomJS requires its prebuilt Win32 FFI package for native window movement.');
|
|
281
|
+
}
|
|
282
|
+
try {
|
|
283
|
+
await run(process.execPath, ['-e', "require('koffi');"], { cwd: appDir });
|
|
284
|
+
} catch (error) {
|
|
285
|
+
throw new Error(`The prebuilt Koffi package could not load for this Windows architecture: ${error.message}`);
|
|
286
|
+
}
|
|
275
287
|
} else if (target === 'linux') {
|
|
276
288
|
const bindingPath = path.join(appDir, 'node_modules', 'webview-nodejs');
|
|
277
289
|
if (!fs.existsSync(bindingPath) && process.env.ATOM_SKIP_WEBVIEW_CHECK !== '1') {
|