Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Commit

Permalink
update configs
Browse files Browse the repository at this point in the history
  • Loading branch information
amacneil committed May 19, 2021
1 parent 1eebc7b commit d26d731
Show file tree
Hide file tree
Showing 12 changed files with 361 additions and 341 deletions.
646 changes: 323 additions & 323 deletions .eslintrc.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion desktop/main/StudioWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import path from "path";

import Logger from "@foxglove/log";
import colors from "@foxglove/studio-base/styles/colors.module.scss";
import colors from "@foxglove/studio-base/src/styles/colors.module.scss";

import pkgInfo from "../../package.json";
import { simulateUserClick } from "./simulateUserClick";
Expand Down
2 changes: 1 addition & 1 deletion desktop/main/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { app } from "electron";
import fs from "fs";
import path from "path";

import { AppSetting } from "@foxglove/studio-base/AppSetting";
import { AppSetting } from "@foxglove/studio-base/src/AppSetting";

function getTelemetrySettings(): [crashReportingEnabled: boolean, telemetryEnabled: boolean] {
const datastoreDir = path.join(app.getPath("userData"), "studio-datastores", "settings");
Expand Down
2 changes: 1 addition & 1 deletion desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "desktop",
"private": true,
"dependencies": {
"@foxglove/studio-base": "workspace:packages/@foxglove/studio-base"
"@foxglove/studio-base": "workspace:packages/studio-base"
}
}
2 changes: 1 addition & 1 deletion desktop/preload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import os from "os";

import { PreloaderSockets } from "@foxglove/electron-socket/preloader";
import Logger from "@foxglove/log";
import { NetworkInterface, OsContext } from "@foxglove/studio-base/OsContext";
import { NetworkInterface, OsContext } from "@foxglove/studio-base/src/OsContext";

import pkgInfo from "../../package.json";
import { Desktop, ForwardedMenuEvent, NativeMenuBridge, Storage } from "../common/types";
Expand Down
6 changes: 3 additions & 3 deletions docs/fluentui-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Intellisense/autocomplete and the "header" documentation in .d.ts files is prett

## Theme

