Compare commits

..

14 Commits

Author SHA1 Message Date
Bret Comnes
2ac7b56408 1.0.0 2020-02-17 21:19:33 -07:00
Bret Comnes
3024afb807 docs: add missing example 2020-02-17 21:18:51 -07:00
Bret Comnes
60d959d7ed docs: update logo 2020-02-17 21:14:22 -07:00
Bret Comnes
6d0a96de91 Merge branch 'master' of github.com:bcomnes/deploy-to-neocities 2020-02-17 21:12:54 -07:00
Bret Comnes
da5f527254 docs: Document action, inputs and outputs. 2020-02-17 21:12:06 -07:00
Bret Comnes
6bcb1bafa6 Merge pull request #1 from bcomnes/greenkeeper/initial
Update dependencies to enable Greenkeeper 🌴
2020-02-13 12:20:26 -07:00
Bret Comnes
df9c0b9fe1 Update README.md 2020-02-13 12:19:42 -07:00
greenkeeper[bot]
bcc9d90095 docs(readme): add Greenkeeper badge 2020-02-13 19:16:16 +00:00
greenkeeper[bot]
7092d0c55c chore(package): update dependencies 2020-02-13 19:16:12 +00:00
Bret Comnes
6b86fa30b4 bug: remove extraneous logging 2020-02-13 12:08:54 -07:00
Bret Comnes
74e6c4a57e 0.0.11 2020-02-13 12:05:48 -07:00
Bret Comnes
8b470dbfd8 bug: fix time formatting 2020-02-13 12:05:09 -07:00
Bret Comnes
0dd3a06ef7 0.0.10 2020-02-13 11:59:16 -07:00
Bret Comnes
bf2d333152 chore: deps 2020-02-13 11:58:33 -07:00
20 changed files with 597 additions and 537 deletions

View File

