@produtype/core 0.50.0 → 0.51.0

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/README.md CHANGED
@@ -174,7 +174,7 @@ prodkit plan ../my-app --output prodkit-plan.md
174
174
 
175
175
  _Generated from the analyzer itself — run `npm run docs:stacks` after changing a detector._
176
176
 
177
- - **Backend:** Express, Next.js, NestJS, Fastify, Hono, Elysia, Koa, AdonisJS, SvelteKit, Remix, Nuxt, Nitro, Astro, Django, Flask, FastAPI, aiohttp, Litestar, Sanic, Tornado, Starlette, Streamlit, Gradio, Dash, Chainlit, Gin, Echo, Fiber, chi, Gorilla, Beego, Go, Axum, Actix Web, Rocket, Warp, Tide, Poem, Salvo, Tower HTTP, Rails, Sinatra, Hanami, Roda, Grape, Ruby, Laravel, Symfony, Slim, CodeIgniter, CakePHP, Yii, PHP, ASP.NET Core, .NET
177
+ - **Backend:** Express, Next.js, NestJS, Fastify, Hono, Elysia, Koa, AdonisJS, SvelteKit, Remix, Nuxt, Nitro, Astro, Django, Flask, FastAPI, aiohttp, Litestar, Sanic, Tornado, Starlette, Streamlit, Gradio, Dash, Chainlit, Gin, Echo, Fiber, chi, Gorilla, Beego, Go, Axum, Actix Web, Rocket, Warp, Tide, Poem, Salvo, Tower HTTP, Spring Boot, Quarkus, Micronaut, Ktor, Javalin, Vert.x, Dropwizard, Helidon, Rails, Sinatra, Hanami, Roda, Grape, Ruby, Laravel, Symfony, Slim, CodeIgniter, CakePHP, Yii, PHP, ASP.NET Core, .NET
178
178
  - **Frontend:** React, Vite, Vue, Nuxt, Svelte, Angular, Astro, Solid, Qwik, Preact, Remix, htmx, Tailwind CSS, Electron
179
179
  - **Mobile:** Flutter, React Native, iOS (native), Android (native)
180
180
  - **Databases:** Postgres, MySQL, SQLite, SQL Server, MongoDB, Redis, Firestore, DynamoDB, Convex
