ic-mops 0.8.0 → 0.8.2

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/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ identity.pem
2
+ network.txt
package/README.md CHANGED
@@ -67,7 +67,7 @@ Now you can import installed packages in your Motoko code
67
67
  import PackageName "mo:<package_name>";
68
68
  ```
69
69
  for example
70
- ```
70
+ ```motoko
71
71
  import Itertools "mo:itertools/Iter";
72
72
  ```
73
73
 
package/cli.js CHANGED
@@ -17,7 +17,7 @@ import {add} from './commands/add.js';
17
17
  import {cacheSize, cleanCache} from './cache.js';
18
18
  import {test} from './commands/test.js';
19
19
  import {template} from './commands/template.js';
20
- // import {upgrade} from './commands/upgrade.js';
20
+ import {upgrade} from './commands/upgrade.js';
21
21
 
22
22
  let cwd = process.cwd();
23
23
  let configFile = path.join(cwd, 'mops.toml');
@@ -171,12 +171,13 @@ program
171
171
  await template(options);
172
172
  });
173
173
 
174
- // // upgrade
175
- // program
176
- // .command('upgrade')
177
- // .description('Upgrade mops CLI to the latest version')
178
- // .action(async () => {
179
- // upgrade();
180
- // });
174
+ // upgrade
175
+ program
176
+ .command('self-update')
177
+ .description('Upgrade mops CLI to the latest version')
178
+ .option('--detached')
179
+ .action(async (options) => {
180
+ upgrade(options);
181
+ });
181
182
 
182
183
  program.parse();
@@ -22,6 +22,7 @@ export async function template() {
22
22
  return;
23
23
  }
24
24
  let mopsTestYml = new URL('../templates/mops-test.yml', import.meta.url);
25
+ fs.mkdirSync(path.resolve(process.cwd(), '.github/workflows'), {recursive: true});
25
26
  fs.copyFileSync(mopsTestYml, dest);
26
27
  console.log(chalk.green('Workflow created:'), dest);
27
28
  }
@@ -1,6 +1,6 @@
1
1
  import child_process from 'child_process';
2
2
 
3
- export function upgrade() {
3
+ export function upgrade({detached = false} = {}) {
4
4
  console.log('Upgrading mops CLI...');
5
- child_process.execSync('npm i ic-mops -g', {stdio: 'inherit'});
5
+ child_process.execSync('npm i ic-mops -g', {stdio: 'inherit', detached});
6
6
  }
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mops": "cli.js"
7
7
  },
8
+ "files": [
9
+ "*",
10
+ "/templates"
11
+ ],
8
12
  "homepage": "https://mops.one",
9
13
  "repository": {
10
14
  "type": "git",