Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
b54681f063 | |||
37f3df9deb | |||
4b0d99cf3a | |||
38426a24bc | |||
dadd0b70b3 | |||
516b0ff578 | |||
e5fa36fb06 | |||
228756951f | |||
a22c837eac | |||
a1a341b2de | |||
046d3107e8 | |||
956bcdf16e | |||
f61640b65a | |||
0125591149 | |||
6aa0d800b3 | |||
19160170a9 | |||
8bf9e3d691 | |||
737d43b59e |
@ -19,23 +19,36 @@ mirror:
|
|||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci git mirror
|
- npmci git mirror
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- lossless
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
|
|
||||||
audit:
|
auditProductionDependencies:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
stage: security
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci command npm install --production --ignore-scripts
|
||||||
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
- npmci command npm audit --audit-level=high --only=prod --production
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
|
auditDevDependencies:
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci command npm install --ignore-scripts
|
- npmci command npm install --ignore-scripts
|
||||||
- npmci command npm config set registry https://registry.npmjs.org
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
- npmci command npm audit --audit-level=high
|
- npmci command npm audit --audit-level=high --only=dev
|
||||||
tags:
|
tags:
|
||||||
- lossless
|
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
allow_failure: true
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# test stage
|
# test stage
|
||||||
@ -50,9 +63,7 @@ testStable:
|
|||||||
- npmci npm test
|
- npmci npm test
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- lossless
|
|
||||||
- docker
|
- docker
|
||||||
- priv
|
|
||||||
|
|
||||||
testBuild:
|
testBuild:
|
||||||
stage: test
|
stage: test
|
||||||
@ -63,9 +74,7 @@ testBuild:
|
|||||||
- npmci command npm run build
|
- npmci command npm run build
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- lossless
|
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
@ -85,6 +94,8 @@ release:
|
|||||||
codequality:
|
codequality:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g tslint typescript
|
- npmci command npm install -g tslint typescript
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
|
20418
package-lock.json
generated
20418
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
53
package.json
53
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsbundle",
|
"name": "@gitzone/tsbundle",
|
||||||
"version": "1.0.73",
|
"version": "1.0.82",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a bundler using rollup for painless bundling of web projects",
|
"description": "a bundler using rollup for painless bundling of web projects",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
@ -8,46 +8,45 @@
|
|||||||
"author": "Lossless GmbH",
|
"author": "Lossless GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "cd test && node ../cli.ts.js --production",
|
"test": "(tstest test/) && (cd test && node ../cli.ts.js --production)",
|
||||||
"build": "(tsbuild --web)"
|
"build": "(tsbuild --web)"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsbundle": "cli.js"
|
"tsbundle": "cli.js"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.24",
|
"@gitzone/tsbuild": "^2.1.25",
|
||||||
"@gitzone/tsrun": "^1.2.12",
|
"@gitzone/tsrun": "^1.2.17",
|
||||||
"@gitzone/tstest": "^1.0.43",
|
"@gitzone/tstest": "^1.0.54",
|
||||||
"@pushrocks/tapbundle": "^3.2.9",
|
"@pushrocks/tapbundle": "^3.2.14",
|
||||||
"tslint": "^6.1.3",
|
"tslint": "^6.1.3",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/core": "^7.11.1",
|
"@babel/core": "^7.14.8",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.10.4",
|
"@babel/plugin-proposal-class-properties": "^7.14.5",
|
||||||
"@babel/plugin-proposal-decorators": "^7.10.5",
|
"@babel/plugin-proposal-decorators": "^7.14.5",
|
||||||
"@babel/plugin-transform-runtime": "^7.11.0",
|
"@babel/plugin-transform-runtime": "^7.14.5",
|
||||||
"@babel/preset-env": "^7.11.0",
|
"@babel/preset-env": "^7.14.8",
|
||||||
"@babel/runtime": "^7.11.2",
|
"@babel/runtime": "^7.14.8",
|
||||||
"@pushrocks/early": "^3.0.3",
|
"@pushrocks/early": "^3.0.6",
|
||||||
"@pushrocks/smartcli": "^3.0.12",
|
"@pushrocks/smartcli": "^3.0.14",
|
||||||
"@pushrocks/smartfile": "^8.0.0",
|
"@pushrocks/smartfile": "^8.0.10",
|
||||||
"@pushrocks/smartlog": "^2.0.36",
|
"@pushrocks/smartlog": "^2.0.44",
|
||||||
"@pushrocks/smartlog-destination-local": "^8.0.8",
|
"@pushrocks/smartlog-destination-local": "^8.0.8",
|
||||||
"@pushrocks/smartparcel": "^1.0.5",
|
"@pushrocks/smartparcel": "^1.0.9",
|
||||||
"@rollup/plugin-commonjs": "^12.0.0",
|
"@rollup/plugin-commonjs": "^19.0.1",
|
||||||
"@rollup/plugin-json": "^4.1.0",
|
"@rollup/plugin-json": "^4.1.0",
|
||||||
"@rollup/plugin-node-resolve": "^8.4.0",
|
"@rollup/plugin-node-resolve": "^13.0.2",
|
||||||
"@rollup/plugin-typescript": "^4.1.2",
|
"@rollup/plugin-typescript": "^8.2.3",
|
||||||
"@types/html-minifier": "^3.5.3",
|
"@types/html-minifier": "^4.0.1",
|
||||||
"@types/node": "^14.0.27",
|
"@types/node": "^16.4.0",
|
||||||
"html-minifier": "^4.0.0",
|
"html-minifier": "^4.0.0",
|
||||||
"rollup": "^2.23.1",
|
"rollup": "^2.53.3",
|
||||||
"rollup-plugin-babel": "^4.4.0",
|
"rollup-plugin-babel": "^4.4.0",
|
||||||
"rollup-plugin-sourcemaps": "^0.6.2",
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||||
"rollup-plugin-terser": "^5.3.0",
|
"rollup-plugin-terser": "^7.0.2",
|
||||||
"terser": "^4.7.0",
|
"typescript": "^4.3.5"
|
||||||
"typescript": "^3.9.7"
|
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
|
@ -1,8 +1,15 @@
|
|||||||
import { expect, tap } from '@pushrocks/tapbundle';
|
import { expect, tap } from '@pushrocks/tapbundle';
|
||||||
import * as tsbundle from '../ts/index';
|
import * as tsbundle from '../ts/index';
|
||||||
|
|
||||||
tap.test('first test', async () => {
|
import * as path from 'path';
|
||||||
|
|
||||||
|
tap.skip.test('first test', async () => {
|
||||||
await tsbundle.runCli();
|
await tsbundle.runCli();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
tap.test('should run a custom function', async () => {
|
||||||
|
const tsbundleInstance = new tsbundle.TsBundle();
|
||||||
|
await tsbundleInstance.buildProduction(process.cwd(), './test/ts_web/index.ts', './test/dist_manual/index.js')
|
||||||
|
})
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
@ -1,3 +1,18 @@
|
|||||||
const myConst = 'hello';
|
const myConst: string = 'hello';
|
||||||
|
|
||||||
|
function sealed(constructor: Function) {
|
||||||
|
Object.seal(constructor);
|
||||||
|
Object.seal(constructor.prototype);
|
||||||
|
}
|
||||||
|
|
||||||
|
@sealed
|
||||||
|
class BugReport {
|
||||||
|
type = "report";
|
||||||
|
title: string;
|
||||||
|
|
||||||
|
constructor(t: string) {
|
||||||
|
this.title = t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
console.log(myConst);
|
console.log(myConst);
|
||||||
|
@ -88,8 +88,7 @@ export class TsBundle {
|
|||||||
productionOptions.plugins.push(
|
productionOptions.plugins.push(
|
||||||
plugins.rollupTerser({
|
plugins.rollupTerser({
|
||||||
compress: true,
|
compress: true,
|
||||||
mangle: true,
|
mangle: true
|
||||||
sourcemap: true,
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
return productionOptions;
|
return productionOptions;
|
||||||
@ -127,7 +126,9 @@ export class TsBundle {
|
|||||||
/**
|
/**
|
||||||
* creates a bundle for the production environment
|
* creates a bundle for the production environment
|
||||||
*/
|
*/
|
||||||
public async buildProduction(fromArg: string, toArg: string) {
|
public async buildProduction(cwdArg: string, fromArg: string, toArg: string) {
|
||||||
|
process.chdir(cwdArg);
|
||||||
|
console.log(process.cwd())
|
||||||
// create a bundle
|
// create a bundle
|
||||||
logger.log('info', `bundling for PRODUCTION!`);
|
logger.log('info', `bundling for PRODUCTION!`);
|
||||||
const buildOptions = this.getOptionsProduction(fromArg, toArg);
|
const buildOptions = this.getOptionsProduction(fromArg, toArg);
|
||||||
|
@ -10,7 +10,7 @@ export const runCli = async () => {
|
|||||||
// const htmlHandler = new HtmlHandler();
|
// const htmlHandler = new HtmlHandler();
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case argvArg.production || process.env.CI:
|
case argvArg.production || process.env.CI:
|
||||||
await tsbundle.buildProduction(argvArg.from, argvArg.to);
|
await tsbundle.buildProduction(process.cwd(), argvArg.from, argvArg.to);
|
||||||
// await htmlHandler.minifyHtml();
|
// await htmlHandler.minifyHtml();
|
||||||
break;
|
break;
|
||||||
case argvArg.test:
|
case argvArg.test:
|
||||||
@ -26,7 +26,7 @@ export const runCli = async () => {
|
|||||||
// const htmlHandler = new HtmlHandler();
|
// const htmlHandler = new HtmlHandler();
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case argvArg.production || process.env.CI:
|
case argvArg.production || process.env.CI:
|
||||||
await tsbundle.buildProduction('./ts_web/index.ts', './dist_bundle/bundle.js');
|
await tsbundle.buildProduction(process.cwd(), './ts_web/index.ts', './dist_bundle/bundle.js');
|
||||||
// await htmlHandler.minifyHtml();
|
// await htmlHandler.minifyHtml();
|
||||||
break;
|
break;
|
||||||
case argvArg.test:
|
case argvArg.test:
|
||||||
@ -42,7 +42,7 @@ export const runCli = async () => {
|
|||||||
// const htmlHandler = new HtmlHandler();
|
// const htmlHandler = new HtmlHandler();
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case argvArg.production || process.env.CI:
|
case argvArg.production || process.env.CI:
|
||||||
await tsbundle.buildProduction('./ts/index.ts', './dist_bundle/bundle.js');
|
await tsbundle.buildProduction(process.cwd(), './ts/index.ts', './dist_bundle/bundle.js');
|
||||||
// await htmlHandler.minifyHtml();
|
// await htmlHandler.minifyHtml();
|
||||||
break;
|
break;
|
||||||
case argvArg.test:
|
case argvArg.test:
|
||||||
@ -58,7 +58,7 @@ export const runCli = async () => {
|
|||||||
const htmlHandler = new HtmlHandler();
|
const htmlHandler = new HtmlHandler();
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case argvArg.production || process.env.CI:
|
case argvArg.production || process.env.CI:
|
||||||
await tsbundle.buildProduction('./ts_web/index.ts', './dist_serve/bundle.js');
|
await tsbundle.buildProduction(process.cwd(), './ts_web/index.ts', './dist_serve/bundle.js');
|
||||||
await htmlHandler.minifyHtml();
|
await htmlHandler.minifyHtml();
|
||||||
break;
|
break;
|
||||||
case argvArg.test:
|
case argvArg.test:
|
||||||
|
5
tsconfig.json
Normal file
5
tsconfig.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"experimentalDecorators": true
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user