Permalink
Browse files

Version 2.0 checkpoint

  • Loading branch information...
1 parent 852133c commit 097cad001f32d2120512f8739c37603bbae4bd2a @mcavage mcavage committed May 3, 2012
Showing with 3,369 additions and 2,925 deletions.
  1. +1 −1 .dir-locals.el
  2. +0 −3 .gitmodules
  3. +38 −19 Makefile
  4. +0 −55 Makefile.deps
  5. +154 −153 bin/report-latency
  6. +0 −1 deps/cutarelease
  7. +94 −0 lib/args.js
  8. +245 −250 lib/clients/http_client.js
  9. +42 −51 lib/clients/json_client.js
  10. +93 −112 lib/clients/string_client.js
  11. +79 −0 lib/dtrace.js
  12. +70 −59 lib/errors/http_error.js
  13. +2 −2 lib/errors/index.js
  14. +42 −40 lib/errors/rest_error.js
  15. +17 −0 lib/formatters/binary.js
  16. +31 −0 lib/formatters/index.js
  17. +35 −0 lib/formatters/json.js
  18. +21 −0 lib/formatters/text.js
  19. +61 −0 lib/http_date.js
  20. +130 −133 lib/index.js
  21. +18 −18 lib/plugins/accept.js
  22. +70 −68 lib/plugins/audit.js
  23. +81 −73 lib/plugins/authorization.js
  24. +32 −18 lib/plugins/body_parser.js
  25. +14 −0 lib/plugins/bunyan.js
  26. +134 −77 lib/plugins/conditional_request.js
  27. +44 −23 lib/plugins/date.js
  28. +72 −54 lib/plugins/form_body_parser.js
  29. +110 −0 lib/plugins/full_response.js
  30. +31 −6 lib/plugins/index.js
  31. +78 −60 lib/plugins/json_body_parser.js
  32. +35 −36 lib/plugins/multipart_parser.js
  33. +41 −0 lib/plugins/pre/pre_path.js
  34. +28 −25 lib/plugins/query.js
  35. +109 −117 lib/plugins/throttle.js
  36. +197 −135 lib/request.js
  37. +162 −404 lib/response.js
  38. +0 −419 lib/route.js
  39. +269 −0 lib/router.js
  40. +436 −431 lib/server.js
  41. +58 −58 package.json
  42. +1 −2 tools/jsl.node.conf
  43. +2 −2 tools/jsstyle.conf
  44. +40 −0 tools/mk/Makefile.defs
  45. +39 −0 tools/mk/Makefile.deps
  46. +113 −20 { → tools/mk}/Makefile.targ
