-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Moving to pnpm and ditching nx #727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
Caution Review failedThe pull request is closed. WalkthroughThis update restructures the monorepo by removing Nx workspace configurations, project-level Nx files, and Nx-specific build/test/lint scripts. It introduces standalone package.json, tsconfig, and NestJS/Next.js configuration files for each app, switches to pnpm workspaces, and simplifies Docker and deployment scripts. Numerous build, lint, and test configurations are refactored or deleted. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant PNPM as pnpm CLI
participant App as App (Backend/Frontend/Workers/Cron/Commands)
participant Docker as Docker
participant Caddy as Caddy Server
Dev->>PNPM: Run install/build scripts (pnpm)
PNPM->>App: Install dependencies, run build scripts
Dev->>Docker: Build image (single-stage)
Docker->>App: Copy source, install, build
Docker->>Caddy: Start Caddy after ports 4200/3000 ready (entrypoint.sh)
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (84)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 12
🔭 Outside diff range comments (1)
package.json (1)
71-81
: 🛠️ Refactor suggestionRemove leftover Nx dependencies.
Since you’re ditching Nx, the@nx/*
packages andnx
in dependencies should be removed to avoid unused bloat and potential confusion.Also applies to: 156-156
🧹 Nitpick comments (32)
pnpm-workspace.yaml (1)
1-3
: Add newline at end of fileThis pnpm workspace configuration correctly defines the workspace structure by including all packages under the
apps/
andlibraries/
directories, which is essential for the migration to pnpm. However, there's a missing newline at the end of the file as detected by linting.Add a newline at the end of the file to satisfy the linter:
packages: - apps/* - libraries/* +
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 3-3: no new line character at the end of file
(new-line-at-end-of-file)
apps/commands/package.json (1)
1-4
: Mark workspace package private
To prevent accidental publishing of internal apps, add"private": true
at the top level.{ + "private": true, "name": "postiz-command", "version": "1.0.0",
apps/cron/package.json (3)
2-4
: Fill in essential package metadata
Thedescription
andauthor
fields are empty, andkeywords
is an empty array. Consider adding meaningful values to improve project documentation and discoverability. Also, since this package is not intended for public publication, add"private": true
to prevent accidentalnpm publish
.
5-10
: Improve script portability and dependency declarations
Thedev
,build
, andstart
scripts rely ondotenv -e
and inlineNODE_ENV
assignments, which may not work consistently across environments (especially Windows). To enhance portability:
- Declare
dotenv-cli
andcross-env
indevDependencies
.- Use
cross-env
for setting environment variables.- Simplify paths if running from the project root.
Example:
"dev": "dotenv -e ../../.env -- cross-env NODE_ENV=development nest start --watch --entryFile=apps/cron/src/main", "build": "cross-env NODE_ENV=production nest build", "start": "dotenv -e ../../.env -- cross-env NODE_ENV=production node dist/apps/cron/src/main.js",
11-14
: Verify licensing and version strategy
The package is set to version1.0.0
with anISC
license. Confirm thatISC
aligns with your organization’s policy. If you manage versions centrally, consider adopting a workspace-wide versioning approach or synchronizing versions across all apps.apps/workers/tsconfig.json (1)
2-10
: Enhance type safety and output configuration
To catch issues earlier and produce consistent build outputs, consider:
- Enabling strict checks (
"strict": true
).- Adding
"esModuleInterop": true
alongsideallowSyntheticDefaultImports
.- Specifying input/output directories (
"rootDir": "src"
,"outDir": "dist"
).Example:
"compilerOptions": { + "strict": true, + "esModuleInterop": true, "module": "commonjs", "declaration": true, "removeComments": true, "allowSyntheticDefaultImports": true, "target": "es2017", "sourceMap": true, + "rootDir": "src", + "outDir": "dist" }apps/workers/package.json (2)
2-4
: Complete package metadata
Thedescription
andauthor
fields are blank, andkeywords
is an empty array. Populate these fields for clarity. Also, mark this package as private to prevent unintended publishing:+ "private": true
5-10
: Standardize environment variable handling in scripts
Scripts currently usedotenv -e
and inlineNODE_ENV
, which can vary by OS. Improve consistency by:
- Adding
dotenv-cli
andcross-env
todevDependencies
.- Refactoring scripts to use
cross-env
:"dev": "dotenv -e ../../.env -- cross-env NODE_ENV=development nest start --watch --entryFile=apps/workers/src/main", "build": "cross-env NODE_ENV=production nest build", "start": "dotenv -e ../../.env -- cross-env NODE_ENV=production node dist/apps/workers/src/main.js",apps/frontend/.gitignore (2)
3-12
: Remove obsolete Yarn/PnP ignore patterns
Since the monorepo now uses pnpm, Yarn-specific entries (.pnp
,.pnp.*
,.yarn/
) can be removed to declutter this file:-/ .pnp -/ .pnp.* -/ .yarn/*
23-26
: Add common IDE/editor directories
To avoid committing editor-specific files, consider ignoring:.vscode/ .idea/apps/backend/package.json (3)
2-4
: Enhance package metadata
Thedescription
,author
, andkeywords
fields are empty. Add meaningful content for documentation purposes. Also, include"private": true
if this package should not be published publicly:+ "private": true
5-10
: Refactor scripts for cross-platform consistency
As with other apps, scripts rely ondotenv -e
and inlineNODE_ENV
. Improve cross-OS support by addingdotenv-cli
andcross-env
todevDependencies
and updating scripts:"dev": "dotenv -e ../../.env -- cross-env NODE_ENV=development nest start --watch --entryFile=apps/backend/src/main", "build": "cross-env NODE_ENV=production nest build", "start": "dotenv -e ../../.env -- cross-env NODE_ENV=production node dist/apps/backend/src/main.js",
11-14
: Confirm license policy and version alignment
The package uses version1.0.0
and anISC
license. Ensure this aligns with your organization’s standards, and consider centralizing version management if you maintain multiple related packages.apps/cron/tsconfig.build.json (1)
15-17
: Consider enabling stricter type checkingCurrently,
skipLibCheck
istrue
and bothstrictNullChecks
andnoImplicitAny
are disabled. For improved type safety and earlier error detection, consider:
"skipLibCheck": false
"strictNullChecks": true
"noImplicitAny": true
apps/cron/tsconfig.json (2)
4-4
: Normalize casing for consistencyThe options
"module": "commonjs"
and"target": "ES2021"
use mixed case. To align with other configs, consider using"CommonJS"
and"ES2021"
consistently.Also applies to: 9-9
8-8
: Remove redundant optionThe
"noLib": false
setting is the default and can be omitted to reduce clutter.apps/commands/tsconfig.json (1)
4-4
: Consider consistent casing for optionsThe
module
andtarget
values use lowercase ("commonjs"
,"es2017"
). Standardizing to"CommonJS"
and"ES2017"
can improve readability and consistency.Also applies to: 8-8
apps/backend/nest-cli.json (1)
14-19
: Clean up unused plugin settingsSince
webpack
,assets
,watchAssets
, andplugins
are unused, consider removing these entries to simplify the config.apps/frontend/README.md (1)
16-37
: Optional: Add build and PM2 instructionsIf your
package.json
includesbuild
,start
, or PM2 scripts, consider documenting:npm run build npm run start pm2 start ecosystem.config.jsThis will help users complete the full deployment workflow.
.dockerignore (2)
5-6
: Avoid redundantnode_modules
ignore patterns.The patterns
node_modules/*
andnode_modules
are already covered by**/node_modules
. You can remove these duplicate entries to simplify the ignore file.
21-23
: Consolidate Git-related ignore patterns.You have both
.git
and.github
alongside the existing**/.git
. Consider keeping only the necessary root-level patterns or rely on**/.git
for consistency.var/docker/entrypoint.sh (1)
17-17
: Parameterize the Caddy configuration path.Hardcoding
--config /app/Caddyfile
reduces flexibility across environments. Consider using an environment variable (e.g.,CADDY_CONFIG
) to reference the config file.apps/commands/tsconfig.build.json (1)
5-22
: Consider enabling stricter type checking.Several strict options (
strictNullChecks
,noImplicitAny
, etc.) are disabled. Enablingstrict
or selected strict flags can improve type safety and catch errors early.apps/backend/tsconfig.build.json (2)
4-22
: Consider tightening TypeScript strictness.
Flags likestrictNullChecks
,noImplicitAny
, andstrictBindCallApply
are currently disabled. Enabling them—or simply using"strict": true
—can help catch potential bugs at compile time.
1-23
: Add explicitinclude
to clarify compilation scope.
Relying on default file inclusion may inadvertently compile unwanted files. Consider adding an"include": ["src/**/*.ts"]
(or your actual source folder) to make the build inputs explicit.apps/workers/tsconfig.build.json (2)
4-22
: Consider tightening TypeScript strictness.
Flags likestrictNullChecks
,noImplicitAny
, andstrictBindCallApply
are currently disabled. Enabling them—or simply using"strict": true
—can help catch potential bugs at compile time.
1-23
: Add explicitinclude
to clarify compilation scope.
Relying on default file inclusion may inadvertently compile unintended files. Consider adding an"include": ["src/**/*.ts"]
(or your actual source folder) to make the build inputs explicit.package.json (2)
36-36
: Usepnpx
instead ofnpx
for Prisma reset.
For consistency in a pnpm-based repo, update:- "prisma-reset": "cd ./libraries/... && pnpx prisma db push --force-reset && npx prisma db push", + "prisma-reset": "cd ./libraries/... && pnpx prisma db push --force-reset && pnpx prisma db push",
39-39
: Alignpostinstall
with pnpm.
You’re invokingnpm run ...
here. For consistency and to leverage pnpm’s hooks, consider switching topnpm run update-plugins && pnpm run prisma-generate
.Dockerfile.dev (3)
1-3
: Combine installation steps to reduce layers.
You can merge the twoRUN
commands:RUN apk add --no-cache g++ make py3-pip supervisor bash caddy && \ npm --no-update-notifier --no-fund --global install [email protected] pm2This reduces image layers and speeds up builds.
2-3
: Evaluate necessity of Supervisor and Caddy layers.
You installsupervisor
, copy its configs, and bring in Caddy viaentrypoint.sh
, yet the finalCMD
invokespnpm run pm2
. If PM2 and your entrypoint script handle all processes, these Supervisor bits may be dead weight. Consider removing or consolidating.Also applies to: 8-12
14-15
: Consider a multi-stage build for a lean runtime.
Installing dev dependencies and building in the same layer keeps them in the final image. A multi-stage Dockerfile can install/build in one stage and then copy only production artifacts into a slimmer runtime image.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
package-lock.json
is excluded by!**/package-lock.json
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (84)
.dockerignore
(1 hunks).npmrc
(1 hunks)Dockerfile.dev
(1 hunks)apps/backend/.eslintrc.json
(0 hunks)apps/backend/.gitignore
(1 hunks)apps/backend/jest.config.ts
(0 hunks)apps/backend/nest-cli.json
(1 hunks)apps/backend/package.json
(1 hunks)apps/backend/project.json
(0 hunks)apps/backend/src/api/routes/auth.controller.ts
(2 hunks)apps/backend/src/api/routes/posts.controller.ts
(1 hunks)apps/backend/tsconfig.app.json
(0 hunks)apps/backend/tsconfig.build.json
(1 hunks)apps/backend/tsconfig.json
(1 hunks)apps/backend/tsconfig.spec.json
(0 hunks)apps/backend/webpack.config.js
(0 hunks)apps/commands/.eslintrc.json
(0 hunks)apps/commands/.gitignore
(1 hunks)apps/commands/jest.config.ts
(0 hunks)apps/commands/nest-cli.json
(1 hunks)apps/commands/package.json
(1 hunks)apps/commands/project.json
(0 hunks)apps/commands/tsconfig.app.json
(0 hunks)apps/commands/tsconfig.build.json
(1 hunks)apps/commands/tsconfig.json
(1 hunks)apps/commands/tsconfig.spec.json
(0 hunks)apps/commands/webpack.config.js
(0 hunks)apps/cron/.eslintrc.json
(0 hunks)apps/cron/.gitignore
(1 hunks)apps/cron/jest.config.ts
(0 hunks)apps/cron/nest-cli.json
(1 hunks)apps/cron/package.json
(1 hunks)apps/cron/project.json
(0 hunks)apps/cron/tsconfig.app.json
(0 hunks)apps/cron/tsconfig.build.json
(1 hunks)apps/cron/tsconfig.json
(1 hunks)apps/cron/tsconfig.spec.json
(0 hunks)apps/cron/webpack.config.js
(0 hunks)apps/frontend/.eslintrc.json
(0 hunks)apps/frontend/.gitignore
(1 hunks)apps/frontend/README.md
(1 hunks)apps/frontend/index.d.ts
(0 hunks)apps/frontend/jest.config.ts
(0 hunks)apps/frontend/next-env.d.ts
(0 hunks)apps/frontend/next.config.js
(2 hunks)apps/frontend/package.json
(1 hunks)apps/frontend/postcss.config.js
(0 hunks)apps/frontend/postcss.config.mjs
(1 hunks)apps/frontend/project.json
(0 hunks)apps/frontend/src/app/(site)/layout.tsx
(0 hunks)apps/frontend/src/app/auth/return.url.component.tsx
(1 hunks)apps/frontend/src/components/launches/editor.tsx
(0 hunks)apps/frontend/src/components/launches/helpers/use.values.ts
(1 hunks)apps/frontend/src/components/launches/integration.redirect.component.tsx
(1 hunks)apps/frontend/src/components/launches/polonto/polonto.picture.generation.tsx
(1 hunks)apps/frontend/src/components/layout/new.subscription.tsx
(1 hunks)apps/frontend/tailwind.config.js
(2 hunks)apps/frontend/tsconfig.json
(1 hunks)apps/frontend/tsconfig.spec.json
(0 hunks)apps/workers/.eslintrc.json
(0 hunks)apps/workers/.gitignore
(1 hunks)apps/workers/jest.config.ts
(0 hunks)apps/workers/nest-cli.json
(1 hunks)apps/workers/package.json
(1 hunks)apps/workers/project.json
(0 hunks)apps/workers/tsconfig.app.json
(0 hunks)apps/workers/tsconfig.build.json
(1 hunks)apps/workers/tsconfig.json
(1 hunks)apps/workers/tsconfig.spec.json
(0 hunks)apps/workers/webpack.config.js
(0 hunks)libraries/nestjs-libraries/project.json
(0 hunks)libraries/plugins/project.json
(0 hunks)libraries/react-shared-libraries/project.json
(0 hunks)migrations.json
(0 hunks)nx.json
(0 hunks)package.json
(5 hunks)pnpm-workspace.yaml
(1 hunks)tsconfig.base.json
(2 hunks)tsconfig.json
(1 hunks)var/docker/entrypoint.sh
(1 hunks)var/docker/supervisord/backend.conf
(0 hunks)var/docker/supervisord/cron.conf
(0 hunks)var/docker/supervisord/frontend.conf
(0 hunks)var/docker/supervisord/workers.conf
(0 hunks)
💤 Files with no reviewable changes (42)
- apps/frontend/src/app/(site)/layout.tsx
- apps/backend/tsconfig.spec.json
- apps/cron/webpack.config.js
- apps/backend/tsconfig.app.json
- apps/frontend/next-env.d.ts
- libraries/nestjs-libraries/project.json
- var/docker/supervisord/workers.conf
- apps/frontend/tsconfig.spec.json
- libraries/react-shared-libraries/project.json
- apps/frontend/src/components/launches/editor.tsx
- apps/workers/webpack.config.js
- apps/workers/tsconfig.app.json
- apps/workers/tsconfig.spec.json
- apps/frontend/postcss.config.js
- var/docker/supervisord/backend.conf
- var/docker/supervisord/frontend.conf
- apps/commands/tsconfig.app.json
- libraries/plugins/project.json
- apps/cron/tsconfig.spec.json
- apps/backend/webpack.config.js
- apps/commands/jest.config.ts
- apps/cron/jest.config.ts
- apps/frontend/.eslintrc.json
- apps/workers/project.json
- apps/commands/webpack.config.js
- apps/frontend/project.json
- migrations.json
- apps/workers/jest.config.ts
- apps/workers/.eslintrc.json
- var/docker/supervisord/cron.conf
- apps/backend/.eslintrc.json
- apps/backend/jest.config.ts
- apps/cron/tsconfig.app.json
- apps/frontend/jest.config.ts
- apps/cron/.eslintrc.json
- apps/commands/.eslintrc.json
- apps/frontend/index.d.ts
- apps/commands/tsconfig.spec.json
- nx.json
- apps/cron/project.json
- apps/backend/project.json
- apps/commands/project.json
🧰 Additional context used
🪛 YAMLlint (1.35.1)
pnpm-workspace.yaml
[error] 3-3: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (36)
apps/frontend/postcss.config.mjs (1)
1-8
: The PostCSS configuration is properly structured but missing autoprefixerThe configuration is correctly typed and properly exports the config object. However, the previous configuration included both
tailwindcss
andautoprefixer
plugins, while this new configuration only includestailwindcss
.Was the removal of
autoprefixer
intentional? Autoprefixer automatically adds vendor prefixes to CSS properties for better browser compatibility. Consider adding it back:/** @type {import('postcss-load-config').Config} */ const config = { plugins: { tailwindcss: {}, + autoprefixer: {}, }, }; export default config;
apps/backend/.gitignore (1)
1-7
: Appropriate .gitignore patterns for the backend applicationThe .gitignore file correctly excludes build artifacts (dist/), dependencies (node_modules/), and editor swap files, which is appropriate for a Node.js backend application.
apps/commands/.gitignore (1)
1-7
: Appropriate .gitignore patterns for the commands applicationThe .gitignore file correctly excludes build artifacts (dist/), dependencies (node_modules/), and editor swap files, which is appropriate for a Node.js application.
apps/backend/src/api/routes/posts.controller.ts (1)
57-57
:✅ Verification successful
Breaking API change: 'id' parameter is now mandatory
The route has been changed from
/marketplace/:id?
to/marketplace/:id
, making theid
parameter mandatory instead of optional. This is a breaking change that could affect API clients.Verify that no clients are calling this endpoint without providing an 'id'. If clients need to access marketplace posts without an id, consider:
- Adding a separate endpoint for that case, or
- Implementing a fallback in the controller method to handle missing ids
🏁 Script executed:
#!/bin/bash # Search for frontend code that might be calling the marketplace endpoint without an id rg --type ts --type js "(/posts/marketplace/(?!\$)|/posts/marketplace/?(?!\$)|/posts/marketplace$|/posts/marketplace\s)" apps/frontend/Length of output: 452
I’ll run a broader search in the frontend for any references to the
/posts/marketplace
endpoint without using look-around:
🏁 Script executed:
#!/bin/bash # Search for any frontend references to the marketplace endpoint rg "/posts/marketplace" -n apps/frontend/Length of output: 293
No breaking changes in frontend clients: all calls include an
id
A search in
apps/frontend
shows every usage of/posts/marketplace
includes a dynamicid
:
apps/frontend/src/components/launches/add.edit.model.tsx:522
apps/frontend/src/components/launches/add.edit.model.tsx:527
Since there are no client calls without an
id
, making theid
parameter mandatory will not break existing front-end functionality.If you expose this endpoint to other consumers (mobile apps or third-party clients), update your API documentation or provide a fallback route as needed.
apps/workers/.gitignore (1)
1-8
: Standard .gitignore for Node.js project is well structured.This is a good addition that aligns with the migration to pnpm by establishing app-specific configurations. The file properly ignores build outputs, dependencies, and editor-specific files.
apps/frontend/tailwind.config.js (1)
5-6
: Content glob patterns simplified from Nx dependencyThe configuration has been updated to use direct static glob patterns instead of the previous dynamic Nx import (
createGlobPatternsForDependencies
). This aligns with the PR objective of removing Nx dependencies.apps/frontend/next.config.js (2)
1-7
: Next.js configuration simplified from Nx plugin-based approachThe configuration has been refactored from an Nx-based approach to a standard Next.js configuration, aligning with the PR objective of removing Nx.
The addition of
proxyTimeout: 90_000
is notable - make sure this timeout value is appropriate for your API needs.
45-45
: Module system updated to use ES module export syntaxChanged from CommonJS
module.exports
to ES modulesexport default
, which is more modern but ensure your Node.js environment supports this syntax.apps/frontend/src/components/launches/polonto/polonto.picture.generation.tsx (1)
1-1
: Added Next.js client directiveThe
'use client';
directive is correctly added at the top of the file, explicitly marking this component as client-side in Next.js's React Server Components paradigm. This aligns with the migration to pnpm and is necessary for components that use client-side features such as state and event handlers.apps/frontend/tsconfig.json (1)
19-19
: LGTM: Changed array formatThe formatting change for the "types" array from multi-line to single-line maintains the same functionality while making the configuration more concise.
tsconfig.json (1)
1-3
: LGTM: Added root tsconfig configurationGood addition of a minimal root-level TypeScript configuration that extends the base config. This provides a central point for TypeScript settings across the workspace and is a standard practice in pnpm-managed monorepos.
apps/backend/src/api/routes/auth.controller.ts (2)
105-105
: Improved type safety in error handlingAdded explicit type annotation for the caught error, which improves type safety in the error handling logic.
169-169
: Improved type safety in error handlingAdded explicit type annotation for the caught error, which improves type safety in the error handling logic.
apps/frontend/src/components/layout/new.subscription.tsx (1)
2-2
: Consistent component typing using React.FC.
TypingNewSubscription
asFC
improves consistency with other components and ensures correct typing for props (even if none). This aligns with the migrations of other frontend components.Also applies to: 5-5
apps/cron/.gitignore (1)
1-8
: .gitignore looks good.
The patterns correctly ignore build artifacts andnode_modules
for thecron
app. This aligns with sibling directories..npmrc (1)
1-5
: Enable pnpm workspace features.
The.npmrc
entries align with the pnpm workspace setup and enforce hoisting, manifest restrictions, and automatic workspace package injection.apps/frontend/src/app/auth/return.url.component.tsx (1)
3-3
: Add explicit React.FC typing.
AnnotatingReturnUrlComponent
asFC
improves type consistency across frontend components and aligns with the new typing conventions.Also applies to: 5-5
apps/frontend/src/components/launches/integration.redirect.component.tsx (1)
6-11
: Explicit React.FC typing is well‐aligned
Adding theFC
annotation and importinguseEffect
improves consistency and type safety across components without altering behavior.apps/backend/tsconfig.json (1)
4-10
: Verify complete TypeScript configuration inheritance
The simplified compiler options look good, but please confirm that your basetsconfig.base.json
or the newtsconfig.build.json
providesrootDir
,outDir
, and any required strictness (e.g.,strict
,skipLibCheck
) to ensure builds include/exclude the correct files (e.g., test specs).apps/cron/tsconfig.build.json (2)
4-14
: Compiler options look aligned with NestJS needsFlags like
emitDecoratorMetadata
,experimentalDecorators
,removeComments
, andincremental
are correctly configured for a NestJS build. These options should support both development and CI builds as intended.Also applies to: 18-20
21-21
: Verify output directory consistencyThe
outDir
is set to./dist
; ensure that your build and Docker scripts reference this path correctly.apps/cron/tsconfig.json (2)
2-2
: Validate shared config pathEnsure that
../../tsconfig.base.json
exists and contains the expected shared compiler settings for all apps.
5-7
: Compiler options are appropriateEnabling
declaration
,removeComments
,allowSyntheticDefaultImports
, andsourceMap
supports both development and tooling integrations.Also applies to: 10-10
apps/commands/tsconfig.json (2)
2-2
: Ensure shared config path is accessibleVerify that
../../tsconfig.base.json
exists and provides the baseline settings you expect across the monorepo.
5-7
: Compiler options look solidSettings for
declaration
,removeComments
,allowSyntheticDefaultImports
,sourceMap
, andesModuleInterop
are all appropriate for a commands-oriented build.Also applies to: 9-10
apps/backend/nest-cli.json (1)
12-13
: Compiler integration is correct
manualRestart
andtsConfigPath
correctly reference the new build config and enable live reload behavior.apps/frontend/README.md (1)
1-15
: Documentation is clear and comprehensiveThe README covers setup instructions for npm, Yarn, pnpm, and bun, plus development workflow and hot-reload guidance. Great work!
.dockerignore (2)
7-7
: Confirm existence ofdocker-data
directory.Ensure the
docker-data/
directory exists in the project structure or update this pattern if the directory name differs.
10-14
: Explicitly ignore new build output directories.The new entries for
/apps/frontend/.next
and each/apps/*/dist
align with the pnpm migration and removal of Nx—this keeps your Docker context lean by excluding compiled artifacts.apps/commands/tsconfig.build.json (1)
1-4
: Verify base configuration extension and exclusions.This file correctly extends
./tsconfig.json
and excludes common directories and spec files. Ensure your roottsconfig.json
includes all shared compiler options as expected.apps/backend/tsconfig.build.json (1)
1-3
: Base config extension and exclusions are correct.
Extending./tsconfig.json
and excludingnode_modules
,test
,dist
, and spec files is appropriate for a clean production build.apps/workers/tsconfig.build.json (1)
1-3
: Base config extension and exclusions are correct.
Extending./tsconfig.json
and excludingnode_modules
,test
,dist
, and spec files is appropriate for a clean production build.package.json (2)
3-7
: Verify license change and version bump.
You've moved from version0.0.0
to1.0.0
and switched the license toAGPL-3.0
. Ensure this meets your project’s legal requirements and is compatible with your dependencies’ licenses.
12-12
: Package manager specification is correct.
Locking"packageManager": "[email protected]"
ensures consistent installs across environments.Dockerfile.dev (2)
7-7
: Ensure.dockerignore
covers unwanted files.
Since youCOPY . /app
, verify your.dockerignore
excludesnode_modules
,dist
, and other build artifacts so they’re not baked into the image.
19-19
: CMD to start PM2 processes is correct.
UsingCMD ["pnpm", "run", "pm2"]
aligns with your PM2-based startup script inpackage.json
.
"incremental": true, | ||
"strictNullChecks": false, | ||
"noImplicitAny": true, | ||
"strictBindCallApply": false, | ||
"noFallthroughCasesInSwitch": true, | ||
"strict": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Watch out for conflicting TypeScript strictness settings
While the addition of "incremental": true
will improve build performance, there's a potential conflict in the strictness settings. You've enabled "strict": true
which activates all strict type-checking options, but simultaneously disabled specific strict checks like "strictNullChecks": false
and "strictBindCallApply": false
.
While this will work (explicit settings override the strict
setting), it might be confusing for developers. Consider either:
- Only specifying the exceptions to strict mode, or
- Not using
"strict": true
and enabling individual checks explicitly
🏁 Script executed:
#!/bin/bash
# Check for any TypeScript errors that might be occurring with the new configuration
fd -e ts -e tsx -d 3 . apps libraries | head -n 10 | xargs -I{} echo "// Checking: {}"
Length of output: 472
Streamline TypeScript strictness configuration
Your tsconfig.base.json
currently reads:
"incremental": true,
"strictNullChecks": false,
"noImplicitAny": true,
"strictBindCallApply": false,
"noFallthroughCasesInSwitch": true,
"strict": true,
Because "strict": true
enables all strict flags and your explicit false
settings override it, the build remains valid. However, mixing the aggregate strict
flag with per-rule overrides can be confusing for future maintainers. To improve clarity, please choose one of the following approaches:
- Keep
"strict": true
and document only the exceptions (e.g. in comments or a dedicated overrides section). - Remove
"strict": true
and explicitly enable each strictness check you want (e.g."noImplicitAny": true
,"noFallthroughCasesInSwitch": true
, etc.).
Either pattern will make it clear which checks are intentionally disabled.
@@ -44,6 +44,7 @@ export const useValues = ( | |||
return () => ({ ...form.getValues(), __type: identifier }); | |||
}, [form, integration]); | |||
|
|||
// @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Replace // @ts-ignore
with proper typing.
Suppressing TypeScript errors via @ts-ignore
can mask genuine type issues and reduce maintainability. Instead, update the type of finalInformation
to allow indexed assignment or use a nullish coalescing assignment:
-finalInformation[integration] = finalInformation[integration] || {};
+finalInformation[integration] ??= {} as typeof finalInformation[string];
This removes the need for // @ts-ignore
while preserving type safety.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
// @ts-ignore | |
finalInformation[integration] ??= {} as typeof finalInformation[string]; |
{ | ||
"name": "postiz-command", | ||
"version": "1.0.0", | ||
"description": "", | ||
"scripts": { | ||
"dev": "dotenv -e ../../.env -- nest start --watch --entryFile=./apps/command/src/main", | ||
"build": "NODE_ENV=production nest build", | ||
"start": "node ./dist/apps/command/src/main.js" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define package dependencies
Right now there’s no dependencies
or devDependencies
section, so NestJS and dotenv
won’t be installed in this workspace package. Please add the required runtime and build deps.
{
"name": "postiz-command",
"version": "1.0.0",
"description": "",
"scripts": {
"dev": "dotenv -e ../../.env -- nest start --watch --entryFile=./apps/command/src/main",
"build": "NODE_ENV=production nest build",
"start": "node ./dist/apps/command/src/main.js"
},
+ "dependencies": {
+ "@nestjs/common": "^9.0.0",
+ "@nestjs/core": "^9.0.0",
+ "dotenv": "^10.0.0"
+ },
+ "devDependencies": {
+ "@nestjs/cli": "^9.0.0",
+ "typescript": "^4.9.0"
+ }
}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
{ | |
"name": "postiz-command", | |
"version": "1.0.0", | |
"description": "", | |
"scripts": { | |
"dev": "dotenv -e ../../.env -- nest start --watch --entryFile=./apps/command/src/main", | |
"build": "NODE_ENV=production nest build", | |
"start": "node ./dist/apps/command/src/main.js" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC" | |
} | |
{ | |
"name": "postiz-command", | |
"version": "1.0.0", | |
"description": "", | |
"scripts": { | |
"dev": "dotenv -e ../../.env -- nest start --watch --entryFile=./apps/command/src/main", | |
"build": "NODE_ENV=production nest build", | |
"start": "node ./dist/apps/command/src/main.js" | |
}, | |
"dependencies": { | |
"@nestjs/common": "^9.0.0", | |
"@nestjs/core": "^9.0.0", | |
"dotenv": "^10.0.0" | |
}, | |
"devDependencies": { | |
"@nestjs/cli": "^9.0.0", | |
"typescript": "^4.9.0" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC" | |
} |
{ | ||
"name": "postiz-frontend", | ||
"version": "1.0.0", | ||
"description": "", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "dotenv -e ../../.env -- next dev -p 4200", | ||
"build": "next build", | ||
"start": "dotenv -e ../../.env -- next start -p 4200", | ||
"pm2": "pm2 start pnpm --name frontend -- start" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declare frontend dependencies
This package.json
lists no dependencies
or devDependencies
, so Next.js, React, and dotenv
likely aren’t installed here. Please add them (or verify they’re hoisted by the workspace).
{
"name": "postiz-frontend",
"version": "1.0.0",
"description": "",
"type": "module",
+ "private": true,
"scripts": {
"dev": "dotenv -e ../../.env -- next dev -p 4200",
"build": "next build",
"start": "dotenv -e ../../.env -- next start -p 4200",
"pm2": "pm2 start pnpm --name frontend -- start"
},
+ "dependencies": {
+ "react": "^18.0.0",
+ "react-dom": "^18.0.0",
+ "next": "^13.0.0",
+ "dotenv": "^10.0.0"
+ },
+ "devDependencies": {
+ "typescript": "^4.9.0"
+ }
}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
{ | |
"name": "postiz-frontend", | |
"version": "1.0.0", | |
"description": "", | |
"type": "module", | |
"scripts": { | |
"dev": "dotenv -e ../../.env -- next dev -p 4200", | |
"build": "next build", | |
"start": "dotenv -e ../../.env -- next start -p 4200", | |
"pm2": "pm2 start pnpm --name frontend -- start" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC" | |
} | |
{ | |
"name": "postiz-frontend", | |
"version": "1.0.0", | |
"description": "", | |
"type": "module", | |
"private": true, | |
"scripts": { | |
"dev": "dotenv -e ../../.env -- next dev -p 4200", | |
"build": "next build", | |
"start": "dotenv -e ../../.env -- next start -p 4200", | |
"pm2": "pm2 start pnpm --name frontend -- start" | |
}, | |
"dependencies": { | |
"react": "^18.0.0", | |
"react-dom": "^18.0.0", | |
"next": "^13.0.0", | |
"dotenv": "^10.0.0" | |
}, | |
"devDependencies": { | |
"typescript": "^4.9.0" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC" | |
} |
apps/cron/nest-cli.json
Outdated
"collection": "@nestjs/schematics", | ||
"monorepo": false, | ||
"sourceRoot": "src", | ||
"entryFile": "../../dist/workers/apps/workers/src/main", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the entryFile
path for the cron app
The entryFile
currently points to the workers output rather than cron. It should reference the cron dist directory.
- "entryFile": "../../dist/workers/apps/workers/src/main",
+ "entryFile": "../../dist/apps/cron/src/main",
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"entryFile": "../../dist/workers/apps/workers/src/main", | |
"entryFile": "../../dist/apps/cron/src/main", |
# Wait for port 4200 to be open | ||
while ! nc -z localhost 4200; do | ||
echo "Waiting for port 4200..." | ||
sleep 1 | ||
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add timeout and strict error handling to port checks.
These loops will wait indefinitely if services fail to start. Introducing a timeout and enabling strict mode will make the script more robust.
Example diff:
set -o xtrace
+set -euo pipefail
# Wait for port 4200 to be open
while ! nc -z localhost 4200; do
+ if [ $SECONDS -ge 60 ]; then
+ echo "Timeout waiting for port 4200" >&2
+ exit 1
+ fi
echo "Waiting for port 4200..."
sleep 1
done
# Wait for port 3000 to be open
while ! nc -z localhost 3000; do
+ if [ $SECONDS -ge 60 ]; then
+ echo "Timeout waiting for port 3000" >&2
+ exit 1
+ fi
echo "Waiting for port 3000..."
sleep 1
done
Also applies to: 11-15
"collection": "@nestjs/schematics", | ||
"monorepo": false, | ||
"sourceRoot": "src", | ||
"entryFile": "../../dist/workers/apps/workers/src/main", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect entryFile
path.
entryFile
should reference the source entry (e.g., main
) relative to sourceRoot
, not the compiled dist
. This misconfiguration will break CLI commands.
Apply this diff:
-"entryFile": "../../dist/workers/apps/workers/src/main",
+"entryFile": "main",
apps/commands/nest-cli.json
Outdated
"collection": "@nestjs/schematics", | ||
"monorepo": false, | ||
"sourceRoot": "src", | ||
"entryFile": "../../dist/backend/apps/backend/src/main", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong entryFile
reference.
This points to the backend's dist
folder instead of the commands source—likely a copy-paste error that will prevent proper CLI scaffolding.
Proposed fix:
-"entryFile": "../../dist/backend/apps/backend/src/main",
+"entryFile": "main",
package.json
Outdated
"prisma-reset": "cd ./libraries/nestjs-libraries/src/database/prisma && npx prisma db push --force-reset && npx prisma db push", | ||
"start:prod": "pnpm --filter ./apps/backend run start", | ||
"commands:build:development": "pnpm --filter ./apps/commands run build", | ||
"start:prod:frontend": "pnpm --filter ./apps/backend run start", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical: Wrong filter in start:prod:frontend
.
The script targets ./apps/backend
instead of ./apps/frontend
. This will start the backend under the wrong alias.
Apply this diff:
- "start:prod:frontend": "pnpm --filter ./apps/backend run start",
+ "start:prod:frontend": "pnpm --filter ./apps/frontend run start",
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"start:prod:frontend": "pnpm --filter ./apps/backend run start", | |
"start:prod:frontend": "pnpm --filter ./apps/frontend run start", |
package.json
Outdated
"start:prod:frontend": "pnpm --filter ./apps/backend run start", | ||
"start:prod:workers": "pnpm --filter ./apps/workers run start", | ||
"start:prod:cron": "pnpm --filter ./apps/cron run start", | ||
"workers": "rm -rf dist/backend && pnpm --filter ./apps/workers run dev", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical: Incorrect dist folder cleanup in workers
script.
It removes dist/backend
before running the workers dev server. It should remove the workers output:
- "workers": "rm -rf dist/backend && pnpm --filter ./apps/workers run dev",
+ "workers": "rm -rf dist/workers && pnpm --filter ./apps/workers run dev",
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"workers": "rm -rf dist/backend && pnpm --filter ./apps/workers run dev", | |
"workers": "rm -rf dist/workers && pnpm --filter ./apps/workers run dev", |
Docstrings generation was requested by @nevo-david. * #727 (comment) The following files were modified: * `apps/frontend/src/app/(site)/layout.tsx`
Note Generated docstrings for this pull request at #728 |
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Chores
.gitignore
and.dockerignore
files for better dependency and build artifact management.package.json
.Documentation
Style
Tests
Revert