Skip to content

Commit b3578e8

Browse files
authoredAug 17, 2022
fix: correct link to issues page for ipfs readmes (#1049)
1 parent d3d5ee9 commit b3578e8

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed
 

‎src/check-project/check-monorepo-readme.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export async function checkMonorepoReadme (projectDir, repoUrl, defaultBranch, p
108108
parsedReadme.children.push(child)
109109
})
110110

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

114114
parsedReadme.children = [

‎src/check-project/check-readme.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export async function checkReadme (projectDir, repoUrl, defaultBranch) {
116116
})
117117

118118
const installation = parseMarkdown(INSTALL(pkg))
119-
const license = parseMarkdown(LICENSE[repoOwner] ?? LICENSE.default)
119+
const license = parseMarkdown(LICENSE(pkg, repoOwner, repoName, defaultBranch))
120120

121121
parsedReadme.children = [
122122
...installation.children,

‎src/check-project/readme/license.js

+23-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
2-
/** @type {Record<string, string>} */
3-
export const LICENSE = {
4-
ipfs: `
1+
/**
2+
* @type {Record<string, (repoOwner: string, repoName: string, defaultBranch: string) => string>}
3+
*/
4+
const licenses = {
5+
ipfs: (repoOwner, repoName, defaultBranch) => `
56
## License
67
78
Licensed under either of
@@ -11,22 +12,36 @@ Licensed under either of
1112
1213
## Contribute
1314
14-
Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-importer/issues)!
15+
Contributions welcome! Please check out [the issues](https://github.com/${repoOwner}/${repoName}/issues).
16+
17+
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.
1518
16-
This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
19+
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).
20+
21+
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.
1722
1823
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
1924
`,
20-
default: `
25+
default: (repoOwner, repoName, defaultBranch) => `
2126
## License
2227
2328
Licensed under either of
2429
2530
* Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / http://www.apache.org/licenses/LICENSE-2.0)
2631
* MIT ([LICENSE-MIT](LICENSE-MIT) / http://opensource.org/licenses/MIT)
2732
28-
## Contribution
33+
## Contribute
2934
3035
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.
3136
`
3237
}
38+
39+
/**
40+
* @param {*} pkg
41+
* @param {string} repoOwner
42+
* @param {string} repoName
43+
* @param {string} defaultBranch
44+
*/
45+
export const LICENSE = (pkg, repoOwner, repoName, defaultBranch) => {
46+
return (licenses[repoOwner] ?? licenses.default)(repoOwner, repoName, defaultBranch)
47+
}

0 commit comments

Comments
 (0)
Please sign in to comment.