mirror of
https://github.com/bcomnes/deploy-to-neocities.git
synced 2026-01-21 00:46:29 +00:00
Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3e555927c | ||
|
|
e04c11b5e4 | ||
|
|
990011bf36 | ||
|
|
5dda7b9d7a | ||
|
|
97a3bdd7ff | ||
|
|
86a0fba676 | ||
|
|
b5e74f0efd | ||
|
|
1114060652 | ||
|
|
e00b896343 | ||
|
|
056a8c9940 | ||
|
|
5a689c25d8 | ||
|
|
3f1ce1ffb0 | ||
|
|
969ba2cc61 | ||
|
|
115b9e855f | ||
|
|
6fcd2fe52c | ||
|
|
523524ca70 | ||
|
|
8fae4b2c6c | ||
|
|
c907c30f9c | ||
|
|
c7b4dca027 | ||
|
|
f0f33d7da4 | ||
|
|
69e8a94c47 | ||
|
|
59a102c463 | ||
|
|
4f62bb5b90 | ||
|
|
8f9be808b5 | ||
|
|
53bfeb132c | ||
|
|
853a9a7fe2 | ||
|
|
d98f2e152b | ||
|
|
48b61f22d5 | ||
|
|
fe942e2bfe | ||
|
|
de57ddf5ae | ||
|
|
1f2e44c5ca | ||
|
|
f51969618c | ||
|
|
635243fdea | ||
|
|
9808b8398b | ||
|
|
cec985e2c2 | ||
|
|
90217b6969 |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -30,7 +30,7 @@ jobs:
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
- run: npm i
|
||||
- run: npm test
|
||||
- uses: bcomnes/npm-bump@v2.0.2
|
||||
- uses: bcomnes/npm-bump@v2.1.0
|
||||
with:
|
||||
git_email: bcomnes@gmail.com
|
||||
git_username: ${{ github.actor }}
|
||||
|
||||
57
CHANGELOG.md
57
CHANGELOG.md
@@ -7,7 +7,60 @@ 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.9](https://github.com/bcomnes/deploy-to-neocities/compare/v1.1.8...v1.1.9)
|
||||
## [v1.1.13](https://github.com/bcomnes/deploy-to-neocities/compare/v1.1.12...v1.1.13)
|
||||
|
||||
### Merged
|
||||
|
||||
- chore(deps): bump minimatch from 5.1.1 to 5.1.2 [`#115`](https://github.com/bcomnes/deploy-to-neocities/pull/115)
|
||||
|
||||
### Commits
|
||||
|
||||
- Update example to use actions v3 [`97a3bdd`](https://github.com/bcomnes/deploy-to-neocities/commit/97a3bdd7ff2cb7dd8a61969d6a3a8029d331bd29)
|
||||
- Update README.md [`5dda7b9`](https://github.com/bcomnes/deploy-to-neocities/commit/5dda7b9d7afe5f87039e8bff30d1dd6d5eeb793e)
|
||||
|
||||
## [v1.1.12](https://github.com/bcomnes/deploy-to-neocities/compare/v1.1.11...v1.1.12) - 2022-12-20
|
||||
|
||||
### Merged
|
||||
|
||||
- chore(deps-dev): bump @vercel/ncc from 0.34.0 to 0.36.0 [`#112`](https://github.com/bcomnes/deploy-to-neocities/pull/112)
|
||||
- chore(deps): bump minimatch from 5.1.0 to 5.1.1 [`#111`](https://github.com/bcomnes/deploy-to-neocities/pull/111)
|
||||
|
||||
### Commits
|
||||
|
||||
- Update action to use node 16 [`b5e74f0`](https://github.com/bcomnes/deploy-to-neocities/commit/b5e74f0efddc239968a312e1bae4501d3e84f9a9)
|
||||
- Merge pull request #113 from bcomnes/dependabot/npm_and_yarn/gh-release-7.0.0 [`1114060`](https://github.com/bcomnes/deploy-to-neocities/commit/1114060652dade40eaacdea104051d6e13a096a3)
|
||||
- chore(deps-dev): bump gh-release from 6.0.4 to 7.0.0 [`e00b896`](https://github.com/bcomnes/deploy-to-neocities/commit/e00b89634371d88950fa4f3ec2a8892888bc98e2)
|
||||
|
||||
## [v1.1.11](https://github.com/bcomnes/deploy-to-neocities/compare/v1.1.10...v1.1.11) - 2022-11-07
|
||||
|
||||
### Merged
|
||||
|
||||
- the site is open-source again [`#107`](https://github.com/bcomnes/deploy-to-neocities/pull/107)
|
||||
- info [`#104`](https://github.com/bcomnes/deploy-to-neocities/pull/104)
|
||||
- chore(deps): bump bcomnes/npm-bump from 2.0.2 to 2.1.0 [`#105`](https://github.com/bcomnes/deploy-to-neocities/pull/105)
|
||||
|
||||
### Commits
|
||||
|
||||
- Print error cause no matter what [`8fae4b2`](https://github.com/bcomnes/deploy-to-neocities/commit/8fae4b2c6c1923355b43f7dcfd2efdad7279ffc1)
|
||||
- Update README.md [`c7b4dca`](https://github.com/bcomnes/deploy-to-neocities/commit/c7b4dca027b41fa09bc9d92efa5489238bc98a5a)
|
||||
|
||||
## [v1.1.10](https://github.com/bcomnes/deploy-to-neocities/compare/v1.1.9...v1.1.10) - 2022-10-03
|
||||
|
||||
### Merged
|
||||
|
||||
- chore(deps): bump @actions/core from 1.9.1 to 1.10.0 [`#102`](https://github.com/bcomnes/deploy-to-neocities/pull/102)
|
||||
- the site is open-source again [`#103`](https://github.com/bcomnes/deploy-to-neocities/pull/103)
|
||||
- added notice about my site source code [`#100`](https://github.com/bcomnes/deploy-to-neocities/pull/100)
|
||||
- Update README.md [`#97`](https://github.com/bcomnes/deploy-to-neocities/pull/97)
|
||||
- add conorsheehan1.neocities.org [`#95`](https://github.com/bcomnes/deploy-to-neocities/pull/95)
|
||||
|
||||
### Commits
|
||||
|
||||
- Bump async-neocities to 2.1.3 [`8f9be80`](https://github.com/bcomnes/deploy-to-neocities/commit/8f9be808b5b4f9e1d9a316b391c7c21acfcba3ad)
|
||||
- Merge pull request #96 from bechnokid/patch-1 [`635243f`](https://github.com/bcomnes/deploy-to-neocities/commit/635243fdea7e5d224675222008031a553bc142c3)
|
||||
- Add bechnokid.neocities.org to README.md [`9808b83`](https://github.com/bcomnes/deploy-to-neocities/commit/9808b8398bf70ac8e2a41172c74eb9f66e7d0d89)
|
||||
|
||||
## [v1.1.9](https://github.com/bcomnes/deploy-to-neocities/compare/v1.1.8...v1.1.9) - 2022-08-10
|
||||
|
||||
### Commits
|
||||
|
||||
@@ -110,8 +163,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
||||
|
||||
### Commits
|
||||
|
||||
- Fix static deploy stuff with bandaid [`fea2d47`](https://github.com/bcomnes/deploy-to-neocities/commit/fea2d4780c7a98bcdf5738c1c259d66ff115326a)
|
||||
- Update site build and ncc [`def67b4`](https://github.com/bcomnes/deploy-to-neocities/commit/def67b48c6e28d4544d8dd2bd92ab53f56856e40)
|
||||
- Fix static deploy stuff with bandaid [`fea2d47`](https://github.com/bcomnes/deploy-to-neocities/commit/fea2d4780c7a98bcdf5738c1c259d66ff115326a)
|
||||
|
||||
## [v1.1.1](https://github.com/bcomnes/deploy-to-neocities/compare/v1.1.0...v1.1.1) - 2021-08-20
|
||||
|
||||
|
||||
11
README.md
11
README.md
@@ -29,11 +29,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v3
|
||||
# Set up any tools and build steps here
|
||||
# This example uses a Node.js toolchain to build a site
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: lts/*
|
||||
- name: Install deps and build
|
||||
@@ -113,8 +113,6 @@ None.
|
||||
|
||||
## Sites using deploy-to-neocities
|
||||
|
||||
(Some may be NSFW)
|
||||
|
||||
- https://github.com/bcomnes/bret.io ([bret.io](https://bret.io))
|
||||
- https://github.com/ecomnes/elenacomnes.com ([elenacomnes.comnes](https://elenacomnes.com))
|
||||
- https://github.com/gumcast/gumcast-client ([gumcast.com](https://gumcast.com))
|
||||
@@ -136,8 +134,11 @@ None.
|
||||
- https://andri.dk/blog/2021/deploy-static-websites-anywhere
|
||||
- https://github.com/PersonMeetup/frontiercorps ([frontiercorps.neocities.org](https://frontiercorps.neocities.org/))
|
||||
- https://github.com/riastrad/cyberbspace ([cyberb.space](https://cyberb.space))
|
||||
- https://github.com/lime360/lime360.neocities.org ([lime360.neocities.org](https://lime360.neocities.org/))
|
||||
- https://github.com/rogerahuntley/neocities-site ([stealdog.neocities.org](https://stealdog.neocities.org))
|
||||
- https://github.com/ConorSheehan1/conorsheehan1.neocities.org ([conorsheehan1.neocities.org](https://conorsheehan1.neocities.org))
|
||||
- https://github.com/bechnokid/neocities ([bechnokid.neocities.org](https://bechnokid.neocities.org))
|
||||
- https://github.com/lime360/website ([lime360.neocities.org](https://lime360.neocities.org))
|
||||
- [See more!](https://github.com/bcomnes/deploy-to-neocities/network/dependents)
|
||||
- ...PR your site when you set it up!
|
||||
|
||||
## See also
|
||||
|
||||
@@ -19,5 +19,5 @@ inputs:
|
||||
description: A glob string that prevents matched files from ever being deleted.
|
||||
required: false
|
||||
runs:
|
||||
using: 'node12'
|
||||
using: 'node16'
|
||||
main: 'dist/index.js'
|
||||
|
||||
404
dist/index.js
vendored
404
dist/index.js
vendored
@@ -140,7 +140,6 @@ const file_command_1 = __nccwpck_require__(717);
|
||||
const utils_1 = __nccwpck_require__(5278);
|
||||
const os = __importStar(__nccwpck_require__(2037));
|
||||
const path = __importStar(__nccwpck_require__(1017));
|
||||
const uuid_1 = __nccwpck_require__(5840);
|
||||
const oidc_utils_1 = __nccwpck_require__(8041);
|
||||
/**
|
||||
* The code to exit an action
|
||||
@@ -170,20 +169,9 @@ function exportVariable(name, val) {
|
||||
process.env[name] = convertedVal;
|
||||
const filePath = process.env['GITHUB_ENV'] || '';
|
||||
if (filePath) {
|
||||
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
|
||||
// These should realistically never happen, but just in case someone finds a way to exploit uuid generation let's not allow keys or values that contain the delimiter.
|
||||
if (name.includes(delimiter)) {
|
||||
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
|
||||
}
|
||||
if (convertedVal.includes(delimiter)) {
|
||||
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
|
||||
}
|
||||
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
|
||||
file_command_1.issueCommand('ENV', commandValue);
|
||||
}
|
||||
else {
|
||||
command_1.issueCommand('set-env', { name }, convertedVal);
|
||||
return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
|
||||
}
|
||||
command_1.issueCommand('set-env', { name }, convertedVal);
|
||||
}
|
||||
exports.exportVariable = exportVariable;
|
||||
/**
|
||||
@@ -201,7 +189,7 @@ exports.setSecret = setSecret;
|
||||
function addPath(inputPath) {
|
||||
const filePath = process.env['GITHUB_PATH'] || '';
|
||||
if (filePath) {
|
||||
file_command_1.issueCommand('PATH', inputPath);
|
||||
file_command_1.issueFileCommand('PATH', inputPath);
|
||||
}
|
||||
else {
|
||||
command_1.issueCommand('add-path', {}, inputPath);
|
||||
@@ -241,7 +229,10 @@ function getMultilineInput(name, options) {
|
||||
const inputs = getInput(name, options)
|
||||
.split('\n')
|
||||
.filter(x => x !== '');
|
||||
return inputs;
|
||||
if (options && options.trimWhitespace === false) {
|
||||
return inputs;
|
||||
}
|
||||
return inputs.map(input => input.trim());
|
||||
}
|
||||
exports.getMultilineInput = getMultilineInput;
|
||||
/**
|
||||
@@ -274,8 +265,12 @@ exports.getBooleanInput = getBooleanInput;
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function setOutput(name, value) {
|
||||
const filePath = process.env['GITHUB_OUTPUT'] || '';
|
||||
if (filePath) {
|
||||
return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
|
||||
}
|
||||
process.stdout.write(os.EOL);
|
||||
command_1.issueCommand('set-output', { name }, value);
|
||||
command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
|
||||
}
|
||||
exports.setOutput = setOutput;
|
||||
/**
|
||||
@@ -404,7 +399,11 @@ exports.group = group;
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function saveState(name, value) {
|
||||
command_1.issueCommand('save-state', { name }, value);
|
||||
const filePath = process.env['GITHUB_STATE'] || '';
|
||||
if (filePath) {
|
||||
return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
|
||||
}
|
||||
command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
|
||||
}
|
||||
exports.saveState = saveState;
|
||||
/**
|
||||
@@ -470,13 +469,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.issueCommand = void 0;
|
||||
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
|
||||
// We use any as a valid input type
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
const fs = __importStar(__nccwpck_require__(7147));
|
||||
const os = __importStar(__nccwpck_require__(2037));
|
||||
const uuid_1 = __nccwpck_require__(5840);
|
||||
const utils_1 = __nccwpck_require__(5278);
|
||||
function issueCommand(command, message) {
|
||||
function issueFileCommand(command, message) {
|
||||
const filePath = process.env[`GITHUB_${command}`];
|
||||
if (!filePath) {
|
||||
throw new Error(`Unable to find environment variable for file command ${command}`);
|
||||
@@ -488,7 +488,22 @@ function issueCommand(command, message) {
|
||||
encoding: 'utf8'
|
||||
});
|
||||
}
|
||||
exports.issueCommand = issueCommand;
|
||||
exports.issueFileCommand = issueFileCommand;
|
||||
function prepareKeyValueMessage(key, value) {
|
||||
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
|
||||
const convertedValue = utils_1.toCommandValue(value);
|
||||
// These should realistically never happen, but just in case someone finds a
|
||||
// way to exploit uuid generation let's not allow keys or values that contain
|
||||
// the delimiter.
|
||||
if (key.includes(delimiter)) {
|
||||
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
|
||||
}
|
||||
if (convertedValue.includes(delimiter)) {
|
||||
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
|
||||
}
|
||||
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
|
||||
}
|
||||
exports.prepareKeyValueMessage = prepareKeyValueMessage;
|
||||
//# sourceMappingURL=file-command.js.map
|
||||
|
||||
/***/ }),
|
||||
@@ -1962,6 +1977,7 @@ const fetch = __nccwpck_require__(467)
|
||||
const { URL } = __nccwpck_require__(7310)
|
||||
const qs = __nccwpck_require__(3477)
|
||||
const os = __nccwpck_require__(2037)
|
||||
const { ErrorWithCause } = __nccwpck_require__(702)
|
||||
|
||||
const { neocitiesLocalDiff } = __nccwpck_require__(8140)
|
||||
const pkg = __nccwpck_require__(926)
|
||||
@@ -2162,13 +2178,12 @@ class NeocitiesAPIClient {
|
||||
try {
|
||||
const result = await fetch(url, reqOpts).then(handleResponse)
|
||||
results.push(result)
|
||||
} catch (e) {
|
||||
throw new Error('Neocities API error', {
|
||||
cause: {
|
||||
error: e,
|
||||
results
|
||||
}
|
||||
} catch (err) {
|
||||
const wrappedError = new ErrorWithCause('Neocities API error', {
|
||||
cause: err
|
||||
})
|
||||
wrappedError.results = results
|
||||
throw wrappedError
|
||||
} finally {
|
||||
statsCb({ stage: ERROR, status: STOP })
|
||||
}
|
||||
@@ -2307,14 +2322,13 @@ class NeocitiesAPIClient {
|
||||
|
||||
try {
|
||||
await Promise.all(work)
|
||||
} catch (e) {
|
||||
} catch (err) {
|
||||
// Wrap error with stats so that we don't lose all that context
|
||||
throw new Error('Error uploading files', {
|
||||
cause: {
|
||||
error: e,
|
||||
stats: stats()
|
||||
}
|
||||
const wrappedError = new ErrorWithCause('Error uploading files', {
|
||||
cause: err
|
||||
})
|
||||
wrappedError.stats = stats()
|
||||
throw wrappedError
|
||||
} finally {
|
||||
statsCb({ stage: ERROR, status: STOP })
|
||||
}
|
||||
@@ -2381,7 +2395,7 @@ const crypto = __nccwpck_require__(6113)
|
||||
const util = __nccwpck_require__(3837)
|
||||
const fs = __nccwpck_require__(7147)
|
||||
|
||||
const ppump = util.promisify(__nccwpck_require__(8341))
|
||||
const ppump = util.promisify(__nccwpck_require__(5952))
|
||||
|
||||
/**
|
||||
* neocitiesLocalDiff returns an array of files to delete and update and some useful stats.
|
||||
@@ -2645,7 +2659,7 @@ module.exports = statsHandler
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
const { Writable, Transform } = __nccwpck_require__(5147)
|
||||
const pump = __nccwpck_require__(8341)
|
||||
const pump = __nccwpck_require__(5952)
|
||||
const pumpify = __nccwpck_require__(212)
|
||||
|
||||
async function getStreamsLength (readables) {
|
||||
@@ -4820,6 +4834,7 @@ const EMPTY = ''
|
||||
const SPACE = ' '
|
||||
const ESCAPE = '\\'
|
||||
const REGEX_TEST_BLANK_LINE = /^\s+$/
|
||||
const REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/
|
||||
const REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/
|
||||
const REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/
|
||||
const REGEX_SPLITALL_CRLF = /\r?\n/g
|
||||
@@ -4831,10 +4846,14 @@ const REGEX_SPLITALL_CRLF = /\r?\n/g
|
||||
const REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/
|
||||
|
||||
const SLASH = '/'
|
||||
const KEY_IGNORE = typeof Symbol !== 'undefined'
|
||||
? Symbol.for('node-ignore')
|
||||
/* istanbul ignore next */
|
||||
: 'node-ignore'
|
||||
|
||||
// Do not use ternary expression here, since "istanbul ignore next" is buggy
|
||||
let TMP_KEY_IGNORE = 'node-ignore'
|
||||
/* istanbul ignore else */
|
||||
if (typeof Symbol !== 'undefined') {
|
||||
TMP_KEY_IGNORE = Symbol.for('node-ignore')
|
||||
}
|
||||
const KEY_IGNORE = TMP_KEY_IGNORE
|
||||
|
||||
const define = (object, key, value) =>
|
||||
Object.defineProperty(object, key, {value})
|
||||
@@ -5001,18 +5020,27 @@ const REPLACERS = [
|
||||
: '\\/.+'
|
||||
],
|
||||
|
||||
// intermediate wildcards
|
||||
// normal intermediate wildcards
|
||||
[
|
||||
// Never replace escaped '*'
|
||||
// ignore rule '\*' will match the path '*'
|
||||
|
||||
// 'abc.*/' -> go
|
||||
// 'abc.*' -> skip this rule
|
||||
/(^|[^\\]+)\\\*(?=.+)/g,
|
||||
// 'abc.*' -> skip this rule,
|
||||
// coz trailing single wildcard will be handed by [trailing wildcard]
|
||||
/(^|[^\\]+)(\\\*)+(?=.+)/g,
|
||||
|
||||
// '*.js' matches '.js'
|
||||
// '*.js' doesn't match 'abc'
|
||||
(_, p1) => `${p1}[^\\/]*`
|
||||
(_, p1, p2) => {
|
||||
// 1.
|
||||
// > An asterisk "*" matches anything except a slash.
|
||||
// 2.
|
||||
// > Other consecutive asterisks are considered regular asterisks
|
||||
// > and will match according to the previous rules.
|
||||
const unescaped = p2.replace(/\\\*/g, '[^\\/]*')
|
||||
return p1 + unescaped
|
||||
}
|
||||
],
|
||||
|
||||
[
|
||||
@@ -5123,6 +5151,7 @@ const isString = subject => typeof subject === 'string'
|
||||
const checkPattern = pattern => pattern
|
||||
&& isString(pattern)
|
||||
&& !REGEX_TEST_BLANK_LINE.test(pattern)
|
||||
&& !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern)
|
||||
|
||||
// > A line starting with # serves as a comment.
|
||||
&& pattern.indexOf('#') !== 0
|
||||
@@ -5388,7 +5417,7 @@ module.exports = factory
|
||||
|
||||
// Windows
|
||||
// --------------------------------------------------------------
|
||||
/* istanbul ignore if */
|
||||
/* istanbul ignore if */
|
||||
if (
|
||||
// Detect `process` so that it can run in browsers.
|
||||
typeof process !== 'undefined'
|
||||
@@ -6336,7 +6365,9 @@ minimatch.match = (list, pattern, options = {}) => {
|
||||
|
||||
// replace stuff like \* with *
|
||||
const globUnescape = s => s.replace(/\\(.)/g, '$1')
|
||||
const charUnescape = s => s.replace(/\\([^-\]])/g, '$1')
|
||||
const regExpEscape = s => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
|
||||
const braExpEscape = s => s.replace(/[[\]\\]/g, '\\$&')
|
||||
|
||||
class Minimatch {
|
||||
constructor (pattern, options) {
|
||||
@@ -6422,7 +6453,7 @@ class Minimatch {
|
||||
negateOffset++
|
||||
}
|
||||
|
||||
if (negateOffset) this.pattern = pattern.substr(negateOffset)
|
||||
if (negateOffset) this.pattern = pattern.slice(negateOffset)
|
||||
this.negate = negate
|
||||
}
|
||||
|
||||
@@ -6671,6 +6702,11 @@ class Minimatch {
|
||||
}
|
||||
|
||||
case '\\':
|
||||
if (inClass && pattern.charAt(i + 1) === '-') {
|
||||
re += c
|
||||
continue
|
||||
}
|
||||
|
||||
clearStateChar()
|
||||
escaping = true
|
||||
continue
|
||||
@@ -6783,8 +6819,6 @@ class Minimatch {
|
||||
continue
|
||||
}
|
||||
|
||||
// handle the case where we left a class open.
|
||||
// "[z-a]" is valid, equivalent to "\[z-a\]"
|
||||
// split where the last [ was, make sure we don't have
|
||||
// an invalid re. if so, re-walk the contents of the
|
||||
// would-be class to re-translate any characters that
|
||||
@@ -6794,20 +6828,16 @@ class Minimatch {
|
||||
// to do safely. For now, this is safe and works.
|
||||
cs = pattern.substring(classStart + 1, i)
|
||||
try {
|
||||
RegExp('[' + cs + ']')
|
||||
RegExp('[' + braExpEscape(charUnescape(cs)) + ']')
|
||||
// looks good, finish up the class.
|
||||
re += c
|
||||
} catch (er) {
|
||||
// not a valid class!
|
||||
sp = this.parse(cs, SUBPARSE)
|
||||
re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
|
||||
hasMagic = hasMagic || sp[1]
|
||||
inClass = false
|
||||
continue
|
||||
// out of order ranges in JS are errors, but in glob syntax,
|
||||
// they're just a range that matches nothing.
|
||||
re = re.substring(0, reClassStart) + '(?:$.)' // match nothing ever
|
||||
}
|
||||
|
||||
// finish up the class.
|
||||
hasMagic = true
|
||||
inClass = false
|
||||
re += c
|
||||
continue
|
||||
|
||||
default:
|
||||
@@ -6831,9 +6861,9 @@ class Minimatch {
|
||||
// this is a huge pita. We now have to re-walk
|
||||
// the contents of the would-be class to re-translate
|
||||
// any characters that were passed through as-is
|
||||
cs = pattern.substr(classStart + 1)
|
||||
cs = pattern.slice(classStart + 1)
|
||||
sp = this.parse(cs, SUBPARSE)
|
||||
re = re.substr(0, reClassStart) + '\\[' + sp[0]
|
||||
re = re.substring(0, reClassStart) + '\\[' + sp[0]
|
||||
hasMagic = hasMagic || sp[1]
|
||||
}
|
||||
|
||||
@@ -9033,6 +9063,216 @@ function onceStrict (fn) {
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 702:
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
const { ErrorWithCause } = __nccwpck_require__(8341); // linemod-replace-with: export { ErrorWithCause } from './lib/error-with-cause.mjs';
|
||||
|
||||
const { // linemod-replace-with: export {
|
||||
findCauseByReference,
|
||||
getErrorCause,
|
||||
messageWithCauses,
|
||||
stackWithCauses,
|
||||
} = __nccwpck_require__(7343); // linemod-replace-with: } from './lib/helpers.mjs';
|
||||
|
||||
module.exports = { // linemod-remove
|
||||
ErrorWithCause, // linemod-remove
|
||||
findCauseByReference, // linemod-remove
|
||||
getErrorCause, // linemod-remove
|
||||
stackWithCauses, // linemod-remove
|
||||
messageWithCauses, // linemod-remove
|
||||
}; // linemod-remove
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 8341:
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
/** @template [T=undefined] */
|
||||
class ErrorWithCause extends Error { // linemod-prefix-with: export
|
||||
/**
|
||||
* @param {string} message
|
||||
* @param {{ cause?: T }} options
|
||||
*/
|
||||
constructor (message, { cause } = {}) {
|
||||
super(message);
|
||||
|
||||
/** @type {string} */
|
||||
this.name = ErrorWithCause.name;
|
||||
if (cause) {
|
||||
/** @type {T} */
|
||||
this.cause = cause;
|
||||
}
|
||||
/** @type {string} */
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { // linemod-remove
|
||||
ErrorWithCause, // linemod-remove
|
||||
}; // linemod-remove
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 7343:
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
/**
|
||||
* @template {Error} T
|
||||
* @param {unknown} err
|
||||
* @param {new(...args: any[]) => T} reference
|
||||
* @returns {T|undefined}
|
||||
*/
|
||||
const findCauseByReference = (err, reference) => { // linemod-prefix-with: export
|
||||
if (!err || !reference) return;
|
||||
if (!(err instanceof Error)) return;
|
||||
if (
|
||||
!(reference.prototype instanceof Error) &&
|
||||
// @ts-ignore
|
||||
reference !== Error
|
||||
) return;
|
||||
|
||||
/**
|
||||
* Ensures we don't go circular
|
||||
*
|
||||
* @type {Set<Error>}
|
||||
*/
|
||||
const seen = new Set();
|
||||
|
||||
/** @type {Error|undefined} */
|
||||
let currentErr = err;
|
||||
|
||||
while (currentErr && !seen.has(currentErr)) {
|
||||
seen.add(currentErr);
|
||||
|
||||
if (currentErr instanceof reference) {
|
||||
return currentErr;
|
||||
}
|
||||
|
||||
currentErr = getErrorCause(currentErr);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Error|{ cause?: unknown|(()=>err)}} err
|
||||
* @returns {Error|undefined}
|
||||
*/
|
||||
const getErrorCause = (err) => { // linemod-prefix-with: export
|
||||
if (!err || typeof err !== 'object' || !('cause' in err)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// VError / NError style causes
|
||||
if (typeof err.cause === 'function') {
|
||||
const causeResult = err.cause();
|
||||
|
||||
return causeResult instanceof Error
|
||||
? causeResult
|
||||
: undefined;
|
||||
} else {
|
||||
return err.cause instanceof Error
|
||||
? err.cause
|
||||
: undefined;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Internal method that keeps a track of which error we have already added, to avoid circular recursion
|
||||
*
|
||||
* @private
|
||||
* @param {Error} err
|
||||
* @param {Set<Error>} seen
|
||||
* @returns {string}
|
||||
*/
|
||||
const _stackWithCauses = (err, seen) => {
|
||||
if (!(err instanceof Error)) return '';
|
||||
|
||||
const stack = err.stack || '';
|
||||
|
||||
// Ensure we don't go circular or crazily deep
|
||||
if (seen.has(err)) {
|
||||
return stack + '\ncauses have become circular...';
|
||||
}
|
||||
|
||||
const cause = getErrorCause(err);
|
||||
|
||||
// TODO: Follow up in https://github.com/nodejs/node/issues/38725#issuecomment-920309092 on how to log stuff
|
||||
|
||||
if (cause) {
|
||||
seen.add(err);
|
||||
return (stack + '\ncaused by: ' + _stackWithCauses(cause, seen));
|
||||
} else {
|
||||
return stack;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Error} err
|
||||
* @returns {string}
|
||||
*/
|
||||
const stackWithCauses = (err) => _stackWithCauses(err, new Set()); // linemod-prefix-with: export
|
||||
|
||||
/**
|
||||
* Internal method that keeps a track of which error we have already added, to avoid circular recursion
|
||||
*
|
||||
* @private
|
||||
* @param {Error} err
|
||||
* @param {Set<Error>} seen
|
||||
* @param {boolean} [skip]
|
||||
* @returns {string}
|
||||
*/
|
||||
const _messageWithCauses = (err, seen, skip) => {
|
||||
if (!(err instanceof Error)) return '';
|
||||
|
||||
const message = skip ? '' : (err.message || '');
|
||||
|
||||
// Ensure we don't go circular or crazily deep
|
||||
if (seen.has(err)) {
|
||||
return message + ': ...';
|
||||
}
|
||||
|
||||
const cause = getErrorCause(err);
|
||||
|
||||
if (cause) {
|
||||
seen.add(err);
|
||||
|
||||
const skipIfVErrorStyleCause = 'cause' in err && typeof err.cause === 'function';
|
||||
|
||||
return (message +
|
||||
(skipIfVErrorStyleCause ? '' : ': ') +
|
||||
_messageWithCauses(cause, seen, skipIfVErrorStyleCause));
|
||||
} else {
|
||||
return message;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Error} err
|
||||
* @returns {string}
|
||||
*/
|
||||
const messageWithCauses = (err) => _messageWithCauses(err, new Set()); // linemod-prefix-with: export
|
||||
|
||||
module.exports = { // linemod-remove
|
||||
findCauseByReference, // linemod-remove
|
||||
getErrorCause, // linemod-remove
|
||||
stackWithCauses, // linemod-remove
|
||||
messageWithCauses, // linemod-remove
|
||||
}; // linemod-remove
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5168:
|
||||
@@ -9161,7 +9401,7 @@ module.exports = (number, options) => {
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 8341:
|
||||
/***/ 5952:
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
var once = __nccwpck_require__(1223)
|
||||
@@ -9253,7 +9493,7 @@ module.exports = pump
|
||||
/***/ 212:
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
var pump = __nccwpck_require__(8341)
|
||||
var pump = __nccwpck_require__(5952)
|
||||
var inherits = __nccwpck_require__(4124)
|
||||
var Duplexify = __nccwpck_require__(6599)
|
||||
|
||||
@@ -9318,9 +9558,19 @@ module.exports.ctor = define
|
||||
/***/ }),
|
||||
|
||||
/***/ 5322:
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
module.exports = (typeof process !== 'undefined' && typeof process.nextTick === 'function')
|
||||
? process.nextTick.bind(process)
|
||||
: __nccwpck_require__(1031)
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 1031:
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = process.nextTick.bind(process)
|
||||
module.exports = typeof queueMicrotask === 'function' ? queueMicrotask : (fn) => Promise.resolve().then(fn)
|
||||
|
||||
|
||||
/***/ }),
|
||||
@@ -12713,6 +12963,13 @@ const READ_DONE = 0b0010000000000 << 3
|
||||
const READ_NEXT_TICK = 0b0100000000001 << 3 // also active
|
||||
const READ_NEEDS_PUSH = 0b1000000000000 << 3
|
||||
|
||||
// Combined read state
|
||||
const READ_FLOWING = READ_RESUMED | READ_PIPE_DRAINED
|
||||
const READ_ACTIVE_AND_SYNC = READ_ACTIVE | READ_SYNC
|
||||
const READ_ACTIVE_AND_SYNC_AND_NEEDS_PUSH = READ_ACTIVE | READ_SYNC | READ_NEEDS_PUSH
|
||||
const READ_PRIMARY_AND_ACTIVE = READ_PRIMARY | READ_ACTIVE
|
||||
const READ_EMIT_READABLE_AND_QUEUED = READ_EMIT_READABLE | READ_QUEUED
|
||||
|
||||
const READ_NOT_ACTIVE = MAX ^ READ_ACTIVE
|
||||
const READ_NON_PRIMARY = MAX ^ READ_PRIMARY
|
||||
const READ_NON_PRIMARY_AND_PUSHED = MAX ^ (READ_PRIMARY | READ_NEEDS_PUSH)
|
||||
@@ -12721,7 +12978,7 @@ const READ_PUSHED = MAX ^ READ_NEEDS_PUSH
|
||||
const READ_PAUSED = MAX ^ READ_RESUMED
|
||||
const READ_NOT_QUEUED = MAX ^ (READ_QUEUED | READ_EMITTED_READABLE)
|
||||
const READ_NOT_ENDING = MAX ^ READ_ENDING
|
||||
const READ_PIPE_NOT_DRAINED = MAX ^ (READ_RESUMED | READ_PIPE_DRAINED)
|
||||
const READ_PIPE_NOT_DRAINED = MAX ^ READ_FLOWING
|
||||
const READ_NOT_NEXT_TICK = MAX ^ READ_NEXT_TICK
|
||||
|
||||
// Write state
|
||||
@@ -12751,19 +13008,14 @@ const DESTROY_STATUS = DESTROYING | DESTROYED
|
||||
const OPEN_STATUS = DESTROY_STATUS | OPENING
|
||||
const AUTO_DESTROY = DESTROY_STATUS | DONE
|
||||
const NON_PRIMARY = WRITE_NON_PRIMARY & READ_NON_PRIMARY
|
||||
const TICKING = (WRITE_NEXT_TICK | READ_NEXT_TICK) & NOT_ACTIVE
|
||||
const ACTIVE_OR_TICKING = ACTIVE | TICKING
|
||||
const ACTIVE_OR_TICKING = WRITE_NEXT_TICK | READ_NEXT_TICK
|
||||
const TICKING = ACTIVE_OR_TICKING & NOT_ACTIVE
|
||||
const IS_OPENING = OPEN_STATUS | TICKING
|
||||
|
||||
// Combined read state
|
||||
// Combined shared state and read state
|
||||
const READ_PRIMARY_STATUS = OPEN_STATUS | READ_ENDING | READ_DONE
|
||||
const READ_STATUS = OPEN_STATUS | READ_DONE | READ_QUEUED
|
||||
const READ_FLOWING = READ_RESUMED | READ_PIPE_DRAINED
|
||||
const READ_ACTIVE_AND_SYNC = READ_ACTIVE | READ_SYNC
|
||||
const READ_ACTIVE_AND_SYNC_AND_NEEDS_PUSH = READ_ACTIVE | READ_SYNC | READ_NEEDS_PUSH
|
||||
const READ_PRIMARY_AND_ACTIVE = READ_PRIMARY | READ_ACTIVE
|
||||
const READ_ENDING_STATUS = OPEN_STATUS | READ_ENDING | READ_QUEUED
|
||||
const READ_EMIT_READABLE_AND_QUEUED = READ_EMIT_READABLE | READ_QUEUED
|
||||
const READ_READABLE_STATUS = OPEN_STATUS | READ_EMIT_READABLE | READ_QUEUED | READ_EMITTED_READABLE
|
||||
const SHOULD_NOT_READ = OPEN_STATUS | READ_ACTIVE | READ_ENDING | READ_DONE | READ_NEEDS_PUSH
|
||||
const READ_BACKPRESSURE_STATUS = DESTROY_STATUS | READ_ENDING | READ_DONE
|
||||
@@ -13640,6 +13892,10 @@ function isStreamx (stream) {
|
||||
return typeof stream._duplexState === 'number' && isStream(stream)
|
||||
}
|
||||
|
||||
function getStreamError (stream) {
|
||||
return (stream._readableState && stream._readableState.error) || (stream._writableState && stream._writableState.error)
|
||||
}
|
||||
|
||||
function isReadStreamx (stream) {
|
||||
return isStreamx(stream) && stream.readable
|
||||
}
|
||||
@@ -13663,6 +13919,7 @@ module.exports = {
|
||||
pipelinePromise,
|
||||
isStream,
|
||||
isStreamx,
|
||||
getStreamError,
|
||||
Stream,
|
||||
Writable,
|
||||
Readable,
|
||||
@@ -17293,7 +17550,7 @@ Object.defineProperty(exports, '__esModule', {value: true}).default = assert
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = JSON.parse('{"name":"async-neocities","description":"WIP - nothing to see here","version":"2.1.2","author":"Bret Comnes <bcomnes@gmail.com> (https://bret.io)","bugs":{"url":"https://github.com/bcomnes/async-neocities/issues"},"dependencies":{"async-folder-walker":"^2.0.1","fetch-errors":"^2.0.1","form-data":"^4.0.0","lodash.chunk":"^4.2.0","nanoassert":"^2.0.0","node-fetch":"^2.6.0","pretty-bytes":"^5.3.0","pump":"^3.0.0","pumpify":"^2.0.1","streamx":"^2.6.0"},"devDependencies":{"auto-changelog":"^2.2.0","dependency-check":"^4.1.0","gh-release":"^6.0.0","minimatch":"^5.0.0","npm-run-all":"^4.1.5","standard":"^17.0.0","tap":"^16.0.0"},"homepage":"https://github.com/bcomnes/async-neocities","keywords":["neocities","async","api client","static hosting"],"license":"MIT","main":"index.js","repository":{"type":"git","url":"https://github.com/bcomnes/async-neocities.git"},"scripts":{"prepublishOnly":"git push --follow-tags && gh-release -y","test":"run-s test:*","test:deps":"dependency-check . --no-dev --no-peer","test:standard":"standard","test:tape":"tap --no-check-coverage","version":"auto-changelog -p --template keepachangelog auto-changelog --breaking-pattern \'BREAKING CHANGE:\' && git add CHANGELOG.md"},"standard":{"ignore":["dist"]}}');
|
||||
module.exports = JSON.parse('{"name":"async-neocities","description":"WIP - nothing to see here","version":"2.1.4","author":"Bret Comnes <bcomnes@gmail.com> (https://bret.io)","bugs":{"url":"https://github.com/bcomnes/async-neocities/issues"},"dependencies":{"async-folder-walker":"^2.0.1","fetch-errors":"^2.0.1","form-data":"^4.0.0","lodash.chunk":"^4.2.0","nanoassert":"^2.0.0","node-fetch":"^2.6.0","pony-cause":"^2.1.4","pretty-bytes":"^5.3.0","pump":"^3.0.0","pumpify":"^2.0.1","streamx":"^2.6.0"},"devDependencies":{"auto-changelog":"^2.2.0","dependency-check":"^4.1.0","gh-release":"^6.0.0","minimatch":"^5.0.0","npm-run-all":"^4.1.5","standard":"^17.0.0","tap":"^16.0.0"},"homepage":"https://github.com/bcomnes/async-neocities","keywords":["neocities","async","api client","static hosting"],"license":"MIT","main":"index.js","repository":{"type":"git","url":"https://github.com/bcomnes/async-neocities.git"},"scripts":{"prepublishOnly":"git push --follow-tags && gh-release -y","test":"run-s test:*","test:deps":"dependency-check . --no-dev --no-peer","test:standard":"standard","test:tape":"tap --no-check-coverage","version":"auto-changelog -p --template keepachangelog auto-changelog --breaking-pattern \'BREAKING CHANGE:\' && git add CHANGELOG.md"},"standard":{"ignore":["dist"]}}');
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -17362,6 +17619,7 @@ const ms = __nccwpck_require__(900)
|
||||
const assert = (__nccwpck_require__(3094)["default"])
|
||||
const fsp = (__nccwpck_require__(7147).promises)
|
||||
const minimatch = __nccwpck_require__(3973)
|
||||
const { stackWithCauses } = __nccwpck_require__(702)
|
||||
|
||||
let cleanup
|
||||
|
||||
@@ -17397,7 +17655,7 @@ async function doDeploy () {
|
||||
}
|
||||
|
||||
doDeploy().catch(err => {
|
||||
console.error(err)
|
||||
console.error(stackWithCauses(err))
|
||||
if (err.stats) {
|
||||
console.log('Files to upload: ')
|
||||
console.dir(err.stats.filesToUpload, { colors: true, depth: 999 })
|
||||
|
||||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
3
index.js
3
index.js
@@ -6,6 +6,7 @@ const ms = require('ms')
|
||||
const assert = require('webassert').default
|
||||
const fsp = require('fs').promises
|
||||
const minimatch = require('minimatch')
|
||||
const { stackWithCauses } = require('pony-cause')
|
||||
|
||||
let cleanup
|
||||
|
||||
@@ -41,7 +42,7 @@ async function doDeploy () {
|
||||
}
|
||||
|
||||
doDeploy().catch(err => {
|
||||
console.error(err)
|
||||
console.error(stackWithCauses(err))
|
||||
if (err.stats) {
|
||||
console.log('Files to upload: ')
|
||||
console.dir(err.stats.filesToUpload, { colors: true, depth: 999 })
|
||||
|
||||
13
package.json
13
package.json
@@ -1,25 +1,26 @@
|
||||
{
|
||||
"name": "deploy-to-neocities",
|
||||
"description": "Github Action to deplpoy a folder to Neocities.org",
|
||||
"version": "1.1.9",
|
||||
"version": "1.1.13",
|
||||
"author": "Bret Comnes <bcomnes@gmail.com> (https://bret.io/)",
|
||||
"bugs": {
|
||||
"url": "https://github.com/bcomnes/deploy-to-neocities/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "1.9.1",
|
||||
"async-neocities": "2.1.2",
|
||||
"minimatch": "5.1.0",
|
||||
"@actions/core": "1.10.0",
|
||||
"async-neocities": "2.1.4",
|
||||
"minimatch": "5.1.2",
|
||||
"ms": "2.1.3",
|
||||
"pony-cause": "^2.1.4",
|
||||
"webassert": "3.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@siteup/cli": "^2.0.0",
|
||||
"@vercel/ncc": "^0.34.0",
|
||||
"@vercel/ncc": "^0.36.0",
|
||||
"auto-changelog": "^2.0.0",
|
||||
"browser-sync": "^2.27.7",
|
||||
"dependency-check": "^4.1.0",
|
||||
"gh-release": "^6.0.0",
|
||||
"gh-release": "^7.0.0",
|
||||
"mkdirp": "^1.0.4",
|
||||
"npm-run-all2": "^6.0.0",
|
||||
"standard": "^17.0.0"
|
||||
|
||||
Reference in New Issue
Block a user