Skip to content

Commit

Permalink
Merge a2fbfac into 1e24513
Browse files Browse the repository at this point in the history
  • Loading branch information
Himenon committed Oct 26, 2018
2 parents 1e24513 + a2fbfac commit fe7b120
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 1 deletion.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@types/express": "^4.16.0",
"@types/express-session": "^1.15.11",
"@types/html-webpack-plugin": "^3.2.0",
"@types/hyperscript": "^0.0.3",
"@types/jest": "^23.3.5",
"@types/js-yaml": "^3.11.2",
"@types/node": "^10.11.7",
Expand Down Expand Up @@ -77,6 +78,8 @@
"cookie-parser": "^1.4.3",
"express": "^4.16.4",
"express-session": "^1.15.6",
"hast-to-hyperscript": "^5.0.0",
"hyperscript": "^2.0.2",
"mdast-util-to-hast": "^3.0.2",
"portfinder": "^1.0.17",
"react": "^16.5.2",
Expand Down
8 changes: 8 additions & 0 deletions src/hast-to-hyperscript/__tests__/oneshot.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as OneShot from '../oneshot';

describe('hast-to-hyperscript', () => {
test('sample test', () => {
const doc = OneShot.main();
expect(doc).toBe('<p id="alpha" class="bravo">charlie <strong style="color:red;">delta</strong> echo.</p>');
})
})
24 changes: 24 additions & 0 deletions src/hast-to-hyperscript/oneshot.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// @ts-ignore
import * as toH from 'hast-to-hyperscript'
import * as h from 'hyperscript'


export const main = () => {
const tree = {
type: 'element',
tagName: 'p',
properties: {id: 'alpha', className: ['bravo']},
children: [
{type: 'text', value: 'charlie '},
{
type: 'element',
tagName: 'strong',
properties: {style: 'color: red'},
children: [{type: 'text', value: 'delta'}]
},
{type: 'text', value: ' echo.'}
]
}

return toH(h, tree).outerHTML
}
69 changes: 68 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,11 @@
"@types/tapable" "*"
"@types/webpack" "*"

"@types/hyperscript@^0.0.3":
version "0.0.3"
resolved "https://registry.yarnpkg.com/@types/hyperscript/-/hyperscript-0.0.3.tgz#52475f8d9e65a080d463c32c95a78d2d42fd00a6"
integrity sha512-NNbK4Dck3S7ER/7hPq5QFlvrzEgNh+jci9yw84Ii64QJIX5rodtEH+hgxyeJO2bZ56kk5zzd8fQXa+Z9cC9+Og==

"@types/jest@^23.3.5":
version "23.3.5"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-23.3.5.tgz#870a1434208b60603745bfd214fc3fc675142364"
Expand Down Expand Up @@ -1269,6 +1274,11 @@ browser-resolve@^1.11.3:
dependencies:
resolve "1.1.7"

browser-split@0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/browser-split/-/browser-split-0.0.0.tgz#41419caef769755929dd518967d3eec0a6262771"
integrity sha1-QUGcrvdpdVkp3VGJZ9PuwKYmJ3E=

browserify-aes@^1.0.0, browserify-aes@^1.0.4:
version "1.2.0"
resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48"
Expand Down Expand Up @@ -1568,6 +1578,13 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3:
inherits "^2.0.1"
safe-buffer "^5.0.1"

class-list@~0.1.0, class-list@~0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/class-list/-/class-list-0.1.1.tgz#9b9745192c4179b5da0a0d7633658e3c70d796cb"
integrity sha1-m5dFGSxBebXaCg12M2WOPHDXlss=
dependencies:
indexof "0.0.1"

class-utils@^0.3.5:
version "0.3.6"
resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463"
Expand Down Expand Up @@ -1934,6 +1951,16 @@ css-what@2.1:
resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.0.tgz#9467d032c38cfaefb9f2d79501253062f87fa1bd"
integrity sha1-lGfQMsOM+u+58teVASUwYvh/ob0=

