create-krispya 0.1.0 → 0.2.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/dist/cli.js +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/dist/integrations/vitest.d.ts +2 -0
- package/dist/integrations/vitest.js +20 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -70,6 +70,8 @@ function formatConfigSummary(options) {
|
|
|
70
70
|
? getLanguageFromTemplate(options.template)
|
|
71
71
|
: "typescript";
|
|
72
72
|
lines.push(formatRow("Language", formatLanguage(language)));
|
|
73
|
+
// Bundler (always vite)
|
|
74
|
+
lines.push(formatRow("Bundler", "vite"));
|
|
73
75
|
// Node version
|
|
74
76
|
lines.push(formatRow("Node version", options.nodeVersion || "latest"));
|
|
75
77
|
// Package manager
|
|
@@ -87,6 +89,8 @@ function formatConfigSummary(options) {
|
|
|
87
89
|
if (options.formatter) {
|
|
88
90
|
lines.push(formatRow("Formatter", options.formatter));
|
|
89
91
|
}
|
|
92
|
+
// Testing (always vitest)
|
|
93
|
+
lines.push(formatRow("Testing", "vitest"));
|
|
90
94
|
// R3F integrations
|
|
91
95
|
if (options.template && getBaseTemplate(options.template) === "r3f") {
|
|
92
96
|
const integrationNames = [
|
|
@@ -421,6 +425,9 @@ async function main() {
|
|
|
421
425
|
getLatestNpmVersion("vite", "6.3.4").then((v) => {
|
|
422
426
|
versions.vite = v;
|
|
423
427
|
}),
|
|
428
|
+
getLatestNpmVersion("vitest", "4.0.0").then((v) => {
|
|
429
|
+
versions.vitest = v;
|
|
430
|
+
}),
|
|
424
431
|
];
|
|
425
432
|
// Fetch linter version
|
|
426
433
|
const linter = generateOptions.linter ?? "oxlint";
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare function getLanguageFromTemplate(template: Template): "javascript
|
|
|
19
19
|
export declare function getBaseTemplate(template: Template): BaseTemplate;
|
|
20
20
|
export type PackageVersions = {
|
|
21
21
|
vite?: string;
|
|
22
|
+
vitest?: string;
|
|
22
23
|
eslint?: string;
|
|
23
24
|
oxlint?: string;
|
|
24
25
|
oxfmt?: string;
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,7 @@ import { generateUikit } from "./integrations/uikit.js";
|
|
|
17
17
|
import { generateXr } from "./integrations/xr.js";
|
|
18
18
|
import { generateZustand } from "./integrations/zustand.js";
|
|
19
19
|
import { generateTriplex } from "./integrations/triplex.js";
|
|
20
|
+
import { generateVitest } from "./integrations/vitest.js";
|
|
20
21
|
import { merge } from "./merge.js";
|
|
21
22
|
import { generateViverse } from "./integrations/viverse.js";
|
|
22
23
|
export * from "./utils.js";
|
|
@@ -163,6 +164,8 @@ export function generate(options) {
|
|
|
163
164
|
}
|
|
164
165
|
// GitHub Pages works for all templates
|
|
165
166
|
generateGithubPages(generator, clonedOptions.githubPages);
|
|
167
|
+
// Testing - always include vitest
|
|
168
|
+
generateVitest(generator);
|
|
166
169
|
// Linter and formatter integrations
|
|
167
170
|
const linter = clonedOptions.linter;
|
|
168
171
|
const formatter = clonedOptions.formatter;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getBaseTemplate } from "../index.js";
|
|
2
|
+
export function generateVitest(generator) {
|
|
3
|
+
const version = generator.versions.vitest ?? "4.0.0"; // fallback if not fetched
|
|
4
|
+
generator.addDependency("vitest", `^${version}`);
|
|
5
|
+
const template = generator.options.template ?? "vanilla";
|
|
6
|
+
const baseTemplate = getBaseTemplate(template);
|
|
7
|
+
const isReact = baseTemplate === "react" || baseTemplate === "r3f";
|
|
8
|
+
// Add React Testing Library for React/R3F templates
|
|
9
|
+
if (isReact) {
|
|
10
|
+
generator.addDependency("@testing-library/react", "^16.2.0");
|
|
11
|
+
generator.addDependency("@testing-library/dom", "^10.4.0");
|
|
12
|
+
generator.addDependency("jsdom", "^26.0.0");
|
|
13
|
+
}
|
|
14
|
+
// Merge vitest config into vite config (only if needed)
|
|
15
|
+
if (isReact) {
|
|
16
|
+
generator.configureVite({ test: { environment: "jsdom" } });
|
|
17
|
+
}
|
|
18
|
+
generator.addScript("test", "vitest");
|
|
19
|
+
generator.inject("readme-tools", "[Vitest](https://vitest.dev/) - Fast unit test framework powered by Vite");
|
|
20
|
+
}
|