@ajitems/devtools 0.1.0 → 0.2.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 ADDED
@@ -0,0 +1,70 @@
1
+ # devtools
2
+
3
+ Headless engines for common developer utilities, implemented in Rust and compiled to **WebAssembly**. Use them in the browser or any JS runtime that can load WASM (for example via [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen)).
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @ajitems/devtools
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ The package is built with `wasm-pack` for the **`web`** target. Initialize the module once, then call the exported functions. Each engine returns a JSON-shaped object with `ok`, optional `data`, and optional `error` (see `ToolResult` in the sources).
14
+
15
+ ```javascript
16
+ import init, { base64_encode, jwt_decode } from "@ajitems/devtools";
17
+
18
+ await init(); // WASM start (e.g. panic hook)
19
+
20
+ const encoded = base64_encode("hello", false);
21
+ // { ok: true, data: { output: "...", inputBytes: 5, outputBytes: ... }, error: null }
22
+
23
+ const decoded = jwt_decode("eyJ...");
24
+ // { ok: true | false, data: ..., error: ... }
25
+ ```
26
+
27
+ Exact import paths depend on how you bundle or serve the `.wasm` file; follow the [wasm-pack web workflow](https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/index.html) for your toolchain.
28
+
29
+ ## What’s included
30
+
31
+ | Area | Functions (high level) |
32
+ |------|-------------------------|
33
+ | Encoding | `base64_encode`, `base64_decode` |
34
+ | JSON | `json_format`, `json_diff` |
35
+ | JWT | `jwt_decode` |
36
+ | URL | `url_process` |
37
+ | Regex | `regex_test` |
38
+ | Env files | `env_validate` |
39
+ | Docker | `docker_convert` |
40
+ | Tokens / prompts | `tokens_estimate`, `prompt_analyse` |
41
+ | SLA | `sla_calculate` |
42
+ | Payroll / tax (India-oriented) | `ctc_calculate`, `freelance_calculate`, `gst_calculate`, `gstin_validate`, `pan_validate` |
43
+ | India utilities | `validate_ifsc`, `estimate_cloud_cost`, `calculate_working_days`, `calculate_automation_roi`, `calculate_sprint_velocity`, `calculate_retry_budget` |
44
+
45
+ With the **`cron`** feature (enabled in published builds): `cron_parse`.
46
+
47
+ ## Build from source
48
+
49
+ Prerequisites: stable Rust, `wasm32-unknown-unknown`, and [wasm-pack](https://rustwasm.github.io/wasm-pack/).
50
+
51
+ ```bash
52
+ rustup target add wasm32-unknown-unknown
53
+ wasm-pack build --target web --release -- --features cron
54
+ cp package.npm.json pkg/package.json
55
+ ```
56
+
57
+ Optional Cargo features:
58
+
59
+ - **`cron`** — cron expression parsing (`cron_parse`).
60
+ - **`minify`** — pulls in minify/CSS dependencies (see `Cargo.toml`; not required for the default npm build).
61
+
62
+ CI runs `cargo clippy`, `cargo fmt --check`, `cargo test --all-features`, and the WASM build above.
63
+
64
+ ## Publish
65
+
66
+ Releases are published to npm when a version tag `v*` is pushed (see `.github/workflows/publish.yml`).
67
+
68
+ ## License
69
+
70
+ MIT. See [LICENSE](LICENSE).
package/devtools_bg.wasm CHANGED
Binary file
@@ -0,0 +1,33 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const base64_decode: (a: number, b: number, c: number) => number;
5
+ export const base64_encode: (a: number, b: number, c: number) => number;
6
+ export const calculate_automation_roi: (a: number) => number;
7
+ export const calculate_retry_budget: (a: number) => number;
8
+ export const calculate_sprint_velocity: (a: number) => number;
9
+ export const calculate_working_days: (a: number) => number;
10
+ export const cron_parse: (a: number, b: number) => number;
11
+ export const ctc_calculate: (a: number, b: number, c: number, d: number) => number;
12
+ export const docker_convert: (a: number, b: number) => number;
13
+ export const env_validate: (a: number, b: number) => number;
14
+ export const estimate_cloud_cost: (a: number) => number;
15
+ export const freelance_calculate: (a: number, b: number, c: number, d: number) => number;
16
+ export const gst_calculate: (a: number, b: number, c: number, d: number, e: number) => number;
17
+ export const gstin_validate: (a: number, b: number) => number;
18
+ export const init: () => void;
19
+ export const json_diff: (a: number, b: number, c: number, d: number) => number;
20
+ export const json_format: (a: number, b: number, c: number) => number;
21
+ export const jwt_decode: (a: number, b: number) => number;
22
+ export const pan_validate: (a: number, b: number) => number;
23
+ export const prompt_analyse: (a: number, b: number) => number;
24
+ export const regex_test: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
25
+ export const sla_calculate: (a: number) => number;
26
+ export const tokens_estimate: (a: number, b: number) => number;
27
+ export const url_process: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
28
+ export const validate_ifsc: (a: number, b: number) => number;
29
+ export const __wbindgen_export: (a: number, b: number) => number;
30
+ export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
31
+ export const __wbindgen_export3: (a: number) => void;
32
+ export const __wbindgen_export4: (a: number, b: number, c: number) => void;
33
+ export const __wbindgen_start: () => void;
package/package.json CHANGED
@@ -1,24 +1,35 @@
1
1
  {
2
2
  "name": "@ajitems/devtools",
3
- "type": "module",
4
- "collaborators": [
5
- "Ajitem Sahasrabuddhe"
6
- ],
3
+ "version": "0.2.0",
7
4
  "description": "Headless engines for common developer utilities. Compiled to WASM.",
8
- "version": "0.1.0",
9
- "license": "MIT",
5
+ "main": "devtools.js",
6
+ "types": "devtools.d.ts",
7
+ "files": [
8
+ "devtools_bg.wasm",
9
+ "devtools_bg.wasm.d.ts",
10
+ "devtools.js",
11
+ "devtools.d.ts",
12
+ "package.json"
13
+ ],
14
+ "sideEffects": false,
10
15
  "repository": {
11
16
  "type": "git",
12
17
  "url": "https://github.com/asahasrabuddhe/devtools"
13
18
  },
14
- "files": [
15
- "devtools_bg.wasm",
16
- "devtools.js",
17
- "devtools.d.ts"
19
+ "keywords": [
20
+ "devtools",
21
+ "wasm",
22
+ "webassembly",
23
+ "jwt",
24
+ "base64",
25
+ "regex",
26
+ "cron",
27
+ "json",
28
+ "prompt",
29
+ "docker",
30
+ "env",
31
+ "url"
18
32
  ],
19
- "main": "devtools.js",
20
- "types": "devtools.d.ts",
21
- "sideEffects": [
22
- "./snippets/*"
23
- ]
24
- }
33
+ "author": "Ajitem Sahasrabuddhe",
34
+ "license": "MIT"
35
+ }