Skip to content

Commit

Permalink
Migrate to github actions, upgrade min es version and remove bower
Browse files Browse the repository at this point in the history
  • Loading branch information
sagiegurari committed May 11, 2020
1 parent 110f8f2 commit abd4703
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

var commons = require('js-project-commons');
const commons = require('js-project-commons');

module.exports = commons.lint.eslint.web;
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Fixed a bug or just want to provided additional functionality?<br>
Simply fork this repository, implement your changes and create a pull request.<br>
Few guidelines regarding pull requests:

* This repository is integrated with travis.ci for continuous integration.<br>
* This repository is integrated with github actions for continuous integration.<br>

Your pull request build must pass (the build will run automatically).<br>
You can run the following command locally to ensure the build will pass:
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI
on: [push, pull_request]
env:
CLICOLOR_FORCE: 1
jobs:
ci:
name: CI
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install
uses: ianwalter/puppeteer@v2.0.0
with:
args: npm install
- name: Run CI
uses: ianwalter/puppeteer@v2.0.0
with:
args: npm test
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: './target/coverage/report/lcov.info'
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*eslint-disable no-underscore-dangle*/

module.exports = function (grunt) {
var commons = require('js-project-commons');
const commons = require('js-project-commons');

commons.grunt.config.initConfig(grunt, {
buildConfig: {
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# angular-web-notification

[![NPM Version](http://img.shields.io/npm/v/angular-web-notification.svg?style=flat)](https://www.npmjs.org/package/angular-web-notification) [![Build Status](https://travis-ci.org/sagiegurari/angular-web-notification.svg)](http://travis-ci.org/sagiegurari/angular-web-notification) [![Coverage Status](https://coveralls.io/repos/sagiegurari/angular-web-notification/badge.svg)](https://coveralls.io/r/sagiegurari/angular-web-notification) [![Known Vulnerabilities](https://snyk.io/test/github/sagiegurari/angular-web-notification/badge.svg)](https://snyk.io/test/github/sagiegurari/angular-web-notification) [![Inline docs](http://inch-ci.org/github/sagiegurari/angular-web-notification.svg?branch=master)](http://inch-ci.org/github/sagiegurari/angular-web-notification) [![License](https://img.shields.io/npm/l/angular-web-notification.svg?style=flat)](https://github.com/sagiegurari/angular-web-notification/blob/master/LICENSE)
[![NPM Version](http://img.shields.io/npm/v/angular-web-notification.svg?style=flat)](https://www.npmjs.org/package/angular-web-notification) [![CI](https://github.com/sagiegurari/angular-web-notification/workflows/CI/badge.svg?branch=master)](https://github.com/sagiegurari/angular-web-notification/actions) [![Coverage Status](https://coveralls.io/repos/sagiegurari/angular-web-notification/badge.svg)](https://coveralls.io/r/sagiegurari/angular-web-notification) [![Known Vulnerabilities](https://snyk.io/test/github/sagiegurari/angular-web-notification/badge.svg)](https://snyk.io/test/github/sagiegurari/angular-web-notification) [![Inline docs](http://inch-ci.org/github/sagiegurari/angular-web-notification.svg?branch=master)](http://inch-ci.org/github/sagiegurari/angular-web-notification) [![License](https://img.shields.io/npm/l/angular-web-notification.svg?style=flat)](https://github.com/sagiegurari/angular-web-notification/blob/master/LICENSE)

> Web Notifications AngularJS Service
Expand Down Expand Up @@ -153,6 +153,7 @@ See [contributing guide](.github/CONTRIBUTING.md)

| Date | Version | Description |
| ----------- | ------- | ----------- |
| 2020-05-11 | v2.0.0 | Migrate to github actions, upgrade minimal node version and remove bower |
| 2019-02-08 | v1.2.31 | Maintenance |
| 2017-08-25 | v1.2.24 | Document support of service worker web notifications |
| 2017-01-22 | v1.2.0 | Split the internal web notification API into a new project: simple-web-notification |
Expand Down
4 changes: 2 additions & 2 deletions angular-web-notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
(function initWebNotification(webNotificationAPI) {
'use strict';

var webNotification = window.angular.module('angular-web-notification', []);
const webNotification = window.angular.module('angular-web-notification', []);

/**
* @ngdoc service
Expand Down Expand Up @@ -97,7 +97,7 @@
* });
* ```
*/
var showNotification = webNotificationAPI.showNotification;
const showNotification = webNotificationAPI.showNotification;

if (showNotification) {
return webNotificationAPI;
Expand Down
37 changes: 0 additions & 37 deletions bower.json

This file was deleted.

1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
| Date | Version | Description |
| ----------- | ------- | ----------- |
| 2020-05-11 | v2.0.0 | Migrate to github actions, upgrade minimal node version and remove bower |
| 2019-02-08 | v1.2.31 | Maintenance |
| 2017-08-25 | v1.2.24 | Document support of service worker web notifications |
| 2017-01-22 | v1.2.0 | Split the internal web notification API into a new project: simple-web-notification |
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-web-notification",
"version": "1.2.31",
"version": "2.0.0",
"description": "AngularJS service for displaying web notifications.",
"author": {
"name": "Sagie Gur-Ari",
Expand Down Expand Up @@ -42,14 +42,17 @@
}
},
"dependencies": {
"angular": "^1",
"simple-web-notification": "latest"
},
"devDependencies": {
"angular-mocks": "^1",
"chai": "latest",
"grunt": "latest",
"grunt-cli": "latest",
"grunt-karma": "latest",
"husky": "latest",
"jquery": "latest",
"js-project-commons": "latest",
"karma": "latest",
"karma-chrome-launcher": "latest",
Expand Down
2 changes: 1 addition & 1 deletion project/config/README-template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# {"gitdown": "gitinfo", "name": "name"}

[![NPM Version](http://img.shields.io/npm/v/{"gitdown": "gitinfo", "name": "name"}.svg?style=flat)](https://www.npmjs.org/package/{"gitdown": "gitinfo", "name": "name"}) [![Build Status](https://travis-ci.org/{"gitdown": "gitinfo", "name": "username"}/{"gitdown": "gitinfo", "name": "name"}.svg)](http://travis-ci.org/{"gitdown": "gitinfo", "name": "username"}/{"gitdown": "gitinfo", "name": "name"}) [![Coverage Status](https://coveralls.io/repos/{"gitdown": "gitinfo", "name": "username"}/{"gitdown": "gitinfo", "name": "name"}/badge.svg)](https://coveralls.io/r/{"gitdown": "gitinfo", "name": "username"}/{"gitdown": "gitinfo", "name": "name"}) [![Known Vulnerabilities](https://snyk.io/test/github/{"gitdown": "gitinfo", "name": "username"}/{"gitdown": "gitinfo", "name": "name"}/badge.svg)](https://snyk.io/test/github/{"gitdown": "gitinfo", "name": "username"}/{"gitdown": "gitinfo", "name": "name"}) [![Inline docs](http://inch-ci.org/github/{"gitdown": "gitinfo", "name": "username"}/{"gitdown": "gitinfo", "name": "name"}.svg?branch=master)](http://inch-ci.org/github/{"gitdown": "gitinfo", "name": "username"}/{"gitdown": "gitinfo", "name": "name"}) [![License](https://img.shields.io/npm/l/{"gitdown": "gitinfo", "name": "name"}.svg?style=flat)](https://github.com/{"gitdown": "gitinfo", "name": "username"}/{"gitdown": "gitinfo", "name": "name"}/blob/master/LICENSE)
[![NPM Version](http://img.shields.io/npm/v/{"gitdown": "gitinfo", "name": "name"}.svg?style=flat)](https://www.npmjs.org/package/{"gitdown": "gitinfo", "name": "name"}) [![CI](https://github.com/{"gitdown": "gitinfo", "name": "username"}/{"gitdown": "gitinfo", "name": "name"}/workflows/CI/badge.svg?branch=master)](https://github.com/{"gitdown": "gitinfo", "name": "username"}/{"gitdown": "gitinfo", "name": "name"}/actions) [![Coverage Status](https://coveralls.io/repos/{"gitdown": "gitinfo", "name": "username"}/{"gitdown": "gitinfo", "name": "name"}/badge.svg)](https://coveralls.io/r/{"gitdown": "gitinfo", "name": "username"}/{"gitdown": "gitinfo", "name": "name"}) [![Known Vulnerabilities](https://snyk.io/test/github/{"gitdown": "gitinfo", "name": "username"}/{"gitdown": "gitinfo", "name": "name"}/badge.svg)](https://snyk.io/test/github/{"gitdown": "gitinfo", "name": "username"}/{"gitdown": "gitinfo", "name": "name"}) [![Inline docs](http://inch-ci.org/github/{"gitdown": "gitinfo", "name": "username"}/{"gitdown": "gitinfo", "name": "name"}.svg?branch=master)](http://inch-ci.org/github/{"gitdown": "gitinfo", "name": "username"}/{"gitdown": "gitinfo", "name": "name"}) [![License](https://img.shields.io/npm/l/{"gitdown": "gitinfo", "name": "name"}.svg?style=flat)](https://github.com/{"gitdown": "gitinfo", "name": "username"}/{"gitdown": "gitinfo", "name": "name"}/blob/master/LICENSE)

> Web Notifications AngularJS Service
Expand Down
1 change: 1 addition & 0 deletions project/config/jshintrc-common.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"bitwise": true,
"curly": true,
"eqeqeq": true,
"esversion": 6,
"forin": true,
"freeze": true,
"futurehostile": true,
Expand Down
12 changes: 6 additions & 6 deletions project/config/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
module.exports = function (config) {
'use strict';

var mainJSFile = require('../../bower.json').main;
var commons = require('js-project-commons');
const mainJSFile = require('../../package.json').main;
const commons = require('js-project-commons');

commons.tools.karma(config, {
files: [
'bower_components/jquery/dist/jquery.js',
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'**/jquery/dist/jquery.js',
'**/angular/angular.js',
'**/angular-mocks/angular-mocks.js',
'test/helpers/**/*.js',
'bower_components/simple-web-notification/web-notification.js',
'**/simple-web-notification/web-notification.js',
mainJSFile,
'test/spec/**/*.js'
]
Expand Down
2 changes: 1 addition & 1 deletion stylelint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

var commons = require('js-project-commons');
const commons = require('js-project-commons');

module.exports = commons.lint.stylelint;
10 changes: 5 additions & 5 deletions test/helpers/notify-mock.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
window.Notification = (function Notification() {
'use strict';

var permissionInfo = {
const permissionInfo = {
value: null
};

var oncePermission;
let oncePermission;

var Lib = function (title, options) {
const Lib = function (title, options) {
Lib.validateNotification(title, options);

var self = this;
const self = this;
self.close = function () {
if (options.onClick) {
self.onclick();
Expand All @@ -22,7 +22,7 @@ window.Notification = (function Notification() {

Object.defineProperty(Lib, 'permission', {
enumerable: true,
get: function () {
get() {
return permissionInfo.value;
}
});
Expand Down
8 changes: 4 additions & 4 deletions test/spec/angular-web-notification-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
describe('angular-web-notification', function () {
'use strict';

var validShowValidation = function (error, hide, done) {
const validShowValidation = function (error, hide, done) {
assert.isNull(error);
assert.isFunction(hide);

Expand All @@ -14,7 +14,7 @@ describe('angular-web-notification', function () {
}
};

var errorValidation = function (error, hide, done) {
const errorValidation = function (error, hide, done) {
assert.isDefined(error);
assert.isNull(hide);
done();
Expand All @@ -23,10 +23,10 @@ describe('angular-web-notification', function () {
beforeEach(window.angular.mock.module('angular-web-notification'));

it('library not defined test', inject(function ($injector) {
var showNotification = window.webNotification.showNotification;
const showNotification = window.webNotification.showNotification;
delete window.webNotification.showNotification;

var errorDetected = false;
let errorDetected = false;
try {
$injector.get('webNotification').$get();
} catch (error) {
Expand Down

0 comments on commit abd4703

Please sign in to comment.