ic-mops 2.2.0 → 2.3.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/CHANGELOG.md +13 -0
- package/RELEASE.md +9 -1
- package/bundle/cli.tgz +0 -0
- package/cli.ts +25 -2
- package/commands/build.ts +2 -10
- package/commands/check-stable.ts +177 -0
- package/commands/check.ts +53 -6
- package/commands/toolchain/index.ts +4 -0
- package/dist/cli.js +22 -2
- package/dist/commands/build.js +2 -5
- package/dist/commands/check-stable.d.ts +14 -0
- package/dist/commands/check-stable.js +95 -0
- package/dist/commands/check.js +41 -6
- package/dist/commands/toolchain/index.js +3 -0
- package/dist/helpers/resolve-canisters.d.ts +7 -0
- package/dist/helpers/resolve-canisters.js +31 -0
- package/dist/mops.js +0 -4
- package/dist/package.json +6 -7
- package/dist/tests/check-fix.test.js +17 -0
- package/dist/tests/check-stable.test.d.ts +1 -0
- package/dist/tests/check-stable.test.js +51 -0
- package/dist/tests/check.test.js +54 -1
- package/dist/tests/moc-args.test.js +3 -3
- package/dist/tests/toolchain.test.js +11 -0
- package/dist/types.d.ts +5 -1
- package/helpers/resolve-canisters.ts +52 -0
- package/mops.ts +0 -6
- package/package.json +8 -9
- package/tests/README.md +16 -0
- package/tests/__snapshots__/check-fix.test.ts.snap +16 -10
- package/tests/__snapshots__/check-stable.test.ts.snap +29 -0
- package/tests/__snapshots__/check.test.ts.snap +26 -16
- package/tests/build/no-dfx/mops.toml +3 -0
- package/tests/build/no-dfx/src/Main.mo +1 -1
- package/tests/check/canisters/Ok.mo +5 -0
- package/tests/check/canisters/mops.toml +8 -0
- package/tests/check/canisters-error/Error.mo +7 -0
- package/tests/check/canisters-error/mops.toml +8 -0
- package/tests/check/canisters-moc-args/Warning.mo +5 -0
- package/tests/check/canisters-moc-args/mops.toml +8 -0
- package/tests/check/deployed-compatible/main.mo +4 -0
- package/tests/check/deployed-compatible/mops.toml +11 -0
- package/tests/check/deployed-compatible/old.mo +3 -0
- package/tests/check/deployed-compile-error/Error.mo +7 -0
- package/tests/check/deployed-compile-error/mops.toml +11 -0
- package/tests/check/deployed-compile-error/old.mo +3 -0
- package/tests/check/deployed-missing-error/Ok.mo +5 -0
- package/tests/check/deployed-missing-error/mops.toml +11 -0
- package/tests/check/deployed-missing-skip/Ok.mo +5 -0
- package/tests/check/deployed-missing-skip/mops.toml +12 -0
- package/tests/check/error/Error.mo +1 -1
- package/tests/check/error/mops.toml +5 -2
- package/tests/check/fix/M0223.mo +1 -1
- package/tests/check/fix/M0236.mo +1 -1
- package/tests/check/fix/M0237.mo +1 -1
- package/tests/check/fix/Ok.mo +1 -1
- package/tests/check/fix/fix-with-error.mo +9 -0
- package/tests/check/fix/fix-with-warning.mo +8 -0
- package/tests/check/fix/mops.toml +3 -0
- package/tests/check/fix/transitive-main.mo +1 -1
- package/tests/check/moc-args/Warning.mo +1 -1
- package/tests/check/moc-args/mops.toml +4 -1
- package/tests/check/success/Ok.mo +1 -1
- package/tests/check/success/Warning.mo +1 -1
- package/tests/check/success/mops.toml +5 -2
- package/tests/check-fix.test.ts +25 -0
- package/tests/check-stable/compatible/mops.toml +8 -0
- package/tests/check-stable/compatible/new.mo +4 -0
- package/tests/check-stable/compatible/old.mo +3 -0
- package/tests/check-stable/incompatible/mops.toml +8 -0
- package/tests/check-stable/incompatible/new.mo +3 -0
- package/tests/check-stable/incompatible/old.mo +4 -0
- package/tests/check-stable/subdirectory/.old/src/main.mo +3 -0
- package/tests/check-stable/subdirectory/mops.toml +8 -0
- package/tests/check-stable/subdirectory/src/main.mo +4 -0
- package/tests/check-stable.test.ts +56 -0
- package/tests/check.test.ts +63 -1
- package/tests/moc-args.test.ts +3 -3
- package/tests/toolchain-local-subpath/bin/moc +2 -0
- package/tests/toolchain-local-subpath/mops.toml +2 -0
- package/tests/toolchain.test.ts +13 -0
- package/types.ts +5 -1
package/tests/toolchain.test.ts
CHANGED
|
@@ -9,4 +9,17 @@ describe("toolchain", () => {
|
|
|
9
9
|
expect(result.exitCode).toBe(0);
|
|
10
10
|
expect(result.stdout.trim()).toBe("./mock");
|
|
11
11
|
});
|
|
12
|
+
|
|
13
|
+
test("file URI with subdirectory path", async () => {
|
|
14
|
+
const cwd = path.join(import.meta.dirname, "toolchain-local-subpath");
|
|
15
|
+
const result = await cli(["toolchain", "bin", "moc"], { cwd });
|
|
16
|
+
expect(result.exitCode).toBe(0);
|
|
17
|
+
expect(result.stdout.trim()).toBe("./bin/moc");
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test("file URI does not trigger download during install", async () => {
|
|
21
|
+
const cwd = path.join(import.meta.dirname, "toolchain-local-subpath");
|
|
22
|
+
const result = await cli(["install"], { cwd });
|
|
23
|
+
expect(result.stderr).not.toContain("Invalid Version");
|
|
24
|
+
});
|
|
12
25
|
});
|
package/types.ts
CHANGED
|
@@ -33,10 +33,14 @@ export type Config = {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
export type CanisterConfig = {
|
|
36
|
-
main
|
|
36
|
+
main?: string;
|
|
37
37
|
args?: string[];
|
|
38
38
|
candid?: string;
|
|
39
39
|
initArg?: string;
|
|
40
|
+
"check-stable"?: {
|
|
41
|
+
path: string;
|
|
42
|
+
skipIfMissing?: boolean;
|
|
43
|
+
};
|
|
40
44
|
};
|
|
41
45
|
|
|
42
46
|
export type Dependencies = Record<string, Dependency>;
|