ic-mops 0.8.8 → 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;
@@ -52,6 +46,24 @@ type Result =
52
46
  };
53
47
  type PublishingId = text;
54
48
  type PublishingErr = text;
49
+ type PackageSummary__1 =
50
+ record {
51
+ config: PackageConfigV2__1;
52
+ downloadsInLast30Days: nat;
53
+ downloadsInLast7Days: nat;
54
+ downloadsTotal: nat;
55
+ owner: principal;
56
+ publication: PackagePublication;
57
+ };
58
+ type PackageSummary =
59
+ record {
60
+ config: PackageConfigV2__1;
61
+ downloadsInLast30Days: nat;
62
+ downloadsInLast7Days: nat;
63
+ downloadsTotal: nat;
64
+ owner: principal;
65
+ publication: PackagePublication;
66
+ };
55
67
  type PackagePublication =
56
68
  record {
57
69
  storage: principal;
@@ -64,11 +76,16 @@ type PackageId = text;
64
76
  type PackageDetails =
65
77
  record {
66
78
  config: PackageConfigV2__1;
79
+ dependents: vec PackageSummary__1;
80
+ deps: vec PackageSummary__1;
81
+ devDeps: vec PackageSummary__1;
82
+ downloadTrend: vec DownloadsSnapshot;
67
83
  downloadsInLast30Days: nat;
68
84
  downloadsInLast7Days: nat;
69
85
  downloadsTotal: nat;
70
86
  owner: principal;
71
87
  publication: PackagePublication;
88
+ versionHistory: vec PackageSummary__1;
72
89
  };
73
90
  type PackageConfigV2__1 =
74
91
  record {
@@ -110,6 +127,18 @@ type PackageConfigV2 =
110
127
  };
111
128
  type FileId = text;
112
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
+ };
113
142
  type DependencyV2 =
114
143
  record {
115
144
  name: PackageName;
@@ -123,14 +152,16 @@ service : {
123
152
  PackageName__1;
124
153
  Version;
125
154
  }) query;
126
- getDownloadTrendByPackageId: (PackageId) -> (vec Snapshot) query;
127
- getDownloadTrendByPackageName: (PackageName__1) -> (vec Snapshot) query;
155
+ getDownloadTrendByPackageId: (PackageId) ->
156
+ (vec DownloadsSnapshot__1) query;
157
+ getDownloadTrendByPackageName: (PackageName__1) ->
158
+ (vec DownloadsSnapshot__1) query;
128
159
  getFileIds: (PackageName__1, Ver) -> (Result_5) query;
129
160
  getHighestVersion: (PackageName__1) -> (Result_4) query;
130
- getMostDownloadedPackages: () -> (vec PackageDetails) query;
131
- getMostDownloadedPackagesIn7Days: () -> (vec PackageDetails) query;
161
+ getMostDownloadedPackages: () -> (vec PackageSummary) query;
162
+ getMostDownloadedPackagesIn7Days: () -> (vec PackageSummary) query;
132
163
  getPackageDetails: (PackageName__1, Ver) -> (Result_3) query;
