Skip to content

Commit 05c77c2

Browse files
authored
Merge pull request #164 from ControlCore-Project/main
Sync from main
2 parents 0b64389 + bfba8a8 commit 05c77c2

39 files changed

Lines changed: 487 additions & 166 deletions

.eslintrc.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
module.exports = {
2+
parser: 'babel-eslint',
3+
env: {
4+
browser: true,
5+
es2021: true,
6+
},
7+
extends: [
8+
'plugin:react/recommended',
9+
'airbnb',
10+
],
11+
parserOptions: {
12+
ecmaFeatures: {
13+
jsx: true,
14+
},
15+
ecmaVersion: 12,
16+
sourceType: 'module',
17+
},
18+
plugins: [
19+
'react',
20+
],
21+
rules: {
22+
indent: [
23+
'error',
24+
4,
25+
],
26+
'react/jsx-indent': [
27+
'error',
28+
4,
29+
],
30+
'react/jsx-indent-props': [
31+
'error',
32+
4,
33+
],
34+
'max-len': [
35+
'error',
36+
{
37+
code: 120,
38+
ignoreUrls: true,
39+
ignoreComments: true,
40+
},
41+
],
42+
'keyword-spacing': 'warn',
43+
'space-infix-ops': 'error',
44+
'no-unused-vars': [
45+
'warn',
46+
{
47+
vars: 'all',
48+
args: 'after-used',
49+
ignoreRestSiblings: false,
50+
},
51+
],
52+
'react/prop-types': 'off',
53+
'linebreak-style': ['error', (process.platform === 'win32' ? 'windows' : 'unix')],
54+
},
55+
overrides: [
56+
{
57+
files: [
58+
'*ML.js',
59+
],
60+
rules: {
61+
indent: [
62+
'error',
63+
2,
64+
],
65+
},
66+
},
67+
],
68+
settings: {
69+
'import/ignore': [
70+
'.css$',
71+
'node_modules/*',
72+
],
73+
},
74+
};

.eslintrc.json

Lines changed: 0 additions & 74 deletions
This file was deleted.

.github/workflows/buildAndDeploy.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
name: Build and Deploy
2+
23
on: workflow_dispatch
34
jobs:
45
build-and-deploy:
56
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
node-version: [16.x]
610
steps:
711
- name: Checkout 🛎️
812
uses: actions/checkout@v2.3.1
9-
13+
- name: Use Node.js ${{ matrix.node-version }}
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: ${{ matrix.node-version }}
1017
- name: Install and Build 🔧
1118
run: |
1219
npm ci

README.md

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
This is a fork of DHGWorkflow, visual Directed Hypergraph Workflow Composer, finetuned to operate as a frontend for _concore_.
44

5-
Active development of the _concore_ Editor happens in the dev branch. Please check it out!
6-
75
Key Features of the _concore_ Editor:
86
* Export-import graph as a graphml file.
97
* Export graph as JPEG/PNG
@@ -22,8 +20,9 @@ Steps to start it locally
2220
2. At the root of the repository, run the following commands:
2321
1. `npm i`
2422
2. `npm start`
25-
3. It should a development server and tool will be accessible at
23+
3. It should start a development server and tool will be accessible at
2624
`http://localhost:3000/DHGWorkflow`
25+
4. Note - In case, you're using Windows and see the linebreak-error please modify line 53 in `.eslintrc.json` file to `"linebreak-style": ["error", "windows"]`. Make sure you do not commit this change to prevent default environment.
2726

2827
## Creating a generic Graph Builder.
2928

@@ -35,6 +34,25 @@ This branch will be synced with the changes from the main periodically. Easy to
3534
2. `npm i`
3635
3. `npm start`
3736

37+
If this throws a long error in the browser and console about line endings (LF/CRLF), please follow the below steps.
38+
39+
In ~/.gitconfig, set autocrlf to false as below.
40+
````
41+
[core]
42+
autocrlf = false
43+
````
44+
45+
Then run the below from the concore editor source code in terminal.
46+
47+
````
48+
git rm --cached -r .
49+
git reset --hard
50+
git pull --rebase
51+
````
52+
53+
Now re-run with npm as above.
54+
55+
3856
This branch may contain `src/graph-builder/tailored-graph-builder.js`. It can be safely removed.
3957

4058
### 2. Make changes to the master branch
@@ -53,4 +71,21 @@ This project requires building a graph with some special kind of hyperedges.
5371

5472
If we create our instance of the graph with `tailored-graph-builder`, we will get graph builder which will have hyperedges specialized for this project requirement whereas creating the instance from `graph-core` will result in a generic graph builder with simple edges.
5573

56-
74+
# Deploying concore-editor in GitHub
75+
76+
If you have forked this repository, make sure to configure the GitHub actions. This is done *only once* for the entire GitHub deployment. Go to your fork's settings/pages (for example, https://github.com/pradeebanlab/concore-editor/settings/pages), and enable the GitHub Pages as shown below.
77+
78+
![The Pages Configuration](figures/github-pages.png)
79+
80+
Once this is configured, every time you want to update the hosted concore-editor, you need to run the "Build and Deploy" action as elaborated below.
81+
82+
We have two workflows.
83+
84+
* Build - triggers automatically on every push and pull just to ensure the new PRs are consistent.
85+
86+
* Build and Deploy - This has to be triggered manually and updates the online deployed version. This ensures that any PR containing breaking change doesn't affect the user directly
87+
88+
89+
Please go to the url https://github.com/ControlCore-Project/concore-editor/actions/workflows/buildAndDeploy.yml and trigger this particular workflow. This will in turn automatically trigger the Pages Build and Deploy action. Once that action also completes successfully, the new page will be alive. Depending on the nature of the changes, you may need to clear the cache/cookies to make the changes visible to your browser. You can choose to delete just the cookies and data of controlcore-project.github.io as stored in your browser. Please check the browser documentation for more information on deleting the cookies.
90+
91+

figures/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
A placeholder for screenshots

figures/chrome-chrome.png

646 KB
Loading

figures/emptynode.png

71.5 KB
Loading

figures/github-pages.png

408 KB
Loading

figures/png-error.png

515 KB
Loading

figures/program-editor.png

706 KB
Loading

0 commit comments

Comments
 (0)