Our theme is configured in [theme/index.ts](../packages/@foxglove/studio-base/theme/index.ts) and provided to components via [ThemeProvider](../packages/@foxglove/studio-base/theme/ThemeProvider.tsx). It has a `palette` of colors as well as some "slots" for [semantic colors](https://docs.microsoft.com/en-us/javascript/api/theme/isemanticcolors?view=office-ui-fabric-react-latest) (such as `buttonBackground`) to customize certain components. You can also configure fonts, spacing, effects, and more in the theme object.
Our theme is configured in [theme/index.ts](../packages/studio-base/theme/index.ts) and provided to components via [ThemeProvider](../packages/studio-base/theme/ThemeProvider.tsx). It has a `palette` of colors as well as some "slots" for [semantic colors](https://docs.microsoft.com/en-us/javascript/api/theme/isemanticcolors?view=office-ui-fabric-react-latest) (such as `buttonBackground`) to customize certain components. You can also configure fonts, spacing, effects, and more in the theme object.

There's a Theme Designer tool at https://aka.ms/themedesigner. It has limited customization capabilities, but helps you get a feel for what theme colors will look like.

Expand Down Expand Up @@ -89,11 +89,11 @@ The list of icons can be found at: https://developer.microsoft.com/en-us/fluentu
### Using a new icon

Since we only import the SVG icons we need, icons must be registered before they are used. This is done in the [ThemeProvider](../packages/@foxglove/studio-base/theme/ThemeProvider.tsx), and there is a corresponding type definition tracking the `RegisteredIconNames` at [fluentui.d.ts](../typings/fluentui.d.ts). The TypeScript compiler will prompt you to update both of these places before you can use a new icon.
Since we only import the SVG icons we need, icons must be registered before they are used. This is done in the [ThemeProvider](../packages/studio-base/theme/ThemeProvider.tsx), and there is a corresponding type definition tracking the `RegisteredIconNames` at [fluentui.d.ts](../typings/fluentui.d.ts). The TypeScript compiler will prompt you to update both of these places before you can use a new icon.

### Custom SVG icons

You can make a custom SVG icon conform to the Fluent UI theme by using `createSvgIcon()`. See [RosIcon.tsx](../packages/@foxglove/studio-base/components/RosIcon.tsx) for an example.
You can make a custom SVG icon conform to the Fluent UI theme by using `createSvgIcon()`. See [RosIcon.tsx](../packages/studio-base/components/RosIcon.tsx) for an example.

```tsx
import { createSvgIcon } from "@fluentui/react-icons-mdl2";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"homepage": "https://foxglove.dev/",
"scripts": {
"clean": "tsc --build --clean packages/*/tsconfig.json && rimraf .webpack dist packages/@foxglove/studio-base/storybook-screenshots packages/@foxglove/studio-base/storybook-static",
"clean": "tsc --build --clean packages/*/tsconfig.json && rimraf .webpack dist packages/studio-base/storybook-screenshots packages/studio-base/storybook-static",
"clean:package": "yarn && yarn clean && yarn build:prod && yarn package",
"start": "electron desktop/.webpack",
"build:packages": "tsc --build --verbose packages/**/tsconfig.json",
Expand Down
17 changes: 17 additions & 0 deletions packages/studio-base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
{
"name": "@foxglove/studio-base",
"version": "0.0.1",
"description": "Core components of Foxglove Studio",
"license": "MPL-2.0",
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/foxglove/studio.git"
},
"author": {
"name": "Foxglove Technologies",
"email": "support@foxglove.dev"
},
"homepage": "https://foxglove.dev/",
"main": "src/index.ts",
"files": [
"dist",
"src"
],
"scripts": {
"chromatic": "chromatic --project-token $CHROMATIC_PROJECT_TOKEN --build-script-name storybook:build --exit-once-uploaded",
"storybook:build": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' build-storybook"
Expand Down
9 changes: 4 additions & 5 deletions packages/studio-base/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"extends": "@foxglove/tsconfig/tsconfig.base.json",
"include": ["./**/*", "./**/*.json", "./.storybook/**/*", "../package.json"],
"include": ["./src/**/*", "./src/**/*.json"],
"compilerOptions": {
"noEmit": true,
"rootDir": "../",
"rootDir": "./src",
"outDir": "./dist",
"jsx": "react-jsx",
"lib": ["dom", "dom.iterable", "es2020"],
"paths": {
// This is only needed for vscode import suggestions
"@foxglove/studio-base/*": ["./*"]
"@foxglove/studio-base/*": ["./src/*"]
}
}
}
4 changes: 4 additions & 0 deletions packages/studio-base/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export function makeConfig(
resolve: {
extensions: [".js", ".ts", ".jsx", ".tsx"],
alias: {
"@foxglove/studio-base": path.resolve(__dirname, "src"),
"react-dnd": require.resolve("react-dnd"),
"styled-components": require.resolve("styled-components"),
},
Expand Down Expand Up @@ -199,6 +200,9 @@ export function makeConfig(
configOverwrite: {
compilerOptions: {
noUnusedLocals: !allowUnusedLocals,
paths: {
"@foxglove/studio-base/*": [path.join(__dirname, "src/*")],
},
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build:prod": "webpack --mode production --progress"
},
"dependencies": {
"@foxglove/studio-base": "workspace:packages/@foxglove/studio-base"
"@foxglove/studio-base": "workspace:packages/studio-base"
},
"devDependencies": {
"@types/copy-webpack-plugin": "8.0.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2171,9 +2171,9 @@ __metadata:
languageName: unknown
linkType: soft

"@foxglove/studio-base@workspace:packages/@foxglove/studio-base":
"@foxglove/studio-base@workspace:packages/studio-base":
version: 0.0.0-use.local
resolution: "@foxglove/studio-base@workspace:packages/@foxglove/studio-base"
resolution: "@foxglove/studio-base@workspace:packages/studio-base"
dependencies:
"@fluentui/react": 8.14.9
"@fluentui/react-icons-mdl2": 1.1.0
Expand Down Expand Up @@ -10305,7 +10305,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "desktop@workspace:desktop"
dependencies:
"@foxglove/studio-base": "workspace:packages/@foxglove/studio-base"
"@foxglove/studio-base": "workspace:packages/studio-base"
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -25936,7 +25936,7 @@ typescript@4.2.4:
version: 0.0.0-use.local
resolution: "web@workspace:web"
dependencies:
"@foxglove/studio-base": "workspace:packages/@foxglove/studio-base"
"@foxglove/studio-base": "workspace:packages/studio-base"
"@types/copy-webpack-plugin": 8.0.0
copy-webpack-plugin: 8.1.1
webpack: 5.37.0
Expand Down

0 comments on commit d26d731

Please sign in to comment.