Skip to content

Commit

Permalink
Merge pull request #44 from siefkenj/pret
Browse files Browse the repository at this point in the history
Prettier v3 support
  • Loading branch information
siefkenj authored Sep 8, 2023
2 parents f2b8c10 + 8bf7d31 commit b1a7e59
Show file tree
Hide file tree
Showing 17 changed files with 858 additions and 794 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### v1.4.1
- Many more ligatures added to the HTML converter.
- Fixed issue [#40](https://github.com/siefkenj/unified-latex/issues/40) where the optional argument to `\\` was being parsed even if preceded by a space. (E.g., `\\[10pt]` and `\\ [10pt]`) were parsed the same. Not allowing the space should more closely match expected behavior.
- Bump Prettier to v2.8.8

### v1.4.0
- Better CJS support (now `unified` is compiled in rather than left as an external dependency. This is needed because `unified` is ESM-only).
Expand Down
4 changes: 2 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"packages": ["packages/*"],
"version": "1.4.0"
"packages": ["packages/*"],
"version": "1.4.1"
}
157 changes: 108 additions & 49 deletions package-lock.json

Large diffs are not rendered by default.

114 changes: 57 additions & 57 deletions packages/support-tables/package.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
{
"name": "@unified-latex/support-tables",
"version": "1.4.0",
"description": "Lists of special data needed for the internals of unified-latex",
"type": "module",
"files": [
"dist/**/*.ts",
"dist/**/*.js",
"dist/**/*.map",
"dist/**/*.json"
],
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"./*json": "./dist/*json",
"./*js": "./dist/*js",
"./*": {
"import": "./dist/*.js",
"require": "./dist/*.cjs"
}
},
"scripts": {
"build": "npm run clean && mkdirp ./dist && npm run compile",
"clean": "rm -rf ./dist && rm -rf tsconfig.tsbuildinfo",
"compile": "tsc -b tsconfig.json & node build.js & wait",
"package": "node ../../scripts/make-package.mjs",
"publish": "cd dist && npm publish"
},
"repository": {
"type": "git",
"url": "git+https://github.com/siefkenj/unified-latex.git"
"name": "@unified-latex/support-tables",
"version": "1.4.1",
"description": "Lists of special data needed for the internals of unified-latex",
"type": "module",
"files": [
"dist/**/*.ts",
"dist/**/*.js",
"dist/**/*.map",
"dist/**/*.json"
],
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"keywords": [
"pegjs",
"latex",
"parser",
"prettier",
"unified-latex",
"unified"
"./*json": "./dist/*json",
"./*js": "./dist/*js",
"./*": {
"import": "./dist/*.js",
"require": "./dist/*.cjs"
}
},
"scripts": {
"build": "npm run clean && mkdirp ./dist && npm run compile",
"clean": "rm -rf ./dist && rm -rf tsconfig.tsbuildinfo",
"compile": "tsc -b tsconfig.json & node build.js & wait",
"package": "node ../../scripts/make-package.mjs",
"publish": "cd dist && npm publish"
},
"repository": {
"type": "git",
"url": "git+https://github.com/siefkenj/unified-latex.git"
},
"keywords": [
"pegjs",
"latex",
"parser",
"prettier",
"unified-latex",
"unified"
],
"author": "Jason Siefken",
"license": "MIT",
"bugs": {
"url": "https://github.com/siefkenj/unified-latex/issues"
},
"homepage": "https://github.com/siefkenj/unified-latex#readme",
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!unified|bail|is-plain-obj|trough|vfile.*|unist.*|hast.*|property-information|html-void-elements|.*-separated-tokens|.*entities.*|ccount|rehype*|string-width|strip-ansi|ansi-regex|supports-color)"
],
"author": "Jason Siefken",
"license": "MIT",
"bugs": {
"url": "https://github.com/siefkenj/unified-latex/issues"
},
"homepage": "https://github.com/siefkenj/unified-latex#readme",
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!unified|bail|is-plain-obj|trough|vfile.*|unist.*|hast.*|property-information|html-void-elements|.*-separated-tokens|.*entities.*|ccount|rehype*|string-width|strip-ansi|ansi-regex|supports-color)"
],
"transform": {
"\\.m?jsx?$": "esbuild-jest",
"latex.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor-latex.js",
"\\.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor.js",
"^.+\\.tsx?$": "ts-jest"
}
},
"private": true
"transform": {
"\\.m?jsx?$": "esbuild-jest",
"latex.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor-latex.js",
"\\.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor.js",
"^.+\\.tsx?$": "ts-jest"
}
},
"private": true
}
4 changes: 2 additions & 2 deletions packages/test-common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ declare global {
}

