Permalink
Browse files

First test committed.

  • Loading branch information...
jrburke committed Jun 22, 2012
1 parent 80543b8 commit f1505ee202ce30e169288cc133e14a7f3b4abbca
Showing with 2,237 additions and 2 deletions.
  1. +58 −0 LICENSE
  2. +26 −2 README.md
  3. +4 −0 tests/case/CamelCase.js
  4. +19 −0 tests/case/case.html
  5. +11 −0 tests/case/main.js
  6. +3 −0 tests/case/other/camelCase.js
  7. +2,037 −0 tests/require.js
  8. +79 −0 xrayquire.js
View
58 LICENSE
@@ -0,0 +1,58 @@
+xrayquire is released under two licenses: new BSD, and MIT. You may pick the
+license that best suits your development needs. The text of both licenses are
+provided below.
+
+
+The "New" BSD License:
+----------------------
+
+Copyright (c) 2012, The Dojo Foundation
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of the Dojo Foundation nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+MIT License
+-----------
+
+Copyright (c) 2012, The Dojo Foundation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
View
@@ -1,4 +1,28 @@
-Just a placeholder for now. The issue tracker will be used to track items to consider for it.
+# xrayrequire
-The idea is for it to be a helper script that plugs into the requirejs internals to give information on what is going on, and hopefully some pointers on possible errors.
+An introspection tool for RequireJS. It dives into the the internals of
+RequireJS to show you information on the modules you load and flags some
+potential problems.
+This is still under development. See the
+[issues area](https://github.com/requirejs/xrayquire/issues) for the features
+that it may support in the future.
+
+See the tests directory for examples of the items xrayrequire checks.
+
+## Usage
+
+Place it as a script tag right after require.js:
+
+```html
+<script src="require.js"></script>
+<script src="xrayrequire.js"></script>
+```
+
+## Error checks
+
+### Case insensitive ID collisions
+
+Checks for module IDs that differ only by case, which indicates a probable
+typing error, or something that will lead to problems on case insensitive
+operating systems.
View
@@ -0,0 +1,4 @@
+define({
+ name: 'CamelCase'
+});
+
View
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Case-insensitive test</title>
+ <script data-main="main" src="../require.js"></script>
+ <script src="../../xrayquire"></script>
+</head>
+<body>
+ <h1>Case-insensitive test</h1>
+
+ <p>Tests if there are module IDs that only differ in
+ string case. May indicate a typo or a problem that
+ will show up when moving to a case-insensitive file
+ system.</p>
+
+ <p>In the console, there should be an error printed about
+ a case issue.</p>
+</body>
+</html>
View
@@ -0,0 +1,11 @@
+requirejs.config({
+ paths: {
+ 'camelCase': 'other/camelCase'
+ }
+});
+
+require(['CamelCase', 'camelCase'], function (CamelCase, camelCase) {
+ console.log(CamelCase);
+ console.log(camelCase);
+});
+
@@ -0,0 +1,3 @@
+define({
+ name: 'cameCase'
+});
Oops, something went wrong.

0 comments on commit f1505ee

Please sign in to comment.