@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/index.d.cts CHANGED
@@ -477,6 +477,11 @@ interface AIGuidesOptions {
477
477
  * Used for placeholder replacement in Cursor rules
478
478
  */
479
479
  laravelBasePath?: string;
480
+ /**
481
+ * TypeScript/React base path (e.g., 'resources/ts' or 'frontend/src')
482
+ * Used for placeholder replacement in Cursor rules
483
+ */
484
+ typescriptBasePath?: string;
480
485
  }
481
486
  /**
482
487
  * Result of AI guides generation
package/dist/index.d.ts CHANGED
@@ -477,6 +477,11 @@ interface AIGuidesOptions {
477
477
  * Used for placeholder replacement in Cursor rules
478
478
  */
479
479
  laravelBasePath?: string;
480
+ /**
481
+ * TypeScript/React base path (e.g., 'resources/ts' or 'frontend/src')
482
+ * Used for placeholder replacement in Cursor rules
483
+ */
484
+ typescriptBasePath?: string;
480
485
  }
481
486
  /**
482
487
  * Result of AI guides generation
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ import {
31
31
  shouldGenerateAIGuides,
32
32
  toColumnName,
33
33
  toTableName
34
- } from "./chunk-3YANFHE5.js";
34
+ } from "./chunk-7I6UNXOD.js";
35
35
  export {
36
36
  extractManyToManyRelations,
37
37
  extractMorphToManyRelations,
package/dist/plugin.cjs CHANGED
@@ -4039,8 +4039,25 @@ function extractLaravelBasePath(modelsPath) {
4039
4039
  }
4040
4040
  return "app";
4041
4041
  }
4042
- function replacePlaceholders(content, basePath) {
4043
- return content.replace(/\{\{LARAVEL_BASE\}\}/g, basePath);
4042
+ function extractLaravelRoot(basePath) {
4043
+ const normalized = basePath.replace(/\\/g, "/");
4044
+ const match = normalized.match(/^(.+?)\/app$/);
4045
+ if (match && match[1]) {
4046
+ return match[1];
4047
+ }
4048
+ return "";
4049
+ }
4050
+ function replacePlaceholders(content, basePath, typescriptPath) {
4051
+ const root = extractLaravelRoot(basePath);
4052
+ let result = content.replace(/\{\{LARAVEL_BASE\}\}/g, basePath);
4053
+ if (root) {
4054
+ result = result.replace(/\{\{LARAVEL_ROOT\}\}/g, root + "/");
4055
+ } else {
4056
+ result = result.replace(/\{\{LARAVEL_ROOT\}\}/g, "");
4057
+ }
4058
+ const tsPath = typescriptPath || "resources/ts";
4059
+ result = result.replace(/\{\{TYPESCRIPT_BASE\}\}/g, tsPath);
4060
+ return result;
4044
4061
  }
4045
4062
  function copyStubs(srcDir, destDir, transform) {
4046
4063
  const writtenFiles = [];
@@ -4073,6 +4090,7 @@ function copyStubs(srcDir, destDir, transform) {
4073
4090
  function generateAIGuides(rootDir, options = {}) {
4074
4091
  const stubsDir = getStubsDir();
4075
4092
  const basePath = options.laravelBasePath || extractLaravelBasePath(options.modelsPath);
4093
+ const tsPath = options.typescriptBasePath || "resources/ts";
4076
4094
  const result = {
4077
4095
  claudeGuides: 0,
4078
4096
  claudeRules: 0,
@@ -4101,9 +4119,13 @@ function generateAIGuides(rootDir, options = {}) {
4101
4119
  result.files.push(...files);
4102
4120
  }
4103
4121
  const claudeRulesSrcDir = (0, import_node_path.join)(stubsDir, "claude-rules");
4104
- const claudeRulesDestDir = (0, import_node_path.resolve)(rootDir, ".claude/omnify/rules");
4122
+ const claudeRulesDestDir = (0, import_node_path.resolve)(rootDir, ".claude/rules/omnify");
4105
4123
  if ((0, import_node_fs.existsSync)(claudeRulesSrcDir)) {
4106
- const files = copyStubs(claudeRulesSrcDir, claudeRulesDestDir);
4124
+ const files = copyStubs(
4125
+ claudeRulesSrcDir,
4126
+ claudeRulesDestDir,
4127
+ (content) => replacePlaceholders(content, basePath, tsPath)
4128
+ );
4107
4129
  result.claudeRules = files.length;
4108
4130
  result.files.push(...files);
4109
4131
  }
@@ -4141,7 +4163,7 @@ function generateAIGuides(rootDir, options = {}) {
4141
4163
  const files = copyStubs(
4142
4164
  cursorSrcDir,
4143
4165
  cursorDestDir,
4144
- (content) => replacePlaceholders(content, basePath)
4166
+ (content) => replacePlaceholders(content, basePath, tsPath)
4145
4167
  );
4146
4168
  result.cursorRules = files.length;
4147
4169
  result.files.push(...files);