@salesforce/webapps-features-experimental 1.93.1 → 1.94.1
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 +5 -5
- package/dist/{install-feature.d.ts → cli.d.ts} +1 -1
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +71 -0
- package/dist/cli.js.map +1 -0
- package/dist/dependency-resolver.d.ts +1 -1
- package/dist/dependency-resolver.js +1 -1
- package/dist/describe-command.d.ts +10 -0
- package/dist/describe-command.d.ts.map +1 -0
- package/dist/describe-command.js +119 -0
- package/dist/describe-command.js.map +1 -0
- package/dist/install-command.d.ts +15 -0
- package/dist/install-command.d.ts.map +1 -0
- package/dist/install-command.js +315 -0
- package/dist/install-command.js.map +1 -0
- package/dist/list-command.d.ts +13 -0
- package/dist/list-command.d.ts.map +1 -0
- package/dist/list-command.js +71 -0
- package/dist/list-command.js.map +1 -0
- package/dist/placeholder-resolver.d.ts +1 -1
- package/dist/placeholder-resolver.js +6 -6
- package/dist/placeholder-resolver.js.map +1 -1
- package/dist/types.d.ts +3 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/install-feature.d.ts.map +0 -1
- package/dist/install-feature.js +0 -552
- package/dist/install-feature.js.map +0 -1
package/README.md
CHANGED
|
@@ -49,13 +49,13 @@ npx @salesforce/webapps-features-experimental install <feature-name> --webapp-di
|
|
|
49
49
|
Example:
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
|
-
npx @salesforce/webapps-features-experimental install authentication --webapp-dir
|
|
52
|
+
npx @salesforce/webapps-features-experimental install authentication --webapp-dir mywebapp
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
#### Installation Options
|
|
56
56
|
|
|
57
|
-
- `--webapp-dir <
|
|
58
|
-
- `--sfdx-
|
|
57
|
+
- `--webapp-dir <name>` - **Required**. Webapp name, resolves to `<sfdx-source>/webapplications/<name>`
|
|
58
|
+
- `--sfdx-source <path>` - Optional. SFDX source directory (default: `force-app/main/default`)
|
|
59
59
|
- `--dry-run` - Preview changes without making them
|
|
60
60
|
- `--verbose` or `-v` - Show detailed output
|
|
61
61
|
- `--yes` or `-y` - Skip conflicts (non-destructive)
|
|
@@ -70,7 +70,7 @@ The recommended workflow for LLMs and automated tools:
|
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
72
|
npx @salesforce/webapps-features-experimental install authentication \
|
|
73
|
-
--webapp-dir
|
|
73
|
+
--webapp-dir mywebapp \
|
|
74
74
|
--on-conflict error
|
|
75
75
|
```
|
|
76
76
|
|
|
@@ -87,7 +87,7 @@ The recommended workflow for LLMs and automated tools:
|
|
|
87
87
|
3. **Rerun with resolution file:**
|
|
88
88
|
```bash
|
|
89
89
|
npx @salesforce/webapps-features-experimental install authentication \
|
|
90
|
-
--webapp-dir
|
|
90
|
+
--webapp-dir mywebapp \
|
|
91
91
|
--conflict-resolution resolution.json
|
|
92
92
|
```
|
|
93
93
|
|
|
@@ -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("webapps-features")
|
|
22
|
+
.description("Manage Salesforce webapp features")
|
|
23
|
+
.version(cliVersion);
|
|
24
|
+
// Install command
|
|
25
|
+
program
|
|
26
|
+
.command("install")
|
|
27
|
+
.description("Install a Salesforce webapp feature package")
|
|
28
|
+
.argument("<feature>", 'Feature name (e.g., "authentication", "shadcn") or npm package name')
|
|
29
|
+
.requiredOption("--webapp-dir <name>", "Webapp name, resolves to <sfdx-source>/webapplications/<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
|
package/dist/cli.js.map
ADDED
|
@@ -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,CAAC;AAGrC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACtC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,KAAK,CACzC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAC5D,CAAC;AAEF,MAAM,OAAO,GAAG,IAAI,OAAO,E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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"}
|
|
@@ -12,7 +12,7 @@ export declare function resolveFeatureDependencies(dependencies: readonly string
|
|
|
12
12
|
/**
|
|
13
13
|
* Process the "own" operations for a feature (package deps + copies),
|
|
14
14
|
* excluding recursive feature dependency resolution.
|
|
15
|
-
* Used by
|
|
15
|
+
* Used by cli.ts for the main feature's section.
|
|
16
16
|
*/
|
|
17
17
|
export declare function processFeatureOwnOperations(schema: FileCopySchema, packageName: string, context: InstallationContext): Promise<void>;
|
|
18
18
|
//# sourceMappingURL=dependency-resolver.d.ts.map
|
|
@@ -78,7 +78,7 @@ async function installFeatureDependency(featureName, context) {
|
|
|
78
78
|
/**
|
|
79
79
|
* Process the "own" operations for a feature (package deps + copies),
|
|
80
80
|
* excluding recursive feature dependency resolution.
|
|
81
|
-
* Used by
|
|
81
|
+
* Used by cli.ts for the main feature's section.
|
|
82
82
|
*/
|
|
83
83
|
export async function processFeatureOwnOperations(schema, packageName, context) {
|
|
84
84
|
const logger = context.logger;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Describe a specific feature in detail
|
|
8
|
+
*/
|
|
9
|
+
export declare function describeFeature(featureName: string): void;
|
|
10
|
+
//# sourceMappingURL=describe-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe-command.d.ts","sourceRoot":"","sources":["../src/describe-command.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH;;GAEG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CA4HzD"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { getAllFeatures, getFeatureMetadata, resolveFeatureName, suggestSimilarFeatures, } from "./feature-metadata.js";
|
|
7
|
+
/**
|
|
8
|
+
* Describe a specific feature in detail
|
|
9
|
+
*/
|
|
10
|
+
export function describeFeature(featureName) {
|
|
11
|
+
const resolvedName = resolveFeatureName(featureName);
|
|
12
|
+
if (!resolvedName) {
|
|
13
|
+
console.error(`\nFeature not found: ${featureName}\n`);
|
|
14
|
+
const suggestions = suggestSimilarFeatures(featureName);
|
|
15
|
+
if (suggestions.length > 0) {
|
|
16
|
+
console.log("Did you mean?");
|
|
17
|
+
for (const s of suggestions) {
|
|
18
|
+
console.log(` - ${s}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
console.log("Available features:");
|
|
23
|
+
const allFeatures = getAllFeatures();
|
|
24
|
+
for (const [name] of Object.entries(allFeatures)) {
|
|
25
|
+
console.log(` - ${name}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
console.log('\nUse "npx @salesforce/webapps-features-experimental list" to see all features\n');
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
const feature = getFeatureMetadata(resolvedName);
|
|
32
|
+
console.log("\n" + "=".repeat(80));
|
|
33
|
+
console.log(`${feature.name}`);
|
|
34
|
+
console.log("=".repeat(80));
|
|
35
|
+
console.log();
|
|
36
|
+
console.log("Description:");
|
|
37
|
+
console.log(` ${feature.longDescription}`);
|
|
38
|
+
console.log();
|
|
39
|
+
console.log("Package:", feature.package);
|
|
40
|
+
console.log();
|
|
41
|
+
if (feature.keywords && feature.keywords.length > 0) {
|
|
42
|
+
console.log("Keywords:", feature.keywords.join(", "));
|
|
43
|
+
console.log();
|
|
44
|
+
}
|
|
45
|
+
if (feature.featureDependencies && feature.featureDependencies.length > 0) {
|
|
46
|
+
console.log("Feature Dependencies:");
|
|
47
|
+
for (const dep of feature.featureDependencies) {
|
|
48
|
+
const depMeta = getFeatureMetadata(dep);
|
|
49
|
+
console.log(` - ${dep}${depMeta ? ` (${depMeta.package})` : ""}`);
|
|
50
|
+
}
|
|
51
|
+
console.log();
|
|
52
|
+
}
|
|
53
|
+
if (feature.packageDependencies && Object.keys(feature.packageDependencies).length > 0) {
|
|
54
|
+
console.log("Package Dependencies:");
|
|
55
|
+
for (const [pkg, version] of Object.entries(feature.packageDependencies)) {
|
|
56
|
+
console.log(` - ${pkg}@${version}`);
|
|
57
|
+
}
|
|
58
|
+
console.log();
|
|
59
|
+
}
|
|
60
|
+
if (feature.packageDevDependencies && Object.keys(feature.packageDevDependencies).length > 0) {
|
|
61
|
+
console.log("Package Dev Dependencies:");
|
|
62
|
+
for (const [pkg, version] of Object.entries(feature.packageDevDependencies)) {
|
|
63
|
+
console.log(` - ${pkg}@${version}`);
|
|
64
|
+
}
|
|
65
|
+
console.log();
|
|
66
|
+
}
|
|
67
|
+
if (feature.copy && feature.copy.length > 0) {
|
|
68
|
+
const regularCopies = feature.copy.filter((op) => !op.integrationTarget);
|
|
69
|
+
const exampleFiles = feature.copy.filter((op) => op.integrationTarget);
|
|
70
|
+
if (regularCopies.length > 0) {
|
|
71
|
+
console.log("Copy Operations:");
|
|
72
|
+
for (const op of regularCopies) {
|
|
73
|
+
console.log(` - ${op.from} → ${op.to}`);
|
|
74
|
+
if (op.description) {
|
|
75
|
+
console.log(` ${op.description}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
console.log();
|
|
79
|
+
}
|
|
80
|
+
if (exampleFiles.length > 0) {
|
|
81
|
+
console.log("Integration Examples:");
|
|
82
|
+
console.log(" These __example__ files show how to integrate the feature:");
|
|
83
|
+
console.log();
|
|
84
|
+
for (const op of exampleFiles) {
|
|
85
|
+
console.log(` - ${op.to.split("/").pop()}`);
|
|
86
|
+
if (op.description) {
|
|
87
|
+
console.log(` ${op.description}`);
|
|
88
|
+
}
|
|
89
|
+
if (op.integrationTarget) {
|
|
90
|
+
console.log(` Review and integrate patterns into: ${op.integrationTarget}`);
|
|
91
|
+
console.log(` Then delete the example file`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
console.log();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (feature.features && feature.features.length > 0) {
|
|
98
|
+
console.log("Features:");
|
|
99
|
+
for (const item of feature.features) {
|
|
100
|
+
console.log(` - ${item}`);
|
|
101
|
+
}
|
|
102
|
+
console.log();
|
|
103
|
+
}
|
|
104
|
+
if (feature.components && feature.components.length > 0) {
|
|
105
|
+
console.log("Components:");
|
|
106
|
+
for (const component of feature.components) {
|
|
107
|
+
console.log(` - ${component}`);
|
|
108
|
+
}
|
|
109
|
+
console.log();
|
|
110
|
+
}
|
|
111
|
+
console.log("Installation:");
|
|
112
|
+
console.log(` npx @salesforce/webapps-features-experimental install ${resolvedName} --webapp-dir <path>`);
|
|
113
|
+
console.log();
|
|
114
|
+
console.log("Example:");
|
|
115
|
+
console.log(` npx @salesforce/webapps-features-experimental install ${resolvedName} \\`);
|
|
116
|
+
console.log(" --webapp-dir force-app/main/default/webapplications/mywebapp");
|
|
117
|
+
console.log();
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=describe-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe-command.js","sourceRoot":"","sources":["../src/describe-command.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACN,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,GACtB,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,WAAmB;IAClD,MAAM,YAAY,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAErD,IAAI,CAAC,YAAY,EAAE,CAAC;QACnB,OAAO,CAAC,KAAK,CAAC,wBAAwB,WAAW,IAAI,CAAC,CAAC;QACvD,MAAM,WAAW,GAAG,sBAAsB,CAAC,WAAW,CAAC,CAAC;QACxD,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;YAC7B,KAAK,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC;gBAC7B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACzB,CAAC;QACF,CAAC;aAAM,CAAC;YACP,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;YACnC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;YACrC,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;gBAClD,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;YAC5B,CAAC;QACF,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,kFAAkF,CAAC,CAAC;QA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OAAO,CAAC,GAAG,EAAE,CAAC;QACf,CAAC;IACF,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrD,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACzB,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACrC,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QAC5B,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;IAED,IAAI,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC3B,KAAK,MAAM,SAAS,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YAC5C,OAAO,CAAC,GAAG,CAAC,OAAO,SAAS,EAAE,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAC7B,OAAO,CAAC,GAAG,CACV,2DAA2D,YAAY,sBAAsB,CAC7F,CAAC;IACF,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACxB,OAAO,CAAC,GAAG,CAAC,2DAA2D,YAAY,KAAK,CAAC,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,kEAAkE,CAAC,CAAC;IAChF,OAAO,CAAC,GAAG,EAAE,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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 { CliOptions } from "./types.js";
|
|
7
|
+
/**
|
|
8
|
+
* Main installation function
|
|
9
|
+
*/
|
|
10
|
+
export declare function install(featureName: string, options: CliOptions): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Get comprehensive help text for install command
|
|
13
|
+
*/
|
|
14
|
+
export declare function getInstallHelpText(): string;
|
|
15
|
+
//# sourceMappingURL=install-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-command.d.ts","sourceRoot":"","sources":["../src/install-command.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EACX,UAAU,EAIV,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAsB,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAqHrF;AAgDD;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAwJ3C"}
|
|
@@ -0,0 +1,315 @@
|
|
|
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, readFileSync } from "fs";
|
|
7
|
+
import { join, resolve } from "path";
|
|
8
|
+
import { processFeatureOwnOperations, resolveFeatureDependencies } from "./dependency-resolver.js";
|
|
9
|
+
import { getFeatureMetadataOrThrow } from "./feature-search.js";
|
|
10
|
+
import { Logger } from "./logger.js";
|
|
11
|
+
import { installPackage, isPackageInstalled } from "./package-manager.js";
|
|
12
|
+
import { loadSchemaFromNodeModules } from "./schema-loader.js";
|
|
13
|
+
/**
|
|
14
|
+
* Main installation function
|
|
15
|
+
*/
|
|
16
|
+
export async function install(featureName, options) {
|
|
17
|
+
// Create logger and installation context
|
|
18
|
+
const logger = new Logger(options.verbose || false);
|
|
19
|
+
const context = createContext(options, logger);
|
|
20
|
+
// Validate directories
|
|
21
|
+
if (!existsSync(context.sfdxSource)) {
|
|
22
|
+
throw new Error(`SFDX source directory not found: ${context.sfdxSource}`);
|
|
23
|
+
}
|
|
24
|
+
if (!existsSync(context.webappDir)) {
|
|
25
|
+
throw new Error(`Webapp directory not found: ${context.webappDir}`);
|
|
26
|
+
}
|
|
27
|
+
// Log configuration
|
|
28
|
+
logger.info(`SFDX Source: ${context.sfdxSource}`);
|
|
29
|
+
logger.info(`Webapp Dir: ${context.webappDir}`);
|
|
30
|
+
logger.info(`Webapp Name: ${context.webappName}`);
|
|
31
|
+
if (context.dryRun) {
|
|
32
|
+
logger.info("DRY RUN MODE: No changes will be made");
|
|
33
|
+
}
|
|
34
|
+
if (Object.keys(context.conflictResolutions).length > 0) {
|
|
35
|
+
logger.info(`Loaded ${Object.keys(context.conflictResolutions).length} conflict resolutions`);
|
|
36
|
+
}
|
|
37
|
+
// Resolve feature name to package name (throws with suggestions if not found)
|
|
38
|
+
const feature = getFeatureMetadataOrThrow(featureName);
|
|
39
|
+
const packageName = feature.package;
|
|
40
|
+
const displayName = featureName;
|
|
41
|
+
// Install the main feature package (silently — logged inside feature section later)
|
|
42
|
+
if (!isPackageInstalled(packageName, context.webappDir)) {
|
|
43
|
+
await installPackage(packageName, true, context.webappDir, context.dryRun, context.verbose);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
logger.debug("Feature package already installed, skipping...");
|
|
47
|
+
}
|
|
48
|
+
// Mark as installed
|
|
49
|
+
context.installedFeatures.add(packageName);
|
|
50
|
+
if (context.dryRun) {
|
|
51
|
+
logger.info("[DRY RUN] Would load and process feature schema");
|
|
52
|
+
}
|
|
53
|
+
// Load the feature schema
|
|
54
|
+
const schema = loadSchemaFromNodeModules(packageName, context.webappDir, context.logger);
|
|
55
|
+
if (!schema) {
|
|
56
|
+
logger.warn("No features.json found. Refer to README for manual instructions.");
|
|
57
|
+
logger.info(`Try: cat node_modules/${packageName}/README.md`);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
logger.debug("Feature schema:", JSON.stringify(schema, null, 2));
|
|
61
|
+
// Determine dependencies for summary
|
|
62
|
+
const deps = schema.featureDependencies ?? [];
|
|
63
|
+
// Log installation summary
|
|
64
|
+
logger.info(`Installing feature: ${displayName}`);
|
|
65
|
+
if (deps.length > 0) {
|
|
66
|
+
logger.info(`Dependencies: ${deps.join(", ")}`);
|
|
67
|
+
}
|
|
68
|
+
// Install feature dependencies (each gets its own section)
|
|
69
|
+
if (deps.length > 0) {
|
|
70
|
+
await resolveFeatureDependencies(deps, context);
|
|
71
|
+
}
|
|
72
|
+
// Open main feature section
|
|
73
|
+
logger.section(`Installing feature: ${displayName}`);
|
|
74
|
+
logger.plain(`Installing package: ${packageName}`);
|
|
75
|
+
// Process this feature's own package deps and copy operations
|
|
76
|
+
await processFeatureOwnOperations(schema, packageName, context);
|
|
77
|
+
logger.sectionEnd(`Feature installed: ${displayName}`);
|
|
78
|
+
// Success message
|
|
79
|
+
console.log();
|
|
80
|
+
if (deps.length === 1) {
|
|
81
|
+
logger.success(`Installed feature: ${displayName} (with dependency: ${deps[0]})`);
|
|
82
|
+
}
|
|
83
|
+
else if (deps.length > 1) {
|
|
84
|
+
logger.success(`Installed feature: ${displayName} (with dependencies: ${deps.join(", ")})`);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
logger.success(`Installed feature: ${displayName}`);
|
|
88
|
+
}
|
|
89
|
+
if (!context.dryRun) {
|
|
90
|
+
// Show example files that need integration
|
|
91
|
+
if (context.copiedExampleFiles.length > 0) {
|
|
92
|
+
console.log();
|
|
93
|
+
console.log("Example files copied (require manual integration):");
|
|
94
|
+
for (const exampleFile of context.copiedExampleFiles) {
|
|
95
|
+
const relativePath = exampleFile.file.replace(context.webappDir + "/", "");
|
|
96
|
+
console.log(` - ${relativePath}`);
|
|
97
|
+
if (exampleFile.integrationTarget) {
|
|
98
|
+
console.log(` → Integrate into: ${exampleFile.integrationTarget}`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
console.log();
|
|
103
|
+
console.log("Next steps:");
|
|
104
|
+
console.log(" 1. Review copied files (including __example__ files)");
|
|
105
|
+
if (context.copiedExampleFiles.length > 0) {
|
|
106
|
+
console.log(" 2. Integrate patterns from __example__ files into target files");
|
|
107
|
+
console.log(" 3. Delete __example__ files after integration");
|
|
108
|
+
console.log(" 4. Run: npm run build && npm run dev");
|
|
109
|
+
console.log(" 5. Test the feature");
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
console.log(" 2. Run: npm run build && npm run dev");
|
|
113
|
+
console.log(" 3. Test the feature");
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Create installation context from CLI options
|
|
119
|
+
*/
|
|
120
|
+
function createContext(options, loggerInstance) {
|
|
121
|
+
// Resolve paths (webappDir is required as webapp name, sfdxSource has default)
|
|
122
|
+
const sfdxSource = resolve(options.sfdxSource || "force-app/main/default");
|
|
123
|
+
const webappName = options.webappDir;
|
|
124
|
+
const webappDir = join(sfdxSource, "webapplications", webappName);
|
|
125
|
+
// Determine conflict mode
|
|
126
|
+
let conflictMode = options.onConflict || "prompt";
|
|
127
|
+
if (options.yes) {
|
|
128
|
+
conflictMode = "skip";
|
|
129
|
+
}
|
|
130
|
+
// Load conflict resolutions if provided
|
|
131
|
+
let conflictResolutions = {};
|
|
132
|
+
if (options.conflictResolution) {
|
|
133
|
+
const resolutionPath = resolve(options.conflictResolution);
|
|
134
|
+
if (!existsSync(resolutionPath)) {
|
|
135
|
+
throw new Error(`Conflict resolution file not found: ${resolutionPath}`);
|
|
136
|
+
}
|
|
137
|
+
try {
|
|
138
|
+
const content = readFileSync(resolutionPath, "utf-8");
|
|
139
|
+
conflictResolutions = JSON.parse(content);
|
|
140
|
+
loggerInstance.debug(`Loaded conflict resolutions from: ${resolutionPath}`);
|
|
141
|
+
}
|
|
142
|
+
catch (_error) {
|
|
143
|
+
throw new Error(`Failed to parse conflict resolution file: ${resolutionPath}`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
sfdxSource,
|
|
148
|
+
webappDir,
|
|
149
|
+
webappName,
|
|
150
|
+
verbose: options.verbose || false,
|
|
151
|
+
dryRun: options.dryRun || false,
|
|
152
|
+
conflictMode: conflictMode,
|
|
153
|
+
conflictResolutions,
|
|
154
|
+
installedFeatures: new Set(),
|
|
155
|
+
copiedExampleFiles: [],
|
|
156
|
+
logger: loggerInstance,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Get comprehensive help text for install command
|
|
161
|
+
*/
|
|
162
|
+
export function getInstallHelpText() {
|
|
163
|
+
return `
|
|
164
|
+
|
|
165
|
+
DESCRIPTION
|
|
166
|
+
Install a Salesforce webapp feature package with automatic dependency resolution,
|
|
167
|
+
file copying, and conflict management.
|
|
168
|
+
|
|
169
|
+
DISCOVERING FEATURES
|
|
170
|
+
Before installing, discover what features are available:
|
|
171
|
+
|
|
172
|
+
List all features:
|
|
173
|
+
$ npx @salesforce/webapps-features-experimental list
|
|
174
|
+
|
|
175
|
+
Search for features:
|
|
176
|
+
$ npx @salesforce/webapps-features-experimental list --search "auth"
|
|
177
|
+
|
|
178
|
+
Get detailed information:
|
|
179
|
+
$ npx @salesforce/webapps-features-experimental describe authentication
|
|
180
|
+
|
|
181
|
+
This tool automates the feature installation workflow by:
|
|
182
|
+
1. Resolving feature names to npm packages
|
|
183
|
+
2. Installing npm packages as dev dependencies
|
|
184
|
+
3. Recursively processing feature dependencies
|
|
185
|
+
4. Installing package dependencies
|
|
186
|
+
5. Copying files from the feature package to your project
|
|
187
|
+
6. Handling conflicts interactively or via configuration
|
|
188
|
+
|
|
189
|
+
PREREQUISITES
|
|
190
|
+
- Run from within your webapp directory, or provide explicit paths
|
|
191
|
+
- Ensure package.json exists in the webapp directory
|
|
192
|
+
- Ensure feature packages include a features.json file
|
|
193
|
+
|
|
194
|
+
WORKFLOW EXAMPLES
|
|
195
|
+
|
|
196
|
+
Basic installation (interactive):
|
|
197
|
+
$ npx @salesforce/webapps-features-experimental install authentication \\
|
|
198
|
+
--webapp-dir mywebapp
|
|
199
|
+
|
|
200
|
+
The CLI will:
|
|
201
|
+
- Install the authentication feature package
|
|
202
|
+
- Process its dependencies (e.g., shadcn)
|
|
203
|
+
- Prompt for any file conflicts
|
|
204
|
+
- Copy all files including __example__ files
|
|
205
|
+
|
|
206
|
+
Installation with custom SFDX source:
|
|
207
|
+
$ npx @salesforce/webapps-features-experimental install authentication \\
|
|
208
|
+
--webapp-dir mywebapp \\
|
|
209
|
+
--sfdx-source custom/sfdx/path
|
|
210
|
+
|
|
211
|
+
LLM-assisted workflow (RECOMMENDED for AI assistants):
|
|
212
|
+
1. Run with error mode to detect conflicts:
|
|
213
|
+
$ npx @salesforce/webapps-features-experimental install authentication \\
|
|
214
|
+
--webapp-dir mywebapp \\
|
|
215
|
+
--on-conflict error
|
|
216
|
+
|
|
217
|
+
2. CLI outputs conflict list with instructions
|
|
218
|
+
|
|
219
|
+
3. Create conflict-resolution.json based on user preferences
|
|
220
|
+
|
|
221
|
+
4. Rerun with resolution file:
|
|
222
|
+
$ npx @salesforce/webapps-features-experimental install authentication \\
|
|
223
|
+
--webapp-dir mywebapp \\
|
|
224
|
+
--conflict-resolution conflict-resolution.json
|
|
225
|
+
|
|
226
|
+
Dry run to preview changes:
|
|
227
|
+
$ npx @salesforce/webapps-features-experimental install authentication \\
|
|
228
|
+
--webapp-dir mywebapp \\
|
|
229
|
+
--dry-run
|
|
230
|
+
|
|
231
|
+
Non-interactive installation (skip conflicts):
|
|
232
|
+
$ npx @salesforce/webapps-features-experimental install authentication \\
|
|
233
|
+
--webapp-dir mywebapp \\
|
|
234
|
+
--yes
|
|
235
|
+
|
|
236
|
+
FEATURE SCHEMA
|
|
237
|
+
Features must include a features.json file that defines:
|
|
238
|
+
|
|
239
|
+
- featureDependencies: Other features to install first
|
|
240
|
+
- packageDependencies: npm packages to add to dependencies
|
|
241
|
+
- packageDevDependencies: npm packages to add to devDependencies
|
|
242
|
+
- copy: Files/directories to copy from the package
|
|
243
|
+
|
|
244
|
+
Example:
|
|
245
|
+
{
|
|
246
|
+
"featureDependencies": ["shadcn"],
|
|
247
|
+
"packageDependencies": {
|
|
248
|
+
"@tanstack/react-form": "^1.28.3"
|
|
249
|
+
},
|
|
250
|
+
"copy": [
|
|
251
|
+
{
|
|
252
|
+
"from": "force-app/main/default/classes",
|
|
253
|
+
"to": "<sfdxSource>/classes",
|
|
254
|
+
"description": "Apex classes"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"from": "force-app/main/default/webapplications/feature-auth/src/auth",
|
|
258
|
+
"to": "<webappDir>/src/auth",
|
|
259
|
+
"description": "Auth components"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"from": "force-app/main/default/webapplications/feature-auth/src/__example__app.tsx",
|
|
263
|
+
"to": "<webappDir>/src/__example__app.tsx",
|
|
264
|
+
"description": "Integration example",
|
|
265
|
+
"integrationTarget": "src/app.tsx"
|
|
266
|
+
}
|
|
267
|
+
]
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
EXAMPLE FILES
|
|
271
|
+
Feature packages may include __example__ files (e.g., __example__routes.tsx)
|
|
272
|
+
that show how to integrate the feature into your existing code.
|
|
273
|
+
|
|
274
|
+
After installation:
|
|
275
|
+
1. Review the __example__ files
|
|
276
|
+
2. Manually integrate patterns into your actual files
|
|
277
|
+
3. Delete the __example__ files once integrated
|
|
278
|
+
|
|
279
|
+
PATH RESOLUTION
|
|
280
|
+
Schema paths support these placeholders:
|
|
281
|
+
|
|
282
|
+
- <sfdxSource>/path → Resolves to <sfdx-source>/path
|
|
283
|
+
Example: <sfdxSource>/classes → force-app/main/default/classes
|
|
284
|
+
|
|
285
|
+
- <webappDir>/path → Resolves to <sfdx-source>/webapplications/<webapp-dir>/path
|
|
286
|
+
Example: <webappDir>/src/auth → force-app/main/default/webapplications/mywebapp/src/auth
|
|
287
|
+
|
|
288
|
+
Hint placeholders (for user/LLM guidance):
|
|
289
|
+
- Some "to" paths contain descriptive segments like <desired-page-with-search-input>
|
|
290
|
+
that are NOT resolved by the CLI. These are hints indicating the user or LLM
|
|
291
|
+
should choose an appropriate destination. The file will be copied with the
|
|
292
|
+
literal placeholder name; rename or relocate it to the intended target.
|
|
293
|
+
|
|
294
|
+
Legacy formats are also supported:
|
|
295
|
+
- force-app/main/default/classes → Treated as SFDX metadata
|
|
296
|
+
- <webapp> placeholder → Replaced with webapp name
|
|
297
|
+
|
|
298
|
+
AFTER INSTALLATION
|
|
299
|
+
1. Review copied files, especially __example__ files
|
|
300
|
+
2. Integrate __example__ patterns into your code
|
|
301
|
+
3. Run: npm run build && npm run dev
|
|
302
|
+
4. Test the new feature
|
|
303
|
+
5. Delete __example__ files after integration
|
|
304
|
+
|
|
305
|
+
TROUBLESHOOTING
|
|
306
|
+
- "SFDX source directory not found": Check --sfdx-source path
|
|
307
|
+
- "Webapp directory not found": Check --webapp-dir name and --sfdx-source path
|
|
308
|
+
- "No features.json found": Feature package doesn't support this tool
|
|
309
|
+
- Conflicts in error mode: Follow instructions to create conflict-resolution.json
|
|
310
|
+
- npm install failures: Check network and package availability
|
|
311
|
+
|
|
312
|
+
For more information, see: .a4drules/webapplications.md
|
|
313
|
+
`;
|
|
314
|
+
}
|
|
315
|
+
//# sourceMappingURL=install-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-command.js","sourceRoot":"","sources":["../src/install-command.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACnG,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAA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IACjC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsJP,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* List all available features
|
|
8
|
+
*/
|
|
9
|
+
export declare function listFeatures(options: {
|
|
10
|
+
verbose?: boolean;
|
|
11
|
+
search?: string;
|
|
12
|
+
}): void;
|
|
13
|
+
//# sourceMappingURL=list-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-command.d.ts","sourceRoot":"","sources":["../src/list-command.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA2ElF"}
|