Compare commits

...

14 Commits

Author SHA1 Message Date
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
Bret Comnes
f13458cc2d 0.0.9 2020-02-13 11:54:18 -07:00
Bret Comnes
5e6f9848c7 chore: update deps 2020-02-13 11:53:43 -07:00
Bret Comnes
fad2c4a165 0.0.8 2020-02-13 11:46:12 -07:00
Bret Comnes
1638c39428 chore: update async-neocities to 1.1.3 2020-02-13 11:45:29 -07:00
Bret Comnes
c50fdeb3e6 0.0.7 2020-02-13 11:39:55 -07:00
Bret Comnes
48d2e5e4e0 refactor: Remove core calls 2020-02-13 11:39:13 -07:00
Bret Comnes
aaf8a90973 0.0.6 2020-02-13 11:29:33 -07:00
Bret Comnes
34601c4927 bug: update async-neocities to 1.1.2 2020-02-13 11:28:52 -07:00
Bret Comnes
ce8f0e70b0 0.0.5 2020-02-13 11:23:24 -07:00
Bret Comnes
22ef26e851 bug: Use correct version of async-neocities 2020-02-13 11:22:49 -07:00
18 changed files with 514 additions and 558 deletions

View File

@@ -7,6 +7,48 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
## [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
- chore: update deps [`5e6f984`](https://github.com/bcomnes/deploy-to-neocities/commit/5e6f9848c78a5f3a668b47a27dc14835005bf98c)
## [v0.0.8](https://github.com/bcomnes/deploy-to-neocities/compare/v0.0.7...v0.0.8) - 2020-02-13
### Commits
- chore: update async-neocities to 1.1.3 [`1638c39`](https://github.com/bcomnes/deploy-to-neocities/commit/1638c394287dcf61bcf439a387dbefc2e68b2128)
## [v0.0.7](https://github.com/bcomnes/deploy-to-neocities/compare/v0.0.6...v0.0.7) - 2020-02-13
### Commits
- refactor: Remove core calls [`48d2e5e`](https://github.com/bcomnes/deploy-to-neocities/commit/48d2e5e4e064176c8c4d27eddea40d0009446dba)
## [v0.0.6](https://github.com/bcomnes/deploy-to-neocities/compare/v0.0.5...v0.0.6) - 2020-02-13
### Commits
- bug: update async-neocities to 1.1.2 [`34601c4`](https://github.com/bcomnes/deploy-to-neocities/commit/34601c49277891d15395a79b28eeb21781a019da)
## [v0.0.5](https://github.com/bcomnes/deploy-to-neocities/compare/v0.0.4...v0.0.5) - 2020-02-13
### Commits
- bug: Use correct version of async-neocities [`22ef26e`](https://github.com/bcomnes/deploy-to-neocities/commit/22ef26e851efa57357d731a73a1f606dc212608a)
## [v0.0.4](https://github.com/bcomnes/deploy-to-neocities/compare/v0.0.3...v0.0.4) - 2020-02-13
### Commits

View File

@@ -2,7 +2,7 @@ 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 () {
@@ -14,17 +14,18 @@ async function doDeploy () {
const client = new Neocities(token)
const stats = await core.group('Deploying to neocities', client.deploy(distDir, {
const stats = await client.deploy(distDir, {
cleanup,
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`)
}
doDeploy().catch(err => {
console.error(err)
core.setFailed(err.message)
})

View File

@@ -7,6 +7,48 @@ 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.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
- bug: fix logging handler logic [`f6c5921`](https://github.com/bcomnes/async-neocities/commit/f6c5921d6fd0a420c5895ed6ba2fe2f766e726fd)
## [v1.1.3](https://github.com/bcomnes/async-neocities/compare/v1.1.2...v1.1.3) - 2020-02-13
### Commits
- refactor: Stop logging progress when the stream has been read. [`3ce0fc4`](https://github.com/bcomnes/async-neocities/commit/3ce0fc452acbbbd28c39b53a3a9a4318a8019c09)
## [v1.1.2](https://github.com/bcomnes/async-neocities/compare/v1.1.1...v1.1.2) - 2020-02-13
### Commits
- bug: Fix export name of statsHandler [`8958e5e`](https://github.com/bcomnes/async-neocities/commit/8958e5eeb947376690a1ce0cefe7cce3d59be5b8)
## [v1.1.1](https://github.com/bcomnes/async-neocities/compare/v1.1.0...v1.1.1) - 2020-02-13
### Commits
- bug: Fix busted export of stats handler. [`510ae29`](https://github.com/bcomnes/async-neocities/commit/510ae293263955e0e34d3ab48df253fb6e093053)
## [v1.1.0](https://github.com/bcomnes/async-neocities/compare/v1.0.2...v1.1.0) - 2020-02-13
### Commits
- feat: Finish statsCb API and add a stats-handler.js function. [`c8e6483`](https://github.com/bcomnes/async-neocities/commit/c8e64835e594e68715ef71590b08baac374052bd)
## [v1.0.2](https://github.com/bcomnes/async-neocities/compare/v1.0.1...v1.0.2) - 2020-02-13
### Commits
- chore: remove total time from stats [`3c375ec`](https://github.com/bcomnes/async-neocities/commit/3c375ecf64ae8536a8e3ccce0a69cd93c8c6a306)
## [v1.0.1](https://github.com/bcomnes/async-neocities/compare/v1.0.0...v1.0.1) - 2020-02-13
### Commits

View File

@@ -185,11 +185,11 @@ Deploy a path to a `directory`, efficiently only uploading missing and changed f
```js
{
cleanup: false // delete orphaned files on neocities that are not in the `directory`
statsCb: () => {} // WIP progress API
statsCb: (stats) => {}
}
```
The return value of this method is subject to change.
For an example of a stats handler, see [lib/stats-handler.js]('./lib/stats-handler.js').
### `client.get(endpoint, [quieries], [opts])`

210
node_modules/async-neocities/index.js generated vendored
View File

@@ -12,6 +12,7 @@ const { neocitiesLocalDiff } = require('./lib/folder-diff')
const pkg = require('./package.json')
const SimpleTimer = require('./lib/timer')
const { getStreamLength, meterStream } = require('./lib/stream-meter')
const statsHandler = require('./lib/stats-handler')
const defaultURL = 'https://neocities.org'
@@ -19,6 +20,7 @@ const defaultURL = 'https://neocities.org'
const START = 'start'
const PROGRESS = 'progress' // progress updates
const STOP = 'stop'
const SKIP = 'skip'
// Progress stages
const INSPECTING = 'inspecting'
const DIFFING = 'diffing'
@@ -55,6 +57,8 @@ class NeocitiesAPIClient {
return fetch(url, opts)
}
static statsHandler (...args) { return statsHandler(...args) }
/**
* Create an async-neocities api client.
* @param {string} apiKey An apiKey to make requests with.
@@ -226,195 +230,73 @@ class NeocitiesAPIClient {
}
const statsCb = opts.statsCb
const startDeployTime = Date.now()
const totalTime = new SimpleTimer(startDeployTime)
const totalTime = new SimpleTimer(Date.now())
// Inspection stage stats initializer
const inspectionStats = {
stage: INSPECTING,
status: START,
timer: new SimpleTimer(startDeployTime),
totalTime,
tasks: {
localScan: {
numberOfFiles: 0,
totalSize: 0,
timer: new SimpleTimer(startDeployTime)
},
remoteScan: {
numberOfFiles: 0,
totalSize: 0,
timer: new SimpleTimer(startDeployTime)
}
}
}
const sendInspectionUpdate = (status) => {
if (status) inspectionStats.status = status
statsCb(inspectionStats)
}
sendInspectionUpdate(START)
// Remote scan timers
const remoteScanJob = this.list()
remoteScanJob.then(({ files }) => { // Comes in the form of a response object
const { tasks: { remoteScan } } = inspectionStats
remoteScan.numberOfFiles = files.length
remoteScan.totalSize = files.reduce((accum, cur) => {
return accum + cur.size || 0
}, 0)
remoteScan.timer.stop()
sendInspectionUpdate(PROGRESS)
})
// Local scan timers and progress accumulator
const localScanJob = progressAccum(
afw.asyncFolderWalker(directory, { shaper: f => f })
)
async function progressAccum (iterator) {
const localFiles = []
const { tasks: { localScan } } = inspectionStats
for await (const file of iterator) {
localFiles.push(file)
localScan.numberOfFiles += 1
localScan.totalSize += file.stat.size
sendInspectionUpdate(PROGRESS)
}
return localFiles
}
localScanJob.then(files => {
const { tasks: { localScan } } = inspectionStats
localScan.timer.stop()
sendInspectionUpdate(PROGRESS)
})
// Inspection stage finalizer
// INSPECTION STAGE
statsCb({ stage: INSPECTING, status: START })
const [localFiles, remoteFiles] = await Promise.all([
localScanJob,
remoteScanJob.then(res => res.files)
afw.allFiles(directory, { shaper: f => f }),
this.list().then(res => res.files)
])
inspectionStats.timer.stop()
sendInspectionUpdate(STOP)
statsCb({ stage: INSPECTING, status: STOP })
// DIFFING STAGE
const diffingStats = {
stage: DIFFING,
status: START,
timer: new SimpleTimer(Date.now()),
totalTime,
tasks: {
diffing: {
uploadCount: 0,
deleteCount: 0,
skipCount: 0
}
}
}
statsCb(diffingStats)
const { tasks: { diffing } } = diffingStats
statsCb({ stage: DIFFING, status: START })
const { filesToUpload, filesToDelete, filesSkipped } = await neocitiesLocalDiff(remoteFiles, localFiles)
statsCb({ stage: DIFFING, status: STOP })
diffingStats.timer.stop()
diffingStats.status = STOP
diffing.uploadCount = filesToUpload.length
diffing.deleteCount = filesToDelete.length
diffing.skipCount = filesSkipped.length
statsCb(diffingStats)
const applyingStartTime = Date.now()
const applyingStats = {
stage: APPLYING,
status: START,
timer: new SimpleTimer(applyingStartTime),
totalTime,
tasks: {
uploadFiles: {
timer: new SimpleTimer(applyingStartTime),
bytesWritten: 0,
totalBytes: 0,
get percent () {
return this.totalBytes === 0 ? 0 : this.bytesWritten / this.totalBytes
},
get speed () {
return this.bytesWritten / this.timer.elapsed
}
},
deleteFiles: {
timer: new SimpleTimer(applyingStartTime),
bytesWritten: 0,
totalBytes: 0,
get percent () {
return this.totalBytes === 0 ? 0 : this.bytesWritten / this.totalBytes
},
get speed () {
return this.bytesWritten / this.timer.elapsed
}
},
skippedFiles: {
count: filesSkipped.length,
size: filesSkipped.reduce((accum, file) => accum + file.stat.size, 0)
}
}
// APPLYING STAGE
if (filesToUpload.length === 0 && (!opts.cleanup || filesToDelete.length === 0)) {
statsCb({ stage: APPLYING, status: SKIP })
return stats()
}
const sendApplyingUpdate = (status) => {
if (status) applyingStats.status = status
statsCb(applyingStats)
}
sendApplyingUpdate(START)
statsCb({ stage: APPLYING, status: START })
const work = []
const { tasks: { uploadFiles, deleteFiles } } = applyingStats
if (filesToUpload.length > 0) {
const uploadJob = this.upload(filesToUpload, {
statsCb: ({ bytesWritten, totalBytes }) => {
uploadFiles.bytesWritten = bytesWritten
uploadFiles.totalBytes = totalBytes
sendApplyingUpdate(PROGRESS)
statsCb ({ totalBytes, bytesWritten }) {
statsCb({
stage: APPLYING,
status: PROGRESS,
complete: false,
totalBytes,
bytesWritten,
get progress () {
return (this.bytesWritten / this.totalBytes) || 0
}
})
}
}).then((_) => {
statsCb({
stage: APPLYING,
status: PROGRESS,
complete: true,
progress: 1.0
})
})
work.push(uploadJob)
uploadJob.then(res => {
uploadFiles.timer.stop()
sendApplyingUpdate(PROGRESS)
})
} else {
uploadFiles.timer.stop()
}
if (opts.cleanup && filesToDelete.length > 0) {
const deleteJob = this.delete(filesToDelete, {
statsCb: ({ bytesWritten, totalBytes }) => {
deleteFiles.bytesWritten = bytesWritten
deleteFiles.totalBytes = totalBytes
sendApplyingUpdate(PROGRESS)
}
})
work.push(deleteJob)
deleteJob.then(res => {
deleteFiles.timer.stop()
sendApplyingUpdate(PROGRESS)
})
} else {
deleteFiles.timer.stop()
work.push(this.delete(filesToDelete))
}
await Promise.all(work)
applyingStats.timer.stop()
sendApplyingUpdate(STOP)
statsCb({ stage: APPLYING, status: STOP })
totalTime.stop()
return stats()
const statsSummary = {
time: totalTime,
inspectionStats,
diffingStats,
applyingStats
function stats () {
totalTime.stop()
return {
time: totalTime.elapsed,
filesToUpload,
filesToDelete,
filesSkipped
}
}
return statsSummary
}
}

60
node_modules/async-neocities/lib/stats-handler.js generated vendored Normal file
View File

@@ -0,0 +1,60 @@
const prettyBytes = require('pretty-bytes')
// Progress API constants
const START = 'start'
const PROGRESS = 'progress' // progress updates
const STOP = 'stop'
const SKIP = 'skip'
function statsHandler (opts = {}) {
let progressInterval
const lastStats = {}
return (stats) => {
switch (stats.status) {
case START: {
console.log(`Starting ${stats.stage} stage...`)
break
}
case STOP: {
console.log(`Finished ${stats.stage} stage.`)
break
}
case SKIP: {
console.log(`Skipping ${stats.stage} stage.`)
break
}
case PROGRESS: {
progressHandler(stats)
break
}
default: {
}
}
}
function progressHandler (stats) {
Object.assign(lastStats, stats)
if (!stats.complete && stats.progress < 1) {
if (!progressInterval) {
progressInterval = setInterval(logProgress, 500, lastStats)
logProgress(lastStats)
}
} else {
if (progressInterval) {
clearInterval(progressInterval)
logProgress(lastStats)
}
}
}
function logProgress (stats) {
let logLine = `Stage ${stats.stage}: ${stats.progress * 100}%`
if (stats.bytesWritten != null && stats.totalBytes != null) {
logLine = logLine + ` (${prettyBytes(stats.bytesWritten)} / ${prettyBytes(stats.totalBytes)})`
}
console.log(logLine)
}
}
module.exports = statsHandler

View File

@@ -1,26 +1,26 @@
{
"_from": "async-neocities@1.0.1",
"_id": "async-neocities@1.0.1",
"_from": "async-neocities@1.1.5",
"_id": "async-neocities@1.1.5",
"_inBundle": false,
"_integrity": "sha512-5TVaKLYKnaHoSiluCP0i78e0CBZbeqBL6bgK8/QsM8YOAtrhd5JO9c5DEaW4SFpmf4wV0qcamQXh0A3C7CANLw==",
"_integrity": "sha512-7EHFjdmPACBQ2prEr7wUQsIi9bVXrD5tpR9PTmDndmZn5U+0uPe6dQxuk+xKI6BLizQVQVKjjODPTI+De5rlTA==",
"_location": "/async-neocities",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "async-neocities@1.0.1",
"raw": "async-neocities@1.1.5",
"name": "async-neocities",
"escapedName": "async-neocities",
"rawSpec": "1.0.1",
"rawSpec": "1.1.5",
"saveSpec": null,
"fetchSpec": "1.0.1"
"fetchSpec": "1.1.5"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/async-neocities/-/async-neocities-1.0.1.tgz",
"_shasum": "3428ae48f48104b205a3537212090b00d9bbce45",
"_spec": "async-neocities@1.0.1",
"_resolved": "https://registry.npmjs.org/async-neocities/-/async-neocities-1.1.5.tgz",
"_shasum": "b9d31cf903ff6253beaf9012201bfae97908436f",
"_spec": "async-neocities@1.1.5",
"_where": "/Users/bret/repos/deploy-to-neocities",
"author": {
"name": "Bret Comnes",
@@ -37,6 +37,7 @@
"form-data": "^3.0.0",
"nanoassert": "^2.0.0",
"node-fetch": "^2.6.0",
"pretty-bytes": "^5.3.0",
"pump": "^3.0.0",
"pumpify": "^2.0.1",
"qs": "^6.9.1",
@@ -79,5 +80,5 @@
"dist"
]
},
"version": "1.0.1"
"version": "1.1.5"
}

15
node_modules/async-neocities/test.js generated vendored
View File

@@ -3,6 +3,7 @@ const tap = require('tap')
const { readFileSync } = require('fs')
const { resolve } = require('path')
const NeocitiesAPIClient = require('.')
const statsHanlder = require('./lib/stats-handler')
let token = process.env.NEOCITIES_API_TOKEN
let fakeToken = false
@@ -87,18 +88,10 @@ if (!fakeToken) {
tap.test('can deploy folders', async t => {
const client = new NeocitiesAPIClient(token)
const statsCb = (stats) => {
let logLine = `${stats.stage} ${stats.status} ${stats.timer.elapsed}`
Object.entries(stats.tasks).forEach(([key, val]) => {
logLine += ` ${key}: ${JSON.stringify(val)}`
})
console.log(logLine)
}
const deployStats = await client.deploy(
resolve(__dirname, 'fixtures'),
{
statsCb,
statsCb: statsHanlder(),
cleanup: false
}
)
@@ -110,7 +103,7 @@ if (!fakeToken) {
const redeployStats = await client.deploy(
resolve(__dirname, 'fixtures'),
{
statsCb,
statsCb: statsHanlder(),
cleanup: false
}
)
@@ -122,7 +115,7 @@ if (!fakeToken) {
const cleanupStats = await client.deploy(
resolve(__dirname, 'fixtures/empty'),
{
statsCb,
statsCb: statsHanlder(),
cleanup: true
}
)

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`

View File

@@ -16,12 +16,12 @@
"fetchSpec": "^5.3.0"
},
"_requiredBy": [
"/"
"/async-neocities"
],
"_resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.3.0.tgz",
"_shasum": "f2849e27db79fb4d6cfe24764fc4134f165989f2",
"_spec": "pretty-bytes@^5.3.0",
"_where": "/Users/bret/repos/deploy-to-neocities",
"_where": "/Users/bret/repos/deploy-to-neocities/node_modules/async-neocities",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",

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": "range",
"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

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