Skip to content

Commit

Permalink
Modernizes everything.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaubourg committed May 21, 2022
1 parent 46a95dc commit a96f6bd
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 34 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
49 changes: 49 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
on:

push:
branches:
- "**"

pull_request:
branches:
- "**"

jobs:

test:

runs-on: ubuntu-latest

strategy:
matrix:
node-version:
- 14.x
- 16.x
- 18.x

steps:

- name: checkout
uses: actions/checkout@v3

- name: install NodeJS ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: install NPM dependencies
run: npm install

- name: run tests
run: npm run test

- name: compute coverage
if: matrix.node-version == '18.x'
run: npm run coverage

- name: send result to coveralls
if: matrix.node-version == '18.x'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.nyc_output
/node_modules
/*.lcov
/yarn.lock
23 changes: 3 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,8 @@
[![Node Version][node-image]][node-url]
[![License][license-image]][license-url]

[![Build Status][travis-image]][travis-url]
[![Coverage Status][coveralls-image]][coveralls-url]
[![Greenkeeper Status][greenkeeper-image]][greenkeeper-url]

[![Dependencies Status][dependency-image]][dependency-url]
[![devDependencies Status][devDependency-image]][devDependency-url]

[![Code quality][quality-image]][quality-url]
[![Code Style][codestyle-image]][codestyle-url]
[![Test Status][test-image]][test-url]

`@twicpics/url` provides a simple yet expressive fluent API to generate [TwicPics](https://www.twicpics.com) URLs.

Expand Down Expand Up @@ -705,23 +698,13 @@ builder.zoom( 2 );

© [TwicPics](mailto:hello@twic.pics), 2018-2019 – licensed under the [MIT license][license-url].

[codestyle-image]: https://img.shields.io/badge/code%20style-creative--area-brightgreen.svg?style=flat-square
[codestyle-url]: https://github.com/creative-area/eslint-config
[coveralls-image]: https://img.shields.io/coveralls/TwicPics/url.svg?style=flat-square
[coveralls-url]: https://coveralls.io/github/TwicPics/url
[dependency-image]: https://img.shields.io/david/TwicPics/url.svg?style=flat-square
[dependency-url]: https://david-dm.org/TwicPics/url
[devDependency-image]: https://img.shields.io/david/dev/TwicPics/url.svg?style=flat-square
[devDependency-url]: https://david-dm.org/TwicPics/url?type=dev
[greenkeeper-image]: https://badges.greenkeeper.io/TwicPics/url.svg?style=flat-square
[greenkeeper-url]: https://greenkeeper.io/
[license-image]: https://img.shields.io/npm/l/@twicpics/url.svg?style=flat-square
[license-url]: https://raw.githubusercontent.com/TwicPics/url/master/LICENSE
[node-image]: https://img.shields.io/node/v/@twicpics/url.svg?style=flat-square
[node-url]: https://npmjs.org/package/@twicpics/url
[npm-image]: https://img.shields.io/npm/v/@twicpics/url.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@twicpics/url
[quality-image]: https://img.shields.io/lgtm/grade/javascript/g/TwicPics/url.svg?style=flat-square&logo=lgtm&logoWidth=18
[quality-url]: https://lgtm.com/projects/g/TwicPics/url/context:javascript
[travis-image]: https://img.shields.io/travis/TwicPics/url.svg?style=flat-square
[travis-url]: https://travis-ci.org/TwicPics/url
[test-image]: https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Ftwicpics%2Furl%2Fbadge&style=flat-square
[test-url]: https://github.com/twicpics/url/actions
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"author": "TwicPics <hello@twic.pics> (https://www.twicpics.com)",
"dependencies": {
},
"description": "a library to build TwicPics URLs",
"devDependencies": {
"coveralls": "3.1.1",
"eslint": "7.30.0",
"eslint": "8.16.0",
"eslint-config-creative-area": "0.11.1",
"nodeunit": "0.11.1",
"eslint-formatter-codeframe": "7.32.1",
"nodeunit": "0.11.3",
"nyc": "15.1.0"
},
"engines": {
Expand All @@ -26,7 +24,7 @@
"main": "lib/index.js",
"name": "@twicpics/url",
"scripts": {
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov",
"test": "nyc node test"
},
"version": "0.1.1"
Expand Down
19 changes: 11 additions & 8 deletions test/tasks/lint.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
"use strict";

const ESLint = require( `eslint` ).CLIEngine;
const linter = new ESLint();
const report = linter.executeOnFiles( [ `${ __dirname }/../../` ] );
if ( report.errorCount || report.warningCount ) {
console.log( linter.getFormatter( `codeframe` )( report.results ) );
if ( report.errorCount ) {
process.exit( 1 );
const { ESLint } = require( `eslint` );
const formatter = require( `eslint-formatter-codeframe` );

( new ESLint() ).lintFiles( [ `${ __dirname }/../../` ] ).then( report => {
if ( report.errorCount || report.warningCount ) {
console.log( formatter( report.results ) );
if ( report.errorCount ) {
process.exit( 1 );
}
}
}
} );

0 comments on commit a96f6bd

Please sign in to comment.