minecraft-datapack-language 17.0.8__py3-none-any.whl → 17.0.10__py3-none-any.whl
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.
- minecraft_datapack_language/_version.py +2 -2
- minecraft_datapack_language/cli.py +321 -0
- minecraft_datapack_language/completions/mdl.bash +35 -0
- minecraft_datapack_language/completions/mdl.fish +31 -0
- minecraft_datapack_language/completions/mdl.ps1 +27 -0
- minecraft_datapack_language/completions/mdl.zsh +28 -0
- {minecraft_datapack_language-17.0.8.dist-info → minecraft_datapack_language-17.0.10.dist-info}/METADATA +1 -1
- minecraft_datapack_language-17.0.10.dist-info/RECORD +22 -0
- minecraft_datapack_language-17.0.8.dist-info/RECORD +0 -18
- {minecraft_datapack_language-17.0.8.dist-info → minecraft_datapack_language-17.0.10.dist-info}/WHEEL +0 -0
- {minecraft_datapack_language-17.0.8.dist-info → minecraft_datapack_language-17.0.10.dist-info}/entry_points.txt +0 -0
- {minecraft_datapack_language-17.0.8.dist-info → minecraft_datapack_language-17.0.10.dist-info}/licenses/LICENSE +0 -0
- {minecraft_datapack_language-17.0.8.dist-info → minecraft_datapack_language-17.0.10.dist-info}/top_level.txt +0 -0
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
28
28
|
commit_id: COMMIT_ID
|
29
29
|
__commit_id__: COMMIT_ID
|
30
30
|
|
31
|
-
__version__ = version = '17.0.
|
32
|
-
__version_tuple__ = version_tuple = (17, 0,
|
31
|
+
__version__ = version = '17.0.10'
|
32
|
+
__version_tuple__ = version_tuple = (17, 0, 10)
|
33
33
|
|
34
34
|
__commit_id__ = commit_id = None
|
@@ -8,6 +8,13 @@ import sys
|
|
8
8
|
import os
|
9
9
|
from pathlib import Path
|
10
10
|
import shutil
|
11
|
+
from typing import Optional
|
12
|
+
try:
|
13
|
+
# Python 3.9+
|
14
|
+
from importlib.resources import files as importlib_resources_files
|
15
|
+
except Exception: # pragma: no cover
|
16
|
+
import importlib_resources # type: ignore
|
17
|
+
importlib_resources_files = importlib_resources.files # type: ignore
|
11
18
|
from .mdl_lexer import MDLLexer
|
12
19
|
from .mdl_parser import MDLParser
|
13
20
|
from .mdl_compiler import MDLCompiler
|
@@ -53,6 +60,25 @@ Examples:
|
|
53
60
|
new_parser.add_argument('--pack-name', help='Custom name for the datapack')
|
54
61
|
new_parser.add_argument('--pack-format', type=int, default=82, help='Pack format number (default: 82)')
|
55
62
|
new_parser.add_argument('--output', help='Directory to create the project in (defaults to current directory)')
|
63
|
+
new_parser.add_argument('--exclude-local-docs', action='store_true', help='Do not copy packaged docs into the project')
|
64
|
+
|
65
|
+
# Completion command
|
66
|
+
completion_parser = subparsers.add_parser('completion', help='Shell completion utilities')
|
67
|
+
completion_sub = completion_parser.add_subparsers(dest='completion_cmd', help='Completion subcommands')
|
68
|
+
comp_print = completion_sub.add_parser('print', help='Print completion script for a shell')
|
69
|
+
comp_print.add_argument('shell', nargs='?', choices=['bash', 'zsh', 'fish', 'powershell'], help='Target shell (default: auto-detect)')
|
70
|
+
comp_install = completion_sub.add_parser('install', help='Install completion for current user shell')
|
71
|
+
comp_install.add_argument('shell', nargs='?', choices=['bash', 'zsh', 'fish', 'powershell'], help='Target shell (default: auto-detect)')
|
72
|
+
comp_uninstall = completion_sub.add_parser('uninstall', help='Uninstall completion from current user shell')
|
73
|
+
comp_uninstall.add_argument('shell', nargs='?', choices=['bash', 'zsh', 'fish', 'powershell'], help='Target shell (default: auto-detect)')
|
74
|
+
completion_sub.add_parser('doctor', help='Diagnose completion install status')
|
75
|
+
|
76
|
+
# Docs command
|
77
|
+
docs_parser = subparsers.add_parser('docs', help='Docs utilities')
|
78
|
+
docs_sub = docs_parser.add_subparsers(dest='docs_cmd', help='Docs subcommands')
|
79
|
+
docs_serve = docs_sub.add_parser('serve', help='Serve project docs locally')
|
80
|
+
docs_serve.add_argument('--port', type=int, default=8000, help='Port to serve on (default: 8000)')
|
81
|
+
docs_serve.add_argument('--dir', default='docs', help='Docs directory to serve (default: docs)')
|
56
82
|
|
57
83
|
args = parser.parse_args()
|
58
84
|
|
@@ -76,6 +102,10 @@ Examples:
|
|
76
102
|
return check_command(args)
|
77
103
|
elif args.command == 'new':
|
78
104
|
return new_command(args)
|
105
|
+
elif args.command == 'completion':
|
106
|
+
return completion_command(args)
|
107
|
+
elif args.command == 'docs':
|
108
|
+
return docs_command(args)
|
79
109
|
else:
|
80
110
|
print(f"Unknown command: {args.command}")
|
81
111
|
return 1
|
@@ -295,6 +325,26 @@ A Minecraft datapack created with MDL (Minecraft Datapack Language).
|
|
295
325
|
with open(readme_file, 'w', encoding='utf-8') as f:
|
296
326
|
f.write(readme_content)
|
297
327
|
|
328
|
+
# Copy packaged docs unless excluded
|
329
|
+
if not getattr(args, 'exclude_local_docs', False):
|
330
|
+
try:
|
331
|
+
copied = copy_packaged_docs_into(project_dir)
|
332
|
+
if copied:
|
333
|
+
print(f" - docs/ (local docs copied)")
|
334
|
+
else:
|
335
|
+
print(f" - docs/ (skipped: no embedded docs found)")
|
336
|
+
except FileExistsError:
|
337
|
+
print(" - docs/ already exists (skipped). Use --exclude-local-docs to suppress this step.")
|
338
|
+
except Exception as e:
|
339
|
+
print(f" - docs/ copy failed: {e}")
|
340
|
+
|
341
|
+
# Add simple serve scripts
|
342
|
+
try:
|
343
|
+
create_docs_serve_scripts(project_dir)
|
344
|
+
print(" - serve_docs.sh, serve_docs.ps1")
|
345
|
+
except Exception as e:
|
346
|
+
print(f" - serve script creation failed: {e}")
|
347
|
+
|
298
348
|
print(f"Created new MDL project: {project_dir}/")
|
299
349
|
print(f" - {mdl_file}")
|
300
350
|
print(f" - {readme_file}")
|
@@ -306,5 +356,276 @@ A Minecraft datapack created with MDL (Minecraft Datapack Language).
|
|
306
356
|
return 0
|
307
357
|
|
308
358
|
|
359
|
+
def copy_packaged_docs_into(project_dir: Path) -> bool:
|
360
|
+
"""Copy embedded docs folder into the given project directory.
|
361
|
+
Returns True if copied, False if no embedded docs packaged.
|
362
|
+
Raises FileExistsError if destination exists.
|
363
|
+
"""
|
364
|
+
embedded_root = importlib_resources_files("minecraft_datapack_language").joinpath("_embedded", "docs")
|
365
|
+
try:
|
366
|
+
# Some importlib.resources implementations require as_file for files; for dirs, check existence
|
367
|
+
if not Path(str(embedded_root)).exists():
|
368
|
+
return False
|
369
|
+
except Exception:
|
370
|
+
return False
|
371
|
+
|
372
|
+
dest = project_dir / "docs"
|
373
|
+
if dest.exists():
|
374
|
+
raise FileExistsError("docs directory already exists")
|
375
|
+
shutil.copytree(str(embedded_root), str(dest))
|
376
|
+
return True
|
377
|
+
|
378
|
+
|
379
|
+
def create_docs_serve_scripts(project_dir: Path) -> None:
|
380
|
+
"""Create convenience scripts to serve the project's docs."""
|
381
|
+
bash_script = project_dir / "serve_docs.sh"
|
382
|
+
bash_script.write_text("""#!/usr/bin/env bash
|
383
|
+
set -e
|
384
|
+
PORT=${PORT:-8000}
|
385
|
+
DIR=${1:-docs}
|
386
|
+
if [ ! -d "$DIR" ]; then
|
387
|
+
echo "Error: docs directory '$DIR' not found"; exit 1
|
388
|
+
fi
|
389
|
+
# Prefer Jekyll if available and Gemfile exists
|
390
|
+
if command -v bundle >/dev/null 2>&1 && [ -f "$DIR/Gemfile" ] || [ -f "Gemfile" ]; then
|
391
|
+
(cd "$DIR" && bundle exec jekyll serve --livereload --port "$PORT")
|
392
|
+
else
|
393
|
+
(cd "$DIR" && python -m http.server "$PORT")
|
394
|
+
fi
|
395
|
+
""", encoding='utf-8')
|
396
|
+
try:
|
397
|
+
os.chmod(bash_script, 0o755)
|
398
|
+
except Exception:
|
399
|
+
pass
|
400
|
+
|
401
|
+
ps1_script = project_dir / "serve_docs.ps1"
|
402
|
+
ps1_script.write_text("""
|
403
|
+
param(
|
404
|
+
[int]$Port = 8000,
|
405
|
+
[string]$Dir = "docs"
|
406
|
+
)
|
407
|
+
if (-not (Test-Path $Dir)) { Write-Host "Error: docs directory '$Dir' not found"; exit 1 }
|
408
|
+
# Prefer Jekyll if available and Gemfile exists
|
409
|
+
$gemfile = (Test-Path (Join-Path $Dir 'Gemfile')) -or (Test-Path 'Gemfile')
|
410
|
+
if ($gemfile -and (Get-Command bundle -ErrorAction SilentlyContinue)) {
|
411
|
+
Push-Location $Dir
|
412
|
+
& bundle exec jekyll serve --livereload --port $Port
|
413
|
+
Pop-Location
|
414
|
+
} else {
|
415
|
+
Push-Location $Dir
|
416
|
+
python -m http.server $Port
|
417
|
+
Pop-Location
|
418
|
+
}
|
419
|
+
""", encoding='utf-8')
|
420
|
+
|
421
|
+
|
422
|
+
def completion_command(args) -> int:
|
423
|
+
"""Handle completion subcommands: print/install/uninstall/doctor."""
|
424
|
+
cmd = args.completion_cmd
|
425
|
+
if not cmd:
|
426
|
+
print("Usage: mdl completion [print|install|uninstall|doctor] [shell]")
|
427
|
+
return 1
|
428
|
+
|
429
|
+
shell = getattr(args, 'shell', None)
|
430
|
+
if cmd == 'print':
|
431
|
+
return print_completion(shell)
|
432
|
+
elif cmd == 'install':
|
433
|
+
return install_completion(shell)
|
434
|
+
elif cmd == 'uninstall':
|
435
|
+
return uninstall_completion(shell)
|
436
|
+
elif cmd == 'doctor':
|
437
|
+
return doctor_completion()
|
438
|
+
else:
|
439
|
+
print(f"Unknown completion subcommand: {cmd}")
|
440
|
+
return 1
|
441
|
+
|
442
|
+
|
443
|
+
def detect_shell() -> str:
|
444
|
+
sh = os.environ.get('SHELL', '')
|
445
|
+
if 'zsh' in sh:
|
446
|
+
return 'zsh'
|
447
|
+
if 'bash' in sh:
|
448
|
+
return 'bash'
|
449
|
+
# Windows PowerShell detection
|
450
|
+
if os.name == 'nt' or os.environ.get('ComSpec', '').endswith('cmd.exe'):
|
451
|
+
return 'powershell'
|
452
|
+
return 'bash'
|
453
|
+
|
454
|
+
|
455
|
+
def _read_completion_text(shell: str) -> Optional[str]:
|
456
|
+
base = importlib_resources_files("minecraft_datapack_language").joinpath("completions")
|
457
|
+
mapping = {
|
458
|
+
'bash': 'mdl.bash',
|
459
|
+
'zsh': 'mdl.zsh',
|
460
|
+
'fish': 'mdl.fish',
|
461
|
+
'powershell': 'mdl.ps1',
|
462
|
+
}
|
463
|
+
name = mapping.get(shell)
|
464
|
+
if not name:
|
465
|
+
return None
|
466
|
+
path = Path(str(base)) / name
|
467
|
+
if not path.exists():
|
468
|
+
return None
|
469
|
+
return path.read_text(encoding='utf-8')
|
470
|
+
|
471
|
+
|
472
|
+
def print_completion(shell: Optional[str]) -> int:
|
473
|
+
sh = shell or detect_shell()
|
474
|
+
text = _read_completion_text(sh)
|
475
|
+
if not text:
|
476
|
+
print(f"No completion script packaged for shell: {sh}")
|
477
|
+
return 1
|
478
|
+
print(text)
|
479
|
+
return 0
|
480
|
+
|
481
|
+
|
482
|
+
def install_completion(shell: Optional[str]) -> int:
|
483
|
+
sh = shell or detect_shell()
|
484
|
+
text = _read_completion_text(sh)
|
485
|
+
if not text:
|
486
|
+
print(f"No completion script packaged for shell: {sh}")
|
487
|
+
return 1
|
488
|
+
home = Path.home()
|
489
|
+
target_dir = home / ".mdl" / "completion"
|
490
|
+
target_dir.mkdir(parents=True, exist_ok=True)
|
491
|
+
filename = {
|
492
|
+
'bash': 'mdl.bash',
|
493
|
+
'zsh': 'mdl.zsh',
|
494
|
+
'fish': 'mdl.fish',
|
495
|
+
'powershell': 'mdl.ps1',
|
496
|
+
}[sh]
|
497
|
+
target_path = target_dir / filename
|
498
|
+
target_path.write_text(text, encoding='utf-8')
|
499
|
+
|
500
|
+
if sh == 'bash':
|
501
|
+
rc = home / ".bashrc"
|
502
|
+
_ensure_line_in_file(rc, f"source {target_path.as_posix()}")
|
503
|
+
print(f"Installed bash completion. Restart your shell or 'source {rc}'.")
|
504
|
+
elif sh == 'zsh':
|
505
|
+
rc = home / ".zshrc"
|
506
|
+
_ensure_line_in_file(rc, f"source {target_path.as_posix()}")
|
507
|
+
print(f"Installed zsh completion. Restart your shell or 'source {rc}'.")
|
508
|
+
elif sh == 'fish':
|
509
|
+
fish_dir = home / ".config" / "fish" / "completions"
|
510
|
+
fish_dir.mkdir(parents=True, exist_ok=True)
|
511
|
+
(fish_dir / "mdl.fish").write_text(text, encoding='utf-8')
|
512
|
+
print("Installed fish completion. Restart your shell.")
|
513
|
+
elif sh == 'powershell':
|
514
|
+
print(f"Saved PowerShell completion to {target_path}. Add this line to your $PROFILE:")
|
515
|
+
print(f". {target_path}")
|
516
|
+
else:
|
517
|
+
print(f"Unknown shell: {sh}")
|
518
|
+
return 1
|
519
|
+
return 0
|
520
|
+
|
521
|
+
|
522
|
+
def uninstall_completion(shell: Optional[str]) -> int:
|
523
|
+
sh = shell or detect_shell()
|
524
|
+
home = Path.home()
|
525
|
+
target_dir = home / ".mdl" / "completion"
|
526
|
+
filename = {
|
527
|
+
'bash': 'mdl.bash',
|
528
|
+
'zsh': 'mdl.zsh',
|
529
|
+
'fish': 'mdl.fish',
|
530
|
+
'powershell': 'mdl.ps1',
|
531
|
+
}.get(sh)
|
532
|
+
if not filename:
|
533
|
+
print(f"Unknown shell: {sh}")
|
534
|
+
return 1
|
535
|
+
try:
|
536
|
+
(target_dir / filename).unlink(missing_ok=True) # type: ignore[arg-type]
|
537
|
+
except TypeError:
|
538
|
+
# Python < 3.8 fallback
|
539
|
+
path = target_dir / filename
|
540
|
+
if path.exists():
|
541
|
+
path.unlink()
|
542
|
+
if sh == 'bash':
|
543
|
+
_remove_line_from_file(home / ".bashrc", "source ~/.mdl/completion/mdl.bash")
|
544
|
+
elif sh == 'zsh':
|
545
|
+
_remove_line_from_file(home / ".zshrc", "source ~/.mdl/completion/mdl.zsh")
|
546
|
+
elif sh == 'fish':
|
547
|
+
fish_path = home / ".config" / "fish" / "completions" / "mdl.fish"
|
548
|
+
if fish_path.exists():
|
549
|
+
fish_path.unlink()
|
550
|
+
elif sh == 'powershell':
|
551
|
+
pass
|
552
|
+
print(f"Uninstalled {sh} completion.")
|
553
|
+
return 0
|
554
|
+
|
555
|
+
|
556
|
+
def doctor_completion() -> int:
|
557
|
+
sh = detect_shell()
|
558
|
+
print(f"Detected shell: {sh}")
|
559
|
+
print("Check if 'mdl' completion activates after restarting your shell. If not, re-run: 'mdl completion install'.")
|
560
|
+
return 0
|
561
|
+
|
562
|
+
|
563
|
+
def _ensure_line_in_file(path: Path, line: str) -> None:
|
564
|
+
try:
|
565
|
+
if not path.exists():
|
566
|
+
path.write_text(f"# Added by MDL CLI\n{line}\n", encoding='utf-8')
|
567
|
+
return
|
568
|
+
content = path.read_text(encoding='utf-8')
|
569
|
+
if line not in content:
|
570
|
+
with open(path, 'a', encoding='utf-8') as f:
|
571
|
+
f.write(f"\n{line}\n")
|
572
|
+
except Exception:
|
573
|
+
pass
|
574
|
+
|
575
|
+
|
576
|
+
def _remove_line_from_file(path: Path, line: str) -> None:
|
577
|
+
try:
|
578
|
+
if not path.exists():
|
579
|
+
return
|
580
|
+
lines = path.read_text(encoding='utf-8').splitlines()
|
581
|
+
new_lines = [l for l in lines if l.strip() != line.strip()]
|
582
|
+
if new_lines != lines:
|
583
|
+
path.write_text("\n".join(new_lines) + "\n", encoding='utf-8')
|
584
|
+
except Exception:
|
585
|
+
pass
|
586
|
+
|
587
|
+
|
588
|
+
def docs_command(args) -> int:
|
589
|
+
cmd = args.docs_cmd
|
590
|
+
if cmd == 'serve':
|
591
|
+
port = getattr(args, 'port', 8000)
|
592
|
+
directory = getattr(args, 'dir', 'docs')
|
593
|
+
docs_dir = Path(directory)
|
594
|
+
if not docs_dir.exists() or not docs_dir.is_dir():
|
595
|
+
print(f"Error: docs directory '{docs_dir}' not found")
|
596
|
+
return 1
|
597
|
+
print(f"Serving docs on http://localhost:{port} from {docs_dir}")
|
598
|
+
try:
|
599
|
+
# Prefer Jekyll if Gemfile exists and 'bundle' is available
|
600
|
+
use_jekyll = (docs_dir / 'Gemfile').exists() or Path('Gemfile').exists()
|
601
|
+
has_bundle = shutil.which('bundle') is not None
|
602
|
+
if use_jekyll and has_bundle:
|
603
|
+
import subprocess
|
604
|
+
subprocess.run(['bundle', 'exec', 'jekyll', 'serve', '--livereload', '--port', str(port)], cwd=str(docs_dir), check=True)
|
605
|
+
return 0
|
606
|
+
except Exception as e:
|
607
|
+
print(f"Jekyll serve failed or unavailable: {e}")
|
608
|
+
print("Falling back to Python static server.")
|
609
|
+
# Fallback to Python HTTP server
|
610
|
+
try:
|
611
|
+
import http.server
|
612
|
+
import socketserver
|
613
|
+
os.chdir(str(docs_dir))
|
614
|
+
handler = http.server.SimpleHTTPRequestHandler
|
615
|
+
with socketserver.TCPServer(('', port), handler) as httpd:
|
616
|
+
print("Press Ctrl+C to stop...")
|
617
|
+
httpd.serve_forever()
|
618
|
+
except KeyboardInterrupt:
|
619
|
+
print("Stopped.")
|
620
|
+
return 0
|
621
|
+
except Exception as e:
|
622
|
+
print(f"Failed to serve docs: {e}")
|
623
|
+
return 1
|
624
|
+
return 0
|
625
|
+
else:
|
626
|
+
print("Usage: mdl docs serve [--dir DIR] [--port PORT]")
|
627
|
+
return 1
|
628
|
+
|
629
|
+
|
309
630
|
if __name__ == '__main__':
|
310
631
|
sys.exit(main())
|
@@ -0,0 +1,35 @@
|
|
1
|
+
_mdl_complete() {
|
2
|
+
local cur prev words cword
|
3
|
+
_init_completion -n : || {
|
4
|
+
COMPREPLY=()
|
5
|
+
return
|
6
|
+
}
|
7
|
+
|
8
|
+
local subcommands="build check new completion docs"
|
9
|
+
if [[ ${cword} -eq 1 ]]; then
|
10
|
+
COMPREPLY=( $(compgen -W "${subcommands}" -- "$cur") )
|
11
|
+
return
|
12
|
+
fi
|
13
|
+
|
14
|
+
case "${words[1]}" in
|
15
|
+
build)
|
16
|
+
COMPREPLY=( $(compgen -W "--mdl -o --output --verbose --wrapper --no-zip" -- "$cur") )
|
17
|
+
[[ ${cur} == -* ]] || COMPREPLY+=( $(compgen -f -d -- "$cur") )
|
18
|
+
;;
|
19
|
+
check)
|
20
|
+
COMPREPLY=( $(compgen -W "--verbose" -- "$cur") )
|
21
|
+
[[ ${cur} == -* ]] || COMPREPLY+=( $(compgen -f -d -- "$cur") )
|
22
|
+
;;
|
23
|
+
new)
|
24
|
+
COMPREPLY=( $(compgen -W "--pack-name --pack-format --output --exclude-local-docs" -- "$cur") )
|
25
|
+
;;
|
26
|
+
completion)
|
27
|
+
COMPREPLY=( $(compgen -W "print install uninstall doctor" -- "$cur") )
|
28
|
+
;;
|
29
|
+
docs)
|
30
|
+
COMPREPLY=( $(compgen -W "serve" -- "$cur") )
|
31
|
+
;;
|
32
|
+
esac
|
33
|
+
}
|
34
|
+
complete -F _mdl_complete mdl
|
35
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
complete -c mdl -n "__fish_use_subcommand" -a "build" -d "Build MDL files into a datapack"
|
2
|
+
complete -c mdl -n "__fish_use_subcommand" -a "check" -d "Check MDL files for syntax errors"
|
3
|
+
complete -c mdl -n "__fish_use_subcommand" -a "new" -d "Create a new MDL project"
|
4
|
+
complete -c mdl -n "__fish_use_subcommand" -a "completion" -d "Shell completion utilities"
|
5
|
+
complete -c mdl -n "__fish_use_subcommand" -a "docs" -d "Docs utilities"
|
6
|
+
|
7
|
+
# build options
|
8
|
+
complete -c mdl -n "__fish_seen_subcommand_from build" -l mdl -d "MDL file or directory" -r -F
|
9
|
+
complete -c mdl -n "__fish_seen_subcommand_from build" -s o -l output -d "Output directory" -r -F
|
10
|
+
complete -c mdl -n "__fish_seen_subcommand_from build" -l verbose -d "Verbose output"
|
11
|
+
complete -c mdl -n "__fish_seen_subcommand_from build" -l wrapper -d "Wrapper directory" -r
|
12
|
+
complete -c mdl -n "__fish_seen_subcommand_from build" -l no-zip -d "Do not zip"
|
13
|
+
|
14
|
+
# check options
|
15
|
+
complete -c mdl -n "__fish_seen_subcommand_from check" -l verbose -d "Verbose output"
|
16
|
+
|
17
|
+
# new options
|
18
|
+
complete -c mdl -n "__fish_seen_subcommand_from new" -l pack-name -d "Custom datapack name" -r
|
19
|
+
complete -c mdl -n "__fish_seen_subcommand_from new" -l pack-format -d "Pack format number" -r
|
20
|
+
complete -c mdl -n "__fish_seen_subcommand_from new" -l output -d "Project directory" -r -F
|
21
|
+
complete -c mdl -n "__fish_seen_subcommand_from new" -l exclude-local-docs -d "Skip copying docs"
|
22
|
+
|
23
|
+
# completion subcommands
|
24
|
+
complete -c mdl -n "__fish_seen_subcommand_from completion" -a "print" -d "Print completion script"
|
25
|
+
complete -c mdl -n "__fish_seen_subcommand_from completion" -a "install" -d "Install completion"
|
26
|
+
complete -c mdl -n "__fish_seen_subcommand_from completion" -a "uninstall" -d "Uninstall completion"
|
27
|
+
complete -c mdl -n "__fish_seen_subcommand_from completion" -a "doctor" -d "Diagnose setup"
|
28
|
+
|
29
|
+
# docs subcommands
|
30
|
+
complete -c mdl -n "__fish_seen_subcommand_from docs" -a "serve" -d "Serve docs locally"
|
31
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Register-ArgumentCompleter -Native -CommandName mdl -ScriptBlock {
|
2
|
+
param($wordToComplete, $commandAst, $cursorPosition)
|
3
|
+
$line = $commandAst.ToString()
|
4
|
+
$parts = [System.Management.Automation.PSParser]::Tokenize($line, [ref]$null) | Where-Object { $_.Type -eq 'CommandArgument' } | ForEach-Object { $_.Content }
|
5
|
+
if ($parts.Count -lt 1) {
|
6
|
+
'build','check','new','completion','docs' | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) }
|
7
|
+
return
|
8
|
+
}
|
9
|
+
switch ($parts[0]) {
|
10
|
+
'build' {
|
11
|
+
'--mdl','-o','--output','--verbose','--wrapper','--no-zip' | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_) }
|
12
|
+
}
|
13
|
+
'check' {
|
14
|
+
'--verbose' | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_) }
|
15
|
+
}
|
16
|
+
'new' {
|
17
|
+
'--pack-name','--pack-format','--output','--exclude-local-docs' | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterName', $_) }
|
18
|
+
}
|
19
|
+
'completion' {
|
20
|
+
'print','install','uninstall','doctor' | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) }
|
21
|
+
}
|
22
|
+
'docs' {
|
23
|
+
'serve' | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) }
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#compdef mdl
|
2
|
+
_mdl() {
|
3
|
+
local -a subcmds
|
4
|
+
subcmds=(build check new completion docs)
|
5
|
+
if (( CURRENT == 2 )); then
|
6
|
+
_describe 'command' subcmds
|
7
|
+
return
|
8
|
+
fi
|
9
|
+
case $words[2] in
|
10
|
+
build)
|
11
|
+
_arguments '*:file:_files' '--mdl' '-o' '--output' '--verbose' '--wrapper' '--no-zip'
|
12
|
+
;;
|
13
|
+
check)
|
14
|
+
_arguments '*:file:_files' '--verbose'
|
15
|
+
;;
|
16
|
+
new)
|
17
|
+
_arguments '--pack-name' '--pack-format' '--output' '--exclude-local-docs'
|
18
|
+
;;
|
19
|
+
completion)
|
20
|
+
_values 'subcommands' 'print' 'install' 'uninstall' 'doctor'
|
21
|
+
;;
|
22
|
+
docs)
|
23
|
+
_values 'subcommands' 'serve'
|
24
|
+
;;
|
25
|
+
esac
|
26
|
+
}
|
27
|
+
compdef _mdl mdl
|
28
|
+
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: minecraft-datapack-language
|
3
|
-
Version: 17.0.
|
3
|
+
Version: 17.0.10
|
4
4
|
Summary: Compile MDL language with explicit scoping into a Minecraft datapack (1.21+ ready). Features variables, control flow, error handling, and VS Code extension.
|
5
5
|
Project-URL: Homepage, https://www.mcmdl.com
|
6
6
|
Project-URL: Documentation, https://www.mcmdl.com/docs
|
@@ -0,0 +1,22 @@
|
|
1
|
+
minecraft_datapack_language/__init__.py,sha256=0KVXBE4ScRaRUrf83aA2tVB-y8A_jplyaxVvtHH6Uw0,1199
|
2
|
+
minecraft_datapack_language/_version.py,sha256=MwtuDvdk_txRmRvQegL4SnmVFhlMdO5C0QGlEOzBoRY,708
|
3
|
+
minecraft_datapack_language/ast_nodes.py,sha256=L5izavSeXDr766vsfRvJrcnflXNJyXcy0WSfyJPq2ZA,4484
|
4
|
+
minecraft_datapack_language/cli.py,sha256=QEEOryoQS2CT-r7DkN6ozqst-yqPk6weRx_roe7YUPE,22307
|
5
|
+
minecraft_datapack_language/dir_map.py,sha256=HmxFkuvWGkzHF8o_GFb4BpuMCRc6QMw8UbmcAI8JVdY,1788
|
6
|
+
minecraft_datapack_language/mdl_compiler.py,sha256=Cs3fXtIAG4_Johp7h3BeYOs9RNUogkvYsR8Dvt7Ek1E,70720
|
7
|
+
minecraft_datapack_language/mdl_errors.py,sha256=r0Gu3KhoX1YLPAVW_iO7Q_fPgaf_Dv9tOGSOdKNSzmw,16114
|
8
|
+
minecraft_datapack_language/mdl_lexer.py,sha256=YuRflOkoMOcjECPAZzoAkJciMks5amWMtGbcTIVKmAs,24166
|
9
|
+
minecraft_datapack_language/mdl_linter.py,sha256=z85xoAglENurCh30bR7kEHZ_JeMxcYaLDcGNRAl-RAI,17253
|
10
|
+
minecraft_datapack_language/mdl_parser.py,sha256=1ecbkzvkgwcjfF8tn6Hxg4jBIjyFlk4bCzJ46p0-JR0,27477
|
11
|
+
minecraft_datapack_language/python_api.py,sha256=Iao1jbdeW6ekeA80BZG6gNqHVjxQJEheB3DbpVsuTZQ,12304
|
12
|
+
minecraft_datapack_language/utils.py,sha256=Aq0HAGlXqj9BUTEjaEilpvzEW0EtZYYMMwOqG9db6dE,684
|
13
|
+
minecraft_datapack_language/completions/mdl.bash,sha256=mlRdQ1PwoFwl7Fw5j7u0mhsNdxfbLSfkz1FMiI4DuWc,957
|
14
|
+
minecraft_datapack_language/completions/mdl.fish,sha256=ReWjaqUwjQni-hUZfVQG2CsI5fE7uJpoywiKrQhtcFw,1923
|
15
|
+
minecraft_datapack_language/completions/mdl.ps1,sha256=b2A1sFCtY23sv1-LILhPu0lphnZqzVjl__AtvCUMWtU,1744
|
16
|
+
minecraft_datapack_language/completions/mdl.zsh,sha256=Pdx6yuSFaK2-UIsriVoJJacuWnw2f9DOWrVhPJLBAwo,633
|
17
|
+
minecraft_datapack_language-17.0.10.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
18
|
+
minecraft_datapack_language-17.0.10.dist-info/METADATA,sha256=jbbKU-XVBDwzblhLOxosTYSitPOJU49KktgNsVlwJEw,8418
|
19
|
+
minecraft_datapack_language-17.0.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
20
|
+
minecraft_datapack_language-17.0.10.dist-info/entry_points.txt,sha256=c6vjBeCiyQflvPHBRyBk2nJCSfYt3Oc7Sc9V87ySi_U,108
|
21
|
+
minecraft_datapack_language-17.0.10.dist-info/top_level.txt,sha256=ADtFI476tbKLLxEAA-aJQAfg53MA3k_DOb0KTFiggfw,28
|
22
|
+
minecraft_datapack_language-17.0.10.dist-info/RECORD,,
|
@@ -1,18 +0,0 @@
|
|
1
|
-
minecraft_datapack_language/__init__.py,sha256=0KVXBE4ScRaRUrf83aA2tVB-y8A_jplyaxVvtHH6Uw0,1199
|
2
|
-
minecraft_datapack_language/_version.py,sha256=QLlqxt50Q5t50mWxVhc34ERM7nFRwcoBNFeJYrd1YTc,706
|
3
|
-
minecraft_datapack_language/ast_nodes.py,sha256=L5izavSeXDr766vsfRvJrcnflXNJyXcy0WSfyJPq2ZA,4484
|
4
|
-
minecraft_datapack_language/cli.py,sha256=oNpiMBIaTXvo-67CN-Jty8Fq4yn8WbyuQxhJi1TxtWU,10375
|
5
|
-
minecraft_datapack_language/dir_map.py,sha256=HmxFkuvWGkzHF8o_GFb4BpuMCRc6QMw8UbmcAI8JVdY,1788
|
6
|
-
minecraft_datapack_language/mdl_compiler.py,sha256=Cs3fXtIAG4_Johp7h3BeYOs9RNUogkvYsR8Dvt7Ek1E,70720
|
7
|
-
minecraft_datapack_language/mdl_errors.py,sha256=r0Gu3KhoX1YLPAVW_iO7Q_fPgaf_Dv9tOGSOdKNSzmw,16114
|
8
|
-
minecraft_datapack_language/mdl_lexer.py,sha256=YuRflOkoMOcjECPAZzoAkJciMks5amWMtGbcTIVKmAs,24166
|
9
|
-
minecraft_datapack_language/mdl_linter.py,sha256=z85xoAglENurCh30bR7kEHZ_JeMxcYaLDcGNRAl-RAI,17253
|
10
|
-
minecraft_datapack_language/mdl_parser.py,sha256=1ecbkzvkgwcjfF8tn6Hxg4jBIjyFlk4bCzJ46p0-JR0,27477
|
11
|
-
minecraft_datapack_language/python_api.py,sha256=Iao1jbdeW6ekeA80BZG6gNqHVjxQJEheB3DbpVsuTZQ,12304
|
12
|
-
minecraft_datapack_language/utils.py,sha256=Aq0HAGlXqj9BUTEjaEilpvzEW0EtZYYMMwOqG9db6dE,684
|
13
|
-
minecraft_datapack_language-17.0.8.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
14
|
-
minecraft_datapack_language-17.0.8.dist-info/METADATA,sha256=TRBg9WQwG8WRkkHXXQQQQBQsB9nisPJHXGDr4FBFn9Q,8417
|
15
|
-
minecraft_datapack_language-17.0.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
16
|
-
minecraft_datapack_language-17.0.8.dist-info/entry_points.txt,sha256=c6vjBeCiyQflvPHBRyBk2nJCSfYt3Oc7Sc9V87ySi_U,108
|
17
|
-
minecraft_datapack_language-17.0.8.dist-info/top_level.txt,sha256=ADtFI476tbKLLxEAA-aJQAfg53MA3k_DOb0KTFiggfw,28
|
18
|
-
minecraft_datapack_language-17.0.8.dist-info/RECORD,,
|
{minecraft_datapack_language-17.0.8.dist-info → minecraft_datapack_language-17.0.10.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|