Skip to content

Commit

Permalink
lint improvements, basic tweaks to has-soft-deleter
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaMulein committed Sep 25, 2024
1 parent baa45ae commit bd2622b
Show file tree
Hide file tree
Showing 20 changed files with 47 additions and 26 deletions.
2 changes: 1 addition & 1 deletion apps/duality-social-node/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"ignorePatterns": ["node_modules", "!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
Expand Down
8 changes: 4 additions & 4 deletions apps/duality-social-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
},
"devDependencies": {
"@faker-js/faker": "^9.0.1",
"@types/cors": "^2.8.17",
"@types/express-session": "^1.18.0",
"@types/uuid": "^10.0.0",
"@types/bcrypt": "^5.0.2",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/express-session": "^1.18.0",
"@types/jest": "^29.5.13",
"@types/multer": "^1.4.12",
"@types/node": "^22.5.5",
"@types/node": "^22.6.1",
"@types/supertest": "^6.0.2",
"@types/uuid": "^10.0.0",
"@types/validator": "^13.12.0",
"jest": "^29.7.0",
"jest-mock-extended": "^3.0.7",
Expand Down
2 changes: 1 addition & 1 deletion apps/duality-social-queue-worker-e2e/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"ignorePatterns": ["node_modules", "!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
Expand Down
2 changes: 1 addition & 1 deletion apps/duality-social-queue-worker/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"ignorePatterns": ["node_modules", "!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
Expand Down
2 changes: 1 addition & 1 deletion apps/duality-social-react-e2e/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": ["plugin:cypress/recommended", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"ignorePatterns": ["node_modules", "!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
Expand Down
2 changes: 1 addition & 1 deletion apps/duality-social-react/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"ignorePatterns": ["node_modules", "!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
Expand Down
9 changes: 9 additions & 0 deletions do-yarn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@ PACKAGE_ROOTS=$(find . -type f -name "package.json" ! -path "*/node_modules/*" !
# Make sure we start with the project root
PROJECT_ROOT=$(pwd)

# Run yarn in the project root
echo "Running yarn in $PROJECT_ROOT"
yarn "$@"

# Loop through each package.json file
for PACKAGE in $PACKAGE_ROOTS; do
# Get the directory containing the package.json file
PACKAGE_DIR=$(dirname "$PACKAGE")

# Skip the project root directory
if [ "$PACKAGE_DIR" == "$PROJECT_ROOT" ]; then
continue
fi

# Change to the package directory
cd "$PACKAGE_DIR" || exit

Expand Down
2 changes: 1 addition & 1 deletion libs/duality-social-lib/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export * from './lib/interfaces/feed-post.ts';
export * from './lib/interfaces/feed-post-viewpoint.ts';
export * from './lib/interfaces/has-creation.ts';
export * from './lib/interfaces/has-creator.ts';
export * from './lib/interfaces/has-deleter.ts';
export * from './lib/interfaces/has-soft-deleter.ts';
export * from './lib/interfaces/has-id.ts';
export * from './lib/interfaces/has-soft-delete.ts';
export * from './lib/interfaces/has-timestamp-owners.ts';
Expand Down
1 change: 0 additions & 1 deletion libs/duality-social-lib/src/lib/interfaces/has-creator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Types } from 'mongoose';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface IHasCreator {
/**
* The MongoDB unique identifier for the user who created the object.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Types } from 'mongoose';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface IHasDeleter {
export interface IHasSoftDeleter {
/**
* The MongoDB unique identifier for the user who deleted the object.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { IHasCreator } from './has-creator.ts';
import { IHasUpdater } from './has-updater.ts';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface IHasTimestampOwners extends IHasCreator, IHasUpdater {}
1 change: 0 additions & 1 deletion libs/duality-social-lib/src/lib/interfaces/has-updater.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Types } from 'mongoose';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface IHasUpdater {
/**
* The MongoDB unique identifier for the user who updated the object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { HumanityTypeEnum } from '../../enumerations/humanity-type.ts';
import { ViewpointTypeEnum } from '../../enumerations/viewpoint-type.ts';
import { IHasSoftDelete } from '../has-soft-delete.ts';
import { IHasTimestamps } from '../has-timestamps.ts';
import { IHasDeleter } from '../has-deleter.ts';
import { IHasSoftDeleter } from '../has-soft-deleter.ts';
import { DefaultReactionsTypeEnum } from '../../enumerations/default-reactions-type.ts';

export interface IPostViewpoint
extends IHasTimestamps,
IHasSoftDelete,
IHasDeleter {
IHasSoftDeleter {
/**
* Correlation id to link the dualities.
*/
Expand Down
4 changes: 2 additions & 2 deletions libs/duality-social-lib/src/lib/interfaces/models/post.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Types } from 'mongoose';
import { IHasDeleter } from '../has-deleter.ts';
import { IHasSoftDeleter } from '../has-soft-deleter.ts';
import { IHasSoftDelete } from '../has-soft-delete.ts';
import { IHasTimestampOwners } from '../has-timestamp-owners.ts';
import { IHasTimestamps } from '../has-timestamps.ts';
Expand All @@ -20,7 +20,7 @@ export interface IPost
extends IHasTimestamps,
IHasSoftDelete,
IHasTimestampOwners,
IHasDeleter {
IHasSoftDeleter {
/**
* Whether the post is hidden from the feed.
*/
Expand Down
4 changes: 2 additions & 2 deletions libs/duality-social-lib/src/lib/interfaces/models/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { IHasSoftDelete } from '../has-soft-delete.ts';
import { IHasTimestampOwners } from '../has-timestamp-owners.ts';
import { IHasTimestamps } from '../has-timestamps.ts';
import { HumanityTypeEnum } from '../../enumerations/humanity-type.ts';
import { IHasDeleter } from '../has-deleter.ts';
import { IHasSoftDeleter } from '../has-soft-deleter.ts';

export interface IUser
extends IHasTimestamps,
IHasTimestampOwners,
IHasSoftDelete,
IHasDeleter {
IHasSoftDeleter {
username: string;
languages: string[];
/**
Expand Down
2 changes: 1 addition & 1 deletion libs/duality-social-node-lib/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"ignorePatterns": ["node_modules", "!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
Expand Down
5 changes: 4 additions & 1 deletion libs/duality-social-node-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"name": "duality-social-node-lib",
"version": "0.0.1",
"license": "MIT"
"license": "MIT",
"dependencies": {
"mongoose": "^8.6.3"
}
}
12 changes: 12 additions & 0 deletions list-scripts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# Check if jq is installed
if ! command -v jq &> /dev/null
then
echo "jq could not be found. Please install jq to use this script."
exit
fi

# Read and list the scripts from package.json
echo "Available scripts in package.json:"
jq -r '.scripts | to_entries[] | "\(.key): \(.value)"' package.json
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"clean:all": "rm -rf node_modules dist/ ~/.cache && yarn cache clean",
"migrate:latest": "npx nx migrate latest",
"migrate:run-migrations": "npx nx migrate --run-migrations",
"upgrade:all": "./do-yarn.sh upgrade"
"upgrade:all": "./do-yarn.sh upgrade",
"commands": "./list-scripts.sh"
},
"dependencies": {
"@awesome.me/kit-89ec609b07": "^1.0.4",
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4477,7 +4477,7 @@
dependencies:
"@types/node" "*"

"@types/node@*", "@types/node@^22.5.5":
"@types/node@*", "@types/node@^22.6.1":
version "22.6.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.6.1.tgz#e531a45f4d78f14a8468cb9cdc29dc9602afc7ac"
integrity sha512-V48tCfcKb/e6cVUigLAaJDAILdMP0fUW6BidkPK4GpGjXcfbnoHasCZDwz3N3yVt5we2RHm4XTQCpv0KJz9zqw==
Expand Down Expand Up @@ -12602,7 +12602,7 @@ mongoose-browser@^5.2.8-pre-2:
resolved "https://registry.yarnpkg.com/mongoose-browser/-/mongoose-browser-5.2.8-pre-2.tgz#e7272ea2657dd2ab299fe31762f341ad6a67892d"
integrity sha512-DCRCfcvhVtW3E861Vdx+d4btMcpgN7COYuo5hgnEzl6TjRK4gJKYDq7myRhv24dIHvGn2hscfE93CjPbI4Sr/w==

mongoose@^8.5.1:
mongoose@^8.5.1, mongoose@^8.6.3:
version "8.6.3"
resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-8.6.3.tgz#fdc1f4defd4de87dc3f5c18aacaf811cafcfcfbe"
integrity sha512-++yRmm7hjMbqVA/8WeiygTnEfrFbiy+OBjQi49GFJIvCQuSYE56myyQWo4j5hbpcHjhHQU8NukMNGTwAWFWjIw==
Expand Down

0 comments on commit bd2622b

Please sign in to comment.