Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"project": "tsconfig.eslint.json",
"sourceType": "module"
},
"plugins": [
Expand Down
57 changes: 53 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"prettier": "^3.3.2",
"rimraf": "^5.0.7",
"rollup": "^4.18.0",
"rollup-plugin-shebang-bin": "^0.1.0",
"typescript": "5.5.2"
},
"dependencies": {
Expand Down
5 changes: 4 additions & 1 deletion rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import typescript from '@rollup/plugin-typescript';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import shebang from 'rollup-plugin-shebang-bin'

/** @type {import('rollup').RollupOptions} */
const baseConfig = {
output: {
dir: 'dist',
format: 'esm'
},
plugins: [
nodeResolve(),
typescript({ tsconfig: './tsconfig.json' })
typescript({ tsconfig: './tsconfig.json' }),
shebang({ include: "src/clientApp.ts" }),
Copy link
Member

@admon84 admon84 Feb 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this can be done with a banner in the output section instead of adding the shebang plugin

banner: '#!/usr/bin/env node'

Copy link
Author

@tiennou tiennou Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not only about the banner, we need a chmod +x to happen to the output, otherwise you get a EPERM error when trying to exec that on a *nix platform. Like, node ./clientApp.js would work (since the thing being exec'd is node, which has its +x bit set), but ./clientApp.js wouldn't.

],
external: id => /node_modules/.test(id)
};
Expand Down
1 change: 0 additions & 1 deletion src/clientApp.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env node
import views from '@ladjs/koa-views';
import { ArgumentParser } from 'argparse';
import chalk from 'chalk';
Expand Down
7 changes: 7 additions & 0 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"include": [
"src",
"rollup.config.mjs"
]
}
Loading