@mikulgohil/ai-kit 1.8.1 → 1.9.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/README.md +1 -0
- package/dist/index.js +78 -7
- package/dist/index.js.map +1 -1
- package/package.json +9 -2
- package/templates/claude-md/optimizely-saas.md +384 -0
- package/templates/cursorrules/optimizely-saas.md +20 -0
package/README.md
CHANGED
|
@@ -74,6 +74,7 @@ Scans your `package.json`, config files, and directory structure to detect your
|
|
|
74
74
|
|---|---|
|
|
75
75
|
| Next.js 15 with App Router | Server Components, Server Actions, `app/` routing patterns |
|
|
76
76
|
| Sitecore XM Cloud | `<Text>`, `<RichText>`, `<Image>` field helpers, placeholder patterns |
|
|
77
|
+
| Optimizely SaaS CMS | Visual Builder, Optimizely Graph, `@remkoj` SDK, component factory |
|
|
77
78
|
| Tailwind CSS v4 | `@theme` tokens, utility class patterns, responsive prefixes |
|
|
78
79
|
| TypeScript strict mode | No `any`, proper null checks, discriminated unions |
|
|
79
80
|
| Turborepo monorepo | Workspace conventions, cross-package imports |
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var GUIDES_DIR = path.join(PACKAGE_ROOT, "guides");
|
|
|
15
15
|
var DOCS_SCAFFOLDS_DIR = path.join(PACKAGE_ROOT, "docs-scaffolds");
|
|
16
16
|
var AGENTS_DIR = path.join(PACKAGE_ROOT, "agents");
|
|
17
17
|
var CONTEXTS_DIR = path.join(PACKAGE_ROOT, "contexts");
|
|
18
|
-
var VERSION = "1.
|
|
18
|
+
var VERSION = "1.9.0";
|
|
19
19
|
var AI_KIT_CONFIG_FILE = "ai-kit.config.json";
|
|
20
20
|
var GENERATED_FILES = {
|
|
21
21
|
claudeMd: "CLAUDE.md",
|
|
@@ -34,6 +34,7 @@ var TEMPLATE_FRAGMENTS = [
|
|
|
34
34
|
"nextjs-app-router",
|
|
35
35
|
"nextjs-pages-router",
|
|
36
36
|
"sitecore-xmc",
|
|
37
|
+
"optimizely-saas",
|
|
37
38
|
"tailwind",
|
|
38
39
|
"typescript",
|
|
39
40
|
"monorepo",
|
|
@@ -153,6 +154,56 @@ function detectSitecore(pkg) {
|
|
|
153
154
|
return { cms: "none" };
|
|
154
155
|
}
|
|
155
156
|
|
|
157
|
+
// src/scanner/optimizely.ts
|
|
158
|
+
var OPTIMIZELY_PACKAGES = [
|
|
159
|
+
"@remkoj/optimizely-cms-react",
|
|
160
|
+
"@remkoj/optimizely-cms-nextjs",
|
|
161
|
+
"@remkoj/optimizely-cms-api",
|
|
162
|
+
"@remkoj/optimizely-cms-cli",
|
|
163
|
+
"@remkoj/optimizely-graph-client",
|
|
164
|
+
"@remkoj/optimizely-graph-cli",
|
|
165
|
+
"@remkoj/optimizely-graph-functions",
|
|
166
|
+
"@remkoj/optimizely-one-nextjs"
|
|
167
|
+
];
|
|
168
|
+
var OPTIMIZELY_OFFICIAL_PACKAGES = [
|
|
169
|
+
"@optimizely/cms",
|
|
170
|
+
"@optimizely/graph",
|
|
171
|
+
"@optimizely/cms-react",
|
|
172
|
+
"@optimizely/cms-nextjs"
|
|
173
|
+
];
|
|
174
|
+
function detectOptimizely(pkg) {
|
|
175
|
+
const deps = {
|
|
176
|
+
...pkg.dependencies,
|
|
177
|
+
...pkg.devDependencies
|
|
178
|
+
};
|
|
179
|
+
const foundPackages = [];
|
|
180
|
+
let version;
|
|
181
|
+
for (const pkgName of OPTIMIZELY_PACKAGES) {
|
|
182
|
+
if (deps[pkgName]) {
|
|
183
|
+
foundPackages.push(pkgName);
|
|
184
|
+
if (!version && (pkgName === "@remkoj/optimizely-cms-nextjs" || pkgName === "@remkoj/optimizely-cms-react")) {
|
|
185
|
+
version = deps[pkgName].replace(/[\^~>=<]/g, "");
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
for (const pkgName of OPTIMIZELY_OFFICIAL_PACKAGES) {
|
|
190
|
+
if (deps[pkgName]) {
|
|
191
|
+
foundPackages.push(pkgName);
|
|
192
|
+
if (!version) {
|
|
193
|
+
version = deps[pkgName].replace(/[\^~>=<]/g, "");
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (foundPackages.length === 0 && deps["@remkoj/optimizely-graph-functions"]) {
|
|
198
|
+
foundPackages.push("@remkoj/optimizely-graph-functions");
|
|
199
|
+
}
|
|
200
|
+
return {
|
|
201
|
+
optimizelySaas: foundPackages.length > 0,
|
|
202
|
+
optimizelyVersion: version || void 0,
|
|
203
|
+
optimizelyPackages: foundPackages
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
156
207
|
// src/scanner/styling.ts
|
|
157
208
|
import path3 from "path";
|
|
158
209
|
function detectStyling(projectPath, pkg) {
|
|
@@ -709,6 +760,7 @@ async function scanProject(projectPath) {
|
|
|
709
760
|
const projectName = pkg.name || path13.basename(projectPath);
|
|
710
761
|
const nextjsResult = detectNextjs(projectPath, pkg);
|
|
711
762
|
const sitecoreResult = detectSitecore(pkg);
|
|
763
|
+
const optimizelyResult = detectOptimizely(pkg);
|
|
712
764
|
const stylingResult = detectStyling(projectPath, pkg);
|
|
713
765
|
const tsResult = detectTypescript(projectPath);
|
|
714
766
|
const monorepoResult = detectMonorepo(projectPath, pkg);
|
|
@@ -720,9 +772,14 @@ async function scanProject(projectPath) {
|
|
|
720
772
|
const staticSiteResult = detectStaticSite(projectPath, pkg);
|
|
721
773
|
const aiIgnorePatterns = loadAiIgnorePatterns(projectPath);
|
|
722
774
|
const figmaDetected = figmaResult.figmaMcp || figmaResult.figmaCodeCli || figmaResult.designTokens;
|
|
775
|
+
const cmsResult = sitecoreResult.cms !== "none" ? sitecoreResult : optimizelyResult.optimizelySaas ? {
|
|
776
|
+
cms: "optimizely-saas",
|
|
777
|
+
optimizelyVersion: optimizelyResult.optimizelyVersion,
|
|
778
|
+
optimizelyPackages: optimizelyResult.optimizelyPackages
|
|
779
|
+
} : sitecoreResult;
|
|
723
780
|
return {
|
|
724
781
|
...nextjsResult,
|
|
725
|
-
...
|
|
782
|
+
...cmsResult,
|
|
726
783
|
...stylingResult,
|
|
727
784
|
...tsResult,
|
|
728
785
|
...monorepoResult,
|
|
@@ -817,7 +874,9 @@ function selectFragments(scan) {
|
|
|
817
874
|
fragments.push("nextjs-pages-router");
|
|
818
875
|
}
|
|
819
876
|
}
|
|
820
|
-
if (scan.cms
|
|
877
|
+
if (scan.cms === "optimizely-saas") {
|
|
878
|
+
fragments.push("optimizely-saas");
|
|
879
|
+
} else if (scan.cms !== "none") {
|
|
821
880
|
fragments.push("sitecore-xmc");
|
|
822
881
|
}
|
|
823
882
|
if (scan.styling.includes("tailwind")) {
|
|
@@ -851,7 +910,11 @@ function buildVariables(scan) {
|
|
|
851
910
|
techStack.push(`Next.js ${scan.nextjsVersion || ""}`);
|
|
852
911
|
}
|
|
853
912
|
if (scan.cms !== "none") {
|
|
854
|
-
if (scan.cms === "
|
|
913
|
+
if (scan.cms === "optimizely-saas") {
|
|
914
|
+
techStack.push(
|
|
915
|
+
`Optimizely SaaS CMS${scan.optimizelyVersion ? ` (SDK ${scan.optimizelyVersion})` : ""}`
|
|
916
|
+
);
|
|
917
|
+
} else if (scan.cms === "sitecore-xmc-v2") {
|
|
855
918
|
techStack.push(
|
|
856
919
|
`Sitecore XM Cloud${scan.sitecoreContentSdkVersion ? ` (Content SDK ${scan.sitecoreContentSdkVersion})` : " (Content SDK v2)"}`
|
|
857
920
|
);
|
|
@@ -920,9 +983,13 @@ function buildCursorVariables(scan) {
|
|
|
920
983
|
techStack.push(`Next.js ${scan.nextjsVersion || ""}`);
|
|
921
984
|
}
|
|
922
985
|
if (scan.cms !== "none") {
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
986
|
+
if (scan.cms === "optimizely-saas") {
|
|
987
|
+
techStack.push("Optimizely SaaS CMS");
|
|
988
|
+
} else {
|
|
989
|
+
techStack.push(
|
|
990
|
+
scan.cms === "sitecore-xmc-v2" || scan.cms === "sitecore-xmc" ? "Sitecore XM Cloud" : "Sitecore JSS"
|
|
991
|
+
);
|
|
992
|
+
}
|
|
926
993
|
}
|
|
927
994
|
if (scan.typescript) techStack.push("TypeScript");
|
|
928
995
|
if (scan.styling.includes("tailwind")) techStack.push("Tailwind CSS");
|
|
@@ -958,6 +1025,10 @@ var MDC_CONFIG = {
|
|
|
958
1025
|
description: "Sitecore XM Cloud component patterns and field helpers",
|
|
959
1026
|
globs: "src/components/**/*.{ts,tsx}"
|
|
960
1027
|
},
|
|
1028
|
+
"optimizely-saas": {
|
|
1029
|
+
description: "Optimizely SaaS CMS patterns, Visual Builder, and Graph API",
|
|
1030
|
+
globs: "src/components/**/*.{ts,tsx}, src/gql/**/*.{ts,graphql}"
|
|
1031
|
+
},
|
|
961
1032
|
tailwind: {
|
|
962
1033
|
description: "Tailwind CSS conventions and utility patterns",
|
|
963
1034
|
globs: "**/*.{tsx,jsx,css}"
|