@@ -525,7 +525,30 @@ async function analyzeProject(projectPath) {
525
525
  * reported, which is the direction to err in — the catalog is the project's own
526
526
  * statement about what it builds with.
527
527
  */
528
+ /**
529
+ * pom.xml, read for the coordinates a Maven project declares.
530
+ *
531
+ * A Spring Boot REST API with Spring Security and PostgreSQL reported no backend and
532
+ * no database. The manifest was recognised well enough to name the package manager
533
+ * "maven" and then never opened — the same shape of gap Rust had, in the larger
534
+ * ecosystem.
535
+ *
536
+ * `<parent>` is read alongside `<dependencies>` because that is where Spring Boot
537
+ * declares itself: `spring-boot-starter-parent` is the single line that makes a
538
+ * project a Spring Boot project, and a starter listed below it inherits its version
539
+ * from there rather than stating one.
540
+ *
541
+ * Regular expressions rather than an XML parser, for the reason the others give: the
542
+ * shape being read is two adjacent elements, and a manifest this cannot read yields
543
+ * no dependencies rather than a wrong answer.
544
+ */
528
545
  const gradleDeps = [];
546
+ for (const file of allFiles.filter((f) => /(^|\/)pom\.xml$/.test(f))) {
547
+ const raw = (await (0, readTextFileSafe_1.readTextFileSafe)(root, file)) ?? '';
548
+ for (const match of raw.matchAll(/<groupId>\s*([^<\s]+)\s*<\/groupId>\s*<artifactId>\s*([^<\s]+)\s*<\/artifactId>/g)) {
549
+ gradleDeps.push(`${match[1]}:${match[2]}`.toLowerCase());
550
+ }
551
+ }
529
552
  for (const file of allFiles.filter((f) => /(^|\/)build\.gradle(\.kts)?$/.test(f))) {
530
553
  const raw = (await (0, readTextFileSafe_1.readTextFileSafe)(root, file)) ?? '';
531
554
  for (const match of raw.matchAll(/\b(?:implementation|api|compileOnly|runtimeOnly|kapt|ksp|annotationProcessor|testImplementation)\s*[( ]\s*["']([^"']+)["']/g)) {
@@ -25,6 +25,25 @@ export declare const GO_BACKEND_FRAMEWORKS: Array<[string, string[]]>;
25
25
  * at all.
26
26
  */
27
27
  export declare const RUST_BACKEND_FRAMEWORKS: Array<[string, string[]]>;
28
+ /**
29
+ * JVM frameworks, read from pom.xml and build.gradle alike.
30
+ *
31
+ * A Spring Boot REST API with Spring Security and PostgreSQL reported no backend at
32
+ * all: the coordinates were never read, and no JVM server framework was ever named.
33
+ * Coordinates are `group:artifact` in both build systems, so one table serves both.
34
+ *
35
+ * `spring-boot-starter-parent` earns its place beside the starters: it is how a Maven
36
+ * project declares itself a Spring Boot project, and the starters under it inherit
37
+ * their version from it rather than stating one.
38
+ */
39
+ export declare const JVM_BACKEND_FRAMEWORKS: Array<[string, string[]]>;
40
+ /**
41
+ * Databases a JVM project declares by driver.
42
+ *
43
+ * The same manifest that names the framework names the database, and a Spring Boot
44
+ * project with `org.postgresql:postgresql` was reported as having no data layer.
45
+ */
46
+ export declare const JVM_DATABASES: Array<[string, string[]]>;
28
47
  /** Ruby frameworks, read from the Gemfile. */
29
48
  export declare const RUBY_BACKEND_FRAMEWORKS: Array<[string, string[]]>;
30
49
  /** PHP frameworks, read from composer.json. */
@@ -15,7 +15,7 @@
15
15
  * that loses users.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.LANGUAGES = exports.FRONTEND_FRAMEWORKS = exports.PYTHON_BACKEND_FRAMEWORKS = exports.PHP_BACKEND_FRAMEWORKS = exports.RUBY_BACKEND_FRAMEWORKS = exports.RUST_BACKEND_FRAMEWORKS = exports.GO_BACKEND_FRAMEWORKS = exports.NODE_BACKEND_FRAMEWORKS = void 0;
18
+ exports.LANGUAGES = exports.FRONTEND_FRAMEWORKS = exports.PYTHON_BACKEND_FRAMEWORKS = exports.PHP_BACKEND_FRAMEWORKS = exports.RUBY_BACKEND_FRAMEWORKS = exports.JVM_DATABASES = exports.JVM_BACKEND_FRAMEWORKS = exports.RUST_BACKEND_FRAMEWORKS = exports.GO_BACKEND_FRAMEWORKS = exports.NODE_BACKEND_FRAMEWORKS = void 0;
19
19
  exports.labelFor = labelFor;
20
20
  exports.hasLabel = hasLabel;
21
21
  exports.supportedStacks = supportedStacks;
@@ -60,6 +60,46 @@ exports.RUST_BACKEND_FRAMEWORKS = [
60
60
  ['salvo', ['salvo']],
61
61
  ['tower-http', ['tower-http']],
62
62
  ];
63
+ /**
64
+ * JVM frameworks, read from pom.xml and build.gradle alike.
65
+ *
66
+ * A Spring Boot REST API with Spring Security and PostgreSQL reported no backend at
67
+ * all: the coordinates were never read, and no JVM server framework was ever named.
68
+ * Coordinates are `group:artifact` in both build systems, so one table serves both.
69
+ *
70
+ * `spring-boot-starter-parent` earns its place beside the starters: it is how a Maven
71
+ * project declares itself a Spring Boot project, and the starters under it inherit
72
+ * their version from it rather than stating one.
73
+ */
74
+ exports.JVM_BACKEND_FRAMEWORKS = [
75
+ ['spring-boot', [
76
+ 'org.springframework.boot:spring-boot-starter-web',
77
+ 'org.springframework.boot:spring-boot-starter-webflux',
78
+ 'org.springframework.boot:spring-boot-starter-parent',
79
+ 'org.springframework.boot:spring-boot-starter',
80
+ ]],
81
+ ['quarkus', ['io.quarkus:quarkus-resteasy', 'io.quarkus:quarkus-resteasy-reactive', 'io.quarkus:quarkus-bom']],
82
+ ['micronaut', ['io.micronaut:micronaut-http-server-netty', 'io.micronaut:micronaut-inject']],
83
+ ['ktor', ['io.ktor:ktor-server-core', 'io.ktor:ktor-server-netty', 'io.ktor:ktor-server-cio']],
84
+ ['javalin', ['io.javalin:javalin']],
85
+ ['vertx', ['io.vertx:vertx-web', 'io.vertx:vertx-core']],
86
+ ['dropwizard', ['io.dropwizard:dropwizard-core']],
87
+ ['helidon', ['io.helidon.webserver:helidon-webserver']],
88
+ ];
89
+ /**
90
+ * Databases a JVM project declares by driver.
91
+ *
92
+ * The same manifest that names the framework names the database, and a Spring Boot
93
+ * project with `org.postgresql:postgresql` was reported as having no data layer.
94
+ */
95
+ exports.JVM_DATABASES = [
96
+ ['postgres', ['org.postgresql:postgresql', 'io.r2dbc:r2dbc-postgresql']],
97
+ ['mysql', ['mysql:mysql-connector-java', 'com.mysql:mysql-connector-j']],
98
+ ['mariadb', ['org.mariadb.jdbc:mariadb-java-client']],
99
+ ['sqlite', ['org.xerial:sqlite-jdbc']],
100
+ ['mongodb', ['org.mongodb:mongodb-driver-sync', 'org.mongodb:mongo-java-driver']],
101
+ ['redis', ['redis.clients:jedis', 'io.lettuce:lettuce-core']],
102
+ ];
63
103
  /** Ruby frameworks, read from the Gemfile. */
64
104
  exports.RUBY_BACKEND_FRAMEWORKS = [
65
105
  ['rails', ['rails']],
@@ -155,6 +195,14 @@ const LABELS = {
155
195
  chi: 'chi',
156
196
  gorilla: 'Gorilla',
157
197
  beego: 'Beego',
198
+ 'spring-boot': 'Spring Boot',
199
+ quarkus: 'Quarkus',
200
+ micronaut: 'Micronaut',
201
+ ktor: 'Ktor',
202
+ javalin: 'Javalin',
203
+ vertx: 'Vert.x',
204
+ dropwizard: 'Dropwizard',
205
+ helidon: 'Helidon',
158
206
  axum: 'Axum',
159
207
  'actix-web': 'Actix Web',
160
208
  rocket: 'Rocket',
@@ -287,6 +335,7 @@ function supportedStacks() {
287
335
  ...entries(exports.GO_BACKEND_FRAMEWORKS.map(([id]) => id)),
288
336
  { id: 'go', label: 'Go', detectedFrom: 'a go.mod with no framework in it — net/http is a real answer' },
289
337
  ...entries(exports.RUST_BACKEND_FRAMEWORKS.map(([id]) => id)),
338
+ ...entries(exports.JVM_BACKEND_FRAMEWORKS.map(([id]) => id)),
290
339
  ...entries(exports.RUBY_BACKEND_FRAMEWORKS.map(([id]) => id)),
291
340
  { id: 'ruby', label: 'Ruby', detectedFrom: 'a Gemfile with no web framework in it' },
292
341
  ...entries(exports.PHP_BACKEND_FRAMEWORKS.map(([id]) => id)),
@@ -99,6 +99,15 @@ async function detectBackend(ctx) {
99
99
  frameworks.push('go');
100
100
  evidence.push({ type: 'note', value: 'a Go module with no web framework named in go.mod' });
101
101
  }
102
+ /** The JVM, read from pom.xml and build.gradle alike: coordinates are the same shape. */
103
+ for (const [framework, deps] of catalogue_1.JVM_BACKEND_FRAMEWORKS) {
104
+ const hits = (0, detectContext_1.hasAnyGradleDep)(ctx, deps);
105
+ if (!hits.length)
106
+ continue;
107
+ frameworks.push(framework);
108
+ for (const dep of hits)
109
+ evidence.push({ type: 'dependency', value: dep });
110
+ }
102
111
  /** Rust, read from Cargo.toml. */
103
112
  let namedRustFramework = false;
104
113
  for (const [framework, deps] of catalogue_1.RUST_BACKEND_FRAMEWORKS) {
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.detectDatabase = detectDatabase;
4
4
  const detectContext_1 = require("./detectContext");
5
5
  const readTextFileSafe_1 = require("../utils/readTextFileSafe");
6
+ const catalogue_1 = require("./catalogue");
6
7
  /**
7
8
  * Managed data platforms, and the engine each one actually is.
8
9
  *
@@ -94,6 +95,20 @@ async function detectDatabase(ctx) {
94
95
  evidence.push({ type: 'dependency', value: h });
95
96
  }
96
97
  }
98
+ /**
99
+ * The JVM, by driver coordinate.
100
+ *
101
+ * The same manifest that names Spring Boot names PostgreSQL, and a Spring Boot API
102
+ * with `org.postgresql:postgresql` in its pom was reported as having no data layer.
103
+ */
104
+ for (const [db, names] of catalogue_1.JVM_DATABASES) {
105
+ const hits = (0, detectContext_1.hasAnyGradleDep)(ctx, names);
106
+ if (hits.length) {
107
+ databases.add(db);
108
+ for (const h of hits)
109
+ evidence.push({ type: 'dependency', value: h });
110
+ }
111
+ }
97
112
  const goHits = [
98
113
  ['postgres', ['jackc/pgx', 'jackc/pgx/v5', 'lib/pq']],
99
114
  ['mysql', ['go-sql-driver/mysql']],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@produtype/core",
3
- "version": "0.50.0",
3
+ "version": "0.51.0",
4
4
  "description": "Deterministic CLI and library that analyzes a web application repository and reports how far it is from production-ready for the kind of product it is meant to be.",
5
5
  "license": "MIT",
6
6
  "bin": {