Download your Java JDK:
Since oracle is asking to signup to download the JDK, you may use the below website to download JDK without signup.
https://www.malavida.com/en/soft/java-jdk/download
Set your JAVA_HOME and Path.
JAVA_HOME: your JDK path (my java home path looks like this: C:\Program Files\Java\jdk1.8.0_231)
Path :you Bin path (my java path looks like this: C:\Program Files\Java\jdk1.8.0_231\bin)
Testing: use Java -version from the command prompt whether this setting works or not. If everything works, you will get java version, otherwise you will get "java is not recognized as ....."
>> Download your Salesforce CLI and execute the .exe file
https://developer.salesforce.com/tools/sfdxcli
Testing: From the command prompt type "SFDX". If it is properly installed, you will get some sfdx commands, otherwise you will get "sfdx is not recognized as ....."
>> Download your Visual studio code from the below link and then execute the .exe file
https://code.visualstudio.com/
>> Now add the extensions whichever necessary.
How to connect to the Salesforce org:
>> From the visual studio, select proper folder where you want to store all the project related components.
>> Now, press ctrl+shift+p and select SFDX:create project with manifest and then select standard project template ( this step will not really connect to salesforce org but below step connects)
>> Now, press ctrl+shift+p and select SFDX: authorize an org (select login.salesforce.com or test.salesforce.com or custom domain, it depends on which instance you
are connecting)
>>Now right click on lwc(it can be any component like class, aura component pages... so on)
>> provide the webcomponent name and select folder and then hit enter.
>> Now your webcomponets files are availble under the folder in the format of .html, .js and meta xml
>>Right click once you develop your component and deploy it.
LWC open source:
Go to : https://lwc.dev/
=> Download node Js from the below link and execute it:
https://nodejs.org/en/
=> Now go to command prompt follow below steps.
To install Lightning Web Components and the Lightning Web Components CLI, use the open source create-lwc-app tool.
Step 1: npx create-lwc-app my-app ( here my-app can be any name. If you change it as per your needs, ensure to point the below cmd to the right folder
which you have created)
Note: if the node js in not installed, it will throw an error like "npx is not recognised as internal command..........".
Step 2: cd my-app (to move to the current folder which you have created in the step 1)
Step 3: npm run watch (to start your local server)
As a final step, now go to the local host from any browser: http://localhost:3001
Push the same code to the Heroku cloud:
Signup for the Heroku account for free from the below link:
https://signup.heroku.com
=> Install "GIT" prior to installing Heroku cli, use the below link for the same.
https://git-scm.com/download/win
Testing: from command prompt type git, if it is installed properly, you will get proper commands.
=> Install Heroku cli from below website:
https://devcenter.heroku.com/articles/heroku-cli
Testing: from command prompt type "Heroku", if it is installed properly, you will get proper commands.
Create a Procfile with web: npm run serve and place the file under root folder of where you created your opensource(my-app) folder.
heroku login
git init (initializes git if it is not initialized)
git add .
git commit -m "Intial Commit"
git push heroku master
heroku open
Note: To connect to specific existing app you can use cmd heroku git:remote -a lwconcloud
TIP: In case if you encounter any challenges to connect to heroku from your local code.
you can download below git stuff from the given link and push to the heroku. You can change the folder structure as per your needs.
https://github.com/Tdssaini/lwc-open-source-with-heroku
>> now go to the app which you have in Heroku and try to check the output.
Since oracle is asking to signup to download the JDK, you may use the below website to download JDK without signup.
https://www.malavida.com/en/soft/java-jdk/download
Set your JAVA_HOME and Path.
JAVA_HOME: your JDK path (my java home path looks like this: C:\Program Files\Java\jdk1.8.0_231)
Path :you Bin path (my java path looks like this: C:\Program Files\Java\jdk1.8.0_231\bin)
Testing: use Java -version from the command prompt whether this setting works or not. If everything works, you will get java version, otherwise you will get "java is not recognized as ....."
>> Download your Salesforce CLI and execute the .exe file
https://developer.salesforce.com/tools/sfdxcli
Testing: From the command prompt type "SFDX". If it is properly installed, you will get some sfdx commands, otherwise you will get "sfdx is not recognized as ....."
>> Download your Visual studio code from the below link and then execute the .exe file
https://code.visualstudio.com/
>> Now add the extensions whichever necessary.
How to connect to the Salesforce org:
>> From the visual studio, select proper folder where you want to store all the project related components.
>> Now, press ctrl+shift+p and select SFDX:create project with manifest and then select standard project template ( this step will not really connect to salesforce org but below step connects)
>> Now, press ctrl+shift+p and select SFDX: authorize an org (select login.salesforce.com or test.salesforce.com or custom domain, it depends on which instance you
are connecting)
>>Now right click on lwc(it can be any component like class, aura component pages... so on)
>> provide the webcomponent name and select folder and then hit enter.
>> Now your webcomponets files are availble under the folder in the format of .html, .js and meta xml
>>Right click once you develop your component and deploy it.
LWC open source:
Go to : https://lwc.dev/
=> Download node Js from the below link and execute it:
https://nodejs.org/en/
=> Now go to command prompt follow below steps.
To install Lightning Web Components and the Lightning Web Components CLI, use the open source create-lwc-app tool.
Step 1: npx create-lwc-app my-app ( here my-app can be any name. If you change it as per your needs, ensure to point the below cmd to the right folder
which you have created)
Note: if the node js in not installed, it will throw an error like "npx is not recognised as internal command..........".
Step 2: cd my-app (to move to the current folder which you have created in the step 1)
Step 3: npm run watch (to start your local server)
As a final step, now go to the local host from any browser: http://localhost:3001
Push the same code to the Heroku cloud:
Signup for the Heroku account for free from the below link:
https://signup.heroku.com
=> Install "GIT" prior to installing Heroku cli, use the below link for the same.
https://git-scm.com/download/win
Testing: from command prompt type git, if it is installed properly, you will get proper commands.
=> Install Heroku cli from below website:
https://devcenter.heroku.com/articles/heroku-cli
Testing: from command prompt type "Heroku", if it is installed properly, you will get proper commands.
Create a Procfile with web: npm run serve and place the file under root folder of where you created your opensource(my-app) folder.
heroku login
git init (initializes git if it is not initialized)
git add .
git commit -m "Intial Commit"
git push heroku master
heroku open
Note: To connect to specific existing app you can use cmd heroku git:remote -a lwconcloud
TIP: In case if you encounter any challenges to connect to heroku from your local code.
you can download below git stuff from the given link and push to the heroku. You can change the folder structure as per your needs.
https://github.com/Tdssaini/lwc-open-source-with-heroku
>> now go to the app which you have in Heroku and try to check the output.
No comments:
Post a Comment