Skip to content

Commit

Permalink
chore: general project cleanup (#68)
Browse files Browse the repository at this point in the history
Removed unuised files, added a custom cspell dictionary, and fixed a few
seeding errors
  • Loading branch information
jmcdo29 authored Sep 29, 2023
2 parents a13bce4 + 6e9c46f commit 7732ebc
Show file tree
Hide file tree
Showing 69 changed files with 892 additions and 951 deletions.
61 changes: 61 additions & 0 deletions .cspell/custom-dictionary-workspace.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
abil
Amare
Amashia
Aodhan
Aquan
Arboria
Archfey
Branok
buildx
Caelaum
Caoimhe
Celestials
Ciaradh
Daeris
Darkvision
Eira
Everfather
Felvcor
Felvos
Feywild
Genasi
Halflings
hexblade
housecats
Insertable
Jarekos
jmcdo
Kitsune
Klinge
Krypta
Kurio
Latubor
lightcookie
McDoniel
Meister
Militaris
Millis
Naga
Nagan
Nagas
Ordin
pactum
Pomdra
Proecerta
Seele
Seelie
Shadowfell
Shapeshifter
spellcasting
Spinne
Tabaxi
Tadhg
Thirio
Tsumi
Unseelie
unteris
Vatcher
Venlustel
Verfell
Viridi
vitoak
9 changes: 8 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"cSpell.words": ["unteris"],
"cSpell.customDictionaries": {
"custom-dictionary-workspace": {
"name": "custom-dictionary-workspace",
"path": "${workspaceFolder:unteris}/.cspell/custom-dictionary-workspace.txt",
"addWords": true,
"scope": "workspace"
}
},
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"quickfix.biome": true
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions apps/kysely-cli/Dockerfile → apps/cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM node:20.2-alpine3.18 as unteris-node
RUN npm i -g [email protected] && \
apk add --no-cache \
dumb-init=1.2.5-r2

FROM unteris-node AS unteris-common

WORKDIR /src
Expand All @@ -21,18 +21,18 @@ ENV CYPRESS_INSTALL_BINARY=0
RUN pnpm i

FROM unteris-common AS migrations-build
COPY apps/kysely-cli ./apps/kysely-cli
COPY apps/cli ./apps/cli
COPY libs/server ./libs/server
COPY libs/db ./libs/db
COPY libs/shared ./libs/shared/
RUN pnpm nx run kysely-cli:build:production
RUN pnpm nx run cli:build:production

FROM unteris-node AS migrations-prod
LABEL description="The image that runs migrations for the Unteris Database. This should be ran as one-off commands on demand"
USER node
WORKDIR /src
COPY --from=migrations-build --chown=node:node /src/dist ./dist
RUN cp ./dist/apps/kysely-cli/package.json ./package.json
RUN cp ./dist/apps/cli/package.json ./package.json
ENV NODE_ENV=production
RUN pnpm i
CMD ["dumb-init", "node", "dist/apps/kysely-cli/main", "migrate"]
CMD ["dumb-init", "node", "dist/apps/cli/main", "migrate"]
4 changes: 2 additions & 2 deletions apps/kysely-cli/jest.config.ts → apps/cli/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable */
export default {
displayName: "kysely-cli",
displayName: "cli",
preset: "../../jest.preset.js",
testEnvironment: "node",
transform: {
"^.+\\.[tj]s$": ["ts-jest", { tsconfig: "<rootDir>/tsconfig.spec.json" }],
},
moduleFileExtensions: ["ts", "js", "html"],
coverageDirectory: "../../coverage/apps/kysely-cli",
coverageDirectory: "../../coverage/apps/cli",
};
65 changes: 46 additions & 19 deletions apps/kysely-cli/project.json → apps/cli/project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kysely-cli",
"name": "cli",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/kysely-cli/src",
"sourceRoot": "apps/cli/src",
"projectType": "application",
"implicitDependencies": ["db-migrations"],
"targets": {
Expand All @@ -11,12 +11,12 @@
"options": {
"target": "node",
"compiler": "tsc",
"outputPath": "dist/apps/kysely-cli",
"main": "apps/kysely-cli/src/main.ts",
"tsConfig": "apps/kysely-cli/tsconfig.app.json",
"assets": ["apps/kysely-cli/src/assets"],
"outputPath": "dist/apps/cli",
"main": "apps/cli/src/main.ts",
"tsConfig": "apps/cli/tsconfig.app.json",
"assets": ["apps/cli/src/assets"],
"isolatedConfig": true,
"webpackConfig": "apps/kysely-cli/webpack.config.js",
"webpackConfig": "apps/cli/webpack.config.js",
"generatePackageJson": true
},
"configurations": {
Expand All @@ -27,15 +27,15 @@
"migrate": {
"executor": "@nx/js:node",
"options": {
"buildTarget": "kysely-cli:build",
"buildTarget": "cli:build",
"watch": false
},
"configurations": {
"development": {
"buildTarget": "kysely-cli:build:development"
"buildTarget": "cli:build:development"
},
"production": {
"buildTarget": "kysely-cli:build:production"
"buildTarget": "cli:build:production"
}
},
"dependsOn": [
Expand All @@ -48,15 +48,37 @@
"e2e": {
"executor": "@nx/js:node",
"options": {
"buildTarget": "kysely-cli:build",
"buildTarget": "cli:build",
"watch": false
},
"configurations": {
"development": {
"buildTarget": "kysely-cli:build:development"
"buildTarget": "cli:build:development"
},
"production": {
"buildTarget": "kysely-cli:build:production"
"buildTarget": "cli:build:production"
}
},
"dependsOn": [
{
"target": "build",
"dependencies": true
}
]
},
"repl": {
"executor": "@nx/js:node",
"options": {
"buildTarget": "cli:build",
"args": ["repl"],
"watch": false
},
"configurations": {
"development": {
"buildTarget": "cli:build:development"
},
"production": {
"buildTarget": "cli:build:production"
}
},
"dependsOn": [
Expand All @@ -69,16 +91,21 @@
"seed": {
"executor": "@nx/js:node",
"options": {
"buildTarget": "kysely-cli:build",
"buildTarget": "cli:build",
"args": ["seed"],
"watch": false
"watch": false,
"inspect": false
},
"configurations": {
"development": {
"buildTarget": "kysely-cli:build:development"
"buildTarget": "cli:build:development"
},
"production": {
"buildTarget": "kysely-cli:build:production"
"buildTarget": "cli:build:production"
},
"dryRun": {
"buildTarget": "cli:build:development",
"args": ["seed", "-d"]
}
},
"dependsOn": [
Expand All @@ -99,14 +126,14 @@
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/kysely-cli/**/*.ts"]
"lintFilePatterns": ["apps/cli/**/*.ts"]
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/kysely-cli/jest.config.ts",
"jestConfig": "apps/cli/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,26 @@ import { KyselyModule } from "@unteris/server/kysely";
import { ServerLocationModule } from "@unteris/server/location";
import { ServerLoggingModule } from "@unteris/server/logging";

import { AppController } from "./app.controller";
import { AppService } from "./app.service";
import { FullSeedCommand } from "./full-seed.command";
import { KyselyCliCommand } from "./kysely.command";
import { SeedCommand } from "./seed.command";
import { DeityCategoryQuestions } from "./seeds/deity-category.questions";
import { DeityDomainQuestions } from "./seeds/deity-domain.questions";
import { DeityQuestions } from "./seeds/deity.questions";
import { DomainQuestions } from "./seeds/domain.questions";
import { LocationQuestins } from "./seeds/location.question";
import { LocationQuestions } from "./seeds/location.question";
import { RepeatQuestions } from "./seeds/repeat.questions";
import { SeedTypeQuestions } from "./seeds/seed-type.questions";

@Module({
imports: [
KyselyModule,
ServerLoggingModule.forApplication("Kysely CLI", "ALL"),
OgmaModule.forFeatures([KyselyCliCommand, SeedCommand]),
ServerLoggingModule.forApplication("CLI", "DEBUG"),
OgmaModule.forFeatures([KyselyCliCommand, SeedCommand, FullSeedCommand]),
ServerDeitiesModule,
ServerLocationModule,
],
controllers: [AppController],
providers: [
AppService,
KyselyCliCommand,
SeedCommand,
DeityQuestions,
Expand All @@ -36,7 +33,8 @@ import { SeedTypeQuestions } from "./seeds/seed-type.questions";
SeedTypeQuestions,
RepeatQuestions,
DeityDomainQuestions,
LocationQuestins,
LocationQuestions,
FullSeedCommand,
],
})
export class AppModule {}
Loading

0 comments on commit 7732ebc

Please sign in to comment.