diff --git a/activestorage/.gitignore b/activestorage/.gitignore index a532335bddae88e02c417fb8f6f793b88070827f..29bdcc4468a0d8f2a23228e422dea11ceedf968a 100644 --- a/activestorage/.gitignore +++ b/activestorage/.gitignore @@ -1,5 +1,6 @@ .byebug_history node_modules +src test/dummy/db/*.sqlite3 test/dummy/db/*.sqlite3-journal test/dummy/log/*.log diff --git a/activestorage/CHANGELOG.md b/activestorage/CHANGELOG.md index 79e409c30482ca6b6fac7799df45c2cc0b76403c..5927911cff56844b2c4c6147ce030374813dcf6e 100644 --- a/activestorage/CHANGELOG.md +++ b/activestorage/CHANGELOG.md @@ -1,5 +1,12 @@ ## Rails 5.2.0.rc1 (January 30, 2018) ## +* Add source code to published npm package + + This allows activestorage users to depend on the javascript source code + rather than the compiled code, which can produce smaller javascript bundles. + + *Richard Macklin* + * Preserve display aspect ratio when extracting width and height from videos with rectangular samples in `ActiveStorage::Analyzer::VideoAnalyzer`. diff --git a/activestorage/package.json b/activestorage/package.json index 084a22b4de58b4737041537a84af0198fc97ddf8..7f36d32a8af29f60d78fd520c61620574f383660 100644 --- a/activestorage/package.json +++ b/activestorage/package.json @@ -4,7 +4,8 @@ "description": "Attach cloud and local files in Rails applications", "main": "app/assets/javascripts/activestorage.js", "files": [ - "app/assets/javascripts/*.js" + "app/assets/javascripts/*.js", + "src/*.js" ], "homepage": "http://rubyonrails.org/", "repository": { @@ -16,18 +17,21 @@ }, "author": "Javan Makhmali ", "license": "MIT", + "dependencies": { + "spark-md5": "^3.0.0" + }, "devDependencies": { "babel-core": "^6.25.0", "babel-loader": "^7.1.1", "babel-preset-env": "^1.6.0", "eslint": "^4.3.0", "eslint-plugin-import": "^2.7.0", - "spark-md5": "^3.0.0", "webpack": "^3.4.0" }, "scripts": { "prebuild": "yarn lint", "build": "webpack -p", - "lint": "eslint app/javascript" + "lint": "eslint app/javascript", + "prepublishOnly": "rm -rf src && cp -R app/javascript/activestorage src" } }