Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AFB9510AC7 for ; Mon, 15 Jul 2013 12:23:05 +0000 (UTC) Received: (qmail 26699 invoked by uid 500); 15 Jul 2013 12:23:04 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 26562 invoked by uid 500); 15 Jul 2013 12:22:59 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 26542 invoked by uid 99); 15 Jul 2013 12:22:58 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jul 2013 12:22:58 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 43EE389D88D; Mon, 15 Jul 2013 12:22:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: garren@apache.org To: commits@couchdb.apache.org Date: Mon, 15 Jul 2013 12:22:58 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/3] Improved development server Updated Branches: refs/heads/master 03d1b7e0c -> 9b64526db http://git-wip-us.apache.org/repos/asf/couchdb/blob/9b64526d/src/fauxton/assets/less/bootstrap/tests/css-tests.css ---------------------------------------------------------------------- diff --git a/src/fauxton/assets/less/bootstrap/tests/css-tests.css b/src/fauxton/assets/less/bootstrap/tests/css-tests.css deleted file mode 100644 index 9edaf69..0000000 --- a/src/fauxton/assets/less/bootstrap/tests/css-tests.css +++ /dev/null @@ -1,139 +0,0 @@ -/*! - * Bootstrap CSS Tests - */ - - -/* Remove background image */ -body { - background-image: none; -} - -/* Space out subhead */ -.subhead { - margin-bottom: 36px; -} -/*h4 { - margin-bottom: 5px; -} -*/ - -.type-test { - margin-bottom: 20px; - padding: 0 20px 20px; - background: url(../../docs/assets/img/grid-baseline-20px.png); -} -.type-test h1, -.type-test h2, -.type-test h3, -.type-test h4, -.type-test h5, -.type-test h6 { - background-color: rgba(255,0,0,.2); -} - - -/* colgroup tests */ -.col1 { - background-color: rgba(255,0,0,.1); -} -.col2 { - background-color: rgba(0,255,0,.1); -} -.col3 { - background-color: rgba(0,0,255,.1); -} - - -/* Fluid row inputs */ -#rowInputs .row > [class*=span], -#fluidRowInputs .row-fluid > [class*=span] { - background-color: rgba(255,0,0,.1); -} - - -/* Fluid grid */ -.fluid-grid { - margin-bottom: 45px; -} -.fluid-grid .row { - height: 40px; - padding-top: 10px; - margin-top: 10px; - color: #ddd; - text-align: center; -} -.fluid-grid .span1 { - background-color: #999; -} - - -/* Gradients */ - -[class^="gradient-"] { - width: 100%; - height: 400px; - margin: 20px 0; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; -} - -.gradient-horizontal { - background-color: #333333; - background-image: -moz-linear-gradient(left, #555555, #333333); - background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#555555), to(#333333)); - background-image: -webkit-linear-gradient(left, #555555, #333333); - background-image: -o-linear-gradient(left, #555555, #333333); - background-image: linear-gradient(to right, #555555, #333333); - background-repeat: repeat-x; - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff555555', endColorstr='#ff333333', GradientType=1); -} - -.gradient-vertical { - background-color: #474747; - background-image: -moz-linear-gradient(top, #555555, #333333); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#333333)); - background-image: -webkit-linear-gradient(top, #555555, #333333); - background-image: -o-linear-gradient(top, #555555, #333333); - background-image: linear-gradient(to bottom, #555555, #333333); - background-repeat: repeat-x; - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff555555', endColorstr='#ff333333', GradientType=0); -} - -.gradient-directional { - background-color: #333333; - background-image: -moz-linear-gradient(45deg, #555555, #333333); - background-image: -webkit-linear-gradient(45deg, #555555, #333333); - background-image: -o-linear-gradient(45deg, #555555, #333333); - background-image: linear-gradient(45deg, #555555, #333333); - background-repeat: repeat-x; -} - -.gradient-vertical-three { - background-color: #8940a5; - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#00b3ee), color-stop(50%, #7a43b6), to(#c3325f)); - background-image: -webkit-linear-gradient(#00b3ee, #7a43b6 50%, #c3325f); - background-image: -moz-linear-gradient(top, #00b3ee, #7a43b6 50%, #c3325f); - background-image: -o-linear-gradient(#00b3ee, #7a43b6 50%, #c3325f); - background-image: linear-gradient(#00b3ee, #7a43b6 50%, #c3325f); - background-repeat: no-repeat; - filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff00b3ee', endColorstr='#ffc3325f', GradientType=0); -} - -.gradient-radial { - background-color: #333333; - background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(#555555), to(#333333)); - background-image: -webkit-radial-gradient(circle, #555555, #333333); - background-image: -moz-radial-gradient(circle, #555555, #333333); - background-image: -o-radial-gradient(circle, #555555, #333333); - background-repeat: no-repeat; -} - -.gradient-striped { - background-color: #555555; - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/couchdb/blob/9b64526d/src/fauxton/assets/less/bootstrap/tests/css-tests.html ---------------------------------------------------------------------- diff --git a/src/fauxton/assets/less/bootstrap/tests/css-tests.html b/src/fauxton/assets/less/bootstrap/tests/css-tests.html deleted file mode 100644 index c0cb148..0000000 --- a/src/fauxton/assets/less/bootstrap/tests/css-tests.html +++ /dev/null @@ -1,1296 +0,0 @@ - - - - - CSS Tests · Twitter Bootstrap - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-

