Code Monkey home page Code Monkey logo

sublime-lightning's Introduction

Sublime Lightning

Sublime Plugin for Lightning Component Development

This plugin requires Sublime Text 3 and works in conjunction with the Force CLI. You can download the version of Force CLI for your OS here: https://force-cli.herokuapp.com

Make sure that you have installed the Force CLI force binary into a folder on your path, and that it's marked as executable.

To install the sublime-lightning plugin, first install Package Control. Installation instructions are here: https://sublime.wbond.net/installation. Once Package Control is installed, open the Command Palette from Tools > Command Palette, type 'install' and select 'Package Control: Install Package'. Search for 'lightning' and then install the package from the results.

Once you have both of these installed, create a new folder to be your working folder.

mkdir mywork
cd mywork

Launch Sublime Text and open the new folder. If you haven't logged in recently from the command line, you can right-click the folder in Sublime's sidebar and select "Salesforce Login". In the bottom tray of Sublime enter your username and hit the enter key, enter your password (shown in clear text, sorry), and hit the Enter key.

Note: If you receive the error message, "Sublime Lightning Plugin requires the Force.com CLI to function.." and you are certain that the CLI is in your path and is marked as executable, you can try installing the Fix Mac Path plugin, which might solve the issue.

At this point, you won't be able to create Lightning resources, unless you have a folder under your work directory named 'metadata/aura'. You can, however, fetch existing Lightning resources by right-clicking the work folder and selecting "Fetch Lightning". This queries your Salesforce instance for all Lightning bundles and display them for you to choose which you want to edit. You can choose all Lightning bundles, scroll to the specific bundle you want, or begin typing the name of the Lightning bundle to filter the list and then select the one you want.

Once you have a Lightning bundle locally in SublimeText, you can begin editing your component, controller, event, app, or styles. To save your changes back to Salesforce, simply press CMD+S on your Mac or CTRL+S on your Windows machine. You'll see a verification of the save and the time it took in the status bar at the bottom of the screen. You might also, or instead, see errors that prevented saving your changes back to Salesforce.

To create a new Lightning bundle, right-click the "aura" folder and select the type of component that you want to create. You are prompted for a name at the bottom of the screen. Enter a name and hit enter. Once your bundle is created, you can right-click the bundle folder and add other artifacts to your bundle as appropriate for the bundle type.

Deleting artifacts is accomplished by right-clicking the file and selecting "Delete Lightning Definition". This will only delete the selected file and remove that artifact from the bundle both locally and on Salesforce. If you want to delete the entire bundle, right-click the bundle folder and select "Delete Lightning Bundle". Deletes CANNOT be undone and there is no confirmation prompt in the current version of the plugin.

You can safely right-click any file or folder and select the Sublime menu item for deleting file or folder, as what is saved locally is a copy of what is in Salesforce. You can easily retrieve the Lightning bundle or artifact by re-fetching, right-click and select "Fetch Lightning".

screenshot-238

screenshot-237

screenshot-236

screenshot-235

See "how to" video below.

Video: How to Use SublimeText to Edit Lightning Commponents

sublime-lightning's People

Contributors

alderete-sfdc avatar dcarroll avatar devangel avatar i814u2 avatar jeffdonthemic avatar jonacollazo avatar nathanialle avatar nathanross avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sublime-lightning's Issues

Support for 32 bit Windows 7 system

Current release is not supported on win 7 32 bit system. Do we have any available solution for 32 bit system.
I want to code lightning...

KIndly help me to Fix this

I have sublime text 3 and i have installed heroku CLI, commands work on cmd if i want to login/check version.

But on sublime text 3 when i open a folder and click salesforce login for lightning,, this throws below attached errors.

Kindly some one help me on this.

login

login_then

Error with Fetch command

I'm getting this error when running the Fetch command:

pic1

As the message says, when I run the same command from CLI I get similar results, for example:

running the following command:

