diff --git a/.gitignore b/.gitignore index 859af7e00185..ce45005c9bec 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,5 @@ apps/web/static/files/noto-* apps/web/cypress/screenshots/**/__tkey-*.png .vim apps/librelingo_tools/dist +**/dist/ +*.tsbuildinfo diff --git a/.semaphore/pipeline_3.yml b/.semaphore/pipeline_3.yml index e94ac7aa78bd..a5003094d211 100644 --- a/.semaphore/pipeline_3.yml +++ b/.semaphore/pipeline_3.yml @@ -16,7 +16,8 @@ blocks: - cache restore packages-web-$(checksum yarn.lock) - git config --global user.email "gitlab@daniel-kantor.com" - git config --global user.name "Dániel Kántor" - - yarn workspaces run semantic-release -e semantic-release-monorepo + - yarn workspace @librelingo/answer-corrector build + - yarn workspace @librelingo/answer-corrector semantic-release -e semantic-release-monorepo secrets: - name: NPM token - name: GitHub token diff --git a/apps/answer-corrector/package.json b/apps/answer-corrector/package.json index adac37698984..6b36805dd382 100644 --- a/apps/answer-corrector/package.json +++ b/apps/answer-corrector/package.json @@ -3,12 +3,15 @@ "private": false, "version": "1.0.0", "main": "index.js", - "license": "GPLv3", + "license": "AGPL-3.0-or-later", + "scripts": { + "build": "tsc --build" + }, "dependencies": { "js-levenshtein": "1.1.6" }, "devDependencies": { - "@types/jest": "26.0.20", + "@types/jest": "^26.0.20", "@types/js-levenshtein": "1.1.0" } } diff --git a/apps/answer-corrector/index.test.ts b/apps/answer-corrector/src/index.test.ts similarity index 100% rename from apps/answer-corrector/index.test.ts rename to apps/answer-corrector/src/index.test.ts diff --git a/apps/answer-corrector/index.ts b/apps/answer-corrector/src/index.ts similarity index 100% rename from apps/answer-corrector/index.ts rename to apps/answer-corrector/src/index.ts diff --git a/apps/answer-corrector/tsconfig.json b/apps/answer-corrector/tsconfig.json new file mode 100644 index 000000000000..e0d895c692c3 --- /dev/null +++ b/apps/answer-corrector/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "composite": true, + "outDir": "dist", + "rootDir": "src", + "esModuleInterop": true, + "skipLibCheck": true + }, + "include": [ + "src/index.ts" + ], + "exclude": [ + "node_modules", + "build" + ] +} diff --git a/apps/lluis/package.json b/apps/lluis/package.json index bf7729071bb2..fdec621d01f9 100644 --- a/apps/lluis/package.json +++ b/apps/lluis/package.json @@ -4,7 +4,8 @@ "version": "0.0.0", "scripts": { "eslintfix": "exit 0", - "prettierfix": "exit 0" + "prettierfix": "exit 0", + "build": "exit 0" }, "dependencies": { "bulma": "0.9.1" diff --git a/apps/web/src/components/ShortInputChallenge.svelte b/apps/web/src/components/ShortInputChallenge.svelte index 8020d38ed570..e821a9863419 100644 --- a/apps/web/src/components/ShortInputChallenge.svelte +++ b/apps/web/src/components/ShortInputChallenge.svelte @@ -7,7 +7,7 @@ import InputFieldWithVirtualKeyboard from "./InputFieldWithVirtualKeyboard" import Column from "lluis/Column" import Columns from "lluis/Columns" - import evaluateAnswer from "@librelingo/answer-corrector" + import evaluateAnswer from "@librelingo/answer-corrector/src/index.ts" export let challenge export let registerResult diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json new file mode 100644 index 000000000000..0fa4f01e6fd1 --- /dev/null +++ b/apps/web/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src" + ], + "references": [ + { + "path": "../answer-corrector" + } + ] +} diff --git a/yarn.lock b/yarn.lock index bc7aa454c0d9..b0f0a25b58b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2005,14 +2005,6 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@26.0.20": - version "26.0.20" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.20.tgz#cd2f2702ecf69e86b586e1f5223a60e454056307" - integrity sha512-9zi2Y+5USJRxd0FsahERhBwlcvFh6D2GLQnY2FH2BzK8J9s9omvNHIbvABwIluXa0fD8XVKMLTO0aOEuUfACAA== - dependencies: - jest-diff "^26.0.0" - pretty-format "^26.0.0" - "@types/jest@26.x": version "26.0.14" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.14.tgz#078695f8f65cb55c5a98450d65083b2b73e5a3f3" @@ -2021,6 +2013,14 @@ jest-diff "^25.2.1" pretty-format "^25.2.1" +"@types/jest@^26.0.20": + version "26.0.20" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.20.tgz#cd2f2702ecf69e86b586e1f5223a60e454056307" + integrity sha512-9zi2Y+5USJRxd0FsahERhBwlcvFh6D2GLQnY2FH2BzK8J9s9omvNHIbvABwIluXa0fD8XVKMLTO0aOEuUfACAA== + dependencies: + jest-diff "^26.0.0" + pretty-format "^26.0.0" + "@types/jquery@*": version "3.5.5" resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.5.5.tgz#2c63f47c9c8d96693d272f5453602afd8338c903"