@solana-mobile/dapp-store-cli 0.9.5 → 0.10.0
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 +12 -11
- package/lib/CliUtils.js +6 -6
- package/lib/commands/ValidateCommand.js +3 -3
- package/lib/commands/create/CreateCliApp.js +4 -4
- package/lib/commands/create/CreateCliPublisher.js +4 -4
- package/lib/commands/create/CreateCliRelease.js +4 -4
- package/lib/commands/publish/PublishCliRemove.js +3 -3
- package/lib/commands/publish/PublishCliSubmit.js +3 -3
- package/lib/commands/publish/PublishCliSupport.js +3 -3
- package/lib/commands/publish/PublishCliUpdate.js +3 -3
- package/lib/commands/scaffolding/ScaffoldInit.js +1 -1
- package/lib/config/PublishDetails.js +193 -62
- package/lib/generated/config_obj.json +1 -1
- package/lib/package.json +2 -2
- package/lib/prebuild_schema/publishing_source.yaml +4 -0
- package/lib/prebuild_schema/schemagen.js +4 -4
- package/package.json +2 -2
- package/src/CliSetup.ts +1 -0
- package/src/CliUtils.ts +1 -1
- package/src/config/PublishDetails.ts +54 -4
- package/src/prebuild_schema/publishing_source.yaml +4 -0
package/lib/CliSetup.js
CHANGED
|
@@ -37,13 +37,13 @@ function _ts_generator(thisArg, body) {
|
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return g = {
|
|
41
41
|
next: verb(0),
|
|
42
42
|
"throw": verb(1),
|
|
43
43
|
"return": verb(2)
|
|
44
44
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
45
|
return this;
|
|
46
|
-
}), g
|
|
46
|
+
}), g;
|
|
47
47
|
function verb(n) {
|
|
48
48
|
return function(v) {
|
|
49
49
|
return step([
|
|
@@ -153,11 +153,12 @@ function resolveBuildToolsPath(buildToolsPath) {
|
|
|
153
153
|
* This method should be updated with each new release of the CLI, and just do nothing when there isn't anything to report
|
|
154
154
|
*/ function latestReleaseMessage() {
|
|
155
155
|
var messages = [
|
|
156
|
+
"- App details page now supports a Banner Graphic image of size 1200x600px and a Feature Graphic image of size 1200x1200px (optional)",
|
|
156
157
|
"- App details page now supports video files. (mp4 file format only and minimum resolution 720p)",
|
|
157
158
|
"- priority fee has been updated to ".concat(Constants.DEFAULT_PRIORITY_FEE, " lamports = ").concat(Constants.DEFAULT_PRIORITY_FEE / LAMPORTS_PER_SOL, ' SOL. To adjust this value use param "-p" or "--priority-fee-lamports"'),
|
|
158
159
|
"- At least 4 screenshots are now required to update or release a new app",
|
|
159
160
|
"- App icons should be exactly 512x512."
|
|
160
|
-
].join(
|
|
161
|
+
].join('\n\n');
|
|
161
162
|
showMessage("Publishing Tools Version ".concat(Constants.CLI_VERSION), messages, "warning");
|
|
162
163
|
}
|
|
163
164
|
function tryWithErrorMessage(block) {
|
|
@@ -230,7 +231,7 @@ export var initCliCmd = mainCli.command("init").description("First-time initiali
|
|
|
230
231
|
});
|
|
231
232
|
}));
|
|
232
233
|
export var createCliCmd = mainCli.command("create").description("Create a `publisher`, `app`, or `release`");
|
|
233
|
-
export var createPublisherCliCmd = createCliCmd.command("publisher").description("Create a publisher").requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file").option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET).option("-d, --dry-run", "Flag for dry run. Doesn't mint an NFT").option("-s, --storage-config <storage-config>", "Provide alternative storage configuration details").option("-p, --priority-fee-lamports <priority-fee-lamports>", "Priority Fee lamports").action(function() {
|
|
234
|
+
export var createPublisherCliCmd = createCliCmd.command("publisher").description("Create a publisher").requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file").option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET).option("-d, --dry-run", "Flag for dry run. Doesn't mint an NFT").option("-s, --storage-config <storage-config>", "Provide alternative storage configuration details").option("-p, --priority-fee-lamports <priority-fee-lamports>", "Priority Fee lamports").action(/*#__PURE__*/ function() {
|
|
234
235
|
var _ref = _async_to_generator(function(param) {
|
|
235
236
|
var keypair, url, dryRun, storageConfig, priorityFeeLamports;
|
|
236
237
|
return _ts_generator(this, function(_state) {
|
|
@@ -298,7 +299,7 @@ export var createPublisherCliCmd = createCliCmd.command("publisher").description
|
|
|
298
299
|
return _ref.apply(this, arguments);
|
|
299
300
|
};
|
|
300
301
|
}());
|
|
301
|
-
export var createAppCliCmd = createCliCmd.command("app").description("Create a app").requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file").option("-p, --publisher-mint-address <publisher-mint-address>", "The mint address of the publisher NFT").option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET).option("-d, --dry-run", "Flag for dry run. Doesn't mint an NFT").option("-s, --storage-config <storage-config>", "Provide alternative storage configuration details").option("-p, --priority-fee-lamports <priority-fee-lamports>", "Priority Fee lamports").action(function() {
|
|
302
|
+
export var createAppCliCmd = createCliCmd.command("app").description("Create a app").requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file").option("-p, --publisher-mint-address <publisher-mint-address>", "The mint address of the publisher NFT").option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET).option("-d, --dry-run", "Flag for dry run. Doesn't mint an NFT").option("-s, --storage-config <storage-config>", "Provide alternative storage configuration details").option("-p, --priority-fee-lamports <priority-fee-lamports>", "Priority Fee lamports").action(/*#__PURE__*/ function() {
|
|
302
303
|
var _ref = _async_to_generator(function(param) {
|
|
303
304
|
var publisherMintAddress, keypair, url, dryRun, storageConfig, priorityFeeLamports;
|
|
304
305
|
return _ts_generator(this, function(_state) {
|
|
@@ -376,7 +377,7 @@ export var createAppCliCmd = createCliCmd.command("app").description("Create a a
|
|
|
376
377
|
return _ref.apply(this, arguments);
|
|
377
378
|
};
|
|
378
379
|
}());
|
|
379
|
-
export var createReleaseCliCmd = createCliCmd.command("release").description("Create a release").requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file").option("-a, --app-mint-address <app-mint-address>", "The mint address of the app NFT").option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET).option("-d, --dry-run", "Flag for dry run. Doesn't mint an NFT").option("-b, --build-tools-path <build-tools-path>", "Path to Android build tools which contains AAPT2").option("-s, --storage-config <storage-config>", "Provide alternative storage configuration details").option("-p, --priority-fee-lamports <priority-fee-lamports>", "Priority Fee lamports").action(function() {
|
|
380
|
+
export var createReleaseCliCmd = createCliCmd.command("release").description("Create a release").requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file").option("-a, --app-mint-address <app-mint-address>", "The mint address of the app NFT").option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET).option("-d, --dry-run", "Flag for dry run. Doesn't mint an NFT").option("-b, --build-tools-path <build-tools-path>", "Path to Android build tools which contains AAPT2").option("-s, --storage-config <storage-config>", "Provide alternative storage configuration details").option("-p, --priority-fee-lamports <priority-fee-lamports>", "Priority Fee lamports").action(/*#__PURE__*/ function() {
|
|
380
381
|
var _ref = _async_to_generator(function(param) {
|
|
381
382
|
var appMintAddress, keypair, url, dryRun, buildToolsPath, storageConfig, priorityFeeLamports;
|
|
382
383
|
return _ts_generator(this, function(_state) {
|
|
@@ -459,7 +460,7 @@ export var createReleaseCliCmd = createCliCmd.command("release").description("Cr
|
|
|
459
460
|
return _ref.apply(this, arguments);
|
|
460
461
|
};
|
|
461
462
|
}());
|
|
462
|
-
mainCli.command("validate").description("Validates details prior to publishing").requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file").option("-b, --build-tools-path <build-tools-path>", "Path to Android build tools which contains AAPT2").action(function() {
|
|
463
|
+
mainCli.command("validate").description("Validates details prior to publishing").requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file").option("-b, --build-tools-path <build-tools-path>", "Path to Android build tools which contains AAPT2").action(/*#__PURE__*/ function() {
|
|
463
464
|
var _ref = _async_to_generator(function(param) {
|
|
464
465
|
var keypair, buildToolsPath;
|
|
465
466
|
return _ts_generator(this, function(_state) {
|
|
@@ -520,7 +521,7 @@ mainCli.command("validate").description("Validates details prior to publishing")
|
|
|
520
521
|
};
|
|
521
522
|
}());
|
|
522
523
|
var publishCommand = mainCli.command("publish").description("Submit a publishing request (`submit`, `update`, `remove`, or `support`) to the Solana Mobile dApp publisher portal");
|
|
523
|
-
publishCommand.command("submit").description("Submit a new app to the Solana Mobile dApp publisher portal").requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file").requiredOption("--complies-with-solana-dapp-store-policies", "An attestation that the app complies with the Solana dApp Store policies").requiredOption("--requestor-is-authorized", "An attestation that the party making this Solana dApp publisher portal request is authorized to do so").option("-a, --app-mint-address <app-mint-address>", "The mint address of the app NFT. If not specified, the value from your config file will be used.").option("-r, --release-mint-address <release-mint-address>", "The mint address of the release NFT. If not specified, the value from your config file will be used.").option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET).option("-d, --dry-run", "Flag for dry run. Doesn't submit the request to the publisher portal.").option("-l, --alpha", "Flag to mark the submission as alpha test.").action(function() {
|
|
524
|
+
publishCommand.command("submit").description("Submit a new app to the Solana Mobile dApp publisher portal").requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file").requiredOption("--complies-with-solana-dapp-store-policies", "An attestation that the app complies with the Solana dApp Store policies").requiredOption("--requestor-is-authorized", "An attestation that the party making this Solana dApp publisher portal request is authorized to do so").option("-a, --app-mint-address <app-mint-address>", "The mint address of the app NFT. If not specified, the value from your config file will be used.").option("-r, --release-mint-address <release-mint-address>", "The mint address of the release NFT. If not specified, the value from your config file will be used.").option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET).option("-d, --dry-run", "Flag for dry run. Doesn't submit the request to the publisher portal.").option("-l, --alpha", "Flag to mark the submission as alpha test.").action(/*#__PURE__*/ function() {
|
|
524
525
|
var _ref = _async_to_generator(function(param) {
|
|
525
526
|
var appMintAddress, releaseMintAddress, keypair, url, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, dryRun, alpha;
|
|
526
527
|
return _ts_generator(this, function(_state) {
|
|
@@ -626,7 +627,7 @@ publishCommand.command("submit").description("Submit a new app to the Solana Mob
|
|
|
626
627
|
return _ref.apply(this, arguments);
|
|
627
628
|
};
|
|
628
629
|
}());
|
|
629
|
-
publishCommand.command("update").description("Update an existing app on the Solana Mobile dApp publisher portal").requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file").requiredOption("--complies-with-solana-dapp-store-policies", "An attestation that the app complies with the Solana dApp Store policies").requiredOption("--requestor-is-authorized", "An attestation that the party making this Solana dApp publisher portal request is authorized to do so").option("-a, --app-mint-address <app-mint-address>", "The mint address of the app NFT. If not specified, the value from your config file will be used.").option("-r, --release-mint-address <release-mint-address>", "The mint address of the release NFT. If not specified, the value from your config file will be used.").option("-c, --critical", "Flag for a critical app update request").option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET).option("-d, --dry-run", "Flag for dry run. Doesn't submit the request to the publisher portal.").option("-l, --alpha", "Flag to mark the submission as alpha test.").action(function() {
|
|
630
|
+
publishCommand.command("update").description("Update an existing app on the Solana Mobile dApp publisher portal").requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file").requiredOption("--complies-with-solana-dapp-store-policies", "An attestation that the app complies with the Solana dApp Store policies").requiredOption("--requestor-is-authorized", "An attestation that the party making this Solana dApp publisher portal request is authorized to do so").option("-a, --app-mint-address <app-mint-address>", "The mint address of the app NFT. If not specified, the value from your config file will be used.").option("-r, --release-mint-address <release-mint-address>", "The mint address of the release NFT. If not specified, the value from your config file will be used.").option("-c, --critical", "Flag for a critical app update request").option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET).option("-d, --dry-run", "Flag for dry run. Doesn't submit the request to the publisher portal.").option("-l, --alpha", "Flag to mark the submission as alpha test.").action(/*#__PURE__*/ function() {
|
|
630
631
|
var _ref = _async_to_generator(function(param) {
|
|
631
632
|
var appMintAddress, releaseMintAddress, keypair, url, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, critical, dryRun, alpha;
|
|
632
633
|
return _ts_generator(this, function(_state) {
|
|
@@ -706,7 +707,7 @@ publishCommand.command("update").description("Update an existing app on the Sola
|
|
|
706
707
|
return _ref.apply(this, arguments);
|
|
707
708
|
};
|
|
708
709
|
}());
|
|
709
|
-
publishCommand.command("remove").description("Remove an existing app from the Solana Mobile dApp publisher portal").requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file").requiredOption("--requestor-is-authorized", "An attestation that the party making this Solana dApp publisher portal request is authorized to do so").option("-a, --app-mint-address <app-mint-address>", "The mint address of the app NFT. If not specified, the value from your config file will be used.").option("-r, --release-mint-address <release-mint-address>", "The mint address of the release NFT. If not specified, the value from your config file will be used.").option("-c, --critical", "Flag for a critical app removal request").option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET).option("-d, --dry-run", "Flag for dry run. Doesn't submit the request to the publisher portal.").action(function() {
|
|
710
|
+
publishCommand.command("remove").description("Remove an existing app from the Solana Mobile dApp publisher portal").requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file").requiredOption("--requestor-is-authorized", "An attestation that the party making this Solana dApp publisher portal request is authorized to do so").option("-a, --app-mint-address <app-mint-address>", "The mint address of the app NFT. If not specified, the value from your config file will be used.").option("-r, --release-mint-address <release-mint-address>", "The mint address of the release NFT. If not specified, the value from your config file will be used.").option("-c, --critical", "Flag for a critical app removal request").option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET).option("-d, --dry-run", "Flag for dry run. Doesn't submit the request to the publisher portal.").action(/*#__PURE__*/ function() {
|
|
710
711
|
var _ref = _async_to_generator(function(param) {
|
|
711
712
|
var appMintAddress, releaseMintAddress, keypair, url, requestorIsAuthorized, critical, dryRun;
|
|
712
713
|
return _ts_generator(this, function(_state) {
|
|
@@ -781,7 +782,7 @@ publishCommand.command("remove").description("Remove an existing app from the So
|
|
|
781
782
|
return _ref.apply(this, arguments);
|
|
782
783
|
};
|
|
783
784
|
}());
|
|
784
|
-
publishCommand.command("support <request_details>").description("Submit a support request for an existing app on the Solana Mobile dApp publisher portal").requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file").requiredOption("--requestor-is-authorized", "An attestation that the party making this Solana dApp publisher portal request is authorized to do so").option("-a, --app-mint-address <app-mint-address>", "The mint address of the app NFT. If not specified, the value from your config file will be used.").option("-r, --release-mint-address <release-mint-address>", "The mint address of the release NFT. If not specified, the value from your config file will be used.").option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET).option("-d, --dry-run", "Flag for dry run. Doesn't submit the request to the publisher portal.").action(function() {
|
|
785
|
+
publishCommand.command("support <request_details>").description("Submit a support request for an existing app on the Solana Mobile dApp publisher portal").requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file").requiredOption("--requestor-is-authorized", "An attestation that the party making this Solana dApp publisher portal request is authorized to do so").option("-a, --app-mint-address <app-mint-address>", "The mint address of the app NFT. If not specified, the value from your config file will be used.").option("-r, --release-mint-address <release-mint-address>", "The mint address of the release NFT. If not specified, the value from your config file will be used.").option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET).option("-d, --dry-run", "Flag for dry run. Doesn't submit the request to the publisher portal.").action(/*#__PURE__*/ function() {
|
|
785
786
|
var _ref = _async_to_generator(function(requestDetails, param) {
|
|
786
787
|
var appMintAddress, releaseMintAddress, keypair, url, requestorIsAuthorized, dryRun;
|
|
787
788
|
return _ts_generator(this, function(_state) {
|
package/lib/CliUtils.js
CHANGED
|
@@ -55,13 +55,13 @@ function _ts_generator(thisArg, body) {
|
|
|
55
55
|
trys: [],
|
|
56
56
|
ops: []
|
|
57
57
|
};
|
|
58
|
-
return
|
|
58
|
+
return g = {
|
|
59
59
|
next: verb(0),
|
|
60
60
|
"throw": verb(1),
|
|
61
61
|
"return": verb(2)
|
|
62
62
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
63
63
|
return this;
|
|
64
|
-
}), g
|
|
64
|
+
}), g;
|
|
65
65
|
function verb(n) {
|
|
66
66
|
return function(v) {
|
|
67
67
|
return step([
|
|
@@ -145,7 +145,7 @@ import { Keypair, PublicKey } from "@solana/web3.js";
|
|
|
145
145
|
import debugModule from "debug";
|
|
146
146
|
import { IrysStorageDriver, keypairIdentity, Metaplex } from "@metaplex-foundation/js";
|
|
147
147
|
import updateNotifier from "update-notifier";
|
|
148
|
-
import { readFile } from
|
|
148
|
+
import { readFile } from 'fs/promises';
|
|
149
149
|
var cliPackage = JSON.parse((await readFile(new URL("./package.json", import.meta.url))).toString());
|
|
150
150
|
import boxen from "boxen";
|
|
151
151
|
import ver from "semver";
|
|
@@ -158,7 +158,7 @@ export var Constants = function Constants() {
|
|
|
158
158
|
"use strict";
|
|
159
159
|
_class_call_check(this, Constants);
|
|
160
160
|
};
|
|
161
|
-
_define_property(Constants, "CLI_VERSION", "0.
|
|
161
|
+
_define_property(Constants, "CLI_VERSION", "0.10.0");
|
|
162
162
|
_define_property(Constants, "CONFIG_FILE_NAME", "config.yaml");
|
|
163
163
|
_define_property(Constants, "DEFAULT_RPC_DEVNET", "https://api.devnet.solana.com");
|
|
164
164
|
_define_property(Constants, "DEFAULT_PRIORITY_FEE", 500000);
|
|
@@ -166,7 +166,7 @@ _define_property(Constants, "getConfigFilePath", function() {
|
|
|
166
166
|
return "".concat(process.cwd(), "/").concat(Constants.CONFIG_FILE_NAME);
|
|
167
167
|
});
|
|
168
168
|
export var debug = debugModule("CLI");
|
|
169
|
-
export var checkForSelfUpdate = function() {
|
|
169
|
+
export var checkForSelfUpdate = /*#__PURE__*/ function() {
|
|
170
170
|
var _ref = _async_to_generator(function() {
|
|
171
171
|
var notifier, updateInfo, latestVer, currentVer;
|
|
172
172
|
return _ts_generator(this, function(_state) {
|
|
@@ -196,7 +196,7 @@ export var checkForSelfUpdate = function() {
|
|
|
196
196
|
return _ref.apply(this, arguments);
|
|
197
197
|
};
|
|
198
198
|
}();
|
|
199
|
-
export var checkMintedStatus = function() {
|
|
199
|
+
export var checkMintedStatus = /*#__PURE__*/ function() {
|
|
200
200
|
var _ref = _async_to_generator(function(conn, pubAddr, appAddr, releaseAddr) {
|
|
201
201
|
var i, _results_, _results_1, _results_2, results, isPublisherMinted, isAppMinted, isReleaseMinted, errorMessage;
|
|
202
202
|
return _ts_generator(this, function(_state) {
|
|
@@ -37,13 +37,13 @@ function _ts_generator(thisArg, body) {
|
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return g = {
|
|
41
41
|
next: verb(0),
|
|
42
42
|
"throw": verb(1),
|
|
43
43
|
"return": verb(2)
|
|
44
44
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
45
|
return this;
|
|
46
|
-
}), g
|
|
46
|
+
}), g;
|
|
47
47
|
function verb(n) {
|
|
48
48
|
return function(v) {
|
|
49
49
|
return step([
|
|
@@ -125,7 +125,7 @@ function _ts_generator(thisArg, body) {
|
|
|
125
125
|
import { createAppJson, createPublisherJson, createReleaseJson, validateApp, validatePublisher, validateRelease, metaplexFileReplacer } from "@solana-mobile/dapp-store-publishing-tools";
|
|
126
126
|
import { debug, showMessage } from "../CliUtils.js";
|
|
127
127
|
import { loadPublishDetailsWithChecks } from "../config/PublishDetails.js";
|
|
128
|
-
export var validateCommand = function() {
|
|
128
|
+
export var validateCommand = /*#__PURE__*/ function() {
|
|
129
129
|
var _ref = _async_to_generator(function(param) {
|
|
130
130
|
var signer, buildToolsPath, _ref, publisherDetails, appDetails, releaseDetails, publisherJson, _publisherJson_image, _e_message, errorMsg, appJson, _appJson_image, _e_message1, errorMsg1, releaseJson, objStringified, _e_message2, errorMsg2;
|
|
131
131
|
return _ts_generator(this, function(_state) {
|
|
@@ -37,13 +37,13 @@ function _ts_generator(thisArg, body) {
|
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return g = {
|
|
41
41
|
next: verb(0),
|
|
42
42
|
"throw": verb(1),
|
|
43
43
|
"return": verb(2)
|
|
44
44
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
45
|
return this;
|
|
46
|
-
}), g
|
|
46
|
+
}), g;
|
|
47
47
|
function verb(n) {
|
|
48
48
|
return function(v) {
|
|
49
49
|
return step([
|
|
@@ -127,7 +127,7 @@ import { Connection, Keypair, PublicKey } from "@solana/web3.js";
|
|
|
127
127
|
import { Constants, getMetaplexInstance } from "../../CliUtils.js";
|
|
128
128
|
import { loadPublishDetailsWithChecks, writeToPublishDetails } from "../../config/PublishDetails.js";
|
|
129
129
|
import { sendAndConfirmTransaction } from "../utils.js";
|
|
130
|
-
var createAppNft = function() {
|
|
130
|
+
var createAppNft = /*#__PURE__*/ function() {
|
|
131
131
|
var _ref = _async_to_generator(function(param) {
|
|
132
132
|
var appDetails, connection, publisherMintAddress, publisher, storageParams, priorityFeeLamports, mintAddress, metaplex, txBuilder, response;
|
|
133
133
|
return _ts_generator(this, function(_state) {
|
|
@@ -172,7 +172,7 @@ var createAppNft = function() {
|
|
|
172
172
|
return _ref.apply(this, arguments);
|
|
173
173
|
};
|
|
174
174
|
}();
|
|
175
|
-
export var createAppCommand = function() {
|
|
175
|
+
export var createAppCommand = /*#__PURE__*/ function() {
|
|
176
176
|
var _ref = _async_to_generator(function(param) {
|
|
177
177
|
var signer, url, dryRun, publisherMintAddress, storageParams, _param_priorityFeeLamports, priorityFeeLamports, connection, _ref, appDetails, publisherDetails, _publisherDetails_address, _ref1, appAddress, transactionSignature;
|
|
178
178
|
return _ts_generator(this, function(_state) {
|
|
@@ -37,13 +37,13 @@ function _ts_generator(thisArg, body) {
|
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return g = {
|
|
41
41
|
next: verb(0),
|
|
42
42
|
"throw": verb(1),
|
|
43
43
|
"return": verb(2)
|
|
44
44
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
45
|
return this;
|
|
46
|
-
}), g
|
|
46
|
+
}), g;
|
|
47
47
|
function verb(n) {
|
|
48
48
|
return function(v) {
|
|
49
49
|
return step([
|
|
@@ -127,7 +127,7 @@ import { Connection, Keypair } from "@solana/web3.js";
|
|
|
127
127
|
import { Constants, getMetaplexInstance } from "../../CliUtils.js";
|
|
128
128
|
import { loadPublishDetailsWithChecks, writeToPublishDetails } from "../../config/PublishDetails.js";
|
|
129
129
|
import { sendAndConfirmTransaction } from "../utils.js";
|
|
130
|
-
var createPublisherNft = function() {
|
|
130
|
+
var createPublisherNft = /*#__PURE__*/ function() {
|
|
131
131
|
var _ref = _async_to_generator(function(param) {
|
|
132
132
|
var connection, publisher, publisherDetails, storageParams, priorityFeeLamports, mintAddress, metaplex, txBuilder, response;
|
|
133
133
|
return _ts_generator(this, function(_state) {
|
|
@@ -171,7 +171,7 @@ var createPublisherNft = function() {
|
|
|
171
171
|
return _ref.apply(this, arguments);
|
|
172
172
|
};
|
|
173
173
|
}();
|
|
174
|
-
export var createPublisherCommand = function() {
|
|
174
|
+
export var createPublisherCommand = /*#__PURE__*/ function() {
|
|
175
175
|
var _ref = _async_to_generator(function(param) {
|
|
176
176
|
var signer, url, dryRun, storageParams, _param_priorityFeeLamports, priorityFeeLamports, connection, _ref, publisherDetails, _ref1, publisherAddress, transactionSignature;
|
|
177
177
|
return _ts_generator(this, function(_state) {
|
|
@@ -65,13 +65,13 @@ function _ts_generator(thisArg, body) {
|
|
|
65
65
|
trys: [],
|
|
66
66
|
ops: []
|
|
67
67
|
};
|
|
68
|
-
return
|
|
68
|
+
return g = {
|
|
69
69
|
next: verb(0),
|
|
70
70
|
"throw": verb(1),
|
|
71
71
|
"return": verb(2)
|
|
72
72
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
73
73
|
return this;
|
|
74
|
-
}), g
|
|
74
|
+
}), g;
|
|
75
75
|
function verb(n) {
|
|
76
76
|
return function(v) {
|
|
77
77
|
return step([
|
|
@@ -157,7 +157,7 @@ import { createHash } from "crypto";
|
|
|
157
157
|
import { Constants, getMetaplexInstance } from "../../CliUtils.js";
|
|
158
158
|
import { loadPublishDetailsWithChecks, writeToPublishDetails } from "../../config/PublishDetails.js";
|
|
159
159
|
import { sendAndConfirmTransaction } from "../utils.js";
|
|
160
|
-
var createReleaseNft = function() {
|
|
160
|
+
var createReleaseNft = /*#__PURE__*/ function() {
|
|
161
161
|
var _ref = _async_to_generator(function(param) {
|
|
162
162
|
var appMintAddress, releaseDetails, appDetails, publisherDetails, connection, publisher, storageParams, priorityFeeLamports, releaseMintAddress, metaplex, txBuilder, response;
|
|
163
163
|
return _ts_generator(this, function(_state) {
|
|
@@ -204,7 +204,7 @@ var createReleaseNft = function() {
|
|
|
204
204
|
return _ref.apply(this, arguments);
|
|
205
205
|
};
|
|
206
206
|
}();
|
|
207
|
-
export var createReleaseCommand = function() {
|
|
207
|
+
export var createReleaseCommand = /*#__PURE__*/ function() {
|
|
208
208
|
var _ref = _async_to_generator(function(param) {
|
|
209
209
|
var appMintAddress, buildToolsPath, signer, url, _param_dryRun, dryRun, storageParams, _param_priorityFeeLamports, priorityFeeLamports, connection, config, apkEntry, mediaBuffer, hash, _config_app_address, _ref, releaseAddress, transactionSignature;
|
|
210
210
|
return _ts_generator(this, function(_state) {
|
|
@@ -37,13 +37,13 @@ function _ts_generator(thisArg, body) {
|
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return g = {
|
|
41
41
|
next: verb(0),
|
|
42
42
|
"throw": verb(1),
|
|
43
43
|
"return": verb(2)
|
|
44
44
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
45
|
return this;
|
|
46
|
-
}), g
|
|
46
|
+
}), g;
|
|
47
47
|
function verb(n) {
|
|
48
48
|
return function(v) {
|
|
49
49
|
return step([
|
|
@@ -127,7 +127,7 @@ import { publishRemove } from "@solana-mobile/dapp-store-publishing-tools";
|
|
|
127
127
|
import { checkMintedStatus } from "../../CliUtils.js";
|
|
128
128
|
import nacl from "tweetnacl";
|
|
129
129
|
import { loadPublishDetailsWithChecks } from "../../config/PublishDetails.js";
|
|
130
|
-
export var publishRemoveCommand = function() {
|
|
130
|
+
export var publishRemoveCommand = /*#__PURE__*/ function() {
|
|
131
131
|
var _ref = _async_to_generator(function(param) {
|
|
132
132
|
var appMintAddress, releaseMintAddress, signer, url, _param_dryRun, dryRun, _param_requestorIsAuthorized, requestorIsAuthorized, _param_critical, critical, connection, _ref, publisherDetails, appDetails, releaseDetails, sign, pubAddr, appAddr, releaseAddr;
|
|
133
133
|
return _ts_generator(this, function(_state) {
|
|
@@ -37,13 +37,13 @@ function _ts_generator(thisArg, body) {
|
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return g = {
|
|
41
41
|
next: verb(0),
|
|
42
42
|
"throw": verb(1),
|
|
43
43
|
"return": verb(2)
|
|
44
44
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
45
|
return this;
|
|
46
|
-
}), g
|
|
46
|
+
}), g;
|
|
47
47
|
function verb(n) {
|
|
48
48
|
return function(v) {
|
|
49
49
|
return step([
|
|
@@ -127,7 +127,7 @@ import { publishSubmit } from "@solana-mobile/dapp-store-publishing-tools";
|
|
|
127
127
|
import nacl from "tweetnacl";
|
|
128
128
|
import { checkMintedStatus, showMessage } from "../../CliUtils.js";
|
|
129
129
|
import { loadPublishDetailsWithChecks, writeToPublishDetails } from "../../config/PublishDetails.js";
|
|
130
|
-
export var publishSubmitCommand = function() {
|
|
130
|
+
export var publishSubmitCommand = /*#__PURE__*/ function() {
|
|
131
131
|
var _ref = _async_to_generator(function(param) {
|
|
132
132
|
var appMintAddress, releaseMintAddress, signer, url, _param_dryRun, dryRun, _param_compliesWithSolanaDappStorePolicies, compliesWithSolanaDappStorePolicies, _param_requestorIsAuthorized, requestorIsAuthorized, alphaTest, connection, _ref, publisherDetails, appDetails, releaseDetails, solanaMobileDappPublisherPortalDetails, lastUpdatedVersionOnStore, sign, pubAddr, appAddr, releaseAddr;
|
|
133
133
|
return _ts_generator(this, function(_state) {
|
|
@@ -37,13 +37,13 @@ function _ts_generator(thisArg, body) {
|
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return g = {
|
|
41
41
|
next: verb(0),
|
|
42
42
|
"throw": verb(1),
|
|
43
43
|
"return": verb(2)
|
|
44
44
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
45
|
return this;
|
|
46
|
-
}), g
|
|
46
|
+
}), g;
|
|
47
47
|
function verb(n) {
|
|
48
48
|
return function(v) {
|
|
49
49
|
return step([
|
|
@@ -127,7 +127,7 @@ import { publishSupport } from "@solana-mobile/dapp-store-publishing-tools";
|
|
|
127
127
|
import { checkMintedStatus } from "../../CliUtils.js";
|
|
128
128
|
import nacl from "tweetnacl";
|
|
129
129
|
import { loadPublishDetailsWithChecks } from "../../config/PublishDetails.js";
|
|
130
|
-
export var publishSupportCommand = function() {
|
|
130
|
+
export var publishSupportCommand = /*#__PURE__*/ function() {
|
|
131
131
|
var _ref = _async_to_generator(function(param) {
|
|
132
132
|
var appMintAddress, releaseMintAddress, signer, url, _param_dryRun, dryRun, _param_requestorIsAuthorized, requestorIsAuthorized, requestDetails, connection, _ref, publisherDetails, appDetails, releaseDetails, sign, pubAddr, appAddr, releaseAddr;
|
|
133
133
|
return _ts_generator(this, function(_state) {
|
|
@@ -37,13 +37,13 @@ function _ts_generator(thisArg, body) {
|
|
|
37
37
|
trys: [],
|
|
38
38
|
ops: []
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return g = {
|
|
41
41
|
next: verb(0),
|
|
42
42
|
"throw": verb(1),
|
|
43
43
|
"return": verb(2)
|
|
44
44
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
45
|
return this;
|
|
46
|
-
}), g
|
|
46
|
+
}), g;
|
|
47
47
|
function verb(n) {
|
|
48
48
|
return function(v) {
|
|
49
49
|
return step([
|
|
@@ -127,7 +127,7 @@ import { publishUpdate } from "@solana-mobile/dapp-store-publishing-tools";
|
|
|
127
127
|
import { checkMintedStatus, showMessage } from "../../CliUtils.js";
|
|
128
128
|
import nacl from "tweetnacl";
|
|
129
129
|
import { loadPublishDetailsWithChecks, writeToPublishDetails } from "../../config/PublishDetails.js";
|
|
130
|
-
export var publishUpdateCommand = function() {
|
|
130
|
+
export var publishUpdateCommand = /*#__PURE__*/ function() {
|
|
131
131
|
var _ref = _async_to_generator(function(param) {
|
|
132
132
|
var appMintAddress, releaseMintAddress, signer, url, _param_dryRun, dryRun, _param_compliesWithSolanaDappStorePolicies, compliesWithSolanaDappStorePolicies, _param_requestorIsAuthorized, requestorIsAuthorized, _param_critical, critical, alphaTest, connection, _ref, publisherDetails, appDetails, releaseDetails, solanaMobileDappPublisherPortalDetails, lastUpdatedVersionOnStore, sign, pubAddr, appAddr, releaseAddr;
|
|
133
133
|
return _ts_generator(this, function(_state) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { dump } from "js-yaml";
|
|
2
|
-
import { readFile } from
|
|
2
|
+
import { readFile } from 'fs/promises';
|
|
3
3
|
var releaseSchema = JSON.parse((await readFile(new URL("../../generated/config_obj.json", import.meta.url))).toString());
|
|
4
4
|
import fs from "fs";
|
|
5
5
|
import { Constants } from "../../CliUtils.js";
|
|
@@ -121,13 +121,13 @@ function _ts_generator(thisArg, body) {
|
|
|
121
121
|
trys: [],
|
|
122
122
|
ops: []
|
|
123
123
|
};
|
|
124
|
-
return
|
|
124
|
+
return g = {
|
|
125
125
|
next: verb(0),
|
|
126
126
|
"throw": verb(1),
|
|
127
127
|
"return": verb(2)
|
|
128
128
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
129
129
|
return this;
|
|
130
|
-
}), g
|
|
130
|
+
}), g;
|
|
131
131
|
function verb(n) {
|
|
132
132
|
return function(v) {
|
|
133
133
|
return step([
|
|
@@ -209,7 +209,7 @@ function _ts_generator(thisArg, body) {
|
|
|
209
209
|
import { dump, load } from "js-yaml";
|
|
210
210
|
import Ajv from "ajv";
|
|
211
211
|
// eslint-disable-next-line require-extensions/require-extensions
|
|
212
|
-
import { readFile } from
|
|
212
|
+
import { readFile } from 'fs/promises';
|
|
213
213
|
var schemaJson = JSON.parse((await readFile(new URL("../generated/config_schema.json", import.meta.url))).toString());
|
|
214
214
|
import fs from "fs";
|
|
215
215
|
import path from "path";
|
|
@@ -236,7 +236,7 @@ var ajv = new Ajv({
|
|
|
236
236
|
strictTuples: false
|
|
237
237
|
});
|
|
238
238
|
var validate = ajv.compile(schemaJson);
|
|
239
|
-
export var loadPublishDetails = function() {
|
|
239
|
+
export var loadPublishDetails = /*#__PURE__*/ function() {
|
|
240
240
|
var _ref = _async_to_generator(function(configPath) {
|
|
241
241
|
var configFile, valid;
|
|
242
242
|
return _ts_generator(this, function(_state) {
|
|
@@ -264,9 +264,9 @@ export var loadPublishDetails = function() {
|
|
|
264
264
|
return _ref.apply(this, arguments);
|
|
265
265
|
};
|
|
266
266
|
}();
|
|
267
|
-
export var loadPublishDetailsWithChecks = function() {
|
|
267
|
+
export var loadPublishDetailsWithChecks = /*#__PURE__*/ function() {
|
|
268
268
|
var _ref = _async_to_generator(function() {
|
|
269
|
-
var buildToolsDir, _config_publisher_media_find, _config_publisher_media, _config_app_media_find, _config_app_media, _config_release_media_find, _config_release_media, _config_release_media1, _config_release_media2, config, apkEntry, apkPath, _, publisherIcon, iconPath, iconBuffer, appIcon, iconPath1, iconBuffer1, releaseIcon, iconPath2, screenshots, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, item, mediaPath, err, videos, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, video, mediaPath1, err, googlePkg, pkgCompare, alpha_testers, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, wallet;
|
|
269
|
+
var buildToolsDir, _config_publisher_media_find, _config_publisher_media, _config_app_media_find, _config_app_media, _config_release_media_find, _config_release_media, _config_release_media_find1, _config_release_media1, _config_release_media_find2, _config_release_media2, _config_release_media3, _config_release_media4, config, apkEntry, apkPath, _, publisherIcon, iconPath, iconBuffer, appIcon, iconPath1, iconBuffer1, releaseIcon, iconPath2, banner, bannerPath, featureGraphic, featureGraphicPath, screenshots, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, item, mediaPath, err, videos, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, video, mediaPath1, err, googlePkg, pkgCompare, alpha_testers, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, wallet;
|
|
270
270
|
var _arguments = arguments;
|
|
271
271
|
return _ts_generator(this, function(_state) {
|
|
272
272
|
switch(_state.label){
|
|
@@ -278,6 +278,7 @@ export var loadPublishDetailsWithChecks = function() {
|
|
|
278
278
|
];
|
|
279
279
|
case 1:
|
|
280
280
|
config = _state.sent();
|
|
281
|
+
// We validate that the config is going to have at least one installable asset
|
|
281
282
|
apkEntry = config.release.files.find(function(asset) {
|
|
282
283
|
return asset.purpose === "install";
|
|
283
284
|
});
|
|
@@ -298,7 +299,7 @@ export var loadPublishDetailsWithChecks = function() {
|
|
|
298
299
|
_.android_details = _state.sent();
|
|
299
300
|
_state.label = 3;
|
|
300
301
|
case 3:
|
|
301
|
-
publisherIcon = (
|
|
302
|
+
publisherIcon = (_config_publisher_media = config.publisher.media) === null || _config_publisher_media === void 0 ? void 0 : (_config_publisher_media_find = _config_publisher_media.find(function(asset) {
|
|
302
303
|
return asset.purpose === "icon";
|
|
303
304
|
})) === null || _config_publisher_media_find === void 0 ? void 0 : _config_publisher_media_find.uri;
|
|
304
305
|
if (!publisherIcon) return [
|
|
@@ -321,7 +322,7 @@ export var loadPublishDetailsWithChecks = function() {
|
|
|
321
322
|
config.publisher.icon = toMetaplexFile(iconBuffer, publisherIcon);
|
|
322
323
|
_state.label = 6;
|
|
323
324
|
case 6:
|
|
324
|
-
appIcon = (
|
|
325
|
+
appIcon = (_config_app_media = config.app.media) === null || _config_app_media === void 0 ? void 0 : (_config_app_media_find = _config_app_media.find(function(asset) {
|
|
325
326
|
return asset.purpose === "icon";
|
|
326
327
|
})) === null || _config_app_media_find === void 0 ? void 0 : _config_app_media_find.uri;
|
|
327
328
|
if (!appIcon) return [
|
|
@@ -344,7 +345,7 @@ export var loadPublishDetailsWithChecks = function() {
|
|
|
344
345
|
config.app.icon = toMetaplexFile(iconBuffer1, appIcon);
|
|
345
346
|
_state.label = 9;
|
|
346
347
|
case 9:
|
|
347
|
-
releaseIcon = (
|
|
348
|
+
releaseIcon = (_config_release_media = config.release.media) === null || _config_release_media === void 0 ? void 0 : (_config_release_media_find = _config_release_media.find(function(asset) {
|
|
348
349
|
return asset.purpose === "icon";
|
|
349
350
|
})) === null || _config_release_media_find === void 0 ? void 0 : _config_release_media_find.uri;
|
|
350
351
|
if (!releaseIcon) return [
|
|
@@ -363,6 +364,38 @@ export var loadPublishDetailsWithChecks = function() {
|
|
|
363
364
|
if (!appIcon && !releaseIcon) {
|
|
364
365
|
throw new Error("Please specify at least one media entry of type icon in your configuration file");
|
|
365
366
|
}
|
|
367
|
+
banner = (_config_release_media1 = config.release.media) === null || _config_release_media1 === void 0 ? void 0 : (_config_release_media_find1 = _config_release_media1.find(function(asset) {
|
|
368
|
+
return asset.purpose === "banner";
|
|
369
|
+
})) === null || _config_release_media_find1 === void 0 ? void 0 : _config_release_media_find1.uri;
|
|
370
|
+
if (!banner) return [
|
|
371
|
+
3,
|
|
372
|
+
13
|
|
373
|
+
];
|
|
374
|
+
bannerPath = path.join(process.cwd(), banner);
|
|
375
|
+
return [
|
|
376
|
+
4,
|
|
377
|
+
checkBannerCompatibility(bannerPath)
|
|
378
|
+
];
|
|
379
|
+
case 12:
|
|
380
|
+
_state.sent();
|
|
381
|
+
_state.label = 13;
|
|
382
|
+
case 13:
|
|
383
|
+
featureGraphic = (_config_release_media2 = config.release.media) === null || _config_release_media2 === void 0 ? void 0 : (_config_release_media_find2 = _config_release_media2.find(function(asset) {
|
|
384
|
+
return asset.purpose === "featureGraphic";
|
|
385
|
+
})) === null || _config_release_media_find2 === void 0 ? void 0 : _config_release_media_find2.uri;
|
|
386
|
+
if (!featureGraphic) return [
|
|
387
|
+
3,
|
|
388
|
+
15
|
|
389
|
+
];
|
|
390
|
+
featureGraphicPath = path.join(process.cwd(), featureGraphic);
|
|
391
|
+
return [
|
|
392
|
+
4,
|
|
393
|
+
checkFeatureGraphicCompatibility(featureGraphicPath)
|
|
394
|
+
];
|
|
395
|
+
case 14:
|
|
396
|
+
_state.sent();
|
|
397
|
+
_state.label = 15;
|
|
398
|
+
case 15:
|
|
366
399
|
config.release.media.forEach(function(item) {
|
|
367
400
|
var mediaPath = path.join(process.cwd(), item.uri);
|
|
368
401
|
if (!fs.existsSync(mediaPath)) {
|
|
@@ -375,56 +408,56 @@ export var loadPublishDetailsWithChecks = function() {
|
|
|
375
408
|
throw new Error("Please ensure the file ".concat(item.uri, " is a mp4."));
|
|
376
409
|
}
|
|
377
410
|
});
|
|
378
|
-
screenshots = (
|
|
411
|
+
screenshots = (_config_release_media3 = config.release.media) === null || _config_release_media3 === void 0 ? void 0 : _config_release_media3.filter(function(asset) {
|
|
379
412
|
return asset.purpose === "screenshot";
|
|
380
413
|
});
|
|
381
414
|
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
382
|
-
_state.label =
|
|
383
|
-
case
|
|
415
|
+
_state.label = 16;
|
|
416
|
+
case 16:
|
|
384
417
|
_state.trys.push([
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
418
|
+
16,
|
|
419
|
+
21,
|
|
420
|
+
22,
|
|
421
|
+
23
|
|
389
422
|
]);
|
|
390
423
|
_iterator = screenshots[Symbol.iterator]();
|
|
391
|
-
_state.label =
|
|
392
|
-
case
|
|
424
|
+
_state.label = 17;
|
|
425
|
+
case 17:
|
|
393
426
|
if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
|
|
394
427
|
3,
|
|
395
|
-
|
|
428
|
+
20
|
|
396
429
|
];
|
|
397
430
|
item = _step.value;
|
|
398
431
|
mediaPath = path.join(process.cwd(), item.uri);
|
|
399
432
|
return [
|
|
400
433
|
4,
|
|
401
|
-
|
|
434
|
+
checkScreenshotDimensions(mediaPath)
|
|
402
435
|
];
|
|
403
|
-
case
|
|
436
|
+
case 18:
|
|
404
437
|
if (_state.sent()) {
|
|
405
438
|
throw new Error("Screenshot ".concat(mediaPath, " must be at least 1080px in width and height."));
|
|
406
439
|
}
|
|
407
|
-
_state.label =
|
|
408
|
-
case
|
|
440
|
+
_state.label = 19;
|
|
441
|
+
case 19:
|
|
409
442
|
_iteratorNormalCompletion = true;
|
|
410
443
|
return [
|
|
411
444
|
3,
|
|
412
|
-
|
|
445
|
+
17
|
|
413
446
|
];
|
|
414
|
-
case
|
|
447
|
+
case 20:
|
|
415
448
|
return [
|
|
416
449
|
3,
|
|
417
|
-
|
|
450
|
+
23
|
|
418
451
|
];
|
|
419
|
-
case
|
|
452
|
+
case 21:
|
|
420
453
|
err = _state.sent();
|
|
421
454
|
_didIteratorError = true;
|
|
422
455
|
_iteratorError = err;
|
|
423
456
|
return [
|
|
424
457
|
3,
|
|
425
|
-
|
|
458
|
+
23
|
|
426
459
|
];
|
|
427
|
-
case
|
|
460
|
+
case 22:
|
|
428
461
|
try {
|
|
429
462
|
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
430
463
|
_iterator.return();
|
|
@@ -437,57 +470,57 @@ export var loadPublishDetailsWithChecks = function() {
|
|
|
437
470
|
return [
|
|
438
471
|
7
|
|
439
472
|
];
|
|
440
|
-
case
|
|
441
|
-
videos = (
|
|
473
|
+
case 23:
|
|
474
|
+
videos = (_config_release_media4 = config.release.media) === null || _config_release_media4 === void 0 ? void 0 : _config_release_media4.filter(function(asset) {
|
|
442
475
|
return asset.purpose === "video";
|
|
443
476
|
});
|
|
444
477
|
_iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
445
|
-
_state.label =
|
|
446
|
-
case
|
|
478
|
+
_state.label = 24;
|
|
479
|
+
case 24:
|
|
447
480
|
_state.trys.push([
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
481
|
+
24,
|
|
482
|
+
29,
|
|
483
|
+
30,
|
|
484
|
+
31
|
|
452
485
|
]);
|
|
453
486
|
_iterator1 = videos[Symbol.iterator]();
|
|
454
|
-
_state.label =
|
|
455
|
-
case
|
|
487
|
+
_state.label = 25;
|
|
488
|
+
case 25:
|
|
456
489
|
if (!!(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done)) return [
|
|
457
490
|
3,
|
|
458
|
-
|
|
491
|
+
28
|
|
459
492
|
];
|
|
460
493
|
video = _step1.value;
|
|
461
494
|
mediaPath1 = path.join(process.cwd(), video.uri);
|
|
462
495
|
return [
|
|
463
496
|
4,
|
|
464
|
-
|
|
497
|
+
checkVideoDimensions(mediaPath1)
|
|
465
498
|
];
|
|
466
|
-
case
|
|
499
|
+
case 26:
|
|
467
500
|
if (_state.sent()) {
|
|
468
501
|
throw new Error("Video ".concat(mediaPath1, " must be at least 720px in width and height."));
|
|
469
502
|
}
|
|
470
|
-
_state.label =
|
|
471
|
-
case
|
|
503
|
+
_state.label = 27;
|
|
504
|
+
case 27:
|
|
472
505
|
_iteratorNormalCompletion1 = true;
|
|
473
506
|
return [
|
|
474
507
|
3,
|
|
475
|
-
|
|
508
|
+
25
|
|
476
509
|
];
|
|
477
|
-
case
|
|
510
|
+
case 28:
|
|
478
511
|
return [
|
|
479
512
|
3,
|
|
480
|
-
|
|
513
|
+
31
|
|
481
514
|
];
|
|
482
|
-
case
|
|
515
|
+
case 29:
|
|
483
516
|
err = _state.sent();
|
|
484
517
|
_didIteratorError1 = true;
|
|
485
518
|
_iteratorError1 = err;
|
|
486
519
|
return [
|
|
487
520
|
3,
|
|
488
|
-
|
|
521
|
+
31
|
|
489
522
|
];
|
|
490
|
-
case
|
|
523
|
+
case 30:
|
|
491
524
|
try {
|
|
492
525
|
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
493
526
|
_iterator1.return();
|
|
@@ -500,7 +533,7 @@ export var loadPublishDetailsWithChecks = function() {
|
|
|
500
533
|
return [
|
|
501
534
|
7
|
|
502
535
|
];
|
|
503
|
-
case
|
|
536
|
+
case 31:
|
|
504
537
|
if (screenshots.length + videos.length < 4) {
|
|
505
538
|
throw new Error("At least 4 screenshots or videos are required for publishing a new release. Found only ".concat(screenshots.length + videos.length));
|
|
506
539
|
}
|
|
@@ -553,7 +586,7 @@ export var loadPublishDetailsWithChecks = function() {
|
|
|
553
586
|
return _ref.apply(this, arguments);
|
|
554
587
|
};
|
|
555
588
|
}();
|
|
556
|
-
var checkIconCompatibility = function() {
|
|
589
|
+
var checkIconCompatibility = /*#__PURE__*/ function() {
|
|
557
590
|
var _ref = _async_to_generator(function(path, typeString) {
|
|
558
591
|
return _ts_generator(this, function(_state) {
|
|
559
592
|
switch(_state.label){
|
|
@@ -579,6 +612,58 @@ var checkIconCompatibility = function() {
|
|
|
579
612
|
return _ref.apply(this, arguments);
|
|
580
613
|
};
|
|
581
614
|
}();
|
|
615
|
+
var checkBannerCompatibility = /*#__PURE__*/ function() {
|
|
616
|
+
var _ref = _async_to_generator(function(path) {
|
|
617
|
+
return _ts_generator(this, function(_state) {
|
|
618
|
+
switch(_state.label){
|
|
619
|
+
case 0:
|
|
620
|
+
if (!fs.existsSync(path) || !checkImageExtension(path)) {
|
|
621
|
+
throw new Error("Please check the path to your banner image and ensure the file is a jpeg, png, or webp file.");
|
|
622
|
+
}
|
|
623
|
+
return [
|
|
624
|
+
4,
|
|
625
|
+
checkBannerDimensions(path)
|
|
626
|
+
];
|
|
627
|
+
case 1:
|
|
628
|
+
if (_state.sent()) {
|
|
629
|
+
throw new Error("Banner must be 1200px by 600px.");
|
|
630
|
+
}
|
|
631
|
+
return [
|
|
632
|
+
2
|
|
633
|
+
];
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
});
|
|
637
|
+
return function checkBannerCompatibility(path) {
|
|
638
|
+
return _ref.apply(this, arguments);
|
|
639
|
+
};
|
|
640
|
+
}();
|
|
641
|
+
var checkFeatureGraphicCompatibility = /*#__PURE__*/ function() {
|
|
642
|
+
var _ref = _async_to_generator(function(path) {
|
|
643
|
+
return _ts_generator(this, function(_state) {
|
|
644
|
+
switch(_state.label){
|
|
645
|
+
case 0:
|
|
646
|
+
if (!fs.existsSync(path) || !checkImageExtension(path)) {
|
|
647
|
+
throw new Error("Please check the path to your featureGraphic image and ensure the file is a jpeg, png, or webp file.");
|
|
648
|
+
}
|
|
649
|
+
return [
|
|
650
|
+
4,
|
|
651
|
+
checkFeatureGraphicDimensions(path)
|
|
652
|
+
];
|
|
653
|
+
case 1:
|
|
654
|
+
if (_state.sent()) {
|
|
655
|
+
throw new Error("Feature Graphic must be 1200px by 1200px.");
|
|
656
|
+
}
|
|
657
|
+
return [
|
|
658
|
+
2
|
|
659
|
+
];
|
|
660
|
+
}
|
|
661
|
+
});
|
|
662
|
+
});
|
|
663
|
+
return function checkFeatureGraphicCompatibility(path) {
|
|
664
|
+
return _ref.apply(this, arguments);
|
|
665
|
+
};
|
|
666
|
+
}();
|
|
582
667
|
var checkImageExtension = function(uri) {
|
|
583
668
|
var fileExt = path.extname(uri).toLowerCase();
|
|
584
669
|
return fileExt == ".png" || fileExt == ".jpg" || fileExt == ".jpeg" || fileExt == ".webp";
|
|
@@ -609,7 +694,7 @@ var checkVideoExtension = function(uri) {
|
|
|
609
694
|
throw new Error("Please ensure all translations of short_description are between 0 and 30 characters");
|
|
610
695
|
}
|
|
611
696
|
};
|
|
612
|
-
var checkIconDimensions = function() {
|
|
697
|
+
var checkIconDimensions = /*#__PURE__*/ function() {
|
|
613
698
|
var _ref = _async_to_generator(function(iconPath) {
|
|
614
699
|
var size, _size_width;
|
|
615
700
|
return _ts_generator(this, function(_state) {
|
|
@@ -632,7 +717,7 @@ var checkIconDimensions = function() {
|
|
|
632
717
|
return _ref.apply(this, arguments);
|
|
633
718
|
};
|
|
634
719
|
}();
|
|
635
|
-
var
|
|
720
|
+
var checkScreenshotDimensions = /*#__PURE__*/ function() {
|
|
636
721
|
var _ref = _async_to_generator(function(imagePath) {
|
|
637
722
|
var size, _size_width, _size_height;
|
|
638
723
|
return _ts_generator(this, function(_state) {
|
|
@@ -651,11 +736,57 @@ var checkScreenshotSize = function() {
|
|
|
651
736
|
}
|
|
652
737
|
});
|
|
653
738
|
});
|
|
654
|
-
return function
|
|
739
|
+
return function checkScreenshotDimensions(imagePath) {
|
|
740
|
+
return _ref.apply(this, arguments);
|
|
741
|
+
};
|
|
742
|
+
}();
|
|
743
|
+
var checkBannerDimensions = /*#__PURE__*/ function() {
|
|
744
|
+
var _ref = _async_to_generator(function(imagePath) {
|
|
745
|
+
var size, _size_width, _size_height;
|
|
746
|
+
return _ts_generator(this, function(_state) {
|
|
747
|
+
switch(_state.label){
|
|
748
|
+
case 0:
|
|
749
|
+
return [
|
|
750
|
+
4,
|
|
751
|
+
runImgSize(imagePath)
|
|
752
|
+
];
|
|
753
|
+
case 1:
|
|
754
|
+
size = _state.sent();
|
|
755
|
+
return [
|
|
756
|
+
2,
|
|
757
|
+
((_size_width = size === null || size === void 0 ? void 0 : size.width) !== null && _size_width !== void 0 ? _size_width : 0) != 1200 || ((_size_height = size === null || size === void 0 ? void 0 : size.height) !== null && _size_height !== void 0 ? _size_height : 0) != 600
|
|
758
|
+
];
|
|
759
|
+
}
|
|
760
|
+
});
|
|
761
|
+
});
|
|
762
|
+
return function checkBannerDimensions(imagePath) {
|
|
763
|
+
return _ref.apply(this, arguments);
|
|
764
|
+
};
|
|
765
|
+
}();
|
|
766
|
+
var checkFeatureGraphicDimensions = /*#__PURE__*/ function() {
|
|
767
|
+
var _ref = _async_to_generator(function(imagePath) {
|
|
768
|
+
var size, _size_width, _size_height;
|
|
769
|
+
return _ts_generator(this, function(_state) {
|
|
770
|
+
switch(_state.label){
|
|
771
|
+
case 0:
|
|
772
|
+
return [
|
|
773
|
+
4,
|
|
774
|
+
runImgSize(imagePath)
|
|
775
|
+
];
|
|
776
|
+
case 1:
|
|
777
|
+
size = _state.sent();
|
|
778
|
+
return [
|
|
779
|
+
2,
|
|
780
|
+
((_size_width = size === null || size === void 0 ? void 0 : size.width) !== null && _size_width !== void 0 ? _size_width : 0) != 1200 || ((_size_height = size === null || size === void 0 ? void 0 : size.height) !== null && _size_height !== void 0 ? _size_height : 0) != 1200
|
|
781
|
+
];
|
|
782
|
+
}
|
|
783
|
+
});
|
|
784
|
+
});
|
|
785
|
+
return function checkFeatureGraphicDimensions(imagePath) {
|
|
655
786
|
return _ref.apply(this, arguments);
|
|
656
787
|
};
|
|
657
788
|
}();
|
|
658
|
-
var
|
|
789
|
+
var checkVideoDimensions = /*#__PURE__*/ function() {
|
|
659
790
|
var _ref = _async_to_generator(function(imagePath) {
|
|
660
791
|
var size, _size_width, _size_height;
|
|
661
792
|
return _ts_generator(this, function(_state) {
|
|
@@ -674,11 +805,11 @@ var checkVideoSize = function() {
|
|
|
674
805
|
}
|
|
675
806
|
});
|
|
676
807
|
});
|
|
677
|
-
return function
|
|
808
|
+
return function checkVideoDimensions(imagePath) {
|
|
678
809
|
return _ref.apply(this, arguments);
|
|
679
810
|
};
|
|
680
811
|
}();
|
|
681
|
-
var getAndroidDetails = function() {
|
|
812
|
+
var getAndroidDetails = /*#__PURE__*/ function() {
|
|
682
813
|
var _ref = _async_to_generator(function(aaptDir, apkPath) {
|
|
683
814
|
var stdout, appPackage, versionCode, versionName, minSdk, permissions, locales, isDebuggable, _locales_values, localeArray, localesSrc, _appPackage_, _minSdk_, _versionCode_, _versionName_, _tmp, e;
|
|
684
815
|
return _ts_generator(this, function(_state) {
|
|
@@ -765,7 +896,7 @@ var getAndroidDetails = function() {
|
|
|
765
896
|
return _ref.apply(this, arguments);
|
|
766
897
|
};
|
|
767
898
|
}();
|
|
768
|
-
var checkAbis = function() {
|
|
899
|
+
var checkAbis = /*#__PURE__*/ function() {
|
|
769
900
|
var _ref = _async_to_generator(function(apkPath) {
|
|
770
901
|
var stdout, amV7libs, x86libs, x8664libs, messages, e;
|
|
771
902
|
return _ts_generator(this, function(_state) {
|
|
@@ -805,7 +936,7 @@ var checkAbis = function() {
|
|
|
805
936
|
] : []), [
|
|
806
937
|
"\n\nAlthough your app works fine on Saga, these library files are unused and increase the size of apk file making the download and update time longer for your app.",
|
|
807
938
|
"\n\nSee https://developer.android.com/games/optimize/64-bit#build-with-64-bit for how to optimize your app."
|
|
808
|
-
]).join(
|
|
939
|
+
]).join('\n');
|
|
809
940
|
showMessage("Unsupported files found in apk", messages, "warning");
|
|
810
941
|
}
|
|
811
942
|
return [
|
|
@@ -829,7 +960,7 @@ var checkAbis = function() {
|
|
|
829
960
|
return _ref.apply(this, arguments);
|
|
830
961
|
};
|
|
831
962
|
}();
|
|
832
|
-
export var extractCertFingerprint = function() {
|
|
963
|
+
export var extractCertFingerprint = /*#__PURE__*/ function() {
|
|
833
964
|
var _ref = _async_to_generator(function(aaptDir, apkPath) {
|
|
834
965
|
var stdout, regex, match;
|
|
835
966
|
return _ts_generator(this, function(_state) {
|
|
@@ -861,7 +992,7 @@ export var extractCertFingerprint = function() {
|
|
|
861
992
|
return _ref.apply(this, arguments);
|
|
862
993
|
};
|
|
863
994
|
}();
|
|
864
|
-
export var writeToPublishDetails = function() {
|
|
995
|
+
export var writeToPublishDetails = /*#__PURE__*/ function() {
|
|
865
996
|
var _ref = _async_to_generator(function(param) {
|
|
866
997
|
var publisher, app, release, lastSubmittedVersionOnChain, lastUpdatedVersionOnStore, currentConfig, _publisher_address, _app_address, _release_address, newConfig;
|
|
867
998
|
return _ts_generator(this, function(_state) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"publisher":{"name":"<<YOUR_PUBLISHER_NAME>>","address":"","website":"<<URL_OF_PUBLISHER_WEBSITE>>","email":"<<EMAIL_ADDRESS_TO_CONTACT_PUBLISHER>>","media":[{"purpose":"icon","uri":"<<RELATIVE_PATH_TO_PUBLISHER_ICON>>"}]},"app":{"name":"<<APP_NAME>>","address":"","android_package":"<<ANDROID_PACKAGE_NAME>>","urls":{"license_url":"<<URL_OF_APP_LICENSE_OR_TERMS_OF_SERVICE>>","copyright_url":"<<URL_OF_COPYRIGHT_DETAILS_FOR_APP>>","privacy_policy_url":"<<URL_OF_APP_PRIVACY_POLICY>>","website":"<<URL_OF_APP_WEBSITE>>"},"media":[{"purpose":"icon","uri":"<<RELATIVE_PATH_TO_APP_ICON>>"}]},"release":{"address":"","media":[{"purpose":"icon","uri":"<<RELATIVE_PATH_TO_RELEASE_ICON>>"},{"purpose":"screenshot","uri":"<<RELATIVE_PATH_TO_SCREENSHOT1>>"},{"purpose":"screenshot","uri":"<<RELATIVE_PATH_TO_SCREENSHOT2>>"},{"purpose":"screenshot","uri":"<<RELATIVE_PATH_TO_SCREENSHOT3>>"},{"purpose":"screenshot","uri":"<<RELATIVE_PATH_TO_SCREENSHOT4>>"},{"purpose":"video","uri":"<<RELATIVE_PATH_TO_VIDEO1>>"}],"files":[{"purpose":"install","uri":"<<RELATIVE_PATH_TO_APK>>"}],"catalog":{"en-US":{"name":"<<APP_NAME>>","short_description":"<<SHORT_APP_DESCRIPTION>>","long_description":"<<LONG_APP_DESCRIPTION>>","new_in_version":"<<WHATS_NEW_IN_THIS_VERSION>>","saga_features":"<<ANY_FEATURES_ONLY_AVAILBLE_WHEN_RUNNING_ON_SAGA>>"}}},"solana_mobile_dapp_publisher_portal":{"google_store_package":"<<ANDROID_PACKAGE_NAME_OF_GOOGLE_PLAY_STORE_VERSION_IF_DIFFERENT>>","testing_instructions":"<<TESTING_INSTRUCTIONS>>","alpha_testers":[{"address":"<<genesis token wallet address>>","comment":"<<Optional. For internal use only>>"},{"address":"<<genesis token wallet address>>","comment":"<<Optional. For internal use only>>"}]}}
|
|
1
|
+
{"publisher":{"name":"<<YOUR_PUBLISHER_NAME>>","address":"","website":"<<URL_OF_PUBLISHER_WEBSITE>>","email":"<<EMAIL_ADDRESS_TO_CONTACT_PUBLISHER>>","media":[{"purpose":"icon","uri":"<<RELATIVE_PATH_TO_PUBLISHER_ICON>>"}]},"app":{"name":"<<APP_NAME>>","address":"","android_package":"<<ANDROID_PACKAGE_NAME>>","urls":{"license_url":"<<URL_OF_APP_LICENSE_OR_TERMS_OF_SERVICE>>","copyright_url":"<<URL_OF_COPYRIGHT_DETAILS_FOR_APP>>","privacy_policy_url":"<<URL_OF_APP_PRIVACY_POLICY>>","website":"<<URL_OF_APP_WEBSITE>>"},"media":[{"purpose":"icon","uri":"<<RELATIVE_PATH_TO_APP_ICON>>"}]},"release":{"address":"","media":[{"purpose":"icon","uri":"<<RELATIVE_PATH_TO_RELEASE_ICON>>"},{"purpose":"banner","uri":"<<RELATIVE_PATH_TO_BANNER>>"},{"purpose":"featureGraphic","uri":"<<RELATIVE_PATH_TO_FEATURE_GRAPHIC>>"},{"purpose":"screenshot","uri":"<<RELATIVE_PATH_TO_SCREENSHOT1>>"},{"purpose":"screenshot","uri":"<<RELATIVE_PATH_TO_SCREENSHOT2>>"},{"purpose":"screenshot","uri":"<<RELATIVE_PATH_TO_SCREENSHOT3>>"},{"purpose":"screenshot","uri":"<<RELATIVE_PATH_TO_SCREENSHOT4>>"},{"purpose":"video","uri":"<<RELATIVE_PATH_TO_VIDEO1>>"}],"files":[{"purpose":"install","uri":"<<RELATIVE_PATH_TO_APK>>"}],"catalog":{"en-US":{"name":"<<APP_NAME>>","short_description":"<<SHORT_APP_DESCRIPTION>>","long_description":"<<LONG_APP_DESCRIPTION>>","new_in_version":"<<WHATS_NEW_IN_THIS_VERSION>>","saga_features":"<<ANY_FEATURES_ONLY_AVAILBLE_WHEN_RUNNING_ON_SAGA>>"}}},"solana_mobile_dapp_publisher_portal":{"google_store_package":"<<ANDROID_PACKAGE_NAME_OF_GOOGLE_PLAY_STORE_VERSION_IF_DIFFERENT>>","testing_instructions":"<<TESTING_INSTRUCTIONS>>","alpha_testers":[{"address":"<<genesis token wallet address>>","comment":"<<Optional. For internal use only>>"},{"address":"<<genesis token wallet address>>","comment":"<<Optional. For internal use only>>"}]}}
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana-mobile/dapp-store-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
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.20.0",
|
|
56
|
-
"@solana-mobile/dapp-store-publishing-tools": "workspace:0.
|
|
56
|
+
"@solana-mobile/dapp-store-publishing-tools": "workspace:0.10.0",
|
|
57
57
|
"@solana/web3.js": "1.92.1",
|
|
58
58
|
"@types/semver": "^7.3.13",
|
|
59
59
|
"ajv": "^8.11.0",
|
|
@@ -23,6 +23,10 @@ release:
|
|
|
23
23
|
media:
|
|
24
24
|
- purpose: icon
|
|
25
25
|
uri: <<RELATIVE_PATH_TO_RELEASE_ICON>>
|
|
26
|
+
- purpose: banner
|
|
27
|
+
uri: <<RELATIVE_PATH_TO_BANNER>>
|
|
28
|
+
- purpose: featureGraphic
|
|
29
|
+
uri: <<RELATIVE_PATH_TO_FEATURE_GRAPHIC>>
|
|
26
30
|
- purpose: screenshot
|
|
27
31
|
uri: <<RELATIVE_PATH_TO_SCREENSHOT1>>
|
|
28
32
|
- purpose: screenshot
|
|
@@ -2,10 +2,10 @@ import fs from "fs";
|
|
|
2
2
|
import yaml from "js-yaml";
|
|
3
3
|
import generateSchema from "generate-schema";
|
|
4
4
|
try {
|
|
5
|
-
var yamlSrc = fs.readFileSync(
|
|
5
|
+
var yamlSrc = fs.readFileSync('./src/prebuild_schema/publishing_source.yaml', 'utf8');
|
|
6
6
|
var convertedYaml = yaml.load(yamlSrc);
|
|
7
|
-
fs.writeFileSync(
|
|
8
|
-
var schema = generateSchema.json(
|
|
7
|
+
fs.writeFileSync('./src/generated/config_obj.json', Buffer.from(JSON.stringify(convertedYaml)), 'utf-8');
|
|
8
|
+
var schema = generateSchema.json('result', convertedYaml);
|
|
9
9
|
// CLI 0.3.0: Adding requirement for `short_description` so validation will catch
|
|
10
10
|
schema["properties"]["release"]["properties"]["catalog"]["properties"]["en-US"].required = [
|
|
11
11
|
"short_description"
|
|
@@ -14,7 +14,7 @@ try {
|
|
|
14
14
|
delete schema.$schema;
|
|
15
15
|
delete schema.title;
|
|
16
16
|
var toWrite = Buffer.from(JSON.stringify(schema));
|
|
17
|
-
fs.writeFileSync(
|
|
17
|
+
fs.writeFileSync('./src/generated/config_schema.json', toWrite, 'utf-8');
|
|
18
18
|
} catch (e) {
|
|
19
19
|
console.log(":: Schema generation step failed ::");
|
|
20
20
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana-mobile/dapp-store-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
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.20.0",
|
|
49
|
-
"@solana-mobile/dapp-store-publishing-tools": "0.
|
|
49
|
+
"@solana-mobile/dapp-store-publishing-tools": "0.10.0",
|
|
50
50
|
"@solana/web3.js": "1.92.1",
|
|
51
51
|
"@types/semver": "^7.3.13",
|
|
52
52
|
"ajv": "^8.11.0",
|
package/src/CliSetup.ts
CHANGED
|
@@ -51,6 +51,7 @@ function resolveBuildToolsPath(buildToolsPath: string | undefined) {
|
|
|
51
51
|
*/
|
|
52
52
|
function latestReleaseMessage() {
|
|
53
53
|
const messages = [
|
|
54
|
+
`- App details page now supports a Banner Graphic image of size 1200x600px and a Feature Graphic image of size 1200x1200px (optional)`,
|
|
54
55
|
`- App details page now supports video files. (mp4 file format only and minimum resolution 720p)`,
|
|
55
56
|
`- priority fee has been updated to ${Constants.DEFAULT_PRIORITY_FEE} lamports = ${Constants.DEFAULT_PRIORITY_FEE / LAMPORTS_PER_SOL} SOL. To adjust this value use param "-p" or "--priority-fee-lamports"`,
|
|
56
57
|
`- At least 4 screenshots are now required to update or release a new app`,
|
package/src/CliUtils.ts
CHANGED
|
@@ -19,7 +19,7 @@ import { awsStorage } from "@metaplex-foundation/js-plugin-aws";
|
|
|
19
19
|
import { S3StorageManager } from "./config/index.js";
|
|
20
20
|
|
|
21
21
|
export class Constants {
|
|
22
|
-
static CLI_VERSION = "0.
|
|
22
|
+
static CLI_VERSION = "0.10.0";
|
|
23
23
|
static CONFIG_FILE_NAME = "config.yaml";
|
|
24
24
|
static DEFAULT_RPC_DEVNET = "https://api.devnet.solana.com";
|
|
25
25
|
static DEFAULT_PRIORITY_FEE = 500000;
|
|
@@ -127,6 +127,24 @@ export const loadPublishDetailsWithChecks = async (
|
|
|
127
127
|
throw new Error("Please specify at least one media entry of type icon in your configuration file");
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
+
const banner = config.release.media?.find(
|
|
131
|
+
(asset: any) => asset.purpose === "banner"
|
|
132
|
+
)?.uri;
|
|
133
|
+
|
|
134
|
+
if (banner) {
|
|
135
|
+
const bannerPath = path.join(process.cwd(), banner);
|
|
136
|
+
await checkBannerCompatibility(bannerPath);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const featureGraphic = config.release.media?.find(
|
|
140
|
+
(asset: any) => asset.purpose === "featureGraphic"
|
|
141
|
+
)?.uri;
|
|
142
|
+
|
|
143
|
+
if (featureGraphic) {
|
|
144
|
+
const featureGraphicPath = path.join(process.cwd(), featureGraphic);
|
|
145
|
+
await checkFeatureGraphicCompatibility(featureGraphicPath);
|
|
146
|
+
}
|
|
147
|
+
|
|
130
148
|
config.release.media.forEach((item: PublishDetails["release"]["media"][0]) => {
|
|
131
149
|
const mediaPath = path.join(process.cwd(), item.uri);
|
|
132
150
|
if (!fs.existsSync(mediaPath)) {
|
|
@@ -149,7 +167,7 @@ export const loadPublishDetailsWithChecks = async (
|
|
|
149
167
|
|
|
150
168
|
for (const item of screenshots) {
|
|
151
169
|
const mediaPath = path.join(process.cwd(), item.uri);
|
|
152
|
-
if (await
|
|
170
|
+
if (await checkScreenshotDimensions(mediaPath)) {
|
|
153
171
|
throw new Error(`Screenshot ${mediaPath} must be at least 1080px in width and height.`);
|
|
154
172
|
}
|
|
155
173
|
}
|
|
@@ -160,7 +178,7 @@ export const loadPublishDetailsWithChecks = async (
|
|
|
160
178
|
|
|
161
179
|
for (const video of videos) {
|
|
162
180
|
const mediaPath = path.join(process.cwd(), video.uri);
|
|
163
|
-
if (await
|
|
181
|
+
if (await checkVideoDimensions(mediaPath)) {
|
|
164
182
|
throw new Error(`Video ${mediaPath} must be at least 720px in width and height.`);
|
|
165
183
|
}
|
|
166
184
|
}
|
|
@@ -208,6 +226,26 @@ const checkIconCompatibility = async (path: string, typeString: string) => {
|
|
|
208
226
|
}
|
|
209
227
|
};
|
|
210
228
|
|
|
229
|
+
const checkBannerCompatibility = async (path: string) => {
|
|
230
|
+
if (!fs.existsSync(path) || !checkImageExtension(path)) {
|
|
231
|
+
throw new Error(`Please check the path to your banner image and ensure the file is a jpeg, png, or webp file.`);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (await checkBannerDimensions(path)) {
|
|
235
|
+
throw new Error("Banner must be 1200px by 600px.");
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
const checkFeatureGraphicCompatibility = async (path: string) => {
|
|
240
|
+
if (!fs.existsSync(path) || !checkImageExtension(path)) {
|
|
241
|
+
throw new Error(`Please check the path to your featureGraphic image and ensure the file is a jpeg, png, or webp file.`);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (await checkFeatureGraphicDimensions(path)) {
|
|
245
|
+
throw new Error("Feature Graphic must be 1200px by 1200px.");
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
|
|
211
249
|
const checkImageExtension = (uri: string): boolean => {
|
|
212
250
|
const fileExt = path.extname(uri).toLowerCase();
|
|
213
251
|
return (
|
|
@@ -257,13 +295,25 @@ const checkIconDimensions = async (iconPath: string): Promise<boolean> => {
|
|
|
257
295
|
return size?.width != size?.height || (size?.width ?? 0) != 512;
|
|
258
296
|
};
|
|
259
297
|
|
|
260
|
-
const
|
|
298
|
+
const checkScreenshotDimensions = async (imagePath: string): Promise<boolean> => {
|
|
261
299
|
const size = await runImgSize(imagePath);
|
|
262
300
|
|
|
263
301
|
return (size?.width ?? 0) < 1080 || (size?.height ?? 0) < 1080;
|
|
264
302
|
}
|
|
265
303
|
|
|
266
|
-
const
|
|
304
|
+
const checkBannerDimensions = async (imagePath: string): Promise<boolean> => {
|
|
305
|
+
const size = await runImgSize(imagePath);
|
|
306
|
+
|
|
307
|
+
return (size?.width ?? 0) != 1200 || (size?.height ?? 0) != 600;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
const checkFeatureGraphicDimensions = async (imagePath: string): Promise<boolean> => {
|
|
311
|
+
const size = await runImgSize(imagePath);
|
|
312
|
+
|
|
313
|
+
return (size?.width ?? 0) != 1200 || (size?.height ?? 0) != 1200;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const checkVideoDimensions = async (imagePath: string): Promise<boolean> => {
|
|
267
317
|
const size = await getVideoDimensions(imagePath);
|
|
268
318
|
|
|
269
319
|
return (size?.width ?? 0) < 720 || (size?.height ?? 0) < 720;
|
|
@@ -23,6 +23,10 @@ release:
|
|
|
23
23
|
media:
|
|
24
24
|
- purpose: icon
|
|
25
25
|
uri: <<RELATIVE_PATH_TO_RELEASE_ICON>>
|
|
26
|
+
- purpose: banner
|
|
27
|
+
uri: <<RELATIVE_PATH_TO_BANNER>>
|
|
28
|
+
- purpose: featureGraphic
|
|
29
|
+
uri: <<RELATIVE_PATH_TO_FEATURE_GRAPHIC>>
|
|
26
30
|
- purpose: screenshot
|
|
27
31
|
uri: <<RELATIVE_PATH_TO_SCREENSHOT1>>
|
|
28
32
|
- purpose: screenshot
|