Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/out-tsc

# dependencies
/node_modules
node_modules

# IDEs and editors
/.idea
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What packages do we need to use this for? If it's only a few we should probably use public hoist pattern.
public-hoist-pattern[]=eslint
public-hoist-pattern[]=@types/*

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shamefully-hoist=true
28 changes: 28 additions & 0 deletions apis/api-journeys/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "@core/api-journeys",
"version": "0.0.0",
"private": true,
"dependencies": {
"express": "5.0.1",
"@nestjs/apollo": "13.0.4",
"@nestjs/bullmq": "11.0.3",
"@nestjs/cache-manager": "3.0.1",
"@nestjs/common": "11.0.16",
"@nestjs/core": "11.0.12",
"@nestjs/graphql": "13.0.4",
"@nestjs/platform-express": "11.0.12",
"class-transformer": "0.5.1",
"class-validator": "0.14.1",
"file-type": "^20.4.1",
"nestjs-ddtrace": "6.0.0",
"nestjs-pino": "4.4.0",
"adal-node": "0.2.4",
"@casl/ability": "6.7.3",
"@casl/prisma": "1.5.2",
"firebase-admin": "11.11.1"
},
"devDependencies": {
"@nestjs/schematics": "11.0.5",
"@nestjs/testing": "11.0.12"
}
}
2 changes: 1 addition & 1 deletion apis/api-journeys/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"watcher": {
"executor": "nx:run-commands",
"options": {
"command": "pnpm exec ts-node tools/scripts/generate-typings.ts api-journeys --transpileOnly"
"command": "pnpm exec ts-node apis/api-journeys/scripts/generate-typings.ts --transpileOnly"
}
},
"lint": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { join } from 'path'

import { GraphQLFederationDefinitionsFactory } from '@nestjs/graphql'

const definitionsFactory = new GraphQLFederationDefinitionsFactory()
definitionsFactory
.generate({
typePaths: [
join(process.cwd(), `apis/${process.argv[2]}/src/app/**/*.graphql`)
],
typePaths: [join(process.cwd(), 'apis/api-journeys/src/app/**/*.graphql')],
path: join(
process.cwd(),
`apis/${process.argv[2]}/src/app/__generated__/graphql.ts`
'apis/api-journeys/src/app/__generated__/graphql.ts'
),
Comment on lines +8 to 12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Avoid process.cwd()-dependent paths.

If this script is run from apis/api-journeys/, the current process.cwd() usage will double the path (e.g., apis/api-journeys/apis/api-journeys/...). Resolve paths relative to the script instead to make execution location-agnostic.

🔧 Suggested adjustment
-import { join } from 'path'
+import { join, resolve } from 'path'

 const definitionsFactory = new GraphQLFederationDefinitionsFactory()
+const apiJourneysRoot = resolve(__dirname, '..')

 definitionsFactory
   .generate({
-    typePaths: [join(process.cwd(), 'apis/api-journeys/src/app/**/*.graphql')],
+    typePaths: [join(apiJourneysRoot, 'src/app/**/*.graphql')],
     path: join(
-      process.cwd(),
-      'apis/api-journeys/src/app/__generated__/graphql.ts'
+      apiJourneysRoot,
+      'src/app/__generated__/graphql.ts'
     ),
📝 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.

Suggested change
typePaths: [join(process.cwd(), 'apis/api-journeys/src/app/**/*.graphql')],
path: join(
process.cwd(),
`apis/${process.argv[2]}/src/app/__generated__/graphql.ts`
'apis/api-journeys/src/app/__generated__/graphql.ts'
),
import { join, resolve } from 'path'
const definitionsFactory = new GraphQLFederationDefinitionsFactory()
const apiJourneysRoot = resolve(__dirname, '..')
definitionsFactory
.generate({
typePaths: [join(apiJourneysRoot, 'src/app/**/*.graphql')],
path: join(
apiJourneysRoot,
'src/app/__generated__/graphql.ts'
),
🤖 Prompt for AI Agents
In `@apis/api-journeys/scripts/generate-typings.ts` around lines 8 - 12, The
typePaths/path entries currently build locations with process.cwd() which makes
the script sensitive to the working directory; change them to resolve relative
to the script file (use __dirname or path.resolve with join from the script
directory) so typePaths and the output path (the variables referenced as
typePaths and path in this file) point to 'src/app/**/*.graphql' and
'src/app/__generated__/graphql.ts' relative to the script location rather than
process.cwd(); update any uses of join(process.cwd(), ...) to join(__dirname,
...) or path.resolve(__dirname, '..', 'src', ...) accordingly so the script runs
correctly from any working directory.

outputAs: 'class',
watch: true,
Expand Down
3 changes: 2 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,6 @@
],
"tui": {
"enabled": false
}
},
"packageManager": "pnpm"
}
12 changes: 0 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,6 @@
"@mui/x-tree-view": "^8.5.2",
"@mux/mux-node": "^11.0.0",
"@mux/upchunk": "^3.4.0",
"@nestjs/apollo": "^13.0.0",
"@nestjs/bullmq": "^11.0.0",
"@nestjs/cache-manager": "^3.0.0",
"@nestjs/common": "^11.0.1",
"@nestjs/core": "^11.0.1",
"@nestjs/graphql": "^13.0.0",
"@nestjs/platform-express": "^11.0.1",
"@next/bundle-analyzer": "^13.5.6",
"@next/eslint-plugin-next": "^15.5.2",
"@next/third-parties": "^15.1.7",
Expand Down Expand Up @@ -132,7 +125,6 @@
"@types/mailchimp__mailchimp_marketing": "^3.0.19",
"@types/node-fetch": "^2.6.13",
"@upstash/redis": "^1.35.3",
"adal-node": "^0.2.3",
"ai": "^5.0.86",
"algoliasearch": "^5.0.0",
"apollo-link-debounce": "^3.0.0",
Expand Down Expand Up @@ -179,8 +171,6 @@
"lodash": "^4.17.21",
"lucide-react": "^0.513.0",
"nanoid": "^3.3.7",
"nestjs-ddtrace": "6.0.0",
"nestjs-pino": "^4.0.0",
"next": "^15.5.7",
"next-absolute-url": "^1.2.2",
"next-firebase-auth": "^1.0.1",
Expand Down Expand Up @@ -274,8 +264,6 @@
"@jest/globals": "^30.1.1",
"@mermaid-js/mermaid-cli": "^11.0.0",
"@naxodev/nx-cloudflare": "5.0.2",
"@nestjs/schematics": "11.0.5",
"@nestjs/testing": "11.0.12",
"@nx/devkit": "22.0.2",
"@nx/esbuild": "22.0.2",
"@nx/eslint": "22.0.2",
Expand Down
615 changes: 407 additions & 208 deletions pnpm-lock.yaml

Large diffs are not rendered by default.