Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Commit 56cdcd0

Browse files
committed
Merge branch 'master' into one-keystroke-cljs-eval
2 parents 5e5c3d7 + 9834dbe commit 56cdcd0

24 files changed

Lines changed: 842 additions & 854 deletions

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language: clojure
2+
script:
3+
- cd runner && lein test
4+
jdk:
5+
- oraclejdk8
6+
notifications:
7+
irc: "chat.freenode.net#lighttable"
8+
email:
9+
- gabriel.horner@gmail.com
10+
- mrundberget@hotmail.com
11+
- kenny.evitt@gmail.com

CHANGELOG.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
#Changes
22

3-
##0.0.14
3+
## 0.1.3
4+
5+
* Remove fs and cheshire dependencies
6+
* Fix stacking for doseq
7+
* Use normal versions of tools.reader and cljs.analyzer instead of forks
8+
9+
## 0.1.2
10+
11+
* ADDED: cljc syntax highlighting
12+
13+
## 0.1.1
14+
15+
* FIX: Inline results stacking
16+
17+
## 0.1.0
18+
19+
* ADDED: Refresh connection command
20+
* FIX: Reeval of clojurescript namespace
21+
* FIX: Clojure client description to avoid confusing clojurescript users
22+
* Remove old behavior and pomegranate dependency for lein-light-nrepl
23+
* ADDED: clojurescript docs
24+
* Switch to semver versioning
25+
26+
## 0.0.14
427

