@thiagodiogo/psjava 0.0.1-beta.3 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/cli.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# psjava
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@thiagodiogo/psjava)
|
|
4
4
|
[](https://github.com/eipastel/psjava/actions/workflows/ci.yml)
|
|
5
5
|
[](./LICENSE)
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ There's no custom syntax and no transpilation: whatever is in the file is exactl
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm install -g @thiagodiogo/psjava
|
|
14
|
+
npm install -g @thiagodiogo/psjava
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Requires a **JDK 11+** with `jshell` on your `PATH`. Verify your setup with `psjava doctor`.
|
package/dist/cli.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
+
import { createRequire } from 'module';
|
|
2
3
|
import { runFile } from './commands/run.js';
|
|
3
4
|
import { runDoctor } from './commands/doctor.js';
|
|
5
|
+
// Versão vem do package.json (fonte única) — em dist/cli.js, '../package.json' é a raiz do pacote.
|
|
6
|
+
const { version } = createRequire(import.meta.url)('../package.json');
|
|
4
7
|
export function buildProgram() {
|
|
5
8
|
const program = new Command();
|
|
6
|
-
program.name('psjava').description('Run .psjava files').version(
|
|
9
|
+
program.name('psjava').description('Run .psjava files').version(version);
|
|
7
10
|
program
|
|
8
11
|
.argument('[file]', '.psjava file')
|
|
9
12
|
.option('-d, --debug', 'print the elapsed time at the end')
|