Skip to content

Commit

Permalink
updated: Riot utils and fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaGuarini committed Aug 25, 2023
1 parent 5d82f6c commit 1b4e261
Show file tree
Hide file tree
Showing 18 changed files with 124 additions and 124 deletions.
174 changes: 87 additions & 87 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"pretest": "npm run build",
"postest": "npm run cov-html",
"bench": "node benchmarks/index.cjs",
"test": "npm run lint && c8 mocha -r test/index.js test/**/*.spec.js && npm run test-typing",
"test": "npm run lint && c8 mocha -r test/index.js 'test/**/*.spec.js' && npm run test-typing",
"test-typing": "tsc -p test",
"test-debug": "mocha --inspect --inspect-brk -r test/index.js test/**/*.spec.js",
"test-debug": "mocha --inspect --inspect-brk -r test/index.js 'test/**/*.spec.js'",
"prepublishOnly": "npm test"
},
"files": [
Expand Down Expand Up @@ -50,23 +50,23 @@
"homepage": "https://github.com/GianlucaGuarini/dom-bindings#readme",
"devDependencies": {
"@riotjs/prettier-config": "^1.1.0",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-node-resolve": "^15.2.1",
"benchmark": "^2.1.4",
"c8": "^8.0.1",
"chai": "^4.3.7",
"chai": "^4.3.8",
"coveralls": "^3.1.1",
"eslint": "^8.46.0",
"eslint-config-riot": "^4.1.0",
"eslint": "^8.48.0",
"eslint-config-riot": "^4.1.1",
"jsdom": "^22.1.0",
"jsdom-global": "3.0.2",
"mocha": "^10.2.0",
"prettier": "^3.0.0",
"rollup": "^3.27.0",
"prettier": "^3.0.2",
"rollup": "^3.28.1",
"sinon": "^15.2.0",
"sinon-chai": "^3.7.0",
"typescript": "^5.1.6"
"typescript": "^5.2.2"
},
"dependencies": {
"@riotjs/util": "^2.2.1"
"@riotjs/util": "^2.2.2"
}
}
4 changes: 2 additions & 2 deletions src/binding.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SIMPLE } from '@riotjs/util/binding-types.js'
import { TEXT } from '@riotjs/util/expression-types.js'
import { SIMPLE } from '@riotjs/util/binding-types'
import { TEXT } from '@riotjs/util/expression-types'
import bindings from './bindings/index.js'

/**
Expand Down
6 changes: 3 additions & 3 deletions src/bindings/each.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { insertBefore, removeChild } from '@riotjs/util/dom.js'
import { defineProperty } from '@riotjs/util/objects.js'
import { isTemplate } from '@riotjs/util/checks.js'
import { insertBefore, removeChild } from '@riotjs/util/dom'
import { defineProperty } from '@riotjs/util/objects'
import { isTemplate } from '@riotjs/util/checks'
import createTemplateMeta from '../util/create-template-meta.js'
import udomdiff from '../util/udomdiff.js'

Expand Down
2 changes: 1 addition & 1 deletion src/bindings/if.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { insertBefore, removeChild } from '@riotjs/util/dom.js'
import { insertBefore, removeChild } from '@riotjs/util/dom'

/**
* Binding responsible for the `if` directive
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EACH, IF, SIMPLE, SLOT, TAG } from '@riotjs/util/binding-types.js'
import { EACH, IF, SIMPLE, SLOT, TAG } from '@riotjs/util/binding-types'
import EachBinding from './each.js'
import IfBinding from './if.js'
import SimpleBinding from './simple.js'
Expand Down
6 changes: 3 additions & 3 deletions src/bindings/slot.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cleanNode, insertBefore, removeChild } from '@riotjs/util/dom.js'
import { PARENT_KEY_SYMBOL } from '@riotjs/util/constants.js'
import { evaluateAttributeExpressions } from '@riotjs/util/misc.js'
import { cleanNode, insertBefore, removeChild } from '@riotjs/util/dom'
import { PARENT_KEY_SYMBOL } from '@riotjs/util/constants'
import { evaluateAttributeExpressions } from '@riotjs/util/misc'
import template from '../template.js'

function extendParentScope(attributes, scope, parentScope) {
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/tag.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ATTRIBUTE } from '@riotjs/util/expression-types.js'
import { ATTRIBUTE } from '@riotjs/util/expression-types'
import template from '../template.js'

/**
Expand Down
2 changes: 1 addition & 1 deletion src/expression.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EVENT, TEXT } from '@riotjs/util/expression-types.js'
import { EVENT, TEXT } from '@riotjs/util/expression-types'
import expressions from './expressions/index.js'
import { getTextNode } from './expressions/text.js'

Expand Down
4 changes: 2 additions & 2 deletions src/expressions/attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {
isBoolean as checkIfBoolean,
isFunction,
isObject,
} from '@riotjs/util/checks.js'
import { memoize } from '@riotjs/util/misc.js'
} from '@riotjs/util/checks'
import { memoize } from '@riotjs/util/misc'

const ElementProto = typeof Element === 'undefined' ? {} : Element.prototype
const isNativeHtmlProperty = memoize(
Expand Down
2 changes: 1 addition & 1 deletion src/expressions/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ATTRIBUTE, EVENT, TEXT, VALUE } from '@riotjs/util/expression-types.js'
import { ATTRIBUTE, EVENT, TEXT, VALUE } from '@riotjs/util/expression-types'
import attributeExpression from './attribute.js'
import eventExpression from './event.js'
import textExpression from './text.js'
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ export { default as createExpression } from './expression.js'
* Object containing all the binding types
* @type {Object}
*/
export { default as bindingTypes } from '@riotjs/util/binding-types.js'
export { default as bindingTypes } from '@riotjs/util/binding-types'

