Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

A bunch of stuff for debugging Node.js and stuff!

  • Loading branch information...
commit 8546d6358e540acd43294ee04fc0abe279cb7d6c 1 parent f3f8eca
@subtleGradient authored
View
31 Commands/Debug in Node Inspector.tmCommand
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>. "$TM_SUPPORT_PATH/lib/html.sh"
+
+redirect "http://0.0.0.0:8080/debug?port=5858"
+
+ps|grep node-inspector|xargs -n 1|head -1|xargs kill
+
+node --debug-brk "$TM_FILEPATH" 2&gt;&amp;1 &gt;/dev/null &amp;
+
+node-inspector 2&gt;&amp;1 &gt;/dev/null &amp;
+</string>
+ <key>input</key>
+ <string>none</string>
+ <key>keyEquivalent</key>
+ <string>^~@r</string>
+ <key>name</key>
+ <string>Debug in Node.js Inspector</string>
+ <key>output</key>
+ <string>showAsHTML</string>
+ <key>scope</key>
+ <string>source.js</string>
+ <key>uuid</key>
+ <string>FF421350-D5CD-4FB2-9FDE-D92B02CD7F73</string>
+</dict>
+</plist>
View
24 Commands/Kill Node Inspector.tmCommand
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>ps|grep node-inspector|xargs -n 1|head -1|xargs kill
+ps|grep node-inspector|grep -v grep
+</string>
+ <key>input</key>
+ <string>none</string>
+ <key>keyEquivalent</key>
+ <string>^~@R</string>
+ <key>name</key>
+ <string>Kill Node Inspector</string>
+ <key>output</key>
+ <string>showAsTooltip</string>
+ <key>scope</key>
+ <string>source.js</string>
+ <key>uuid</key>
+ <string>F1DF7529-7815-4FF8-918C-87BA71453EE3</string>
+</dict>
+</plist>
View
29 Commands/Node Inspector.tmCommand
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>. "$TM_SUPPORT_PATH/lib/html.sh"
+
+redirect "http://0.0.0.0:8080/debug?port=5858"
+
+ps|grep node-inspector|xargs -n 1|head -1|xargs kill
+
+node-inspector 2&gt;&amp;1 &gt;/dev/null &amp;
+</string>
+ <key>input</key>
+ <string>none</string>
+ <key>keyEquivalent</key>
+ <string>^~@R</string>
+ <key>name</key>
+ <string>Launch Node Inspector</string>
+ <key>output</key>
+ <string>showAsHTML</string>
+ <key>scope</key>
+ <string>source.js</string>
+ <key>uuid</key>
+ <string>AB09302E-EE14-4464-92AB-240F0DD26596</string>
+</dict>
+</plist>
View
32 Commands/Run Javascript in Node_js --debug.tmCommand
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>. "$TM_SUPPORT_PATH/lib/webpreview.sh"
+html_header "Run JavaScript in Node.js"
+
+require_cmd node
+
+echo "&lt;h2&gt;You'll need to start Node Inspector separately&lt;/h2&gt;"
+
+node --debug "$TM_FILEPATH" 2&gt;&amp;1 |pre | "$TM_BUNDLE_SUPPORT/bin/TextMate.js" linkPaths
+
+html_footer
+</string>
+ <key>input</key>
+ <string>selection</string>
+ <key>keyEquivalent</key>
+ <string>^~@R</string>
+ <key>name</key>
+ <string>Debug with Node.js</string>
+ <key>output</key>
+ <string>showAsHTML</string>
+ <key>scope</key>
+ <string>source.js</string>
+ <key>uuid</key>
+ <string>F9046994-D105-4D83-8E23-CFB535C892A7</string>
+</dict>
+</plist>
View
11 Support/bin/TextMate.js
@@ -7,7 +7,16 @@ exports.href = function(path, line, column){
exports.linkPaths = function(html){
return String(html)
- .replace(/(\.*\/[^\n(){},'"]+?):(\d+)(?::(\d+))?/g, exports.linkPath)
+ // .replace(/(\.*\/[^\n(){},'"]+?):(\d+)(?::(\d+))?/g, exports.linkPath)
+ .replace(/\B(\/\b[^\n'"]*?\b\.js)(?!>)(?::(\d+))?(?::(\d+))?\b/g, exports.linkPath)
+
+ /*
+ YES
+ /foo
+ NO
+ f/foo
+ //aasdas
+ */
}
exports.linkPath = function(match, path, line, column){
View
4 Support/bin/jshint.textmate.js
@@ -1,3 +1,5 @@
+/*jshint asi:true*/
+
var QUICK = process.argv.indexOf('quick') >= 0
var JSHINT = require('./jshint').JSHINT
@@ -74,7 +76,7 @@ function report(message){
('', message.reason)
)
)
- ('td',BS('code', message.evidence.replace(/&/g,'&amp;').replace(/</g,'&lt;')))
+ ('td',BS('code', String(message.evidence).replace(/&/g,'&amp;').replace(/</g,'&lt;')))
)
))
View
59 info.plist
@@ -4,32 +4,62 @@
<dict>
<key>mainMenu</key>
<dict>
+ <key>excludedItems</key>
+ <array>
+ <string>F2A344A2-8546-41E8-BC60-EA331D4EF7B8</string>
+ <string>EAC536BF-6C4C-4AE9-8437-B28E8EB31631</string>
+ </array>
<key>items</key>
<array>
<string>6298E048-4D1B-4DD2-A3F1-AB78DD181E06</string>
<string>------------------------------------</string>
- <string>0C3CB37C-1C88-4F62-814B-5C6998E1709B</string>
- <string>------------------------------------</string>
- <string>67347C19-DA7A-41B8-8C48-8CC92E11E4E3</string>
+ <string>D551C035-3665-4E00-BFF5-801012A58876</string>
+ <string>E54A7651-8834-4EF6-8852-468A24ACC6C6</string>
+ <string>EA41CEBC-8AFB-4C46-B4F6-EAE56A97664A</string>
<string>------------------------------------</string>
<string>C8BDE80D-21C7-4237-886D-A099AC463665</string>
- <string>E54A7651-8834-4EF6-8852-468A24ACC6C6</string>
+ <string>------------------------------------</string>
+ <string>158E1772-3408-4603-81DA-86FEF3FF018D</string>
</array>
<key>submenus</key>
<dict>
+ <key>158E1772-3408-4603-81DA-86FEF3FF018D</key>
+ <dict>
+ <key>items</key>
+ <array>
+ <string>A2A911D2-4D18-47CF-8E2D-FCDAD3006A1A</string>
+ <string>FF421350-D5CD-4FB2-9FDE-D92B02CD7F73</string>
+ <string>------------------------------------</string>
+ <string>AB09302E-EE14-4464-92AB-240F0DD26596</string>
+ <string>F9046994-D105-4D83-8E23-CFB535C892A7</string>
+ <string>F1DF7529-7815-4FF8-918C-87BA71453EE3</string>
+ </array>
+ <key>name</key>
+ <string>Node.js</string>
+ </dict>
<key>C8BDE80D-21C7-4237-886D-A099AC463665</key>
<dict>
<key>items</key>
<array>
- <string>F2A344A2-8546-41E8-BC60-EA331D4EF7B8</string>
+ <string>7C7E733F-D008-4A52-8A2C-7552836807C1</string>
+ <string>88D4CEE6-2D1F-4B65-A04D-F4ABBC8F9145</string>
<string>4108455E-925C-4009-B87F-4635199F6DE7</string>
- <string>02917AD5-E190-40B5-998A-DD7DBC79BAF0</string>
<string>------------------------------------</string>
- <string>88D4CEE6-2D1F-4B65-A04D-F4ABBC8F9145</string>
+ <string>02917AD5-E190-40B5-998A-DD7DBC79BAF0</string>
</array>
<key>name</key>
<string>Validate</string>
</dict>
+ <key>D551C035-3665-4E00-BFF5-801012A58876</key>
+ <dict>
+ <key>items</key>
+ <array>
+ <string>B4DDB005-470D-4D22-8FE8-B29FDC613A7A</string>
+ <string>67347C19-DA7A-41B8-8C48-8CC92E11E4E3</string>
+ </array>
+ <key>name</key>
+ <string>Convert</string>
+ </dict>
<key>E54A7651-8834-4EF6-8852-468A24ACC6C6</key>
<dict>
<key>items</key>
@@ -46,6 +76,17 @@
<key>name</key>
<string>Compress</string>
</dict>
+ <key>EA41CEBC-8AFB-4C46-B4F6-EAE56A97664A</key>
+ <dict>
+ <key>items</key>
+ <array>
+ <string>91A87FF2-F802-4999-98ED-4FEFC3465AC1</string>
+ <string>0C3CB37C-1C88-4F62-814B-5C6998E1709B</string>
+ <string>486A2267-2A7B-46B7-9C0A-BC81D33DC0CB</string>
+ </array>
+ <key>name</key>
+ <string>Reformat</string>
+ </dict>
</dict>
</dict>
<key>name</key>
@@ -54,6 +95,10 @@
<array>
<string>6298E048-4D1B-4DD2-A3F1-AB78DD181E06</string>
<string>A2A911D2-4D18-47CF-8E2D-FCDAD3006A1A</string>
+ <string>F9046994-D105-4D83-8E23-CFB535C892A7</string>
+ <string>AB09302E-EE14-4464-92AB-240F0DD26596</string>
+ <string>FF421350-D5CD-4FB2-9FDE-D92B02CD7F73</string>
+ <string>F1DF7529-7815-4FF8-918C-87BA71453EE3</string>
<string>4108455E-925C-4009-B87F-4635199F6DE7</string>
<string>7C7E733F-D008-4A52-8A2C-7552836807C1</string>
<string>EAC536BF-6C4C-4AE9-8437-B28E8EB31631</string>
Please sign in to comment.
Something went wrong with that request. Please try again.