133
- getRecentlyUpdatedPackages: () -> (vec PackageDetails) query;
164
+ getRecentlyUpdatedPackages: () -> (vec PackageSummary) query;
134
165
  getStoragesStats: () -> (vec record {
135
166
  StorageId;
136
167
  StorageStats;
@@ -138,7 +169,7 @@ service : {
138
169
  getTotalDownloads: () -> (nat) query;
139
170
  getTotalPackages: () -> (nat) query;
140
171
  notifyInstall: (PackageName__1, Ver) -> () oneway;
141
- search: (Text) -> (vec PackageDetails) query;
172
+ search: (Text) -> (vec PackageSummary) query;
142
173
  startFileUpload: (PublishingId, Text, nat, blob) -> (Result_2);
143
174
  startPublish: (PackageConfigV2) -> (Result_1);
144
175
  uploadFileChunk: (PublishingId, FileId, nat, blob) -> (Result);
@@ -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 {
@@ -46,8 +56,13 @@ export interface PackageConfigV2__1 {
46
56
  }
47
57
  export interface PackageDetails {
48
58
  'owner' : Principal,
59
+ 'deps' : Array<PackageSummary__1>,
49
60
  'downloadsTotal' : bigint,
50
61
  'downloadsInLast30Days' : bigint,
62
+ 'downloadTrend' : Array<DownloadsSnapshot>,
63
+ 'versionHistory' : Array<PackageSummary__1>,
64
+ 'dependents' : Array<PackageSummary__1>,
65
+ 'devDeps' : Array<PackageSummary__1>,
51
66
  'downloadsInLast7Days' : bigint,
52
67
  'config' : PackageConfigV2__1,
53
68
  'publication' : PackagePublication,
@@ -60,6 +75,22 @@ export interface PackagePublication {
60
75
  'time' : Time,
61
76
  'user' : Principal,
62
77
  }
78
+ export interface PackageSummary {
79
+ 'owner' : Principal,
80
+ 'downloadsTotal' : bigint,
81
+ 'downloadsInLast30Days' : bigint,
82
+ 'downloadsInLast7Days' : bigint,
83
+ 'config' : PackageConfigV2__1,
84
+ 'publication' : PackagePublication,
85
+ }
86
+ export interface PackageSummary__1 {
87
+ 'owner' : Principal,
88
+ 'downloadsTotal' : bigint,
89
+ 'downloadsInLast30Days' : bigint,
90
+ 'downloadsInLast7Days' : bigint,
91
+ 'config' : PackageConfigV2__1,
92
+ 'publication' : PackagePublication,
93
+ }
63
94
  export type PublishingErr = string;
64
95
  export type PublishingId = string;
65
96
  export type Result = { 'ok' : null } |
@@ -75,11 +106,6 @@ export type Result_4 = { 'ok' : Ver } |
75
106
  export type Result_5 = { 'ok' : Array<FileId> } |
76
107
  { 'err' : Err };
77
108
  export interface Script { 'value' : string, 'name' : string }
78
- export interface Snapshot {
79
- 'startTime' : Time,
80
- 'endTime' : Time,
81
- 'downloads' : bigint,
82
- }
83
109
  export type StorageId = Principal;
84
110
  export interface StorageStats {
85
111
  'fileCount' : bigint,
@@ -97,22 +123,25 @@ export interface _SERVICE {
97
123
  [string],
98
124
  Array<[PackageName__1, Version]>
99
125
  >,
100
- 'getDownloadTrendByPackageId' : ActorMethod<[PackageId], Array<Snapshot>>,
126
+ 'getDownloadTrendByPackageId' : ActorMethod<
127
+ [PackageId],
128
+ Array<DownloadsSnapshot__1>
129
+ >,
101
130
  'getDownloadTrendByPackageName' : ActorMethod<
102
131
  [PackageName__1],
103
- Array<Snapshot>
132
+ Array<DownloadsSnapshot__1>
104
133
  >,
105
134
  'getFileIds' : ActorMethod<[PackageName__1, Ver], Result_5>,
106
135
  'getHighestVersion' : ActorMethod<[PackageName__1], Result_4>,
107
- 'getMostDownloadedPackages' : ActorMethod<[], Array<PackageDetails>>,
108
- 'getMostDownloadedPackagesIn7Days' : ActorMethod<[], Array<PackageDetails>>,
136
+ 'getMostDownloadedPackages' : ActorMethod<[], Array<PackageSummary>>,
137
+ 'getMostDownloadedPackagesIn7Days' : ActorMethod<[], Array<PackageSummary>>,
109
138
  'getPackageDetails' : ActorMethod<[PackageName__1, Ver], Result_3>,
110
- 'getRecentlyUpdatedPackages' : ActorMethod<[], Array<PackageDetails>>,
139
+ 'getRecentlyUpdatedPackages' : ActorMethod<[], Array<PackageSummary>>,
111
140
  'getStoragesStats' : ActorMethod<[], Array<[StorageId, StorageStats]>>,
112
141
  'getTotalDownloads' : ActorMethod<[], bigint>,
113
142
  'getTotalPackages' : ActorMethod<[], bigint>,
114
143
  'notifyInstall' : ActorMethod<[PackageName__1, Ver], undefined>,
115
- 'search' : ActorMethod<[Text], Array<PackageDetails>>,
144
+ 'search' : ActorMethod<[Text], Array<PackageSummary>>,
116
145
  'startFileUpload' : ActorMethod<
117
146
  [PublishingId, Text, bigint, Uint8Array | number[]],
118
147
  Result_2
@@ -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,
@@ -46,10 +46,36 @@ export const idlFactory = ({ IDL }) => {
46
46
  'time' : Time,
47
47
  'user' : IDL.Principal,
48
48
  });
49
+ const PackageSummary = IDL.Record({
50
+ 'owner' : IDL.Principal,
51
+ 'downloadsTotal' : IDL.Nat,
52
+ 'downloadsInLast30Days' : IDL.Nat,
53
+ 'downloadsInLast7Days' : IDL.Nat,
54
+ 'config' : PackageConfigV2__1,
55
+ 'publication' : PackagePublication,
56
+ });
57
+ const PackageSummary__1 = IDL.Record({
58
+ 'owner' : IDL.Principal,
59
+ 'downloadsTotal' : IDL.Nat,
60
+ 'downloadsInLast30Days' : IDL.Nat,
61
+ 'downloadsInLast7Days' : IDL.Nat,
62
+ 'config' : PackageConfigV2__1,
63
+ 'publication' : PackagePublication,
64
+ });
65
+ const DownloadsSnapshot = IDL.Record({
66
+ 'startTime' : Time,
67
+ 'endTime' : Time,
68
+ 'downloads' : IDL.Nat,
69
+ });
49
70
  const PackageDetails = IDL.Record({
50
71
  'owner' : IDL.Principal,
72
+ 'deps' : IDL.Vec(PackageSummary__1),
51
73
  'downloadsTotal' : IDL.Nat,
52
74
  'downloadsInLast30Days' : IDL.Nat,
75
+ 'downloadTrend' : IDL.Vec(DownloadsSnapshot),
76
+ 'versionHistory' : IDL.Vec(PackageSummary__1),
77
+ 'dependents' : IDL.Vec(PackageSummary__1),
78
+ 'devDeps' : IDL.Vec(PackageSummary__1),
53
79
  'downloadsInLast7Days' : IDL.Nat,
54
80
  'config' : PackageConfigV2__1,
55
81
  'publication' : PackagePublication,
@@ -92,24 +118,24 @@ export const idlFactory = ({ IDL }) => {
92
118
  ),
93
119
  'getDownloadTrendByPackageId' : IDL.Func(
94
120
  [PackageId],
95
- [IDL.Vec(Snapshot)],
121
+ [IDL.Vec(DownloadsSnapshot__1)],
96
122
  ['query'],
97
123
  ),
98
124
  'getDownloadTrendByPackageName' : IDL.Func(
99
125
  [PackageName__1],
100
- [IDL.Vec(Snapshot)],
126
+ [IDL.Vec(DownloadsSnapshot__1)],
101
127
  ['query'],
102
128
  ),
103
129
  'getFileIds' : IDL.Func([PackageName__1, Ver], [Result_5], ['query']),
104
130
  'getHighestVersion' : IDL.Func([PackageName__1], [Result_4], ['query']),
105
131
  'getMostDownloadedPackages' : IDL.Func(
106
132
  [],
107
- [IDL.Vec(PackageDetails)],
133
+ [IDL.Vec(PackageSummary)],
108
134
  ['query'],
109
135
  ),
110
136
  'getMostDownloadedPackagesIn7Days' : IDL.Func(
111
137
  [],
112
- [IDL.Vec(PackageDetails)],
138
+ [IDL.Vec(PackageSummary)],
113
139
  ['query'],
114
140
  ),
115
141
  'getPackageDetails' : IDL.Func(
@@ -119,7 +145,7 @@ export const idlFactory = ({ IDL }) => {
119
145
  ),
120
146
  'getRecentlyUpdatedPackages' : IDL.Func(
121
147
  [],
122
- [IDL.Vec(PackageDetails)],
148
+ [IDL.Vec(PackageSummary)],
123
149
  ['query'],
124
150
  ),
125
151
  'getStoragesStats' : IDL.Func(
@@ -130,7 +156,7 @@ export const idlFactory = ({ IDL }) => {
130
156
  'getTotalDownloads' : IDL.Func([], [IDL.Nat], ['query']),
131
157
  'getTotalPackages' : IDL.Func([], [IDL.Nat], ['query']),
132
158
  'notifyInstall' : IDL.Func([PackageName__1, Ver], [], ['oneway']),
133
- 'search' : IDL.Func([Text], [IDL.Vec(PackageDetails)], ['query']),
159
+ 'search' : IDL.Func([Text], [IDL.Vec(PackageSummary)], ['query']),
134
160
  'startFileUpload' : IDL.Func(
135
161
  [PublishingId, Text, IDL.Nat, IDL.Vec(IDL.Nat8)],
136
162
  [Result_2],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "0.8.8",
3
+ "version": "0.8.10",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mops": "cli.js"
@@ -1,6 +1,11 @@
1
1
  name: mops test
2
2
 
3
- on: [push, pull_request]
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - master
8
+ pull_request:
4
9
 
5
10
  jobs:
6
11
  test: