fix(core): Updated dependencies and improved npm preparation logic.

This commit is contained in:
2024-11-05 02:38:21 +01:00
parent 66d28e5081
commit c6918399bf
6 changed files with 863 additions and 182 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@ship.zone/npmci',
version: '4.1.32',
version: '4.1.33',
description: 'A tool to streamline Node.js and Docker workflows within CI environments, particularly GitLab CI, providing various CI/CD utilities.'
}

View File

@ -52,12 +52,17 @@ export class NpmciNpmManager {
* authenticates npm with token from env var
*/
public async prepare() {
logger.log('info', 'running >>npm prepare<<');
const config = this.npmciRef.npmciConfig.getConfig();
let npmrcFileString: string = '';
await plugins.smartobject.forEachMinimatch(
process.env,
'NPMCI_TOKEN_NPM*',
(npmEnvArg: string) => {
if (!npmEnvArg) {
logger.log('note','found empty token...');
return;
}
const npmRegistryUrl = npmEnvArg.split('|')[0];
logger.log('ok', `found token for ${npmRegistryUrl}`);
let npmToken = npmEnvArg.split('|')[1];

View File

@ -48,10 +48,10 @@ export class NpmciConfig {
public async init() {
this.npmciNpmextra = new plugins.npmextra.Npmextra(paths.cwd);
this.kvStorage = new plugins.npmextra.KeyValueStore(
'userHomeDir',
`${this.npmciRef.npmciEnv.repo.user}_${this.npmciRef.npmciEnv.repo.repo}`
);
this.kvStorage = new plugins.npmextra.KeyValueStore({
typeArg: 'userHomeDir',
identityArg: `.npmci_${this.npmciRef.npmciEnv.repo.user}_${this.npmciRef.npmciEnv.repo.repo}`,
});
this.npmciQenv = new plugins.qenv.Qenv(
paths.NpmciProjectDir,
paths.NpmciProjectNogitDir,