Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
Philipp Dormann | cf460a8d88 | |
Philipp Dormann | 847d842b7e | |
Philipp Dormann | 3cafa53318 | |
Philipp Dormann | 4b1326e826 |
|
@ -5,4 +5,5 @@ node_modules
|
|||
.drone.yml
|
||||
.gitignore
|
||||
lib
|
||||
package-lock.json
|
||||
package-lock.json
|
||||
changelog.md
|
|
@ -26,13 +26,13 @@ const args = yargs
|
|||
type: 'boolean',
|
||||
})
|
||||
.option('output', {
|
||||
alias : 'o',
|
||||
alias: 'o',
|
||||
describe: 'Output folder for the exports (Default: Current folder).',
|
||||
type: 'string',
|
||||
default: '.'
|
||||
})
|
||||
.option('input', {
|
||||
alias : 'i',
|
||||
alias: 'i',
|
||||
describe: 'Path to the input folder containing your package.json and node_modules (Default: Current folder).',
|
||||
type: 'string',
|
||||
default: '.'
|
||||
|
@ -69,14 +69,42 @@ function getDependencyLicenseInfo(all_dependencies, recursive) {
|
|||
licensetext = fs.readFileSync(`${args.input}/node_modules/${p[0]}/LICENSE.txt`, { encoding: 'utf-8' });
|
||||
}
|
||||
const info = {
|
||||
author: packageinfo.author,
|
||||
author: "?",
|
||||
repo: packageinfo.repository || packageinfo.repository?.url,
|
||||
description: packageinfo.description,
|
||||
description: packageinfo.description || "",
|
||||
name: packageinfo.name,
|
||||
license: packageinfo.license,
|
||||
version: packageinfo.version,
|
||||
licensetext
|
||||
};
|
||||
if (info.repo) {
|
||||
if (typeof info.repo === "object") {
|
||||
info.repo.url = info.repo.url.replace(/git\:\/\/github.com\//gi, "https://github.com");
|
||||
info.repo.url = info.repo.url.replace(/git\+https:\/\/github.com\//gi, "https://github.com/");
|
||||
}
|
||||
if (typeof info.repo === "string") {
|
||||
info.repo = {
|
||||
url: info.repo
|
||||
};
|
||||
}
|
||||
info.repo.url = info.repo.url.replace(/github:/gi, "https://github.com/");
|
||||
if (info.repo.url.includes("github.com")) {
|
||||
info.repo.url = info.repo.url.replace(/\.git/gi, "");
|
||||
}
|
||||
}
|
||||
if (packageinfo.author) {
|
||||
if (typeof packageinfo.author === "string") info.author = packageinfo.author;
|
||||
if (packageinfo.author.name) {
|
||||
info.author = packageinfo.author.name;
|
||||
}
|
||||
}
|
||||
if (packageinfo.homepage && packageinfo.repository) {
|
||||
if (typeof packageinfo.repository === "string") {
|
||||
if (packageinfo.homepage.toLowerCase().includes(packageinfo.repository.toLowerCase())) {
|
||||
info.repo = packageinfo.homepage;
|
||||
}
|
||||
}
|
||||
}
|
||||
all.push(info);
|
||||
if (recursive == true) {
|
||||
all.push(...getDependencyLicenseInfo(packageinfo.dependencies, true));
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
## Changes from 0.0.10 to 0.0.11
|
||||
I noticed some packages not exporting properly/ in a standardized way
|
||||
|
||||
npm package|0.0.10|0.0.11|what
|
||||
--- | --- | --- | ---
|
||||
|core-js|❌|✅|repo contains `.git`
|
||||
|quasar|❌|✅|repo contains `.git` + `git+https://`
|
||||
|vue-property-decorator|❌|✅|repo contains `.git` + `git+https://`
|
||||
|vue-geolocation-api|❌|✅|repo contains `github:` + description=`undefined`
|
||||
|@types/node|❌|✅|author=`undefined`
|
||||
|@typescript-eslint/eslint-plugin|❌|✅|author=`undefined`
|
||||
|@typescript-eslint/parser|❌|✅|author=`undefined`
|
||||
|eslint-config-standard|❌|✅|repo contains `.git` + `git://github.com`
|
||||
|workbox-webpack-plugin|❌|✅|repo without url
|
|
@ -1,6 +1,6 @@
|
|||
# yargs
|
||||
**Author**: undefined
|
||||
**Repo**: [object Object]
|
||||
**Author**: ?
|
||||
**Repo**: https://github.com/yargs/yargs
|
||||
**License**: MIT
|
||||
**Description**: yargs the modern, pirate-themed, successor to optimist.
|
||||
## License Text
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@odit/license-exporter",
|
||||
"version": "0.0.10",
|
||||
"version": "0.0.11",
|
||||
"description": "A simple license crawler for crediting open source work",
|
||||
"keywords": [
|
||||
"license",
|
||||
|
@ -11,7 +11,11 @@
|
|||
"type": "git",
|
||||
"url": "https://git.odit.services/odit/license-exporter"
|
||||
},
|
||||
"author": "ODIT.Services",
|
||||
"author": {
|
||||
"name": "ODIT.Services",
|
||||
"email": "info@odit.services",
|
||||
"url": "https://odit.services"
|
||||
},
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
|
Reference in New Issue