Skip to content

Commit

Permalink
refactor: Convert all codebase to typescript (#2)
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
We're using a named export in Typescript now:
```diff
- var menubar = require('menubar');
+ var { menubar } = require('menubar');
```

Alternatively, using ES6/TS syntax:
```javascript
import { menubar } from 'menubar';
```
  • Loading branch information
amaury1093 authored Mar 23, 2019
1 parent ccbda25 commit 820d41a
Show file tree
Hide file tree
Showing 15 changed files with 3,678 additions and 198 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
node_modules
lib
dist
*.app
*.log
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
language: node_js
node_js:
- '0.12'
- '10'
2 changes: 1 addition & 1 deletion example/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const menubar = require('@amaurymartiny/menubar');
const { menubar } = require('..');

const mb = menubar();

Expand Down
3 changes: 0 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
"build": "electron-builder",
"start": "electron ."
},
"dependencies": {
"@amaurymartiny/menubar": "file:.."
},
"devDependencies": {
"electron-builder": "^20.39.0",
"electron-prebuilt": "^1.4.13"
Expand Down
16 changes: 0 additions & 16 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
resolved "https://registry.yarnpkg.com/7zip-bin/-/7zip-bin-4.1.0.tgz#33eff662a5c39c0c2061170cc003c5120743fff0"
integrity sha512-AsnBZN3a8/JcNt+KPkGGODaA4c7l3W5+WpeKgGSbstSLxqWtTXqd1ieJGBQ8IFCtRg8DmmKUcSkIkUc0A4p3YA==

"@amaurymartiny/menubar@file:..":
version "5.2.3"
dependencies:
electron-positioner "^3.0.0"
extend "^2.0.0"

ajv-keywords@^3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.0.tgz#4b831e7b531415a7cc518cd404e73f6193c6349d"
Expand Down Expand Up @@ -544,11 +538,6 @@ electron-osx-sign@0.4.11:
minimist "^1.2.0"
plist "^3.0.1"

electron-positioner@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/electron-positioner/-/electron-positioner-3.0.1.tgz#e699400c2d634ad19352cf20202e92b92b96accb"
integrity sha512-zQsnNzJB2PY6KEcGFXAoW6iIKtZ+3nbpVozKN7jhdRdRHMFpEpGufwcfrKhnEBBwrfHpyFQgU+p5jkteLIV+Jg==

electron-prebuilt@^1.4.13:
version "1.4.13"
resolved "https://registry.yarnpkg.com/electron-prebuilt/-/electron-prebuilt-1.4.13.tgz#0a0e4d7bf895a242061ccfab29394dcda1da33d2"
Expand Down Expand Up @@ -630,11 +619,6 @@ execa@^1.0.0:
signal-exit "^3.0.0"
strip-eof "^1.0.0"

extend@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/extend/-/extend-2.0.2.tgz#1b74985400171b85554894459c978de6ef453ab7"
integrity sha512-AgFD4VU+lVLP6vjnlNfF7OeInLTyeyckCNPEsuxz1vi786UuK/nk6ynPuhn/h+Ju9++TQyr5EpLRI14fc1QtTQ==

extend@~3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
Expand Down
157 changes: 0 additions & 157 deletions index.js

This file was deleted.

41 changes: 26 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@amaurymartiny/menubar",
"version": "5.2.3",
"description": "high level way to create menubar desktop applications with electron",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/maxogden/menubar.git"
},
"scripts": {
"test": "standard"
"author": "max ogden",
"bugs": {
"url": "https://github.com/amaurymartiny/menubar/issues"
},
"contributors": [
"Amaury Martiny <amaury.martiny@protonmail.com>"
],
"description": "high level way to create menubar desktop applications with electron",
"homepage": "https://github.com/amaurymartiny/menubar",
"keywords": [
"electron",
"atom",
Expand All @@ -19,17 +19,28 @@
"mac",
"app"
],
"author": "max ogden",
"license": "BSD-2-Clause",
"bugs": {
"url": "https://github.com/maxogden/menubar/issues"
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "https://github.com/amaurymartiny/menubar.git"
},
"types": "lib/index.d.ts",
"scripts": {
"prebuild": "rimraf lib/",
"build": "tsc",
"lint": "tslint --project .",
"test": "echo skipped for now."
},
"homepage": "https://github.com/maxogden/menubar",
"dependencies": {
"electron-positioner": "^3.0.0",
"extend": "^2.0.0"
"electron-positioner": "^4.1.0"
},
"devDependencies": {
"standard": "^5.4.1"
"electron": "^4.1.1",
"rimraf": "^2.6.3",
"standard": "^5.4.1",
"tslint": "^5.14.0",
"tslint-config-semistandard": "^7.0.0",
"typescript": "^3.3.4000"
}
}
10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ npm install menubar --save
create a JS program like this:

```js
var menubar = require('menubar')
var menubar = require('menubar');

var mb = menubar()
var mb = menubar();

mb.on('ready', function ready () {
console.log('app is ready')
mb.on('ready', function ready() {
console.log('app is ready');
// your app code here
})
});
```

make sure there is also a `index.html` file in `dir`
Expand Down
1 change: 1 addition & 0 deletions src/ambient.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module 'electron-positioner';
Loading

0 comments on commit 820d41a

Please sign in to comment.