Skip to content

Commit 18aced1

Browse files
committed
fix: add missing package.json entry
1 parent 603e733 commit 18aced1

File tree

10 files changed

+173
-143
lines changed

10 files changed

+173
-143
lines changed

.changeset/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"changelog": [
44
"@changesets/changelog-github",
55
{
6-
"repo": "un-ts/synckit"
6+
"repo": "un-ts/json-schema-migrate"
77
}
88
],
99
"commit": false,
1010
"linked": [],
1111
"access": "public",
12-
"baseBranch": "main",
12+
"baseBranch": "master",
1313
"updateInternalDependencies": "patch",
1414
"ignore": []
1515
}

.changeset/strong-planets-leave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@unts/json-schema-migrate": patch
3+
---
4+
5+
fix: add missing `package.json` entry

.github/workflows/codeql.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.github/workflows/pkg-pr-new.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ jobs:
2727
- name: Build
2828
run: yarn build
2929

30-
- run: yarn dlx pkg-pr-new publish
30+
- name: Publish
31+
run: yarn dlx pkg-pr-new publish --compact

.github/workflows/size-limit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
size-limit:
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
2121

2222
- name: Setup Node.js LTS
23-
uses: actions/setup-node@v4
23+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
2424
with:
2525
node-version: lts/*
2626
cache: yarn

.renovaterc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"github>1stG/configs"
4+
]
5+
}

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ bun add @unts/json-schema-migrate
3434

3535
```js
3636
import * as migrate from '@unts/json-schema-migrate'
37+
3738
const schema = {
3839
id: 'my-schema',
3940
minimum: 1,
@@ -95,6 +96,6 @@ Detailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.m
9596

9697
[MIT][] © [JounQin][]@[1stG.me][]
9798

98-
[1stg.me]: https://www.1stg.me
99-
[jounqin]: https://GitHub.com/JounQin
100-
[mit]: http://opensource.org/licenses/MIT
99+
[1stG.me]: https://www.1stG.me
100+
[JounQin]: https://github.com/JounQin
101+
[MIT]: http://opensource.org/licenses/MIT

package.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"types": "./index.d.cts",
3131
"default": "./lib/index.cjs"
3232
}
33-
}
33+
},
34+
"./package.json": "./package.json"
3435
},
3536
"types": "lib/index.d.ts",
3637
"files": [
@@ -54,13 +55,14 @@
5455
"prepare": "simple-git-hooks && yarn-berry-deduplicate || exit 0",
5556
"release": "clean-pkg-json && changeset publish",
5657
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
58+
"typecov": "type-coverage",
5759
"version": "changeset version && yarn --no-immutable"
5860
},
5961
"dependencies": {
6062
"ajv": "^8.17.1"
6163
},
6264
"devDependencies": {
63-
"@1stg/common-config": "^11.1.1",
65+
"@1stg/common-config": "^11.1.2",
6466
"@changesets/changelog-github": "^0.5.1",
6567
"@changesets/cli": "^2.28.1",
6668
"@commitlint/cli": "^19.8.0",
@@ -78,6 +80,7 @@
7880
"size-limit-preset-node-lib": "^0.3.0",
7981
"ts-jest": "^29.3.1",
8082
"tslib": "^2.8.1",
83+
"type-coverage": "^2.29.7",
8184
"typescript": "^5.8.2",
8285
"yarn-berry-deduplicate": "^6.1.1"
8386
},
@@ -105,5 +108,18 @@
105108
}
106109
]
107110
}
111+
},
112+
"typeCoverage": {
113+
"atLeast": 91.42,
114+
"cache": true,
115+
"detail": true,
116+
"ignoreAsAssertion": true,
117+
"ignoreFiles": [
118+
"**/*.d.ts"
119+
],
120+
"ignoreNonNullAssertion": true,
121+
"showRelativePath": true,
122+
"strict": true,
123+
"update": true
108124
}
109125
}

src/index.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,12 @@ export function getAjv(): Ajv {
9696
if (rest.length > 0) {
9797
throw new Error(`json-schema-migrate: invalid schema id ${id}`)
9898
}
99-
if ($id) dataSchema.$id = $id
100-
if ($anchor && $anchor !== '/') dataSchema.$anchor = $anchor
99+
if ($id) {
100+
dataSchema.$id = $id
101+
}
102+
if ($anchor && $anchor !== '/') {
103+
dataSchema.$anchor = $anchor
104+
}
101105
} else {
102106
dataSchema.$id = id
103107
}
@@ -138,13 +142,15 @@ export function getAjv(): Ajv {
138142
break
139143
}
140144
case 'maximum': {
141-
if (dsCopy.exclusiveMaximum !== true)
145+
if (dsCopy.exclusiveMaximum !== true) {
142146
dataSchema.maximum = dsCopy.maximum
147+
}
143148
break
144149
}
145150
case 'minimum': {
146-
if (dsCopy.exclusiveMinimum !== true)
151+
if (dsCopy.exclusiveMinimum !== true) {
147152
dataSchema.minimum = dsCopy.minimum
153+
}
148154
break
149155
}
150156
case 'dependencies': {

0 commit comments

Comments
 (0)