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

View File

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