rman 0.36.3 → 0.37.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.
Files changed (78) hide show
  1. package/{esm/commands → commands}/build-command.js +2 -1
  2. package/{esm/commands → commands}/changed-command.js +2 -1
  3. package/{esm/commands → commands}/ci-command.js +2 -1
  4. package/{esm/commands → commands}/execute-command.js +4 -1
  5. package/{esm/commands → commands}/info-command.js +1 -1
  6. package/{esm/commands → commands}/list-command.js +2 -1
  7. package/{esm/commands → commands}/multi-task-command.js +2 -0
  8. package/{types/commands → commands}/publish-command.d.ts +1 -0
  9. package/{esm/commands → commands}/publish-command.js +7 -1
  10. package/{esm/commands → commands}/run-command.js +3 -1
  11. package/{esm/commands → commands}/version-command.js +4 -2
  12. package/{esm/core → core}/command.js +5 -3
  13. package/{esm/core → core}/package.js +3 -1
  14. package/{types/core → core}/repository.d.ts +2 -1
  15. package/{esm/core → core}/repository.js +22 -9
  16. package/package.json +16 -33
  17. package/{esm/utils → utils}/git-utils.js +1 -0
  18. package/{esm/utils → utils}/npm-utils.js +2 -0
  19. package/cjs/cli.js +0 -71
  20. package/cjs/commands/build-command.js +0 -27
  21. package/cjs/commands/changed-command.js +0 -35
  22. package/cjs/commands/ci-command.js +0 -72
  23. package/cjs/commands/execute-command.js +0 -74
  24. package/cjs/commands/info-command.js +0 -60
  25. package/cjs/commands/list-command.js +0 -138
  26. package/cjs/commands/multi-task-command.js +0 -68
  27. package/cjs/commands/publish-command.js +0 -130
  28. package/cjs/commands/run-command.js +0 -134
  29. package/cjs/commands/version-command.js +0 -198
  30. package/cjs/core/command.js +0 -119
  31. package/cjs/core/constants.js +0 -5
  32. package/cjs/core/logger.js +0 -5
  33. package/cjs/core/package.js +0 -42
  34. package/cjs/core/repository.js +0 -139
  35. package/cjs/index.js +0 -4
  36. package/cjs/package.json +0 -3
  37. package/cjs/tsconfig-build-cjs.tsbuildinfo +0 -1
  38. package/cjs/utils/exec.js +0 -109
  39. package/cjs/utils/file-utils.js +0 -34
  40. package/cjs/utils/get-dirname.js +0 -31
  41. package/cjs/utils/git-utils.js +0 -70
  42. package/cjs/utils/npm-run-path.js +0 -68
  43. package/cjs/utils/npm-utils.js +0 -36
  44. package/cjs/utils/package-not-found-error.js +0 -6
  45. package/esm/package.json +0 -3
  46. package/esm/tsconfig-build-esm.tsbuildinfo +0 -1
  47. package/types/index.d.cts +0 -1
  48. /package/{types/cli.d.ts → cli.d.ts} +0 -0
  49. /package/{esm/cli.js → cli.js} +0 -0
  50. /package/{types/commands → commands}/build-command.d.ts +0 -0
  51. /package/{types/commands → commands}/changed-command.d.ts +0 -0
  52. /package/{types/commands → commands}/ci-command.d.ts +0 -0
  53. /package/{types/commands → commands}/execute-command.d.ts +0 -0
  54. /package/{types/commands → commands}/info-command.d.ts +0 -0
  55. /package/{types/commands → commands}/list-command.d.ts +0 -0
  56. /package/{types/commands → commands}/multi-task-command.d.ts +0 -0
  57. /package/{types/commands → commands}/run-command.d.ts +0 -0
  58. /package/{types/commands → commands}/version-command.d.ts +0 -0
  59. /package/{types/core → core}/command.d.ts +0 -0
  60. /package/{types/core → core}/constants.d.ts +0 -0
  61. /package/{esm/core → core}/constants.js +0 -0
  62. /package/{types/core → core}/logger.d.ts +0 -0
  63. /package/{esm/core → core}/logger.js +0 -0
  64. /package/{types/core → core}/package.d.ts +0 -0
  65. /package/{types/index.d.ts → index.d.ts} +0 -0
  66. /package/{esm/index.js → index.js} +0 -0
  67. /package/{types/utils → utils}/exec.d.ts +0 -0
  68. /package/{esm/utils → utils}/exec.js +0 -0
  69. /package/{types/utils → utils}/file-utils.d.ts +0 -0
  70. /package/{esm/utils → utils}/file-utils.js +0 -0
  71. /package/{types/utils → utils}/get-dirname.d.ts +0 -0
  72. /package/{esm/utils → utils}/get-dirname.js +0 -0
  73. /package/{types/utils → utils}/git-utils.d.ts +0 -0
  74. /package/{types/utils → utils}/npm-run-path.d.ts +0 -0
  75. /package/{esm/utils → utils}/npm-run-path.js +0 -0
  76. /package/{types/utils → utils}/npm-utils.d.ts +0 -0
  77. /package/{types/utils → utils}/package-not-found-error.d.ts +0 -0
  78. /package/{esm/utils → utils}/package-not-found-error.js +0 -0
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDirname = getDirname;
4
- exports.getPackageJson = getPackageJson;
5
- const tslib_1 = require("tslib");
6
- const fs_1 = tslib_1.__importDefault(require("fs"));
7
- const path_1 = tslib_1.__importDefault(require("path"));
8
- function getDirname() {
9
- const pst = Error.prepareStackTrace;
10
- Error.prepareStackTrace = function (_, stack) {
11
- Error.prepareStackTrace = pst;
12
- return stack;
13
- };
14
- const e = new Error();
15
- if (!e.stack)
16
- throw Error('Can not parse stack');
17
- const stack = e.stack.slice(1);
18
- while (stack.length) {
19
- const frame = stack.shift();
20
- const filename = frame && frame.getFileName();
21
- if (filename)
22
- return path_1.default.dirname(filename).replace('file://', '');
23
- }
24
- throw Error('Can not parse stack');
25
- }
26
- function getPackageJson(dirname) {
27
- const f = path_1.default.resolve(dirname, 'package.json');
28
- if (!fs_1.default.existsSync(f))
29
- return;
30
- return JSON.parse(fs_1.default.readFileSync(f, 'utf-8'));
31
- }
@@ -1,70 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GitHelper = void 0;
4
- const tslib_1 = require("tslib");
5
- const path_1 = tslib_1.__importDefault(require("path"));
6
- const exec_js_1 = require("./exec.js");
7
- class GitHelper {
8
- constructor(options) {
9
- this.cwd = options?.cwd || process.cwd();
10
- }
11
- async listDirtyFileStatus(options) {
12
- const x = await (0, exec_js_1.exec)('git', {
13
- cwd: this.cwd,
14
- argv: ['status', '--porcelain'],
15
- });
16
- const result = [];
17
- const files = x.stdout ? x.stdout.trim().split(/\s*\n\s*/) : [];
18
- for (const f of files) {
19
- const m = f.match(/^(\w+) (.+)$/);
20
- if (m) {
21
- result.push({
22
- filename: options?.absolute ? path_1.default.join(this.cwd, m[2]) : m[2],
23
- status: m[1],
24
- });
25
- }
26
- }
27
- return result;
28
- }
29
- async listDirtyFiles(options) {
30
- return (await this.listDirtyFileStatus(options)).map(x => x.filename);
31
- }
32
- async listCommitSha() {
33
- const x = await (0, exec_js_1.exec)('git', {
34
- cwd: this.cwd,
35
- argv: ['cherry'],
36
- });
37
- const matches = x.stdout ? x.stdout.matchAll(/([a-f0-9]+)/gi) : [];
38
- const result = [];
39
- for (const m of matches) {
40
- result.push(m[1]);
41
- }
42
- return result;
43
- }
44
- async listCommittedFiles(options) {
45
- const shaArr = options?.commits
46
- ? Array.isArray(options?.commits)
47
- ? options?.commits
48
- : [options?.commits]
49
- : await this.listCommitSha();
50
- let result = [];
51
- for (const s of shaArr) {
52
- const x = await (0, exec_js_1.exec)('git', {
53
- cwd: this.cwd,
54
- argv: ['show', s, '--name-only', '--pretty="format:"'],
55
- });
56
- result.push(...(x.stdout ? x.stdout.trim().split(/\s*\n\s*/) : []));
57
- }
58
- if (options?.absolute)
59
- result = result.map(f => path_1.default.join(this.cwd, f));
60
- return result;
61
- }
62
- async readFileLastPublished(filePath, commitSha) {
63
- const x = await (0, exec_js_1.exec)('git', {
64
- cwd: this.cwd,
65
- argv: ['show', (commitSha || 'HEAD') + ':"' + filePath + '"'],
66
- });
67
- return x.stdout || '';
68
- }
69
- }
70
- exports.GitHelper = GitHelper;
@@ -1,68 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.npmRunPath = npmRunPath;
4
- exports.npmRunPathEnv = npmRunPathEnv;
5
- const tslib_1 = require("tslib");
6
- /**
7
- * Inspired from [npm-run-path](https://github.com/sindresorhus/npm-run-path)
8
- */
9
- const path_1 = tslib_1.__importDefault(require("path"));
10
- const process_1 = tslib_1.__importDefault(require("process"));
11
- /**
12
- Get your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) prepended with locally installed binaries.
13
- @returns The augmented path string.
14
- @example
15
- ```
16
- import childProcess from 'node:child_process';
17
- import {npmRunPath} from 'npm-run-path';
18
- console.log(process.env.PATH);
19
- //=> '/usr/local/bin'
20
- console.log(npmRunPath());
21
- //=> '/Users/sindresorhus/dev/foo/node_modules/.bin:/Users/sindresorhus/dev/node_modules/.bin:/Users/sindresorhus/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/usr/local/bin'
22
- ```
23
- */
24
- function npmRunPath(options = {}) {
25
- const cwd = options.cwd || process_1.default.cwd();
26
- const path_ = options.path || process_1.default.env[pathKey()];
27
- const execPath = options.execPath || process_1.default.execPath;
28
- let previous;
29
- let cwdPath = path_1.default.resolve(cwd);
30
- const result = [];
31
- while (previous !== cwdPath) {
32
- result.push(path_1.default.join(cwdPath, 'node_modules/.bin'));
33
- previous = cwdPath;
34
- cwdPath = path_1.default.resolve(cwdPath, '..');
35
- }
36
- // Ensure the running `node` binary is used.
37
- result.push(path_1.default.resolve(cwd, execPath, '..'));
38
- return [...result, path_].join(path_1.default.delimiter);
39
- }
40
- function pathKey(options) {
41
- const env = options?.env || process_1.default.env;
42
- const platform = options?.platform || process_1.default.platform;
43
- if (platform !== 'win32') {
44
- return 'PATH';
45
- }
46
- return (Object.keys(env)
47
- .reverse()
48
- .find(key => key.toUpperCase() === 'PATH') || 'Path');
49
- }
50
- /**
51
- @returns The augmented [`process.env`](https://nodejs.org/api/process.html#process_process_env) object.
52
- @example
53
- ```
54
- import childProcess from 'node:child_process';
55
- import {npmRunPathEnv} from 'npm-run-path';
56
- // `foo` is a locally installed binary
57
- childProcess.execFileSync('foo', {
58
- env: npmRunPathEnv()
59
- });
60
- ```
61
- */
62
- function npmRunPathEnv(options = {}) {
63
- const env = { ...(options.env || process_1.default.env) };
64
- const path_ = pathKey({ env });
65
- const opts = { ...options, path: env[path_] };
66
- env[path_] = npmRunPath(opts);
67
- return env;
68
- }
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NpmHelper = void 0;
4
- const tslib_1 = require("tslib");
5
- const path_1 = tslib_1.__importDefault(require("path"));
6
- const exec_js_1 = require("./exec.js");
7
- const package_not_found_error_js_1 = require("./package-not-found-error.js");
8
- class NpmHelper {
9
- constructor(options) {
10
- this.cwd = options?.cwd || process.cwd();
11
- this.userconfig = options?.userconfig ? path_1.default.resolve(this.cwd, options.userconfig) : undefined;
12
- }
13
- async getPackageInfo(packageName) {
14
- const argv = ['view', packageName, '--json'];
15
- if (this.userconfig)
16
- argv.push('--userconfig', this.userconfig);
17
- const x = await (0, exec_js_1.exec)('npm', { cwd: this.cwd, argv });
18
- if (x && x.stdout) {
19
- if (x.code && x.stdout.includes('404')) {
20
- throw new package_not_found_error_js_1.PackageNotFoundError('Package ' + packageName + ' not found in repository');
21
- }
22
- const b = x.stdout.indexOf('{');
23
- const e = x.stdout.lastIndexOf('}');
24
- const s = x.stdout.substring(b, e + 1);
25
- try {
26
- if (s)
27
- return JSON.parse(s);
28
- }
29
- catch {
30
- //
31
- }
32
- }
33
- throw new Error('Unable to fetch version info');
34
- }
35
- }
36
- exports.NpmHelper = NpmHelper;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PackageNotFoundError = void 0;
4
- class PackageNotFoundError extends Error {
5
- }
6
- exports.PackageNotFoundError = PackageNotFoundError;
package/esm/package.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
@@ -1 +0,0 @@
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","../../src/utils/package-not-found-error.ts"],"version":"5.7.3"}
package/types/index.d.cts DELETED
@@ -1 +0,0 @@
1
- export * from './core/repository.js';
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes