@lerna-lite/publish 1.16.2 → 2.0.0-alpha.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.
- package/README.md +9 -44
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -6
- package/dist/index.js.map +1 -1
- package/dist/lib/create-temp-licenses.js +7 -12
- package/dist/lib/create-temp-licenses.js.map +1 -1
- package/dist/lib/fetch-config.js +3 -8
- package/dist/lib/fetch-config.js.map +1 -1
- package/dist/lib/get-current-sha.js +6 -11
- package/dist/lib/get-current-sha.js.map +1 -1
- package/dist/lib/get-current-tags.js +7 -12
- package/dist/lib/get-current-tags.js.map +1 -1
- package/dist/lib/get-npm-username.js +11 -15
- package/dist/lib/get-npm-username.js.map +1 -1
- package/dist/lib/get-packages-without-license.js +3 -8
- package/dist/lib/get-packages-without-license.js.map +1 -1
- package/dist/lib/get-packed.d.ts +1 -1
- package/dist/lib/get-packed.js +12 -16
- package/dist/lib/get-packed.js.map +1 -1
- package/dist/lib/get-profile-data.js +4 -9
- package/dist/lib/get-profile-data.js.map +1 -1
- package/dist/lib/get-tagged-packages.js +8 -13
- package/dist/lib/get-tagged-packages.js.map +1 -1
- package/dist/lib/get-two-factor-auth-required.js +7 -11
- package/dist/lib/get-two-factor-auth-required.js.map +1 -1
- package/dist/lib/get-unpublished-packages.js +13 -21
- package/dist/lib/get-unpublished-packages.js.map +1 -1
- package/dist/lib/get-whoami.js +4 -9
- package/dist/lib/get-whoami.js.map +1 -1
- package/dist/lib/git-checkout.js +5 -10
- package/dist/lib/git-checkout.js.map +1 -1
- package/dist/lib/index.d.ts +19 -19
- package/dist/lib/index.js +19 -22
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/log-packed.d.ts +1 -1
- package/dist/lib/log-packed.js +28 -34
- package/dist/lib/log-packed.js.map +1 -1
- package/dist/lib/npm-dist-tag.d.ts +1 -1
- package/dist/lib/npm-dist-tag.js +21 -30
- package/dist/lib/npm-dist-tag.js.map +1 -1
- package/dist/lib/npm-publish.d.ts +1 -1
- package/dist/lib/npm-publish.js +18 -24
- package/dist/lib/npm-publish.js.map +1 -1
- package/dist/lib/override-publish-config.js +4 -8
- package/dist/lib/override-publish-config.js.map +1 -1
- package/dist/lib/pack-directory.d.ts +1 -1
- package/dist/lib/pack-directory.js +22 -27
- package/dist/lib/pack-directory.js.map +1 -1
- package/dist/lib/remove-temp-licenses.js +4 -9
- package/dist/lib/remove-temp-licenses.js.map +1 -1
- package/dist/lib/verify-npm-package-access.js +9 -14
- package/dist/lib/verify-npm-package-access.js.map +1 -1
- package/dist/models/index.js +1 -2
- package/dist/publish-command.d.ts +0 -1
- package/dist/publish-command.js +121 -160
- package/dist/publish-command.js.map +1 -1
- package/package.json +38 -21
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# @lerna-lite/publish
|
|
6
6
|
|
|
7
|
-
## (`lerna publish`) - Publish command ☁️
|
|
7
|
+
## (`lerna publish`) - Publish command [optional] ☁️
|
|
8
8
|
|
|
9
9
|
Lerna-Lite Publish command, publish package(s) in the current project
|
|
10
10
|
|
|
@@ -13,8 +13,7 @@ Lerna-Lite Publish command, publish package(s) in the current project
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
|
-
|
|
17
|
-
npm install @lerna-lite/cli -D -W
|
|
16
|
+
npm install @lerna-lite/publish -D -W
|
|
18
17
|
|
|
19
18
|
# then use it (see usage below)
|
|
20
19
|
lerna publish
|
|
@@ -31,7 +30,8 @@ lerna publish from-package # explicitly publish packages where the latest versi
|
|
|
31
30
|
When run, this command does one of the following things:
|
|
32
31
|
|
|
33
32
|
- Publish packages updated since the last release (calling [`lerna version`](https://github.com/lerna-lite/lerna-lite/blob/main/packages/version/README.md) behind the scenes).
|
|
34
|
-
- This is the legacy behavior of lerna 2.x
|
|
33
|
+
- This is the legacy behavior of lerna 2.x.
|
|
34
|
+
- The package updated since the last release will be found based on the `describeTag` pattern (For details, refer to [`lerna version`](https://github.com/lerna-lite/lerna-lite/blob/main/packages/version/README.md#--describe-tag-pattern)).
|
|
35
35
|
- Publish packages tagged in the current commit (`from-git`).
|
|
36
36
|
- Publish packages in the latest commit where the version is not present in the registry (`from-package`).
|
|
37
37
|
- Publish an unversioned "canary" release of packages (and their dependents) updated in the previous commit.
|
|
@@ -71,7 +71,7 @@ This is useful when a previous `lerna publish` failed to publish all packages to
|
|
|
71
71
|
- [semver `--bump from-package`](#semver--bump-from-package)
|
|
72
72
|
- [Options](#options)
|
|
73
73
|
- [`--canary`](#--canary)
|
|
74
|
-
- [`--cleanup-temp-files`](#--cleanup-temp-files)
|
|
74
|
+
- [`--cleanup-temp-files`](#--cleanup-temp-files)
|
|
75
75
|
- [`--contents <dir>`](#--contents-dir)
|
|
76
76
|
- [`--dist-tag <tag>`](#--dist-tag-tag)
|
|
77
77
|
- [`--force-publish`](#--force-publish)
|
|
@@ -85,17 +85,15 @@ This is useful when a previous `lerna publish` failed to publish all packages to
|
|
|
85
85
|
- [`--otp`](#--otp)
|
|
86
86
|
- [`--preid`](#--preid)
|
|
87
87
|
- [`--pre-dist-tag <tag>`](#--pre-dist-tag-tag)
|
|
88
|
-
- [`--remove-package-fields <fields>`](#--remove-package-fields-fields)
|
|
88
|
+
- [`--remove-package-fields <fields>`](#--remove-package-fields-fields)
|
|
89
89
|
- [`--registry <url>`](#--registry-url)
|
|
90
90
|
- [`--tag-version-prefix`](#--tag-version-prefix)
|
|
91
91
|
- [`--temp-tag`](#--temp-tag)
|
|
92
|
-
- [`--summary-file <dir>`](#--summary-file)
|
|
92
|
+
- [`--summary-file <dir>`](#--summary-file)
|
|
93
93
|
- [`--verify-access`](#--verify-access)
|
|
94
94
|
- [`--yes`](#--yes)
|
|
95
95
|
- [`publishConfig` Overrides](#publishconfig-overrides)
|
|
96
96
|
- [`workspace:` protocol](#workspace-protocol)
|
|
97
|
-
- [`--workspace-strict-match (default)`](#with---workspace-strict-match-default)
|
|
98
|
-
- [`--no-workspace-strict-match`](#with---no-workspace-strict-match-deprecated)
|
|
99
97
|
|
|
100
98
|
### `--canary`
|
|
101
99
|
|
|
@@ -553,11 +551,9 @@ So for example, if we have `foo`, `bar`, `qar`, `zoo` in the workspace and they
|
|
|
553
551
|
|
|
554
552
|
> **Note** semver range with an operator (ie `workspace:>=2.0.0`) are also supported but will never be mutated.
|
|
555
553
|
|
|
556
|
-
####
|
|
554
|
+
#### versions that will be published
|
|
557
555
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
_this is the default and is usually what most user will want to use since it will strictly adhere to pnpm/yarn workspace protocol._
|
|
556
|
+
The library is doing a strict match and it will transform and publish the following:
|
|
561
557
|
|
|
562
558
|
```json
|
|
563
559
|
{
|
|
@@ -570,23 +566,6 @@ _this is the default and is usually what most user will want to use since it wil
|
|
|
570
566
|
}
|
|
571
567
|
```
|
|
572
568
|
|
|
573
|
-
#### with `--no-workspace-strict-match` (deprecated)
|
|
574
|
-
|
|
575
|
-
When strict match is disabled, it will be transformed and publish with the following:
|
|
576
|
-
|
|
577
|
-
_you would rarely want to disable the strict match, in fact this option will be removed entirely in a future release, this flag was created for the sole purpose of making it compatible with previous Lerna-Lite version `1.2.0`. When disabled, in most cases Lerna will assume that the caret (^) is needed unless the option [--exact](https://github.com/lerna-lite/lerna-lite/tree/main/packages/version#--exact) is provided and by doing so will not be strictly following pnpm/yarn workspace protocol and for that reason is not recommended._
|
|
578
|
-
|
|
579
|
-
```json
|
|
580
|
-
{
|
|
581
|
-
"dependencies": {
|
|
582
|
-
"foo": "^1.5.0",
|
|
583
|
-
"bar": "^1.5.0",
|
|
584
|
-
"qar": "^1.5.0",
|
|
585
|
-
"zoo": "^1.5.0"
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
```
|
|
589
|
-
|
|
590
569
|
## FAQ
|
|
591
570
|
|
|
592
571
|
### Recovering from a network error
|
|
@@ -594,17 +573,3 @@ _you would rarely want to disable the strict match, in fact this option will be
|
|
|
594
573
|
In the case that some packages were successfully published and others were not, `lerna publish` may have left the repository in an inconsistent state with some changed files. To recover from this, reset any extraneous local changes from the failed run to get back to a clean working tree. Then, retry the same `lerna publish` command. Lerna will attempt to publish all of the packages again, but will recognize those that have already been published and skip over them with a warning.
|
|
595
574
|
|
|
596
575
|
If you used the `lerna publish` command without positional arguments to select a new version for the packages, then you can run `lerna publish from-git` to retry publishing that same already-tagged version instead of having to bump the version again while retrying.
|
|
597
|
-
|
|
598
|
-
## Deprecated Options
|
|
599
|
-
|
|
600
|
-
### `--no-verify-access`
|
|
601
|
-
|
|
602
|
-
The legacy preemptive access verification is now off by default, so `--no-verify-access` is not needed. Requests will fail with appropriate errors when not authorized correctly. To opt-in to the legacy access verification, use [`--verify-access`](#--verify-access).
|
|
603
|
-
|
|
604
|
-
### `--skip-npm`
|
|
605
|
-
|
|
606
|
-
Call [`lerna version`](https://github.com/lerna/lerna/tree/main/commands/version#readme) directly, instead.
|
|
607
|
-
|
|
608
|
-
### `--no-workspace-strict-match`
|
|
609
|
-
|
|
610
|
-
Providing --no-workspace-strict-match is deprecated and will be removed in future version, we will make `workspace:` protocol strict matching in every case.
|
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/index.js';
|
|
2
|
+
export * from './models/index.js';
|
|
3
|
+
export * from './publish-command.js';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
tslib_1.__exportStar(require("./lib"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./models"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./publish-command"), exports);
|
|
1
|
+
export * from './lib/index.js';
|
|
2
|
+
export * from './models/index.js';
|
|
3
|
+
export * from './publish-command.js';
|
|
7
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
6
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
|
-
const p_map_1 = tslib_1.__importDefault(require("p-map"));
|
|
1
|
+
import { copy } from 'fs-extra/esm';
|
|
2
|
+
import { basename, join } from 'node:path';
|
|
3
|
+
import pMap from 'p-map';
|
|
8
4
|
/**
|
|
9
5
|
* Create temporary license files.
|
|
10
6
|
* @param {string} srcLicensePath
|
|
11
7
|
* @param {Packages[]} packagesToBeLicensed
|
|
12
8
|
*/
|
|
13
|
-
function createTempLicenses(srcLicensePath, packagesToBeLicensed) {
|
|
9
|
+
export function createTempLicenses(srcLicensePath, packagesToBeLicensed) {
|
|
14
10
|
if (!srcLicensePath || !packagesToBeLicensed.length) {
|
|
15
11
|
return Promise.resolve();
|
|
16
12
|
}
|
|
17
13
|
// license file might have an extension, so let's allow it
|
|
18
|
-
const licenseFileName =
|
|
14
|
+
const licenseFileName = basename(srcLicensePath);
|
|
19
15
|
const options = {
|
|
20
16
|
// make an effort to keep package contents stable over time
|
|
21
17
|
preserveTimestamps: process.arch !== 'ia32',
|
|
@@ -23,9 +19,8 @@ function createTempLicenses(srcLicensePath, packagesToBeLicensed) {
|
|
|
23
19
|
};
|
|
24
20
|
// store target path for removal later
|
|
25
21
|
packagesToBeLicensed.forEach((pkg) => {
|
|
26
|
-
pkg.licensePath =
|
|
22
|
+
pkg.licensePath = join(pkg.contents, licenseFileName);
|
|
27
23
|
});
|
|
28
|
-
return (
|
|
24
|
+
return pMap(packagesToBeLicensed, (pkg) => copy(srcLicensePath, pkg.licensePath, options));
|
|
29
25
|
}
|
|
30
|
-
exports.createTempLicenses = createTempLicenses;
|
|
31
26
|
//# sourceMappingURL=create-temp-licenses.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-temp-licenses.js","sourceRoot":"","sources":["../../src/lib/create-temp-licenses.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-temp-licenses.js","sourceRoot":"","sources":["../../src/lib/create-temp-licenses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,IAAI,MAAM,OAAO,CAAC;AAIzB;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,cAAsB,EAAE,oBAA+B;IACxF,IAAI,CAAC,cAAc,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE;QACnD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;KAC1B;IAED,0DAA0D;IAC1D,MAAM,eAAe,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IACjD,MAAM,OAAO,GAAG;QACd,2DAA2D;QAC3D,kBAAkB,EAAE,OAAO,CAAC,IAAI,KAAK,MAAM;QAC3C,6DAA6D;KAC9D,CAAC;IAEF,sCAAsC;IACtC,oBAAoB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACnC,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC,oBAAoB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;AAC7F,CAAC"}
|
package/dist/lib/fetch-config.js
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFetchConfig = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const npmlog_1 = tslib_1.__importDefault(require("npmlog"));
|
|
1
|
+
import log from 'npmlog';
|
|
6
2
|
/**
|
|
7
3
|
* Create a merged options object suitable for npm-registry-fetch.
|
|
8
4
|
* @param {{ [key: string]: unknown }} options
|
|
9
5
|
* @param {Partial<FetchConfig>} [extra]
|
|
10
6
|
* @returns {FetchConfig}
|
|
11
7
|
*/
|
|
12
|
-
function getFetchConfig(options, extra) {
|
|
8
|
+
export function getFetchConfig(options, extra) {
|
|
13
9
|
return {
|
|
14
|
-
log
|
|
10
|
+
log,
|
|
15
11
|
...options,
|
|
16
12
|
...extra,
|
|
17
13
|
};
|
|
18
14
|
}
|
|
19
|
-
exports.getFetchConfig = getFetchConfig;
|
|
20
15
|
//# sourceMappingURL=fetch-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-config.js","sourceRoot":"","sources":["../../src/lib/fetch-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetch-config.js","sourceRoot":"","sources":["../../src/lib/fetch-config.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,QAAQ,CAAC;AAEzB;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,OAAgC,EAAE,KAA4B;IAC3F,OAAO;QACL,GAAG;QACH,GAAG,OAAO;QACV,GAAG,KAAK;KACM,CAAC;AACnB,CAAC"}
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.getCurrentSHA = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const npmlog_1 = tslib_1.__importDefault(require("npmlog"));
|
|
6
|
-
const core_1 = require("@lerna-lite/core");
|
|
1
|
+
import log from 'npmlog';
|
|
2
|
+
import { execSync } from '@lerna-lite/core';
|
|
7
3
|
/**
|
|
8
4
|
* Retrieve current SHA from git.
|
|
9
5
|
* @param {import("@lerna/child-process").ExecOpts} opts
|
|
10
6
|
*/
|
|
11
|
-
function getCurrentSHA(opts, dryRun = false) {
|
|
12
|
-
|
|
13
|
-
const sha =
|
|
14
|
-
|
|
7
|
+
export function getCurrentSHA(opts, dryRun = false) {
|
|
8
|
+
log.silly('getCurrentSHA', '');
|
|
9
|
+
const sha = execSync('git', ['rev-parse', 'HEAD'], opts, dryRun);
|
|
10
|
+
log.verbose('getCurrentSHA', sha);
|
|
15
11
|
return sha;
|
|
16
12
|
}
|
|
17
|
-
exports.getCurrentSHA = getCurrentSHA;
|
|
18
13
|
//# sourceMappingURL=get-current-sha.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-current-sha.js","sourceRoot":"","sources":["../../src/lib/get-current-sha.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-current-sha.js","sourceRoot":"","sources":["../../src/lib/get-current-sha.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,QAAQ,CAAC;AACzB,OAAO,EAAY,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,IAAc,EAAE,MAAM,GAAG,KAAK;IAC1D,GAAG,CAAC,KAAK,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;IAE/B,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACjE,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;IAElC,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1,33 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const npmlog_1 = tslib_1.__importDefault(require("npmlog"));
|
|
6
|
-
const npm_package_arg_1 = tslib_1.__importDefault(require("npm-package-arg"));
|
|
7
|
-
const core_1 = require("@lerna-lite/core");
|
|
1
|
+
import log from 'npmlog';
|
|
2
|
+
import npa from 'npm-package-arg';
|
|
3
|
+
import { exec } from '@lerna-lite/core';
|
|
8
4
|
/**
|
|
9
5
|
* Retrieve a list of git tags pointing to the current HEAD that match the provided pattern.
|
|
10
6
|
* @param {import("@lerna/child-process").ExecOpts} execOpts
|
|
11
7
|
* @param {string} matchingPattern
|
|
12
8
|
* @returns {string[]}
|
|
13
9
|
*/
|
|
14
|
-
function getCurrentTags(execOpts, matchingPattern, dryRun = false) {
|
|
15
|
-
|
|
10
|
+
export function getCurrentTags(execOpts, matchingPattern, dryRun = false) {
|
|
11
|
+
log.silly('getCurrentTags', 'matching %j', matchingPattern);
|
|
16
12
|
const opts = Object.assign({}, execOpts, {
|
|
17
13
|
// don't reject due to non-zero exit code when there are no results
|
|
18
14
|
reject: false,
|
|
19
15
|
});
|
|
20
|
-
return
|
|
16
|
+
return exec('git', ['tag', '--sort', 'version:refname', '--points-at', 'HEAD', '--list', matchingPattern], opts, dryRun).then((result) => {
|
|
21
17
|
const lines = result.stdout.split('\n').filter(Boolean);
|
|
22
18
|
if (matchingPattern === '*@*') {
|
|
23
19
|
// independent mode does not respect tagVersionPrefix,
|
|
24
20
|
// but embeds the package name in the tag "prefix"
|
|
25
|
-
return lines.map((tag) => (
|
|
21
|
+
return lines.map((tag) => npa(tag).name);
|
|
26
22
|
}
|
|
27
23
|
// "fixed" mode can have a custom tagVersionPrefix,
|
|
28
24
|
// but it doesn't really matter as it is not used to extract package names
|
|
29
25
|
return lines;
|
|
30
26
|
});
|
|
31
27
|
}
|
|
32
|
-
exports.getCurrentTags = getCurrentTags;
|
|
33
28
|
//# sourceMappingURL=get-current-tags.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-current-tags.js","sourceRoot":"","sources":["../../src/lib/get-current-tags.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-current-tags.js","sourceRoot":"","sources":["../../src/lib/get-current-tags.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,QAAQ,CAAC;AACzB,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAClC,OAAO,EAAE,IAAI,EAAY,MAAM,kBAAkB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,QAAkB,EAAE,eAAuB,EAAE,MAAM,GAAG,KAAK;IACxF,GAAG,CAAC,KAAK,CAAC,gBAAgB,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;IAE5D,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE;QACvC,mEAAmE;QACnE,MAAM,EAAE,KAAK;KACd,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,CAC3H,CAAC,MAAM,EAAE,EAAE;QACT,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAExD,IAAI,eAAe,KAAK,KAAK,EAAE;YAC7B,sDAAsD;YACtD,kDAAkD;YAClD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;SAC1C;QAED,mDAAmD;QACnD,0EAA0E;QAC1E,OAAO,KAAK,CAAC;IACf,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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");
|
|
1
|
+
import { ValidationError } from '@lerna-lite/core';
|
|
2
|
+
import { getFetchConfig } from './fetch-config.js';
|
|
3
|
+
import { getProfileData } from './get-profile-data.js';
|
|
4
|
+
import { getWhoAmI } from './get-whoami.js';
|
|
8
5
|
/**
|
|
9
6
|
* Retrieve username of logged-in user.
|
|
10
7
|
* @param {import("./fetch-config").FetchConfig} options
|
|
11
8
|
* @returns {Promise<string>}
|
|
12
9
|
*/
|
|
13
|
-
function getNpmUsername(options) {
|
|
14
|
-
const opts =
|
|
10
|
+
export function getNpmUsername(options) {
|
|
11
|
+
const opts = getFetchConfig(options, {
|
|
15
12
|
// don't wait forever for third-party failures to be dealt with
|
|
16
13
|
fetchRetries: 0,
|
|
17
14
|
});
|
|
18
15
|
opts.log.info('', 'Verifying npm credentials');
|
|
19
|
-
return
|
|
16
|
+
return getProfileData(opts)
|
|
20
17
|
.catch((err) => {
|
|
21
18
|
// Many third-party registries do not implement the user endpoint
|
|
22
19
|
// Legacy npm Enterprise returns E500 instead of E404
|
|
23
20
|
if (err.code === 'E500' || err.code === 'E404') {
|
|
24
|
-
return
|
|
21
|
+
return getWhoAmI(opts);
|
|
25
22
|
}
|
|
26
23
|
// re-throw 401 Unauthorized (and all other unexpected errors)
|
|
27
24
|
throw err;
|
|
@@ -30,7 +27,7 @@ function getNpmUsername(options) {
|
|
|
30
27
|
function success(result) {
|
|
31
28
|
opts.log.silly('get npm username', 'received %j', result);
|
|
32
29
|
if (!result.username) {
|
|
33
|
-
throw new
|
|
30
|
+
throw new ValidationError('ENEEDAUTH', 'You must be logged in to publish packages. Use `npm login` and try again.');
|
|
34
31
|
}
|
|
35
32
|
return result.username;
|
|
36
33
|
}
|
|
@@ -42,12 +39,11 @@ function getNpmUsername(options) {
|
|
|
42
39
|
opts.log.resume();
|
|
43
40
|
if (opts.registry === 'https://registry.npmjs.org/') {
|
|
44
41
|
if (err.code === 'E403') {
|
|
45
|
-
throw new
|
|
42
|
+
throw new ValidationError('ENEEDAUTH', 'Access verification failed. Ensure that your npm access token has both read and write access, or remove the verifyAccess option to skip this verification. Note that npm automation tokens do NOT have read access (https://docs.npmjs.com/creating-and-viewing-access-tokens).');
|
|
46
43
|
}
|
|
47
|
-
throw new
|
|
44
|
+
throw new ValidationError('EWHOAMI', 'Authentication error. Use `npm whoami` to troubleshoot.');
|
|
48
45
|
}
|
|
49
46
|
opts.log.warn('EWHOAMI', 'Unable to determine npm username from third-party registry, this command will likely fail soon!');
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
|
-
exports.getNpmUsername = getNpmUsername;
|
|
53
49
|
//# sourceMappingURL=get-npm-username.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-npm-username.js","sourceRoot":"","sources":["../../src/lib/get-npm-username.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-npm-username.js","sourceRoot":"","sources":["../../src/lib/get-npm-username.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,OAAoB;IACjD,MAAM,IAAI,GAAG,cAAc,CAAC,OAAO,EAAE;QACnC,+DAA+D;QAC/D,YAAY,EAAE,CAAC;KAChB,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,2BAA2B,CAAC,CAAC;IAE/C,OAAO,cAAc,CAAC,IAAI,CAAC;SACxB,KAAK,CA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exports.getPackagesWithoutLicense = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
1
|
+
import { dirname } from 'node:path';
|
|
6
2
|
/**
|
|
7
3
|
* Retrieve a list of packages that lack a license file.
|
|
8
4
|
* @param {Project} project
|
|
9
5
|
* @param {Package[]} packagesToPublish
|
|
10
6
|
* @returns {Package[]}
|
|
11
7
|
*/
|
|
12
|
-
function getPackagesWithoutLicense(project, packagesToPublish) {
|
|
8
|
+
export function getPackagesWithoutLicense(project, packagesToPublish) {
|
|
13
9
|
return project.getPackageLicensePaths().then((licensePaths) => {
|
|
14
10
|
// this assumes any existing license is a sibling of package.json, which is pretty safe
|
|
15
11
|
// it also dedupes package locations, since we don't care about duplicate license files
|
|
16
|
-
const licensed = new Set(licensePaths.map((lp) =>
|
|
12
|
+
const licensed = new Set(licensePaths.map((lp) => dirname(lp)));
|
|
17
13
|
return packagesToPublish.filter((pkg) => !licensed.has(pkg.location));
|
|
18
14
|
});
|
|
19
15
|
}
|
|
20
|
-
exports.getPackagesWithoutLicense = getPackagesWithoutLicense;
|
|
21
16
|
//# sourceMappingURL=get-packages-without-license.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-packages-without-license.js","sourceRoot":"","sources":["../../src/lib/get-packages-without-license.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-packages-without-license.js","sourceRoot":"","sources":["../../src/lib/get-packages-without-license.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAgB,EAAE,iBAA4B;IACtF,OAAO,OAAO,CAAC,sBAAsB,EAAE,CAAC,IAAI,CAAC,CAAC,YAAsB,EAAE,EAAE;QACtE,uFAAuF;QACvF,uFAAuF;QACvF,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAU,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAExE,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/lib/get-packed.d.ts
CHANGED
package/dist/lib/get-packed.js
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const ssri_1 = tslib_1.__importDefault(require("ssri"));
|
|
8
|
-
const tar_1 = tslib_1.__importDefault(require("tar"));
|
|
9
|
-
function getPacked(pkg, tarFilePath) {
|
|
1
|
+
import { createReadStream } from 'node:fs';
|
|
2
|
+
import { stat } from 'fs/promises';
|
|
3
|
+
import { basename } from 'node:path';
|
|
4
|
+
import ssri from 'ssri';
|
|
5
|
+
import tar from 'tar';
|
|
6
|
+
export function getPacked(pkg, tarFilePath) {
|
|
10
7
|
const bundledWanted = new Set(/* pkg.bundleDependencies || pkg.bundledDependencies || */ []);
|
|
11
8
|
const bundled = new Set();
|
|
12
9
|
const files = [];
|
|
13
10
|
let totalEntries = 0;
|
|
14
11
|
let totalEntrySize = 0;
|
|
15
|
-
return
|
|
12
|
+
return tar
|
|
16
13
|
.list({
|
|
17
14
|
file: tarFilePath,
|
|
18
15
|
onentry(entry) {
|
|
19
16
|
totalEntries += 1;
|
|
20
17
|
totalEntrySize += entry.size;
|
|
21
18
|
const p = entry.path;
|
|
22
|
-
/*
|
|
19
|
+
/* c8 ignore next 5 */
|
|
23
20
|
if (p.startsWith('package/node_modules/')) {
|
|
24
21
|
const name = p.match(/^package\/node_modules\/((?:@[^/]+\/)?[^/]+)/)[1];
|
|
25
22
|
if (bundledWanted.has(name)) {
|
|
@@ -37,8 +34,8 @@ function getPacked(pkg, tarFilePath) {
|
|
|
37
34
|
strip: 1,
|
|
38
35
|
})
|
|
39
36
|
.then(() => Promise.all([
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
stat(tarFilePath),
|
|
38
|
+
ssri.fromStream(createReadStream(tarFilePath), {
|
|
42
39
|
algorithms: ['sha1', 'sha512'],
|
|
43
40
|
}),
|
|
44
41
|
]))
|
|
@@ -51,8 +48,8 @@ function getPacked(pkg, tarFilePath) {
|
|
|
51
48
|
size,
|
|
52
49
|
unpackedSize: totalEntrySize,
|
|
53
50
|
shasum,
|
|
54
|
-
integrity:
|
|
55
|
-
filename:
|
|
51
|
+
integrity: ssri.parse(sha512[0]),
|
|
52
|
+
filename: basename(tarFilePath),
|
|
56
53
|
files,
|
|
57
54
|
entryCount: totalEntries,
|
|
58
55
|
bundled: Array.from(bundled),
|
|
@@ -60,5 +57,4 @@ function getPacked(pkg, tarFilePath) {
|
|
|
60
57
|
};
|
|
61
58
|
});
|
|
62
59
|
}
|
|
63
|
-
exports.getPacked = getPacked;
|
|
64
60
|
//# sourceMappingURL=get-packed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-packed.js","sourceRoot":"","sources":["../../src/lib/get-packed.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-packed.js","sourceRoot":"","sources":["../../src/lib/get-packed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,GAAG,MAAM,KAAK,CAAC;AAKtB,MAAM,UAAU,SAAS,CAAC,GAAY,EAAE,WAAmB;IACzD,MAAM,aAAa,GAAG,IAAI,GAAG,CAAS,0DAA0D,CAAC,EAAE,CAAC,CAAC;IACrG,M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MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;QAEnC,OAAO;YACL,EAAE,EAAE,GAAG,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,OAAO,EAAE;YAChC,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,IAAI;YACJ,YAAY,EAAE,cAAc;YAC5B,MAAM;YACN,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAChC,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAAC;YAC/B,KAAK;YACL,UAAU,EAAE,YAAY;YACxB,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;YAC5B,WAAW;SACD,CAAC;IACf,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.getProfileData = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const npm_registry_fetch_1 = tslib_1.__importDefault(require("npm-registry-fetch"));
|
|
6
|
-
const core_1 = require("@lerna-lite/core");
|
|
1
|
+
import fetch from 'npm-registry-fetch';
|
|
2
|
+
import { pulseTillDone } from '@lerna-lite/core';
|
|
7
3
|
/**
|
|
8
4
|
* Retrieve profile data of logged-in user.
|
|
9
5
|
* @param {import("./fetch-config").FetchConfig} opts
|
|
10
6
|
* @returns {Promise<ProfileData>}
|
|
11
7
|
*/
|
|
12
|
-
async function getProfileData(opts) {
|
|
8
|
+
export async function getProfileData(opts) {
|
|
13
9
|
opts.log.verbose('', 'Retrieving npm user profile');
|
|
14
|
-
const data = await
|
|
10
|
+
const data = await pulseTillDone(await fetch.json('/-/npm/v1/user', opts));
|
|
15
11
|
opts.log.silly('npm profile get', 'received %j', data);
|
|
16
12
|
return Object.assign(
|
|
17
13
|
// remap to match legacy whoami format
|
|
18
14
|
{ username: data.name }, data);
|
|
19
15
|
}
|
|
20
|
-
exports.getProfileData = getProfileData;
|
|
21
16
|
//# sourceMappingURL=get-profile-data.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-profile-data.js","sourceRoot":"","sources":["../../src/lib/get-profile-data.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-profile-data.js","sourceRoot":"","sources":["../../src/lib/get-profile-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAEvC,OAAO,EAA4B,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE3E;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAiB;IACpD,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,6BAA6B,CAAC,CAAC;IAEpD,MAAM,IAAI,GAAgB,MAAM,aAAa,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC,CAAC;IACxF,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;IAEvD,OAAO,MAAM,CAAC,MAAM;IAClB,sCAAsC;IACtC,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,EACvB,IAAI,CACU,CAAC;AACnB,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
|
-
const npmlog_1 = tslib_1.__importDefault(require("npmlog"));
|
|
7
|
-
const core_1 = require("@lerna-lite/core");
|
|
1
|
+
import { basename, dirname, join } from 'node:path';
|
|
2
|
+
import log from 'npmlog';
|
|
3
|
+
import { exec } from '@lerna-lite/core';
|
|
8
4
|
/**
|
|
9
5
|
* Retrieve a list of graph nodes for packages that were tagged in a non-independent release.
|
|
10
6
|
* @param {import("@lerna/package-graph").PackageGraph} packageGraph
|
|
@@ -12,16 +8,15 @@ const core_1 = require("@lerna-lite/core");
|
|
|
12
8
|
* @param {import("@lerna/child-process").ExecOpts} execOpts
|
|
13
9
|
* @returns {Promise<import("@lerna/package-graph").PackageGraphNode[]>}
|
|
14
10
|
*/
|
|
15
|
-
function getTaggedPackages(packageGraph, rootPath, execOpts, dryRun = false) {
|
|
16
|
-
|
|
11
|
+
export function getTaggedPackages(packageGraph, rootPath, execOpts, dryRun = false) {
|
|
12
|
+
log.silly('getTaggedPackages', '');
|
|
17
13
|
// @see https://stackoverflow.com/a/424142/5707
|
|
18
14
|
// FIXME: --root is only necessary for tests :P
|
|
19
|
-
return
|
|
20
|
-
const manifests = stdout.split('\n').filter((fp) =>
|
|
21
|
-
const locations = new Set(manifests.map((fp) =>
|
|
15
|
+
return exec('git', ['diff-tree', '--name-only', '--no-commit-id', '--root', '-r', '-c', 'HEAD'], execOpts, dryRun).then(({ stdout }) => {
|
|
16
|
+
const manifests = stdout.split('\n').filter((fp) => basename(fp) === 'package.json');
|
|
17
|
+
const locations = new Set(manifests.map((fp) => join(rootPath, dirname(fp))));
|
|
22
18
|
// @ts-ignore
|
|
23
19
|
return Array.from(packageGraph.values()).filter((node) => locations.has(node.location));
|
|
24
20
|
});
|
|
25
21
|
}
|
|
26
|
-
exports.getTaggedPackages = getTaggedPackages;
|
|
27
22
|
//# sourceMappingURL=get-tagged-packages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-tagged-packages.js","sourceRoot":"","sources":["../../src/lib/get-tagged-packages.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-tagged-packages.js","sourceRoot":"","sources":["../../src/lib/get-tagged-packages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,GAAG,MAAM,QAAQ,CAAC;AACzB,OAAO,EAAE,IAAI,EAA0B,MAAM,kBAAkB,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,YAA0B,EAAE,QAAgB,EAAE,QAAkB,EAAE,MAAM,GAAG,KAAK;IAChH,GAAG,CAAC,KAAK,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;IAEnC,+CAA+C;IAC/C,+CAA+C;IAC/C,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,IAAI,CACrH,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;QACb,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,cAAc,CAAC,CAAC;QACrF,MAAM,SAAS,GAAG,IAAI,GAAG,CAAS,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAEtF,aAAa;QACb,OAAO,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAA0B,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAChH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const core_1 = require("@lerna-lite/core");
|
|
5
|
-
const fetch_config_1 = require("./fetch-config");
|
|
6
|
-
const get_profile_data_1 = require("./get-profile-data");
|
|
1
|
+
import { ValidationError } from '@lerna-lite/core';
|
|
2
|
+
import { getFetchConfig } from './fetch-config.js';
|
|
3
|
+
import { getProfileData } from './get-profile-data.js';
|
|
7
4
|
/**
|
|
8
5
|
* Determine if the logged-in user has enabled two-factor auth.
|
|
9
6
|
* @param {import('./fetch-config').FetchConfig} options
|
|
10
7
|
* @returns {Promise<boolean>}
|
|
11
8
|
*/
|
|
12
|
-
function getTwoFactorAuthRequired(options) {
|
|
13
|
-
const opts =
|
|
9
|
+
export function getTwoFactorAuthRequired(options) {
|
|
10
|
+
const opts = getFetchConfig(options, {
|
|
14
11
|
// don't wait forever for third-party failures to be dealt with
|
|
15
12
|
fetchRetries: 0,
|
|
16
13
|
});
|
|
17
14
|
opts.log.info('', 'Checking two-factor auth mode');
|
|
18
|
-
return
|
|
15
|
+
return getProfileData(opts).then(success, failure);
|
|
19
16
|
function success(result) {
|
|
20
17
|
opts.log.silly('2FA', result.tfa.toString());
|
|
21
18
|
if (result.tfa.pending) {
|
|
@@ -36,8 +33,7 @@ function getTwoFactorAuthRequired(options) {
|
|
|
36
33
|
opts.log.pause();
|
|
37
34
|
console.error(err.message); // eslint-disable-line no-console
|
|
38
35
|
opts.log.resume();
|
|
39
|
-
throw new
|
|
36
|
+
throw new ValidationError('ETWOFACTOR', 'Unable to obtain two-factor auth mode');
|
|
40
37
|
}
|
|
41
38
|
}
|
|
42
|
-
exports.getTwoFactorAuthRequired = getTwoFactorAuthRequired;
|
|
43
39
|
//# sourceMappingURL=get-two-factor-auth-required.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-two-factor-auth-required.js","sourceRoot":"","sources":["../../src/lib/get-two-factor-auth-required.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-two-factor-auth-required.js","sourceRoot":"","sources":["../../src/lib/get-two-factor-auth-required.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE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