>force query "Select Id,DeveloperName,MasterLabel,Description From AuraDefinitionBundle" --format:json -t"

The first data I get is the following error:

pic2

I tweaked a little the command and I didn't get errors with the following one:
>force query --format json -t "Select Id,DeveloperName,MasterLabel,Description From AuraDefinitionBundle"

Clearly something changed recently in the platform, the CLI version I'm running is v0.24.0, and the platform we have is v40.0.

Can somebody help with this?

btw I took that command from:

p = popen_force_cli(["query", "Select Id,DeveloperName, "
"MasterLabel, Description From "
"AuraDefinitionBundle",
"--format:json", "-t"])

Lightning plugin does not show up on latest Sublime install list

I tried to re-install Lightning plugin onto sublime by following your instructions: "Once Package Control is installed, open the Command Palette from Tools > Command Palette, type 'install' and select 'Package Control: Install Package'. Search for 'lightning' and then install the package from the results".

Unlike in the past, today, NO Lightning plugin showed up on the list!

I have installed the latest update on Sublime Text 3 and my Max OSX is 10.11.4

Creating an APEX classes / triggers

First of all, thanks to the awesome plugin which makes my life much easier!
It is really a great tool that helped me deal with all different aura components, helpers, controllers, etc! However, what is the best way to create APEX classes (or triggers)? I tried manually creating a class file. It seems like it is actually trying to upload the file to the server but fails saying the class' XML metadata file is missing (classname.cls-meta.xml). Then I also manually created this XML file but still fails to save.

Am I doing anything wrong? If so or there is any proper way to do it, please advise. Thank you in advance.

Not available for deploy for this API version

I get this error "Not available for deploy for this API version " when saving lightning app from Sublime but have no issues when doing it through Developer console.
Updated with the latest force cli and also installed the latest package and still the same issue.
Any ideas? Thanks.

Sublime error Mac os

im using sublime in a Macbook pro (latest generation) and sublime is no recognizing my .java files i save them on documents or deskot and it doesnt run the program on the terminal it says the files do not exist but in finder it appears

I cannot login Salesforce with the plugin

Hi there,
I was successfully use the plugin to fetch lightning project code. Now I working on another project, and when I use Lightning -> Salesforce Login, I input new username/password/instanceURL, but log in failed.
And it shows"Loaded Endpoin: (https://old project url)", it seems the URL was in catch or somewhere?

Thanks,
Moon Cui

Not able to add css to existing component

When i am trying to add css to an existing component named "Sample", it is not getting added. Nothing is being shown below. If we open console, I am getting below error,
FileNotFoundError: [Errno 2] No such file or directory: '/Users/myName/Documents/Trainings/lightning/projectName/metadata/aura/SampleStyle/SampleStyle.css'

It should try to find file under below path right?

'/Users/myName/Documents/Trainings/lightning/projectName/metadata/aura/Sample/SampleStyle.css'

Unable to fetch Lightning components using Force CLI (using directly or via sublime plugin)

I am using Windows 64 bit v0.22.50 of force CLI on Windows 7.
After successfully logging in, I run the following command:
force fetch -t Aura -n InventoryList -d "C:\Users\chdmcint\workspace\lightning"
Here is the response:

`panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x1 addr=0x0 pc=0x42b982]

goroutine 1 [running]:
main.(_Force).GetAuraBundleByName(0x0, 0xc082002310, 0xd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/travis/gopath/src/github.com/heroku/force/force.go:499 +0x592
main.(_Force).GetAuraBundle(0x0, 0xc082002310, 0xd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/travis/gopath/src/github.com/heroku/force/force.go:487 +0xb3
main.runFetchAura2(0xba1e80, 0xc082002310, 0xd)
/home/travis/gopath/src/github.com/heroku/force/fetch.go:89 +0x164
main.runFetch(0xba1e80, 0xc082056070, 0x0, 0x0)
/home/travis/gopath/src/github.com/heroku/force/fetch.go:200 +0x1aa
main.main()
/home/travis/gopath/src/github.com/heroku/force/main.go:55 +0x2f9
`
I get same result if I try fetching lightning components from Sublime.

