Skip to content

Commit

Permalink
Catch fix (#214)
Browse files Browse the repository at this point in the history
* [update] adds bundle configs

* [update] adds acceptance test runner

* [update] removes unneeded if statements and unused code

* [update] no gulp

* [update] switches from airbnb to standard lint config

* [update] update build for 3.0.0

* [docs] readme 3.0.0 messaging

* [upadte] update travis

* [update] reverts forEach => for loop
  • Loading branch information
yowainwright authored Jan 31, 2018
1 parent 8739bb9 commit 5ad354d
Show file tree
Hide file tree
Showing 19 changed files with 252 additions and 611 deletions.
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dist/*
tests/*
rollup.config.js
gulpfile.js
node_modules/*
coverage/*
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": [ "airbnb/base"],
"extends": [ "standard"],
"env": {
"browser": true,
"node": true
Expand Down
8 changes: 0 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,8 @@ node_js:

before_install:
- npm install -g npm
- npm install -g bower
- bower --version
- phantomjs --version

install:
- npm install
- bower install

before_script:
- npm install -g gulp
- npm install node-qunit-phantomjs

script: npm run release
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

> Stickybits is a lightweight alternative to `position: sticky` polyfills. It works perfectly for things like sticky headers.
**NOTE:** As of **StickyBits 3.0.0**, unminified versions are not built hence the big 3.0.0. Everything else should work as expected. Provide a pull request with new build requirements.

**Stickybits is awesome because:**
- it can add a CSS Sticky Class (`.js-is-sticky`) when [position: sticky](http://caniuse.com/#search=sticky) elements become active and a CSS Stuck Class (`.js-is-stuck`) when they become stuck. See [useStickyClasses](#feature).
- it loosely mimics [position: sticky](http://caniuse.com/#search=sticky) to consistently stick elements vertically across multiple platforms
Expand Down
42 changes: 42 additions & 0 deletions configs/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import {
author,
description,
homepage,
license,
name,
version
} from '../package.json'

const babelSetup = {
babelrc: false,
presets: [['es2015', { modules: false }]],
exclude: 'node_modules/**'
}

const uglifyOutput = {
output: {
comments: function (node, comment) {
const text = comment.value
const type = comment.type
if (type === 'comment2') {
// multiline comment
return /@preserve|@license|@cc_on/i.test(text)
}
}
}
}

const banner = `/**
${name} - ${description}
@version v${version}
@link ${homepage}
@author ${author}
@license ${license}
**/`

export {
babelSetup,
banner,
uglifyOutput,
version
}
26 changes: 26 additions & 0 deletions configs/rollup.config.es.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import {
babelSetup,
banner,
uglifyOutput,
version
} from '../configs/config'
import babel from 'rollup-plugin-babel'
import replace from 'rollup-plugin-replace'
import uglify from 'rollup-plugin-uglify'

export default {
input: 'src/stickybits.js',
plugins: [
babel(babelSetup),
replace({ VERSION: JSON.stringify(version) }),
uglify(uglifyOutput)
],
treeshake: false,
output: {
banner,
file: 'dist/stickybits.es.js',
format: 'es',
name: 'stickybits',
sourcemap: false
}
}
26 changes: 26 additions & 0 deletions configs/rollup.config.jquery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import {
babelSetup,
banner,
uglifyOutput,
version
} from '../configs/config'
import babel from 'rollup-plugin-babel'
import replace from 'rollup-plugin-replace'
import uglify from 'rollup-plugin-uglify'

export default {
input: 'src/jquery.stickybits.js',
plugins: [
babel(babelSetup),
replace({ VERSION: JSON.stringify(version) }),
uglify(uglifyOutput)
],
treeshake: false,
output: {
banner,
file: 'dist/jquery.stickybits.min.js',
format: 'umd',
name: 'stickybits',
sourcemap: false
}
}
26 changes: 26 additions & 0 deletions configs/rollup.config.standard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import {
babelSetup,
banner,
uglifyOutput,
version
} from '../configs/config'
import babel from 'rollup-plugin-babel'
import replace from 'rollup-plugin-replace'
import uglify from 'rollup-plugin-uglify'

export default {
input: 'src/stickybits.js',
plugins: [
babel(babelSetup),
replace({ VERSION: JSON.stringify(version) }),
uglify(uglifyOutput)
],
treeshake: false,
output: {
banner,
file: 'dist/stickybits.min.js',
format: 'umd',
name: 'stickybits',
sourcemap: false
}
}
26 changes: 26 additions & 0 deletions configs/rollup.config.umbrella.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import {
babelSetup,
banner,
uglifyOutput,
version
} from '../configs/config'
import babel from 'rollup-plugin-babel'
import replace from 'rollup-plugin-replace'
import uglify from 'rollup-plugin-uglify'

export default {
input: 'src/umbrella.stickybits.js',
plugins: [
babel(babelSetup),
replace({ VERSION: JSON.stringify(version) }),
uglify(uglifyOutput)
],
treeshake: false,
output: {
banner,
file: 'dist/umbrella.stickybits.js',
format: 'umd',
name: 'stickybits',
sourcemap: false
}
}
13 changes: 7 additions & 6 deletions dist/jquery.stickybits.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5ad354d

Please sign in to comment.