From 4c5b260231678fe83a6abdb902a6266fa49983b9 Mon Sep 17 00:00:00 2001 From: Florian Sihler Date: Thu, 14 Sep 2023 13:46:54 +0200 Subject: [PATCH] clean up the root directory (#293) * refactor: move dockerfile to scripts * refactor: move `.nycrc` configuration to `package.json` * refactor: move `typedoc.json` to the `package.json` * refactor: move the `.eslintrc.json` to the `package.json` * fix: remove comment in package.json * refactor: ci should not trigger on `synchronize` as it does already on push --- .eslintrc.json | 108 -------------- .github/workflows/check-broken-links.yaml | 2 +- .github/workflows/deploy-docker.yaml | 2 +- .nycrc | 10 -- package.json | 166 +++++++++++++++++++++- Dockerfile => scripts/Dockerfile | 4 +- typedoc.json | 47 ------ 7 files changed, 169 insertions(+), 170 deletions(-) delete mode 100644 .eslintrc.json delete mode 100644 .nycrc rename Dockerfile => scripts/Dockerfile (90%) delete mode 100644 typedoc.json diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 365c3f4f2d..0000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "root": true, - "env": { - "browser": false, - "node": true, - "es2022": true - }, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", - "plugin:@typescript-eslint/strict", - "plugin:@typescript-eslint/recommended" - ], - "overrides": [], - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module", - "project": "./tsconfig.json" - }, - "parser": "@typescript-eslint/parser", - "plugins": [ - "@typescript-eslint", - "eslint-plugin-tsdoc" - ], - "rules": { - "indent": "off", - "@typescript-eslint/indent": [ - "error", - "tab", - { - "FunctionDeclaration": { - "parameters": "first" - }, - "ObjectExpression": 1, - "SwitchCase": 1 - } - ], - "no-mixed-spaces-and-tabs": ["error", "smart-tabs"], - // refer to https://github.com/Code-Inspect/flowr/issues/238 for more information: use issues! - "no-warning-comments": ["error", { - "terms": ["todo", "fixme", "xxx"], - "location": "anywhere" - }], - "@typescript-eslint/non-nullable-type-assertion-style": "off", - "@typescript-eslint/no-unsafe-enum-comparison": "off", - "@typescript-eslint/key-spacing": [ - "error", - { - "align": "value" - } - ], - "semi": [ - "error", - "never" - ], - "space-before-function-paren": [ - "error", - "never" - ], - "keyword-spacing": "off", - "@typescript-eslint/keyword-spacing": [ - "error", - { - "before": true, - "after": true, - "overrides": { - "if": { - "after": false - }, - "for": { - "after": false - }, - "while": { - "after": false - }, - "do": { - "after": false - }, - "catch": { - "after": false - }, - "switch": { - "after": false - }, - "default": { - "after": false - }, - "throw": { - "after": false - } - } - } - ], - "@typescript-eslint/space-before-function-paren": [ - "error", - "never" - ], - "@typescript-eslint/no-unused-vars": [ - "error", - { - "argsIgnorePattern": "^_", - "destructuredArrayIgnorePattern": "^_", - "varsIgnorePattern": "^_" - } - ], - "tsdoc/syntax": "error" - } -} diff --git a/.github/workflows/check-broken-links.yaml b/.github/workflows/check-broken-links.yaml index 4130a902b2..0b24ee0f95 100644 --- a/.github/workflows/check-broken-links.yaml +++ b/.github/workflows/check-broken-links.yaml @@ -6,7 +6,7 @@ name: check for broken links - '**/*.md' - 'wiki/**' pull_request: - types: [ opened, synchronize ] + types: [ opened ] branches: [ main ] workflow_dispatch: schedule: diff --git a/.github/workflows/deploy-docker.yaml b/.github/workflows/deploy-docker.yaml index 1b97152d9d..9c8552a6f4 100644 --- a/.github/workflows/deploy-docker.yaml +++ b/.github/workflows/deploy-docker.yaml @@ -21,7 +21,7 @@ jobs: - name: Build the image run: | - docker build -t flowr -f Dockerfile . + docker build -t flowr -f scripts/Dockerfile . - name: Test that the image works timeout-minutes: 5 diff --git a/.nycrc b/.nycrc deleted file mode 100644 index 74f4a4dd45..0000000000 --- a/.nycrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "all": true, - "per-file": true, - "check-coverage": false, - "skip-full": false, - "lines": 70, - "extension": [".ts"], - "include": "src/**/*.ts", - "reporter": ["html", "text", "lcov", "cobertura"] -} diff --git a/package.json b/package.json index b339b5b414..df8ae2f1ec 100644 --- a/package.json +++ b/package.json @@ -13,13 +13,177 @@ "export-quads": "ts-node src/cli/export-quads-app.ts", "build": "tsc --project .", "lint": "eslint src/ test/", - "doc": "typedoc --options typedoc.json", + "doc": "typedoc", "test": "nyc --no-clean mocha --require ts-node/register --timeout 10000 \"test/**/*.spec.ts\"", "test-full": "npm run test -- --test-installation" }, "keywords": [], "author": "Florian Sihler", "license": "ISC", + "nyc": { + "all": true, + "per-file": true, + "check-coverage": false, + "skip-full": false, + "lines": 70, + "extension": [".ts"], + "include": "src/**/*.ts", + "reporter": ["html", "text", "lcov", "cobertura"] + }, + "typedocOptions": { + "includeVersion": true, + "plugin": [ + "typedoc-umlclass", + "typedoc-plugin-missing-exports", + "typedoc-theme-hierarchy" + ], + "entryPoints": [ + "src", + "test/helper" + ], + "entryPointStrategy": "expand", + "exclude": [ + "**/node_modules/**/*" + ], + "theme": "hierarchy", + "out": "doc", + "readme": "README.md", + "umlClassDiagram": { + "type": "detailed", + "location": "embed", + "format": "svg", + "position": "below", + "legendType": "none", + "hideEmptyMembers": false, + "generatorProcessCount": 4 + }, + "lightHighlightTheme": "light-plus", + "darkHighlightTheme": "dark-plus", + "hideGenerator": false, + "searchInComments": true, + "useTsLinkResolution": true, + "categorizeByGroup": true, + "sort": [ "static-first", "alphabetical" ], + "visibilityFilters": { + "protected": true, + "private": true, + "inherited": true, + "external": true + }, + "validation": { + "notExported": true, + "invalidLink": true, + "notDocumented": true + }, + "treatValidationWarningsAsErrors": false + }, + "eslintConfig": { + "root": true, + "env": { + "browser": false, + "node": true, + "es2022": true + }, + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + "plugin:@typescript-eslint/strict", + "plugin:@typescript-eslint/recommended" + ], + "overrides": [], + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module", + "project": "./tsconfig.json" + }, + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint", + "eslint-plugin-tsdoc" + ], + "rules": { + "indent": "off", + "@typescript-eslint/indent": [ + "error", + "tab", + { + "FunctionDeclaration": { + "parameters": "first" + }, + "ObjectExpression": 1, + "SwitchCase": 1 + } + ], + "no-mixed-spaces-and-tabs": ["error", "smart-tabs"], + "no-warning-comments": ["error", { + "terms": ["todo", "fixme", "xxx"], + "location": "anywhere" + }], + "@typescript-eslint/non-nullable-type-assertion-style": "off", + "@typescript-eslint/no-unsafe-enum-comparison": "off", + "@typescript-eslint/key-spacing": [ + "error", + { + "align": "value" + } + ], + "semi": [ + "error", + "never" + ], + "space-before-function-paren": [ + "error", + "never" + ], + "keyword-spacing": "off", + "@typescript-eslint/keyword-spacing": [ + "error", + { + "before": true, + "after": true, + "overrides": { + "if": { + "after": false + }, + "for": { + "after": false + }, + "while": { + "after": false + }, + "do": { + "after": false + }, + "catch": { + "after": false + }, + "switch": { + "after": false + }, + "default": { + "after": false + }, + "throw": { + "after": false + } + } + } + ], + "@typescript-eslint/space-before-function-paren": [ + "error", + "never" + ], + "@typescript-eslint/no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_", + "destructuredArrayIgnorePattern": "^_", + "varsIgnorePattern": "^_" + } + ], + "tsdoc/syntax": "error" + } + }, "devDependencies": { "@types/chai": "^4.3.5", "@types/chai-as-promised": "^7.1.5", diff --git a/Dockerfile b/scripts/Dockerfile similarity index 90% rename from Dockerfile rename to scripts/Dockerfile index 45bc60876b..6684baf8b7 100644 --- a/Dockerfile +++ b/scripts/Dockerfile @@ -4,7 +4,7 @@ FROM node:20 AS builder WORKDIR /app -COPY ./src/ /app/src/ +COPY ../src /app/src/ COPY ./package*.json ./tsconfig.json /app/ RUN npm install @@ -20,7 +20,7 @@ WORKDIR /app RUN apk add --no-cache R # we keep the package.json for module resolution -COPY package.json LICENSE /app/ +COPY ../package.json LICENSE /app/ RUN npm install --only=production COPY --from=builder /app/dist/src /app/dist diff --git a/typedoc.json b/typedoc.json deleted file mode 100644 index 330dce9e39..0000000000 --- a/typedoc.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "includeVersion": true, - "plugin": [ - "typedoc-umlclass", - "typedoc-plugin-missing-exports", - "typedoc-theme-hierarchy" - ], - "entryPoints": [ - "src", - "test/helper" - ], - "entryPointStrategy": "expand", - "exclude": [ - "**/node_modules/**/*" - ], - "theme": "hierarchy", - "out": "doc", - "readme": "README.md", - "umlClassDiagram": { - "type": "detailed", - "location": "embed", - "format": "svg", - "position": "below", - "legendType": "none", - "hideEmptyMembers": false, - "generatorProcessCount": 4 - }, - "lightHighlightTheme": "light-plus", - "darkHighlightTheme": "dark-plus", - "hideGenerator": false, - "searchInComments": true, - "useTsLinkResolution": true, - "categorizeByGroup": true, - "sort": [ "static-first", "alphabetical" ], - "visibilityFilters": { - "protected": true, - "private": true, - "inherited": true, - "external": true - }, - "validation": { - "notExported": true, - "invalidLink": true, - "notDocumented": true - }, - "treatValidationWarningsAsErrors": false -}