Skip to content

Commit

Permalink
Merge pull request #9393 from weseek/support/typechecking
Browse files Browse the repository at this point in the history
support: Type checking
  • Loading branch information
mergify[bot] authored Nov 12, 2024
2 parents 032d349 + f0292fa commit 29474b0
Show file tree
Hide file tree
Showing 17 changed files with 130 additions and 18 deletions.
9 changes: 8 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,12 @@

"githubPullRequests.ignoredPullRequestBranches": [
"master"
]
],

"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.preferences.autoImportFileExcludePatterns": ["node_modules/*"],
"typescript.validate.enable": true,
"typescript.surveys.enabled": false

}
4 changes: 3 additions & 1 deletion apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"dev:migrate:down": "pnpm run dev:migrate-mongo down -f config/migrate-mongo-config.js",
"//// for CI": "",
"launch-dev:ci": "cross-env NODE_ENV=development pnpm run dev:migrate && pnpm run ts-node src/server/app.ts --ci",
"lint:typecheck": "npx -y tspc",
"lint:typecheck": "vue-tsc --noEmit",
"lint:eslint": "eslint --quiet \"**/*.{js,jsx,ts,tsx}\"",
"lint:styles": "stylelint \"src/**/*.scss\"",
"lint:swagger2openapi:apiv3": "node node_modules/swagger2openapi/oas-validate tmp/openapi-spec-apiv3.json",
Expand Down Expand Up @@ -228,6 +228,7 @@
"unzip-stream": "^0.3.2",
"url-join": "^4.0.0",
"usehooks-ts": "^2.6.0",
"uuid": "^11.0.3",
"validator": "^13.7.0",
"ws": "^8.17.1",
"xss": "^1.0.15",
Expand Down Expand Up @@ -272,6 +273,7 @@
"@types/unist": "^3.0.3",
"@types/unzip-stream": "^0.3.4",
"@types/url-join": "^4.0.2",
"@types/uuid": "^10.0.0",
"babel-loader": "^8.2.5",
"bootstrap": "=5.3.2",
"connect-browser-sync": "^2.1.0",
Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/server/service/file-uploader/file-uploader.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { randomUUID } from 'crypto';
import type { ReadStream } from 'fs';

import type { Response } from 'express';
import { v4 as uuidv4 } from 'uuid';

