ic-mops 2.5.0 → 2.6.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 +24 -0
- package/api/network.ts +1 -1
- package/bun.lock +1082 -78
- package/bundle/cli.tgz +0 -0
- package/cli.ts +1 -1
- package/commands/add.ts +4 -1
- package/commands/build.ts +7 -12
- package/commands/check.ts +20 -2
- package/commands/docs-coverage.ts +26 -21
- package/commands/install/install-dep.ts +5 -3
- package/commands/lint.ts +107 -10
- package/commands/publish.ts +24 -11
- package/commands/remove.ts +5 -2
- package/commands/self.ts +1 -1
- package/commands/sources.ts +3 -2
- package/commands/sync.ts +13 -16
- package/commands/test/test.ts +3 -3
- package/commands/update.ts +13 -7
- package/commands/watch/error-checker.ts +3 -8
- package/commands/watch/warning-checker.ts +3 -8
- package/dist/api/network.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/add.js +4 -1
- package/dist/commands/build.js +5 -10
- package/dist/commands/check.js +14 -2
- package/dist/commands/docs-coverage.js +22 -22
- package/dist/commands/install/install-dep.js +3 -3
- package/dist/commands/lint.d.ts +3 -0
- package/dist/commands/lint.js +75 -10
- package/dist/commands/publish.js +19 -11
- package/dist/commands/remove.js +5 -2
- package/dist/commands/self.js +1 -1
- package/dist/commands/sources.js +3 -2
- package/dist/commands/sync.js +9 -14
- package/dist/commands/test/test.js +3 -3
- package/dist/commands/update.js +9 -4
- package/dist/commands/watch/error-checker.js +3 -8
- package/dist/commands/watch/warning-checker.js +3 -8
- package/dist/helpers/find-changelog-entry.js +1 -1
- package/dist/integrity.js +9 -3
- package/dist/mops.js +3 -0
- package/dist/package.json +3 -5
- package/dist/release-cli.js +2 -2
- package/dist/resolve-packages.js +4 -4
- package/dist/tests/build.test.js +1 -1
- package/dist/tests/check.test.js +24 -0
- package/dist/tests/helpers.js +8 -1
- package/dist/tests/lint.test.js +28 -2
- package/dist/types.d.ts +2 -0
- package/dist/vessel.d.ts +1 -1
- package/dist/vessel.js +3 -2
- package/helpers/find-changelog-entry.ts +3 -1
- package/integrity.ts +12 -3
- package/mops.ts +7 -0
- package/package.json +3 -5
- package/release-cli.ts +2 -2
- package/resolve-packages.ts +6 -4
- package/tests/build.test.ts +1 -1
- package/tests/check/with-lint-fail/NoBoolSwitch.mo +8 -0
- package/tests/check/with-lint-fail/lints/no-bool-switch.toml +9 -0
- package/tests/check/with-lint-fail/mops.toml +9 -0
- package/tests/check/with-lint-pass/Ok.mo +5 -0
- package/tests/check/with-lint-pass/lints/no-bool-switch.toml +9 -0
- package/tests/check/with-lint-pass/mops.toml +9 -0
- package/tests/check.test.ts +28 -0
- package/tests/helpers.ts +9 -1
- package/tests/lint-config-rules/extra-rules/no-bool-switch.toml +9 -0
- package/tests/lint-config-rules/mops.toml +5 -0
- package/tests/lint-config-rules/src/NoBoolSwitch.mo +8 -0
- package/tests/lint-extends/mops.toml +8 -0
- package/tests/lint-extends/my-pkg/mops.toml +3 -0
- package/tests/lint-extends/my-pkg/rules/no-bool-switch.toml +9 -0
- package/tests/lint-extends/src/NoBoolSwitch.mo +8 -0
- package/tests/lint-extends-all/mops.toml +8 -0
- package/tests/lint-extends-all/src/NoBoolSwitch.mo +8 -0
- package/tests/lint-extends-ignored/mops.toml +8 -0
- package/tests/lint-extends-ignored/src/NoBoolSwitch.mo +8 -0
- package/tests/lint.test.ts +32 -2
- package/types.ts +2 -0
- package/vessel.ts +5 -3
package/tests/lint.test.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { describe, test } from "@jest/globals";
|
|
1
|
+
import { describe, expect, test } from "@jest/globals";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import { cliSnapshot } from "./helpers";
|
|
3
|
+
import { cli, cliSnapshot } from "./helpers";
|
|
4
4
|
|
|
5
5
|
describe("lint", () => {
|
|
6
6
|
test("ok", async () => {
|
|
@@ -14,4 +14,34 @@ describe("lint", () => {
|
|
|
14
14
|
await cliSnapshot(["lint", "NoBoolSwitch", "--verbose"], { cwd }, 1);
|
|
15
15
|
await cliSnapshot(["lint", "DoesNotExist"], { cwd }, 1);
|
|
16
16
|
});
|
|
17
|
+
|
|
18
|
+
test("[lint] rules - additional config rules directory is used", async () => {
|
|
19
|
+
const cwd = path.join(import.meta.dirname, "lint-config-rules");
|
|
20
|
+
const result = await cli(["lint"], { cwd });
|
|
21
|
+
expect(result.exitCode).toBe(1);
|
|
22
|
+
expect(result.stderr).toMatch(/no-bool-switch/);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test("[lint] extends - picks up rules/ from named dependency", async () => {
|
|
26
|
+
const cwd = path.join(import.meta.dirname, "lint-extends");
|
|
27
|
+
const result = await cli(["lint"], { cwd });
|
|
28
|
+
expect(result.exitCode).toBe(1);
|
|
29
|
+
expect(result.stderr).toMatch(/no-bool-switch/);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test("[lint] extends true - picks up rules/ from all dependencies", async () => {
|
|
33
|
+
const cwd = path.join(import.meta.dirname, "lint-extends-all");
|
|
34
|
+
const result = await cli(["lint"], { cwd });
|
|
35
|
+
expect(result.exitCode).toBe(1);
|
|
36
|
+
expect(result.stderr).toMatch(/no-bool-switch/);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test("[lint] extends - dep not in extends list is ignored", async () => {
|
|
40
|
+
// my-pkg has rules/ but extends only lists "other-pkg" (which doesn't exist),
|
|
41
|
+
// so no dep rules are loaded and NoBoolSwitch.mo passes with exit 0.
|
|
42
|
+
const cwd = path.join(import.meta.dirname, "lint-extends-ignored");
|
|
43
|
+
const result = await cli(["lint"], { cwd });
|
|
44
|
+
expect(result.exitCode).toBe(0);
|
|
45
|
+
expect(result.stderr).toMatch(/not found in dependencies/);
|
|
46
|
+
});
|
|
17
47
|
});
|
package/types.ts
CHANGED
package/vessel.ts
CHANGED
|
@@ -181,7 +181,7 @@ export const installFromGithub = async (
|
|
|
181
181
|
silent = false,
|
|
182
182
|
ignoreTransitive = false,
|
|
183
183
|
} = {},
|
|
184
|
-
) => {
|
|
184
|
+
): Promise<boolean> => {
|
|
185
185
|
let cacheName = getGithubDepCacheName(name, repo);
|
|
186
186
|
let cacheDir = getDepCacheDir(cacheName);
|
|
187
187
|
|
|
@@ -205,7 +205,7 @@ export const installFromGithub = async (
|
|
|
205
205
|
await downloadFromGithub(repo, cacheDir, progress);
|
|
206
206
|
} catch (err) {
|
|
207
207
|
deleteSync([cacheDir], { force: true });
|
|
208
|
-
|
|
208
|
+
return false;
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
|
|
@@ -216,7 +216,7 @@ export const installFromGithub = async (
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
if (ignoreTransitive) {
|
|
219
|
-
return;
|
|
219
|
+
return true;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
const config = await readVesselConfig(cacheDir, { silent });
|
|
@@ -228,4 +228,6 @@ export const installFromGithub = async (
|
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
+
|
|
232
|
+
return true;
|
|
231
233
|
};
|