Skip to content

Commit

Permalink
fix: correct link to issues page for ipfs readmes (#1049)
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain authored Aug 17, 2022
1 parent d3d5ee9 commit b3578e8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/check-project/check-monorepo-readme.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export async function checkMonorepoReadme (projectDir, repoUrl, defaultBranch, p
parsedReadme.children.push(child)
})

const license = parseMarkdown(LICENSE[repoOwner] ?? LICENSE.default)
const license = parseMarkdown(LICENSE(pkg, repoOwner, repoName, defaultBranch))
const structure = parseMarkdown(STRUCTURE(projectDir, projectDirs))

parsedReadme.children = [
Expand Down
2 changes: 1 addition & 1 deletion src/check-project/check-readme.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export async function checkReadme (projectDir, repoUrl, defaultBranch) {
})

const installation = parseMarkdown(INSTALL(pkg))
const license = parseMarkdown(LICENSE[repoOwner] ?? LICENSE.default)
const license = parseMarkdown(LICENSE(pkg, repoOwner, repoName, defaultBranch))

parsedReadme.children = [
...installation.children,
Expand Down
31 changes: 23 additions & 8 deletions src/check-project/readme/license.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

/** @type {Record<string, string>} */
export const LICENSE = {
ipfs: `
/**
* @type {Record<string, (repoOwner: string, repoName: string, defaultBranch: string) => string>}
*/
const licenses = {
ipfs: (repoOwner, repoName, defaultBranch) => `
## License
Licensed under either of
Expand All @@ -11,22 +12,36 @@ Licensed under either of
## Contribute
Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-importer/issues)!
Contributions welcome! Please check out [the issues](https://github.com/${repoOwner}/${repoName}/issues).
Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.
This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
Please be aware that all interactions related to this repo are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
`,
default: `
default: (repoOwner, repoName, defaultBranch) => `
## License
Licensed under either of
* Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / http://www.apache.org/licenses/LICENSE-2.0)
* MIT ([LICENSE-MIT](LICENSE-MIT) / http://opensource.org/licenses/MIT)
## Contribution
## Contribute
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
`
}

/**
* @param {*} pkg
* @param {string} repoOwner
* @param {string} repoName
* @param {string} defaultBranch
*/
export const LICENSE = (pkg, repoOwner, repoName, defaultBranch) => {
return (licenses[repoOwner] ?? licenses.default)(repoOwner, repoName, defaultBranch)
}

0 comments on commit b3578e8

Please sign in to comment.