@famgia/omnify-laravel 0.0.118 → 0.0.120
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/{chunk-3YANFHE5.js → chunk-NMX3TLZT.js} +35 -6
- package/dist/{chunk-3YANFHE5.js.map → chunk-NMX3TLZT.js.map} +1 -1
- package/dist/index.cjs +34 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1 -1
- package/dist/plugin.cjs +34 -5
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.js +1 -1
- package/package.json +4 -4
- package/stubs/ai-guides/claude-checklists/react.md.stub +108 -0
- package/stubs/ai-guides/claude-rules/laravel-controllers.md.stub +57 -0
- package/stubs/ai-guides/claude-rules/laravel-migrations.md.stub +47 -0
- package/stubs/ai-guides/claude-rules/laravel-tests.md.stub +52 -0
- package/stubs/ai-guides/claude-rules/naming.md.stub +5 -0
- package/stubs/ai-guides/claude-rules/performance.md.stub +5 -0
- package/stubs/ai-guides/claude-rules/react-components.md.stub +67 -0
- package/stubs/ai-guides/claude-rules/schema-yaml.md.stub +69 -0
- package/stubs/ai-guides/claude-rules/security.md.stub +5 -0
- package/stubs/ai-guides/cursor/omnify-schema.mdc.stub +339 -0
- package/stubs/ai-guides/cursor/react-design.mdc.stub +693 -0
- package/stubs/ai-guides/cursor/react-form.mdc.stub +277 -0
- package/stubs/ai-guides/cursor/react-services.mdc.stub +304 -0
- package/stubs/ai-guides/cursor/react.mdc.stub +336 -0
- package/stubs/ai-guides/cursor/schema-create.mdc.stub +344 -0
- package/stubs/ai-guides/react/README.md.stub +221 -0
- package/stubs/ai-guides/react/antd-guide.md.stub +457 -0
- package/stubs/ai-guides/react/checklist.md.stub +108 -0
- package/stubs/ai-guides/react/datetime-guide.md.stub +137 -0
- package/stubs/ai-guides/react/design-philosophy.md.stub +363 -0
- package/stubs/ai-guides/react/i18n-guide.md.stub +211 -0
- package/stubs/ai-guides/react/laravel-integration.md.stub +181 -0
- package/stubs/ai-guides/react/service-pattern.md.stub +180 -0
- package/stubs/ai-guides/react/tanstack-query.md.stub +339 -0
- package/stubs/ai-guides/react/types-guide.md.stub +671 -0
|
@@ -4190,8 +4190,25 @@ function extractLaravelBasePath(modelsPath) {
|
|
|
4190
4190
|
}
|
|
4191
4191
|
return "app";
|
|
4192
4192
|
}
|
|
4193
|
-
function
|
|
4194
|
-
|
|
4193
|
+
function extractLaravelRoot(basePath) {
|
|
4194
|
+
const normalized = basePath.replace(/\\/g, "/");
|
|
4195
|
+
const match = normalized.match(/^(.+?)\/app$/);
|
|
4196
|
+
if (match && match[1]) {
|
|
4197
|
+
return match[1];
|
|
4198
|
+
}
|
|
4199
|
+
return "";
|
|
4200
|
+
}
|
|
4201
|
+
function replacePlaceholders(content, basePath, typescriptPath) {
|
|
4202
|
+
const root = extractLaravelRoot(basePath);
|
|
4203
|
+
let result = content.replace(/\{\{LARAVEL_BASE\}\}/g, basePath);
|
|
4204
|
+
if (root) {
|
|
4205
|
+
result = result.replace(/\{\{LARAVEL_ROOT\}\}/g, root + "/");
|
|
4206
|
+
} else {
|
|
4207
|
+
result = result.replace(/\{\{LARAVEL_ROOT\}\}/g, "");
|
|
4208
|
+
}
|
|
4209
|
+
const tsPath = typescriptPath || "resources/ts";
|
|
4210
|
+
result = result.replace(/\{\{TYPESCRIPT_BASE\}\}/g, tsPath);
|
|
4211
|
+
return result;
|
|
4195
4212
|
}
|
|
4196
4213
|
function copyStubs(srcDir, destDir, transform) {
|
|
4197
4214
|
const writtenFiles = [];
|
|
@@ -4224,6 +4241,7 @@ function copyStubs(srcDir, destDir, transform) {
|
|
|
4224
4241
|
function generateAIGuides(rootDir, options = {}) {
|
|
4225
4242
|
const stubsDir = getStubsDir();
|
|
4226
4243
|
const basePath = options.laravelBasePath || extractLaravelBasePath(options.modelsPath);
|
|
4244
|
+
const tsPath = options.typescriptBasePath || "resources/ts";
|
|
4227
4245
|
const result = {
|
|
4228
4246
|
claudeGuides: 0,
|
|
4229
4247
|
claudeRules: 0,
|
|
@@ -4251,10 +4269,21 @@ function generateAIGuides(rootDir, options = {}) {
|
|
|
4251
4269
|
result.claudeGuides = files.length;
|
|
4252
4270
|
result.files.push(...files);
|
|
4253
4271
|
}
|
|
4272
|
+
const reactSrcDir = join(stubsDir, "react");
|
|
4273
|
+
const reactDestDir = resolve(rootDir, ".claude/omnify/guides/react");
|
|
4274
|
+
if (existsSync(reactSrcDir)) {
|
|
4275
|
+
const files = copyStubs(reactSrcDir, reactDestDir);
|
|
4276
|
+
result.claudeGuides += files.length;
|
|
4277
|
+
result.files.push(...files);
|
|
4278
|
+
}
|
|
4254
4279
|
const claudeRulesSrcDir = join(stubsDir, "claude-rules");
|
|
4255
|
-
const claudeRulesDestDir = resolve(rootDir, ".claude/omnify
|
|
4280
|
+
const claudeRulesDestDir = resolve(rootDir, ".claude/rules/omnify");
|
|
4256
4281
|
if (existsSync(claudeRulesSrcDir)) {
|
|
4257
|
-
const files = copyStubs(
|
|
4282
|
+
const files = copyStubs(
|
|
4283
|
+
claudeRulesSrcDir,
|
|
4284
|
+
claudeRulesDestDir,
|
|
4285
|
+
(content) => replacePlaceholders(content, basePath, tsPath)
|
|
4286
|
+
);
|
|
4258
4287
|
result.claudeRules = files.length;
|
|
4259
4288
|
result.files.push(...files);
|
|
4260
4289
|
}
|
|
@@ -4292,7 +4321,7 @@ function generateAIGuides(rootDir, options = {}) {
|
|
|
4292
4321
|
const files = copyStubs(
|
|
4293
4322
|
cursorSrcDir,
|
|
4294
4323
|
cursorDestDir,
|
|
4295
|
-
(content) => replacePlaceholders(content, basePath)
|
|
4324
|
+
(content) => replacePlaceholders(content, basePath, tsPath)
|
|
4296
4325
|
);
|
|
4297
4326
|
result.cursorRules = files.length;
|
|
4298
4327
|
result.files.push(...files);
|
|
@@ -4839,4 +4868,4 @@ export {
|
|
|
4839
4868
|
shouldGenerateAIGuides,
|
|
4840
4869
|
laravelPlugin
|
|
4841
4870
|
};
|
|
4842
|
-
//# sourceMappingURL=chunk-
|
|
4871
|
+
//# sourceMappingURL=chunk-NMX3TLZT.js.map
|