package-registry-manager 0.22.0 → 0.22.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/CHANGELOG.md +1 -0
- package/package.json +3 -3
- package/src/cli.mjs +4 -18
- package/src/direct-execution.mjs +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -35,6 +35,7 @@ currently shares its release version with the Rust implementation.
|
|
|
35
35
|
outside any repository (`~/Library/Application Support` on macOS,
|
|
36
36
|
`$XDG_STATE_HOME` or `~/.local/state` on Linux, `%LOCALAPPDATA%` on Windows,
|
|
37
37
|
each followed by `package-registry-manager/browser-profile`) (#8).
|
|
38
|
+
- `browser-commander` is required at `^0.22.0`, its latest release (#28).
|
|
38
39
|
|
|
39
40
|
### Fixed
|
|
40
41
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "package-registry-manager",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.2",
|
|
4
4
|
"description": "Inspect repositories and guide secure package-registry setup",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"provenance": true
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
|
-
"syntax": "node --check src/cli.mjs && node --check src/index.mjs && node --check src/browser.mjs && node --check src/browser-options.mjs && node --check src/automation.mjs && node --check src/profile.mjs && node --check src/setup.mjs && node --check src/auth-urls.mjs && node --check src/containers.mjs && node --check src/flows.mjs && node --check src/prerequisites.mjs && node --check src/registry-state.mjs && node --check src/workflows.mjs && node --check src/publishers.mjs && node --check src/skips.mjs && node --check src/tokens.mjs && node --check src/approvals.mjs && node --check src/default-browser.mjs && node --check src/pages.mjs && node --check src/crates-api.mjs && node --check src/sign-in-import.mjs && node --check scripts/publish-to-npm.mjs && node --check scripts/setup-npm.mjs && node --check scripts/sanitize-npm-userconfig.mjs",
|
|
31
|
+
"syntax": "node --check src/cli.mjs && node --check src/direct-execution.mjs && node --check src/index.mjs && node --check src/browser.mjs && node --check src/browser-options.mjs && node --check src/automation.mjs && node --check src/profile.mjs && node --check src/setup.mjs && node --check src/auth-urls.mjs && node --check src/containers.mjs && node --check src/flows.mjs && node --check src/prerequisites.mjs && node --check src/registry-state.mjs && node --check src/workflows.mjs && node --check src/publishers.mjs && node --check src/skips.mjs && node --check src/tokens.mjs && node --check src/approvals.mjs && node --check src/default-browser.mjs && node --check src/pages.mjs && node --check src/crates-api.mjs && node --check src/sign-in-import.mjs && node --check scripts/publish-to-npm.mjs && node --check scripts/setup-npm.mjs && node --check scripts/sanitize-npm-userconfig.mjs",
|
|
32
32
|
"lint": "eslint src test scripts --max-warnings 0",
|
|
33
33
|
"lint:fix": "eslint src test scripts --fix --max-warnings 0",
|
|
34
34
|
"format": "prettier --write .",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"pack:check": "npm pack --dry-run"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"browser-commander": "^0.
|
|
42
|
+
"browser-commander": "^0.22.0",
|
|
43
43
|
"command-stream": "^1.3.0",
|
|
44
44
|
"playwright": "^1.63.0"
|
|
45
45
|
},
|
package/src/cli.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { readFileSync
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
4
|
import { stat } from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import process from "node:process";
|
|
7
|
-
import { fileURLToPath } from "node:url";
|
|
8
7
|
import { parseArgs } from "node:util";
|
|
9
8
|
|
|
10
9
|
import { parseBrowserOptions } from "./browser-options.mjs";
|
|
10
|
+
import { isDirectExecution } from "./direct-execution.mjs";
|
|
11
11
|
import { inspectRepository } from "./discovery.mjs";
|
|
12
12
|
import { parseRegistry } from "./model.mjs";
|
|
13
13
|
import { buildPlans } from "./plan.mjs";
|
|
@@ -15,6 +15,8 @@ import { probeEnvironment, renderPrerequisites } from "./prerequisites.mjs";
|
|
|
15
15
|
import { probeRegistryState } from "./registry-state.mjs";
|
|
16
16
|
import { BROWSER_MODES, defaultBrowserProfile, executePlan } from "./setup.mjs";
|
|
17
17
|
|
|
18
|
+
export { isDirectExecution };
|
|
19
|
+
|
|
18
20
|
const HELP = `Usage: package-registry-manager-js [global options] <command>
|
|
19
21
|
|
|
20
22
|
Commands:
|
|
@@ -421,22 +423,6 @@ function packageVersion() {
|
|
|
421
423
|
return JSON.parse(readFileSync(manifest, "utf8")).version;
|
|
422
424
|
}
|
|
423
425
|
|
|
424
|
-
/**
|
|
425
|
-
* Whether this module is the program node started. npm, npx, and global
|
|
426
|
-
* installs start bins through a symlink in node_modules/.bin, while
|
|
427
|
-
* import.meta.url names the real file, so both sides are resolved first.
|
|
428
|
-
*/
|
|
429
|
-
export function isDirectExecution(moduleUrl, entryPath) {
|
|
430
|
-
if (!entryPath) {
|
|
431
|
-
return false;
|
|
432
|
-
}
|
|
433
|
-
try {
|
|
434
|
-
return realpathSync(fileURLToPath(moduleUrl)) === realpathSync(entryPath);
|
|
435
|
-
} catch {
|
|
436
|
-
return false;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
|
|
440
426
|
if (isDirectExecution(import.meta.url, process.argv[1])) {
|
|
441
427
|
main().catch((error) => {
|
|
442
428
|
process.stderr.write(`error: ${error.message}\n`);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { realpathSync } from "node:fs";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Whether this module is the program node started. npm, npx, and global
|
|
6
|
+
* installs start bins through a symlink in node_modules/.bin, while
|
|
7
|
+
* import.meta.url names the real file, so both sides are resolved first.
|
|
8
|
+
*/
|
|
9
|
+
export function isDirectExecution(moduleUrl, entryPath) {
|
|
10
|
+
if (!entryPath) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
try {
|
|
14
|
+
return realpathSync(fileURLToPath(moduleUrl)) === realpathSync(entryPath);
|
|
15
|
+
} catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|