rman 0.32.0 → 0.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/rman.mjs CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  import { runCli } from '../esm/cli.js';
3
3
 
4
- // eslint-disable-next-line
5
4
  runCli().catch(() => 0);
package/cjs/cli.js CHANGED
@@ -42,7 +42,6 @@ async function runCli(options) {
42
42
  : err
43
43
  ? err.message
44
44
  : '';
45
- // eslint-disable-next-line no-console
46
45
  console.log('\n' + ansi_colors_1.default.red(text));
47
46
  throw msg;
48
47
  }
@@ -89,7 +89,6 @@ class ListCommand extends command_js_1.Command {
89
89
  }
90
90
  if (table.rows.length) {
91
91
  npmlog_1.default.output('', '%s', table.toString().trim());
92
- // eslint-disable-next-line no-console
93
92
  console.log('');
94
93
  npmlog_1.default.info('list', '%i Package(s) found', count);
95
94
  return arr;
@@ -66,7 +66,9 @@ class PublishCommand extends run_command_js_1.RunCommand {
66
66
  const cwd = this.options.contents
67
67
  ? path_1.default.resolve(this.repository.dirname, path_1.default.join(this.options.contents, path_1.default.basename(pkg.dirname)))
68
68
  : pkg.dirname;
69
- return super._exec(pkg, 'npm publish' + (this.options.access ? ' --access=' + this.options.access : ''), {
69
+ return super._exec(pkg, 'npm publish' +
70
+ (this.options.access ? ' --access=' + this.options.access : '') +
71
+ (this.options.userconfig ? ` --userconfig="${this.options.userconfig}"` : ''), {
70
72
  ...args,
71
73
  cwd,
72
74
  stdio: npmlog_1.default.levelIndex < 1000 ? 'inherit' : 'pipe',
@@ -91,6 +93,10 @@ PublishCommand.commandName = 'publish';
91
93
  type: 'string',
92
94
  choices: ['public', 'restricted'],
93
95
  },
96
+ userconfig: {
97
+ describe: '# Path of .npmrc file to use for authentication',
98
+ type: 'string',
99
+ },
94
100
  'check-only': {
95
101
  describe: '# Only performs version checking and do not apply "publish" to the registry.',
96
102
  type: 'boolean',
@@ -79,7 +79,11 @@ class RunCommand extends multi_task_command_js_1.MultiTaskCommand {
79
79
  }
80
80
  const t = Date.now();
81
81
  const cwd = args.cwd || pkg.dirname;
82
- const r = await (0, exec_js_1.exec)(command, { cwd, stdio: args.stdio, throwOnError: false });
82
+ const r = await (0, exec_js_1.exec)(command, {
83
+ cwd,
84
+ stdio: args.stdio,
85
+ throwOnError: false,
86
+ });
83
87
  if (logLevel) {
84
88
  if (r.error) {
85
89
  npmlog_1.default.error(this.commandName, ansi_colors_1.default.cyan(name), npmlog_1.default.separator, ansi_colors_1.default.cyanBright.bold(args.script || ''), ansi_colors_1.default.red.bold('failed'), npmlog_1.default.separator, command, npmlog_1.default.separator, r.error.message.trim() + ('\n' + r.stdout).trim());
@@ -4,7 +4,7 @@ exports.Repository = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const fast_glob_1 = tslib_1.__importDefault(require("fast-glob"));
6
6
  const fs_1 = tslib_1.__importDefault(require("fs"));
7
- const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
7
+ const yaml = tslib_1.__importStar(require("js-yaml"));
8
8
  const path_1 = tslib_1.__importDefault(require("path"));
9
9
  const putil_merge_1 = tslib_1.__importDefault(require("putil-merge"));
10
10
  const get_dirname_js_1 = require("../utils/get-dirname.js");
@@ -114,7 +114,7 @@ class Repository extends package_js_1.Package {
114
114
  (0, putil_merge_1.default)(result, pkgJson.rman, { deep: true });
115
115
  let filename = path_1.default.resolve(dirname, '.rman.yml');
116
116
  if (fs_1.default.existsSync(filename)) {
117
- const obj = js_yaml_1.default.load(fs_1.default.readFileSync(filename, 'utf-8'));
117
+ const obj = yaml.load(fs_1.default.readFileSync(filename, 'utf-8'));
118
118
  if (obj && typeof obj === 'object')
119
119
  (0, putil_merge_1.default)(result, obj, { deep: true });
120
120
  }
@@ -0,0 +1 @@
1
+ {"root":["../../src/cli.ts","../../src/index.ts","../../src/commands/build-command.ts","../../src/commands/changed-command.ts","../../src/commands/ci-command.ts","../../src/commands/execute-command.ts","../../src/commands/info-command.ts","../../src/commands/list-command.ts","../../src/commands/multi-task-command.ts","../../src/commands/publish-command.ts","../../src/commands/run-command.ts","../../src/commands/version-command.ts","../../src/core/command.ts","../../src/core/constants.ts","../../src/core/logger.ts","../../src/core/package.ts","../../src/core/repository.ts","../../src/utils/exec.ts","../../src/utils/file-utils.ts","../../src/utils/get-dirname.ts","../../src/utils/git-utils.ts","../../src/utils/npm-run-path.ts","../../src/utils/npm-utils.ts"],"version":"5.7.3"}
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.npmRunPath = npmRunPath;
4
4
  exports.npmRunPathEnv = npmRunPathEnv;
5
5
  const tslib_1 = require("tslib");
6
- /* eslint-disable max-len */
7
6
  /**
8
7
  * Inspired from [npm-run-path](https://github.com/sindresorhus/npm-run-path)
9
8
  */
@@ -9,11 +9,11 @@ class NpmHelper {
9
9
  constructor(options) {
10
10
  this.cwd = options?.cwd || process.cwd();
11
11
  }
12
- async getPackageInfo(packageName) {
13
- const x = await (0, exec_js_1.exec)('npm', {
14
- cwd: this.cwd,
15
- argv: ['view', packageName, '--json'],
16
- });
12
+ async getPackageInfo(packageName, options) {
13
+ const argv = ['view', packageName, '--json'];
14
+ if (options?.userconfig)
15
+ argv.push('--userconfig', options.userconfig);
16
+ const x = await (0, exec_js_1.exec)('npm', { cwd: this.cwd, argv });
17
17
  if (x && x.stdout) {
18
18
  if (x.code && x.stdout.includes('404')) {
19
19
  return new PackageNotFoundError('Package ' + packageName + ' not found in repository');
package/esm/cli.js CHANGED
@@ -38,7 +38,6 @@ export async function runCli(options) {
38
38
  : err
39
39
  ? err.message
40
40
  : '';
41
- // eslint-disable-next-line no-console
42
41
  console.log('\n' + colors.red(text));
43
42
  throw msg;
44
43
  }
@@ -85,7 +85,6 @@ export class ListCommand extends Command {
85
85
  }
86
86
  if (table.rows.length) {
87
87
  logger.output('', '%s', table.toString().trim());
88
- // eslint-disable-next-line no-console
89
88
  console.log('');
90
89
  logger.info('list', '%i Package(s) found', count);
91
90
  return arr;
@@ -62,7 +62,9 @@ export class PublishCommand extends RunCommand {
62
62
  const cwd = this.options.contents
63
63
  ? path.resolve(this.repository.dirname, path.join(this.options.contents, path.basename(pkg.dirname)))
64
64
  : pkg.dirname;
65
- return super._exec(pkg, 'npm publish' + (this.options.access ? ' --access=' + this.options.access : ''), {
65
+ return super._exec(pkg, 'npm publish' +
66
+ (this.options.access ? ' --access=' + this.options.access : '') +
67
+ (this.options.userconfig ? ` --userconfig="${this.options.userconfig}"` : ''), {
66
68
  ...args,
67
69
  cwd,
68
70
  stdio: logger.levelIndex < 1000 ? 'inherit' : 'pipe',
@@ -86,6 +88,10 @@ PublishCommand.commandName = 'publish';
86
88
  type: 'string',
87
89
  choices: ['public', 'restricted'],
88
90
  },
91
+ userconfig: {
92
+ describe: '# Path of .npmrc file to use for authentication',
93
+ type: 'string',
94
+ },
89
95
  'check-only': {
90
96
  describe: '# Only performs version checking and do not apply "publish" to the registry.',
91
97
  type: 'boolean',
@@ -75,7 +75,11 @@ export class RunCommand extends MultiTaskCommand {
75
75
  }
76
76
  const t = Date.now();
77
77
  const cwd = args.cwd || pkg.dirname;
78
- const r = await exec(command, { cwd, stdio: args.stdio, throwOnError: false });
78
+ const r = await exec(command, {
79
+ cwd,
80
+ stdio: args.stdio,
81
+ throwOnError: false,
82
+ });
79
83
  if (logLevel) {
80
84
  if (r.error) {
81
85
  logger.error(this.commandName, colors.cyan(name), logger.separator, colors.cyanBright.bold(args.script || ''), colors.red.bold('failed'), logger.separator, command, logger.separator, r.error.message.trim() + ('\n' + r.stdout).trim());
@@ -1,6 +1,6 @@
1
1
  import glob from 'fast-glob';
2
2
  import fs from 'fs';
3
- import yaml from 'js-yaml';
3
+ import * as yaml from 'js-yaml';
4
4
  import path from 'path';
5
5
  import merge from 'putil-merge';
6
6
  import { getPackageJson } from '../utils/get-dirname.js';
@@ -0,0 +1 @@
1
+ {"root":["../../src/cli.ts","../../src/index.ts","../../src/commands/build-command.ts","../../src/commands/changed-command.ts","../../src/commands/ci-command.ts","../../src/commands/execute-command.ts","../../src/commands/info-command.ts","../../src/commands/list-command.ts","../../src/commands/multi-task-command.ts","../../src/commands/publish-command.ts","../../src/commands/run-command.ts","../../src/commands/version-command.ts","../../src/core/command.ts","../../src/core/constants.ts","../../src/core/logger.ts","../../src/core/package.ts","../../src/core/repository.ts","../../src/utils/exec.ts","../../src/utils/file-utils.ts","../../src/utils/get-dirname.ts","../../src/utils/git-utils.ts","../../src/utils/npm-run-path.ts","../../src/utils/npm-utils.ts"],"version":"5.7.3"}
@@ -1,4 +1,3 @@
1
- /* eslint-disable max-len */
2
1
  /**
3
2
  * Inspired from [npm-run-path](https://github.com/sindresorhus/npm-run-path)
4
3
  */
@@ -5,11 +5,11 @@ export class NpmHelper {
5
5
  constructor(options) {
6
6
  this.cwd = options?.cwd || process.cwd();
7
7
  }
8
- async getPackageInfo(packageName) {
9
- const x = await exec('npm', {
10
- cwd: this.cwd,
11
- argv: ['view', packageName, '--json'],
12
- });
8
+ async getPackageInfo(packageName, options) {
9
+ const argv = ['view', packageName, '--json'];
10
+ if (options?.userconfig)
11
+ argv.push('--userconfig', options.userconfig);
12
+ const x = await exec('npm', { cwd: this.cwd, argv });
13
13
  if (x && x.stdout) {
14
14
  if (x.code && x.stdout.includes('404')) {
15
15
  return new PackageNotFoundError('Package ' + packageName + ' not found in repository');
package/package.json CHANGED
@@ -1,27 +1,27 @@
1
1
  {
2
2
  "name": "rman",
3
3
  "description": "Monorepo repository manager",
4
- "version": "0.32.0",
4
+ "version": "0.33.1",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
7
7
  "dependencies": {
8
8
  "@netlify/parse-npm-script": "^0.1.2",
9
9
  "ansi-colors": "^4.1.3",
10
10
  "easy-table": "^1.2.0",
11
- "envinfo": "^7.13.0",
12
- "fast-glob": "^3.3.2",
13
- "ini": "^4.1.3",
14
- "is-ci": "^3.0.1",
11
+ "envinfo": "^7.14.0",
12
+ "fast-glob": "^3.3.3",
13
+ "ini": "^5.0.0",
14
+ "is-ci": "^4.1.0",
15
15
  "js-yaml": "^4.1.0",
16
16
  "npmlog": "^7.0.1",
17
17
  "power-tasks": "^1.11.0",
18
18
  "putil-merge": "^3.13.0",
19
19
  "putil-varhelpers": "^1.6.5",
20
- "semver": "^7.6.3",
20
+ "semver": "^7.7.1",
21
21
  "signal-exit": "^4.1.0",
22
22
  "strict-typed-events": "^2.8.0",
23
23
  "strip-color": "^0.1.0",
24
- "tslib": "^2.6.3",
24
+ "tslib": "^2.8.1",
25
25
  "yargs": "^17.7.2"
26
26
  },
27
27
  "type": "module",
@@ -16,6 +16,7 @@ export declare namespace PublishCommand {
16
16
  contents?: string;
17
17
  access?: string;
18
18
  checkOnly?: boolean;
19
+ userconfig?: string;
19
20
  }
20
21
  const cliCommandOptions: Record<string, yargs.Options>;
21
22
  function initCli(repository: Repository, program: yargs.Argv): void;
@@ -7,5 +7,7 @@ export interface NpmOptions {
7
7
  export declare class NpmHelper {
8
8
  cwd: string;
9
9
  constructor(options?: NpmOptions);
10
- getPackageInfo(packageName: string): Promise<any>;
10
+ getPackageInfo(packageName: string, options?: {
11
+ userconfig?: string;
12
+ }): Promise<any>;
11
13
  }