ic-mops 0.3.6 → 0.4.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/README.md CHANGED
@@ -38,17 +38,26 @@ mops init
38
38
  ```
39
39
 
40
40
  ### 3. Install Motoko Packages
41
- Install your favorite packages
41
+ Use `mops add` to install a specific package and save it to `mops.toml`
42
42
 
43
43
  ```
44
44
  mops add <package_name>
45
45
  ```
46
46
 
47
+ Use `mops install` to install all packages specified in `mops.toml`
48
+ ```
49
+ mops install
50
+ ```
51
+
47
52
  ### 4. Import Package
48
53
  Now you can import installed packages in your Motoko code
49
54
 
50
55
  ```motoko
51
- import Lib "mo:<package_name>";
56
+ import PackageName "mo:<package_name>";
57
+ ```
58
+ for example
59
+ ```
60
+ import Itertools "mo:itertools/Iter";
52
61
  ```
53
62
 
54
63
  ## Publish a Package
package/cli.js CHANGED
@@ -14,6 +14,7 @@ import {whoami} from './commands/whoami.js';
14
14
  import {installAll} from './commands/install-all.js';
15
15
  import {search} from './commands/search.js';
16
16
  import {add} from './commands/add.js';
17
+ import {upgrade} from './commands/upgrade.js';
17
18
 
18
19
  let cwd = process.cwd();
19
20
  let configFile = path.join(cwd, 'mops.toml');
@@ -124,10 +125,17 @@ program
124
125
  // search
125
126
  program
126
127
  .command('search <text>')
127
- .alias('find')
128
128
  .description('Search for packages')
129
129
  .action(async (text) => {
130
130
  await search(text);
131
131
  });
132
132
 
133
+ // search
134
+ program
135
+ .command('upgrade')
136
+ .description('Upgrade mops CLI to the latest version')
137
+ .action(async () => {
138
+ upgrade();
139
+ });
140
+
133
141
  program.parse();
@@ -0,0 +1,6 @@
1
+ import child_process from 'child_process';
2
+
3
+ export function upgrade() {
4
+ console.log('Upgrading mops CLI...');
5
+ child_process.execSync('npm i ic-mops -g', {stdio: 'inherit'});
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "0.3.6",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mops": "cli.js"