@cmmn/tools 1.4.8 → 1.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin.js +1 -1
- package/bundle/bundle.js +5 -3
- package/bundle/rollup.config.js +9 -6
- package/compile/compile.js +3 -3
- package/package.json +2 -2
package/bin.js
CHANGED
package/bundle/bundle.js
CHANGED
|
@@ -89,16 +89,16 @@ export async function bundle(...options) {
|
|
|
89
89
|
console.log('START BUNDLING');
|
|
90
90
|
break;
|
|
91
91
|
case 'END':
|
|
92
|
-
console.log(
|
|
92
|
+
console.log(`FINISH at ${new Date().toTimeString().substring(0,8)}`);
|
|
93
93
|
break;
|
|
94
94
|
case 'BUNDLE_START':
|
|
95
95
|
for (let key in event.input){
|
|
96
|
-
console.log(
|
|
96
|
+
console.log(`\t${key} -> ${event.output}`);
|
|
97
97
|
}
|
|
98
98
|
break;
|
|
99
99
|
case 'BUNDLE_END':
|
|
100
100
|
for (let key in event.input){
|
|
101
|
-
console.log(
|
|
101
|
+
console.log(`\t${key} -> ${event.output}, (${event.duration / 1000}s)`);
|
|
102
102
|
}
|
|
103
103
|
break;
|
|
104
104
|
|
|
@@ -119,6 +119,8 @@ export async function bundle(...options) {
|
|
|
119
119
|
break;
|
|
120
120
|
}
|
|
121
121
|
break;
|
|
122
|
+
default:
|
|
123
|
+
console.warn('WARNING:', event)
|
|
122
124
|
}
|
|
123
125
|
});
|
|
124
126
|
}
|
package/bundle/rollup.config.js
CHANGED
|
@@ -195,14 +195,17 @@ export class ConfigCreator {
|
|
|
195
195
|
output: this.output,
|
|
196
196
|
external: (this.options.external || []).map(s => new RegExp(s)),
|
|
197
197
|
onwarn(warning) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
198
|
+
switch (warning.code){
|
|
199
|
+
case 'CIRCULAR_DEPENDENCY':
|
|
200
|
+
return;
|
|
201
|
+
case 'THIS_IS_UNDEFINED':
|
|
202
|
+
console.log(`${warning.message} at`);
|
|
203
|
+
console.log(`\t${warning.id}`);
|
|
204
|
+
break;
|
|
205
|
+
default:
|
|
206
|
+
console.warn(`\t(!) ${warning.message}`)
|
|
203
207
|
}
|
|
204
208
|
|
|
205
|
-
console.warn(`(!) ${warning.message}`)
|
|
206
209
|
},
|
|
207
210
|
plugins: this.plugins,
|
|
208
211
|
treeshake: this.options.minify ? "smallest" : "recommended",
|
package/compile/compile.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ts from "ttypescript";
|
|
2
|
-
import {resolve} from 'path';
|
|
2
|
+
import {resolve, relative} from 'path';
|
|
3
3
|
|
|
4
4
|
const rootDir = process.cwd();
|
|
5
5
|
|
|
@@ -16,7 +16,7 @@ export function compile(...flags) {
|
|
|
16
16
|
incremental: true,
|
|
17
17
|
dry: false
|
|
18
18
|
}, {
|
|
19
|
-
excludeDirectories: ["node_modules", "dist"]
|
|
19
|
+
excludeDirectories: ["node_modules", "dist"],
|
|
20
20
|
});
|
|
21
21
|
builder.clean(rootDir);
|
|
22
22
|
builder.build(rootDir);
|
|
@@ -26,7 +26,7 @@ function createProgram(rootNames, options, host, oldProgram, configFileParsingDi
|
|
|
26
26
|
options.outDir = resolve(options.configFilePath, '../dist/esm');
|
|
27
27
|
options.declarationDir = resolve(options.configFilePath, '../dist/typings');
|
|
28
28
|
options.baseUrl = resolve(options.configFilePath, '../');
|
|
29
|
-
console.log('
|
|
29
|
+
console.log('\t', relative(process.cwd(), options.baseUrl));
|
|
30
30
|
return ts.createEmitAndSemanticDiagnosticsBuilderProgram(
|
|
31
31
|
rootNames, options, host, oldProgram, configFileParsingDiagnostics, projectReferences
|
|
32
32
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmmn/tools",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.12",
|
|
4
4
|
"description": "Compilation, bundling, code generator, testing.",
|
|
5
5
|
"main": "dist/rollup.config.js",
|
|
6
6
|
"type": "module",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
},
|
|
66
66
|
"author": "",
|
|
67
67
|
"license": "ISC",
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "6d71154c76d97bf9e1a8ebd52ab3c31df797d56d"
|
|
69
69
|
}
|