Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
remove unused commands
default config do not exist anymore -> config is added to config.js file from the template
fixed cdn not working
  • Loading branch information
Armaldio committed Aug 11, 2019
1 parent 27d9548 commit 0fb4802
Show file tree
Hide file tree
Showing 23 changed files with 49 additions and 710 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"author": "Armaldio <armaldio@gmail.com>",
"license": "MIT",
"dependencies": {
"deepmerge": "^3.2.0",
"deepmerge": "^4.0.0",
"dotenv": "^8.0.0",
"dumper.js": "^1.3.1",
"electron-builder": "^20.40.2",
Expand Down
34 changes: 0 additions & 34 deletions src/DefaultConfig.js

This file was deleted.

4 changes: 0 additions & 4 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ const minify = require('./minify');
const _new = require('./new');
const preview = require('./preview');
const reportAnIssue = require('./report-an-issue');
const ui = require('./ui');
const login = require('./login');

module.exports = {
build,
Expand All @@ -26,6 +24,4 @@ module.exports = {
_new,
preview,
reportAnIssue,
ui,
login,
};
74 changes: 0 additions & 74 deletions src/actions/login.js

This file was deleted.

66 changes: 0 additions & 66 deletions src/actions/ui.js

This file was deleted.

14 changes: 7 additions & 7 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
const fs = require('fs');
const path = require('path');
const deepmerge = require('deepmerge');
const mri = require('mri');
const deepmerge = require('deepmerge');
const rollbar = require('./ErrorReport');

const USER_CONFIG = path.join(process.cwd(), 'config.js');
const base = require('./DefaultConfig');
const PluginManager = require('./PluginManager');

const logger = require('./utils/console').normal('system');
Expand Down Expand Up @@ -41,8 +40,6 @@ module.exports = async () => {
config.env = 'development';
}

const baseConfig = base(config.env === 'production');

let userConfig = {};
if (fs.existsSync(USER_CONFIG)) {
const usrConfig = require(USER_CONFIG);
Expand All @@ -56,10 +53,13 @@ module.exports = async () => {

// mix only plugins
const userPlugins = [];
if (userConfig && userConfig.plugins) {
const defaultPlugins = [
'build', 'preview', 'debug', 'donate', 'new', 'report-issue', 'help',
];
if (userConfig.plugins) {
userPlugins.push(...userConfig.plugins);
}
userPlugins.push(...baseConfig.plugins);
userPlugins.push(...defaultPlugins);

await pm.loadDefaultCommands(userPlugins);
// if (isReady) await pm.loadCustomCommands();
Expand All @@ -69,7 +69,7 @@ module.exports = async () => {
pluginsConfig = deepmerge(pluginsConfig, { [command.name]: command.config || {} });
});

config = deepmerge.all([config, baseConfig, pluginsConfig, userConfig]);
config = deepmerge.all([config, pluginsConfig, userConfig]);

pm.setModules();

Expand Down
1 change: 0 additions & 1 deletion src/dist-dashboard/css/app.8c9727dc.css

This file was deleted.

Binary file removed src/dist-dashboard/favicon.ico
Binary file not shown.
Binary file removed src/dist-dashboard/fonts/element-icons.2fad952a.woff
Binary file not shown.
Binary file removed src/dist-dashboard/fonts/element-icons.6f0a7632.ttf
Binary file not shown.
1 change: 0 additions & 1 deletion src/dist-dashboard/index.html

This file was deleted.

2 changes: 0 additions & 2 deletions src/dist-dashboard/js/about.69260e02.js

This file was deleted.

1 change: 0 additions & 1 deletion src/dist-dashboard/js/about.69260e02.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions src/dist-dashboard/js/app.1b337af1.js

This file was deleted.

1 change: 0 additions & 1 deletion src/dist-dashboard/js/app.1b337af1.js.map

This file was deleted.

501 changes: 0 additions & 501 deletions src/dist-dashboard/js/chunk-vendors.b6eedc30.js

This file was deleted.

1 change: 0 additions & 1 deletion src/dist-dashboard/js/chunk-vendors.b6eedc30.js.map

This file was deleted.

32 changes: 31 additions & 1 deletion src/new-project-template/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
// Happy with ElectronForConstruct ? ► Donate: https://armaldio.xyz/#/donations ♥
// Happy with ElectronForConstruct ? ► Donate: https://armaldio.xyz/donations ♥

module.exports = isProd => ({
// add your own configuration

electron: '6.0.1',
errorLogging: true,
singleInstance: false,
window: {
width: 800,
height: 600,
fullscreen: isProd,
frame: true,
transparent: false,
toolbar: true,
alwaysOnTop: false,
},
debug: {
showConfig: false,
},
developer: {
showConstructDevTools: !isProd,
autoClose: !isProd,
autoReload: !isProd,
showChromeDevTools: !isProd,
overlay: null,
},
project: {
name: 'MyName',
description: 'MyDescription',
author: 'Me',
version: '0.0.0',
},
switches: [],
});
7 changes: 2 additions & 5 deletions src/template/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
const deepmerge = require('deepmerge');
const user = require('./user');

const base = require('./config-base');
const user = require('./config-user');

module.exports = deepmerge(base, user(base.env === 'production'));
module.exports = user;
3 changes: 1 addition & 2 deletions src/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
"license": "UNLICENSED",
"private": true,
"devDependencies": {
"electron": "5.0.1"
"electron": "6.0.1"
},
"dependencies": {
"deepmerge": "^3.2.0",
"fs-extra": "^7.0.1",
"get-port": "^4.2.0",
"serve-handler": "^5.0.8"
Expand Down
2 changes: 1 addition & 1 deletion src/template/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ document.addEventListener('DOMContentLoaded', () => {

console.log('adding vue');

return _appendScript('https://gitcdn.xyz/repo/ElectronForConstruct/construct-devtool/master/dist/construct-devtool.min.js');
return _appendScript('https://cdn.jsdelivr.net/gh/ElectronForConstruct/construct-devtool/dist/construct-devtool.min.js');
})
.then(() => {
const dt = document.createElement('construct-devtool');
Expand Down
4 changes: 2 additions & 2 deletions src/utils/setupDir.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ module.exports = async (settings, zipFile = null, mode) => {
shelljs.cp(path.join(__dirname, '../', 'template', 'preload.js'), tmpDir.name);
shelljs.cp(path.join(__dirname, '../', 'template', 'package.json'), tmpDir.name);

shelljs.cp(path.join(process.cwd(), 'config.js'), path.join(tmpDir.name, 'config-user.js'));
// shelljs.cp(path.join(process.cwd(), 'config.js'), path.join(tmpDir.name, 'user.js'));

fs.writeFileSync(path.join(tmpDir.name, 'config-base.js'), `module.exports = ${JSON.stringify(settings, null, ' ')}`, 'utf8');
fs.writeFileSync(path.join(tmpDir.name, 'user.js'), `module.exports = ${JSON.stringify(settings, null, ' ')}`, 'utf8');

if (zipFile) {
await extractZip(zipFile, tmpDir.name);
Expand Down
7 changes: 4 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -860,9 +860,10 @@ deep-is@~0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"

deepmerge@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-3.2.0.tgz#58ef463a57c08d376547f8869fdc5bcee957f44e"
deepmerge@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.0.0.tgz#3e3110ca29205f120d7cb064960a39c3d2087c09"
integrity sha512-YZ1rOP5+kHor4hMAH+HRQnBQHg+wvS1un1hAOuIcxcBy0hzcUf6Jg2a1w65kpoOUnurOfZbERwjI1TfZxNjcww==

defer-to-connect@^1.0.1:
version "1.0.2"
Expand Down

0 comments on commit 0fb4802

Please sign in to comment.