Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
211 changes: 211 additions & 0 deletions .sdd/ui-bundle-upload/plan.md

Large diffs are not rendered by default.

526 changes: 526 additions & 0 deletions .sdd/ui-bundle-upload/spec.md

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- commands -->

- [`sf ui-bundle dev`](#sf-ui-bundle-dev)
- [`sf ui-bundle upload`](#sf-ui-bundle-upload)

## `sf ui-bundle dev`

Expand Down Expand Up @@ -64,4 +65,69 @@ EXAMPLES
$ SF_LOG_LEVEL=debug sf ui-bundle dev --target-org myorg
```

## `sf ui-bundle upload`

Upload a UI Bundle to your org.

```
USAGE
$ sf ui-bundle upload --use-salesforce-pages -o <value> [--json] [--flags-dir <value>] [-z <value>] [-d <value>]
[--api-version <value>] [--bundle-name <value>]

FLAGS
-d, --bundle-dir=<value> Path to an uncompressed UI Bundle source directory; the CLI compresses it before upload.
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
configuration variable is already set.
-z, --zip-file=<value> Path to the UI Bundle source to upload.
--api-version=<value> Override the api version used for api requests made by this command
--bundle-name=<value> Name to associate with the uploaded UI Bundle.
--use-salesforce-pages (required) Toggle whether this UI Bundle should be uploaded to Salesforce Pages.

GLOBAL FLAGS
--flags-dir=<value> Import flag values from a directory.
--json Format output as json.

DESCRIPTION
Upload a UI Bundle to your org.

Use this command to upload a React-based UI Bundle to your Salesforce org. Provide the bundle source as either a
compressed ZIP file (--zip-file) or an uncompressed source directory (--bundle-dir), which the CLI compresses for you.
This can be used by both admin and non-admin users.

The upload is asynchronous. View the UI bundle in your org to verify completion.

EXAMPLES
Upload a UI Bundle to Salesforce Pages using your default org:

$ sf ui-bundle upload --zip-file my-compressed-bundle --use-salesforce-pages

Upload an uncompressed source directory (auto-compressed by the CLI):

$ sf ui-bundle upload --bundle-dir ./my-bundle-src --use-salesforce-pages

Upload to a specific org by alias:

$ sf ui-bundle upload --zip-file my-compressed-bundle --use-salesforce-pages --target-org my-org

FLAG DESCRIPTIONS
-d, --bundle-dir=<value> Path to an uncompressed UI Bundle source directory; the CLI compresses it before upload.

The path to an uncompressed directory containing the UI Bundle source. The CLI compresses the directory into a ZIP
file before uploading. The CLI doesn't validate the contents of the directory — that's a server-side concern.

-z, --zip-file=<value> Path to the UI Bundle source to upload.

The path to a compressed ZIP file containing the UI Bundle source. The CLI doesn't validate the contents of the zip
file — that's a server-side concern.

--bundle-name=<value> Name to associate with the uploaded UI Bundle.

A human-readable name for the UI Bundle. If not specified, defaults to the base name of --bundle-dir or --zip-file,
with any .zip extension removed.

--use-salesforce-pages Toggle whether this UI Bundle should be uploaded to Salesforce Pages.

When set, the UI Bundle is uploaded for use with Salesforce Pages.
```

<!-- commandsstop -->
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,41 @@ SEE ALSO
- Complete Guide: SF_UI_BUNDLE_DEV_GUIDE.md
```

### `sf ui-bundle upload`

Upload a UI Bundle to your org.

```bash
USAGE
$ sf ui-bundle upload (--zip-file <value> | --bundle-dir <value>) --use-salesforce-pages --target-org <org-alias>

BUNDLE SOURCE (exactly one required)
-z, --zip-file=<value> Path to a pre-built UI Bundle ZIP file, sent as-is
-d, --bundle-dir=<value> Path to an uncompressed UI Bundle source directory; the CLI compresses it before upload

REQUIRED FLAGS
--use-salesforce-pages Toggle whether this UI Bundle should be uploaded to Salesforce Pages
-o, --target-org=<value> Salesforce org to authenticate against

DESCRIPTION
Uploads a React-based UI Bundle to your Salesforce org. Provide the bundle
source as either a compressed ZIP file (--zip-file) or an uncompressed source
directory (--bundle-dir), which the CLI compresses for you. The upload is
asynchronous — the command returns a job ID immediately; view the UI bundle in
your org to verify completion. Can be used by both admin and non-admin users.

EXAMPLES
Upload a UI Bundle to Salesforce Pages using your default org:

$ sf ui-bundle upload --zip-file my-compressed-bundle --use-salesforce-pages

Upload an uncompressed source directory (auto-compressed by the CLI):

$ sf ui-bundle upload --bundle-dir ./my-bundle-src --use-salesforce-pages

Upload to a specific org by alias:

$ sf ui-bundle upload --zip-file my-compressed-bundle --use-salesforce-pages --target-org my-org
```

<!-- commandsstop -->
17 changes: 17 additions & 0 deletions command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,22 @@
"flagChars": ["b", "n", "o", "p", "u"],
"flags": ["flags-dir", "json", "name", "open", "port", "target-org", "url"],
"plugin": "@salesforce/plugin-ui-bundle-dev"
},
{
"alias": [],
"command": "ui-bundle:upload",
"flagAliases": [],
"flagChars": ["d", "o", "z"],
"flags": [
"api-version",
"bundle-dir",
"bundle-name",
"flags-dir",
"json",
"target-org",
"use-salesforce-pages",
"zip-file"
],
"plugin": "@salesforce/plugin-ui-bundle-dev"
}
]
77 changes: 77 additions & 0 deletions messages/ui-bundle.upload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# summary

