ic-mops 0.8.9 → 0.8.10

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/cli.js CHANGED
@@ -183,8 +183,14 @@ program
183
183
  .command('self-update')
184
184
  .description('Update mops CLI to the latest version')
185
185
  .option('--detached')
186
+ .option('--force')
186
187
  .action(async (options) => {
187
- selfUpdate(options);
188
+ if (options.force) {
189
+ selfUpdate(options);
190
+ }
191
+ else {
192
+ console.log('Please run \'npm i -g ic-mops\'');
193
+ }
188
194
  });
189
195
 
190
196
  program.parse();
package/commands/test.js CHANGED
@@ -114,7 +114,9 @@ export async function runAll(filter = '') {
114
114
  // stderr
115
115
  proc.stderr.on('data', (data) => {
116
116
  let text = data.toString().trim();
117
- text = text.replace(/:(\d+).(\d+)(-\d+.\d+)/g, ':$1:$2');
117
+ // change absolute file path to relative
118
+ // change :line:col-line:col to :line:col to work in vscode
119
+ text = text.replace(/([\w+._/-]+):(\d+).(\d+)(-\d+.\d+)/g, (m0, m1, m2, m3) => `${path.relative(getRootDir(), path.resolve(m1))}:${m2}:${m3}`);
118
120
  mmf1.fail(text);
119
121
  });
120
122
 
@@ -9,12 +9,6 @@ type StorageStats =
9
9
  memorySize: nat;
10
10
  };
11
11
  type StorageId = principal;
12
- type Snapshot =
13
- record {
14
- downloads: nat;
15
- endTime: Time;
16
- startTime: Time;
17
- };
18
12
  type Script =
19
13
  record {
20
14
  name: text;
@@ -85,6 +79,7 @@ type PackageDetails =
85
79
  dependents: vec PackageSummary__1;
86
80
  deps: vec PackageSummary__1;
87
81
  devDeps: vec PackageSummary__1;
82
+ downloadTrend: vec DownloadsSnapshot;
88
83
  downloadsInLast30Days: nat;
89
84
  downloadsInLast7Days: nat;
90
85
  downloadsTotal: nat;
@@ -132,6 +127,18 @@ type PackageConfigV2 =
132
127
  };
133
128
  type FileId = text;
134
129
  type Err = text;
130
+ type DownloadsSnapshot__1 =
131
+ record {
132
+ downloads: nat;
133
+ endTime: Time;
134
+ startTime: Time;
135
+ };
136
+ type DownloadsSnapshot =
137
+ record {
138
+ downloads: nat;
139
+ endTime: Time;
140
+ startTime: Time;
141
+ };
135
142
  type DependencyV2 =
136
143
  record {
137
144
  name: PackageName;
@@ -145,8 +152,10 @@ service : {
145
152
  PackageName__1;
146
153
  Version;
147
154
  }) query;
148
- getDownloadTrendByPackageId: (PackageId) -> (vec Snapshot) query;
149
- getDownloadTrendByPackageName: (PackageName__1) -> (vec Snapshot) query;
155
+ getDownloadTrendByPackageId: (PackageId) ->
156
+ (vec DownloadsSnapshot__1) query;
157
+ getDownloadTrendByPackageName: (PackageName__1) ->
158
+ (vec DownloadsSnapshot__1) query;
150
159
  getFileIds: (PackageName__1, Ver) -> (Result_5) query;
151
160
  getHighestVersion: (PackageName__1) -> (Result_4) query;
152
161
  getMostDownloadedPackages: () -> (vec PackageSummary) query;
@@ -6,6 +6,16 @@ export interface DependencyV2 {
6
6
  'repo' : string,
7
7
  'version' : string,
8
8
  }
9
+ export interface DownloadsSnapshot {
10
+ 'startTime' : Time,
11
+ 'endTime' : Time,
12
+ 'downloads' : bigint,
13
+ }
14
+ export interface DownloadsSnapshot__1 {
15
+ 'startTime' : Time,
16
+ 'endTime' : Time,
17
+ 'downloads' : bigint,
18
+ }
9
19
  export type Err = string;
10
20
  export type FileId = string;
