New build

pull/827/head
Cagatay Civici 2020-12-29 21:25:30 +03:00
parent 4795feeb1b
commit 382bc7dabd
397 changed files with 413 additions and 397 deletions

View File

@ -1,32 +1,71 @@
const fs = require('fs-extra'); const fs = require('fs-extra');
const path = require('path'); const path = require('path');
const { execSync } = require('child_process'); const Service = require('@vue/cli-service/lib/Service');
const vueCliServicePath = path.resolve(__dirname, 'node_modules/@vue/cli-service/bin/vue-cli-service'); const service = new Service(process.env.VUE_CLI_CONTEXT || process.cwd());
const babelPath = path.resolve(__dirname, 'node_modules/@babel/cli/bin/babel'); const _file = require("@babel/cli/lib/babel/file");
fs.readdirSync(path.resolve(__dirname, './src/components/')).forEach(folder => { function buildComponent(folder, file, name) {
fs.readdirSync(path.resolve(__dirname, './src/components/' + folder)).forEach(file => { service.run('build', {
let filename = file.split(/(.vue)$|(.js)$/)[0].toLowerCase(); _: ['build', 'src/components/' + folder + '/' + file, 'build'],
if (/\.vue$/.test(file)) { modern: false,
console.log('Building ' + green(filename)); report: false,
'report-json': false,
execSync( 'inline-vue': false,
`node ${vueCliServicePath} build src/components/${folder}/${file} --target lib --name ${filename} --dest components/${folder} --no-clean ` watch: false,
) open: false,
copy: true,
https: false,
verbose: false,
target: 'lib',
clean: false,
name: name,
dest: 'dist/' + folder
},
[
'build',
'src/components/' + folder + '/' + file,
'build',
'--target',
'lib',
'--no-clean',
'--name',
name,
'--dest',
'dist/' + folder
]);
} }
else if (/\.js$/.test(file)) {
console.log('Building ' + blue(filename));
execSync( function transpileJS(folder, file) {
`node ${vueCliServicePath} build src/components/${folder}/${file} --target lib --name ${filename} --dest components/${folder} --no-clean ` var options = {
) babelOptions: {
configFile: './.babelrc-lib'
execSync( },
`node ${babelPath} src/components/${folder}/${file} --out-file components/${folder}/${file} --config-file=./.babelrc-lib` cliOptions: {
) filename: undefined,
filenames: ['src/components/' + folder + '/' + file],
extensions: undefined,
keepFileExtension: undefined,
outFileExtension: undefined,
watch: undefined,
skipInitialBuild: undefined,
outFile: 'dist/' + folder + '/' + file,
outDir: undefined,
relative: undefined,
copyFiles: undefined,
copyIgnored: undefined,
includeDotfiles: undefined,
verbose: undefined,
quiet: undefined,
deleteDirOnStart: undefined,
sourceMapTarget: undefined
} }
}
_file.default(options).catch(err => {
console.error(err);
process.exitCode = 1;
}); });
}); }
function blue(str) { function blue(str) {
return '\x1b[1m\x1b[34m' + str + '\x1b[39m\x1b[22m'; return '\x1b[1m\x1b[34m' + str + '\x1b[39m\x1b[22m';
@ -35,3 +74,32 @@ function blue (str) {
function green(str) { function green(str) {
return '\x1b[1m\x1b[32m' + str + '\x1b[39m\x1b[22m'; return '\x1b[1m\x1b[32m' + str + '\x1b[39m\x1b[22m';
} }
fs.readdirSync(path.resolve(__dirname, './src/components/')).forEach(folder => {
fs.readdirSync(path.resolve(__dirname, './src/components/' + folder)).forEach(file => {
if (!(/\.js$/.test(file)) || file === 'index.js') {
fs.copySync(path.resolve(__dirname, './src/components/' + folder) + '/' + file, 'dist/' + folder + '/' + file);
}
});
});
fs.readdirSync(path.resolve(__dirname, './src/components/')).forEach(folder => {
fs.readdirSync(path.resolve(__dirname, './src/components/' + folder)).forEach(file => {
if (file !== 'index.js' && file !== 'index.d.ts') {
let name = file.split(/(.vue)$|(.js)$/)[0].toLowerCase();
if (/\.js$/.test(file)) {
console.log('Transpiling ' + blue(file));
buildComponent(folder, file, name);
transpileJS(folder, file);
}
else if (/\.vue$/.test(file)) {
console.log('Building ' + green(name));
buildComponent(folder, file, name);
}
}
});
});
fs.copySync(path.resolve(__dirname, './package-build.json'), 'dist/package.json');
fs.copySync(path.resolve(__dirname, './README.md'), 'dist/README.md');
fs.copySync(path.resolve(__dirname, './LICENSE.md'), 'dist/LICENSE.md');

View File

@ -1 +0,0 @@
export * from './components/accordion/Accordion';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/accordion/Accordion.vue');

View File

@ -1 +0,0 @@
export * from './components/accordiontab/AccordionTab';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/accordiontab/AccordionTab.vue');

View File

@ -1 +0,0 @@
export * from './components/autocomplete/AutoComplete';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/autocomplete/AutoComplete.vue');

1
exports/avatar.d.ts vendored
View File

@ -1 +0,0 @@
export * from './components/avatar/Avatar';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/avatar/Avatar.vue');

View File

@ -1 +0,0 @@
export * from './components/avatargroup/AvatarGroup';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/avatargroup/AvatarGroup.vue');

1
exports/badge.d.ts vendored
View File

@ -1 +0,0 @@
export * from './components/badge/Badge';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/badge/Badge.vue');

View File

@ -1 +0,0 @@
export * from './components/badge/BadgeDirective';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/badge/BadgeDirective.js');

View File

@ -1 +0,0 @@
export * from './components/blockui/BlockUI';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/blockui/BlockUI.vue');

View File

@ -1 +0,0 @@
export * from './components/breadcrumb/Breadcrumb';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/breadcrumb/Breadcrumb.vue');

1
exports/button.d.ts vendored
View File

@ -1 +0,0 @@
export * from './components/button/Button';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/button/Button.vue');

View File

@ -1 +0,0 @@
export * from './components/calendar/Calendar';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/calendar/Calendar.vue');

1
exports/card.d.ts vendored
View File

@ -1 +0,0 @@
export * from './components/card/Card';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/card/Card.vue');

View File

@ -1 +0,0 @@
export * from './components/carousel/Carousel';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/carousel/Carousel.vue');

View File

@ -1 +0,0 @@
export * from './components/cascadeselect/CascadeSelect';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/cascadeselect/CascadeSelect.vue');

1
exports/chart.d.ts vendored
View File

@ -1 +0,0 @@
export * from './components/chart/Chart';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/chart/Chart.vue');

View File

@ -1 +0,0 @@
export * from './components/checkbox/Checkbox';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/checkbox/Checkbox.vue');

1
exports/chip.d.ts vendored
View File

@ -1 +0,0 @@
export * from './components/chip/Chip';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/chip/Chip.vue');

1
exports/chips.d.ts vendored
View File

@ -1 +0,0 @@
export * from './components/chips/Chips';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/chips/Chips.vue');

View File

@ -1 +0,0 @@
export * from './components/colorpicker/ColorPicker';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/colorpicker/ColorPicker.vue');

1
exports/column.d.ts vendored
View File

@ -1 +0,0 @@
export * from './components/column/Column';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/column/Column.vue');

View File

@ -1 +0,0 @@
export * from './components/columngroup/ColumnGroup';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/columngroup/ColumnGroup.vue');

1
exports/config.d.ts vendored
View File

@ -1 +0,0 @@
export * from './components/config/PrimeVue';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/config/PrimeVue.js');

View File

@ -1 +0,0 @@
export * from './components/confirmation/ConfirmationService';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/confirmation/ConfirmationService.js');

View File

@ -1 +0,0 @@
export * from './components/confirmdialog/ConfirmDialog';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/confirmdialog/ConfirmDialog.vue');

View File

@ -1 +0,0 @@
export * from './components/confirmpopup/ConfirmPopup';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/confirmpopup/ConfirmPopup.vue');

View File

@ -1 +0,0 @@
export * from './components/contextmenu/ContextMenu';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/contextmenu/ContextMenu.vue');

View File

@ -1 +0,0 @@
export * from './components/datatable/DataTable';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/datatable/DataTable.vue');

View File

@ -1 +0,0 @@
export * from './components/dataview/DataView';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/dataview/DataView.vue');

View File

@ -1 +0,0 @@
export * from './components/dataviewlayoutoptions/DataViewLayoutOptions';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/dataviewlayoutoptions/DataViewLayoutOptions.vue');

View File

@ -1 +0,0 @@
export * from './components/deferredcontent/DeferredContent';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/deferredcontent/DeferredContent.vue');

1
exports/dialog.d.ts vendored
View File

@ -1 +0,0 @@
export * from './components/dialog/Dialog';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/dialog/Dialog.vue');

View File

@ -1 +0,0 @@
export * from './components/divider/Divider';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/divider/Divider.vue');

View File

@ -1 +0,0 @@
export * from './components/dropdown/Dropdown';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/dropdown/Dropdown.vue');

1
exports/editor.d.ts vendored
View File

@ -1 +0,0 @@
export * from './components/editor/Editor';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/editor/Editor.vue');

View File

@ -1 +0,0 @@
export * from './components/fieldset/Fieldset';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/fieldset/Fieldset.vue');

View File

@ -1 +0,0 @@
export * from './components/fileupload/FileUpload';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/fileupload/FileUpload.vue');

View File

@ -1 +0,0 @@
export * from './components/fullcalendar/FullCalendar';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/fullcalendar/FullCalendar.vue');

View File

@ -1 +0,0 @@
export * from './components/galleria/Galleria';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/galleria/Galleria.vue');

View File

@ -1 +0,0 @@
export * from './components/inlinemessage/InlineMessage';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/inlinemessage/InlineMessage.vue');

View File

@ -1 +0,0 @@
export * from './components/inplace/Inplace';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/inplace/Inplace.vue');

View File

@ -1 +0,0 @@
export * from './components/inputmask/InputMask';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/inputmask/InputMask.vue');

View File

@ -1 +0,0 @@
export * from './components/inputnumber/InputNumber';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/inputnumber/InputNumber.vue');

View File

@ -1 +0,0 @@
export * from './components/inputswitch/InputSwitch';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/inputswitch/InputSwitch.vue');

View File

@ -1 +0,0 @@
export * from './components/inputtext/InputText';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/inputtext/InputText.vue');

1
exports/knob.d.ts vendored
View File

@ -1 +0,0 @@
export * from './components/knob/Knob';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/knob/Knob.vue');

View File

@ -1 +0,0 @@
export * from './components/listbox/Listbox';

View File

@ -1,3 +0,0 @@
'use strict';
module.exports = require('./components/listbox/Listbox.vue');

View File

@ -1 +0,0 @@
export * from './components/megamenu/MegaMenu';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/megamenu/MegaMenu.vue');

1
exports/menu.d.ts vendored
View File

@ -1 +0,0 @@
export * from './components/menu/Menu';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/menu/Menu.vue');

View File

@ -1 +0,0 @@
export * from './components/menubar/Menubar';

View File

@ -1,2 +0,0 @@
'use strict';
module.exports = require('./components/menubar/Menubar.vue');

View File

@ -1 +0,0 @@
export * from './components/message/Message';

Some files were not shown because too many files have changed in this diff Show More