Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
dist
lib
src/versionInfo.ts
.idea
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
"dist"
],
"scripts": {
"build": "npm run build-lib && npm run build-types",
"build": "npm run clean && npm run build-version && npm run build-lib && npm run build-types",
"build-lib": "babel src -d lib --source-maps --extensions '.ts,.js'",
"build-types": "tsc --emitDeclarationOnly",
"postversion": "git push origin master --follow-tags",
"prepublishOnly": "npm run build",
"build-version": "./timestamp.sh > src/versionInfo.ts && eslint 'src/versionInfo.ts' --fix",
"watch": "npm run build-version && babel src --out-dir lib --watch --source-maps --extensions '.ts,.js'",
"clean": "rm -rf lib",
"lint": "eslint 'src/**/*.js' 'src/**/*.ts'",
"lint-fix": "eslint 'src/**/*.js' 'src/**/*.ts' --fix",
"test": "npm run lint",
"watch": "babel src --out-dir lib --watch --source-maps --extensions '.ts,.js'"
"prepublishOnly": "npm test && npm run build",
"postpublish": "git push origin master --follow-tags"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -71,7 +73,8 @@
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
"pre-commit": "lint-staged",
"pre-push": "npm test"
}
},
"lint-staged": {
Expand Down
7 changes: 5 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ import tabs from './tabs'
// @ts-ignore
import utils from './utils'
import widgets from './widgets'
import versionInfo from './versionInfo'

const dom = window ? window.document : null // Idea that UI.dom can be adapted in non-browser environments

Expand All @@ -100,7 +101,8 @@ if (typeof window !== 'undefined') {
table,
tabs,
utils,
widgets
widgets,
versionInfo
} // Simpler access by non-node scripts
}

Expand All @@ -125,5 +127,6 @@ export {
table,
tabs,
utils,
widgets
widgets,
versionInfo
}
7 changes: 7 additions & 0 deletions timestamp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Timestamp a git/npm project in node JS
echo "export default {"
date -u '+buildTime: "%Y-%m-%dT%H:%M:%SZ",'
git log | grep commit | head -1 | sed -e 's/ /: "/' | sed -e 's/$/",/'
echo npmInfo:
npm version
echo "};"