Skip to content

Commit

Permalink
chore: modernize tooling, because modern tooling is so metal
Browse files Browse the repository at this point in the history
BREAKING CHANGE: require Node.js 12 or above because running EOL or
very-soon-to-be-EOL runtimes is not metal
  • Loading branch information
Trott committed Oct 18, 2020
1 parent 7e47d41 commit 4e5d0fb
Show file tree
Hide file tree
Showing 12 changed files with 20,604 additions and 285 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Code scanning - action"

on:
push:
pull_request:
schedule:
- cron: '0 7 * * 5'

jobs:
CodeQL-Build:

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
31 changes: 31 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
env:
CI: true
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release
on:
push:
branches:
- master
jobs:
release:
name: Release
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install dependencies
run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
coverage/
node_modules/
1 change: 0 additions & 1 deletion .jshintignore

This file was deleted.

13 changes: 0 additions & 13 deletions .jshintrc

This file was deleted.

3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

20 changes: 10 additions & 10 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env node
'use strict';
var meow = require('meow');
var metal = require('./');
'use strict'
var meow = require('meow')
var metal = require('./')

meow({
help: [
'Examples',
' $ metal-name',
' Desecrated Glory'
].join('\n')
});
help: [
'Examples',
' $ metal-name',
' Desecrated Glory'
].join('\n')
})

console.log(metal());
console.log(metal())
14 changes: 7 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict';
var words = require('./words.json');
var sample = require('lodash.sample');
'use strict'
var words = require('./words.json')
var sample = require('lodash.sample')

module.exports = function (options = {}) {
if (! options.fragment) {
return `${sample(words.start)} ${sample(words.end)}`;
if (!options.fragment) {
return `${sample(words.start)} ${sample(words.end)}`
}
return sample(words[options.fragment]);
};
return sample(words[options.fragment])
}
Loading

0 comments on commit 4e5d0fb

Please sign in to comment.