rman 0.36.0 → 0.36.2

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.
@@ -39,9 +39,7 @@ class PublishCommand extends run_command_js_1.RunCommand {
39
39
  ? `No publish needed. Version (${ansi_colors_1.default.magenta(p.version)}) same in repository`
40
40
  : `Publishing is possible.` +
41
41
  ` Version "${ansi_colors_1.default.magenta(p.version)}" differs from version in repository (${ansi_colors_1.default.magenta(fetchedVersion)})`);
42
- if (this.options.checkOnly)
43
- return;
44
- if (fetchedVersion === p.version) {
42
+ if (!sameVersion) {
45
43
  selectedPackages.push(p);
46
44
  }
47
45
  })
@@ -55,6 +53,14 @@ class PublishCommand extends run_command_js_1.RunCommand {
55
53
  }));
56
54
  }
57
55
  await Promise.all(promises);
56
+ if (this.options.checkOnly)
57
+ npmlog_1.default.verbose(this.commandName, '', npmlog_1.default.separator, `${selectedPackages.length} packages can be be published`);
58
+ else
59
+ npmlog_1.default.verbose(this.commandName, '', npmlog_1.default.separator, `${selectedPackages.length} packages will be published`);
60
+ selectedPackages.forEach(p => {
61
+ p.json.scripts = p.json.scripts || {};
62
+ p.json.scripts.publish = '#';
63
+ });
58
64
  return super._prepareTasks(selectedPackages, { newVersions });
59
65
  }
60
66
  async _exec(pkg, command, args, options) {
@@ -70,7 +76,7 @@ class PublishCommand extends run_command_js_1.RunCommand {
70
76
  cwd = path_1.default.join(pkg.dirname, contents);
71
77
  }
72
78
  const npmHelper = new npm_utils_js_1.NpmHelper({ cwd: pkg.dirname, userconfig: this.options.userconfig });
73
- return super._exec(pkg, 'npm publish' +
79
+ return super._exec(pkg, 'echo npm publish' +
74
80
  (this.options.access ? ' --access=' + this.options.access : '') +
75
81
  (npmHelper.userconfig ? ` --userconfig="${npmHelper.userconfig}"` : ''), {
76
82
  ...args,
@@ -18,12 +18,12 @@ class RunCommand extends multi_task_command_js_1.MultiTaskCommand {
18
18
  _prepareTasks(packages, options) {
19
19
  const packageTasks = [];
20
20
  for (const p of packages) {
21
- // if (p.json.scripts) {
22
- const childTask = this._prepareScriptTask(p, options);
23
- if (childTask) {
24
- packageTasks.push(childTask);
21
+ if (p.json.scripts) {
22
+ const childTask = this._prepareScriptTask(p, options);
23
+ if (childTask) {
24
+ packageTasks.push(childTask);
25
+ }
25
26
  }
26
- // }
27
27
  }
28
28
  const rootTask = this._prepareScriptTask(this.repository.rootPackage);
29
29
  const children = rootTask?.options.children;
@@ -35,9 +35,7 @@ export class PublishCommand extends RunCommand {
35
35
  ? `No publish needed. Version (${colors.magenta(p.version)}) same in repository`
36
36
  : `Publishing is possible.` +
37
37
  ` Version "${colors.magenta(p.version)}" differs from version in repository (${colors.magenta(fetchedVersion)})`);
38
- if (this.options.checkOnly)
39
- return;
40
- if (fetchedVersion === p.version) {
38
+ if (!sameVersion) {
41
39
  selectedPackages.push(p);
42
40
  }
43
41
  })
@@ -51,6 +49,14 @@ export class PublishCommand extends RunCommand {
51
49
  }));
52
50
  }
53
51
  await Promise.all(promises);
52
+ if (this.options.checkOnly)
53
+ logger.verbose(this.commandName, '', logger.separator, `${selectedPackages.length} packages can be be published`);
54
+ else
55
+ logger.verbose(this.commandName, '', logger.separator, `${selectedPackages.length} packages will be published`);
56
+ selectedPackages.forEach(p => {
57
+ p.json.scripts = p.json.scripts || {};
58
+ p.json.scripts.publish = '#';
59
+ });
54
60
  return super._prepareTasks(selectedPackages, { newVersions });
55
61
  }
56
62
  async _exec(pkg, command, args, options) {
@@ -66,7 +72,7 @@ export class PublishCommand extends RunCommand {
66
72
  cwd = path.join(pkg.dirname, contents);
67
73
  }
68
74
  const npmHelper = new NpmHelper({ cwd: pkg.dirname, userconfig: this.options.userconfig });
69
- return super._exec(pkg, 'npm publish' +
75
+ return super._exec(pkg, 'echo npm publish' +
70
76
  (this.options.access ? ' --access=' + this.options.access : '') +
71
77
  (npmHelper.userconfig ? ` --userconfig="${npmHelper.userconfig}"` : ''), {
72
78
  ...args,
@@ -14,12 +14,12 @@ export class RunCommand extends MultiTaskCommand {
14
14
  _prepareTasks(packages, options) {
15
15
  const packageTasks = [];
16
16
  for (const p of packages) {
17
- // if (p.json.scripts) {
18
- const childTask = this._prepareScriptTask(p, options);
19
- if (childTask) {
20
- packageTasks.push(childTask);
17
+ if (p.json.scripts) {
18
+ const childTask = this._prepareScriptTask(p, options);
19
+ if (childTask) {
20
+ packageTasks.push(childTask);
21
+ }
21
22
  }
22
- // }
23
23
  }
24
24
  const rootTask = this._prepareScriptTask(this.repository.rootPackage);
25
25
  const children = rootTask?.options.children;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rman",
3
3
  "description": "Monorepo repository manager",
4
- "version": "0.36.0",
4
+ "version": "0.36.2",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
7
7
  "dependencies": {