diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-01-28 18:48:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-28 18:48:37 +0100 |
commit | 3cf1e858dfad1d8f3ba7079e7e0b249c1cdfd5f5 (patch) | |
tree | 2e6cfbdbc7b2de3574c6ec35bbd3c88ef116f786 | |
parent | fc0089b31bd632451786b743df35f51c8ddba07a (diff) | |
download | kronika-3cf1e858dfad1d8f3ba7079e7e0b249c1cdfd5f5.tar.gz kronika-3cf1e858dfad1d8f3ba7079e7e0b249c1cdfd5f5.zip |
Add api building (#5)
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | test/build.js | 5 | ||||
-rw-r--r-- | test/check.js | 10 | ||||
-rw-r--r-- | test/package.json | 3 |
4 files changed, 13 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore index 77038aa..f5c3e7a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store +api # testing node_modules diff --git a/test/build.js b/test/build.js new file mode 100644 index 0000000..c5b6e8c --- /dev/null +++ b/test/build.js @@ -0,0 +1,5 @@ +import Kronikarz from 'kronikarz'; + +const k = new Kronikarz('../wpisy'); + +k.generateApi('../api'); diff --git a/test/check.js b/test/check.js index 5bae1f5..12ed637 100644 --- a/test/check.js +++ b/test/check.js @@ -1,11 +1,11 @@ -import readline from "readline"; -import { parsePost } from "kronikarz/dist/parsePost"; +import readline from 'readline'; +import Post from 'kronikarz/dist/Post'; const rl = readline.createInterface({ input: process.stdin, - output: process.stdout + output: process.stdout, }); -rl.question("", filePath => { - parsePost(filePath); +rl.question('', (filePath) => { + new Post(filePath); }); diff --git a/test/package.json b/test/package.json index f78dd9d..52960ed 100644 --- a/test/package.json +++ b/test/package.json @@ -5,9 +5,10 @@ "main": "check.js", "dependencies": { "esm": "^3.2.25", - "kronikarz": "^1.0.0" + "kronikarz": "^2.0.0" }, "scripts": { + "build": "mkdir -p ../api/api && touch ../api/api/posts.json && node -r esm build.js", "test": "./validator.sh" }, "keywords": [], |