Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tsc-hooks

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsc-hooks - npm Package Compare versions

Comparing version 1.0.9-dev.20210708.1 to 1.0.9-dev.20210708.2

1

docs/TODO.md

@@ -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

3

hooks/copy-files.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc