@batijs/features 0.0.599 → 0.0.600
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/features-D5mjsler.js +498 -0
- package/dist/features-DpR7_9XX.d.ts +521 -0
- package/dist/index.d.ts +42 -34
- package/dist/index.js +117 -120
- package/dist/rules.d.ts +22 -18
- package/dist/rules.js +90 -106
- package/package.json +5 -5
- package/dist/chunk-C6ZJJWQB.js +0 -576
- package/dist/features-CF7XmzsN.d.ts +0 -518
package/dist/index.d.ts
CHANGED
|
@@ -1,43 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { C as CategoryLabels, a as categories, d as cliFlags, f as features, b as flags } from './features-CF7XmzsN.js';
|
|
1
|
+
import { a as CategoryLabels, i as flags, n as cliFlags, o as categories, r as features, s as categoriesGroups, t as Flags } from "./features-DpR7_9XX.js";
|
|
3
2
|
|
|
3
|
+
//#region src/types.d.ts
|
|
4
4
|
interface Feature<C = string> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
label: string;
|
|
6
|
+
flag: string;
|
|
7
|
+
category: C;
|
|
8
|
+
image?: string;
|
|
9
|
+
url?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
dependsOn?: ReadonlyArray<string>;
|
|
12
|
+
spectrum?: "beaten_path" | "bleeding_edge";
|
|
13
|
+
tagline?: string;
|
|
14
|
+
links?: FeatureLink[];
|
|
15
|
+
repo?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
invisibleCli?: boolean;
|
|
18
|
+
readonly?: boolean;
|
|
19
|
+
selected?: boolean;
|
|
20
20
|
}
|
|
21
21
|
interface FeatureLink {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
label: string;
|
|
23
|
+
href: string;
|
|
24
24
|
}
|
|
25
25
|
interface Category {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
label: string;
|
|
27
|
+
group: categoriesGroups;
|
|
28
|
+
multiple?: boolean;
|
|
29
|
+
required?: boolean;
|
|
30
|
+
description?: string;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/helpers.d.ts
|
|
34
|
+
/**
|
|
35
|
+
* /!\ This needs to be published for updates to be taken into account in the CI
|
|
36
|
+
*/
|
|
33
37
|
declare class BatiSet extends Set<Flags> {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
#private;
|
|
39
|
+
constructor(flags: Flags[], allFeatures: ReadonlyArray<Feature>);
|
|
40
|
+
private hasOneOf;
|
|
41
|
+
get hasServer(): boolean;
|
|
42
|
+
get hasDatabase(): boolean;
|
|
43
|
+
get hasD1(): boolean;
|
|
44
|
+
get hasUD(): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated
|
|
47
|
+
*/
|
|
48
|
+
get hasPhoton(): boolean;
|
|
41
49
|
}
|
|
42
|
-
|
|
43
|
-
export { BatiSet,
|
|
50
|
+
//#endregion
|
|
51
|
+
export { BatiSet, Category, CategoryLabels, Feature, FeatureLink, Flags, categories, categoriesGroups, cliFlags, features, flags };
|
package/dist/index.js
CHANGED
|
@@ -1,130 +1,127 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
label: "UI Framework",
|
|
26
|
-
group: "Frontend" /* Frontend */,
|
|
27
|
-
description: `It\u2019s recommended to choose a frontend lib to kickstart a new Vike project,
|
|
1
|
+
import { n as features, r as flags, t as cliFlags } from "./features-D5mjsler.js";
|
|
2
|
+
//#region src/groups.ts
|
|
3
|
+
let categoriesGroups = /* @__PURE__ */ function(categoriesGroups) {
|
|
4
|
+
categoriesGroups["Frontend"] = "Frontend";
|
|
5
|
+
categoriesGroups["Data"] = "Data";
|
|
6
|
+
categoriesGroups["Deployment"] = "Deployment";
|
|
7
|
+
categoriesGroups["Utilities"] = "Utilities";
|
|
8
|
+
return categoriesGroups;
|
|
9
|
+
}({});
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/categories.ts
|
|
12
|
+
const categories = [
|
|
13
|
+
{
|
|
14
|
+
label: "Frontend Framework",
|
|
15
|
+
group: categoriesGroups.Frontend,
|
|
16
|
+
description: `Flexible, robust, community-driven, and fast Vite-based frontend framework.`,
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
label: "UI Framework",
|
|
21
|
+
group: categoriesGroups.Frontend,
|
|
22
|
+
description: `It’s recommended to choose a frontend lib to kickstart a new Vike project,
|
|
28
23
|
as they each come with a wide range of integrations. You can at any time eject and take control over integration code
|
|
29
|
-
so that it doesn
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
so that it doesn’t get in your way.`,
|
|
25
|
+
required: true
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: "CSS",
|
|
29
|
+
group: categoriesGroups.Frontend,
|
|
30
|
+
description: `These CSS libraries are deeply integrated with UI frameworks.
|
|
36
31
|
They showcase their respective recommended usage and how they integrate with Vite and Vike.`
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: "UI Component Libraries",
|
|
35
|
+
group: categoriesGroups.Frontend,
|
|
36
|
+
description: `These UI Component Libraries are deeply integrated with UI frameworks.
|
|
42
37
|
They showcase their respective recommended usage and how they integrate with Vite and Vike.`
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: "Auth",
|
|
41
|
+
group: categoriesGroups.Data,
|
|
42
|
+
description: `Ready to use self-hosted or cloud-based Auth solutions.
|
|
48
43
|
Requires to also select a Server of your choosing.`
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: "Data fetching",
|
|
47
|
+
group: categoriesGroups.Data,
|
|
48
|
+
description: `Data fetching libraries to help you interact with your backend.
|
|
54
49
|
Selecting one of those usually requires you to also choose a Server.`
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: "Server",
|
|
53
|
+
group: categoriesGroups.Data,
|
|
54
|
+
description: `Mostly required by other integrations such as Auth or RPC,
|
|
60
55
|
it's recommended to only install a Server if you really need to, as Vike doesn't require one to operate.`
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: "Database",
|
|
59
|
+
group: categoriesGroups.Data,
|
|
60
|
+
description: `Helping you get started with a database solution.`
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: "Hosting",
|
|
64
|
+
group: categoriesGroups.Deployment,
|
|
65
|
+
description: `Quickly host your Vike project with a Serverless or VPS (coming soon) solution.`
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
label: "Linter",
|
|
69
|
+
multiple: true,
|
|
70
|
+
group: categoriesGroups.Utilities,
|
|
71
|
+
description: `Well known linting and formatting tools, pre-configured to match their recommended usage,
|
|
77
72
|
tailored for Vike.`
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
label: "Analytics",
|
|
76
|
+
group: categoriesGroups.Utilities,
|
|
77
|
+
description: `Keep track of your website traffic with these ready-to-get-started Analytics solutions.`
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
label: "Error tracking",
|
|
81
|
+
group: categoriesGroups.Utilities,
|
|
82
|
+
description: `Coming soon: Error Tracking solution for frontend and backend`
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
label: "Tooling",
|
|
86
|
+
group: categoriesGroups.Utilities,
|
|
87
|
+
description: `Additional tooling to improve your developer experience.`
|
|
88
|
+
}
|
|
94
89
|
];
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/helpers.ts
|
|
92
|
+
/**
|
|
93
|
+
* /!\ This needs to be published for updates to be taken into account in the CI
|
|
94
|
+
*/
|
|
97
95
|
var BatiSet = class extends Set {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
cliFlags,
|
|
128
|
-
features,
|
|
129
|
-
flags
|
|
96
|
+
#servers;
|
|
97
|
+
#databases;
|
|
98
|
+
constructor(flags, allFeatures) {
|
|
99
|
+
super(flags);
|
|
100
|
+
this.#servers = new Set(allFeatures.filter((f) => f.category === "Server").map((f) => f.flag));
|
|
101
|
+
this.#databases = new Set(allFeatures.filter((f) => f.category === "Database").map((f) => f.flag));
|
|
102
|
+
}
|
|
103
|
+
hasOneOf(a) {
|
|
104
|
+
for (const x of this) if (a.has(x)) return true;
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
get hasServer() {
|
|
108
|
+
return this.hasOneOf(this.#servers);
|
|
109
|
+
}
|
|
110
|
+
get hasDatabase() {
|
|
111
|
+
return this.has("sqlite") || this.has("drizzle") || this.has("kysely");
|
|
112
|
+
}
|
|
113
|
+
get hasD1() {
|
|
114
|
+
return this.has("cloudflare") && (this.has("sqlite") || this.has("drizzle") || this.has("kysely"));
|
|
115
|
+
}
|
|
116
|
+
get hasUD() {
|
|
117
|
+
return this.has("cloudflare") || this.has("vercel") || this.hasOneOf(this.#servers);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* @deprecated
|
|
121
|
+
*/
|
|
122
|
+
get hasPhoton() {
|
|
123
|
+
return this.hasUD;
|
|
124
|
+
}
|
|
130
125
|
};
|
|
126
|
+
//#endregion
|
|
127
|
+
export { BatiSet, categories, categoriesGroups, cliFlags, features, flags };
|
package/dist/rules.d.ts
CHANGED
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as CategoryLabels, t as Flags } from "./features-DpR7_9XX.js";
|
|
2
2
|
|
|
3
|
+
//#region src/rules/enum.d.ts
|
|
3
4
|
declare enum RulesMessage {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
ERROR_AUTH_R_SERVER = 0,
|
|
6
|
+
ERROR_COMPILED_R_REACT = 1,
|
|
7
|
+
ERROR_DRIZZLE_R_SERVER = 2,
|
|
8
|
+
ERROR_KYSELY_R_SERVER = 3,
|
|
9
|
+
ERROR_DATA_R_SERVER = 4,
|
|
10
|
+
ERROR_CLOUDFLARE_R_COMPAT_SERVER = 5,
|
|
11
|
+
ERROR_AWS_R_COMPAT_SERVER = 6,
|
|
12
|
+
ERROR_MANTINE_R_REACT = 7,
|
|
13
|
+
ERROR_SHADCN_R_REACT = 8,
|
|
14
|
+
WARN_SHADCN_R_TAILWINDCSS = 9,
|
|
15
|
+
INFO_STACKBLITZ_COMPAT = 10,
|
|
16
|
+
ERROR_STORYBOOK_R_UI_FRAMEWORK = 11
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/rules/utils.d.ts
|
|
18
20
|
type FeatureOrCategory = Flags | CategoryLabels;
|
|
19
21
|
type Rule = (fts: Set<FeatureOrCategory>) => null | undefined | false | RulesMessage;
|
|
20
|
-
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/rules/rules.d.ts
|
|
21
24
|
declare const _default: Rule[];
|
|
22
|
-
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/rules/index.d.ts
|
|
23
27
|
declare function execRules<T>(fts: FeatureOrCategory[], rulesMessages: Record<RulesMessage, T>): T[];
|
|
24
|
-
|
|
25
|
-
export { RulesMessage, execRules, _default as rules };
|
|
28
|
+
//#endregion
|
|
29
|
+
export { RulesMessage, execRules, _default as rules };
|
package/dist/rules.js
CHANGED
|
@@ -1,116 +1,100 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// src/rules/utils.ts
|
|
1
|
+
import { n as features, r as flags } from "./features-D5mjsler.js";
|
|
2
|
+
//#region src/rules/enum.ts
|
|
3
|
+
let RulesMessage = /* @__PURE__ */ function(RulesMessage) {
|
|
4
|
+
RulesMessage[RulesMessage["ERROR_AUTH_R_SERVER"] = 0] = "ERROR_AUTH_R_SERVER";
|
|
5
|
+
RulesMessage[RulesMessage["ERROR_COMPILED_R_REACT"] = 1] = "ERROR_COMPILED_R_REACT";
|
|
6
|
+
RulesMessage[RulesMessage["ERROR_DRIZZLE_R_SERVER"] = 2] = "ERROR_DRIZZLE_R_SERVER";
|
|
7
|
+
RulesMessage[RulesMessage["ERROR_KYSELY_R_SERVER"] = 3] = "ERROR_KYSELY_R_SERVER";
|
|
8
|
+
RulesMessage[RulesMessage["ERROR_DATA_R_SERVER"] = 4] = "ERROR_DATA_R_SERVER";
|
|
9
|
+
RulesMessage[RulesMessage["ERROR_CLOUDFLARE_R_COMPAT_SERVER"] = 5] = "ERROR_CLOUDFLARE_R_COMPAT_SERVER";
|
|
10
|
+
RulesMessage[RulesMessage["ERROR_AWS_R_COMPAT_SERVER"] = 6] = "ERROR_AWS_R_COMPAT_SERVER";
|
|
11
|
+
RulesMessage[RulesMessage["ERROR_MANTINE_R_REACT"] = 7] = "ERROR_MANTINE_R_REACT";
|
|
12
|
+
RulesMessage[RulesMessage["ERROR_SHADCN_R_REACT"] = 8] = "ERROR_SHADCN_R_REACT";
|
|
13
|
+
RulesMessage[RulesMessage["WARN_SHADCN_R_TAILWINDCSS"] = 9] = "WARN_SHADCN_R_TAILWINDCSS";
|
|
14
|
+
RulesMessage[RulesMessage["INFO_STACKBLITZ_COMPAT"] = 10] = "INFO_STACKBLITZ_COMPAT";
|
|
15
|
+
RulesMessage[RulesMessage["ERROR_STORYBOOK_R_UI_FRAMEWORK"] = 11] = "ERROR_STORYBOOK_R_UI_FRAMEWORK";
|
|
16
|
+
return RulesMessage;
|
|
17
|
+
}({});
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/rules/utils.ts
|
|
20
|
+
/**
|
|
21
|
+
* Returns a message if ifPresent is present but any mustAlsoInclude is not
|
|
22
|
+
*/
|
|
24
23
|
function requires(message, ifPresent, mustAlsoInclude) {
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const m = Array.from(prepare(mustAlsoInclude));
|
|
25
|
+
return (fts) => fts.has(ifPresent) && !m.every((r) => fts.has(r)) && message;
|
|
27
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Returns a message if callback return true
|
|
29
|
+
*/
|
|
28
30
|
function filter(message, callback) {
|
|
29
|
-
|
|
31
|
+
return (fts) => callback(fts) && message;
|
|
30
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Create a Set from an array of features, and be sure to add
|
|
35
|
+
* all used categories to the Set.
|
|
36
|
+
*/
|
|
31
37
|
function prepare(fts) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
return s;
|
|
38
|
+
const s = /* @__PURE__ */ new Set();
|
|
39
|
+
for (const f of fts) {
|
|
40
|
+
if (flags.includes(f)) s.add(features.find((feat) => feat.flag === f).category);
|
|
41
|
+
s.add(f);
|
|
42
|
+
}
|
|
43
|
+
return s;
|
|
40
44
|
}
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/rules/rules.ts
|
|
43
47
|
var rules_default = [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
return false;
|
|
84
|
-
}),
|
|
85
|
-
filter(10 /* INFO_STACKBLITZ_COMPAT */, (fts) => {
|
|
86
|
-
return fts.has("drizzle") || fts.has("sqlite") || fts.has("kysely") || fts.has("cloudflare");
|
|
87
|
-
}),
|
|
88
|
-
filter(11 /* ERROR_STORYBOOK_R_UI_FRAMEWORK */, (fts) => {
|
|
89
|
-
if (fts.has("storybook")) {
|
|
90
|
-
return !fts.has("react") && !fts.has("vue") && !fts.has("solid");
|
|
91
|
-
}
|
|
92
|
-
return false;
|
|
93
|
-
})
|
|
48
|
+
requires(RulesMessage.ERROR_AUTH_R_SERVER, "Auth", ["Server"]),
|
|
49
|
+
requires(RulesMessage.ERROR_COMPILED_R_REACT, "compiled-css", ["react"]),
|
|
50
|
+
requires(RulesMessage.ERROR_DRIZZLE_R_SERVER, "drizzle", ["Server"]),
|
|
51
|
+
requires(RulesMessage.ERROR_KYSELY_R_SERVER, "kysely", ["Server"]),
|
|
52
|
+
requires(RulesMessage.ERROR_DATA_R_SERVER, "Data fetching", ["Server"]),
|
|
53
|
+
filter(RulesMessage.ERROR_CLOUDFLARE_R_COMPAT_SERVER, (fts) => {
|
|
54
|
+
if (fts.has("cloudflare")) {
|
|
55
|
+
if (fts.has("hono") || fts.has("h3")) return false;
|
|
56
|
+
return fts.has("Server");
|
|
57
|
+
}
|
|
58
|
+
return false;
|
|
59
|
+
}),
|
|
60
|
+
filter(RulesMessage.ERROR_AWS_R_COMPAT_SERVER, (fts) => {
|
|
61
|
+
if (fts.has("aws")) {
|
|
62
|
+
if (fts.has("hono")) return false;
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
return false;
|
|
66
|
+
}),
|
|
67
|
+
filter(RulesMessage.ERROR_MANTINE_R_REACT, (fts) => {
|
|
68
|
+
if (fts.has("mantine")) return fts.has("vue") || fts.has("solid");
|
|
69
|
+
return false;
|
|
70
|
+
}),
|
|
71
|
+
filter(RulesMessage.ERROR_SHADCN_R_REACT, (fts) => {
|
|
72
|
+
if (fts.has("shadcn-ui")) return fts.has("vue") || fts.has("solid");
|
|
73
|
+
return false;
|
|
74
|
+
}),
|
|
75
|
+
filter(RulesMessage.WARN_SHADCN_R_TAILWINDCSS, (fts) => {
|
|
76
|
+
if (fts.has("shadcn-ui")) return fts.has("daisyui") || fts.has("compiled-css");
|
|
77
|
+
return false;
|
|
78
|
+
}),
|
|
79
|
+
filter(RulesMessage.INFO_STACKBLITZ_COMPAT, (fts) => {
|
|
80
|
+
return fts.has("drizzle") || fts.has("sqlite") || fts.has("kysely") || fts.has("cloudflare");
|
|
81
|
+
}),
|
|
82
|
+
filter(RulesMessage.ERROR_STORYBOOK_R_UI_FRAMEWORK, (fts) => {
|
|
83
|
+
if (fts.has("storybook")) return !fts.has("react") && !fts.has("vue") && !fts.has("solid");
|
|
84
|
+
return false;
|
|
85
|
+
})
|
|
94
86
|
];
|
|
95
|
-
|
|
96
|
-
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/rules/index.ts
|
|
97
89
|
function execRules(fts, rulesMessages) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
console.warn("No handler defined for rule", result);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return messages;
|
|
90
|
+
const sfts = prepare(fts);
|
|
91
|
+
const messages = [];
|
|
92
|
+
for (const rule of rules_default) {
|
|
93
|
+
const result = rule(sfts);
|
|
94
|
+
if (typeof result === "number") if (result in rulesMessages) messages.push(rulesMessages[result]);
|
|
95
|
+
else console.warn("No handler defined for rule", result);
|
|
96
|
+
}
|
|
97
|
+
return messages;
|
|
111
98
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
execRules,
|
|
115
|
-
rules_default as rules
|
|
116
|
-
};
|
|
99
|
+
//#endregion
|
|
100
|
+
export { RulesMessage, execRules, rules_default as rules };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@batijs/features",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.600",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [],
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@types/node": "^20.19.37",
|
|
12
|
-
"
|
|
13
|
-
"vitest": "^4.1.
|
|
12
|
+
"tsdown": "^0.21.7",
|
|
13
|
+
"vitest": "^4.1.2"
|
|
14
14
|
},
|
|
15
15
|
"main": "./dist/index.js",
|
|
16
16
|
"module": "./dist/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"scripts": {
|
|
35
35
|
"test": "vitest run",
|
|
36
36
|
"test:ci": "vitest run",
|
|
37
|
-
"build": "
|
|
38
|
-
"watch": "
|
|
37
|
+
"build": "tsdown",
|
|
38
|
+
"watch": "tsdown --watch"
|
|
39
39
|
}
|
|
40
40
|
}
|