Skip to content

Commit f630398

Browse files
committed
build fixes, separate npm modules
1 parent 9e1bc6a commit f630398

10 files changed

+156
-127
lines changed

examples/js/demo-gsap.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/js/demo.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/js/shared.js

+115-115
Large diffs are not rendered by default.

examples/webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = {
3434

3535
resolve: {
3636
alias: {
37-
'react-spark-scroll': '../../src/',
37+
'react-spark-scroll': path.resolve(__dirname + '../../src/'),
3838
'underscore': 'lodash'
3939
}
4040
},

package-npm-gsap.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
var p = require('./package');
2+
3+
p.name = 'react-spark-scroll-gsap';
4+
p.dependencies.gsap = p.devDependencies.gsap;
5+
p.dependencies['react-spark-scroll'] = '^' + p.version;
6+
p.main = 'lib';
7+
p.scripts = p.devDependencies=undefined;
8+
9+
module.exports = p;

package-npm-rekapi.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
var p = require('./package');
2+
3+
p.name = 'react-spark-scroll-rekapi';
4+
p.dependencies.rekapi = p.devDependencies.rekapi;
5+
p.dependencies['react-spark-scroll'] = '^' + p.version;
6+
p.main = 'lib';
7+
p.scripts = p.devDependencies=undefined;
8+
9+
module.exports = p;

package-npm.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
var p = require('./package');
2+
3+
p.main='lib';
4+
p.scripts=p.devDependencies=undefined;
5+
6+
module.exports = p;

package.json

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-spark-scroll",
3-
"version": "0.0.1",
3+
"version": "1.0.0",
44
"description": "Scroll-based animation and actions for React",
55
"main": "src",
66
"repository": {
@@ -11,10 +11,15 @@
1111
"bugs": "https://github.com/gilbox/react-spark-scroll/issues",
1212
"scripts": {
1313
"build-global": "rm -rf build/global && NODE_ENV=production webpack src/index.js build/global/spark-scroll.js && NODE_ENV=production COMPRESS=1 webpack src/index.js build/global/spark-scroll.min.js && echo \"gzipped, the global build is `gzip -c build/global/spark-scroll.min.js | wc -c` bytes\"",
14-
"build-npm": "rm -rf build/npm && babel -d build/npm/lib ./src && cp README.md build/npm && find -X build/npm/lib -type d -name __tests__ | xargs rm -rf && node -p 'p=require(\"./package\");p.main=\"lib\";p.scripts=p.devDependencies=undefined;JSON.stringify(p,null,2)' > build/npm/package.json",
14+
"build-npm": "rm -rf build/npm && babel -d build/npm/lib ./src && cp README.md build/npm && find -X build/npm/lib -type d -name __tests__ | xargs rm -rf && node -p 'p=require(\"./package-npm\");JSON.stringify(p,null,2)' > build/npm/package.json",
15+
"build-npm-rekapi": "rm -rf build/npm-rekapi && babel -d build/npm-rekapi/lib ./src && rm build/npm-rekapi/lib/index.js build/npm-rekapi/lib/gsap-animator.js build/npm-rekapi/lib/spark.js build/npm-rekapi/lib/spark-scroll-gsap.js && mv build/npm-rekapi/lib/spark-scroll-rekapi.js build/npm-rekapi/lib/index.js && cp README.md build/npm-rekapi && find -X build/npm-rekapi/lib -type d -name __tests__ | xargs rm -rf && node -p 'p=require(\"./package-npm-rekapi\");JSON.stringify(p,null,2)' > build/npm-rekapi/package.json",
16+
"build-npm-gsap": "rm -rf build/npm-gsap && babel -d build/npm-gsap/lib ./src && rm build/npm-gsap/lib/index.js build/npm-gsap/lib/spark.js build/npm-gsap/lib/spark-scroll-rekapi.js && mv build/npm-gsap/lib/spark-scroll-gsap.js build/npm-gsap/lib/index.js && cp README.md build/npm-gsap && find -X build/npm-gsap/lib -type d -name __tests__ | xargs rm -rf && node -p 'p=require(\"./package-npm-gsap\");JSON.stringify(p,null,2)' > build/npm-gsap/package.json",
17+
"build-npm-all": "npm run build-npm && npm run build-npm-rekapi && npm run build-npm-gsap",
1518
"examples": "rm -rf examples/js && webpack-dev-server --config examples/webpack.config.js --content-base examples",
1619
"examples-build": "rm -rf examples/js && webpack --config examples/webpack.build.config.js",
17-
"test": "jsxhint . && karma start"
20+
"test": "jsxhint . && karma start",
21+
"publish": "npm publish ./build/npm && npm publish ./build/npm-gsap && npm publish ./build/npm-rekapi",
22+
"prepush": "npm run examples-build"
1823
},
1924
"authors": [
2025
"Gil Birman"
@@ -40,18 +45,18 @@
4045
"rf-changelog": "^0.4.0",
4146
"rx": "2.3.18",
4247
"webpack": "^1.4.13",
43-
"webpack-dev-server": "^1.6.6"
48+
"webpack-dev-server": "^1.6.6",
49+
"gsap": "^1.16.1",
50+
"rekapi": "^1.4.4"
4451
},
4552
"peerDependencies": {
4653
"react": "0.13.x"
4754
},
4855
"dependencies": {
4956
"animation-frame": "^0.2.4",
5057
"events": "^1.0.2",
51-
"gsap": "^1.16.1",
5258
"lodash": "^3.6.0",
53-
"object-assign": "^2.0.0",
54-
"rekapi": "^1.4.4"
59+
"object-assign": "^2.0.0"
5560
},
5661
"tags": [
5762
"react",

src/spark-scroll-gsap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
require('gsap');
88

99
const assign = require('object-assign');
10-
const _factory = require('./');
10+
const _factory = require('react-spark-scroll');
1111
const GSAPAnimator = require('./gsap-animator');
1212

1313
function factory(options) {

src/spark-scroll-rekapi.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var Rekapi = require('rekapi/dist/rekapi');
22
var assign = require('object-assign');
3-
var _factory = require('./');
3+
var _factory = require('react-spark-scroll');
44

55
function factory(options) {
66
return _factory(assign({

0 commit comments

Comments
 (0)