@salesforce/webapps-features-experimental 1.68.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.
Files changed (52) hide show
  1. package/LICENSE.txt +82 -0
  2. package/README.md +154 -0
  3. package/dist/conflict-detector.d.ts +31 -0
  4. package/dist/conflict-detector.d.ts.map +1 -0
  5. package/dist/conflict-detector.js +153 -0
  6. package/dist/conflict-detector.js.map +1 -0
  7. package/dist/dependency-resolver.d.ts +18 -0
  8. package/dist/dependency-resolver.d.ts.map +1 -0
  9. package/dist/dependency-resolver.js +90 -0
  10. package/dist/dependency-resolver.js.map +1 -0
  11. package/dist/feature-metadata.d.ts +35 -0
  12. package/dist/feature-metadata.d.ts.map +1 -0
  13. package/dist/feature-metadata.js +140 -0
  14. package/dist/feature-metadata.js.map +1 -0
  15. package/dist/feature-search.d.ts +11 -0
  16. package/dist/feature-search.d.ts.map +1 -0
  17. package/dist/feature-search.js +121 -0
  18. package/dist/feature-search.js.map +1 -0
  19. package/dist/features.json +336 -0
  20. package/dist/file-copier.d.ts +15 -0
  21. package/dist/file-copier.d.ts.map +1 -0
  22. package/dist/file-copier.js +105 -0
  23. package/dist/file-copier.js.map +1 -0
  24. package/dist/install-feature.d.ts +8 -0
  25. package/dist/install-feature.d.ts.map +1 -0
  26. package/dist/install-feature.js +563 -0
  27. package/dist/install-feature.js.map +1 -0
  28. package/dist/logger.d.ts +48 -0
  29. package/dist/logger.d.ts.map +1 -0
  30. package/dist/logger.js +82 -0
  31. package/dist/logger.js.map +1 -0
  32. package/dist/package-manager.d.ts +22 -0
  33. package/dist/package-manager.d.ts.map +1 -0
  34. package/dist/package-manager.js +172 -0
  35. package/dist/package-manager.js.map +1 -0
  36. package/dist/placeholder-resolver.d.ts +25 -0
  37. package/dist/placeholder-resolver.d.ts.map +1 -0
  38. package/dist/placeholder-resolver.js +78 -0
  39. package/dist/placeholder-resolver.js.map +1 -0
  40. package/dist/schema-loader.d.ts +17 -0
  41. package/dist/schema-loader.d.ts.map +1 -0
  42. package/dist/schema-loader.js +82 -0
  43. package/dist/schema-loader.js.map +1 -0
  44. package/dist/types.d.ts +146 -0
  45. package/dist/types.d.ts.map +1 -0
  46. package/dist/types.js +7 -0
  47. package/dist/types.js.map +1 -0
  48. package/dist/utils.d.ts +30 -0
  49. package/dist/utils.d.ts.map +1 -0
  50. package/dist/utils.js +58 -0
  51. package/dist/utils.js.map +1 -0
  52. package/package.json +53 -0
