faf-cli 7.5.1 → 7.7.0
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/README.md +4 -5
- package/dist/cli.js +242 -238
- package/dist/cli.js.map +15 -12
- package/dist/detect/ruby.d.ts +38 -0
- package/dist/detect/swift.d.ts +53 -0
- package/dist/index.js +148 -144
- package/dist/index.js.map +10 -8
- package/package.json +1 -1
- package/project.faf +3 -3
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ruby detection — CONTENT-AWARE Gemfile / gemspec classification.
|
|
3
|
+
*
|
|
4
|
+
* Kill line: Gemfile alone ≠ Rails.
|
|
5
|
+
* Bundler backs libraries, Rails apps, Sinatra/Roda/Grape/Hanami, CLIs, and MCP
|
|
6
|
+
* servers. We read gem names (+ light layout), then branch.
|
|
7
|
+
*
|
|
8
|
+
* Same composition as go.ts / jvm.ts: knowledge in ruby-detection.json.
|
|
9
|
+
*/
|
|
10
|
+
export type RubyAppType = 'mcp' | 'backend' | 'cli' | 'library';
|
|
11
|
+
export interface RubyProject {
|
|
12
|
+
appType: RubyAppType;
|
|
13
|
+
/** Primary framework label (Rails / Sinatra / …) or ''. */
|
|
14
|
+
framework: string;
|
|
15
|
+
/** package manager signal */
|
|
16
|
+
packageManager: 'bundler' | 'rubygems';
|
|
17
|
+
/** Glass Hood rationale for .faf `# found:`. */
|
|
18
|
+
found: string;
|
|
19
|
+
}
|
|
20
|
+
/** True if directory looks like a Ruby project root. */
|
|
21
|
+
export declare function isRubyRoot(dir: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Extract gem names from a Gemfile / gems.rb (static — does NOT execute Ruby).
|
|
24
|
+
* Handles: gem 'x', gem "x", gem :x (rare), gem "x", "1.0"
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseGemfileGems(content: string): Set<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Extract gem names from Gemfile.lock SPECS sections (static).
|
|
29
|
+
* Lines like " rails (7.1.0)" under GEM specs.
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseGemfileLockGems(content: string): Set<string>;
|
|
32
|
+
/** Gem names from *.gemspec dependency lines (static). */
|
|
33
|
+
export declare function parseGemspecGems(content: string): Set<string>;
|
|
34
|
+
/**
|
|
35
|
+
* Classify a Ruby project from Gemfile / lock / gemspec (+ light layout).
|
|
36
|
+
* Returns null if not a Ruby root.
|
|
37
|
+
*/
|
|
38
|
+
export declare function detectRubyProject(dir: string): RubyProject | null;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swift detection — CONTENT-AWARE Package.swift / Xcode classification.
|
|
3
|
+
*
|
|
4
|
+
* Kill line: Package.swift alone ≠ app.
|
|
5
|
+
* SPM backs libraries, executables (CLI), server apps (Vapor / Hummingbird),
|
|
6
|
+
* MCP servers (official swift-sdk product MCP), and Xcode client apps.
|
|
7
|
+
* Static token scan only — never execute Package.swift / swift build.
|
|
8
|
+
*
|
|
9
|
+
* Same composition as go.ts / ruby.ts: knowledge in swift-detection.json.
|
|
10
|
+
*/
|
|
11
|
+
export type SwiftAppType = 'mcp' | 'backend' | 'cli' | 'app' | 'library';
|
|
12
|
+
export interface SwiftProject {
|
|
13
|
+
appType: SwiftAppType;
|
|
14
|
+
/** Primary framework label (Vapor / Hummingbird / MCP / ArgumentParser / …) or ''. */
|
|
15
|
+
framework: string;
|
|
16
|
+
/** spm when Package.swift; xcode when only xcodeproj; both when combined. */
|
|
17
|
+
packageManager: 'spm' | 'xcode' | 'spm+xcode';
|
|
18
|
+
/** Glass Hood rationale for .faf `# found:`. */
|
|
19
|
+
found: string;
|
|
20
|
+
}
|
|
21
|
+
export interface PackageSwiftSignals {
|
|
22
|
+
packageUrls: string[];
|
|
23
|
+
productNames: string[];
|
|
24
|
+
hasLibraryProduct: boolean;
|
|
25
|
+
hasExecutableProduct: boolean;
|
|
26
|
+
hasPluginProduct: boolean;
|
|
27
|
+
hasExecutableTarget: boolean;
|
|
28
|
+
hasLibraryTarget: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** True if directory looks like a Swift project root. */
|
|
31
|
+
export declare function isSwiftRoot(dir: string): boolean;
|
|
32
|
+
/** Root-level *.xcodeproj directory names. */
|
|
33
|
+
export declare function listXcodeprojs(dir: string): string[];
|
|
34
|
+
/**
|
|
35
|
+
* Static scan of Package.swift — does NOT compile or evaluate Swift.
|
|
36
|
+
* Strips line and block comments best-effort before token extraction.
|
|
37
|
+
*/
|
|
38
|
+
export declare function parsePackageSwift(content: string): PackageSwiftSignals;
|
|
39
|
+
/** Best-effort strip of line (//) and block comments for static scan. */
|
|
40
|
+
export declare function stripSwiftComments(src: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* Light pbxproj grep — no AST. Reads project.pbxproj under each .xcodeproj.
|
|
43
|
+
*/
|
|
44
|
+
export declare function scanXcodeProductTypes(dir: string): {
|
|
45
|
+
hasApplication: boolean;
|
|
46
|
+
hasTool: boolean;
|
|
47
|
+
hit?: string;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Classify a Swift project from Package.swift (+ light Xcode).
|
|
51
|
+
* Returns null if not a Swift root.
|
|
52
|
+
*/
|
|
53
|
+
export declare function detectSwiftProject(dir: string): SwiftProject | null;
|