diff --git a/frontend/package.json b/frontend/package.json index 529231ced..c0ebc019a 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -49,7 +49,7 @@ "@fontsource/source-sans-pro": "5.0.8", "@hedgedoc/commons": "workspace:commons", "@hedgedoc/html-to-react": "workspace:html-to-react", - "@hedgedoc/markdown-it-plugins": "2.1.3", + "@hedgedoc/markdown-it-plugins": "workspace:markdown-it-plugins", "@mrdrogdrog/optional": "1.2.1", "@react-hook/resize-observer": "1.2.6", "@redux-devtools/core": "3.13.1", diff --git a/markdown-it-plugins/.gitignore b/markdown-it-plugins/.gitignore deleted file mode 100644 index 849ddff3b..000000000 --- a/markdown-it-plugins/.gitignore +++ /dev/null @@ -1 +0,0 @@ -dist/ diff --git a/markdown-it-plugins/LICENSE b/markdown-it-plugins/LICENSE deleted file mode 100644 index d16914bf4..000000000 --- a/markdown-it-plugins/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 The HedgeDoc developers (see AUTHORS file) - -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. diff --git a/markdown-it-plugins/package.json b/markdown-it-plugins/package.json index 7f7df479d..8f39953b5 100644 --- a/markdown-it-plugins/package.json +++ b/markdown-it-plugins/package.json @@ -85,11 +85,12 @@ "dist/esm/toc/toc-options.js.map" ], "scripts": { - "test": "../node_modules/.bin/jest", - "build": "build.sh", - "prepublish": "rm -rf ../dist && yarn lint && yarn build && yarn test", - "lint": "../node_modules/.bin/eslint --ext .ts markdown-it-plugins/src", - "lint:fix": "../node_modules/.bin/eslint --fix --ext .ts markdown-it-plugins/src" + "build": "./build.sh", + "test": "jest", + "test:ci": "jest --ci", + "prepublish": "rm -rf dist && yarn lint && yarn build && yarn test", + "lint": "eslint src --ext .ts", + "lint:fix": "eslint --fix --ext .ts src" }, "keywords": [ "markdown", diff --git a/markdown-it-plugins/src/index.ts b/markdown-it-plugins/src/index.ts index b5ca17245..859caa4bc 100644 --- a/markdown-it-plugins/src/index.ts +++ b/markdown-it-plugins/src/index.ts @@ -4,6 +4,6 @@ * SPDX-License-Identifier: MIT */ -export { imageSize } from './image-size' -export { taskLists } from './task-lists' -export * from './toc' +export { imageSize } from './image-size/index.js' +export { taskLists } from './task-lists/index.js' +export * from './toc/index.js' diff --git a/markdown-it-plugins/tsconfig.base.json b/markdown-it-plugins/tsconfig.base.json index 37aa889d9..4eeed81b9 100644 --- a/markdown-it-plugins/tsconfig.base.json +++ b/markdown-it-plugins/tsconfig.base.json @@ -12,11 +12,10 @@ "forceConsistentCasingInFileNames": true, "esModuleInterop": true, "allowJs": true, - "sourceMap": true + "declarationMap":true, + "sourceMap": true, + "typeRoots": ["./types"] }, - "include": [ - "src" - ], - "exclude": [ - "../dist", "**/*.test.ts"] + "include": ["./src", "./types"], + "exclude": ["./dist", "**/*.test.ts"] } diff --git a/markdown-it-plugins/tsconfig.cjs.json b/markdown-it-plugins/tsconfig.cjs.json index c61fc7985..a88d7f768 100644 --- a/markdown-it-plugins/tsconfig.cjs.json +++ b/markdown-it-plugins/tsconfig.cjs.json @@ -3,8 +3,8 @@ "compilerOptions": { "module": "CommonJS", "target": "ES2015", - "outDir": "../dist/cjs", - "declarationDir": "../dist/cjs", + "outDir": "dist/cjs", + "declarationDir": "dist/cjs", "moduleResolution": "node" } } diff --git a/markdown-it-plugins/tsconfig.esm.json b/markdown-it-plugins/tsconfig.esm.json index fabe0d3f4..f8b6287b6 100644 --- a/markdown-it-plugins/tsconfig.esm.json +++ b/markdown-it-plugins/tsconfig.esm.json @@ -3,8 +3,8 @@ "compilerOptions": { "module": "NodeNext", "target" : "esnext", - "outDir": "../dist/esm", + "outDir": "dist/esm", "moduleResolution": "NodeNext", - "declarationDir": "../dist/esm" + "declarationDir": "dist/esm" } } diff --git a/markdown-it-plugins/tsconfig.test.json b/markdown-it-plugins/tsconfig.test.json index 96a9b2511..67bc6edb2 100644 --- a/markdown-it-plugins/tsconfig.test.json +++ b/markdown-it-plugins/tsconfig.test.json @@ -1,6 +1,4 @@ { "extends" : "./tsconfig.esm.json", - "exclude": [ - "../dist" - ] + "exclude": ["./dist"] } diff --git a/package.json b/package.json index d6d692943..af718ca38 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "commons", "dev-reverse-proxy", "docs", - "html-to-react" + "html-to-react", + "markdown-it-plugins" ], "scripts": { "build": "dotenv -- turbo run build", diff --git a/turbo.json b/turbo.json index 09b82da22..59d0ba84d 100644 --- a/turbo.json +++ b/turbo.json @@ -18,6 +18,14 @@ "dist/**" ] }, + "@hedgedoc/markdown-it-plugins#build": { + "dependsOn": [ + "^build" + ], + "outputs": [ + "dist/**" + ] + }, "@hedgedoc/frontend#build": { "dependsOn": [ "^build" diff --git a/yarn.lock b/yarn.lock index b545f22a4..b71e2cf67 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2414,7 +2414,7 @@ __metadata: "@fontsource/source-sans-pro": 5.0.8 "@hedgedoc/commons": "workspace:commons" "@hedgedoc/html-to-react": "workspace:html-to-react" - "@hedgedoc/markdown-it-plugins": 2.1.3 + "@hedgedoc/markdown-it-plugins": "workspace:markdown-it-plugins" "@mrdrogdrog/optional": 1.2.1 "@next/bundle-analyzer": 13.4.19 "@react-hook/resize-observer": 1.2.6 @@ -2563,17 +2563,29 @@ __metadata: languageName: unknown linkType: soft -"@hedgedoc/markdown-it-plugins@npm:2.1.3": - version: 2.1.3 - resolution: "@hedgedoc/markdown-it-plugins@npm:2.1.3" +"@hedgedoc/markdown-it-plugins@workspace:markdown-it-plugins": + version: 0.0.0-use.local + resolution: "@hedgedoc/markdown-it-plugins@workspace:markdown-it-plugins" dependencies: + "@jest/types": 29.6.3 "@mrdrogdrog/optional": ^1.2.1 + "@types/markdown-it": 13.0.0 + "@typescript-eslint/eslint-plugin": 6.4.1 + "@typescript-eslint/parser": 6.4.1 + eslint: 8.48.0 + eslint-config-prettier: 9.0.0 + eslint-plugin-jest: 27.2.3 + eslint-plugin-prettier: 5.0.0 html-entities: ^2.4.0 + jest: 29.6.4 + markdown-it: 13.0.1 + prettier: 3.0.2 + ts-jest: 29.1.1 + typescript: 5.2.2 peerDependencies: markdown-it: ">=12" - checksum: bac43a6c69eaca295f769e4ff35abf273359cf38fc3cae2929c135df3a5cebe5c82f5a0a787033eed8a7746ed98bc5b99a1ab26572272926dc6154293861f860 - languageName: node - linkType: hard + languageName: unknown + linkType: soft "@hpcc-js/wasm@npm:2.13.1": version: 2.13.1