package/LICENSE.txt ADDED
@@ -0,0 +1,82 @@
1
+ Terms of Use
2
+
3
+ Copyright 2026 Salesforce, Inc. All rights reserved.
4
+
5
+ These Terms of Use govern the download, installation, and/or use of this
6
+ software provided by Salesforce, Inc. ("Salesforce") (the "Software"), were
7
+ last updated on April 15, 2025, and constitute a legally binding
8
+ agreement between you and Salesforce. If you do not agree to these Terms of
9
+ Use, do not install or use the Software.
10
+
11
+ Salesforce grants you a worldwide, non-exclusive, no-charge, royalty-free
12
+ copyright license to reproduce, prepare derivative works of, publicly
13
+ display, publicly perform, sublicense, and distribute the Software and
14
+ derivative works subject to these Terms. These Terms shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ Subject to the limited rights expressly granted hereunder, Salesforce
18
+ reserves all rights, title, and interest in and to all intellectual
19
+ property subsisting in the Software. No rights are granted to you hereunder
20
+ other than as expressly set forth herein. Users residing in countries on
21
+ the United States Office of Foreign Assets Control sanction list, or which
22
+ are otherwise subject to a US export embargo, may not use the Software.
23
+
24
+ Implementation of the Software may require development work, for which you
25
+ are responsible. The Software may contain bugs, errors and
26
+ incompatibilities and is made available on an AS IS basis without support,
27
+ updates, or service level commitments.
28
+
29
+ Salesforce reserves the right at any time to modify, suspend, or
30
+ discontinue, the Software (or any part thereof) with or without notice. You
31
+ agree that Salesforce shall not be liable to you or to any third party for
32
+ any modification, suspension, or discontinuance.
33
+
34
+ You agree to defend Salesforce against any claim, demand, suit or
35
+ proceeding made or brought against Salesforce by a third party arising out
36
+ of or accruing from (a) your use of the Software, and (b) any application
37
+ you develop with the Software that infringes any copyright, trademark,
38
+ trade secret, trade dress, patent, or other intellectual property right of
39
+ any person or defames any person or violates their rights of publicity or
40
+ privacy (each a "Claim Against Salesforce"), and will indemnify Salesforce
41
+ from any damages, attorney fees, and costs finally awarded against
42
+ Salesforce as a result of, or for any amounts paid by Salesforce under a
43
+ settlement approved by you in writing of, a Claim Against Salesforce,
44
+ provided Salesforce (x) promptly gives you written notice of the Claim
45
+ Against Salesforce, (y) gives you sole control of the defense and
46
+ settlement of the Claim Against Salesforce (except that you may not settle
47
+ any Claim Against Salesforce unless it unconditionally releases Salesforce
48
+ of all liability), and (z) gives you all reasonable assistance, at your
49
+ expense.
50
+
51
+ WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE SOFTWARE IS NOT
52
+ SUPPORTED AND IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
53
+ IMPLIED. IN NO EVENT SHALL SALESFORCE HAVE ANY LIABILITY FOR ANY DAMAGES,
54
+ INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL, INCIDENTAL,
55
+ PUNITIVE, OR CONSEQUENTIAL DAMAGES, OR DAMAGES BASED ON LOST PROFITS, DATA,
56
+ OR USE, IN CONNECTION WITH THE SOFTWARE, HOWEVER CAUSED AND WHETHER IN
57
+ CONTRACT, TORT, OR UNDER ANY OTHER THEORY OF LIABILITY, WHETHER OR NOT YOU
58
+ HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
59
+
60
+ These Terms of Use shall be governed exclusively by the internal laws of
61
+ the State of California, without regard to its conflicts of laws
62
+ rules. Each party hereby consents to the exclusive jurisdiction of the
63
+ state and federal courts located in San Francisco County, California to
64
+ adjudicate any dispute arising out of or relating to these Terms of Use and
65
+ the download, installation, and/or use of the Software. Except as expressly
66
+ stated herein, these Terms of Use constitute the entire agreement between
67
+ the parties, and supersede all prior and contemporaneous agreements,
68
+ proposals, or representations, written or oral, concerning their subject
69
+ matter. No modification, amendment, or waiver of any provision of these
70
+ Terms of Use shall be effective unless it is by an update to these Terms of
71
+ Use that Salesforce makes available, or is in writing and signed by the
72
+ party against whom the modification, amendment, or waiver is to be
73
+ asserted.
74
+
75
+ Data Privacy: Salesforce may collect, process, and store device,
76
+ system, and other information related to your use of the Software. This
77
+ information includes, but is not limited to, IP address, user metrics, and
78
+ other data ("Usage Data"). Salesforce may use Usage Data for analytics,
79
+ product development, and marketing purposes. You acknowledge that files
80
+ generated in conjunction with the Software may contain sensitive or
81
+ confidential data, and you are solely responsible for anonymizing and
82
+ protecting such data.
package/README.md ADDED
@@ -0,0 +1,154 @@
1
+ # @salesforce/webapps-features-experimental
2
+
3
+ CLI tool for installing UI features into Salesforce webapps.
4
+
5
+ ## Installation
6
+
7
+ ### Using npx (Recommended)
8
+
9
+ ```bash
10
+ npx @salesforce/webapps-features-experimental <command>
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ### List Available Features
16
+
17
+ ```bash
18
+ npx @salesforce/webapps-features-experimental list
19
+ ```
20
+
21
+ Search for specific features:
22
+
23
+ ```bash
24
+ npx @salesforce/webapps-features-experimental list --search "auth"
25
+ ```
26
+
27
+ ### Describe a Feature
28
+
29
+ Get detailed information about a specific feature:
30
+
31
+ ```bash
32
+ npx @salesforce/webapps-features-experimental describe authentication
33
+ ```
34
+
35
+ This shows:
36
+
37
+ - Full description
38
+ - Dependencies (feature and npm packages)
39
+ - Files that will be copied
40
+ - Integration examples
41
+ - Components and capabilities
42
+
43
+ ### Install a Feature
44
+
45
+ ```bash
46
+ npx @salesforce/webapps-features-experimental install <feature-name> --webapp-dir <path>
47
+ ```
48
+
49
+ Example:
50
+
51
+ ```bash
52
+ npx @salesforce/webapps-features-experimental install authentication --webapp-dir force-app/main/default/webapplications/mywebapp
53
+ ```
54
+
55
+ #### Installation Options
56
+
57
+ - `--webapp-dir <path>` - **Required**. Path to the webapp directory
58
+ - `--sfdx-root <path>` - Optional. SFDX metadata root (default: `force-app/main/default`)
59
+ - `--dry-run` - Preview changes without making them
60
+ - `--verbose` or `-v` - Show detailed output
61
+ - `--yes` or `-y` - Skip conflicts (non-destructive)
62
+ - `--on-conflict <mode>` - Conflict resolution mode: `error`, `skip`, `overwrite`, or `prompt` (default)
63
+ - `--conflict-resolution <file>` - JSON file with per-file conflict resolutions
64
+
65
+ ### Handling Conflicts
66
+
67
+ The recommended workflow for LLMs and automated tools:
68
+
69
+ 1. **First, detect conflicts:**
70
+
71
+ ```bash
72
+ npx @salesforce/webapps-features-experimental install authentication \
73
+ --webapp-dir force-app/main/default/webapplications/mywebapp \
74
+ --on-conflict error
75
+ ```
76
+
77
+ 2. **If conflicts are detected**, create a resolution file:
78
+
79
+ ```json
80
+ {
81
+ "path/to/file1": "overwrite",
82
+ "path/to/file2": "skip",
83
+ "path/to/file3": "overwrite"
84
+ }
85
+ ```
86
+
87
+ 3. **Rerun with resolution file:**
88
+ ```bash
89
+ npx @salesforce/webapps-features-experimental install authentication \
90
+ --webapp-dir force-app/main/default/webapplications/mywebapp \
91
+ --conflict-resolution resolution.json
92
+ ```
93
+
94
+ ### Integration Examples
95
+
96
+ After installation, the CLI will list any `__example__` files that need manual integration:
97
+
98
+ ```
99
+ Example files to integrate:
100
+ src/__example__auth-app.tsx → Integrate into: src/app.tsx
101
+ ```
102
+
103
+ For each example file:
104
+
105
+ 1. Read the example file to see the integration pattern
106
+ 2. Apply the pattern to your target file
107
+ 3. Delete the example file after integration
108
+
109
+ ## Available Features
110
+
111
+ Run `npx @salesforce/webapps-features-experimental list` to see all available features.
112
+
113
+ Common features:
114
+
115
+ - **authentication** - Complete auth system with login, registration, password reset
116
+ - **shadcn** - UI component library based on shadcn/ui
117
+ - **global-search** - Salesforce object search
118
+ - **nav-menu** - Navigation menu layout
119
+ - **charts** - Analytics charts with Recharts
120
+ - **graphql** - GraphQL integration
121
+ - **agentforce** - AI-powered conversation interface
122
+
123
+ ## Local Development
124
+
125
+ ### Building
126
+
127
+ ```bash
128
+ npm run build
129
+ ```
130
+
131
+ ### Running locally
132
+
133
+ ```bash
134
+ npm run dev -- <command>
135
+ ```
136
+
137
+ Example:
138
+
139
+ ```bash
140
+ npm run dev -- list
141
+ npm run dev -- install authentication --webapp-dir /path/to/webapp
142
+ ```
143
+
144
+ ### Global install from local build
145
+
146
+ ```bash
147
+ npm run build && npm link
148
+ ```
149
+
150
+ Then use `webapps-features-experimental <command>` directly without `npx`.
151
+
152
+ ## License
153
+
154
+ SEE LICENSE IN LICENSE.txt
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import type { ConflictResolution, InstallationContext } from "./types.js";
7
+ /**
8
+ * Check if a path already exists (file or directory)
9
+ * For directories, we don't consider them conflicts - only individual files
10
+ */
11
+ export declare function hasConflict(path: string): boolean;
12
+ /**
13
+ * Resolve a conflict based on the context's conflict mode
14
+ */
15
+ export declare function resolveConflict(path: string, context: InstallationContext): Promise<ConflictResolution>;
16
+ /**
17
+ * Collect all conflicts for error mode
18
+ * Returns a list of conflicting paths
19
+ *
20
+ * For directory operations, we need the source path to check individual files
21
+ */
22
+ export declare function collectConflicts(operations: {
23
+ from: string;
24
+ to: string;
25
+ sourcePath: string;
26
+ }[]): string[];
27
+ /**
28
+ * Output error message with conflict list and instructions
29
+ */
30
+ export declare function outputConflictError(conflicts: string[]): void;
31
+ //# sourceMappingURL=conflict-detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conflict-detector.d.ts","sourceRoot":"","sources":["../src/conflict-detector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE1E;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAiBjD;AAED;;GAEG;AACH,wBAAsB,eAAe,CACpC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,mBAAmB,GAC1B,OAAO,CAAC,kBAAkB,CAAC,CA6B7B;AAwBD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC/B,UAAU,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,EAAE,GAC5D,MAAM,EAAE,CASV;AAkDD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,CA8B7D"}
@@ -0,0 +1,153 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { existsSync, readdirSync, statSync } from "fs";
7
+ import { join } from "path";
8
+ import inquirer from "inquirer";
9
+ /**
10
+ * Check if a path already exists (file or directory)
11
+ * For directories, we don't consider them conflicts - only individual files
12
+ */
13
+ export function hasConflict(path) {
14
+ if (!existsSync(path)) {
15
+ return false;
16
+ }
17
+ // If it's a file, it's a conflict
18
+ try {
19
+ const stats = statSync(path);
20
+ if (stats.isFile()) {
21
+ return true;
22
+ }
23
+ // If it's a directory, it's not a conflict - we can merge into it
24
+ return false;
25
+ }
26
+ catch (_error) {
27
+ // If we can't stat it, assume no conflict
28
+ return false;
29
+ }
30
+ }
31
+ /**
32
+ * Resolve a conflict based on the context's conflict mode
33
+ */
34
+ export async function resolveConflict(path, context) {
35
+ // Check if we already have a resolution for this path
36
+ if (context.conflictResolutions[path]) {
37
+ return context.conflictResolutions[path];
38
+ }
39
+ const mode = context.conflictMode;
40
+ const logger = context.logger;
41
+ switch (mode) {
42
+ case "prompt":
43
+ return await promptForResolution(path);
44
+ case "error":
45
+ // In error mode, we don't resolve - just return 'cancel' to stop
46
+ return "cancel";
47
+ case "skip":
48
+ logger.debug(`Auto-skipping conflict: ${path}`);
49
+ return "skip";
50
+ case "overwrite":
51
+ logger.debug(`Auto-overwriting conflict: ${path}`);
52
+ return "overwrite";
53
+ default:
54
+ throw new Error(`Unknown conflict mode: ${mode}`);
55
+ }
56
+ }
57
+ /**
58
+ * Prompt user interactively for conflict resolution
59
+ */
60
+ async function promptForResolution(path) {
61
+ console.warn(`[WARN] Destination already exists: ${path}`);
62
+ const answer = await inquirer.prompt([
63
+ {
64
+ type: "list",
65
+ name: "resolution",
66
+ message: `File/directory already exists: ${path}. What would you like to do?`,
67
+ choices: [
68
+ { name: "Skip (keep existing)", value: "skip" },
69
+ { name: "Overwrite (loses customizations)", value: "overwrite" },
70
+ { name: "Cancel installation", value: "cancel" },
71
+ ],
72
+ },
73
+ ]);
74
+ return answer.resolution;
75
+ }
76
+ /**
77
+ * Collect all conflicts for error mode
78
+ * Returns a list of conflicting paths
79
+ *
80
+ * For directory operations, we need the source path to check individual files
81
+ */
82
+ export function collectConflicts(operations) {
83
+ const conflicts = [];
84
+ for (const op of operations) {
85
+ const fileConflicts = getConflictsForOperation(op.sourcePath, op.to);
86
+ conflicts.push(...fileConflicts);
87
+ }
88
+ return conflicts;
89
+ }
90
+ /**
91
+ * Get all conflicting files for a single copy operation
92
+ * Handles both file and directory copies
93
+ */
94
+ function getConflictsForOperation(sourcePath, destPath) {
95
+ const conflicts = [];
96
+ // Check if destination exists
97
+ if (!existsSync(destPath)) {
98
+ return conflicts;
99
+ }
100
+ try {
101
+ const sourceStats = statSync(sourcePath);
102
+ const destStats = statSync(destPath);
103
+ // If source is a file and dest is a file, it's a conflict
104
+ if (sourceStats.isFile() && destStats.isFile()) {
105
+ conflicts.push(destPath);
106
+ return conflicts;
107
+ }
108
+ // If source is a directory and dest is a file, it's a conflict
109
+ if (sourceStats.isDirectory() && destStats.isFile()) {
110
+ conflicts.push(destPath);
111
+ return conflicts;
112
+ }
113
+ // If source is a directory and dest is a directory, check contents recursively
114
+ if (sourceStats.isDirectory() && destStats.isDirectory()) {
115
+ const sourceFiles = readdirSync(sourcePath);
116
+ for (const file of sourceFiles) {
117
+ const sourceFile = join(sourcePath, file);
118
+ const destFile = join(destPath, file);
119
+ // Recursively check for conflicts in subdirectories
120
+ const subConflicts = getConflictsForOperation(sourceFile, destFile);
121
+ conflicts.push(...subConflicts);
122
+ }
123
+ }
124
+ }
125
+ catch (_error) {
126
+ // If we can't stat, no conflict
127
+ return conflicts;
128
+ }
129
+ return conflicts;
130
+ }
131
+ /**
132
+ * Output error message with conflict list and instructions
133
+ */
134
+ export function outputConflictError(conflicts) {
135
+ console.error("[ERROR] Conflicts detected during installation");
136
+ console.log("\nConflicts found:");
137
+ conflicts.forEach((path, index) => {
138
+ console.log(`${index + 1}. ${path} (${existsSync(path) ? "already exists" : "unknown"})`);
139
+ });
140
+ console.log("\nTo resolve, create a conflict resolution file:\n");
141
+ console.log("Example conflict-resolution.json:");
142
+ const exampleResolutions = {};
143
+ conflicts.forEach((path) => {
144
+ exampleResolutions[path] = "overwrite"; // or 'skip'
145
+ });
146
+ console.log(JSON.stringify(exampleResolutions, null, 2));
147
+ console.log("\nThen run:");
148
+ console.log("npx @salesforce/webapps-features-experimental install <feature> --conflict-resolution conflict-resolution.json");
149
+ console.log("\nOr use automatic modes:");
150
+ console.log("npx @salesforce/webapps-features-experimental install <feature> --on-conflict skip (keeps all existing files)");
151
+ console.log("npx @salesforce/webapps-features-experimental install <feature> --on-conflict overwrite (replaces all files - destructive)");
152
+ }
153
+ //# sourceMappingURL=conflict-detector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conflict-detector.js","sourceRoot":"","sources":["../src/conflict-detector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAGhC;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACvC,IAAI,CAAC,UAAU,CAA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C,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC;IAC3F,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IAEjD,MAAM,kBAAkB,GAA2B,EAAE,CAAC;IACtD,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC1B,kBAAkB,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC,YAAY;IACrD,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAEzD,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC3B,OAAO,CAAC,GAAG,CACV,gHAAgH,CAChH,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IACzC,OAAO,CAAC,GAAG,CACV,+GAA+G,CAC/G,CAAC;IACF,OAAO,CAAC,GAAG,CACV,4HAA4H,CAC5H,CAAC;AACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import type { FileCopySchema, InstallationContext } from "./types.js";
7
+ /**
8
+ * Resolve and install feature dependencies recursively
9
+ * Follows the exact workflow: install package -> load schema -> recursively process
10
+ */
11
+ export declare function resolveFeatureDependencies(dependencies: string[], context: InstallationContext): Promise<void>;
12
+ /**
13
+ * Process the "own" operations for a feature (package deps + copies),
14
+ * excluding recursive feature dependency resolution.
15
+ * Used by install-feature.ts for the main feature's section.
16
+ */
17
+ export declare function processFeatureOwnOperations(schema: FileCopySchema, packageName: string, context: InstallationContext): Promise<void>;
18
+ //# sourceMappingURL=dependency-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependency-resolver.d.ts","sourceRoot":"","sources":["../src/dependency-resolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtE;;;GAGG;AACH,wBAAsB,0BAA0B,CAC/C,YAAY,EAAE,MAAM,EAAE,EACtB,OAAO,EAAE,mBAAmB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAIf;AAuED;;;;GAIG;AACH,wBAAsB,2BAA2B,CAChD,MAAM,EAAE,cAAc,EACtB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,mBAAmB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAcf"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { getFeatureMetadata } from "./feature-metadata.js";
7
+ import { executeCopyOperations } from "./file-copier.js";
8
+ import { installPackage, installPackageDependencies, isPackageInstalled, } from "./package-manager.js";
9
+ import { loadSchemaFromNodeModules } from "./schema-loader.js";
10
+ /**
11
+ * Resolve and install feature dependencies recursively
12
+ * Follows the exact workflow: install package -> load schema -> recursively process
13
+ */
14
+ export async function resolveFeatureDependencies(dependencies, context) {
15
+ for (const dependency of dependencies) {
16
+ await installFeatureDependency(dependency, context);
17
+ }
18
+ }
19
+ /**
20
+ * Install a single feature dependency with section-delimited output
21
+ */
22
+ async function installFeatureDependency(featureName, context) {
23
+ const logger = context.logger;
24
+ // Resolve feature name to package name
25
+ const feature = getFeatureMetadata(featureName);
26
+ const packageName = feature?.package ?? featureName;
27
+ const displayName = feature ? featureName : packageName;
28
+ // Check if already installed
29
+ if (context.installedFeatures.has(packageName)) {
30
+ logger.debug(`Feature dependency already installed: ${packageName}`);
31
+ return;
32
+ }
33
+ // Step 1: Install the package (before opening section, so npm output is suppressed)
34
+ if (!isPackageInstalled(packageName, context.webappDir)) {
35
+ await installPackage(packageName, true, context.webappDir, context.dryRun, context.verbose);
36
+ }
37
+ else {
38
+ logger.debug(`Package already in node_modules: ${packageName}`);
39
+ }
40
+ // Mark as installed to prevent duplicate processing
41
+ context.installedFeatures.add(packageName);
42
+ if (context.dryRun) {
43
+ logger.info(`[DRY RUN] Would process feature dependency schema: ${packageName}`);
44
+ return;
45
+ }
46
+ // Step 2: Load its schema
47
+ const schema = loadSchemaFromNodeModules(packageName, context.webappDir, context.logger);
48
+ if (!schema) {
49
+ logger.warn(`No features.json found for dependency: ${packageName}`);
50
+ return;
51
+ }
52
+ logger.debug(`Processing schema for dependency: ${packageName}`);
53
+ // Step 3: Install sub-dependencies first (they get their own sections)
54
+ if (schema.featureDependencies && schema.featureDependencies.length > 0) {
55
+ await resolveFeatureDependencies(schema.featureDependencies, context);
56
+ }
57
+ // Step 4: Open section for THIS dependency
58
+ logger.section(`Installing dependency: ${displayName}`);
59
+ logger.plain(`Installing package: ${packageName}`);
60
+ // Step 5: Install package dependencies (inside section)
61
+ if (schema.packageDependencies || schema.packageDevDependencies) {
62
+ logger.blank();
63
+ await installPackageDependencies(schema, context);
64
+ }
65
+ // Step 6: Execute copy operations (inside section)
66
+ if (schema.copy && schema.copy.length > 0) {
67
+ logger.blank();
68
+ await executeCopyOperations(schema.copy, packageName, context);
69
+ }
70
+ logger.sectionEnd(`Dependency installed: ${displayName}`);
71
+ }
72
+ /**
73
+ * Process the "own" operations for a feature (package deps + copies),
74
+ * excluding recursive feature dependency resolution.
75
+ * Used by install-feature.ts for the main feature's section.
76
+ */
77
+ export async function processFeatureOwnOperations(schema, packageName, context) {
78
+ const logger = context.logger;
79
+ // Install packageDependencies
80
+ if (schema.packageDependencies || schema.packageDevDependencies) {
81
+ logger.blank();
82
+ await installPackageDependencies(schema, context);
83
+ }
84
+ // Execute copy operations
85
+ if (schema.copy && schema.copy.length > 0) {
86
+ logger.blank();
87
+ await executeCopyOperations(schema.copy, packageName, context);
88
+ }
89
+ }
90
+ //# sourceMappingURL=dependency-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependency-resolver.js","sourceRoot":"","sources":["../src/dependency-resolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EACN,cAAc,EACd,0BAA0B,EAC1B,kBAAkB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAG/D;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC/C,YAAsB,EACtB,OAA4B;IAE5B,KAAK,MAAM,UAAU,IAAI,YAAY,EAAE,CAAC;QACvC,MAAM,wBAAwB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;AACF,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,wBAAwB,CACtC,WAAmB,EACnB,OAA4B;IAE5B,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAE9B,uCAAuC;IACvC,MAAM,OAAO,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAChD,MAAM,WAAW,GAAG,OAAO,EAAE,OAAO,IAAI,WAAW,CAAC;IACpD,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC;IAExD,6BAA6B;IAC7B,IAAI,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QAChD,MAAM,CAAC,KAAK,CAAC,yCAAyC,WAAW,EAAE,CAAC,CAAC;QACrE,OAAO;IACR,CAAC;IAED,oFAAoF;IACpF,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QACzD,MAAM,cAAc,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC,SAA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I,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3C,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,qBAAqB,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,yBAAyB,WAAW,EAAE,CAAC,CAAC;AAC3D,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAChD,MAAsB,EACtB,WAAmB,EACnB,OAA4B;IAE5B,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAE9B,8BAA8B;IAC9B,IAAI,MAAM,CAAC,mBAAmB,IAAI,MAAM,CAAC,sBAAsB,EAAE,CAAC;QACjE,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,0BAA0B,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAED,0BAA0B;IAC1B,IAAI,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3C,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,qBAAqB,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;AACF,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import type { FeatureMetadata } from "./types.js";
7
+ /**
8
+ * Get all available features
9
+ */
10
+ export declare function getAllFeatures(): Record<string, FeatureMetadata>;
11
+ /**
12
+ * Resolve a feature name to its canonical (registry) key, matching case-insensitively.
13
+ * Returns the canonical key or null if no match is found.
14
+ */
15
+ export declare function resolveFeatureName(featureName: string): string | null;
16
+ /**
17
+ * Get metadata for a specific feature (case-insensitive).
18
+ */
19
+ export declare function getFeatureMetadata(featureName: string): FeatureMetadata | null;
20
+ /**
21
+ * Suggest similar feature names for a given input.
22
+ * Uses prefix matching and Levenshtein distance.
23
+ * Returns up to `max` suggestions sorted by relevance.
24
+ */
25
+ export declare function suggestSimilarFeatures(input: string, max?: number): string[];
26
+ export { searchFeatures } from "./feature-search.js";
27
+ /**
28
+ * Get feature name from package name
29
+ */
30
+ export declare function getFeatureNameFromPackage(packageName: string): string | null;
31
+ /**
32
+ * Check if a feature has complete schema information
33
+ */
34
+ export declare function isFeatureReady(featureName: string): boolean;
35
+ //# sourceMappingURL=feature-metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature-metadata.d.ts","sourceRoot":"","sources":["../src/feature-metadata.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,YAAY,CAAC;AA0BpE;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAGhE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAcrE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAK9E;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAI,GAAG,MAAM,EAAE,CA0BvE;AA0BD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAU5E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAM3D"}