Skip to content

Commit

Permalink
Load weblibs with npm
Browse files Browse the repository at this point in the history
- Run npm install / update to install / update the dependend weblibs
- Run rake weblib to update them in the project
- Dependencies should be tracked by dependabot
  • Loading branch information
robertcheramy committed Jun 5, 2024
1 parent 4addf32 commit a421605
Show file tree
Hide file tree
Showing 21 changed files with 53,123 additions and 7 deletions.
8 changes: 1 addition & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,15 @@ updates:
schedule:
interval: "daily"
open-pull-requests-limit: 10
labels:
- dependencies
- package-ecosystem: "bundler"
target-branch: "master"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
labels:
- dependencies
- package-ecosystem: "docker"
- package-ecosystem: "npm"
target-branch: "master"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
labels:
- dependencies
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,7 @@ Gemfile.lock

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc

# npm files
/node_modules/
package-lock.json
56 changes: 56 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,60 @@ task :chmod do
dirs.sort.uniq.each { |dir| File.chmod(0o0755, dir) }
end

desc 'Copy web packages from npm into public'
task :weblibs do
weblibs = []
fonts = []

# jQuery
#weblibs << 'node_modules/jquery/dist/jquery.min.js'
#weblibs << 'node_modules/jquery/dist/jquery.min.map'
weblibs << 'node_modules/jquery/dist/jquery.js'

# Bootstrap
#weblibs << 'node_modules/bootstrap/dist/js/bootstrap.min.js'
#weblibs << 'node_modules/bootstrap/dist/js/bootstrap.min.js.map'
#weblibs << 'node_modules/bootstrap/dist/css/bootstrap.min.css'
#weblibs << 'node_modules/bootstrap/dist/css/bootstrap.min.css.map'
weblibs << 'node_modules/bootstrap/dist/js/bootstrap.js'
weblibs << 'node_modules/bootstrap/dist/js/bootstrap.js.map'
weblibs << 'node_modules/bootstrap/dist/css/bootstrap.css'
weblibs << 'node_modules/bootstrap/dist/css/bootstrap.css.map'
weblibs << 'node_modules/bootstrap/dist/js/bootstrap.bundle.js'
weblibs << 'node_modules/bootstrap/dist/js/bootstrap.bundle.js.map'

# Bootstrap-icons
weblibs << 'node_modules/bootstrap-icons/font/bootstrap-icons.css'
fonts << 'node_modules/bootstrap-icons/font/fonts/bootstrap-icons.woff'
fonts << 'node_modules/bootstrap-icons/font/fonts/bootstrap-icons.woff2'

# Datatables
#weblibs << 'node_modules/datatables.net/js/dataTables.min.js'
weblibs << 'node_modules/datatables.net/js/dataTables.js'

# Datatables + Bootstrap
#weblibs << 'node_modules/datatables.net-bs5/js/dataTables.bootstrap5.min.js'
#weblibs << 'node_modules/datatables.net-bs5/css/dataTables.bootstrap5.min.css'
weblibs << 'node_modules/datatables.net-bs5/js/dataTables.bootstrap5.js'
weblibs << 'node_modules/datatables.net-bs5/css/dataTables.bootstrap5.css'

# Datatables Buttons + Bootstrap
#weblibs << 'node_modules/datatables.net-buttons-bs5/js/buttons.bootstrap5.min.js'
#weblibs << 'node_modules/datatables.net-buttons-bs5/css/buttons.bootstrap5.min.css'
weblibs << 'node_modules/datatables.net-buttons-bs5/js/buttons.bootstrap5.js'
weblibs << 'node_modules/datatables.net-buttons-bs5/css/buttons.bootstrap5.css'
# colVis
weblibs << 'node_modules/datatables.net-buttons/js/dataTables.buttons.js'
weblibs << 'node_modules/datatables.net-buttons/js/buttons.colVis.js'

weblibs.each() do |w|
cp(w, 'lib/oxidized/web/public/weblibs')
end

fonts.each() do |f|
cp(f, 'lib/oxidized/web/public/weblibs/fonts')
end

end

task default: :test
Loading

0 comments on commit a421605

Please sign in to comment.