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.1.2-dev.20211113.1 to 1.1.2-dev.20211115.1

2

hooks/copy-files/copy-files.hook.js

@@ -28,3 +28,3 @@ const fs = require('fs');

// Register files to watch on change
api.watch.apply(api, includedFiles);
api.watch.apply(api, Array.from(includedFiles));

@@ -31,0 +31,0 @@ // Remove include and exclude files that aren't typescript from tsconfig for compilation

{
"name": "tsc-hooks",
"version": "1.1.2-dev.20211113.1",
"version": "1.1.2-dev.20211115.1",
"description": "Add tsc compiler hooks to your TypeScript project",

@@ -15,2 +15,6 @@ "main": "run.js",

],
"injectionPaths": [
"typescript/bin/tsc",
"@nestjs/cli/bin/nest"
],
"scripts": {

@@ -17,0 +21,0 @@ "postinstall": "node run postinstall",

const path = require('path');
const fs = require('fs');
const { injectionPaths } = require('./package.json');
const script = require(path.resolve(__dirname, 'scripts', process.argv[2]));
if (script instanceof Function) {
script(path.resolve(process.cwd(), '../typescript/bin/tsc'));
for (const injectionPath of injectionPaths) {
const absoluteInjectionPath = path.resolve(process.cwd(), '../', injectionPath);
if (fs.existsSync(absoluteInjectionPath)) {
script(absoluteInjectionPath);
}
}
}
const path = require('path');
const fs = require('fs');
module.exports = (TSC_BIN_PATH) => {
module.exports = (BIN_PATH) => {
const INJECTION_PATH = path.resolve(__dirname, '../lib/injection');
const BIN_FILE = fs.readFileSync(BIN_PATH, 'utf-8').split('\n');
const script = [
'#!/usr/bin/env node',
BIN_FILE.shift(),
`require('${path.relative(path.dirname(TSC_BIN_PATH), INJECTION_PATH).replace(/\\/g, '/')}')`,
"require('../lib/tsc.js')"
...BIN_FILE
];

@@ -12,0 +13,0 @@

const fs = require('fs');
module.exports = (TSC_BIN_PATH) => {
fs.writeFileSync(TSC_BIN_PATH, "#!/usr/bin/env node\nrequire('../lib/tsc.js')\n");
module.exports = (BIN_PATH) => {
const BIN_FILE = fs.readFileSync(BIN_PATH, 'utf-8').split('\n');
BIN_FILE.splice(1, 1);
fs.writeFileSync(BIN_PATH, BIN_FILE.join('\n'));
}
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