Comparing version 1.1.2-dev.20211113.1 to 1.1.2-dev.20211115.1
@@ -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')); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
151562
287
13