Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added yarn support #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Or install it yourself as:
invoke 'npm:install'
invoke 'bower:install'
invoke 'grunt:task'
invoke 'yarn:install'
...
end
end
Expand All @@ -38,10 +39,12 @@ Or install it yourself as:
set :npm_bin # default: 'npm'
set :bower_bin # default: 'bower'
set :grunt_bin # default: 'grunt'
set :yarn_bin # default: 'yarn'
set :npm_options # default: '--production'
set :bower_options # default: '--allow-root'
set :grunt_options # default: ''
set :grunt_task # default: 'build'
set :yarn_options # default: '--production'

## Contributing

Expand Down
16 changes: 15 additions & 1 deletion lib/mina/npm/tasks.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
set :npm_bin, 'npm'
set :bower_bin, 'bower'
set :grunt_bin, 'grunt'
set :yarn_bin, 'yarn'
set :npm_options, '--production'
set :bower_options, '--allow-root'
set :grunt_options, ''
set :grunt_task, 'build'

set :yarn_options, '--production'

namespace :npm do
desc 'Install node modules using Npm.'
Expand All @@ -20,6 +21,19 @@
end
end

namespace :yarn do
desc 'Install node modules using Yarn.'
task install: :environment do
command %{
echo "-----> Installing node modules using Yarn"
sub_directory=$(pwd | sed -r "s/.*?$(basename $build_path)//g")
#{echo_cmd %[mkdir -p "#{fetch(:deploy_to)}/#{fetch(:shared_path)}/$sub_directory/node_modules"]}
#{echo_cmd %[ln -s "#{fetch(:deploy_to)}/#{fetch(:shared_path)}/$sub_directory/node_modules" "node_modules"]}
#{echo_cmd %[#{fetch(:yarn_bin)} install #{fetch(:yarn_options)}]}
}
end
end

namespace :bower do
desc "Install bower modules."
task install: :environment do
Expand Down