diff --git a/_config.yml b/_config.yml index 72a7e8b77bab2df92f6e3cd35a5d40426f2f2eb3..4352ab15d0978d6718badc213686648811dc649f 100644 --- a/_config.yml +++ b/_config.yml @@ -1,7 +1,7 @@ source: pages destination: tmp -version: 1.0.0-alpha.3 +version: 1.0.0-alpha.4 title: Tabler description: Premium and Open Source dashboard template with responsive and high quality UI. github_url: https://github.com/tabler/tabler diff --git a/build/browsersync.js b/build/browsersync.js index d8d735fe1724e2b88880d07a862a1da4bc1c3498..7d823995feb607dbd01a2d28aea86801a7065a79 100755 --- a/build/browsersync.js +++ b/build/browsersync.js @@ -1,10 +1,3 @@ -/* - * Tabler (v0.9.0): browsersync.js - * Copyright 2018-2019 The Tabler Authors - * Copyright 2018-2019 codecalm - * Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE) - */ - const bs = require('browser-sync').create(); bs.init({ diff --git a/build/change-version.js b/build/change-version.js new file mode 100755 index 0000000000000000000000000000000000000000..6be2e335335e4baaf6b1fa6e817ca29d34ad9153 --- /dev/null +++ b/build/change-version.js @@ -0,0 +1,107 @@ +#!/usr/bin/env node + +const fs = require('fs'); +const path = require('path'); +const sh = require('shelljs'); + +sh.config.fatal = true; + +// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37 +function regExpQuote(string) { + return string.replace(/[$()*+-.?[\\\]^{|}]/g, '\\$&') +} + +function regExpQuoteReplacement(string) { + return string.replace(/\$/g, '$$') +} + +const DRY_RUN = false; + +function walkAsync(directory, excludedDirectories, fileCallback, errback) { + if (excludedDirectories.has(path.parse(directory).base)) { + return + } + + fs.readdir(directory, (err, names) => { + if (err) { + errback(err); + return + } + + names.forEach(name => { + const filepath = path.join(directory, name); + fs.lstat(filepath, (err, stats) => { + if (err) { + process.nextTick(errback, err); + return + } + + if (stats.isDirectory()) { + process.nextTick(walkAsync, filepath, excludedDirectories, fileCallback, errback) + } else if (stats.isFile()) { + process.nextTick(fileCallback, filepath) + } + }) + }) + }) +} + +function replaceRecursively(directory, excludedDirectories, allowedExtensions, original, replacement) { + original = new RegExp(regExpQuote(original), 'g'); + replacement = regExpQuoteReplacement(replacement); + const updateFile = DRY_RUN ? + filepath => { + if (allowedExtensions.has(path.parse(filepath).ext)) { + console.log(`FILE: ${filepath}`) + } else { + console.log(`EXCLUDED:${filepath}`) + } + } : + filepath => { + if (allowedExtensions.has(path.parse(filepath).ext)) { + sh.sed('-i', original, replacement, filepath) + } + }; + + walkAsync(directory, excludedDirectories, updateFile, err => { + console.error('ERROR while traversing directory!:'); + console.error(err); + process.exit(1) + }) +} + +function main(args) { + if (args.length !== 2) { + console.error('USAGE: change-version old_version new_version'); + console.error('Got arguments:', args); + process.exit(1); + } + + const oldVersion = args[0]; + const newVersion = args[1]; + const EXCLUDED_DIRS = new Set([ + '.git', + '_gh_pages', + 'node_modules', + 'vendor', + 'demo', + 'dist' + ]); + + const INCLUDED_EXTENSIONS = new Set([ + // This extension whitelist is how we avoid modifying binary files + '', + '.css', + '.html', + '.js', + '.json', + '.md', + '.scss', + '.txt', + '.yml' + ]); + + replaceRecursively('.', EXCLUDED_DIRS, INCLUDED_EXTENSIONS, oldVersion, newVersion) +} + +main(process.argv.slice(2)); \ No newline at end of file diff --git a/build/postcss.config.js b/build/postcss.config.js index 97c8cb9fe50db8337154605972dc4d0d4df8eb62..1f39a438ff6b042f535e839fbaa929bbd7f736b1 100644 --- a/build/postcss.config.js +++ b/build/postcss.config.js @@ -1,10 +1,3 @@ -/* - * Tabler (v0.9.0): postcss.config.js - * Copyright 2018-2019 The Tabler Authors - * Copyright 2018-2019 codecalm - * Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE) - */ - 'use strict'; module.exports = ctx => ({ diff --git a/build/rollup.config.js b/build/rollup.config.js index 2a64387868c3d891321ff67b953bb3f82714a436..d42883ba8f059c3a458ccff98e0e23b3f72be111 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -1,10 +1,3 @@ -/* - * Tabler (v0.9.0): rollup.config.js - * Copyright 2018-2019 The Tabler Authors - * Copyright 2018-2019 codecalm - * Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE) - */ - 'use strict'; const BUNDLE = process.env.BUNDLE === 'true'; diff --git a/build/scss-compile.js b/build/scss-compile.js index d5295916f6d79aee0bda64a6eb4169fd5dfab1ed..be3b48b807ffcef3991d537ed267a02d2b7b52f4 100644 --- a/build/scss-compile.js +++ b/build/scss-compile.js @@ -1,10 +1,3 @@ -/* - * Tabler (v0.9.0): scss-compile.js - * Copyright 2018-2019 The Tabler Authors - * Copyright 2018-2019 codecalm - * Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE) - */ - const BUNDLE = process.env.BUNDLE === 'true'; const path = require('path'), diff --git a/build/unused-files.js b/build/unused-files.js old mode 100644 new mode 100755 index 2c37bb61649f25dc4a54a7f8179b8a12f81d7d57..b7767e40ad3391364e562a203901dac1d7c548c4 --- a/build/unused-files.js +++ b/build/unused-files.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + const glob = require("glob"), fs = require("fs"); @@ -22,6 +24,3 @@ includeFiles.forEach(function (file) { console.log('file', file); } }); - -// console.log('foundFiles', foundFiles); -// console.log('includeFiles', includeFiles); diff --git a/dist/js/tabler.min.js b/dist/js/tabler.min.js index aaca3b1b622b9c04cfb8372539c51f960826231e..d0aa5b16a367de56fe0db9adb63c212767ddbd44 100644 --- a/dist/js/tabler.min.js +++ b/dist/js/tabler.min.js @@ -1,5 +1,5 @@ /*! - * Tabler v1.0.0-alpha.3 (https://tabler.io) + * Tabler v1.0.0-alpha.4 (https://tabler.io) * Copyright 2018-2020 codecalm * Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE) */'use strict';var __assign=window&&window.__assign||function(){return(__assign=Object.assign||function(b){for(var c,d=1,e=arguments.length;dg.endVal?g.endVal:g.frameVal,g.frameVal=Math.round(g.frameVal*g.decimalMult)/g.decimalMult,g.printValue(g.frameVal),bc?"-":"";if(d=b(c).toFixed(g.options.decimalPlaces),j=(f=(d+="").split("."))[0],k=1c;var d=c-this.startVal;if(b(d)>this.options.smartEasingThreshold){this.finalEndVal=c;var e=this.countDown?1:-1;this.endVal=c+e*this.options.smartEasingAmount,this.duration/=2}else this.endVal=c,this.finalEndVal=null;this.useEasing=!this.finalEndVal&&this.options.useEasing},a.prototype.start=function(a){this.error||(this.callback=a,0