CSS Tests

-

One stop shop for quick debugging and edge-case tests of CSS.

-
-
- - -
- -
- - - - - - - -
-
-
-

h1. Heading 1

-

h2. Heading 2

-

h3. Heading 3

-

h4. Heading 4

-
h5. Heading 5
-
h6. Heading 6
-

Sed posuere consectetur est at lobortis. Maecenas sed diam eget risus varius blandit sit amet non magna. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

-
-
-
-
-

h1. Heading 1

-

Sed posuere consectetur est at lobortis. Maecenas sed diam eget risus varius blandit sit amet non magna. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

-

h2. Heading 2

-

Sed posuere consectetur est at lobortis. Maecenas sed diam eget risus varius blandit sit amet non magna. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

-

h3. Heading 3

-

Sed posuere consectetur est at lobortis. Maecenas sed diam eget risus varius blandit sit amet non magna. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

-

h4. Heading 4

-

Sed posuere consectetur est at lobortis. Maecenas sed diam eget risus varius blandit sit amet non magna. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

-
h5. Heading 5
-

Sed posuere consectetur est at lobortis. Maecenas sed diam eget risus varius blandit sit amet non magna. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

-
h6. Heading 6
-

Sed posuere consectetur est at lobortis. Maecenas sed diam eget risus varius blandit sit amet non magna. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

-
-
-
- - - - - - - -
-
- -
-
- -
-
- -
-
- -
- -
-
- -
-
- -
-
- -
-
- -

- - - - - - - - -
-
-
12 -
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
-
-
11 -
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
1 -
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
-
-
10 -
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
2 -
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
-
-
9 -
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
3 -
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
-
-
8 -
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
4 -
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
-
-
7 -
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
5 -
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
-
-
6 -
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
6 -
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
1
-
-
-
-
- - - - - - - -
-
-

Bordered without thead

- - - - - - - - - - - - - - - - - - -
123
123
123
-

Bordered without thead, with caption

- - - - - - - - - - - - - - - - - - - -
Table caption
123
123
123
-

Bordered without thead, with colgroup

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
123
123
123
369
-

Bordered with thead, with colgroup

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ABC
123
123
123
369
-
-
-

Bordered with thead and caption

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table caption
123
123
123
123
369
-

Bordered with rowspan and colspan

- - - - - - - - - - - - - - - - - - - - - - - - - - -
123
1 and 23
123
13
2 and 3
-
-
- - -

Grid sizing

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
123
1 and 23
123
13
2 and 3
-
-
- -

Fluid grid sizing

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
123
1 and 23
123
13
2 and 3
-
-
- - - - - - - -

Buttons and button groups

-
- - - -
- -

Horizontal form errors

-
-
- -
- - Please correct the error -
-
-
- -
-
-

Prepend and append on inputs

-
-
-
- @ - -
-
-
-
- - @ -
-
-
-
- $ - - .00 -
-
-
-
-
-

Prepend and append with uneditable

-
-
- $ - Some value here -
-
- Some value here - .00 -
-
- $ - Some value here - .00 -
-
-
-
-

Prepend with type="submit"

- -
- - -
-
- - - -
-
-
- -

Fluid prepended and appended inputs

-
-
-
-
-
- @ -
-
-
-
- @ -
-
-
-
- $.00 -
-
-
-
-
- -

Fixed row with inputs

-

Inputs should not extend past the light red background, set on their parent, a .span* column.

- -
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -

Fluid row with inputs

-

Inputs should not extend past the light red background, set on their parent, a .span* column.

-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
- -
- -

Inline form in fluid row

