File tree Expand file tree Collapse file tree 4 files changed +21
-7
lines changed Expand file tree Collapse file tree 4 files changed +21
-7
lines changed Original file line number Diff line number Diff line change 11node_modules
22dist
33lib
4+ src /versionInfo.ts
45.idea
Original file line number Diff line number Diff line change 99 " dist"
1010 ],
1111 "scripts" : {
12- "build" : " npm run build-lib && npm run build-types" ,
12+ "build" : " npm run clean && npm run build-version && npm run build-lib && npm run build-types" ,
1313 "build-lib" : " babel src -d lib --source-maps --extensions '.ts,.js'" ,
1414 "build-types" : " tsc --emitDeclarationOnly" ,
15- "postversion" : " git push origin master --follow-tags" ,
16- "prepublishOnly" : " npm run build" ,
15+ "build-version" : " ./timestamp.sh > src/versionInfo.ts && eslint 'src/versionInfo.ts' --fix" ,
16+ "watch" : " npm run build-version && babel src --out-dir lib --watch --source-maps --extensions '.ts,.js'" ,
17+ "clean" : " rm -rf lib" ,
1718 "lint" : " eslint 'src/**/*.js' 'src/**/*.ts'" ,
1819 "lint-fix" : " eslint 'src/**/*.js' 'src/**/*.ts' --fix" ,
1920 "test" : " npm run lint" ,
20- "watch" : " babel src --out-dir lib --watch --source-maps --extensions '.ts,.js'"
21+ "prepublishOnly" : " npm test && npm run build" ,
22+ "postpublish" : " git push origin master --follow-tags"
2123 },
2224 "repository" : {
2325 "type" : " git" ,
7173 },
7274 "husky" : {
7375 "hooks" : {
74- "pre-commit" : " lint-staged"
76+ "pre-commit" : " lint-staged" ,
77+ "pre-push" : " npm test"
7578 }
7679 },
7780 "lint-staged" : {
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ import tabs from './tabs'
7575// @ts -ignore
7676import utils from './utils'
7777import widgets from './widgets'
78+ import versionInfo from './versionInfo'
7879
7980const dom = window ? window . document : null // Idea that UI.dom can be adapted in non-browser environments
8081
@@ -100,7 +101,8 @@ if (typeof window !== 'undefined') {
100101 table,
101102 tabs,
102103 utils,
103- widgets
104+ widgets,
105+ versionInfo
104106 } // Simpler access by non-node scripts
105107}
106108
@@ -125,5 +127,6 @@ export {
125127 table ,
126128 tabs ,
127129 utils ,
128- widgets
130+ widgets ,
131+ versionInfo
129132}
Original file line number Diff line number Diff line change 1+ # Timestamp a git/npm project in node JS
2+ echo " export default {"
3+ date -u ' +buildTime: "%Y-%m-%dT%H:%M:%SZ",'
4+ git log | grep commit | head -1 | sed -e ' s/ /: "/' | sed -e ' s/$/",/'
5+ echo npmInfo:
6+ npm version
7+ echo " };"
You can’t perform that action at this time.
0 commit comments