com.elestrago.unity.package-tools 2.2.2 → 2.2.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/CAHNGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ---
4
4
 
5
+ ## [2.2.3](https://gitlab.com/elestrago-pkg/package-tool/-/tags/2.2.3)
6
+
7
+ ### Fixed
8
+
9
+ - Fixed `unity-package-docs` scanner missing namespaces and types in C# files that start with a UTF-8 BOM.
10
+
11
+ ---
12
+
5
13
  ## [2.2.2](https://gitlab.com/elestrago-pkg/package-tool/-/tags/2.2.2)
6
14
 
7
15
  ### Changed
@@ -154,7 +154,7 @@ SUMMARY_LINE_RE = re.compile(r"^\s*///\s?(?P<text>.*)$")
154
154
 
155
155
  def parse_cs_file(path: Path, rel_path: str) -> dict:
156
156
  """Return {'types': [...], 'namespaces': set([...])} for one .cs file."""
157
- raw = path.read_text(encoding="utf-8", errors="replace")
157
+ raw = path.read_text(encoding="utf-8-sig", errors="replace")
158
158
  norm = normalize(raw)
159
159
  norm_lines = norm.split("\n")
160
160
  raw_lines = raw.split("\n")
@@ -353,7 +353,7 @@ def scan_asmdefs(package_dir: Path, repo_root: Path) -> list[dict]:
353
353
  results: list[dict] = []
354
354
  for p in package_dir.rglob("*.asmdef"):
355
355
  try:
356
- data = json.loads(p.read_text(encoding="utf-8"))
356
+ data = json.loads(p.read_text(encoding="utf-8-sig"))
357
357
  except json.JSONDecodeError:
358
358
  continue
359
359
  results.append(
@@ -383,7 +383,7 @@ def build_script_guid_map(repo_root: Path) -> dict[str, str]:
383
383
  return mapping
384
384
  for meta in assets.rglob("*.cs.meta"):
385
385
  try:
386
- text = meta.read_text(encoding="utf-8", errors="replace")
386
+ text = meta.read_text(encoding="utf-8-sig", errors="replace")
387
387
  except OSError:
388
388
  continue
389
389
  m = META_GUID_RE.search(text)
@@ -409,7 +409,7 @@ def scan_sample_dir(sample_dir: Path, repo_root: Path, package_types: set[str],
409
409
  suf = p.suffix.lower()
410
410
  if suf == ".cs":
411
411
  try:
412
- src = p.read_text(encoding="utf-8", errors="replace")
412
+ src = p.read_text(encoding="utf-8-sig", errors="replace")
413
413
  except OSError:
414
414
  continue
415
415
  norm = normalize(src)
@@ -420,7 +420,7 @@ def scan_sample_dir(sample_dir: Path, repo_root: Path, package_types: set[str],
420
420
  results.append({"path": rel, "kind": "script", "namespace": ns, "packageTypesReferenced": refs})
421
421
  elif suf in (".unity", ".prefab"):
422
422
  try:
423
- text = p.read_text(encoding="utf-8", errors="replace")
423
+ text = p.read_text(encoding="utf-8-sig", errors="replace")
424
424
  except OSError:
425
425
  continue
426
426
  guids = sorted(set(SCRIPT_REF_RE.findall(text)))
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "com.elestrago.unity.package-tools",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "displayName": "Package Tool",
5
5
  "description": "Tool for create unity packages",
6
6
  "category": "unity",
7
7
  "unity": "2021.3",
8
8
  "homepage": "https://gitlab.com/elestrago-pkg/package-tool",
9
- "documentationUrl": "https://gitlab.com/elestrago-pkg/package-tool/-/blob/2.2.2/README.md",
10
- "changelogUrl": "https://gitlab.com/elestrago-pkg/package-tool/-/blob/2.2.2/CHANGELOG.md",
11
- "licensesUrl": "https://gitlab.com/elestrago-pkg/package-tool/-/blob/2.2.2/LICENSE",
9
+ "documentationUrl": "https://gitlab.com/elestrago-pkg/package-tool/-/blob/2.2.3/README.md",
10
+ "changelogUrl": "https://gitlab.com/elestrago-pkg/package-tool/-/blob/2.2.3/CHANGELOG.md",
11
+ "licensesUrl": "https://gitlab.com/elestrago-pkg/package-tool/-/blob/2.2.3/LICENSE",
12
12
  "license": "MIT",
13
13
  "keywords": [
14
14
  "unity",