@amritk/mjst 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 +132 -0
- package/dist/cli-config.d.ts +25 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +2523 -0
- package/dist/load-config.d.ts +6 -0
- package/dist/parse-cli-args.d.ts +7 -0
- package/package.json +47 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CliConfig } from './cli-config';
|
|
2
|
+
/**
|
|
3
|
+
* Loads a JSON config file and returns the relevant CLI config properties.
|
|
4
|
+
* The config file should have the same keys as the CLI flags (schema, outDir).
|
|
5
|
+
*/
|
|
6
|
+
export declare const loadConfig: (configPath: string) => Promise<Partial<CliConfig>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CliConfig } from './cli-config';
|
|
2
|
+
/**
|
|
3
|
+
* Parses command-line arguments into a partial CLI config.
|
|
4
|
+
* Supports --schema, --outDir, and --types-only flags with either `--flag value` or `--flag=value` syntax.
|
|
5
|
+
* Only returns the flags that were explicitly provided so we can layer them on top of config file values.
|
|
6
|
+
*/
|
|
7
|
+
export declare const parseCliArgs: (args: readonly string[]) => Partial<CliConfig>;
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@amritk/mjst",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Generate TypeScript parsers and type definitions from JSON Schemas.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "amritk",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"json-schema",
|
|
10
|
+
"typescript",
|
|
11
|
+
"parser",
|
|
12
|
+
"validator",
|
|
13
|
+
"code-generation",
|
|
14
|
+
"cli",
|
|
15
|
+
"mjst"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/amritk/mjst.git",
|
|
20
|
+
"directory": "packages/cli"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/amritk/mjst/tree/main/packages/cli#readme",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/amritk/mjst/issues"
|
|
25
|
+
},
|
|
26
|
+
"bin": {
|
|
27
|
+
"mjst": "./dist/cli.js"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"dev": "bun run --conditions=development ./src/cli.ts",
|
|
34
|
+
"start": "bun run ./src/cli.ts",
|
|
35
|
+
"build": "bun run build:code && bun run build:types",
|
|
36
|
+
"build:code": "bun build ./src/cli.ts --outdir=dist --target=node",
|
|
37
|
+
"build:types": "tsc -p .",
|
|
38
|
+
"generate-readme": "bun run ./scripts/generate-readme.ts"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@amritk/generate-parsers": "workspace:*",
|
|
42
|
+
"@amritk/generate-markdown": "workspace:*"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"json-schema-typed": "catalog:"
|
|
46
|
+
}
|
|
47
|
+
}
|