/**
* Object containing all the expression types
* @type {Object}
*/
export { default as expressionTypes } from '@riotjs/util/expression-types.js'
export { default as expressionTypes } from '@riotjs/util/expression-types'
8 changes: 4 additions & 4 deletions src/template.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { cleanNode, clearChildren, removeChild } from '@riotjs/util/dom.js'
import { IS_PURE_SYMBOL } from '@riotjs/util/constants.js'
import { cleanNode, clearChildren, removeChild } from '@riotjs/util/dom'
import { IS_PURE_SYMBOL } from '@riotjs/util/constants'
import createBinding from './binding.js'
import createDOMTree from './util/create-DOM-tree.js'
import injectDOM from './util/inject-DOM.js'
import { isTemplate } from '@riotjs/util/checks.js'
import { panic } from '@riotjs/util/misc.js'
import { isTemplate } from '@riotjs/util/checks'
import { panic } from '@riotjs/util/misc'

/**
* Create the Template DOM skeleton
Expand Down
2 changes: 1 addition & 1 deletion src/util/create-DOM-tree.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isSvg, isTemplate } from '@riotjs/util/checks.js'
import { isSvg, isTemplate } from '@riotjs/util/checks'

// in this case a simple innerHTML is enough
function createHTMLTree(html, root) {
Expand Down
4 changes: 2 additions & 2 deletions src/util/inject-DOM.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isSvg, isTemplate } from '@riotjs/util/checks.js'
import { moveChildren } from '@riotjs/util/dom.js'
import { isSvg, isTemplate } from '@riotjs/util/checks'
import { moveChildren } from '@riotjs/util/dom'

/**
* Inject the DOM tree into a target node
Expand Down
2 changes: 1 addition & 1 deletion src/util/normalize-string-value.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isNil } from '@riotjs/util/checks.js'
import { isNil } from '@riotjs/util/checks'

/**
* Normalize the user value in order to render a empty string in case of falsy values
Expand Down
2 changes: 1 addition & 1 deletion src/util/udomdiff.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { insertBefore, removeChild, replaceChild } from '@riotjs/util/dom.js'
import { insertBefore, removeChild, replaceChild } from '@riotjs/util/dom'
/* c8 ignore start */
/**
* ISC License
Expand Down
2 changes: 1 addition & 1 deletion test/core.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bindingTypes, expressionTypes, template } from '../src/index'
import { bindingTypes, expressionTypes, template } from '../src/index.js'
import { IS_PURE_SYMBOL } from '@riotjs/util/constants'
import { expect } from 'chai'

Expand Down

0 comments on commit 1b4e261

Please sign in to comment.