@uapkg/diagnostics 1.2.0 → 1.3.1

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.
Files changed (81) hide show
  1. package/dist/base/Diagnostic.d.ts +22 -19
  2. package/dist/base/Diagnostic.d.ts.map +1 -1
  3. package/dist/base/Diagnostic.js +23 -24
  4. package/dist/base/Diagnostic.js.map +1 -1
  5. package/dist/base/DiagnosticBag.d.ts +32 -29
  6. package/dist/base/DiagnosticBag.d.ts.map +1 -1
  7. package/dist/base/DiagnosticBag.js +75 -76
  8. package/dist/base/DiagnosticBag.js.map +1 -1
  9. package/dist/base/DiagnosticFingerprint.d.ts +10 -8
  10. package/dist/base/DiagnosticFingerprint.d.ts.map +1 -1
  11. package/dist/base/DiagnosticFingerprint.js +18 -19
  12. package/dist/base/DiagnosticFingerprint.js.map +1 -1
  13. package/dist/base/DiagnosticLevel.d.ts +4 -1
  14. package/dist/base/DiagnosticLevel.d.ts.map +1 -1
  15. package/dist/base/DiagnosticLevel.js +1 -2
  16. package/dist/base/Result.d.ts +15 -12
  17. package/dist/base/Result.d.ts.map +1 -1
  18. package/dist/base/Result.js +28 -16
  19. package/dist/base/Result.js.map +1 -1
  20. package/dist/config/ConfigDiagnostics.d.ts +36 -33
  21. package/dist/config/ConfigDiagnostics.d.ts.map +1 -1
  22. package/dist/config/ConfigDiagnostics.js +51 -41
  23. package/dist/config/ConfigDiagnostics.js.map +1 -1
  24. package/dist/controlPlane/ControlPlaneDiagnostics.d.ts +22 -19
  25. package/dist/controlPlane/ControlPlaneDiagnostics.d.ts.map +1 -1
  26. package/dist/controlPlane/ControlPlaneDiagnostics.js +11 -7
  27. package/dist/controlPlane/ControlPlaneDiagnostics.js.map +1 -1
  28. package/dist/general/GeneralDiagnostics.d.ts +16 -13
  29. package/dist/general/GeneralDiagnostics.d.ts.map +1 -1
  30. package/dist/general/GeneralDiagnostics.js +34 -27
  31. package/dist/general/GeneralDiagnostics.js.map +1 -1
  32. package/dist/index.d.ts +20 -33
  33. package/dist/index.js +19 -20
  34. package/dist/installer/InstallerDiagnostics.d.ts +41 -38
  35. package/dist/installer/InstallerDiagnostics.d.ts.map +1 -1
  36. package/dist/installer/InstallerDiagnostics.js +86 -56
  37. package/dist/installer/InstallerDiagnostics.js.map +1 -1
  38. package/dist/manifest/ManifestDiagnostics.d.ts +50 -47
  39. package/dist/manifest/ManifestDiagnostics.d.ts.map +1 -1
  40. package/dist/manifest/ManifestDiagnostics.js +99 -80
  41. package/dist/manifest/ManifestDiagnostics.js.map +1 -1
  42. package/dist/pack/PackDiagnostics.d.ts +31 -28
  43. package/dist/pack/PackDiagnostics.d.ts.map +1 -1
  44. package/dist/pack/PackDiagnostics.js +70 -64
  45. package/dist/pack/PackDiagnostics.js.map +1 -1
  46. package/dist/postinstall/PostinstallDiagnostics.d.ts +35 -32
  47. package/dist/postinstall/PostinstallDiagnostics.d.ts.map +1 -1
  48. package/dist/postinstall/PostinstallDiagnostics.js +75 -52
  49. package/dist/postinstall/PostinstallDiagnostics.js.map +1 -1
  50. package/dist/publishing/PublishingDiagnostics.d.ts +78 -0
  51. package/dist/publishing/PublishingDiagnostics.d.ts.map +1 -0
  52. package/dist/publishing/PublishingDiagnostics.js +14 -0
  53. package/dist/publishing/PublishingDiagnostics.js.map +1 -0
  54. package/dist/registry/RegistryDiagnostics.d.ts +51 -48
  55. package/dist/registry/RegistryDiagnostics.d.ts.map +1 -1
  56. package/dist/registry/RegistryDiagnostics.js +106 -82
  57. package/dist/registry/RegistryDiagnostics.js.map +1 -1
  58. package/dist/registryTools/RegistryToolsDiagnostics.d.ts +97 -94
  59. package/dist/registryTools/RegistryToolsDiagnostics.d.ts.map +1 -1
  60. package/dist/registryTools/RegistryToolsDiagnostics.js +91 -40
  61. package/dist/registryTools/RegistryToolsDiagnostics.js.map +1 -1
  62. package/dist/resolver/ResolverDiagnostics.d.ts +27 -24
  63. package/dist/resolver/ResolverDiagnostics.d.ts.map +1 -1
  64. package/dist/resolver/ResolverDiagnostics.js +59 -43
  65. package/dist/resolver/ResolverDiagnostics.js.map +1 -1
  66. package/dist/safety/SafetyDiagnostics.d.ts +19 -16
  67. package/dist/safety/SafetyDiagnostics.d.ts.map +1 -1
  68. package/dist/safety/SafetyDiagnostics.js +38 -26
  69. package/dist/safety/SafetyDiagnostics.js.map +1 -1
  70. package/dist/spec/SpecDiagnostics.d.ts +17 -14
  71. package/dist/spec/SpecDiagnostics.d.ts.map +1 -1
  72. package/dist/spec/SpecDiagnostics.js +37 -27
  73. package/dist/spec/SpecDiagnostics.js.map +1 -1
  74. package/dist/types.d.ts +20 -16
  75. package/dist/types.d.ts.map +1 -1
  76. package/dist/types.js +1 -2
  77. package/package.json +14 -16
  78. package/dist/base/DiagnosticLevel.js.map +0 -1
  79. package/dist/index.d.ts.map +0 -1
  80. package/dist/index.js.map +0 -1
  81. package/dist/types.js.map +0 -1
