Skip to content

Commit

Permalink
fixing tutorial
Browse files Browse the repository at this point in the history
Signed-off-by: Teo Koon Peng <teokoonpeng@gmail.com>
  • Loading branch information
koonpeng committed Oct 18, 2024
1 parent c9ea2c2 commit 8c36f1e
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 53 deletions.
2 changes: 1 addition & 1 deletion packages/rmf-dashboard-framework/.storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { CssBaseline } from '@mui/material';
import { Decorator, Preview } from '@storybook/react';
import { TestProviders } from 'rmf-dashboard-framework/utils/test-utils.test';

import { LocalizationProvider } from '../src/components/locale';
import { TestProviders } from '../src/utils/test-utils.test';

const preview: Preview = {
parameters: {
Expand Down
27 changes: 2 additions & 25 deletions packages/rmf-dashboard-framework/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,10 @@ cd basic-dashboard
git clone --depth 1 https://github.com/open-rmf/rmf-web
```

<!-- TODO(koonpeng): not needed after package is published -->

Modify the following to resolve `rmf-dashboard-framework` as if it is installed from npmjs.

Add local dependency to `rmf-web`:

package.json

```
"dependencies": {
...
"rmf-dashboard-framework": "rmf-web/packages/rmf-dashboard-framework"
}
```

Configure typescript to resolve `rmf-dashboard-framework`:

tsconfig.app.json

```
compilerOptions: [
...,
"paths": {
"rmf-dashboard-framework/*": ["./node_modules/rmf-dashboard-framework/src/*"]
},
...
]
```bash
pnpm add rmf-web/packages/rmf-dashboard-framework
```

Build `rmf-dashboard-framework`
Expand Down
8 changes: 0 additions & 8 deletions packages/rmf-dashboard-framework/examples/shared/app.css

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,4 @@ import { defineConfig } from 'vite';
export default defineConfig({
plugins: [react()],
publicDir: path.resolve(__dirname, 'public'),
resolve: {
alias: {
'rmf-dashboard-framework': path.resolve(__dirname, '../../src'),
},
},
});
8 changes: 4 additions & 4 deletions packages/rmf-dashboard-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@
"vitest": "^2.0.4"
},
"exports": {
"./components": "./src/components/index",
"./hooks": "./src/hooks/index",
"./micro-apps": "./src/micro-apps/index",
"./services": "./src/services/index"
"./components": "./src/components/index.ts",
"./hooks": "./src/hooks/index.ts",
"./micro-apps": "./src/micro-apps/index.ts",
"./services": "./src/services/index.ts"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createMicroApp } from '.';
import { createMicroApp } from '../components';

export default createMicroApp(
'doors-table',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createMicroApp } from '.';
import { createMicroApp } from '../components';

export default createMicroApp(
'lifts-table',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createMicroApp } from '.';
import { createMicroApp } from '../components';

export default createMicroApp(
'robot-mutex-groups-table',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createMicroApp } from '.';
import { createMicroApp } from '../components';

export default createMicroApp(
'robots-table',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { lazy } from 'react';
import { Suspense } from 'react';

import { MicroAppManifest } from '.';
import { MicroAppManifest } from '../components';

const TasksWindow = lazy(() => import('../components/tasks/tasks-window'));

Expand Down
6 changes: 1 addition & 5 deletions packages/rmf-dashboard-framework/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

"paths": {
"rmf-dashboard-framework/*": ["./src/*"]
}
"noFallthroughCasesInSwitch": true
},
"include": ["src", "examples", ".storybook/*"]
}

0 comments on commit 8c36f1e

Please sign in to comment.