Skip to content

Commit

Permalink
v4.1.1 - trim trailing slashes, update repo handling
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Dec 28, 2023
1 parent a6d5603 commit 266c619
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bevry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- run: npm run our:compile
- run: npm run our:meta
- name: publish to npm
uses: bevry-actions/[email protected].3
uses: bevry-actions/[email protected].5
with:
npmAuthToken: ${{ secrets.NPM_AUTH_TOKEN }}
npmBranchTag: ':next'
Expand Down
7 changes: 7 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# History

## v4.1.1 2023 December 28

- Update github-api and fellow deps, so trailing slashes no longer cause duplicates (they are now trimmed) and maintainer urls are now the homepage
- Support `.repository` that isn't github, if it is github however, update to the preferred format
- Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation)
- Thank you to the sponsors: [Andrew Nesbitt](https://nesbitt.io), [Balsa](https://balsa.com), [Codecov](https://codecov.io/), [Poonacha Medappa](https://poonachamedappa.com), [Rob Morris](https://github.com/Rob-Morris), [Sentry](https://sentry.io), [Syntax](https://syntax.fm)

## v4.1.0 2023 December 28

- Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation)
Expand Down
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ This package is published with the following editions:

#### Maintainers

- [Benjamin Lupton](https://github.com/balupton) — Accelerating collaborative wisdom.
- [Benjamin Lupton](https://balupton.com) — Accelerating collaborative wisdom.

#### Contributors

Expand Down Expand Up @@ -350,7 +350,7 @@ This package is published with the following editions:

- [Andrew Nesbitt](https://nesbitt.io) — Software engineer and researcher
- [Balsa](https://balsa.com) — We're Balsa, and we're building tools for builders.
- [Codecov](https://codecov.io/) — Empower developers with tools to improve code quality and testing.
- [Codecov](https://codecov.io) — Empower developers with tools to improve code quality and testing.
- [Poonacha Medappa](https://poonachamedappa.com)
- [Rob Morris](https://github.com/Rob-Morris)
- [Sentry](https://sentry.io) — Real-time crash reporting for your web apps, mobile apps, and games.
Expand All @@ -359,19 +359,30 @@ This package is published with the following editions:
#### Donors

- [Andrew Nesbitt](https://nesbitt.io)
- [Armen Mkrtchian](https://mogoni.dev)
- [Balsa](https://balsa.com)
- [Chad](https://opencollective.com/chad8)
- [Codecov](https://codecov.io/)
- [Codecov](https://codecov.io)
- [dr.dimitru](https://veliovgroup.com)
- [Elliott Ditman](https://elliottditman.com)
- [entroniq](https://gitlab.com/entroniq)
- [GitHub](https://github.com/about)
- [Hunter Beast](https://cryptoquick.com)
- [Jean-Luc Geering](https://github.com/jlgeering)
- [Michael Duane Mooring](https://mdm.cc)
- [Michael Harry Scepaniak](https://michaelscepaniak.com)
- [Mohammed Shah](https://github.com/smashah)
- [Mr. Henry](https://mrhenry.be)
- [Nermal](https://arjunaditya.vercel.app)
- [Pleo](https://www.pleo.io)
- [Poonacha Medappa](https://poonachamedappa.com)
- [Rob Morris](https://github.com/Rob-Morris)
- [Robert de Forest](https://github.com/rdeforest)
- [Sentry](https://sentry.io)
- [ServieJS](https://github.com/serviejs)
- [Skunk Team](https://skunk.team)
- [Syntax](https://syntax.fm)
- [WriterJohnBuck](https://github.com/WriterJohnBuck)

<!-- /BACKERS -->

Expand Down
54 changes: 27 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 21 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"title": "Projectz",
"name": "projectz",
"version": "4.1.0",
"version": "4.1.1",
"license": "Artistic-2.0",
"description": "Stop wasting time syncing and updating your project's README and Package Files!",
"homepage": "https://github.com/bevry/projectz",
"funding": "https://bevry.me/fund",
"repository": {
"type": "git",
"url": "https://github.com/bevry/projectz.git"
"url": "git+https://github.com/bevry/projectz.git"
},
"bugs": {
"url": "https://github.com/bevry/projectz/issues"
Expand Down Expand Up @@ -89,7 +89,7 @@
"Benjamin Lupton <[email protected]> (https://balupton.com) (https://github.com/balupton)",
"James George <[email protected]> (https://github.com/jamesgeorge007)",
"Oliver Lorenz (https://www.oliverlorenz.com) (https://github.com/oliverlorenz)",
"Peter C <[email protected]> (https://www.linkedin.com/in/peterkc1/) (https://github.com/peterkc)",
"Peter C <[email protected]> (https://www.linkedin.com/in/peterkc1) (https://github.com/peterkc)",
"Peter Flannery (https://github.com/pflannery)",
"Rob Loach <[email protected]> (https://robloach.net) (https://github.com/RobLoach)",
"Shahar \"Dawn\" Or <[email protected]> (https://github.com/mightyiam)",
Expand All @@ -100,27 +100,38 @@
"sponsors": [
"Andrew Nesbitt (https://nesbitt.io) (https://github.com/andrew): Software engineer and researcher",
"Balsa <[email protected]> (https://balsa.com) (https://github.com/balsa): We're Balsa, and we're building tools for builders.",
"Codecov <[email protected]> (https://codecov.io/) (https://github.com/codecov): Empower developers with tools to improve code quality and testing.",
"Codecov <[email protected]> (https://codecov.io) (https://github.com/codecov): Empower developers with tools to improve code quality and testing.",
"Poonacha Medappa (https://poonachamedappa.com) (https://github.com/km-Poonacha)",
"Rob Morris <[email protected]> (https://github.com/Rob-Morris)",
"Sentry (https://sentry.io) (https://github.com/getsentry): Real-time crash reporting for your web apps, mobile apps, and games.",
"Syntax <[email protected]> (https://syntax.fm) (https://github.com/syntaxfm): Syntax Podcast"
],
"donors": [
"Andrew Nesbitt (https://nesbitt.io) (https://github.com/andrew)",
"Armen Mkrtchian (https://mogoni.dev) (https://github.com/Armenm)",
"Balsa <[email protected]> (https://balsa.com) (https://github.com/balsa)",
"Chad (https://opencollective.com/chad8)",
"Codecov <[email protected]> (https://codecov.io/) (https://github.com/codecov)",
"Codecov <[email protected]> (https://codecov.io) (https://github.com/codecov)",
"dr.dimitru (https://veliovgroup.com) (https://github.com/dr-dimitru)",
"Elliott Ditman (https://elliottditman.com) (https://github.com/elliottditman)",
"entroniq (https://gitlab.com/entroniq) (https://thanks.dev/d/gl/entroniq)",
"GitHub (https://github.com/about) (https://github.com/github)",
"Hunter Beast (https://cryptoquick.com) (https://github.com/cryptoquick)",
"Jean-Luc Geering (https://github.com/jlgeering) (https://opencollective.com/jlgeering) (https://twitter.com/jlgeering)",
"Michael Duane Mooring (https://mdm.cc) (https://github.com/mikeumus) (https://opencollective.com/mikeumus) (https://twitter.com/mikeumus)",
"Michael Harry Scepaniak <[email protected]> (https://michaelscepaniak.com) (https://github.com/hispanic)",
"Mohammed Shah <[email protected]> (https://github.com/smashah) (https://thanks.dev/d/gh/smashah) (https://twitter.com/smashah)",
"Mr. Henry <[email protected]> (https://mrhenry.be) (https://github.com/mrhenry)",
"Nermal <[email protected]> (https://arjunaditya.vercel.app) (https://github.com/nermalcat69)",
"Pleo (https://www.pleo.io) (https://github.com/pleo-io)",
"Poonacha Medappa (https://poonachamedappa.com) (https://github.com/km-Poonacha)",
"Rob Morris <[email protected]> (https://github.com/Rob-Morris)",
"Robert de Forest <[email protected]> (https://github.com/rdeforest)",
"Sentry (https://sentry.io) (https://github.com/getsentry)",
"ServieJS (https://github.com/serviejs) (https://thanks.dev/d/gh/serviejs)",
"Skunk Team (https://skunk.team) (https://github.com/skunkteam)",
"Syntax <[email protected]> (https://syntax.fm) (https://github.com/syntaxfm)"
"Syntax <[email protected]> (https://syntax.fm) (https://github.com/syntaxfm)",
"WriterJohnBuck (https://github.com/WriterJohnBuck)"
],
"engines": {
"node": ">=20"
Expand Down Expand Up @@ -195,15 +206,15 @@
"@bevry/fs-list": "^2.5.0",
"@bevry/fs-read": "^1.5.0",
"@bevry/fs-write": "^1.5.0",
"@bevry/github-api": "^11.1.0",
"@bevry/github-api": "^11.3.1",
"@bevry/json": "^2.3.0",
"@bevry/render": "^1.1.0",
"arrange-package-json": "^5.1.0",
"badges": "^4.39.0",
"caterpillar": "^8.1.0",
"spdx-expression-parse": "^4.0.0",
"spdx-license-list": "^6.8.0",
"trim-empty-keys": "^1.0.1",
"trim-empty-keys": "^1.1.0",
"typechecker": "^9.3.0"
},
"devDependencies": {
Expand All @@ -221,7 +232,7 @@
"safeps": "^11.5.0",
"typedoc": "^0.25.4",
"typescript": "5.3.3",
"valid-directory": "^4.7.0"
"valid-directory": "^4.8.0"
},
"scripts": {
"our:bin": "node ./bin.cjs",
Expand All @@ -234,7 +245,7 @@
"our:meta": "npm run our:meta:docs && npm run our:meta:projectz",
"our:meta:docs": "npm run our:meta:docs:typedoc",
"our:meta:docs:typedoc": "rm -rf ./docs && typedoc --exclude '**/+(*test*|node_modules)' --excludeExternals --out ./docs ./source",
"our:meta:projectz": "npm run our:bin",
"our:meta:projectz": "npm run our:bin -- --offline",
"our:release": "npm run our:release:prepare && npm run our:release:check-changelog && npm run our:release:check-dirty && npm run our:release:tag && npm run our:release:push",
"our:release:check-changelog": "cat ./HISTORY.md | grep \"v$npm_package_version\" || (printf '%s\n' \"add a changelog entry for v$npm_package_version\" && exit -1)",
"our:release:check-dirty": "git diff --exit-code",
Expand Down
39 changes: 22 additions & 17 deletions source/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import {
getBackers,
renderBackers,
BackersRenderFormat,
getRepositoryWebsiteUrlFromGitHubSlugOrUrl,
getRepositoryIssuesUrlFromGitHubSlugOrUrl,
getRepositoryUrlFromGitHubSlugOrUrl,
} from '@bevry/github-api'
import { mh1, trim } from '@bevry/render'

Expand Down Expand Up @@ -236,12 +239,9 @@ export class Projectz {

// Ensure repository is an object
if (typeof mergedPackageData.repository === 'string') {
const githubSlug = getGitHubSlugFromPackageData(mergedPackageData)
if (githubSlug) {
mergedPackageData.repository = {
type: 'git',
url: `https://github.com/${githubSlug}.git`,
}
mergedPackageData.repository = {
type: 'git',
url: mergedPackageData.repository,
}
}

Expand Down Expand Up @@ -290,15 +290,19 @@ export class Projectz {
if (githubSlug) {
// Extract parts
const [githubUsername, githubRepository] = githubSlug.split('/')
const githubUrl = 'https://github.com/' + githubSlug
const githubRepositoryUrl = githubUrl + '.git'
const githubRepositoryWebsiteUrl =
getRepositoryWebsiteUrlFromGitHubSlugOrUrl(githubSlug) || ''
const githubRepositoryUrl =
getRepositoryUrlFromGitHubSlugOrUrl(githubSlug) || ''
const githubIssuesUrl =
getRepositoryIssuesUrlFromGitHubSlugOrUrl(githubSlug) || ''

// Github data
github = {
username: githubUsername,
repository: githubRepository,
slug: githubSlug,
url: githubUrl,
url: githubRepositoryWebsiteUrl,
repositoryUrl: githubRepositoryUrl,
}

Expand All @@ -309,15 +313,18 @@ export class Projectz {
githubSlug,
})

// Fallback bugs field by use of repo
// Fallback bugs field by use of slug
if (!mergedPackageData.bugs) {
mergedPackageData.bugs = github && {
url: `https://github.com/${github.slug}/issues`,
}
mergedPackageData.bugs = githubIssuesUrl
}

// Fetch contributors
// await getContributorsFromRepo(githubSlug)
// Fallback repository field by use of slug
if (!mergedPackageData.repository?.url) {
mergedPackageData.repository = {
type: 'git',
url: githubRepositoryUrl,
}
}
}
}

Expand All @@ -328,8 +335,6 @@ export class Projectz {
githubSlug: github?.slug,
packageData: mergedPackageData,
offline: this.offline,
sponsorCentsThreshold: 100,
donorCentsThreshold: 100,
})
const renderedBackersForPackage = await renderBackers(backers, {
format: BackersRenderFormat.string,
Expand Down
Loading

0 comments on commit 266c619

Please sign in to comment.