@orderly.network/cli 0.0.33-alpha.3

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/bin/cli.js ADDED
@@ -0,0 +1,22 @@
1
+ #! /usr/bin/env node
2
+
3
+ // command:
4
+ // project create
5
+ // theme pull/push
6
+ // intl pull/push
7
+
8
+ const yargs = require("yargs");
9
+ const { hideBin } = require("yargs/helpers");
10
+
11
+ console.clear();
12
+
13
+ const create = require("../commands/create");
14
+
15
+
16
+
17
+ const argv = yargs(hideBin(process.argv))
18
+ // .command(create)
19
+ .commandDir("../commands")
20
+ .demandCommand(1,'You need at least one command before moving on')
21
+ // .example('$0 create -n my-project -t react', 'create a new project')
22
+ .help().argv;
File without changes
@@ -0,0 +1,23 @@
1
+ function handler(argv) {
2
+ console.log("create:::::", argv);
3
+ }
4
+
5
+ module.exports = {
6
+ command: "create",
7
+ describe: "create a new Orderly project",
8
+ builder: (yargs) => {
9
+ yargs.option("name", {
10
+ alias: "n",
11
+ describe: "project name",
12
+ type: "string",
13
+ demandOption: true,
14
+ });
15
+ yargs.option("template", {
16
+ alias: "t",
17
+ describe: "project template",
18
+ type: "string",
19
+ demandOption: true,
20
+ });
21
+ },
22
+ handler,
23
+ };
File without changes
@@ -0,0 +1,73 @@
1
+ const metaMaks = require("@metamask/sdk");
2
+
3
+ const qrcode = require("qrcode-terminal");
4
+
5
+
6
+
7
+ function handler(argv) {
8
+ const options = {
9
+ shouldShimWeb3: false,
10
+ dappMetadata: {
11
+ name: "NodeJS example",
12
+ },
13
+ logging: {
14
+ sdk: false,
15
+ },
16
+ checkInstallationImmediately: false,
17
+ // Optional: customize modal text
18
+ modals: {
19
+ install: ({ link }) => {
20
+ qrcode.generate(link, { small: true }, (qr) => console.log(qr));
21
+ return {};
22
+ },
23
+ otp: () => {
24
+ return {
25
+ mount() {},
26
+ updateOTPValue: (otpValue) => {
27
+ if (otpValue !== "") {
28
+ console.debug(
29
+ `[CUSTOMIZE TEXT] Choose the following value on your metamask mobile wallet: ${otpValue}`
30
+ );
31
+ }
32
+ },
33
+ };
34
+ },
35
+ },
36
+ };
37
+ const MMSDK = new metaMaks.MetaMaskSDK(options);
38
+ console.log("create:::::", argv);
39
+
40
+
41
+
42
+ // MMSDK.init();
43
+
44
+ // const ethereum = MMSDK.getProvider();
45
+
46
+ // ethereum.request({ method: "eth_requestAccounts" }).then((accounts) => {
47
+ // console.log(accounts);
48
+ // });
49
+
50
+ // MMSDK.connect().then((res) => {
51
+ // console.log(res)
52
+ // })
53
+ }
54
+
55
+ module.exports = {
56
+ command: "login",
57
+ describe: "Connect to your Orderly account",
58
+ builder: (yargs) => {
59
+ // yargs.option("name", {
60
+ // alias: "n",
61
+ // describe: "project name",
62
+ // type: "string",
63
+ // demandOption: true,
64
+ // });
65
+ // yargs.option("template", {
66
+ // alias: "t",
67
+ // describe: "project template",
68
+ // type: "string",
69
+ // demandOption: true,
70
+ // });
71
+ },
72
+ handler,
73
+ };
@@ -0,0 +1,26 @@
1
+ // sign message
2
+
3
+ function handler(argv) {
4
+ console.log("create:::::", argv);
5
+ }
6
+
7
+ module.exports = {
8
+ command: "sign",
9
+ describe: "create a new Orderly project",
10
+ builder: (yargs) => {
11
+ yargs.option("name", {
12
+ alias: "n",
13
+ describe: "project name",
14
+ type: "string",
15
+ demandOption: true,
16
+ });
17
+ yargs.option("template", {
18
+ alias: "t",
19
+ describe: "project template",
20
+ type: "string",
21
+ demandOption: true,
22
+ });
23
+ },
24
+ handler,
25
+ };
26
+
@@ -0,0 +1,16 @@
1
+ exports.command = "pull";
2
+
3
+ exports.describe = "Pull theme from the theming build portal";
4
+
5
+ exports.builder = (yargs) => {
6
+ yargs.option("themeId", {
7
+ alias: "id",
8
+ describe: "theme id",
9
+ type: "string",
10
+ demandOption: true,
11
+ });
12
+ };
13
+
14
+ exports.handler = (argv) => {
15
+ console.log("pull:::::", argv);
16
+ };
File without changes
@@ -0,0 +1,10 @@
1
+ exports.command = "theme";
2
+
3
+ exports.describe = "theme commands";
4
+
5
+ exports.builder = (yargs) => {
6
+ yargs.commandDir("./theme");
7
+ };
8
+ exports.handler = (argv) => {
9
+ console.log("theme:::::", argv);
10
+ };
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@orderly.network/cli",
3
+ "version": "0.0.33-alpha.3",
4
+ "description": "",
5
+ "bin": {
6
+ "orderly": "./bin/cli.js"
7
+ },
8
+ "files": [
9
+ "bin",
10
+ "commands"
11
+ ],
12
+ "keywords": [],
13
+ "author": "leo",
14
+ "license": "ISC",
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "dependencies": {
19
+ "@metamask/sdk": "^0.14.1",
20
+ "configstore": "^6.0.0",
21
+ "enquirer": "^2.4.1",
22
+ "qrcode-terminal": "^0.12.0",
23
+ "yargs": "^17.7.2",
24
+ "@orderly.network/core": "0.1.24-alpha.5"
25
+ },
26
+ "scripts": {
27
+ "test": "echo \"Error: no test specified\" && exit 1"
28
+ }
29
+ }