Create or Retreive Lightning Components from Sandbox

Appears that there is no ability to use against a sandbox org, as the instance parameter for the force CLI cannot be passed, and defaults to Production. Could an enhancement be added to allow specifying the Test or Production Instance for the login function?

any plans to merge this with Mavensmate?

This looks like a great tool. It would be awesome to merge with Mavensmate and have one app and access point for SFDC interactions.

(sorry if this is not really an "issue." just didn't know where else to post this question.)

Duplicate component error while pushing the component to Salesforce

A component has been created in the salesforce using the dev console.
The same has been fetched to sublime and then when try to modify the component and save the file.

The following error is thrown

  • The error is: duplicate value found: AuraDefinitionBundleId duplicates value on record with id: 0Adj00000004p4r
    ERROR: duplicate value found: AuraDefinitionBundleId duplicates value on record with id: 0Adj00000004p4r
    %!(EXTRA string=DUPLICATE_VALUE)[Finished in 0.9s]

Environment: Windows 7, Sublime Text 3

Needs logout feature

I can't get metadata from another org, because plugin try to login into existing org.

I found solution: force -logout, but it isn't unfriendly.

ERROR: File does not exist

My sublime Text 3 has always been working with Lightning plugin until this morning.

My Mac Book automatically updated the OS to El Capitan 10.11.4. Since then, I could still do a Salesforce Login correctly and fetch "All Bundles".

But when I attempted to save any one of them, it gave me this error:

stat /Users/dkoon/dev/codebase/lightning/[email protected]/metadata/aura/profileTopLevelContainerView/'/Users/dkoon/dev/codebase/lightning/[email protected]/metadata/aura/profileTopLevelContainerView/profileTopLevelContainerView.cmp': no such file or directory
ERROR: File does not exist
/Users/dkoon/dev/codebase/lightning/[email protected]/metadata/aura/profileTopLevelContainerView/'/Users/dkoon/dev/codebase/lightning/[email protected]/metadata/aura/profileTopLevelContainerView/profileTopLevelContainerView.cmp'
[Finished in 0.2s with exit code 1]
[cmd: ['force', 'aura', 'push', '-f', "'/Users/dkoon/dev/codebase/lightning/[email protected]/metadata/aura/profileTopLevelContainerView/profileTopLevelContainerView.cmp'"]]
[dir: /Users/dkoon/dev/codebase/lightning/[email protected]/metadata/aura/profileTopLevelContainerView]
[path: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin]

Notice that it expects to see: '/Users/dkoon/dev/codebase/lightning/[email protected]/metadata/aura/profileTopLevelContainerView/profileTopLevelContainerView.cmp' inside of /Users/dkoon/dev/codebase/lightning/[email protected]/metadata/aura/profileTopLevelContainerView/

My actual file structure is:
/Users/dkoon/dev/codebase/lightning/[email protected]/metadata/aura/profileTopLevelContainerView

ERROR: parse :///id//: missing protocol scheme

Hi!
I'm getting the same issue as ForceCLI/force#144.
I've installed everything and trying to login to my org and get the following error:

Loaded Endpoint: (https://na24.salesforce.com)
Save login was  ok
ERROR: parse :///id//: missing protocol scheme
[Finished in 3.4s]

I'm using Developer Edition and trying to connect from 62-bit Windows pc.

Cannot fully fetch the component and Duplicate Id error

  1. The plugin cannot fully fetch the newly created components anymore. Whenever I create a new component in the online dev console, the lightning plugin only creates the file ".manifest" containing the component's name, id. For example {"Name":"ManagerDashBoard","Id":"0Ab110000004CYhCAM","Files":[]}
  2. The plugin cannot modify/update some existing components on the local computer. The error is "duplicate value found: AuraDefinitionBundleId duplicaes value on record with id###...etc" (please see attached picture). I think the plugin gets confused when I save the file locally. Usually, whenever I saved the file in sublime, the file on the server got updated immediately.

'File is not in an aura bundle folder' error

Hi,

I'm trying to create a new lightning component, I've fetched the bundles from org, right clicked clicked on the aura folder -> create -> component and I get:

ERROR: File is not in an aura bundle folder (aura)
[Finished in 0.0s with exit code 1]
[cmd: ['force', 'aura', 'push -f=C:\Users\Hubert\workspaces\sublime lightning\test\test\metadata\aura\load\load.cmp']]

can you help?

Unable to create a lightning app from scratch

Hello,

I wonder how can I create a lightning application from scratch using just sublime.
So far I create the application using the Salesforce Developer Console and then I fetch the lightning application from sublime.

Thanks.

Add LICENSE file with license information

Having a license under which contributions are made protects the project from copyright claims.

In addition, it's hard to get people to try Sublime Lightning when there's no license. Questions are raised like "if they decide to make the repo private one day out of the blue (for whatever reason, commercialization etc), what is the effect on the business" and those are questions that are difficult to answer without a license.

To this end I propose one of the following

  1. The typical approach, example here, of notifying through @username mention each prior contributor, and polling them on a license that will be added.
  2. Assuming that all prior contributions were made with an implicit understanding that the copyright would be assigned, and using that prior assignment, retroactively relicensing all prior commits under an explicit license that future commits fall under as well.

Although the notification approach takes more time, and the assumption of prior implicit copyright assignment is dubious, one or the other is required to have a clear license on past and future contributions.

Running 'Lightning > Fetch > Lightning' does not run command

Just installed most recent package and choosing 'Lightning > Fetch > Lightning' is not working. Enabled logging and Console shows nothing, too. For reference, I see 'Running FetchMetaCommand' for the 'Fetch > Metadata' and 'Running FetchPackageCommand' for 'Fetch > Package', though nothing seems to happen for either, probably for legitimate reason (no folder structure or data). Thoughts?

Fetching error

After using the following command line

force fetch -t Aura -n InventoryList -d "C:\Work\Salesforce\test"

The following error appear, no firewall or proxy

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x1 addr=0x0 pc=0x42bab2]

goroutine 1 [running]:
main.(_Force).GetAuraBundleByName(0x0, 0xc0820022c0, 0xd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/travis/gopath/src/github.com/heroku/force/force.go:499 +0x592
main.(_Force).GetAuraBundle(0x0, 0xc0820022c0, 0xd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/travis/gopath/src/github.com/heroku/force/force.go:487 +0xb3
main.runFetchAura2(0xba1e80, 0xc0820022c0, 0xd)
/home/travis/gopath/src/github.com/heroku/force/fetch.go:89 +0x164
main.runFetch(0xba1e80, 0xc082058070, 0x0, 0x0)
/home/travis/gopath/src/github.com/heroku/force/fetch.go:200 +0x1aa
main.main()
/home/travis/gopath/src/github.com/heroku/force/main.go:55 +0x2f9

Not working on Mac OS 10.10

Hi, I am trying to run the plugin on Mac OS 10.10, MavensMate 0.0.2, ForceCLI. I added ForceCLI to my $Path varible, running smoothly on terminal. But when I try to install the lightning plugin I'll reveive the following Error:
Sublime Lightning Plugin requires the Force.com CLI to function

Please visit force-cli.herokuapp.com to installthe Force.com CLI.

If you have already installed it, please make sure that you have stored it or created a symlink to it in Sublime's default path.

I found a hint on http://salesforce.stackexchange.com/questions/83457/trouble-making-cli-command-line-interface-work-with-sublime-on-mac-os-x, but this plugin seems not working too.

MavensMate itself runs like charm - I have no Idea what the problem could be.
Do you have any hint for me what "Sublime's default path" is?

Add Lighting Event is missing?

I've managed to create component, controller, css, renderer
But I don't find a way to create an event. Am I wrong?

I'm using sublime lightininh with mavensmate on sulbime 3 with windows.

Turn Off Auto Push On Save

Hi Dave,

I have been getting stuck in with Lightning components and have really been enjoying using the plugin for Sublime but wondered if there was any way I could turn off the Auto Push & Deploy feature whenever I click save?

Thanks a lot,

Mark

Unable to fetch Lightning components from Sandbox

Been trying to get Lightning in Sublime but it's not happening...

I've followed the steps on this page to install. I have version 6.0.0 of Mavensmate, build 3083 of Sublime Text 3 and v 0.22.36 of force.exe saved in the Sublime Progam Files folder. Running Windows 7. I have tried going through Lightning/Login first and entering the details and it tells me it has successfully logged in. However, when I go to fetch Lightning, it reports an error "panic: runtime error: invalid memory address or nil point dereference". I can write more of the error message if that's helpful but haven't right now because I can't copy paste and it's a lot to type...

Issue when connecting to a different org

When I login to another org. It's trying to load the endpoint of previous org and not to the org I am trying to login.

for example if two orgs that have their domain set and then when trying to login with username, password and login.salesforce.com for developer org. It tries to load the endpint of the previous org though the username and password is unrelated to the previous org.

Error on save/deploy

Thank you for this awesome plugin!!! Love not having to use the dev console to create + edit bundles.

I've started getting an error message on saving any aura files, on auto-deploy:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x20 pc=0x45eaac]

goroutine 1 [running]:
main.InAuraBundlesFolder(0xc08214b5e0, 0xd2, 0x0)
/app/work/src/src/github.com/heroku/force/pushAura.go:289 +0x5c
main.runPushAura(0xba0aa0, 0xc08219e120, 0x1, 0x1)
/app/work/src/src/github.com/heroku/force/pushAura.go:39 +0x21f
main.runAura(0xba0aa0, 0xc08200c1b0, 0x3, 0x3)
/app/work/src/src/github.com/heroku/force/aura.go:111 +0x683
main.main()
/app/work/src/src/github.com/heroku/force/main.go:55 +0x2f9
[Finished in 0.1s with exit code 2]
[cmd: ['force', 'aura', 'push', '-f', "'C:\Users\myUserName\Documents\workspace\myWorkspaceName\metadata\aura\helloMessageInteractive\helloMessageInteractiveController.js'"]]
[dir: C:\Users\myUsername\Documents\workspace\myWorkspaceName\metadata\aura\helloMessageInteractive]
[path: variousPathAddressesHere

However, when I push using the force CLI
force aura push -f
and the target url

C:\Users\myUserName\Documents\workspace\myWorkspaceName\metadata\aura\helloMessageInteractive\helloMessageInteractiveController.js

the push works. Am I doing something wrong, or is this an issue with the plugin?

Thanks!

Unable to switch end points

I have two different lightning orgs that I work on. I was trying to do some work on the other one, but it still showed the end point of the first one even though I gave a different instance url.

There doesn't seem to be anything that documents how to change end points.

Problem with Proxy

I've tried out the plugin and it works great but I faced some problem when trying to work through a proxy.

[Error] dial tcp: GetAddrInfoW: No such host is known.

Any suggestion/workaround?

unable to create component if root folder name contains space

$ mkdir -p some\ folder/metadata/aura
$ subl some\ folder/
Right-click aura -> Lightning -> Create Component -> provide name

No component is created. The output pane says the following:

ERROR: File does not exist
/Users/eeeldert/Downloads/some
stat /Users/eeeldert/Downloads/some: no such file or directory
[Finished in 0.0s with exit code 1]
[cmd: ['force', 'aura', 'push -f=/Users/eeeldert/Downloads/some folder/metadata/aura/mycomp/mycomp.cmp']]
[dir: /Users/eeeldert/Downloads/some folder/metadata/aura/mycomp]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.