@famgia/omnify-typescript 0.0.147 → 0.0.149

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
@@ -9,9 +9,9 @@ import { LocaleConfig, CustomTypeDefinition, PluginEnumDefinition, PropertyDefin
9
9
  /**
10
10
  * File category for organizing output.
11
11
  * - schema: Model schemas (user-editable)
12
- * - base: Base files (auto-generated, goes to node_modules/@omnify-client/schemas)
12
+ * - base: Base files (auto-generated, goes to node_modules/@omnify-base/schemas)
13
13
  * - enum: Schema enums (user-editable)
14
- * - plugin-enum: Plugin enums (auto-generated, goes to node_modules/@omnify-client/enum)
14
+ * - plugin-enum: Plugin enums (auto-generated, goes to node_modules/@omnify-base/enum)
15
15
  */
16
16
  type FileCategory = 'schema' | 'base' | 'enum' | 'plugin-enum';
17
17
  /**
@@ -95,15 +95,15 @@ interface TypeScriptOptions {
95
95
  readonly useJsExtension?: boolean | undefined;
96
96
  /**
97
97
  * Import path prefix for plugin enums.
98
- * Plugin enums are generated to node_modules/@omnify-client/enum/ and imported from this path.
99
- * @example '@omnify-client/enum' - for node_modules/@omnify-client/enum with package alias
98
+ * Plugin enums are generated to node_modules/@omnify-base/enum/ and imported from this path.
99
+ * @example '@omnify-base/enum' - for node_modules/@omnify-base/enum with package alias
100
100
  * @default '../enum/plugin' - legacy behavior (plugin enums in enum/plugin/)
101
101
  */
102
102
  readonly pluginEnumImportPrefix?: string | undefined;
103
103
  /**
104
104
  * Import path prefix for base schema files.
105
- * Base files are generated to node_modules/@omnify-client/schemas/ and imported from this path.
106
- * @example '@omnify-client/schemas' - for node_modules/@omnify-client/schemas with package alias
105
+ * Base files are generated to node_modules/@omnify-base/schemas/ and imported from this path.
106
+ * @example '@omnify-base/schemas' - for node_modules/@omnify-base/schemas with package alias
107
107
  * @default './base' - legacy behavior (base files in schemas/base/)
108
108
  */
109
109
  readonly baseImportPrefix?: string | undefined;
@@ -381,65 +381,6 @@ declare function generateModelRules(schema: LoadedSchema, locales: string[], fal
381
381
  */
382
382
  declare function generateRulesFiles(schemas: SchemaCollection, options?: TypeScriptOptions): TypeScriptFile[];
383
383
 
384
- /**
385
- * Stub file utilities for React/Ant Design/TanStack Query utilities.
386
- *
387
- * NOTE: Stub files are NO LONGER generated into projects.
388
- * All runtime utilities should be imported from @famgia/omnify-client-react:
389
- *
390
- * ```typescript
391
- * import {
392
- * // Components
393
- * JapaneseNameField,
394
- * JapaneseAddressField,
395
- * JapaneseBankField,
396
- *
397
- * // Hooks
398
- * useFormMutation,
399
- *
400
- * // Utilities
401
- * zodRule,
402
- * setZodLocale,
403
- * kanaString,
404
- * } from '@famgia/omnify-client-react';
405
- * ```
406
- *
407
- * Only schema files (editable) and schema enums are generated into the project.
408
- */
409
- interface StubFile {
410
- stub: string;
411
- output: string;
412
- indexExport: string;
413
- }
414
- /**
415
- * Stub file definitions - empty since all utilities come from @famgia/omnify-client-react
416
- */
417
- declare const STUB_FILES: readonly StubFile[];
418
- interface CopyStubsOptions {
419
- /** Target directory (e.g., 'resources/ts/omnify') */
420
- targetDir: string;
421
- /** Skip if file exists (default: false - always overwrite library files) */
422
- skipIfExists?: boolean;
423
- }
424
- interface CopyStubsResult {
425
- copied: string[];
426
- skipped: string[];
427
- }
428
- /**
429
- * Copy React utility stubs to the target directory.
430
- *
431
- * @example
432
- * copyStubs({
433
- * targetDir: 'resources/ts/omnify',
434
- * skipIfExists: true,
435
- * });
436
- */
437
- declare function copyStubs(options: CopyStubsOptions): CopyStubsResult;
438
- /**
439
- * Get list of stub files that would be generated.
440
- */
441
- declare function getStubPaths(): string[];
442
-
443
384
  /**
444
385
  * AI Guides Generator for TypeScript/Frontend
445
386
  *
@@ -479,4 +420,26 @@ declare function generateAIGuides(rootDir: string, options?: AIGuidesOptions): A
479
420
  */
480
421
  declare function shouldGenerateAIGuides(rootDir: string): boolean;
481
422
 
482
- export { type AIGuidesOptions, type AIGuidesResult, type CopyStubsOptions, type CopyStubsResult, DEFAULT_VALIDATION_TEMPLATES, type ExtractedInlineEnum, type LocaleMap, STUB_FILES, type TSEnum, type TSEnumValue, type TSInterface, type TSProperty, type TSTypeAlias, type TypeScriptFile, type TypeScriptOptions, type ValidationTemplates, copyStubs, enumToUnionType, extractInlineEnums, formatEnum, formatInterface, formatProperty, formatTypeAlias, formatValidationMessage, generateAIGuides, generateEnums, generateInterfaces, generateModelRules, generatePluginEnums, generateRulesFiles, generateTypeScript, generateTypeScript as generateTypeScriptFiles, getPropertyType, getStubPaths, getValidationMessages, mergeValidationTemplates, pluginEnumToTSEnum, propertyToTSProperty, schemaToEnum, schemaToInterface, shouldGenerateAIGuides, toEnumMemberName, toEnumName, toInterfaceName, toPropertyName };
423
+ /**
424
+ * Stubs management for TypeScript generator
425
+ *
426
+ * Currently a placeholder - React utility stubs feature is not yet implemented.
427
+ */
428
+ interface CopyStubsOptions {
429
+ targetDir: string;
430
+ skipIfExists?: boolean;
431
+ }
432
+ interface CopyStubsResult {
433
+ copied: string[];
434
+ skipped: string[];
435
+ }
436
+ /**
437
+ * Copy React utility stubs to target directory.
438
+ *
439
+ * Currently returns empty result as React utility stubs feature
440
+ * is not yet implemented. The AI guides are handled separately
441
+ * via generateAIGuides().
442
+ */
443
+ declare function copyStubs(_options: CopyStubsOptions): CopyStubsResult;
444
+
445
+ export { type AIGuidesOptions, type AIGuidesResult, type CopyStubsOptions, type CopyStubsResult, DEFAULT_VALIDATION_TEMPLATES, type ExtractedInlineEnum, type LocaleMap, type TSEnum, type TSEnumValue, type TSInterface, type TSProperty, type TSTypeAlias, type TypeScriptFile, type TypeScriptOptions, type ValidationTemplates, copyStubs, enumToUnionType, extractInlineEnums, formatEnum, formatInterface, formatProperty, formatTypeAlias, formatValidationMessage, generateAIGuides, generateEnums, generateInterfaces, generateModelRules, generatePluginEnums, generateRulesFiles, generateTypeScript, generateTypeScript as generateTypeScriptFiles, getPropertyType, getValidationMessages, mergeValidationTemplates, pluginEnumToTSEnum, propertyToTSProperty, schemaToEnum, schemaToInterface, shouldGenerateAIGuides, toEnumMemberName, toEnumName, toInterfaceName, toPropertyName };
package/dist/index.d.ts CHANGED
@@ -9,9 +9,9 @@ import { LocaleConfig, CustomTypeDefinition, PluginEnumDefinition, PropertyDefin
9
9
  /**
10
10
  * File category for organizing output.
11
11
  * - schema: Model schemas (user-editable)
12
- * - base: Base files (auto-generated, goes to node_modules/@omnify-client/schemas)
12
+ * - base: Base files (auto-generated, goes to node_modules/@omnify-base/schemas)
13
13
  * - enum: Schema enums (user-editable)
14
- * - plugin-enum: Plugin enums (auto-generated, goes to node_modules/@omnify-client/enum)
14
+ * - plugin-enum: Plugin enums (auto-generated, goes to node_modules/@omnify-base/enum)
15
15
  */
16
16
  type FileCategory = 'schema' | 'base' | 'enum' | 'plugin-enum';
17
17
  /**
@@ -95,15 +95,15 @@ interface TypeScriptOptions {
95
95
  readonly useJsExtension?: boolean | undefined;
96
96
  /**
97
97
  * Import path prefix for plugin enums.
98
- * Plugin enums are generated to node_modules/@omnify-client/enum/ and imported from this path.
99
- * @example '@omnify-client/enum' - for node_modules/@omnify-client/enum with package alias
98
+ * Plugin enums are generated to node_modules/@omnify-base/enum/ and imported from this path.
99
+ * @example '@omnify-base/enum' - for node_modules/@omnify-base/enum with package alias
100
100
  * @default '../enum/plugin' - legacy behavior (plugin enums in enum/plugin/)
101
101
  */
102
102
  readonly pluginEnumImportPrefix?: string | undefined;
103
103
  /**
104
104
  * Import path prefix for base schema files.
105
- * Base files are generated to node_modules/@omnify-client/schemas/ and imported from this path.
106
- * @example '@omnify-client/schemas' - for node_modules/@omnify-client/schemas with package alias
105
+ * Base files are generated to node_modules/@omnify-base/schemas/ and imported from this path.
106
+ * @example '@omnify-base/schemas' - for node_modules/@omnify-base/schemas with package alias
107
107
  * @default './base' - legacy behavior (base files in schemas/base/)
108
108
  */
109
109
  readonly baseImportPrefix?: string | undefined;
@@ -381,65 +381,6 @@ declare function generateModelRules(schema: LoadedSchema, locales: string[], fal
381
381
  */
382
382
  declare function generateRulesFiles(schemas: SchemaCollection, options?: TypeScriptOptions): TypeScriptFile[];
383
383
 
384
- /**
385
- * Stub file utilities for React/Ant Design/TanStack Query utilities.
386
- *
387
- * NOTE: Stub files are NO LONGER generated into projects.
388
- * All runtime utilities should be imported from @famgia/omnify-client-react:
389
- *
390
- * ```typescript
391
- * import {
392
- * // Components
393
- * JapaneseNameField,
394
- * JapaneseAddressField,
395
- * JapaneseBankField,
396
- *
397
- * // Hooks
398
- * useFormMutation,
399
- *
400
- * // Utilities
401
- * zodRule,
402
- * setZodLocale,
403
- * kanaString,
404
- * } from '@famgia/omnify-client-react';
405
- * ```
406
- *
407
- * Only schema files (editable) and schema enums are generated into the project.
408
- */
409
- interface StubFile {
410
- stub: string;
411
- output: string;
412
- indexExport: string;
413
- }
414
- /**
415
- * Stub file definitions - empty since all utilities come from @famgia/omnify-client-react
416
- */
417
- declare const STUB_FILES: readonly StubFile[];
418
- interface CopyStubsOptions {
419
- /** Target directory (e.g., 'resources/ts/omnify') */
420
- targetDir: string;
421
- /** Skip if file exists (default: false - always overwrite library files) */
422
- skipIfExists?: boolean;
423
- }
424
- interface CopyStubsResult {
425
- copied: string[];
426
- skipped: string[];
427
- }
428
- /**
429
- * Copy React utility stubs to the target directory.
430
- *
431
- * @example
432
- * copyStubs({
433
- * targetDir: 'resources/ts/omnify',
434
- * skipIfExists: true,
435
- * });
436
- */
437
- declare function copyStubs(options: CopyStubsOptions): CopyStubsResult;
438
- /**
439
- * Get list of stub files that would be generated.
440
- */
441
- declare function getStubPaths(): string[];
442
-
443
384
  /**
444
385
  * AI Guides Generator for TypeScript/Frontend
445
386
  *
@@ -479,4 +420,26 @@ declare function generateAIGuides(rootDir: string, options?: AIGuidesOptions): A
479
420
  */
480
421
  declare function shouldGenerateAIGuides(rootDir: string): boolean;
481
422
 
482
- export { type AIGuidesOptions, type AIGuidesResult, type CopyStubsOptions, type CopyStubsResult, DEFAULT_VALIDATION_TEMPLATES, type ExtractedInlineEnum, type LocaleMap, STUB_FILES, type TSEnum, type TSEnumValue, type TSInterface, type TSProperty, type TSTypeAlias, type TypeScriptFile, type TypeScriptOptions, type ValidationTemplates, copyStubs, enumToUnionType, extractInlineEnums, formatEnum, formatInterface, formatProperty, formatTypeAlias, formatValidationMessage, generateAIGuides, generateEnums, generateInterfaces, generateModelRules, generatePluginEnums, generateRulesFiles, generateTypeScript, generateTypeScript as generateTypeScriptFiles, getPropertyType, getStubPaths, getValidationMessages, mergeValidationTemplates, pluginEnumToTSEnum, propertyToTSProperty, schemaToEnum, schemaToInterface, shouldGenerateAIGuides, toEnumMemberName, toEnumName, toInterfaceName, toPropertyName };
423
+ /**
424
+ * Stubs management for TypeScript generator
425
+ *
426
+ * Currently a placeholder - React utility stubs feature is not yet implemented.
427
+ */
428
+ interface CopyStubsOptions {
429
+ targetDir: string;
430
+ skipIfExists?: boolean;
431
+ }
432
+ interface CopyStubsResult {
433
+ copied: string[];
434
+ skipped: string[];
435
+ }
436
+ /**
437
+ * Copy React utility stubs to target directory.
438
+ *
439
+ * Currently returns empty result as React utility stubs feature
440
+ * is not yet implemented. The AI guides are handled separately
441
+ * via generateAIGuides().
442
+ */
443
+ declare function copyStubs(_options: CopyStubsOptions): CopyStubsResult;
444
+
445
+ export { type AIGuidesOptions, type AIGuidesResult, type CopyStubsOptions, type CopyStubsResult, DEFAULT_VALIDATION_TEMPLATES, type ExtractedInlineEnum, type LocaleMap, type TSEnum, type TSEnumValue, type TSInterface, type TSProperty, type TSTypeAlias, type TypeScriptFile, type TypeScriptOptions, type ValidationTemplates, copyStubs, enumToUnionType, extractInlineEnums, formatEnum, formatInterface, formatProperty, formatTypeAlias, formatValidationMessage, generateAIGuides, generateEnums, generateInterfaces, generateModelRules, generatePluginEnums, generateRulesFiles, generateTypeScript, generateTypeScript as generateTypeScriptFiles, getPropertyType, getValidationMessages, mergeValidationTemplates, pluginEnumToTSEnum, propertyToTSProperty, schemaToEnum, schemaToInterface, shouldGenerateAIGuides, toEnumMemberName, toEnumName, toInterfaceName, toPropertyName };
package/dist/index.js CHANGED
@@ -24,55 +24,7 @@ import {
24
24
  toEnumName,
25
25
  toInterfaceName,
26
26
  toPropertyName
27
- } from "./chunk-PA7B7ZFK.js";
28
-
29
- // src/stubs.ts
30
- import fs from "fs";
31
- import path from "path";
32
- import { fileURLToPath } from "url";
33
- var __filename = fileURLToPath(import.meta.url);
34
- var __dirname = path.dirname(__filename);
35
- var STUB_FILES = [];
36
- function copyStubs(options) {
37
- const { targetDir, skipIfExists = false } = options;
38
- const stubsDir = path.join(__dirname, "..", "stubs");
39
- const result = { copied: [], skipped: [] };
40
- const directories = /* @__PURE__ */ new Map();
41
- for (const { stub, output, indexExport } of STUB_FILES) {
42
- const stubPath = path.join(stubsDir, stub);
43
- const outputPath = path.join(targetDir, output);
44
- const outputDir = path.dirname(outputPath);
45
- const dirName = path.dirname(output).split("/")[0];
46
- if (!directories.has(dirName)) {
47
- directories.set(dirName, "");
48
- }
49
- directories.set(dirName, directories.get(dirName) + indexExport);
50
- if (!fs.existsSync(outputDir)) {
51
- fs.mkdirSync(outputDir, { recursive: true });
52
- }
53
- if (skipIfExists && fs.existsSync(outputPath)) {
54
- result.skipped.push(output);
55
- continue;
56
- }
57
- if (fs.existsSync(stubPath)) {
58
- const content = fs.readFileSync(stubPath, "utf-8");
59
- fs.writeFileSync(outputPath, content);
60
- result.copied.push(output);
61
- }
62
- }
63
- for (const [dirName, exports] of directories) {
64
- const indexPath = path.join(targetDir, dirName, "index.ts");
65
- if (skipIfExists && fs.existsSync(indexPath)) {
66
- continue;
67
- }
68
- fs.writeFileSync(indexPath, exports);
69
- result.copied.push(`${dirName}/index.ts`);
70
- }
71
- return result;
72
- }
73
- function getStubPaths() {
74
- return STUB_FILES.map((s) => s.output);
75
- }
27
+ } from "./chunk-VLDDJNHY.js";
76
28
 
77
29
  // src/ai-guides/generator.ts
78
30
  import { existsSync, readdirSync } from "fs";
@@ -127,9 +79,16 @@ function shouldGenerateAIGuides(rootDir) {
127
79
  return true;
128
80
  }
129
81
  }
82
+
83
+ // src/stubs.ts
84
+ function copyStubs(_options) {
85
+ return {
86
+ copied: [],
87
+ skipped: []
88
+ };
89
+ }
130
90
  export {
131
91
  DEFAULT_VALIDATION_TEMPLATES,
132
- STUB_FILES,
133
92
  copyStubs,
134
93
  enumToUnionType,
135
94
  extractInlineEnums,
@@ -147,7 +106,6 @@ export {
147
106
  generateTypeScript,
148
107
  generateTypeScript as generateTypeScriptFiles,
149
108
  getPropertyType,
150
- getStubPaths,
151
109
  getValidationMessages,
152
110
  mergeValidationTemplates,
153
111
  pluginEnumToTSEnum,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/stubs.ts","../src/ai-guides/generator.ts"],"sourcesContent":["/**\n * Stub file utilities for React/Ant Design/TanStack Query utilities.\n * \n * NOTE: Stub files are NO LONGER generated into projects.\n * All runtime utilities should be imported from @famgia/omnify-client-react:\n * \n * ```typescript\n * import {\n * // Components\n * JapaneseNameField,\n * JapaneseAddressField,\n * JapaneseBankField,\n * \n * // Hooks\n * useFormMutation,\n * \n * // Utilities\n * zodRule,\n * setZodLocale,\n * kanaString,\n * } from '@famgia/omnify-client-react';\n * ```\n * \n * Only schema files (editable) and schema enums are generated into the project.\n */\n\nimport fs from 'fs';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\ninterface StubFile {\n stub: string;\n output: string;\n indexExport: string;\n}\n\n/**\n * Stub file definitions - empty since all utilities come from @famgia/omnify-client-react\n */\nexport const STUB_FILES: readonly StubFile[] = [];\n\nexport interface CopyStubsOptions {\n /** Target directory (e.g., 'resources/ts/omnify') */\n targetDir: string;\n /** Skip if file exists (default: false - always overwrite library files) */\n skipIfExists?: boolean;\n}\n\nexport interface CopyStubsResult {\n copied: string[];\n skipped: string[];\n}\n\n/**\n * Copy React utility stubs to the target directory.\n *\n * @example\n * copyStubs({\n * targetDir: 'resources/ts/omnify',\n * skipIfExists: true,\n * });\n */\nexport function copyStubs(options: CopyStubsOptions): CopyStubsResult {\n const { targetDir, skipIfExists = false } = options;\n const stubsDir = path.join(__dirname, '..', 'stubs');\n const result: CopyStubsResult = { copied: [], skipped: [] };\n\n // Group stubs by directory for index file generation\n const directories = new Map<string, string>();\n\n for (const { stub, output, indexExport } of STUB_FILES) {\n const stubPath = path.join(stubsDir, stub);\n const outputPath = path.join(targetDir, output);\n const outputDir = path.dirname(outputPath);\n const dirName = path.dirname(output).split('/')[0]; // e.g., 'components', 'hooks', 'lib'\n\n // Track index exports per directory\n if (!directories.has(dirName)) {\n directories.set(dirName, '');\n }\n directories.set(dirName, directories.get(dirName)! + indexExport);\n\n // Create directory if not exists\n if (!fs.existsSync(outputDir)) {\n fs.mkdirSync(outputDir, { recursive: true });\n }\n\n // Skip if file exists and skipIfExists is true\n if (skipIfExists && fs.existsSync(outputPath)) {\n result.skipped.push(output);\n continue;\n }\n\n // Copy stub file\n if (fs.existsSync(stubPath)) {\n const content = fs.readFileSync(stubPath, 'utf-8');\n fs.writeFileSync(outputPath, content);\n result.copied.push(output);\n }\n }\n\n // Generate index files for each directory\n for (const [dirName, exports] of directories) {\n const indexPath = path.join(targetDir, dirName, 'index.ts');\n if (skipIfExists && fs.existsSync(indexPath)) {\n continue;\n }\n fs.writeFileSync(indexPath, exports);\n result.copied.push(`${dirName}/index.ts`);\n }\n\n return result;\n}\n\n/**\n * Get list of stub files that would be generated.\n */\nexport function getStubPaths(): string[] {\n return STUB_FILES.map(s => s.output);\n}\n","/**\n * AI Guides Generator for TypeScript/Frontend\n *\n * TypeScript/Reactプロジェクト用のAIガイド生成\n * @famgia/omnify-coreの統一ジェネレーターを使用\n */\n\nimport { existsSync, readdirSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport {\n generateAIGuides as coreGenerateAIGuides,\n} from '@famgia/omnify-core';\n\n/**\n * Options for AI guides generation\n */\nexport interface AIGuidesOptions {\n /**\n * TypeScript output path from config (e.g., 'resources/ts/omnify')\n * Used to extract the base path for glob replacement\n */\n typescriptPath?: string;\n\n /**\n * Base path for TypeScript files (default: extracted from typescriptPath or 'src')\n * Used for placeholder replacement in Cursor rules\n */\n typescriptBasePath?: string;\n}\n\n/**\n * Result of AI guides generation\n */\nexport interface AIGuidesResult {\n claudeGuides: number;\n claudeChecklists: number;\n cursorRules: number;\n files: string[];\n}\n\n/**\n * Extract TypeScript base path from typescriptPath\n * e.g., 'resources/ts/omnify' -> 'resources/ts'\n * e.g., 'src/generated' -> 'src'\n */\nfunction extractTypescriptBasePath(typescriptPath?: string): string {\n if (!typescriptPath) return 'src';\n\n const normalized = typescriptPath.replace(/\\\\/g, '/');\n\n // Remove last segment (omnify, generated, etc.)\n const parts = normalized.split('/').filter(Boolean);\n if (parts.length > 1) {\n return parts.slice(0, -1).join('/');\n }\n\n return 'src';\n}\n\n/**\n * Generate AI guides for Claude and Cursor\n */\nexport function generateAIGuides(\n rootDir: string,\n options: AIGuidesOptions = {}\n): AIGuidesResult {\n const basePath = options.typescriptBasePath || extractTypescriptBasePath(options.typescriptPath);\n\n // Coreジェネレーターを呼び出し\n const coreResult = coreGenerateAIGuides(rootDir, {\n placeholders: {\n TYPESCRIPT_BASE: basePath,\n LARAVEL_BASE: 'app',\n LARAVEL_ROOT: '',\n },\n // TypeScriptプロジェクトではReact関連のみ\n adapters: ['cursor', 'claude'],\n });\n\n // 結果を変換 (後方互換性のため)\n const result: AIGuidesResult = {\n claudeGuides: 0,\n claudeChecklists: 0,\n cursorRules: 0,\n files: coreResult.files,\n };\n\n // ファイル数をカウント\n const claudeCount = coreResult.counts['claude'] || 0;\n const cursorCount = coreResult.counts['cursor'] || 0;\n\n result.claudeGuides = Math.floor(claudeCount * 0.8);\n result.claudeChecklists = claudeCount - result.claudeGuides;\n result.cursorRules = cursorCount;\n\n return result;\n}\n\n/**\n * Check if AI guides need to be generated\n */\nexport function shouldGenerateAIGuides(rootDir: string): boolean {\n const claudeDir = resolve(rootDir, '.claude/omnify/guides/react');\n const cursorDir = resolve(rootDir, '.cursor/rules/omnify');\n\n if (!existsSync(claudeDir) || !existsSync(cursorDir)) {\n return true;\n }\n\n try {\n const claudeFiles = readdirSync(claudeDir);\n const cursorFiles = readdirSync(cursorDir);\n\n return claudeFiles.length === 0 || cursorFiles.length === 0;\n } catch {\n return true;\n }\n}\n"],"mappings":"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","names":[]}
1
+ {"version":3,"sources":["../src/ai-guides/generator.ts","../src/stubs.ts"],"sourcesContent":["/**\n * AI Guides Generator for TypeScript/Frontend\n *\n * TypeScript/Reactプロジェクト用のAIガイド生成\n * @famgia/omnify-coreの統一ジェネレーターを使用\n */\n\nimport { existsSync, readdirSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport {\n generateAIGuides as coreGenerateAIGuides,\n} from '@famgia/omnify-core';\n\n/**\n * Options for AI guides generation\n */\nexport interface AIGuidesOptions {\n /**\n * TypeScript output path from config (e.g., 'resources/ts/omnify')\n * Used to extract the base path for glob replacement\n */\n typescriptPath?: string;\n\n /**\n * Base path for TypeScript files (default: extracted from typescriptPath or 'src')\n * Used for placeholder replacement in Cursor rules\n */\n typescriptBasePath?: string;\n}\n\n/**\n * Result of AI guides generation\n */\nexport interface AIGuidesResult {\n claudeGuides: number;\n claudeChecklists: number;\n cursorRules: number;\n files: string[];\n}\n\n/**\n * Extract TypeScript base path from typescriptPath\n * e.g., 'resources/ts/omnify' -> 'resources/ts'\n * e.g., 'src/generated' -> 'src'\n */\nfunction extractTypescriptBasePath(typescriptPath?: string): string {\n if (!typescriptPath) return 'src';\n\n const normalized = typescriptPath.replace(/\\\\/g, '/');\n\n // Remove last segment (omnify, generated, etc.)\n const parts = normalized.split('/').filter(Boolean);\n if (parts.length > 1) {\n return parts.slice(0, -1).join('/');\n }\n\n return 'src';\n}\n\n/**\n * Generate AI guides for Claude and Cursor\n */\nexport function generateAIGuides(\n rootDir: string,\n options: AIGuidesOptions = {}\n): AIGuidesResult {\n const basePath = options.typescriptBasePath || extractTypescriptBasePath(options.typescriptPath);\n\n // Coreジェネレーターを呼び出し\n const coreResult = coreGenerateAIGuides(rootDir, {\n placeholders: {\n TYPESCRIPT_BASE: basePath,\n LARAVEL_BASE: 'app',\n LARAVEL_ROOT: '',\n },\n // TypeScriptプロジェクトではReact関連のみ\n adapters: ['cursor', 'claude'],\n });\n\n // 結果を変換 (後方互換性のため)\n const result: AIGuidesResult = {\n claudeGuides: 0,\n claudeChecklists: 0,\n cursorRules: 0,\n files: coreResult.files,\n };\n\n // ファイル数をカウント\n const claudeCount = coreResult.counts['claude'] || 0;\n const cursorCount = coreResult.counts['cursor'] || 0;\n\n result.claudeGuides = Math.floor(claudeCount * 0.8);\n result.claudeChecklists = claudeCount - result.claudeGuides;\n result.cursorRules = cursorCount;\n\n return result;\n}\n\n/**\n * Check if AI guides need to be generated\n */\nexport function shouldGenerateAIGuides(rootDir: string): boolean {\n const claudeDir = resolve(rootDir, '.claude/omnify/guides/react');\n const cursorDir = resolve(rootDir, '.cursor/rules/omnify');\n\n if (!existsSync(claudeDir) || !existsSync(cursorDir)) {\n return true;\n }\n\n try {\n const claudeFiles = readdirSync(claudeDir);\n const cursorFiles = readdirSync(cursorDir);\n\n return claudeFiles.length === 0 || cursorFiles.length === 0;\n } catch {\n return true;\n }\n}\n","/**\n * Stubs management for TypeScript generator\n *\n * Currently a placeholder - React utility stubs feature is not yet implemented.\n */\n\nexport interface CopyStubsOptions {\n targetDir: string;\n skipIfExists?: boolean;\n}\n\nexport interface CopyStubsResult {\n copied: string[];\n skipped: string[];\n}\n\n/**\n * Copy React utility stubs to target directory.\n *\n * Currently returns empty result as React utility stubs feature\n * is not yet implemented. The AI guides are handled separately\n * via generateAIGuides().\n */\nexport function copyStubs(_options: CopyStubsOptions): CopyStubsResult {\n // React utility stubs feature not yet implemented\n // AI guides are handled via generateAIGuides()\n return {\n copied: [],\n skipped: [],\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,SAAS,YAAY,mBAAmB;AACxC,SAAS,eAAe;AACxB;AAAA,EACI,oBAAoB;AAAA,OACjB;AAkCP,SAAS,0BAA0B,gBAAiC;AAChE,MAAI,CAAC,eAAgB,QAAO;AAE5B,QAAM,aAAa,eAAe,QAAQ,OAAO,GAAG;AAGpD,QAAM,QAAQ,WAAW,MAAM,GAAG,EAAE,OAAO,OAAO;AAClD,MAAI,MAAM,SAAS,GAAG;AAClB,WAAO,MAAM,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG;AAAA,EACtC;AAEA,SAAO;AACX;AAKO,SAAS,iBACZ,SACA,UAA2B,CAAC,GACd;AACd,QAAM,WAAW,QAAQ,sBAAsB,0BAA0B,QAAQ,cAAc;AAG/F,QAAM,aAAa,qBAAqB,SAAS;AAAA,IAC7C,cAAc;AAAA,MACV,iBAAiB;AAAA,MACjB,cAAc;AAAA,MACd,cAAc;AAAA,IAClB;AAAA;AAAA,IAEA,UAAU,CAAC,UAAU,QAAQ;AAAA,EACjC,CAAC;AAGD,QAAM,SAAyB;AAAA,IAC3B,cAAc;AAAA,IACd,kBAAkB;AAAA,IAClB,aAAa;AAAA,IACb,OAAO,WAAW;AAAA,EACtB;AAGA,QAAM,cAAc,WAAW,OAAO,QAAQ,KAAK;AACnD,QAAM,cAAc,WAAW,OAAO,QAAQ,KAAK;AAEnD,SAAO,eAAe,KAAK,MAAM,cAAc,GAAG;AAClD,SAAO,mBAAmB,cAAc,OAAO;AAC/C,SAAO,cAAc;AAErB,SAAO;AACX;AAKO,SAAS,uBAAuB,SAA0B;AAC7D,QAAM,YAAY,QAAQ,SAAS,6BAA6B;AAChE,QAAM,YAAY,QAAQ,SAAS,sBAAsB;AAEzD,MAAI,CAAC,WAAW,SAAS,KAAK,CAAC,WAAW,SAAS,GAAG;AAClD,WAAO;AAAA,EACX;AAEA,MAAI;AACA,UAAM,cAAc,YAAY,SAAS;AACzC,UAAM,cAAc,YAAY,SAAS;AAEzC,WAAO,YAAY,WAAW,KAAK,YAAY,WAAW;AAAA,EAC9D,QAAQ;AACJ,WAAO;AAAA,EACX;AACJ;;;AC9FO,SAAS,UAAU,UAA6C;AAGnE,SAAO;AAAA,IACH,QAAQ,CAAC;AAAA,IACT,SAAS,CAAC;AAAA,EACd;AACJ;","names":[]}