fix(core): update

This commit is contained in:
Philipp Kunz 2020-07-07 18:55:17 +00:00
parent e244ca30b9
commit 558edb8f09
4 changed files with 7177 additions and 184 deletions

7301
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -17,8 +17,8 @@
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.24", "@gitzone/tsbuild": "^2.1.24",
"@gitzone/tsrun": "^1.2.8", "@gitzone/tsrun": "^1.2.12",
"@gitzone/tstest": "^1.0.28", "@gitzone/tstest": "^1.0.33",
"@pushrocks/tapbundle": "^3.2.1", "@pushrocks/tapbundle": "^3.2.1",
"tslint": "^6.1.2", "tslint": "^6.1.2",
"tslint-config-prettier": "^1.15.0" "tslint-config-prettier": "^1.15.0"
@ -31,23 +31,24 @@
"@babel/preset-env": "^7.9.6", "@babel/preset-env": "^7.9.6",
"@babel/runtime": "^7.9.6", "@babel/runtime": "^7.9.6",
"@pushrocks/early": "^3.0.3", "@pushrocks/early": "^3.0.3",
"@pushrocks/smartcli": "^3.0.11", "@pushrocks/smartcli": "^3.0.12",
"@pushrocks/smartfile": "^7.0.12", "@pushrocks/smartfile": "^7.0.12",
"@pushrocks/smartlog": "^2.0.21", "@pushrocks/smartlog": "^2.0.35",
"@pushrocks/smartlog-destination-local": "^8.0.2", "@pushrocks/smartlog-destination-local": "^8.0.8",
"@pushrocks/smartparcel": "^1.0.3",
"@rollup/plugin-commonjs": "^12.0.0", "@rollup/plugin-commonjs": "^12.0.0",
"@rollup/plugin-json": "^4.0.3", "@rollup/plugin-json": "^4.0.3",
"@rollup/plugin-node-resolve": "^8.0.0", "@rollup/plugin-node-resolve": "^8.0.0",
"@rollup/plugin-typescript": "^4.1.2", "@rollup/plugin-typescript": "^4.1.2",
"@types/html-minifier": "^3.5.3", "@types/html-minifier": "^3.5.3",
"@types/node": "^14.0.5", "@types/node": "^14.0.19",
"html-minifier": "^4.0.0", "html-minifier": "^4.0.0",
"rollup": "^2.10.9", "rollup": "^2.10.9",
"rollup-plugin-babel": "^4.4.0", "rollup-plugin-babel": "^4.4.0",
"rollup-plugin-sourcemaps": "^0.6.2", "rollup-plugin-sourcemaps": "^0.6.2",
"rollup-plugin-terser": "^5.3.0", "rollup-plugin-terser": "^5.3.0",
"terser": "^4.7.0", "terser": "^4.7.0",
"typescript": "^3.9.3" "typescript": "^3.9.6"
}, },
"files": [ "files": [
"ts/**/*", "ts/**/*",

View File

@ -18,17 +18,19 @@ export class TsBundle {
name: 'tsbundle', name: 'tsbundle',
file: toArg, file: toArg,
format: 'iife', format: 'iife',
sourcemap: true sourcemap: true,
}, },
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash') // Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
external: [], external: [],
watch: { watch: {
include: ['src/**'] include: ['src/**'],
}, },
plugins: [ plugins: [
// Compile TypeScript files // Compile TypeScript files
plugins.rollupTypescript({ plugins.rollupTypescript({
include: plugins.path.parse(fromArg).dir ? plugins.path.parse(fromArg).dir + '/**/*.ts' : '**/*.ts', include: plugins.path.parse(fromArg).dir
? plugins.path.parse(fromArg).dir + '/**/*.ts'
: '**/*.ts',
declaration: false, declaration: false,
emitDecoratorMetadata: true, emitDecoratorMetadata: true,
experimentalDecorators: true, experimentalDecorators: true,
@ -37,7 +39,7 @@ export class TsBundle {
lib: ['esnext', 'dom', 'es2017.object'], lib: ['esnext', 'dom', 'es2017.object'],
noImplicitAny: false, noImplicitAny: false,
target: 'es2018', target: 'es2018',
allowSyntheticDefaultImports: true allowSyntheticDefaultImports: true,
}), }),
plugins.rollupJson(), plugins.rollupJson(),
// Allow node_modules resolution, so you can use 'external' to control // Allow node_modules resolution, so you can use 'external' to control
@ -47,7 +49,7 @@ export class TsBundle {
plugins.rollupCommonjs({}), plugins.rollupCommonjs({}),
// Resolve source maps to the original source // Resolve source maps to the original source
plugins.rollupSourceMaps() plugins.rollupSourceMaps(),
/*plugins.rollupBabel({ /*plugins.rollupBabel({
runtimeHelpers: true, runtimeHelpers: true,
extensions: ['.js', '.jsx', '.ts', '.tsx'], extensions: ['.js', '.jsx', '.ts', '.tsx'],
@ -72,7 +74,7 @@ export class TsBundle {
] ]
] ]
})*/ })*/
] ],
}; };
return baseOptions; return baseOptions;
} }
@ -87,7 +89,7 @@ export class TsBundle {
plugins.rollupTerser({ plugins.rollupTerser({
compress: true, compress: true,
mangle: true, mangle: true,
sourcemap: true sourcemap: true,
}) })
); );
return productionOptions; return productionOptions;
@ -100,14 +102,26 @@ export class TsBundle {
/** /**
* creates a bundle for the test enviroment * creates a bundle for the test enviroment
*/ */
public async buildTest(fromArg: string, toArg: string) { public async buildTest(
fromArg: string,
toArg: string,
bundlerArg: 'rollup' | 'parcel' = 'rollup'
) {
// create a bundle // create a bundle
logger.log('info', `bundling for TEST!`); switch (bundlerArg) {
const buildOptions = this.getOptionsTest(fromArg, toArg); case 'rollup':
const bundle = await plugins.rollup.rollup(buildOptions); logger.log('info', `bundling for TEST!`);
bundle.generate(buildOptions.output as plugins.rollup.OutputOptions); const buildOptions = this.getOptionsTest(fromArg, toArg);
await bundle.write(buildOptions.output as plugins.rollup.OutputOptions); const bundle = await plugins.rollup.rollup(buildOptions);
logger.log('ok', `Successfully bundled files!`); bundle.generate(buildOptions.output as plugins.rollup.OutputOptions);
await bundle.write(buildOptions.output as plugins.rollup.OutputOptions);
logger.log('ok', `Successfully bundled files!`);
break;
case 'parcel':
const parsedPath = plugins.path.parse(toArg);
const parcelInstance = new plugins.smartparcel.Parcel(fromArg, parsedPath.dir, parsedPath.base);
await parcelInstance.build();
}
} }
/** /**

View File

@ -8,8 +8,9 @@ import * as smartcli from '@pushrocks/smartcli';
import * as smartfile from '@pushrocks/smartfile'; import * as smartfile from '@pushrocks/smartfile';
import * as smartlog from '@pushrocks/smartlog'; import * as smartlog from '@pushrocks/smartlog';
import * as smartlogDestinationLocal from '@pushrocks/smartlog-destination-local'; import * as smartlogDestinationLocal from '@pushrocks/smartlog-destination-local';
import * as smartparcel from '@pushrocks/smartparcel';
export { smartcli, smartfile, smartlog, smartlogDestinationLocal }; export { smartcli, smartfile, smartlog, smartlogDestinationLocal, smartparcel };
// third party scope // third party scope
import * as rollup from 'rollup'; import * as rollup from 'rollup';