feat: added opensource license

This commit is contained in:
Junseo Park 2021-02-25 22:54:25 +09:00
parent 42f5c0a7f7
commit d9677b05c3
4 changed files with 1460 additions and 1126 deletions

View File

@ -73,7 +73,7 @@ const Footer = ({ color, theme, setTheme }:FooterProps): JSX.Element => {
</Link>
</li>
<li>
<Link href='/opensource'>
<Link href='/license'>
<a className='hover:text-gray-300'> </a>
</Link>
</li>

View File

@ -27,6 +27,7 @@
"discord.js": "12.5.1",
"emoji-mart": "3.0.1",
"formik": "2.2.6",
"generate-license-file": "^1.1.0",
"josa": "3.0.1",
"jsonwebtoken": "8.5.1",
"knex": "0.21.18",

View File

@ -1,12 +1,16 @@
import { NextPage } from 'next'
import dynamic from 'next/dynamic'
import * as generateLicenseFile from 'generate-license-file'
import { ILicense } from 'generate-license-file/dist/models/license.interface'
const Docs = dynamic(()=> import('@components/Docs'))
const Segment = dynamic(() => import('@components/Segment'))
const Markdown = dynamic(() => import('@components/Markdown'))
const Opensource: NextPage<OpensourceProps> = ({ packageJson }) => {
const Opensource: NextPage<OpensourceProps> = ({ packageJson, license }) => {
console.log(license)
return <Docs title='오픈소스' header={<h1 className='font-black text-4xl'>
<span className='text-koreanbots-blue'></span>
<span><i className='text-red-500 fas fa-heart mx-2' /> </span>
@ -706,6 +710,15 @@ For more information on this, and how to apply and follow the GNU AGPL, see
{
Object.keys(packageJson.dependencies).concat(Object.keys(packageJson.devDependencies)).map(el=> <span key={el}><a className='text-blue-500 hover:text-blue-400' href={`https://npmjs.org/package/${el}`}>{el}</a> </span>)
}
{
license.map(el=>
<>
<h2 className='text-xl font-semibold my-3'>{el.dependencies.join(', ')}</h2>
<Segment>
<Markdown text={el.content} />
</Segment>
</>)
}
</p>
</Docs>
}
@ -715,13 +728,18 @@ interface OpensourceProps {
dependencies: Record<string, string>
devDependencies: Record<string, string>
}
license: ILicense[]
}
export async function getStaticProps () {
const license = await generateLicenseFile.getProjectLicenses('./').then(license => license)
return {
props: {
packageJson: require('package.json')
packageJson: require('package.json'),
license
}
}
}
export default Opensource

2553
yarn.lock

File diff suppressed because it is too large Load Diff