create-rezi 0.1.0-alpha.17 → 0.1.0-alpha.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rezi",
3
- "version": "0.1.0-alpha.17",
3
+ "version": "0.1.0-alpha.18",
4
4
  "description": "Scaffold a Rezi terminal UI app.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://rtlzeromemory.github.io/Rezi/",
@@ -19,13 +19,15 @@
19
19
  "files": [
20
20
  "dist/",
21
21
  "templates/",
22
- "README.md"
22
+ "README.md",
23
+ "!dist/**/__tests__/**",
24
+ "!dist/**/__e2e__/**"
23
25
  ],
24
26
  "engines": {
25
27
  "node": ">=18",
26
28
  "bun": ">=1.3.0"
27
29
  },
28
30
  "devDependencies": {
29
- "@rezi-ui/testkit": "0.1.0-alpha.17"
31
+ "@rezi-ui/testkit": "0.1.0-alpha.18"
30
32
  }
31
33
  }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=scaffold.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scaffold.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/scaffold.test.ts"],"names":[],"mappings":""}
@@ -1,52 +0,0 @@
1
- import { mkdtemp, readFile, readdir } from "node:fs/promises";
2
- import { tmpdir } from "node:os";
3
- import { join } from "node:path";
4
- import { assert, test } from "@rezi-ui/testkit";
5
- import { TEMPLATE_DEFINITIONS, createProject, getTemplatesRoot, normalizeTemplateName, toValidPackageName, } from "../scaffold.js";
6
- test("normalizeTemplateName accepts friendly aliases", () => {
7
- assert.equal(normalizeTemplateName("dashboard"), "dashboard");
8
- assert.equal(normalizeTemplateName("dash"), "dashboard");
9
- assert.equal(normalizeTemplateName("stress-test"), "stress-test");
10
- assert.equal(normalizeTemplateName("stress"), "stress-test");
11
- assert.equal(normalizeTemplateName("chaos"), "stress-test");
12
- assert.equal(normalizeTemplateName("bench"), "stress-test");
13
- });
14
- test("template keys match template directories and include highlights", async () => {
15
- const expectedKeys = ["dashboard", "stress-test"];
16
- const keys = TEMPLATE_DEFINITIONS.map((template) => template.key);
17
- assert.equal(keys.join(","), expectedKeys.join(","));
18
- const directories = (await readdir(getTemplatesRoot(), { withFileTypes: true }))
19
- .filter((entry) => entry.isDirectory())
20
- .map((entry) => entry.name)
21
- .sort();
22
- const definedDirectories = TEMPLATE_DEFINITIONS.map((template) => template.dir).sort();
23
- assert.equal(directories.join(","), definedDirectories.join(","));
24
- for (const template of TEMPLATE_DEFINITIONS) {
25
- assert.equal(template.dir, template.key);
26
- assert.ok(template.highlights.length >= 2);
27
- }
28
- });
29
- test("createProject scaffolds each template with substitutions", async () => {
30
- const root = await mkdtemp(join(tmpdir(), "rezi-create-"));
31
- for (const template of TEMPLATE_DEFINITIONS) {
32
- const targetDir = join(root, template.key);
33
- const displayName = `My ${template.label}`;
34
- const packageName = toValidPackageName(`my-${template.key}`);
35
- await createProject({
36
- targetDir,
37
- templateKey: template.key,
38
- packageName,
39
- displayName,
40
- });
41
- const pkgRaw = await readFile(join(targetDir, "package.json"), "utf8");
42
- const pkg = JSON.parse(pkgRaw);
43
- assert.equal(pkg.name, packageName);
44
- const main = await readFile(join(targetDir, "src", "main.ts"), "utf8");
45
- assert.ok(main.includes(displayName));
46
- assert.ok(!main.includes("__APP_NAME__"));
47
- const readme = await readFile(join(targetDir, "README.md"), "utf8");
48
- assert.ok(readme.includes(template.label));
49
- assert.ok(!readme.includes("__TEMPLATE_LABEL__"));
50
- }
51
- });
52
- //# sourceMappingURL=scaffold.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scaffold.test.js","sourceRoot":"","sources":["../../src/__tests__/scaffold.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CA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