Skip to content

Commit

Permalink
Merge pull request #18 from uttori/WIP
Browse files Browse the repository at this point in the history
Preview Support
  • Loading branch information
MatthewCallis authored Nov 28, 2021
2 parents e4f33d5 + 1c6e311 commit 8e40e08
Show file tree
Hide file tree
Showing 35 changed files with 13,093 additions and 3,617 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ coverage
site/themes/*
convert
node_modules
types/*
17 changes: 7 additions & 10 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"plugin:node/recommended",
"plugin:optimize-regex/all",
"plugin:ramda/recommended",
"plugin:security/recommended",
"plugin:unicorn/recommended"
"plugin:security/recommended"
],
"plugins": [
"ava",
Expand All @@ -17,7 +16,6 @@
"optimize-regex",
"ramda",
"security",
"unicorn",
"xss"
],
"env": {
Expand Down Expand Up @@ -60,12 +58,11 @@
"optimize-regex/optimize-regex": "warn",
"security/detect-non-literal-fs-filename": 0,
"security/detect-non-literal-require": 0,
"security/detect-object-injection": 0,
"unicorn/catch-error-name": 0,
"unicorn/filename-case": 0,
"unicorn/no-array-for-each": 0,
"unicorn/no-array-reduce": 0,
"unicorn/no-fn-reference-in-iterator": 0,
"unicorn/prevent-abbreviations": 0
"security/detect-object-injection": 0
},
"settings": {
"jsdoc": {
"mode": "typescript"
}
}
}
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cache:
- "$HOME/.npm"

script:
- npm install -g coveralls
- npm run lint
- npm run validate --prod
- npm run test && nyc report --reporter=text-lcov | coveralls
Expand Down
5 changes: 4 additions & 1 deletion .tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"include": [
"node_modules/@uttori/**/src/*",
"src/**/*"
],
"exclude": [
Expand All @@ -8,14 +9,16 @@
],
"compilerOptions": {
"allowJs": true,
"checkJs": false,
"checkJs": true,
"declaration": true,
"downlevelIteration": true,
"emitDeclarationOnly": true,
"extendedDiagnostics": true,
"moduleResolution": "node",
"noEmit": false,
"outFile": "types/index.d.ts",
"removeComments": true,
"sourceMap": true,
"strict": false,
"target": "esnext",
"skipLibCheck": true
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).

## [4.2.0](https://github.com/uttori/uttori-wiki/compare/v4.1.1...v4.2.0) - 2021-11-27

- 🧰 Add Support for previewing content
- 🛠 Use `cors` to help prevent spam
- 🛠 Use `flatMap` rather than `.map().flat()`
- 🎁 Update dev dependencies

## [4.1.1](https://github.com/uttori/uttori-wiki/compare/v4.1.0...v4.1.1) - 2021-01-30

- 🛠 Empty searches were missing the `searchResults` view model key rather than the expected array.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018-2020 Matthew Callis
Copyright (c) 2018-2021 Matthew Callis

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ UttoriWiki is a fast, simple, wiki knowledge base.
* [.save(request, response, next)](#UttoriWiki+save)
* [.new(request, response, next)](#UttoriWiki+new)
* [.detail(request, response, next)](#UttoriWiki+detail)
* [.preview(request, response, next)](#UttoriWiki+preview)
* [.historyIndex(request, response, next)](#UttoriWiki+historyIndex)
* [.historyDetail(request, response, next)](#UttoriWiki+historyDetail)
* [.historyRestore(request, response, next)](#UttoriWiki+historyRestore)
Expand Down Expand Up @@ -638,6 +639,23 @@ Hooks:
| response | <code>Response</code> | The Express Response object. |
| next | <code>function</code> | The Express Next function. |

<a name="UttoriWiki+preview"></a>

### uttoriWiki.preview(request, response, next)
Renders the a preview of the passed in content.
Sets the `X-Robots-Tag` header to `noindex`.

Hooks:
- `render-content` - `render-content` - Passes in the request body content.

**Kind**: instance method of [<code>UttoriWiki</code>](#UttoriWiki)

| Param | Type | Description |
| --- | --- | --- |
| request | <code>Request</code> | The Express Request object. |
| response | <code>Response</code> | The Express Response object. |
| next | <code>function</code> | The Express Next function. |

<a name="UttoriWiki+historyIndex"></a>

### uttoriWiki.historyIndex(request, response, next)
Expand Down
18 changes: 18 additions & 0 deletions docs/wiki.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ UttoriWiki is a fast, simple, wiki knowledge base.
* [.save(request, response, next)](#UttoriWiki+save)
* [.new(request, response, next)](#UttoriWiki+new)
* [.detail(request, response, next)](#UttoriWiki+detail)
* [.preview(request, response, next)](#UttoriWiki+preview)
* [.historyIndex(request, response, next)](#UttoriWiki+historyIndex)
* [.historyDetail(request, response, next)](#UttoriWiki+historyDetail)
* [.historyRestore(request, response, next)](#UttoriWiki+historyRestore)
Expand Down Expand Up @@ -310,6 +311,23 @@ Hooks:
| response | <code>Response</code> | The Express Response object. |
| next | <code>function</code> | The Express Next function. |

<a name="UttoriWiki+preview"></a>

### uttoriWiki.preview(request, response, next)
Renders the a preview of the passed in content.
Sets the `X-Robots-Tag` header to `noindex`.

Hooks:
- `render-content` - `render-content` - Passes in the request body content.

**Kind**: instance method of [<code>UttoriWiki</code>](#UttoriWiki)

| Param | Type | Description |
| --- | --- | --- |
| request | <code>Request</code> | The Express Request object. |
| response | <code>Response</code> | The Express Response object. |
| next | <code>function</code> | The Express Next function. |

<a name="UttoriWiki+historyIndex"></a>

### uttoriWiki.historyIndex(request, response, next)
Expand Down
10 changes: 10 additions & 0 deletions esm/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"parserOptions": {
"sourceType": "module"
},
"settings": {
"jsdoc": {
"mode": "typescript"
}
}
}
1 change: 0 additions & 1 deletion esm/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable node/no-unpublished-import, node/no-unsupported-features/es-syntax, import/extensions */

import UttoriWiki from '../src/wiki.js';

export default UttoriWiki;
Expand Down
Loading

0 comments on commit 8e40e08

Please sign in to comment.