Skip to content

Commit

Permalink
Merge pull request #30 from jeanlescure/fix-typings
Browse files Browse the repository at this point in the history
Fix typings
  • Loading branch information
jeanlescure authored May 21, 2020
2 parents 65693b6 + 194b238 commit e2b89df
Show file tree
Hide file tree
Showing 12 changed files with 224 additions and 22 deletions.
6 changes: 6 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
short_uuid
.gitmodules
*.log
*.tgz
.vscode
.github
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Generate random or sequential UUID of any length.
// Deno (web module) Import
import ShortUniqueId from 'https://cdn.jsdelivr.net/npm/short-unique-id@latest/short_uuid/mod.ts';

// ES6 Import
// ES6 / TypeScript Import
import ShortUniqueId from 'short-unique-id';

//or Node.js require
Expand Down Expand Up @@ -141,6 +141,8 @@ git clone --recurse-submodules [email protected]:jeanlescure/short-unique-id.git
git clone --recurse-submodules https://github.com/jeanlescure/short-unique-id.git
```

All feature development must happen under `./short_uuid/mod.ts`.

Tests run using [Deno](https://deno.land/std/testing/):

```
Expand Down
6 changes: 4 additions & 2 deletions dist/short-unique-id.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ System.register("version", [], function (exports_1, context_1) {
return {
setters: [],
execute: function () {
exports_1("default", "3.0.1");
exports_1("default", "3.0.2");
},
};
});
Expand Down Expand Up @@ -174,8 +174,10 @@ System.register("mod", ["version"], function (exports_2, context_2) {
* ```js
* // Deno (web module) Import
* import ShortUniqueId from 'https://cdn.jsdelivr.net/npm/short-unique-id@latest/short_uuid/mod.ts';
* // ES6 Import
*
* // ES6 / TypeScript Import
* import ShortUniqueId from 'short-unique-id';
*
* //or Node.js require
* const {default: ShortUniqueId} = require('short-unique-id');
*
Expand Down
2 changes: 1 addition & 1 deletion dist/short-unique-id.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions docs/classes/shortuniqueid.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Short Unique ID - Short UUID Generator</title>
<meta name="description" content="Documentation for short-unique-id - v3.0.1">
<meta name="description" content="Documentation for short-unique-id - v3.0.2">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
<script src="https://cdn.jsdelivr.net/npm/short-unique-id@latest/dist/short-unique-id.min.js"></script>
Expand Down Expand Up @@ -33,7 +33,7 @@
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">short-unique-id - v3.0.1</a>
<a href="../index.html" class="title">short-unique-id - v3.0.2</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
Expand Down Expand Up @@ -139,8 +139,10 @@ <h3>Use as module</h3>
</a>
<pre><code class="language-js"><span class="hljs-comment">// Deno (web module) Import</span>
<span class="hljs-keyword">import</span> ShortUniqueId <span class="hljs-keyword">from</span> <span class="hljs-string">'https://cdn.jsdelivr.net/npm/short-unique-id@latest/short_uuid/mod.ts'</span>;
<span class="hljs-comment">// ES6 Import</span>

<span class="hljs-comment">// ES6 / TypeScript Import</span>
<span class="hljs-keyword">import</span> ShortUniqueId <span class="hljs-keyword">from</span> <span class="hljs-string">'short-unique-id'</span>;

<span class="hljs-comment">//or Node.js require</span>
<span class="hljs-keyword">const</span> {<span class="hljs-attr">default</span>: ShortUniqueId} = <span class="hljs-built_in">require</span>(<span class="hljs-string">'short-unique-id'</span>);

Expand Down
8 changes: 4 additions & 4 deletions docs/globals.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Short Unique ID - Short UUID Generator</title>
<meta name="description" content="Documentation for short-unique-id - v3.0.1">
<meta name="description" content="Documentation for short-unique-id - v3.0.2">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="assets/css/main.css">
<script src="https://cdn.jsdelivr.net/npm/short-unique-id@latest/dist/short-unique-id.min.js"></script>
Expand Down Expand Up @@ -33,7 +33,7 @@
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="index.html" class="title">short-unique-id - v3.0.1</a>
<a href="index.html" class="title">short-unique-id - v3.0.2</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
Expand All @@ -58,7 +58,7 @@
<div class="container">
<ul class="tsd-breadcrumb">
</ul>
<h1>short-unique-id - v3.0.1</h1>
<h1>short-unique-id - v3.0.2</h1>
</div>
</div>
</header>
Expand Down Expand Up @@ -118,7 +118,7 @@ <h3>Options</h3>
<div class="lead">
<pre><code class="language-js">{
<span class="hljs-attr">dictionary</span>: [<span class="hljs-string">'z'</span>, <span class="hljs-string">'a'</span>, <span class="hljs-string">'p'</span>, <span class="hljs-string">'h'</span>, <span class="hljs-string">'o'</span>, <span class="hljs-string">'d'</span>, ...],
<span class="hljs-attr">skipShuffle</span>: <span class="hljs-literal">false</span>,
<span class="hljs-attr">shuffle</span>: <span class="hljs-literal">false</span>,
<span class="hljs-attr">debug</span>: <span class="hljs-literal">false</span>,
<span class="hljs-attr">length</span>: <span class="hljs-number">6</span>,
}</code></pre>
Expand Down
9 changes: 5 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Short Unique ID - Short UUID Generator</title>
<meta name="description" content="Documentation for short-unique-id - v3.0.1">
<meta name="description" content="Documentation for short-unique-id - v3.0.2">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="assets/css/main.css">
<script src="https://cdn.jsdelivr.net/npm/short-unique-id@latest/dist/short-unique-id.min.js"></script>
Expand Down Expand Up @@ -33,7 +33,7 @@
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="index.html" class="title">short-unique-id - v3.0.1</a>
<a href="index.html" class="title">short-unique-id - v3.0.2</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
Expand All @@ -58,7 +58,7 @@
<div class="container">
<ul class="tsd-breadcrumb">
</ul>
<h1>short-unique-id - v3.0.1</h1>
<h1>short-unique-id - v3.0.2</h1>
</div>
</div>
</header>
Expand Down Expand Up @@ -180,7 +180,7 @@ <h3>Use as module</h3>
<pre><code class="language-js"><span class="hljs-comment">// Deno (web module) Import</span>
<span class="hljs-keyword">import</span> ShortUniqueId <span class="hljs-keyword">from</span> <span class="hljs-string">'https://cdn.jsdelivr.net/npm/short-unique-id@latest/short_uuid/mod.ts'</span>;

<span class="hljs-comment">// ES6 Import</span>
<span class="hljs-comment">// ES6 / TypeScript Import</span>
<span class="hljs-keyword">import</span> ShortUniqueId <span class="hljs-keyword">from</span> <span class="hljs-string">'short-unique-id'</span>;

<span class="hljs-comment">//or Node.js require</span>
Expand Down Expand Up @@ -284,6 +284,7 @@ <h2>Development</h2>

<span class="hljs-comment"># HTTPS</span>
git <span class="hljs-built_in">clone</span> --recurse-submodules https://github.com/jeanlescure/short-unique-id.git</code></pre>
<p>All feature development must happen under <code>./short_uuid/mod.ts</code>.</p>
<p>Tests run using <a href="https://deno.land/std/testing/">Deno</a>:</p>
<pre><code>yarn <span class="hljs-built_in">test</span></code></pre><p>Using <a href="https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base">airbnb</a> rules for <a href="https://palantir.github.io/tslint/">tslint</a>:</p>
<pre><code><span class="hljs-attribute">yarn lint</span></code></pre>
Expand Down
6 changes: 4 additions & 2 deletions lib/short-unique-id.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ System.register("version", [], function (exports_1, context_1) {
return {
setters: [],
execute: function () {
exports_1("default", "3.0.1");
exports_1("default", "3.0.2");
},
};
});
Expand Down Expand Up @@ -172,8 +172,10 @@ System.register("mod", ["version"], function (exports_2, context_2) {
* ```js
* // Deno (web module) Import
* import ShortUniqueId from 'https://cdn.jsdelivr.net/npm/short-unique-id@latest/short_uuid/mod.ts';
* // ES6 Import
*
* // ES6 / TypeScript Import
* import ShortUniqueId from 'short-unique-id';
*
* //or Node.js require
* const {default: ShortUniqueId} = require('short-unique-id');
*
Expand Down
2 changes: 1 addition & 1 deletion lib/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ System.register("version", [], function (exports_1, context_1) {
return {
setters: [],
execute: function () {
exports_1("default", "3.0.1");
exports_1("default", "3.0.2");
},
};
});
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "short-unique-id",
"version": "3.0.1",
"version": "3.0.2",
"description": "Generate random or sequential UUID of any length",
"keywords": [
"short",
Expand All @@ -14,7 +14,7 @@
"license": "Apache-2.0",
"main": "lib/short-unique-id",
"module": "lib/short-unique-id",
"typings": "short_uuid/mod",
"typings": "typings/short-unique-id",
"homepage": "https://jeanlescure.github.io/short-unique-id/",
"repository": {
"type": "git",
Expand All @@ -24,10 +24,12 @@
"scripts": {
"gen:version": "echo \"export default '`jq -r .version package.json`';\" > short_uuid/version.ts",
"gen:docs": "cd short_uuid && typedoc --gaID UA-159642755-1 --readme ../README.md --theme ../node_modules/short_uuid_typedoc_template/bin/default --out ../docs . && cd .. && cp -r ./assets ./docs && mv ./docs/assets/favicon.ico ./docs/ && echo shortunique.id > ./docs/CNAME",
"gen:typings": "cd short_uuid && ../node_modules/typescript/bin/tsc --declaration --emitDeclarationOnly mod.ts ; mv mod.d.ts ../typings/short-unique-id.d.ts",
"lib:build": "yarn gen:version && rm ./lib/* ; mkdir -p tmp && cd short_uuid && deno bundle mod.ts ../tmp/mod.js && deno bundle version.ts ../tmp/version.js && cd .. && sucrase ./tmp -d ./lib -t imports && mv ./lib/mod.js ./lib/short-unique-id.js && rm -rf ./tmp",
"dist:build": "yarn lib:build && rm ./dist/* ; echo 'var __suid_module = ' > ./dist/short-unique-id.js && browserify ./lib/short-unique-id.js >> ./dist/short-unique-id.js && echo 'var ShortUniqueId = __suid_module(1)[\"default\"];' >> ./dist/short-unique-id.js && minify ./dist/short-unique-id.js > ./dist/short-unique-id.min.js",
"test": "cd short_uuid && deno test && cd .. && yarn link && yarn link short-unique-id && node ./runkit.js",
"lint": "tslint ./short_uuid/*.ts"
"lint": "tslint ./short_uuid/*.ts",
"prepare:release": "yarn gen:typings && yarn lint && yarn lib:build && yarn dist:build && yarn test && yarn gen:docs"
},
"devDependencies": {
"browserify": "^16.5.1",
Expand Down
2 changes: 1 addition & 1 deletion short_uuid
Submodule short_uuid updated 2 files
+4 −2 mod.ts
+1 −1 version.ts
Loading

0 comments on commit e2b89df

Please sign in to comment.