@@ -7,6 +7,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
## [v1.0.0](https://github.com/bcomnes/deploy-to-neocities/compare/v0.0.11...v1.0.0) - 2020-02-18
### Merged
- Update dependencies to enable Greenkeeper 🌴 [`#1`](https://github.com/bcomnes/deploy-to-neocities/pull/1)
### Commits
- docs: Document action, inputs and outputs. [`da5f527`](https://github.com/bcomnes/deploy-to-neocities/commit/da5f52725420f64188f5130c7bb54fda5252e3ec)
- docs: add missing example [`3024afb`](https://github.com/bcomnes/deploy-to-neocities/commit/3024afb80791888e8c0fd04cf23ba6e7560a5f40)
- Update README.md [`df9c0b9`](https://github.com/bcomnes/deploy-to-neocities/commit/df9c0b9fe144eb76092e3998b2013e130756c950)
## [v0.0.11](https://github.com/bcomnes/deploy-to-neocities/compare/v0.0.10...v0.0.11) - 2020-02-13
### Commits
- bug: fix time formatting [`8b470db`](https://github.com/bcomnes/deploy-to-neocities/commit/8b470dbfd876d61b6bd72327952bd1d9b0b49c9b)
## [v0.0.10](https://github.com/bcomnes/deploy-to-neocities/compare/v0.0.9...v0.0.10) - 2020-02-13
### Commits
- chore: deps [`bf2d333`](https://github.com/bcomnes/deploy-to-neocities/commit/bf2d333152be116ec87d35592c8cb9ee4ef6821b)
## [v0.0.9](https://github.com/bcomnes/deploy-to-neocities/compare/v0.0.8...v0.0.9) - 2020-02-13
### Commits

View File

@@ -2,8 +2,75 @@
[![Actions Status](https://github.com/bcomnes/deploy-to-neocities/workflows/tests/badge.svg)](https://github.com/bcomnes/deploy-to-neocities/actions)
<center><img src="logo.png"></center>
Efficiently deploy a website to [Neocities][nc].
### Pre-requisites
Create a workflow `.yml` file in your repositories `.github/workflows` directory. An [example workflow](#example-workflow) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).
Get your sites API token and set a [secret][sec] called `NEOCITIES_API_TOKEN`. Set the `api_token` input on your `deploy-to-neocities` action to `NEOCITIES_API_TOKEN`.
```
https://neocities.org/settings/{{sitename}}#api_key
```
During your workflow, generate the files you want to deploy to [Neocities][nc] into a `distDir` directory. You can use any tools that can be installed or brought into the Github actions environment.
This `dist_dir` should be specified as the `distDir` input. Once the build is complete, the `deploy-to-neocities` action will efficiently upload all new and all changed files to Neocities. Any files on Neocities that don't exist in the `distDir` are considdered 'orphaned' files. To destrucively remove these 'orphaned' files, set the `cleanup` input to `true`.
You most likely only want to run this on the `master` branch so that only changes commited to `master` result in website updates.
### Example workflow
```yaml
name: Deploy to neociteis
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install deps and build
run: |
npm i
npm run build
- name: Deploy to neocities
uses: bcomnes/deploy-to-neocities@v1
with:
api_token: ${{ secrets.NEOCITIES_API_TOKEN }}
cleanup: false
dist_dir: public
```
### Inputs
- `api_token` (**REQUIRED**): The api token for your [Neocities][nc] website to deploy to.
- `dist_dir`: The directory to deploy to [Neocities][nc]. Default: `public`.
- `cleanup`: Boolean string (`true` or `false`). If `true`, `deploy-to-neocities` will destructively delete files found on [Neocoties][nc] not found in your `dist_dir`. Default: `false`.
### Outputs
None.
## See also
- [async-neocities](https://ghub.io/async-neocities): diffing engine used for action.
- [Neocities API Docs](https://neocities.org/api)
- [neocities/neocities-node](https://github.com/neocities/neocities-node): Node api
[qs]: https://ghub.io/qs
[nf]: https://ghub.io/node-fetch
[fd]: https://ghub.io/form-data
[nc]: https://neocities.org
[sec]: https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets

View File

@@ -1,10 +1,10 @@
name: 'Deploy to Neocities'
description: 'Github Action to deplpoy a folder to Neocities.org'
description: 'Efficiently deplpoy a folder to Neocities.org'
branding:
icon: cat
color: yellow
icon: aperture
color: orange
inputs:
apiToken: # api token for site to deploy to
api_token: # api token for site to deploy to
description: 'Neocities API token for site to deploy to'
required: true
distDir:

View File

@@ -2,15 +2,14 @@ const core = require('@actions/core')
// const github = require('@actions/github')
const Neocities = require('async-neocities')
const path = require('path')
const prettyTime = require('pretty-time')
const ms = require('ms')
const assert = require('nanoassert')
async function doDeploy () {
const token = core.getInput('apiToken')
const distDir = path.join(process.cwd(), core.getInput('distDir'))
const token = core.getInput('api_token')
const distDir = path.join(process.cwd(), core.getInput('dist_dir'))
const cleanup = JSON.parse(core.getInput('cleanup'))
assert(typeof cleanup === 'boolean', 'Cleanup input must be a boolean "true" or "false"')
console.log(typeof cleanup)
const client = new Neocities(token)
@@ -19,7 +18,7 @@ async function doDeploy () {
statsCb: Neocities.statsHandler()
})
console.log(`Deployed to Neocities in ${prettyTime([0, stats.time])}:`)
console.log(`Deployed to Neocities in ${ms(stats.time)}:`)
console.log(` Uploaded ${stats.filesToUpload.length} files`)
console.log(` ${cleanup ? 'Deleted' : 'Orphaned'} ${stats.filesToDelete.length} files`)
console.log(` Skipped ${stats.filesSkipped.length} files`)

BIN
logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

View File

@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
## [v1.1.6](https://github.com/bcomnes/async-neocities/compare/v1.1.5...v1.1.6) - 2020-02-13
### Commits
- refactor: limit decimal places in statHandler [`745b5c0`](https://github.com/bcomnes/async-neocities/commit/745b5c08b446723b837cf787e5911045cd0a01ed)
## [v1.1.5](https://github.com/bcomnes/async-neocities/compare/v1.1.4...v1.1.5) - 2020-02-13
### Commits
- bug: Log last stats before clear [`c4c83f8`](https://github.com/bcomnes/async-neocities/commit/c4c83f8e329303404dfec6a2943d8b01783040ad)
## [v1.1.4](https://github.com/bcomnes/async-neocities/compare/v1.1.3...v1.1.4) - 2020-02-13
### Commits

View File

@@ -41,12 +41,15 @@ function statsHandler (opts = {}) {
logProgress(lastStats)
}
} else {
if (progressInterval) clearInterval(progressInterval)
if (progressInterval) {
clearInterval(progressInterval)
logProgress(lastStats)
}
}
}
function logProgress (stats) {
let logLine = `Stage ${stats.stage}: ${stats.progress * 100}%`
let logLine = `Stage ${stats.stage}: ${(stats.progress * 100).toFixed(2)}%`
if (stats.bytesWritten != null && stats.totalBytes != null) {
logLine = logLine + ` (${prettyBytes(stats.bytesWritten)} / ${prettyBytes(stats.totalBytes)})`
}

View File

@@ -1,26 +1,26 @@
{
"_from": "async-neocities@1.1.4",
"_id": "async-neocities@1.1.4",
"_from": "async-neocities@1.1.6",
"_id": "async-neocities@1.1.6",
"_inBundle": false,
"_integrity": "sha512-EpVYipQlIkBGSbZYfnrJYpAhgoYbC2MyWypcMZ+YnPUM1c38WsKGA5QGujX6Rg6gQQKwUUTt/tuYSg8gPQGsSA==",
"_integrity": "sha512-q5fTVttBaN9znGxqxxDAh/ks+bZngIJPu6zPS7nlbJLC9NnOhrcP5Mu0VntxgEBtAuaExyI6uH/C+CxKSW0LeQ==",
"_location": "/async-neocities",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "async-neocities@1.1.4",
"raw": "async-neocities@1.1.6",
"name": "async-neocities",
"escapedName": "async-neocities",
"rawSpec": "1.1.4",
"rawSpec": "1.1.6",
"saveSpec": null,
"fetchSpec": "1.1.4"
"fetchSpec": "1.1.6"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/async-neocities/-/async-neocities-1.1.4.tgz",
"_shasum": "7edb6d8a9ceee4fdc410b562430119619dd31aca",
"_spec": "async-neocities@1.1.4",
"_resolved": "https://registry.npmjs.org/async-neocities/-/async-neocities-1.1.6.tgz",
"_shasum": "405b45565ccbe9c4ea56e65552ae9c48c20a0309",
"_spec": "async-neocities@1.1.6",
"_where": "/Users/bret/repos/deploy-to-neocities",
"author": {
"name": "Bret Comnes",
@@ -80,5 +80,5 @@
"dist"
]
},
"version": "1.1.4"
"version": "1.1.6"
}

162
node_modules/ms/index.js generated vendored Normal file
View File

@@ -0,0 +1,162 @@
/**
* Helpers.
*/
var s = 1000;
var m = s * 60;
var h = m * 60;
var d = h * 24;
var w = d * 7;
var y = d * 365.25;
/**
* Parse or format the given `val`.
*
* Options:
*
* - `long` verbose formatting [false]
*
* @param {String|Number} val
* @param {Object} [options]
* @throws {Error} throw an error if val is not a non-empty string or a number
* @return {String|Number}
* @api public
*/
module.exports = function(val, options) {
options = options || {};
var type = typeof val;
if (type === 'string' && val.length > 0) {
return parse(val);
} else if (type === 'number' && isFinite(val)) {
return options.long ? fmtLong(val) : fmtShort(val);
}
throw new Error(
'val is not a non-empty string or a valid number. val=' +
JSON.stringify(val)
);
};
/**
* Parse the given `str` and return milliseconds.
*
* @param {String} str
* @return {Number}
* @api private
*/
function parse(str) {
str = String(str);
if (str.length > 100) {
return;
}
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
str
);
if (!match) {
return;
}
var n = parseFloat(match[1]);
var type = (match[2] || 'ms').toLowerCase();
switch (type) {
case 'years':
case 'year':
case 'yrs':
case 'yr':
case 'y':
return n * y;
case 'weeks':
case 'week':
case 'w':
return n * w;
case 'days':
case 'day':
case 'd':
return n * d;
case 'hours':
case 'hour':
case 'hrs':
case 'hr':
case 'h':
return n * h;
case 'minutes':
case 'minute':
case 'mins':
case 'min':
case 'm':
return n * m;
case 'seconds':
case 'second':
case 'secs':
case 'sec':
case 's':
return n * s;
case 'milliseconds':
case 'millisecond':
case 'msecs':
case 'msec':
case 'ms':
return n;
default:
return undefined;
}
}
/**
* Short format for `ms`.
*
* @param {Number} ms
* @return {String}
* @api private
*/
function fmtShort(ms) {
var msAbs = Math.abs(ms);
if (msAbs >= d) {
return Math.round(ms / d) + 'd';
}
if (msAbs >= h) {
return Math.round(ms / h) + 'h';
}
if (msAbs >= m) {
return Math.round(ms / m) + 'm';
}
if (msAbs >= s) {
return Math.round(ms / s) + 's';
}
return ms + 'ms';
}
/**
* Long format for `ms`.
*
* @param {Number} ms
* @return {String}
* @api private
*/
function fmtLong(ms) {
var msAbs = Math.abs(ms);
if (msAbs >= d) {
return plural(ms, msAbs, d, 'day');
}
if (msAbs >= h) {
return plural(ms, msAbs, h, 'hour');
}
if (msAbs >= m) {
return plural(ms, msAbs, m, 'minute');
}
if (msAbs >= s) {
return plural(ms, msAbs, s, 'second');
}
return ms + ' ms';
}
/**
* Pluralization helper.
*/
function plural(ms, msAbs, n, name) {
var isPlural = msAbs >= n * 1.5;
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
}

View File

@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2015-present, Jon Schlinkert.
Copyright (c) 2016 Zeit, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

70
node_modules/ms/package.json generated vendored Normal file
View File

@@ -0,0 +1,70 @@
{
"_from": "ms@^2.1.2",
"_id": "ms@2.1.2",
"_inBundle": false,
"_integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
"_location": "/ms",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "ms@^2.1.2",
"name": "ms",
"escapedName": "ms",
"rawSpec": "^2.1.2",
"saveSpec": null,
"fetchSpec": "^2.1.2"
},
"_requiredBy": [
"/",
"/debug"
],
"_resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"_shasum": "d09d1f357b443f493382a8eb3ccd183872ae6009",
"_spec": "ms@^2.1.2",
"_where": "/Users/bret/repos/deploy-to-neocities",
"bugs": {
"url": "https://github.com/zeit/ms/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Tiny millisecond conversion utility",
"devDependencies": {
"eslint": "4.12.1",
"expect.js": "0.3.1",
"husky": "0.14.3",
"lint-staged": "5.0.0",
"mocha": "4.0.1"
},
"eslintConfig": {
"extends": "eslint:recommended",
"env": {
"node": true,
"es6": true
}
},
"files": [
"index.js"
],
"homepage": "https://github.com/zeit/ms#readme",
"license": "MIT",
"lint-staged": {
"*.js": [
"npm run lint",
"prettier --single-quote --write",
"git add"
]
},
"main": "./index",
"name": "ms",
"repository": {
"type": "git",
"url": "git+https://github.com/zeit/ms.git"
},
"scripts": {
"lint": "eslint lib/* bin/*",
"precommit": "lint-staged",
"test": "mocha tests.js"
},
"version": "2.1.2"
}

60
node_modules/ms/readme.md generated vendored Normal file
View File

@@ -0,0 +1,60 @@
# ms
[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms)
[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/zeit)
Use this package to easily convert various time formats to milliseconds.
## Examples
```js
ms('2 days') // 172800000
ms('1d') // 86400000
ms('10h') // 36000000
ms('2.5 hrs') // 9000000
ms('2h') // 7200000
ms('1m') // 60000
ms('5s') // 5000
ms('1y') // 31557600000
ms('100') // 100
ms('-3 days') // -259200000
ms('-1h') // -3600000
ms('-200') // -200
```
### Convert from Milliseconds
```js
ms(60000) // "1m"
ms(2 * 60000) // "2m"
ms(-3 * 60000) // "-3m"
ms(ms('10 hours')) // "10h"
```
### Time Format Written-Out
```js
ms(60000, { long: true }) // "1 minute"
ms(2 * 60000, { long: true }) // "2 minutes"
ms(-3 * 60000, { long: true }) // "-3 minutes"
ms(ms('10 hours'), { long: true }) // "10 hours"
```
## Features
- Works both in [Node.js](https://nodejs.org) and in the browser
- If a number is supplied to `ms`, a string with a unit is returned
- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`)
- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned
## Related Packages
- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time.
## Caught a Bug?
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
2. Link the package to the global module directory: `npm link`
3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms!
As always, you can run the tests using: `npm test`

169
node_modules/pretty-time/README.md generated vendored
View File

@@ -1,169 +0,0 @@
# pretty-time [![NPM version](https://img.shields.io/npm/v/pretty-time.svg?style=flat)](https://www.npmjs.com/package/pretty-time) [![NPM monthly downloads](https://img.shields.io/npm/dm/pretty-time.svg?style=flat)](https://npmjs.org/package/pretty-time) [![NPM total downloads](https://img.shields.io/npm/dt/pretty-time.svg?style=flat)](https://npmjs.org/package/pretty-time) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/pretty-time.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/pretty-time)
> Easily format the time from node.js `process.hrtime`. Works with timescales ranging from weeks to nanoseconds.
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save pretty-time
```
## Usage
```js
var pretty = require('pretty-time');
var start = process.hrtime();
var time = process.hrtime(start);
console.log(pretty(time));
//=> 3μs
```
## API
By default, when no time increment is given as the second argument, the closest timescale is used (e.g. _most granular without being less than zero_).
**Examples:**
```js
pretty([1200708, 795428088]);
//=> '2w'
pretty([800708, 795428088]);
//=> '1w'
pretty([400708, 795428088]);
//=> '5d'
pretty([70708, 795428088]);
//=> '20h'
pretty([12708, 795428088]);
//=> '4h'
pretty([3708, 795428088]);
//=> '1h'
pretty([208, 795428088]);
//=> '3m'
pretty([20, 795428088]);
//=> '21s'
pretty([0, 795428088]);
//=> '795ms'
pretty([0, 000428088]);
//=> '428μs'
pretty([0, 000000088]);
//=> '88ns'
pretty([0, 000000018]);
//=> '18ns'
```
### Minimum time increment
_(All of the following examples use `[6740, 795428088]` as the hrtime array.)_
This value is passed as the second argument and determines how granular to make the time.
**Examples**
```js
pretty(time, 'h');
//=> '2h'
pretty(time, 'm');
//=> '1h 52m'
pretty(time, 's');
//=> '1h 52m 21s'
```
**Valid time increments**
Any of the following may be used:
* `ns` | `nano` | `nanosecond` | `nanoseconds`
* `μs` | `micro` | `microsecond` | `microseconds`
* `ms` | `milli` | `millisecond` | `milliseconds`
* `s` | `sec` | `second` | `seconds`
* `m` | `min` | `minute` | `minutes`
* `h` | `hr` | `hour` | `hours`
* `d` | `day` | `days`
* `w` | `wk` | `week` | `weeks`
## About
<details>
<summary><strong>Contributing</strong></summary>
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
</details>
<details>
<summary><strong>Running Tests</strong></summary>
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
```sh
$ npm install && npm test
```
</details>
<details>
<summary><strong>Building docs</strong></summary>
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
To generate the readme, run the following command:
```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```
</details>
### Related projects
You might also be interested in these projects:
* [o-clock](https://www.npmjs.com/package/o-clock): Simple javascript utility for displaying the time in 12-hour clock format. | [homepage](https://github.com/jonschlinkert/o-clock "Simple javascript utility for displaying the time in 12-hour clock format.")
* [seconds](https://www.npmjs.com/package/seconds): Get the number of seconds for a minute, hour, day and week. | [homepage](https://github.com/jonschlinkert/seconds "Get the number of seconds for a minute, hour, day and week.")
* [time-stamp](https://www.npmjs.com/package/time-stamp): Get a formatted timestamp. | [homepage](https://github.com/jonschlinkert/time-stamp "Get a formatted timestamp.")
* [timescale](https://www.npmjs.com/package/timescale): Convert from one time scale to another. Nanosecond is the most atomic unit, week is… [more](https://github.com/jonschlinkert/timescale) | [homepage](https://github.com/jonschlinkert/timescale "Convert from one time scale to another. Nanosecond is the most atomic unit, week is the largest unit.")
* [week](https://www.npmjs.com/package/week): Get the current week number. | [homepage](https://github.com/datetime/week "Get the current week number.")
* [weekday](https://www.npmjs.com/package/weekday): Get the name and number of the current weekday. Or get the name of the… [more](https://github.com/datetime/weekday) | [homepage](https://github.com/datetime/weekday "Get the name and number of the current weekday. Or get the name of the weekday for a given number.")
* [year](https://www.npmjs.com/package/year): Simple utility to get the current year with 2 or 4 digits. | [homepage](https://github.com/jonschlinkert/year "Simple utility to get the current year with 2 or 4 digits.")
### Contributors
| **Commits** | **Contributor** |
| --- | --- |
| 14 | [jonschlinkert](https://github.com/jonschlinkert) |
| 5 | [doowb](https://github.com/doowb) |
### Author
**Jon Schlinkert**
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
* [GitHub Profile](https://github.com/jonschlinkert)
* [Twitter Profile](https://twitter.com/jonschlinkert)
### License
Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 12, 2018._

56
node_modules/pretty-time/index.js generated vendored
View File

@@ -1,56 +0,0 @@
/*!
* pretty-time <https://github.com/jonschlinkert/pretty-time>
*
* Copyright (c) 2015-2018, present, Jon Schlinkert.
* Released under the MIT License.
*/
'use strict';
const utils = require('./utils');
module.exports = (time, smallest, digits) => {
const isNumber = /^[0-9]+$/.test(time);
if (!isNumber && !Array.isArray(time)) {
throw new TypeError('expected an array or number in nanoseconds');
}
if (Array.isArray(time) && time.length !== 2) {
throw new TypeError('expected an array from process.hrtime()');
}
if (/^[0-9]+$/.test(smallest)) {
digits = smallest;
smallest = null;
}
let num = isNumber ? time : utils.nano(time);
let res = '';
let prev;
for (const uom of Object.keys(utils.scale)) {
const step = utils.scale[uom];
let inc = num / step;
if (smallest && utils.isSmallest(uom, smallest)) {
inc = utils.round(inc, digits);
if (prev && (inc === (prev / step))) --inc;
res += inc + uom;
return res.trim();
}
if (inc < 1) continue;
if (!smallest) {
inc = utils.round(inc, digits);
res += inc + uom;
return res;
}
prev = step;
inc = Math.floor(inc);
num -= (inc * step);
res += inc + uom + ' ';
}
return res.trim();
};

View File

@@ -1,99 +0,0 @@
{
"_from": "pretty-time@1.1.0",
"_id": "pretty-time@1.1.0",
"_inBundle": false,
"_integrity": "sha512-28iF6xPQrP8Oa6uxE6a1biz+lWeTOAPKggvjB8HAs6nVMKZwf5bG++632Dx614hIWgUPkgivRfG+a8uAXGTIbA==",
"_location": "/pretty-time",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "pretty-time@1.1.0",
"name": "pretty-time",
"escapedName": "pretty-time",
"rawSpec": "1.1.0",
"saveSpec": null,
"fetchSpec": "1.1.0"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/pretty-time/-/pretty-time-1.1.0.tgz",
"_shasum": "ffb7429afabb8535c346a34e41873adf3d74dd0e",
"_spec": "pretty-time@1.1.0",
"_where": "/Users/bret/repos/deploy-to-neocities",
"author": {
"name": "Jon Schlinkert",
"url": "https://github.com/jonschlinkert"
},
"bugs": {
"url": "https://github.com/jonschlinkert/pretty-time/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Easily format the time from node.js `process.hrtime`. Works with timescales ranging from weeks to nanoseconds.",
"devDependencies": {
"gulp-format-md": "^1.0.0",
"mocha": "^3.5.3"
},
"engines": {
"node": ">=4"
},
"files": [
"index.js",
"utils.js"
],
"homepage": "https://github.com/jonschlinkert/pretty-time",
"keywords": [
"convert",
"date",
"format",
"formatting",
"hour",
"hrtime",
"micro",
"milli",
"minute",
"nano",
"nanosecond",
"pretty",
"second",
"time",
"week"
],
"license": "MIT",
"main": "index.js",
"name": "pretty-time",
"repository": {
"type": "git",
"url": "git+https://github.com/jonschlinkert/pretty-time.git"
},
"scripts": {
"test": "mocha"
},
"verb": {
"toc": false,
"layout": "default",
"tasks": [
"readme"
],
"plugins": [
"gulp-format-md"
],
"related": {
"list": [
"o-clock",
"seconds",
"time-stamp",
"timescale",
"week",
"weekday",
"year"
]
},
"lint": {
"reflinks": true
}
},
"version": "1.1.0"
}

32
node_modules/pretty-time/utils.js generated vendored
View File

@@ -1,32 +0,0 @@
exports.nano = time => +time[0] * 1e9 + +time[1];
exports.scale = {
'w': 6048e11,
'd': 864e11,
'h': 36e11,
'm': 6e10,
's': 1e9,
'ms': 1e6,
'μs': 1e3,
'ns': 1,
};
exports.regex = {
'w': /^(w((ee)?k)?s?)$/,
'd': /^(d(ay)?s?)$/,
'h': /^(h((ou)?r)?s?)$/,
'm': /^(min(ute)?s?|m)$/,
's': /^((sec(ond)?)s?|s)$/,
'ms': /^(milli(second)?s?|ms)$/,
'μs': /^(micro(second)?s?|μs)$/,
'ns': /^(nano(second)?s?|ns?)$/,
};
exports.isSmallest = function(uom, unit) {
return exports.regex[uom].test(unit);
};
exports.round = function(num, digits) {
const n = Math.abs(num);
return /[0-9]/.test(digits) ? n.toFixed(digits) : Math.round(n);
};

View File

@@ -15,7 +15,7 @@ npm install --save readable-stream
This package is a mirror of the streams implementations in Node.js.
Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v10.18.1/docs/api/stream.html).
Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v10.19.0/docs/api/stream.html).
If you want to guarantee a stable streams base, regardless of what version of
Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).

View File

@@ -6,6 +6,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
var _require = require('buffer'),
Buffer = _require.Buffer;
@@ -22,170 +28,183 @@ module.exports =
/*#__PURE__*/
function () {
function BufferList() {
_classCallCheck(this, BufferList);
this.head = null;
this.tail = null;
this.length = 0;
}
var _proto = BufferList.prototype;
_proto.push = function push(v) {
var entry = {
data: v,
next: null
};
if (this.length > 0) this.tail.next = entry;else this.head = entry;
this.tail = entry;
++this.length;
};
_proto.unshift = function unshift(v) {
var entry = {
data: v,
next: this.head
};
if (this.length === 0) this.tail = entry;
this.head = entry;
++this.length;
};
_proto.shift = function shift() {
if (this.length === 0) return;
var ret = this.head.data;
if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
--this.length;
return ret;
};
_proto.clear = function clear() {
this.head = this.tail = null;
this.length = 0;
};
_proto.join = function join(s) {
if (this.length === 0) return '';
var p = this.head;
var ret = '' + p.data;
while (p = p.next) {
ret += s + p.data;
_createClass(BufferList, [{
key: "push",
value: function push(v) {
var entry = {
data: v,
next: null
};
if (this.length > 0) this.tail.next = entry;else this.head = entry;
this.tail = entry;
++this.length;
}
return ret;
};
_proto.concat = function concat(n) {
if (this.length === 0) return Buffer.alloc(0);
var ret = Buffer.allocUnsafe(n >>> 0);
var p = this.head;
var i = 0;
while (p) {
copyBuffer(p.data, ret, i);
i += p.data.length;
p = p.next;
}, {
key: "unshift",
value: function unshift(v) {
var entry = {
data: v,
next: this.head
};
if (this.length === 0) this.tail = entry;
this.head = entry;
++this.length;
}
return ret;
} // Consumes a specified amount of bytes or characters from the buffered data.
;
_proto.consume = function consume(n, hasStrings) {
var ret;
if (n < this.head.data.length) {
// `slice` is the same for buffers and strings.
ret = this.head.data.slice(0, n);
this.head.data = this.head.data.slice(n);
} else if (n === this.head.data.length) {
// First chunk is a perfect match.
ret = this.shift();
} else {
// Result spans more than one buffer.
ret = hasStrings ? this._getString(n) : this._getBuffer(n);
}, {
key: "shift",
value: function shift() {
if (this.length === 0) return;
var ret = this.head.data;
if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
--this.length;
return ret;
}
}, {
key: "clear",
value: function clear() {
this.head = this.tail = null;
this.length = 0;
}
}, {
key: "join",
value: function join(s) {
if (this.length === 0) return '';
var p = this.head;
var ret = '' + p.data;
return ret;
};
_proto.first = function first() {
return this.head.data;
} // Consumes a specified amount of characters from the buffered data.
;
_proto._getString = function _getString(n) {
var p = this.head;
var c = 1;
var ret = p.data;
n -= ret.length;
while (p = p.next) {
var str = p.data;
var nb = n > str.length ? str.length : n;
if (nb === str.length) ret += str;else ret += str.slice(0, n);
n -= nb;
if (n === 0) {
if (nb === str.length) {
++c;
if (p.next) this.head = p.next;else this.head = this.tail = null;
} else {
this.head = p;
p.data = str.slice(nb);
}
break;
while (p = p.next) {
ret += s + p.data;
}
++c;
return ret;
}
}, {
key: "concat",
value: function concat(n) {
if (this.length === 0) return Buffer.alloc(0);
var ret = Buffer.allocUnsafe(n >>> 0);
var p = this.head;
var i = 0;
this.length -= c;
return ret;
} // Consumes a specified amount of bytes from the buffered data.
;
_proto._getBuffer = function _getBuffer(n) {
var ret = Buffer.allocUnsafe(n);
var p = this.head;
var c = 1;
p.data.copy(ret);
n -= p.data.length;
while (p = p.next) {
var buf = p.data;
var nb = n > buf.length ? buf.length : n;
buf.copy(ret, ret.length - n, 0, nb);
n -= nb;
if (n === 0) {
if (nb === buf.length) {
++c;
if (p.next) this.head = p.next;else this.head = this.tail = null;
} else {
this.head = p;
p.data = buf.slice(nb);
}
break;
while (p) {
copyBuffer(p.data, ret, i);
i += p.data.length;
p = p.next;
}
++c;
return ret;
} // Consumes a specified amount of bytes or characters from the buffered data.
}, {
key: "consume",
value: function consume(n, hasStrings) {
var ret;
if (n < this.head.data.length) {
// `slice` is the same for buffers and strings.
ret = this.head.data.slice(0, n);
this.head.data = this.head.data.slice(n);
} else if (n === this.head.data.length) {
// First chunk is a perfect match.
ret = this.shift();
} else {
// Result spans more than one buffer.
ret = hasStrings ? this._getString(n) : this._getBuffer(n);
}
return ret;
}
}, {
key: "first",
value: function first() {
return this.head.data;
} // Consumes a specified amount of characters from the buffered data.
this.length -= c;
return ret;
} // Make sure the linked list only shows the minimal necessary information.
;
}, {
key: "_getString",
value: function _getString(n) {
var p = this.head;
var c = 1;
var ret = p.data;
n -= ret.length;
_proto[custom] = function (_, options) {
return inspect(this, _objectSpread({}, options, {
// Only inspect one level.
depth: 0,
// It should not recurse.
customInspect: false
}));
};
while (p = p.next) {
var str = p.data;
var nb = n > str.length ? str.length : n;
if (nb === str.length) ret += str;else ret += str.slice(0, n);
n -= nb;
if (n === 0) {
if (nb === str.length) {
++c;
if (p.next) this.head = p.next;else this.head = this.tail = null;
} else {
this.head = p;
p.data = str.slice(nb);
}
break;
}
++c;
}
this.length -= c;
return ret;
} // Consumes a specified amount of bytes from the buffered data.
}, {
key: "_getBuffer",
value: function _getBuffer(n) {
var ret = Buffer.allocUnsafe(n);
var p = this.head;
var c = 1;
p.data.copy(ret);
n -= p.data.length;
while (p = p.next) {
var buf = p.data;
var nb = n > buf.length ? buf.length : n;
buf.copy(ret, ret.length - n, 0, nb);
n -= nb;
if (n === 0) {
if (nb === buf.length) {
++c;
if (p.next) this.head = p.next;else this.head = this.tail = null;
} else {
this.head = p;
p.data = buf.slice(nb);
}
break;
}
++c;
}
this.length -= c;
return ret;
} // Make sure the linked list only shows the minimal necessary information.
}, {
key: custom,
value: function value(_, options) {
return inspect(this, _objectSpread({}, options, {
// Only inspect one level.
depth: 0,
// It should not recurse.
customInspect: false
}));
}
}]);
return BufferList;
}();

View File

@@ -1,8 +1,8 @@
{
"_from": "readable-stream@^3.1.1",
"_id": "readable-stream@3.5.0",
"_id": "readable-stream@3.6.0",
"_inBundle": false,
"_integrity": "sha512-gSz026xs2LfxBPudDuI41V1lka8cxg64E66SGe78zJlsUofOg/yqwezdIcdfwik6B4h8LFmWPA9ef9X3FiNFLA==",
"_integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"_location": "/readable-stream",
"_phantomChildren": {},
"_requested": {
@@ -18,8 +18,8 @@
"_requiredBy": [
"/duplexify"
],
"_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.5.0.tgz",
"_shasum": "465d70e6d1087f6162d079cd0b5db7fbebfd1606",
"_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"_shasum": "337bbda3adc0706bd3e024426a286d4b4b2c9198",
"_spec": "readable-stream@^3.1.1",
"_where": "/Users/bret/repos/deploy-to-neocities/node_modules/duplexify",
"browser": {
@@ -93,5 +93,5 @@
"test-browsers": "airtap --sauce-connect --loopback airtap.local -- test/browser.js",
"update-browser-errors": "babel -o errors-browser.js errors.js"
},
"version": "3.5.0"
"version": "3.6.0"
}

View File

@@ -1,6 +1,6 @@
{
"name": "deploy-to-neocities",
"version": "0.0.9",
"version": "1.0.0",
"description": "Github Action to deplpoy a folder to Neocities.org",
"main": "index.js",
"private": true,
@@ -39,8 +39,8 @@
"dependencies": {
"@actions/core": "1.2.2",
"@actions/github": "2.1.0",
"async-neocities": "1.1.4",
"pretty-time": "1.1.0"
"async-neocities": "1.1.6",
"ms": "^2.1.2"
},
"standard": {
"ignore": [