@effected/package-json 0.7.2 → 0.8.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/License.js CHANGED
@@ -10,7 +10,7 @@ import { isValidExpression } from "@effected/spdx";
10
10
  *
11
11
  * @public
12
12
  */
13
- var InvalidSpdxLicenseError = class extends Schema.TaggedErrorClass()("InvalidSpdxLicenseError", {
13
+ var InvalidSpdxLicenseError = class extends Schema.TaggedError()("InvalidSpdxLicenseError", {
14
14
  /** The raw input string that failed validation. */
15
15
  input: Schema.String }) {
16
16
  get message() {
package/Package.js CHANGED
@@ -80,7 +80,7 @@ const RepositoryField = Schema.Union([Schema.String, Schema.Record(Schema.String
80
80
  *
81
81
  * @public
82
82
  */
83
- var PackageDecodeError = class extends Schema.TaggedErrorClass()("PackageDecodeError", {
83
+ var PackageDecodeError = class extends Schema.TaggedError()("PackageDecodeError", {
84
84
  /** The underlying `SchemaError`, preserved structurally rather than stringified. */
85
85
  cause: Schema.Defect() }) {
86
86
  get message() {
@@ -8,7 +8,7 @@ import { Context, Effect, FileSystem, Layer, Path, Schema } from "effect";
8
8
  *
9
9
  * @public
10
10
  */
11
- var PackageJsonReadError = class extends Schema.TaggedErrorClass()("PackageJsonReadError", {
11
+ var PackageJsonReadError = class extends Schema.TaggedError()("PackageJsonReadError", {
12
12
  /** The path that could not be read. */
13
13
  path: Schema.String,
14
14
  /** The underlying failure, preserved structurally. */
@@ -24,7 +24,7 @@ var PackageJsonReadError = class extends Schema.TaggedErrorClass()("PackageJsonR
24
24
  *
25
25
  * @public
26
26
  */
27
- var PackageJsonNotFoundError = class extends Schema.TaggedErrorClass()("PackageJsonNotFoundError", {
27
+ var PackageJsonNotFoundError = class extends Schema.TaggedError()("PackageJsonNotFoundError", {
28
28
  /** The path where package.json was expected. */
29
29
  path: Schema.String }) {
30
30
  get message() {
@@ -36,7 +36,7 @@ path: Schema.String }) {
36
36
  *
37
37
  * @public
38
38
  */
39
- var PackageJsonParseError = class extends Schema.TaggedErrorClass()("PackageJsonParseError", {
39
+ var PackageJsonParseError = class extends Schema.TaggedError()("PackageJsonParseError", {
40
40
  /** The path whose contents failed to parse as JSON. */
41
41
  path: Schema.String,
42
42
  /** The underlying `SyntaxError`, preserved structurally. */
@@ -53,7 +53,7 @@ var PackageJsonParseError = class extends Schema.TaggedErrorClass()("PackageJson
53
53
  *
54
54
  * @public
55
55
  */
56
- var PackageJsonWriteError = class extends Schema.TaggedErrorClass()("PackageJsonWriteError", {
56
+ var PackageJsonWriteError = class extends Schema.TaggedError()("PackageJsonWriteError", {
57
57
  /** The path that could not be written. */
58
58
  path: Schema.String,
59
59
  /** The underlying filesystem failure, preserved structurally. Narrowed to the write failure only. */
@@ -14,7 +14,7 @@ import { Result, Schema } from "effect";
14
14
  *
15
15
  * @public
16
16
  */
17
- var PackageJsonSyntaxError = class extends Schema.TaggedErrorClass()("PackageJsonSyntaxError", {
17
+ var PackageJsonSyntaxError = class extends Schema.TaggedError()("PackageJsonSyntaxError", {
18
18
  /** Which syntactic precondition failed. */
19
19
  reason: Schema.Literals(["invalid-json", "not-an-object"]),
20
20
  /** The underlying `SyntaxError` for `"invalid-json"`, preserved structurally. */
package/PackageManager.js CHANGED
@@ -4,7 +4,7 @@ import { SemVer } from "@effected/semver";
4
4
 
5
5
  //#region src/PackageManager.ts
6
6
  const PACKAGE_MANAGER_NAME_RE = /^[a-z]+$/;
7
- const invalid = (input, message) => Effect.fail(new SchemaIssue.InvalidValue(Option.some(input), { message }));
7
+ const invalid = (input, message) => Effect.fail(new SchemaIssue.InvalidValue({ message }, input));
8
8
  /**
9
9
  * A structured `packageManager` value with `name`, `version` and an optional
10
10
  * `integrity` hash.
package/PackageName.js CHANGED
@@ -9,7 +9,7 @@ import { Option, Schema } from "effect";
9
9
  *
10
10
  * @public
11
11
  */
12
- var InvalidPackageNameError = class extends Schema.TaggedErrorClass()("InvalidPackageNameError", {
12
+ var InvalidPackageNameError = class extends Schema.TaggedError()("InvalidPackageNameError", {
13
13
  /** The raw input string that failed validation. */
14
14
  input: Schema.String }) {
15
15
  get message() {
@@ -9,7 +9,7 @@ import { Context, Effect, HashMap, Layer, Option, Result, Schema } from "effect"
9
9
  *
10
10
  * @public
11
11
  */
12
- var PackageValidationError = class extends Schema.TaggedErrorClass()("PackageValidationError", {
12
+ var PackageValidationError = class extends Schema.TaggedError()("PackageValidationError", {
13
13
  /** The aggregated rule failures. */
14
14
  failures: Schema.Array(Schema.Struct({
15
15
  rule: Schema.String,
package/README.md CHANGED
@@ -182,7 +182,7 @@ console.log(Effect.runSync(program));
182
182
  // => ["^4.0.0", "^1.4.0"]
183
183
  ```
184
184
 
185
- The `workspace:` range modifier is honored: `workspace:*` takes the bare version, `workspace:^` and `workspace:^` prefix it, and an explicit modifier is used as-is. The projection is `@effected/npm`'s `DependencySpecifier` statics with full pnpm publish semantics: the alias form `workspace:<name>@<range>` resolves the *target* package's version and becomes the `npm:<name>@<range>` alias pnpm publishes, and a blank catalog name selects the default catalog. A failed catalog assembly surfaces typed as `@effected/npm`'s `CatalogAssemblyError`, alongside the contracts' `DependencyResolutionError`.
185
+ The `workspace:` range modifier is honored: `workspace:*` takes the bare version, `workspace:^` and `workspace:~` prefix it, and an explicit modifier is used as-is. The projection is `@effected/npm`'s `DependencySpecifier` statics with full pnpm publish semantics: the alias form `workspace:<name>@<range>` resolves the *target* package's version and becomes the `npm:<name>@<range>` alias pnpm publishes, and a blank catalog name selects the default catalog. A failed catalog assembly surfaces typed as `@effected/npm`'s `CatalogAssemblyError`, alongside the contracts' `DependencyResolutionError`.
186
186
 
187
187
  ## Errors
188
188
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effected/package-json",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "private": false,
5
5
  "description": "package.json parsing, editing, validation and file IO as Effect schemas.",
6
6
  "keywords": [
@@ -38,12 +38,12 @@
38
38
  "./package.json": "./package.json"
39
39
  },
40
40
  "dependencies": {
41
- "@effected/npm": "^0.8.1",
42
- "@effected/semver": "^0.3.1",
43
- "@effected/spdx": "^0.1.2"
41
+ "@effected/npm": "^0.9.0",
42
+ "@effected/semver": "^0.4.0",
43
+ "@effected/spdx": "^0.2.0"
44
44
  },
45
45
  "peerDependencies": {
46
- "effect": "4.0.0-beta.101"
46
+ "effect": "4.0.0-beta.107"
47
47
  },
48
48
  "engines": {
49
49
  "node": ">=24.11.0"