@famgia/omnify-laravel 0.0.118 → 0.0.119
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-7I6UNXOD.js} +28 -6
- package/dist/{chunk-3YANFHE5.js.map → chunk-7I6UNXOD.js.map} +1 -1
- package/dist/index.cjs +27 -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 +27 -5
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.js +1 -1
- package/package.json +4 -4
- 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/dist/index.cjs
CHANGED
|
@@ -4248,8 +4248,25 @@ function extractLaravelBasePath(modelsPath) {
|
|
|
4248
4248
|
}
|
|
4249
4249
|
return "app";
|
|
4250
4250
|
}
|
|
4251
|
-
function
|
|
4252
|
-
|
|
4251
|
+
function extractLaravelRoot(basePath) {
|
|
4252
|
+
const normalized = basePath.replace(/\\/g, "/");
|
|
4253
|
+
const match = normalized.match(/^(.+?)\/app$/);
|
|
4254
|
+
if (match && match[1]) {
|
|
4255
|
+
return match[1];
|
|
4256
|
+
}
|
|
4257
|
+
return "";
|
|
4258
|
+
}
|
|
4259
|
+
function replacePlaceholders(content, basePath, typescriptPath) {
|
|
4260
|
+
const root = extractLaravelRoot(basePath);
|
|
4261
|
+
let result = content.replace(/\{\{LARAVEL_BASE\}\}/g, basePath);
|
|
4262
|
+
if (root) {
|
|
4263
|
+
result = result.replace(/\{\{LARAVEL_ROOT\}\}/g, root + "/");
|
|
4264
|
+
} else {
|
|
4265
|
+
result = result.replace(/\{\{LARAVEL_ROOT\}\}/g, "");
|
|
4266
|
+
}
|
|
4267
|
+
const tsPath = typescriptPath || "resources/ts";
|
|
4268
|
+
result = result.replace(/\{\{TYPESCRIPT_BASE\}\}/g, tsPath);
|
|
4269
|
+
return result;
|
|
4253
4270
|
}
|
|
4254
4271
|
function copyStubs(srcDir, destDir, transform) {
|
|
4255
4272
|
const writtenFiles = [];
|
|
@@ -4282,6 +4299,7 @@ function copyStubs(srcDir, destDir, transform) {
|
|
|
4282
4299
|
function generateAIGuides(rootDir, options = {}) {
|
|
4283
4300
|
const stubsDir = getStubsDir();
|
|
4284
4301
|
const basePath = options.laravelBasePath || extractLaravelBasePath(options.modelsPath);
|
|
4302
|
+
const tsPath = options.typescriptBasePath || "resources/ts";
|
|
4285
4303
|
const result = {
|
|
4286
4304
|
claudeGuides: 0,
|
|
4287
4305
|
claudeRules: 0,
|
|
@@ -4310,9 +4328,13 @@ function generateAIGuides(rootDir, options = {}) {
|
|
|
4310
4328
|
result.files.push(...files);
|
|
4311
4329
|
}
|
|
4312
4330
|
const claudeRulesSrcDir = (0, import_node_path.join)(stubsDir, "claude-rules");
|
|
4313
|
-
const claudeRulesDestDir = (0, import_node_path.resolve)(rootDir, ".claude/omnify
|
|
4331
|
+
const claudeRulesDestDir = (0, import_node_path.resolve)(rootDir, ".claude/rules/omnify");
|
|
4314
4332
|
if ((0, import_node_fs.existsSync)(claudeRulesSrcDir)) {
|
|
4315
|
-
const files = copyStubs(
|
|
4333
|
+
const files = copyStubs(
|
|
4334
|
+
claudeRulesSrcDir,
|
|
4335
|
+
claudeRulesDestDir,
|
|
4336
|
+
(content) => replacePlaceholders(content, basePath, tsPath)
|
|
4337
|
+
);
|
|
4316
4338
|
result.claudeRules = files.length;
|
|
4317
4339
|
result.files.push(...files);
|
|
4318
4340
|
}
|
|
@@ -4350,7 +4372,7 @@ function generateAIGuides(rootDir, options = {}) {
|
|
|
4350
4372
|
const files = copyStubs(
|
|
4351
4373
|
cursorSrcDir,
|
|
4352
4374
|
cursorDestDir,
|
|
4353
|
-
(content) => replacePlaceholders(content, basePath)
|
|
4375
|
+
(content) => replacePlaceholders(content, basePath, tsPath)
|
|
4354
4376
|
);
|
|
4355
4377
|
result.cursorRules = files.length;
|
|
4356
4378
|
result.files.push(...files);
|