Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore!: Normalize repository, dropping node <10.13 support #3

Merged
merged 3 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: dev
on:
pull_request:
push:
branches:
- master
- main
env:
CI: true

jobs:
prettier:
name: Format code
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Prettier
uses: gulpjs/prettier_action@v3.0
with:
commit_message: 'chore: Run prettier'
prettier_options: '--write .'

test:
name: Tests for Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node: [10, 12, 14, 16]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Set Node.js version
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}

- run: node --version
- run: npm --version

- name: Install npm dependencies
run: npm install

- name: Run lint
run: npm run lint

- name: Run tests
run: npm test

- name: Coveralls
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: ${{matrix.os}}-node-${{ matrix.node }}
parallel: true

coveralls:
needs: test
name: Finish up

runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: release
on:
push:
branches:
- master
- main

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
package-name: release-please-action
46 changes: 39 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,64 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# Commenting this out is preferred by some people, see
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules
# Dependency directories
node_modules/
jspm_packages/

# Users Environment Variables
.lock-wscript
# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# Garbage files
.DS_Store
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage/
.nyc_output/
CHANGELOG.md
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2018 Tyler Kellen <tyler@sleekcode.net>, Blaine Bublitz <blaine.bublitz@gmail.com>, and Eric Schoffstall <yo@contra.io>
Copyright (c) 2014-2018, 2022 Tyler Kellen <tyler@sleekcode.net>, Blaine Bublitz <blaine.bublitz@gmail.com>, and Eric Schoffstall <yo@contra.io>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# hacker

[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Gitter chat][gitter-image]][gitter-url]
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]

Hack on your project easily. A [liftoff](https://github.com/gulpjs/liftoff) proof-of-concept.

Expand Down Expand Up @@ -45,15 +45,14 @@ To run:

MIT

[downloads-image]: http://img.shields.io/npm/dm/hacker.svg
[npm-url]: https://www.npmjs.com/package/hacker
[npm-image]: http://img.shields.io/npm/v/hacker.svg
<!-- prettier-ignore-start -->
[downloads-image]: https://img.shields.io/npm/dm/$PROJECT_NAME.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/$PROJECT_NAME
[npm-image]: https://img.shields.io/npm/v/$PROJECT_NAME.svg?style=flat-square

[travis-url]: https://travis-ci.org/gulpjs/hacker
[travis-image]: http://img.shields.io/travis/gulpjs/hacker.svg?label=travis-ci
[ci-url]: https://github.com/gulpjs/$PROJECT_NAME/actions?query=workflow:dev
[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/$PROJECT_NAME/dev?style=flat-square

[appveyor-url]: https://ci.appveyor.com/project/gulpjs/hacker
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/hacker.svg?label=appveyor

[gitter-url]: https://gitter.im/gulpjs/gulp
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg
[coveralls-url]: https://coveralls.io/r/gulpjs/$PROJECT_NAME
[coveralls-image]: https://img.shields.io/coveralls/gulpjs/$PROJECT_NAME/master.svg?style=flat-square
<!-- prettier-ignore-end -->
26 changes: 0 additions & 26 deletions appveyor.yml

This file was deleted.

57 changes: 36 additions & 21 deletions bin/hacker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env node
var Liftoff = require('liftoff');
var argv = require('minimist')(process.argv.slice(2));
var minimist = require('minimist');

var argv = minimist(process.argv.slice(2));

var Hacker = new Liftoff({
name: 'hacker',
Expand All @@ -12,24 +14,35 @@ var Hacker = new Liftoff({
// supported by interpret. e.g. coffee-script / livescript, etc
v8flags: ['--harmony'], // to support all flags: require('v8flags')
// ^ respawn node with any flag listed here
}).on('require', function(name, module) {
console.log('Loading:', name);
}).on('requireFail', function(name, err) {
console.log('Unable to load:', name, err);
}).on('respawn', function(flags, child) {
console.log('Detected node flags:', flags);
console.log('Respawned to PID:', child.pid);
});

Hacker.launch({
cwd: argv.cwd,
configPath: argv.hackerfile,
require: argv.require,
completion: argv.completion,
verbose: argv.verbose,
}, invoke);

function invoke(env) {
})
.on('loader:success', function (name, module) {
console.log('Loaded:', name);
})
.on('loader:failure', function (name, err) {
console.log('Unable to load:', name);
if (argv.verbose) {
console.error(err);
}
})
.on('respawn', function (flags, child) {
console.log('Detected node flags:', flags);
console.log('Respawned to PID:', child.pid);
});

Hacker.prepare(
{
cwd: argv.cwd,
configPath: argv.hackerfile,
preload: argv.preload,
completion: argv.completion,
},
function (env) {
Hacker.execute(env, invoke);
}
);

function invoke(env, argv) {
argv = minimist(argv);

if (argv.verbose) {
console.log('LIFTOFF SETTINGS:', this);
Expand All @@ -50,13 +63,15 @@ function invoke(env) {
}

if (!env.modulePath) {
console.log('Local ', Hacker.moduleName, ' module not found in: ', env.cwd);
console.log(
'Local ' + Hacker.moduleName + ' module not found in: ' + env.cwd
);
process.exit(1);
}

if (env.configPath) {
require(env.configPath);
} else {
console.log('No ', Hacker.configName, ' found.');
console.log('No ' + Hacker.configName + ' found.');
}
}
29 changes: 21 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"name": "hacker",
"version": "1.2.0",
"description": "Hack on your project easily. A liftoff proof-of-concept.",
"author": "Gulp Team <team@gulpjs.com> (http://gulpjs.com/)",
"author": "Gulp Team <team@gulpjs.com> (https://gulpjs.com/)",
"contributors": [
"Tyler Kellen <tyler@sleekcode.net>",
"Blaine Bublitz <blaine.bublitz@gmail.com>"
],
"repository": "gulpjs/hacker",
"license": "MIT",
"engines": {
"node": ">= 0.10"
"node": ">=10.13.0"
},
"main": "index.js",
"bin": {
Expand All @@ -23,16 +23,29 @@
],
"scripts": {
"lint": "eslint .",
"test": "npm run lint"
"test": "nyc mocha --async-only"
},
"dependencies": {
"interpret": "~0.4.1",
"liftoff": "~2.0.0",
"minimist": "~1.1.0"
"interpret": "^3.1.1",
"liftoff": "^4.0.0",
"minimist": "^1.2.6"
},
"devDependencies": {
"eslint": "^2.13.0",
"eslint-config-gulp": "^3.0.1"
"eslint": "^7.0.0",
"eslint-config-gulp": "^5.0.0",
"eslint-plugin-node": "^11.1.0",
"expect": "^27.0.0",
"mocha": "^8.0.0",
"nyc": "^15.0.0"
},
"nyc": {
"reporter": [
"lcov",
"text-summary"
]
},
"prettier": {
"singleQuote": true
},
"keywords": [
"proof of concept",
Expand Down
Empty file added test/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions test/hackerfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('Hackerfile loaded');
Loading