Skip to content
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
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ demo/.*\.js
demo/.*\.html
demo/.*\.css

# ignore python files/folders
# ignore Python files/folders
setup.py
usage.py
setup.py
Expand Down
31 changes: 31 additions & 0 deletions R/themes.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.prependBootswatch <- function(suffix) {
BOOTSWATCH_BASE <- "https://stackpath.bootstrapcdn.com/bootswatch/4.5.0/"
return(paste(BOOTSWATCH_BASE, suffix, sep=""))
}

#' @export'
dbcThemes <- list(
BOOTSTRAP = "https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css",
GRID = "https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap-grid.min.css",
CERULEAN = .prependBootswatch("cerulean/bootstrap.min.css"),
COSMO = .prependBootswatch("cosmo/bootstrap.min.css"),
CYBORG = .prependBootswatch("cyborg/bootstrap.min.css"),
DARKLY = .prependBootswatch("darkly/bootstrap.min.css"),
FLATLY = .prependBootswatch("flatly/bootstrap.min.css"),
JOURNAL = .prependBootswatch("journal/bootstrap.min.css"),
LITERA = .prependBootswatch("litera/bootstrap.min.css"),
LUMEN = .prependBootswatch("lumen/bootstrap.min.css"),
LUX = .prependBootswatch("lux/bootstrap.min.css"),
MATERIA = .prependBootswatch("materia/bootstrap.min.css"),
MINTY = .prependBootswatch("minty/bootstrap.min.css"),
PULSE = .prependBootswatch("pulse/bootstrap.min.css"),
SANDSTONE = .prependBootswatch("sandstone/bootstrap.min.css"),
SIMPLEX = .prependBootswatch("simplex/bootstrap.min.css"),
SKETCHY = .prependBootswatch("sketchy/bootstrap.min.css"),
SLATE = .prependBootswatch("slate/bootstrap.min.css"),
SOLAR = .prependBootswatch("solar/bootstrap.min.css"),
SPACELAB = .prependBootswatch("spacelab/bootstrap.min.css"),
SUPERHERO = .prependBootswatch("superhero/bootstrap.min.css"),
UNITED = .prependBootswatch("united/bootstrap.min.css"),
YETI = .prependBootswatch("yeti/bootstrap.min.css")
)
33 changes: 0 additions & 33 deletions R/zzz.R

This file was deleted.

14 changes: 13 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const {dest, parallel, series, src} = require('gulp');
const del = require('del');
const mkdirp = require('mkdirp');
const rename = require('gulp-rename');
const footer = require('gulp-footer');

function cleanLib() {
mkdirp.sync('lib');
Expand Down Expand Up @@ -42,5 +43,16 @@ function copyGeneratedFiles() {
.pipe(dest('dash_bootstrap_components/_components'));
}

exports.default = series(copyGeneratedFiles, cleanGeneratedFiles);
function addThemesToRNamespace() {
return src('NAMESPACE')
.pipe(footer('export(dbcThemes)'))
.pipe(dest('.', {overwrite: true}));
}

exports.postPyBuild = series(copyGeneratedFiles, cleanGeneratedFiles);
exports.clean = parallel(cleanGeneratedFiles, cleanComponents, cleanLib);
exports.postRBuild = series(
copyGeneratedFiles,
cleanGeneratedFiles,
addThemesToRNamespace
);
138 changes: 138 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"build": "run-s clean build:js build:py build:r",
"build:lib": "webpack --config=webpack/config.lib.js",
"build:js": "NODE_ENV=production webpack --config=webpack/config.dist.js",
"build:py": "dash-generate-components ./src/components dash_bootstrap_components && gulp",
"build:r": "dash-generate-components ./src/components dash_bootstrap_components --r-prefix 'dbc' && gulp",
"build:py": "dash-generate-components ./src/components dash_bootstrap_components && gulp postPyBuild",
"build:r": "dash-generate-components ./src/components dash_bootstrap_components --r-prefix 'dbc' && gulp postRBuild",
"clean": "gulp clean",
"demo": "webpack-dev-server --hot --inline --port=8888 --config=webpack/config.demo.js",
"format": "prettier src/**/*.js --write",
Expand Down Expand Up @@ -46,6 +46,7 @@
"css-loader": "^1.0.1",
"del": "^5.1.0",
"gulp": "^4.0.2",
"gulp-footer": "^2.0.2",
"gulp-rename": "^2.0.0",
"jest": "^24.9.0",
"mkdirp": "^0.5.4",
Expand Down