Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Commit

Permalink
refactor(fine-uploader-wrappers): externalize wrapper classes (#61)
Browse files Browse the repository at this point in the history
All wrapper classes were moved to the fine-uploader-wrappers project. react-fine-uploader now depends on fine-uploader-wrappers. 

Breaking changes:
- Traditional, S3, and Azure wrappers must be imported from 'fine-uploader-wrappers'
- Components are now at the root of the package.

Also, <Gallery /> is now the default export for this package.

closes #21
  • Loading branch information
rnicholus committed Feb 1, 2017
1 parent e92cf62 commit 980f515
Show file tree
Hide file tree
Showing 48 changed files with 65 additions and 748 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.eslintcache
.idea
composer.phar
dist
lib
node_modules
Expand Down
251 changes: 30 additions & 221 deletions README.md

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ const isProduction = process.env.NODE_ENV === 'production';
const path = require('path')

module.exports = {
entry: {
'traditional-wrapper': [path.resolve('src/wrappers/traditional.js')],
'file-input': [path.resolve('src/components/file-input/styleable-element.jsx')]
},
output: {
path: path.resolve('lib'),
filename: `[name].${isProduction ? 'min.js' : '.js'}`
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-fine-uploader",
"version": "0.4.0",
"version": "0.5.0",
"license": "MIT",
"description": "React UI components for using Fine Uploader in a React-based project.",
"author": {
Expand All @@ -19,13 +19,14 @@
"upload",
"widget"
],
"main": "wrappers/traditional.js",
"main": "gallery/index.js",
"peerDependencies": {
"react": "0.14.x || 15.x.x",
"react-addons-css-transition-group": "0.14.x || 15.x.x"
},
"dependencies": {
"fine-uploader": ">=5.11.10 <6.0.0",
"fine-uploader-wrappers": "0.1.1",
"object-assign": "4.1.1"
},
"devDependencies": {
Expand Down Expand Up @@ -58,19 +59,19 @@
"react-addons-test-utils": "latest",
"react-dom": "latest",
"style-loader": "latest",
"webpack": "latest",
"webpack": "1.14.0",
"webpack-node-externals": "latest"
},
"engines": {
"node": ">=5.0.0"
},
"scripts": {
"build": "rm -rf lib && mkdir -p lib && cp -pR src/components lib && cp -pR src/wrappers lib && babel lib --out-dir lib && find lib -type f -name '*.jsx' -delete",
"build": "rm -rf lib && mkdir -p lib && cp -pR src/ lib && babel lib --out-dir lib && find lib -type f -name '*.jsx' -delete",
"lint": "eslint src/. --ext .js,.jsx --cache",
"manual-test": "webpack --config config/webpack.manual-test.config.js --watch --display-error-details",
"push-to-npm": "cp package.json README.md LICENSE lib && (cd lib ; npm publish)",
"release": "npm run test && npm run build && npm run push-to-npm",
"start": "(. src/test/manual/s3keys.sh; php -S 0.0.0.0:9090 -t src/test/manual -c src/test/manual/php.ini)",
"start": "(php -S 0.0.0.0:9090 -t src/test/manual -c src/test/manual/php.ini)",
"start-no-s3": "php -S 0.0.0.0:9090 -t src/test/manual -c src/test/manual/php.ini",
"test": "npm run lint && if [ $CI ]; then karma start config/karma.conf; else karma start config/karma.dev.conf; fi"
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/test/manual/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"fineuploader/php-traditional-server": "1.2.0",
"fineuploader/php-traditional-server": "1.2.1",
"fineuploader/php-s3-server": "1.1.0"
}
}
8 changes: 4 additions & 4 deletions src/test/manual/tester.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { Component } from 'react'

import Gallery from 'lib/components/gallery'
import S3FineUploader from 'lib/wrappers/s3'
import TraditionalFineUploader from 'lib/wrappers/traditional'
import Gallery from 'lib/gallery'
import S3FineUploader from 'fine-uploader-wrappers/s3'
import TraditionalFineUploader from 'fine-uploader-wrappers'

import 'lib/components/gallery/gallery.css'
import 'lib/gallery/gallery.css'

const traditionalUploader = new TraditionalFineUploader({
options: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import TestUtils from 'react-addons-test-utils'

import FineUploaderTraditional from 'src/wrappers/traditional'
import CancelButton from 'src/components/cancel-button'
import FineUploaderTraditional from 'fine-uploader-wrappers'
import CancelButton from 'src/cancel-button'

const sampleBlob = new Blob(['hi!'], { type : 'text/plain' })

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import TestUtils from 'react-addons-test-utils'

import DeleteButton from 'src/components/delete-button'
import FineUploaderTraditional from 'src/wrappers/traditional'
import DeleteButton from 'src/delete-button'
import FineUploaderTraditional from 'fine-uploader-wrappers'

describe('<DeleteButton />', () => {
const getButton = Component => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import TestUtils from 'react-addons-test-utils'

import FileInput from 'src/components/file-input'
import FileInput from 'src/file-input'

class DummyStylableElement extends React.Component {
render() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import TestUtils from 'react-addons-test-utils'

import { wrapStatelessComponent } from 'test/utils'
import StyleableElement from 'src/components/file-input/styleable-element'
import StyleableElement from 'src/file-input/styleable-element'

describe('<StylableElement />', () => {
const WrappedStyleableElement = wrapStatelessComponent(StyleableElement)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import TestUtils from 'react-addons-test-utils'

import FineUploaderTraditional from 'src/wrappers/traditional'
import Filename from 'src/components/filename'
import FineUploaderTraditional from 'fine-uploader-wrappers'
import Filename from 'src/filename'

const sampleBlob = new Blob(['hi!'], { type : 'text/plain' })
const sampleBlobWrapper = { blob: sampleBlob, name: 'test' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import TestUtils from 'react-addons-test-utils'

import FineUploaderTraditional from 'src/wrappers/traditional'
import Filesize from 'src/components/filesize'
import FineUploaderTraditional from 'fine-uploader-wrappers'
import Filesize from 'src/filesize'

const sampleBlob = new Blob(['hi!'], { type : 'text/plain' })
const sampleBlobWrapper = { blob: sampleBlob, name: 'test' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react'
import TestUtils from 'react-addons-test-utils'

import Dropzone from 'src/components/dropzone'
import FileInput from 'src/components/file-input'
import FineUploaderTraditional from 'src/wrappers/traditional'
import Gallery from 'src/components/gallery'
import Dropzone from 'src/dropzone'
import FileInput from 'src/file-input'
import FineUploaderTraditional from 'fine-uploader-wrappers'
import Gallery from 'src/gallery'

const isMobile = !!('ontouchstart' in window)
const sampleBlob = new Blob(['hi!'], { type : 'text/plain' })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import TestUtils from 'react-addons-test-utils'

import FineUploaderTraditional from 'src/wrappers/traditional'
import PauseResumeButton from 'src/components/pause-resume-button'
import FineUploaderTraditional from 'fine-uploader-wrappers'
import PauseResumeButton from 'src/pause-resume-button'

describe('<PauseResumeButton />', () => {
let statusChangeCallback, uploadChunkCallback, uploader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import qq from 'fine-uploader/lib/core/all'
import React from 'react'
import TestUtils from 'react-addons-test-utils'

import FineUploaderTraditional from 'src/wrappers/traditional'
import ProgressBar from 'src/components/progress-bar'
import FineUploaderTraditional from 'fine-uploader-wrappers'
import ProgressBar from 'src/progress-bar'

describe('<ProgressBar />', () => {
it('renders total progress bar when a file ID is not supplied & updates progress appropriately', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import TestUtils from 'react-addons-test-utils'

import RetryButton from 'src/components/retry-button'
import FineUploaderTraditional from 'src/wrappers/traditional'
import RetryButton from 'src/retry-button'
import FineUploaderTraditional from 'fine-uploader-wrappers'

describe('<RetryButton />', () => {
const getButton = () => (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import TestUtils from 'react-addons-test-utils'

import Status from 'src/components/status'
import FineUploaderTraditional from 'src/wrappers/traditional'
import Status from 'src/status'
import FineUploaderTraditional from 'fine-uploader-wrappers'

describe('<Status />', () => {
const getStatus = () => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import qq from 'fine-uploader/lib/core/all'
import React from 'react'
import TestUtils from 'react-addons-test-utils'

import Thumbnail, { defaultMaxSize, notAvailableStatus, waitingStatus } from 'src/components/thumbnail'
import Thumbnail, { defaultMaxSize, notAvailableStatus, waitingStatus } from 'src/thumbnail'

describe('<Thumbnail />', () => {
let drawThumbnail, qqPromise, uploader
Expand Down
Loading

0 comments on commit 980f515

Please sign in to comment.