-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: point type def in package json to index
- Loading branch information
Showing
13 changed files
with
219 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module.exports = { | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
], | ||
"overrides": [ | ||
{ | ||
"env": { | ||
"node": true | ||
}, | ||
"files": [ | ||
".eslintrc.{js,cjs}" | ||
], | ||
"parserOptions": { | ||
"sourceType": "script" | ||
} | ||
} | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint", | ||
], | ||
"rules": { | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
}, | ||
"settings": { | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {CastProfiles, loadCast, StoryScript} from "cantos"; | ||
|
||
const mwCastProfiles = { | ||
MW: { | ||
role: "Mermaid Whisper", | ||
}, | ||
diagramHeader: { | ||
role: 'Header', | ||
} | ||
|
||
} satisfies CastProfiles | ||
|
||
|
||
const mwCast = loadCast(mwCastProfiles); | ||
|
||
const mwStoryScript = { | ||
who: ['MW'], | ||
story: 'Mermaid Whisper Tests', | ||
} satisfies StoryScript<typeof mwCast> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"name": "mermaid-whisper", | ||
"private": false, | ||
"author": "Bo An", | ||
"version": "0.0.1", | ||
"keywords": [ | ||
"Mermaid" | ||
], | ||
"type": "module", | ||
"main": "./dist/mermaid-whisper.umd.cjs", | ||
"module": "./dist/mermaid-whisper.js", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/mermaid-whisper.js", | ||
"require": "./dist/mermaid-whisper.umd.cjs" | ||
} | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"dev": "vite", | ||
"build:tsc": "tsc --project tsconfig.build.json", | ||
"build": "yarn build:tsc && vite build", | ||
"dry-run": "npm pack --dry-run", | ||
"preview": "vite preview", | ||
"test": "vitest", | ||
"test:ui": "vitest --ui", | ||
"mermaid": "^10.6.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.9.0", | ||
"@types/uuid": "^9.0.7", | ||
"@typescript-eslint/eslint-plugin": "^6.10.0", | ||
"@typescript-eslint/parser": "^6.10.0", | ||
"@vitest/coverage-v8": "^0.34.6", | ||
"@vitest/ui": "^1.0.0-beta.4", | ||
"eslint": "^8.53.0", | ||
"typescript": "^5", | ||
"vite": "^4.4.5", | ||
"vite-plugin-dts": "^3.6.3", | ||
"vite-plugin-eslint": "^1.8.1", | ||
"vitest": "^1.0.0-beta.4" | ||
}, | ||
"dependencies": { | ||
"cantos": "^0.0.4", | ||
"mermaid": "^10.6.1" | ||
}, | ||
"peerDependencies": { | ||
"typescript": "^5" | ||
}, | ||
"license": "MIT" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import * as MW from './mermaid-whisper.ts'; | ||
|
||
export {MW, MW as MermaidWhisper} |
17 changes: 17 additions & 0 deletions
17
packages/mermaid-whisper/src/mermaid-types/flowchart/flow-chart.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const DIRECTIONS = { | ||
// Left to right direction | ||
LR: 'LR', | ||
// Right to left direction | ||
RL: 'RL', | ||
// Left to right direction | ||
TD: 'TD', | ||
// Top to bottom direction | ||
TB: 'TB', | ||
} as const; | ||
|
||
export const FLOW_CHART_DEF = { | ||
DIAGRAM_TYPE: 'flowchart', | ||
DIRECTIONS | ||
} as const; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class MermaidWhisper { | ||
constructor() { | ||
console.log('MermaidWhisper constructor'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {describe, expect, it} from "vitest"; | ||
|
||
describe('mermaid-whisper.ts', () => { | ||
it('should be a thing', () => { | ||
expect(true).toBe(true); | ||
}); | ||
}) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"useDefineForClassFields": true, | ||
"module": "ESNext", | ||
"lib": ["ES2020", "DOM", "DOM.Iterable"], | ||
"skipLibCheck": true, | ||
|
||
/* Bundler mode */ | ||
"moduleResolution": "bundler", | ||
"allowImportingTsExtensions": true, | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"noEmit": true, | ||
"outDir": "./dist/", | ||
/* Linting */ | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"paths": { | ||
"@src/*": ["./src/*"] | ||
} | ||
}, | ||
"include": [ | ||
"src", | ||
"tests" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import {defineConfig, UserConfig} from "vitest/config"; | ||
import * as path from "path"; | ||
import dts from 'vite-plugin-dts'; | ||
import eslintPlugin from "vite-plugin-eslint"; | ||
export const viteConfig: UserConfig = { | ||
resolve: { | ||
alias: { | ||
'@src': path.resolve(__dirname, './src') | ||
|
||
} | ||
}, | ||
build: { | ||
lib: { | ||
entry: path.resolve(__dirname, './src/index.ts'), | ||
name: 'mermaid-whisper.ts', | ||
fileName: 'mermaid-whisper.ts', | ||
}, | ||
rollupOptions: { | ||
external: ['./tests'] | ||
} | ||
}, | ||
plugins: [dts({ | ||
tsconfigPath: 'tsconfig.build.json' | ||
}), eslintPlugin()], | ||
test: { | ||
include: ['**/*.test.ts'], | ||
setupFiles: [ | ||
'tests/utils/setup.ts' | ||
], | ||
coverage: { | ||
provider: 'v8', | ||
include: ['**/*.ts'], | ||
} | ||
}, | ||
} | ||
export default defineConfig(viteConfig); |