css@2.2.4:
version "2.2.4"
resolved "https://registry.yarnpkg.com/css/-/css-2.2.4.tgz#c646755c73971f2bba6a601e2cf2fd71b1298929"
integrity sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw==
dependencies:
inherits "^2.0.3"
source-map "^0.6.1"
source-map-resolve "^0.5.2"
urix "^0.1.0"

cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0":
version "0.3.4"
resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.4.tgz#8cd52e8a3acfd68d3aed38ee0a640177d2f9d797"
Expand Down Expand Up @@ -3147,6 +3174,18 @@ hast-to-hyperscript@^4.0.0:
trim "0.0.1"
unist-util-is "^2.0.0"

hast-to-hyperscript@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/hast-to-hyperscript/-/hast-to-hyperscript-5.0.0.tgz#5106cbba78edb7c95e2e8a49079371eb196c1ced"
integrity sha512-DLl3eYTz8uwwzEubDUdCChsR5t5b2ne+yvHrA2h58Suq/JnN3+Gsb9Tc4iZoCCsykmFUc6UUpwxTmQXs0akSeg==
dependencies:
comma-separated-tokens "^1.0.0"
property-information "^4.0.0"
space-separated-tokens "^1.0.0"
style-to-object "^0.2.1"
unist-util-is "^2.0.0"
web-namespaces "^1.1.2"

hast-util-is-element@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/hast-util-is-element/-/hast-util-is-element-1.0.1.tgz#c76e8aafbdb6e5c83265bf50324e2f2e024eb12a"
Expand Down Expand Up @@ -3212,6 +3251,13 @@ hosted-git-info@^2.1.4:
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047"
integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==

html-element@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/html-element/-/html-element-2.2.0.tgz#c3c1ff88c261db74d0af6391eef90c346f900730"
integrity sha1-w8H/iMJh23TQr2OR7vkMNG+QBzA=
dependencies:
class-list "~0.1.1"

html-encoding-sniffer@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8"
Expand Down Expand Up @@ -3311,6 +3357,15 @@ husky@^1.1.2:
run-node "^1.0.0"
slash "^2.0.0"

hyperscript@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/hyperscript/-/hyperscript-2.0.2.tgz#3839cba45554bdfe27bb81c2142d1684f8135af5"
integrity sha1-ODnLpFVUvf4nu4HCFC0WhPgTWvU=
dependencies:
browser-split "0.0.0"
class-list "~0.1.0"
html-element "^2.0.0"

iconv-lite@0.4.23:
version "0.4.23"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63"
Expand Down Expand Up @@ -6478,7 +6533,7 @@ source-list-map@^2.0.0:
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34"
integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==

source-map-resolve@^0.5.0:
source-map-resolve@^0.5.0, source-map-resolve@^0.5.2:
version "0.5.2"
resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259"
integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==
Expand Down Expand Up @@ -6783,6 +6838,13 @@ strip-json-comments@~2.0.1:
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=

style-to-object@^0.2.1:
version "0.2.2"
resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-0.2.2.tgz#3ea3b276bd3fa9da1195fcdcdd03bc52aa2aae01"
integrity sha512-GcbtvfsqyKmIPpHeOHZ5Rmwsx2MDJct4W9apmTGcbPTbpA2FcgTFl2Z43Hm4Qb61MWGPNK8Chki7ITiY7lLOow==
dependencies:
css "2.2.4"

styled-components@^3.4.10:
version "3.4.10"
resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-3.4.10.tgz#9a654c50ea2b516c36ade57ddcfa296bf85c96e1"
Expand Down Expand Up @@ -7470,6 +7532,11 @@ watchpack@^1.5.0:
graceful-fs "^4.1.2"
neo-async "^2.5.0"

web-namespaces@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.2.tgz#c8dc267ab639505276bae19e129dbd6ae72b22b4"
integrity sha512-II+n2ms4mPxK+RnIxRPOw3zwF2jRscdJIUE9BfkKHm4FYEg9+biIoTMnaZF5MpemE3T+VhMLrhbyD4ilkPCSbg==

webidl-conversions@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
Expand Down

0 comments on commit fe7b120

Please sign in to comment.