528
* FIX: jump to source for jars and relative paths in clj/cljs
629
* FIX: Clear instarepl results with "Clear inline results"

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Like with Clojure and most other big OSS projects, we have a [Contributor's Agreement](https://docs.google.com/a/kodowa.com/forms/d/1ME_PT6qLKUcALUEz1h1yerLF7vP_Rnohpb9RvMLDALg/viewform) that you have to agree to before we can merge. It's a simple adaptation of Twitter's own Contributor's Agreement and just says that by signing this you can't take the code back from us or sue us into oblivion for using it later.
1+
See [LightTable's main CONTRIBUTING page](https://github.com/LightTable/LightTable/blob/master/CONTRIBUTING.md).

LICENSE.md

Lines changed: 22 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -1,180 +1,22 @@
1-
# Eclipse Public License - v 1.0
2-
3-
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
4-
5-
## 1. DEFINITIONS
6-
7-
"Contribution" means:
8-
9-
<ol type="a">
10-
<li>in the case of the initial Contributor, the initial code and documentation distributed under
11-
this Agreement, and</li>
12-
13-
<li>in the case of each subsequent Contributor:
14-
<ol type="i">
15-
<li>changes to the Program, and</li>
16-
17-
<li>additions to the Program;</li>
18-
where such changes and/or additions to the Program originate from and are distributed by that
19-
particular Contributor. A Contribution 'originates' from a Contributor if it was added to the
20-
Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions
21-
do not include additions to the Program which: (i) are separate modules of software distributed
22-
in conjunction with the Program under their own license agreement, and (ii) are not derivative
23-
works of the Program.</li>
24-
</ol>
25-
26-
"Contributor" means any person or entity that distributes the Program.
27-
28-
"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
29-
30-
"Program" means the Contributions distributed in accordance with this Agreement.
31-
32-
"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
33-
34-
## 2. GRANT OF RIGHTS
35-
36-
<ol type="a">
37-
<li>Subject to the terms of this Agreement, each Contributor hereby grants Recipient a
38-
non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works
39-
of, publicly display, publicly perform, distribute and sublicense the Contribution of such
40-
Contributor, if any, and such derivative works, in source code and object code form.</li>
41-
42-
<li>Subject to the terms of this Agreement, each Contributor hereby grants Recipient a
43-
non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell,
44-
offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in
45-
source code and object code form. This patent license shall apply to the combination of the
46-
Contribution and the Program if, at the time the Contribution is added by the Contributor, such
47-
addition of the Contribution causes such combination to be covered by the Licensed Patents. The
48-
patent license shall not apply to any other combinations which include the Contribution. No
49-
hardware per se is licensed hereunder.
50-
51-
<li>Recipient understands that although each Contributor grants the licenses to its Contributions
52-
set forth herein, no assurances are provided by any Contributor that the Program does not infringe
53-
the patent or other intellectual property rights of any other entity. Each Contributor disclaims
54-
any liability to Recipient for claims brought by any other entity based on infringement of
55-
intellectual property rights or otherwise. As a condition to exercising the rights and licenses
56-
granted hereunder, each Recipient hereby assumes sole responsibility to secure any other
57-
intellectual property rights needed, if any. For example, if a third party patent license is
58-
required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire
59-
that license before distributing the Program.</li>
60-
61-
<li>Each Contributor represents that to its knowledge it has sufficient copyright rights in its
62-
Contribution, if any, to grant the copyright license set forth in this Agreement.</li>
63-
</ol>
64-
65-
## 3. REQUIREMENTS
66-
67-
A Contributor may choose to distribute the Program in object code form under its own license
68-
agreement, provided that:
69-
70-
<ol type="a">
71-
<li>it complies with the terms and conditions of this Agreement; and</li>
72-
<li>its license agreement:
73-
<ol type="i">
74-
<li>effectively disclaims on behalf of all Contributors all warranties and conditions, express
75-
and implied, including warranties or conditions of title and non-infringement, and implied
76-
warranties or conditions of merchantability and fitness for a particular purpose;</li>
77-
78-
<li>effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
79-
iii) states that any provisions which differ from this Agreement are offered by that Contributor
80-
alone and not by any other party; and</li>
81-
82-
<li>effectively excludes on behalf of all Contributors all liability for damages, including
83-
direct, indirect, special, incidental and consequential damages, such as lost profits;</li>
84-
85-
<li>states that source code for the Program is available from such Contributor, and informs
86-
licensees how to obtain it in a reasonable manner on or through a medium customarily used for
87-
software exchange.</li></li>
88-
</ol>
89-
</ol>
90-
91-
<ol type="a">
92-
<li>it must be made available under this Agreement; and</li>
93-
<li>a copy of this Agreement must be included with each copy of the Program.
94-
</ol>
95-
96-
Contributors may not remove or alter any copyright notices contained within the Program.
97-
98-
## 4. COMMERCIAL DISTRIBUTION
99-
100-
Commercial distributors of software may accept certain responsibilities with respect to end users,
101-
business partners and the like. While this license is intended to facilitate the commercial use of
102-
the Program, the Contributor who includes the Program in a commercial product offering should do so
103-
in a manner which does not create potential liability for other Contributors. Therefore, if a
104-
Contributor includes the Program in a commercial product offering, such Contributor ("Commercial
105-
Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified
106-
Contributor") against any losses, damages and costs (collectively "Losses") arising from claims,
107-
lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the
108-
extent caused by the acts or omissions of such Commercial Contributor in connection with its
109-
distribution of the Program in a commercial product offering. The obligations in this section do not
110-
apply to any claims or Losses relating to any actual or alleged intellectual property
111-
infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the
112-
Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control,
113-
and cooperate with the Commercial Contributor in, the defense and any related settlement
114-
negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
115-
116-
For example, a Contributor might include the Program in a commercial product offering, Product
117-
X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes
118-
performance claims, or offers warranties related to Product X, those performance claims and
119-
warranties are such Commercial Contributor's responsibility alone. Under this section, the
120-
Commercial Contributor would have to defend claims against the other Contributors related to those
121-
performance claims and warranties, and if a court requires any other Contributor to pay any damages
122-
as a result, the Commercial Contributor must pay those damages.
123-
124-
## 5. NO WARRANTY
125-
126-
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS,
127-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
128-
LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR
129-
A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of
130-
using and distributing the Program and assumes all risks associated with its exercise of rights
131-
under this Agreement , including but not limited to the risks and costs of program errors,
132-
compliance with applicable laws, damage to or loss of data, programs or equipment, and
133-
unavailability or interruption of operations.
134-
135-
## 6. DISCLAIMER OF LIABILITY
136-
137-
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE
138-
ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
139-
(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
140-
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
141-
THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF
142-
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
143-
144-
##7. GENERAL
145-
146-
If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not
147-
affect the validity or enforceability of the remainder of the terms of this Agreement, and without
148-
further action by the parties hereto, such provision shall be reformed to the minimum extent
149-
necessary to make such provision valid and enforceable.
150-
151-
If Recipient institutes patent litigation against any entity (including a cross-claim or
152-
counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program
153-
with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights
154-
granted under Section 2(b) shall terminate as of the date such litigation is filed.
155-
156-
All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the
157-
material terms or conditions of this Agreement and does not cure such failure in a reasonable period
158-
of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement
159-
terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably
160-
practicable. However, Recipient's obligations under this Agreement and any licenses granted by
161-
Recipient relating to the Program shall continue and survive.
162-
163-
Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid
164-
inconsistency the Agreement is copyrighted and may only be modified in the following manner. The
165-
Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement
166-
from time to time. No one other than the Agreement Steward has the right to modify this
167-
Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may
168-
assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new
169-
version of the Agreement will be given a distinguishing version number. The Program (including
170-
Contributions) may always be distributed subject to the version of the Agreement under which it was
171-
received. In addition, after a new version of the Agreement is published, Contributor may elect to
172-
distribute the Program (including its Contributions) under the new version. Except as expressly
173-
stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual
174-
property of any Contributor under this Agreement, whether expressly, by implication, estoppel or
175-
otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
176-
177-
This Agreement is governed by the laws of the State of New York and the intellectual property laws
178-
of the United States of America. No party to this Agreement will bring a legal action under this
179-
Agreement more than one year after the cause of action arose. Each party waives its rights to a jury
180-
trial in any resulting litigation.
1+
The MIT License (MIT)
2+
=====================
3+
4+
Copyright (c) 2014 Kodowa, Inc. & Light Table contributors
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

README.md

Lines changed: 67 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,84 @@
22

33
The official Clojure language plugin for Light Table.
44

5+
## Supported Clojure versions
6+
7+
This plugin requires projects Clojure 1.5.1 and higher. Starting with 0.2.0 this plugin will only be maintained for projects with Clojure 1.7.0 and higher.
8+
9+
## Supported ClojureScript versions
10+
11+
This plugin works for projects on recent versions of ClojureScript e.g. 1.7.X. For projects with ClojureScript versions 0.0-2341 and higher, Clojure 1.7.0 is required.
12+
13+
## First ClojureScript Repl
14+
15+
Welcome first time ClojureScript users! Please see [David Nolen's tutorial](https://github.com/swannodette/lt-cljs-tutorial) to get familiar with ClojureScript and comfortable with LightTable's repl. Note while doing that tutorial you were in a namespace. A namespace is necessary for a LightTable repl. Once you have finished the tutorial, create your own ClojureScript project with `lein new mies my-project` and eval there. If you want to add dependencies to your project, read the [below section](#clojurescript-eval) as that requires a different type of LightTable connection.
16+
17+
## Cljc eval
18+
19+
By default, \*.cljc files are identified as Clojure files. Thus when you eval, it will eval as a
20+
Clojure file. If you'd like to eval as a ClojureScript file, run the command `Editor: Set current
21+
editor syntax`, select `ClojureScript` and then eval.
522

623
## ClojureScript Eval
724

8-
There are 3 ways to eval ClojureScript, 2 of which use your ClojureScript javascript. To add one of these connections, run the command `Connect: Add Connection`. The 3 connections to choose from:
25+
There are 3 options to eval ClojureScript, 2 of which use your ClojureScript javascript. To add one of these connections, run the command `Connect: Add Connection`. The 3 connections to choose from:
926

1027
1. `Light Table UI` - Connect to the LightTable js process. Great for a headless mode, writing plugins and to try out ClojureScript features. Note, you use the ClojureScript version that comes with LightTable.
1128

12-
2. `Browser` - Connect to a web page that has the compiled ClojureScript sourced. You must navigate the internal browser to that web page. Recommended for ease of use.
29+
2. `Browser` - Connect to a web page that has the compiled ClojureScript sourced e.g. `file:///path/to/index.html`. You must navigate the internal browser to that web page. Recommended for ease of use.
30+
31+
3. `Browser (External)` - Connect to a web page that has the compiled ClojureScript sourced e.g. `file:///path/to/index.html`. In addition to navigating the external browser, you must copy the script tag into that web page. Requires more setup than the internal browser but gives you the freedom to use any browser.
32+
33+
Note that for Browser options, compiled ClojureScript cannot be compiled with `:advanced` `:optimizations` mode.
34+
35+
## ClojureScript Workflows
36+
37+
For ClojureScript projects:
38+
39+
Your project is connected to a browser. Recompile cljs outside of LT with project's cljs compile tool e.g. `lein cljsbuild auto`.
40+
Most changes can be evaled. However, if adding project dependencies or requires to ns, use the `:client.refresh-connection` command
41+
to refresh the browser page. To automate this on-save, add this to `user.behaviors`:
1342

14-
3. `Browser (External)` - Connect to a web page that has the compiled ClojureScript sourced. In addition to navigating the external browser, you must copy the script tag into that web page. Requires more setup than the internal browser but gives you the freedom to use any browser.
43+
```clojurescript
44+
:editor.clojurescript [(:lt.objs.editor.file/on-save :client.refresh-connection)]
45+
```
1546

47+
For LightTable plugins:
1648

17-
## For Commiters
49+
Your project is connected to `LightTable UI`. When you save any plugin cljs file, compiled js is generated and saved. Any change
50+
can be eval-ed.
1851

52+
## Connect to remote nREPL
53+
54+
When you eval a Clojure project, Light Table automatically starts an nREPL server and connects to it. If you'd prefer to start an nREPL server,
55+
open the `Connections` panel, press `Add Connection` button and select the `Clojure (remote nREPL)` client. Make sure your project.clj
56+
has the following `:dependencies` and `:repl-options`:
57+
58+
```clojure
59+
(defproject lttest "0.1.0-SNAPSHOT"
60+
:description "FIXME: write description"
61+
:dependencies [[org.clojure/clojure "1.6.0"]
62+
[lein-light-nrepl "X.X.X"]]
63+
:repl-options {:nrepl-middleware [lighttable.nrepl.handler/lighttable-ops]})
64+
```
65+
66+
For projects using Clojure >= 1.5.1 and < 1.7.0, `X.X.X` refers to `0.1.3`, an older unmaintained version.
67+
For projects using Clojure >= 1.7.0, `X.X.X` refers to the latest version of `lein-light-nrepl`:
68+
69+
[![Clojars Project](http://clojars.org/lein-light-nrepl/latest-version.svg)](http://clojars.org/lein-light-nrepl)
70+
71+
## License
72+
73+
Distributed under the MIT License, see license.md for the full text.
74+
75+
## For Committers
76+
77+
* Project layout
78+
* runner/: Contains uberjar to inject our nREPL middleware into a project and then start a repl
79+
* lein-light-nrepl/: Contains nREPL middleware that needs to be deployed to Clojars when changed
80+
* src/ and everything else: Normal LightTable plugin
1981
* When releasing a new plugin version and lein-light-nrepl has changed:
2082
* Bump lein-light-nrepl and lein-light in runner/.
21-
* Update the uberjar with `lein uberjar` in `runner/target/lein-light-standalone.jar`.
83+
* Update the uberjar with `lein uberjar` in `runner` to produce `runner/target/lein-light-standalone.jar`.
2284
* Release the new version of lein-light-nrepl to [clojars](https://clojars.org/lein-light-nrepl)
2385
* No process for upgrading `clojure-mode.js` until [this issue](https://github.com/LightTable/Clojure/issues/26) is addressed.
24-
25-
###License
26-
27-
Copyright (C) 2013 Kodowa Inc.
28-
29-
Distributed under the EPL, see license.md for the full text.

build.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/bin/sh
2-
find . -name '*.DS_Store' -type f -delete
32
cd runner
43
lein uberjar
5-
lein install
64
cd ../lein-light-nrepl
75
lein install
86
echo " --- Done!"

0 commit comments

Comments
 (0)