mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-02 23:26:44 +02:00
feat: create parser
package in packages
directory
This commit is contained in:
@@ -6,3 +6,6 @@ cypress/plugins/index.js
|
|||||||
coverage
|
coverage
|
||||||
*.json
|
*.json
|
||||||
node_modules
|
node_modules
|
||||||
|
|
||||||
|
# autogenereated by langium-cli
|
||||||
|
generated/
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -47,3 +47,6 @@ stats/
|
|||||||
demos/dev/**
|
demos/dev/**
|
||||||
!/demos/dev/example.html
|
!/demos/dev/example.html
|
||||||
!/demos/dev/reload.js
|
!/demos/dev/reload.js
|
||||||
|
|
||||||
|
# autogenereated by langium-cli
|
||||||
|
generated/
|
||||||
|
@@ -10,3 +10,6 @@ stats
|
|||||||
.nyc_output
|
.nyc_output
|
||||||
# Autogenerated by `pnpm run --filter mermaid types:build-config`
|
# Autogenerated by `pnpm run --filter mermaid types:build-config`
|
||||||
packages/mermaid/src/config.type.ts
|
packages/mermaid/src/config.type.ts
|
||||||
|
|
||||||
|
# autogenereated by langium-cli
|
||||||
|
generated/
|
||||||
|
@@ -70,6 +70,7 @@
|
|||||||
"knut",
|
"knut",
|
||||||
"knutsveidqvist",
|
"knutsveidqvist",
|
||||||
"laganeckas",
|
"laganeckas",
|
||||||
|
"langium",
|
||||||
"linetype",
|
"linetype",
|
||||||
"lintstagedrc",
|
"lintstagedrc",
|
||||||
"logmsg",
|
"logmsg",
|
||||||
|
21
packages/parser/LICENSE
Normal file
21
packages/parser/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2023 Yokozuna59
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
13
packages/parser/langium-config.json
Normal file
13
packages/parser/langium-config.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"projectName": "Mermaid",
|
||||||
|
"languages": [
|
||||||
|
{
|
||||||
|
"id": "info",
|
||||||
|
"grammar": "src/language/info/info.langium",
|
||||||
|
"fileExtensions": [".mmd", ".mermaid"]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"mode": "production",
|
||||||
|
"importExtension": ".js",
|
||||||
|
"out": "src/language/generated"
|
||||||
|
}
|
49
packages/parser/package.json
Normal file
49
packages/parser/package.json
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
"name": "mermaid-parser",
|
||||||
|
"version": "0.2.0",
|
||||||
|
"description": "MermaidJS parser",
|
||||||
|
"author": "Yokozuna59",
|
||||||
|
"contributors": [
|
||||||
|
"Yokozuna59",
|
||||||
|
"Sidharth Vinod (https://sidharth.dev)"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/mermaid-js/mermaid/#readme",
|
||||||
|
"types": "dist/src/index.d.ts",
|
||||||
|
"type": "module",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"import": "./dist/mermaid-parser.esm.mjs",
|
||||||
|
"types": "./dist/src/index.d.ts"
|
||||||
|
},
|
||||||
|
"./*": "./*"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"clean": "rimraf dist src/language/generated",
|
||||||
|
"langium:generate": "langium generate",
|
||||||
|
"langium:watch": "langium generate --watch",
|
||||||
|
"prepublishOnly": "pnpm -w run build"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/mermaid-js/mermaid.git",
|
||||||
|
"directory": "packages/parser"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"keywords": [
|
||||||
|
"mermaid",
|
||||||
|
"parser",
|
||||||
|
"ast"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"langium": "2.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"langium-cli": "2.0.0"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"dist/"
|
||||||
|
],
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
}
|
||||||
|
}
|
0
packages/parser/src/index.ts
Normal file
0
packages/parser/src/index.ts
Normal file
12
packages/parser/tsconfig.json
Normal file
12
packages/parser/tsconfig.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": ".",
|
||||||
|
"outDir": "./dist",
|
||||||
|
"allowJs": false,
|
||||||
|
"preserveSymlinks": false,
|
||||||
|
"strictPropertyInitialization": false
|
||||||
|
},
|
||||||
|
"include": ["./src/**/*.ts", "./tests/**/*.ts"],
|
||||||
|
"typeRoots": ["./src/types"]
|
||||||
|
}
|
6797
pnpm-lock.yaml
generated
6797
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
|||||||
import jison from './.vite/jisonPlugin.js';
|
import jison from './.vite/jisonPlugin.js';
|
||||||
import jsonSchemaPlugin from './.vite/jsonSchemaPlugin.js';
|
import jsonSchemaPlugin from './.vite/jsonSchemaPlugin.js';
|
||||||
import typescript from '@rollup/plugin-typescript';
|
import typescript from '@rollup/plugin-typescript';
|
||||||
import { defineConfig } from 'vitest/config';
|
import { defaultExclude, defineConfig } from 'vitest/config';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
resolve: {
|
resolve: {
|
||||||
@@ -22,7 +22,7 @@ export default defineConfig({
|
|||||||
provider: 'v8',
|
provider: 'v8',
|
||||||
reporter: ['text', 'json', 'html', 'lcov'],
|
reporter: ['text', 'json', 'html', 'lcov'],
|
||||||
reportsDirectory: './coverage/vitest',
|
reportsDirectory: './coverage/vitest',
|
||||||
exclude: ['**/node_modules/**', '**/tests/**', '**/__mocks__/**'],
|
exclude: [...defaultExclude, './tests/**', '**/__mocks__/**', '**/generated/'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
|
Reference in New Issue
Block a user