@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.
Files changed (36) hide show
  1. package/dist/{chunk-3YANFHE5.js → chunk-NMX3TLZT.js} +35 -6
  2. package/dist/{chunk-3YANFHE5.js.map → chunk-NMX3TLZT.js.map} +1 -1
  3. package/dist/index.cjs +34 -5
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts +5 -0
  6. package/dist/index.d.ts +5 -0
  7. package/dist/index.js +1 -1
  8. package/dist/plugin.cjs +34 -5
  9. package/dist/plugin.cjs.map +1 -1
  10. package/dist/plugin.js +1 -1
  11. package/package.json +4 -4
  12. package/stubs/ai-guides/claude-checklists/react.md.stub +108 -0
  13. package/stubs/ai-guides/claude-rules/laravel-controllers.md.stub +57 -0
  14. package/stubs/ai-guides/claude-rules/laravel-migrations.md.stub +47 -0
  15. package/stubs/ai-guides/claude-rules/laravel-tests.md.stub +52 -0
  16. package/stubs/ai-guides/claude-rules/naming.md.stub +5 -0
  17. package/stubs/ai-guides/claude-rules/performance.md.stub +5 -0
  18. package/stubs/ai-guides/claude-rules/react-components.md.stub +67 -0
  19. package/stubs/ai-guides/claude-rules/schema-yaml.md.stub +69 -0
  20. package/stubs/ai-guides/claude-rules/security.md.stub +5 -0
  21. package/stubs/ai-guides/cursor/omnify-schema.mdc.stub +339 -0
  22. package/stubs/ai-guides/cursor/react-design.mdc.stub +693 -0
  23. package/stubs/ai-guides/cursor/react-form.mdc.stub +277 -0
  24. package/stubs/ai-guides/cursor/react-services.mdc.stub +304 -0
  25. package/stubs/ai-guides/cursor/react.mdc.stub +336 -0
  26. package/stubs/ai-guides/cursor/schema-create.mdc.stub +344 -0
  27. package/stubs/ai-guides/react/README.md.stub +221 -0
  28. package/stubs/ai-guides/react/antd-guide.md.stub +457 -0
  29. package/stubs/ai-guides/react/checklist.md.stub +108 -0
  30. package/stubs/ai-guides/react/datetime-guide.md.stub +137 -0
  31. package/stubs/ai-guides/react/design-philosophy.md.stub +363 -0
  32. package/stubs/ai-guides/react/i18n-guide.md.stub +211 -0
  33. package/stubs/ai-guides/react/laravel-integration.md.stub +181 -0
  34. package/stubs/ai-guides/react/service-pattern.md.stub +180 -0
  35. package/stubs/ai-guides/react/tanstack-query.md.stub +339 -0
  36. package/stubs/ai-guides/react/types-guide.md.stub +671 -0
package/dist/index.cjs CHANGED
@@ -4248,8 +4248,25 @@ function extractLaravelBasePath(modelsPath) {
4248
4248
  }
4249
4249
  return "app";
4250
4250
  }
4251
- function replacePlaceholders(content, basePath) {
4252
- return content.replace(/\{\{LARAVEL_BASE\}\}/g, basePath);
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,
@@ -4309,10 +4327,21 @@ function generateAIGuides(rootDir, options = {}) {
4309
4327
  result.claudeGuides = files.length;
4310
4328
  result.files.push(...files);
4311
4329
  }
4330
+ const reactSrcDir = (0, import_node_path.join)(stubsDir, "react");
4331
+ const reactDestDir = (0, import_node_path.resolve)(rootDir, ".claude/omnify/guides/react");
4332
+ if ((0, import_node_fs.existsSync)(reactSrcDir)) {
4333
+ const files = copyStubs(reactSrcDir, reactDestDir);
4334
+ result.claudeGuides += files.length;
4335
+ result.files.push(...files);
4336
+ }
4312
4337
  const claudeRulesSrcDir = (0, import_node_path.join)(stubsDir, "claude-rules");
4313
- const claudeRulesDestDir = (0, import_node_path.resolve)(rootDir, ".claude/omnify/rules");
4338
+ const claudeRulesDestDir = (0, import_node_path.resolve)(rootDir, ".claude/rules/omnify");
4314
4339
  if ((0, import_node_fs.existsSync)(claudeRulesSrcDir)) {
4315
- const files = copyStubs(claudeRulesSrcDir, claudeRulesDestDir);
4340
+ const files = copyStubs(
4341
+ claudeRulesSrcDir,
4342
+ claudeRulesDestDir,
4343
+ (content) => replacePlaceholders(content, basePath, tsPath)
4344
+ );
4316
4345
  result.claudeRules = files.length;
4317
4346
  result.files.push(...files);
4318
4347
  }
@@ -4350,7 +4379,7 @@ function generateAIGuides(rootDir, options = {}) {
4350
4379
  const files = copyStubs(
4351
4380
  cursorSrcDir,
4352
4381
  cursorDestDir,
4353
- (content) => replacePlaceholders(content, basePath)
4382
+ (content) => replacePlaceholders(content, basePath, tsPath)
4354
4383
  );
4355
4384
  result.cursorRules = files.length;
4356
4385
  result.files.push(...files);