@strapi/generators 5.54.0 → 5.55.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/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -0
- package/dist/index.mjs.map +1 -1
- package/dist/plops/content-type.d.ts.map +1 -1
- package/dist/plops/content-type.js +41 -11
- package/dist/plops/content-type.js.map +1 -1
- package/dist/plops/content-type.mjs +40 -11
- package/dist/plops/content-type.mjs.map +1 -1
- package/dist/plops/prompts/get-folder-prompts.d.ts +14 -0
- package/dist/plops/prompts/get-folder-prompts.d.ts.map +1 -0
- package/dist/plops/prompts/get-folder-prompts.js +105 -0
- package/dist/plops/prompts/get-folder-prompts.js.map +1 -0
- package/dist/plops/prompts/get-folder-prompts.mjs +103 -0
- package/dist/plops/prompts/get-folder-prompts.mjs.map +1 -0
- package/dist/plops/utils/content-structure.d.ts +42 -0
- package/dist/plops/utils/content-structure.d.ts.map +1 -0
- package/dist/plops/utils/content-structure.js +260 -0
- package/dist/plops/utils/content-structure.js.map +1 -0
- package/dist/plops/utils/content-structure.mjs +247 -0
- package/dist/plops/utils/content-structure.mjs.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
|
|
5
|
+
const getContentStructureFilePath = (destBasePath)=>{
|
|
6
|
+
return join(destBasePath, 'content-structure', 'groups.json');
|
|
7
|
+
};
|
|
8
|
+
const isRecord = (value)=>{
|
|
9
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
10
|
+
};
|
|
11
|
+
const readContentStructureFile = (destBasePath)=>{
|
|
12
|
+
const filePath = getContentStructureFilePath(destBasePath);
|
|
13
|
+
if (!fs.pathExistsSync(filePath)) {
|
|
14
|
+
return {
|
|
15
|
+
status: 'absent'
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
let parsed;
|
|
19
|
+
try {
|
|
20
|
+
parsed = fs.readJSONSync(filePath);
|
|
21
|
+
} catch {
|
|
22
|
+
return {
|
|
23
|
+
status: 'invalid'
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
if (!isRecord(parsed) || parsed.version !== 1 || !isRecord(parsed.sections)) {
|
|
27
|
+
return {
|
|
28
|
+
status: 'invalid'
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
status: 'ok',
|
|
33
|
+
file: parsed
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
const sectionKeyForKind = (kind)=>{
|
|
37
|
+
return kind === 'singleType' ? 'singleTypes' : 'collectionTypes';
|
|
38
|
+
};
|
|
39
|
+
const isWellFormedGroup = (group)=>{
|
|
40
|
+
if (!isRecord(group)) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
if (typeof group.id !== 'string' || group.id.length === 0) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
if (typeof group.name !== 'string' || group.name.trim().length === 0) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
if (group.parent !== null && typeof group.parent !== 'string') {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
return Array.isArray(group.children);
|
|
53
|
+
};
|
|
54
|
+
const getSectionGroups = (file, sectionKey)=>{
|
|
55
|
+
const section = file.sections[sectionKey];
|
|
56
|
+
if (section === undefined || section === null) {
|
|
57
|
+
return [];
|
|
58
|
+
}
|
|
59
|
+
if (!isRecord(section) || !Array.isArray(section.groups)) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
return section.groups;
|
|
63
|
+
};
|
|
64
|
+
const isGroupChild = (child)=>{
|
|
65
|
+
return isRecord(child) && child.type === 'group' && typeof child.id === 'string';
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* A group is an effective root when it has no parent, or its parent id points
|
|
69
|
+
* at a group that no longer exists.
|
|
70
|
+
*/ const isEffectivelyRoot = (group, knownIds)=>{
|
|
71
|
+
return group.parent === null || !knownIds.has(group.parent);
|
|
72
|
+
};
|
|
73
|
+
const listFolderChoices = (groups)=>{
|
|
74
|
+
const wellFormed = groups.filter(isWellFormedGroup);
|
|
75
|
+
const choices = [];
|
|
76
|
+
const seen = new Set();
|
|
77
|
+
const byId = new Map();
|
|
78
|
+
for (const group of wellFormed){
|
|
79
|
+
if (byId.has(group.id)) continue;
|
|
80
|
+
byId.set(group.id, group);
|
|
81
|
+
}
|
|
82
|
+
const knownIds = new Set(byId.keys());
|
|
83
|
+
const childGroupsOf = (parent)=>{
|
|
84
|
+
const listed = parent.children.filter(isGroupChild).map((child)=>{
|
|
85
|
+
return byId.get(child.id);
|
|
86
|
+
}).filter((group)=>{
|
|
87
|
+
return group !== undefined && group.parent === parent.id;
|
|
88
|
+
});
|
|
89
|
+
const unlisted = wellFormed.filter((group)=>{
|
|
90
|
+
return group.parent === parent.id && !listed.includes(group);
|
|
91
|
+
});
|
|
92
|
+
return [
|
|
93
|
+
...listed,
|
|
94
|
+
...unlisted
|
|
95
|
+
];
|
|
96
|
+
};
|
|
97
|
+
const visit = (parent, path)=>{
|
|
98
|
+
const children = (()=>{
|
|
99
|
+
if (parent !== null) {
|
|
100
|
+
return childGroupsOf(parent);
|
|
101
|
+
}
|
|
102
|
+
return wellFormed.filter((group)=>{
|
|
103
|
+
return isEffectivelyRoot(group, knownIds);
|
|
104
|
+
});
|
|
105
|
+
})();
|
|
106
|
+
for (const group of children){
|
|
107
|
+
if (seen.has(group.id)) {
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
seen.add(group.id);
|
|
111
|
+
const groupPath = [
|
|
112
|
+
...path,
|
|
113
|
+
group.name
|
|
114
|
+
];
|
|
115
|
+
choices.push({
|
|
116
|
+
name: groupPath.join(' / '),
|
|
117
|
+
value: group.id
|
|
118
|
+
});
|
|
119
|
+
visit(group, groupPath);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
visit(null, []);
|
|
123
|
+
return choices;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Groups whose parent id does not exist are considered root level entries.
|
|
127
|
+
*/ const findRootFolderByName = (groups, name)=>{
|
|
128
|
+
const target = name.trim().toLowerCase();
|
|
129
|
+
if (target.length === 0) {
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
const knownIds = new Set(groups.filter(isWellFormedGroup).map(({ id })=>id));
|
|
133
|
+
return groups.find((group)=>{
|
|
134
|
+
if (!isWellFormedGroup(group)) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
if (!isEffectivelyRoot(group, knownIds)) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
return group.name.trim().toLowerCase() === target;
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
const generateFolderId = ()=>{
|
|
144
|
+
const body = randomUUID().replace(/-/g, '').slice(0, 24);
|
|
145
|
+
return `grp_${body}`;
|
|
146
|
+
};
|
|
147
|
+
const createEmptyContentStructureFile = ()=>{
|
|
148
|
+
return {
|
|
149
|
+
version: 1,
|
|
150
|
+
sections: {
|
|
151
|
+
collectionTypes: {
|
|
152
|
+
groups: []
|
|
153
|
+
},
|
|
154
|
+
singleTypes: {
|
|
155
|
+
groups: []
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
const ensureSectionGroups = (file, sectionKey)=>{
|
|
161
|
+
const section = file.sections[sectionKey];
|
|
162
|
+
if (section === undefined || section === null) {
|
|
163
|
+
file.sections[sectionKey] = {
|
|
164
|
+
groups: []
|
|
165
|
+
};
|
|
166
|
+
return file.sections[sectionKey].groups;
|
|
167
|
+
}
|
|
168
|
+
if (!isRecord(section) || !Array.isArray(section.groups)) {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
return section.groups;
|
|
172
|
+
};
|
|
173
|
+
const resolveTargetGroup = (groups, folder)=>{
|
|
174
|
+
if ('targetGroupId' in folder) {
|
|
175
|
+
const target = groups.find((group)=>{
|
|
176
|
+
return isWellFormedGroup(group) && group.id === folder.targetGroupId;
|
|
177
|
+
});
|
|
178
|
+
if (!target) {
|
|
179
|
+
throw new Error(`No usable folder with id "${folder.targetGroupId}" exists in groups.json.`);
|
|
180
|
+
}
|
|
181
|
+
return target;
|
|
182
|
+
}
|
|
183
|
+
const hasUsableName = typeof folder.newFolderName === 'string';
|
|
184
|
+
const name = hasUsableName ? folder.newFolderName.trim() : '';
|
|
185
|
+
if (name.length === 0) {
|
|
186
|
+
throw new Error('The new folder name must be a non-empty string.');
|
|
187
|
+
}
|
|
188
|
+
const existingRootFolder = findRootFolderByName(groups, name);
|
|
189
|
+
if (existingRootFolder) {
|
|
190
|
+
return existingRootFolder;
|
|
191
|
+
}
|
|
192
|
+
const created = {
|
|
193
|
+
id: generateFolderId(),
|
|
194
|
+
children: [],
|
|
195
|
+
parent: null,
|
|
196
|
+
name
|
|
197
|
+
};
|
|
198
|
+
groups.push(created);
|
|
199
|
+
return created;
|
|
200
|
+
};
|
|
201
|
+
const removeContentTypeFromSection = (groups, uid)=>{
|
|
202
|
+
for (const group of groups){
|
|
203
|
+
if (!isWellFormedGroup(group)) {
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
group.children = group.children.filter((child)=>{
|
|
207
|
+
if (!isRecord(child)) {
|
|
208
|
+
return true;
|
|
209
|
+
}
|
|
210
|
+
return !(child.type === 'contentType' && child.uid === uid);
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Validates the folder selection and stages the assignment of a content type in
|
|
216
|
+
* `<destBasePath>/content-structure/groups.json`, creating the file (or a new root
|
|
217
|
+
* folder) in memory when needed.
|
|
218
|
+
*
|
|
219
|
+
* @return A commit function that writes the staged result to disk.
|
|
220
|
+
*/ const planContentTypeToFolder = (options)=>{
|
|
221
|
+
const { destBasePath, kind, uid, folder } = options;
|
|
222
|
+
const filePath = getContentStructureFilePath(destBasePath);
|
|
223
|
+
const read = readContentStructureFile(destBasePath);
|
|
224
|
+
if (read.status === 'invalid') {
|
|
225
|
+
throw new Error(`Cannot assign "${uid}" to a folder: ${filePath} exists but is not a valid content-structure file.`);
|
|
226
|
+
}
|
|
227
|
+
const file = read.status === 'ok' ? read.file : createEmptyContentStructureFile();
|
|
228
|
+
const sectionKey = sectionKeyForKind(kind);
|
|
229
|
+
const groups = ensureSectionGroups(file, sectionKey);
|
|
230
|
+
if (groups === null) {
|
|
231
|
+
throw new Error(`Cannot assign "${uid}" to a folder: the "${sectionKey}" section of ${filePath} is malformed.`);
|
|
232
|
+
}
|
|
233
|
+
const targetGroup = resolveTargetGroup(groups, folder);
|
|
234
|
+
removeContentTypeFromSection(groups, uid);
|
|
235
|
+
targetGroup.children.push({
|
|
236
|
+
type: 'contentType',
|
|
237
|
+
uid
|
|
238
|
+
});
|
|
239
|
+
return ()=>{
|
|
240
|
+
fs.outputJSONSync(filePath, file, {
|
|
241
|
+
spaces: 2
|
|
242
|
+
});
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
export { findRootFolderByName, generateFolderId, getContentStructureFilePath, getSectionGroups, listFolderChoices, planContentTypeToFolder, readContentStructureFile, sectionKeyForKind };
|
|
247
|
+
//# sourceMappingURL=content-structure.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-structure.mjs","sources":["../../../src/plops/utils/content-structure.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { randomUUID } from 'node:crypto';\nimport fs from 'fs-extra';\n\nexport type FolderSelection = { targetGroupId: string } | { newFolderName: string };\n\nexport interface FolderChoice {\n value: string;\n name: string;\n}\n\nexport type ContentStructureReadResult =\n | { status: 'ok'; file: any }\n | { status: 'invalid' }\n | { status: 'absent' };\n\nexport const getContentStructureFilePath = (destBasePath: string): string => {\n return join(destBasePath, 'content-structure', 'groups.json');\n};\n\nconst isRecord = (value: any): boolean => {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n};\n\nexport const readContentStructureFile = (destBasePath: string): ContentStructureReadResult => {\n const filePath = getContentStructureFilePath(destBasePath);\n\n if (!fs.pathExistsSync(filePath)) {\n return { status: 'absent' };\n }\n\n let parsed: any;\n\n try {\n parsed = fs.readJSONSync(filePath);\n } catch {\n return { status: 'invalid' };\n }\n\n if (!isRecord(parsed) || parsed.version !== 1 || !isRecord(parsed.sections)) {\n return { status: 'invalid' };\n }\n\n return { status: 'ok', file: parsed };\n};\n\nexport const sectionKeyForKind = (kind: string): 'collectionTypes' | 'singleTypes' => {\n return kind === 'singleType' ? 'singleTypes' : 'collectionTypes';\n};\n\nconst isWellFormedGroup = (group: any): boolean => {\n if (!isRecord(group)) {\n return false;\n }\n\n if (typeof group.id !== 'string' || group.id.length === 0) {\n return false;\n }\n\n if (typeof group.name !== 'string' || group.name.trim().length === 0) {\n return false;\n }\n\n if (group.parent !== null && typeof group.parent !== 'string') {\n return false;\n }\n\n return Array.isArray(group.children);\n};\n\nexport const getSectionGroups = (file: any, sectionKey: string): any[] | null => {\n const section = file.sections[sectionKey];\n\n if (section === undefined || section === null) {\n return [];\n }\n\n if (!isRecord(section) || !Array.isArray(section.groups)) {\n return null;\n }\n\n return section.groups;\n};\n\nconst isGroupChild = (child: any): boolean => {\n return isRecord(child) && child.type === 'group' && typeof child.id === 'string';\n};\n\n/**\n * A group is an effective root when it has no parent, or its parent id points\n * at a group that no longer exists.\n */\nconst isEffectivelyRoot = (group: any, knownIds: Set<string>): boolean => {\n return group.parent === null || !knownIds.has(group.parent);\n};\n\nexport const listFolderChoices = (groups: any[]): FolderChoice[] => {\n const wellFormed = groups.filter(isWellFormedGroup);\n\n const choices: FolderChoice[] = [];\n const seen = new Set<string>();\n\n const byId = new Map<string, any>();\n\n for (const group of wellFormed) {\n if (byId.has(group.id)) continue;\n byId.set(group.id, group);\n }\n\n const knownIds = new Set(byId.keys());\n\n const childGroupsOf = (parent: any): any[] => {\n const listed = parent.children\n .filter(isGroupChild)\n .map((child: any) => {\n return byId.get(child.id);\n })\n .filter((group: any) => {\n return group !== undefined && group.parent === parent.id;\n });\n\n const unlisted = wellFormed.filter((group) => {\n return group.parent === parent.id && !listed.includes(group);\n });\n\n return [...listed, ...unlisted];\n };\n\n const visit = (parent: any, path: string[]) => {\n const children = (() => {\n if (parent !== null) {\n return childGroupsOf(parent);\n }\n\n return wellFormed.filter((group) => {\n return isEffectivelyRoot(group, knownIds);\n });\n })();\n\n for (const group of children) {\n if (seen.has(group.id)) {\n continue;\n }\n\n seen.add(group.id);\n\n const groupPath = [...path, group.name];\n choices.push({ name: groupPath.join(' / '), value: group.id });\n\n visit(group, groupPath);\n }\n };\n\n visit(null, []);\n\n return choices;\n};\n\n/**\n * Groups whose parent id does not exist are considered root level entries.\n */\nexport const findRootFolderByName = (groups: any[], name: string): any => {\n const target = name.trim().toLowerCase();\n\n if (target.length === 0) {\n return undefined;\n }\n\n const knownIds = new Set(groups.filter(isWellFormedGroup).map(({ id }) => id));\n\n return groups.find((group) => {\n if (!isWellFormedGroup(group)) {\n return false;\n }\n\n if (!isEffectivelyRoot(group, knownIds)) {\n return false;\n }\n\n return group.name.trim().toLowerCase() === target;\n });\n};\n\nexport const generateFolderId = (): string => {\n const body = randomUUID().replace(/-/g, '').slice(0, 24);\n return `grp_${body}`;\n};\n\nconst createEmptyContentStructureFile = () => {\n return {\n version: 1,\n sections: {\n collectionTypes: { groups: [] },\n singleTypes: { groups: [] },\n },\n };\n};\n\nconst ensureSectionGroups = (file: any, sectionKey: string): any[] | null => {\n const section = file.sections[sectionKey];\n\n if (section === undefined || section === null) {\n file.sections[sectionKey] = { groups: [] };\n return file.sections[sectionKey].groups;\n }\n\n if (!isRecord(section) || !Array.isArray(section.groups)) {\n return null;\n }\n\n return section.groups;\n};\n\nconst resolveTargetGroup = (groups: any[], folder: FolderSelection): any => {\n if ('targetGroupId' in folder) {\n const target = groups.find((group) => {\n return isWellFormedGroup(group) && group.id === folder.targetGroupId;\n });\n\n if (!target) {\n throw new Error(`No usable folder with id \"${folder.targetGroupId}\" exists in groups.json.`);\n }\n\n return target;\n }\n\n const hasUsableName = typeof folder.newFolderName === 'string';\n const name = hasUsableName ? folder.newFolderName.trim() : '';\n\n if (name.length === 0) {\n throw new Error('The new folder name must be a non-empty string.');\n }\n\n const existingRootFolder = findRootFolderByName(groups, name);\n\n if (existingRootFolder) {\n return existingRootFolder;\n }\n\n const created = {\n id: generateFolderId(),\n children: [],\n parent: null,\n name,\n };\n\n groups.push(created);\n\n return created;\n};\n\nconst removeContentTypeFromSection = (groups: any[], uid: string): void => {\n for (const group of groups) {\n if (!isWellFormedGroup(group)) {\n continue;\n }\n\n group.children = group.children.filter((child: any) => {\n if (!isRecord(child)) {\n return true;\n }\n\n return !(child.type === 'contentType' && child.uid === uid);\n });\n }\n};\n\nexport interface AssignContentTypeToFolderOptions {\n folder: FolderSelection;\n destBasePath: string;\n kind: string;\n uid: string;\n}\n\n/**\n * Validates the folder selection and stages the assignment of a content type in\n * `<destBasePath>/content-structure/groups.json`, creating the file (or a new root\n * folder) in memory when needed.\n *\n * @return A commit function that writes the staged result to disk.\n */\nexport const planContentTypeToFolder = (\n options: AssignContentTypeToFolderOptions\n): (() => void) => {\n const { destBasePath, kind, uid, folder } = options;\n const filePath = getContentStructureFilePath(destBasePath);\n\n const read = readContentStructureFile(destBasePath);\n\n if (read.status === 'invalid') {\n throw new Error(\n `Cannot assign \"${uid}\" to a folder: ${filePath} exists but is not a valid content-structure file.`\n );\n }\n\n const file = read.status === 'ok' ? read.file : createEmptyContentStructureFile();\n\n const sectionKey = sectionKeyForKind(kind);\n const groups = ensureSectionGroups(file, sectionKey);\n\n if (groups === null) {\n throw new Error(\n `Cannot assign \"${uid}\" to a folder: the \"${sectionKey}\" section of ${filePath} is malformed.`\n );\n }\n\n const targetGroup = resolveTargetGroup(groups, folder);\n\n removeContentTypeFromSection(groups, uid);\n targetGroup.children.push({ type: 'contentType', uid });\n\n return () => {\n fs.outputJSONSync(filePath, file, { spaces: 2 });\n };\n};\n"],"names":["getContentStructureFilePath","destBasePath","join","isRecord","value","Array","isArray","readContentStructureFile","filePath","fs","pathExistsSync","status","parsed","readJSONSync","version","sections","file","sectionKeyForKind","kind","isWellFormedGroup","group","id","length","name","trim","parent","children","getSectionGroups","sectionKey","section","undefined","groups","isGroupChild","child","type","isEffectivelyRoot","knownIds","has","listFolderChoices","wellFormed","filter","choices","seen","Set","byId","Map","set","keys","childGroupsOf","listed","map","get","unlisted","includes","visit","path","add","groupPath","push","findRootFolderByName","target","toLowerCase","find","generateFolderId","body","randomUUID","replace","slice","createEmptyContentStructureFile","collectionTypes","singleTypes","ensureSectionGroups","resolveTargetGroup","folder","targetGroupId","Error","hasUsableName","newFolderName","existingRootFolder","created","removeContentTypeFromSection","uid","planContentTypeToFolder","options","read","targetGroup","outputJSONSync","spaces"],"mappings":";;;;AAgBO,MAAMA,8BAA8B,CAACC,YAAAA,GAAAA;IAC1C,OAAOC,IAAAA,CAAKD,cAAc,mBAAA,EAAqB,aAAA,CAAA;AACjD;AAEA,MAAME,WAAW,CAACC,KAAAA,GAAAA;IAChB,OAAO,OAAOA,UAAU,QAAA,IAAYA,KAAAA,KAAU,QAAQ,CAACC,KAAAA,CAAMC,OAAO,CAACF,KAAAA,CAAAA;AACvE,CAAA;AAEO,MAAMG,2BAA2B,CAACN,YAAAA,GAAAA;AACvC,IAAA,MAAMO,WAAWR,2BAAAA,CAA4BC,YAAAA,CAAAA;AAE7C,IAAA,IAAI,CAACQ,EAAAA,CAAGC,cAAc,CAACF,QAAAA,CAAAA,EAAW;QAChC,OAAO;YAAEG,MAAAA,EAAQ;AAAS,SAAA;AAC5B,IAAA;IAEA,IAAIC,MAAAA;IAEJ,IAAI;QACFA,MAAAA,GAASH,EAAAA,CAAGI,YAAY,CAACL,QAAAA,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CAAAA;AAE/CO,IAAAA,4BAAAA,CAA6BjD,MAAAA,EAAQkD,GAAAA,CAAAA;IACrCI,WAAAA,CAAY3D,QAAQ,CAACgC,IAAI,CAAC;QAAExB,IAAAA,EAAM,aAAA;AAAe+C,QAAAA;AAAI,KAAA,CAAA;IAErD,OAAO,IAAA;QACLxE,EAAAA,CAAG6E,cAAc,CAAC9E,QAAAA,EAAUQ,IAAAA,EAAM;YAAEuE,MAAAA,EAAQ;AAAE,SAAA,CAAA;AAChD,IAAA,CAAA;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/generators",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.55.0",
|
|
4
4
|
"description": "Interactive API generator.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@sindresorhus/slugify": "1.1.0",
|
|
53
|
-
"@strapi/typescript-utils": "5.
|
|
54
|
-
"@strapi/utils": "5.
|
|
53
|
+
"@strapi/typescript-utils": "5.55.0",
|
|
54
|
+
"@strapi/utils": "5.55.0",
|
|
55
55
|
"chalk": "4.1.2",
|
|
56
56
|
"fs-extra": "11.3.4",
|
|
57
57
|
"handlebars": "4.7.9",
|
|
@@ -66,10 +66,10 @@
|
|
|
66
66
|
"@types/jscodeshift": "17.3.0",
|
|
67
67
|
"@types/node": "20.19.41",
|
|
68
68
|
"copyfiles": "2.4.1",
|
|
69
|
-
"eslint-config-custom": "5.
|
|
69
|
+
"eslint-config-custom": "5.55.0",
|
|
70
70
|
"jest": "29.6.0",
|
|
71
71
|
"outdent": "^0.8.0",
|
|
72
|
-
"tsconfig": "5.
|
|
72
|
+
"tsconfig": "5.55.0"
|
|
73
73
|
},
|
|
74
74
|
"engines": {
|
|
75
75
|
"node": ">=20.0.0 <=26.x.x",
|