@famgia/omnify 1.0.71 → 1.0.72

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@famgia/omnify",
3
- "version": "1.0.71",
3
+ "version": "1.0.72",
4
4
  "description": "Schema-driven database migration system with TypeScript types and Laravel migrations",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -25,14 +25,14 @@
25
25
  "README.md"
26
26
  ],
27
27
  "dependencies": {
28
- "@famgia/omnify-cli": "0.0.67",
29
- "@famgia/omnify-core": "0.0.61",
30
- "@famgia/omnify-types": "0.0.59",
31
- "@famgia/omnify-laravel": "0.0.70",
32
- "@famgia/omnify-typescript": "0.0.49",
33
- "@famgia/omnify-atlas": "0.0.55",
34
- "@famgia/omnify-mcp": "0.0.47",
35
- "@famgia/omnify-japan": "0.0.54"
28
+ "@famgia/omnify-cli": "0.0.68",
29
+ "@famgia/omnify-core": "0.0.62",
30
+ "@famgia/omnify-types": "0.0.60",
31
+ "@famgia/omnify-laravel": "0.0.71",
32
+ "@famgia/omnify-typescript": "0.0.50",
33
+ "@famgia/omnify-atlas": "0.0.56",
34
+ "@famgia/omnify-mcp": "0.0.48",
35
+ "@famgia/omnify-japan": "0.0.55"
36
36
  },
37
37
  "keywords": [
38
38
  "omnify",
@@ -174,26 +174,88 @@ function findProjectRoot() {
174
174
  return null;
175
175
  }
176
176
 
177
+ /**
178
+ * Copy ai-guides from a directory to the project's .claude/omnify folder
179
+ */
180
+ function copyAiGuidesFromDir(aiGuidesDir, omnifyDir) {
181
+ if (!fs.existsSync(aiGuidesDir)) return;
182
+
183
+ const files = fs.readdirSync(aiGuidesDir);
184
+ for (const file of files) {
185
+ const srcPath = path.join(aiGuidesDir, file);
186
+ const destPath = path.join(omnifyDir, file);
187
+
188
+ if (fs.statSync(srcPath).isFile()) {
189
+ fs.copyFileSync(srcPath, destPath);
190
+ console.log(` Created .claude/omnify/${file}`);
191
+ }
192
+ }
193
+ }
194
+
195
+ /**
196
+ * Find all @famgia/omnify-* packages with ai-guides directories
197
+ */
198
+ function findPluginAiGuides(projectRoot) {
199
+ const nodeModulesDir = path.join(projectRoot, 'node_modules');
200
+ const aiGuidesDirs = [];
201
+
202
+ // Check @famgia directory
203
+ const famgiaDir = path.join(nodeModulesDir, '@famgia');
204
+ if (fs.existsSync(famgiaDir)) {
205
+ const packages = fs.readdirSync(famgiaDir);
206
+ for (const pkg of packages) {
207
+ if (pkg.startsWith('omnify')) {
208
+ const aiGuidesPath = path.join(famgiaDir, pkg, 'ai-guides');
209
+ if (fs.existsSync(aiGuidesPath)) {
210
+ aiGuidesDirs.push(aiGuidesPath);
211
+ }
212
+ }
213
+ }
214
+ }
215
+
216
+ // Also check pnpm hoisted location (.pnpm/@famgia+omnify-xxx@version/node_modules/@famgia/omnify-xxx)
217
+ const pnpmDir = path.join(nodeModulesDir, '.pnpm');
218
+ if (fs.existsSync(pnpmDir)) {
219
+ try {
220
+ const pnpmPackages = fs.readdirSync(pnpmDir);
221
+ for (const pkg of pnpmPackages) {
222
+ if (pkg.startsWith('@famgia+omnify')) {
223
+ // Extract package name from pnpm folder name (e.g., @famgia+omnify-laravel@0.0.70 -> omnify-laravel)
224
+ const match = pkg.match(/@famgia\+([^@]+)@/);
225
+ if (match) {
226
+ const pkgName = match[1]; // e.g., omnify-laravel
227
+ const aiGuidesPath = path.join(pnpmDir, pkg, 'node_modules/@famgia', pkgName, 'ai-guides');
228
+ if (fs.existsSync(aiGuidesPath)) {
229
+ aiGuidesDirs.push(aiGuidesPath);
230
+ }
231
+ }
232
+ }
233
+ }
234
+ } catch {
235
+ // Ignore errors reading pnpm directory
236
+ }
237
+ }
238
+
239
+ return aiGuidesDirs;
240
+ }
241
+
177
242
  function copyAiGuidesToProject(projectRoot) {
178
243
  const omnifyDir = path.join(projectRoot, '.claude', 'omnify');
179
- const aiGuidesDir = path.join(__dirname, '..', 'ai-guides');
180
244
 
181
245
  try {
246
+ // Create .claude/omnify directory
182
247
  if (!fs.existsSync(omnifyDir)) {
183
248
  fs.mkdirSync(omnifyDir, { recursive: true });
184
249
  }
185
250
 
186
- if (fs.existsSync(aiGuidesDir)) {
187
- const files = fs.readdirSync(aiGuidesDir);
188
- for (const file of files) {
189
- const srcPath = path.join(aiGuidesDir, file);
190
- const destPath = path.join(omnifyDir, file);
251
+ // Copy from main omnify package
252
+ const mainAiGuidesDir = path.join(__dirname, '..', 'ai-guides');
253
+ copyAiGuidesFromDir(mainAiGuidesDir, omnifyDir);
191
254
 
192
- if (fs.statSync(srcPath).isFile()) {
193
- fs.copyFileSync(srcPath, destPath);
194
- console.log(` Created .claude/omnify/${file}`);
195
- }
196
- }
255
+ // Copy from all @famgia/omnify-* plugin packages
256
+ const pluginDirs = findPluginAiGuides(projectRoot);
257
+ for (const pluginDir of pluginDirs) {
258
+ copyAiGuidesFromDir(pluginDir, omnifyDir);
197
259
  }
198
260
 
199
261
  return true;