@sandstone-mc/mcdoc-ts-generator 0.1.1 → 0.1.3
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 +3 -12
- package/dist/cli.js +3 -3
- package/dist/index.js +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
# @sandstone/mcdoc-ts-generator
|
|
2
2
|
|
|
3
|
-
To
|
|
4
|
-
|
|
3
|
+
To be used in Sandstone with
|
|
5
4
|
```bash
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
To run:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
bun run index.ts
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
This project was created using `bun init` in bun v1.1.0. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
|
|
5
|
+
pnpm --package=@sandstone-mc/mcdoc-ts-generator -c dlx 'mcdoc-ts-generator --out-dir "src/arguments/generated/" --no-tsconfig'
|
|
6
|
+
```
|
package/dist/cli.js
CHANGED
|
@@ -2879,9 +2879,9 @@ function handle_imports(imports) {
|
|
|
2879
2879
|
if (path.length === 0) {
|
|
2880
2880
|
throw new Error(`[mcdoc_import] Import path has no module prefix: "${import_path}"`);
|
|
2881
2881
|
} else if (path[1] === "java") {
|
|
2882
|
-
file = `sandstone/generated/${path.slice(2).join("/")}`;
|
|
2882
|
+
file = `sandstone/arguments/generated/${path.slice(2).join("/")}.js`;
|
|
2883
2883
|
} else if (path[0] === "sandstone") {
|
|
2884
|
-
file = path.join("/")
|
|
2884
|
+
file = path.length === 1 ? "sandstone" : `${path.join("/")}.js`;
|
|
2885
2885
|
} else {
|
|
2886
2886
|
throw new Error(`[mcdoc_import] Unsupported import location "${path[0]}" in "${import_path}"`);
|
|
2887
2887
|
}
|
|
@@ -3079,7 +3079,7 @@ async function generate(options = {}) {
|
|
|
3079
3079
|
baseUrl: "./",
|
|
3080
3080
|
paths: {
|
|
3081
3081
|
sandstone: ["../sandstone-types/index.ts"],
|
|
3082
|
-
"sandstone/generated/*": [`./*`]
|
|
3082
|
+
"sandstone/arguments/generated/*": [`./*`]
|
|
3083
3083
|
}
|
|
3084
3084
|
}
|
|
3085
3085
|
}, null, 2));
|
package/dist/index.js
CHANGED
|
@@ -2877,9 +2877,9 @@ function handle_imports(imports) {
|
|
|
2877
2877
|
if (path.length === 0) {
|
|
2878
2878
|
throw new Error(`[mcdoc_import] Import path has no module prefix: "${import_path}"`);
|
|
2879
2879
|
} else if (path[1] === "java") {
|
|
2880
|
-
file = `sandstone/generated/${path.slice(2).join("/")}`;
|
|
2880
|
+
file = `sandstone/arguments/generated/${path.slice(2).join("/")}.js`;
|
|
2881
2881
|
} else if (path[0] === "sandstone") {
|
|
2882
|
-
file = path.join("/")
|
|
2882
|
+
file = path.length === 1 ? "sandstone" : `${path.join("/")}.js`;
|
|
2883
2883
|
} else {
|
|
2884
2884
|
throw new Error(`[mcdoc_import] Unsupported import location "${path[0]}" in "${import_path}"`);
|
|
2885
2885
|
}
|
|
@@ -3077,7 +3077,7 @@ async function generate(options = {}) {
|
|
|
3077
3077
|
baseUrl: "./",
|
|
3078
3078
|
paths: {
|
|
3079
3079
|
sandstone: ["../sandstone-types/index.ts"],
|
|
3080
|
-
"sandstone/generated/*": [`./*`]
|
|
3080
|
+
"sandstone/arguments/generated/*": [`./*`]
|
|
3081
3081
|
}
|
|
3082
3082
|
}
|
|
3083
3083
|
}, null, 2));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sandstone-mc/mcdoc-ts-generator",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Generate TypeScript types from Minecraft mcdoc definitions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"compile": "bun run ./src/cli.ts",
|
|
23
23
|
"build": "bun run build:bundle && bun run build:types",
|
|
24
24
|
"build:bundle": "bun build ./src/cli.ts --outfile ./dist/cli.js --target node --format esm --packages external && bun build ./src/index.ts --outfile ./dist/index.js --target node --format esm --packages external",
|
|
25
|
-
"build:types": "tsc --emitDeclarationOnly --declaration --outDir ./dist",
|
|
25
|
+
"build:types": "bun tsc --emitDeclarationOnly --declaration --outDir ./dist",
|
|
26
26
|
"prepublishOnly": "bun run build"
|
|
27
27
|
},
|
|
28
28
|
"keywords": [
|