@solana-mobile/dapp-store-cli 0.5.0 → 0.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.
- package/lib/CliSetup.js +516 -443
- package/lib/CliUtils.js +1 -1
- package/lib/commands/create/CreateCliApp.js +12 -3
- package/lib/commands/create/CreateCliPublisher.js +10 -5
- package/lib/commands/create/CreateCliRelease.js +12 -7
- package/lib/config/PublishDetails.js +3 -1
- package/lib/index.js +1 -0
- package/lib/package.json +2 -2
- package/package.json +2 -2
- package/src/CliSetup.ts +10 -11
- package/src/CliUtils.ts +1 -1
- package/src/commands/create/CreateCliApp.ts +1 -1
- package/src/commands/create/CreateCliPublisher.ts +1 -1
- package/src/commands/create/CreateCliRelease.ts +1 -3
- package/src/config/PublishDetails.ts +3 -1
- package/src/index.ts +2 -0
package/lib/CliUtils.js
CHANGED
|
@@ -159,7 +159,7 @@ export var Constants = function Constants() {
|
|
|
159
159
|
"use strict";
|
|
160
160
|
_class_call_check(this, Constants);
|
|
161
161
|
};
|
|
162
|
-
_define_property(Constants, "CLI_VERSION", "0.5.
|
|
162
|
+
_define_property(Constants, "CLI_VERSION", "0.5.1");
|
|
163
163
|
_define_property(Constants, "CONFIG_FILE_NAME", "config.yaml");
|
|
164
164
|
_define_property(Constants, "DEFAULT_RPC_DEVNET", "https://api.devnet.solana.com");
|
|
165
165
|
_define_property(Constants, "getConfigFilePath", function() {
|
|
@@ -218,13 +218,22 @@ export var createAppCommand = function() {
|
|
|
218
218
|
];
|
|
219
219
|
case 2:
|
|
220
220
|
appAddress = _state.sent().appAddress;
|
|
221
|
-
if (
|
|
221
|
+
if (!!dryRun) return [
|
|
222
|
+
3,
|
|
223
|
+
4
|
|
224
|
+
];
|
|
225
|
+
return [
|
|
226
|
+
4,
|
|
222
227
|
writeToPublishDetails({
|
|
223
228
|
app: {
|
|
224
229
|
address: appAddress
|
|
225
230
|
}
|
|
226
|
-
})
|
|
227
|
-
|
|
231
|
+
})
|
|
232
|
+
];
|
|
233
|
+
case 3:
|
|
234
|
+
_state.sent();
|
|
235
|
+
_state.label = 4;
|
|
236
|
+
case 4:
|
|
228
237
|
return [
|
|
229
238
|
2,
|
|
230
239
|
{
|
|
@@ -218,11 +218,16 @@ export var createPublisherCommand = function() {
|
|
|
218
218
|
case 2:
|
|
219
219
|
publisherAddress = _state.sent().publisherAddress;
|
|
220
220
|
// TODO(sdlaver): dry-run should not modify config
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
221
|
+
return [
|
|
222
|
+
4,
|
|
223
|
+
writeToPublishDetails({
|
|
224
|
+
publisher: {
|
|
225
|
+
address: publisherAddress
|
|
226
|
+
}
|
|
227
|
+
})
|
|
228
|
+
];
|
|
229
|
+
case 3:
|
|
230
|
+
_state.sent();
|
|
226
231
|
return [
|
|
227
232
|
2,
|
|
228
233
|
{
|
|
@@ -230,7 +230,7 @@ export var createReleaseCommand = function() {
|
|
|
230
230
|
_ref = _state.sent(), release = _ref.release, app = _ref.app, publisher = _ref.publisher;
|
|
231
231
|
if (!!dryRun) return [
|
|
232
232
|
3,
|
|
233
|
-
|
|
233
|
+
4
|
|
234
234
|
];
|
|
235
235
|
return [
|
|
236
236
|
4,
|
|
@@ -246,18 +246,23 @@ export var createReleaseCommand = function() {
|
|
|
246
246
|
];
|
|
247
247
|
case 2:
|
|
248
248
|
releaseAddress = _state.sent().releaseAddress;
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
249
|
+
return [
|
|
250
|
+
4,
|
|
251
|
+
writeToPublishDetails({
|
|
252
|
+
release: {
|
|
253
|
+
address: releaseAddress
|
|
254
|
+
}
|
|
255
|
+
})
|
|
256
|
+
];
|
|
257
|
+
case 3:
|
|
258
|
+
_state.sent();
|
|
254
259
|
return [
|
|
255
260
|
2,
|
|
256
261
|
{
|
|
257
262
|
releaseAddress: releaseAddress
|
|
258
263
|
}
|
|
259
264
|
];
|
|
260
|
-
case
|
|
265
|
+
case 4:
|
|
261
266
|
return [
|
|
262
267
|
2
|
|
263
268
|
];
|
|
@@ -578,7 +578,9 @@ export var writeToPublishDetails = function() {
|
|
|
578
578
|
}),
|
|
579
579
|
solana_mobile_dapp_publisher_portal: currentConfig.solana_mobile_dapp_publisher_portal
|
|
580
580
|
};
|
|
581
|
-
fs.writeFileSync(Constants.getConfigFilePath(), dump(newConfig
|
|
581
|
+
fs.writeFileSync(Constants.getConfigFilePath(), dump(newConfig, {
|
|
582
|
+
lineWidth: -1
|
|
583
|
+
}));
|
|
582
584
|
return [
|
|
583
585
|
2
|
|
584
586
|
];
|
package/lib/index.js
CHANGED
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana-mobile/dapp-store-cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@aws-sdk/client-s3": "^3.321.1",
|
|
55
55
|
"@metaplex-foundation/js-plugin-aws": "^0.18.3",
|
|
56
|
-
"@solana-mobile/dapp-store-publishing-tools": "workspace:0.5.
|
|
56
|
+
"@solana-mobile/dapp-store-publishing-tools": "workspace:0.5.1",
|
|
57
57
|
"@solana/web3.js": "1.68.0",
|
|
58
58
|
"@types/semver": "^7.3.13",
|
|
59
59
|
"ajv": "^8.11.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana-mobile/dapp-store-cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@aws-sdk/client-s3": "^3.321.1",
|
|
48
48
|
"@metaplex-foundation/js-plugin-aws": "^0.18.3",
|
|
49
|
-
"@solana-mobile/dapp-store-publishing-tools": "0.5.
|
|
49
|
+
"@solana-mobile/dapp-store-publishing-tools": "0.5.1",
|
|
50
50
|
"@solana/web3.js": "1.68.0",
|
|
51
51
|
"@types/semver": "^7.3.13",
|
|
52
52
|
"ajv": "^8.11.0",
|
package/src/CliSetup.ts
CHANGED
|
@@ -60,6 +60,7 @@ async function tryWithErrorMessage(block: () => Promise<any>) {
|
|
|
60
60
|
const errorMsg = (e as Error | null)?.message ?? "";
|
|
61
61
|
|
|
62
62
|
showMessage("Error", errorMsg, "error");
|
|
63
|
+
process.exit(-1)
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
66
|
|
|
@@ -72,7 +73,7 @@ export const initCliCmd = mainCli
|
|
|
72
73
|
.command("init")
|
|
73
74
|
.description("First-time initialization of tooling configuration")
|
|
74
75
|
.action(async () => {
|
|
75
|
-
tryWithErrorMessage(async () => {
|
|
76
|
+
await tryWithErrorMessage(async () => {
|
|
76
77
|
const msg = initScaffold();
|
|
77
78
|
|
|
78
79
|
showMessage("Initialized", msg);
|
|
@@ -94,7 +95,7 @@ export const createPublisherCliCmd = createCliCmd
|
|
|
94
95
|
.option("-d, --dry-run", "Flag for dry run. Doesn't mint an NFT")
|
|
95
96
|
.option("-s, --storage-config <storage-config>", "Provide alternative storage configuration details")
|
|
96
97
|
.action(async ({ keypair, url, dryRun, storageConfig }) => {
|
|
97
|
-
tryWithErrorMessage(async () => {
|
|
98
|
+
await tryWithErrorMessage(async () => {
|
|
98
99
|
latestReleaseMessage();
|
|
99
100
|
await checkForSelfUpdate();
|
|
100
101
|
|
|
@@ -125,7 +126,7 @@ export const createAppCliCmd = createCliCmd
|
|
|
125
126
|
.option("-d, --dry-run", "Flag for dry run. Doesn't mint an NFT")
|
|
126
127
|
.option("-s, --storage-config <storage-config>", "Provide alternative storage configuration details")
|
|
127
128
|
.action(async ({ publisherMintAddress, keypair, url, dryRun, storageConfig }) => {
|
|
128
|
-
tryWithErrorMessage(async () => {
|
|
129
|
+
await tryWithErrorMessage(async () => {
|
|
129
130
|
latestReleaseMessage();
|
|
130
131
|
await checkForSelfUpdate();
|
|
131
132
|
|
|
@@ -172,7 +173,7 @@ export const createReleaseCliCmd = createCliCmd
|
|
|
172
173
|
)
|
|
173
174
|
.option("-s, --storage-config <storage-config>", "Provide alternative storage configuration details")
|
|
174
175
|
.action(async ({ appMintAddress, keypair, url, dryRun, buildToolsPath, storageConfig }) => {
|
|
175
|
-
|
|
176
|
+
await tryWithErrorMessage(async () => {
|
|
176
177
|
latestReleaseMessage();
|
|
177
178
|
await checkForSelfUpdate();
|
|
178
179
|
|
|
@@ -218,7 +219,7 @@ mainCli
|
|
|
218
219
|
"Path to Android build tools which contains AAPT2"
|
|
219
220
|
)
|
|
220
221
|
.action(async ({ keypair, buildToolsPath }) => {
|
|
221
|
-
tryWithErrorMessage(async () => {
|
|
222
|
+
await tryWithErrorMessage(async () => {
|
|
222
223
|
latestReleaseMessage();
|
|
223
224
|
await checkForSelfUpdate();
|
|
224
225
|
|
|
@@ -233,8 +234,6 @@ mainCli
|
|
|
233
234
|
signer,
|
|
234
235
|
buildToolsPath: resolvedBuildToolsPath,
|
|
235
236
|
});
|
|
236
|
-
|
|
237
|
-
//TODO: Add pretty formatting here, but will require more work than other sections
|
|
238
237
|
}
|
|
239
238
|
});
|
|
240
239
|
});
|
|
@@ -283,7 +282,7 @@ publishCommand
|
|
|
283
282
|
requestorIsAuthorized,
|
|
284
283
|
dryRun,
|
|
285
284
|
}) => {
|
|
286
|
-
tryWithErrorMessage(async () => {
|
|
285
|
+
await tryWithErrorMessage(async () => {
|
|
287
286
|
await checkForSelfUpdate();
|
|
288
287
|
await checkSubmissionNetwork(url);
|
|
289
288
|
|
|
@@ -354,7 +353,7 @@ publishCommand
|
|
|
354
353
|
critical,
|
|
355
354
|
dryRun,
|
|
356
355
|
}) => {
|
|
357
|
-
tryWithErrorMessage(async () => {
|
|
356
|
+
await tryWithErrorMessage(async () => {
|
|
358
357
|
await checkForSelfUpdate();
|
|
359
358
|
await checkSubmissionNetwork(url);
|
|
360
359
|
|
|
@@ -421,7 +420,7 @@ publishCommand
|
|
|
421
420
|
critical,
|
|
422
421
|
dryRun,
|
|
423
422
|
}) => {
|
|
424
|
-
tryWithErrorMessage(async () => {
|
|
423
|
+
await tryWithErrorMessage(async () => {
|
|
425
424
|
await checkForSelfUpdate();
|
|
426
425
|
await checkSubmissionNetwork(url);
|
|
427
426
|
|
|
@@ -481,7 +480,7 @@ publishCommand
|
|
|
481
480
|
requestDetails,
|
|
482
481
|
{ appMintAddress, releaseMintAddress, keypair, url, requestorIsAuthorized, dryRun }
|
|
483
482
|
) => {
|
|
484
|
-
tryWithErrorMessage(async () => {
|
|
483
|
+
await tryWithErrorMessage(async () => {
|
|
485
484
|
await checkForSelfUpdate();
|
|
486
485
|
await checkSubmissionNetwork(url);
|
|
487
486
|
|
package/src/CliUtils.ts
CHANGED
|
@@ -18,7 +18,7 @@ import { awsStorage } from "@metaplex-foundation/js-plugin-aws";
|
|
|
18
18
|
import { S3StorageManager } from "./config/index.js";
|
|
19
19
|
|
|
20
20
|
export class Constants {
|
|
21
|
-
static CLI_VERSION = "0.5.
|
|
21
|
+
static CLI_VERSION = "0.5.1";
|
|
22
22
|
static CONFIG_FILE_NAME = "config.yaml";
|
|
23
23
|
static DEFAULT_RPC_DEVNET = "https://api.devnet.solana.com";
|
|
24
24
|
|
|
@@ -78,7 +78,7 @@ export const createPublisherCommand = async ({
|
|
|
78
78
|
);
|
|
79
79
|
|
|
80
80
|
// TODO(sdlaver): dry-run should not modify config
|
|
81
|
-
writeToPublishDetails({ publisher: { address: publisherAddress } });
|
|
81
|
+
await writeToPublishDetails({ publisher: { address: publisherAddress } });
|
|
82
82
|
|
|
83
83
|
return { publisherAddress };
|
|
84
84
|
};
|
|
@@ -99,9 +99,7 @@ export const createReleaseCommand = async ({
|
|
|
99
99
|
storageParams: storageParams,
|
|
100
100
|
});
|
|
101
101
|
|
|
102
|
-
writeToPublishDetails({
|
|
103
|
-
release: { address: releaseAddress },
|
|
104
|
-
});
|
|
102
|
+
await writeToPublishDetails({ release: { address: releaseAddress }, });
|
|
105
103
|
|
|
106
104
|
return { releaseAddress };
|
|
107
105
|
}
|
|
@@ -281,5 +281,7 @@ export const writeToPublishDetails = async ({ publisher, app, release }: SaveToC
|
|
|
281
281
|
solana_mobile_dapp_publisher_portal: currentConfig.solana_mobile_dapp_publisher_portal
|
|
282
282
|
};
|
|
283
283
|
|
|
284
|
-
fs.writeFileSync(Constants.getConfigFilePath(), dump(newConfig
|
|
284
|
+
fs.writeFileSync(Constants.getConfigFilePath(), dump(newConfig, {
|
|
285
|
+
lineWidth: -1
|
|
286
|
+
}));
|
|
285
287
|
};
|