@underpeaks/generator-core 1.0.31 → 1.0.34
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/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/insertion/field-insertion.d.ts +10 -35
- package/dist/insertion/field-insertion.d.ts.map +1 -1
- package/dist/insertion/field-insertion.js +20 -45
- package/dist/insertion/field-insertion.js.map +1 -1
- package/dist/manifest/manifest.d.ts +2 -0
- package/dist/manifest/manifest.d.ts.map +1 -1
- package/dist/manifest/manifest.js +30 -13
- package/dist/manifest/manifest.js.map +1 -1
- package/dist/schema/card-field-selection.d.ts +19 -0
- package/dist/schema/card-field-selection.d.ts.map +1 -0
- package/dist/schema/card-field-selection.js +95 -0
- package/dist/schema/card-field-selection.js.map +1 -0
- package/dist/schema/default-display-types.d.ts +3 -0
- package/dist/schema/default-display-types.d.ts.map +1 -0
- package/dist/schema/default-display-types.js +92 -0
- package/dist/schema/default-display-types.js.map +1 -0
- package/dist/schema/parser.d.ts +1 -0
- package/dist/schema/parser.d.ts.map +1 -1
- package/dist/schema/parser.js +45 -1
- package/dist/schema/parser.js.map +1 -1
- package/dist/schema/types.d.ts +14 -0
- package/dist/schema/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export * from './schema/types';
|
|
2
2
|
export * from './schema/parser';
|
|
3
3
|
export * from './schema/page-template-types';
|
|
4
|
+
export * from './schema/default-display-types';
|
|
5
|
+
export * from './schema/card-field-selection';
|
|
4
6
|
export * from './manifest/manifest';
|
|
5
7
|
export * from './scan/scan-ui-types';
|
|
6
8
|
export * from './scan/resolve-widgets';
|
|
9
|
+
export * from './insertion/field-insertion';
|
|
7
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,6BAA6B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
__exportStar(require("./schema/types"), exports);
|
|
19
19
|
__exportStar(require("./schema/parser"), exports);
|
|
20
20
|
__exportStar(require("./schema/page-template-types"), exports);
|
|
21
|
+
__exportStar(require("./schema/default-display-types"), exports);
|
|
22
|
+
__exportStar(require("./schema/card-field-selection"), exports);
|
|
21
23
|
__exportStar(require("./manifest/manifest"), exports);
|
|
22
24
|
__exportStar(require("./scan/scan-ui-types"), exports);
|
|
23
25
|
__exportStar(require("./scan/resolve-widgets"), exports);
|
|
26
|
+
__exportStar(require("./insertion/field-insertion"), exports);
|
|
24
27
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,gEAAgE;;;;;;;;;;;;;;;;AAEhE,iDAA8B;AAC9B,kDAA+B;AAC/B,+DAA4C;AAC5C,sDAAmC;AACnC,uDAAoC;AACpC,yDAAsC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,gEAAgE;;;;;;;;;;;;;;;;AAEhE,iDAA8B;AAC9B,kDAA+B;AAC/B,+DAA4C;AAC5C,iEAA8C;AAC9C,gEAA6C;AAC7C,sDAAmC;AACnC,uDAAoC;AACpC,yDAAsC;AACtC,8DAA2C"}
|
|
@@ -1,45 +1,20 @@
|
|
|
1
1
|
export declare const NXF_INSERT_MARKER = "NXF:INSERT-FIELDS-HERE";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
3
|
+
* Builds the full marker tag for a given section. Plain detail-style
|
|
4
|
+
* pages (one insertion point) use no section id. Multi-location pages
|
|
5
|
+
* like forms (a new field needs code in several places — a controller
|
|
6
|
+
* declaration, initState, dispose, submit construction, AND the visible
|
|
7
|
+
* field itself) use a distinct section id per location, so each spot
|
|
8
|
+
* gets its own findable marker.
|
|
8
9
|
*/
|
|
9
|
-
export declare function
|
|
10
|
+
export declare function buildInsertMarkerTag(section?: string): string;
|
|
11
|
+
export declare function buildMarkerComment(commentPrefix?: string, section?: string): string[];
|
|
10
12
|
export interface FieldInsertionResult {
|
|
11
13
|
content: string;
|
|
12
14
|
insertedAtMarker: boolean;
|
|
13
15
|
message?: string;
|
|
14
16
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* it's missing (deleted, or the file predates this mechanism).
|
|
18
|
-
*/
|
|
19
|
-
export declare function findMarkerLine(existingContent: string): number;
|
|
20
|
-
/**
|
|
21
|
-
* Inserts newFieldLines into an existing page's content:
|
|
22
|
-
* - If the marker is present, splices the new field's code in directly
|
|
23
|
-
* above the marker (so the marker always stays as the insertion point
|
|
24
|
-
* for the NEXT field too), preserving everything else in the file
|
|
25
|
-
* exactly as the developer left it.
|
|
26
|
-
* - If the marker is missing, appends the new field's code to the very
|
|
27
|
-
* bottom of the file instead, with a clear header comment, and returns
|
|
28
|
-
* a message the CLI should print telling the developer where to find
|
|
29
|
-
* it and that they should cut/paste it into place themselves.
|
|
30
|
-
*
|
|
31
|
-
* Indentation of newFieldLines is the caller's responsibility — this
|
|
32
|
-
* function does not reformat or re-indent anything, since it can't know
|
|
33
|
-
* the surrounding widget tree's nesting depth safely for every page type.
|
|
34
|
-
*/
|
|
35
|
-
export declare function insertFieldAtMarker(existingContent: string, newFieldLines: string[], pageLabel: string, fieldLabel: string, commentPrefix?: string): FieldInsertionResult;
|
|
36
|
-
/**
|
|
37
|
-
* Diffs the model's current visible field names against the set of
|
|
38
|
-
* field names the page was last generated with (tracked in the
|
|
39
|
-
* manifest — see ManifestEntry.field_names in manifest.ts), returning
|
|
40
|
-
* only the ones that are genuinely new. Used to decide which fields
|
|
41
|
-
* need inserting on a regeneration run, rather than re-rendering every
|
|
42
|
-
* field from scratch.
|
|
43
|
-
*/
|
|
17
|
+
export declare function findMarkerLine(existingContent: string, section?: string): number;
|
|
18
|
+
export declare function insertFieldAtMarker(existingContent: string, newFieldLines: string[], pageLabel: string, fieldLabel: string, commentPrefix?: string, section?: string): FieldInsertionResult;
|
|
44
19
|
export declare function diffNewFields(currentFieldNames: string[], previousFieldNames: string[] | undefined): string[];
|
|
45
20
|
//# sourceMappingURL=field-insertion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-insertion.d.ts","sourceRoot":"","sources":["../../src/insertion/field-insertion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"field-insertion.d.ts","sourceRoot":"","sources":["../../src/insertion/field-insertion.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,2BAA2B,CAAA;AAEzD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAgB,kBAAkB,CAAC,aAAa,GAAE,MAAa,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAQ3F;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,wBAAgB,cAAc,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAIhF;AAED,wBAAgB,mBAAmB,CACjC,eAAe,EAAE,MAAM,EACvB,aAAa,EAAI,MAAM,EAAE,EACzB,SAAS,EAAQ,MAAM,EACvB,UAAU,EAAO,MAAM,EACvB,aAAa,GAAI,MAAa,EAC9B,OAAO,CAAC,EAAS,MAAM,GACtB,oBAAoB,CAgCtB;AAED,wBAAgB,aAAa,CAC3B,iBAAiB,EAAG,MAAM,EAAE,EAC5B,kBAAkB,EAAE,MAAM,EAAE,GAAG,SAAS,GACvC,MAAM,EAAE,CAIV"}
|
|
@@ -2,56 +2,39 @@
|
|
|
2
2
|
// File: underpeaks_codegen/packages/generator-core/src/insertion/field-insertion.ts
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.NXF_INSERT_MARKER = void 0;
|
|
5
|
+
exports.buildInsertMarkerTag = buildInsertMarkerTag;
|
|
5
6
|
exports.buildMarkerComment = buildMarkerComment;
|
|
6
7
|
exports.findMarkerLine = findMarkerLine;
|
|
7
8
|
exports.insertFieldAtMarker = insertFieldAtMarker;
|
|
8
9
|
exports.diffNewFields = diffNewFields;
|
|
9
|
-
// The marker-tag mechanism: lets a regenerated page pick up newly added
|
|
10
|
-
// model fields without overwriting the whole file (and losing whatever
|
|
11
|
-
// the developer has customized in it since). Platform-agnostic — works
|
|
12
|
-
// on plain text/line arrays, so both Flutter (.dart, // comments) and
|
|
13
|
-
// Next.js (.tsx, // comments) can share this exact logic.
|
|
14
10
|
exports.NXF_INSERT_MARKER = 'NXF:INSERT-FIELDS-HERE';
|
|
15
11
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
12
|
+
* Builds the full marker tag for a given section. Plain detail-style
|
|
13
|
+
* pages (one insertion point) use no section id. Multi-location pages
|
|
14
|
+
* like forms (a new field needs code in several places — a controller
|
|
15
|
+
* declaration, initState, dispose, submit construction, AND the visible
|
|
16
|
+
* field itself) use a distinct section id per location, so each spot
|
|
17
|
+
* gets its own findable marker.
|
|
21
18
|
*/
|
|
22
|
-
function
|
|
19
|
+
function buildInsertMarkerTag(section) {
|
|
20
|
+
return section ? `${exports.NXF_INSERT_MARKER}:${section.toUpperCase()}` : exports.NXF_INSERT_MARKER;
|
|
21
|
+
}
|
|
22
|
+
function buildMarkerComment(commentPrefix = '//', section) {
|
|
23
|
+
const tag = buildInsertMarkerTag(section);
|
|
23
24
|
return [
|
|
24
|
-
`${commentPrefix} ${
|
|
25
|
+
`${commentPrefix} ${tag} — DO NOT DELETE`,
|
|
25
26
|
`${commentPrefix} This tag marks where new fields get inserted automatically when you`,
|
|
26
27
|
`${commentPrefix} update your model. Removing it means future field additions get pasted`,
|
|
27
28
|
`${commentPrefix} at the bottom of this file instead, for you to move into place yourself.`,
|
|
28
29
|
];
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
* it's missing (deleted, or the file predates this mechanism).
|
|
33
|
-
*/
|
|
34
|
-
function findMarkerLine(existingContent) {
|
|
31
|
+
function findMarkerLine(existingContent, section) {
|
|
32
|
+
const tag = buildInsertMarkerTag(section);
|
|
35
33
|
const lines = existingContent.split('\n');
|
|
36
|
-
return lines.findIndex((line) => line.includes(
|
|
34
|
+
return lines.findIndex((line) => line.includes(tag));
|
|
37
35
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
* - If the marker is present, splices the new field's code in directly
|
|
41
|
-
* above the marker (so the marker always stays as the insertion point
|
|
42
|
-
* for the NEXT field too), preserving everything else in the file
|
|
43
|
-
* exactly as the developer left it.
|
|
44
|
-
* - If the marker is missing, appends the new field's code to the very
|
|
45
|
-
* bottom of the file instead, with a clear header comment, and returns
|
|
46
|
-
* a message the CLI should print telling the developer where to find
|
|
47
|
-
* it and that they should cut/paste it into place themselves.
|
|
48
|
-
*
|
|
49
|
-
* Indentation of newFieldLines is the caller's responsibility — this
|
|
50
|
-
* function does not reformat or re-indent anything, since it can't know
|
|
51
|
-
* the surrounding widget tree's nesting depth safely for every page type.
|
|
52
|
-
*/
|
|
53
|
-
function insertFieldAtMarker(existingContent, newFieldLines, pageLabel, fieldLabel, commentPrefix = '//') {
|
|
54
|
-
const markerLine = findMarkerLine(existingContent);
|
|
36
|
+
function insertFieldAtMarker(existingContent, newFieldLines, pageLabel, fieldLabel, commentPrefix = '//', section) {
|
|
37
|
+
const markerLine = findMarkerLine(existingContent, section);
|
|
55
38
|
if (markerLine === -1) {
|
|
56
39
|
const lines = existingContent.split('\n');
|
|
57
40
|
const appended = [
|
|
@@ -66,7 +49,7 @@ function insertFieldAtMarker(existingContent, newFieldLines, pageLabel, fieldLab
|
|
|
66
49
|
return {
|
|
67
50
|
content: appended.join('\n'),
|
|
68
51
|
insertedAtMarker: false,
|
|
69
|
-
message: `Added the ${fieldLabel}
|
|
52
|
+
message: `Added the ${fieldLabel} field to the bottom of ${pageLabel} — cut and paste it wherever you'd like it in the layout.`,
|
|
70
53
|
};
|
|
71
54
|
}
|
|
72
55
|
const lines = existingContent.split('\n');
|
|
@@ -78,17 +61,9 @@ function insertFieldAtMarker(existingContent, newFieldLines, pageLabel, fieldLab
|
|
|
78
61
|
insertedAtMarker: true,
|
|
79
62
|
};
|
|
80
63
|
}
|
|
81
|
-
/**
|
|
82
|
-
* Diffs the model's current visible field names against the set of
|
|
83
|
-
* field names the page was last generated with (tracked in the
|
|
84
|
-
* manifest — see ManifestEntry.field_names in manifest.ts), returning
|
|
85
|
-
* only the ones that are genuinely new. Used to decide which fields
|
|
86
|
-
* need inserting on a regeneration run, rather than re-rendering every
|
|
87
|
-
* field from scratch.
|
|
88
|
-
*/
|
|
89
64
|
function diffNewFields(currentFieldNames, previousFieldNames) {
|
|
90
65
|
if (!previousFieldNames)
|
|
91
|
-
return [];
|
|
66
|
+
return [];
|
|
92
67
|
const previousSet = new Set(previousFieldNames);
|
|
93
68
|
return currentFieldNames.filter((name) => !previousSet.has(name));
|
|
94
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-insertion.js","sourceRoot":"","sources":["../../src/insertion/field-insertion.ts"],"names":[],"mappings":";AAAA,oFAAoF;;;
|
|
1
|
+
{"version":3,"file":"field-insertion.js","sourceRoot":"","sources":["../../src/insertion/field-insertion.ts"],"names":[],"mappings":";AAAA,oFAAoF;;;AAYpF,oDAEC;AAED,gDAQC;AAQD,wCAIC;AAED,kDAuCC;AAED,sCAOC;AApFY,QAAA,iBAAiB,GAAG,wBAAwB,CAAA;AAEzD;;;;;;;GAOG;AACH,SAAgB,oBAAoB,CAAC,OAAgB;IACnD,OAAO,OAAO,CAAC,CAAC,CAAC,GAAG,yBAAiB,IAAI,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,yBAAiB,CAAA;AACtF,CAAC;AAED,SAAgB,kBAAkB,CAAC,gBAAwB,IAAI,EAAE,OAAgB;IAC/E,MAAM,GAAG,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAA;IACzC,OAAO;QACL,GAAG,aAAa,IAAI,GAAG,kBAAkB;QACzC,GAAG,aAAa,sEAAsE;QACtF,GAAG,aAAa,yEAAyE;QACzF,GAAG,aAAa,2EAA2E;KAC5F,CAAA;AACH,CAAC;AAQD,SAAgB,cAAc,CAAC,eAAuB,EAAE,OAAgB;IACtE,MAAM,GAAG,GAAK,oBAAoB,CAAC,OAAO,CAAC,CAAA;IAC3C,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACzC,OAAO,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAA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,EAAE,CAAA;IAClC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,kBAAkB,CAAC,CAAA;IAC/C,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;AACnE,CAAC"}
|
|
@@ -7,6 +7,7 @@ export interface ManifestEntry {
|
|
|
7
7
|
customized: boolean;
|
|
8
8
|
generated_at: string;
|
|
9
9
|
field_names?: string[];
|
|
10
|
+
field_renders?: Record<string, Record<string, string[]>>;
|
|
10
11
|
}
|
|
11
12
|
export interface Manifest {
|
|
12
13
|
version: string;
|
|
@@ -21,6 +22,7 @@ export interface CreateManifestFileInfo {
|
|
|
21
22
|
field_names?: string[];
|
|
22
23
|
}
|
|
23
24
|
export declare function createManifest(projectId: string, files: GeneratedFile[], sourceMap: Record<string, CreateManifestFileInfo>): Manifest;
|
|
25
|
+
export declare function buildManifestFile(projectId: string, files: GeneratedFile[]): GeneratedFile;
|
|
24
26
|
export declare function mergeManifest(existing: Manifest, incoming: Manifest, existingFileContents: Record<string, string>): Manifest;
|
|
25
27
|
export declare function getFilesToSkip(manifest: Manifest): string[];
|
|
26
28
|
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/manifest/manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD,MAAM,WAAW,aAAa;IAC5B,WAAW,
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/manifest/manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAK,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CA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
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.computeChecksum = computeChecksum;
|
|
8
8
|
exports.createManifest = createManifest;
|
|
9
|
+
exports.buildManifestFile = buildManifestFile;
|
|
9
10
|
exports.mergeManifest = mergeManifest;
|
|
10
11
|
exports.getFilesToSkip = getFilesToSkip;
|
|
11
12
|
const crypto_1 = __importDefault(require("crypto"));
|
|
@@ -24,7 +25,8 @@ function createManifest(projectId, files, sourceMap) {
|
|
|
24
25
|
generated: true,
|
|
25
26
|
customized: false,
|
|
26
27
|
generated_at: now,
|
|
27
|
-
field_names: source.field_names,
|
|
28
|
+
field_names: source.field_names ?? file.field_names,
|
|
29
|
+
field_renders: file.field_renders,
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
32
|
return {
|
|
@@ -34,11 +36,34 @@ function createManifest(projectId, files, sourceMap) {
|
|
|
34
36
|
files: entries,
|
|
35
37
|
};
|
|
36
38
|
}
|
|
39
|
+
function buildManifestFile(projectId, files) {
|
|
40
|
+
const now = new Date().toISOString();
|
|
41
|
+
const entries = {};
|
|
42
|
+
for (const file of files) {
|
|
43
|
+
entries[file.path] = {
|
|
44
|
+
source_type: file.category === 'customizable' ? 'page' : 'root',
|
|
45
|
+
source_id: file.path,
|
|
46
|
+
checksum: computeChecksum(file.content),
|
|
47
|
+
generated: true,
|
|
48
|
+
customized: false,
|
|
49
|
+
generated_at: now,
|
|
50
|
+
field_names: file.field_names,
|
|
51
|
+
field_renders: file.field_renders,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const manifest = {
|
|
55
|
+
version: '1.0.0',
|
|
56
|
+
generated_at: now,
|
|
57
|
+
project_id: projectId,
|
|
58
|
+
files: entries,
|
|
59
|
+
};
|
|
60
|
+
return {
|
|
61
|
+
path: '.nxf/manifest.json',
|
|
62
|
+
content: JSON.stringify(manifest, null, 2),
|
|
63
|
+
category: 'root',
|
|
64
|
+
};
|
|
65
|
+
}
|
|
37
66
|
function mergeManifest(existing, incoming, existingFileContents) {
|
|
38
|
-
// FIX: was a shallow spread ({ ...incoming }), so merged.files was the
|
|
39
|
-
// SAME object reference as incoming.files — every write below silently
|
|
40
|
-
// mutated the caller's original incoming manifest as a side effect.
|
|
41
|
-
// Now deep-copies the files map so incoming stays untouched.
|
|
42
67
|
const merged = {
|
|
43
68
|
...incoming,
|
|
44
69
|
files: { ...incoming.files },
|
|
@@ -47,20 +72,12 @@ function mergeManifest(existing, incoming, existingFileContents) {
|
|
|
47
72
|
const incomingEntry = incoming.files[filePath];
|
|
48
73
|
if (!incomingEntry)
|
|
49
74
|
continue;
|
|
50
|
-
// Check if file was customized — if on-disk checksum differs from last generated checksum
|
|
51
75
|
const onDiskContent = existingFileContents[filePath];
|
|
52
76
|
const onDiskChecksum = onDiskContent ? computeChecksum(onDiskContent) : null;
|
|
53
77
|
if (onDiskChecksum && onDiskChecksum !== existingEntry.checksum) {
|
|
54
78
|
merged.files[filePath] = {
|
|
55
79
|
...incomingEntry,
|
|
56
80
|
customized: true,
|
|
57
|
-
// A customized page keeps its LAST KNOWN field_names from the
|
|
58
|
-
// existing manifest, not whatever the fresh incoming entry
|
|
59
|
-
// would have had — the incoming entry reflects a full
|
|
60
|
-
// regeneration that never actually happened for this file
|
|
61
|
-
// (it was skipped because it's customized), so its field_names
|
|
62
|
-
// don't describe what's actually on disk. Preserving the old
|
|
63
|
-
// list keeps future diffNewFields() calls accurate.
|
|
64
81
|
field_names: existingEntry.field_names,
|
|
65
82
|
};
|
|
66
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/manifest/manifest.ts"],"names":[],"mappings":";AAAA,4EAA4E;;;;;
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/manifest/manifest.ts"],"names":[],"mappings":";AAAA,4EAA4E;;;;;AAuB5E,0CAEC;AAQD,wCA4BC;AAED,8CA6BC;AAED,sCA2BC;AAED,wCAI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C,CAAC,CAAC,CAAC,IAAI,CAAA;QAE5E,IAAI,cAAc,IAAI,cAAc,KAAK,aAAa,CAAC,QAAQ,EAAE,CAAC;YAChE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG;gBACvB,GAAG,aAAa;gBAChB,UAAU,EAAG,IAAI;gBACjB,WAAW,EAAE,aAAa,CAAC,WAAW;aACvC,CAAA;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAgB,cAAc,CAAC,QAAkB;IAC/C,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;SAClC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC;SACvC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAA;AAClC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Model, ColumnDef } from './types';
|
|
2
|
+
export interface CardFieldSelection {
|
|
3
|
+
titleField?: ColumnDef;
|
|
4
|
+
imageField?: ColumnDef;
|
|
5
|
+
priceField?: ColumnDef;
|
|
6
|
+
metaFields: ColumnDef[];
|
|
7
|
+
allFields?: ColumnDef[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Picks which fields a card/list preview should show, based on the
|
|
11
|
+
* project's declared type. 'custom' (or any unrecognized project_type)
|
|
12
|
+
* returns every visible field instead of guessing — there's no sensible
|
|
13
|
+
* default without more context. For known types, matches columns to
|
|
14
|
+
* named roles (title/image/price/meta) by keyword, falling back to
|
|
15
|
+
* "first visible column" for title if nothing matches, so a card is
|
|
16
|
+
* never left with no title text at all.
|
|
17
|
+
*/
|
|
18
|
+
export declare function selectCardFields(model: Model, projectType: string): CardFieldSelection;
|
|
19
|
+
//# sourceMappingURL=card-field-selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-field-selection.d.ts","sourceRoot":"","sources":["../../src/schema/card-field-selection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAG/C,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAG,SAAS,CAAA;IACvB,UAAU,CAAC,EAAG,SAAS,CAAA;IACvB,UAAU,CAAC,EAAG,SAAS,CAAA;IAGvB,UAAU,EAAI,SAAS,EAAE,CAAA;IAKzB,SAAS,CAAC,EAAI,SAAS,EAAE,CAAA;CAC1B;AAsDD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,GAAG,kBAAkB,CA4CtF"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File: underpeaks_codegen/packages/generator-core/src/schema/card-field-selection.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.selectCardFields = selectCardFields;
|
|
5
|
+
const parser_1 = require("./parser");
|
|
6
|
+
// Ordered keyword slots per project_type. First column whose name
|
|
7
|
+
// contains any keyword in a slot wins that slot — checked in the order
|
|
8
|
+
// listed, so e.g. 'title' is preferred over 'heading' for blog posts,
|
|
9
|
+
// without excluding 'heading' as a fallback.
|
|
10
|
+
const PROJECT_TYPE_SLOTS = {
|
|
11
|
+
blog: {
|
|
12
|
+
title: ['title', 'heading', 'headline'],
|
|
13
|
+
image: ['image', 'cover', 'thumbnail', 'photo'],
|
|
14
|
+
meta: [['author', 'writer'], ['excerpt', 'summary', 'description']],
|
|
15
|
+
},
|
|
16
|
+
ecommerce: {
|
|
17
|
+
title: ['name', 'title'],
|
|
18
|
+
image: ['image', 'thumbnail', 'photo', 'cover'],
|
|
19
|
+
price: ['price', 'cost', 'amount'],
|
|
20
|
+
meta: [['description', 'summary']],
|
|
21
|
+
},
|
|
22
|
+
marketplace: {
|
|
23
|
+
title: ['name', 'title'],
|
|
24
|
+
image: ['image', 'thumbnail', 'photo', 'cover'],
|
|
25
|
+
price: ['price', 'cost', 'amount'],
|
|
26
|
+
meta: [['vendor', 'supplier', 'seller', 'store']],
|
|
27
|
+
},
|
|
28
|
+
saas: {
|
|
29
|
+
title: ['name', 'title'],
|
|
30
|
+
meta: [['status', 'state'], ['plan', 'tier'], ['email']],
|
|
31
|
+
},
|
|
32
|
+
social: {
|
|
33
|
+
title: ['name', 'username', 'author', 'handle'],
|
|
34
|
+
image: ['image', 'avatar', 'photo'],
|
|
35
|
+
meta: [['content', 'body', 'text', 'caption'], ['likes', 'comments', 'reactions']],
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
function findColumnMatching(columns, keywords, taken) {
|
|
39
|
+
for (const keyword of keywords) {
|
|
40
|
+
const match = columns.find((c) => !taken.has(c.name) && c.name.toLowerCase().includes(keyword));
|
|
41
|
+
if (match)
|
|
42
|
+
return match;
|
|
43
|
+
}
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Picks which fields a card/list preview should show, based on the
|
|
48
|
+
* project's declared type. 'custom' (or any unrecognized project_type)
|
|
49
|
+
* returns every visible field instead of guessing — there's no sensible
|
|
50
|
+
* default without more context. For known types, matches columns to
|
|
51
|
+
* named roles (title/image/price/meta) by keyword, falling back to
|
|
52
|
+
* "first visible column" for title if nothing matches, so a card is
|
|
53
|
+
* never left with no title text at all.
|
|
54
|
+
*/
|
|
55
|
+
function selectCardFields(model, projectType) {
|
|
56
|
+
const columns = (0, parser_1.getVisibleColumns)(model);
|
|
57
|
+
const slots = PROJECT_TYPE_SLOTS[projectType];
|
|
58
|
+
if (!slots) {
|
|
59
|
+
return { allFields: columns, metaFields: [] };
|
|
60
|
+
}
|
|
61
|
+
const taken = new Set();
|
|
62
|
+
const titleField = slots.title
|
|
63
|
+
? findColumnMatching(columns, slots.title, taken)
|
|
64
|
+
: undefined;
|
|
65
|
+
if (titleField)
|
|
66
|
+
taken.add(titleField.name);
|
|
67
|
+
const imageField = slots.image
|
|
68
|
+
? findColumnMatching(columns, slots.image, taken)
|
|
69
|
+
: undefined;
|
|
70
|
+
if (imageField)
|
|
71
|
+
taken.add(imageField.name);
|
|
72
|
+
const priceField = slots.price
|
|
73
|
+
? findColumnMatching(columns, slots.price, taken)
|
|
74
|
+
: undefined;
|
|
75
|
+
if (priceField)
|
|
76
|
+
taken.add(priceField.name);
|
|
77
|
+
const metaFields = [];
|
|
78
|
+
for (const metaSlot of slots.meta) {
|
|
79
|
+
const match = findColumnMatching(columns, metaSlot, taken);
|
|
80
|
+
if (match) {
|
|
81
|
+
metaFields.push(match);
|
|
82
|
+
taken.add(match.name);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// Never leave a card with no title at all — fall back to the first
|
|
86
|
+
// visible column (excluding the primary key) if no keyword matched.
|
|
87
|
+
const finalTitleField = titleField ?? columns.find((c) => c.name !== (0, parser_1.getPrimaryKey)(model)?.name);
|
|
88
|
+
return {
|
|
89
|
+
titleField: finalTitleField,
|
|
90
|
+
imageField,
|
|
91
|
+
priceField,
|
|
92
|
+
metaFields,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=card-field-selection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-field-selection.js","sourceRoot":"","sources":["../../src/schema/card-field-selection.ts"],"names":[],"mappings":";AAAA,sFAAsF;;AAgFtF,4CA4CC;AAzHD,qCAA2D;AAuB3D,kEAAkE;AAClE,uEAAuE;AACvE,sEAAsE;AACtE,6CAA6C;AAC7C,MAAM,kBAAkB,GAA8B;IACpD,IAAI,EAAE;QACJ,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC;QACvC,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC;QAC/C,IAAI,EAAG,CAAC,CAAC,QAAQ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AAC,KAAK,EAAE,KAAK,CAAC;QACjD,CAAC,CAAC,SAAS,CAAA;IACb,IAAI,UAAU;QAAE,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;IAE1C,MAAM,UAAU,GAAgB,EAAE,CAAA;IAClC,KAAK,MAAM,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QAClC,MAAM,KAAK,GAAG,kBAAkB,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;QAC1D,IAAI,KAAK,EAAE,CAAC;YACV,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YACtB,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACvB,CAAC;IACH,CAAC;IAED,mEAAmE;IACnE,oEAAoE;IACpE,MAAM,eAAe,GAAG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAA,sBAAa,EAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAA;IAEhG,OAAO;QACL,UAAU,EAAE,eAAe;QAC3B,UAAU;QACV,UAAU;QACV,UAAU;KACX,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-display-types.d.ts","sourceRoot":"","sources":["../../src/schema/default-display-types.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA+E1D,CAAA;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE9D"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File: underpeaks_codegen/packages/generator-core/src/schema/default-display-types.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DEFAULT_DISPLAY_UI_TYPE = void 0;
|
|
5
|
+
exports.getDefaultDisplayUiType = getDefaultDisplayUiType;
|
|
6
|
+
// Mirrors the DEFAULT (first-listed) display variant per ui_type from
|
|
7
|
+
// Studio's uitypes.ts DISPLAY_UI_TYPE_OPTIONS map — kept in generator-core
|
|
8
|
+
// so the scan step can fall back to a sensible display widget even when a
|
|
9
|
+
// field's display_ui_type was never explicitly set (e.g. existing fields
|
|
10
|
+
// created before this column existed, never re-saved through the model
|
|
11
|
+
// editor). Falls back further to 'label' for any ui_type not listed here,
|
|
12
|
+
// matching getDefaultDisplayUiType()'s own fallback in uitypes.ts.
|
|
13
|
+
//
|
|
14
|
+
// NOTE: keep in sync with uitypes.ts DISPLAY_UI_TYPE_OPTIONS on the
|
|
15
|
+
// Studio side — this is a deliberate, minimal duplication (first entry
|
|
16
|
+
// only) rather than importing the whole map, since generator-core has no
|
|
17
|
+
// dependency on the Studio app.
|
|
18
|
+
exports.DEFAULT_DISPLAY_UI_TYPE = {
|
|
19
|
+
textfield: 'label',
|
|
20
|
+
textarea: 'paragraph',
|
|
21
|
+
'rich-text': 'rendered-html',
|
|
22
|
+
'markdown-editor': 'rendered-markdown',
|
|
23
|
+
'code-editor': 'code-block',
|
|
24
|
+
'html-editor': 'rendered-html',
|
|
25
|
+
'url-input': 'link',
|
|
26
|
+
'email-input': 'mailto-link',
|
|
27
|
+
'phone-input': 'tel-link',
|
|
28
|
+
'password-input': 'masked-label',
|
|
29
|
+
'slug-input': 'label',
|
|
30
|
+
'color-picker': 'color-swatch',
|
|
31
|
+
'search-input': 'label',
|
|
32
|
+
'otp-input': 'masked-label',
|
|
33
|
+
'masked-input': 'masked-label',
|
|
34
|
+
'barcode-input': 'barcode-display',
|
|
35
|
+
'qr-code-input': 'qr-code-display',
|
|
36
|
+
select: 'chip',
|
|
37
|
+
'multi-select': 'chip-list',
|
|
38
|
+
radio: 'chip',
|
|
39
|
+
'checkbox-group': 'chip-list',
|
|
40
|
+
autocomplete: 'chip',
|
|
41
|
+
'number-input': 'label',
|
|
42
|
+
slider: 'label',
|
|
43
|
+
'range-slider': 'label',
|
|
44
|
+
rating: 'star-display',
|
|
45
|
+
stepper: 'label',
|
|
46
|
+
counter: 'label',
|
|
47
|
+
'percentage-input': 'formatted-percentage',
|
|
48
|
+
'currency-input': 'formatted-currency',
|
|
49
|
+
'weight-input': 'formatted-unit',
|
|
50
|
+
'distance-input': 'formatted-unit',
|
|
51
|
+
toggle: 'badge',
|
|
52
|
+
checkbox: 'badge',
|
|
53
|
+
'radio-yes-no': 'badge',
|
|
54
|
+
switch: 'badge',
|
|
55
|
+
'datetime-picker': 'formatted-datetime',
|
|
56
|
+
'date-picker': 'formatted-date',
|
|
57
|
+
'time-picker': 'formatted-time',
|
|
58
|
+
'date-range-picker': 'formatted-date-range',
|
|
59
|
+
'calendar-picker': 'formatted-date',
|
|
60
|
+
'week-picker': 'formatted-date',
|
|
61
|
+
'month-picker': 'formatted-date',
|
|
62
|
+
'relative-date-input': 'relative-time',
|
|
63
|
+
'key-value-editor': 'key-value-display',
|
|
64
|
+
'json-viewer': 'json-viewer',
|
|
65
|
+
'schema-editor': 'json-viewer',
|
|
66
|
+
'form-builder': 'json-viewer',
|
|
67
|
+
'tags-input': 'chip-list',
|
|
68
|
+
checklist: 'checklist-display',
|
|
69
|
+
list: 'list-display',
|
|
70
|
+
repeater: 'list-display',
|
|
71
|
+
'chip-list-input': 'chip-list',
|
|
72
|
+
'file-list-upload': 'file-list-display',
|
|
73
|
+
'ordered-list-input': 'ordered-list-display',
|
|
74
|
+
'image-upload': 'image-carousel',
|
|
75
|
+
'image-gallery-upload': 'image-carousel',
|
|
76
|
+
'image-url': 'image-carousel',
|
|
77
|
+
'media-picker': 'image-carousel',
|
|
78
|
+
'avatar-upload': 'avatar-display',
|
|
79
|
+
'cover-image-upload': 'single-image',
|
|
80
|
+
'icon-picker': 'icon-display',
|
|
81
|
+
'file-upload': 'file-download-link',
|
|
82
|
+
'document-upload': 'file-download-link',
|
|
83
|
+
'video-upload': 'video-player',
|
|
84
|
+
'audio-upload': 'audio-player',
|
|
85
|
+
'signature-pad': 'signature-display',
|
|
86
|
+
'location-input': 'map-preview',
|
|
87
|
+
hidden: 'label',
|
|
88
|
+
};
|
|
89
|
+
function getDefaultDisplayUiType(uiType) {
|
|
90
|
+
return exports.DEFAULT_DISPLAY_UI_TYPE[uiType] ?? 'label';
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=default-display-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-display-types.js","sourceRoot":"","sources":["../../src/schema/default-display-types.ts"],"names":[],"mappings":";AAAA,uFAAuF;;;AAgGvF,0DAEC;AAhGD,sEAAsE;AACtE,2EAA2E;AAC3E,0EAA0E;AAC1E,yEAAyE;AACzE,uEAAuE;AACvE,0EAA0E;AAC1E,mEAAmE;AACnE,EAAE;AACF,oEAAoE;AACpE,uEAAuE;AACvE,yEAAyE;AACzE,gCAAgC;AAEnB,QAAA,uBAAuB,GAA2B;IAC7D,SAAS,EAAa,OAAO;IAC7B,QAAQ,EAAc,WAAW;IACjC,WAAW,EAAY,eAAe;IACtC,iBAAiB,EAAM,mBAAmB;IAC1C,aAAa,EAAU,YAAY;IACnC,aAAa,EAAU,eAAe;IACtC,WAAW,EAAY,MAAM;IAC7B,aAAa,EAAU,aAAa;IACpC,aAAa,EAAU,UAAU;IACjC,gBAAgB,EAAO,cAAc;IACrC,YAAY,EAAW,OAAO;IAC9B,cAAc,EAAS,cAAc;IACrC,cAAc,EAAS,OAAO;IAC9B,WAAW,EAAY,cAAc;IACrC,cAAc,EAAS,cAAc;IACrC,eAAe,EAAQ,iBAAiB;IACxC,eAAe,EAAQ,iBAAiB;IAExC,MAAM,EAAgB,MAAM;IAC5B,cAAc,EAAS,WAAW;IAClC,KAAK,EAAiB,MAAM;IAC5B,gBAAgB,EAAO,WAAW;IAClC,YAAY,EAAU,MAAM;IAE5B,cAAc,EAAS,OAAO;IAC9B,MAAM,EAAgB,OAAO;IAC7B,cAAc,EAAS,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MAAc;IACpD,OAAO,+BAAuB,CAAC,MAAM,CAAC,IAAI,OAAO,CAAA;AACnD,CAAC"}
|
package/dist/schema/parser.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare function parseColumnType(col: ColumnDef): {
|
|
|
7
7
|
toJson: string;
|
|
8
8
|
};
|
|
9
9
|
export declare function getVisibleColumns(model: Model): ColumnDef[];
|
|
10
|
+
export declare function getAllNonPrimaryColumns(model: Model): ColumnDef[];
|
|
10
11
|
export declare function getPrimaryKey(model: Model): ColumnDef | undefined;
|
|
11
12
|
export declare function modelToClassName(modelName: string): string;
|
|
12
13
|
export declare function modelToFileName(modelName: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/schema/parser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE5D,wBAAgB,eAAe,CAAC,GAAG,EAAE,SAAS,GAAG;IAC/C,QAAQ,EAAI,MAAM,CAAA;IAClB,MAAM,EAAM,MAAM,CAAA;IAClB,QAAQ,EAAI,OAAO,CAAA;IACnB,QAAQ,EAAI,MAAM,CAAA;IAClB,MAAM,EAAM,MAAM,CAAA;CACnB,
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/schema/parser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE5D,wBAAgB,eAAe,CAAC,GAAG,EAAE,SAAS,GAAG;IAC/C,QAAQ,EAAI,MAAM,CAAA;IAClB,MAAM,EAAM,MAAM,CAAA;IAClB,QAAQ,EAAI,OAAO,CAAA;IACnB,QAAQ,EAAI,MAAM,CAAA;IAClB,MAAM,EAAM,MAAM,CAAA;CACnB,CAoGA;AAQD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,EAAE,CAE3D;AAQD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,EAAE,CAEjE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,SAAS,CAEjE;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAY1D;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAOzD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,CAkBhE"}
|
package/dist/schema/parser.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.parseColumnType = parseColumnType;
|
|
5
5
|
exports.getVisibleColumns = getVisibleColumns;
|
|
6
|
+
exports.getAllNonPrimaryColumns = getAllNonPrimaryColumns;
|
|
6
7
|
exports.getPrimaryKey = getPrimaryKey;
|
|
7
8
|
exports.modelToClassName = modelToClassName;
|
|
8
9
|
exports.modelToFileName = modelToFileName;
|
|
@@ -59,9 +60,25 @@ function parseColumnType(col) {
|
|
|
59
60
|
fromJson: `json['${col.name}'] != null ? DateTime.parse(json['${col.name}']) : null`,
|
|
60
61
|
toJson: `'${col.name}': ${col.name}?.toIso8601String()`,
|
|
61
62
|
};
|
|
63
|
+
// FIX: 'array' was previously grouped with 'json'/'jsonb' and typed as
|
|
64
|
+
// Map<String, dynamic>? — wrong. Every array-shaped ui_type
|
|
65
|
+
// (tags-input, multi-select, checklist, etc.) operates on a JSON list,
|
|
66
|
+
// not a JSON object. Split out into its own case with a real List type.
|
|
67
|
+
case 'array':
|
|
68
|
+
return {
|
|
69
|
+
dartType: nullable ? 'List<dynamic>?' : 'List<dynamic>',
|
|
70
|
+
tsType: 'unknown[]',
|
|
71
|
+
nullable,
|
|
72
|
+
fromJson: `json['${col.name}'] as List<dynamic>?`,
|
|
73
|
+
toJson: `'${col.name}': ${col.name}`,
|
|
74
|
+
};
|
|
75
|
+
// 'geo' is stored as a JSON object ({lat, lng, address}), so it
|
|
76
|
+
// correctly belongs with jsonb/json here, not with array. Widget
|
|
77
|
+
// templates are responsible for converting this Map to/from a typed
|
|
78
|
+
// NxfGeoValue at the point of use.
|
|
62
79
|
case 'json':
|
|
63
80
|
case 'jsonb':
|
|
64
|
-
case '
|
|
81
|
+
case 'geo':
|
|
65
82
|
return {
|
|
66
83
|
dartType: nullable ? 'Map<String, dynamic>?' : 'Map<String, dynamic>',
|
|
67
84
|
tsType: 'Record<string, any>',
|
|
@@ -69,6 +86,18 @@ function parseColumnType(col) {
|
|
|
69
86
|
fromJson: `json['${col.name}'] as Map<String, dynamic>?`,
|
|
70
87
|
toJson: `'${col.name}': ${col.name}`,
|
|
71
88
|
};
|
|
89
|
+
// FIX: 'image'/'file' had no case at all and fell through to
|
|
90
|
+
// 'dynamic' — both are stored as a plain URL string, same shape as
|
|
91
|
+
// any other text field.
|
|
92
|
+
case 'image':
|
|
93
|
+
case 'file':
|
|
94
|
+
return {
|
|
95
|
+
dartType: nullable ? 'String?' : 'String',
|
|
96
|
+
tsType: 'string',
|
|
97
|
+
nullable,
|
|
98
|
+
fromJson: `json['${col.name}'] as String?`,
|
|
99
|
+
toJson: `'${col.name}': ${col.name}`,
|
|
100
|
+
};
|
|
72
101
|
default:
|
|
73
102
|
return {
|
|
74
103
|
dartType: nullable ? 'dynamic' : 'dynamic',
|
|
@@ -79,9 +108,24 @@ function parseColumnType(col) {
|
|
|
79
108
|
};
|
|
80
109
|
}
|
|
81
110
|
}
|
|
111
|
+
// Fields the developer wants hidden from FORM/DETAIL widget rendering —
|
|
112
|
+
// used only by presentation-layer templates (page-form, page-detail,
|
|
113
|
+
// widget-card) to decide what to actually SHOW. Never use this to decide
|
|
114
|
+
// what belongs on the model/repository — a hidden field (e.g. a foreign
|
|
115
|
+
// key like order_id) still needs to exist on the model and round-trip
|
|
116
|
+
// through create/update correctly even though no widget renders for it.
|
|
82
117
|
function getVisibleColumns(model) {
|
|
83
118
|
return model.schema.columns.filter((c) => !c.hidden && !c.is_primary);
|
|
84
119
|
}
|
|
120
|
+
// FIX: model.ts previously built its Dart/TS fields from
|
|
121
|
+
// getVisibleColumns() — meaning any column with hidden: true (e.g.
|
|
122
|
+
// order_id, tenant_id, project_id) was completely missing from the
|
|
123
|
+
// generated model class, breaking any create/update that needs to carry
|
|
124
|
+
// that value through. Models must always include every real column;
|
|
125
|
+
// hiding is a presentation concern only.
|
|
126
|
+
function getAllNonPrimaryColumns(model) {
|
|
127
|
+
return model.schema.columns.filter((c) => !c.is_primary);
|
|
128
|
+
}
|
|
85
129
|
function getPrimaryKey(model) {
|
|
86
130
|
return model.schema.columns.find((c) => c.is_primary);
|
|
87
131
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/schema/parser.ts"],"names":[],"mappings":";AAAA,wEAAwE;;AAIxE,
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/schema/parser.ts"],"names":[],"mappings":";AAAA,wEAAwE;;AAIxE,0CA0GC;AAQD,8CAEC;AAQD,0DAEC;AAED,sCAEC;AAED,4CAYC;AAED,0CAOC;AAED,8CAkBC;AA7KD,SAAgB,eAAe,CAAC,GAAc;IAO5C,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,KAAK,KAAK,CAAA;IAEvC,QAAQ,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QAC/B,KAAK,MAAM,CAAC;QACZ,KAAK,QAAQ,CAAC;QACd,KAAK,MAAM;YACT,OAAO;gBACL,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;gBACzC,MAAM,EAAI,QAAQ;gBAClB,QAAQ;gBACR,QAAQ,EAAE,SAAS,GAAG,CAAC,IAAI,eAAe;gBAC1C,MAAM,EAAI,IAAI,GAAG,CAAC,I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,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CACxF,CAAA;IACH,CAAC;IAED,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;AACnC,CAAC"}
|
package/dist/schema/types.d.ts
CHANGED
|
@@ -25,12 +25,23 @@ export interface Model {
|
|
|
25
25
|
project_id: string;
|
|
26
26
|
tenant_id: string;
|
|
27
27
|
}
|
|
28
|
+
export interface NavSettings {
|
|
29
|
+
mobile: {
|
|
30
|
+
header: 'none' | 'app-bar';
|
|
31
|
+
bottom: 'none' | 'bottom-nav' | 'drawer-nav';
|
|
32
|
+
};
|
|
33
|
+
web: {
|
|
34
|
+
header: 'none' | 'top-nav' | 'sidebar-nav';
|
|
35
|
+
footer: 'none' | 'footer';
|
|
36
|
+
};
|
|
37
|
+
}
|
|
28
38
|
export interface PageDef {
|
|
29
39
|
page_id: string;
|
|
30
40
|
name: string;
|
|
31
41
|
slug: string;
|
|
32
42
|
template_type: string;
|
|
33
43
|
nav_type?: string;
|
|
44
|
+
nav_settings?: NavSettings;
|
|
34
45
|
model_id?: string | null;
|
|
35
46
|
visibility?: string;
|
|
36
47
|
}
|
|
@@ -40,6 +51,7 @@ export interface PageRoute {
|
|
|
40
51
|
to_page_id: string;
|
|
41
52
|
trigger: string;
|
|
42
53
|
label?: string | null;
|
|
54
|
+
attach_to?: string | null;
|
|
43
55
|
}
|
|
44
56
|
export interface ThemeData {
|
|
45
57
|
colours: Record<string, string>;
|
|
@@ -88,5 +100,7 @@ export interface GeneratedFile {
|
|
|
88
100
|
path: string;
|
|
89
101
|
content: string;
|
|
90
102
|
category: 'generated' | 'customizable' | 'root';
|
|
103
|
+
field_names?: string[];
|
|
104
|
+
field_renders?: Record<string, Record<string, string[]>>;
|
|
91
105
|
}
|
|
92
106
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/schema/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAe,MAAM,CAAA;IACzB,IAAI,EAAgB,MAAM,CAAA;IAC1B,OAAO,CAAC,EAAY,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/schema/types.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAe,MAAM,CAAA;IACzB,IAAI,EAAgB,MAAM,CAAA;IAC1B,OAAO,CAAC,EAAY,MAAM,CAAA;IAC1B,eAAe,CAAC,EAAI,MAAM,CAAA;IAC1B,UAAU,CAAC,EAAS,OAAO,CAAA;IAC3B,QAAQ,CAAC,EAAW,OAAO,CAAA;IAC3B,MAAM,CAAC,EAAc,OAAO,CAAA;IAC5B,OAAO,CAAC,EAAa,GAAG,CAAA;IACxB,MAAM,CAAC,EAAc,OAAO,CAAA;IAC5B,QAAQ,CAAC,EAAY,OAAO,CAAA;IAC5B,OAAO,CAAC,EAAa,MAAM,EAAE,CAAA;CAC9B;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAQ,MAAM,CAAA;IACrB,OAAO,EAAQ,SAAS,EAAE,CAAA;IAC1B,KAAK,CAAC,EAAS,GAAG,EAAE,CAAA;IACpB,YAAY,CAAC,EAAE,GAAG,EAAE,CAAA;CACrB;AAED,MAAM,WAAW,KAAK;IACpB,KAAK,EAAO,MAAM,CAAA;IAClB,IAAI,EAAQ,MAAM,CAAA;IAClB,IAAI,CAAC,EAAO,MAAM,CAAA;IAClB,MAAM,EAAM,WAAW,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAG,MAAM,CAAA;CACnB;AAKD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;QAC1B,MAAM,EAAE,MAAM,GAAG,YAAY,GA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