hugo-extended
Advanced tools
Comparing version 0.64.1 to 0.65.0
@@ -8,5 +8,3 @@ #!/usr/bin/env node | ||
const input = process.argv.slice(2); | ||
spawn(hugo, input, { stdio: 'inherit' }) | ||
spawn(hugo, process.argv.slice(2), { stdio: 'inherit' }) | ||
.on('exit', process.exit); |
'use strict'; | ||
module.exports = require('./lib')(process.cwd()).path(); | ||
module.exports = require('./lib').path(); |
@@ -10,20 +10,23 @@ 'use strict'; | ||
// Default to extended Hugo, fall back to vanilla Hugo on unsupported platforms | ||
const hugoBin = new binWrapper() | ||
// eslint-disable-next-line new-cap | ||
module.exports = new binWrapper() | ||
.src(`${baseUrl}hugo_extended_${hugoVersion}_Linux-64bit.tar.gz`, 'linux', 'x64') | ||
.src(`${baseUrl}hugo_extended_${hugoVersion}_macOS-64bit.tar.gz`, 'darwin', 'x64') | ||
.src(`${baseUrl}hugo_extended_${hugoVersion}_Windows-64bit.zip`, 'win32', 'x64') | ||
.src(`${baseUrl}hugo_${hugoVersion}_FreeBSD-32bit.tar.gz`, 'freebsd', 'x86') | ||
.src(`${baseUrl}hugo_${hugoVersion}_FreeBSD-64bit.tar.gz`, 'freebsd', 'x64') | ||
.src(`${baseUrl}hugo_${hugoVersion}_FreeBSD-ARM.tar.gz`, 'freebsd', 'arm') | ||
.src(`${baseUrl}hugo_${hugoVersion}_Linux-32bit.tar.gz`, 'linux', 'x86') | ||
.src(`${baseUrl}hugo_${hugoVersion}_Linux-ARM.tar.gz`, 'linux', 'arm') | ||
.src(`${baseUrl}hugo_${hugoVersion}_Linux-ARM64.tar.gz`, 'linux', 'arm64') | ||
.src(`${baseUrl}hugo_${hugoVersion}_macOS-32bit.tar.gz`, 'darwin', 'x86') | ||
.src(`${baseUrl}hugo_${hugoVersion}_Windows-32bit.zip`, 'win32', 'x86') | ||
.src(`${baseUrl}hugo_${hugoVersion}_FreeBSD-64bit.tar.gz`, 'freebsd', 'x64') | ||
.src(`${baseUrl}hugo_${hugoVersion}_FreeBSD-32bit.tar.gz`, 'freebsd', 'x86') | ||
.src(`${baseUrl}hugo_${hugoVersion}_FreeBSD-ARM.tar.gz`, 'freebsd', 'arm') | ||
.src(`${baseUrl}hugo_${hugoVersion}_NetBSD-64bit.tar.gz`, 'netbsd', 'x64') | ||
.src(`${baseUrl}hugo_${hugoVersion}_NetBSD-32bit.tar.gz`, 'netbsd', 'x86') | ||
.src(`${baseUrl}hugo_${hugoVersion}_NetBSD-ARM.tar.gz`, 'netbsd', 'arm') | ||
.src(`${baseUrl}hugo_${hugoVersion}_OpenBSD-64bit.tar.gz`, 'openbsd', 'x64') | ||
.src(`${baseUrl}hugo_${hugoVersion}_OpenBSD-32bit.tar.gz`, 'openbsd', 'x86') | ||
.src(`${baseUrl}hugo_${hugoVersion}_OpenBSD-ARM.tar.gz`, 'openbsd', 'arm') | ||
.src(`${baseUrl}hugo_${hugoVersion}_DragonFlyBSD-64bit.tar.gz`, 'dragonflybsd', 'x64') | ||
.dest(path.join(__dirname, '../vendor')) | ||
.use(process.platform === 'win32' ? 'hugo.exe' : 'hugo'); | ||
// TODO: download checksums.txt file and validate package integrity | ||
module.exports = function () { | ||
return hugoBin; | ||
}; |
'use strict'; | ||
const path = require('path'); | ||
const bin = require('.'); | ||
function getProjectRoot() { | ||
// `projectRoot` on postinstall could be INIT_CWD introduced in npm >= 5.4 | ||
// see: https://github.com/npm/npm/issues/16990 | ||
const initCwd = process.env.INIT_CWD; | ||
if (initCwd) | ||
return initCwd; | ||
// Fallback of getting INIT_CWD | ||
const cwd = process.cwd(); | ||
const paths = cwd.split(path.sep); | ||
// If `process.cwd` ends with 'node_modules/*' then get the dependent root directory, | ||
// otherwise return the `cwd` (ordinary it will be the postinstall process of hugo-bin itself). | ||
if (paths.length > 1 && paths[paths.length - 2] === 'node_modules') | ||
return path.resolve('../../', cwd); | ||
return cwd; | ||
} | ||
bin(getProjectRoot()).run(['version']) | ||
.then(() => { | ||
console.log('✔ Hugo installed successfully!'); | ||
}) | ||
.catch(error => { | ||
console.error('✖ ERROR: Hugo installation failed. :(\n', error); | ||
}); | ||
bin.run(['version']).then(() => { | ||
console.log('✔ Hugo installed successfully!'); | ||
}).catch(error => { | ||
console.error('✖ ERROR: Hugo installation failed. :(\n', error); | ||
}); |
{ | ||
"name": "hugo-extended", | ||
"version": "0.64.1", | ||
"hugoVersion": "0.64.1", | ||
"version": "0.65.0", | ||
"hugoVersion": "0.65.0", | ||
"description": "Plug-and-play binary wrapper for Hugo Extended, the awesomest static-site generator.", | ||
@@ -29,18 +29,15 @@ "homepage": "https://github.com/jakejarvis/hugo-extended#readme", | ||
"dependencies": { | ||
"bin-wrapper": "^4.1.0", | ||
"rimraf": "^3.0.1" | ||
"bin-wrapper": "^4.1.0" | ||
}, | ||
"devDependencies": { | ||
"bin-check": "^4.1.0", | ||
"eslint": "^6.8.0", | ||
"mocha": "^7.0.1" | ||
"mocha": "*", | ||
"xo": "*" | ||
}, | ||
"scripts": { | ||
"eslint": "eslint .", | ||
"mocha": "mocha", | ||
"test": "npm run eslint && npm run mocha", | ||
"postinstall": "rimraf vendor && node lib/install" | ||
"postinstall": "node lib/install.js", | ||
"test": "xo && mocha" | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
"node": ">=10" | ||
}, | ||
@@ -55,19 +52,13 @@ "files": [ | ||
}, | ||
"eslintConfig": { | ||
"extends": "eslint:recommended", | ||
"env": { | ||
"es6": true, | ||
"node": true | ||
}, | ||
"xo": { | ||
"envs": [ | ||
"es6", | ||
"node" | ||
], | ||
"space": true, | ||
"rules": { | ||
"prefer-destructuring": [ | ||
"error", | ||
{ | ||
"object": true, | ||
"array": false | ||
} | ||
], | ||
"strict": "error" | ||
"object-curly-spacing": "off", | ||
"promise/prefer-await-to-then": "warn" | ||
} | ||
} | ||
} |
@@ -1,6 +0,6 @@ | ||
# <img src="https://raw.githubusercontent.com/gohugoio/gohugoioTheme/master/static/images/hugo-logo-wide.svg?sanitize=true" alt="Hugo" width="115"> via NPM [![CI status](https://github.com/jakejarvis/hugo-extended/workflows/Run%20tests/badge.svg)](https://github.com/jakejarvis/hugo-extended/actions) [![npm](https://img.shields.io/npm/v/hugo-extended?color=red)](https://www.npmjs.com/package/hugo-extended) [![Hugo v0.64.1](https://img.shields.io/badge/Hugo-v0.64.1-orange)](https://github.com/gohugoio/hugo) [![Dependabot](https://api.dependabot.com/badges/status?host=github&repo=jakejarvis/hugo-extended)](https://github.com/jakejarvis/hugo-extended/pulls?q=is%3Apr+label%3Adependencies) | ||
# <img src="https://raw.githubusercontent.com/gohugoio/gohugoioTheme/master/static/images/hugo-logo-wide.svg?sanitize=true" alt="Hugo" width="115"> via NPM [![CI status](https://github.com/jakejarvis/hugo-extended/workflows/Run%20tests/badge.svg)](https://github.com/jakejarvis/hugo-extended/actions) [![npm](https://img.shields.io/npm/v/hugo-extended?color=red)](https://www.npmjs.com/package/hugo-extended) [![Hugo v0.65.0](https://img.shields.io/badge/Hugo-v0.65.0-orange)](https://github.com/gohugoio/hugo) [![Dependabot](https://api.dependabot.com/badges/status?host=github&repo=jakejarvis/hugo-extended)](https://github.com/jakejarvis/hugo-extended/pulls?q=is%3Apr+label%3Adependencies) | ||
> Plug-and-play binary wrapper for [Hugo Extended](https://gohugo.io/), the awesomest static-site generator. | ||
## Install | ||
## Installation | ||
@@ -13,9 +13,11 @@ ```sh | ||
`hugo-extended` defaults to the [extended version](https://gohugo.io/getting-started/installing/#linux) of Hugo on [supported platforms](https://github.com/gohugoio/hugo/releases), and falls back to vanilla Hugo automatically if unsupported. | ||
`hugo-extended` defaults to the [extended version](https://gohugo.io/troubleshooting/faq/#i-get-tocss--this-feature-is-not-available-in-your-current-hugo-version) of Hugo on [supported platforms](https://github.com/gohugoio/hugo/releases), and automatically falls back to vanilla Hugo if unsupported (mainly on 32-bit systems). | ||
This package's version numbers align with Hugo's — `hugo-extended@0.64.1` installs Hugo v0.64.1, for example. | ||
## Usage | ||
See the [Hugo Documentation](https://gohugo.io/documentation/) for additional functionality. | ||
The following examples simply refer to executing Hugo as a local Node dependency. See the [official Hugo docs](https://gohugo.io/documentation/) for guidance on actual Hugo usage. | ||
### package.json | ||
### via CLI / `package.json`: | ||
@@ -26,4 +28,3 @@ ```json | ||
"build": "hugo", | ||
"start": "hugo serve", | ||
"create": "hugo new" | ||
"start": "hugo server --buildDrafts --buildFuture --port 1313" | ||
} | ||
@@ -33,20 +34,25 @@ } | ||
#### CLI: | ||
```bash | ||
$ npm start | ||
```sh | ||
$(npm bin)/hugo --help | ||
npm run create -- post/my-new-post.md | ||
``` | ||
Building sites … | ||
or on Windows: | ||
| EN | ||
-------------------+------ | ||
Pages | 50 | ||
Paginator pages | 0 | ||
Non-page files | 138 | ||
Static files | 39 | ||
Processed images | 63 | ||
Aliases | 0 | ||
Sitemaps | 1 | ||
Cleaned | 0 | ||
```bat | ||
for /f "delims=" %F in ('npm bin') do call "%F\hugo" help | ||
npm run create -- post/my-new-post.md | ||
Built in 2361 ms | ||
Serving pages from memory | ||
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1) | ||
``` | ||
--- | ||
### via API: | ||
### API | ||
```js | ||
@@ -53,0 +59,0 @@ const { execFile } = require('child_process'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
7432
1
77
0
14
43
- Removedrimraf@^3.0.1
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedinflight@1.0.6(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedrimraf@3.0.2(transitive)