@plasius/schema 1.0.0 → 1.0.7

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.
@@ -6,13 +6,13 @@ on:
6
6
  types: [published]
7
7
 
8
8
  permissions:
9
- contents: read
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: 22
24
- registry-url: https://registry.npmjs.org/
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: Set npm scope and auth
33
- run: |
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
@@ -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.0",
3
+ "version": "1.0.7",
4
4
  "description": "Entity schema definition & validation helpers for Plasius ecosystem",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -26,7 +26,7 @@
26
26
  "license": "Apache-2.0",
27
27
  "repository": {
28
28
  "type": "git",
29
- "url": "https://github.com/Plasius-LTD/schema.git"
29
+ "url": "git+https://github.com/Plasius-LTD/schema.git"
30
30
  },
31
31
  "bugs": {
32
32
  "url": "https://github.com/Plasius-LTD/schema/issues"