Skip to content

Commit

Permalink
feat: use monaco-themes
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Zhang (张涛) committed Jun 29, 2024
1 parent d35f5e7 commit 18a1c1f
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 185 deletions.
11 changes: 1 addition & 10 deletions packages/canyon-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,8 @@
"license": "UNLICENSED",
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"dev-backend": "nest start --watch",
"preinstall": "prisma generate && nest build",
"migrate": "prisma migrate dev"
},
Expand Down
1 change: 1 addition & 0 deletions packages/canyon-platform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"i18next": "^23.8.2",
"i18next-browser-languagedetector": "^7.2.0",
"monaco-editor": "^0.46.0",
"monaco-themes": "^0.4.4",
"query-string": "^9.0.0",
"react": "^18.2.0",
"react-copy-to-clipboard": "^5.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const CanyonReportCoverageDetail = ({ data, theme }) => {
})}
/>
<Editor
theme={theme === 'light' ? 'light' : 'vs-dark'}
theme={theme === 'light' ? 'light' : 'nightowl'}
height={`${code.split('\n').length * viewLineHeight + viewLineHeight}px`}
language='typescript'
onMount={handleEditorDidMount}
Expand Down
42 changes: 0 additions & 42 deletions packages/canyon-platform/src/components/TagSelect.tsx

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const ProjectConfigure = () => {
theme={
{
light: 'light',
dark: 'vs-dark',
dark: 'nightowl',
}[localStorage.getItem('theme') || 'light']
}
defaultValue={GetProjectByIdDocumentData?.getProjectByID.coverage}
Expand Down
9 changes: 6 additions & 3 deletions packages/canyon-platform/src/useWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ self.MonacoEnvironment = {
},
};

loader.config({ monaco });

loader.init().then(/* ... */);
import('monaco-themes/themes/Night Owl.json').then((data) => {
// @ts-ignore
monaco.editor.defineTheme('nightowl', data);
loader.config({ monaco });
loader.init()
});

0 comments on commit 18a1c1f

Please sign in to comment.