Upload a UI Bundle to your org.

# description

Use this command to upload a React-based UI Bundle to your Salesforce org. Provide the bundle source as either a compressed ZIP file (--zip-file) or an uncompressed source directory (--bundle-dir). This command compresses the directory for you. This command can be used by both admin and non-admin users.

The upload is asynchronous. View the UI bundle in your org to verify upload completion.

# flags.zip-file.summary

Path to the compressed UI Bundle source to upload.

# flags.bundle-dir.summary

Path to an uncompressed UI Bundle source directory. This command compresses the directory into a ZIP file before uploading.

# flags.use-salesforce-pages.summary

Upload UI Bundle to Salesforce Pages. This is a required flag as only Salesforce Pages uploads are currently supported.

# flags.bundle-name.summary

Name to associate with the uploaded UI Bundle.

# flags.bundle-name.description

A human-readable name for the UI Bundle. If not specified, defaults to the base name of --bundle-dir or --zip-file, with any .zip extension removed.

# examples

- Upload a UI Bundle to Salesforce Pages using your default org:

<%= config.bin %> <%= command.id %> --zip-file my-compressed-bundle.zip --use-salesforce-pages

- Upload an uncompressed source directory (auto-compressed by the CLI):

<%= config.bin %> <%= command.id %> --bundle-dir ./my-bundle-src --use-salesforce-pages

- Upload to a specific org by alias:

<%= config.bin %> <%= command.id %> --zip-file my-compressed-bundle.zip --use-salesforce-pages --target-org my-org

# info.upload-queued

Upload queued successfully.

# info.job-id

Job ID: %s

# error.upload-failed

Upload failed
Job ID: %s
Message: %s

# error.bundle-dir-empty

The bundle source directory is empty.

# error.uiBundleUploadApiVersionError

API version %s isn't supported by this command; --api-version must be %s or later.

# error.uiBundleUploadAuthError

Authentication error: %s

# error.uiBundleUploadNetworkError

Network error: %s

# error.uiBundleUploadValidationError

Validation error: %s
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"@salesforce/sf-plugins-core": "^12.2.6",
"@salesforce/ui-bundle": "^1.118.4",
"chokidar": "^3.6.0",
"form-data": "^4.0.5",
"http-proxy": "^1.18.1",
"jszip": "^3.10.1",
"micromatch": "^4.0.8",
"open": "^10.1.0",
"path-to-regexp": "^8.3.0"
Expand Down
27 changes: 27 additions & 0 deletions schemas/ui__bundle-upload.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/UiBundleUploadResult",
"definitions": {
"UiBundleUploadResult": {
"type": "object",
"properties": {
"jobId": {
"type": "string",
"description": "ID of the enqueued upload job"
},
"status": {
"type": "string",
"enum": ["Queued", "InProgress", "Succeeded", "Failed"],
"description": "Status of the upload job"
},
"message": {
"type": "string",
"description": "Server-provided message, present on Failed status"
}
},
"required": ["jobId", "status"],
"additionalProperties": false,
"description": "Command execution result"
}
}
}
Loading
Loading