@learncard/cli 1.1.5 → 1.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @learncard/cli
2
2
 
3
+ ## 1.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#60](https://github.com/WeLibraryOS/LearnCard/pull/60) [`100899e`](https://github.com/WeLibraryOS/LearnCard/commit/100899e32db4385758dc1b3559da7b64f705d305) Thanks [@TaylorBeeston](https://github.com/TaylorBeeston)! - Expose initLearnCard method
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`100899e`](https://github.com/WeLibraryOS/LearnCard/commit/100899e32db4385758dc1b3559da7b64f705d305)]:
12
+ - @learncard/core@4.1.0
13
+
14
+ ## 1.1.7
15
+
16
+ ### Patch Changes
17
+
18
+ - [#53](https://github.com/WeLibraryOS/LearnCard/pull/53) [`7d40878`](https://github.com/WeLibraryOS/LearnCard/commit/7d40878f7f15d80b03701bdec859f2e7135559dd) Thanks [@TaylorBeeston](https://github.com/TaylorBeeston)! - Add emptyWallet function to CLI
19
+
20
+ - Updated dependencies [[`7d40878`](https://github.com/WeLibraryOS/LearnCard/commit/7d40878f7f15d80b03701bdec859f2e7135559dd), [`7d40878`](https://github.com/WeLibraryOS/LearnCard/commit/7d40878f7f15d80b03701bdec859f2e7135559dd)]:
21
+ - @learncard/core@4.0.0
22
+
23
+ ## 1.1.6
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies [[`60e0f5b`](https://github.com/WeLibraryOS/LearnCard/commit/60e0f5b6ddaeb124959e87ac61189b2638c0b32b)]:
28
+ - @learncard/core@3.0.0
29
+
3
30
  ## 1.1.5
4
31
 
5
32
  ### Patch Changes
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ var crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto);
18
18
  const generateRandomSeed = () => crypto__default["default"].randomBytes(32).toString("hex");
19
19
 
20
20
  var name = "@learncard/cli";
21
- var version = "1.1.5";
21
+ var version = "1.2.0";
22
22
  var description = "Test out learn card!";
23
23
  var main = "dist/index.js";
24
24
  var bin = "dist/index.js";
@@ -63,7 +63,9 @@ var packageJson = {
63
63
 
64
64
  const g = {
65
65
  wallet: gradient__default["default"](["cyan", "green"])("wallet"),
66
+ emptyWallet: gradient__default["default"](["cyan", "green"])("emptyWallet"),
66
67
  walletFromKey: gradient__default["default"](["cyan", "green"])("walletFromKey"),
68
+ initLearnCard: gradient__default["default"](["cyan", "green"])("initLearnCard"),
67
69
  seed: gradient__default["default"](["cyan", "green"])("seed"),
68
70
  generateRandomSeed: gradient__default["default"](["cyan", "green"])("generateRandomSeed")
69
71
  };
@@ -77,8 +79,10 @@ commander.program.version(packageJson.version).argument("[seed]").action(async (
77
79
  console.log("Creating wallet...");
78
80
  globalThis.seed = seed;
79
81
  globalThis.generateRandomSeed = generateRandomSeed;
82
+ globalThis.emptyWallet = core.emptyWallet;
80
83
  globalThis.walletFromKey = core.walletFromKey;
81
- globalThis.wallet = await core.walletFromKey(seed);
84
+ globalThis.initLearnCard = core.initLearnCard;
85
+ globalThis.wallet = await core.initLearnCard({ seed });
82
86
  process.stdout.moveCursor(0, -1);
83
87
  process.stdout.clearLine(1);
84
88
  console.log("Wallet created!\n");
@@ -88,7 +92,9 @@ commander.program.version(packageJson.version).argument("[seed]").action(async (
88
92
  console.log("\u2502 Variable \u2502 Description \u2502");
89
93
  console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");
90
94
  console.log(`\u2502 ${g.wallet} \u2502 Learn Card Wallet \u2502`);
95
+ console.log(`\u2502 ${g.emptyWallet} \u2502 Wallet Instantiation Function \u2502`);
91
96
  console.log(`\u2502 ${g.walletFromKey} \u2502 Wallet Instantiation Function \u2502`);
97
+ console.log(`\u2502 ${g.initLearnCard} \u2502 Wallet Instantiation Function \u2502`);
92
98
  console.log(`\u2502 ${g.seed} \u2502 Seed used to generate wallet \u2502`);
93
99
  console.log(`\u2502 ${g.generateRandomSeed} \u2502 Generates a random seed \u2502`);
94
100
  console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518");
@@ -109,7 +115,7 @@ commander.program.version(packageJson.version).argument("[seed]").action(async (
109
115
  console.log("");
110
116
  repl__default["default"].start({
111
117
  colorize: (input) => {
112
- return input.replace("walletFromKey", g.walletFromKey).replace("wallet", g.wallet).replace("seed", g.seed).replace("generateRandomSeed", g.generateRandomSeed);
118
+ return input.replace("emptyWallet", g.emptyWallet).replace("walletFromKey", g.walletFromKey).replace("initLearnCard", g.initLearnCard).replace("wallet", g.wallet).replace("seed", g.seed).replace("generateRandomSeed", g.generateRandomSeed);
113
119
  }
114
120
  });
115
121
  }).parse(process.argv);
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@learncard/cli",
3
- "version": "1.1.5",
3
+ "version": "1.2.0",
4
4
  "description": "Test out learn card!",
5
5
  "main": "dist/index.js",
6
6
  "bin": "dist/index.js",
7
7
  "author": "Learning Economy Foundation (www.learningeconomy.io)",
8
8
  "license": "MIT",
9
9
  "dependencies": {
10
- "@learncard/core": "2.1.0",
10
+ "@learncard/core": "4.1.0",
11
11
  "@learncard/types": "2.1.2",
12
12
  "@rollup/plugin-json": "^4.1.0",
13
13
  "commander": "^9.3.0",
package/src/index.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import repl from 'pretty-repl';
2
2
 
3
- import { walletFromKey } from '@learncard/core';
3
+ import { initLearnCard, emptyWallet, walletFromKey } from '@learncard/core';
4
4
  import gradient from 'gradient-string';
5
5
  import figlet from 'figlet';
6
6
  import { program } from 'commander';
@@ -11,7 +11,9 @@ import packageJson from '../package.json';
11
11
 
12
12
  const g = {
13
13
  wallet: gradient(['cyan', 'green'])('wallet'),
14
+ emptyWallet: gradient(['cyan', 'green'])('emptyWallet'),
14
15
  walletFromKey: gradient(['cyan', 'green'])('walletFromKey'),
16
+ initLearnCard: gradient(['cyan', 'green'])('initLearnCard'),
15
17
  seed: gradient(['cyan', 'green'])('seed'),
16
18
  generateRandomSeed: gradient(['cyan', 'green'])('generateRandomSeed'),
17
19
  };
@@ -33,8 +35,10 @@ program
33
35
 
34
36
  globalThis.seed = seed;
35
37
  globalThis.generateRandomSeed = generateRandomSeed;
38
+ globalThis.emptyWallet = emptyWallet;
36
39
  globalThis.walletFromKey = walletFromKey;
37
- globalThis.wallet = await walletFromKey(seed);
40
+ globalThis.initLearnCard = initLearnCard;
41
+ globalThis.wallet = await initLearnCard({ seed });
38
42
 
39
43
  // delete 'Creating wallet...' message
40
44
  process.stdout.moveCursor(0, -1);
@@ -48,7 +52,9 @@ program
48
52
  console.log('│ Variable │ Description │');
49
53
  console.log('├────────────────────┼───────────────────────────────┤');
50
54
  console.log(`│ ${g.wallet} │ Learn Card Wallet │`);
55
+ console.log(`│ ${g.emptyWallet} │ Wallet Instantiation Function │`);
51
56
  console.log(`│ ${g.walletFromKey} │ Wallet Instantiation Function │`);
57
+ console.log(`│ ${g.initLearnCard} │ Wallet Instantiation Function │`);
52
58
  console.log(`│ ${g.seed} │ Seed used to generate wallet │`);
53
59
  console.log(`│ ${g.generateRandomSeed} │ Generates a random seed │`);
54
60
  console.log('└────────────────────┴───────────────────────────────┘');
@@ -81,7 +87,9 @@ program
81
87
  repl.start({
82
88
  colorize: (input: string) => {
83
89
  return input
90
+ .replace('emptyWallet', g.emptyWallet)
84
91
  .replace('walletFromKey', g.walletFromKey)
92
+ .replace('initLearnCard', g.initLearnCard)
85
93
  .replace('wallet', g.wallet)
86
94
  .replace('seed', g.seed)
87
95
  .replace('generateRandomSeed', g.generateRandomSeed);