11
21
  export interface PackageConfigV2 {
@@ -49,6 +59,7 @@ export interface PackageDetails {
49
59
  'deps' : Array<PackageSummary__1>,
50
60
  'downloadsTotal' : bigint,
51
61
  'downloadsInLast30Days' : bigint,
62
+ 'downloadTrend' : Array<DownloadsSnapshot>,
52
63
  'versionHistory' : Array<PackageSummary__1>,
53
64
  'dependents' : Array<PackageSummary__1>,
54
65
  'devDeps' : Array<PackageSummary__1>,
@@ -95,11 +106,6 @@ export type Result_4 = { 'ok' : Ver } |
95
106
  export type Result_5 = { 'ok' : Array<FileId> } |
96
107
  { 'err' : Err };
97
108
  export interface Script { 'value' : string, 'name' : string }
98
- export interface Snapshot {
99
- 'startTime' : Time,
100
- 'endTime' : Time,
101
- 'downloads' : bigint,
102
- }
103
109
  export type StorageId = Principal;
104
110
  export interface StorageStats {
105
111
  'fileCount' : bigint,
@@ -117,10 +123,13 @@ export interface _SERVICE {
117
123
  [string],
118
124
  Array<[PackageName__1, Version]>
119
125
  >,
120
- 'getDownloadTrendByPackageId' : ActorMethod<[PackageId], Array<Snapshot>>,
126
+ 'getDownloadTrendByPackageId' : ActorMethod<
127
+ [PackageId],
128
+ Array<DownloadsSnapshot__1>
129
+ >,
121
130
  'getDownloadTrendByPackageName' : ActorMethod<
122
131
  [PackageName__1],
123
- Array<Snapshot>
132
+ Array<DownloadsSnapshot__1>
124
133
  >,
125
134
  'getFileIds' : ActorMethod<[PackageName__1, Ver], Result_5>,
126
135
  'getHighestVersion' : ActorMethod<[PackageName__1], Result_4>,
@@ -7,7 +7,7 @@ export const idlFactory = ({ IDL }) => {
7
7
  const Version = IDL.Text;
8
8
  const PackageId = IDL.Text;
9
9
  const Time = IDL.Int;
10
- const Snapshot = IDL.Record({
10
+ const DownloadsSnapshot__1 = IDL.Record({
11
11
  'startTime' : Time,
12
12
  'endTime' : Time,
13
13
  'downloads' : IDL.Nat,
@@ -62,11 +62,17 @@ export const idlFactory = ({ IDL }) => {
62
62
  'config' : PackageConfigV2__1,
63
63
  'publication' : PackagePublication,
64
64
  });
65
+ const DownloadsSnapshot = IDL.Record({
66
+ 'startTime' : Time,
67
+ 'endTime' : Time,
68
+ 'downloads' : IDL.Nat,
69
+ });
65
70
  const PackageDetails = IDL.Record({
66
71
  'owner' : IDL.Principal,
67
72
  'deps' : IDL.Vec(PackageSummary__1),
68
73
  'downloadsTotal' : IDL.Nat,
69
74
  'downloadsInLast30Days' : IDL.Nat,
75
+ 'downloadTrend' : IDL.Vec(DownloadsSnapshot),
70
76
  'versionHistory' : IDL.Vec(PackageSummary__1),
71
77
  'dependents' : IDL.Vec(PackageSummary__1),
72
78
  'devDeps' : IDL.Vec(PackageSummary__1),
@@ -112,12 +118,12 @@ export const idlFactory = ({ IDL }) => {
112
118
  ),
113
119
  'getDownloadTrendByPackageId' : IDL.Func(
114
120
  [PackageId],
115
- [IDL.Vec(Snapshot)],
121
+ [IDL.Vec(DownloadsSnapshot__1)],
116
122
  ['query'],
117
123
  ),
118
124
  'getDownloadTrendByPackageName' : IDL.Func(
119
125
  [PackageName__1],
120
- [IDL.Vec(Snapshot)],
126
+ [IDL.Vec(DownloadsSnapshot__1)],
121
127
  ['query'],
122
128
  ),
123
129
  'getFileIds' : IDL.Func([PackageName__1, Ver], [Result_5], ['query']),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "0.8.9",
3
+ "version": "0.8.10",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mops": "cli.js"