- -
-
-
- - - - -
-
-
- - -
- - -

Fluid textarea at .span12

-
-
- -
-
- - -
- - -

Selects

-
- -
- - -
- - - - - - - - -

Dropdown link with hash URL

- - -

Dropdown link with custom URL and data-target

- - -

Dropdown on a button

- - -
- - - - - - -

Default thumbnails (no grid sizing)

-
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
- - - -

Standard grid sizing

- - -

Fluid thumbnails

-
-
- -
-
- - - - - - - -
- -
-
-

I'm in Section 1.

- -
- -
-
-

I'm in Section 1.1.

-
-
-

I'm in Section 1.2.

-
-
-

I'm in Section 1.3.

-
-
-
-
-
-

Howdy, I'm in Section 2.

-
-
-

What up girl, this is Section 3.

-
-
-
- -
- - - - - - -
-
-

Inline label

-

Cras justo odio, dapibus ac facilisis in, egestas eget quam. Maecenas sed diam Label name eget risus varius blandit sit amet non magna. Fusce .class-name dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

-
-
-
- - Hey! Read this. -
-
-
- - -
-
- -
- - - - - - - - - - - - - -
- Maecenas faucibus mollis interdum. Nulla vitae elit libero, a pharetra augue. Donec ullamcorper nulla non metus auctor fringilla. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. - -
- - - - -
-
- -

Mini buttons: text and icon

-
- - -
- -
- - - - - - - -

Visible on...

-
    -
  • Phone✔ Phone
  • -
  • Tablet✔ Tablet
  • -
  • Desktop✔ Desktop
  • -
-
    -
  • Phone + Tablet✔ Phone + Tablet
  • -
  • Tablet + Desktop✔ Tablet + Desktop
  • -
  • All✔ All
  • -
- -

Hidden on...

-
    -
  • Phone✔ Phone
  • -
  • Tablet✔ Tablet
  • -
  • Desktop✔ Desktop
  • -
-
    -
  • Phone + Tablet✔ Phone + Tablet
  • -
  • Tablet + Desktop✔ Tablet + Desktop
  • -
  • All✔ All
  • -
- - - - - - - -

Horizontal

-
- -

Vertical

-
- -

Directional

-
- -

Three colors

-
- -

Radial

-
- -

Striped

-
- - - - - - - -
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/couchdb/blob/9b64526d/src/fauxton/assets/less/bootstrap/tests/forms-responsive.html ---------------------------------------------------------------------- diff --git a/src/fauxton/assets/less/bootstrap/tests/forms-responsive.html b/src/fauxton/assets/less/bootstrap/tests/forms-responsive.html deleted file mode 100644 index 846d5b4..0000000 --- a/src/fauxton/assets/less/bootstrap/tests/forms-responsive.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - Bootstrap, from Twitter - - - - - - - - - - - - - - - - - - - - - - -
- - - -

Vertical alignment

- - - span1 - -

Width across elements

-
- -
-
- -
-
- span2 -
- - - - -
- - - span1 -
- -
- - - http://git-wip-us.apache.org/repos/asf/couchdb/blob/9b64526d/src/fauxton/assets/less/bootstrap/tests/forms.html ---------------------------------------------------------------------- diff --git a/src/fauxton/assets/less/bootstrap/tests/forms.html b/src/fauxton/assets/less/bootstrap/tests/forms.html deleted file mode 100644 index a63d728..0000000 --- a/src/fauxton/assets/less/bootstrap/tests/forms.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - Bootstrap, from Twitter - - - - - - - - - - - - - - - - - - - - - - -
- - - -
-
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
-
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
-
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
-
- -
- - - http://git-wip-us.apache.org/repos/asf/couchdb/blob/9b64526d/src/fauxton/assets/less/bootstrap/tests/navbar-fixed-top.html ---------------------------------------------------------------------- diff --git a/src/fauxton/assets/less/bootstrap/tests/navbar-fixed-top.html b/src/fauxton/assets/less/bootstrap/tests/navbar-fixed-top.html deleted file mode 100644 index 97b86fd..0000000 --- a/src/fauxton/assets/less/bootstrap/tests/navbar-fixed-top.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - Bootstrap, from Twitter - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-

Navbar example

-

This example is a quick exercise to illustrate how the default, static navbar and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device.

-

- View navbar docs » -

