Skip to content

Workspace platform starter React Wrapper #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: frameworks/v21.0.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions frameworks/react/workspace-platform-starter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Runtime files copied to public folder
public/openfin
public/common
74 changes: 74 additions & 0 deletions frameworks/react/workspace-platform-starter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# React Wrapper for Workspace Platform Starter

This project provides a React wrapper for the [workspace-platform-starter](https://github.com/built-on-openfin/workspace-starter/tree/main/how-to/workspace-platform-starter) for teams who prefer to use the build tooling available in the React ecosystem for a familiar development experience.

To use this project, the source files are manually copied into the project from the [workspace-platform-starter](https://github.com/built-on-openfin/workspace-starter/tree/main/how-to/workspace-platform-starter) project. A simple React-based provider demonstrates how to bootstrap a platform.

This can then form the basis of your own OpenFin platform. The source within the /openfin folder becomes your source code to customize as you need to.

Once setup, see the next steps section below.

## Prerequsites

Please follow the [getting started](https://resources.here.io/docs/core/develop/) guide to install the OpenFin RVM.

## Copy workspace-platform-starter source files

Manually add the original workspace-platform-starter source files into this project:

Clone the main workspace-starter repo:

```
git clone https://github.com/built-on-openfin/workspace-starter.git --depth=1
```

Manually copy the following folders from the **how-to/workspace-platform-starter** directory into the openfin folder:

```
client/src/framework -> openfin/framework
client/src/modules -> openfin/modules
public/common -> openfin/common
```

The **/openfin** folder in this project should then look like:

```
/openfin/framework
/openfin/modules
/openfin/common
```

### Develop

```
npm install
npm start
```

Launch [fin://localhost:8080/manifest.fin.json](fin://localhost:8080/manifest.fin.json)

### Build for production

```
npm install
npm run build
```

The files to deploy will be in the `dist` folder

### Preview production build

```
npm run preview
```
Launch [fin://localhost:8080/manifest.fin.json](fin://localhost:8080/manifest.fin.json)

## Next steps

- Remove or disable modules you don't need in public/manifest.fin.json
- If necessary, remove modules from the build step in rollup.config.mjs
- Remove the example app endpoints listed in "appProvider" / "endpointIds" in manifest.fin.json
- Define your apps in /public/apps.json
- Customize your theme in the themeProvider section of the manifest.fin.json
- Follow the [how-to](https://github.com/built-on-openfin/workspace-starter/tree/main/how-to/workspace-platform-starter/docs) documentation to further customize your platform

25 changes: 25 additions & 0 deletions frameworks/react/workspace-platform-starter/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";

export default tseslint.config(
{ ignores: ["dist", "openfin/**", "public"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
}
},
);
13 changes: 13 additions & 0 deletions frameworks/react/workspace-platform-starter/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>OpenFin Workspace Platform Starter</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
framework/
modules/
common/
Loading