forked from lusaxweb/vuesax
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de0df19
commit 6f073cc
Showing
711 changed files
with
23,876 additions
and
136,713 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.