@metamask-previews/java-tron-up 0.0.0-preview-ed0047684 → 0.0.0-preview-a8fd340
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 +15 -0
- package/README.md +116 -7
- package/dist/bin/java-tron-up.cjs +52 -0
- package/dist/bin/java-tron-up.cjs.map +1 -0
- package/dist/bin/java-tron-up.d.cts +3 -0
- package/dist/bin/java-tron-up.d.cts.map +1 -0
- package/dist/bin/java-tron-up.d.mts +3 -0
- package/dist/bin/java-tron-up.d.mts.map +1 -0
- package/dist/bin/java-tron-up.mjs +50 -0
- package/dist/bin/java-tron-up.mjs.map +1 -0
- package/dist/index.cjs +10 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -7
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -7
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -9
- package/dist/index.mjs.map +1 -1
- package/dist/install.cjs +474 -0
- package/dist/install.cjs.map +1 -0
- package/dist/install.d.cts +50 -0
- package/dist/install.d.cts.map +1 -0
- package/dist/install.d.mts +50 -0
- package/dist/install.d.mts.map +1 -0
- package/dist/install.mjs +465 -0
- package/dist/install.mjs.map +1 -0
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,4 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Add the `@metamask/java-tron-up` package ([#9208](https://github.com/MetaMask/core/pull/9208)).
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Parse `.yarnrc.yml` as YAML when detecting Yarn global cache, matching
|
|
17
|
+
`@metamask/foundryup`.
|
|
18
|
+
- Merge partial `fullNode` and `javaRuntime` overrides from `package.json` with
|
|
19
|
+
the pinned defaults instead of replacing them.
|
|
20
|
+
- Re-verify the cached Java runtime checksum on reuse via a `.source-checksum`
|
|
21
|
+
marker.
|
|
22
|
+
- Propagate child termination signals from the generated `java-tron` wrapper as a
|
|
23
|
+
non-zero exit.
|
|
24
|
+
|
|
10
25
|
[Unreleased]: https://github.com/MetaMask/core/
|
package/README.md
CHANGED
|
@@ -1,15 +1,124 @@
|
|
|
1
1
|
# `@metamask/java-tron-up`
|
|
2
2
|
|
|
3
|
-
java-tron runtime
|
|
3
|
+
`java-tron-up` installs a pinned native java-tron runtime for local development
|
|
4
|
+
and CI. It follows the same runtime-only shape as `@metamask/foundryup`: this
|
|
5
|
+
package installs external runtime artifacts into the MetaMask cache and exposes
|
|
6
|
+
binaries in `node_modules/.bin`; the consuming test harness owns process
|
|
7
|
+
startup, private-network config, readiness checks, and seeding.
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
This package does not use Docker and does not start or seed a TRON node.
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
## Usage
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
Install the package in the consuming repo:
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
```bash
|
|
16
|
+
yarn add @metamask/java-tron-up
|
|
17
|
+
npm install @metamask/java-tron-up
|
|
18
|
+
```
|
|
12
19
|
|
|
13
|
-
|
|
20
|
+
For Yarn v4 projects, it is usually simplest to add package scripts in the
|
|
21
|
+
consuming repo:
|
|
14
22
|
|
|
15
|
-
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"scripts": {
|
|
26
|
+
"java-tron-up": "node_modules/.bin/java-tron-up",
|
|
27
|
+
"java-tron": "node_modules/.bin/java-tron"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Install java-tron and its managed Java runtime:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
yarn java-tron-up install
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Run the installed node wrapper:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
node_modules/.bin/java-tron -c /absolute/path/to/fullnode.conf --witness
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
For MetaMask Extension E2E tests, the Tron seeder should spawn
|
|
45
|
+
`node_modules/.bin/java-tron`, pass its generated private-network config, poll
|
|
46
|
+
java-tron's HTTP APIs directly, and perform all account/token/staking seeding
|
|
47
|
+
itself.
|
|
48
|
+
|
|
49
|
+
## Installed Artifacts
|
|
50
|
+
|
|
51
|
+
`java-tron-up` installs:
|
|
52
|
+
|
|
53
|
+
- a platform-specific `FullNode.jar`
|
|
54
|
+
- a managed Java runtime matching java-tron's architecture requirements
|
|
55
|
+
- a `node_modules/.bin/java-tron` wrapper that runs:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
java -jar FullNode.jar "$@"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## CLI
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
java-tron-up [install] [options]
|
|
65
|
+
java-tron-up cache clean [options]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Options:
|
|
69
|
+
|
|
70
|
+
- `--bin-directory <path>`: directory for generated wrappers. Defaults to
|
|
71
|
+
`node_modules/.bin`.
|
|
72
|
+
- `--cache-directory <path>`: artifact cache directory. Defaults to
|
|
73
|
+
`.metamask/cache`.
|
|
74
|
+
- `--full-node-url <url>` and `--full-node-checksum <hash>`: override the
|
|
75
|
+
FullNode jar for the current platform.
|
|
76
|
+
- `--java-runtime-url <url>` and `--java-runtime-checksum <hash>`: override the
|
|
77
|
+
Java runtime archive for the current platform.
|
|
78
|
+
- `--platform <platform>`: override platform selection, for example
|
|
79
|
+
`linux-x64`.
|
|
80
|
+
|
|
81
|
+
## Default Release
|
|
82
|
+
|
|
83
|
+
The package currently pins java-tron `GreatVoyage-v4.8.1` for `darwin-arm64`,
|
|
84
|
+
`darwin-x64`, `linux-arm64`, and `linux-x64`.
|
|
85
|
+
|
|
86
|
+
java-tron `4.8.1` requires JDK 8 for x86_64 and JDK 17 for arm64, so this
|
|
87
|
+
package installs Azul Zulu Java 8 on x64 platforms and Azul Zulu Java 17 on
|
|
88
|
+
arm64 platforms.
|
|
89
|
+
|
|
90
|
+
## Cache
|
|
91
|
+
|
|
92
|
+
The cache defaults to `.metamask/cache` in the current repo. The installer reads
|
|
93
|
+
`.yarnrc.yml` as YAML and, when `enableGlobalCache` is true, moves the cache to
|
|
94
|
+
`~/.cache/metamask`, matching the `@metamask/foundryup` behavior.
|
|
95
|
+
|
|
96
|
+
Clean only this package's cache namespace:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
yarn java-tron-up cache clean
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Package Config
|
|
103
|
+
|
|
104
|
+
The consuming repo can override the pinned artifact URLs and checksums in its
|
|
105
|
+
root `package.json`:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"javaTronUp": {
|
|
110
|
+
"fullNode": {
|
|
111
|
+
"version": "GreatVoyage-v4.8.1",
|
|
112
|
+
"platforms": {
|
|
113
|
+
"linux-x64": {
|
|
114
|
+
"url": "https://github.com/tronprotocol/java-tron/releases/download/GreatVoyage-v4.8.1/FullNode.jar",
|
|
115
|
+
"checksum": "0e67b2fe75d7077750e73c4fa20725c6e9824657275d96be256ae5da681f9945"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Supported package config keys are `javaTronUp`, `javatronup`, and
|
|
124
|
+
`java-tron-up`.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
/* eslint-disable no-restricted-globals */
|
|
5
|
+
const install_1 = require("../install.cjs");
|
|
6
|
+
async function main() {
|
|
7
|
+
const [command, ...args] = process.argv.slice(2);
|
|
8
|
+
if (command === '--help' || command === 'help') {
|
|
9
|
+
printHelp();
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (command === 'cache' && args[0] === 'clean') {
|
|
13
|
+
await (0, install_1.cleanJavaTronCache)({
|
|
14
|
+
...(0, install_1.readJavaTronInstallOptionsFromPackageJson)(),
|
|
15
|
+
...(0, install_1.parseJavaTronInstallCliOptions)(args.slice(1)),
|
|
16
|
+
});
|
|
17
|
+
console.log('[java-tron-up] cache cleaned');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const installArgs = command === 'install' ? args : process.argv.slice(2);
|
|
21
|
+
const result = await (0, install_1.installJavaTron)({
|
|
22
|
+
...(0, install_1.readJavaTronInstallOptionsFromPackageJson)(),
|
|
23
|
+
...(0, install_1.parseJavaTronInstallCliOptions)(installArgs),
|
|
24
|
+
});
|
|
25
|
+
console.log(`[java-tron-up] java-tron ${result.cacheHit ? 'found in cache' : 'installed'} at ${result.fullNodeJar}`);
|
|
26
|
+
console.log(`[java-tron-up] Java runtime installed at ${result.javaBinary}`);
|
|
27
|
+
console.log(`[java-tron-up] binary installed at ${result.binaryPath}`);
|
|
28
|
+
}
|
|
29
|
+
main().catch((error) => {
|
|
30
|
+
console.error(error);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
});
|
|
33
|
+
function printHelp() {
|
|
34
|
+
console.log(`Usage: java-tron-up [install] [options]
|
|
35
|
+
java-tron-up cache clean [options]
|
|
36
|
+
|
|
37
|
+
Commands:
|
|
38
|
+
install Install java-tron and the managed Java runtime. Default command.
|
|
39
|
+
cache clean Remove cached java-tron-up artifacts.
|
|
40
|
+
|
|
41
|
+
Options:
|
|
42
|
+
--bin-directory <path> Directory for the java-tron executable.
|
|
43
|
+
Defaults to node_modules/.bin.
|
|
44
|
+
--cache-directory <path> Cache directory. Defaults to .metamask/cache.
|
|
45
|
+
--full-node-url <url> FullNode.jar URL for the current platform.
|
|
46
|
+
--full-node-checksum <hash> Expected FullNode.jar SHA-256 checksum.
|
|
47
|
+
--java-runtime-url <url> Java runtime archive URL for the current platform.
|
|
48
|
+
--java-runtime-checksum <hash> Expected Java runtime SHA-256 checksum.
|
|
49
|
+
--platform <platform> Override platform key, e.g. linux-x64.
|
|
50
|
+
--help Show this help text.`);
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=java-tron-up.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"java-tron-up.cjs","sourceRoot":"","sources":["../../src/bin/java-tron-up.ts"],"names":[],"mappings":";;;AACA,0CAA0C;AAC1C,4CAKoB;AAEpB,KAAK,UAAU,IAAI;IACjB,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEjD,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QAC/C,SAAS,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IAED,IAAI,OAAO,KAAK,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC;QAC/C,MAAM,IAAA,4BAAkB,EAAC;YACvB,GAAG,IAAA,mDAAyC,GAAE;YAC9C,GAAG,IAAA,wCAA8B,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACjD,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAC5C,OAAO;IACT,CAAC;IAED,MAAM,WAAW,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzE,MAAM,MAAM,GAAG,MAAM,IAAA,yBAAe,EAAC;QACnC,GAAG,IAAA,mDAAyC,GAAE;QAC9C,GAAG,IAAA,wCAA8B,EAAC,WAAW,CAAC;KAC/C,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CACT,4BACE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,WACvC,OAAO,MAAM,CAAC,WAAW,EAAE,CAC5B,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,4CAA4C,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,sCAAsC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;AACzE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,SAAS,SAAS;IAChB,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;sDAgBwC,CAAC,CAAC;AACxD,CAAC","sourcesContent":["#!/usr/bin/env node\n/* eslint-disable no-restricted-globals */\nimport {\n cleanJavaTronCache,\n installJavaTron,\n parseJavaTronInstallCliOptions,\n readJavaTronInstallOptionsFromPackageJson,\n} from '../install';\n\nasync function main(): Promise<void> {\n const [command, ...args] = process.argv.slice(2);\n\n if (command === '--help' || command === 'help') {\n printHelp();\n return;\n }\n\n if (command === 'cache' && args[0] === 'clean') {\n await cleanJavaTronCache({\n ...readJavaTronInstallOptionsFromPackageJson(),\n ...parseJavaTronInstallCliOptions(args.slice(1)),\n });\n console.log('[java-tron-up] cache cleaned');\n return;\n }\n\n const installArgs = command === 'install' ? args : process.argv.slice(2);\n const result = await installJavaTron({\n ...readJavaTronInstallOptionsFromPackageJson(),\n ...parseJavaTronInstallCliOptions(installArgs),\n });\n\n console.log(\n `[java-tron-up] java-tron ${\n result.cacheHit ? 'found in cache' : 'installed'\n } at ${result.fullNodeJar}`,\n );\n console.log(`[java-tron-up] Java runtime installed at ${result.javaBinary}`);\n console.log(`[java-tron-up] binary installed at ${result.binaryPath}`);\n}\n\nmain().catch((error) => {\n console.error(error);\n process.exit(1);\n});\n\nfunction printHelp(): void {\n console.log(`Usage: java-tron-up [install] [options]\n java-tron-up cache clean [options]\n\nCommands:\n install Install java-tron and the managed Java runtime. Default command.\n cache clean Remove cached java-tron-up artifacts.\n\nOptions:\n --bin-directory <path> Directory for the java-tron executable.\n Defaults to node_modules/.bin.\n --cache-directory <path> Cache directory. Defaults to .metamask/cache.\n --full-node-url <url> FullNode.jar URL for the current platform.\n --full-node-checksum <hash> Expected FullNode.jar SHA-256 checksum.\n --java-runtime-url <url> Java runtime archive URL for the current platform.\n --java-runtime-checksum <hash> Expected Java runtime SHA-256 checksum.\n --platform <platform> Override platform key, e.g. linux-x64.\n --help Show this help text.`);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"java-tron-up.d.cts","sourceRoot":"","sources":["../../src/bin/java-tron-up.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"java-tron-up.d.mts","sourceRoot":"","sources":["../../src/bin/java-tron-up.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* eslint-disable no-restricted-globals */
|
|
3
|
+
import { cleanJavaTronCache, installJavaTron, parseJavaTronInstallCliOptions, readJavaTronInstallOptionsFromPackageJson } from "../install.mjs";
|
|
4
|
+
async function main() {
|
|
5
|
+
const [command, ...args] = process.argv.slice(2);
|
|
6
|
+
if (command === '--help' || command === 'help') {
|
|
7
|
+
printHelp();
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (command === 'cache' && args[0] === 'clean') {
|
|
11
|
+
await cleanJavaTronCache({
|
|
12
|
+
...readJavaTronInstallOptionsFromPackageJson(),
|
|
13
|
+
...parseJavaTronInstallCliOptions(args.slice(1)),
|
|
14
|
+
});
|
|
15
|
+
console.log('[java-tron-up] cache cleaned');
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const installArgs = command === 'install' ? args : process.argv.slice(2);
|
|
19
|
+
const result = await installJavaTron({
|
|
20
|
+
...readJavaTronInstallOptionsFromPackageJson(),
|
|
21
|
+
...parseJavaTronInstallCliOptions(installArgs),
|
|
22
|
+
});
|
|
23
|
+
console.log(`[java-tron-up] java-tron ${result.cacheHit ? 'found in cache' : 'installed'} at ${result.fullNodeJar}`);
|
|
24
|
+
console.log(`[java-tron-up] Java runtime installed at ${result.javaBinary}`);
|
|
25
|
+
console.log(`[java-tron-up] binary installed at ${result.binaryPath}`);
|
|
26
|
+
}
|
|
27
|
+
main().catch((error) => {
|
|
28
|
+
console.error(error);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
});
|
|
31
|
+
function printHelp() {
|
|
32
|
+
console.log(`Usage: java-tron-up [install] [options]
|
|
33
|
+
java-tron-up cache clean [options]
|
|
34
|
+
|
|
35
|
+
Commands:
|
|
36
|
+
install Install java-tron and the managed Java runtime. Default command.
|
|
37
|
+
cache clean Remove cached java-tron-up artifacts.
|
|
38
|
+
|
|
39
|
+
Options:
|
|
40
|
+
--bin-directory <path> Directory for the java-tron executable.
|
|
41
|
+
Defaults to node_modules/.bin.
|
|
42
|
+
--cache-directory <path> Cache directory. Defaults to .metamask/cache.
|
|
43
|
+
--full-node-url <url> FullNode.jar URL for the current platform.
|
|
44
|
+
--full-node-checksum <hash> Expected FullNode.jar SHA-256 checksum.
|
|
45
|
+
--java-runtime-url <url> Java runtime archive URL for the current platform.
|
|
46
|
+
--java-runtime-checksum <hash> Expected Java runtime SHA-256 checksum.
|
|
47
|
+
--platform <platform> Override platform key, e.g. linux-x64.
|
|
48
|
+
--help Show this help text.`);
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=java-tron-up.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"java-tron-up.mjs","sourceRoot":"","sources":["../../src/bin/java-tron-up.ts"],"names":[],"mappings":";AACA,0CAA0C;AAC1C,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,8BAA8B,EAC9B,yCAAyC,EAC1C,uBAAmB;AAEpB,KAAK,UAAU,IAAI;IACjB,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEjD,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QAC/C,SAAS,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IAED,IAAI,OAAO,KAAK,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC;QAC/C,MAAM,kBAAkB,CAAC;YACvB,GAAG,yCAAyC,EAAE;YAC9C,GAAG,8BAA8B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACjD,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAC5C,OAAO;IACT,CAAC;IAED,MAAM,WAAW,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzE,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC;QACnC,GAAG,yCAAyC,EAAE;QAC9C,GAAG,8BAA8B,CAAC,WAAW,CAAC;KAC/C,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CACT,4BACE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,WACvC,OAAO,MAAM,CAAC,WAAW,EAAE,CAC5B,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,4CAA4C,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,sCAAsC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;AACzE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,SAAS,SAAS;IAChB,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;sDAgBwC,CAAC,CAAC;AACxD,CAAC","sourcesContent":["#!/usr/bin/env node\n/* eslint-disable no-restricted-globals */\nimport {\n cleanJavaTronCache,\n installJavaTron,\n parseJavaTronInstallCliOptions,\n readJavaTronInstallOptionsFromPackageJson,\n} from '../install';\n\nasync function main(): Promise<void> {\n const [command, ...args] = process.argv.slice(2);\n\n if (command === '--help' || command === 'help') {\n printHelp();\n return;\n }\n\n if (command === 'cache' && args[0] === 'clean') {\n await cleanJavaTronCache({\n ...readJavaTronInstallOptionsFromPackageJson(),\n ...parseJavaTronInstallCliOptions(args.slice(1)),\n });\n console.log('[java-tron-up] cache cleaned');\n return;\n }\n\n const installArgs = command === 'install' ? args : process.argv.slice(2);\n const result = await installJavaTron({\n ...readJavaTronInstallOptionsFromPackageJson(),\n ...parseJavaTronInstallCliOptions(installArgs),\n });\n\n console.log(\n `[java-tron-up] java-tron ${\n result.cacheHit ? 'found in cache' : 'installed'\n } at ${result.fullNodeJar}`,\n );\n console.log(`[java-tron-up] Java runtime installed at ${result.javaBinary}`);\n console.log(`[java-tron-up] binary installed at ${result.binaryPath}`);\n}\n\nmain().catch((error) => {\n console.error(error);\n process.exit(1);\n});\n\nfunction printHelp(): void {\n console.log(`Usage: java-tron-up [install] [options]\n java-tron-up cache clean [options]\n\nCommands:\n install Install java-tron and the managed Java runtime. Default command.\n cache clean Remove cached java-tron-up artifacts.\n\nOptions:\n --bin-directory <path> Directory for the java-tron executable.\n Defaults to node_modules/.bin.\n --cache-directory <path> Cache directory. Defaults to .metamask/cache.\n --full-node-url <url> FullNode.jar URL for the current platform.\n --full-node-checksum <hash> Expected FullNode.jar SHA-256 checksum.\n --java-runtime-url <url> Java runtime archive URL for the current platform.\n --java-runtime-checksum <hash> Expected Java runtime SHA-256 checksum.\n --platform <platform> Override platform key, e.g. linux-x64.\n --help Show this help text.`);\n}\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
exports.
|
|
3
|
+
exports.readJavaTronInstallOptionsFromPackageJson = exports.parseJavaTronInstallCliOptions = exports.installJavaTron = exports.installJavaRuntime = exports.getJavaTronCacheDirectory = exports.cleanJavaTronCache = exports.JAVA_TRON_DEFAULT_JAVA_RUNTIME = exports.JAVA_TRON_DEFAULT_FULL_NODE = void 0;
|
|
4
|
+
var install_1 = require("./install.cjs");
|
|
5
|
+
Object.defineProperty(exports, "JAVA_TRON_DEFAULT_FULL_NODE", { enumerable: true, get: function () { return install_1.JAVA_TRON_DEFAULT_FULL_NODE; } });
|
|
6
|
+
Object.defineProperty(exports, "JAVA_TRON_DEFAULT_JAVA_RUNTIME", { enumerable: true, get: function () { return install_1.JAVA_TRON_DEFAULT_JAVA_RUNTIME; } });
|
|
7
|
+
Object.defineProperty(exports, "cleanJavaTronCache", { enumerable: true, get: function () { return install_1.cleanJavaTronCache; } });
|
|
8
|
+
Object.defineProperty(exports, "getJavaTronCacheDirectory", { enumerable: true, get: function () { return install_1.getJavaTronCacheDirectory; } });
|
|
9
|
+
Object.defineProperty(exports, "installJavaRuntime", { enumerable: true, get: function () { return install_1.installJavaRuntime; } });
|
|
10
|
+
Object.defineProperty(exports, "installJavaTron", { enumerable: true, get: function () { return install_1.installJavaTron; } });
|
|
11
|
+
Object.defineProperty(exports, "parseJavaTronInstallCliOptions", { enumerable: true, get: function () { return install_1.parseJavaTronInstallCliOptions; } });
|
|
12
|
+
Object.defineProperty(exports, "readJavaTronInstallOptionsFromPackageJson", { enumerable: true, get: function () { return install_1.readJavaTronInstallOptionsFromPackageJson; } });
|
|
13
13
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yCASmB;AARjB,sHAAA,2BAA2B,OAAA;AAC3B,yHAAA,8BAA8B,OAAA;AAC9B,6GAAA,kBAAkB,OAAA;AAClB,oHAAA,yBAAyB,OAAA;AACzB,6GAAA,kBAAkB,OAAA;AAClB,0GAAA,eAAe,OAAA;AACf,yHAAA,8BAA8B,OAAA;AAC9B,oIAAA,yCAAyC,OAAA","sourcesContent":["export {\n JAVA_TRON_DEFAULT_FULL_NODE,\n JAVA_TRON_DEFAULT_JAVA_RUNTIME,\n cleanJavaTronCache,\n getJavaTronCacheDirectory,\n installJavaRuntime,\n installJavaTron,\n parseJavaTronInstallCliOptions,\n readJavaTronInstallOptionsFromPackageJson,\n} from './install';\nexport type {\n JavaTronArtifactConfig,\n JavaTronArtifactPlatformConfig,\n JavaTronInstallDependencies,\n JavaTronInstallOptions,\n JavaTronInstallResult,\n JavaTronJavaRuntimeConfig,\n} from './install';\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* @param name - The name to greet.
|
|
5
|
-
* @returns The greeting.
|
|
6
|
-
*/
|
|
7
|
-
export default function greeter(name: string): string;
|
|
1
|
+
export { JAVA_TRON_DEFAULT_FULL_NODE, JAVA_TRON_DEFAULT_JAVA_RUNTIME, cleanJavaTronCache, getJavaTronCacheDirectory, installJavaRuntime, installJavaTron, parseJavaTronInstallCliOptions, readJavaTronInstallOptionsFromPackageJson, } from "./install.cjs";
|
|
2
|
+
export type { JavaTronArtifactConfig, JavaTronArtifactPlatformConfig, JavaTronInstallDependencies, JavaTronInstallOptions, JavaTronInstallResult, JavaTronJavaRuntimeConfig, } from "./install.cjs";
|
|
8
3
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,8BAA8B,EAC9B,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,eAAe,EACf,8BAA8B,EAC9B,yCAAyC,GAC1C,sBAAkB;AACnB,YAAY,EACV,sBAAsB,EACtB,8BAA8B,EAC9B,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,GAC1B,sBAAkB"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* @param name - The name to greet.
|
|
5
|
-
* @returns The greeting.
|
|
6
|
-
*/
|
|
7
|
-
export default function greeter(name: string): string;
|
|
1
|
+
export { JAVA_TRON_DEFAULT_FULL_NODE, JAVA_TRON_DEFAULT_JAVA_RUNTIME, cleanJavaTronCache, getJavaTronCacheDirectory, installJavaRuntime, installJavaTron, parseJavaTronInstallCliOptions, readJavaTronInstallOptionsFromPackageJson, } from "./install.mjs";
|
|
2
|
+
export type { JavaTronArtifactConfig, JavaTronArtifactPlatformConfig, JavaTronInstallDependencies, JavaTronInstallOptions, JavaTronInstallResult, JavaTronJavaRuntimeConfig, } from "./install.mjs";
|
|
8
3
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,8BAA8B,EAC9B,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,eAAe,EACf,8BAA8B,EAC9B,yCAAyC,GAC1C,sBAAkB;AACnB,YAAY,EACV,sBAAsB,EACtB,8BAA8B,EAC9B,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,GAC1B,sBAAkB"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Example function that returns a greeting for the given name.
|
|
3
|
-
*
|
|
4
|
-
* @param name - The name to greet.
|
|
5
|
-
* @returns The greeting.
|
|
6
|
-
*/
|
|
7
|
-
export default function greeter(name) {
|
|
8
|
-
return `Hello, ${name}!`;
|
|
9
|
-
}
|
|
1
|
+
export { JAVA_TRON_DEFAULT_FULL_NODE, JAVA_TRON_DEFAULT_JAVA_RUNTIME, cleanJavaTronCache, getJavaTronCacheDirectory, installJavaRuntime, installJavaTron, parseJavaTronInstallCliOptions, readJavaTronInstallOptionsFromPackageJson } from "./install.mjs";
|
|
10
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,8BAA8B,EAC9B,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,eAAe,EACf,8BAA8B,EAC9B,yCAAyC,EAC1C,sBAAkB","sourcesContent":["export {\n JAVA_TRON_DEFAULT_FULL_NODE,\n JAVA_TRON_DEFAULT_JAVA_RUNTIME,\n cleanJavaTronCache,\n getJavaTronCacheDirectory,\n installJavaRuntime,\n installJavaTron,\n parseJavaTronInstallCliOptions,\n readJavaTronInstallOptionsFromPackageJson,\n} from './install';\nexport type {\n JavaTronArtifactConfig,\n JavaTronArtifactPlatformConfig,\n JavaTronInstallDependencies,\n JavaTronInstallOptions,\n JavaTronInstallResult,\n JavaTronJavaRuntimeConfig,\n} from './install';\n"]}
|