From 5292cdf59a2052c453d6016c69b90b790cbf2547 Mon Sep 17 00:00:00 2001 From: Javan Makhmali Date: Tue, 6 Feb 2018 12:09:08 -0500 Subject: [PATCH] Merge pull request #31880 from rmacklin/publish-activestorage-source-in-addition-to-compiled-js Include source code in published activestorage npm package --- activestorage/.gitignore | 1 + activestorage/CHANGELOG.md | 7 +++++++ activestorage/package.json | 10 +++++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/activestorage/.gitignore b/activestorage/.gitignore index a532335bdd..29bdcc4468 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 79e409c304..5927911cff 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 084a22b4de..7f36d32a8a 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" } } -- GitLab