Skip to content

Commit

Permalink
yarn ➡️ pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
jakejarvis committed Jun 4, 2024
1 parent 5d6d26d commit 1ce5f5b
Show file tree
Hide file tree
Showing 8 changed files with 2,729 additions and 1,920 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ jobs:
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: yarn install --frozen-lockfile
- run: yarn publish
- uses: pnpm/action-setup@v4
with:
version: 8
run_install: false
- run: pnpm install --frozen-lockfile
- run: pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
21 changes: 9 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
- 20
- 18
- 16
- 14
fail-fast: false
runs-on: ${{ matrix.os }}
name: Node ${{ matrix.node }} on ${{ matrix.os }}
Expand All @@ -28,19 +27,17 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: yarn install --frozen-lockfile
- uses: pnpm/action-setup@v4
with:
version: 8
run_install: false
- run: pnpm install --frozen-lockfile
env:
DEBUG: careful-downloader
DEBUG_HIDE_DATE: 1
DEBUG_COLORS: 0
- run: yarn audit
- run: pnpm audit --prod
continue-on-error: true
- run: yarn test
- name: Checkout gohugoio/hugoDocs
uses: actions/checkout@v4
with:
repository: gohugoio/hugoDocs
path: docs/
fetch-depth: 1
- name: Build docs
run: node lib/cli.js --source docs/ --minify --enableGitInfo --logLevel info
- run: pnpm run test
- run: node lib/cli.js new site mysite
- run: node lib/cli.js --source mysite/ --minify --enableGitInfo --logLevel info
6 changes: 2 additions & 4 deletions lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ async function install() {
const binFile = getBinFilename();

// stop here if there's nothing we can download
if (!releaseFile) {
if (!releaseFile)
throw new Error(`Are you sure this platform is supported? See: https://github.com/gohugoio/hugo/releases/tag/v${version}`);
}

// warn if platform doesn't support Hugo Extended, proceed with vanilla Hugo
if (!isExtended(releaseFile)) {
if (!isExtended(releaseFile))
console.warn(`${logSymbols.info} Hugo Extended isn't supported on this platform, downloading vanilla Hugo instead.`);
}

// download release from GitHub and verify its checksum
const download = await downloader(getReleaseUrl(version, releaseFile), {
Expand Down
6 changes: 2 additions & 4 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@ export function getBinVersion(bin) {
// Simply detect if the given file exists.
export function doesBinExist(bin) {
try {
if (fs.existsSync(bin)) {
if (fs.existsSync(bin))
return true;
}
} catch (error) {
// something bad happened besides Hugo not existing
if (error.code !== "ENOENT") {
if (error.code !== "ENOENT")
throw error;
}

return false;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"test": "eslint . && mocha"
},
"engines": {
"node": ">=14.14"
"node": ">=16.14"
},
"keywords": [
"hugo",
Expand Down
Loading

0 comments on commit 1ce5f5b

Please sign in to comment.