@salesforce/ui-bundle-features 1.117.2

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 (68) hide show
  1. package/LICENSE.txt +82 -0
  2. package/README.md +153 -0
  3. package/dist/aggregate-features.d.ts +16 -0
  4. package/dist/aggregate-features.d.ts.map +1 -0
  5. package/dist/aggregate-features.js +43 -0
  6. package/dist/aggregate-features.js.map +1 -0
  7. package/dist/cli.d.ts +8 -0
  8. package/dist/cli.d.ts.map +1 -0
  9. package/dist/cli.js +71 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/conflict-detector.d.ts +31 -0
  12. package/dist/conflict-detector.d.ts.map +1 -0
  13. package/dist/conflict-detector.js +153 -0
  14. package/dist/conflict-detector.js.map +1 -0
  15. package/dist/dependency-resolver.d.ts +18 -0
  16. package/dist/dependency-resolver.d.ts.map +1 -0
  17. package/dist/dependency-resolver.js +96 -0
  18. package/dist/dependency-resolver.js.map +1 -0
  19. package/dist/describe-command.d.ts +10 -0
  20. package/dist/describe-command.d.ts.map +1 -0
  21. package/dist/describe-command.js +119 -0
  22. package/dist/describe-command.js.map +1 -0
  23. package/dist/feature-metadata.d.ts +30 -0
  24. package/dist/feature-metadata.d.ts.map +1 -0
  25. package/dist/feature-metadata.js +136 -0
  26. package/dist/feature-metadata.js.map +1 -0
  27. package/dist/feature-search.d.ts +16 -0
  28. package/dist/feature-search.d.ts.map +1 -0
  29. package/dist/feature-search.js +140 -0
  30. package/dist/feature-search.js.map +1 -0
  31. package/dist/features.json +137 -0
  32. package/dist/file-copier.d.ts +15 -0
  33. package/dist/file-copier.d.ts.map +1 -0
  34. package/dist/file-copier.js +105 -0
  35. package/dist/file-copier.js.map +1 -0
  36. package/dist/install-command.d.ts +15 -0
  37. package/dist/install-command.d.ts.map +1 -0
  38. package/dist/install-command.js +314 -0
  39. package/dist/install-command.js.map +1 -0
  40. package/dist/list-command.d.ts +13 -0
  41. package/dist/list-command.d.ts.map +1 -0
  42. package/dist/list-command.js +71 -0
  43. package/dist/list-command.js.map +1 -0
  44. package/dist/logger.d.ts +48 -0
  45. package/dist/logger.d.ts.map +1 -0
  46. package/dist/logger.js +82 -0
  47. package/dist/logger.js.map +1 -0
  48. package/dist/package-manager.d.ts +22 -0
  49. package/dist/package-manager.d.ts.map +1 -0
  50. package/dist/package-manager.js +172 -0
  51. package/dist/package-manager.js.map +1 -0
  52. package/dist/placeholder-resolver.d.ts +25 -0
  53. package/dist/placeholder-resolver.d.ts.map +1 -0
  54. package/dist/placeholder-resolver.js +78 -0
  55. package/dist/placeholder-resolver.js.map +1 -0
  56. package/dist/schema-loader.d.ts +17 -0
  57. package/dist/schema-loader.d.ts.map +1 -0
  58. package/dist/schema-loader.js +82 -0
  59. package/dist/schema-loader.js.map +1 -0
  60. package/dist/types.d.ts +174 -0
  61. package/dist/types.d.ts.map +1 -0
  62. package/dist/types.js +7 -0
  63. package/dist/types.js.map +1 -0
  64. package/dist/utils.d.ts +30 -0
  65. package/dist/utils.d.ts.map +1 -0
  66. package/dist/utils.js +58 -0
  67. package/dist/utils.js.map +1 -0
  68. 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,153 @@