expect.extend({
toFormatAs(inStr, outStr, formatter) {
async toFormatAs(inStr, outStr, formatter) {
if (typeof formatter !== "function") {
throw new Error(
"Must pass in a formatting function as the second argument when using `toFormatAs`"
);
}
const formatted = formatter(inStr);
const formatted = await formatter(inStr);

const pass = this.equals(formatted, outStr);

Expand Down
172 changes: 86 additions & 86 deletions packages/unified-latex-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,91 +1,91 @@
{
"name": "@unified-latex/unified-latex-cli",
"version": "1.4.0",
"description": "Command line interface to common unified-latex options",
"main": "dist/index.js",
"type": "module",
"bin": {
"unified-latex": "./unified-latex-cli.mjs"
"name": "@unified-latex/unified-latex-cli",
"version": "1.4.1",
"description": "Command line interface to common unified-latex options",
"main": "dist/index.js",
"type": "module",
"bin": {
"unified-latex": "./unified-latex-cli.mjs"
},
"dependencies": {
"@unified-latex/unified-latex-lint": "^1.4.1",
"@unified-latex/unified-latex-to-hast": "^1.4.1",
"@unified-latex/unified-latex-types": "^1.3.1",
"@unified-latex/unified-latex-util-arguments": "^1.4.0",
"@unified-latex/unified-latex-util-macros": "^1.4.0",
"@unified-latex/unified-latex-util-packages": "^1.4.0",
"@unified-latex/unified-latex-util-parse": "^1.4.1",
"@unified-latex/unified-latex-util-print-raw": "^1.4.0",
"@unified-latex/unified-latex-util-to-string": "^1.4.1",
"camelcase": "^7.0.1",
"chalk": "^5.2.0",
"chokidar": "^3.5.3",
"fault": "^2.0.1",
"hastscript": "^7.2.0",
"json5": "^2.2.3",
"minimist": "^1.2.7",
"prettier": "^2.8.3",
"rehype-stringify": "^9.0.3",
"text-table": "^0.2.0",
"unified": "^10.1.2",
"unified-engine": "^10.1.0"
},
"files": [
"dist/**/*.ts",
"dist/**/*.js",
"dist/**/*.map",
"dist/**/*.json"
],
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"dependencies": {
"@unified-latex/unified-latex-lint": "^1.4.0",
"@unified-latex/unified-latex-to-hast": "^1.4.0",
"@unified-latex/unified-latex-types": "^1.3.1",
"@unified-latex/unified-latex-util-arguments": "^1.4.0",
"@unified-latex/unified-latex-util-macros": "^1.4.0",
"@unified-latex/unified-latex-util-packages": "^1.4.0",
"@unified-latex/unified-latex-util-parse": "^1.4.0",
"@unified-latex/unified-latex-util-print-raw": "^1.4.0",
"@unified-latex/unified-latex-util-to-string": "^1.4.0",
"camelcase": "^7.0.1",
"chalk": "^5.2.0",
"chokidar": "^3.5.3",
"fault": "^2.0.1",
"hastscript": "^7.2.0",
"json5": "^2.2.3",
"minimist": "^1.2.7",
"prettier": "^2.8.3",
"rehype-stringify": "^9.0.3",
"text-table": "^0.2.0",
"unified": "^10.1.2",
"unified-engine": "^10.1.0"
},
"files": [
"dist/**/*.ts",
"dist/**/*.js",
"dist/**/*.map",
"dist/**/*.json"
],
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"./*js": "./dist/*js",
"./*": {
"import": "./dist/*.js",
"require": "./dist/*.cjs"
}
},
"scripts": {
"build": "npm run clean && mkdirp ./dist && npm run compile",
"clean": "rm -rf ./dist && rm -rf tsconfig.tsbuildinfo",
"compile": "tsc -b tsconfig.json & node build.js & wait",
"test": "jest",
"package": "node ../../scripts/make-package.mjs",
"publish": "cd dist && npm publish"
},
"repository": {
"type": "git",
"url": "git+https://github.com/siefkenj/unified-latex.git"
},
"keywords": [
"pegjs",
"latex",
"parser",
"prettier",
"unified-latex",
"unified"
"./*js": "./dist/*js",
"./*": {
"import": "./dist/*.js",
"require": "./dist/*.cjs"
}
},
"scripts": {
"build": "npm run clean && mkdirp ./dist && npm run compile",
"clean": "rm -rf ./dist && rm -rf tsconfig.tsbuildinfo",
"compile": "tsc -b tsconfig.json & node build.js & wait",
"test": "jest",
"package": "node ../../scripts/make-package.mjs",
"publish": "cd dist && npm publish"
},
"repository": {
"type": "git",
"url": "git+https://github.com/siefkenj/unified-latex.git"
},
"keywords": [
"pegjs",
"latex",
"parser",
"prettier",
"unified-latex",
"unified"
],
"author": "Jason Siefken",
"license": "MIT",
"bugs": {
"url": "https://github.com/siefkenj/unified-latex/issues"
},
"homepage": "https://github.com/siefkenj/unified-latex#readme",
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!unified|bail|is-plain-obj|trough|vfile.*|unist.*|hast.*|property-information|html-void-elements|.*-separated-tokens|.*entities.*|ccount|rehype*|string-width|strip-ansi|ansi-regex|supports-color)"
],
"author": "Jason Siefken",
"license": "MIT",
"bugs": {
"url": "https://github.com/siefkenj/unified-latex/issues"
},
"homepage": "https://github.com/siefkenj/unified-latex#readme",
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!unified|bail|is-plain-obj|trough|vfile.*|unist.*|hast.*|property-information|html-void-elements|.*-separated-tokens|.*entities.*|ccount|rehype*|string-width|strip-ansi|ansi-regex|supports-color)"
],
"transform": {
"\\.m?jsx?$": "esbuild-jest",
"latex.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor-latex.js",
"\\.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor.js",
"^.+\\.tsx?$": "ts-jest"
},
"modulePathIgnorePatterns": [
"/dist/"
]
"transform": {
"\\.m?jsx?$": "esbuild-jest",
"latex.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor-latex.js",
"\\.pegjs$": "<rootDir>/../../tests/pegjs-preprocessor.js",
"^.+\\.tsx?$": "ts-jest"
},
"private": true
"modulePathIgnorePatterns": [
"/dist/"
]
},
"private": true
}
Loading

0 comments on commit b1a7e59

Please sign in to comment.