@salesforce/afv-skills 1.37.0 → 1.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/agentforce-generate/README.md +20 -3
- package/skills/agentforce-generate/SKILL.md +253 -440
- package/skills/agentforce-generate/assets/agent-spec-template.md +6 -2
- package/skills/agentforce-generate/assets/agents/order-service.agent +16 -12
- package/skills/agentforce-generate/assets/agents/production-faq.agent +4 -4
- package/skills/agentforce-generate/assets/agents/router-first.agent +5 -5
- package/skills/agentforce-generate/assets/agents/template-single-subagent.agent +4 -4
- package/skills/agentforce-generate/assets/agents/verification-gate.agent +8 -6
- package/skills/agentforce-generate/assets/agents/voice-knowledge-grounded.agent +9 -9
- package/skills/agentforce-generate/assets/agents/voice-service-agent.agent +7 -7
- package/skills/agentforce-generate/assets/patterns/README.md +3 -3
- package/skills/agentforce-generate/assets/patterns/action-callbacks.agent +5 -5
- package/skills/agentforce-generate/assets/patterns/advanced-input-bindings.agent +6 -8
- package/skills/agentforce-generate/assets/patterns/bidirectional-routing.agent +11 -13
- package/skills/agentforce-generate/assets/patterns/critical-input-collection.agent +11 -16
- package/skills/agentforce-generate/assets/patterns/lifecycle-events.agent +2 -3
- package/skills/agentforce-generate/assets/patterns/llm-controlled-actions.agent +6 -7
- package/skills/agentforce-generate/assets/patterns/open-gate-routing.agent +3 -3
- package/skills/agentforce-generate/assets/patterns/prompt-template-action.agent +14 -19
- package/skills/agentforce-generate/assets/patterns/system-instruction-overrides.agent +11 -20
- package/skills/agentforce-generate/references/actions-reference.md +2 -2
- package/skills/agentforce-generate/references/agent-audit-and-repair.md +135 -0
- package/skills/agentforce-generate/references/agent-audit-candidate-verification.md +160 -0
- package/skills/agentforce-generate/references/agent-audit-diagnostic-catalog.md +156 -0
- package/skills/agentforce-generate/references/agent-audit-diagnostics-actions-state.md +176 -0
- package/skills/agentforce-generate/references/agent-audit-diagnostics-architecture-evaluation.md +68 -0
- package/skills/agentforce-generate/references/agent-audit-diagnostics-instructions-routing.md +283 -0
- package/skills/agentforce-generate/references/agent-audit-evaluation-loop.md +191 -0
- package/skills/agentforce-generate/references/agent-audit-repair-report.md +143 -0
- package/skills/agentforce-generate/references/agent-audit-scope-path-review.md +180 -0
- package/skills/agentforce-generate/references/agent-design-and-spec-creation.md +105 -59
- package/skills/agentforce-generate/references/agent-script-core-language.md +144 -61
- package/skills/agentforce-generate/references/agent-subagent-map-diagrams.md +33 -23
- package/skills/agentforce-generate/references/agent-validation-and-debugging.md +37 -11
- package/skills/agentforce-generate/references/agentscript-toolchain.md +112 -0
- package/skills/agentforce-generate/references/architecture-patterns.md +81 -18
- package/skills/agentforce-generate/references/common-control-flow-pitfalls.md +255 -0
- package/skills/agentforce-generate/references/control-flow-actions-sequencing.md +198 -0
- package/skills/agentforce-generate/references/control-flow-lifecycle-side-effects.md +87 -0
- package/skills/agentforce-generate/references/examples.md +22 -22
- package/skills/agentforce-generate/references/instruction-resolution.md +123 -83
- package/skills/agentforce-generate/references/known-issues.md +1 -2
- package/skills/agentforce-generate/references/optimization-pattern-1-data-flow.md +4 -0
- package/skills/agentforce-generate/references/optimization-pattern-2-deterministic-logic.md +33 -0
- package/skills/agentforce-generate/references/optimization-pattern-3-reference-syntax.md +32 -3
- package/skills/agentforce-generate/references/optimization-pattern-4-escalation.md +2 -2
- package/skills/agentforce-generate/references/patterns-by-requirement.md +3 -1
- package/skills/agentforce-generate/references/posture-and-determinism.md +103 -22
- package/skills/agentforce-generate/references/reference-map.md +19 -3
- package/skills/agentforce-generate/references/scoring-rubric.md +1 -1
- package/skills/agentforce-generate/references/voice-latency-heuristics.md +4 -0
- package/skills/agentforce-generate/references/voice-modality-reference.md +4 -4
- package/skills/agentforce-generate/references/zen-of-agentscript.md +139 -23
- package/skills/agentforce-generate/scripts/agentscript-sdk-loader.mjs +133 -0
- package/skills/agentforce-generate/scripts/index-agent.mjs +141 -0
- package/skills/agentforce-generate/scripts/setup-agentscript-sdk.mjs +337 -0
- package/skills/automation-sandbox-post-copy-config-generate/SKILL.md +1 -1
- package/skills/automation-sandbox-post-copy-configure/SKILL.md +433 -0
- package/skills/automation-sandbox-post-copy-configure/assets/api_request_templates.json +89 -0
- package/skills/automation-sandbox-post-copy-configure/examples/sample_config_input.json +40 -0
- package/skills/automation-sandbox-post-copy-configure/examples/sample_execution_summary.md +79 -0
- package/skills/automation-sandbox-post-copy-configure/references/api_endpoints.md +273 -0
- package/skills/automation-sandbox-post-copy-configure/references/authentication.md +94 -0
- package/skills/automation-sandbox-post-copy-configure/references/execution_phasing.md +93 -0
- package/skills/automation-sandbox-post-copy-configure/references/rules_gotchas.md +35 -0
- package/skills/automation-sandbox-post-copy-configure/scripts/classify-patch-result.mjs +88 -0
- package/skills/automation-sandbox-post-copy-configure/scripts/map-metadata-key.mjs +98 -0
- package/skills/automation-sandbox-post-copy-configure/scripts/plan-phases.mjs +98 -0
- package/skills/automation-sandbox-post-copy-configure/scripts/resolve-target-org.mjs +56 -0
- package/skills/design-systems-slds-validate/SKILL.md +14 -13
- package/skills/dx-code-analyzer-custom-rule-create/examples/xpath-examples.md +1 -1
- package/skills/dx-code-analyzer-custom-rule-create/references/xpath-patterns-security.md +1 -1
- package/skills/dx-org-devhub-configure/SKILL.md +268 -0
- package/skills/dx-org-devhub-configure/examples/status-output.md +39 -0
- package/skills/dx-org-devhub-configure/scripts/devhub.sh +650 -0
- package/skills/dx-org-devhub-configure/scripts/test-devhub.sh +116 -0
- package/skills/dx-org-manage/SKILL.md +135 -42
- package/skills/dx-org-manage/assets/derive-alias.sh +95 -0
- package/skills/dx-org-manage/assets/scratch-def.seed.json +6 -0
- package/skills/dx-org-manage/examples/README.md +1 -1
- package/skills/dx-org-manage/examples/scratch-orgs/delete_output.json +8 -0
- package/skills/dx-org-manage/examples/scratch-orgs/display_output.json +23 -0
- package/skills/dx-org-manage/examples/scratch-orgs/list_output.json +58 -0
- package/skills/dx-org-manage/examples/scratch-orgs/resume_output.json +38 -0
- package/skills/dx-org-manage/examples/scratch-orgs/success_definition_file.json +1 -1
- package/skills/dx-org-manage/examples/scratch-orgs/success_edition.json +1 -1
- package/skills/dx-org-manage/examples/scratch-orgs/success_shape.json +41 -0
- package/skills/dx-org-manage/examples/scratch-orgs/success_snapshot.json +1 -1
- package/skills/dx-org-manage/examples/snapshots/error_output.json +3 -3
- package/skills/dx-org-manage/references/creating-scratch-org.md +2 -2
- package/skills/dx-org-manage/references/creating-snapshot.md +1 -2
- package/skills/dx-org-manage/references/definition_file_options.md +24 -0
- package/skills/dx-org-manage/references/edition_types.md +10 -8
- package/skills/dx-org-manage/references/opening-org.md +11 -12
- package/skills/dx-org-manage/references/scratch-org-create.md +303 -0
- package/skills/dx-org-manage/references/scratch-org-operations.md +135 -0
- package/skills/experience-aura-lwc-migrate/SKILL.md +120 -0
- package/skills/experience-aura-lwc-migrate/references/aura-api-expert.md +170 -0
- package/skills/experience-aura-lwc-migrate/references/aura-data-expert.md +172 -0
- package/skills/experience-aura-lwc-migrate/references/aura-migration-guidelines.md +299 -0
- package/skills/experience-aura-lwc-migrate/references/aura-prd-framework.md +79 -0
- package/skills/experience-aura-lwc-migrate/references/aura-redundant-code-expert.md +24 -0
- package/skills/experience-aura-lwc-migrate/references/aura-reference-expert.md +140 -0
- package/skills/experience-aura-lwc-migrate/references/aura-resolver-expert.md +115 -0
- package/skills/experience-aura-lwc-migrate/references/aura-slots-expert.md +67 -0
- package/skills/experience-aura-lwc-migrate/references/aura-style-expert.md +62 -0
- package/skills/experience-aura-lwc-migrate/references/aura-to-lwc-completeness-checklist.md +188 -0
- package/skills/experience-aura-lwc-migrate/references/aura-values-expert.md +67 -0
- package/skills/experience-content-media-search/SKILL.md +17 -12
- package/skills/experience-content-media-stock-image-search/SKILL.md +192 -0
- package/skills/experience-content-media-stock-image-search/scripts/download-stock-image.py +102 -0
- package/skills/experience-lds-best-practices-apply/SKILL.md +245 -0
- package/skills/experience-lds-best-practices-apply/references/adapter-apis.md +1640 -0
- package/skills/experience-lds-best-practices-apply/references/lds-data-consistency.md +126 -0
- package/skills/experience-lds-best-practices-apply/references/lds-expert.md +429 -0
- package/skills/experience-lds-best-practices-apply/references/lds-referential-integrity.md +322 -0
- package/skills/experience-lds-best-practices-apply/references/wire-adapter-types.md +1511 -0
- package/skills/experience-lds-graphql-generate/SKILL.md +222 -0
- package/skills/experience-lds-graphql-generate/references/generation-guide.md +236 -0
- package/skills/experience-lds-graphql-generate/references/generation-mutation.md +277 -0
- package/skills/experience-lds-graphql-generate/references/generation-query.md +237 -0
- package/skills/experience-lds-graphql-generate/scripts/fetch-lds-graphql-schema.sh +230 -0
- package/skills/experience-lds-graphql-generate/scripts/test-lds-graphql-query.sh +128 -0
- package/skills/experience-lwc-accessibility-validate/SKILL.md +112 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-1-1-non-text-content.md +88 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-i-lists.md +52 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-ii-tables.md +106 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-iii-form-labels.md +78 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-iv-regions.md +26 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-v-groups.md +66 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-5-identify-input.md +70 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-4-3-contrast.md +115 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-1-1-keyboard.md +47 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-4-4-link-purpose.md +39 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-4-6-headings-labels.md +50 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-1-pointer-gestures.md +54 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-2-pointer-cancellation.md +49 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-3-label-in-name.md +77 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-7-dragging-movement.md +45 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-2-1-on-focus.md +55 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-2-2-on-input.md +51 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-3-1-error-identification.md +84 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-3-2-labels-instructions.md +50 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-3-3-error-suggestion.md +64 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-4-1-2-i-name.md +105 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-4-1-2-ii-role.md +99 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-4-1-2-iii-value.md +97 -0
- package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-1-1-non-text-content.md +83 -0
- package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-1-use-of-color.md +62 -0
- package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-10-resize-reflow.md +18 -0
- package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-11-non-text-contrast.md +43 -0
- package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-3-contrast.md +25 -0
- package/skills/experience-lwc-accessibility-validate/scripts/contrast-ratio.py +153 -0
- package/skills/experience-lwc-design-generate/SKILL.md +261 -0
- package/skills/experience-lwc-design-generate/references/figma-to-prd-blueprint.md +66 -0
- package/skills/experience-lwc-design-generate/references/prd-analysis-template.md +17 -0
- package/skills/experience-lwc-design-generate/scripts/check-component-name.sh +75 -0
- package/skills/experience-lwc-design-generate/scripts/detect-project-tools.sh +97 -0
- package/skills/experience-lwc-runtime-observe/SKILL.md +244 -0
- package/skills/experience-lwc-runtime-observe/examples/component-preview-and-dom.md +41 -0
- package/skills/experience-lwc-runtime-observe/scripts/extract-dom.sh +79 -0
- package/skills/experience-lwc-runtime-observe/scripts/open-frontdoor.sh +46 -0
- package/skills/experience-lwc-runtime-observe/scripts/verify-toolchain.sh +48 -0
- package/skills/experience-lwc-security-validate/SKILL.md +151 -0
- package/skills/experience-lwc-security-validate/examples/review-report.md +6 -0
- package/skills/experience-lwc-security-validate/examples/score-report.sarif.json +32 -0
- package/skills/experience-lwc-security-validate/references/lws-security-expert.md +986 -0
- package/skills/experience-lwc-security-validate/references/security-analysis.md +611 -0
- package/skills/experience-lwc-security-validate/scripts/check-lwc-import.sh +166 -0
- package/skills/experience-lwc-security-validate/scripts/validate-sarif.sh +131 -0
- package/skills/experience-ui-bundle-2gp-deploy/SKILL.md +454 -0
- package/skills/experience-ui-bundle-2gp-deploy/assets/CustomApplication.app-meta.xml +12 -0
- package/skills/experience-ui-bundle-2gp-deploy/assets/PermissionSet.permissionset-meta.xml +9 -0
- package/skills/experience-ui-bundle-2gp-deploy/scripts/find-bundle-package-dir.sh +53 -0
- package/skills/experience-ui-bundle-agentforce-client-generate/SKILL.md +104 -26
- package/skills/experience-ui-bundle-agentforce-client-generate/references/constraints.md +35 -24
- package/skills/experience-ui-bundle-agentforce-client-generate/references/examples.md +92 -1
- package/skills/experience-ui-bundle-agentforce-client-generate/references/style-tokens.md +2 -0
- package/skills/experience-ui-bundle-agentforce-client-generate/references/troubleshooting.md +14 -1
- package/skills/experience-ui-bundle-agentforce-client-generate/scripts/detect-framework.sh +67 -0
- package/skills/experience-ui-bundle-deploy/SKILL.md +83 -14
- package/skills/experience-ui-bundle-deploy/assets/Communities.settings-meta.xml +19 -0
- package/skills/experience-ui-bundle-deploy/assets/org-setup.config.template.json +5 -0
- package/skills/experience-ui-bundle-deploy/assets/social-login-auth-providers.apex +158 -0
- package/skills/experience-ui-bundle-deploy/references/config-scaffold.md +13 -1
- package/skills/experience-ui-bundle-deploy/references/social-login.md +179 -0
- package/skills/experience-ui-bundle-frontend-generate/SKILL.md +14 -0
- package/skills/experience-ui-bundle-mfa-configure/SKILL.md +6 -5
- package/skills/experience-ui-bundle-mfa-configure/references/social-login.md +15 -7
- package/skills/experience-ui-bundle-salesforce-data-access/SKILL.md +41 -5
- package/skills/experience-ui-bundle-salesforce-data-access/references/caching.md +10 -22
- package/skills/experience-ui-bundle-salesforce-data-access/references/graphql-hand-authoring.md +4 -19
- package/skills/experience-ui-bundle-salesforce-data-access/references/migration.md +5 -0
- package/skills/experience-ui-bundle-salesforce-data-access/references/sdk-api.md +33 -150
- package/skills/mobile-platform-native-capabilities-integrate/references/nfc.md +35 -0
- package/skills/platform-apex-generate/SKILL.md +8 -7
- package/skills/platform-apex-test-generate/SKILL.md +3 -1
- package/skills/platform-apex-test-run/SKILL.md +9 -8
- package/skills/platform-lightning-type-widget-coordinate/SKILL.md +1 -1
- package/skills/platform-lightning-type-widget-coordinate/examples/existing-lightning-type-with-widget-prompt.md +1 -1
- package/skills/platform-lightning-type-widget-coordinate/examples/new-lightning-type-with-widget-prompt.md +1 -1
- package/skills/platform-lightning-type-widget-coordinate/references/validation-gates.md +3 -3
- package/skills/platform-mcp-tool-widget-coordinate/SKILL.md +43 -67
- package/skills/platform-mcp-tool-widget-coordinate/examples/action-name-source-prompt.md +1 -2
- package/skills/platform-mcp-tool-widget-coordinate/examples/apex-invocable-source-prompt.md +2 -3
- package/skills/platform-mcp-tool-widget-coordinate/examples/nested-object-list-source-prompt.md +163 -0
- package/skills/platform-mcp-tool-widget-coordinate/examples/nested-object-single-source-prompt.md +198 -0
- package/skills/platform-mcp-tool-widget-coordinate/examples/pasted-tool-output-prompt.md +0 -1
- package/skills/platform-mcp-tool-widget-coordinate/references/build-plan-format.md +17 -11
- package/skills/platform-mcp-tool-widget-coordinate/references/mcp-tool-output-discovery.md +48 -15
- package/skills/platform-mcp-tool-widget-coordinate/references/two-clt-modeling.md +73 -10
- package/skills/platform-mcp-tool-widget-coordinate/references/validation-gates.md +48 -8
- package/skills/platform-policy-rule-generate/SKILL.md +22 -12
- package/skills/platform-policy-rule-generate/references/deploy-errors.md +1 -1
- package/skills/platform-policy-rule-generate/references/policy-schema-full.md +8 -29
- package/skills/platform-policy-rule-generate/references/templates-advanced.md +1 -1
- package/skills/platform-sharing-owd-configure/SKILL.md +20 -8
- package/skills/platform-sharing-owd-configure/references/access_levels.md +14 -1
- package/skills/platform-sharing-rules-generate/SKILL.md +67 -35
- package/skills/platform-sharing-rules-generate/examples/create-cases.md +16 -17
- package/skills/platform-sharing-rules-generate/examples/delete-cases.md +34 -79
- package/skills/platform-sharing-rules-generate/examples/edit-cases.md +13 -26
- package/skills/platform-sharing-rules-generate/scripts/count-remaining-rules.sh +33 -0
- package/skills/platform-widget-generate/SKILL.md +3 -5
- package/skills/platform-widget-generate/examples/conditional.json +18 -13
- package/skills/platform-widget-generate/examples/list-with-foreach.json +2 -2
- package/skills/platform-widget-generate/examples/single-object.json +2 -2
- package/skills/platform-widget-generate/references/schema-from-lightning-type.md +27 -6
- package/skills/platform-widget-generate/references/widget-bundle-layout.md +4 -3
- package/skills/service-itsm-agentic-setup-cmdb-access-assign/SKILL.md +287 -0
- package/skills/service-itsm-agentic-setup-cmdb-access-assign/references/mcp-invocation.md +260 -0
- package/skills/service-itsm-agentic-setup-cmdb-bundle-deploy/SKILL.md +252 -0
- package/skills/service-itsm-agentic-setup-cmdb-bundle-deploy/references/mcp-invocation.md +204 -0
- package/skills/service-itsm-agentic-setup-cmdb-configure/SKILL.md +259 -0
- package/skills/service-itsm-agentic-setup-cmdb-configure/references/mcp-invocation.md +188 -0
- package/skills/service-itsm-agentic-setup-cmdb-coordinate/SKILL.md +197 -0
- package/skills/service-itsm-agentic-setup-cmdb-coordinate/examples/output-templates.md +77 -0
- package/skills/service-itsm-agentic-setup-cmdb-discovery-configure/SKILL.md +316 -0
- package/skills/service-itsm-agentic-setup-cmdb-discovery-configure/references/mcp-invocation.md +221 -0
- package/skills/service-itsm-incident-priority-configure/SKILL.md +168 -0
- package/skills/service-itsm-incident-priority-configure/examples/matrix-operations.md +200 -0
- package/skills/service-itsm-incident-priority-configure/examples/render-matrix.md +54 -0
- package/skills/service-itsm-incident-priority-configure/examples/seed-full-matrix.md +52 -0
- package/skills/service-itsm-incident-priority-configure/references/sf-cli-invocation.md +264 -0
- package/skills/platform-mcp-tool-widget-coordinate/examples/nested-object-source-prompt.md +0 -191
- package/skills/platform-policy-rule-generate/references/fixtures-index.md +0 -29
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: experience-ui-bundle-2gp-deploy
|
|
3
|
+
description: "MUST activate when the user wants to package, distribute, or install/upgrade/uninstall/promote a UI Bundle as a Salesforce second-generation (2GP) package (project may contain uiBundles/ or sfdx-project.json for packaging tasks; install/upgrade tasks may lack local bundle files). Handles making a bundle packageable, choosing managed/unlocked flavor, creating package/version with sf package, installing/upgrading in another org, and debugging failures. TRIGGER on packaging, 2GP, managed package, unlocked package, AppExchange, package version, sf package, sf package install, sf package upgrade, install a package, upgrade a package, cross-org distribution. DO NOT TRIGGER for plain source deploy to one org (use experience-ui-bundle-deploy) or scaffolding a new bundle (use experience-ui-bundle-project-generate). Apply piecemeal — do ONLY the part asked."
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.0"
|
|
6
|
+
minApiVersion: "58.0"
|
|
7
|
+
relatedSkills:
|
|
8
|
+
- "experience-ui-bundle-deploy"
|
|
9
|
+
- "experience-ui-bundle-project-generate"
|
|
10
|
+
accessCheck:
|
|
11
|
+
- type: "orgPref"
|
|
12
|
+
value: "Package2Enabled"
|
|
13
|
+
cliTools:
|
|
14
|
+
- tool: ["jq"]
|
|
15
|
+
semver: ">=1.6"
|
|
16
|
+
- tool: ["node"]
|
|
17
|
+
semver: ">=18.0.0"
|
|
18
|
+
- tool: ["npm"]
|
|
19
|
+
semver: ">=7.0.0"
|
|
20
|
+
- tool: ["sf"]
|
|
21
|
+
semver: ">=2.0.0"
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# Package an existing UI Bundle (2GP)
|
|
25
|
+
|
|
26
|
+
How to take a **UI Bundle that already exists in the current project**
|
|
27
|
+
(under `<packageDir>/uiBundles/<name>/`, where `<packageDir>` is the package
|
|
28
|
+
directory from `sfdx-project.json` — commonly `force-app/main/default`) and ship
|
|
29
|
+
it as a **second-generation package** (2GP), then install / upgrade / uninstall
|
|
30
|
+
it in another org.
|
|
31
|
+
|
|
32
|
+
**This is reference knowledge, not a runbook to execute top-to-bottom.** The
|
|
33
|
+
user already has a project and a built (or buildable) bundle. Read their intent
|
|
34
|
+
and apply only the matching part:
|
|
35
|
+
|
|
36
|
+
**Answer only what was asked.** Give the commands for the one part the user
|
|
37
|
+
needs plus the org each targets and any genuine caveat — nothing else. Do **not**
|
|
38
|
+
restate the other parts, re-explain the flavor table, or replay the full
|
|
39
|
+
build→create→install→promote sequence when the user asked about a single step. A
|
|
40
|
+
debug question wants the fix, not a packaging tutorial; an install question wants
|
|
41
|
+
the `sf package install` line and the subscriber-vs-Dev-Hub distinction, not
|
|
42
|
+
Part 1 and Part 2. Brevity is correctness here.
|
|
43
|
+
|
|
44
|
+
| The user wants to… | Go to |
|
|
45
|
+
|---|---|
|
|
46
|
+
| Decide managed vs. unlocked | [Choose a flavor](#choose-a-flavor) |
|
|
47
|
+
| Make the bundle packageable / wire a CustomApplication | [Part 1](#part-1--make-the-existing-bundle-packageable) |
|
|
48
|
+
| Create the package or a new version | [Part 2](#part-2--create-the-package-dev-hub-only) |
|
|
49
|
+
| Install / upgrade / uninstall / promote | [Part 3](#part-3--install--upgrade--uninstall--promote) |
|
|
50
|
+
| Debug a failure | [Part 4](#part-4--debug--inspect) + [Troubleshooting](#troubleshooting) |
|
|
51
|
+
|
|
52
|
+
This skill is for **packaging and cross-org distribution** (`sf package …`). For
|
|
53
|
+
plain source deploy of a bundle into one org (`sf project deploy …`), use
|
|
54
|
+
**experience-ui-bundle-deploy** instead. Never `sf project generate` or
|
|
55
|
+
`sf template generate ui-bundle` here — the project and bundle exist.
|
|
56
|
+
`MyReactApp` / `force-app` / `force-app/main/default` are placeholders; substitute
|
|
57
|
+
the user's real bundle name and their `<packageDir>` everywhere they appear
|
|
58
|
+
below. Resolve `<packageDir>` deterministically — never guess `[0]` in a
|
|
59
|
+
multi-package project — with:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
packageDir="$(scripts/find-bundle-package-dir.sh <bundleName>)" # walks packageDirectories; picks the entry whose tree contains uiBundles/<bundleName>/
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Step 0 — Confirm the orgs (do this before touching any org)
|
|
68
|
+
|
|
69
|
+
Do **not** assume the default org. Ask the user, or read `sf org list`, then
|
|
70
|
+
restate what you'll use:
|
|
71
|
+
|
|
72
|
+
- **Dev Hub** (`devhub`) — where the package is created, versions are built, and
|
|
73
|
+
source is deployed. **Always required.**
|
|
74
|
+
- **Subscriber** (`subscriber`) — the org you install into. **Only required for
|
|
75
|
+
install / upgrade / uninstall.**
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
sf org list # connected orgs + default Dev Hub
|
|
79
|
+
sf org list --json | jq -r '.result.nonScratchOrgs[]?.alias'
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Rules:
|
|
83
|
+
- **Create-only task** (package or version) → one Dev Hub is enough; **don't ask
|
|
84
|
+
for a subscriber.**
|
|
85
|
+
- **Install task** → confirm **both**, and confirm *which is which*. Installing
|
|
86
|
+
into the Dev Hub by mistake is a common, messy error.
|
|
87
|
+
|
|
88
|
+
Substitute the real aliases for `devhub` / `subscriber` everywhere below.
|
|
89
|
+
|
|
90
|
+
**ID legend (packaging):** `0Ho…` package · `04t…` installable version
|
|
91
|
+
(SubscriberPackageVersionId) · `05i…` Package2Version · `08c…` version-create
|
|
92
|
+
request · `0Hf…` install request · `06y…` uninstall request.
|
|
93
|
+
|
|
94
|
+
**ID legend (runtime, useful when debugging a broken subscriber):** `9YE…` UI
|
|
95
|
+
Bundle row · `9YF…` UIBundleApplication junction · `02u…` CustomApplication /
|
|
96
|
+
TabSet · `0Zu…` ManagedContentSpace (workspace) · `0ap…` ManagedContentChannel
|
|
97
|
+
(WEB_APP). A missing App Launcher tile after install almost always traces back
|
|
98
|
+
to one of these being absent or misprovisioned.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Prerequisite — the 2GP toggle everyone forgets
|
|
103
|
+
|
|
104
|
+
2GP needs a **manual Setup toggle on the Dev Hub** that no CLI command or
|
|
105
|
+
metadata deploy can flip. **Setup → Dev Hub**, both on:
|
|
106
|
+
|
|
107
|
+
1. **Enable Dev Hub**, and
|
|
108
|
+
2. **Enable Unlocked Packages and Second-Generation Managed Packages** ← the real gate.
|
|
109
|
+
|
|
110
|
+
Until #2 is on, `sf package create` returns `NOT_FOUND` and any `Package2` query
|
|
111
|
+
returns `sObject type 'Package2' is not supported`. There is no CLI workaround —
|
|
112
|
+
flip the toggle. Verify before starting:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# clean "0 records" = 2GP ON; "sObject type 'Package2' is not supported" = toggle OFF
|
|
116
|
+
sf data query --target-org devhub --use-tooling-api --query "SELECT Id FROM Package2 LIMIT 1"
|
|
117
|
+
sf org display --target-org devhub --json | jq '.result.isDevHub'
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Choose a flavor
|
|
123
|
+
|
|
124
|
+
All three are 2GP (same `sf package` CLI). Pick before creating — it drives the
|
|
125
|
+
namespace, how the bundle is named on install, and coexistence.
|
|
126
|
+
|
|
127
|
+
| | **Managed** | **Unlocked — namespaced** | **Unlocked — org-dependent** |
|
|
128
|
+
|---|---|---|---|
|
|
129
|
+
| Namespace | required | required | none (empty `""`) |
|
|
130
|
+
| Source visibility | hidden (IP-protected) | visible / editable | visible / editable |
|
|
131
|
+
| Installs as | `ns__Name` | `ns__Name` | bare `Name` (flat) |
|
|
132
|
+
| Coexists with a local same-name bundle | yes (ns-filtered) | yes (ns-filtered) | no — collides |
|
|
133
|
+
| Upgrade behavior | clean replace (locked) | replace, **overwrites subscriber edits** | replace, **overwrites subscriber edits** |
|
|
134
|
+
| Rollback risk on failed upgrade | yes | yes | none |
|
|
135
|
+
| Typical use | ISV / AppExchange distribution | org-agnostic sharing, source open | package depends on metadata already in the target org |
|
|
136
|
+
|
|
137
|
+
Namespaced flavors (managed, unlocked-namespaced) need a namespace **registered
|
|
138
|
+
and linked to this Dev Hub** (App Launcher → *Namespace Registries*). No
|
|
139
|
+
registered namespace? Use **org-dependent unlocked** — it needs none.
|
|
140
|
+
|
|
141
|
+
### How linking works (namespace ⇄ Dev Hub)
|
|
142
|
+
|
|
143
|
+
The namespace lives in a separate **Developer Edition (DE) org** that owns it;
|
|
144
|
+
the Dev Hub *borrows* it via a linked registration. Concretely:
|
|
145
|
+
|
|
146
|
+
1. Sign up a DE org and register a namespace on it (Setup → Package Manager →
|
|
147
|
+
Namespace Registrations).
|
|
148
|
+
2. In the Dev Hub, App Launcher → *Namespace Registries* → **Link Namespace**,
|
|
149
|
+
log in with the DE org's credentials to link the namespace to this Dev Hub.
|
|
150
|
+
3. Set `namespace` in `sfdx-project.json` to the linked namespace slug. If the
|
|
151
|
+
value here isn't linked to the target Dev Hub, `sf package version create`
|
|
152
|
+
fails with a namespace error (see [Troubleshooting](#troubleshooting)).
|
|
153
|
+
|
|
154
|
+
One DE org can carry multiple namespaces, and one Dev Hub can link multiple DE
|
|
155
|
+
orgs — so a single Dev Hub can build packages under several namespaces. The
|
|
156
|
+
namespace is **locked in at version-create time** and travels with every UI
|
|
157
|
+
Bundle row inside the built version; you cannot change it later.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Runtime model — why the flavor matters
|
|
162
|
+
|
|
163
|
+
You do not have to explain this to answer a routine question. Reach for it when
|
|
164
|
+
the user asks *why*: why managed hides source, why namespaced installs are
|
|
165
|
+
`ns__Name`, why some URLs look different, or why an unlocked upgrade wiped
|
|
166
|
+
their edits.
|
|
167
|
+
|
|
168
|
+
- **Origin isolation.** Every installed UI Bundle renders from its own origin on
|
|
169
|
+
`*.salesforce.app`, distinct from `salesforce.com` core UI. Tiers:
|
|
170
|
+
- `salesforce.com` — 1st-party core UI
|
|
171
|
+
- `*.salesforce.app` — 2nd-party AFS-hosted bundles (no namespace)
|
|
172
|
+
- `<ns>.salesforce.app` — 3rd-party / namespaced (managed + unlocked-namespaced)
|
|
173
|
+
Because each namespace gets its own subdomain, two bundles from different
|
|
174
|
+
packages can coexist without cross-origin bleed.
|
|
175
|
+
- **IP protection is a managed-only property.** For **managed** packages,
|
|
176
|
+
`getSourceZip()` returns null in subscriber orgs — the compiled `dist/` is
|
|
177
|
+
stored as opaque content and never handed back. For **unlocked** (namespaced
|
|
178
|
+
or org-dependent), the served binary is fully readable by the subscriber.
|
|
179
|
+
- **Install semantics.** Managed and unlocked-namespaced install as `ns__Name`
|
|
180
|
+
and can coexist with a local same-name bundle. Org-dependent unlocked has no
|
|
181
|
+
namespace — it installs as bare `Name` and collides with a local bundle of
|
|
182
|
+
the same developer name.
|
|
183
|
+
- **Delta upgrade.** On `sf package install` of a newer `04t…`, the platform
|
|
184
|
+
compares content-index hashes of each incoming `dist/` asset against what's
|
|
185
|
+
already stored and **skips any asset whose hash is unchanged** — a patch that
|
|
186
|
+
touches one bundle re-writes only that bundle's changed files. Developer-owned
|
|
187
|
+
artifacts (`dist/`, `ui-bundle.json`, ISV base permission sets) are replaced;
|
|
188
|
+
subscriber-owned state (subscriber-created permission sets, custom metadata,
|
|
189
|
+
provisioned domain) is preserved.
|
|
190
|
+
- **Kill switch.** Setup → Security → *Multi-Framework Domains* → disable a
|
|
191
|
+
provisioned domain. Immediate 404; metadata stays installed; reversible.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Part 1 — make the existing bundle packageable
|
|
196
|
+
|
|
197
|
+
Prepare the project so it can be packaged and used in-org. Apply only what the
|
|
198
|
+
request needs.
|
|
199
|
+
|
|
200
|
+
### 1a. Set API version + namespace in `sfdx-project.json`
|
|
201
|
+
|
|
202
|
+
The `namespace` here decides which flavor you can build (see table above), so set
|
|
203
|
+
it deliberately — there is no safe default. Substitute the user's real registered
|
|
204
|
+
namespace for `<ns>`; use `""` for org-dependent.
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
# namespaced (managed / unlocked-namespaced): <ns> MUST be registered & linked to this Dev Hub
|
|
208
|
+
node -e "const fs=require('fs'),f='sfdx-project.json',j=JSON.parse(fs.readFileSync(f)); j.sourceApiVersion='68.0'; j.namespace='<ns>'; fs.writeFileSync(f,JSON.stringify(j,null,2))"
|
|
209
|
+
|
|
210
|
+
# org-dependent unlocked: no namespace
|
|
211
|
+
node -e "const fs=require('fs'),f='sfdx-project.json',j=JSON.parse(fs.readFileSync(f)); j.sourceApiVersion='68.0'; j.namespace=''; fs.writeFileSync(f,JSON.stringify(j,null,2))"
|
|
212
|
+
|
|
213
|
+
cat sfdx-project.json # confirm namespace + sourceApiVersion before packaging
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
- Managed / namespaced-unlocked → `namespace` = a registered, linked namespace.
|
|
217
|
+
- Org-dependent unlocked → leave `namespace` as `""`.
|
|
218
|
+
- Setting a namespace that isn't registered to this Dev Hub fails the build later
|
|
219
|
+
(see [Troubleshooting](#troubleshooting)).
|
|
220
|
+
|
|
221
|
+
### 1b. Build the bundle — `dist/` must exist before packaging
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
cd force-app/main/default/uiBundles/MyReactApp # the real bundle dir
|
|
225
|
+
npm install --no-audit --no-fund
|
|
226
|
+
npm run build
|
|
227
|
+
cd -
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Package or deploy **before** `dist/` exists and the app installs but **renders
|
|
231
|
+
blank** — the bundle ships with its built assets. Always build first.
|
|
232
|
+
|
|
233
|
+
### 1c. Wire a CustomApplication (only if the bundle must be launchable as a Salesforce app)
|
|
234
|
+
|
|
235
|
+
Skip this step when the bundle is already referenced another way (embedded in a
|
|
236
|
+
FlexiPage, Experience Cloud site, etc.). Otherwise **read**
|
|
237
|
+
`<SKILL_DIR>/assets/CustomApplication.app-meta.xml` (where `<SKILL_DIR>` is the
|
|
238
|
+
absolute path to this skill's own directory), replace every `MyReactApp` with
|
|
239
|
+
the real bundle developer name, and **write** the result to the user's project
|
|
240
|
+
under `<packageDir>/applications/`. Author `<uiBundle>` with the bundle's
|
|
241
|
+
**developer name** — inside the same package no prefix is needed; cross-namespace
|
|
242
|
+
it resolves as `ns__Name` (namespaced) or `c__Name` (no namespace).
|
|
243
|
+
|
|
244
|
+
The three fields the App Launcher tile actually cares about — installed
|
|
245
|
+
subscribers won't see a broken tile if they're set correctly:
|
|
246
|
+
|
|
247
|
+
- `<uiType>Lightning</uiType>` — required for the App Launcher to render it
|
|
248
|
+
- `<navType>Standard</navType>` — standard navigation container
|
|
249
|
+
- `<formFactors>Large</formFactors>` — desktop form factor (validation is
|
|
250
|
+
install-time only, so a missing/wrong value passes deploy but hides the tile)
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
mkdir -p force-app/main/default/applications
|
|
254
|
+
# then write the substituted template to:
|
|
255
|
+
# force-app/main/default/applications/<BundleName>.app-meta.xml
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### 1d. Deploy source to the Dev Hub (so metadata exists before `package create`)
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
sf project deploy start --source-dir force-app --target-org devhub --api-version 68.0 --wait 30
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### 1e. Grant app visibility via a permission set (only if 1c added a CustomApplication and the app must be reachable without a manual Setup click)
|
|
265
|
+
|
|
266
|
+
Read `<SKILL_DIR>/assets/PermissionSet.permissionset-meta.xml`, replace
|
|
267
|
+
`MyReactApp` with the real bundle name (both in `<application>` and the label),
|
|
268
|
+
write the result into the user's project, then deploy and assign:
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
mkdir -p force-app/main/default/permissionsets
|
|
272
|
+
# write the substituted template to:
|
|
273
|
+
# force-app/main/default/permissionsets/<BundleName>_Access.permissionset-meta.xml
|
|
274
|
+
sf project deploy start --source-dir force-app/main/default/permissionsets/MyReactApp_Access.permissionset-meta.xml --target-org devhub --api-version 68.0 --wait 30
|
|
275
|
+
sf org assign permset --name MyReactApp_Access --target-org devhub
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## Part 2 — create the package (Dev Hub only)
|
|
281
|
+
|
|
282
|
+
No subscriber org involved. `sf package create` runs **once** (registers the
|
|
283
|
+
`0Ho…` container); you build installable `04t…` versions repeatedly after. Pick
|
|
284
|
+
the one flavor you chose above:
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
# managed
|
|
288
|
+
sf package create --name MyReactApp --package-type Managed --path force-app --target-dev-hub devhub
|
|
289
|
+
|
|
290
|
+
# unlocked, namespaced (namespace comes from sfdx-project.json)
|
|
291
|
+
sf package create --name MyReactApp --package-type Unlocked --path force-app --target-dev-hub devhub
|
|
292
|
+
|
|
293
|
+
# unlocked, org-dependent (no namespace)
|
|
294
|
+
sf package create --name MyReactApp --package-type Unlocked --org-dependent --path force-app --target-dev-hub devhub
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Then build a version:
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
sf package version create --package MyReactApp --installation-key-bypass --wait 20 --target-dev-hub devhub
|
|
301
|
+
# a specific/patch version instead:
|
|
302
|
+
sf package version create --package MyReactApp --version-number 1.0.1 --wait 20 --target-dev-hub devhub
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
`--version-number 1.0.0.NEXT` auto-bumps the build number; a fixed `1.0.1` pins
|
|
306
|
+
it. `--installation-key-bypass` builds an unprotected version (no key to
|
|
307
|
+
install); omit it and pass `--installation-key <key>` to gate installs.
|
|
308
|
+
|
|
309
|
+
### Robust version-create (survives a slow Dev Hub queue)
|
|
310
|
+
|
|
311
|
+
`--wait` can time out while the build sits queued, losing the request handle.
|
|
312
|
+
Submit async, capture the `08c…` id, poll:
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
REQ=$(sf package version create --package MyReactApp --installation-key-bypass \
|
|
316
|
+
--skip-validation --target-dev-hub devhub --json | jq -r '.result.Id')
|
|
317
|
+
echo "request: $REQ"
|
|
318
|
+
while :; do
|
|
319
|
+
J=$(sf package version create report -i "$REQ" --target-dev-hub devhub --json)
|
|
320
|
+
ST=$(echo "$J" | jq -r '.result[0].Status'); echo "status: $ST"
|
|
321
|
+
case "$ST" in
|
|
322
|
+
Success) echo "$J" | jq -r '.result[0].SubscriberPackageVersionId'; break;;
|
|
323
|
+
Error) echo "$J" | jq -r '.result[0].Error[]? // "build failed"'; break;;
|
|
324
|
+
esac
|
|
325
|
+
sleep 30
|
|
326
|
+
done
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
`--skip-validation` is faster but produces a **beta** version (can't be promoted,
|
|
330
|
+
and beta can't upgrade beta — see Part 3). Drop it for a releasable build. Resume
|
|
331
|
+
a queued build anytime:
|
|
332
|
+
`sf package version create report -i 08c… --target-dev-hub devhub`
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## Part 3 — install / upgrade / uninstall / promote
|
|
337
|
+
|
|
338
|
+
**Confirm the subscriber alias first (Step 0).** Everything here hits the
|
|
339
|
+
subscriber — except **promote**, which runs on the Dev Hub.
|
|
340
|
+
|
|
341
|
+
```bash
|
|
342
|
+
# fresh install
|
|
343
|
+
sf package install --package 04t… --target-org subscriber --wait 10
|
|
344
|
+
# add --installation-key <key> if the version was built with one
|
|
345
|
+
# add --publish-wait 10 to wait for the version to finish publishing
|
|
346
|
+
|
|
347
|
+
# upgrade (newer version over the old)
|
|
348
|
+
sf package install --package 04t…v2 --target-org subscriber --upgrade-type Mixed --wait 10
|
|
349
|
+
# --upgrade-type: Mixed (default) | DeprecateOnly | Delete (destructive — care)
|
|
350
|
+
|
|
351
|
+
# uninstall
|
|
352
|
+
sf package uninstall --package 04t… --target-org subscriber --wait 20
|
|
353
|
+
|
|
354
|
+
# promote a managed version to released/immutable — runs on the DEV HUB, irreversible
|
|
355
|
+
sf package version promote --package 04t… --target-dev-hub devhub
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
**Beta can't upgrade beta.** A `--skip-validation` (beta) v0.2 over a beta v0.1
|
|
359
|
+
fails with *"Cannot upgrade beta package."* Either **promote** v0.1 (managed) or
|
|
360
|
+
**uninstall** v0.1 first, then install v0.2.
|
|
361
|
+
|
|
362
|
+
**Unlocked upgrades overwrite subscriber edits** to the bundle. Org-dependent has
|
|
363
|
+
no rollback on a failed upgrade; namespaced flavors do.
|
|
364
|
+
|
|
365
|
+
### Robust install (confirm it actually landed)
|
|
366
|
+
|
|
367
|
+
`sf package install --wait` can exit 0 while the request is still IN_PROGRESS —
|
|
368
|
+
a false success. Verify:
|
|
369
|
+
|
|
370
|
+
```bash
|
|
371
|
+
sf package install --package 04t… --target-org subscriber --wait 20 --no-prompt
|
|
372
|
+
sf package installed list --target-org subscriber --json \
|
|
373
|
+
| jq -r '.result[]? | select(.SubscriberPackageVersionId=="04t…") | .SubscriberPackageVersionId'
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
Prints nothing → still processing server-side; poll `sf package installed list`
|
|
377
|
+
a few minutes before concluding it failed.
|
|
378
|
+
|
|
379
|
+
---
|
|
380
|
+
|
|
381
|
+
## Part 4 — debug / inspect
|
|
382
|
+
|
|
383
|
+
Mostly read-only. Reach for these to diagnose a failure or inspect state.
|
|
384
|
+
|
|
385
|
+
```bash
|
|
386
|
+
# Dev Hub state
|
|
387
|
+
sf org display --target-org devhub --json | jq '{isDevHub:.result.isDevHub, user:.result.username, instance:.result.instanceUrl, api:.result.apiVersion}'
|
|
388
|
+
|
|
389
|
+
# Is 2GP on? (the #1 root cause)
|
|
390
|
+
sf data query --target-org devhub --use-tooling-api --query "SELECT Id, Name, NamespacePrefix, ContainerOptions FROM Package2"
|
|
391
|
+
|
|
392
|
+
# Packages & versions on the Dev Hub
|
|
393
|
+
sf package list --target-dev-hub devhub
|
|
394
|
+
sf package version list --packages MyReactApp --target-dev-hub devhub --verbose
|
|
395
|
+
|
|
396
|
+
# Version-create failures — status + Error[]
|
|
397
|
+
sf package version create list --target-dev-hub devhub
|
|
398
|
+
sf package version create report -i 08c… --target-dev-hub devhub
|
|
399
|
+
sf data query --target-org devhub --use-tooling-api \
|
|
400
|
+
--query "SELECT Id, Status, Package2Id, Error FROM Package2VersionCreateRequest ORDER BY CreatedDate DESC LIMIT 5"
|
|
401
|
+
|
|
402
|
+
# A version's details
|
|
403
|
+
sf package version report --package 04t… --target-dev-hub devhub
|
|
404
|
+
|
|
405
|
+
# What's installed in the subscriber
|
|
406
|
+
sf package installed list --target-org subscriber --json \
|
|
407
|
+
| jq -r '.result[]? | "\(.SubscriberPackageName) \(.SubscriberPackageVersionNumber) \(.SubscriberPackageVersionId)"'
|
|
408
|
+
|
|
409
|
+
# Install/uninstall stuck IN_PROGRESS
|
|
410
|
+
sf package install report --request-id 0Hf… --target-org subscriber
|
|
411
|
+
sf package uninstall report --request-id 06y… --target-org subscriber
|
|
412
|
+
|
|
413
|
+
# Deploy failures (before you can even package)
|
|
414
|
+
sf project deploy start --source-dir force-app --target-org devhub --dry-run --wait 30
|
|
415
|
+
sf project deploy report --target-org devhub
|
|
416
|
+
|
|
417
|
+
# Bundle renders blank — confirm built assets shipped
|
|
418
|
+
ls -la force-app/main/default/uiBundles/MyReactApp/dist
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
## Troubleshooting
|
|
424
|
+
|
|
425
|
+
| Symptom | Cause / fix |
|
|
426
|
+
|---|---|
|
|
427
|
+
| `sObject type 'Package2' is not supported` | 2GP toggle OFF — **Setup → Dev Hub** → enable "Unlocked & Second-Gen Managed Packages" (manual, no CLI fix). |
|
|
428
|
+
| `sf package create` → `NOT_FOUND` | Same — 2GP not provisioned. Enable toggle, re-auth. |
|
|
429
|
+
| `isDevHub: false/null` after enabling | Cached CLI login — re-auth. Trust the `Package2` query + `package create`, not the cached flag. |
|
|
430
|
+
| `version create` hangs / `--wait` times out | Build queued. Use the async submit + `version create report -i 08c…` poll; resume later with the same id. |
|
|
431
|
+
| `install --wait` exits 0 but app missing | Still IN_PROGRESS server-side. Confirm with `sf package installed list`; poll a few minutes. |
|
|
432
|
+
| "Cannot upgrade beta package" | Beta can't upgrade beta. Promote v0.1 (managed) or uninstall it first, then install v0.2. |
|
|
433
|
+
| Namespace error on managed/namespaced build | Namespace not registered/linked to this Dev Hub (App Launcher → *Namespace Registries*), or switch to org-dependent unlocked (no namespace). |
|
|
434
|
+
| App installs but renders blank | Bundle not built before deploy/package — `npm run build`, confirm `dist/`, redeploy, rebuild the version. |
|
|
435
|
+
| Installed into the wrong org | Wrong alias confirmed in Step 0. Re-check `sf org list`; `subscriber` ≠ `devhub`. |
|
|
436
|
+
| Org-dependent bundle collides with a local one | Both use a bare (null-prefix) name. Use a namespaced flavor, or rename. |
|
|
437
|
+
|
|
438
|
+
## Notes
|
|
439
|
+
|
|
440
|
+
- **Confirm orgs first.** Dev Hub always; subscriber only for install/upgrade/
|
|
441
|
+
uninstall. Don't ask for a subscriber on a create-only task.
|
|
442
|
+
- **Order for a full run:** build bundle → deploy source → `package create`
|
|
443
|
+
(once) → `package version create` (each release) → `install` → `promote`
|
|
444
|
+
(managed only).
|
|
445
|
+
- For internal Salesforce packaging questions, the authoritative channel is
|
|
446
|
+
**#packaging**.
|
|
447
|
+
- **Authoritative external docs** (for deeper reference):
|
|
448
|
+
- Second-Generation Managed Packaging Developer Guide —
|
|
449
|
+
<https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/sfdx_dev_dev2gp.htm>
|
|
450
|
+
(managed / AppExchange flavor: workflow, components, distribution, push
|
|
451
|
+
upgrades, 1GP→2GP gaps).
|
|
452
|
+
- Unlocked packages share the same `sf package` CLI; see the "Unlocked
|
|
453
|
+
Packages" section of the same guide for the unlocked-namespaced and
|
|
454
|
+
org-dependent flavors.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<CustomApplication xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
3
|
+
<brand>
|
|
4
|
+
<headerColor>#0070D2</headerColor>
|
|
5
|
+
<shouldOverrideOrgTheme>false</shouldOverrideOrgTheme>
|
|
6
|
+
</brand>
|
|
7
|
+
<formFactors>Large</formFactors>
|
|
8
|
+
<label>MyReactApp</label>
|
|
9
|
+
<navType>Standard</navType>
|
|
10
|
+
<uiBundle>MyReactApp</uiBundle>
|
|
11
|
+
<uiType>Lightning</uiType>
|
|
12
|
+
</CustomApplication>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<PermissionSet xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
3
|
+
<applicationVisibilities>
|
|
4
|
+
<application>MyReactApp</application>
|
|
5
|
+
<visible>true</visible>
|
|
6
|
+
</applicationVisibilities>
|
|
7
|
+
<hasActivationRequired>false</hasActivationRequired>
|
|
8
|
+
<label>MyReactApp Access</label>
|
|
9
|
+
</PermissionSet>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Resolve the package directory that actually owns a UI Bundle.
|
|
3
|
+
#
|
|
4
|
+
# Given a bundle name, walk sfdx-project.json's `packageDirectories` array and
|
|
5
|
+
# print the `path` of the entry whose tree contains `uiBundles/<bundle-name>/`
|
|
6
|
+
# on disk. This is what the skill's `<packageDir>` token substitutes to.
|
|
7
|
+
#
|
|
8
|
+
# Why this exists: `packageDirectories[0]` is only correct when the project
|
|
9
|
+
# has a single package directory. Multi-package projects can put the bundle
|
|
10
|
+
# under any entry, so writing metadata (CustomApplication, PermissionSet) into
|
|
11
|
+
# `[0]` blindly can land it *outside* the package being versioned, and the
|
|
12
|
+
# installed package will then be missing the intended wiring.
|
|
13
|
+
#
|
|
14
|
+
# Usage: scripts/find-bundle-package-dir.sh <bundleName> [project-dir]
|
|
15
|
+
# project-dir defaults to the current directory.
|
|
16
|
+
#
|
|
17
|
+
# Exit 0: prints the matching `path` (no trailing slash) on stdout.
|
|
18
|
+
# Exit 1: no sfdx-project.json / malformed / no entry contains the bundle.
|
|
19
|
+
set -euo pipefail
|
|
20
|
+
|
|
21
|
+
if [[ $# -lt 1 ]]; then
|
|
22
|
+
echo "find-bundle-package-dir: usage: $0 <bundleName> [project-dir]" >&2
|
|
23
|
+
exit 1
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
bundle="$1"
|
|
27
|
+
project_dir="${2:-.}"
|
|
28
|
+
project_file="$project_dir/sfdx-project.json"
|
|
29
|
+
|
|
30
|
+
if [[ ! -f "$project_file" ]]; then
|
|
31
|
+
echo "find-bundle-package-dir: no sfdx-project.json in '$project_dir'" >&2
|
|
32
|
+
exit 1
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
# Match anywhere under each packageDir tree, not just the fixed
|
|
36
|
+
# force-app/main/default layout — the bundle may live under any depth.
|
|
37
|
+
# Read paths one-at-a-time (portable to bash 3.2 on macOS).
|
|
38
|
+
found=""
|
|
39
|
+
while IFS= read -r raw; do
|
|
40
|
+
[[ -z "$raw" ]] && continue
|
|
41
|
+
path="${raw%/}"
|
|
42
|
+
if [[ -d "$project_dir/$path" ]] && find "$project_dir/$path" -type d -path "*/uiBundles/$bundle" -print -quit 2>/dev/null | grep -q .; then
|
|
43
|
+
found="$path"
|
|
44
|
+
break
|
|
45
|
+
fi
|
|
46
|
+
done < <(jq -r '.packageDirectories[]?.path // empty' "$project_file")
|
|
47
|
+
|
|
48
|
+
if [[ -z "$found" ]]; then
|
|
49
|
+
echo "find-bundle-package-dir: no packageDirectories entry contains 'uiBundles/$bundle' — check the bundle name and sfdx-project.json paths" >&2
|
|
50
|
+
exit 1
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
echo "$found"
|