bingo 0.4.1 → 0.4.2

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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=produceTemplate.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"produceTemplate.test.d.ts","sourceRoot":"","sources":["../../src/producers/produceTemplate.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,68 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { z } from "zod";
3
+ import { createTemplate } from "../creators/createTemplate.js";
4
+ import { produceTemplate } from "./produceTemplate.js";
5
+ const template = createTemplate({
6
+ about: { name: "Test Template" },
7
+ options: {
8
+ title: z.string(),
9
+ },
10
+ produce({ options }) {
11
+ return {
12
+ files: {
13
+ "README.md": `# ${options.title}`,
14
+ },
15
+ };
16
+ },
17
+ setup({ options }) {
18
+ return {
19
+ files: {
20
+ "README-setup.md": `# ${options.title}`,
21
+ },
22
+ };
23
+ },
24
+ transition({ options }) {
25
+ return {
26
+ files: {
27
+ "README-transition.md": `# ${options.title}`,
28
+ },
29
+ };
30
+ },
31
+ });
32
+ describe("produceTemplate", () => {
33
+ it("runs the template's produce without augmentations when mode is undefined", () => {
34
+ const creation = produceTemplate(template, {
35
+ options: { title: "Test Title" },
36
+ });
37
+ expect(creation).toEqual({
38
+ files: {
39
+ "README.md": `# Test Title`,
40
+ },
41
+ });
42
+ });
43
+ it("runs the template's produce and setup when mode is setup", () => {
44
+ const creation = produceTemplate(template, {
45
+ mode: "setup",
46
+ options: { title: "Test Title" },
47
+ });
48
+ expect(creation).toEqual({
49
+ files: {
50
+ "README-setup.md": `# Test Title`,
51
+ "README.md": `# Test Title`,
52
+ },
53
+ });
54
+ });
55
+ it("runs the template's produce and transition when mode is transition", () => {
56
+ const creation = produceTemplate(template, {
57
+ mode: "transition",
58
+ options: { title: "Test Title" },
59
+ });
60
+ expect(creation).toEqual({
61
+ files: {
62
+ "README-transition.md": `# Test Title`,
63
+ "README.md": `# Test Title`,
64
+ },
65
+ });
66
+ });
67
+ });
68
+ //# sourceMappingURL=produceTemplate.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"produceTemplate.test.js","sourceRoot":"","sources":["../../src/producers/produceTemplate.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC/B,KAAK,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE;IAChC,OAAO,EAAE;QACR,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;KACjB;IACD,OAAO,CAAC,EAAE,OAAO,EAAE;QAClB,OAAO;YACN,KAAK,EAAE;gBACN,WAAW,EAAE,KAAK,OAAO,CAAC,KAAK,EAAE;aACjC;SACD,CAAC;IACH,CAAC;IACD,KAAK,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACN,KAAK,EAAE;gBACN,iBAAiB,EAAE,KAAK,OAAO,CAAC,KAAK,EAAE;aACvC;SACD,CAAC;IACH,CAAC;IACD,UAAU,CAAC,EAAE,OAAO,EAAE;QACrB,OAAO;YACN,KAAK,EAAE;gBACN,sBAAsB,EAAE,KAAK,OAAO,CAAC,KAAK,EAAE;aAC5C;SACD,CAAC;IACH,CAAC;CACD,CAAC,CAAC;AAEH,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,0EAA0E,EAAE,GAAG,EAAE;QACnF,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,EAAE;YAC1C,OAAO,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE;SAChC,CAAC,CAAC;QAEH,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;YACxB,KAAK,EAAE;gBACN,WAAW,EAAE,cAAc;aAC3B;SACD,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;QACnE,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,EAAE;YAC1C,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE;SAChC,CAAC,CAAC;QAEH,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;YACxB,KAAK,EAAE;gBACN,iBAAiB,EAAE,cAAc;gBACjC,WAAW,EAAE,cAAc;aAC3B;SACD,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC7E,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,EAAE;YAC1C,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE;SAChC,CAAC,CAAC;QAEH,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;YACxB,KAAK,EAAE;gBACN,sBAAsB,EAAE,cAAc;gBACtC,WAAW,EAAE,cAAc;aAC3B;SACD,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bingo",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Delightful templates for web repositories. 💝",
5
5
  "repository": {
6
6
  "type": "git",