From c7001e62f34b7e0592a7d143f51e9266e03ddc57 Mon Sep 17 00:00:00 2001 From: Adithya Krishna Date: Mon, 28 Aug 2023 00:51:35 +0530 Subject: [PATCH 01/17] fix: removed unnecessary whitespace Signed-off-by: Adithya Krishna --- packages/ui/primitives/card.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/primitives/card.tsx b/packages/ui/primitives/card.tsx index 5144c4dfa..90619d2bf 100644 --- a/packages/ui/primitives/card.tsx +++ b/packages/ui/primitives/card.tsx @@ -110,7 +110,7 @@ CardContent.displayName = 'CardContent'; const CardFooter = React.forwardRef>( ({ className, ...props }, ref) => ( -
+
), ); From c817c67a1c6df2f56e91ad6aac0c289411178509 Mon Sep 17 00:00:00 2001 From: Adithya Krishna Date: Mon, 28 Aug 2023 00:56:15 +0530 Subject: [PATCH 02/17] fix: removed more unnecessary whitespace Signed-off-by: Adithya Krishna --- apps/web/src/components/(dashboard)/layout/desktop-nav.tsx | 2 +- packages/ui/primitives/navigation-menu.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/(dashboard)/layout/desktop-nav.tsx b/apps/web/src/components/(dashboard)/layout/desktop-nav.tsx index 9b64baf58..f07d2baf4 100644 --- a/apps/web/src/components/(dashboard)/layout/desktop-nav.tsx +++ b/apps/web/src/components/(dashboard)/layout/desktop-nav.tsx @@ -13,7 +13,7 @@ export const DesktopNav = ({ className, ...props }: DesktopNavProps) => { {/* Date: Mon, 28 Aug 2023 08:14:21 +0530 Subject: [PATCH 03/17] fix: duplicate import Signed-off-by: Adithya Krishna --- apps/web/src/pages/api/document/create.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/web/src/pages/api/document/create.ts b/apps/web/src/pages/api/document/create.ts index d6a3b4524..b2042315f 100644 --- a/apps/web/src/pages/api/document/create.ts +++ b/apps/web/src/pages/api/document/create.ts @@ -1,7 +1,6 @@ import { NextApiRequest, NextApiResponse } from 'next'; -import formidable from 'formidable'; -import { type File } from 'formidable'; +import formidable, { type File } from 'formidable'; import { readFileSync } from 'fs'; import { getServerSession } from '@documenso/lib/next-auth/get-server-session'; From 090752c539f3f803e12d4622afb9a7881d168daa Mon Sep 17 00:00:00 2001 From: Adithya Krishna Date: Mon, 28 Aug 2023 08:14:42 +0530 Subject: [PATCH 04/17] feat: added new eslint rules Signed-off-by: Adithya Krishna --- .eslintrc.cjs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 8113ada52..3d19691e5 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,9 +1,28 @@ /** @type {import('eslint').Linter.Config} */ module.exports = { root: true, - extends: ['@documenso/eslint-config'], + extends: [ + '@documenso/eslint-config', + 'plugin:package-json/recommended', + 'plugin:import/recommended', + ], + plugins: ['package-json', 'import', 'simple-import-sort'], rules: { '@next/next/no-img-element': 'off', + 'no-multi-spaces': [ + 'error', + { + ignoreEOLComments: false, + exceptions: { + BinaryExpression: false, + VariableDeclarator: false, + ImportDeclaration: false, + Property: false, + }, + }, + ], + 'import/named': 'off', + 'no-duplicate-imports': 'error', }, settings: { next: { From 829122c486baed19b7d8ff37457365efa94aefeb Mon Sep 17 00:00:00 2001 From: Adithya Krishna Date: Mon, 28 Aug 2023 08:15:12 +0530 Subject: [PATCH 05/17] feat: added eslint plugin dependencies Signed-off-by: Adithya Krishna --- package-lock.json | 133 +++++++++++++++++++++++----- packages/eslint-config/package.json | 7 +- 2 files changed, 115 insertions(+), 25 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8f3b7d79f..8be47592a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6807,6 +6807,31 @@ "resolved": "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz", "integrity": "sha512-c68LpLbO+7kP/b1Hr1qs8/BJ09F5khZGTxqxZuhzxpmwJKOgRFHJWIb9/KmqnqHhLdO55aOxFH/EGBvUQbL/RQ==" }, + "node_modules/disparity": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/disparity/-/disparity-3.2.0.tgz", + "integrity": "sha512-8cl9ouncFYE7OQsYwJNiy2e15S0xN80X1Jj/N/YkoiM+VGWSyg1YzPToecKyYx2DQiJapt5IC8yi43GW23TUHQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.2.1", + "diff": "^4.0.2" + }, + "bin": { + "disparity": "bin/disparity" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/disparity/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/dlv": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", @@ -7591,9 +7616,9 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.28.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.28.0.tgz", - "integrity": "sha512-B8s/n+ZluN7sxj9eUf7/pRFERX0r5bnFA2dCaLHy2ZeaQEAz0k+ZZkFWRFHJAqxfxQDx6KLv9LeIki7cFdwW+Q==", + "version": "2.28.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.28.1.tgz", + "integrity": "sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A==", "dependencies": { "array-includes": "^3.1.6", "array.prototype.findlastindex": "^1.2.2", @@ -7604,13 +7629,12 @@ "eslint-import-resolver-node": "^0.3.7", "eslint-module-utils": "^2.8.0", "has": "^1.0.3", - "is-core-module": "^2.12.1", + "is-core-module": "^2.13.0", "is-glob": "^4.0.3", "minimatch": "^3.1.2", "object.fromentries": "^2.0.6", "object.groupby": "^1.0.0", "object.values": "^1.1.6", - "resolve": "^1.22.3", "semver": "^6.3.1", "tsconfig-paths": "^3.14.2" }, @@ -7640,22 +7664,6 @@ "node": ">=0.10.0" } }, - "node_modules/eslint-plugin-import/node_modules/resolve": { - "version": "1.22.3", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.3.tgz", - "integrity": "sha512-P8ur/gp/AmbEzjr729bZnLjXK5Z+4P0zhIJgBgzqRih7hL7BOukHGtSTA3ACMY467GRFz3duQsi0bDZdR7DKdw==", - "dependencies": { - "is-core-module": "^2.12.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/eslint-plugin-import/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -7701,6 +7709,23 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-package-json": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-package-json/-/eslint-plugin-package-json-0.1.4.tgz", + "integrity": "sha512-qdb9LUBFR3tM9OZM1AaYCkxoZnRx7PX2xqvLm49D0JbUu+EkbDur9ug+tCS2xlA1Lbt12Wff5qES81ttc/VBdg==", + "dev": true, + "dependencies": { + "disparity": "^3.0.0", + "package-json-validator": "^0.6.3", + "requireindex": "^1.2.0" + }, + "engines": { + "node": ">=8.0.0" + }, + "peerDependencies": { + "eslint": ">=4.7.0" + } + }, "node_modules/eslint-plugin-prettier": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", @@ -7795,6 +7820,15 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-simple-import-sort": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-10.0.0.tgz", + "integrity": "sha512-AeTvO9UCMSNzIHRkg8S6c3RPy5YEwKWSQPx3DYghLedo2ZQxowPFLGDN1AZ2evfg6r6mjBSZSLxLFsWSu3acsw==", + "dev": true, + "peerDependencies": { + "eslint": ">=5.0.0" + } + }, "node_modules/eslint-plugin-turbo": { "version": "1.10.12", "resolved": "https://registry.npmjs.org/eslint-plugin-turbo/-/eslint-plugin-turbo-1.10.12.tgz", @@ -9345,9 +9379,9 @@ } }, "node_modules/is-core-module": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", - "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", "dependencies": { "has": "^1.0.3" }, @@ -12115,6 +12149,22 @@ "url": "https://github.com/sponsors/panva" } }, + "node_modules/optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha512-snN4O4TkigujZphWLN0E//nQmm7790RYaE53DdL7ZYwee2D8DDo9/EyYiKUfN3rneWUjhJnueija3G9I2i0h3g==", + "dev": true, + "dependencies": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + } + }, + "node_modules/optimist/node_modules/minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha512-iotkTvxc+TwOm5Ieim8VnSNvCDjCK9S8G3scJ50ZthspSxa7jx50jkhYduuAtAjvfDUwSgOwf8+If99AlOEhyw==", + "dev": true + }, "node_modules/optionator": { "version": "0.9.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", @@ -12168,6 +12218,18 @@ "node": ">=6" } }, + "node_modules/package-json-validator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/package-json-validator/-/package-json-validator-0.6.3.tgz", + "integrity": "sha512-juKiFboV4UKUvWQ+OSxstnyukhuluyuEoFmgZw1Rx21XzmwlgDWLcbl3qzjA3789IRORYhVFs7cmAO0YFGwHCg==", + "dev": true, + "dependencies": { + "optimist": "~0.6.0" + }, + "bin": { + "pjv": "bin/pjv" + } + }, "node_modules/pako": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", @@ -13715,6 +13777,15 @@ "node": ">=0.10.0" } }, + "node_modules/requireindex": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz", + "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==", + "dev": true, + "engines": { + "node": ">=0.10.5" + } + }, "node_modules/resolve": { "version": "1.22.2", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", @@ -16203,6 +16274,15 @@ "string-width": "^1.0.2 || 2 || 3 || 4" } }, + "node_modules/wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha512-1tMA907+V4QmxV7dbRvb4/8MaRALK6q9Abid3ndMYnbyo8piisCmeONVqVSXqQA3KaP4SLt5b7ud6E2sqP8TFw==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -16345,6 +16425,11 @@ "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.32.2", "typescript": "^5.1.6" + }, + "devDependencies": { + "eslint-plugin-import": "^2.28.1", + "eslint-plugin-package-json": "^0.1.4", + "eslint-plugin-simple-import-sort": "^10.0.0" } }, "packages/eslint-config/node_modules/@eslint/eslintrc": { diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index a34230ee1..319af96e0 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -9,9 +9,14 @@ "eslint": "^8.40.0", "eslint-config-next": "13.4.12", "eslint-config-prettier": "^8.8.0", + "eslint-config-turbo": "^1.9.3", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.32.2", - "eslint-config-turbo": "^1.9.3", "typescript": "^5.1.6" + }, + "devDependencies": { + "eslint-plugin-import": "^2.28.1", + "eslint-plugin-package-json": "^0.1.4", + "eslint-plugin-simple-import-sort": "^10.0.0" } } From aad52a3e2e3fb96b315e4898b9c2821383d7e98a Mon Sep 17 00:00:00 2001 From: Adithya Krishna Date: Mon, 28 Aug 2023 08:37:59 +0530 Subject: [PATCH 06/17] fix: updated eslint config Signed-off-by: Adithya Krishna --- .eslintrc.cjs | 21 +-------------------- packages/eslint-config/index.cjs | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 3d19691e5..8113ada52 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,28 +1,9 @@ /** @type {import('eslint').Linter.Config} */ module.exports = { root: true, - extends: [ - '@documenso/eslint-config', - 'plugin:package-json/recommended', - 'plugin:import/recommended', - ], - plugins: ['package-json', 'import', 'simple-import-sort'], + extends: ['@documenso/eslint-config'], rules: { '@next/next/no-img-element': 'off', - 'no-multi-spaces': [ - 'error', - { - ignoreEOLComments: false, - exceptions: { - BinaryExpression: false, - VariableDeclarator: false, - ImportDeclaration: false, - Property: false, - }, - }, - ], - 'import/named': 'off', - 'no-duplicate-imports': 'error', }, settings: { next: { diff --git a/packages/eslint-config/index.cjs b/packages/eslint-config/index.cjs index 9386fc7cb..60c58f89f 100644 --- a/packages/eslint-config/index.cjs +++ b/packages/eslint-config/index.cjs @@ -6,9 +6,11 @@ module.exports = { 'eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', + 'plugin:package-json/recommended', + 'plugin:import/recommended', ], - plugins: ['prettier'], + plugins: ['prettier', 'package-json', 'import', 'simple-import-sort'], env: { node: true, @@ -38,5 +40,21 @@ module.exports = { // To handle this we want this rule to catch usages and highlight them as // warnings so we can write appropriate interfaces and guards later. '@typescript-eslint/consistent-type-assertions': ['warn', { assertionStyle: 'never' }], + 'no-multi-spaces': [ + 'error', + { + ignoreEOLComments: false, + exceptions: { + BinaryExpression: false, + VariableDeclarator: false, + ImportDeclaration: false, + Property: false, + }, + }, + ], + 'import/named': 'error', + 'import/no-named-as-default': 'off', + 'import/namespace': 'off', + 'no-duplicate-imports': 'error', }, }; From e8336ae9b40952b003d065a2d47a7896e2fd769b Mon Sep 17 00:00:00 2001 From: Adithya Krishna Date: Mon, 28 Aug 2023 12:32:20 +0530 Subject: [PATCH 07/17] chore: removed eslint-plugin-import Signed-off-by: Adithya Krishna --- package-lock.json | 497 +++++++++++++++------------- packages/eslint-config/index.cjs | 6 +- packages/eslint-config/package.json | 1 - 3 files changed, 259 insertions(+), 245 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8be47592a..d8b1c5263 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "packages/*" ], "dependencies": { + "@prisma/client": "^5.0.0", "recharts": "^2.7.2" }, "devDependencies": { @@ -17,7 +18,7 @@ "@commitlint/config-conventional": "^17.7.0", "dotenv": "^16.0.3", "dotenv-cli": "^7.2.1", - "eslint": "^7.32.0", + "eslint": "^8.48.0", "eslint-config-custom": "*", "husky": "^8.0.0", "lint-staged": "^14.0.0", @@ -1553,36 +1554,47 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", "dependencies": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/@eslint/eslintrc/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "engines": { - "node": ">= 4" + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, "node_modules/@eslint/js": { - "version": "8.46.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.46.0.tgz", - "integrity": "sha512-a8TLtmPi8xzPkCbp/OGFUo5yhRkHM2Ko9kOWP4znJr0WAhWyThaw3PnwX4vOTWOAMsV2uRt32PPDcEz63esSaA==", + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.48.0.tgz", + "integrity": "sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw==", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } @@ -1665,13 +1677,13 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", + "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", "dependencies": { - "@humanwhocodes/object-schema": "^1.2.0", + "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", - "minimatch": "^3.0.4" + "minimatch": "^3.0.5" }, "engines": { "node": ">=10.10.0" @@ -7207,56 +7219,53 @@ } }, "node_modules/eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", + "version": "8.48.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.48.0.tgz", + "integrity": "sha512-sb6DLeIuRXxeM1YljSe1KEx9/YYeZFQWcV8Rq9HfigmdDEugjLEVEa1ozDjL6YDjBpQHPJxJzze+alxi4T3OLg==", "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "8.48.0", + "@humanwhocodes/config-array": "^0.11.10", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "enquirer": "^2.3.5", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -7901,41 +7910,84 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "node_modules/eslint/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, "engines": { - "node": ">=10" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "engines": { - "node": ">= 4" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, "node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "node_modules/espree/node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "bin": { + "acorn": "bin/acorn" + }, "engines": { - "node": ">=4" + "node": ">=0.4.0" } }, "node_modules/esprima": { @@ -16089,9 +16141,9 @@ } }, "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==" + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", + "integrity": "sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==" }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", @@ -16427,168 +16479,10 @@ "typescript": "^5.1.6" }, "devDependencies": { - "eslint-plugin-import": "^2.28.1", "eslint-plugin-package-json": "^0.1.4", "eslint-plugin-simple-import-sort": "^10.0.0" } }, - "packages/eslint-config/node_modules/@eslint/eslintrc": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.1.tgz", - "integrity": "sha512-9t7ZA7NGGK8ckelF0PQCfcxIUzs1Md5rrO6U/c+FIQNanea5UZC0wqKXH4vHBccmu4ZJgZ2idtPeW7+Q2npOEA==", - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "packages/eslint-config/node_modules/@humanwhocodes/config-array": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", - "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "packages/eslint-config/node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "packages/eslint-config/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, - "packages/eslint-config/node_modules/eslint": { - "version": "8.46.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.46.0.tgz", - "integrity": "sha512-cIO74PvbW0qU8e0mIvk5IV3ToWdCq5FYG6gWPHHkx6gNdjlbAYvtfHmlCMXxjcoVaIdwy/IAt3+mDkZkfvb2Dg==", - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.1", - "@eslint/js": "^8.46.0", - "@humanwhocodes/config-array": "^0.11.10", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.2", - "espree": "^9.6.1", - "esquery": "^1.4.2", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "packages/eslint-config/node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "packages/eslint-config/node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", - "dependencies": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "packages/eslint-config/node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "packages/eslint-config/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "packages/lib": { "name": "@documenso/lib", "version": "1.0.0", @@ -16655,6 +16549,131 @@ "@tailwindcss/typography": "^0.5.9" } }, + "packages/tailwind-config/node_modules/@eslint/eslintrc": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "packages/tailwind-config/node_modules/@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "packages/tailwind-config/node_modules/eslint": { + "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", + "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", + "dependencies": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.9", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "packages/tailwind-config/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "engines": { + "node": ">=10" + } + }, + "packages/tailwind-config/node_modules/espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dependencies": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "packages/tailwind-config/node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "engines": { + "node": ">=4" + } + }, + "packages/tailwind-config/node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "engines": { + "node": ">= 4" + } + }, "packages/trpc": { "name": "@documenso/trpc", "version": "1.0.0", diff --git a/packages/eslint-config/index.cjs b/packages/eslint-config/index.cjs index 60c58f89f..eb2054c73 100644 --- a/packages/eslint-config/index.cjs +++ b/packages/eslint-config/index.cjs @@ -7,10 +7,9 @@ module.exports = { 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', 'plugin:package-json/recommended', - 'plugin:import/recommended', ], - plugins: ['prettier', 'package-json', 'import', 'simple-import-sort'], + plugins: ['prettier', 'package-json', 'simple-import-sort'], env: { node: true, @@ -52,9 +51,6 @@ module.exports = { }, }, ], - 'import/named': 'error', - 'import/no-named-as-default': 'off', - 'import/namespace': 'off', 'no-duplicate-imports': 'error', }, }; diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 319af96e0..a14ea56e2 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -15,7 +15,6 @@ "typescript": "^5.1.6" }, "devDependencies": { - "eslint-plugin-import": "^2.28.1", "eslint-plugin-package-json": "^0.1.4", "eslint-plugin-simple-import-sort": "^10.0.0" } From 0abd3da7fd52e54128541abcc9270fc9e7c60c3d Mon Sep 17 00:00:00 2001 From: Mythie Date: Wed, 30 Aug 2023 12:35:43 +1000 Subject: [PATCH 08/17] fix: update eslint rules --- package-lock.json | 303 ++------------------- package.json | 2 +- packages/eslint-config/index.cjs | 29 +- packages/eslint-config/package.json | 5 +- packages/prisma/tsconfig.json | 5 + packages/tailwind-config/package.json | 1 - packages/trpc/server/auth-router/schema.ts | 1 - 7 files changed, 41 insertions(+), 305 deletions(-) create mode 100644 packages/prisma/tsconfig.json diff --git a/package-lock.json b/package-lock.json index b2363a8c1..c6c404669 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,15 @@ { - "name": "documenso.next", + "name": "@documenso/root", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "documenso.next", + "name": "@documenso/root", "workspaces": [ "apps/*", "packages/*" ], "dependencies": { - "@prisma/client": "^5.0.0", "recharts": "^2.7.2" }, "devDependencies": { @@ -18,7 +17,7 @@ "@commitlint/config-conventional": "^17.7.0", "dotenv": "^16.0.3", "dotenv-cli": "^7.2.1", - "eslint": "^8.48.0", + "eslint": "^8.40.0", "eslint-config-custom": "*", "husky": "^8.0.0", "lint-staged": "^14.0.0", @@ -136,6 +135,7 @@ "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, "dependencies": { "@babel/highlight": "^7.10.4" } @@ -1679,9 +1679,9 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", - "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", + "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", @@ -4862,6 +4862,9 @@ "version": "4.1.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "optional": true, + "peer": true, "engines": { "node": ">=6" } @@ -5132,14 +5135,6 @@ "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", "integrity": "sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==" }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "engines": { - "node": ">=8" - } - }, "node_modules/astring": { "version": "1.8.6", "resolved": "https://registry.npmjs.org/astring/-/astring-1.8.6.tgz", @@ -6825,7 +6820,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/disparity/-/disparity-3.2.0.tgz", "integrity": "sha512-8cl9ouncFYE7OQsYwJNiy2e15S0xN80X1Jj/N/YkoiM+VGWSyg1YzPToecKyYx2DQiJapt5IC8yi43GW23TUHQ==", - "dev": true, "dependencies": { "ansi-styles": "^4.2.1", "diff": "^4.0.2" @@ -6841,7 +6835,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, "engines": { "node": ">=0.3.1" } @@ -7048,6 +7041,9 @@ "version": "2.4.1", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", + "dev": true, + "optional": true, + "peer": true, "dependencies": { "ansi-colors": "^4.1.1", "strip-ansi": "^6.0.1" @@ -7724,7 +7720,6 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/eslint-plugin-package-json/-/eslint-plugin-package-json-0.1.4.tgz", "integrity": "sha512-qdb9LUBFR3tM9OZM1AaYCkxoZnRx7PX2xqvLm49D0JbUu+EkbDur9ug+tCS2xlA1Lbt12Wff5qES81ttc/VBdg==", - "dev": true, "dependencies": { "disparity": "^3.0.0", "package-json-validator": "^0.6.3", @@ -7831,15 +7826,6 @@ "semver": "bin/semver.js" } }, - "node_modules/eslint-plugin-simple-import-sort": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-10.0.0.tgz", - "integrity": "sha512-AeTvO9UCMSNzIHRkg8S6c3RPy5YEwKWSQPx3DYghLedo2ZQxowPFLGDN1AZ2evfg6r6mjBSZSLxLFsWSu3acsw==", - "dev": true, - "peerDependencies": { - "eslint": ">=5.0.0" - } - }, "node_modules/eslint-plugin-turbo": { "version": "1.10.12", "resolved": "https://registry.npmjs.org/eslint-plugin-turbo/-/eslint-plugin-turbo-1.10.12.tgz", @@ -7879,32 +7865,10 @@ "node": ">=4.0" } }, - "node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "engines": { - "node": ">=4" - } - }, "node_modules/eslint-visitor-keys": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz", - "integrity": "sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -7932,17 +7896,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/eslint/node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -8541,11 +8494,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==" - }, "node_modules/functions-have-names": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", @@ -10286,11 +10234,6 @@ "integrity": "sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==", "dev": true }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==" - }, "node_modules/lodash.uniq": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", @@ -12207,7 +12150,6 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", "integrity": "sha512-snN4O4TkigujZphWLN0E//nQmm7790RYaE53DdL7ZYwee2D8DDo9/EyYiKUfN3rneWUjhJnueija3G9I2i0h3g==", - "dev": true, "dependencies": { "minimist": "~0.0.1", "wordwrap": "~0.0.2" @@ -12216,8 +12158,7 @@ "node_modules/optimist/node_modules/minimist": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha512-iotkTvxc+TwOm5Ieim8VnSNvCDjCK9S8G3scJ50ZthspSxa7jx50jkhYduuAtAjvfDUwSgOwf8+If99AlOEhyw==", - "dev": true + "integrity": "sha512-iotkTvxc+TwOm5Ieim8VnSNvCDjCK9S8G3scJ50ZthspSxa7jx50jkhYduuAtAjvfDUwSgOwf8+If99AlOEhyw==" }, "node_modules/optionator": { "version": "0.9.3", @@ -12276,7 +12217,6 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/package-json-validator/-/package-json-validator-0.6.3.tgz", "integrity": "sha512-juKiFboV4UKUvWQ+OSxstnyukhuluyuEoFmgZw1Rx21XzmwlgDWLcbl3qzjA3789IRORYhVFs7cmAO0YFGwHCg==", - "dev": true, "dependencies": { "optimist": "~0.6.0" }, @@ -12980,14 +12920,6 @@ "node": ">=16.13" } }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/prop-types": { "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", @@ -13686,17 +13618,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, "node_modules/rehype-stringify": { "version": "9.0.3", "resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-9.0.3.tgz", @@ -13827,6 +13748,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -13835,7 +13757,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz", "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==", - "dev": true, "engines": { "node": ">=0.10.5" } @@ -14384,22 +14305,6 @@ "node": ">=8" } }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, "node_modules/source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -14846,41 +14751,6 @@ "url": "https://opencollective.com/unts" } }, - "node_modules/table": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", - "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", - "dependencies": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, "node_modules/tailwind-merge": { "version": "1.14.0", "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-1.14.0.tgz", @@ -16142,11 +16012,6 @@ "node": ">=8" } }, - "node_modules/v8-compile-cache": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", - "integrity": "sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==" - }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -16332,7 +16197,6 @@ "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", "integrity": "sha512-1tMA907+V4QmxV7dbRvb4/8MaRALK6q9Abid3ndMYnbyo8piisCmeONVqVSXqQA3KaP4SLt5b7ud6E2sqP8TFw==", - "dev": true, "engines": { "node": ">=0.4.0" } @@ -16476,13 +16340,10 @@ "eslint-config-next": "13.4.12", "eslint-config-prettier": "^8.8.0", "eslint-config-turbo": "^1.9.3", + "eslint-plugin-package-json": "^0.1.4", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.32.2", "typescript": "^5.1.6" - }, - "devDependencies": { - "eslint-plugin-package-json": "^0.1.4", - "eslint-plugin-simple-import-sort": "^10.0.0" } }, "packages/lib": { @@ -16542,7 +16403,6 @@ "license": "MIT", "dependencies": { "autoprefixer": "^10.4.13", - "eslint": "7.32.0", "postcss": "^8.4.21", "tailwindcss": "^3.2.7", "tailwindcss-animate": "^1.0.5" @@ -16551,131 +16411,6 @@ "@tailwindcss/typography": "^0.5.9" } }, - "packages/tailwind-config/node_modules/@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "packages/tailwind-config/node_modules/@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "packages/tailwind-config/node_modules/eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", - "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "packages/tailwind-config/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "engines": { - "node": ">=10" - } - }, - "packages/tailwind-config/node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", - "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "packages/tailwind-config/node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "engines": { - "node": ">=4" - } - }, - "packages/tailwind-config/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "engines": { - "node": ">= 4" - } - }, "packages/trpc": { "name": "@documenso/trpc", "version": "1.0.0", diff --git a/package.json b/package.json index 3b8d3612e..b66c194a2 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "@commitlint/config-conventional": "^17.7.0", "dotenv": "^16.0.3", "dotenv-cli": "^7.2.1", - "eslint": "^7.32.0", + "eslint": "^8.40.0", "eslint-config-custom": "*", "husky": "^8.0.0", "lint-staged": "^14.0.0", diff --git a/packages/eslint-config/index.cjs b/packages/eslint-config/index.cjs index fcc6c878f..c4cfae3c3 100644 --- a/packages/eslint-config/index.cjs +++ b/packages/eslint-config/index.cjs @@ -9,7 +9,7 @@ module.exports = { 'plugin:package-json/recommended', ], - plugins: ['prettier', 'package-json', 'simple-import-sort'], + plugins: ['prettier', 'package-json'], env: { node: true, @@ -35,6 +35,20 @@ module.exports = { 'no-unused-vars': ['error', { argsIgnorePattern: '^_' }], '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], + 'no-duplicate-imports': 'error', + 'no-multi-spaces': [ + 'error', + { + ignoreEOLComments: false, + exceptions: { + BinaryExpression: false, + VariableDeclarator: false, + ImportDeclaration: false, + Property: false, + }, + }, + ], + // Safety with promises so we aren't running with scissors 'no-promise-executor-return': 'error', 'prefer-promise-reject-errors': 'error', @@ -53,18 +67,5 @@ module.exports = { // To handle this we want this rule to catch usages and highlight them as // warnings so we can write appropriate interfaces and guards later. '@typescript-eslint/consistent-type-assertions': ['warn', { assertionStyle: 'never' }], - 'no-multi-spaces': [ - 'error', - { - ignoreEOLComments: false, - exceptions: { - BinaryExpression: false, - VariableDeclarator: false, - ImportDeclaration: false, - Property: false, - }, - }, - ], - 'no-duplicate-imports': 'error', }, }; diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index a14ea56e2..d9b53c540 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -10,12 +10,9 @@ "eslint-config-next": "13.4.12", "eslint-config-prettier": "^8.8.0", "eslint-config-turbo": "^1.9.3", + "eslint-plugin-package-json": "^0.1.4", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.32.2", "typescript": "^5.1.6" - }, - "devDependencies": { - "eslint-plugin-package-json": "^0.1.4", - "eslint-plugin-simple-import-sort": "^10.0.0" } } diff --git a/packages/prisma/tsconfig.json b/packages/prisma/tsconfig.json new file mode 100644 index 000000000..4aefcb98c --- /dev/null +++ b/packages/prisma/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "@documenso/tsconfig/react-library.json", + "include": ["."], + "exclude": ["dist", "build", "node_modules"] +} diff --git a/packages/tailwind-config/package.json b/packages/tailwind-config/package.json index 090617d48..7f10b8d76 100644 --- a/packages/tailwind-config/package.json +++ b/packages/tailwind-config/package.json @@ -5,7 +5,6 @@ "license": "MIT", "dependencies": { "autoprefixer": "^10.4.13", - "eslint": "7.32.0", "postcss": "^8.4.21", "tailwindcss": "^3.2.7", "tailwindcss-animate": "^1.0.5" diff --git a/packages/trpc/server/auth-router/schema.ts b/packages/trpc/server/auth-router/schema.ts index e2b5b3ac8..04714e0fe 100644 --- a/packages/trpc/server/auth-router/schema.ts +++ b/packages/trpc/server/auth-router/schema.ts @@ -1,4 +1,3 @@ -import 'zod'; import { z } from 'zod'; export const ZSignUpMutationSchema = z.object({ From 40767430d980b5457a19a2769c9f6f0497e51da4 Mon Sep 17 00:00:00 2001 From: Ephraim Atta-Duncan Date: Wed, 30 Aug 2023 03:09:40 +0000 Subject: [PATCH 09/17] feat: reset password from on submit --- apps/web/src/components/forms/password.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/web/src/components/forms/password.tsx b/apps/web/src/components/forms/password.tsx index 7c595421e..0b3267f87 100644 --- a/apps/web/src/components/forms/password.tsx +++ b/apps/web/src/components/forms/password.tsx @@ -39,6 +39,7 @@ export const PasswordForm = ({ className }: PasswordFormProps) => { const { register, handleSubmit, + reset, formState: { errors, isSubmitting }, } = useForm({ values: { @@ -56,6 +57,8 @@ export const PasswordForm = ({ className }: PasswordFormProps) => { password, }); + reset(); + toast({ title: 'Password updated', description: 'Your password has been updated successfully.', From 4f3970c361bb24e814739ab1c2ab70c14f74c5a6 Mon Sep 17 00:00:00 2001 From: Ephraim Atta-Duncan Date: Wed, 30 Aug 2023 03:22:47 +0000 Subject: [PATCH 10/17] feat: prevent a user from updating password with the same password --- packages/lib/server-only/user/update-password.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/lib/server-only/user/update-password.ts b/packages/lib/server-only/user/update-password.ts index d3ff9070f..521aecd22 100644 --- a/packages/lib/server-only/user/update-password.ts +++ b/packages/lib/server-only/user/update-password.ts @@ -1,4 +1,4 @@ -import { hash } from 'bcrypt'; +import { compare, hash } from 'bcrypt'; import { prisma } from '@documenso/prisma'; @@ -11,7 +11,7 @@ export type UpdatePasswordOptions = { export const updatePassword = async ({ userId, password }: UpdatePasswordOptions) => { // Existence check - await prisma.user.findFirstOrThrow({ + const user = await prisma.user.findFirstOrThrow({ where: { id: userId, }, @@ -19,6 +19,13 @@ export const updatePassword = async ({ userId, password }: UpdatePasswordOptions const hashedPassword = await hash(password, SALT_ROUNDS); + // Compare the new password with the old password + const isSamePassword = await compare(password, user.password as string); + + if (isSamePassword) { + throw new Error('You cannot use the same password as your current password.'); + } + const updatedUser = await prisma.user.update({ where: { id: userId, From ed6fa4dc2a9aa911d34a25f2583383832e82d13c Mon Sep 17 00:00:00 2001 From: Ephraim Atta-Duncan Date: Wed, 30 Aug 2023 03:26:24 +0000 Subject: [PATCH 11/17] feat: avoid updating password with existing password --- packages/trpc/server/profile-router/router.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/trpc/server/profile-router/router.ts b/packages/trpc/server/profile-router/router.ts index d5d191d6e..76e50473d 100644 --- a/packages/trpc/server/profile-router/router.ts +++ b/packages/trpc/server/profile-router/router.ts @@ -40,12 +40,13 @@ export const profileRouter = router({ password, }); } catch (err) { - console.error(err); + const errorMessage = (err as { message?: string }).message; throw new TRPCError({ code: 'BAD_REQUEST', - message: - 'We were unable to update your profile. Please review the information you provided and try again.', + message: errorMessage + ? errorMessage + : 'We were unable to update your profile. Please review the information you provided and try again.', }); } }), From d71e43c5d691503014adf3d24f5657ec8451077f Mon Sep 17 00:00:00 2001 From: Mythie Date: Wed, 30 Aug 2023 14:01:30 +1000 Subject: [PATCH 12/17] fix: minor tidying --- apps/web/src/components/forms/password.tsx | 2 +- packages/lib/server-only/user/update-password.ts | 2 +- packages/trpc/server/profile-router/router.ts | 11 +++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/web/src/components/forms/password.tsx b/apps/web/src/components/forms/password.tsx index 0b3267f87..508579b78 100644 --- a/apps/web/src/components/forms/password.tsx +++ b/apps/web/src/components/forms/password.tsx @@ -76,7 +76,7 @@ export const PasswordForm = ({ className }: PasswordFormProps) => { title: 'An unknown error occurred', variant: 'destructive', description: - 'We encountered an unknown error while attempting to sign you In. Please try again later.', + 'We encountered an unknown error while attempting to update your password. Please try again later.', }); } } diff --git a/packages/lib/server-only/user/update-password.ts b/packages/lib/server-only/user/update-password.ts index 521aecd22..4133bc342 100644 --- a/packages/lib/server-only/user/update-password.ts +++ b/packages/lib/server-only/user/update-password.ts @@ -23,7 +23,7 @@ export const updatePassword = async ({ userId, password }: UpdatePasswordOptions const isSamePassword = await compare(password, user.password as string); if (isSamePassword) { - throw new Error('You cannot use the same password as your current password.'); + throw new Error('Your new password cannot be the same as your old password.'); } const updatedUser = await prisma.user.update({ diff --git a/packages/trpc/server/profile-router/router.ts b/packages/trpc/server/profile-router/router.ts index 76e50473d..1ca8a0cf2 100644 --- a/packages/trpc/server/profile-router/router.ts +++ b/packages/trpc/server/profile-router/router.ts @@ -40,13 +40,16 @@ export const profileRouter = router({ password, }); } catch (err) { - const errorMessage = (err as { message?: string }).message; + let message = + 'We were unable to update your profile. Please review the information you provided and try again.'; + + if (err instanceof Error) { + message = err.message; + } throw new TRPCError({ code: 'BAD_REQUEST', - message: errorMessage - ? errorMessage - : 'We were unable to update your profile. Please review the information you provided and try again.', + message, }); } }), From bfe0d50661f28768326dd47d76af748df2cc9c81 Mon Sep 17 00:00:00 2001 From: Mythie Date: Thu, 24 Aug 2023 13:32:57 +1000 Subject: [PATCH 13/17] feat: make billing page functional --- packages/lib/ee/LICENSE.md | 1 + packages/lib/ee/stripe/create-customer.ts | 32 +++++++++++++++++++ packages/lib/ee/stripe/get-portal-session.ts | 19 +++++++++++ packages/lib/package.json | 2 +- .../get-subscription-by-user-id.ts | 15 +++++++++ 5 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 packages/lib/ee/LICENSE.md create mode 100644 packages/lib/ee/stripe/create-customer.ts create mode 100644 packages/lib/ee/stripe/get-portal-session.ts create mode 100644 packages/lib/server-only/subscription/get-subscription-by-user-id.ts diff --git a/packages/lib/ee/LICENSE.md b/packages/lib/ee/LICENSE.md new file mode 100644 index 000000000..eabda6db2 --- /dev/null +++ b/packages/lib/ee/LICENSE.md @@ -0,0 +1 @@ + diff --git a/packages/lib/ee/stripe/create-customer.ts b/packages/lib/ee/stripe/create-customer.ts new file mode 100644 index 000000000..585fbdb22 --- /dev/null +++ b/packages/lib/ee/stripe/create-customer.ts @@ -0,0 +1,32 @@ +import { prisma } from '@documenso/prisma'; +import { User } from '@documenso/prisma/client'; + +import { stripe } from '../../server-only/stripe'; +import { getSubscriptionByUserId } from '../../server-only/subscription/get-subscription-by-user-id'; + +export type CreateCustomerOptions = { + user: User; +}; + +export const createCustomer = async ({ user }: CreateCustomerOptions) => { + const existingSubscription = await getSubscriptionByUserId({ userId: user.id }); + + if (existingSubscription) { + throw new Error('User already has a subscription'); + } + + const customer = await stripe.customers.create({ + name: user.name ?? undefined, + email: user.email, + metadata: { + userId: user.id, + }, + }); + + return await prisma.subscription.create({ + data: { + userId: user.id, + customerId: customer.id, + }, + }); +}; diff --git a/packages/lib/ee/stripe/get-portal-session.ts b/packages/lib/ee/stripe/get-portal-session.ts new file mode 100644 index 000000000..91ecc63ab --- /dev/null +++ b/packages/lib/ee/stripe/get-portal-session.ts @@ -0,0 +1,19 @@ +'use server'; + +import { stripe } from '../../server-only/stripe'; + +export type GetPortalSessionOptions = { + customerId: string; + returnUrl: string; +}; + +export const getPortalSession = async ({ customerId, returnUrl }: GetPortalSessionOptions) => { + 'use server'; + + const session = await stripe.billingPortal.sessions.create({ + customer: customerId, + return_url: returnUrl, + }); + + return session.url; +}; diff --git a/packages/lib/package.json b/packages/lib/package.json index 0d04f6c93..dafac9527 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "main": "./index.ts", "types": "./index.ts", - "license": "MIT", + "license": "SEE LICENSE IN LICENSE.md", "files": [ "client-only/", "server-only/", diff --git a/packages/lib/server-only/subscription/get-subscription-by-user-id.ts b/packages/lib/server-only/subscription/get-subscription-by-user-id.ts new file mode 100644 index 000000000..19932669a --- /dev/null +++ b/packages/lib/server-only/subscription/get-subscription-by-user-id.ts @@ -0,0 +1,15 @@ +'use server'; + +import { prisma } from '@documenso/prisma'; + +export type GetSubscriptionByUserIdOptions = { + userId: number; +}; + +export const getSubscriptionByUserId = ({ userId }: GetSubscriptionByUserIdOptions) => { + return prisma.subscription.findFirst({ + where: { + userId, + }, + }); +}; From 249211bd4f07198aef8dcf10be5ea8b2ad30b87b Mon Sep 17 00:00:00 2001 From: Mythie Date: Wed, 30 Aug 2023 16:36:22 +1000 Subject: [PATCH 14/17] fix: add items from stash --- apps/web/package.json | 1 + .../app/(dashboard)/settings/billing/page.tsx | 50 +++++++++++++++++-- package-lock.json | 15 +++++- packages/ee/LICENSE | 40 +++++++++++++++ packages/ee/index.ts | 1 + packages/ee/package.json | 17 +++++++ .../server-only}/stripe/create-customer.ts | 5 +- .../server-only}/stripe/get-portal-session.ts | 2 +- packages/ee/tsconfig.json | 5 ++ packages/lib/ee/LICENSE.md | 1 - packages/lib/package.json | 2 +- 11 files changed, 129 insertions(+), 10 deletions(-) create mode 100644 packages/ee/LICENSE create mode 100644 packages/ee/index.ts create mode 100644 packages/ee/package.json rename packages/{lib/ee => ee/server-only}/stripe/create-customer.ts (80%) rename packages/{lib/ee => ee/server-only}/stripe/get-portal-session.ts (85%) create mode 100644 packages/ee/tsconfig.json delete mode 100644 packages/lib/ee/LICENSE.md diff --git a/apps/web/package.json b/apps/web/package.json index 22a75128f..8e7dd2be7 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -11,6 +11,7 @@ "copy:pdfjs": "node ../../scripts/copy-pdfjs.cjs" }, "dependencies": { + "@documenso/ee": "*", "@documenso/lib": "*", "@documenso/prisma": "*", "@documenso/tailwind-config": "*", diff --git a/apps/web/src/app/(dashboard)/settings/billing/page.tsx b/apps/web/src/app/(dashboard)/settings/billing/page.tsx index 256f682fb..e9966b9ac 100644 --- a/apps/web/src/app/(dashboard)/settings/billing/page.tsx +++ b/apps/web/src/app/(dashboard)/settings/billing/page.tsx @@ -1,8 +1,14 @@ +import Link from 'next/link'; import { redirect } from 'next/navigation'; +import { createCustomer } from '@documenso/ee/server-only/stripe/create-customer'; +import { getPortalSession } from '@documenso/ee/server-only/stripe/get-portal-session'; import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session'; +import { getSubscriptionByUserId } from '@documenso/lib/server-only/subscription/get-subscription-by-user-id'; +import { SubscriptionStatus } from '@documenso/prisma/client'; +import { Button } from '@documenso/ui/primitives/button'; -import { PasswordForm } from '~/components/forms/password'; +import { LocaleDate } from '~/components/formatter/locale-date'; import { getServerComponentFlag } from '~/helpers/get-server-component-feature-flag'; export default async function BillingSettingsPage() { @@ -15,17 +21,55 @@ export default async function BillingSettingsPage() { redirect('/settings/profile'); } + let subscription = await getSubscriptionByUserId({ userId: user.id }); + + // If we don't have a customer record, create one as well as an empty subscription. + if (!subscription?.customerId) { + subscription = await createCustomer({ user }); + } + + let billingPortalUrl = ''; + + if (subscription?.customerId) { + billingPortalUrl = await getPortalSession({ + customerId: subscription.customerId, + returnUrl: `${process.env.NEXT_PUBLIC_SITE_URL}/settings/billing`, + }); + } + return (

Billing

- Here you can update and manage your subscription. + Your subscription is{' '} + {subscription.status !== SubscriptionStatus.INACTIVE ? 'active' : 'inactive'}. + {subscription?.periodEnd && ( + <> + {' '} + Your next payment is due on{' '} + + + + . + + )}


- + {billingPortalUrl && ( + + )} + + {!billingPortalUrl && ( +

+ You do not currently have a customer record, this should not happen. Please contact + support for assistance. +

+ )}
); } diff --git a/package-lock.json b/package-lock.json index c6c404669..12c957494 100644 --- a/package-lock.json +++ b/package-lock.json @@ -68,6 +68,7 @@ "version": "0.1.0", "license": "AGPL-3.0", "dependencies": { + "@documenso/ee": "*", "@documenso/lib": "*", "@documenso/prisma": "*", "@documenso/tailwind-config": "*", @@ -1076,6 +1077,10 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@documenso/ee": { + "resolved": "packages/ee", + "link": true + }, "node_modules/@documenso/email": { "resolved": "packages/email", "link": true @@ -16313,6 +16318,14 @@ "url": "https://github.com/sponsors/wooorm" } }, + "packages/ee": { + "version": "1.0.0", + "license": "COMMERCIAL", + "dependencies": { + "@documenso/lib": "*", + "@documenso/prisma": "*" + } + }, "packages/email": { "name": "@documenso/email", "version": "1.0.0", @@ -16349,7 +16362,7 @@ "packages/lib": { "name": "@documenso/lib", "version": "1.0.0", - "license": "MIT", + "license": "SEE LICENSE IN LICENSE", "dependencies": { "@documenso/email": "*", "@documenso/prisma": "*", diff --git a/packages/ee/LICENSE b/packages/ee/LICENSE new file mode 100644 index 000000000..cc97e3a10 --- /dev/null +++ b/packages/ee/LICENSE @@ -0,0 +1,40 @@ +The Documenso Commercial License (the “Commercial License”) +Copyright (c) 2023 Documenso, Inc + +With regard to the Documenso Software: + +This software and associated documentation files (the "Software") may only be +used in production, if you (and any entity that you represent) have agreed to, +and are in compliance with, an agreement governing +the use of the Software, as mutually agreed by you and Documenso, Inc ("Documenso"), +and otherwise have a valid Documenso Enterprise Edition subscription ("Commercial Subscription"). +Subject to the foregoing sentence, you are free to modify this Software and publish patches to the Software. +You agree that Documenso and/or its licensors (as applicable) retain all right, title and interest in +and to all such modifications and/or patches, and all such modifications and/or +patches may only be used, copied, modified, displayed, distributed, or otherwise +exploited with a valid Commercial Subscription for the correct number of hosts. +Notwithstanding the foregoing, you may copy and modify the Software for development +and testing purposes, without requiring a subscription. You agree that Documenso and/or +its licensors (as applicable) retain all right, title and interest in and to all such +modifications. You are not granted any other rights beyond what is expressly stated herein. +Subject to the foregoing, it is forbidden to copy, merge, publish, distribute, sublicense, +and/or sell the Software. + +This Commercial License applies only to the part of this Software that is not distributed under +the AGPLv3 license. Any part of this Software distributed under the MIT license or which +is served client-side as an image, font, cascading stylesheet (CSS), file which produces +or is compiled, arranged, augmented, or combined into client-side JavaScript, in whole or +in part, is copyrighted under the AGPLv3 license. The full text of this Commercial License 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. + +For all third party components incorporated into the Documenso Software, those +components are licensed under the original license provided by the owner of the +applicable component. diff --git a/packages/ee/index.ts b/packages/ee/index.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/packages/ee/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/packages/ee/package.json b/packages/ee/package.json new file mode 100644 index 000000000..4c810a235 --- /dev/null +++ b/packages/ee/package.json @@ -0,0 +1,17 @@ +{ + "name": "@documenso/ee", + "version": "1.0.0", + "main": "./index.ts", + "types": "./index.ts", + "license": "COMMERCIAL", + "files": [ + "client-only/", + "server-only/", + "universal/" + ], + "scripts": {}, + "dependencies": { + "@documenso/lib": "*", + "@documenso/prisma": "*" + } +} diff --git a/packages/lib/ee/stripe/create-customer.ts b/packages/ee/server-only/stripe/create-customer.ts similarity index 80% rename from packages/lib/ee/stripe/create-customer.ts rename to packages/ee/server-only/stripe/create-customer.ts index 585fbdb22..175298d0b 100644 --- a/packages/lib/ee/stripe/create-customer.ts +++ b/packages/ee/server-only/stripe/create-customer.ts @@ -1,9 +1,8 @@ +import { stripe } from '@documenso/lib/server-only/stripe'; +import { getSubscriptionByUserId } from '@documenso/lib/server-only/subscription/get-subscription-by-user-id'; import { prisma } from '@documenso/prisma'; import { User } from '@documenso/prisma/client'; -import { stripe } from '../../server-only/stripe'; -import { getSubscriptionByUserId } from '../../server-only/subscription/get-subscription-by-user-id'; - export type CreateCustomerOptions = { user: User; }; diff --git a/packages/lib/ee/stripe/get-portal-session.ts b/packages/ee/server-only/stripe/get-portal-session.ts similarity index 85% rename from packages/lib/ee/stripe/get-portal-session.ts rename to packages/ee/server-only/stripe/get-portal-session.ts index 91ecc63ab..310cc1e47 100644 --- a/packages/lib/ee/stripe/get-portal-session.ts +++ b/packages/ee/server-only/stripe/get-portal-session.ts @@ -1,6 +1,6 @@ 'use server'; -import { stripe } from '../../server-only/stripe'; +import { stripe } from '@documenso/lib/server-only/stripe'; export type GetPortalSessionOptions = { customerId: string; diff --git a/packages/ee/tsconfig.json b/packages/ee/tsconfig.json new file mode 100644 index 000000000..0f63d1612 --- /dev/null +++ b/packages/ee/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "@documenso/tsconfig/react-library.json", + "include": ["**/*.ts", "**/*.tsx", "**/*.d.ts"], + "exclude": ["dist", "build", "node_modules"] +} diff --git a/packages/lib/ee/LICENSE.md b/packages/lib/ee/LICENSE.md deleted file mode 100644 index eabda6db2..000000000 --- a/packages/lib/ee/LICENSE.md +++ /dev/null @@ -1 +0,0 @@ - diff --git a/packages/lib/package.json b/packages/lib/package.json index dafac9527..155cdb8a4 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "main": "./index.ts", "types": "./index.ts", - "license": "SEE LICENSE IN LICENSE.md", + "license": "SEE LICENSE IN LICENSE", "files": [ "client-only/", "server-only/", From 93962625ed743f7427d99e5d2c59e9ac62d5047e Mon Sep 17 00:00:00 2001 From: Mythie Date: Wed, 30 Aug 2023 16:39:35 +1000 Subject: [PATCH 15/17] fix: further stash conflicts --- packages/lib/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lib/package.json b/packages/lib/package.json index 155cdb8a4..0d04f6c93 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "main": "./index.ts", "types": "./index.ts", - "license": "SEE LICENSE IN LICENSE", + "license": "MIT", "files": [ "client-only/", "server-only/", From 463dc48ea664c91bf305326a0ef73e3b16d59043 Mon Sep 17 00:00:00 2001 From: Mythie Date: Wed, 30 Aug 2023 17:31:23 +1000 Subject: [PATCH 16/17] fix: extract feature-flag zod schema to separate file --- apps/web/src/providers/feature-flag.tsx | 11 +---------- apps/web/src/providers/feature-flag.types.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 apps/web/src/providers/feature-flag.types.ts diff --git a/apps/web/src/providers/feature-flag.tsx b/apps/web/src/providers/feature-flag.tsx index 58d1bff63..0a09fe0f0 100644 --- a/apps/web/src/providers/feature-flag.tsx +++ b/apps/web/src/providers/feature-flag.tsx @@ -2,8 +2,6 @@ import { createContext, useCallback, useContext, useEffect, useState } from 'react'; -import { z } from 'zod'; - import { FEATURE_FLAG_POLL_INTERVAL, LOCAL_FEATURE_FLAGS, @@ -12,14 +10,7 @@ import { import { getAllFlags } from '~/helpers/get-feature-flag'; -export const ZFeatureFlagValueSchema = z.union([ - z.boolean(), - z.string(), - z.number(), - z.undefined(), -]); - -export type TFeatureFlagValue = z.infer; +import { TFeatureFlagValue } from './feature-flag.types'; export type FeatureFlagContextValue = { getFlag: (_key: string) => TFeatureFlagValue; diff --git a/apps/web/src/providers/feature-flag.types.ts b/apps/web/src/providers/feature-flag.types.ts new file mode 100644 index 000000000..1654a188c --- /dev/null +++ b/apps/web/src/providers/feature-flag.types.ts @@ -0,0 +1,10 @@ +import { z } from 'zod'; + +export const ZFeatureFlagValueSchema = z.union([ + z.boolean(), + z.string(), + z.number(), + z.undefined(), +]); + +export type TFeatureFlagValue = z.infer; From 8d7d6a19e7c6feea6b179df0b6615a90d6a4e461 Mon Sep 17 00:00:00 2001 From: Mythie Date: Wed, 30 Aug 2023 18:06:41 +1000 Subject: [PATCH 17/17] fix: update import for feature-flag helpers --- apps/web/src/helpers/get-feature-flag.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/helpers/get-feature-flag.ts b/apps/web/src/helpers/get-feature-flag.ts index cb97c9644..3b6c66528 100644 --- a/apps/web/src/helpers/get-feature-flag.ts +++ b/apps/web/src/helpers/get-feature-flag.ts @@ -2,7 +2,7 @@ import { z } from 'zod'; import { LOCAL_FEATURE_FLAGS, isFeatureFlagEnabled } from '@documenso/lib/constants/feature-flags'; -import { TFeatureFlagValue, ZFeatureFlagValueSchema } from '~/providers/feature-flag'; +import { TFeatureFlagValue, ZFeatureFlagValueSchema } from '~/providers/feature-flag.types'; /** * Evaluate whether a flag is enabled for the current user.