@platformatic/foundation 3.0.2 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/module.js CHANGED
@@ -10,6 +10,33 @@ let platformaticPackageVersion
10
10
 
11
11
  export const defaultPackageManager = 'npm'
12
12
 
13
+ // Keep this in sync with packages/create-wattpm/lib/index.js.
14
+ // @platformatic/node is purposely missing as it's the fallback option.
15
+ export const applicationTypes = [
16
+ { name: '@platformatic/nest', label: 'NestJS', dependencies: ['@nestjs/core'] },
17
+ { name: '@platformatic/next', label: 'Next.js', dependencies: ['next'] },
18
+ { name: '@platformatic/remix', label: 'Remix', dependencies: ['@remix-run/dev'] },
19
+ { name: '@platformatic/astro', label: 'Astro', dependencies: ['astro'] },
20
+ // Since Vite is often used with other frameworks, we must check for Vite last amongst frontend frameworks
21
+ { name: '@platformatic/vite', label: 'Vite', dependencies: ['vite'] },
22
+ {
23
+ name: '@platformatic/gateway',
24
+ label: 'Platformatic Gateway',
25
+ dependencies: ['@platformatic/gateway', '@platformatic/composer']
26
+ },
27
+ { name: '@platformatic/service', label: 'Platformatic Service', dependencies: ['@platformatic/service'] },
28
+ { name: '@platformatic/db', label: 'Platformatic DB', dependencies: ['@platformatic/db'] },
29
+ { name: '@platformatic/php', label: 'Platformatic PHP', dependencies: ['@platformatic/php'] },
30
+ { name: '@platformatic/ai-warp', label: 'AI-Warp', dependencies: ['@platformatic/ai-warp'] },
31
+ { name: '@platformatic/pg-hooks', label: 'Platformatic PostgreSQL Hooks', dependencies: ['@platformatic/pg-hooks'] },
32
+ {
33
+ name: '@platformatic/rabbitmq-hooks',
34
+ label: 'Platformatic RabbitMQ Hooks',
35
+ dependencies: ['@platformatic/rabbitmq-hooks']
36
+ },
37
+ { name: '@platformatic/kafka-hooks', label: 'Platformatic Kafka Hooks', dependencies: ['@platformatic/kafka-hooks'] }
38
+ ]
39
+
13
40
  export async function getLatestNpmVersion (pkg) {
14
41
  const res = await request(`https://registry.npmjs.org/${pkg}`)
15
42
  if (res.statusCode === 200) {
@@ -119,23 +146,15 @@ export async function detectApplicationType (root, packageJson) {
119
146
  let name
120
147
  let label
121
148
 
122
- if (hasDependency(packageJson, '@nestjs/core')) {
123
- name = '@platformatic/nest'
124
- label = 'NestJS'
125
- } else if (hasDependency(packageJson, 'next')) {
126
- name = '@platformatic/next'
127
- label = 'Next.js'
128
- } else if (hasDependency(packageJson, '@remix-run/dev')) {
129
- name = '@platformatic/remix'
130
- label = 'Remix'
131
- } else if (hasDependency(packageJson, 'astro')) {
132
- name = '@platformatic/astro'
133
- label = 'Astro'
134
- // Since Vite is often used with other frameworks, we must check for Vite last
135
- } else if (hasDependency(packageJson, 'vite')) {
136
- name = '@platformatic/vite'
137
- label = 'Vite'
138
- } else if (await hasJavascriptFiles(root)) {
149
+ for (const appType of applicationTypes) {
150
+ if (appType.dependencies.some(dep => hasDependency(packageJson, dep))) {
151
+ name = appType.name
152
+ label = appType.label
153
+ break
154
+ }
155
+ }
156
+
157
+ if (!name && (await hasJavascriptFiles(root))) {
139
158
  // If no specific framework is detected, we assume it's a generic Node.js application
140
159
  name = '@platformatic/node'
141
160
  label = 'Node.js'
package/lib/node.js CHANGED
@@ -16,9 +16,9 @@ export function checkNodeVersionForApplications () {
16
16
 
17
17
  export const features = {
18
18
  node: {
19
- reusePort: satisfies(process.version, '^22.12.0 || ^23.1.0') && !['win32', 'darwin'].includes(currentPlatform),
19
+ reusePort: satisfies(process.version, '^22.12.0 || ^23.1.0 || >=24.0.0') && !['win32', 'darwin'].includes(currentPlatform),
20
20
  worker: {
21
- getHeapStatistics: satisfies(process.version, '^22.18.0')
21
+ getHeapStatistics: satisfies(process.version, '^22.16.0 || >=24.0.0')
22
22
  }
23
23
  }
24
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/foundation",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
4
4
  "description": "Platformatic Foundation",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",