Skip to content

Commit

Permalink
Merge pull request #7 from jdwije/improved-structure
Browse files Browse the repository at this point in the history
Improved structure
  • Loading branch information
jdwije committed Oct 30, 2017
2 parents 70464b0 + 0b60dff commit b2c3540
Show file tree
Hide file tree
Showing 58 changed files with 599 additions and 535 deletions.
50 changes: 49 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,52 @@
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*

# Org-mode
.org-id-locations
*_archive

# flymake-mode
*_flymake.*

# eshell files
/eshell/history
/eshell/lastdir

# elpa packages
/elpa/

# reftex files
*.rel

# AUCTeX auto folder
/auto/

# cask packages
.cask/
dist/

# Flycheck
flycheck_*.el

# server auth directory
/server/

# projectiles files
.projectile

# directory configuration
.dir-locals.el

# The rest...
node_modules
dist/
*log
.DS_Store
.DS_Store
coverage
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ language: node_js

install:
- yarn
- yarn build:source
- yarn build:docs
- yarn build

jobs:
include:
Expand All @@ -14,6 +13,7 @@ jobs:
script:
- yarn lint
- yarn test
- yarn test:dist
- stage: benchmark
node_js:
- "6"
Expand All @@ -28,6 +28,6 @@ jobs:
provider: script
skip_cleanup: true
script:
- npm publish
- ./scripts/release
on:
tags: true
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Re-factored code to typescript.
- use `isPointer` internally now.
- Now exports an optimized `npm pack` with minimal file system foot-print.
- Refactor `typings.d.ts` to `./types/index.ts`, we now compile and package our types.
- Improved package scripts, now cleaner and more verbose.
- Simplify package scripts without losing any functionality.

