Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
Removing gulp, using webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
mkmarek committed Apr 23, 2016
1 parent ef753f8 commit 9664662
Show file tree
Hide file tree
Showing 21 changed files with 102 additions and 183 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015", "stage-2"]
}
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test/**/*.js
lib/**/*.js
node_modules
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ coverage

#inteliJ idea files
.idea

.nyc_output
dist
7 changes: 7 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
examples
node_modules
test
src
coverage
.nyc_output
13 changes: 0 additions & 13 deletions gulpconfig.js

This file was deleted.

133 changes: 0 additions & 133 deletions gulpfile.js

This file was deleted.

45 changes: 21 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"name": "pikola",
"version": "0.1.2",
"version": "0.1.3",
"description": "Library for advanced scheduling",
"main": "index.js",
"repository": "https://github.com/mkmarek/Pikola.js.git",
"scripts": {
"coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls",
"test": "node ./node_modules/gulp/bin/gulp cover",
"start": "gulp watch",
"build": "gulp build-scripts",
"postinstall": "gulp build-scripts"
"clean": "rm -rf .nyc_output && rm -rf coverage && rm -rf lib && rm -rf dist",
"coveralls": "npm run coverage && cat ./coverage/lcov.info | ./node_modules/.bin/coveralls",
"test": "npm run lint && mocha --compilers js:babel-core/register ./test/**/*.js",
"coverage": "nyc --reporter=html --reporter=lcov --require babel-core/register mocha ./test/**/*.js",
"build": "BABEL_ENV=production ./node_modules/.bin/babel ./src --out-dir ./lib",
"lint": "eslint src",
"prod": "npm run lint && npm run build && BABEL_ENV=production NODE_ENV=0 webpack --config webpack.prod.config.js && BABEL_ENV=production NODE_ENV=1 webpack --config webpack.prod.config.js"
},
"keywords": [
"date",
Expand All @@ -23,27 +25,22 @@
"url": "https://github.com/mkmarek/"
},
"license": "MIT",
"dependencies": {
"babel-cli": "^6.3.17",
"devDependencies": {
"babel-cli": "^6.6.4",
"babel-core": "^6.5.2",
"babel-eslint": "^6.0.3",
"babel-preset-es2015": "^6.6.0",
"babel-loader": "^6.2.3",
"babel-plugin-transform-runtime": "^6.5.2",
"babel-polyfill": "^6.5.0",
"babel-preset-es2015": "^6.5.0",
"babel-preset-stage-2": "^6.5.0",
"chai": "^3.4.1",
"coveralls": "^2.11.9",
"del": "^2.2.0",
"eslint": "^2.8.0",
"eslint-config-rackt": "^1.1.1",
"gulp": "^3.9.0",
"gulp-babel": "^6.1.1",
"gulp-babel-istanbul": "^1.0.0",
"gulp-eslint": "^2.0.0",
"gulp-inject-modules": "^0.1.1",
"gulp-istanbul-report": "0.0.1",
"gulp-mocha": "^2.2.0",
"gulp-sourcemaps": "^2.0.0-alpha",
"isparta": "^4.0.0",
"istanbul": "^0.4.3",
"merge2": "^1.0.2",
"mocha": "^2.3.4",
"remap-istanbul": "^0.6.3"
}
"mocha": "^2.4.5",
"nyc": "^6.4.0",
"webpack": "^1.12.2"
},
"dependencies": {}
}
2 changes: 1 addition & 1 deletion src/__TEST__/day.test.js → test/day.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import scheduler from '../../index'
import scheduler from '../src/index'
import {testCase} from './templates.test'

testCase({
Expand Down
2 changes: 1 addition & 1 deletion src/__TEST__/fire.test.js → test/fire.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import scheduler from '../../index'
import scheduler from '../src/index'
import chai from 'chai'
import {dateToStr} from './templates.test'

Expand Down
2 changes: 1 addition & 1 deletion src/__TEST__/hour.test.js → test/hour.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import scheduler from '../../index'
import scheduler from '../src/index'
import {testCase} from './templates.test'

testCase({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import scheduler from '../../index'
import scheduler from '../src/index'
import {testCase} from './templates.test'

testCase({
Expand Down
2 changes: 1 addition & 1 deletion src/__TEST__/minute.test.js → test/minute.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import scheduler from '../../index'
import scheduler from '../src/index'
import {testCase} from './templates.test'

testCase({
Expand Down
2 changes: 1 addition & 1 deletion src/__TEST__/month.test.js → test/month.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import scheduler from '../../index'
import scheduler from '../src/index'
import {testCase} from './templates.test'

testCase({
Expand Down
2 changes: 1 addition & 1 deletion src/__TEST__/order.test.js → test/order.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import scheduler from '../../index'
import scheduler from '../src/index'
import {dateToStr} from './templates.test'
import chai from 'chai'

Expand Down
4 changes: 2 additions & 2 deletions src/__TEST__/scheduler.test.js → test/scheduler.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as scheduler from '../scheduler'
import layers from '../resolution'
import * as scheduler from '../src/scheduler'
import layers from '../src/resolution'

import chai from 'chai'

Expand Down
2 changes: 1 addition & 1 deletion src/__TEST__/second.test.js → test/second.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import scheduler from '../../index'
import scheduler from '../src/index'
import {testCase} from './templates.test'

testCase({
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/__TEST__/utils.test.js → test/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
getFirstDayOfWeekInMonth,
getIsoWeekFromDate,
getDateOfISOWeek
} from '../utils'
} from '../src/utils'

import chai from 'chai'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import scheduler from '../../index'
import scheduler from '../src/index'
import chai from 'chai'

const should = chai.should();
Expand Down
2 changes: 1 addition & 1 deletion src/__TEST__/week.test.js → test/week.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import scheduler from '../../index'
import scheduler from '../src/index'
import {testCase} from './templates.test'

testCase({
Expand Down
52 changes: 52 additions & 0 deletions webpack.prod.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
'use strict';

var path = require('path'),
webpack = require('webpack'),
nodeModulesPath = path.join(__dirname, 'node_modules');

var js_root = './src/';
var js_dist = __dirname + '/dist/';

// 0 stands for development, 1 stands for production
// for development mode: NODE_ENV=0 webpack
// for production mode: NODE_ENV=1 webpack
var ENV = !!(+process.env.NODE_ENV || 0);

module.exports = [{
name: 'prod',
entry: {
"pikola": js_root + 'index.js',
},

output: {
libraryTarget: "var",
library: "pikola",
path: js_dist,
filename: ENV ? '[name].min.js' : '[name].js'
},

module: {
loaders: [{
loader: 'babel',
test: [ /\.js$/],
exclude: /node_modules/,
query: {
presets: ['stage-2', 'es2015']
}
}],
},

resolve: {
extensions: ['', '.webpack.js', '.js']
},

externals: {
},

plugins: ENV ? [
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
mangle: false
})
] : []
}];

0 comments on commit 9664662

Please sign in to comment.