ic-mops 1.0.0 → 1.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Mops CLI Changelog
2
2
 
3
+ ## 1.0.1
4
+ - Fixed `mops user *` commands
5
+
3
6
  ## 1.0.0
4
7
  - `mops cache clean` now cleans local cache too (`.mops` folder)
5
8
  - Conflicting dependencies are now reported on `mops add/install/sources`
package/bundle/cli.tgz CHANGED
Binary file
package/cli.ts CHANGED
@@ -25,7 +25,6 @@ import {toolchain} from './commands/toolchain/index.js';
25
25
  import {Tool} from './types.js';
26
26
  import * as self from './commands/self.js';
27
27
  import {resolvePackages} from './resolve-packages.js';
28
- // import {docs} from './commands/docs.js';
29
28
 
30
29
  declare global {
31
30
  // eslint-disable-next-line no-var
@@ -152,16 +151,6 @@ program
152
151
  console.log(getNetwork());
153
152
  });
154
153
 
155
- // user import
156
- program
157
- .command('mops user import <data>')
158
- .description('Import .pem file data to use as identity')
159
- .addOption(new Option('--no-encrypt', 'Do not ask for a password to encrypt identity'))
160
- .action(async (data, options) => {
161
- await importPem(data, options);
162
- await getPrincipal();
163
- });
164
-
165
154
  // sources
166
155
  program
167
156
  .command('sources')
@@ -180,14 +169,6 @@ program
180
169
  console.log(sourcesArr.join('\n'));
181
170
  });
182
171
 
183
- // get-principal
184
- program
185
- .command('get-principal')
186
- .description('Print your principal')
187
- .action(async () => {
188
- await getPrincipal();
189
- });
190
-
191
172
  // search
192
173
  program
193
174
  .command('search <text>')
@@ -256,37 +237,48 @@ program
256
237
  await template();
257
238
  });
258
239
 
259
- // docs
260
- // program
261
- // .command('docs')
262
- // .description('Generate documentation (experimental)')
263
- // .action(async () => {
264
- // if (!checkConfigFile()) {
265
- // process.exit(1);
266
- // }
267
- // await docs();
268
- // });
269
-
270
- // user
271
- program
272
- .command('user')
273
- .addArgument(new Argument('<sub>').choices(['set', 'get']))
240
+ // mops user *
241
+ const userCommand = new Command('user').description('User management');
242
+
243
+ // user get-principal
244
+ userCommand
245
+ .command('get-principal')
246
+ .description('Print your principal')
247
+ .action(async () => {
248
+ await getPrincipal();
249
+ });
250
+
251
+ // user import
252
+ userCommand
253
+ .command('import <data>')
254
+ .description('Import .pem file data to use as identity')
255
+ .addOption(new Option('--no-encrypt', 'Do not ask for a password to encrypt identity'))
256
+ .action(async (data, options) => {
257
+ await importPem(data, options);
258
+ await getPrincipal();
259
+ });
260
+
261
+ // user set <prop> <value>
262
+ userCommand
263
+ .command('set')
274
264
  .addArgument(new Argument('<prop>').choices(['name', 'site', 'email', 'github', 'twitter']))
275
- .addArgument(new Argument('[value]'))
276
- .description('User settings')
277
- .action(async (sub, prop, value) => {
278
- if (sub == 'get') {
279
- await getUserProp(prop);
280
- }
281
- else if (sub == 'set') {
282
- if (!value) {
283
- console.log('error: missing required argument "value"');
284
- return;
285
- }
286
- await setUserProp(prop, value);
287
- }
265
+ .addArgument(new Argument('<value>'))
266
+ .description('Set user property')
267
+ .action(async (prop, value) => {
268
+ await setUserProp(prop, value);
288
269
  });
289
270
 
271
+ // user get <prop>
272
+ userCommand
273
+ .command('get')
274
+ .addArgument(new Argument('<prop>').choices(['name', 'site', 'email', 'github', 'twitter']))
275
+ .description('Get user property')
276
+ .action(async (prop) => {
277
+ await getUserProp(prop);
278
+ });
279
+
280
+ program.addCommand(userCommand);
281
+
290
282
  // bump
291
283
  program
292
284
  .command('bump [major|minor|patch]')
package/dist/cli.js CHANGED
@@ -125,15 +125,6 @@ program
125
125
  .action(async () => {
126
126
  console.log(getNetwork());
127
127
  });
128
- // user import
129
- program
130
- .command('mops user import <data>')
131
- .description('Import .pem file data to use as identity')
132
- .addOption(new Option('--no-encrypt', 'Do not ask for a password to encrypt identity'))
133
- .action(async (data, options) => {
134
- await importPem(data, options);
135
- await getPrincipal();
136
- });
137
128
  // sources
138
129
  program
139
130
  .command('sources')
@@ -151,13 +142,6 @@ program
151
142
  let sourcesArr = await sources(options);
152
143
  console.log(sourcesArr.join('\n'));
153
144
  });
154
- // get-principal
155
- program
156
- .command('get-principal')
157
- .description('Print your principal')
158
- .action(async () => {
159
- await getPrincipal();
160
- });
161
145
  // search
162
146
  program
163
147
  .command('search <text>')
@@ -221,35 +205,42 @@ program
221
205
  }
222
206
  await template();
223
207
  });
224
- // docs
225
- // program
226
- // .command('docs')
227
- // .description('Generate documentation (experimental)')
228
- // .action(async () => {
229
- // if (!checkConfigFile()) {
230
- // process.exit(1);
231
- // }
232
- // await docs();
233
- // });
234
- // user
235
- program
236
- .command('user')
237
- .addArgument(new Argument('<sub>').choices(['set', 'get']))
208
+ // mops user *
209
+ const userCommand = new Command('user').description('User management');
210
+ // user get-principal
211
+ userCommand
212
+ .command('get-principal')
213
+ .description('Print your principal')
214
+ .action(async () => {
215
+ await getPrincipal();
216
+ });
217
+ // user import
218
+ userCommand
219
+ .command('import <data>')
220
+ .description('Import .pem file data to use as identity')
221
+ .addOption(new Option('--no-encrypt', 'Do not ask for a password to encrypt identity'))
222
+ .action(async (data, options) => {
223
+ await importPem(data, options);
224
+ await getPrincipal();
225
+ });
226
+ // user set <prop> <value>
227
+ userCommand
228
+ .command('set')
238
229
  .addArgument(new Argument('<prop>').choices(['name', 'site', 'email', 'github', 'twitter']))
239
- .addArgument(new Argument('[value]'))
240
- .description('User settings')
241
- .action(async (sub, prop, value) => {
242
- if (sub == 'get') {
243
- await getUserProp(prop);
244
- }
245
- else if (sub == 'set') {
246
- if (!value) {
247
- console.log('error: missing required argument "value"');
248
- return;
249
- }
250
- await setUserProp(prop, value);
251
- }
230
+ .addArgument(new Argument('<value>'))
231
+ .description('Set user property')
232
+ .action(async (prop, value) => {
233
+ await setUserProp(prop, value);
234
+ });
235
+ // user get <prop>
236
+ userCommand
237
+ .command('get')
238
+ .addArgument(new Argument('<prop>').choices(['name', 'site', 'email', 'github', 'twitter']))
239
+ .description('Get user property')
240
+ .action(async (prop) => {
241
+ await getUserProp(prop);
252
242
  });
243
+ program.addCommand(userCommand);
253
244
  // bump
254
245
  program
255
246
  .command('bump [major|minor|patch]')
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mops": "bin/mops.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mops": "dist/bin/mops.js",