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

chore: introduce top-level Rakefile for easier task management across packages #120

Merged
merged 6 commits into from
Jul 20, 2020
Merged
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
15 changes: 2 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,18 @@
.bundle
.config
.yardoc

Gemfile.lock
examples/**/Gemfile.lock

*.lock
InstalledFiles
_yardoc
coverage
doc/
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
*.bundle
*.so
*.o
*.a
mkmf.log

*.log
.ruby-version
bin/
node_modules/
spec/examples.txt
./results
10 changes: 0 additions & 10 deletions Gemfile

This file was deleted.

98 changes: 67 additions & 31 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,39 +1,75 @@
require "rake/clean"
require "bundler/gem_tasks"

CLOBBER.include "pkg", "node_modules"

# add npm-install as pre-req for build
Rake::Task[:build].enhance [:npm]

###########
# npm
###########
desc "alias for npm:install"
task :npm => "npm:install"
namespace :npm do
desc "Install npm dependencies"
task :install do
sh "npm install"
end

desc "Update npm dependencies to latest version allowed by package.json"
task :update do
sh "npm update"
# bootstrap
desc "bootstrap all packages"
task :bootstrap, [:pkg] do |t, args|
if args[:pkg].nil?
sh "
baseDir=$PWD
for dir in ./packages/*
do
cd $dir
bundle install
cd $baseDir
done
"
else
pkgDir = "./packages/#{args[:pkg]}"
sh "cd #{pkgDir} && bundle install"
end
end

desc "Upgrade axe-core dependency to latest version available, overwriting package.json"
task :upgrade do
sh "npm install --save axe-core@latest"
# test
desc "Test all packages"
task :test, [:pkg] do |t, args|
if args[:pkg].nil?
sh "
baseDir=$PWD
for dir in ./packages/*
do
cd $dir
rake test
cd $baseDir
done
"
else
pkgDir = "./packages/#{args[:pkg]}"
sh "cd #{pkgDir} && rake test"
end
end

desc "Upgrade axe-core dependency to latest prerelease version, overwriting package.json"
task :next do
sh "npm install --save axe-core@next"
# build
desc "Build all packages"
task :build, [:pkg] do |t, args|
if args[:pkg].nil?
sh "
baseDir=$PWD
for dir in ./packages/*
do
cd $dir
rake build
cd $baseDir
done
"
else
pkgDir = "./packages/#{args[:pkg]}"
sh "cd #{pkgDir} && rake build"
end
end

desc "Display currently-installed and latest-available versions of axe-core lib"
task :status do
sh "npm view axe-core version && npm list axe-core"
# format
desc "format code in all packages"
task :format, [:pkg] do |t, args|
if args[:pkg].nil?
sh "
baseDir=$PWD
for dir in ./packages/*
do
cd $dir
rake format
cd $baseDir
done
"
else
pkgDir = "./packages/#{args[:pkg]}"
sh "cd #{pkgDir} && rake format"
end
end
48 changes: 0 additions & 48 deletions axe-matchers.gemspec

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"url": "git+https://github.com/dequelabs/axe-core-gems.git"
},
"scripts": {
"changelog": "standard-version -a --skip.tag=true --skip.commit=true --skip.bump=true",
"format": "bundle exec rubocop --config rubocop.yml --auto-correct --fix-layout"
"changelog": "standard-version -a --skip.tag=true --skip.commit=true --skip.bump=true"
},
"devDependencies": {
"standard-version": "^8.0.2"
Expand Down
4 changes: 0 additions & 4 deletions rubocop.yml

This file was deleted.