Skip to content

Commit

Permalink
Setup repo for publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
obadakhalili committed Sep 7, 2021
1 parent c924e89 commit 41a7787
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 29 deletions.
19 changes: 3 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
# ERML - Entity-Relationship Markup Language

ERML is a super easy-to-write DSL that represents conceptual data models using the Entity-Relationship modeling concepts.
What does that gibberish mean? read the [docs](https://erml.netlify.app/)
ERML is a super easy-to-write DSL for representing conceptual data models via the Entity-Relationship modeling concepts.

# Installation and Usage
You write ERML code (defined [here](https://erml.netlify.app/)) to represent your Entity-Relationship diagram, and the [ERML Parser](https://github.com/obadakhalili/ERML/tree/main/packages/parser) parses it into an AST, from there, an application can take the resulted AST and build all sorts of things with it, such as an [ERD Visualizer](https://github.com/obadakhalili/ERML/tree/main/packages/visualizer).

You can install the ERML parser from [NPM](http://npmjs.org/package/erml) or [yarn](https://classic.yarnpkg.com/en/package/erml) via the commands

```sh
npm install erml # From NPM
yarn add erml # From yarn
```

After that all you have to do is to execute the parser function exported by the library

```js
const ERMLParser = require("erml")
const ast = ERMLParser(`ENTITY Example_entity { SIMPLE "attribute_name" }`)
```
For more detailed info on where the project is heading, check out the project's roadmap [here](https://github.com/obadakhalili/ERML/issues/4).
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"private": true,
"license": "MIT",
"workspaces": [
"packages/*"
],
"workspaces": {
"packages": ["packages/*"],
"nohoist": ["@erml/parser"]
},
"scripts": {
"format": "yarn run prettier --write .",
"format:all": "yarn run prettier --ignore-path .gitignore --write ."
Expand Down
19 changes: 19 additions & 0 deletions packages/parser/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# ERML Parser

Converts ERML code into an AST.

# Installation and Usage

You can install the ERML parser from [NPM](http://npmjs.org/package/@erml/parser) or [yarn](https://classic.yarnpkg.com/en/package/@erml/parser) via the commands

```sh
npm install @erml/parser
yarn add @erml/parser
```

After that, all you have to do is to execute the parsing function exported by the library

```js
const ERMLParser = require("@erml/parser")
const ast = ERMLParser(`ENTITY Example_entity { SIMPLE "attribute_name" }`)
```
6 changes: 3 additions & 3 deletions packages/parser/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "erml-parser",
"name": "@erml/parser",
"version": "1.0.0",
"author": "Obada Khalili",
"license": "MIT",
"description": "ERML Parser for representing conceptual data models using the Entity-Relationship (ER) modeling concepts",
"description": "Parser implementation of ERML",
"repository": {
"type": "git",
"url": "https://github.com/obadakhalili/ERML.git"
"url": "https://github.com/obadakhalili/ERML/tree/main/packages/parser"
},
"keywords": [
"entity-relationship-diagram",
Expand Down
5 changes: 5 additions & 0 deletions packages/visualizer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ERML Visualizer

ERD Visualizer that converts ERML code into SVG drawings. [Check it out](https://erml-visualizer.netlify.app/).

[![erml-visualizer-demo.gif](https://s9.gifyu.com/images/erml-visualizer-demo.gif)](https://gifyu.com/image/JNy1)
4 changes: 2 additions & 2 deletions packages/visualizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"description": "ERML Visualizer",
"repository": {
"type": "git",
"url": "https://github.com/obadakhalili/ERML.git"
"url": "https://github.com/obadakhalili/ERML/tree/main/packages/visualizer"
},
"scripts": {
"dev": "vite --host --port 8080",
Expand All @@ -24,7 +24,7 @@
"awesome-dev-jokes": "^1.0.3",
"d3": "^7.0.1",
"dagre-d3": "^0.6.4",
"erml-parser": "1.0.0",
"@erml/parser": "^1.0.0",
"monaco-editor": "^0.25.2",
"monaco-vim": "^0.1.15",
"react": "^17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/visualizer/src/Workspace/ASTViewer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react"
import { useRecoilValue } from "recoil"
import ReactJson from "react-json-view"
import ERMLParser from "erml-parser"
import ERMLParser from "@erml/parser"

import { workspaceOptionsState, Theme } from "../state"

Expand Down
2 changes: 1 addition & 1 deletion packages/visualizer/src/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useMemo, useRef, useState } from "react"
import { useRecoilValue, useSetRecoilState } from "recoil"
import ERMLParser from "erml-parser"
import ERMLParser from "@erml/parser"

import { activeSnippetState, parsingErrorState } from "./state"

Expand Down
2 changes: 1 addition & 1 deletion packages/visualizer/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ERMLParser from "erml-parser"
import ERMLParser from "@erml/parser"
import * as d3 from "d3"
import dagreD3 from "dagre-d3"

Expand Down
4 changes: 2 additions & 2 deletions packages/visualizer/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import reactRefresh from "@vitejs/plugin-react-refresh"
export default defineConfig({
plugins: [reactRefresh()],
optimizeDeps: {
include: ["erml-parser"],
include: ["@erml/parser"],
},
define: {
"process.env": {},
},
build: {
commonjsOptions: {
exclude: ["erml-parser"],
exclude: ["@erml/parser"],
},
},
})

0 comments on commit 41a7787

Please sign in to comment.