@lerna-lite/publish 1.3.0 → 1.5.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.
Files changed (52) hide show
  1. package/README.md +474 -466
  2. package/dist/index.d.ts +3 -3
  3. package/dist/index.js +19 -19
  4. package/dist/lib/create-temp-licenses.d.ts +7 -7
  5. package/dist/lib/create-temp-licenses.js +32 -32
  6. package/dist/lib/fetch-config.d.ts +10 -10
  7. package/dist/lib/fetch-config.js +21 -21
  8. package/dist/lib/get-current-sha.d.ts +6 -6
  9. package/dist/lib/get-current-sha.js +19 -19
  10. package/dist/lib/get-current-tags.d.ts +8 -8
  11. package/dist/lib/get-current-tags.js +35 -35
  12. package/dist/lib/get-npm-username.d.ts +7 -7
  13. package/dist/lib/get-npm-username.js +49 -49
  14. package/dist/lib/get-packages-without-license.d.ts +8 -8
  15. package/dist/lib/get-packages-without-license.js +23 -23
  16. package/dist/lib/get-packed.d.ts +3 -2
  17. package/dist/lib/get-packed.js +65 -65
  18. package/dist/lib/get-packed.js.map +1 -1
  19. package/dist/lib/get-profile-data.d.ts +7 -7
  20. package/dist/lib/get-profile-data.js +22 -22
  21. package/dist/lib/get-tagged-packages.d.ts +9 -9
  22. package/dist/lib/get-tagged-packages.js +29 -29
  23. package/dist/lib/get-two-factor-auth-required.d.ts +7 -7
  24. package/dist/lib/get-two-factor-auth-required.js +42 -42
  25. package/dist/lib/get-unpublished-packages.d.ts +8 -8
  26. package/dist/lib/get-unpublished-packages.js +36 -36
  27. package/dist/lib/get-whoami.d.ts +11 -11
  28. package/dist/lib/get-whoami.js +20 -20
  29. package/dist/lib/git-checkout.d.ts +10 -10
  30. package/dist/lib/git-checkout.js +20 -20
  31. package/dist/lib/index.d.ts +19 -19
  32. package/dist/lib/index.js +35 -35
  33. package/dist/lib/log-packed.d.ts +5 -2
  34. package/dist/lib/log-packed.js +71 -67
  35. package/dist/lib/log-packed.js.map +1 -1
  36. package/dist/lib/npm-dist-tag.d.ts +33 -33
  37. package/dist/lib/npm-dist-tag.js +139 -139
  38. package/dist/lib/npm-publish.d.ts +10 -10
  39. package/dist/lib/npm-publish.js +102 -102
  40. package/dist/lib/pack-directory.d.ts +8 -8
  41. package/dist/lib/pack-directory.js +66 -67
  42. package/dist/lib/pack-directory.js.map +1 -1
  43. package/dist/lib/remove-temp-licenses.d.ts +6 -6
  44. package/dist/lib/remove-temp-licenses.js +19 -19
  45. package/dist/lib/verify-npm-package-access.d.ts +9 -9
  46. package/dist/lib/verify-npm-package-access.js +55 -55
  47. package/dist/models/index.d.ts +32 -32
  48. package/dist/models/index.js +2 -2
  49. package/dist/publish-command.d.ts +64 -64
  50. package/dist/publish-command.js +654 -642
  51. package/dist/publish-command.js.map +1 -1
  52. package/package.json +10 -11
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './lib';
2
- export * from './models';
3
- export * from './publish-command';
1
+ export * from './lib';
2
+ export * from './models';
3
+ export * from './publish-command';
package/dist/index.js CHANGED
@@ -1,20 +1,20 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./lib"), exports);
18
- __exportStar(require("./models"), exports);
19
- __exportStar(require("./publish-command"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./lib"), exports);
18
+ __exportStar(require("./models"), exports);
19
+ __exportStar(require("./publish-command"), exports);
20
20
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
- import { Package } from '@lerna-lite/core';
2
- /**
3
- * Create temporary license files.
4
- * @param {string} srcLicensePath
5
- * @param {Packages[]} packagesToBeLicensed
6
- */
7
- export declare function createTempLicenses(srcLicensePath: string, packagesToBeLicensed: Package[]): Promise<any>;
1
+ import { Package } from '@lerna-lite/core';
2
+ /**
3
+ * Create temporary license files.
4
+ * @param {string} srcLicensePath
5
+ * @param {Packages[]} packagesToBeLicensed
6
+ */
7
+ export declare function createTempLicenses(srcLicensePath: string, packagesToBeLicensed: Package[]): Promise<any>;
@@ -1,33 +1,33 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createTempLicenses = void 0;
7
- const fs_extra_1 = __importDefault(require("fs-extra"));
8
- const path_1 = __importDefault(require("path"));
9
- const p_map_1 = __importDefault(require("p-map"));
10
- /**
11
- * Create temporary license files.
12
- * @param {string} srcLicensePath
13
- * @param {Packages[]} packagesToBeLicensed
14
- */
15
- function createTempLicenses(srcLicensePath, packagesToBeLicensed) {
16
- if (!srcLicensePath || !packagesToBeLicensed.length) {
17
- return Promise.resolve();
18
- }
19
- // license file might have an extension, so let's allow it
20
- const licenseFileName = path_1.default.basename(srcLicensePath);
21
- const options = {
22
- // make an effort to keep package contents stable over time
23
- preserveTimestamps: process.arch !== 'ia32',
24
- // (give up on 32-bit architecture to avoid fs-extra warning)
25
- };
26
- // store target path for removal later
27
- packagesToBeLicensed.forEach((pkg) => {
28
- pkg.licensePath = path_1.default.join(pkg.contents, licenseFileName);
29
- });
30
- return (0, p_map_1.default)(packagesToBeLicensed, (pkg) => fs_extra_1.default.copy(srcLicensePath, pkg.licensePath, options));
31
- }
32
- exports.createTempLicenses = createTempLicenses;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createTempLicenses = void 0;
7
+ const fs_extra_1 = __importDefault(require("fs-extra"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const p_map_1 = __importDefault(require("p-map"));
10
+ /**
11
+ * Create temporary license files.
12
+ * @param {string} srcLicensePath
13
+ * @param {Packages[]} packagesToBeLicensed
14
+ */
15
+ function createTempLicenses(srcLicensePath, packagesToBeLicensed) {
16
+ if (!srcLicensePath || !packagesToBeLicensed.length) {
17
+ return Promise.resolve();
18
+ }
19
+ // license file might have an extension, so let's allow it
20
+ const licenseFileName = path_1.default.basename(srcLicensePath);
21
+ const options = {
22
+ // make an effort to keep package contents stable over time
23
+ preserveTimestamps: process.arch !== 'ia32',
24
+ // (give up on 32-bit architecture to avoid fs-extra warning)
25
+ };
26
+ // store target path for removal later
27
+ packagesToBeLicensed.forEach((pkg) => {
28
+ pkg.licensePath = path_1.default.join(pkg.contents, licenseFileName);
29
+ });
30
+ return (0, p_map_1.default)(packagesToBeLicensed, (pkg) => fs_extra_1.default.copy(srcLicensePath, pkg.licensePath, options));
31
+ }
32
+ exports.createTempLicenses = createTempLicenses;
33
33
  //# sourceMappingURL=create-temp-licenses.js.map
@@ -1,10 +1,10 @@
1
- import { FetchConfig } from '@lerna-lite/core';
2
- /**
3
- * Create a merged options object suitable for npm-registry-fetch.
4
- * @param {{ [key: string]: unknown }} options
5
- * @param {Partial<FetchConfig>} [extra]
6
- * @returns {FetchConfig}
7
- */
8
- export declare function getFetchConfig(options: {
9
- [key: string]: any;
10
- }, extra: Partial<FetchConfig>): FetchConfig;
1
+ import { FetchConfig } from '@lerna-lite/core';
2
+ /**
3
+ * Create a merged options object suitable for npm-registry-fetch.
4
+ * @param {{ [key: string]: unknown }} options
5
+ * @param {Partial<FetchConfig>} [extra]
6
+ * @returns {FetchConfig}
7
+ */
8
+ export declare function getFetchConfig(options: {
9
+ [key: string]: any;
10
+ }, extra: Partial<FetchConfig>): FetchConfig;
@@ -1,22 +1,22 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getFetchConfig = void 0;
7
- const npmlog_1 = __importDefault(require("npmlog"));
8
- /**
9
- * Create a merged options object suitable for npm-registry-fetch.
10
- * @param {{ [key: string]: unknown }} options
11
- * @param {Partial<FetchConfig>} [extra]
12
- * @returns {FetchConfig}
13
- */
14
- function getFetchConfig(options, extra) {
15
- return {
16
- log: npmlog_1.default,
17
- ...options,
18
- ...extra,
19
- };
20
- }
21
- exports.getFetchConfig = getFetchConfig;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getFetchConfig = void 0;
7
+ const npmlog_1 = __importDefault(require("npmlog"));
8
+ /**
9
+ * Create a merged options object suitable for npm-registry-fetch.
10
+ * @param {{ [key: string]: unknown }} options
11
+ * @param {Partial<FetchConfig>} [extra]
12
+ * @returns {FetchConfig}
13
+ */
14
+ function getFetchConfig(options, extra) {
15
+ return {
16
+ log: npmlog_1.default,
17
+ ...options,
18
+ ...extra,
19
+ };
20
+ }
21
+ exports.getFetchConfig = getFetchConfig;
22
22
  //# sourceMappingURL=fetch-config.js.map
@@ -1,6 +1,6 @@
1
- import { ExecOpts } from '@lerna-lite/core';
2
- /**
3
- * Retrieve current SHA from git.
4
- * @param {import("@lerna/child-process").ExecOpts} opts
5
- */
6
- export declare function getCurrentSHA(opts: ExecOpts, gitDryRun?: boolean): string;
1
+ import { ExecOpts } from '@lerna-lite/core';
2
+ /**
3
+ * Retrieve current SHA from git.
4
+ * @param {import("@lerna/child-process").ExecOpts} opts
5
+ */
6
+ export declare function getCurrentSHA(opts: ExecOpts, gitDryRun?: boolean): string;
@@ -1,20 +1,20 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getCurrentSHA = void 0;
7
- const npmlog_1 = __importDefault(require("npmlog"));
8
- const core_1 = require("@lerna-lite/core");
9
- /**
10
- * Retrieve current SHA from git.
11
- * @param {import("@lerna/child-process").ExecOpts} opts
12
- */
13
- function getCurrentSHA(opts, gitDryRun = false) {
14
- npmlog_1.default.silly('getCurrentSHA', '');
15
- const sha = (0, core_1.execSync)('git', ['rev-parse', 'HEAD'], opts, gitDryRun);
16
- npmlog_1.default.verbose('getCurrentSHA', sha);
17
- return sha;
18
- }
19
- exports.getCurrentSHA = getCurrentSHA;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getCurrentSHA = void 0;
7
+ const npmlog_1 = __importDefault(require("npmlog"));
8
+ const core_1 = require("@lerna-lite/core");
9
+ /**
10
+ * Retrieve current SHA from git.
11
+ * @param {import("@lerna/child-process").ExecOpts} opts
12
+ */
13
+ function getCurrentSHA(opts, gitDryRun = false) {
14
+ npmlog_1.default.silly('getCurrentSHA', '');
15
+ const sha = (0, core_1.execSync)('git', ['rev-parse', 'HEAD'], opts, gitDryRun);
16
+ npmlog_1.default.verbose('getCurrentSHA', sha);
17
+ return sha;
18
+ }
19
+ exports.getCurrentSHA = getCurrentSHA;
20
20
  //# sourceMappingURL=get-current-sha.js.map
@@ -1,8 +1,8 @@
1
- import { ExecOpts } from '@lerna-lite/core';
2
- /**
3
- * Retrieve a list of git tags pointing to the current HEAD that match the provided pattern.
4
- * @param {import("@lerna/child-process").ExecOpts} execOpts
5
- * @param {string} matchingPattern
6
- * @returns {string[]}
7
- */
8
- export declare function getCurrentTags(execOpts: ExecOpts, matchingPattern: string, gitDryRun?: boolean): Promise<string[]>;
1
+ import { ExecOpts } from '@lerna-lite/core';
2
+ /**
3
+ * Retrieve a list of git tags pointing to the current HEAD that match the provided pattern.
4
+ * @param {import("@lerna/child-process").ExecOpts} execOpts
5
+ * @param {string} matchingPattern
6
+ * @returns {string[]}
7
+ */
8
+ export declare function getCurrentTags(execOpts: ExecOpts, matchingPattern: string, gitDryRun?: boolean): Promise<string[]>;
@@ -1,36 +1,36 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getCurrentTags = void 0;
7
- const npmlog_1 = __importDefault(require("npmlog"));
8
- const npm_package_arg_1 = __importDefault(require("npm-package-arg"));
9
- const core_1 = require("@lerna-lite/core");
10
- /**
11
- * Retrieve a list of git tags pointing to the current HEAD that match the provided pattern.
12
- * @param {import("@lerna/child-process").ExecOpts} execOpts
13
- * @param {string} matchingPattern
14
- * @returns {string[]}
15
- */
16
- function getCurrentTags(execOpts, matchingPattern, gitDryRun = false) {
17
- npmlog_1.default.silly('getCurrentTags', 'matching %j', matchingPattern);
18
- const opts = Object.assign({}, execOpts, {
19
- // don't reject due to non-zero exit code when there are no results
20
- reject: false,
21
- });
22
- return (0, core_1.exec)('git', ['tag', '--sort', 'version:refname', '--points-at', 'HEAD', '--list', matchingPattern], opts, gitDryRun)
23
- .then((result) => {
24
- const lines = result.stdout.split('\n').filter(Boolean);
25
- if (matchingPattern === '*@*') {
26
- // independent mode does not respect tagVersionPrefix,
27
- // but embeds the package name in the tag "prefix"
28
- return lines.map((tag) => (0, npm_package_arg_1.default)(tag).name);
29
- }
30
- // "fixed" mode can have a custom tagVersionPrefix,
31
- // but it doesn't really matter as it is not used to extract package names
32
- return lines;
33
- });
34
- }
35
- exports.getCurrentTags = getCurrentTags;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getCurrentTags = void 0;
7
+ const npmlog_1 = __importDefault(require("npmlog"));
8
+ const npm_package_arg_1 = __importDefault(require("npm-package-arg"));
9
+ const core_1 = require("@lerna-lite/core");
10
+ /**
11
+ * Retrieve a list of git tags pointing to the current HEAD that match the provided pattern.
12
+ * @param {import("@lerna/child-process").ExecOpts} execOpts
13
+ * @param {string} matchingPattern
14
+ * @returns {string[]}
15
+ */
16
+ function getCurrentTags(execOpts, matchingPattern, gitDryRun = false) {
17
+ npmlog_1.default.silly('getCurrentTags', 'matching %j', matchingPattern);
18
+ const opts = Object.assign({}, execOpts, {
19
+ // don't reject due to non-zero exit code when there are no results
20
+ reject: false,
21
+ });
22
+ return (0, core_1.exec)('git', ['tag', '--sort', 'version:refname', '--points-at', 'HEAD', '--list', matchingPattern], opts, gitDryRun)
23
+ .then((result) => {
24
+ const lines = result.stdout.split('\n').filter(Boolean);
25
+ if (matchingPattern === '*@*') {
26
+ // independent mode does not respect tagVersionPrefix,
27
+ // but embeds the package name in the tag "prefix"
28
+ return lines.map((tag) => (0, npm_package_arg_1.default)(tag).name);
29
+ }
30
+ // "fixed" mode can have a custom tagVersionPrefix,
31
+ // but it doesn't really matter as it is not used to extract package names
32
+ return lines;
33
+ });
34
+ }
35
+ exports.getCurrentTags = getCurrentTags;
36
36
  //# sourceMappingURL=get-current-tags.js.map
@@ -1,7 +1,7 @@
1
- import { FetchConfig } from '@lerna-lite/core';
2
- /**
3
- * Retrieve username of logged-in user.
4
- * @param {import("./fetch-config").FetchConfig} options
5
- * @returns {Promise<string>}
6
- */
7
- export declare function getNpmUsername(options: FetchConfig): Promise<string | undefined>;
1
+ import { FetchConfig } from '@lerna-lite/core';
2
+ /**
3
+ * Retrieve username of logged-in user.
4
+ * @param {import("./fetch-config").FetchConfig} options
5
+ * @returns {Promise<string>}
6
+ */
7
+ export declare function getNpmUsername(options: FetchConfig): Promise<string | undefined>;
@@ -1,50 +1,50 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getNpmUsername = void 0;
4
- const fetch_config_1 = require("./fetch-config");
5
- const get_profile_data_1 = require("./get-profile-data");
6
- const get_whoami_1 = require("./get-whoami");
7
- const core_1 = require("@lerna-lite/core");
8
- /**
9
- * Retrieve username of logged-in user.
10
- * @param {import("./fetch-config").FetchConfig} options
11
- * @returns {Promise<string>}
12
- */
13
- function getNpmUsername(options) {
14
- const opts = (0, fetch_config_1.getFetchConfig)(options, {
15
- // don't wait forever for third-party failures to be dealt with
16
- fetchRetries: 0,
17
- });
18
- opts.log.info('', 'Verifying npm credentials');
19
- return (0, get_profile_data_1.getProfileData)(opts)
20
- .catch((err) => {
21
- // Many third-party registries do not implement the user endpoint
22
- // Legacy npm Enterprise returns E500 instead of E404
23
- if (err.code === 'E500' || err.code === 'E404') {
24
- return (0, get_whoami_1.getWhoAmI)(opts);
25
- }
26
- // re-throw 401 Unauthorized (and all other unexpected errors)
27
- throw err;
28
- })
29
- .then(success, failure);
30
- function success(result) {
31
- opts.log.silly('get npm username', 'received %j', result);
32
- if (!result.username) {
33
- throw new core_1.ValidationError('ENEEDAUTH', 'You must be logged in to publish packages. Use `npm login` and try again.');
34
- }
35
- return result.username;
36
- }
37
- // catch request errors, not auth expired errors
38
- function failure(err) {
39
- // Log the error cleanly to stderr
40
- opts.log.pause();
41
- console.error(err.message); // eslint-disable-line no-console
42
- opts.log.resume();
43
- if (opts.registry === 'https://registry.npmjs.org/') {
44
- throw new core_1.ValidationError('EWHOAMI', 'Authentication error. Use `npm whoami` to troubleshoot.');
45
- }
46
- opts.log.warn('EWHOAMI', 'Unable to determine npm username from third-party registry, this command will likely fail soon!');
47
- }
48
- }
49
- exports.getNpmUsername = getNpmUsername;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getNpmUsername = void 0;
4
+ const fetch_config_1 = require("./fetch-config");
5
+ const get_profile_data_1 = require("./get-profile-data");
6
+ const get_whoami_1 = require("./get-whoami");
7
+ const core_1 = require("@lerna-lite/core");
8
+ /**
9
+ * Retrieve username of logged-in user.
10
+ * @param {import("./fetch-config").FetchConfig} options
11
+ * @returns {Promise<string>}
12
+ */
13
+ function getNpmUsername(options) {
14
+ const opts = (0, fetch_config_1.getFetchConfig)(options, {
15
+ // don't wait forever for third-party failures to be dealt with
16
+ fetchRetries: 0,
17
+ });
18
+ opts.log.info('', 'Verifying npm credentials');
19
+ return (0, get_profile_data_1.getProfileData)(opts)
20
+ .catch((err) => {
21
+ // Many third-party registries do not implement the user endpoint
22
+ // Legacy npm Enterprise returns E500 instead of E404
23
+ if (err.code === 'E500' || err.code === 'E404') {
24
+ return (0, get_whoami_1.getWhoAmI)(opts);
25
+ }
26
+ // re-throw 401 Unauthorized (and all other unexpected errors)
27
+ throw err;
28
+ })
29
+ .then(success, failure);
30
+ function success(result) {
31
+ opts.log.silly('get npm username', 'received %j', result);
32
+ if (!result.username) {
33
+ throw new core_1.ValidationError('ENEEDAUTH', 'You must be logged in to publish packages. Use `npm login` and try again.');
34
+ }
35
+ return result.username;
36
+ }
37
+ // catch request errors, not auth expired errors
38
+ function failure(err) {
39
+ // Log the error cleanly to stderr
40
+ opts.log.pause();
41
+ console.error(err.message); // eslint-disable-line no-console
42
+ opts.log.resume();
43
+ if (opts.registry === 'https://registry.npmjs.org/') {
44
+ throw new core_1.ValidationError('EWHOAMI', 'Authentication error. Use `npm whoami` to troubleshoot.');
45
+ }
46
+ opts.log.warn('EWHOAMI', 'Unable to determine npm username from third-party registry, this command will likely fail soon!');
47
+ }
48
+ }
49
+ exports.getNpmUsername = getNpmUsername;
50
50
  //# sourceMappingURL=get-npm-username.js.map
@@ -1,8 +1,8 @@
1
- import { Package, Project } from '@lerna-lite/core';
2
- /**
3
- * Retrieve a list of packages that lack a license file.
4
- * @param {Project} project
5
- * @param {Package[]} packagesToPublish
6
- * @returns {Package[]}
7
- */
8
- export declare function getPackagesWithoutLicense(project: Project, packagesToPublish: Package[]): Promise<Package[]>;
1
+ import { Package, Project } from '@lerna-lite/core';
2
+ /**
3
+ * Retrieve a list of packages that lack a license file.
4
+ * @param {Project} project
5
+ * @param {Package[]} packagesToPublish
6
+ * @returns {Package[]}
7
+ */
8
+ export declare function getPackagesWithoutLicense(project: Project, packagesToPublish: Package[]): Promise<Package[]>;
@@ -1,24 +1,24 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getPackagesWithoutLicense = void 0;
7
- const path_1 = __importDefault(require("path"));
8
- /**
9
- * Retrieve a list of packages that lack a license file.
10
- * @param {Project} project
11
- * @param {Package[]} packagesToPublish
12
- * @returns {Package[]}
13
- */
14
- function getPackagesWithoutLicense(project, packagesToPublish) {
15
- return project.getPackageLicensePaths().then((licensePaths) => {
16
- // this assumes any existing license is a sibling of package.json, which is pretty safe
17
- // it also dedupes package locations, since we don't care about duplicate license files
18
- const licensed = new Set(licensePaths.map((lp) => path_1.default.dirname(lp)));
19
- return packagesToPublish.filter((pkg) => !licensed.has(pkg.location));
20
- });
21
- }
22
- exports.getPackagesWithoutLicense = getPackagesWithoutLicense;
23
- module.exports.getPackagesWithoutLicense = getPackagesWithoutLicense;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getPackagesWithoutLicense = void 0;
7
+ const path_1 = __importDefault(require("path"));
8
+ /**
9
+ * Retrieve a list of packages that lack a license file.
10
+ * @param {Project} project
11
+ * @param {Package[]} packagesToPublish
12
+ * @returns {Package[]}
13
+ */
14
+ function getPackagesWithoutLicense(project, packagesToPublish) {
15
+ return project.getPackageLicensePaths().then((licensePaths) => {
16
+ // this assumes any existing license is a sibling of package.json, which is pretty safe
17
+ // it also dedupes package locations, since we don't care about duplicate license files
18
+ const licensed = new Set(licensePaths.map((lp) => path_1.default.dirname(lp)));
19
+ return packagesToPublish.filter((pkg) => !licensed.has(pkg.location));
20
+ });
21
+ }
22
+ exports.getPackagesWithoutLicense = getPackagesWithoutLicense;
23
+ module.exports.getPackagesWithoutLicense = getPackagesWithoutLicense;
24
24
  //# sourceMappingURL=get-packages-without-license.js.map
@@ -1,2 +1,3 @@
1
- import { Package } from '@lerna-lite/core';
2
- export declare function getPacked(pkg: Package, tarFilePath: string): any;
1
+ import { Package } from '@lerna-lite/core';
2
+ import { Tarball } from '../models';
3
+ export declare function getPacked(pkg: Package, tarFilePath: string): Promise<Tarball>;