@airmoney-degn/airmoney-cli 0.16.0 → 0.16.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/dist/cli/create.js +1 -8
- package/dist/cli/demo.js +9 -3
- package/dist/cli/serve.js +1 -1
- package/dist/cli/setup.js +1 -1
- package/dist/cli/upload.js +1 -5
- package/dist/config.json +1 -1
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/dist/cli/create.js
CHANGED
|
@@ -38,14 +38,7 @@ const fs = __importStar(require("fs"));
|
|
|
38
38
|
const path = __importStar(require("path"));
|
|
39
39
|
const types_1 = require("../types");
|
|
40
40
|
const child_process_1 = require("child_process");
|
|
41
|
-
|
|
42
|
-
* Command for creating a new project.
|
|
43
|
-
* Now no longer requires userId + apiKey from caller;
|
|
44
|
-
* it will read them from environment variables:
|
|
45
|
-
* process.env.DEVELOPER_ADDRESS
|
|
46
|
-
* process.env.API_KEY
|
|
47
|
-
*/
|
|
48
|
-
async function createCommand(name, template, locationFolder, quiet, ignoreEnvValidation) {
|
|
41
|
+
async function createCommand({ name, template, locationFolder, quiet, ignoreEnvValidation, }) {
|
|
49
42
|
// read from env (the .env was placed in config by `setup`).
|
|
50
43
|
const userId = process.env.DEVELOPER_ADDRESS || '';
|
|
51
44
|
const apiKey = process.env.API_KEY || '';
|
package/dist/cli/demo.js
CHANGED
|
@@ -38,11 +38,17 @@ const path = __importStar(require("path"));
|
|
|
38
38
|
const child_process_1 = require("child_process");
|
|
39
39
|
const create_1 = require("./create");
|
|
40
40
|
const serve_1 = require("./serve");
|
|
41
|
-
async function demoCommand(name, appPath) {
|
|
41
|
+
async function demoCommand({ name, appPath }) {
|
|
42
42
|
const projectName = name || 'degn-demo';
|
|
43
43
|
const folderName = appPath || projectName;
|
|
44
44
|
const projectPath = path.join(process.cwd(), folderName);
|
|
45
|
-
await (0, create_1.createCommand)(
|
|
45
|
+
await (0, create_1.createCommand)({
|
|
46
|
+
name: projectName,
|
|
47
|
+
template: true,
|
|
48
|
+
locationFolder: appPath,
|
|
49
|
+
quiet: true,
|
|
50
|
+
ignoreEnvValidation: true,
|
|
51
|
+
});
|
|
46
52
|
try {
|
|
47
53
|
console.log('Installing dependencies...');
|
|
48
54
|
(0, child_process_1.execSync)('npm install', { cwd: projectPath, stdio: 'inherit' });
|
|
@@ -62,5 +68,5 @@ async function demoCommand(name, appPath) {
|
|
|
62
68
|
});
|
|
63
69
|
// Give the dev server a moment to boot; default Vite port is 5173
|
|
64
70
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
|
65
|
-
await (0, serve_1.serveCommand)(false, undefined, 'http://localhost:5173');
|
|
71
|
+
await (0, serve_1.serveCommand)({ noBrowser: false, locationFolder: undefined, appUrl: 'http://localhost:5173' });
|
|
66
72
|
}
|
package/dist/cli/serve.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.serveCommand = serveCommand;
|
|
4
4
|
const ServeOrchestrator_1 = require("../service/serve/ServeOrchestrator");
|
|
5
|
-
async function serveCommand(noBrowser, locationFolder, appUrl) {
|
|
5
|
+
async function serveCommand({ noBrowser, locationFolder, appUrl, }) {
|
|
6
6
|
const orchestrator = new ServeOrchestrator_1.ServeOrchestrator({
|
|
7
7
|
noBrowser,
|
|
8
8
|
locationFolder,
|
package/dist/cli/setup.js
CHANGED
|
@@ -37,7 +37,7 @@ exports.setupCommand = setupCommand;
|
|
|
37
37
|
const fs = __importStar(require("fs"));
|
|
38
38
|
const path = __importStar(require("path"));
|
|
39
39
|
const env_1 = require("../util/env");
|
|
40
|
-
async function setupCommand(network, userId, apiKey) {
|
|
40
|
+
async function setupCommand({ network, userId, apiKey, }) {
|
|
41
41
|
const dir = (0, env_1.configDir)();
|
|
42
42
|
if (!dir)
|
|
43
43
|
return;
|
package/dist/cli/upload.js
CHANGED
|
@@ -43,11 +43,7 @@ const md5_1 = __importDefault(require("md5")); // default import fixes TS call
|
|
|
43
43
|
const metadata_1 = require("../util/metadata");
|
|
44
44
|
const tarball_1 = require("../util/tarball");
|
|
45
45
|
const path_1 = __importDefault(require("path"));
|
|
46
|
-
|
|
47
|
-
* Upload command now reads userId, apiKey from environment or store config,
|
|
48
|
-
* ignoring the older CLI inputs.
|
|
49
|
-
*/
|
|
50
|
-
async function uploadCommand(network, locationFolder, buttonImages) {
|
|
46
|
+
async function uploadCommand({ network, locationFolder, buttonImages, }) {
|
|
51
47
|
console.log('Loading metadata...');
|
|
52
48
|
const userId = process.env.DEVELOPER_ADDRESS || '';
|
|
53
49
|
const apiKey = process.env.API_KEY || '';
|
package/dist/config.json
CHANGED
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ program
|
|
|
25
25
|
.option('-n, --network <string>', 'network devnet|mainnet', 'devnet')
|
|
26
26
|
.action(opts => {
|
|
27
27
|
const { user, key, network } = opts;
|
|
28
|
-
(0, setup_1.setupCommand)(network, user, key);
|
|
28
|
+
(0, setup_1.setupCommand)({ network, userId: user, apiKey: key });
|
|
29
29
|
});
|
|
30
30
|
program
|
|
31
31
|
.command('create')
|
|
@@ -36,7 +36,7 @@ program
|
|
|
36
36
|
.option('--template', 'initialize project based on git quickstart')
|
|
37
37
|
.action(async (opts) => {
|
|
38
38
|
const { name, appPath, template } = opts;
|
|
39
|
-
await (0, create_1.createCommand)(name, template, appPath);
|
|
39
|
+
await (0, create_1.createCommand)({ name, template, locationFolder: appPath });
|
|
40
40
|
});
|
|
41
41
|
program
|
|
42
42
|
.command('serve')
|
|
@@ -53,7 +53,7 @@ program
|
|
|
53
53
|
console.error('both --index-app-path and --app-url must not be used simuntaniusly');
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
await (0, serve_1.serveCommand)(!browser, indexAppPath, appUrl);
|
|
56
|
+
await (0, serve_1.serveCommand)({ noBrowser: !browser, locationFolder: indexAppPath, appUrl });
|
|
57
57
|
});
|
|
58
58
|
program
|
|
59
59
|
.command('wallet')
|
|
@@ -102,7 +102,7 @@ program
|
|
|
102
102
|
indexAppPath = undefined;
|
|
103
103
|
}
|
|
104
104
|
// user and key are read from store config within uploadCommand
|
|
105
|
-
await (0, upload_1.uploadCommand)(network, indexAppPath, buttonImage);
|
|
105
|
+
await (0, upload_1.uploadCommand)({ network, locationFolder: indexAppPath, buttonImages: buttonImage });
|
|
106
106
|
});
|
|
107
107
|
program
|
|
108
108
|
.command('demo')
|
|
@@ -111,7 +111,7 @@ program
|
|
|
111
111
|
.description('serve the built-in demo app')
|
|
112
112
|
.action(async (opts) => {
|
|
113
113
|
const { name = 'degn-demo', appPath } = opts;
|
|
114
|
-
await (0, demo_1.demoCommand)(name, appPath);
|
|
114
|
+
await (0, demo_1.demoCommand)({ name, appPath });
|
|
115
115
|
});
|
|
116
116
|
program.addHelpText('after', 'for more help access https://dash-devnet.air.fun/');
|
|
117
117
|
program.parse(process.argv);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airmoney-degn/airmoney-cli",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"description": "airmoney-cli is a command-line interface tool designed to facilitate the development and management of decentralized applications (DApps) for Airmoney.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|