@plasius/schema 1.0.0 → 1.0.8
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/.github/workflows/cd.yml +13 -11
- package/.nvmrc +1 -0
- package/README.md +15 -1
- package/package.json +25 -3
- package/vitest.config.js +13 -0
package/.github/workflows/cd.yml
CHANGED
|
@@ -6,13 +6,13 @@ on:
|
|
|
6
6
|
types: [published]
|
|
7
7
|
|
|
8
8
|
permissions:
|
|
9
|
-
contents:
|
|
9
|
+
contents: write
|
|
10
10
|
id-token: write # for npm provenance (requires Node 18+ and npm >=9)
|
|
11
11
|
|
|
12
12
|
jobs:
|
|
13
13
|
publish:
|
|
14
14
|
runs-on: ubuntu-latest
|
|
15
|
-
|
|
15
|
+
environment: npm
|
|
16
16
|
steps:
|
|
17
17
|
- name: Checkout
|
|
18
18
|
uses: actions/checkout@v4
|
|
@@ -20,8 +20,8 @@ jobs:
|
|
|
20
20
|
- name: Use Node.js 22
|
|
21
21
|
uses: actions/setup-node@v4
|
|
22
22
|
with:
|
|
23
|
-
node-version:
|
|
24
|
-
|
|
23
|
+
node-version-file: '.nvmrc'
|
|
24
|
+
cache: 'npm'
|
|
25
25
|
|
|
26
26
|
- name: Install deps (CI)
|
|
27
27
|
run: npm ci
|
|
@@ -29,16 +29,18 @@ jobs:
|
|
|
29
29
|
- name: Build
|
|
30
30
|
run: npm run build --if-present
|
|
31
31
|
|
|
32
|
-
- name:
|
|
33
|
-
|
|
34
|
-
npm config set scope "@plasius"
|
|
35
|
-
npm config set //registry.npmjs.org/:_authToken=${NPM_TOKEN}
|
|
32
|
+
- name: Bump version & decide publish flags
|
|
33
|
+
id: pkg
|
|
36
34
|
env:
|
|
37
35
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
38
|
-
|
|
39
|
-
- name: Determine publish flags (first publish needs --access public)
|
|
40
|
-
id: pkg
|
|
41
36
|
run: |
|
|
37
|
+
set -euo pipefail
|
|
38
|
+
git config user.name "github-actions[bot]"
|
|
39
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
40
|
+
NEW_VER=$(npm version patch -m "chore: release v%s [skip ci]")
|
|
41
|
+
echo "New version: $NEW_VER"
|
|
42
|
+
git push --follow-tags
|
|
43
|
+
|
|
42
44
|
NAME=$(node -p "require('./package.json').name")
|
|
43
45
|
echo "name=$NAME" >> "$GITHUB_OUTPUT"
|
|
44
46
|
if npm view "$NAME" version >/dev/null 2>&1; then
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
22
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @plasius/schema
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@plasius/schema)
|
|
4
|
-
[](https://github.com/plasius/
|
|
4
|
+
[](https://github.com/plasius/schema/actions/workflows/ci.yml)
|
|
5
5
|
[](./LICENSE)
|
|
6
6
|
[](./CODE_OF_CONDUCT.md)
|
|
7
7
|
[](./SECURITY.md)
|
|
@@ -23,6 +23,20 @@ npm install @plasius/schema
|
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
+
## Node.js Version
|
|
27
|
+
|
|
28
|
+
This project uses Node.js **22** by default. The version is pinned in the [`.nvmrc`](./.nvmrc) file.
|
|
29
|
+
|
|
30
|
+
If you use [nvm](https://github.com/nvm-sh/nvm), simply run:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
nvm use
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
This ensures your local development environment matches the version used in CI/CD.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
26
40
|
## Usage Example
|
|
27
41
|
|
|
28
42
|
```js
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasius/schema",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Entity schema definition & validation helpers for Plasius ecosystem",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -21,12 +21,34 @@
|
|
|
21
21
|
"prepare": "npm run build",
|
|
22
22
|
"clean": "rimraf dist"
|
|
23
23
|
},
|
|
24
|
-
"keywords": [
|
|
24
|
+
"keywords": [
|
|
25
|
+
"schema",
|
|
26
|
+
"validation",
|
|
27
|
+
"data-validation",
|
|
28
|
+
"schema-validation",
|
|
29
|
+
"typed-schema",
|
|
30
|
+
"json-schema",
|
|
31
|
+
"typescript",
|
|
32
|
+
"typesafe",
|
|
33
|
+
"runtime-validation",
|
|
34
|
+
"type-safety",
|
|
35
|
+
"plasius",
|
|
36
|
+
"schema-helper",
|
|
37
|
+
"entity-schema",
|
|
38
|
+
"domain-modeling",
|
|
39
|
+
"agnostic",
|
|
40
|
+
"oss",
|
|
41
|
+
"frontend",
|
|
42
|
+
"backend",
|
|
43
|
+
"portable",
|
|
44
|
+
"scalability",
|
|
45
|
+
"monorepo-friendly"
|
|
46
|
+
],
|
|
25
47
|
"author": "Plasius LTD <development@plasius.co.uk>",
|
|
26
48
|
"license": "Apache-2.0",
|
|
27
49
|
"repository": {
|
|
28
50
|
"type": "git",
|
|
29
|
-
"url": "https://github.com/Plasius-LTD/schema.git"
|
|
51
|
+
"url": "git+https://github.com/Plasius-LTD/schema.git"
|
|
30
52
|
},
|
|
31
53
|
"bugs": {
|
|
32
54
|
"url": "https://github.com/Plasius-LTD/schema/issues"
|
package/vitest.config.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineConfig } from "vitest/config";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
test: {
|
|
5
|
+
environment: "node",
|
|
6
|
+
globals: true,
|
|
7
|
+
include: ["tests/**/*.test.{ts,tsx}"],
|
|
8
|
+
coverage: {
|
|
9
|
+
reporter: ["text", "lcov"],
|
|
10
|
+
exclude: ["tests/**", "dist/**"],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
});
|