Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moved src/*.coffee under src/coffee-script/ so that lib can be added …

…to $NODE_PATH and only expose the top-level coffee-script namespace. Fixes #1246
  • Loading branch information...
commit ab17f4165230eb33d6d75c9ddcae82450b87b934 1 parent 18ab569
@gfxmonk gfxmonk authored
Showing with 16 additions and 16 deletions.
  1. +11 −11 Cakefile
  2. +1 −1  bin/cake
  3. +1 −1  bin/coffee
  4. 0  lib/{ → coffee-script}/browser.js
  5. 0  lib/{ → coffee-script}/cake.js
  6. 0  lib/{ → coffee-script}/coffee-script.js
  7. 0  lib/{ → coffee-script}/command.js
  8. 0  lib/{ → coffee-script}/grammar.js
  9. 0  lib/{ → coffee-script}/helpers.js
  10. 0  lib/{ → coffee-script}/index.js
  11. 0  lib/{ → coffee-script}/lexer.js
  12. 0  lib/{ → coffee-script}/nodes.js
  13. 0  lib/{ → coffee-script}/optparse.js
  14. 0  lib/{ → coffee-script}/parser.js
  15. 0  lib/{ → coffee-script}/repl.js
  16. 0  lib/{ → coffee-script}/rewriter.js
  17. 0  lib/{ → coffee-script}/scope.js
  18. +2 −2 package.json
  19. 0  src/{ → coffee-script}/browser.coffee
  20. 0  src/{ → coffee-script}/cake.coffee
  21. 0  src/{ → coffee-script}/coffee-script.coffee
  22. 0  src/{ → coffee-script}/command.coffee
  23. 0  src/{ → coffee-script}/grammar.coffee
  24. 0  src/{ → coffee-script}/helpers.coffee
  25. 0  src/{ → coffee-script}/index.coffee
  26. 0  src/{ → coffee-script}/lexer.coffee
  27. 0  src/{ → coffee-script}/nodes.coffee
  28. 0  src/{ → coffee-script}/optparse.coffee
  29. 0  src/{ → coffee-script}/repl.coffee
  30. 0  src/{ → coffee-script}/rewriter.coffee
  31. 0  src/{ → coffee-script}/scope.coffee
  32. +1 −1  test/option_parser.coffee
View
22 Cakefile
@@ -1,6 +1,6 @@
fs = require 'fs'
path = require 'path'
-{extend} = require './lib/helpers'
+{extend} = require './lib/coffee-script/helpers'
CoffeeScript = require './lib/coffee-script'
{spawn, exec} = require 'child_process'
@@ -22,10 +22,11 @@ header = """
"""
sources = [
- 'src/coffee-script.coffee', 'src/grammar.coffee'
- 'src/helpers.coffee', 'src/lexer.coffee', 'src/nodes.coffee'
- 'src/rewriter.coffee', 'src/scope.coffee'
-]
+ 'coffee-script.coffee', 'grammar.coffee'
+ 'helpers.coffee', 'lexer.coffee', 'nodes.coffee'
+ 'rewriter.coffee', 'scope.coffee'
+].map (filename) ->
+ 'src/coffee-script/' + filename
# Run a CoffeeScript through our node/coffee interpreter.
run = (args) ->
@@ -53,7 +54,7 @@ task 'install', 'install CoffeeScript into /usr/local (or --prefix)', (options)
"ln -sfn #{lib}/bin/coffee #{bin}/coffee"
"ln -sfn #{lib}/bin/cake #{bin}/cake"
"mkdir -p ~/.node_libraries"
- "ln -sfn #{lib}/lib #{node}"
+ "ln -sfn #{lib}/lib/coffee-script #{node}"
].join(' && '), (err, stdout, stderr) ->
if err then console.log stderr.trim() else log 'done', green
)
@@ -61,8 +62,7 @@ task 'install', 'install CoffeeScript into /usr/local (or --prefix)', (options)
task 'build', 'build the CoffeeScript language from source', ->
files = fs.readdirSync 'src'
- files = ('src/' + file for file in files when file.match(/\.coffee$/))
- run ['-c', '-o', 'lib'].concat(files)
+ run ['-c', '-o', 'lib', 'src']
task 'build:full', 'rebuild the source twice, and run the tests', ->
@@ -91,7 +91,7 @@ task 'build:browser', 'rebuild the merged script for inclusion in the browser',
code += """
require['./#{name}'] = new function() {
var exports = this;
- #{fs.readFileSync "lib/#{name}.js"}
+ #{fs.readFileSync "lib/coffee-script/#{name}.js"}
};
"""
code = """
@@ -115,7 +115,7 @@ task 'doc:site', 'watch and continually rebuild the documentation for the websit
task 'doc:source', 'rebuild the internal documentation', ->
- exec 'docco src/*.coffee && cp -rf docs documentation && rm -r docs', (err) ->
+ exec 'docco src/coffee-script/*.coffee && cp -rf docs documentation && rm -r docs', (err) ->
throw err if err
@@ -124,7 +124,7 @@ task 'doc:underscore', 'rebuild the Underscore.coffee documentation page', ->
throw err if err
task 'bench', 'quick benchmark of compilation time', ->
- {Rewriter} = require './lib/rewriter'
+ {Rewriter} = require './lib/coffee-script/rewriter'
co = sources.map((name) -> fs.readFileSync name).join '\n'
fmt = (ms) -> " #{bold}#{ " #{ms}".slice -4 }#{reset} ms"
total = 0
View
2  bin/cake
@@ -4,4 +4,4 @@ var path = require('path');
var fs = require('fs');
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
-require(lib + '/cake').run();
+require(lib + '/coffee-script/cake').run();
View
2  bin/coffee
@@ -4,4 +4,4 @@ var path = require('path');
var fs = require('fs');
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
-require(lib + '/command').run();
+require(lib + '/coffee-script/command').run();
View
0  lib/browser.js → lib/coffee-script/browser.js
File renamed without changes
View
0  lib/cake.js → lib/coffee-script/cake.js 100755 → 100644
File renamed without changes
View
0  lib/coffee-script.js → lib/coffee-script/coffee-script.js 100755 → 100644
File renamed without changes
View
0  lib/command.js → lib/coffee-script/command.js
File renamed without changes
View
0  lib/grammar.js → lib/coffee-script/grammar.js
File renamed without changes
View
0  lib/helpers.js → lib/coffee-script/helpers.js
File renamed without changes
View
0  lib/index.js → lib/coffee-script/index.js
File renamed without changes
View
0  lib/lexer.js → lib/coffee-script/lexer.js
File renamed without changes
View
0  lib/nodes.js → lib/coffee-script/nodes.js
File renamed without changes
View
0  lib/optparse.js → lib/coffee-script/optparse.js 100755 → 100644
File renamed without changes
View
0  lib/parser.js → lib/coffee-script/parser.js
File renamed without changes
View
0  lib/repl.js → lib/coffee-script/repl.js
File renamed without changes
View
0  lib/rewriter.js → lib/coffee-script/rewriter.js
File renamed without changes
View
0  lib/scope.js → lib/coffee-script/scope.js
File renamed without changes
View
4 package.json
@@ -12,9 +12,9 @@
"node": ">=0.2.5"
},
"directories" : {
- "lib" : "./lib"
+ "lib" : "./lib/coffee-script"
},
- "main" : "./lib/coffee-script",
+ "main" : "./lib/coffee-script/coffee-script",
"bin": {
"coffee": "./bin/coffee",
"cake": "./bin/cake"
View
0  src/browser.coffee → src/coffee-script/browser.coffee
File renamed without changes
View
0  src/cake.coffee → src/coffee-script/cake.coffee
File renamed without changes
View
0  src/coffee-script.coffee → src/coffee-script/coffee-script.coffee
File renamed without changes
View
0  src/command.coffee → src/coffee-script/command.coffee
File renamed without changes
View
0  src/grammar.coffee → src/coffee-script/grammar.coffee
File renamed without changes
View
0  src/helpers.coffee → src/coffee-script/helpers.coffee
File renamed without changes
View
0  src/index.coffee → src/coffee-script/index.coffee
File renamed without changes
View
0  src/lexer.coffee → src/coffee-script/lexer.coffee
File renamed without changes
View
0  src/nodes.coffee → src/coffee-script/nodes.coffee
File renamed without changes
View
0  src/optparse.coffee → src/coffee-script/optparse.coffee
File renamed without changes
View
0  src/repl.coffee → src/coffee-script/repl.coffee
File renamed without changes
View
0  src/rewriter.coffee → src/coffee-script/rewriter.coffee
File renamed without changes
View
0  src/scope.coffee → src/coffee-script/scope.coffee
File renamed without changes
View
2  test/option_parser.coffee
@@ -5,7 +5,7 @@
# Ensure that the OptionParser handles arguments correctly.
return unless require?
-{OptionParser} = require './../lib/optparse'
+{OptionParser} = require './../lib/coffee-script/optparse'
opt = new OptionParser [
['-r', '--required [DIR]', 'desc required']
Please sign in to comment.
Something went wrong with that request. Please try again.