Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Commit

Permalink
Update for types.
Browse files Browse the repository at this point in the history
1. Added tsconfig.json to handle NPM script "checkjs": "tsc" options. Simplies the NPM script call.
2. Refactored VNode type definition to optionally be of type {}. This was necessary to enable the return type of the "h" function to be compatible with the return type of JSX type definitions provided by the default 'd.ts' file in projects create with @composi/create-composi-app.
  • Loading branch information
Wobbabits committed Oct 27, 2019
1 parent b7da185 commit a8df4f5
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 7 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# composi/core Changelog

## 2.5.7 (October 27, 2019)

### tsconfig.json, package.json

* Added tsconfig to simplify NPM script `checkjs`. No it is just `"checkjs": "tsc"`

### src/vnode.js

* Modified definition of VNode to optionally be an empty object literal. This was necessary for properly typing or `h`. This change enables `h` working properly with the `JSX d.ts` file provided by the `@composi/create-composi-app` for `JSX` Intellisense in Composi projects.

## 2.5.6 (October 26, 2019)

### src/effects.js, src/union.js
Expand Down
2 changes: 1 addition & 1 deletion dist/composi-core.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/composi-core.mjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@composi/core",
"version": "2.5.6",
"version": "2.5.7",
"description": "A JavaScript library for creating websites, PWAs and hybrid apps.",
"main": "src/index.js",
"module": "dist/composi-core.mjs",
"type": "module",
"scripts": {
"bundle": "rollup -c",
"build": "run-s format lint checkjs bundle gzip gzip-mjs",
"checkjs": "tsc --allowJs --checkJs --noEmit --moduleResolution node --target ES6 src/*.js",
"checkjs": "tsc",
"start": "npm run build",
"gzip": "gzip dist/composi-core.js --output=dist",
"gzip-mjs": "gzip dist/composi-core.mjs --output=dist",
Expand Down
1 change: 0 additions & 1 deletion src/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@
*/
export const batchEffects = (...effects) => (getState, send) =>
effects.map(effect => effect && effect(getState, send))

2 changes: 1 addition & 1 deletion src/vnode.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { EMPTY_OBJECT, EMPTY_ARRAY, TEXT_NODE } from './constants'
/**
* @typedef {string | number | Function} Type
* @typedef {number | string | null} Key
* @typedef {Object.<string, any>} VNode
* @typedef {Object | {}} VNode
* @prop {Type} type
* @prop {Props} props
* @prop {Children} children
Expand Down
12 changes: 12 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "es6",
"allowJs": true,
"checkJs": true,
"noEmit": true,
"moduleResolution": "node",
},
"include": [
"src/*.js",
]
}

0 comments on commit a8df4f5

Please sign in to comment.