Skip to content

Commit edf3e67

Browse files
authored
[1.x] [suspend] chore: build typings (#4337)
* chore: build typings * chore: fix typo
1 parent ee59a4f commit edf3e67

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

extensions/suspend/js/package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,22 @@
66
"scripts": {
77
"dev": "webpack --mode development --watch",
88
"build": "webpack --mode production",
9-
"format": "prettier --write src",
109
"analyze": "cross-env ANALYZER=true yarn run build",
11-
"format-check": "prettier --check src"
10+
"format": "prettier --write src",
11+
"format-check": "prettier --check src",
12+
"clean-typings": "npx rimraf dist-typings && mkdir dist-typings",
13+
"build-typings": "yarn run clean-typings && ([ -e src/@types ] && cp -r src/@types dist-typings/@types || true) && tsc && yarn run post-build-typings",
14+
"post-build-typings": "find dist-typings -type f -name '*.d.ts' -print0 | xargs -0 sed -i 's,../src/@types,@types,g'",
15+
"check-typings": "tsc --noEmit --emitDeclarationOnly false",
16+
"check-typings-coverage": "typescript-coverage-report"
1217
},
1318
"devDependencies": {
1419
"@flarum/prettier-config": "^1.0.0",
1520
"flarum-tsconfig": "^1.0.0",
1621
"flarum-webpack-config": "^2.0.0",
1722
"prettier": "^2.5.1",
1823
"webpack": "^5.76.0",
19-
"webpack-cli": "^4.9.1"
24+
"webpack-cli": "^4.9.1",
25+
"typescript-coverage-report": "^0.6.1"
2026
}
2127
}

extensions/suspend/js/src/forum/extend.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Model from 'flarum/common/Model';
55
export default [
66
new Extend.Model(User)
77
.attribute<boolean>('canSuspend')
8-
.attribute<Date, string | null | undefined>('suspendedUntil', Model.transformDate)
8+
.attribute<Date | null, string | null>('suspendedUntil', Model.transformDate)
99
.attribute<string | null | undefined>('suspendReason')
1010
.attribute<string | null | undefined>('suspendMessage'),
1111
];

0 commit comments

Comments
 (0)