From 7fedc79ac8fda4bfd1c566c7f05ef4ac13b2db48 Mon Sep 17 00:00:00 2001 From: Christoph Tavan Date: Mon, 17 Feb 2020 21:27:51 +0100 Subject: [PATCH] fix: add deep-require proxies for local testing and adjust tests (#365) * fix: add deep-require proxies for local testing In the examples we reference the .local/ directory as local module. It should match the structure * docs: remove deprecated deep requires from examples --- .local/v1.js | 1 + .local/v3.js | 1 + .local/v4.js | 1 + .local/v5.js | 1 + examples/node-commonjs/example.js | 8 ++++---- 5 files changed, 8 insertions(+), 4 deletions(-) create mode 120000 .local/v1.js create mode 120000 .local/v3.js create mode 120000 .local/v4.js create mode 120000 .local/v5.js diff --git a/.local/v1.js b/.local/v1.js new file mode 120000 index 00000000..51d4e8f1 --- /dev/null +++ b/.local/v1.js @@ -0,0 +1 @@ +../v1.js \ No newline at end of file diff --git a/.local/v3.js b/.local/v3.js new file mode 120000 index 00000000..d2b6a878 --- /dev/null +++ b/.local/v3.js @@ -0,0 +1 @@ +../v3.js \ No newline at end of file diff --git a/.local/v4.js b/.local/v4.js new file mode 120000 index 00000000..a3f1eb9f --- /dev/null +++ b/.local/v4.js @@ -0,0 +1 @@ +../v4.js \ No newline at end of file diff --git a/.local/v5.js b/.local/v5.js new file mode 120000 index 00000000..bdc91677 --- /dev/null +++ b/.local/v5.js @@ -0,0 +1 @@ +../v5.js \ No newline at end of file diff --git a/examples/node-commonjs/example.js b/examples/node-commonjs/example.js index e3801a03..6d6fd81a 100644 --- a/examples/node-commonjs/example.js +++ b/examples/node-commonjs/example.js @@ -1,10 +1,10 @@ -const uuidv1 = require('uuid/v1'); +const { v1: uuidv1 } = require('uuid'); console.log('uuidv1()', uuidv1()); -const uuidv4 = require('uuid/v4'); +const { v4: uuidv4 } = require('uuid'); console.log('uuidv4()', uuidv4()); -const uuidv3 = require('uuid/v3'); +const { v3: uuidv3 } = require('uuid'); // ... using predefined DNS namespace (for domain names) console.log('uuidv3() DNS', uuidv3('hello.example.com', uuidv3.DNS)); @@ -19,7 +19,7 @@ console.log('uuidv3() URL', uuidv3('http://example.com/hello', uuidv3.URL)); const MY_NAMESPACE = '55238d15-c926-4598-b49d-cf4e913ba13c'; console.log('uuidv3() MY_NAMESPACE', uuidv3('Hello, World!', MY_NAMESPACE)); -const uuidv5 = require('uuid/v5'); +const { v5: uuidv5 } = require('uuid'); // ... using predefined DNS namespace (for domain names) console.log('uuidv5() DNS', uuidv5('hello.example.com', uuidv5.DNS));