1
+ # @salesforce/ui-bundle-features
2
+
3
+ CLI tool for installing UI features into Salesforce UI Bundles.
4
+
5
+ ## Installation
6
+
7
+ ### Using npx (Recommended)
8
+
9
+ ```bash
10
+ npx @salesforce/ui-bundle-features <command>
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ### List Available Features
16
+
17
+ ```bash
18
+ npx @salesforce/ui-bundle-features list
19
+ ```
20
+
21
+ Search for specific features:
22
+
23
+ ```bash
24
+ npx @salesforce/ui-bundle-features list --search "auth"
25
+ ```
26
+
27
+ ### Describe a Feature
28
+
29
+ Get detailed information about a specific feature:
30
+
31
+ ```bash
32
+ npx @salesforce/ui-bundle-features 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/ui-bundle-features install <feature-name> --ui-bundle-dir <path>
47
+ ```
48
+
49
+ Example:
50
+
51
+ ```bash
52
+ npx @salesforce/ui-bundle-features install authentication --ui-bundle-dir my-ui-bundle
53
+ ```
54
+
55
+ #### Installation Options
56
+
57
+ - `--ui-bundle-dir <name>` - **Required**. UI Bundle name, resolves to `<sfdx-source>/uiBundles/<name>`
58
+ - `--sfdx-source <path>` - Optional. SFDX source directory (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/ui-bundle-features install authentication \
73
+ --ui-bundle-dir my-ui-bundle \
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/ui-bundle-features install authentication \
90
+ --ui-bundle-dir my-ui-bundle \
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/ui-bundle-features 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
+ - **agentforce** - AI-powered conversation interface
121
+
122
+ ## Local Development
123
+
124
+ ### Building
125
+
126
+ ```bash
127
+ npm run build
128
+ ```
129
+
130
+ ### Running locally
131
+
132
+ ```bash
133
+ npm run dev -- <command>
134
+ ```
135
+
136
+ Example:
137
+
138
+ ```bash
139
+ npm run dev -- list
140
+ npm run dev -- install authentication --ui-bundle-dir /path/to/ui-bundle
141
+ ```
142
+
143
+ ### Global install from local build
144
+
145
+ ```bash
146
+ npm run build && npm link
147
+ ```
148
+
149
+ Then use `ui-bundle-features <command>` directly without `npx`.
150
+
151
+ ## License
152
+
153
+ SEE LICENSE IN LICENSE.txt
@@ -0,0 +1,16 @@
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 { FeaturesMetadata } from "./types.js";
7
+ /**
8
+ * Aggregates individual feature.ts files from a base directory into a FeaturesMetadata object.
9
+ * Scans each subdirectory for a feature.ts file, imports it, and collects the metadata.
10
+ *
11
+ * @param featureBaseDir - The directory containing feature subdirectories
12
+ * @returns The aggregated features metadata
13
+ * @throws If duplicate feature keys are found
14
+ */
15
+ export declare function aggregateFeatures(featureBaseDir: string): Promise<FeaturesMetadata>;
16
+ //# sourceMappingURL=aggregate-features.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregate-features.d.ts","sourceRoot":"","sources":["../src/aggregate-features.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAyB,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA0BzF"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
7
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
8
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
9
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
10
+ });
11
+ }
12
+ return path;
13
+ };
14
+ import { existsSync, readdirSync } from "fs";
15
+ import { join } from "path";
16
+ /**
17
+ * Aggregates individual feature.ts files from a base directory into a FeaturesMetadata object.
18
+ * Scans each subdirectory for a feature.ts file, imports it, and collects the metadata.
19
+ *
20
+ * @param featureBaseDir - The directory containing feature subdirectories
21
+ * @returns The aggregated features metadata
22
+ * @throws If duplicate feature keys are found
23
+ */
24
+ export async function aggregateFeatures(featureBaseDir) {
25
+ const featureDirs = readdirSync(featureBaseDir, { withFileTypes: true })
26
+ .filter((entry) => entry.isDirectory())
27
+ .map((entry) => entry.name);
28
+ const aggregated = { features: {} };
29
+ for (const dir of featureDirs) {
30
+ const featureTsPath = join(featureBaseDir, dir, "feature.ts");
31
+ if (!existsSync(featureTsPath)) {
32
+ continue;
33
+ }
34
+ const mod = (await import(__rewriteRelativeImportExtension(featureTsPath)));
35
+ const { key, ...metadata } = mod.default;
36
+ if (aggregated.features[key]) {
37
+ throw new Error(`Duplicate feature key "${key}" found in ${dir}/feature.ts`);
38
+ }
39
+ aggregated.features[key] = metadata;
40
+ }
41
+ return aggregated;
42
+ }
43
+ //# sourceMappingURL=aggregate-features.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregate-features.js","sourceRoot":"","sources":["../src/aggregate-features.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,cAAsB;IAC7D,MAAM,WAAW,GAAG,WAAW,CAAC,cAAc,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;SACtE,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;SACtC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAE7B,MAAM,UAAU,GAAqB,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAEtD,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QAC/B,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC;QAC9D,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;YAChC,SAAS;QACV,CAAC;QAED,MAAM,GAAG,GAAG,CAAC,MAAM,MAAM,kCAAC,aAAa,EAAC,CAEvC,CAAC;QACF,MAAM,EAAE,GAAG,EAAE,GAAG,QAAQ,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC;QAEzC,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,0BAA0B,GAAG,cAAc,GAAG,aAAa,CAAC,CAAC;QAC9E,CAAC;QAED,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;IACrC,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC"}
package/dist/cli.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Copyright (c) 2026, Salesforce, Inc.,
4
+ * All rights reserved.
5
+ * For full license text, see the LICENSE.txt file
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;GAIG"}
package/dist/cli.js ADDED
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Copyright (c) 2026, Salesforce, Inc.,
4
+ * All rights reserved.
5
+ * For full license text, see the LICENSE.txt file
6
+ */
7
+ import { readFileSync } from "fs";
8
+ import { dirname, join } from "path";
9
+ import { fileURLToPath } from "url";
10
+ import { Command, Option } from "commander";
11
+ import { describeFeature } from "./describe-command.js";
12
+ import { getInstallHelpText, install } from "./install-command.js";
13
+ import { listFeatures } from "./list-command.js";
14
+ import { Logger } from "./logger.js";
15
+ const __filename = fileURLToPath(import.meta.url);
16
+ const __dirname = dirname(__filename);
17
+ const { version: cliVersion } = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8"));
18
+ const program = new Command();
19
+ // Configure main CLI
20
+ program
21
+ .name("ui-bundle-features")
22
+ .description("Manage Salesforce UI bundle features")
23
+ .version(cliVersion);
24
+ // Install command
25
+ program
26
+ .command("install")
27
+ .description("Install a Salesforce UI bundle feature package")
28
+ .argument("<feature>", 'Feature name (e.g., "authentication", "shadcn") or npm package name')
29
+ .requiredOption("--ui-bundle-dir <name>", "UI bundle name, resolves to <sfdx-source>/uiBundles/<name>")
30
+ .option("--sfdx-source <path>", "SFDX source directory (default: force-app/main/default)", "force-app/main/default")
31
+ .option("-v, --verbose", "Enable verbose logging", false)
32
+ .option("--dry-run", "Show what would be done without making changes", false)
33
+ .option("-y, --yes", "Skip all prompts (auto-skip conflicts)", false)
34
+ .addOption(new Option("--on-conflict <mode>", "Conflict handling mode: prompt, error, skip, overwrite")
35
+ .choices(["prompt", "error", "skip", "overwrite"])
36
+ .default("prompt"))
37
+ .option("--conflict-resolution <file>", "Path to JSON file with conflict resolutions")
38
+ .addHelpText("after", getInstallHelpText())
39
+ .action(async (featureName, options) => {
40
+ try {
41
+ await install(featureName, options);
42
+ }
43
+ catch (error) {
44
+ const logger = new Logger(options.verbose || false);
45
+ if (error instanceof Error) {
46
+ logger.error(error.message, error);
47
+ }
48
+ else {
49
+ logger.error("Installation failed", error);
50
+ }
51
+ process.exit(1);
52
+ }
53
+ });
54
+ // List command
55
+ program
56
+ .command("list")
57
+ .description("List all available features")
58
+ .option("-v, --verbose", "Show detailed information", false)
59
+ .option("--search <query>", "Search features by keyword")
60
+ .action((options) => {
61
+ listFeatures(options);
62
+ });
63
+ // Describe command
64
+ program
65
+ .command("describe <feature>")
66
+ .description("Show detailed information about a specific feature")
67
+ .action((featureName) => {
68
+ describeFeature(featureName);
69
+ });
70
+ program.parse();
71
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CA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IAC1D,IAAI,CAAC;QACJ,MAAM,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC,CAAC;QACpD,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC5B,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACpC,CAAC;aAAM,CAAC;YACP,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE,KAAc,CAAC,CAAC;QACrD,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;AACF,CAAC,CAAC,CAAC;AAEJ,eAAe;AACf,OAAO;KACL,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,6BAA6B,CAAC;KAC1C,MAAM,CAAC,eAAe,EAAE,2BAA2B,EAAE,KAAK,CAAC;KAC3D,MAAM,CAAC,kBAAkB,EAAE,4BAA4B,CAAC;KACxD,MAAM,CAAC,CAAC,OAA+C,EAAE,EAAE;IAC3D,YAAY,CAAC,OAAO,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC;AAEJ,mBAAmB;AACnB,OAAO;KACL,OAAO,CAAC,oBAAoB,CAAC;KAC7B,WAAW,CAAC,oDAAoD,CAAC;KACjE,MAAM,CAAC,CAAC,WAAmB,EAAE,EAAE;IAC/B,eAAe,CAAC,WAAW,CAAC,CAAC;AAC9B,CAAC,CAAC,CAAC;AAEJ,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -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/ui-bundle-features install <feature> --conflict-resolution conflict-resolution.json");
149
+ console.log("\nOr use automatic modes:");
150
+ console.log("npx @salesforce/ui-bundle-features install <feature> --on-conflict skip (keeps all existing files)");
151
+ console.log("npx @salesforce/ui-bundle-features 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,CAAC,IAAI,CAAC,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC;IACd,CAAC;IAED,kCAAkC;IAClC,IAAI,CAAC;QACJ,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;YACpB,OAAO,IAAI,CAAC;QACb,CAAC;QACD,kEAAkE;QAClE,OAAO,KAAK,CAAC;IACd,CAAC;IAAC,OAAO,MAAM,EAAE,CAAC;QACjB,0CAA0C;QAC1C,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACpC,IAAY,EACZ,OAA4B;IAE5B,sDAAsD;IACtD,IAAI,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;QACv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,CACV,qGAAqG,CACrG,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IACzC,OAAO,CAAC,GAAG,CACV,oGAAoG,CACpG,CAAC;IACF,OAAO,CAAC,GAAG,CACV,iHAAiH,CACjH,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: readonly 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 cli.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;AASH,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtE;;;GAGG;AACH,wBAAsB,0BAA0B,CAC/C,YAAY,EAAE,SAAS,MAAM,EAAE,EAC/B,OAAO,EAAE,mBAAmB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAIf;AA+ED;;;;GAIG;AACH,wBAAsB,2BAA2B,CAChD,MAAM,EAAE,cAAc,EACtB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,mBAAmB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAcf"}