View
@@ -1,6 +1,6 @@
((nil . ((indent-tabs-mode . nil)
(tab-width . 8)
(fill-column . 80)))
- (js-mode . ((js-indent-level . 2)
+ (js-mode . ((js-indent-level . 8)
(indent-tabs-mode . nil)
)))
View
@@ -7,6 +7,3 @@
[submodule "deps/jsstyle"]
path = deps/jsstyle
url = git://github.com/davepacheco/jsstyle.git
-[submodule "deps/cutarelease"]
- path = deps/cutarelease
- url = git://github.com/trentm/cutarelease.git
View
@@ -1,47 +1,66 @@
#
# Copyright (c) 2012, Joyent, Inc. All rights reserved.
#
-# Makefile: basic Makefile for restify
+# Makefile: basic Makefile for template API service
+#
+# This Makefile is a template for new repos. It contains only repo-specific
+# logic and uses included makefiles to supply common targets (javascriptlint,
+# jsstyle, restdown, etc.), which are used by other repos as well. You may well
+# need to rewrite most of this file, but you shouldn't need to touch the
+# included makefiles.
+#
+# If you find yourself adding support for new targets that could be useful for
+# other projects too, you should add these to the original versions of the
+# included Makefiles (in eng.git) so that other teams can use them too.
#
#
# Tools
#
-NPM := $(shell which npm)
-TAP := ./node_modules/.bin/tap
+NODEUNIT := ./node_modules/.bin/nodeunit
+NODECOVER := ./node_modules/.bin/cover
+BUNYAN := ./node_modules/.bin/bunyan
+NPM := npm
#
# Files
#
-DOC_FILES = index.restdown
-JS_FILES := $(shell find lib test -name '*.js')
+DOC_FILES = index.md
+JS_FILES := $(shell find lib test bin -name '*.js')
JSL_CONF_NODE = tools/jsl.node.conf
JSL_FILES_NODE = $(JS_FILES)
JSSTYLE_FILES = $(JS_FILES)
JSSTYLE_FLAGS = -f tools/jsstyle.conf
+SHRINKWRAP = npm-shrinkwrap.json
+
+CLEAN_FILES += node_modules $(SHRINKWRAP) cscope.files
+
+include ./tools/mk/Makefile.defs
#
# Repo-specific targets
#
.PHONY: all
-all: test check
+all: $(NODEUNIT) $(REPO_DEPS)
+ $(NPM) rebuild
-.PHONY: release
-release: prepush $(CUTARELEASE)
- python $(CUTARELEASE) -f package.json
+$(NODEUNIT): | $(NPM_EXEC)
+ $(NPM) install
-.PHONY: setup
-setup: $(NPM)
+$(NODECOVER): | $(NPM_EXEC)
$(NPM) install
-.PHONY: test
-test: setup $(TAP)
- $(TAP) test/*.test.js
+.PHONY: cover
+cover: $(NODECOVER)
+ @rm -fr ./.coverage_data
+ LOG_LEVEL=trace $(NODECOVER) run $(NODEUNIT) test/*.test.js | $(BUNYAN)
+ $(NODECOVER) report html
-.PHONY: cutarelease
-cutarelease:
- ./deps/cutarelease/cutarelease.py -v -p restify -f package.json
+CLEAN_FILES += $(TAP) ./node_modules/nodeunit
+.PHONY: test
+test: $(NODEUNIT)
+ $(NODEUNIT) test/*.test.js | $(BUNYAN)
-include ./Makefile.deps
-include ./Makefile.targ
+include ./tools/mk/Makefile.deps
+include ./tools/mk/Makefile.targ
View
@@ -1,55 +0,0 @@
-#
-# Copyright (c) 2012, Joyent, Inc. All rights reserved.
-#
-# Makefile.deps: Makefile for including common tools as dependencies
-#
-
-#
-# javascriptlint
-#
-JSL_SCRIPT = deps/javascriptlint/build/install/jsl
-JSL = python2.6 $(JSL_SCRIPT)
-
-$(JSL_SCRIPT): | deps/javascriptlint/.git
- cd deps/javascriptlint && make install
-
-deps/javascriptlint/.git:
- git submodule update --init deps/javascriptlint
-
-#
-# jsstyle
-#
-JSSTYLE_SCRIPT = deps/jsstyle/jsstyle
-JSSTYLE = $(JSSTYLE_SCRIPT)
-
-deps/jsstyle/jsstyle:
- git submodule update --init deps/jsstyle
-
-#
-# cutarelease
-#
-CUTARELEASE_SCRIPT = deps/cutarelease/cutarelease.py
-CUTARELEASE = $(CUTARELEASE_SCRIPT)
-
-deps/cutarelease/curarelease.py:
- git submodule update --init deps/cutarelease
-
-#
-# restdown
-#
-RESTDOWN = python2.6 deps/restdown/bin/restdown
-
-$(RESTDOWN): | deps/restdown/.git
-
-deps/restdown/.git:
- git submodule update --init deps/restdown
-
-#
-# The restdown submodule should be updated before we build "docs".
-#
-docs: $(RESTDOWN)
-
-#
-# JSL and JSSTYLE must be around before we build "check".
-#
-check: $(JSL_SCRIPT) $(JSSTYLE)
Oops, something went wrong.

0 comments on commit 097cad0

Please sign in to comment.