Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: codevor/js-semaphore
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.2.0
Choose a base ref
...
head repository: codevor/js-semaphore
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 6 commits
  • 3 files changed
  • 2 contributors

Commits on Nov 29, 2019

  1. build: build version 0.2.0

    caiangums committed Nov 29, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6e70ab5 View commit details

Commits on Nov 30, 2019

  1. Copy the full SHA
    68cd8ed View commit details
  2. build: build version 0.2.1

    caiangums committed Nov 30, 2019
    Copy the full SHA
    c5c0e4c View commit details

Commits on Dec 12, 2019

  1. Copy the full SHA
    1632db6 View commit details
  2. Copy the full SHA
    dcd6fec View commit details
  3. Merge pull request #2 from codevor/chore/webpack-structure

    Build: Webpack structure
    Ilê Caian authored Dec 12, 2019
    Copy the full SHA
    aec7648 View commit details
Showing with 30 additions and 19 deletions.
  1. +0 −6 .npmignore
  2. +6 −3 package.json
  3. +24 −10 webpack.config.js
6 changes: 0 additions & 6 deletions .npmignore

This file was deleted.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"name": "@codevor/js-semaphore",
"version": "0.1.0",
"version": "0.3.0",
"description": "🚦Semaphore Implementation for JS",
"main": "dist/js-semaphore.js",
"unpkg": "dist/js-semaphore.min.js",
"files": [
"dist"
],
"scripts": {
"clean": "rimraf dist",
"dev": "NODE_ENV=dev webpack --progress --colors --watch",
@@ -12,7 +15,7 @@
"test": "jest --coverage --expand",
"test:watch": "jest --watch",
"coveralls": "cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",
"prepublish": "yarn lint && yarn test && yarn clean && yarn build:umd",
"prepublish": "yarn clean && yarn build:umd",
"commit": "git-cz"
},
"keywords": ["Semaphore", "Syncronization", "Mutex"],
@@ -42,7 +45,7 @@
"husky": "^3.0.9",
"jest": "^24.9.0",
"rimraf": "^3.0.0",
"uglifyjs-webpack-plugin": "^2.2.0",
"terser-webpack-plugin": "^2.2.3",
"webpack": "^4.41.1",
"webpack-cli": "^3.3.9"
},
34 changes: 24 additions & 10 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,63 @@
const path = require('path');
const webpack = require('webpack');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');

const {
name,
version,
repository,
author,
license
} = require('./package.json');

const isProduction = process.env.NODE_ENV === 'production';
const mode = isProduction ? 'production' : 'development';

const libraryName = 'js-semaphore';

const banner = `
${name} v${version}
${repository.url}
Copyright (c) ${author.replace(/ *\<[^)]*\> */g, ' ')}
This source code is licensed under the ${license} license found in the
LICENSE file in the root directory of this source tree.
`;

module.exports = {
mode,
mode: isProduction ? 'production' : 'development',
entry: {
[libraryName]: path.resolve(__dirname, 'src/index.js'),
[`${libraryName}.min`]: path.resolve(__dirname, 'src/index.js')
},
devtool: 'source-map',
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
library: libraryName,
libraryTarget: 'umd',
umdNamedDefine: true,
globalObject: "typeof self !== 'undefined' ? self : this"
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
},
exclude: /node_modules/
}
}
]
},
optimization: {
minimize: true,
minimizer: [new UglifyJsPlugin({ include: /\.min\.js$/ })]
minimizer: [new TerserPlugin()]
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
})
}),
new webpack.BannerPlugin(banner)
],
resolve: {
extensions: ['.json', '.js']