-
- -
- - - - - - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/couchdb/blob/9b64526d/src/fauxton/assets/less/bootstrap/tests/navbar-static-top.html ---------------------------------------------------------------------- diff --git a/src/fauxton/assets/less/bootstrap/tests/navbar-static-top.html b/src/fauxton/assets/less/bootstrap/tests/navbar-static-top.html deleted file mode 100644 index 505ecb6..0000000 --- a/src/fauxton/assets/less/bootstrap/tests/navbar-static-top.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - Bootstrap, from Twitter - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-

Navbar example

-

This example is a quick exercise to illustrate how the default, static navbar and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device.

-

- View navbar docs » -

-
- -
- - - - - - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/couchdb/blob/9b64526d/src/fauxton/assets/less/bootstrap/tests/navbar.html ---------------------------------------------------------------------- diff --git a/src/fauxton/assets/less/bootstrap/tests/navbar.html b/src/fauxton/assets/less/bootstrap/tests/navbar.html deleted file mode 100644 index c72da71..0000000 --- a/src/fauxton/assets/less/bootstrap/tests/navbar.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - Bootstrap, from Twitter - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
-

Navbar example

-

This example is a quick exercise to illustrate how the default, static navbar and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device.

-

- View navbar docs » -

-
- -
- - - - - - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/couchdb/blob/9b64526d/src/fauxton/package.json ---------------------------------------------------------------------- diff --git a/src/fauxton/package.json b/src/fauxton/package.json index 5b63675..ad69f2f 100644 --- a/src/fauxton/package.json +++ b/src/fauxton/package.json @@ -11,21 +11,25 @@ "grunt": "~0.4.1", "grunt-cli": "~0.1.6", "couchapp": "~0.9.1", - "grunt-contrib": "~0.5.0", "grunt-contrib-cssmin": "~0.5.0", + "grunt-contrib-clean": "~0.4.1", + "grunt-contrib-jshint": "~0.6.0", + "grunt-contrib-concat": "~0.3.0", + "grunt-contrib-less": "~0.5.0", + "grunt-contrib-jst": "~0.5.0", + "grunt-contrib-watch": "~0.4.4", "grunt-contrib-uglify": "~0.2.0", + "grunt-contrib-copy": "~0.4.1", "grunt-couchapp": "~0.1.0", "grunt-exec": "~0.4.0", "grunt-init": "~0.2.0", - "grunt-jasmine-task": "~0.2.3", - "grunt-requirejs": "~0.3.3", + "grunt-contrib-requirejs": "~0.4.1", "underscore": "~1.4.2", "url": "~0.7.9", "urls": "~0.0.3", - "express": "~3.0.6", - "http-proxy": "~0.10.2" + "http-proxy": "~0.10.2", + "send": "~0.1.1" }, - "devDependencies": {}, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, http://git-wip-us.apache.org/repos/asf/couchdb/blob/9b64526d/src/fauxton/settings.json.default ---------------------------------------------------------------------- diff --git a/src/fauxton/settings.json.default b/src/fauxton/settings.json.default index 9716ceb..910488b 100644 --- a/src/fauxton/settings.json.default +++ b/src/fauxton/settings.json.default @@ -7,12 +7,23 @@ { "name": "auth" } ], "template": { - "src": "assets/index.underscore", - "dest": "dist/debug/index.html", - "variables": { - "assets_root": "./", - "requirejs": "require.js", - "base": null + "development": { + "src": "assets/index.underscore", + "dest": "dist/debug/index.html", + "variables": { + "requirejs": "/assets/js/libs/require.js", + "css": "./css/index.css", + "base": null + } + }, + "release": { + "src": "assets/index.underscore", + "dest": "dist/debug/index.html", + "variables": { + "requirejs": "./js/require.js", + "css": "./css/index.css", + "base": null + } } }, http://git-wip-us.apache.org/repos/asf/couchdb/blob/9b64526d/src/fauxton/tasks/couchserver.js ---------------------------------------------------------------------- diff --git a/src/fauxton/tasks/couchserver.js b/src/fauxton/tasks/couchserver.js index 0d1dc7a..baf2b30 100644 --- a/src/fauxton/tasks/couchserver.js +++ b/src/fauxton/tasks/couchserver.js @@ -13,17 +13,18 @@ module.exports = function (grunt) { var log = grunt.log; - grunt.registerTask("couchserver", 'Run a couch dev proxy server', function () { + grunt.registerTask("couchserver", 'Run a couch dev proxy server', function () { var fs = require("fs"), - path = require("path"), - httpProxy = require('http-proxy'), - express = require("express"), - options = grunt.config('couchserver'), - app = express(); + path = require("path"), + http = require("http"), + httpProxy = require('http-proxy'), + send = require('send'), + options = grunt.config('couchserver'); // Options - var dist_dir = options.dist || './dist/debug/'; - var port = options.port || 8000; + var dist_dir = options.dist || './dist/debug/', + app_dir = './app', + port = options.port || 8000; // Proxy options with default localhost var proxy_settings = options.proxy || { @@ -37,44 +38,56 @@ module.exports = function (grunt) { // inform grunt that this task is async var done = this.async(); - // serve any javascript or css files from here - app.get(/\.css$|\.js$|img/, function (req, res) { - res.sendfile(path.join(dist_dir,req.url)); - }); - // create proxy to couch for all couch requests var proxy = new httpProxy.HttpProxy(proxy_settings); - // serve main index file from here - // Also proxy out to the base CouchDB host for handle_welcome_req. - // We still need to reach the top level CouchDB host even through - // the proxy. - app.get('/', function (req, res) { - var accept = req.headers.accept.split(','); - if (accept[0] == 'application/json') { - proxy.proxyRequest(req, res); - } else { - res.sendfile(path.join(dist_dir, 'index.html')); - } - }); + http.createServer(function (req, res) { + var url = req.url, + accept = req.headers.accept.split(','), + filePath; + + if (!!url.match(/assets/)) { + // serve any javascript or css files from here assets dir + filePath = path.join('./',req.url); + } else if (!!url.match(/\.css|img/)) { + filePath = path.join(dist_dir,req.url); + } else if (!!url.match(/\/js/)) { + // serve any javascript or files from dist debug dir + filePath = path.join(dist_dir,req.url); + } else if (!!url.match(/\.js$|\.html$/)) { + // server js from app directory + filePath = path.join(app_dir,req.url.replace('/_utils/fauxton/app','')); + } else if (url === '/' && accept[0] !== 'application/json') { + // serve main index file from here + filePath = path.join(dist_dir, 'index.html'); + }; + + if (filePath) { + return send(req, filePath) + .on('error', function (err) { + if (err.status === 404) { + log.writeln('Could not locate', filePath); + } else { + log.writeln('ERROR', filePath, err); + } + }) + .pipe(res); + } - app.all('*', function (req, res) { proxy.proxyRequest(req, res); - }); + }).listen(port); // Fail this task if any errors have been logged if (grunt.errors) { return false; } - var watch = grunt.util.spawn({cmd: 'bbb', grunt: true, args: ['watch']}, function (error, result, code) {/* log.writeln(String(result));*/ }); + var watch = grunt.util.spawn({cmd: 'grunt', grunt: true, args: ['watch']}, function (error, result, code) {/* log.writeln(String(result));*/ }); watch.stdout.pipe(process.stdout); watch.stderr.pipe(process.stderr); log.writeln('Listening on ' + port); - app.listen(port); - }); }; http://git-wip-us.apache.org/repos/asf/couchdb/blob/9b64526d/src/fauxton/tasks/fauxton.js ---------------------------------------------------------------------- diff --git a/src/fauxton/tasks/fauxton.js b/src/fauxton/tasks/fauxton.js index a26f9f8..ac48cf3 100644 --- a/src/fauxton/tasks/fauxton.js +++ b/src/fauxton/tasks/fauxton.js @@ -20,7 +20,7 @@ module.exports = function(grunt) { grunt.file.write(data.dest, tmpl(data.variables)); }); - grunt.registerMultiTask('get_deps', 'Fetch external dependencies', function() { + grunt.registerMultiTask('get_deps', 'Fetch external dependencies', function(version) { grunt.log.writeln("Fetching external dependencies"); var path = require('path'); http://git-wip-us.apache.org/repos/asf/couchdb/blob/9b64526d/src/fauxton/tasks/helper.js ---------------------------------------------------------------------- diff --git a/src/fauxton/tasks/helper.js b/src/fauxton/tasks/helper.js index a7eddbf..b3a9fbd 100644 --- a/src/fauxton/tasks/helper.js +++ b/src/fauxton/tasks/helper.js @@ -31,10 +31,12 @@ exports.init = function(grunt) { this.readSettingsFile().deps.forEach(callback); }, - watchFiles: function (defaults) { + watchFiles: function (fileExtensions, defaults) { return _.reduce(this.readSettingsFile().deps, function (files, dep) { if (dep.path) { - files.push(path.join(dep.path, '**/*')); + _.each(fileExtensions, function (fileExtension) { + files.push(path.join(dep.path, '**/*' + fileExtension )); + }); } return files }, defaults);