Skip to content

Commit

Permalink
Merge pull request #25 from arturock/dependencies
Browse files Browse the repository at this point in the history
Fix missing dependencies when building and update dev deps
  • Loading branch information
artrz authored Jul 16, 2021
2 parents e79c3de + dbd02e4 commit fb8b1ef
Show file tree
Hide file tree
Showing 7 changed files with 318 additions and 452 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.5.0] - 2021-07-16
### Updated
- Update some dependencies.

### Fixed
- Unable to execute build script.

## [0.4.0] - 2021-05-01
### Updated
- Update some dependencies.
Expand Down
6 changes: 3 additions & 3 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ const basecamp = {
checkNewVersion(notifyLatest) {
versionChecker.check().then((check) => {
if (check.comparison === 1) {
notification(`New version available\n${check.repoVersion}`);
notification(`New version ${check.repoVersion} available`);
} else if (notifyLatest === true) {
notification(check.comparison === 0
? `You have the latest version\n${check.appVersion}`
: `Dev version ${check.appVersion}\nLatest ${check.repoVersion}`);
? 'You have the latest version'
: `This is an unreleased version ${check.appVersion}\n\nLatest published is ${check.repoVersion}`);
}
});
},
Expand Down
4 changes: 2 additions & 2 deletions app/menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ module.exports = {
},
{
type: 'checkbox',
label: 'Check new version at startup',
label: 'Check for updates at startup',
checked: settings.get('checkNewVersion'),
click() {
settings.set('checkNewVersion', !settings.get('checkNewVersion'));
Expand All @@ -119,7 +119,7 @@ module.exports = {
submenu: [
{ label: 'About', click() { app.showAboutDialog(); } },
{ label: 'Website', click() { shell.openExternal('https://github.com/arturock/basecamp-linux'); } },
{ label: 'Check for new version', click() { app.checkNewVersion(true); } },
{ label: 'Check for updates...', click() { app.checkNewVersion(true); } },
{ type: 'separator' },
{ role: 'toggledevtools' },
],
Expand Down
7 changes: 5 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"productName": "Basecamp for Linux",
"baseName": "basecamp",
"description": "Unofficial Basecamp GNU/Linux Desktop Client.",
"version": "0.4.0",
"version": "0.5.0",
"author": "Arturo Rodríguez",
"license": "MIT",
"main": "app.js",
Expand All @@ -22,5 +22,8 @@
],
"dependencies": {
"electron-settings": "^4.0.2"
}
},
"os": [
"linux"
]
}
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
"license": "MIT",
"private": true,
"devDependencies": {
"basecamp-linux": "file:app",
"electron": "11.4.4",
"electron-packager": "15.2.0",
"eslint": "7.25.0",
"eslint": "7.30.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "2.22.1",
"lzma-native": "^7.0.1",
"eslint-plugin-import": "2.23.4",
"lzma-native": "^8.0.1",
"minimist": "^1.2.5",
"tar": "6.1.0"
},
Expand Down
38 changes: 18 additions & 20 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,7 @@ const ASSETS_PATH = path.join(__dirname, '..', 'assets');
const BUILD_PATH = path.join(__dirname, '..', 'build');
const DIST_PATH = path.join(__dirname, '..', 'dist');
const NODE_MODULES_PATH = path.join(__dirname, '..', 'node_modules');
const E_VERSION = require(path.join(NODE_MODULES_PATH, 'electron', 'package.json')).version;

const PACKAGE_CONFIG = {
dir: SOURCE_PATH,
out: BUILD_PATH,
name: APP_NAME,
appVersion: APP_VERSION,
buildVersion: APP_VERSION,
electronVersion: E_VERSION,
extraResource: [`${ASSETS_PATH}`],
packageManager: 'yarn',
platform: 'linux',
};
const ELECTRON_VERSION = require(path.join(NODE_MODULES_PATH, 'electron', 'package.json')).version;

const ARGS = minimist(process.argv.slice(2), {
boolean: ['compress'],
Expand All @@ -43,9 +31,20 @@ const ARGS = minimist(process.argv.slice(2), {
},
});

const PACKAGE_CONFIG = {
dir: SOURCE_PATH,
out: BUILD_PATH,
name: APP_NAME,
appVersion: APP_VERSION,
electronVersion: ELECTRON_VERSION,
extraResource: [`${ASSETS_PATH}`],
platform: 'linux',
arch: ARGS.arch.split(','),
};

const builder = {
build() {
this.reinstallModules();
this.installAppModules();

this.deleteDir(BUILD_PATH);

Expand All @@ -56,9 +55,10 @@ const builder = {
this.package();
},

reinstallModules() {
console.log('\nReinstalling node_modules...');
cp.execSync('yarn install', { stdio: 'inherit' });
installAppModules() {
this.deleteDir(`${SOURCE_PATH}/node_modules`);
console.log('\nInstalling app modules...');
cp.execSync('yarn install --no-lockfile', { cwd: SOURCE_PATH, stdio: 'inherit' });
},

deleteDir(pathToDelete) {
Expand All @@ -69,9 +69,7 @@ const builder = {
package() {
console.log('\nPackaging app...');

const arch = { arch: ARGS.arch.split(',') };

packager({ ...PACKAGE_CONFIG, ...arch })
packager(PACKAGE_CONFIG)
.then((appPaths) => {
appPaths.forEach((appPath) => {
if (ARGS.compress) {
Expand Down
Loading

0 comments on commit fb8b1ef

Please sign in to comment.