Comparing version 1.0.9-dev.20210708.1 to 1.0.9-dev.20210708.2
@@ -7,1 +7,2 @@ - Only cache hooks that are requested, then take from GitHub/put hooks in npmignore | ||
- Allow asynchronous calls | ||
- Find a way to tell editors to ignore the property |
@@ -5,3 +5,2 @@ module.exports = { | ||
onPostCompilation: function() { | ||
const glob = require('glob'); | ||
const path = require('path'); | ||
@@ -13,3 +12,3 @@ const fs = require('fs'); | ||
const files = include?.reduce((files, file) => glob.sync(file, { ignore }), []) || []; | ||
const files = include?.reduce((files, file) => this.glob.sync(file, { ignore }), []) || []; | ||
for (const file of files) { | ||
@@ -16,0 +15,0 @@ if (file.endsWith('.js') || (!this.tsconfig.compilerOptions?.allowTS && file.endsWith('.ts'))) continue; |
@@ -5,16 +5,16 @@ module.exports = { | ||
arguments: { // Custom arguments when using tsc | ||
messageVarName: [ 'm', 'message' ] // Used like "tsc --message 'Cool Message'" or "tsc -m 'Cool Alias'" | ||
messageVarName: [ 'msg', 'message' ] // Used like "tsc --message 'Cool Message'" or "tsc -msg 'Cool Alias'" | ||
}, | ||
onInitCompilation: function() { | ||
// This function is executed before tsc has started compilation | ||
console.log('Before compilation'); | ||
console.log(this.chalk.cyan('onInitCompilation is executed before tsc has started compilation')); | ||
console.log('Bellow is the `this` context in the onInitCompilation function:'); | ||
console.log(this); | ||
// this.config.compilerOptions.message | ||
// this.args.messageVarName | ||
}, | ||
onPostCompilation: function() { | ||
// This function is executed after tsc has completed compilation | ||
console.log('After compilation'); | ||
console.log(this.chalk.magenta('onPostCompilation is executed after tsc has completed compilation')); | ||
console.log('Bellow is the `this` context in the onPostCompilation function:'); | ||
console.log(this); | ||
} | ||
} |
@@ -60,3 +60,3 @@ const fs = require('fs'); | ||
for (const prop of config) { | ||
eval(`delete copyTSConfig.${prop}`); | ||
eval(`delete copyTSConfig?.${prop.replace(/\./g, '?.')}`); | ||
} | ||
@@ -63,0 +63,0 @@ fs.writeFileSync(tsconfigPath, JSON.stringify(copyTSConfig)); |
{ | ||
"name": "tsc-hooks", | ||
"version": "1.0.9-dev.20210708.1", | ||
"version": "1.0.9-dev.20210708.2", | ||
"description": "Add tsc compiler hooks to your TypeScript project", | ||
@@ -5,0 +5,0 @@ "main": "run.js", |
107001
130