import type { ICheckLimitResult } from '~/interfaces/attachment';
import { type RespondOptions, ResponseMode } from '~/server/interfaces/attachment';
Expand Down Expand Up @@ -60,7 +60,7 @@ export abstract class AbstractFileUploader implements FileUploader {
* @returns Whether write opration to the storage is permitted
*/
async isWritable() {
const filePath = `${randomUUID()}.growi`;
const filePath = `${uuidv4()}.growi`;
const data = 'This file was created during g2g transfer to check write permission. You can safely remove this file.';

try {
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/services/renderer/recommended-whitelist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const excludeRestrictedClassAttributes = (propertyDefinitions: PropertyDefinitio
};

// generate relaxed schema
const relaxedSchemaAttributes = structuredClone(defaultSchema.attributes) ?? {};
const relaxedSchemaAttributes: Record<string, PropertyDefinition[]> = structuredClone(defaultSchema.attributes) ?? {};
relaxedSchemaAttributes.a = excludeRestrictedClassAttributes(relaxedSchemaAttributes.a);
relaxedSchemaAttributes.ul = excludeRestrictedClassAttributes(relaxedSchemaAttributes.ul);
relaxedSchemaAttributes.li = excludeRestrictedClassAttributes(relaxedSchemaAttributes.li);
Expand Down
2 changes: 1 addition & 1 deletion apps/slackbot-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"predev": "pnpm run cp:bootstrap:dev",
"lint:js": "eslint src/**/*.{js,ts}",
"lint:styles": "stylelint --allow-empty-input \"src/**/*.scss\" \"src/**/*.css\"",
"lint:typecheck": "tspc",
"lint:typecheck": "vue-tsc --noEmit",
"lint": "run-p lint:*",
"ts-node": "node -r ts-node/register/transpile-only -r tsconfig-paths/register -r dotenv-flow/config",
"version:patch": "pnpm version patch",
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,16 @@
"ts-node": "^10.9.2",
"ts-patch": "^3.2.0",
"tsconfig-paths": "^4.2.0",
"tspc": "^1.1.2",
"turbo": "^2.1.3",
"typescript": "~5.0.0",
"typescript-transform-paths": "^3.4.7",
"vite": "^5.4.6",
"vite-plugin-dts": "^3.9.1",
"vite-tsconfig-paths": "^5.0.1",
"vitest": "^2.1.1",
"vitest-mock-extended": "^2.0.2"
"vitest-mock-extended": "^2.0.2",
"vue-tsc": "^2.1.10"
},
"// comments for pnpm.overrides": {
"@lykmapipo/common>mime": "mime v4 is provided only by ESM, but @lykmapipo/common requires CommonJS version",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"dev": "vite build --mode dev",
"watch": "pnpm run dev -w --emptyOutDir=false",
"lint:js": "eslint **/*.{js,ts}",
"lint:typecheck": "tsc",
"lint:typecheck": "vue-tsc --noEmit",
"lint": "npm-run-all -p lint:*",
"test": "vitest run --coverage"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"watch": "pnpm run dev -w --emptyOutDir=false",
"serve": "vite",
"lint:js": "eslint **/*.{js,ts}",
"lint:typecheck": "tsc",
"lint:typecheck": "vue-tsc --noEmit",
"lint": "npm-run-all -p lint:*"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/pluginkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dev": "vite build --mode dev",
"watch": "pnpm run dev -w --emptyOutDir=false",
"lint:js": "eslint **/*.{js,ts}",
"lint:typecheck": "tsc",
"lint:typecheck": "vue-tsc --noEmit",
"lint": "npm-run-all -p lint:*",
"test": "vitest run --coverage"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/presentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"watch": "pnpm run dev -w --emptyOutDir=false",
"lint:js": "eslint **/*.{js,jsx,ts,tsx}",
"lint:styles": "stylelint --allow-empty-input \"src/**/*.scss\" \"src/**/*.css\"",
"lint:typecheck": "tsc",
"lint:typecheck": "vue-tsc --noEmit",
"lint": "run-p lint:*"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/preset-themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"watch:themes": "pnpm run dev:themes -w --emptyOutDir=false",
"lint:eslint": "eslint \"**/*.{js,jsx,ts,tsx}\"",
"lint:styles": "stylelint \"src/**/*.scss\"",
"lint:typecheck": "tsc",
"lint:typecheck": "vue-tsc --noEmit",
"lint": "run-p lint:*",
"preview": "vite preview"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/remark-attachment-refs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"watch:server": "pnpm run dev:server -w --emptyOutDir=false",
"lint:js": "eslint **/*.{js,jsx,ts,tsx}",
"lint:styles": "stylelint \"src/**/*.scss\" \"src/**/*.css\"",
"lint:typecheck": "tsc",
"lint:typecheck": "vue-tsc --noEmit",
"lint": "run-p lint:*",
"test": ""
},
Expand Down
2 changes: 1 addition & 1 deletion packages/remark-drawio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"watch": "pnpm run dev -w --emptyOutDir=false",
"lint:js": "eslint **/*.{js,jsx,ts,tsx}",
"lint:styles": "stylelint --allow-empty-input \"src/**/*.scss\" \"src/**/*.css\"",
"lint:typecheck": "tsc",
"lint:typecheck": "vue-tsc --noEmit",
"lint": "run-p lint:*"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/remark-lsx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"watch:server": "pnpm run dev:server -w --emptyOutDir=false",
"lint:js": "eslint **/*.{js,jsx,ts,tsx}",
"lint:styles": "stylelint --allow-empty-input \"src/**/*.scss\" \"src/**/*.css\"",
"lint:typecheck": "tsc",
"lint:typecheck": "vue-tsc --noEmit",
"lint": "run-p lint:*",
"test": "vitest run --coverage"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/slack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"dev": "vite build --mode dev",
"watch": "pnpm run dev -w --emptyOutDir=false",
"lint:js": "eslint **/*.{js,ts}",
"lint:typecheck": "tsc",
"lint:typecheck": "vue-tsc --noEmit",
"lint": "npm-run-all -p lint:*",
"test": "vitest run --coverage"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"watch": "pnpm run dev -w --emptyOutDir=false",
"lint:js": "eslint **/*.{js,ts}",
"lint:styles": "stylelint \"./scss/**/*\"",
"lint:typecheck": "tsc",
"lint:typecheck": "vue-tsc --noEmit",
"lint": "npm-run-all -p lint:*"
},
"dependencies": {
Expand Down
Loading

0 comments on commit 29474b0

Please sign in to comment.