Skip to content

Commit b345b55

Browse files
authored
fix: check when expression correctly (#69) (#71)
1 parent 698cfcb commit b345b55

File tree

5 files changed

+685
-751
lines changed

5 files changed

+685
-751
lines changed

.changeset/proud-masks-kiss.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@alauda/doom": patch
3+
---
4+
5+
fix: check `when` expression correctly

package.json

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,35 +48,35 @@
4848
"lint:es": "eslint . --cache",
4949
"lint:tsc": "tsc -b",
5050
"prepare": "simple-git-hooks && patch-package && yarn-berry-deduplicate || exit 0",
51-
"release": "yarn build && clean-pkg-json && changeset publish",
51+
"release": "yarn build && clean-pkg-json && changeset publish --tag release-0.x",
5252
"serve": "yarn doom serve",
5353
"swc-node": "node --enable-source-maps --import @swc-node/register/esm-register",
5454
"translate": "yarn doom translate",
5555
"typecov": "type-coverage",
5656
"version": "changeset version && yarn --no-immutable"
5757
},
5858
"dependencies": {
59-
"@cspell/eslint-plugin": "^9.0.2",
60-
"@eslint-react/eslint-plugin": "^1.50.0",
59+
"@cspell/eslint-plugin": "^8.19.4",
60+
"@eslint-react/eslint-plugin": "^1.51.0",
6161
"@inquirer/prompts": "^7.5.3",
6262
"@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
6363
"@playwright/browser-chromium": "^1.52.0",
6464
"@rsbuild/plugin-yaml": "^1.0.2",
6565
"@rspress/core": "1.44.0",
66-
"@shikijs/transformers": "^3.4.2",
66+
"@shikijs/transformers": "^3.5.0",
6767
"chokidar": "^4.0.3",
6868
"cli-progress": "^3.12.0",
6969
"clsx": "^2.1.1",
7070
"commander": "^13.1.0",
7171
"ejs": "^3.1.10",
72-
"es-toolkit": "^1.38.0",
73-
"eslint": "^9.27.0",
72+
"es-toolkit": "^1.39.0",
73+
"eslint": "^9.28.0",
7474
"eslint-plugin-mdx": "^3.4.2",
7575
"html-tag-names": "^2.1.0",
7676
"mdast-util-mdx": "^2.0.1",
7777
"mdast-util-mdx-jsx": "^2.1.4",
7878
"mermaid": "^11.6.0",
79-
"openai": "^5.0.0-beta.0",
79+
"openai": "^5.1.1",
8080
"openapi-types": "^12.1.3",
8181
"p-ratelimit": "^1.0.1",
8282
"pdf-lib": "^1.17.1",
@@ -90,43 +90,44 @@
9090
"remark-gfm": "^3.0.1",
9191
"remark-mdx": "^2.3.0",
9292
"remark-stringify": "^10.0.3",
93-
"shiki": "^3.4.2",
93+
"shiki": "^3.6.0",
9494
"simple-git": "^3.27.0",
9595
"swagger2openapi": "^7.0.8",
9696
"tinyglobby": "^0.2.14",
9797
"type-fest": "^4.41.0",
98-
"typescript-eslint": "^8.33.0",
98+
"typescript": "^5.8.3",
99+
"typescript-eslint": "^8.33.1",
99100
"x-fetch": "^0.2.6",
100101
"yaml": "^2.8.0",
101102
"yoctocolors": "^2.1.1"
102103
},
103104
"devDependencies": {
104105
"@changesets/changelog-github": "^0.5.1",
105106
"@changesets/cli": "^2.29.4",
106-
"@eslint/js": "^9.27.0",
107+
"@eslint/js": "^9.28.0",
107108
"@swc-node/register": "^1.10.10",
108-
"@swc/core": "1.11.29",
109+
"@swc/core": "1.11.31",
109110
"@total-typescript/ts-reset": "^0.6.1",
110111
"@types/cli-progress": "^3.11.6",
111112
"@types/ejs": "^3.1.5",
112-
"@types/node": "^22.15.24",
113+
"@types/hast": "2",
114+
"@types/node": "^22.15.30",
113115
"@types/picomatch": "^4.0.0",
114116
"@types/react": "^18.3.23",
115117
"@types/react-dom": "^18.3.7",
116118
"@types/swagger2openapi": "^7.0.4",
117119
"@unts/patch-package": "^8.1.1",
118120
"clean-pkg-json": "^1.3.0",
119-
"eslint-import-resolver-typescript": "^4.4.1",
120-
"eslint-plugin-import-x": "^4.13.3",
121+
"eslint-import-resolver-typescript": "^4.4.3",
122+
"eslint-plugin-import-x": "^4.15.1",
121123
"eslint-plugin-react-hooks": "^5.2.0",
122124
"nano-staged": "^0.8.0",
123125
"npm-run-all2": "^7.0.2",
124126
"prettier": "^3.5.3",
125-
"prettier-plugin-pkg": "^0.19.1",
127+
"prettier-plugin-pkg": "^0.20.0",
126128
"prettier-plugin-properties": "^0.3.0",
127129
"simple-git-hooks": "^2.13.0",
128130
"type-coverage": "^2.29.7",
129-
"typescript": "^5.8.3",
130131
"yarn-berry-deduplicate": "^6.1.3"
131132
},
132133
"publishConfig": {

src/cli/new.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export const newCommand = new Command('new')
221221
const target = path.resolve(render(layout.target, { parameters }))
222222
const when = layout.when && render(layout.when, { parameters })
223223

224-
if (JS_STR_FALSY_VALUES.has(when)) {
224+
if (when != null && JS_STR_FALSY_VALUES.has(when)) {
225225
continue
226226
}
227227

src/cli/translate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export const translate = async ({
151151
{ async: true },
152152
)
153153

154-
const { choices } = await openai.beta.chat.completions.parse({
154+
const { choices } = await openai.chat.completions.parse({
155155
messages: [
156156
{
157157
role: 'system',

0 commit comments

Comments
 (0)