Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phartenfeller/gatsby-source-package-licenses
Gatsby Plug-in to source all the licenses from the dependencies of a project.
https://github.com/phartenfeller/gatsby-source-package-licenses
gatsby gatsby-plugin
Last synced: about 2 months ago
JSON representation
Gatsby Plug-in to source all the licenses from the dependencies of a project.
- Host: GitHub
- URL: https://github.com/phartenfeller/gatsby-source-package-licenses
- Owner: phartenfeller
- Created: 2021-07-21T09:32:50.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-12-11T22:37:22.000Z (about 3 years ago)
- Last Synced: 2024-08-10T09:13:22.265Z (5 months ago)
- Topics: gatsby, gatsby-plugin
- Language: JavaScript
- Homepage:
- Size: 934 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gatsby Source Package License
Gatsby Plug-in to source all the licenses from the dependencies of a project.
[![NPM](https://nodei.co/npm/gatsby-source-package-licenses.png)](https://nodei.co/npm/gatsby-source-package-licenses/)
## How to use
Add to `gatsby-config.js`:
```js
...
plugins: [
...
{
resolve: `gatsby-source-package-licenses`,
options: {
cacheFile: "yarn.lock",
},
},
]
...
```Sourcing is pretty fast but still you can use `cacheFile` to speed up the process. Use `yarn.lock` or `package-lock.json` depending on your package manager.
Query:
```graphql
{
allPackageLicense {
edges {
node {
identifier
license
licenseText
package
url
version
}
}
}
}
```Example result:
```json
{
"node": {
"identifier": "@gatsbyjs/[email protected]",
"license": "MIT",
"licenseText": "Copyright JS Foundation and other contributors\n\nPermissionhereby granted...",
"package": "@gatsbyjs/webpack-hot-middleware",
"url": "https://github.com/gatsbyjs/webpack-hot-middleware",
"version": "2.25.2"
}
}
```## Development
### Linking the plugins folder to the sample site
```sh
cd plugin
yarn link
cd ../sample-site
yarn link "gatsby-source-package-licenses"
```### To publish a new version to NPM
1. Bump version in package.json
2. Update readme (both i guess) `cp README.md ./plugin````sh
cd plugins && npm publish
```