Skip to content

Commit

Permalink
Switch to bun
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-gordon committed Jul 27, 2024
1 parent 3af1270 commit 40f7372
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 9,375 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm test && node_modules/.bin/lint-staged
bun test && node_modules/.bin/lint-staged
Binary file added bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"typescript.tsdk": "../node_modules/.pnpm/[email protected]/node_modules/typescript/lib",
"typescript.tsdk": "../node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
Binary file added graph-selector/bun.lockb
Binary file not shown.
26 changes: 15 additions & 11 deletions graph-selector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,25 @@
"version": "0.10.0",
"description": "Parse indented text (flowchart.fun syntax) into a graph",
"source": "src/graph-selector.ts",
"main": "dist/graph-selector.js",
"umd:main": "dist/graph-selector.umd.js",
"module": "dist/graph-selector.mjs",
"main": "./dist/graph-selector.cjs",
"module": "./dist/graph-selector.mjs",
"types": "./dist/graph-selector.d.cts",
"exports": {
"types": "./dist/graph-selector.d.ts",
"require": "./dist/graph-selector.js",
"default": "./dist/graph-selector.modern.mjs"
"require": {
"types": "./dist/graph-selector.d.cts",
"default": "./dist/graph-selector.cjs"
},
"import": {
"types": "./dist/graph-selector.d.mts",
"default": "./dist/graph-selector.mjs"
}
},
"types": "dist/graph-selector.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "rm -rf dist && microbundle",
"dev": "microbundle watch",
"build": "pkgroll",
"dev": "pkgroll --watch",
"test": "vitest",
"test:ci": "vitest run",
"test:coverage": "vitest --coverage",
Expand All @@ -31,23 +35,23 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@types/strip-comments": "^2.0.2",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"eslint": "^8.50.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-no-lookahead-lookbehind-regexp": "^0.3.0",
"eslint-plugin-prettier": "^5.0.0",
"microbundle": "^0.15.1",
"prettier": "^3.0.3",
"typescript": "^5.2.2",
"vitest": "^0.34.5"
},
"dependencies": {
"@types/strip-comments": "^2.0.2",
"@tone-row/strip-comments": "^2.0.6",
"@types/cytoscape": "^3.19.11",
"html-entities": "^2.4.0",
"monaco-editor": "^0.43.0",
"pkgroll": "^2.4.1",
"strip-comments": "^2.0.1"
},
"browserslist": [
Expand Down
2 changes: 1 addition & 1 deletion graph-selector/src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function parse(text: string): Graph {
let lines = strip(text, { preserveNewlines: true }).split(/\n/g);

// unescape backslashes in newlines
lines = lines.map((line) => line.replace(/\\n/g, "\n"));
lines = lines.map((line: string) => line.replace(/\\n/g, "\n"));

// start line number count
let lineNumber = 0;
Expand Down
23 changes: 13 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,29 @@
"main": "index.js",
"private": true,
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev",
"test": "turbo run test:ci",
"test:coverage": "pnpm --parallel test:coverage",
"test:watch": "pnpm --parallel test:watch",
"lint": "pnpm -F graph-selector lint",
"build": "bun --filter graph-selector build; bun --filter examples build",
"dev": "bun --filter '*' dev",
"test": "bun --filter '*' test",
"test:watch": "bun --filter '*' test:watch",
"lint": "bun --filter graph-selector lint",
"prepare": "husky install",
"browsers": "pnpm up -r caniuse-lite --workspace graph-selector"
"browsers": "bun --filter graph-selector up -r caniuse-lite"
},
"workspaces": [
"graph-selector",
"examples"
],
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"husky": "^8.0.0",
"lint-staged": "^13.0.3",
"turbo": "^1.9.3"
"lint-staged": "^13.0.3"
},
"packageManager": "[email protected]",
"lint-staged": {
"graph-selector/**/*.{js,ts}": [
"pnpm -F graph-selector lint:staged"
"bun --filter graph-selector lint:staged"
]
}
}
Loading

0 comments on commit 40f7372

Please sign in to comment.