@@ -1,90 +1,109 @@
1
- // ---------------------------------------------------------------------------
2
- // Factory helpers
3
- // ---------------------------------------------------------------------------
4
- export function createManifestInvalidDiagnostic(filePath, issues) {
5
- return {
6
- level: 'error',
7
- code: 'MANIFEST_INVALID',
8
- message: `Manifest validation failed for "${filePath}".`,
9
- hint: 'Review your uapkg.json against the expected schema.',
10
- data: { filePath, issues },
11
- };
1
+ //#region src/manifest/ManifestDiagnostics.ts
2
+ function createManifestInvalidDiagnostic(filePath, issues) {
3
+ return {
4
+ level: "error",
5
+ code: "MANIFEST_INVALID",
6
+ message: `Manifest validation failed for "${filePath}".`,
7
+ hint: "Review your uapkg.json against the expected schema.",
8
+ data: {
9
+ filePath,
10
+ issues
11
+ }
12
+ };
12
13
  }
13
- export function createLockfileInvalidDiagnostic(filePath, issues) {
14
- return {
15
- level: 'error',
16
- code: 'LOCKFILE_INVALID',
17
- message: `Lockfile validation failed for "${filePath}".`,
18
- hint: 'Delete uapkg.lock and re-run install to regenerate.',
19
- data: { filePath, issues },
20
- };
14
+ function createLockfileInvalidDiagnostic(filePath, issues) {
15
+ return {
16
+ level: "error",
17
+ code: "LOCKFILE_INVALID",
18
+ message: `Lockfile validation failed for "${filePath}".`,
19
+ hint: "Delete uapkg.lock and re-run install to regenerate.",
20
+ data: {
21
+ filePath,
22
+ issues
23
+ }
24
+ };
21
25
  }
22
- export function createLockfileMissingDiagnostic(filePath, level = 'warning') {
23
- return {
24
- level,
25
- code: 'LOCKFILE_MISSING',
26
- message: `No lockfile found at "${filePath}".`,
27
- hint: 'Run `uapkg install` to generate a lockfile, or use `--frozen` only when one already exists.',
28
- data: { filePath },
29
- };
26
+ function createLockfileMissingDiagnostic(filePath, level = "warning") {
27
+ return {
28
+ level,
29
+ code: "LOCKFILE_MISSING",
30
+ message: `No lockfile found at "${filePath}".`,
31
+ hint: "Run `uapkg install` to generate a lockfile, or use `--frozen` only when one already exists.",
32
+ data: { filePath }
33
+ };
30
34
  }
31
- export function createLockfileOutOfSyncDiagnostic(issues, totalIssues, logFilePath) {
32
- return {
33
- level: 'error',
34
- code: 'LOCKFILE_OUT_OF_SYNC',
35
- message: 'Lockfile is out of sync with the current manifest and registry state.',
36
- hint: 'Run `uapkg install` or `uapkg update` to regenerate the lockfile before using `--frozen`.',
37
- data: {
38
- issues,
39
- totalIssues,
40
- additionalIssues: Math.max(0, totalIssues - issues.length),
41
- logFilePath,
42
- },
43
- };
35
+ function createLockfileOutOfSyncDiagnostic(issues, totalIssues, logFilePath) {
36
+ return {
37
+ level: "error",
38
+ code: "LOCKFILE_OUT_OF_SYNC",
39
+ message: "Lockfile is out of sync with the current manifest and registry state.",
40
+ hint: "Run `uapkg install` or `uapkg update` to regenerate the lockfile before using `--frozen`.",
41
+ data: {
42
+ issues,
43
+ totalIssues,
44
+ additionalIssues: Math.max(0, totalIssues - issues.length),
45
+ logFilePath
46
+ }
47
+ };
44
48
  }
45
- export function createForbiddenOverridesDiagnostic(manifestKind, filePath) {
46
- return {
47
- level: 'error',
48
- code: 'FORBIDDEN_OVERRIDES',
49
- message: `Overrides are not allowed in "${manifestKind}" manifests ("${filePath}").`,
50
- hint: 'Overrides may only appear in root project manifests.',
51
- data: { manifestKind, filePath },
52
- };
49
+ function createForbiddenOverridesDiagnostic(manifestKind, filePath) {
50
+ return {
51
+ level: "error",
52
+ code: "FORBIDDEN_OVERRIDES",
53
+ message: `Overrides are not allowed in "${manifestKind}" manifests ("${filePath}").`,
54
+ hint: "Overrides may only appear in root project manifests.",
55
+ data: {
56
+ manifestKind,
57
+ filePath
58
+ }
59
+ };
53
60
  }
54
- export function createUnresolvedRegistryDiagnostic(registryName, dependencyName) {
55
- return {
56
- level: 'error',
57
- code: 'UNRESOLVED_REGISTRY',
58
- message: `Registry "${registryName}" referenced by dependency "${dependencyName}" is not configured.`,
59
- hint: 'Add the registry to your uapkg configuration.',
60
- data: { registryName, dependencyName },
61
- };
61
+ function createUnresolvedRegistryDiagnostic(registryName, dependencyName) {
62
+ return {
63
+ level: "error",
64
+ code: "UNRESOLVED_REGISTRY",
65
+ message: `Registry "${registryName}" referenced by dependency "${dependencyName}" is not configured.`,
66
+ hint: "Add the registry to your uapkg configuration.",
67
+ data: {
68
+ registryName,
69
+ dependencyName
70
+ }
71
+ };
62
72
  }
63
- export function createManifestReadErrorDiagnostic(filePath, reason) {
64
- return {
65
- level: 'error',
66
- code: 'MANIFEST_READ_ERROR',
67
- message: `Failed to read "${filePath}": ${reason}.`,
68
- hint: 'Ensure the file exists and is valid JSON.',
69
- data: { filePath, reason },
70
- };
73
+ function createManifestReadErrorDiagnostic(filePath, reason) {
74
+ return {
75
+ level: "error",
76
+ code: "MANIFEST_READ_ERROR",
77
+ message: `Failed to read "${filePath}": ${reason}.`,
78
+ hint: "Ensure the file exists and is valid JSON.",
79
+ data: {
80
+ filePath,
81
+ reason
82
+ }
83
+ };
71
84
  }
72
- export function createManifestWriteErrorDiagnostic(filePath, reason) {
73
- return {
74
- level: 'error',
75
- code: 'MANIFEST_WRITE_ERROR',
76
- message: `Failed to write "${filePath}": ${reason}.`,
77
- hint: 'Ensure the directory exists and you have write permissions.',
78
- data: { filePath, reason },
79
- };
85
+ function createManifestWriteErrorDiagnostic(filePath, reason) {
86
+ return {
87
+ level: "error",
88
+ code: "MANIFEST_WRITE_ERROR",
89
+ message: `Failed to write "${filePath}": ${reason}.`,
90
+ hint: "Ensure the directory exists and you have write permissions.",
91
+ data: {
92
+ filePath,
93
+ reason
94
+ }
95
+ };
80
96
  }
81
- export function createDependencyNotFoundDiagnostic(packageName) {
82
- return {
83
- level: 'info',
84
- code: 'DEPENDENCY_NOT_FOUND',
85
- message: `Package "${packageName}" is not declared in this manifest and will not be removed.`,
86
- hint: 'Run `uapkg list` to inspect currently declared dependencies.',
87
- data: { packageName },
88
- };
97
+ function createDependencyNotFoundDiagnostic(packageName) {
98
+ return {
99
+ level: "info",
100
+ code: "DEPENDENCY_NOT_FOUND",
101
+ message: `Package "${packageName}" is not declared in this manifest and will not be removed.`,
102
+ hint: "Run `uapkg list` to inspect currently declared dependencies.",
103
+ data: { packageName }
104
+ };
89
105
  }
106
+
107
+ //#endregion
108
+ export { createDependencyNotFoundDiagnostic, createForbiddenOverridesDiagnostic, createLockfileInvalidDiagnostic, createLockfileMissingDiagnostic, createLockfileOutOfSyncDiagnostic, createManifestInvalidDiagnostic, createManifestReadErrorDiagnostic, createManifestWriteErrorDiagnostic, createUnresolvedRegistryDiagnostic };
90
109
  //# sourceMappingURL=ManifestDiagnostics.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ManifestDiagnostics.js","sourceRoot":"","sources":["../../src/manifest/ManifestDiagnostics.ts"],"names":[],"mappings":"AAwGA,8EAA8E;AAC9E,kBAAkB;AAClB,8EAA8E;AAE9E,MAAM,UAAU,+BAA+B,CAC7C,QAAgB,EAChB,MAAyB;IAEzB,OAAO;QACL,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE,mCAAmC,QAAQ,IAAI;QACxD,IAAI,EAAE,qDAAqD;QAC3D,IAAI,EAAE,EAAE,QAAQ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KAAK,EAAE,OAAO;QACd,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,aAAa,YAAY,+BAA+B,cAAc,sBAAsB;QACrG,IAAI,EAAE,+CAA+C;QACrD,IAAI,EAAE,EAAE,YAAY,EAAE,cAAc,EAAE;KACvC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,QAAgB,EAAE,MAAc;IAChF,OAAO;QACL,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,mBAAmB,QAAQ,MAAM,MAAM,GAAG;QACnD,IAAI,EAAE,2CAA2C;QACjD,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE;KAC3B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kCAAkC,CAAC,QAAgB,EAAE,MAAc;IACjF,OAAO;QACL,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,sBAAsB;QAC5B,OAAO,EAAE,oBAAoB,QAAQ,MAAM,MAAM,GAAG;QACpD,IAAI,EAAE,6DAA6D;QACnE,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE;KAC3B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kCAAkC,CAAC,WAAmB;IACpE,OAAO;QACL,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,sBAAsB;QAC5B,OAAO,EAAE,YAAY,WAAW,6DAA6D;QAC7F,IAAI,EAAE,8DAA8D;QACpE,IAAI,EAAE,EAAE,WAAW,EAAE;KACtB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"ManifestDiagnostics.js","names":[],"sources":["../../src/manifest/ManifestDiagnostics.ts"],"sourcesContent":["import type { DiagnosticBase } from '../base/Diagnostic.js';\n\n// ---------------------------------------------------------------------------\n// Manifest diagnostic codes\n// ---------------------------------------------------------------------------\n\n/** Manifest content failed schema validation. */\nexport type ManifestInvalidDiagnostic = DiagnosticBase<\n 'MANIFEST_INVALID',\n {\n readonly filePath: string;\n readonly issues: readonly string[];\n }\n>;\n\n/** Lockfile content failed schema validation. */\nexport type LockfileInvalidDiagnostic = DiagnosticBase<\n 'LOCKFILE_INVALID',\n {\n readonly filePath: string;\n readonly issues: readonly string[];\n }\n>;\n\n/** Lockfile is missing from disk. */\nexport type LockfileMissingDiagnostic = DiagnosticBase<\n 'LOCKFILE_MISSING',\n {\n readonly filePath: string;\n }\n>;\n\n/** Lockfile is present but does not match manifest/config expectations. */\nexport type LockfileOutOfSyncDiagnostic = DiagnosticBase<\n 'LOCKFILE_OUT_OF_SYNC',\n {\n readonly issues: readonly {\n readonly severity: 'error' | 'warning' | 'info';\n readonly code: string;\n readonly message: string;\n readonly packageName?: string;\n }[];\n readonly totalIssues: number;\n readonly additionalIssues: number;\n readonly logFilePath: string;\n }\n>;\n\n/** Overrides are only allowed in root project manifests. */\nexport type ForbiddenOverridesDiagnostic = DiagnosticBase<\n 'FORBIDDEN_OVERRIDES',\n {\n readonly manifestKind: string;\n readonly filePath: string;\n }\n>;\n\n/** A registry name referenced in a dependency is not in configuration. */\nexport type UnresolvedRegistryDiagnostic = DiagnosticBase<\n 'UNRESOLVED_REGISTRY',\n {\n readonly registryName: string;\n readonly dependencyName: string;\n }\n>;\n\n/** Failed to read a manifest or lockfile from disk. */\nexport type ManifestReadErrorDiagnostic = DiagnosticBase<\n 'MANIFEST_READ_ERROR',\n {\n readonly filePath: string;\n readonly reason: string;\n }\n>;\n\n/** Failed to write a manifest or lockfile to disk. */\nexport type ManifestWriteErrorDiagnostic = DiagnosticBase<\n 'MANIFEST_WRITE_ERROR',\n {\n readonly filePath: string;\n readonly reason: string;\n }\n>;\n\n/** Remove was requested for a package that does not exist in manifest buckets. */\nexport type DependencyNotFoundDiagnostic = DiagnosticBase<\n 'DEPENDENCY_NOT_FOUND',\n {\n readonly packageName: string;\n }\n>;\n\n/** Union of all manifest diagnostics. */\nexport type ManifestDiagnostic =\n | ManifestInvalidDiagnostic\n | LockfileInvalidDiagnostic\n | LockfileMissingDiagnostic\n | LockfileOutOfSyncDiagnostic\n | ForbiddenOverridesDiagnostic\n | UnresolvedRegistryDiagnostic\n | ManifestReadErrorDiagnostic\n | ManifestWriteErrorDiagnostic\n | DependencyNotFoundDiagnostic;\n\n// ---------------------------------------------------------------------------\n// Factory helpers\n// ---------------------------------------------------------------------------\n\nexport function createManifestInvalidDiagnostic(\n filePath: string,\n issues: readonly string[],\n): ManifestInvalidDiagnostic {\n return {\n level: 'error',\n code: 'MANIFEST_INVALID',\n message: `Manifest validation failed for \"${filePath}\".`,\n hint: 'Review your uapkg.json against the expected schema.',\n data: { filePath, issues },\n };\n}\n\nexport function createLockfileInvalidDiagnostic(\n filePath: string,\n issues: readonly string[],\n): LockfileInvalidDiagnostic {\n return {\n level: 'error',\n code: 'LOCKFILE_INVALID',\n message: `Lockfile validation failed for \"${filePath}\".`,\n hint: 'Delete uapkg.lock and re-run install to regenerate.',\n data: { filePath, issues },\n };\n}\n\nexport function createLockfileMissingDiagnostic(\n filePath: string,\n level: 'warning' | 'error' = 'warning',\n): LockfileMissingDiagnostic {\n return {\n level,\n code: 'LOCKFILE_MISSING',\n message: `No lockfile found at \"${filePath}\".`,\n hint: 'Run `uapkg install` to generate a lockfile, or use `--frozen` only when one already exists.',\n data: { filePath },\n };\n}\n\nexport function createLockfileOutOfSyncDiagnostic(\n issues: readonly {\n readonly severity: 'error' | 'warning' | 'info';\n readonly code: string;\n readonly message: string;\n readonly packageName?: string;\n }[],\n totalIssues: number,\n logFilePath: string,\n): LockfileOutOfSyncDiagnostic {\n return {\n level: 'error',\n code: 'LOCKFILE_OUT_OF_SYNC',\n message: 'Lockfile is out of sync with the current manifest and registry state.',\n hint: 'Run `uapkg install` or `uapkg update` to regenerate the lockfile before using `--frozen`.',\n data: {\n issues,\n totalIssues,\n additionalIssues: Math.max(0, totalIssues - issues.length),\n logFilePath,\n },\n };\n}\n\nexport function createForbiddenOverridesDiagnostic(\n manifestKind: string,\n filePath: string,\n): ForbiddenOverridesDiagnostic {\n return {\n level: 'error',\n code: 'FORBIDDEN_OVERRIDES',\n message: `Overrides are not allowed in \"${manifestKind}\" manifests (\"${filePath}\").`,\n hint: 'Overrides may only appear in root project manifests.',\n data: { manifestKind, filePath },\n };\n}\n\nexport function createUnresolvedRegistryDiagnostic(\n registryName: string,\n dependencyName: string,\n): UnresolvedRegistryDiagnostic {\n return {\n level: 'error',\n code: 'UNRESOLVED_REGISTRY',\n message: `Registry \"${registryName}\" referenced by dependency \"${dependencyName}\" is not configured.`,\n hint: 'Add the registry to your uapkg configuration.',\n data: { registryName, dependencyName },\n };\n}\n\nexport function createManifestReadErrorDiagnostic(filePath: string, reason: string): ManifestReadErrorDiagnostic {\n return {\n level: 'error',\n code: 'MANIFEST_READ_ERROR',\n message: `Failed to read \"${filePath}\": ${reason}.`,\n hint: 'Ensure the file exists and is valid JSON.',\n data: { filePath, reason },\n };\n}\n\nexport function createManifestWriteErrorDiagnostic(filePath: string, reason: string): ManifestWriteErrorDiagnostic {\n return {\n level: 'error',\n code: 'MANIFEST_WRITE_ERROR',\n message: `Failed to write \"${filePath}\": ${reason}.`,\n hint: 'Ensure the directory exists and you have write permissions.',\n data: { filePath, reason },\n };\n}\n\nexport function createDependencyNotFoundDiagnostic(packageName: string): DependencyNotFoundDiagnostic {\n return {\n level: 'info',\n code: 'DEPENDENCY_NOT_FOUND',\n message: `Package \"${packageName}\" is not declared in this manifest and will not be removed.`,\n hint: 'Run `uapkg list` to inspect currently declared dependencies.',\n data: { packageName },\n };\n}\n"],"mappings":";AA4GA,SAAgB,gCACd,UACA,QAC2B;CAC3B,OAAO;EACL,OAAO;EACP,MAAM;EACN,SAAS,mCAAmC,SAAS;EACrD,MAAM;EACN,MAAM;GAAE;GAAU;EAAO;CAC3B;AACF;AAEA,SAAgB,gCACd,UACA,QAC2B;CAC3B,OAAO;EACL,OAAO;EACP,MAAM;EACN,SAAS,mCAAmC,SAAS;EACrD,MAAM;EACN,MAAM;GAAE;GAAU;EAAO;CAC3B;AACF;AAEA,SAAgB,gCACd,UACA,QAA6B,WACF;CAC3B,OAAO;EACL;EACA,MAAM;EACN,SAAS,yBAAyB,SAAS;EAC3C,MAAM;EACN,MAAM,EAAE,SAAS;CACnB;AACF;AAEA,SAAgB,kCACd,QAMA,aACA,aAC6B;CAC7B,OAAO;EACL,OAAO;EACP,MAAM;EACN,SAAS;EACT,MAAM;EACN,MAAM;GACJ;GACA;GACA,kBAAkB,KAAK,IAAI,GAAG,cAAc,OAAO,MAAM;GACzD;EACF;CACF;AACF;AAEA,SAAgB,mCACd,cACA,UAC8B;CAC9B,OAAO;EACL,OAAO;EACP,MAAM;EACN,SAAS,iCAAiC,aAAa,gBAAgB,SAAS;EAChF,MAAM;EACN,MAAM;GAAE;GAAc;EAAS;CACjC;AACF;AAEA,SAAgB,mCACd,cACA,gBAC8B;CAC9B,OAAO;EACL,OAAO;EACP,MAAM;EACN,SAAS,aAAa,aAAa,8BAA8B,eAAe;EAChF,MAAM;EACN,MAAM;GAAE;GAAc;EAAe;CACvC;AACF;AAEA,SAAgB,kCAAkC,UAAkB,QAA6C;CAC/G,OAAO;EACL,OAAO;EACP,MAAM;EACN,SAAS,mBAAmB,SAAS,KAAK,OAAO;EACjD,MAAM;EACN,MAAM;GAAE;GAAU;EAAO;CAC3B;AACF;AAEA,SAAgB,mCAAmC,UAAkB,QAA8C;CACjH,OAAO;EACL,OAAO;EACP,MAAM;EACN,SAAS,oBAAoB,SAAS,KAAK,OAAO;EAClD,MAAM;EACN,MAAM;GAAE;GAAU;EAAO;CAC3B;AACF;AAEA,SAAgB,mCAAmC,aAAmD;CACpG,OAAO;EACL,OAAO;EACP,MAAM;EACN,SAAS,YAAY,YAAY;EACjC,MAAM;EACN,MAAM,EAAE,YAAY;CACtB;AACF"}
@@ -1,47 +1,50 @@
1
- import type { DiagnosticBase } from '../base/Diagnostic.js';
1
+ import { DiagnosticBase } from "../base/Diagnostic.js";
2
+ //#region src/pack/PackDiagnostics.d.ts
2
3
  /** Cyclic symlink detected during file crawl. */
3
- export type CyclicSymlinkDiagnostic = DiagnosticBase<'CYCLIC_SYMLINK', {
4
- readonly filePath: string;
4
+ type CyclicSymlinkDiagnostic = DiagnosticBase<'CYCLIC_SYMLINK', {
5
+ readonly filePath: string;
5
6
  }>;
6
7
  /** Symlink resolves outside the plugin root. */
7
- export type SymlinkOutsideRootDiagnostic = DiagnosticBase<'SYMLINK_OUTSIDE_ROOT', {
8
- readonly filePath: string;
8
+ type SymlinkOutsideRootDiagnostic = DiagnosticBase<'SYMLINK_OUTSIDE_ROOT', {
9
+ readonly filePath: string;
9
10
  }>;
10
11
  /** Path normalization produced an invalid result. */
11
- export type InvalidPathDiagnostic = DiagnosticBase<'INVALID_PATH', {
12
- readonly filePath: string;
12
+ type InvalidPathDiagnostic = DiagnosticBase<'INVALID_PATH', {
13
+ readonly filePath: string;
13
14
  }>;
14
15
  /** No uapkg.json found walking upward from cwd. */
15
- export type PluginRootNotFoundDiagnostic = DiagnosticBase<'PLUGIN_ROOT_NOT_FOUND', {
16
- readonly cwd: string;
16
+ type PluginRootNotFoundDiagnostic = DiagnosticBase<'PLUGIN_ROOT_NOT_FOUND', {
17
+ readonly cwd: string;
17
18
  }>;
18
19
  /** Unresolved LFS pointer file (fatal when --allow-missing-lfs is off). */
19
- export type UnresolvedLfsDiagnostic = DiagnosticBase<'UNRESOLVED_LFS', {
20
- readonly filePath: string;
20
+ type UnresolvedLfsDiagnostic = DiagnosticBase<'UNRESOLVED_LFS', {
21
+ readonly filePath: string;
21
22
  }>;
22
23
  /** LFS pointer was skipped (warning when --allow-missing-lfs is on). */
23
- export type LfsSkippedDiagnostic = DiagnosticBase<'LFS_SKIPPED', {
24
- readonly filePath: string;
24
+ type LfsSkippedDiagnostic = DiagnosticBase<'LFS_SKIPPED', {
25
+ readonly filePath: string;
25
26
  }>;
26
27
  /** No files were selected for packing after filtering. */
27
- export type NoFilesSelectedDiagnostic = DiagnosticBase<'NO_FILES_SELECTED', Record<string, never>>;
28
+ type NoFilesSelectedDiagnostic = DiagnosticBase<'NO_FILES_SELECTED', Record<string, never>>;
28
29
  /** --outFile resolved to a directory instead of a file. */
29
- export type OutFileIsDirectoryDiagnostic = DiagnosticBase<'OUTFILE_IS_DIRECTORY', {
30
- readonly filePath: string;
30
+ type OutFileIsDirectoryDiagnostic = DiagnosticBase<'OUTFILE_IS_DIRECTORY', {
31
+ readonly filePath: string;
31
32
  }>;
32
33
  /** Plugin descriptor (*.uplugin) is required for pack operations. */
33
- export type UpluginMissingDiagnostic = DiagnosticBase<'UPLUGIN_MISSING', {
34
- readonly pluginRoot: string;
34
+ type UpluginMissingDiagnostic = DiagnosticBase<'UPLUGIN_MISSING', {
35
+ readonly pluginRoot: string;
35
36
  }>;
36
37
  /** Union of all pack diagnostics. */
37
- export type PackDiagnostic = CyclicSymlinkDiagnostic | SymlinkOutsideRootDiagnostic | InvalidPathDiagnostic | PluginRootNotFoundDiagnostic | UnresolvedLfsDiagnostic | LfsSkippedDiagnostic | NoFilesSelectedDiagnostic | OutFileIsDirectoryDiagnostic | UpluginMissingDiagnostic;
38
- export declare function createCyclicSymlinkDiagnostic(filePath: string): CyclicSymlinkDiagnostic;
39
- export declare function createSymlinkOutsideRootDiagnostic(filePath: string): SymlinkOutsideRootDiagnostic;
40
- export declare function createInvalidPathDiagnostic(filePath: string): InvalidPathDiagnostic;
41
- export declare function createPluginRootNotFoundDiagnostic(cwd: string): PluginRootNotFoundDiagnostic;
42
- export declare function createUnresolvedLfsDiagnostic(filePath: string): UnresolvedLfsDiagnostic;
43
- export declare function createLfsSkippedDiagnostic(filePath: string): LfsSkippedDiagnostic;
44
- export declare function createNoFilesSelectedDiagnostic(): NoFilesSelectedDiagnostic;
45
- export declare function createOutFileIsDirectoryDiagnostic(filePath: string): OutFileIsDirectoryDiagnostic;
46
- export declare function createUpluginMissingDiagnostic(pluginRoot: string): UpluginMissingDiagnostic;
38
+ type PackDiagnostic = CyclicSymlinkDiagnostic | SymlinkOutsideRootDiagnostic | InvalidPathDiagnostic | PluginRootNotFoundDiagnostic | UnresolvedLfsDiagnostic | LfsSkippedDiagnostic | NoFilesSelectedDiagnostic | OutFileIsDirectoryDiagnostic | UpluginMissingDiagnostic;
39
+ declare function createCyclicSymlinkDiagnostic(filePath: string): CyclicSymlinkDiagnostic;
40
+ declare function createSymlinkOutsideRootDiagnostic(filePath: string): SymlinkOutsideRootDiagnostic;
41
+ declare function createInvalidPathDiagnostic(filePath: string): InvalidPathDiagnostic;
42
+ declare function createPluginRootNotFoundDiagnostic(cwd: string): PluginRootNotFoundDiagnostic;
43
+ declare function createUnresolvedLfsDiagnostic(filePath: string): UnresolvedLfsDiagnostic;
44
+ declare function createLfsSkippedDiagnostic(filePath: string): LfsSkippedDiagnostic;
45
+ declare function createNoFilesSelectedDiagnostic(): NoFilesSelectedDiagnostic;
46
+ declare function createOutFileIsDirectoryDiagnostic(filePath: string): OutFileIsDirectoryDiagnostic;
47
+ declare function createUpluginMissingDiagnostic(pluginRoot: string): UpluginMissingDiagnostic;
48
+ //#endregion
49
+ export { CyclicSymlinkDiagnostic, InvalidPathDiagnostic, LfsSkippedDiagnostic, NoFilesSelectedDiagnostic, OutFileIsDirectoryDiagnostic, PackDiagnostic, PluginRootNotFoundDiagnostic, SymlinkOutsideRootDiagnostic, UnresolvedLfsDiagnostic, UpluginMissingDiagnostic, createCyclicSymlinkDiagnostic, createInvalidPathDiagnostic, createLfsSkippedDiagnostic, createNoFilesSelectedDiagnostic, createOutFileIsDirectoryDiagnostic, createPluginRootNotFoundDiagnostic, createSymlinkOutsideRootDiagnostic, createUnresolvedLfsDiagnostic, createUpluginMissingDiagnostic };
47
50
  //# sourceMappingURL=PackDiagnostics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PackDiagnostics.d.ts","sourceRoot":"","sources":["../../src/pack/PackDiagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAM5D,iDAAiD;AACjD,MAAM,MAA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BAAmB;iBAS9C,mCAAmC;iBASnC,mCAAmC,mBAAmB;iBAStD,+BAA+B,qBAAqB"}
@@ -1,74 +1,80 @@
1
- // ---------------------------------------------------------------------------
2
- // Factory helpers
3
- // ---------------------------------------------------------------------------
4
- export function createCyclicSymlinkDiagnostic(filePath) {
5
- return {
6
- level: 'error',
7
- code: 'CYCLIC_SYMLINK',
8
- message: `Cyclic symlink detected at ${filePath}.`,
9
- data: { filePath },
10
- };
1
+ //#region src/pack/PackDiagnostics.ts
2
+ function createCyclicSymlinkDiagnostic(filePath) {
3
+ return {
4
+ level: "error",
5
+ code: "CYCLIC_SYMLINK",
6
+ message: `Cyclic symlink detected at ${filePath}.`,
7
+ data: { filePath }
8
+ };
11
9
  }
12
- export function createSymlinkOutsideRootDiagnostic(filePath) {
13
- return {
14
- level: 'error',
15
- code: 'SYMLINK_OUTSIDE_ROOT',
16
- message: `Symlink resolves outside plugin root: ${filePath}.`,
17
- data: { filePath },
18
- };
10
+ function createSymlinkOutsideRootDiagnostic(filePath) {
11
+ return {
12
+ level: "error",
13
+ code: "SYMLINK_OUTSIDE_ROOT",
14
+ message: `Symlink resolves outside plugin root: ${filePath}.`,
15
+ data: { filePath }
16
+ };
19
17
  }
20
- export function createInvalidPathDiagnostic(filePath) {
21
- return { level: 'error', code: 'INVALID_PATH', message: `Invalid normalized path: ${filePath}.`, data: { filePath } };
18
+ function createInvalidPathDiagnostic(filePath) {
19
+ return {
20
+ level: "error",
21
+ code: "INVALID_PATH",
22
+ message: `Invalid normalized path: ${filePath}.`,
23
+ data: { filePath }
24
+ };
22
25
  }
23
- export function createPluginRootNotFoundDiagnostic(cwd) {
24
- return {
25
- level: 'error',
26
- code: 'PLUGIN_ROOT_NOT_FOUND',
27
- message: 'No uapkg.json found from current directory upward.',
28
- hint: 'Run this command from within a uapkg project.',
29
- data: { cwd },
30
- };
26
+ function createPluginRootNotFoundDiagnostic(cwd) {
27
+ return {
28
+ level: "error",
29
+ code: "PLUGIN_ROOT_NOT_FOUND",
30
+ message: "No uapkg.json found from current directory upward.",
31
+ hint: "Run this command from within a uapkg project.",
32
+ data: { cwd }
33
+ };
31
34
  }
32
- export function createUnresolvedLfsDiagnostic(filePath) {
33
- return {
34
- level: 'error',
35
- code: 'UNRESOLVED_LFS',
36
- message: `Unresolved LFS pointer file: ${filePath}.`,
37
- hint: "Run 'git lfs pull' or use --allow-missing-lfs.",
38
- data: { filePath },
39
- };
35
+ function createUnresolvedLfsDiagnostic(filePath) {
36
+ return {
37
+ level: "error",
38
+ code: "UNRESOLVED_LFS",
39
+ message: `Unresolved LFS pointer file: ${filePath}.`,
40
+ hint: "Run 'git lfs pull' or use --allow-missing-lfs.",
41
+ data: { filePath }
42
+ };
40
43
  }
41
- export function createLfsSkippedDiagnostic(filePath) {
42
- return {
43
- level: 'warning',
44
- code: 'LFS_SKIPPED',
45
- message: `Skipping unresolved LFS file: ${filePath}.`,
46
- data: { filePath },
47
- };
44
+ function createLfsSkippedDiagnostic(filePath) {
45
+ return {
46
+ level: "warning",
47
+ code: "LFS_SKIPPED",
48
+ message: `Skipping unresolved LFS file: ${filePath}.`,
49
+ data: { filePath }
50
+ };
48
51
  }
49
- export function createNoFilesSelectedDiagnostic() {
50
- return {
51
- level: 'error',
52
- code: 'NO_FILES_SELECTED',
53
- message: 'No files selected for packing after ignore/LFS resolution.',
54
- data: {},
55
- };
52
+ function createNoFilesSelectedDiagnostic() {
53
+ return {
54
+ level: "error",
55
+ code: "NO_FILES_SELECTED",
56
+ message: "No files selected for packing after ignore/LFS resolution.",
57
+ data: {}
58
+ };
56
59
  }
57
- export function createOutFileIsDirectoryDiagnostic(filePath) {
58
- return {
59
- level: 'error',
60
- code: 'OUTFILE_IS_DIRECTORY',
61
- message: '--outFile must be a file path, not a directory.',
62
- data: { filePath },
63
- };
60
+ function createOutFileIsDirectoryDiagnostic(filePath) {
61
+ return {
62
+ level: "error",
63
+ code: "OUTFILE_IS_DIRECTORY",
64
+ message: "--outFile must be a file path, not a directory.",
65
+ data: { filePath }
66
+ };
64
67
  }
65
- export function createUpluginMissingDiagnostic(pluginRoot) {
66
- return {
67
- level: 'error',
68
- code: 'UPLUGIN_MISSING',
69
- message: `No plugin descriptor (*.uplugin) was found in "${pluginRoot}".`,
70
- hint: 'Ensure your plugin root contains a .uplugin file before running `uapkg pack`.',
71
- data: { pluginRoot },
72
- };
68
+ function createUpluginMissingDiagnostic(pluginRoot) {
69
+ return {
70
+ level: "error",
71
+ code: "UPLUGIN_MISSING",
72
+ message: `No plugin descriptor (*.uplugin) was found in "${pluginRoot}".`,
73
+ hint: "Ensure your plugin root contains a .uplugin file before running `uapkg pack`.",
74
+ data: { pluginRoot }
75
+ };
73
76
  }
77
+
78
+ //#endregion
79
+ export { createCyclicSymlinkDiagnostic, createInvalidPathDiagnostic, createLfsSkippedDiagnostic, createNoFilesSelectedDiagnostic, createOutFileIsDirectoryDiagnostic, createPluginRootNotFoundDiagnostic, createSymlinkOutsideRootDiagnostic, createUnresolvedLfsDiagnostic, createUpluginMissingDiagnostic };
74
80
  //# sourceMappingURL=PackDiagnostics.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PackDiagnostics.js","sourceRoot":"","sources":["../../src/pack/PackDiagnostics.ts"],"names":[],"mappings":"AA6CA,8EAA8E;AAC9E,kBAAkB;AAClB,8EAA8E;AAE9E,MAAM,UAAU,6BAA6B,CAAC,QAAgB;IAC5D,OAAO;QACL,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,8BAA8B,QAAQ,GAAG;QAClD,IAAI,EAAE,EAAE,QAAQ,EAAE;KACnB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kCAAkC,CAAC,QAAgB;IACjE,OAAO;QACL,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,sBAAsB;QAC5B,OAAO,EAAE,yCAAyC,QAAQ,GAAG;QAC7D,IAAI,EAAE,EAAE,QAAQ,EAAE;KACnB,CAAC;AACJ,CAAC;AAED,MAA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QACL,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,kDAAkD,UAAU,IAAI;QACzE,IAAI,EAAE,+EAA+E;QACrF,IAAI,EAAE,EAAE,UAAU,EAAE;KACrB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"PackDiagnostics.js","names":[],"sources":["../../src/pack/PackDiagnostics.ts"],"sourcesContent":["import type { DiagnosticBase } from '../base/Diagnostic.js';\n\n// ---------------------------------------------------------------------------\n// Pack diagnostic codes\n// ---------------------------------------------------------------------------\n\n/** Cyclic symlink detected during file crawl. */\nexport type CyclicSymlinkDiagnostic = DiagnosticBase<'CYCLIC_SYMLINK', { readonly filePath: string }>;\n\n/** Symlink resolves outside the plugin root. */\nexport type SymlinkOutsideRootDiagnostic = DiagnosticBase<'SYMLINK_OUTSIDE_ROOT', { readonly filePath: string }>;\n\n/** Path normalization produced an invalid result. */\nexport type InvalidPathDiagnostic = DiagnosticBase<'INVALID_PATH', { readonly filePath: string }>;\n\n/** No uapkg.json found walking upward from cwd. */\nexport type PluginRootNotFoundDiagnostic = DiagnosticBase<'PLUGIN_ROOT_NOT_FOUND', { readonly cwd: string }>;\n\n/** Unresolved LFS pointer file (fatal when --allow-missing-lfs is off). */\nexport type UnresolvedLfsDiagnostic = DiagnosticBase<'UNRESOLVED_LFS', { readonly filePath: string }>;\n\n/** LFS pointer was skipped (warning when --allow-missing-lfs is on). */\nexport type LfsSkippedDiagnostic = DiagnosticBase<'LFS_SKIPPED', { readonly filePath: string }>;\n\n/** No files were selected for packing after filtering. */\nexport type NoFilesSelectedDiagnostic = DiagnosticBase<'NO_FILES_SELECTED', Record<string, never>>;\n\n/** --outFile resolved to a directory instead of a file. */\nexport type OutFileIsDirectoryDiagnostic = DiagnosticBase<'OUTFILE_IS_DIRECTORY', { readonly filePath: string }>;\n\n/** Plugin descriptor (*.uplugin) is required for pack operations. */\nexport type UpluginMissingDiagnostic = DiagnosticBase<'UPLUGIN_MISSING', { readonly pluginRoot: string }>;\n\n/** Union of all pack diagnostics. */\nexport type PackDiagnostic =\n | CyclicSymlinkDiagnostic\n | SymlinkOutsideRootDiagnostic\n | InvalidPathDiagnostic\n | PluginRootNotFoundDiagnostic\n | UnresolvedLfsDiagnostic\n | LfsSkippedDiagnostic\n | NoFilesSelectedDiagnostic\n | OutFileIsDirectoryDiagnostic\n | UpluginMissingDiagnostic;\n\n// ---------------------------------------------------------------------------\n// Factory helpers\n// ---------------------------------------------------------------------------\n\nexport function createCyclicSymlinkDiagnostic(filePath: string): CyclicSymlinkDiagnostic {\n return {\n level: 'error',\n code: 'CYCLIC_SYMLINK',\n message: `Cyclic symlink detected at ${filePath}.`,\n data: { filePath },\n };\n}\n\nexport function createSymlinkOutsideRootDiagnostic(filePath: string): SymlinkOutsideRootDiagnostic {\n return {\n level: 'error',\n code: 'SYMLINK_OUTSIDE_ROOT',\n message: `Symlink resolves outside plugin root: ${filePath}.`,\n data: { filePath },\n };\n}\n\nexport function createInvalidPathDiagnostic(filePath: string): InvalidPathDiagnostic {\n return { level: 'error', code: 'INVALID_PATH', message: `Invalid normalized path: ${filePath}.`, data: { filePath } };\n}\n\nexport function createPluginRootNotFoundDiagnostic(cwd: string): PluginRootNotFoundDiagnostic {\n return {\n level: 'error',\n code: 'PLUGIN_ROOT_NOT_FOUND',\n message: 'No uapkg.json found from current directory upward.',\n hint: 'Run this command from within a uapkg project.',\n data: { cwd },\n };\n}\n\nexport function createUnresolvedLfsDiagnostic(filePath: string): UnresolvedLfsDiagnostic {\n return {\n level: 'error',\n code: 'UNRESOLVED_LFS',\n message: `Unresolved LFS pointer file: ${filePath}.`,\n hint: \"Run 'git lfs pull' or use --allow-missing-lfs.\",\n data: { filePath },\n };\n}\n\nexport function createLfsSkippedDiagnostic(filePath: string): LfsSkippedDiagnostic {\n return {\n level: 'warning',\n code: 'LFS_SKIPPED',\n message: `Skipping unresolved LFS file: ${filePath}.`,\n data: { filePath },\n };\n}\n\nexport function createNoFilesSelectedDiagnostic(): NoFilesSelectedDiagnostic {\n return {\n level: 'error',\n code: 'NO_FILES_SELECTED',\n message: 'No files selected for packing after ignore/LFS resolution.',\n data: {},\n };\n}\n\nexport function createOutFileIsDirectoryDiagnostic(filePath: string): OutFileIsDirectoryDiagnostic {\n return {\n level: 'error',\n code: 'OUTFILE_IS_DIRECTORY',\n message: '--outFile must be a file path, not a directory.',\n data: { filePath },\n };\n}\n\nexport function createUpluginMissingDiagnostic(pluginRoot: string): UpluginMissingDiagnostic {\n return {\n level: 'error',\n code: 'UPLUGIN_MISSING',\n message: `No plugin descriptor (*.uplugin) was found in \"${pluginRoot}\".`,\n hint: 'Ensure your plugin root contains a .uplugin file before running `uapkg pack`.',\n data: { pluginRoot },\n };\n}\n"],"mappings":";AAiDA,SAAgB,8BAA8B,UAA2C;CACvF,OAAO;EACL,OAAO;EACP,MAAM;EACN,SAAS,8BAA8B,SAAS;EAChD,MAAM,EAAE,SAAS;CACnB;AACF;AAEA,SAAgB,mCAAmC,UAAgD;CACjG,OAAO;EACL,OAAO;EACP,MAAM;EACN,SAAS,yCAAyC,SAAS;EAC3D,MAAM,EAAE,SAAS;CACnB;AACF;AAEA,SAAgB,4BAA4B,UAAyC;CACnF,OAAO;EAAE,OAAO;EAAS,MAAM;EAAgB,SAAS,4BAA4B,SAAS;EAAI,MAAM,EAAE,SAAS;CAAE;AACtH;AAEA,SAAgB,mCAAmC,KAA2C;CAC5F,OAAO;EACL,OAAO;EACP,MAAM;EACN,SAAS;EACT,MAAM;EACN,MAAM,EAAE,IAAI;CACd;AACF;AAEA,SAAgB,8BAA8B,UAA2C;CACvF,OAAO;EACL,OAAO;EACP,MAAM;EACN,SAAS,gCAAgC,SAAS;EAClD,MAAM;EACN,MAAM,EAAE,SAAS;CACnB;AACF;AAEA,SAAgB,2BAA2B,UAAwC;CACjF,OAAO;EACL,OAAO;EACP,MAAM;EACN,SAAS,iCAAiC,SAAS;EACnD,MAAM,EAAE,SAAS;CACnB;AACF;AAEA,SAAgB,kCAA6D;CAC3E,OAAO;EACL,OAAO;EACP,MAAM;EACN,SAAS;EACT,MAAM,CAAC;CACT;AACF;AAEA,SAAgB,mCAAmC,UAAgD;CACjG,OAAO;EACL,OAAO;EACP,MAAM;EACN,SAAS;EACT,MAAM,EAAE,SAAS;CACnB;AACF;AAEA,SAAgB,+BAA+B,YAA8C;CAC3F,OAAO;EACL,OAAO;EACP,MAAM;EACN,SAAS,kDAAkD,WAAW;EACtE,MAAM;EACN,MAAM,EAAE,WAAW;CACrB;AACF"}
@@ -1,45 +1,48 @@
1
- import type { DiagnosticBase } from '../base/Diagnostic.js';
1
+ import { DiagnosticBase } from "../base/Diagnostic.js";
2
+ //#region src/postinstall/PostinstallDiagnostics.d.ts
2
3
  /** Postinstall was denied by policy (install.postInstallPolicy or per-registry override). */
3
- export type PostinstallPolicyDeniedDiagnostic = DiagnosticBase<'POSTINSTALL_POLICY_DENIED', {
4
- readonly packageName: string;
5
- readonly registry: string;
6
- readonly policy: 'allow' | 'deny';
7
- readonly resolvedFrom: 'registry' | 'install';
4
+ type PostinstallPolicyDeniedDiagnostic = DiagnosticBase<'POSTINSTALL_POLICY_DENIED', {
5
+ readonly packageName: string;
6
+ readonly registry: string;
7
+ readonly policy: 'allow' | 'deny';
8
+ readonly resolvedFrom: 'registry' | 'install';
8
9
  }>;
9
10
  /** Loading the postinstall module failed (e.g. import error). */
10
- export type PostinstallLoadFailedDiagnostic = DiagnosticBase<'POSTINSTALL_LOAD_FAILED', {
11
- readonly packageName: string;
12
- readonly entryFile: string;
13
- readonly reason: string;
11
+ type PostinstallLoadFailedDiagnostic = DiagnosticBase<'POSTINSTALL_LOAD_FAILED', {
12
+ readonly packageName: string;
13
+ readonly entryFile: string;
14
+ readonly reason: string;
14
15
  }>;
15
16
  /** The postinstall module's default export failed Zod validation. */
16
- export type PostinstallInvalidExportDiagnostic = DiagnosticBase<'POSTINSTALL_INVALID_EXPORT', {
17
- readonly packageName: string;
18
- readonly entryFile: string;
19
- readonly issues: readonly string[];
17
+ type PostinstallInvalidExportDiagnostic = DiagnosticBase<'POSTINSTALL_INVALID_EXPORT', {
18
+ readonly packageName: string;
19
+ readonly entryFile: string;
20
+ readonly issues: readonly string[];
20
21
  }>;
21
22
  /** More than one candidate postinstall entry file exists (e.g. both .ts and .js). */
22
- export type PostinstallDuplicateEntryDiagnostic = DiagnosticBase<'POSTINSTALL_DUPLICATE_ENTRY', {
23
- readonly packageName: string;
24
- readonly candidates: readonly string[];
23
+ type PostinstallDuplicateEntryDiagnostic = DiagnosticBase<'POSTINSTALL_DUPLICATE_ENTRY', {
24
+ readonly packageName: string;
25
+ readonly candidates: readonly string[];
25
26
  }>;
26
27
  /** Marker-block in a generated file is corrupt or was edited manually. */
27
- export type PostinstallMarkerCorruptDiagnostic = DiagnosticBase<'POSTINSTALL_MARKER_CORRUPT', {
28
- readonly packageName: string;
29
- readonly file: string;
30
- readonly reason: string;
28
+ type PostinstallMarkerCorruptDiagnostic = DiagnosticBase<'POSTINSTALL_MARKER_CORRUPT', {
29
+ readonly packageName: string;
30
+ readonly file: string;
31
+ readonly reason: string;
31
32
  }>;
32
33
  /** esbuild failed to transpile a `.ts` postinstall entry file. */
33
- export type PostinstallEsbuildErrorDiagnostic = DiagnosticBase<'POSTINSTALL_ESBUILD_ERROR', {
34
- readonly packageName: string;
35
- readonly entryFile: string;
36
- readonly reason: string;
34
+ type PostinstallEsbuildErrorDiagnostic = DiagnosticBase<'POSTINSTALL_ESBUILD_ERROR', {
35
+ readonly packageName: string;
36
+ readonly entryFile: string;
37
+ readonly reason: string;
37
38
  }>;
38
- export type PostinstallDiagnostic = PostinstallPolicyDeniedDiagnostic | PostinstallLoadFailedDiagnostic | PostinstallInvalidExportDiagnostic | PostinstallDuplicateEntryDiagnostic | PostinstallMarkerCorruptDiagnostic | PostinstallEsbuildErrorDiagnostic;
39
- export declare function createPostinstallPolicyDeniedDiagnostic(packageName: string, registry: string, policy: 'allow' | 'deny', resolvedFrom: 'registry' | 'install'): PostinstallPolicyDeniedDiagnostic;
40
- export declare function createPostinstallLoadFailedDiagnostic(packageName: string, entryFile: string, reason: string): PostinstallLoadFailedDiagnostic;
41
- export declare function createPostinstallInvalidExportDiagnostic(packageName: string, entryFile: string, issues: readonly string[]): PostinstallInvalidExportDiagnostic;
42
- export declare function createPostinstallDuplicateEntryDiagnostic(packageName: string, candidates: readonly string[]): PostinstallDuplicateEntryDiagnostic;
43
- export declare function createPostinstallMarkerCorruptDiagnostic(packageName: string, file: string, reason: string): PostinstallMarkerCorruptDiagnostic;
44
- export declare function createPostinstallEsbuildErrorDiagnostic(packageName: string, entryFile: string, reason: string): PostinstallEsbuildErrorDiagnostic;
39
+ type PostinstallDiagnostic = PostinstallPolicyDeniedDiagnostic | PostinstallLoadFailedDiagnostic | PostinstallInvalidExportDiagnostic | PostinstallDuplicateEntryDiagnostic | PostinstallMarkerCorruptDiagnostic | PostinstallEsbuildErrorDiagnostic;
40
+ declare function createPostinstallPolicyDeniedDiagnostic(packageName: string, registry: string, policy: 'allow' | 'deny', resolvedFrom: 'registry' | 'install'): PostinstallPolicyDeniedDiagnostic;
41
+ declare function createPostinstallLoadFailedDiagnostic(packageName: string, entryFile: string, reason: string): PostinstallLoadFailedDiagnostic;
42
+ declare function createPostinstallInvalidExportDiagnostic(packageName: string, entryFile: string, issues: readonly string[]): PostinstallInvalidExportDiagnostic;
43
+ declare function createPostinstallDuplicateEntryDiagnostic(packageName: string, candidates: readonly string[]): PostinstallDuplicateEntryDiagnostic;
44
+ declare function createPostinstallMarkerCorruptDiagnostic(packageName: string, file: string, reason: string): PostinstallMarkerCorruptDiagnostic;
45
+ declare function createPostinstallEsbuildErrorDiagnostic(packageName: string, entryFile: string, reason: string): PostinstallEsbuildErrorDiagnostic;
46
+ //#endregion
47
+ export { PostinstallDiagnostic, PostinstallDuplicateEntryDiagnostic, PostinstallEsbuildErrorDiagnostic, PostinstallInvalidExportDiagnostic, PostinstallLoadFailedDiagnostic, PostinstallMarkerCorruptDiagnostic, PostinstallPolicyDeniedDiagnostic, createPostinstallDuplicateEntryDiagnostic, createPostinstallEsbuildErrorDiagnostic, createPostinstallInvalidExportDiagnostic, createPostinstallLoadFailedDiagnostic, createPostinstallMarkerCorruptDiagnostic, createPostinstallPolicyDeniedDiagnostic };
45
48
  //# sourceMappingURL=PostinstallDiagnostics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PostinstallDiagnostics.d.ts","sourceRoot":"","sources":["../../src/postinstall/PostinstallDiagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAM5D,6FAA6F;AAC7F,MAAM,MAAM,iCAAiC,GAAG,cAAc,CAC5D,2BAA2B,EAC3B;IACE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC,QAAQ,CAAC,YAAY,EAAE,UAAU,GAAG,SAAS,CAAC;CAC/C,CACF,CAAC;AAEF,iEAAiE;AACjE,MAAM,MAAM,+BAA+B,GAAG,cAAc,CAC1D,yBAAyB,EACzB;IACE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CACF,CAAC;AAEF,qEAAqE;AACrE,MAAM,MAAM,kCAAkC,GAAG,cAAc,CAC7D,4BAA4B,EAC5B;IACE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC,CACF,CAAC;AAEF,qFAAqF;AACrF,MAAM,MAAM,mCAAmC,GAAG,cAAc,CAC9D,6BAA6B,EAC7B;IACE,QAAQ,CA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nB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACb,kCAAkC,CAQpC;AAED,wBAAgB,uCAAuC,CACrD,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,iCAAiC,CAQnC"}
1
+ {"version":3,"file":"PostinstallDiagnostics.d.ts","names":[],"sources":["../../src/postinstall/PostinstallDiagnostics.ts"],"mappings":";;;KAOY,oCAAoC;WAGnC;WACA;WACA;WACA;;;KAKD,kCAAkC;WAGjC;WACA;WACA;;;KAKD,qCAAqC;WAGpC;WACA;WACA;;;KAKD,sCAAsC;WAGrC;WACA;;;KAKD,qCAAqC;WAGpC;WACA;WACA;;;KAKD,oCAAoC;WAGnC;WACA;WACA;;KAID,wBACR,oCACA,kCACA,qCACA,sCACA,qCACA;iBAMY,wCACd,qBACA,kBACA,0BACA,uCACC;iBAaa,sCACd,qBACA,mBACA,iBACC;iBASa,yCACd,qBACA,mBACA,4BACC;iBAUa,0CACd,qBACA,gCACC;iBAUa,yCACd,qBACA,cACA,iBACC;iBAUa,wCACd,qBACA,mBACA,iBACC"}