@apso/cli 0.50.0 → 0.50.1
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/lib/utils/crud-deps.d.ts +2 -0
- package/dist/lib/utils/crud-deps.js +3 -1
- package/dist/lib/utils/relationships/parse.js +8 -0
- package/dist/lib/utils/template.d.ts +5 -3
- package/dist/lib/utils/template.js +6 -4
- package/npm-shrinkwrap.json +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* option, Content-Range counts and PostgREST OpenAPI parameters, which the
|
|
5
5
|
* generated controllers rely on. The service template declares the same
|
|
6
6
|
* ranges (see TEMPLATE_REFS in ./template.ts); bump both together.
|
|
7
|
+
* @apso/crud-typeorm starts at 1.1.1, where a concurrent DELETE and a PATCH
|
|
8
|
+
* with a condition have one winner.
|
|
7
9
|
*
|
|
8
10
|
* @apso/postgrest-request is not imported by generated code. It is listed so
|
|
9
11
|
* a project whose lockfile holds an older copy moves to the one @apso/crud
|
|
@@ -11,6 +11,8 @@ const path = tslib_1.__importStar(require("path"));
|
|
|
11
11
|
* option, Content-Range counts and PostgREST OpenAPI parameters, which the
|
|
12
12
|
* generated controllers rely on. The service template declares the same
|
|
13
13
|
* ranges (see TEMPLATE_REFS in ./template.ts); bump both together.
|
|
14
|
+
* @apso/crud-typeorm starts at 1.1.1, where a concurrent DELETE and a PATCH
|
|
15
|
+
* with a condition have one winner.
|
|
14
16
|
*
|
|
15
17
|
* @apso/postgrest-request is not imported by generated code. It is listed so
|
|
16
18
|
* a project whose lockfile holds an older copy moves to the one @apso/crud
|
|
@@ -20,7 +22,7 @@ exports.APSO_CRUD_DEPS = {
|
|
|
20
22
|
"@apso/crud": "^1.1.0",
|
|
21
23
|
"@apso/crud-core": "^1.1.0",
|
|
22
24
|
"@apso/crud-request": "^1.0.1",
|
|
23
|
-
"@apso/crud-typeorm": "^1.1.
|
|
25
|
+
"@apso/crud-typeorm": "^1.1.1",
|
|
24
26
|
"@apso/postgrest-request": "^1.1.0",
|
|
25
27
|
};
|
|
26
28
|
/**
|
|
@@ -572,6 +572,11 @@ function* generateNestedRelationships(entityName, relationshipMap, maxDepth = 4,
|
|
|
572
572
|
const relationships = relationshipMap[entityName];
|
|
573
573
|
if (!relationships)
|
|
574
574
|
return;
|
|
575
|
+
// Two relationships can expose the same property name on this entity (for
|
|
576
|
+
// example two FKs to one table whose inverse sides share a default name).
|
|
577
|
+
// A join path names a property, so emit each name once per level; duplicate
|
|
578
|
+
// keys make the generated controller's join map fail to compile (TS1117).
|
|
579
|
+
const emittedAtLevel = new Set();
|
|
575
580
|
for (const relationship of relationships) {
|
|
576
581
|
const referenceName = (0, exports.getRelationshipName)(relationship);
|
|
577
582
|
const type = relationship.type;
|
|
@@ -611,6 +616,9 @@ function* generateNestedRelationships(entityName, relationshipMap, maxDepth = 4,
|
|
|
611
616
|
continue;
|
|
612
617
|
}
|
|
613
618
|
}
|
|
619
|
+
if (emittedAtLevel.has(formattedName))
|
|
620
|
+
continue;
|
|
621
|
+
emittedAtLevel.add(formattedName);
|
|
614
622
|
// Build the new path
|
|
615
623
|
const newPath = [...path, formattedName];
|
|
616
624
|
// Always yield the join path if it's longer than 1 level
|
|
@@ -3,8 +3,10 @@ export declare const TEMPLATE_REPOS: Record<TargetLanguage, string>;
|
|
|
3
3
|
/**
|
|
4
4
|
* Git ref (tag or branch) to clone for each template. Pinning to a tag makes
|
|
5
5
|
* the CLI-version-to-template pairing explicit instead of a date cutoff on
|
|
6
|
-
* template main. v2.
|
|
7
|
-
*
|
|
6
|
+
* template main. v2.1.1 matches what this CLI generates: @apso/crud ^1.1.0
|
|
7
|
+
* (PostgREST-only), MCP at /mcp, request logging, and the AGENTS.md and
|
|
8
|
+
* CLAUDE.md agent instructions. Move the tag when the template changes in a
|
|
9
|
+
* way new projects need; the Python and Go
|
|
8
10
|
* template repos are untagged and don't carry the dialect work.
|
|
9
11
|
*/
|
|
10
12
|
export declare const TEMPLATE_REFS: Record<TargetLanguage, string>;
|
|
@@ -29,7 +31,7 @@ export declare function ensureDevKey(projectPath: string): string | undefined;
|
|
|
29
31
|
* Stamp the chosen language into the scaffolded `.apsorc`.
|
|
30
32
|
*
|
|
31
33
|
* `apso generate` resolves its target language as flag > .apsorc > prompt.
|
|
32
|
-
* The TypeScript template
|
|
34
|
+
* The TypeScript template ships an `.apsorc` without a
|
|
33
35
|
* `language` field, so a bare `apso generate` right after `apso init` fell
|
|
34
36
|
* through to the interactive prompt — which errors in non-TTY contexts
|
|
35
37
|
* (this is what kept the weekly scaffold-smoke workflow red). Recording the
|
|
@@ -15,12 +15,14 @@ exports.TEMPLATE_REPOS = {
|
|
|
15
15
|
/**
|
|
16
16
|
* Git ref (tag or branch) to clone for each template. Pinning to a tag makes
|
|
17
17
|
* the CLI-version-to-template pairing explicit instead of a date cutoff on
|
|
18
|
-
* template main. v2.
|
|
19
|
-
*
|
|
18
|
+
* template main. v2.1.1 matches what this CLI generates: @apso/crud ^1.1.0
|
|
19
|
+
* (PostgREST-only), MCP at /mcp, request logging, and the AGENTS.md and
|
|
20
|
+
* CLAUDE.md agent instructions. Move the tag when the template changes in a
|
|
21
|
+
* way new projects need; the Python and Go
|
|
20
22
|
* template repos are untagged and don't carry the dialect work.
|
|
21
23
|
*/
|
|
22
24
|
exports.TEMPLATE_REFS = {
|
|
23
|
-
typescript: "v2.
|
|
25
|
+
typescript: "v2.1.1",
|
|
24
26
|
python: "main",
|
|
25
27
|
go: "main",
|
|
26
28
|
};
|
|
@@ -91,7 +93,7 @@ exports.ensureDevKey = ensureDevKey;
|
|
|
91
93
|
* Stamp the chosen language into the scaffolded `.apsorc`.
|
|
92
94
|
*
|
|
93
95
|
* `apso generate` resolves its target language as flag > .apsorc > prompt.
|
|
94
|
-
* The TypeScript template
|
|
96
|
+
* The TypeScript template ships an `.apsorc` without a
|
|
95
97
|
* `language` field, so a bare `apso generate` right after `apso init` fell
|
|
96
98
|
* through to the interactive prompt — which errors in non-TTY contexts
|
|
97
99
|
* (this is what kept the weekly scaffold-smoke workflow red). Recording the
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apso/cli",
|
|
3
|
-
"version": "0.50.
|
|
3
|
+
"version": "0.50.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@apso/cli",
|
|
9
|
-
"version": "0.50.
|
|
9
|
+
"version": "0.50.1",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@apso/schema-tools": "^0.2.2",
|
package/oclif.manifest.json
CHANGED