@formspec/constraints 0.1.0-alpha.26 → 0.1.0-alpha.28

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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +9 -1
  3. package/package.json +6 -5
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mike North
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -45,6 +45,14 @@ const form = formspec(field.text("name"), field.dynamicEnum("country", "countrie
45
45
  const result = validateFormSpecElements(form.elements, { constraints: resolved });
46
46
  ```
47
47
 
48
+ ## Browser Entry Point
49
+
50
+ Use `@formspec/constraints/browser` when you need validation in browser code and do not want the file-based config loader:
51
+
52
+ ```ts
53
+ import { loadConfigFromString, validateFormSpec } from "@formspec/constraints/browser";
54
+ ```
55
+
48
56
  ## Main Exports
49
57
 
50
58
  - `loadConfig`
@@ -56,4 +64,4 @@ const result = validateFormSpecElements(form.elements, { constraints: resolved }
56
64
 
57
65
  ## License
58
66
 
59
- UNLICENSED
67
+ This package is part of the FormSpec monorepo and is released under the MIT License. See [LICENSE](./LICENSE) for details.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formspec/constraints",
3
- "version": "0.1.0-alpha.26",
3
+ "version": "0.1.0-alpha.28",
4
4
  "description": "Constraint validation for FormSpec - restrict features based on target environment capabilities",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -22,16 +22,17 @@
22
22
  "files": [
23
23
  "dist",
24
24
  "formspec.schema.json",
25
- "README.md"
25
+ "README.md",
26
+ "LICENSE"
26
27
  ],
27
28
  "dependencies": {
28
29
  "yaml": "^2.7.0",
29
- "@formspec/core": "0.1.0-alpha.26"
30
+ "@formspec/core": "0.1.0-alpha.28"
30
31
  },
31
32
  "devDependencies": {
32
33
  "tsd": "^0.31.0",
33
34
  "vitest": "^3.0.0",
34
- "@formspec/dsl": "0.1.0-alpha.26"
35
+ "@formspec/dsl": "0.1.0-alpha.28"
35
36
  },
36
37
  "tsd": {
37
38
  "directory": "src/__tests__"
@@ -46,7 +47,7 @@
46
47
  "jsonschema",
47
48
  "jsonforms"
48
49
  ],
49
- "license": "UNLICENSED",
50
+ "license": "MIT",
50
51
  "scripts": {
51
52
  "build": "tsup && tsc --emitDeclarationOnly && pnpm run api-extractor:local",
52
53
  "clean": "rm -rf dist temp",