rman 0.6.1 → 0.8.0

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.
@@ -26,7 +26,7 @@ class ExecuteCommand extends multi_task_command_1.MultiTaskCommand {
26
26
  const r = await (0, exec_1.exec)(this.cmd, {
27
27
  cwd: p.dirname,
28
28
  argv: this.argv,
29
- stdio: npmlog_1.default.levelIndex <= 1000 ? 'inherit' : 'pipe'
29
+ stdio: npmlog_1.default.levelIndex < 1000 ? 'inherit' : 'pipe'
30
30
  });
31
31
  npmlog_1.default.log((r.error ? 'error' : 'info'), this.commandName, p.name, (r.error ? chalk_1.default.red.bold('failed') : chalk_1.default.green.bold('success')), npmlog_1.default.separator, this.cmd, chalk_1.default.yellow(' (' + (Date.now() - t) + ' ms') + ')');
32
32
  }, {
@@ -5,10 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.PublishCommand = void 0;
7
7
  const chalk_1 = __importDefault(require("chalk"));
8
- const package_json_1 = __importDefault(require("package-json"));
9
8
  const npmlog_1 = __importDefault(require("npmlog"));
10
9
  const command_1 = require("../core/command");
11
10
  const run_command_1 = require("./run-command");
11
+ const path_1 = __importDefault(require("path"));
12
12
  class PublishCommand extends run_command_1.RunCommand {
13
13
  constructor(repository, options) {
14
14
  super(repository, 'publish', options);
@@ -19,11 +19,17 @@ class PublishCommand extends run_command_1.RunCommand {
19
19
  const selectedPackages = [];
20
20
  for (const p of packages) {
21
21
  const logPkgName = chalk_1.default.yellow(p.name);
22
- const r = await (0, package_json_1.default)(p.json.name);
22
+ npmlog_1.default.verbose(this.commandName, logPkgName, npmlog_1.default.separator, `Fetching package information from repository`);
23
+ /*
24
+ const r = await fetchPackageInfo(p.json.name);
23
25
  if (r.version === p.version) {
24
- npmlog_1.default.info(this.commandName, logPkgName, npmlog_1.default.separator, `Ignored. Same version (${p.version}) in repository`);
26
+ logger.info(
27
+ this.commandName,
28
+ logPkgName,
29
+ logger.separator,
30
+ `Ignored. Same version (${p.version}) in repository`);
25
31
  continue;
26
- }
32
+ }*/
27
33
  selectedPackages.push(p);
28
34
  }
29
35
  return super._prepareTasks(selectedPackages, { newVersions });
@@ -32,7 +38,14 @@ class PublishCommand extends run_command_1.RunCommand {
32
38
  if (args.command === '#') {
33
39
  if (args.name === 'root')
34
40
  return { code: 0 };
35
- return super._exec({ ...args, command: 'npm publish' }, { ...options, stdio: 'inherit' });
41
+ const cwd = this.options.contents
42
+ ? path_1.default.resolve(this.repository.dirname, path_1.default.join(this.options.contents, path_1.default.basename(args.cwd)))
43
+ : args.cwd;
44
+ return super._exec({
45
+ ...args,
46
+ cwd,
47
+ command: 'npm publish'
48
+ }, { ...options, stdio: npmlog_1.default.levelIndex < 1000 ? 'inherit' : 'pipe' });
36
49
  }
37
50
  return super._exec(args, options);
38
51
  }
@@ -70,7 +70,7 @@ class RunCommand extends multi_task_command_1.MultiTaskCommand {
70
70
  return await this._exec({
71
71
  ...args,
72
72
  command: cmd,
73
- stdio: npmlog_1.default.levelIndex <= 1000 ? 'inherit' : 'pipe'
73
+ stdio: npmlog_1.default.levelIndex < 1000 ? 'inherit' : 'pipe'
74
74
  }, ctx);
75
75
  }, {
76
76
  name: args.name + ':' + s.name,
@@ -87,7 +87,7 @@ class VersionCommand extends run_command_1.RunCommand {
87
87
  name: 'rman',
88
88
  command: 'git tag -a "v' + maxVer + '" -m "version ' + maxVer + '"',
89
89
  cwd: this.repository.dirname,
90
- stdio: npmlog_1.default.levelIndex <= 1000 ? 'inherit' : 'pipe',
90
+ stdio: npmlog_1.default.levelIndex < 1000 ? 'inherit' : 'pipe',
91
91
  logLevel: 'silly'
92
92
  });
93
93
  }
@@ -114,7 +114,7 @@ class VersionCommand extends run_command_1.RunCommand {
114
114
  name: args.name,
115
115
  command: 'git commit -m "' + newVer + '" package.json',
116
116
  cwd: args.cwd,
117
- stdio: npmlog_1.default.levelIndex <= 1000 ? 'inherit' : 'pipe',
117
+ stdio: npmlog_1.default.levelIndex < 1000 ? 'inherit' : 'pipe',
118
118
  logLevel: 'silly'
119
119
  });
120
120
  }
@@ -20,7 +20,7 @@ export class ExecuteCommand extends MultiTaskCommand {
20
20
  const r = await exec(this.cmd, {
21
21
  cwd: p.dirname,
22
22
  argv: this.argv,
23
- stdio: logger.levelIndex <= 1000 ? 'inherit' : 'pipe'
23
+ stdio: logger.levelIndex < 1000 ? 'inherit' : 'pipe'
24
24
  });
25
25
  logger.log((r.error ? 'error' : 'info'), this.commandName, p.name, (r.error ? chalk.red.bold('failed') : chalk.green.bold('success')), logger.separator, this.cmd, chalk.yellow(' (' + (Date.now() - t) + ' ms') + ')');
26
26
  }, {
@@ -1,8 +1,8 @@
1
1
  import chalk from 'chalk';
2
- import fetchPackageInfo from 'package-json';
3
2
  import logger from 'npmlog';
4
3
  import { Command } from './../core/command.mjs';
5
4
  import { RunCommand } from './run-command.mjs';
5
+ import path from 'path';
6
6
  export class PublishCommand extends RunCommand {
7
7
  constructor(repository, options) {
8
8
  super(repository, 'publish', options);
@@ -13,11 +13,17 @@ export class PublishCommand extends RunCommand {
13
13
  const selectedPackages = [];
14
14
  for (const p of packages) {
15
15
  const logPkgName = chalk.yellow(p.name);
16
+ logger.verbose(this.commandName, logPkgName, logger.separator, `Fetching package information from repository`);
17
+ /*
16
18
  const r = await fetchPackageInfo(p.json.name);
17
19
  if (r.version === p.version) {
18
- logger.info(this.commandName, logPkgName, logger.separator, `Ignored. Same version (${p.version}) in repository`);
20
+ logger.info(
21
+ this.commandName,
22
+ logPkgName,
23
+ logger.separator,
24
+ `Ignored. Same version (${p.version}) in repository`);
19
25
  continue;
20
- }
26
+ }*/
21
27
  selectedPackages.push(p);
22
28
  }
23
29
  return super._prepareTasks(selectedPackages, { newVersions });
@@ -26,7 +32,14 @@ export class PublishCommand extends RunCommand {
26
32
  if (args.command === '#') {
27
33
  if (args.name === 'root')
28
34
  return { code: 0 };
29
- return super._exec({ ...args, command: 'npm publish' }, { ...options, stdio: 'inherit' });
35
+ const cwd = this.options.contents
36
+ ? path.resolve(this.repository.dirname, path.join(this.options.contents, path.basename(args.cwd)))
37
+ : args.cwd;
38
+ return super._exec({
39
+ ...args,
40
+ cwd,
41
+ command: 'npm publish'
42
+ }, { ...options, stdio: logger.levelIndex < 1000 ? 'inherit' : 'pipe' });
30
43
  }
31
44
  return super._exec(args, options);
32
45
  }
@@ -64,7 +64,7 @@ export class RunCommand extends MultiTaskCommand {
64
64
  return await this._exec({
65
65
  ...args,
66
66
  command: cmd,
67
- stdio: logger.levelIndex <= 1000 ? 'inherit' : 'pipe'
67
+ stdio: logger.levelIndex < 1000 ? 'inherit' : 'pipe'
68
68
  }, ctx);
69
69
  }, {
70
70
  name: args.name + ':' + s.name,
@@ -81,7 +81,7 @@ export class VersionCommand extends RunCommand {
81
81
  name: 'rman',
82
82
  command: 'git tag -a "v' + maxVer + '" -m "version ' + maxVer + '"',
83
83
  cwd: this.repository.dirname,
84
- stdio: logger.levelIndex <= 1000 ? 'inherit' : 'pipe',
84
+ stdio: logger.levelIndex < 1000 ? 'inherit' : 'pipe',
85
85
  logLevel: 'silly'
86
86
  });
87
87
  }
@@ -108,7 +108,7 @@ export class VersionCommand extends RunCommand {
108
108
  name: args.name,
109
109
  command: 'git commit -m "' + newVer + '" package.json',
110
110
  cwd: args.cwd,
111
- stdio: logger.levelIndex <= 1000 ? 'inherit' : 'pipe',
111
+ stdio: logger.levelIndex < 1000 ? 'inherit' : 'pipe',
112
112
  logLevel: 'silly'
113
113
  });
114
114
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rman",
3
3
  "description": "Monorepo repository manager",
4
- "version": "0.6.1",
4
+ "version": "0.8.0",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
7
7
  "contributors": [