Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 cleaning up and syncing with py lib #10

Merged
merged 32 commits into from
May 1, 2016

Commits on Jan 30, 2016

  1. Configuration menu
    Copy the full SHA
    7d4d72a View commit details
    Browse the repository at this point in the history
  2. [#2] Convert to ES6

    vitorbaptista committed Jan 30, 2016
    Configuration menu
    Copy the full SHA
    e22e8e0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0395608 View commit details
    Browse the repository at this point in the history
  4. [#2] Setup Karma to run tests on PhantomJS

    This gives us more confidence that the code runs both on NodeJS an on a browser
    (at least on a WebKit browser).
    vitorbaptista committed Jan 30, 2016
    Configuration menu
    Copy the full SHA
    3dc8f61 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    34c2f2e View commit details
    Browse the repository at this point in the history
  6. [#2] Remove es6-promise

    We're using bluebird instead.
    vitorbaptista committed Jan 30, 2016
    Configuration menu
    Copy the full SHA
    926d53b View commit details
    Browse the repository at this point in the history
  7. [#2] Refactor into class and simplify code

    Apart from the obvious changes (becoming a class and such), the behaviour
    changed in two other places:
    
    * Instead of rejecting with a string, we throw an Error;
    * We don't alter the csv.parse exceptions on error.
    vitorbaptista committed Jan 30, 2016
    Configuration menu
    Copy the full SHA
    8e7c87f View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2016

  1. Configuration menu
    Copy the full SHA
    f12a9fc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d721a7a View commit details
    Browse the repository at this point in the history
  3. Squashed 'lib/schemas/' content from commit 1a06ab0

    git-subtree-dir: lib/schemas
    git-subtree-split: 1a06ab0a6ecab851e18f1a684e7f13a31db28821
    vitorbaptista committed Jan 31, 2016
    Configuration menu
    Copy the full SHA
    37697d6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7b43e8b View commit details
    Browse the repository at this point in the history
  5. [#2] Caches the default registry

    This library needs to work both on the browser and on NodeJS, so we can't rely
    on `fs.readFile`. Here we're using brfs (actually, babel-brfs because we need
    ES6) to embed the default registry and its schemas into the compiled JS file.
    vitorbaptista committed Jan 31, 2016
    Configuration menu
    Copy the full SHA
    d4073c1 View commit details
    Browse the repository at this point in the history
  6. 2 Configuration menu
    Copy the full SHA
    2aedba6 View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2016

  1. Revert "[#2] Caches the default registry"

    Instead of embeding the cache into the JS files, we'll follow the
    datapackage-registry-py pattern and load from the filesystem (when running in
    NodeJS) or not have a cache (when in the browser).
    
    This avoids issues with the schemas using `$ref` to point to other schemas, and
    also will make the JS file smaller.
    
    This reverts commit d4073c1.
    
    Conflicts:
    	lib/index.js
    	test/test.js
    vitorbaptista committed Feb 1, 2016
    Configuration menu
    Copy the full SHA
    aea8609 View commit details
    Browse the repository at this point in the history
  2. [#2] Extract the logic to fetch URL and allow reading local files

    It is also able to read files now. It'll be used when we're building the local
    cache.
    vitorbaptista committed Feb 1, 2016
    Configuration menu
    Copy the full SHA
    ea60aba View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    411a15c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    15345de View commit details
    Browse the repository at this point in the history
  5. [#2] isBrowser() changed to isBrowser variable

    As the check is static, it doesn't need to be a function.
    vitorbaptista committed Feb 1, 2016
    Configuration menu
    Copy the full SHA
    a338f87 View commit details
    Browse the repository at this point in the history
  6. [#2] When in Node, load registry from the local cache by default

    The behaviour in the browser is the same: load the default registry URL.
    vitorbaptista committed Feb 1, 2016
    Configuration menu
    Copy the full SHA
    4589a5c View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    2792420 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    aa21e49 View commit details
    Browse the repository at this point in the history
  9. [#2] Adds .getBasePath() and .getProfile()

    The profile is loaded from the local filesystem (if exists and we're on Node),
    or from its URL. The base path is the Registry's base path in the local
    filesystem, if it was loaded locally.
    
    The base path is needed for loading schemas that use relative `$ref`s.
    vitorbaptista committed Feb 1, 2016
    Configuration menu
    Copy the full SHA
    8864582 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a4d8a0a View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2016

  1. [#2] Compile package to ES5 for NPM

    The ./src folder contains our code (ES6), the ./lib contains it compiled to
    ES5, and the schemas cache was moved from ./lib/schemas to ./schemas.
    
    In our tests, I've prefered to test the compiled ES5, instead of our ES6 code.
    This means that the stacktraces will point to the compiled ES5 code, but if
    they pass, we can be sure that the resulting package works (including the
    compilation process).
    vitorbaptista committed Feb 2, 2016
    1 Configuration menu
    Copy the full SHA
    9300ade View commit details
    Browse the repository at this point in the history
  2. [#9] Remove Bluebird dependency

    We were only using it for the `.promisify()` method. Without it, the bundled
    codebase goes from 546 KB to 398 KB. Still huge.
    vitorbaptista committed Feb 2, 2016
    Configuration menu
    Copy the full SHA
    af9b689 View commit details
    Browse the repository at this point in the history
  3. [#9] Use csv-parse instead of csv

    That's the only thing we're using anyway. This lowers our codebase from 398 KB
    to 381 KB.
    vitorbaptista committed Feb 2, 2016
    Configuration menu
    Copy the full SHA
    f7ac5a5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    db6b585 View commit details
    Browse the repository at this point in the history
  5. [#9] Replace "url" dependency by a RegExp

    The RegExp isn't as good as what's done by URL, and we also consider
    "file://.*" to be a remote URL, but the code went from 378 KB to 335 KB.
    vitorbaptista committed Feb 2, 2016
    Configuration menu
    Copy the full SHA
    ec00a63 View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2016

  1. Configuration menu
    Copy the full SHA
    8b9fee7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f386c2e View commit details
    Browse the repository at this point in the history
  3. [#9] Don't require 'babel-polyfill', leaving that to the user

    When requiring the polyfill, we're polluting the global scope, and making our
    codebase bigger. They're not needed on many newer browsers, which might be all
    that our users need to support. We can't make this decision for them, so we
    better just document it.
    vitorbaptista committed Feb 3, 2016
    Configuration menu
    Copy the full SHA
    07bc7c6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2d14020 View commit details
    Browse the repository at this point in the history