@verikit/cli 0.2.0 → 0.2.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.
package/dist/detect/framework.js
CHANGED
|
@@ -15,7 +15,7 @@ export function detectFramework(cwd, pkg) {
|
|
|
15
15
|
if (hasDependency(pkg, "next")) {
|
|
16
16
|
return { ui: "next", appDir: findAppRouterRoot(cwd), typescript };
|
|
17
17
|
}
|
|
18
|
-
if (hasDependency(pkg, "vue")) {
|
|
18
|
+
if (hasDependency(pkg, "vue") || hasDependency(pkg, "nuxt")) {
|
|
19
19
|
return { ui: "vue", appDir: null, typescript };
|
|
20
20
|
}
|
|
21
21
|
if (hasDependency(pkg, "react")) {
|
|
@@ -6,11 +6,11 @@ import { hasDependency } from "../detect/project.js";
|
|
|
6
6
|
*
|
|
7
7
|
* Keep in sync with the framework's @verikit/* versions.
|
|
8
8
|
*/
|
|
9
|
-
const VERIKIT_VERSION = "
|
|
9
|
+
const VERIKIT_VERSION = "latest";
|
|
10
10
|
function verikit(...names) {
|
|
11
11
|
return names.map((name) => `@verikit/${name}@${VERIKIT_VERSION}`);
|
|
12
12
|
}
|
|
13
|
-
/** Strips a trailing `@version` from an install spec, e.g. `"@verikit/react
|
|
13
|
+
/** Strips a trailing `@version` from an install spec, e.g. `"@verikit/react@latest"` -> `"@verikit/react"`. */
|
|
14
14
|
function bareName(spec) {
|
|
15
15
|
const at = spec.lastIndexOf("@");
|
|
16
16
|
return at > 0 ? spec.slice(0, at) : spec;
|
|
@@ -19,19 +19,21 @@ export function resolvePackages(selection) {
|
|
|
19
19
|
const packages = [];
|
|
20
20
|
const add = (...specs) => {
|
|
21
21
|
for (const spec of specs) {
|
|
22
|
-
if (!hasDependency(selection.pkg, bareName(spec))
|
|
22
|
+
if (!hasDependency(selection.pkg, bareName(spec)) &&
|
|
23
|
+
!packages.includes(spec)) {
|
|
23
24
|
packages.push(spec);
|
|
25
|
+
}
|
|
24
26
|
}
|
|
25
27
|
};
|
|
26
28
|
if (selection.server)
|
|
27
|
-
add(...verikit("server"));
|
|
29
|
+
add(...verikit("core", "runtime", "client", "server"));
|
|
28
30
|
if (selection.ui === "react" || selection.ui === "next") {
|
|
29
|
-
add(...verikit("react"), "@tanstack/react-query", "@tanstack/react-form", "@tanstack/react-table", "@base-ui/react");
|
|
31
|
+
add(...verikit("core", "react"), "@tanstack/react-query", "@tanstack/react-form", "@tanstack/react-table", "@base-ui/react");
|
|
30
32
|
if (selection.theme)
|
|
31
33
|
add(...verikit("theme"));
|
|
32
34
|
}
|
|
33
35
|
else if (selection.ui === "vue") {
|
|
34
|
-
add(...verikit("vue"), "@tanstack/vue-query", "@tanstack/vue-form", "@tanstack/vue-table", "reka-ui");
|
|
36
|
+
add(...verikit("core", "vue"), "@tanstack/vue-query", "@tanstack/vue-form", "@tanstack/vue-table", "reka-ui");
|
|
35
37
|
if (selection.theme)
|
|
36
38
|
add(...verikit("theme"));
|
|
37
39
|
}
|