@produtype/core 1.1.1 → 1.2.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/dist/cli.js
CHANGED
|
@@ -47,6 +47,7 @@ const markdownPlan_1 = require("./planner/markdownPlan");
|
|
|
47
47
|
const jsonPlan_1 = require("./planner/jsonPlan");
|
|
48
48
|
const pathUtils_1 = require("./utils/pathUtils");
|
|
49
49
|
const version_1 = require("./version");
|
|
50
|
+
const backendOrigin_1 = require("./report/backendOrigin");
|
|
50
51
|
/**
|
|
51
52
|
* The profiles this tool actually has, read from the same table the analyzer uses.
|
|
52
53
|
*
|
|
@@ -130,7 +131,7 @@ function summarize(report) {
|
|
|
130
131
|
'ProdKit Analysis Summary',
|
|
131
132
|
`Project: ${report.projectPath}`,
|
|
132
133
|
`Detected frontend: ${report.detectedStack.frontend.join(', ') || 'unknown'}`,
|
|
133
|
-
`Detected backend: ${report.detectedStack.backend.join(', ') || 'unknown'}`,
|
|
134
|
+
`Detected backend: ${report.detectedStack.backend.join(', ') || 'unknown'}${(0, backendOrigin_1.backendOrigin)(report.detectedStack) ? ` (${(0, backendOrigin_1.backendOrigin)(report.detectedStack)})` : ''}`,
|
|
134
135
|
`Detected databases: ${report.detectedStack.databases.join(', ') || 'unknown'}`,
|
|
135
136
|
// Named on their own line rather than folded into the databases list. A reader
|
|
136
137
|
// whose data layer is entirely Supabase needs to see that the tool recognised
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { StackInfo } from '../analyzer/types';
|
|
2
|
+
/**
|
|
3
|
+
* Where a backend lives, when it does not live in the product.
|
|
4
|
+
*
|
|
5
|
+
* marktext is an Electron editor and its report said "Detected backend: next". The
|
|
6
|
+
* Next application is `packages/website`, its marketing site. yaak is a Tauri client
|
|
7
|
+
* and said `hono`, which is a plugin in `plugins-external/`.
|
|
8
|
+
*
|
|
9
|
+
* Dropping those from the stack was tried and refused: a test holds the decision that
|
|
10
|
+
* the servers are really there and are merely not the product's, and that decision has
|
|
11
|
+
* its reasoning written down. What misleads is not the list — it is the sentence, which
|
|
12
|
+
* names a framework and says nothing about whose it is.
|
|
13
|
+
*
|
|
14
|
+
* So the sentence says. Only when *every* workspace with a backend is a documentation,
|
|
15
|
+
* playground or example directory: a repository with a real server beside its docs site
|
|
16
|
+
* has a backend of its own, and gets no annotation.
|
|
17
|
+
*/
|
|
18
|
+
export declare function backendOrigin(stack: StackInfo): string | undefined;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.backendOrigin = backendOrigin;
|
|
4
|
+
const detectPackaging_1 = require("../analyzer/detectPackaging");
|
|
5
|
+
/**
|
|
6
|
+
* Where a backend lives, when it does not live in the product.
|
|
7
|
+
*
|
|
8
|
+
* marktext is an Electron editor and its report said "Detected backend: next". The
|
|
9
|
+
* Next application is `packages/website`, its marketing site. yaak is a Tauri client
|
|
10
|
+
* and said `hono`, which is a plugin in `plugins-external/`.
|
|
11
|
+
*
|
|
12
|
+
* Dropping those from the stack was tried and refused: a test holds the decision that
|
|
13
|
+
* the servers are really there and are merely not the product's, and that decision has
|
|
14
|
+
* its reasoning written down. What misleads is not the list — it is the sentence, which
|
|
15
|
+
* names a framework and says nothing about whose it is.
|
|
16
|
+
*
|
|
17
|
+
* So the sentence says. Only when *every* workspace with a backend is a documentation,
|
|
18
|
+
* playground or example directory: a repository with a real server beside its docs site
|
|
19
|
+
* has a backend of its own, and gets no annotation.
|
|
20
|
+
*/
|
|
21
|
+
function backendOrigin(stack) {
|
|
22
|
+
if (stack.backend.length === 0)
|
|
23
|
+
return undefined;
|
|
24
|
+
const withBackend = stack.workspaces.filter((workspace) => workspace.backend.length > 0);
|
|
25
|
+
if (withBackend.length === 0)
|
|
26
|
+
return undefined;
|
|
27
|
+
if (withBackend.some((workspace) => !detectPackaging_1.DOCS_DIRECTORIES.test(`${workspace.root}/`)))
|
|
28
|
+
return undefined;
|
|
29
|
+
const roots = [...new Set(withBackend.map((workspace) => workspace.root))];
|
|
30
|
+
return `in ${roots.join(', ')} — documentation or examples, not the product itself`;
|
|
31
|
+
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.renderMarkdown = renderMarkdown;
|
|
4
4
|
const readingDepth_1 = require("../analyzer/readingDepth");
|
|
5
|
+
const backendOrigin_1 = require("./backendOrigin");
|
|
5
6
|
function profileSummary(report) {
|
|
6
7
|
const profile = report.productProfile;
|
|
7
8
|
if (!profile) {
|
|
@@ -232,7 +233,7 @@ function renderMarkdown(report) {
|
|
|
232
233
|
'## Detected Stack',
|
|
233
234
|
'',
|
|
234
235
|
`- Frontend: ${report.detectedStack.frontend.join(', ') || 'unknown'}`,
|
|
235
|
-
`- Backend: ${report.detectedStack.backend.join(', ') || 'unknown'}`,
|
|
236
|
+
`- Backend: ${report.detectedStack.backend.join(', ') || 'unknown'}${originNote(report)}`,
|
|
236
237
|
`- Databases: ${report.detectedStack.databases.join(', ') || 'unknown'}`,
|
|
237
238
|
`- Languages: ${report.detectedStack.languages.join(', ') || 'unknown'}`,
|
|
238
239
|
`- Package manager: ${report.detectedStack.packageManager}`,
|
|
@@ -309,3 +310,8 @@ function renderMarkdown(report) {
|
|
|
309
310
|
appendix,
|
|
310
311
|
].join('\n');
|
|
311
312
|
}
|
|
313
|
+
/** The parenthetical that says whose backend it is, or nothing. */
|
|
314
|
+
function originNote(report) {
|
|
315
|
+
const origin = (0, backendOrigin_1.backendOrigin)(report.detectedStack);
|
|
316
|
+
return origin ? ` (${origin})` : '';
|
|
317
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@produtype/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.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": {
|