@thiagodiogo/psjava 0.0.1-beta.0 → 0.0.1-beta.2

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.
Files changed (2) hide show
  1. package/README.md +32 -23
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -1,43 +1,52 @@
1
1
  # psjava
2
2
 
3
- Roda arquivos `.psjava` como script — Java puro, em cima do [JShell](https://docs.oracle.com/javase/9/jshell/). Sem transformação de sintaxe: o que está no arquivo é o que o `jshell` executa.
3
+ [![npm](https://img.shields.io/npm/v/@thiagodiogo/psjava/beta)](https://www.npmjs.com/package/@thiagodiogo/psjava)
4
+ [![CI](https://github.com/eipastel/psjava/actions/workflows/ci.yml/badge.svg)](https://github.com/eipastel/psjava/actions/workflows/ci.yml)
5
+ [![license](https://img.shields.io/npm/l/@thiagodiogo/psjava)](./LICENSE)
6
+
7
+ Run `.psjava` files as scripts — plain Java on top of [JShell](https://docs.oracle.com/javase/9/jshell/), with zero ceremony.
8
+
9
+ There's no custom syntax and no transpilation: whatever is in the file is exactly what `jshell` runs. `psjava` only adds a small `print` helper to the session and strips the Windows BOM — nothing else touches your code.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npm install -g @thiagodiogo/psjava@beta
15
+ ```
16
+
17
+ Requires a **JDK 11+** with `jshell` on your `PATH`. Verify your setup with `psjava doctor`.
18
+
19
+ ## Usage
4
20
 
5
21
  ```bash
6
- psjava exemplo.psjava # executa o arquivo
7
- psjava exemplo.psjava --debug # idem, e loga o tempo da execução ao final
8
- psjava doctor # verifica se o jshell está disponível
22
+ psjava example.psjava # run the file
23
+ psjava example.psjava --debug # run, and print the elapsed time at the end
24
+ psjava doctor # check that jshell is available
9
25
  ```
10
26
 
27
+ A `.psjava` file is just Java:
28
+
11
29
  ```java
12
- var nome = "mundo";
13
- print("olá, " + nome);
30
+ var name = "world";
31
+ print("hello, " + name);
14
32
  ```
15
33
 
16
- ## Helper `print`
34
+ ## The `print` helper
17
35
 
18
- O psjava define um `print(...)` na sessão antes do teu código (Java puro, teu
19
- arquivo continua intocado). Tem overload para `String`, `int[]` e `List`:
36
+ `psjava` defines a `print(...)` in the session before your code runs (still plain Java your file stays untouched). It comes with overloads for `String`, `int[]`, and `List`:
20
37
 
21
38
  ```java
22
- print("texto"); // texto
39
+ print("text"); // text
23
40
  print(new int[]{1, 2, 3}); // [1, 2, 3]
24
41
  print(java.util.List.of("a", "b")); // [a, b]
25
42
  ```
26
43
 
27
- `System.out.println(...)` continua funcionando normalmente.
44
+ `System.out.println(...)` keeps working as usual.
28
45
 
29
- ## Requisitos
46
+ ## How it works
30
47
 
31
- Um JDK 11+ com `jshell` no PATH. Confirme com `psjava doctor`.
48
+ `psjava` reads your file, prepends the `print` overloads, and pipes the result straight into `jshell -s`. The only change made to your source is removing the Windows BOM, which `jshell` chokes on. That's it plain Java into JShell.
32
49
 
33
- ## Dev
34
-
35
- ```bash
36
- npm install
37
- npm test # unit + e2e
38
- npm run test:unit # só lógica pura (sem JDK)
39
- npm run test:e2e # builda e roda no jshell (precisa de JDK; pula sozinho sem ele)
40
- ```
50
+ ## License
41
51
 
42
- A única coisa que o `psjava` mexe no arquivo é remover o BOM do Windows, que o
43
- `jshell` não engole. Fora isso, é Java puro entrando no JShell.
52
+ [MIT](./LICENSE)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@thiagodiogo/psjava",
3
- "version": "0.0.1-beta.0",
4
- "description": "Roda arquivos .psjava como script — Java sem cerimônia, em cima do JShell.",
3
+ "version": "0.0.1-beta.2",
4
+ "description": "Run .psjava files as scripts plain Java, no ceremony, on top of JShell.",
5
5
  "keywords": [
6
6
  "psjava",
7
7
  "java",
@@ -43,12 +43,12 @@
43
43
  "prepublishOnly": "npm run build"
44
44
  },
45
45
  "dependencies": {
46
- "chalk": "^5.5.0",
47
- "commander": "^14.0.0"
46
+ "chalk": "5.6.2",
47
+ "commander": "14.0.3"
48
48
  },
49
49
  "devDependencies": {
50
- "@types/node": "^24",
51
- "typescript": "^5.9",
52
- "vitest": "^3"
50
+ "@types/node": "24.13.2",
51
+ "typescript": "5.9.3",
52
+ "vitest": "3.2.6"
53
53
  }
54
54
  }