Skip to content

Commit

Permalink
move lib/ui into vscode/webviews, remove lib/ui (#3285)
Browse files Browse the repository at this point in the history
  • Loading branch information
sqs authored Mar 3, 2024
1 parent fa74675 commit 3cd602d
Show file tree
Hide file tree
Showing 68 changed files with 1,219 additions and 1,519 deletions.
2 changes: 0 additions & 2 deletions agent/src/esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import { build } from 'esbuild'
// during dev.
'@sourcegraph/cody-shared': '@sourcegraph/cody-shared/src/index',
'@sourcegraph/cody-shared/src': '@sourcegraph/cody-shared/src',
'@sourcegraph/cody-ui': '@sourcegraph/cody-ui/src/index',
'@sourcegraph/cody-ui/src': '@sourcegraph/cody-ui/src',
},
}
const res = await build(esbuildOptions)
Expand Down
1 change: 0 additions & 1 deletion doc/dev/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ See [vscode/CONTRIBUTING.md](../../vscode/CONTRIBUTING.md) for more information.

### Other topics

- [Developing the Cody library packages (`@sourcegraph/cody-{shared,ui}`)](library-development.md)
- [Quality tools](quality/index.md)
59 changes: 0 additions & 59 deletions doc/dev/library-development.md

This file was deleted.

3 changes: 0 additions & 3 deletions knip.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
"entry": ["**/__tests__/**/*.ts"]
},
"ignore": ["src/vscode-shim.ts"]
},
"lib/ui": {
"ignore": ["src/utils/icons.tsx"]
}
},
"ignore": ["**/__mocks__/**", "**/mocks.*"],
Expand Down
19 changes: 17 additions & 2 deletions lib/shared/src/common/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,22 @@ export function isWindows(): boolean {
return navigator.userAgent.toLowerCase().includes('windows')
}

return false // default
return false
}

export const isMac = () => process.platform === 'darwin'
/** Reports whether the current OS is macOS. */
export function isMacOS(): boolean {
// For Node environments (such as VS Code Desktop).
if (typeof process !== 'undefined') {
if (process.platform) {
return process.platform === 'darwin'
}
}

// For web environments (such as webviews and VS Code Web).
if (typeof navigator === 'object') {
return navigator.userAgent?.includes('Mac')
}

return false
}
2 changes: 1 addition & 1 deletion lib/shared/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export {
} from './common/languages'
export { renderMarkdown } from './common/markdown'
export { posixFilePaths } from './common/path'
export { isWindows } from './common/platform'
export { isWindows, isMacOS } from './common/platform'
export {
assertFileURI,
isFileURI,
Expand Down
3 changes: 0 additions & 3 deletions lib/ui/.gitignore

This file was deleted.

17 changes: 0 additions & 17 deletions lib/ui/.storybook/main.ts

This file was deleted.

3 changes: 0 additions & 3 deletions lib/ui/README.md

This file was deleted.

27 changes: 0 additions & 27 deletions lib/ui/package.json

This file was deleted.

79 changes: 0 additions & 79 deletions lib/ui/src/Chat.module.css

This file was deleted.

Loading

0 comments on commit 3cd602d

Please sign in to comment.