### Remove
- Object manipulation functionality has been dropped from JST (the `merge`,
Expand All @@ -30,6 +33,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- `dereference` circular schema dereferencing.
- fixed linting
- `lodash` imports, build size reduced.
- benchmark messages returning out of sync with test run.

## [1.0.0] - 2017-06-25

Expand Down
43 changes: 0 additions & 43 deletions benchmarks/benchmark.ts

This file was deleted.

28 changes: 0 additions & 28 deletions benchmarks/dereference-address-schema.benchmark.ts

This file was deleted.

42 changes: 0 additions & 42 deletions benchmarks/dereference-petstore-swagger.benchmark.ts

This file was deleted.

41 changes: 0 additions & 41 deletions benchmarks/dereference-temando-swagger.benchmark.ts

This file was deleted.

4 changes: 0 additions & 4 deletions benchmarks/index.benchmark.ts

This file was deleted.

2 changes: 1 addition & 1 deletion docs/CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
www.jwije.com
www.jwije.com
16 changes: 5 additions & 11 deletions docs/dereference.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,6 @@ <h3>Table of Contents</h3>
</a>
</li>


<li>
<a class="source" href="typings.d.html">
typings.d.ts
</a>
</li>

</ol>
</div>

Expand All @@ -88,7 +81,7 @@ <h2 id="usage">Usage</h2>
<p><strong>Arguments</strong></p>
<ul>
<li><code>subject: Object|number|string|boolean|null</code> A json value.</li>
<li><code>resolve: Jst.Resolver</code> A function to resolve a schema by its id.</li>
<li><code>resolve:</code>Resolver` A function to resolve a schema by its id.</li>
</ul>
<p><strong>Returns</strong></p>
<ul>
Expand All @@ -105,7 +98,8 @@ <h2 id="dependencies">Dependencies</h2>
<span class="hljs-keyword">import</span> * <span class="hljs-keyword">as</span> forIn <span class="hljs-keyword">from</span> <span class="hljs-string">'lodash.forin'</span>;
<span class="hljs-keyword">import</span> * <span class="hljs-keyword">as</span> isObject <span class="hljs-keyword">from</span> <span class="hljs-string">'lodash.isobject'</span>;
<span class="hljs-keyword">import</span> * <span class="hljs-keyword">as</span> merge <span class="hljs-keyword">from</span> <span class="hljs-string">'lodash.merge'</span>;
<span class="hljs-keyword">import</span> { <span class="hljs-keyword">get</span>, isPointer, <span class="hljs-keyword">set</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">'./index'</span>;</pre></div>
<span class="hljs-keyword">import</span> { <span class="hljs-keyword">get</span>, isPointer, <span class="hljs-keyword">set</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">'./index'</span>;
<span class="hljs-keyword">import</span> { Dereferencer, Resolver } <span class="hljs-keyword">from</span> <span class="hljs-string">'./types'</span>;</pre></div>



Expand All @@ -131,7 +125,7 @@ <h2 id="implementation">Implementation</h2>
<span class="hljs-keyword">const</span> isHttp: <span class="hljs-built_in">RegExp</span> = <span class="hljs-regexp">/^http/</span>;
<span class="hljs-keyword">const</span> isRemoteRef = (ref: <span class="hljs-built_in">string</span>): <span class="hljs-function"><span class="hljs-params">boolean</span> =&gt;</span> isHttp.test(ref);

<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> dereference: Jst.dereference = <span class="hljs-function">(<span class="hljs-params">root, resolver</span>) =&gt;</span> {</pre></div>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> dereference: Dereferencer = <span class="hljs-function">(<span class="hljs-params">root, resolver</span>) =&gt;</span> {</pre></div>



Expand Down Expand Up @@ -160,7 +154,7 @@ <h3 id="json-in-json-out">JSON In, JSON Out</h3>
}
<span class="hljs-keyword">const</span> circularRefs = {};

<span class="hljs-keyword">const</span> walk = (schema: <span class="hljs-built_in">any</span>, resolve: Jst.resolve = <span class="hljs-literal">null</span>, path: <span class="hljs-built_in">string</span> = <span class="hljs-string">'#'</span>): <span class="hljs-function"><span class="hljs-params">any</span> =&gt;</span> {</pre></div>
<span class="hljs-keyword">const</span> walk = (schema: <span class="hljs-built_in">any</span>, resolve: Resolver = <span class="hljs-literal">null</span>, path: <span class="hljs-built_in">string</span> = <span class="hljs-string">'#'</span>): <span class="hljs-function"><span class="hljs-params">any</span> =&gt;</span> {</pre></div>



Expand Down
12 changes: 3 additions & 9 deletions docs/get.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,6 @@ <h3>Table of Contents</h3>
</a>
</li>


<li>
<a class="source" href="typings.d.html">
typings.d.ts
</a>
</li>

</ol>
</div>

Expand Down Expand Up @@ -98,7 +91,8 @@ <h2 id="dependencies">Dependencies</h2>

<div class='highlight'><pre>
<span class="hljs-keyword">import</span> * <span class="hljs-keyword">as</span> has <span class="hljs-keyword">from</span> <span class="hljs-string">'lodash.has'</span>;
<span class="hljs-keyword">import</span> { isPointer } <span class="hljs-keyword">from</span> <span class="hljs-string">'./isPointer'</span>;</pre></div>
<span class="hljs-keyword">import</span> { isPointer } <span class="hljs-keyword">from</span> <span class="hljs-string">'./isPointer'</span>;
<span class="hljs-keyword">import</span> { GetPointer } <span class="hljs-keyword">from</span> <span class="hljs-string">'./types'</span>;</pre></div>



Expand All @@ -111,7 +105,7 @@ <h4 id="implementation">Implementation</h4>
<a href="typings.d.html">typings.d.ts</a>.</p>


<div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> <span class="hljs-keyword">get</span>: Jst.getPointer = <span class="hljs-function">(<span class="hljs-params">schema, pointer</span>) =&gt;</span> {</pre></div>
<div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> <span class="hljs-keyword">get</span>: GetPointer = <span class="hljs-function">(<span class="hljs-params">schema, pointer</span>) =&gt;</span> {</pre></div>



Expand Down
7 changes: 0 additions & 7 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@ <h3>Table of Contents</h3>
</a>
</li>


<li>
<a class="source" href="typings.d.html">
typings.d.ts
</a>
</li>

</ol>
</div>

Expand Down
Loading

0 comments on commit b2c3540

Please sign in to comment.