@effected/package-json 0.7.3 → 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 +1 -1
- package/Package.js +1 -1
- package/PackageJsonFile.js +4 -4
- package/PackageJsonFormat.js +1 -1
- package/PackageManager.js +1 -1
- package/PackageName.js +1 -1
- package/PackageValidator.js +1 -1
- package/package.json +5 -5
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.
|
|
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.
|
|
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() {
|
package/PackageJsonFile.js
CHANGED
|
@@ -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.
|
|
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.
|
|
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.
|
|
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.
|
|
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. */
|
package/PackageJsonFormat.js
CHANGED
|
@@ -14,7 +14,7 @@ import { Result, Schema } from "effect";
|
|
|
14
14
|
*
|
|
15
15
|
* @public
|
|
16
16
|
*/
|
|
17
|
-
var PackageJsonSyntaxError = class extends Schema.
|
|
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(
|
|
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.
|
|
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() {
|
package/PackageValidator.js
CHANGED
|
@@ -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.
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effected/package-json",
|
|
3
|
-
"version": "0.
|
|
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.
|
|
42
|
-
"@effected/semver": "^0.
|
|
43
|
-
"@effected/spdx": "^0.
|
|
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.
|
|
46
|
+
"effect": "4.0.0-beta.107"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": ">=24.11.0"
|