fix(smartpnpm): harden pnpm license parsing and modernize test and package configuration
This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"@ship.zone/szci": {
|
||||||
|
"npmGlobalTools": [],
|
||||||
|
"npmRegistryUrl": "registry.npmjs.org"
|
||||||
|
},
|
||||||
|
"@git.zone/cli": {
|
||||||
|
"projectType": "npm",
|
||||||
|
"module": {
|
||||||
|
"githost": "code.foss.global",
|
||||||
|
"gitscope": "push.rocks",
|
||||||
|
"gitrepo": "smartpnpm",
|
||||||
|
"shortDescription": "pnpm integration utilities",
|
||||||
|
"description": "A library for integrating pnpm package management capabilities within your code.",
|
||||||
|
"npmPackagename": "@push.rocks/smartpnpm",
|
||||||
|
"license": "MIT",
|
||||||
|
"keywords": [
|
||||||
|
"pnpm",
|
||||||
|
"package management",
|
||||||
|
"dependency license",
|
||||||
|
"typescript",
|
||||||
|
"node.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"release": {
|
||||||
|
"registries": [
|
||||||
|
"https://verdaccio.lossless.digital",
|
||||||
|
"https://registry.npmjs.org"
|
||||||
|
],
|
||||||
|
"accessLevel": "public"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@git.zone/tsdoc": {
|
||||||
|
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-05-01 - 1.0.7 - fix(smartpnpm)
|
||||||
|
harden pnpm license parsing and modernize test and package configuration
|
||||||
|
|
||||||
|
- Escape project paths before invoking pnpm and return a typed license map from getDependencyLicenseJson instead of swallowing execution errors.
|
||||||
|
- Migrate tests to @git.zone/tstest with an async node-specific test file and update build, test, and dependency tooling configuration.
|
||||||
|
- Add package exports and include smart config and license files in published package contents.
|
||||||
|
|
||||||
|
## 2026-03-01 - 1.0.6 - maintenance
|
||||||
|
Maintenance updates and repository metadata cleanup across the 1.0.6 release line.
|
||||||
|
|
||||||
|
- Removed the GitLab CI configuration
|
||||||
|
- Updated project description
|
||||||
|
- Updated TypeScript configuration
|
||||||
|
- Refreshed npmextra.json git host settings
|
||||||
|
|
||||||
|
## 2023-10-11 - 1.0.5 to 1.0.1 - core
|
||||||
|
Repeated patch-level core updates across several versions with no distinct changelog-worthy differences between releases.
|
||||||
|
|
||||||
|
- Applied the same `fix(core): update` change through versions 1.0.1, 1.0.2, 1.0.3, 1.0.4, and 1.0.5
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) 2026 Task Venture Capital GmbH <hello@task.vc>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
+15
-8
@@ -1,14 +1,18 @@
|
|||||||
{
|
{
|
||||||
"gitzone": {
|
"@ship.zone/szci": {
|
||||||
|
"npmGlobalTools": [],
|
||||||
|
"npmRegistryUrl": "registry.npmjs.org"
|
||||||
|
},
|
||||||
|
"@git.zone/cli": {
|
||||||
"projectType": "npm",
|
"projectType": "npm",
|
||||||
"module": {
|
"module": {
|
||||||
"githost": "code.foss.global",
|
"githost": "code.foss.global",
|
||||||
"gitscope": "push.rocks",
|
"gitscope": "push.rocks",
|
||||||
"gitrepo": "smartpnpm",
|
"gitrepo": "smartpnpm",
|
||||||
|
"shortDescription": "pnpm integration utilities",
|
||||||
"description": "A library for integrating pnpm package management capabilities within your code.",
|
"description": "A library for integrating pnpm package management capabilities within your code.",
|
||||||
"npmPackagename": "@push.rocks/smartpnpm",
|
"npmPackagename": "@push.rocks/smartpnpm",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"projectDomain": "push.rocks",
|
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"pnpm",
|
"pnpm",
|
||||||
"package management",
|
"package management",
|
||||||
@@ -16,13 +20,16 @@
|
|||||||
"typescript",
|
"typescript",
|
||||||
"node.js"
|
"node.js"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"release": {
|
||||||
|
"registries": [
|
||||||
|
"https://verdaccio.lossless.digital",
|
||||||
|
"https://registry.npmjs.org"
|
||||||
|
],
|
||||||
|
"accessLevel": "public"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"npmci": {
|
"@git.zone/tsdoc": {
|
||||||
"npmGlobalTools": [],
|
|
||||||
"npmAccessLevel": "public"
|
|
||||||
},
|
|
||||||
"tsdoc": {
|
|
||||||
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-12
@@ -3,26 +3,26 @@
|
|||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "A library for integrating pnpm package management capabilities within your code.",
|
"description": "A library for integrating pnpm package management capabilities within your code.",
|
||||||
|
"exports": {
|
||||||
|
".": "./dist_ts/index.js"
|
||||||
|
},
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist_ts/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"author": "Task Venture Capital GmbH",
|
"author": "Task Venture Capital GmbH <hello@task.vc>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/ --web)",
|
"test": "tstest test/",
|
||||||
"build": "(tsbuild --web --allowimplicitany)",
|
"build": "tsbuild",
|
||||||
"buildDocs": "(tsdoc)"
|
"buildDocs": "tsdoc"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@git.zone/tsbuild": "^2.1.25",
|
"@git.zone/tsbuild": "^4.4.0",
|
||||||
"@git.zone/tsbundle": "^2.0.5",
|
"@git.zone/tstest": "^3.6.3",
|
||||||
"@git.zone/tsrun": "^1.2.46",
|
"@types/node": "^25.6.0"
|
||||||
"@git.zone/tstest": "^1.0.44",
|
|
||||||
"@push.rocks/tapbundle": "^5.0.3",
|
|
||||||
"@types/node": "^20.8.4"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@push.rocks/smartshell": "^3.0.3"
|
"@push.rocks/smartshell": "^3.3.8"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"last 1 chrome versions"
|
"last 1 chrome versions"
|
||||||
@@ -36,6 +36,8 @@
|
|||||||
"dist_ts_web/**/*",
|
"dist_ts_web/**/*",
|
||||||
"assets/**/*",
|
"assets/**/*",
|
||||||
"cli.js",
|
"cli.js",
|
||||||
|
".smartconfig.json",
|
||||||
|
"license",
|
||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
"readme.md"
|
"readme.md"
|
||||||
],
|
],
|
||||||
@@ -51,4 +53,4 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://code.foss.global/push.rocks/smartpnpm.git"
|
"url": "https://code.foss.global/push.rocks/smartpnpm.git"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+6770
-4853
File diff suppressed because it is too large
Load Diff
@@ -1,20 +1,21 @@
|
|||||||
import { expect, expectAsync, tap } from '@push.rocks/tapbundle';
|
import { expect, tap } from '@git.zone/tstest/tapbundle';
|
||||||
import * as smartpnpm from '../ts/index.js'
|
import * as smartpnpm from '../ts/index.js';
|
||||||
|
|
||||||
let testSmartpnpm: smartpnpm.SmartPnpm;
|
let testSmartpnpm: smartpnpm.SmartPnpm;
|
||||||
|
|
||||||
tap.test('first test', async () => {
|
tap.test('first test', async () => {
|
||||||
testSmartpnpm = new smartpnpm.SmartPnpm(process.cwd());
|
testSmartpnpm = new smartpnpm.SmartPnpm(process.cwd());
|
||||||
expect(testSmartpnpm).toBeInstanceOf(smartpnpm.SmartPnpm);
|
expect(testSmartpnpm).toBeInstanceOf(smartpnpm.SmartPnpm);
|
||||||
})
|
});
|
||||||
|
|
||||||
tap.test('should list depdendencies', async () => {
|
tap.test('should list depdendencies', async () => {
|
||||||
const result = testSmartpnpm.getDependencyLicenseJson();
|
const result = await testSmartpnpm.getDependencyLicenseJson();
|
||||||
|
expect(result).toBeInstanceOf(Object);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should print license summary', async () => {
|
tap.test('should print license summary', async () => {
|
||||||
await testSmartpnpm.printDependencyLicenseSummary();
|
await testSmartpnpm.printDependencyLicenseSummary();
|
||||||
})
|
});
|
||||||
|
|
||||||
tap.test('should get a simple array of licenses', async () => {
|
tap.test('should get a simple array of licenses', async () => {
|
||||||
const result = await testSmartpnpm.getDependencyLicenseArray();
|
const result = await testSmartpnpm.getDependencyLicenseArray();
|
||||||
@@ -23,4 +24,4 @@ tap.test('should get a simple array of licenses', async () => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
tap.start()
|
export default tap.start();
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* autocreated commitinfo by @pushrocks/commitinfo
|
* autocreated commitinfo by @push.rocks/commitinfo
|
||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartpnpm',
|
name: '@push.rocks/smartpnpm',
|
||||||
version: '1.0.6',
|
version: '1.0.7',
|
||||||
description: 'use pnpm in your code'
|
description: 'A library for integrating pnpm package management capabilities within your code.'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ export interface IPnpmLicenseResult {
|
|||||||
"description": string;
|
"description": string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type TPnpmLicenseMap = Record<string, IPnpmLicenseResult[]>;
|
||||||
|
|
||||||
export class SmartPnpm {
|
export class SmartPnpm {
|
||||||
public projectDir: string;
|
public projectDir: string;
|
||||||
|
|
||||||
@@ -19,18 +21,12 @@ export class SmartPnpm {
|
|||||||
|
|
||||||
private smartshellInstance = new plugins.smartshell.Smartshell({
|
private smartshellInstance = new plugins.smartshell.Smartshell({
|
||||||
executor: 'bash',
|
executor: 'bash',
|
||||||
})
|
});
|
||||||
|
|
||||||
async getDependencyLicenseJson() {
|
async getDependencyLicenseJson(): Promise<TPnpmLicenseMap> {
|
||||||
try {
|
const projectDir = this.projectDir.replace(/(["\\$`])/g, '\\$1');
|
||||||
// Get store directory
|
const execResult = await this.smartshellInstance.execSilent(`(cd "${projectDir}" && pnpm licenses list --json)`);
|
||||||
const execResult = await this.smartshellInstance.execSilent(`(cd ${this.projectDir} && pnpm licenses list --json)`);
|
return JSON.parse(execResult.stdout) as TPnpmLicenseMap;
|
||||||
const licenseJson: {[key: string]: Array<IPnpmLicenseResult>} = JSON.parse(execResult.stdout);
|
|
||||||
return licenseJson;
|
|
||||||
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error:', error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async printDependencyLicenseSummary() {
|
public async printDependencyLicenseSummary() {
|
||||||
@@ -45,7 +41,7 @@ export class SmartPnpm {
|
|||||||
} else {
|
} else {
|
||||||
console.log(`|-- ${refArray.length} packages. Not detailing this license type.`);
|
console.log(`|-- ${refArray.length} packages. Not detailing this license type.`);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getDependencyLicenseFlatArray() {
|
public async getDependencyLicenseFlatArray() {
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ import * as smartshell from '@push.rocks/smartshell';
|
|||||||
|
|
||||||
export {
|
export {
|
||||||
smartshell,
|
smartshell,
|
||||||
}
|
};
|
||||||
|
|||||||
+3
-1
@@ -5,8 +5,10 @@
|
|||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"module": "NodeNext",
|
"module": "NodeNext",
|
||||||
"moduleResolution": "NodeNext",
|
"moduleResolution": "NodeNext",
|
||||||
|
"noImplicitAny": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"verbatimModuleSyntax": true
|
"verbatimModuleSyntax": true,
|
||||||
|
"types": ["node"]
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"dist_*/**/*.d.ts"
|
"dist_*/**/*.d.ts"
|
||||||
|
|||||||
Reference in New Issue
Block a user