Skip to content

Commit

Permalink
tailwinds works, just missing control bar.
Browse files Browse the repository at this point in the history
  • Loading branch information
bhouston committed Jul 12, 2023
1 parent 8db66f5 commit 24fc328
Show file tree
Hide file tree
Showing 10 changed files with 231 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
<title>@Behave-Graph/React-Flow Graph Editor Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="utf-8" />
<link rel="stylesheet" href="/index.css" />
</head>
<body>
<div id="root"></div>
<script type="module" src="/index.js"></script>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
8 changes: 3 additions & 5 deletions apps/graph-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
"version": "1.0.0",
"type": "module",
"scripts": {
"build:tsc": "tsc --noEmit",
"build:css": "npx postcss src/styles.css -o public/styles.css",
"build:esbuild": "esbuild src/index.tsx --target=es2020 --bundle --minify --outfile=public/index.js",
"build": "npm run build:tsc && npm run build:css && npm run build:esbuild",
"dev": "npx postcss src/styles.css -o public/styles.css --watch & tsc --noEmit --watch & esbuild src/index.tsx --target=es2018 --bundle --sourcemap --outfile=public/index.js --watch --serve=8001 --servedir=public"
"build": "tsc && vite build",
"dev": "vite"
},
"dependencies": {
"@behave-graph/core": "*",
Expand All @@ -20,6 +17,7 @@
"@vitejs/plugin-react": "^2.2.0",
"autoprefixer": "^10.4.13",
"postcss": "^8.4.19",
"postcss-cli": "^10.1.0",
"tailwindcss": "^3.2.4",
"vite-plugin-eslint": "^1.8.1",
"vite-tsconfig-paths": "^3.6.0"
Expand Down
2 changes: 1 addition & 1 deletion apps/graph-editor/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
plugins: {
tailwindcss: {},
autoprefixer: {}
Expand Down
2 changes: 1 addition & 1 deletion apps/graph-editor/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'reactflow/dist/style.css';
import './index.css';
import './styles.css';

import { GraphJSON } from '@behave-graph/core';
import { Examples, Flow } from '@behave-graph/flow';
Expand Down
9 changes: 8 additions & 1 deletion apps/graph-editor/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,12 @@ module.exports = {
theme: {
extend: {}
},
plugins: []
plugins: [
{
tailwindcss: {}
},
{
autoprefixer: {}
}
]
};
23 changes: 23 additions & 0 deletions apps/graph-editor/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { resolve } from 'node:path';

import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [tsconfigPaths(), react()],
build: {
target: ['es2020'],
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html')
}
}
},
optimizeDeps: {
esbuildOptions: {
target: 'es2020'
}
}
});
169 changes: 167 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions packages/flow/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import autoprefixer from 'autoprefixer';
import tailwindcss from 'tailwindcss';

export default {
plugins: [tailwindcss, autoprefixer]
};

2 changes: 1 addition & 1 deletion packages/flow/src/components/Node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { isHandleConnected } from '../util/isHandleConnected.js';
import InputSocket from './InputSocket.js';
import NodeContainer from './NodeContainer.js';
import OutputSocket from './OutputSocket.js';
// import styles from "./Node.module.css"
import styles from './Node.module.css';

type NodeProps = FlowNodeProps & {
spec: NodeSpecJSON;
Expand Down
19 changes: 19 additions & 0 deletions packages/flow/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./public/index.html',
'./src/**/*.{js,ts,jsx,tsx,css}',
'../../packages/flow/dist/**/*.{js,ts,jsx,tsx,css}'
],
theme: {
extend: {}
},
plugins: [
{
tailwindcss: {}
},
{
autoprefixer: {}
}
]
};

0 comments on commit 24fc328

Please sign in to comment.