ic-mops 0.41.0 → 0.41.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/bundle/bin/mops.js +0 -0
- package/bundle/cli.js +29 -29
- package/bundle/cli.tgz +0 -0
- package/bundle/declarations/bench/bench.did.d.ts +1 -1
- package/bundle/declarations/bench/index.js +1 -2
- package/bundle/declarations/main/index.js +1 -2
- package/bundle/declarations/main/main.did +15 -8
- package/bundle/declarations/main/main.did.d.ts +12 -9
- package/bundle/declarations/main/main.did.js +11 -8
- package/bundle-package-json.ts +3 -0
- package/check-requirements.ts +50 -0
- package/commands/add.ts +4 -0
- package/commands/install-all.ts +2 -0
- package/commands/publish.ts +17 -3
- package/commands/toolchain/index.ts +7 -0
- package/declarations/bench/bench.did.d.ts +1 -1
- package/declarations/bench/index.js +1 -2
- package/declarations/main/index.js +1 -2
- package/declarations/main/main.did +15 -8
- package/declarations/main/main.did.d.ts +12 -9
- package/declarations/main/main.did.js +11 -8
- package/dist/bin/mops.js +0 -0
- package/dist/bundle-package-json.js +2 -0
- package/dist/check-requirements.js +9 -4
- package/dist/commands/add.js +2 -0
- package/dist/commands/install-all.js +2 -0
- package/dist/commands/publish.js +13 -1
- package/dist/commands/toolchain/index.js +5 -0
- package/dist/declarations/bench/bench.did.d.ts +1 -1
- package/dist/declarations/bench/index.js +1 -2
- package/dist/declarations/main/index.js +1 -2
- package/dist/declarations/main/main.did +15 -8
- package/dist/declarations/main/main.did.d.ts +12 -9
- package/dist/declarations/main/main.did.js +11 -8
- package/dist/mops.js +8 -1
- package/dist/package.json +3 -3
- package/dist/release-cli.js +4 -0
- package/dist/types.d.ts +4 -0
- package/mops.ts +10 -1
- package/package.json +3 -3
- package/release-cli.ts +5 -0
- package/types.ts +7 -2
|
@@ -117,7 +117,7 @@ export interface Main {
|
|
|
117
117
|
[PublishingId, Text, bigint, Uint8Array | number[]],
|
|
118
118
|
Result_3
|
|
119
119
|
>,
|
|
120
|
-
'startPublish' : ActorMethod<[
|
|
120
|
+
'startPublish' : ActorMethod<[PackageConfigV3_Publishing], Result_2>,
|
|
121
121
|
'transferOwnership' : ActorMethod<[PackageName, Principal], Result_1>,
|
|
122
122
|
'transformRequest' : ActorMethod<[HttpTransformArg], HttpResponse>,
|
|
123
123
|
'uploadBenchmarks' : ActorMethod<[PublishingId, Benchmarks], Result>,
|
|
@@ -136,7 +136,7 @@ export interface PackageChanges {
|
|
|
136
136
|
'notes' : string,
|
|
137
137
|
'devDeps' : Array<DepChange>,
|
|
138
138
|
}
|
|
139
|
-
export interface
|
|
139
|
+
export interface PackageConfigV3 {
|
|
140
140
|
'dfx' : string,
|
|
141
141
|
'moc' : string,
|
|
142
142
|
'scripts' : Array<Script>,
|
|
@@ -151,10 +151,11 @@ export interface PackageConfigV2 {
|
|
|
151
151
|
'devDependencies' : Array<DependencyV2>,
|
|
152
152
|
'repository' : string,
|
|
153
153
|
'dependencies' : Array<DependencyV2>,
|
|
154
|
+
'requirements' : Array<Requirement>,
|
|
154
155
|
'license' : string,
|
|
155
156
|
'readme' : string,
|
|
156
157
|
}
|
|
157
|
-
export interface
|
|
158
|
+
export interface PackageConfigV3_Publishing {
|
|
158
159
|
'dfx' : string,
|
|
159
160
|
'moc' : string,
|
|
160
161
|
'scripts' : Array<Script>,
|
|
@@ -169,6 +170,7 @@ export interface PackageConfigV2__1 {
|
|
|
169
170
|
'devDependencies' : Array<DependencyV2>,
|
|
170
171
|
'repository' : string,
|
|
171
172
|
'dependencies' : Array<DependencyV2>,
|
|
173
|
+
'requirements' : [] | [Array<Requirement>],
|
|
172
174
|
'license' : string,
|
|
173
175
|
'readme' : string,
|
|
174
176
|
}
|
|
@@ -187,7 +189,7 @@ export interface PackageDetails {
|
|
|
187
189
|
'dependents' : Array<PackageSummary__1>,
|
|
188
190
|
'devDeps' : Array<PackageSummary__1>,
|
|
189
191
|
'downloadsInLast7Days' : bigint,
|
|
190
|
-
'config' :
|
|
192
|
+
'config' : PackageConfigV3,
|
|
191
193
|
'changes' : PackageChanges,
|
|
192
194
|
'publication' : PackagePublication,
|
|
193
195
|
}
|
|
@@ -220,7 +222,7 @@ export interface PackageSummary {
|
|
|
220
222
|
'downloadsTotal' : bigint,
|
|
221
223
|
'downloadsInLast30Days' : bigint,
|
|
222
224
|
'downloadsInLast7Days' : bigint,
|
|
223
|
-
'config' :
|
|
225
|
+
'config' : PackageConfigV3,
|
|
224
226
|
'publication' : PackagePublication,
|
|
225
227
|
}
|
|
226
228
|
export interface PackageSummaryWithChanges {
|
|
@@ -230,7 +232,7 @@ export interface PackageSummaryWithChanges {
|
|
|
230
232
|
'downloadsTotal' : bigint,
|
|
231
233
|
'downloadsInLast30Days' : bigint,
|
|
232
234
|
'downloadsInLast7Days' : bigint,
|
|
233
|
-
'config' :
|
|
235
|
+
'config' : PackageConfigV3,
|
|
234
236
|
'changes' : PackageChanges,
|
|
235
237
|
'publication' : PackagePublication,
|
|
236
238
|
}
|
|
@@ -241,7 +243,7 @@ export interface PackageSummaryWithChanges__1 {
|
|
|
241
243
|
'downloadsTotal' : bigint,
|
|
242
244
|
'downloadsInLast30Days' : bigint,
|
|
243
245
|
'downloadsInLast7Days' : bigint,
|
|
244
|
-
'config' :
|
|
246
|
+
'config' : PackageConfigV3,
|
|
245
247
|
'changes' : PackageChanges,
|
|
246
248
|
'publication' : PackagePublication,
|
|
247
249
|
}
|
|
@@ -252,7 +254,7 @@ export interface PackageSummary__1 {
|
|
|
252
254
|
'downloadsTotal' : bigint,
|
|
253
255
|
'downloadsInLast30Days' : bigint,
|
|
254
256
|
'downloadsInLast7Days' : bigint,
|
|
255
|
-
'config' :
|
|
257
|
+
'config' : PackageConfigV3,
|
|
256
258
|
'publication' : PackagePublication,
|
|
257
259
|
}
|
|
258
260
|
export type PackageVersion = string;
|
|
@@ -265,6 +267,7 @@ export interface Request {
|
|
|
265
267
|
'headers' : Array<Header>,
|
|
266
268
|
'certificate_version' : [] | [number],
|
|
267
269
|
}
|
|
270
|
+
export interface Requirement { 'value' : string, 'name' : string }
|
|
268
271
|
export interface Response {
|
|
269
272
|
'body' : Uint8Array | number[],
|
|
270
273
|
'headers' : Array<Header>,
|
|
@@ -349,4 +352,4 @@ export interface User__1 {
|
|
|
349
352
|
}
|
|
350
353
|
export interface _SERVICE extends Main {}
|
|
351
354
|
export declare const idlFactory: IDL.InterfaceFactory;
|
|
352
|
-
export declare const init: (
|
|
355
|
+
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|
|
@@ -62,7 +62,8 @@ export const idlFactory = ({ IDL }) => {
|
|
|
62
62
|
'repo' : IDL.Text,
|
|
63
63
|
'version' : IDL.Text,
|
|
64
64
|
});
|
|
65
|
-
const
|
|
65
|
+
const Requirement = IDL.Record({ 'value' : IDL.Text, 'name' : IDL.Text });
|
|
66
|
+
const PackageConfigV3 = IDL.Record({
|
|
66
67
|
'dfx' : IDL.Text,
|
|
67
68
|
'moc' : IDL.Text,
|
|
68
69
|
'scripts' : IDL.Vec(Script),
|
|
@@ -77,6 +78,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
77
78
|
'devDependencies' : IDL.Vec(DependencyV2),
|
|
78
79
|
'repository' : IDL.Text,
|
|
79
80
|
'dependencies' : IDL.Vec(DependencyV2),
|
|
81
|
+
'requirements' : IDL.Vec(Requirement),
|
|
80
82
|
'license' : IDL.Text,
|
|
81
83
|
'readme' : IDL.Text,
|
|
82
84
|
});
|
|
@@ -92,7 +94,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
92
94
|
'downloadsTotal' : IDL.Nat,
|
|
93
95
|
'downloadsInLast30Days' : IDL.Nat,
|
|
94
96
|
'downloadsInLast7Days' : IDL.Nat,
|
|
95
|
-
'config' :
|
|
97
|
+
'config' : PackageConfigV3,
|
|
96
98
|
'publication' : PackagePublication,
|
|
97
99
|
});
|
|
98
100
|
const BenchmarkMetric = IDL.Text;
|
|
@@ -118,7 +120,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
118
120
|
'downloadsTotal' : IDL.Nat,
|
|
119
121
|
'downloadsInLast30Days' : IDL.Nat,
|
|
120
122
|
'downloadsInLast7Days' : IDL.Nat,
|
|
121
|
-
'config' :
|
|
123
|
+
'config' : PackageConfigV3,
|
|
122
124
|
'publication' : PackagePublication,
|
|
123
125
|
});
|
|
124
126
|
const TestStats__1 = IDL.Record({
|
|
@@ -158,7 +160,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
158
160
|
'downloadsTotal' : IDL.Nat,
|
|
159
161
|
'downloadsInLast30Days' : IDL.Nat,
|
|
160
162
|
'downloadsInLast7Days' : IDL.Nat,
|
|
161
|
-
'config' :
|
|
163
|
+
'config' : PackageConfigV3,
|
|
162
164
|
'changes' : PackageChanges,
|
|
163
165
|
'publication' : PackagePublication,
|
|
164
166
|
});
|
|
@@ -177,7 +179,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
177
179
|
'dependents' : IDL.Vec(PackageSummary__1),
|
|
178
180
|
'devDeps' : IDL.Vec(PackageSummary__1),
|
|
179
181
|
'downloadsInLast7Days' : IDL.Nat,
|
|
180
|
-
'config' :
|
|
182
|
+
'config' : PackageConfigV3,
|
|
181
183
|
'changes' : PackageChanges,
|
|
182
184
|
'publication' : PackagePublication,
|
|
183
185
|
});
|
|
@@ -189,7 +191,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
189
191
|
'downloadsTotal' : IDL.Nat,
|
|
190
192
|
'downloadsInLast30Days' : IDL.Nat,
|
|
191
193
|
'downloadsInLast7Days' : IDL.Nat,
|
|
192
|
-
'config' :
|
|
194
|
+
'config' : PackageConfigV3,
|
|
193
195
|
'changes' : PackageChanges,
|
|
194
196
|
'publication' : PackagePublication,
|
|
195
197
|
});
|
|
@@ -245,7 +247,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
245
247
|
const PageCount = IDL.Nat;
|
|
246
248
|
const Result_1 = IDL.Variant({ 'ok' : IDL.Null, 'err' : IDL.Text });
|
|
247
249
|
const Result_3 = IDL.Variant({ 'ok' : FileId, 'err' : Err });
|
|
248
|
-
const
|
|
250
|
+
const PackageConfigV3_Publishing = IDL.Record({
|
|
249
251
|
'dfx' : IDL.Text,
|
|
250
252
|
'moc' : IDL.Text,
|
|
251
253
|
'scripts' : IDL.Vec(Script),
|
|
@@ -260,6 +262,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
260
262
|
'devDependencies' : IDL.Vec(DependencyV2),
|
|
261
263
|
'repository' : IDL.Text,
|
|
262
264
|
'dependencies' : IDL.Vec(DependencyV2),
|
|
265
|
+
'requirements' : IDL.Opt(IDL.Vec(Requirement)),
|
|
263
266
|
'license' : IDL.Text,
|
|
264
267
|
'readme' : IDL.Text,
|
|
265
268
|
});
|
|
@@ -379,7 +382,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
379
382
|
[Result_3],
|
|
380
383
|
[],
|
|
381
384
|
),
|
|
382
|
-
'startPublish' : IDL.Func([
|
|
385
|
+
'startPublish' : IDL.Func([PackageConfigV3_Publishing], [Result_2], []),
|
|
383
386
|
'transferOwnership' : IDL.Func(
|
|
384
387
|
[PackageName, IDL.Principal],
|
|
385
388
|
[Result_1],
|
package/dist/bin/mops.js
CHANGED
|
File without changes
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
2
2
|
let packageJson = JSON.parse(readFileSync('./bundle/package.json', 'utf8'));
|
|
3
|
+
packageJson.bin.mops = 'bin/mops.js';
|
|
4
|
+
packageJson.bin['ic-mops'] = 'bin/mops.js';
|
|
3
5
|
delete packageJson.scripts;
|
|
4
6
|
delete packageJson.devDependencies;
|
|
5
7
|
delete packageJson.overrides;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import { getDependencyType, readConfig } from './mops.js';
|
|
3
|
-
import { resolvePackages } from './resolve-packages.js';
|
|
4
2
|
import { SemVer } from 'semver';
|
|
5
3
|
import chalk from 'chalk';
|
|
4
|
+
import { getDependencyType, readConfig } from './mops.js';
|
|
5
|
+
import { resolvePackages } from './resolve-packages.js';
|
|
6
|
+
import { getMocVersion } from './helpers/get-moc-version.js';
|
|
6
7
|
export async function checkRequirements({ verbose = false } = {}) {
|
|
7
8
|
let config = readConfig();
|
|
8
|
-
|
|
9
|
+
let mocVersion = config.toolchain?.moc;
|
|
10
|
+
if (!mocVersion) {
|
|
11
|
+
mocVersion = getMocVersion();
|
|
12
|
+
}
|
|
13
|
+
if (!mocVersion) {
|
|
9
14
|
return;
|
|
10
15
|
}
|
|
11
|
-
let installedMoc = new SemVer(
|
|
16
|
+
let installedMoc = new SemVer(mocVersion);
|
|
12
17
|
let highestRequiredMoc = new SemVer('0.0.0');
|
|
13
18
|
let highestRequiredMocPkgId = '';
|
|
14
19
|
let resolvedPackages = await resolvePackages();
|
package/dist/commands/add.js
CHANGED
|
@@ -7,6 +7,7 @@ import { installFromGithub } from '../vessel.js';
|
|
|
7
7
|
import { install } from './install.js';
|
|
8
8
|
import { notifyInstalls } from '../notify-installs.js';
|
|
9
9
|
import { checkIntegrity } from '../integrity.js';
|
|
10
|
+
import { checkRequirements } from '../check-requirements.js';
|
|
10
11
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11
12
|
export async function add(name, { verbose = false, dev = false, lock } = {}, asName) {
|
|
12
13
|
if (!checkConfigFile()) {
|
|
@@ -100,5 +101,6 @@ export async function add(name, { verbose = false, dev = false, lock } = {}, asN
|
|
|
100
101
|
checkIntegrity(lock),
|
|
101
102
|
]);
|
|
102
103
|
logUpdate.clear();
|
|
104
|
+
await checkRequirements({ verbose });
|
|
103
105
|
console.log(chalk.green('Package installed ') + `${pkgDetails.name} = "${pkgDetails.repo || pkgDetails.path || pkgDetails.version}"`);
|
|
104
106
|
}
|
|
@@ -7,6 +7,7 @@ import { installFromGithub } from '../vessel.js';
|
|
|
7
7
|
import { notifyInstalls } from '../notify-installs.js';
|
|
8
8
|
import { checkIntegrity } from '../integrity.js';
|
|
9
9
|
import { installLocal } from './install-local.js';
|
|
10
|
+
import { checkRequirements } from '../check-requirements.js';
|
|
10
11
|
export async function installAll({ verbose = false, silent = false, lock } = {}) {
|
|
11
12
|
if (!checkConfigFile()) {
|
|
12
13
|
return;
|
|
@@ -38,6 +39,7 @@ export async function installAll({ verbose = false, silent = false, lock } = {})
|
|
|
38
39
|
]);
|
|
39
40
|
if (!silent) {
|
|
40
41
|
logUpdate.clear();
|
|
42
|
+
await checkRequirements();
|
|
41
43
|
console.log(chalk.green('Packages installed'));
|
|
42
44
|
}
|
|
43
45
|
}
|
package/dist/commands/publish.js
CHANGED
|
@@ -22,7 +22,7 @@ export async function publish(options = {}) {
|
|
|
22
22
|
console.log(`Publishing ${config.package?.name}@${config.package?.version}`);
|
|
23
23
|
// validate
|
|
24
24
|
for (let key of Object.keys(config)) {
|
|
25
|
-
if (!['package', 'dependencies', 'dev-dependencies', 'toolchain'].includes(key)) {
|
|
25
|
+
if (!['package', 'dependencies', 'dev-dependencies', 'toolchain', 'requirements'].includes(key)) {
|
|
26
26
|
console.log(chalk.red('Error: ') + `Unknown config section [${key}]`);
|
|
27
27
|
process.exit(1);
|
|
28
28
|
}
|
|
@@ -141,6 +141,14 @@ export async function publish(options = {}) {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
+
if (config.requirements) {
|
|
145
|
+
Object.keys(config.requirements).forEach((name) => {
|
|
146
|
+
if (name !== 'moc') {
|
|
147
|
+
console.log(chalk.red('Error: ') + `Unknown requirement "${name}"`);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
144
152
|
let toBackendDep = (dep) => {
|
|
145
153
|
return {
|
|
146
154
|
...dep,
|
|
@@ -148,6 +156,9 @@ export async function publish(options = {}) {
|
|
|
148
156
|
repo: dep.repo || '',
|
|
149
157
|
};
|
|
150
158
|
};
|
|
159
|
+
let toBackendReq = ([name, value]) => {
|
|
160
|
+
return { name, value };
|
|
161
|
+
};
|
|
151
162
|
// map fields
|
|
152
163
|
let backendPkgConfig = {
|
|
153
164
|
name: config.package.name,
|
|
@@ -166,6 +177,7 @@ export async function publish(options = {}) {
|
|
|
166
177
|
dependencies: Object.values(config.dependencies || {}).map(toBackendDep),
|
|
167
178
|
devDependencies: Object.values(config['dev-dependencies'] || {}).map(toBackendDep),
|
|
168
179
|
scripts: [],
|
|
180
|
+
requirements: [Object.entries(config.requirements || {}).map((req) => toBackendReq(req))],
|
|
169
181
|
};
|
|
170
182
|
let defaultFiles = [
|
|
171
183
|
'mops.toml',
|
|
@@ -6,6 +6,7 @@ import chalk from 'chalk';
|
|
|
6
6
|
import prompts from 'prompts';
|
|
7
7
|
import { createLogUpdate } from 'log-update';
|
|
8
8
|
import { checkConfigFile, getClosestConfigFile, getRootDir, globalCacheDir, readConfig, writeConfig } from '../../mops.js';
|
|
9
|
+
import { checkRequirements } from '../../check-requirements.js';
|
|
9
10
|
import * as moc from './moc.js';
|
|
10
11
|
import * as pocketIc from './pocket-ic.js';
|
|
11
12
|
import * as wasmtime from './wasmtime.js';
|
|
@@ -204,6 +205,7 @@ async function use(tool, version) {
|
|
|
204
205
|
let oldVersion = config.toolchain[tool];
|
|
205
206
|
config.toolchain[tool] = version;
|
|
206
207
|
writeConfig(config);
|
|
208
|
+
await checkRequirements();
|
|
207
209
|
if (oldVersion === version) {
|
|
208
210
|
console.log((`${tool} ${version} is already installed`));
|
|
209
211
|
}
|
|
@@ -230,6 +232,9 @@ async function update(tool) {
|
|
|
230
232
|
let oldVersion = config.toolchain[tool];
|
|
231
233
|
config.toolchain[tool] = version;
|
|
232
234
|
writeConfig(config);
|
|
235
|
+
if (tool === 'moc') {
|
|
236
|
+
await checkRequirements();
|
|
237
|
+
}
|
|
233
238
|
if (oldVersion === version) {
|
|
234
239
|
console.log((`Latest ${tool} ${version} is already installed`));
|
|
235
240
|
}
|
|
@@ -26,4 +26,4 @@ export interface anon_class_10_1 {
|
|
|
26
26
|
}
|
|
27
27
|
export interface _SERVICE extends anon_class_10_1 {}
|
|
28
28
|
export declare const idlFactory: IDL.InterfaceFactory;
|
|
29
|
-
export declare const init: (
|
|
29
|
+
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|
|
@@ -10,8 +10,7 @@ export { idlFactory } from "./bench.did.js";
|
|
|
10
10
|
* beginning in dfx 0.15.0
|
|
11
11
|
*/
|
|
12
12
|
export const canisterId =
|
|
13
|
-
process.env.CANISTER_ID_BENCH
|
|
14
|
-
process.env.BENCH_CANISTER_ID;
|
|
13
|
+
process.env.CANISTER_ID_BENCH;
|
|
15
14
|
|
|
16
15
|
export const createActor = (canisterId, options = {}) => {
|
|
17
16
|
const agent = options.agent || new HttpAgent({ ...options.agentOptions });
|
|
@@ -10,8 +10,7 @@ export { idlFactory } from "./main.did.js";
|
|
|
10
10
|
* beginning in dfx 0.15.0
|
|
11
11
|
*/
|
|
12
12
|
export const canisterId =
|
|
13
|
-
process.env.CANISTER_ID_MAIN
|
|
14
|
-
process.env.MAIN_CANISTER_ID;
|
|
13
|
+
process.env.CANISTER_ID_MAIN;
|
|
15
14
|
|
|
16
15
|
export const createActor = (canisterId, options = {}) => {
|
|
17
16
|
const agent = options.agent || new HttpAgent({ ...options.agentOptions });
|
|
@@ -132,6 +132,11 @@ type Response =
|
|
|
132
132
|
streaming_strategy: opt StreamingStrategy;
|
|
133
133
|
upgrade: opt bool;
|
|
134
134
|
};
|
|
135
|
+
type Requirement =
|
|
136
|
+
record {
|
|
137
|
+
name: text;
|
|
138
|
+
value: text;
|
|
139
|
+
};
|
|
135
140
|
type Request =
|
|
136
141
|
record {
|
|
137
142
|
body: blob;
|
|
@@ -145,7 +150,7 @@ type PageCount = nat;
|
|
|
145
150
|
type PackageVersion = text;
|
|
146
151
|
type PackageSummary__1 =
|
|
147
152
|
record {
|
|
148
|
-
config:
|
|
153
|
+
config: PackageConfigV3;
|
|
149
154
|
downloadsInLast30Days: nat;
|
|
150
155
|
downloadsInLast7Days: nat;
|
|
151
156
|
downloadsTotal: nat;
|
|
@@ -157,7 +162,7 @@ type PackageSummary__1 =
|
|
|
157
162
|
type PackageSummaryWithChanges__1 =
|
|
158
163
|
record {
|
|
159
164
|
changes: PackageChanges;
|
|
160
|
-
config:
|
|
165
|
+
config: PackageConfigV3;
|
|
161
166
|
downloadsInLast30Days: nat;
|
|
162
167
|
downloadsInLast7Days: nat;
|
|
163
168
|
downloadsTotal: nat;
|
|
@@ -169,7 +174,7 @@ type PackageSummaryWithChanges__1 =
|
|
|
169
174
|
type PackageSummaryWithChanges =
|
|
170
175
|
record {
|
|
171
176
|
changes: PackageChanges;
|
|
172
|
-
config:
|
|
177
|
+
config: PackageConfigV3;
|
|
173
178
|
downloadsInLast30Days: nat;
|
|
174
179
|
downloadsInLast7Days: nat;
|
|
175
180
|
downloadsTotal: nat;
|
|
@@ -180,7 +185,7 @@ type PackageSummaryWithChanges =
|
|
|
180
185
|
};
|
|
181
186
|
type PackageSummary =
|
|
182
187
|
record {
|
|
183
|
-
config:
|
|
188
|
+
config: PackageConfigV3;
|
|
184
189
|
downloadsInLast30Days: nat;
|
|
185
190
|
downloadsInLast7Days: nat;
|
|
186
191
|
downloadsTotal: nat;
|
|
@@ -218,7 +223,7 @@ type PackageDetails =
|
|
|
218
223
|
record {
|
|
219
224
|
benchmarks: Benchmarks__1;
|
|
220
225
|
changes: PackageChanges;
|
|
221
|
-
config:
|
|
226
|
+
config: PackageConfigV3;
|
|
222
227
|
dependents: vec PackageSummary__1;
|
|
223
228
|
deps: vec PackageSummary__1;
|
|
224
229
|
devDeps: vec PackageSummary__1;
|
|
@@ -234,7 +239,7 @@ type PackageDetails =
|
|
|
234
239
|
testStats: TestStats__1;
|
|
235
240
|
versionHistory: vec PackageSummaryWithChanges__1;
|
|
236
241
|
};
|
|
237
|
-
type
|
|
242
|
+
type PackageConfigV3_Publishing =
|
|
238
243
|
record {
|
|
239
244
|
baseDir: text;
|
|
240
245
|
dependencies: vec DependencyV2;
|
|
@@ -250,10 +255,11 @@ type PackageConfigV2__1 =
|
|
|
250
255
|
name: PackageName__1;
|
|
251
256
|
readme: text;
|
|
252
257
|
repository: text;
|
|
258
|
+
requirements: opt vec Requirement;
|
|
253
259
|
scripts: vec Script;
|
|
254
260
|
version: text;
|
|
255
261
|
};
|
|
256
|
-
type
|
|
262
|
+
type PackageConfigV3 =
|
|
257
263
|
record {
|
|
258
264
|
baseDir: text;
|
|
259
265
|
dependencies: vec DependencyV2;
|
|
@@ -269,6 +275,7 @@ type PackageConfigV2 =
|
|
|
269
275
|
name: PackageName__1;
|
|
270
276
|
readme: text;
|
|
271
277
|
repository: text;
|
|
278
|
+
requirements: vec Requirement;
|
|
272
279
|
scripts: vec Script;
|
|
273
280
|
version: text;
|
|
274
281
|
};
|
|
@@ -341,7 +348,7 @@ type Main =
|
|
|
341
348
|
search: (Text, opt nat, opt nat) -> (vec PackageSummary, PageCount) query;
|
|
342
349
|
setUserProp: (text, text) -> (Result_1);
|
|
343
350
|
startFileUpload: (PublishingId, Text, nat, blob) -> (Result_3);
|
|
344
|
-
startPublish: (
|
|
351
|
+
startPublish: (PackageConfigV3_Publishing) -> (Result_2);
|
|
345
352
|
transferOwnership: (PackageName, principal) -> (Result_1);
|
|
346
353
|
transformRequest: (HttpTransformArg) -> (HttpResponse) query;
|
|
347
354
|
uploadBenchmarks: (PublishingId, Benchmarks) -> (Result);
|
|
@@ -117,7 +117,7 @@ export interface Main {
|
|
|
117
117
|
[PublishingId, Text, bigint, Uint8Array | number[]],
|
|
118
118
|
Result_3
|
|
119
119
|
>,
|
|
120
|
-
'startPublish' : ActorMethod<[
|
|
120
|
+
'startPublish' : ActorMethod<[PackageConfigV3_Publishing], Result_2>,
|
|
121
121
|
'transferOwnership' : ActorMethod<[PackageName, Principal], Result_1>,
|
|
122
122
|
'transformRequest' : ActorMethod<[HttpTransformArg], HttpResponse>,
|
|
123
123
|
'uploadBenchmarks' : ActorMethod<[PublishingId, Benchmarks], Result>,
|
|
@@ -136,7 +136,7 @@ export interface PackageChanges {
|
|
|
136
136
|
'notes' : string,
|
|
137
137
|
'devDeps' : Array<DepChange>,
|
|
138
138
|
}
|
|
139
|
-
export interface
|
|
139
|
+
export interface PackageConfigV3 {
|
|
140
140
|
'dfx' : string,
|
|
141
141
|
'moc' : string,
|
|
142
142
|
'scripts' : Array<Script>,
|
|
@@ -151,10 +151,11 @@ export interface PackageConfigV2 {
|
|
|
151
151
|
'devDependencies' : Array<DependencyV2>,
|
|
152
152
|
'repository' : string,
|
|
153
153
|
'dependencies' : Array<DependencyV2>,
|
|
154
|
+
'requirements' : Array<Requirement>,
|
|
154
155
|
'license' : string,
|
|
155
156
|
'readme' : string,
|
|
156
157
|
}
|
|
157
|
-
export interface
|
|
158
|
+
export interface PackageConfigV3_Publishing {
|
|
158
159
|
'dfx' : string,
|
|
159
160
|
'moc' : string,
|
|
160
161
|
'scripts' : Array<Script>,
|
|
@@ -169,6 +170,7 @@ export interface PackageConfigV2__1 {
|
|
|
169
170
|
'devDependencies' : Array<DependencyV2>,
|
|
170
171
|
'repository' : string,
|
|
171
172
|
'dependencies' : Array<DependencyV2>,
|
|
173
|
+
'requirements' : [] | [Array<Requirement>],
|
|
172
174
|
'license' : string,
|
|
173
175
|
'readme' : string,
|
|
174
176
|
}
|
|
@@ -187,7 +189,7 @@ export interface PackageDetails {
|
|
|
187
189
|
'dependents' : Array<PackageSummary__1>,
|
|
188
190
|
'devDeps' : Array<PackageSummary__1>,
|
|
189
191
|
'downloadsInLast7Days' : bigint,
|
|
190
|
-
'config' :
|
|
192
|
+
'config' : PackageConfigV3,
|
|
191
193
|
'changes' : PackageChanges,
|
|
192
194
|
'publication' : PackagePublication,
|
|
193
195
|
}
|
|
@@ -220,7 +222,7 @@ export interface PackageSummary {
|
|
|
220
222
|
'downloadsTotal' : bigint,
|
|
221
223
|
'downloadsInLast30Days' : bigint,
|
|
222
224
|
'downloadsInLast7Days' : bigint,
|
|
223
|
-
'config' :
|
|
225
|
+
'config' : PackageConfigV3,
|
|
224
226
|
'publication' : PackagePublication,
|
|
225
227
|
}
|
|
226
228
|
export interface PackageSummaryWithChanges {
|
|
@@ -230,7 +232,7 @@ export interface PackageSummaryWithChanges {
|
|
|
230
232
|
'downloadsTotal' : bigint,
|
|
231
233
|
'downloadsInLast30Days' : bigint,
|
|
232
234
|
'downloadsInLast7Days' : bigint,
|
|
233
|
-
'config' :
|
|
235
|
+
'config' : PackageConfigV3,
|
|
234
236
|
'changes' : PackageChanges,
|
|
235
237
|
'publication' : PackagePublication,
|
|
236
238
|
}
|
|
@@ -241,7 +243,7 @@ export interface PackageSummaryWithChanges__1 {
|
|
|
241
243
|
'downloadsTotal' : bigint,
|
|
242
244
|
'downloadsInLast30Days' : bigint,
|
|
243
245
|
'downloadsInLast7Days' : bigint,
|
|
244
|
-
'config' :
|
|
246
|
+
'config' : PackageConfigV3,
|
|
245
247
|
'changes' : PackageChanges,
|
|
246
248
|
'publication' : PackagePublication,
|
|
247
249
|
}
|
|
@@ -252,7 +254,7 @@ export interface PackageSummary__1 {
|
|
|
252
254
|
'downloadsTotal' : bigint,
|
|
253
255
|
'downloadsInLast30Days' : bigint,
|
|
254
256
|
'downloadsInLast7Days' : bigint,
|
|
255
|
-
'config' :
|
|
257
|
+
'config' : PackageConfigV3,
|
|
256
258
|
'publication' : PackagePublication,
|
|
257
259
|
}
|
|
258
260
|
export type PackageVersion = string;
|
|
@@ -265,6 +267,7 @@ export interface Request {
|
|
|
265
267
|
'headers' : Array<Header>,
|
|
266
268
|
'certificate_version' : [] | [number],
|
|
267
269
|
}
|
|
270
|
+
export interface Requirement { 'value' : string, 'name' : string }
|
|
268
271
|
export interface Response {
|
|
269
272
|
'body' : Uint8Array | number[],
|
|
270
273
|
'headers' : Array<Header>,
|
|
@@ -349,4 +352,4 @@ export interface User__1 {
|
|
|
349
352
|
}
|
|
350
353
|
export interface _SERVICE extends Main {}
|
|
351
354
|
export declare const idlFactory: IDL.InterfaceFactory;
|
|
352
|
-
export declare const init: (
|
|
355
|
+
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|
|
@@ -62,7 +62,8 @@ export const idlFactory = ({ IDL }) => {
|
|
|
62
62
|
'repo' : IDL.Text,
|
|
63
63
|
'version' : IDL.Text,
|
|
64
64
|
});
|
|
65
|
-
const
|
|
65
|
+
const Requirement = IDL.Record({ 'value' : IDL.Text, 'name' : IDL.Text });
|
|
66
|
+
const PackageConfigV3 = IDL.Record({
|
|
66
67
|
'dfx' : IDL.Text,
|
|
67
68
|
'moc' : IDL.Text,
|
|
68
69
|
'scripts' : IDL.Vec(Script),
|
|
@@ -77,6 +78,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
77
78
|
'devDependencies' : IDL.Vec(DependencyV2),
|
|
78
79
|
'repository' : IDL.Text,
|
|
79
80
|
'dependencies' : IDL.Vec(DependencyV2),
|
|
81
|
+
'requirements' : IDL.Vec(Requirement),
|
|
80
82
|
'license' : IDL.Text,
|
|
81
83
|
'readme' : IDL.Text,
|
|
82
84
|
});
|
|
@@ -92,7 +94,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
92
94
|
'downloadsTotal' : IDL.Nat,
|
|
93
95
|
'downloadsInLast30Days' : IDL.Nat,
|
|
94
96
|
'downloadsInLast7Days' : IDL.Nat,
|
|
95
|
-
'config' :
|
|
97
|
+
'config' : PackageConfigV3,
|
|
96
98
|
'publication' : PackagePublication,
|
|
97
99
|
});
|
|
98
100
|
const BenchmarkMetric = IDL.Text;
|
|
@@ -118,7 +120,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
118
120
|
'downloadsTotal' : IDL.Nat,
|
|
119
121
|
'downloadsInLast30Days' : IDL.Nat,
|
|
120
122
|
'downloadsInLast7Days' : IDL.Nat,
|
|
121
|
-
'config' :
|
|
123
|
+
'config' : PackageConfigV3,
|
|
122
124
|
'publication' : PackagePublication,
|
|
123
125
|
});
|
|
124
126
|
const TestStats__1 = IDL.Record({
|
|
@@ -158,7 +160,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
158
160
|
'downloadsTotal' : IDL.Nat,
|
|
159
161
|
'downloadsInLast30Days' : IDL.Nat,
|
|
160
162
|
'downloadsInLast7Days' : IDL.Nat,
|
|
161
|
-
'config' :
|
|
163
|
+
'config' : PackageConfigV3,
|
|
162
164
|
'changes' : PackageChanges,
|
|
163
165
|
'publication' : PackagePublication,
|
|
164
166
|
});
|
|
@@ -177,7 +179,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
177
179
|
'dependents' : IDL.Vec(PackageSummary__1),
|
|
178
180
|
'devDeps' : IDL.Vec(PackageSummary__1),
|
|
179
181
|
'downloadsInLast7Days' : IDL.Nat,
|
|
180
|
-
'config' :
|
|
182
|
+
'config' : PackageConfigV3,
|
|
181
183
|
'changes' : PackageChanges,
|
|
182
184
|
'publication' : PackagePublication,
|
|
183
185
|
});
|
|
@@ -189,7 +191,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
189
191
|
'downloadsTotal' : IDL.Nat,
|
|
190
192
|
'downloadsInLast30Days' : IDL.Nat,
|
|
191
193
|
'downloadsInLast7Days' : IDL.Nat,
|
|
192
|
-
'config' :
|
|
194
|
+
'config' : PackageConfigV3,
|
|
193
195
|
'changes' : PackageChanges,
|
|
194
196
|
'publication' : PackagePublication,
|
|
195
197
|
});
|
|
@@ -245,7 +247,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
245
247
|
const PageCount = IDL.Nat;
|
|
246
248
|
const Result_1 = IDL.Variant({ 'ok' : IDL.Null, 'err' : IDL.Text });
|
|
247
249
|
const Result_3 = IDL.Variant({ 'ok' : FileId, 'err' : Err });
|
|
248
|
-
const
|
|
250
|
+
const PackageConfigV3_Publishing = IDL.Record({
|
|
249
251
|
'dfx' : IDL.Text,
|
|
250
252
|
'moc' : IDL.Text,
|
|
251
253
|
'scripts' : IDL.Vec(Script),
|
|
@@ -260,6 +262,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
260
262
|
'devDependencies' : IDL.Vec(DependencyV2),
|
|
261
263
|
'repository' : IDL.Text,
|
|
262
264
|
'dependencies' : IDL.Vec(DependencyV2),
|
|
265
|
+
'requirements' : IDL.Opt(IDL.Vec(Requirement)),
|
|
263
266
|
'license' : IDL.Text,
|
|
264
267
|
'readme' : IDL.Text,
|
|
265
268
|
});
|
|
@@ -379,7 +382,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
379
382
|
[Result_3],
|
|
380
383
|
[],
|
|
381
384
|
),
|
|
382
|
-
'startPublish' : IDL.Func([
|
|
385
|
+
'startPublish' : IDL.Func([PackageConfigV3_Publishing], [Result_2], []),
|
|
383
386
|
'transferOwnership' : IDL.Func(
|
|
384
387
|
[PackageName, IDL.Principal],
|
|
385
388
|
[Result_1],
|
package/dist/mops.js
CHANGED
|
@@ -179,7 +179,14 @@ export function readConfig(configFile = getClosestConfigFile()) {
|
|
|
179
179
|
};
|
|
180
180
|
processDeps(toml.dependencies || {});
|
|
181
181
|
processDeps(toml['dev-dependencies'] || {});
|
|
182
|
-
|
|
182
|
+
let config = { ...toml };
|
|
183
|
+
Object.entries(config.requirements || {}).forEach(([name, value]) => {
|
|
184
|
+
if (name === 'moc') {
|
|
185
|
+
config.requirements = config.requirements || {};
|
|
186
|
+
config.requirements.moc = value;
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
return config;
|
|
183
190
|
}
|
|
184
191
|
export function writeConfig(config, configFile = getClosestConfigFile()) {
|
|
185
192
|
let resConfig = JSON.parse(JSON.stringify(config));
|
package/dist/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ic-mops",
|
|
3
|
-
"version": "0.41.
|
|
3
|
+
"version": "0.41.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
|
-
"mops": "bin/mops.js",
|
|
7
|
-
"ic-mops": "bin/mops.js",
|
|
6
|
+
"mops": "dist/bin/mops.js",
|
|
7
|
+
"ic-mops": "dist/bin/mops.js",
|
|
8
8
|
"moc-wrapper": "bin/moc-wrapper.sh"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
package/dist/release-cli.js
CHANGED
|
@@ -10,6 +10,10 @@ import { findChangelogEntry } from './helpers/find-changelog-entry.js';
|
|
|
10
10
|
let __dirname = new URL('.', import.meta.url).pathname;
|
|
11
11
|
execSync('npm run prepare', { stdio: 'inherit', cwd: __dirname });
|
|
12
12
|
execSync('npm run bundle', { stdio: 'inherit', cwd: __dirname });
|
|
13
|
+
// fix package.json paths
|
|
14
|
+
// let packageJson = fs.readFileSync(path.resolve(__dirname, 'bundle/package.json'), 'utf8');
|
|
15
|
+
// packageJson = packageJson.replaceAll('dist/', '');
|
|
16
|
+
// fs.writeFileSync(path.resolve(__dirname, 'bundle/package.json'), packageJson);
|
|
13
17
|
let version = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'package.json'), 'utf8')).version;
|
|
14
18
|
let major = semver.parse(version)?.major;
|
|
15
19
|
let tag = semver.parse(version)?.prerelease[0] || 'latest';
|