Forum Discussion
Hi Sydney,
The SDK is definitely a learning curve, and I am still learning!
We moved to aurora only 3 weeks ago, and until 24.09 we had real problems getting the SDK to work on Windows machines.
Are you using Windows? are you running the SDK in VsCode or another editor or just the command line?
Now assuming you're trying to edit a HTML component, your folder will have in it at least two files:
in this example I will use a "More Resources" Component we have.
-->res-->components-->More_Resources
files are:
More_Resources.component.json
More_Resources.html
The JSON file contains:
{
"id" : "More_Resources",
"markupLanguage" : "HTML",
"defaults" : {
"config" : {
"applicablePages" : [ ],
"dynamicByCoreNode" : false,
"description" : "",
"fetchedContent" : null
},
"props" : [ ]
},
"components" : [ {
"id" : "custom.widget.More_Resources"
} ],
"grouping" : "TEXTHTML",
"aboutThis" : null
}
and the html file contains plain simple html for this example lets say it contains:
<h3>Test Widget</h3>
Now if you change h3 to h2 for example and you want to preview it on stage then do the following:
1. Check the active branch on stage is stage-main - most of the time you don't need to change this.
2. in your SDK look for the file called .env.local in there you will have two values (you may have more but you only need these two):
LIA_URL=<insert the Top Level Domain to your staging environment>
SDK_KEY=<the key generated from the Dev tools section of admin>
3. Now you have that setup open the html file and change h3 to h2 and save
4. from your command prompt run npm i (or npm ci if you encounter issues) this will rebuild your local environment
5. Now run NPM run start
> @o365/plugin@1.0.0 start
> npm explore khoros-aurora-sdk -- npm run start
> khoros-aurora-sdk@24.10.0 start
> node ./scripts/pluginPreviewCli.js
[15:42:43.472] INFO (cli/19512): Using config values: {"LIA_URL":"YOURTLDWILLBEHERE","SDK_KEY":"<YOURKEYWILLBEHERE"}
[15:42:45.107] INFO (cli/19512): The SDK key is valid.
[15:42:45.107] INFO (versionCheck/19512): The current SDK version: 24.10.0
[15:42:45.911] INFO (versionCheck/19512): The community SDK version: 24.10.0
[15:42:45.912] INFO (PluginPreview/19512): Using plugin repo path: C:\Users\v-allens\Documents\o365
[15:42:45.914] INFO (PluginPreview/19512): Synchronizing plugin assets...
[15:42:45.921] INFO (PluginPreview/19512): Using git branch: stage-main-repair <- this is your branch you are working on.
What happens next will depend on what's in your plugin but once its complete you see the message:
[15:44:10.378] INFO (PluginPreview/19512): Watching for plugin repo changes
Once you see that if you go to the page where this quilt lives you will see the change you made.
if you decide Nae.. Lets change it from saying "Test" to "Lets see what more words look like" then open the html file and change the text per the above and click save.
If you look at your command line it will says "Successfully updated component More_Resources" and then when you refresh the browser it should show you the updated text.
Apologies if you knew most of that, I just wanted to be complete.
This is wonderful, thank you! I did have most of this, but the follow up questions I have are:
I have a working branch off of Staging (following the recommendations per Khoros docs). I don't want my team making changes to stage-main either so I'm trying to follow my own rules. Does the preview only work if you're updating stage-main? Or can it preview based on my working branch?
Second, you mention saving the change. I hadn't saved anything when I tested earlier - the moment I typed in the HTML, and refreshed the page in browser, it got the orange outline so I thought I was smooth sailing. Is saving the changes the trick here, maybe?
I am on Windows. Seems to be somewhat controversial, but I kinda prefer it 😅
Hopefully one of the two pieces above is all I'm missing! Thank you so much for the help!
Related Content
- 4 months ago