Skip to content

Commit

Permalink
release 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
julyL committed Jun 28, 2018
1 parent c636e51 commit dcb02d3
Show file tree
Hide file tree
Showing 26 changed files with 910 additions and 1,011 deletions.
23 changes: 17 additions & 6 deletions .electron-vue/build-installer.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
var electronInstaller = require('electron-winstaller');
var path = require("path");
var electronInstaller = require('electron-winstaller');

resultPromise = electronInstaller.createWindowsInstaller({
appDirectory: path.resolve(__dirname, '../build/mytoy/'),
// In this case, we can use relative paths
var settings = {
// Specify the folder where the built app is located
appDirectory: path.resolve(__dirname, '../build/mytoy-win32-x64/'),
// Specify the existing folder where
outputDirectory: path.resolve(__dirname, '../build/installer'),
// The name of the Author of the app (the name of your company)
authors: 'julyL',
exe: 'my-toy.exe'
});
// The name of the executable of your built
exe: './mytoy.exe'
};

resultPromise = electronInstaller.createWindowsInstaller(settings);

resultPromise.then(() => console.log("It worked!"), (e) => console.log(`No dice: ${e.message}`));
resultPromise.then(() => {
console.log("The installers of your application were succesfully created !");
}, (e) => {
console.log(`Well, sometimes you are not so lucky: ${e.message}`)
});
2 changes: 1 addition & 1 deletion .electron-vue/build.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const path = require('path')
*/
module.exports = {
arch: 'x64',
asar: true,
asar: false,
dir: path.join(__dirname, '../'),
icon: path.join(__dirname, '../build/icons/icon'),
ignore: /(^\/(src|test|\.[a-z]+|README|yarn|static|dist\/web))|\.gitkeep/,
Expand Down
39 changes: 0 additions & 39 deletions .electron-vue/movefile.js

This file was deleted.

12 changes: 5 additions & 7 deletions .electron-vue/webpack.main.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,11 @@ let mainConfig = {
/**
* Adjust mainConfig for development settings
*/
if (process.env.NODE_ENV !== 'production') {
mainConfig.plugins.push(
new webpack.DefinePlugin({
'__static': `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"`
})
)
}
mainConfig.plugins.push(
new webpack.DefinePlugin({
'__static': `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"`
})
)

/**
* Adjust mainConfig for production settings
Expand Down
40 changes: 19 additions & 21 deletions .electron-vue/webpack.renderer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
process.env.BABEL_ENV = 'renderer'

const path = require('path')
const { dependencies } = require('../package.json')
const {
dependencies
} = require('../package.json')
const webpack = require('webpack')

const BabiliWebpackPlugin = require('babili-webpack-plugin')
Expand All @@ -29,8 +31,7 @@ let rendererConfig = {
...Object.keys(dependencies || {}).filter(d => !whiteListedModules.includes(d))
],
module: {
rules: [
{
rules: [{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
Expand Down Expand Up @@ -107,9 +108,9 @@ let rendererConfig = {
removeAttributeQuotes: true,
removeComments: true
},
nodeModules: process.env.NODE_ENV !== 'production'
? path.resolve(__dirname, '../node_modules')
: false
nodeModules: process.env.NODE_ENV !== 'production' ?
path.resolve(__dirname, '../node_modules') :
false
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
Expand Down Expand Up @@ -138,13 +139,12 @@ let rendererConfig = {
/**
* Adjust rendererConfig for development settings
*/
if (process.env.NODE_ENV !== 'production') {
rendererConfig.plugins.push(
new webpack.DefinePlugin({
'__static': `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"`
})
)
}
rendererConfig.plugins.push(
new webpack.DefinePlugin({
'__static': `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"`
})
)


/**
* Adjust rendererConfig for production settings
Expand All @@ -154,13 +154,11 @@ if (process.env.NODE_ENV === 'production') {

rendererConfig.plugins.push(
new BabiliWebpackPlugin(),
new CopyWebpackPlugin([
{
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/electron/static'),
ignore: ['.*']
}
]),
new CopyWebpackPlugin([{
from: path.join(__dirname, '../static'),
to: path.join(__dirname, '../dist/electron/static'),
ignore: ['.*']
}]),
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"'
}),
Expand All @@ -170,4 +168,4 @@ if (process.env.NODE_ENV === 'production') {
)
}

module.exports = rendererConfig
module.exports = rendererConfig
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# my-toy
# mytoy
> a desktop application write by electron
### Preview
![预览图](https://github.com/julyL/toy/tree/master/dist/preview.gif)

### Feature

* 快速搜索
Expand All @@ -27,7 +30,6 @@


#### Build Setup

``` bash
# install dependencies
npm install
Expand Down
Empty file removed dist/electron/.gitkeep
Empty file.
Binary file added dist/preview.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file removed dist/web/.gitkeep
Empty file.
Loading

0 comments on commit dcb02d3

Please sign in to comment.