
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
it's a tsc wrapper, like tsc-watch.
# run package file
$ npx mwtsc --watch --run @midwayjs/mock/app.js
# run file
$ npx mwtsc --watch --run ./bootstrap.js
# run with tsc options
$ npx mwtsc --watch --project tsconfig.production.json --run ./bootstrap.js
# run with kill timeout
$ npx mwtsc --watch --run ./bootstrap.js --kill-timeout 5000
# the child process keep avaliable during the development
$ npx mwtsc --watch --run ./bootstrap.js --keepalive
# run with inspect and debug in chrome or other supported tools
$ npx mwtsc --watch --inspect --run ./bootstrap.js
$ npx mwtsc --watch --inspect-brk --run ./bootstrap.js
--run option, run file after compile success--kill-timeoutProcess kill timeout in milliseconds. When restarting the application, if the process doesn't exit within this time, it will be forcefully killed.
Default: 2000
When using Ctrl+C to stop the process, it will follow the kill-timeout to kill the process.
--inspect and --inspect-brkIf you're using VSCode or JetBrains IntelliJ IDEA (or other IDEs), you won't need to manually start the child process with debugging flags like --inspect or --inspect-brk. The IDE will automatically attach the debugger to the child process.
However, if you wish to debug the child process within Chrome, you can utilize --inspect or --inspect-brk to initiate the child process with the debugger enabled.
$ npx mwtsc --watch --inspect --run ./bootstrap.js
$ npx mwtsc --watch --inspect-brk --run ./bootstrap.js
Unfortunately, Chrome DevTools cannot directly access local files with certain special protocols due to security policies. To overcome this, we set up a proxy server to serve the source files. You will need to configure the proxy server's location in your tsconfig.json to properly handle source maps.
{
"compilerOptions": {
"sourceRoot": "http://localhost:7788/"
}
}
You can use mwtsc API in your code to extend your own logic.
mwtsc API:
run - run tsc compilechokidar - watch file changerun API:
exit - exit processrestart - restart processonExit - on exit event// custom.js
const { run, chokidar } = require('mwtsc');
const { restart, exit, onExit } = run();
const watcher = chokidar.watch('node_modules/**/*.ts', {
ignoreInitial: true,
ignored: ['**/*.d.ts'],
});
watcher.on('all', (event, path) => {
console.log(event, path);
restart([
'/home/admin/workspace/midwayjs/midway/packages/mock/src/app.ts',
]);
});
onExit(async () => {
await watcher.close();
});
Rewrite dev command in package.json .
{
"scripts": {
"dev": "NODE_ENV=local node ./custom.js --watch --run ./bootstrap.js"
}
}
FAQs
tsc wrapper for midway development
We found that apptsc demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.