Skip to content

Commit

Permalink
updated build script and added compiled code into package
Browse files Browse the repository at this point in the history
  • Loading branch information
nimjetushar committed Jul 8, 2020
1 parent 3d43a17 commit 783ab2c
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 12 deletions.
21 changes: 21 additions & 0 deletions build/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Tushar Nimje

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
31 changes: 31 additions & 0 deletions build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Utils

[![Build Status](https://semaphoreci.com/api/v1/nimjetushar/utils/branches/master/shields_badge.svg)](https://semaphoreci.com/nimjetushar/utils)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/86a61b646ab041c0b64e502b3d8be7a7)](https://www.codacy.com/app/tushar/Utils?utm_source=github.com&utm_medium=referral&utm_content=nimjetushar/Utils&utm_campaign=Badge_Grade)
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/86a61b646ab041c0b64e502b3d8be7a7)](https://www.codacy.com/app/tushar/Utils?utm_source=github.com&utm_medium=referral&utm_content=nimjetushar/Utils&utm_campaign=Badge_Coverage)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=nimjetushar/Utils)](https://dependabot.com)
</br>
![GitHub pull requests](https://img.shields.io/github/issues-pr/nimjetushar/Utils.svg)

## This utility provides basic utility functions which are mainly used in day to day coding and not ment perform various utility operations which are handled by other utility lib.

## Getting started:

`npm i tutility --save`

Import the js and start working. <br>
When working with IE or older browser version which does not support es6 syntax then library needs to be included in compilation to get it compied to es5 to make it work or use file for dist.

## [Documentation](https://nimjetushar.github.io/Utils/):

## Testing

Use index.html from sample for testing the utility into the console.

## Dependencies

[![devDependencies Status](https://david-dm.org/nimjetushar/utils/dev-status.svg)](https://david-dm.org/nimjetushar/utils?type=dev)

## Licence

[![GitHub license](https://img.shields.io/github/license/nimjetushar/Utils.svg?style=popout)](https://github.com/nimjetushar/Utils/blob/master/LICENSE)
73 changes: 73 additions & 0 deletions build/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"name": "tutility",
"version": "4.0.0",
"description": "Utility functions",
"main": "index.js",
"scripts": {
"build": "gulp build",
"build:min": "gulp build:min",
"build:all": "gulp build:all",
"build-util": "webpack --config webpack.config.js",
"build-util-umd": "webpack --env.libType=umd --config webpack.config.js",
"build-util-umd:min": "webpack --env.libType=umd --env.build_type=prod --config webpack.config.js",
"build-logger": "webpack --env.build_lib=logger --config webpack.config.js",
"build-logger-umd": "webpack --env.libType=umd --env.build_lib=logger --config webpack.config.js",
"build-logger-umd:min": "webpack --env.libType=umd --env.build_lib=logger --env.build_type=prod --config webpack.config.js",
"build-detect": "webpack --env.build_lib=detect --config webpack.config.js",
"build-detect-umd": "webpack --env.libType=umd --env.build_lib=detect --config webpack.config.js",
"build-detect-umd:min": "webpack --env.libType=umd --env.build_lib=detect --env.build_type=prod --config webpack.config.js",
"test": "jest",
"test-with-coverage": "jest --coverage && codacy-coverage -t 5bce5aece0e04478b72ff03a0a6d530d < ./coverage/lcov.info",
"test-with-coverage-ci": "jest --coverage && cat ./coverage/lcov.info | codacy-coverage -t 5bce5aece0e04478b72ff03a0a6d530d",
"doc": "gulp",
"deploy-doc": "npm run doc && gh-pages -d docs",
"lint": "eslint core/* index.js logger.js detect.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/tusharnimje21/Utils.git"
},
"author": "Tushar Nimje",
"license": "MIT",
"bugs": {
"url": "https://github.com/tusharnimje21/Utils/issues"
},
"homepage": "https://github.com/tusharnimje21/Utils#readme",
"keywords": [
"utility",
"javaScript-utility",
"helper-functions",
"utils",
"utilities",
"utility-functions",
"tutility"
],
"devDependencies": {
"@babel/core": "7.10.2",
"@babel/preset-env": "7.10.2",
"@fourjs/eslint-config-tn": "4.2.1",
"babel-eslint": "10.1.0",
"babel-loader": "8.1.0",
"babel-plugin-add-module-exports": "1.0.2",
"codacy-coverage": "3.4.0",
"device-detector-js": "2.2.1",
"eslint": "6.8.0",
"eslint-loader": "4.0.2",
"eslint-plugin-babel": "5.3.0",
"eslint-plugin-import": "2.20.2",
"eslint-plugin-jest": "23.13.2",
"gh-pages": "3.0.0",
"gulp": "4.0.2",
"gulp-jsdoc3": "3.0.0",
"gulp-run": "1.7.1",
"jest": "26.0.1",
"webpack": "4.43.0",
"webpack-cli": "3.3.11"
},
"peerDependencies": {
"device-detector-js": "2.2.1"
},
"jest": {
"verbose": true
}
}
6 changes: 6 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ function buildUmdMin(cb) {
.pipe(run('echo build min executed', cb()));
}

function moveFiles(cb) {
return gulp.src(['README.md', 'package.json', 'LICENSE'])
.pipe(gulp.dest('build'), cb);
}

exports['build:all'] = gulp.parallel(build, buildUmd, buildUmdMin, moveFiles);
exports['build:min'] = gulp.series(buildUmdMin);
exports.build = gulp.parallel(build, buildUmd);
exports.default = gulp.series(createDoc);
11 changes: 2 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "tutility",
"version": "3.1.0",
"version": "4.0.0",
"description": "Utility functions",
"main": "index.js",
"scripts": {
"build": "gulp build",
"build:min": "gulp build:min",
"build:all": "npm run build && npm run build:min",
"build:all": "gulp build:all",
"build-util": "webpack --config webpack.config.js",
"build-util-umd": "webpack --env.libType=umd --config webpack.config.js",
"build-util-umd:min": "webpack --env.libType=umd --env.build_type=prod --config webpack.config.js",
Expand Down Expand Up @@ -46,7 +46,6 @@
"@babel/core": "7.10.2",
"@babel/preset-env": "7.10.2",
"@fourjs/eslint-config-tn": "4.2.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.1.0",
"babel-loader": "8.1.0",
"babel-plugin-add-module-exports": "1.0.2",
Expand All @@ -65,12 +64,6 @@
"webpack": "4.43.0",
"webpack-cli": "3.3.11"
},
"peerDependencies": {
"device-detector-js": "2.2.1"
},
"resolutions": {
"babel-core": "7.0.0-bridge"
},
"jest": {
"verbose": true
}
Expand Down
8 changes: 5 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ module.exports = env => {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
options: {
configFile: path.resolve('babel.config.js')
use: {
loader: 'babel-loader',
options: {
configFile: path.resolve('babel.config.js')
}
}
},
{
Expand Down

0 comments on commit 783ab2c

Please sign in to comment.