diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index daaa63d87..000000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: Fdawgs diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml deleted file mode 100644 index 7ab4aa678..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: 🐛 Bug Report -description: File a bug report and help us improve -labels: [bug] - -body: - - type: markdown - attributes: - value: | - Thanks for filing a bug report, any help is greatly appreciated! - - - type: checkboxes - id: prerequisites - attributes: - label: Prerequisites - options: - - label: I have written a descriptive issue title - required: true - - label: | - I have searched existing issues to ensure it has not already been reported - required: true - - label: | - I agree to follow the [Code of Conduct](../../CODE_OF_CONDUCT.md) that this project adheres to - required: true - - - type: input - id: version - attributes: - label: API/app/plugin version - placeholder: 1.x.x - - - type: input - id: node-version - attributes: - label: Node.js version - placeholder: 18.x - validations: - required: true - - - type: dropdown - id: os - attributes: - label: Operating system - options: - - Linux - - macOS - - Windows - validations: - required: true - - - type: input - id: os-version - attributes: - label: Operating system version (i.e. 20.04, 11.3, 10) - validations: - required: true - - - type: textarea - id: description - attributes: - label: Description - description: A clear and concise description of what the bug is. - validations: - required: true - - - type: textarea - id: steps-to-reproduce - attributes: - label: Steps to Reproduce - description: | - List of steps, sample code, or a link to code or a project that reproduces the behaviour. - Make sure you place a stack trace inside a [code (```) block](https://docs.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks) to avoid linking unrelated issues. - validations: - required: true - - - type: textarea - id: expected-behaviour - attributes: - label: Expected Behaviour - description: A clear and concise description of what you expected to happen. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml deleted file mode 100644 index 617b490d0..000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: 🚀 Feature Request -description: Submit a proposal for a new feature -labels: [feature] - -body: - - type: markdown - attributes: - value: | - Thanks for making a feature request, new ideas are greatly appreciated! - - - type: checkboxes - id: prerequisites - attributes: - label: Prerequisites - options: - - label: I have written a descriptive title - required: true - - label: | - I have searched existing feature requests to ensure it has not already been proposed - required: true - - label: | - I agree to follow the [Code of Conduct](../../CODE_OF_CONDUCT.md) that this project adheres to - required: true - - - type: textarea - id: description - attributes: - label: Description - description: A clear and concise description of what the feature is, and what it would solve. - validations: - required: true diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md deleted file mode 100644 index 3b0f0f137..000000000 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ /dev/null @@ -1,15 +0,0 @@ - - -#### Checklist - -- [ ] Run `npm test` -- [ ] Documentation has been updated and adheres to the style described in [CONTRIBUTING.md](https://github.com/Fdawgs/docsmith/blob/main/CONTRIBUTING.md#documentation-style) -- [ ] Commit message adheres to the [Conventional commits](https://conventionalcommits.org/en/v1.0.0/) style, following the [@commitlint/config-conventional config](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional) diff --git a/.husky/pre-commit b/.husky/pre-commit index a170e009e..c613291a5 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -npm run lint:prettier && npm run lint:licenses && npm test +npm run lint:licenses && npm test diff --git a/.vscode/settings.json b/.vscode/settings.json index be25d6702..8919b8608 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,6 +8,7 @@ }, "javascript.updateImportsOnFileMove.enabled": "always", "npm.packageManager": "npm", + "prettier.prettierPath": "./node_modules/prettier", "redhat.telemetry.enabled": false, "[xml]": { "editor.defaultFormatter": "redhat.vscode-xml" diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 1ce1f2630..000000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,127 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -- Demonstrating empathy and kindness toward other people -- Being respectful of differing opinions, viewpoints, and experiences -- Giving and gracefully accepting constructive feedback -- Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -- Focusing on what is best not just for us as individuals, but for the overall - community - -Examples of unacceptable behavior include: - -- The use of sexualized language or imagery, and sexual attention or advances of - any kind -- Trolling, insulting or derogatory comments, and personal or political attacks -- Public or private harassment -- Publishing others' private information, such as a physical or email address, - without their explicit permission -- Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leader responsible for enforcement at frazer.dev@outlook.com. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series of -actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or permanent -ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within the -community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.1, available at -[https://contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. - -Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][mozilla coc]. - -For answers to common questions about this code of conduct, see the FAQ at -[https://contributor-covenant.org/faq][faq]. Translations are available at -[https://contributor-covenant.org/translations][translations]. - -[homepage]: https://contributor-covenant.org -[v2.1]: https://contributor-covenant.org/version/2/1/code_of_conduct.html -[mozilla coc]: https://github.com/mozilla/diversity -[faq]: https://contributor-covenant.org/faq -[translations]: https://contributor-covenant.org/translations diff --git a/README.md b/README.md index e91b1a963..33962a3c1 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ The underlying OpenAPI definitions are found at `/docs/openapi`. Contributions are welcome, and any help is greatly appreciated! See [the contributing guide](./CONTRIBUTING.md) for details on how to get started. -Please adhere to this project's [Code of Conduct](./CODE_OF_CONDUCT.md) when contributing. +Please adhere to this project's [Code of Conduct](https://github.com/Fdawgs/.github/blob/main/CODE_OF_CONDUCT.md) when contributing. ## License diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index a4de9d724..000000000 --- a/SECURITY.md +++ /dev/null @@ -1,13 +0,0 @@ -# Security - -## Disclosure policy - -Please email reports about any security-related issues you find to frazer.dev@outlook.com. -Please use a descriptive subject line in your report email, in addition to a reference or link to this repository. -After the initial reply to your report, we will attempt to keep you informed of the progress being made towards a fix. - -In addition, please include the following information along with your report: - -- Your name and affiliation (if any) -- A description of the technical details of the vulnerabilities -- An explanation of who can exploit this vulnerability, and what they gain when doing so diff --git a/jsconfig.json b/jsconfig.json index e1483697c..c9a1ecd67 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -3,11 +3,10 @@ // Uncomment as and when needed // "checkJs": true, // "strict": true, - "lib": ["ES2022"], "module": "NodeNext", "moduleResolution": "NodeNext", "resolveJsonModule": true, - "target": "ES2022" + "target": "ES2022", }, - "exclude": ["dist", "node_modules"] + "exclude": ["dist", "node_modules"], } diff --git a/package-lock.json b/package-lock.json index 79d0ce856..25703bcde 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,6 @@ "clean-css": "^5.3.3", "cssesc": "^3.0.0", "cssom": "^0.5.0", - "dotenv": "^16.3.1", "env-schema": "^5.2.1", "fastify": "^4.25.2", "fastify-disablecache": "^3.1.8", @@ -76,7 +75,7 @@ "nodemon": "^3.0.2", "pino-pretty": "^10.3.1", "playwright": "^1.40.1", - "prettier": "^3.1.1", + "prettier": "^3.2.4", "spdx-copyleft": "^1.0.0" }, "engines": { @@ -9579,9 +9578,9 @@ } }, "node_modules/prettier": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.1.tgz", - "integrity": "sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz", + "integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" diff --git a/package.json b/package.json index 957c929e1..5742261a9 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,10 @@ "description": "RESTful API for converting clinical documents and files", "main": "dist/app.js", "type": "commonjs", - "repository": "git+https://github.com/Fdawgs/docsmith.git", + "repository": { + "type": "git", + "url": "git+https://github.com/Fdawgs/docsmith.git" + }, "homepage": "https://github.com/Fdawgs/docsmith", "bugs": { "url": "https://github.com/Fdawgs/docsmith/issues" @@ -22,6 +25,7 @@ "jest": "jest", "jest:coverage": "jest --coverage", "lint": "eslint . --cache --ext js,jsx --ignore-path .gitignore", + "lint:fix": "npm run lint -- --fix", "lint:licenses": "node scripts/license-checker.js", "lint:lockfile": "lockfile-lint -p package-lock.json -t npm -a npm -s -i", "lint:prettier": "prettier . -c -u", @@ -29,7 +33,7 @@ "prepare": "husky install && npx playwright install firefox --with-deps", "start": "node .", "start:dev": "nodemon src/app.js | pino-pretty", - "test": "npm run lint && npm run jest" + "test": "npm run lint && npm run lint:prettier && npm run jest" }, "commitlint": { "extends": [ @@ -94,7 +98,7 @@ "nodemon": "^3.0.2", "pino-pretty": "^10.3.1", "playwright": "^1.40.1", - "prettier": "^3.1.1", + "prettier": "^3.2.4", "spdx-copyleft": "^1.0.0" }, "dependencies": { @@ -113,7 +117,6 @@ "clean-css": "^5.3.3", "cssesc": "^3.0.0", "cssom": "^0.5.0", - "dotenv": "^16.3.1", "env-schema": "^5.2.1", "fastify": "^4.25.2", "fastify-disablecache": "^3.1.8", diff --git a/scripts/license-checker.js b/scripts/license-checker.js index c974f5fa8..a36cc25e6 100644 --- a/scripts/license-checker.js +++ b/scripts/license-checker.js @@ -57,10 +57,20 @@ async function checkLicenses() { start: joinSafe(__dirname, ".."), }); - const copyLeftLicensesList = Object.keys(licenses).filter((license) => - // @ts-ignore: includes() returns false if undefined is passed - copyLeftLicenses.includes(licenses[license].licenses) - ); + const copyLeftLicensesList = Object.keys(licenses).filter((license) => { + let lic = licenses[license].licenses; + + if (!lic) { + console.error( + `No license found for ${license}. Please check the package.json file.` + ); + process.exit(1); + } + + lic = Array.isArray(lic) ? lic : [lic]; + + return lic.some((l) => copyLeftLicenses.includes(l)); + }); if (copyLeftLicensesList.length > 0) { console.error( diff --git a/src/config/index.js b/src/config/index.js index 9feb094ed..65b3d9a09 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -1,7 +1,5 @@ "use strict"; -require("dotenv").config(); - const { readFile } = require("node:fs/promises"); const envSchema = require("env-schema"); const { getStream } = require("file-stream-rotator");