Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/proud-masks-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@alauda/doom": patch
---

fix: check `when` expression correctly
33 changes: 17 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,35 +48,35 @@
"lint:es": "eslint . --cache",
"lint:tsc": "tsc -b",
"prepare": "simple-git-hooks && patch-package && yarn-berry-deduplicate || exit 0",
"release": "yarn build && clean-pkg-json && changeset publish",
"release": "yarn build && clean-pkg-json && changeset publish --tag release-0.x",
"serve": "yarn doom serve",
"swc-node": "node --enable-source-maps --import @swc-node/register/esm-register",
"translate": "yarn doom translate",
"typecov": "type-coverage",
"version": "changeset version && yarn --no-immutable"
},
"dependencies": {
"@cspell/eslint-plugin": "^9.0.2",
"@eslint-react/eslint-plugin": "^1.50.0",
"@cspell/eslint-plugin": "^8.19.4",
"@eslint-react/eslint-plugin": "^1.51.0",
"@inquirer/prompts": "^7.5.3",
"@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
"@playwright/browser-chromium": "^1.52.0",
"@rsbuild/plugin-yaml": "^1.0.2",
"@rspress/core": "1.44.0",
"@shikijs/transformers": "^3.4.2",
"@shikijs/transformers": "^3.5.0",
"chokidar": "^4.0.3",
"cli-progress": "^3.12.0",
"clsx": "^2.1.1",
"commander": "^13.1.0",
"ejs": "^3.1.10",
"es-toolkit": "^1.38.0",
"eslint": "^9.27.0",
"es-toolkit": "^1.39.0",
"eslint": "^9.28.0",
"eslint-plugin-mdx": "^3.4.2",
"html-tag-names": "^2.1.0",
"mdast-util-mdx": "^2.0.1",
"mdast-util-mdx-jsx": "^2.1.4",
"mermaid": "^11.6.0",
"openai": "^5.0.0-beta.0",
"openai": "^5.1.1",
"openapi-types": "^12.1.3",
"p-ratelimit": "^1.0.1",
"pdf-lib": "^1.17.1",
Expand All @@ -90,43 +90,44 @@
"remark-gfm": "^3.0.1",
"remark-mdx": "^2.3.0",
"remark-stringify": "^10.0.3",
"shiki": "^3.4.2",
"shiki": "^3.6.0",
"simple-git": "^3.27.0",
"swagger2openapi": "^7.0.8",
"tinyglobby": "^0.2.14",
"type-fest": "^4.41.0",
"typescript-eslint": "^8.33.0",
"typescript": "^5.8.3",
"typescript-eslint": "^8.33.1",
"x-fetch": "^0.2.6",
"yaml": "^2.8.0",
"yoctocolors": "^2.1.1"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.1",
"@changesets/cli": "^2.29.4",
"@eslint/js": "^9.27.0",
"@eslint/js": "^9.28.0",
"@swc-node/register": "^1.10.10",
"@swc/core": "1.11.29",
"@swc/core": "1.11.31",
"@total-typescript/ts-reset": "^0.6.1",
"@types/cli-progress": "^3.11.6",
"@types/ejs": "^3.1.5",
"@types/node": "^22.15.24",
"@types/hast": "2",
"@types/node": "^22.15.30",
"@types/picomatch": "^4.0.0",
"@types/react": "^18.3.23",
"@types/react-dom": "^18.3.7",
"@types/swagger2openapi": "^7.0.4",
"@unts/patch-package": "^8.1.1",
"clean-pkg-json": "^1.3.0",
"eslint-import-resolver-typescript": "^4.4.1",
"eslint-plugin-import-x": "^4.13.3",
"eslint-import-resolver-typescript": "^4.4.3",
"eslint-plugin-import-x": "^4.15.1",
"eslint-plugin-react-hooks": "^5.2.0",
"nano-staged": "^0.8.0",
"npm-run-all2": "^7.0.2",
"prettier": "^3.5.3",
"prettier-plugin-pkg": "^0.19.1",
"prettier-plugin-pkg": "^0.20.0",
"prettier-plugin-properties": "^0.3.0",
"simple-git-hooks": "^2.13.0",
"type-coverage": "^2.29.7",
"typescript": "^5.8.3",
"yarn-berry-deduplicate": "^6.1.3"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion src/cli/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export const newCommand = new Command('new')
const target = path.resolve(render(layout.target, { parameters }))
const when = layout.when && render(layout.when, { parameters })

if (JS_STR_FALSY_VALUES.has(when)) {
if (when != null && JS_STR_FALSY_VALUES.has(when)) {
continue
}

Expand Down
2 changes: 1 addition & 1 deletion src/cli/translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export const translate = async ({
{ async: true },
)

const { choices } = await openai.beta.chat.completions.parse({
const { choices } = await openai.chat.completions.parse({
messages: [
{
role: 'system',
Expand Down
Loading