@canonical/summon-component 0.23.0 → 0.25.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
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.25.0](https://github.com/canonical/pragma/compare/v0.24.0...v0.25.0) (2026-04-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @canonical/summon-component
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [0.24.0](https://github.com/canonical/pragma/compare/v0.23.0...v0.24.0) (2026-04-13)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @canonical/summon-component
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [0.23.0](https://github.com/canonical/pragma/compare/v0.22.1...v0.23.0) (2026-04-07)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @canonical/summon-component
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonical/summon-component",
|
|
3
3
|
"description": "Component generators for Summon - React, Svelte and Lit component scaffolding",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.25.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"author": {
|
|
@@ -26,24 +26,26 @@
|
|
|
26
26
|
"check:biome:fix": "biome check --write",
|
|
27
27
|
"check:ts": "tsc --noEmit",
|
|
28
28
|
"check:webarchitect": "webarchitect base",
|
|
29
|
-
"test": "
|
|
29
|
+
"test": "bun run test:vitest",
|
|
30
|
+
"test:vitest": "vitest run --coverage",
|
|
31
|
+
"test:vitest:watch": "vitest"
|
|
30
32
|
},
|
|
31
33
|
"devDependencies": {
|
|
32
34
|
"@biomejs/biome": "2.4.9",
|
|
33
|
-
"@canonical/biome-config": "^0.
|
|
34
|
-
"@canonical/typescript-config": "^0.
|
|
35
|
-
"@canonical/webarchitect": "^0.
|
|
35
|
+
"@canonical/biome-config": "^0.25.0",
|
|
36
|
+
"@canonical/typescript-config": "^0.25.0",
|
|
37
|
+
"@canonical/webarchitect": "^0.25.0",
|
|
36
38
|
"@types/bun": "^1.3.10",
|
|
37
39
|
"@types/node": "^24.12.0",
|
|
38
40
|
"typescript": "^5.9.3",
|
|
39
41
|
"vitest": "^4.0.18"
|
|
40
42
|
},
|
|
41
43
|
"dependencies": {
|
|
42
|
-
"@canonical/utils": "^0.
|
|
44
|
+
"@canonical/utils": "^0.25.0"
|
|
43
45
|
},
|
|
44
46
|
"peerDependencies": {
|
|
45
47
|
"@canonical/summon-core": "^0.18.0 || ^0.20.0",
|
|
46
48
|
"@canonical/task": "^0.18.0 || ^0.20.0"
|
|
47
49
|
},
|
|
48
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "c6005a14c8210772ad8c589a2b473946780b6c20"
|
|
49
51
|
}
|
package/src/index.test.ts
CHANGED
|
@@ -242,6 +242,16 @@ describe("component/svelte generator", () => {
|
|
|
242
242
|
expect(prompt?.type).toBe("confirm");
|
|
243
243
|
expect(prompt?.default).toBe(false);
|
|
244
244
|
});
|
|
245
|
+
|
|
246
|
+
it("useTsStories prompt when condition checks withStories", () => {
|
|
247
|
+
const prompt = generator.prompts.find((p) => p.name === "useTsStories");
|
|
248
|
+
expect(
|
|
249
|
+
prompt?.when?.({ withStories: true } as Record<string, unknown>),
|
|
250
|
+
).toBe(true);
|
|
251
|
+
expect(
|
|
252
|
+
prompt?.when?.({ withStories: false } as Record<string, unknown>),
|
|
253
|
+
).toBe(false);
|
|
254
|
+
});
|
|
245
255
|
});
|
|
246
256
|
|
|
247
257
|
describe("generate", () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { collectUndos, dryRun } from "@canonical/task";
|
|
1
|
+
import { collectUndos, dryRun, readFile } from "@canonical/task";
|
|
2
2
|
import { describe, expect, it } from "vitest";
|
|
3
3
|
import appendExportToParentIndex from "./appendExportToParentIndex.js";
|
|
4
4
|
import dryRunWithFileState from "./dryRunWithFileState.js";
|
|
@@ -73,3 +73,10 @@ describe("appendExportToParentIndex", () => {
|
|
|
73
73
|
expect((appendEffect as Record<string, unknown>).undo).toBeDefined();
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
|
+
|
|
77
|
+
describe("dryRunWithFileState", () => {
|
|
78
|
+
it("returns empty string for missing files", () => {
|
|
79
|
+
const result = dryRunWithFileState(readFile("/missing/file.ts"), {});
|
|
80
|
+
expect(result.value).toBe("");
|
|
81
|
+
});
|
|
82
|
+
});
|
package/vitest.config.ts
CHANGED
|
@@ -6,7 +6,13 @@ export default defineConfig({
|
|
|
6
6
|
coverage: {
|
|
7
7
|
provider: "v8",
|
|
8
8
|
include: ["src/**/*.ts"],
|
|
9
|
-
exclude: ["**/index.ts", "**/*.test.ts", "**/*.d.ts"],
|
|
9
|
+
exclude: ["**/index.ts", "**/*.test.ts", "**/*.d.ts", "**/types.ts"],
|
|
10
|
+
thresholds: {
|
|
11
|
+
statements: 100,
|
|
12
|
+
branches: 100,
|
|
13
|
+
functions: 100,
|
|
14
|
+
lines: 100,
|
|
15
|
+
},
|
|
10
16
|
},
|
|
11
17
|
},
|
|
12
18
|
});
|