Giter Site home page Giter Site logo

requirejs-library-skeleton's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

requirejs-library-skeleton's Issues

r.js build error

I'm getting an error running the build:

$ node vendor/r.js -o build.js

Error: Missing either a "name", "include" or "modules" option
at Function.build.createConfig (c:\Users\dcarte10\Dev\Libraries\requirejs-library-skeleton\vendor\r.js:14901:19)

Any ideas why this is happening?

failing spec - coffeescript should be automatically transpiled

fantastic project....I've been struggling trying to get coffeescript / require.js / and jasmine to work together...this seems the cleanest solution I've seen so far--Thanks for putting this together!....I am however getting a failing spec in cs.js and I'm not really sure what kicks off the coffeescript compiler....Did I miss a step somewhere?...

full error: TypeError: Property 'coffeescript' of object # is not a function
at null. (file://localhost/Users/carloman/Documents/workspace/jasmine-require-skeleton/test/spec/cs.js:8:23)

Configure skeleton with jquery

I am new to grunt and requirejs. I change build.js and add jquery to path:

  paths: {
       "cs": "../vendor/cs",
       "coffee-script": "../vendor/coffee-script",
       "spec": "../test/spec",
       "jquery": "../vendor/jquery"
   },

add jquery.js to vendor/jquery.js

change lib/skeleton.js to
define(['require', 'jquery'], function (require, $) {

However, I got this following error when run 'grunt'.

      $ grunt
         Running "jasmine:all" (jasmine) task
         Running specs for runner.html

         <WARN> PhantomJS timed out, possibly due to an unfinished async spec. Use --force to continue. </WARN>

         Aborted due to warnings.

What can I fix this to have jquery dependency?

Blanket.js Support

Trying to figure out how to integrate blanket.js with this. Might be a good addition to the project. If you have any pointers, I'm all ears.

Human Testing Question

I have implemented this project for a backbone project we are working on. It took a bit of work, but it has been a great tool in getting our tests to be localized to the module and view level. We are working to get our QA team to learn and think in terms of moving some of the selenium tests into this approach.

I would like to be able to have the jasmine test report open a dom page show the rendered HTML for a given test. Since we have broken our bb app into modules that contain their own views, we (potentially) could allow our team to run the test suite and play with the tested code in the browser. Is this an approach you have seen or used?

Proper way to load dependencies

I am looking for the right way to load dependencies e.g. jquery or backbone for inline.html and amd.html demos.

I worry about double loading of my dependencies e.g. my library and project which will use my lib both depend on backbonejs. How to manage such situations?

Jamine Runs duplicate spec calls

It is expected behavior that the current spec would run each spec test twice? There are only five actual specifc describe/it calls.

skeleton : should be accessible...OK
skeleton : should be accessible...OK
skeleton : should return a VERSION...OK
skeleton : should return a VERSION...OK
module : should have a method...OK
module : should have a method...OK
module : the method should work...OK
module : the method should work...OK
feature : should be working...OK
feature : should be working...OK

10 assertions passed in 10 specs (35ms)

Configure require.js to load vendor libraries without `vendor/` prefix

Thanks for putting this together, it's a convenient reference. When building a library that requires third-party code (e.g., jquery), the temptation is to download the requirements into the vendor directory, and load them with: define(['vendor/jquery']). The trouble with this is that any other module that requires simply jquery will cause jquery to be loaded twice or referred to by two different module ids.

Alternatively, you can configure the require.js baseUrl like so:

<script>
  var require = {
    baseUrl: "../vendor",
    paths: {
      "skeleton": "../lib/skeleton",
      "cs": "../vendor/cs",
      "coffee-script": "../vendor/coffee-script"
    }
  }
</script>

so that modules (yours and third-party code) can simply: define(['jquery']). I'm curious if that's a good approach, and if so, if you would make this change in the test runners and the AMD demo harness?

add built files to repository?

that way users don't need to run the build locally to see how the output looks like and can just grab the files from the repository.

many users might not have node.js installed and/or don't know how to do it, so it's always a good idea to keep the deploy files on the project repository or provide a link where they can download the latest build.

Jasmine executes before specs are loaded

Just a heads up that Jasmine is executing before the specs have finished loading. I modified runner-node to fix this with the following code:

var specs = fs.readdirSync(__dirname + '/spec').map(function(spec) {
  return "" + __dirname + "/spec/" + spec;
});

requirejs(specs, function() {
  jasmine.getEnv().addReporter(new jasmine_console());
  jasmine.getEnv().execute();
});

If I have some time I'll submit a PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.