Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Update README and CLI commands #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

The GIF-to-Chatter app for Lightning Platform you didn't know you needed!

This repo was developed for the [Quick Start: Unlocked Packages](https://trailhead.salesforce.com/projects/quick-start-unlocked-packages?trailmix_creator_id=00550000006yDdKAAU&trailmix_id=dreamforce-18-how-build-your-first-sfdx-app-with-unlocked-pkg) Trailhead project.

![image](https://user-images.githubusercontent.com/746259/36634388-9d7b0b9e-1958-11e8-83df-dfc65ace47b3.png)

## Get a GIPHY API Key
Expand All @@ -11,8 +13,9 @@ Go to [https://developers.giphy.com/](https://developers.giphy.com/) and create
## Create an Unlocked Package

Create an Unlocked package:

```
sfdx force:package2:create -n GIFter -d "Using GIPHY to find GIFs and post to Chatter" -o Unlocked
sfdx force:package:create -n GIFter -d "Using GIPHY to find GIFs and post to Chatter" -r force-app -t Unlocked -v DevHub
```

This will only take a moment, and you'll have the following output:
Expand All @@ -21,23 +24,26 @@ This will only take a moment, and you'll have the following output:
=== Ids
NAME VALUE
───────────────────── ──────────────────
Package2 Id 0Ho6A0000004C9hSAE
Subscriber Package Id 0336A0000001JQ6QAM
Package Id 0Hoxxx
```
Grab the `Package2 Id`.

Open the `sfdx-project.json` file and replace `YOUR_PACKAGE_ID` with the ID from above (e.g. `0Ho6A0000004C9hSAE`).
Grab the `Package Id`.

Open the `sfdx-project.json` file.
Notice that the `package:create` command updates the project file to include important details about the package. In `packageDirectories`, you can see the package name you defined, with placeholders for the version name and version number. The command also creates a `packageAliases` section, which maps the package name (alias) to its corresponding package ID (`0Ho`).

Now, create a version of your package:

```
sfdx force:package2:version:create -d force-app --wait 10
sfdx force:package:version:create -p GIFter -d force-app -k test1234 --wait 10 -v DevHub
```

This will take a few moments. When complete, you'll have a message like the following:

```
Successfully created the package2 version [08c6A0000004CFWQA2]. Package2 Version Id: 05i6A000000CaSoQAK.
Subscriber Package2 Version Id: 04t6A000001aR9rQAE.
Successfully created the package version [08cxxx]. Subscriber Package Version Id: 04txxx.
Package Installation URL: https://login.salesforce.com/packaging/installPackage.apexp?p0=04txxx
As an alternative, you can use the "sfdx force:package:install" command.
```

Grab the last ID that starts with `04t` as that's what we'll use when installing into a new environment.
Expand All @@ -51,7 +57,7 @@ sfdx force:org:create -s -f config/project-scratch-def.json
Install the package version:

```
sfdx force:package:install -i 04t6A000001aR9rQAE --wait 10
sfdx force:package:install --wait 10 --publishwait 10 --package [email protected] -k test1234 --noprompt
```

Assign the permission set:
Expand All @@ -63,7 +69,7 @@ sfdx force:user:permset:assign -n GIFter
Open the app:

```
sfdx force:org:open -p one/one.app#/n/GIFter
sfdx force:org:open -p //lightning/n/GIFter
```

Enjoy!
Enjoy!
9 changes: 5 additions & 4 deletions config/project-scratch-def.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"orgName": "wade.wegner Company",
"orgName": "GIFter",
"edition": "Developer",
"orgPreferences" : {
"enabled": ["S1DesktopEnabled", "ChatterEnabled"],
"disabled": ["S1EncryptedStoragePref2"]
"settings" : {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @douglascayers - just curious why you aren't also "enabling" chatter and Lightning, per the original scratch def.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ekapner, I left those out because they weren't necessary, at least not in my tests. New orgs come with Chatter and Lightning already enabled. It doesn't hurt to include them though to be overly explicit.

"orgPreferenceSettings" : {
"s1EncryptedStoragePref2" : false
}
}
}
6 changes: 0 additions & 6 deletions force-app/main/default/aura/SearchGIPHY/SearchGIPHY.auradoc

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="urn:metadata.tooling.soap.sforce.com" fqn="SearchGIPHY">
<apiVersion>42.0</apiVersion>
<apiVersion>44.0</apiVersion>
<description>A Lightning Component Bundle</description>
</AuraDefinitionBundle>
3 changes: 0 additions & 3 deletions force-app/main/default/aura/SearchGIPHY/SearchGIPHY.design

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion force-app/main/default/classes/ChatterHelper.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="urn:metadata.tooling.soap.sforce.com" fqn="ChatterHelper">
<apiVersion>42.0</apiVersion>
<apiVersion>44.0</apiVersion>
<status>Active</status>
</ApexClass>
23 changes: 10 additions & 13 deletions sfdx-project.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"packageDirectories": [
{
"path": "force-app",
"default": true,
"id": "YOUR_PACKAGE_ID",
"versionNumber": "1.0.0.NEXT",
"versionName": "Spring ‘18"
}
],
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "42.0"
}
"packageDirectories": [
{
"path": "force-app",
"default": true
}
],
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "44.0"
}