Skip to content

Commit

Permalink
new v4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
luisDanielRoviraContreras committed Sep 8, 2019
1 parent de0df19 commit 6f073cc
Show file tree
Hide file tree
Showing 711 changed files with 23,876 additions and 136,713 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

58 changes: 0 additions & 58 deletions .eslintrc

This file was deleted.

21 changes: 21 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/essential',
'@vue/standard',
'eslint:recommended',
'plugin:vue/recommended',
'plugin:vue/base',
'plugin:vue/strongly-recommended'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
parserOptions: {
parser: 'babel-eslint'
}
}
17 changes: 0 additions & 17 deletions .github/ISSUE_TEMPLATE/Bug_report.md

This file was deleted.

17 changes: 0 additions & 17 deletions .github/ISSUE_TEMPLATE/Feature_request.md

This file was deleted.

11 changes: 0 additions & 11 deletions bit.json

This file was deleted.

29 changes: 29 additions & 0 deletions build/build-components.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const fs = require('fs')
const path = require('path')
const { execSync } = require('child_process')
const chalk = require('chalk')
const print = require('./print.js')

const green = print('green')

const getDirectories = source => {
let folders = fs.readdirSync(source)

folders.forEach(name => {
let isDirectory = fs.lstatSync(path.join(source, name)).isDirectory()
if(isDirectory) {
print()
print()
green(`Building Component ${chalk.bold(name)}`)
print()
print()


execSync(
`vue build packages/@vuesax/${name}/index.js --target lib --name ${name} --dest packages/vuesax/dist/components/${name}`
)
}
});
}

module.exports = getDirectories
20 changes: 20 additions & 0 deletions build/copy-components-dist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

const fs = require('fs-extra')
const path = require('path')
// const { execSync } = require('child_process')

const copyStyleComponents = source => {
let folders = fs.readdirSync(source)

folders.forEach(name => {
let isDirectory = fs.lstatSync(path.join(source, name)).isDirectory()
if(isDirectory) {
fs.copy(`packages/vuesax/dist/components/${name}`, `packages/@vuesax/${name}/dist`, err => {
if(err) return console.error(err);
});
}
});
}

module.exports = copyStyleComponents

20 changes: 20 additions & 0 deletions build/copy-style-components.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

const fs = require('fs-extra')
const path = require('path')
const { execSync } = require('child_process')

const copyStyleComponents = source => {
let folders = fs.readdirSync(source)

folders.forEach(name => {
let isDirectory = fs.lstatSync(path.join(source, name)).isDirectory()
if(isDirectory) {
fs.copy(`packages/@vuesax/${name}/main.styl`, `dist/style/components/${name}.styl`, err => {
if(err) return console.error(err);
});
}
});
}

module.exports = copyStyleComponents

75 changes: 75 additions & 0 deletions build/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
const { execSync } = require('child_process')
const path = require('path')
const removeDemoHtml = require('./remove-demo-html.js')
const buildComponents = require('./build-components.js')
const renameFiles = require('./rename-files.js')
const copyStylesComponents = require('./copy-style-components.js')
const copyComponentsDist = require('./copy-components-dist.js')
const print = require('./print.js')
const fs = require('fs-extra')
const chalk = require('chalk')
// const log = console.log

const yellow = print('yellow')
const magenta = print('magenta')
const cyan = print('cyan')
const green = print('green')
const emptyLine = print()

emptyLine()
emptyLine()
yellow(`Building ${chalk.bold('Vuesax')} Framework`)
emptyLine()
emptyLine()

execSync(
`vue build packages/vuesax/index.js --target lib --name vuesax --dest packages/vuesax/dist/`
)

emptyLine()
emptyLine()
magenta(`Building ${chalk.bold('@vuesax Components')}`)
emptyLine()
emptyLine()

buildComponents(path.resolve(__dirname, '../packages/@vuesax'))

removeDemoHtml()

renameFiles()

/*
* Copy Styles
*/

fs.copy('packages/vuesax/style/', 'packages/vuesax/dist/style', err =>{
if(err) return console.error(err);
copyStylesComponents(path.resolve(__dirname, '../packages/@vuesax'))
})

emptyLine()
emptyLine()
cyan(`Copy Components ${chalk.bold('@vuesax/{Component}/dist')}`)
emptyLine()
emptyLine()

copyComponentsDist(path.resolve(__dirname, '../packages/vuesax/dist/components/'))

// fs.copy('dist/', 'packages/vuesax/dist/', err => {
// if(err) return console.error(err);
// });

emptyLine()
emptyLine()
green(chalk.bold(`${'🎉'} Success Build! ${'🎉'}`))
emptyLine()
emptyLine()









37 changes: 37 additions & 0 deletions build/print.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const chalk = require('chalk')

const print = (color = null) => (str = '') => {
const terminalCols = retrieveCols()
const strLength = str.replace(/\u001b\[[0-9]{2}m/g, '').length
const leftPaddingLength = Math.floor((terminalCols - strLength) / 2)
const leftPadding = ' '.repeat(Math.max(leftPaddingLength, 0))

if (color) {
str = chalk[color](str)
}

console.log(leftPadding, str)
}

const retrieveCols = (() => {
let result = false

return () => {
if (result) {
return result
}
const defaultCols = 80

try {
const terminalCols = execSync(`tput cols`, { stdio: ['pipe', 'pipe', 'ignore'] })

result = parseInt(terminalCols.toString()) || defaultCols
} catch (e) {
result = defaultCols
}
return result
}
})()


module.exports = print
34 changes: 34 additions & 0 deletions build/remove-demo-html.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const fs = require('fs')
const path = require('path')

function fromDir(startPath ,filter, callback){

//console.log('Starting from dir '+startPath+'/');

if (!fs.existsSync(startPath)){
console.log("no dir ",startPath);
return;
}

var files=fs.readdirSync(startPath);
for(var i=0;i<files.length;i++){
var filename=path.join(startPath,files[i]);
var stat = fs.lstatSync(filename);
if (stat.isDirectory()){
fromDir(filename,filter,callback); //recurse
}
else if (filter.test(filename)) callback(filename);
};
};



function removeDemoHtml() {
fromDir(path.resolve(__dirname, '../packages/vuesax/dist'),/\.html$/,function(filename){
fs.unlink(filename, (err) => {
if (err) throw err;
})
})
}

module.exports = removeDemoHtml
Loading

0 comments on commit 6f073cc

Please sign in to comment.