Skip to content

Commit

Permalink
Add electron app directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Tolu Oluwagbemi committed Aug 23, 2022
1 parent 3fdba2f commit bf00cc3
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/**
dist/**
public/**
*.DS_Store
1 change: 1 addition & 0 deletions main.js → app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ app.setLoginItemSettings({
});

// app.dock.hide();

21 changes: 21 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "Menu-todo",
"title": "Menu Todo",
"version": "1.0.0",
"description": "Todo on macOS menu bar",
"main": "app/main.js",
"keywords": [
"menu",
"bar",
"todo"
],
"author": "Tolu Oluwagbemi",
"license": "MIT",
"bugs": {
"url": "https://github.com/tulburg/menu-todo/issues"
},
"dependencies": {
"electron-store": "^8.1.0",
"electron-util": "^0.17.2"
}
}
1 change: 1 addition & 0 deletions tray-generator.js → app/tray-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ class TrayGenerator {
}

module.exports = TrayGenerator;

12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
"title": "Menu Todo",
"version": "1.0.0",
"description": "Todo on macOS menu bar",
"main": "main.js",
"main": "app/main.js",
"scripts": {
"start": "webpack serve --config webpack.config.js",
"build": "tsc",
"deploy": "webpack --config webpack.config.js && electron-builder -c electron-builder.env",
"test": "npx jest"
},
"postinstall": "electron-builder install-app-deps",
"repository": {
"type": "git",
"url": "git+https://github.com/tulburg/menu-todo.git"
Expand All @@ -34,8 +35,6 @@
"@types/webpack-env": "^1.17.0",
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.7.1",
"electron-store": "^8.1.0",
"electron-util": "^0.17.2",
"html-loader": "^4.1.0",
"html-webpack-plugin": "^5.5.0",
"path-browserify": "^1.0.1",
Expand All @@ -45,7 +44,9 @@
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.3",
"webpack-hot-middleware": "^2.25.1"
"webpack-hot-middleware": "^2.25.1",
"electron-store": "^8.1.0",
"electron-util": "^0.17.2"
},
"devDependencies": {
"copy-webpack-plugin": "^5.1.2",
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import App from "./app";
import Theme from './theme';
export default {
theme: Theme,
// useHash: true,
useHash: true,
routes: [
{ path: '/', name: 'App', component: App }
]
Expand Down
9 changes: 5 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ module.exports = {
inject: true
}),
new CopyPlugin([
{ from: 'main.js', to: '../' }
{ from: 'public', to: path.resolve(__dirname, 'public/') },
{ from: 'assets', to: path.resolve(__dirname, 'app/assets/') }
])
],
resolve: {
Expand All @@ -28,12 +29,12 @@ module.exports = {
extensions: ['.ts', '.tsx', '.js', '.jsx']
},
output: {
path: path.resolve(__dirname, 'public'),
path: path.resolve(__dirname, 'app/public'),
filename: 'app.js',
library: 'js-native',
libraryTarget: 'umd',
publicPath: '/'
// publicPath: '../public/'
// publicPath: '/'
publicPath: 'public/'
},
module: {
rules: [
Expand Down

0 comments on commit bf00cc3

Please sign in to comment.