@strapi/generators 5.30.0 → 5.30.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/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -2
- package/dist/index.mjs.map +1 -1
- package/dist/plops/api.d.ts.map +1 -1
- package/dist/plops/api.js +79 -11
- package/dist/plops/api.js.map +1 -1
- package/dist/plops/api.mjs +79 -11
- package/dist/plops/api.mjs.map +1 -1
- package/dist/plops/content-type.d.ts.map +1 -1
- package/dist/plops/content-type.js +98 -2
- package/dist/plops/content-type.js.map +1 -1
- package/dist/plops/content-type.mjs +98 -2
- package/dist/plops/content-type.mjs.map +1 -1
- package/dist/plops/controller.d.ts.map +1 -1
- package/dist/plops/controller.js +35 -2
- package/dist/plops/controller.js.map +1 -1
- package/dist/plops/controller.mjs +35 -2
- package/dist/plops/controller.mjs.map +1 -1
- package/dist/plops/middleware.d.ts.map +1 -1
- package/dist/plops/middleware.js +35 -2
- package/dist/plops/middleware.js.map +1 -1
- package/dist/plops/middleware.mjs +35 -2
- package/dist/plops/middleware.mjs.map +1 -1
- package/dist/plops/migration.js.map +1 -1
- package/dist/plops/migration.mjs.map +1 -1
- package/dist/plops/policy.d.ts.map +1 -1
- package/dist/plops/policy.js +35 -2
- package/dist/plops/policy.js.map +1 -1
- package/dist/plops/policy.mjs +35 -2
- package/dist/plops/policy.mjs.map +1 -1
- package/dist/plops/service.d.ts.map +1 -1
- package/dist/plops/service.js +35 -2
- package/dist/plops/service.js.map +1 -1
- package/dist/plops/service.mjs +35 -2
- package/dist/plops/service.mjs.map +1 -1
- package/dist/plops/utils/extend-plugin-index-files.d.ts +8 -0
- package/dist/plops/utils/extend-plugin-index-files.d.ts.map +1 -0
- package/dist/plops/utils/extend-plugin-index-files.js +356 -0
- package/dist/plops/utils/extend-plugin-index-files.js.map +1 -0
- package/dist/plops/utils/extend-plugin-index-files.mjs +335 -0
- package/dist/plops/utils/extend-plugin-index-files.mjs.map +1 -0
- package/dist/plops/utils/get-file-path.d.ts +1 -1
- package/dist/plops/utils/get-file-path.js +2 -2
- package/dist/plops/utils/get-file-path.js.map +1 -1
- package/dist/plops/utils/get-file-path.mjs +2 -2
- package/dist/plops/utils/get-file-path.mjs.map +1 -1
- package/dist/templates/js/plugin/plugin.index.js.hbs +3 -0
- package/dist/templates/js/plugin/plugin.routes.index.js.hbs +12 -0
- package/dist/templates/js/plugin/plugin.routes.type.index.js.hbs +6 -0
- package/dist/templates/ts/plugin/plugin.index.ts.hbs +1 -0
- package/dist/templates/ts/plugin/plugin.routes.index.ts.hbs +9 -0
- package/dist/templates/ts/plugin/plugin.routes.type.index.ts.hbs +4 -0
- package/package.json +9 -5
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import * as jscodeshift from 'jscodeshift';
|
|
2
|
+
import camelCase from 'lodash/camelCase';
|
|
3
|
+
|
|
4
|
+
const j = jscodeshift.withParser('tsx');
|
|
5
|
+
// Helper to check if a string is a valid JavaScript identifier
|
|
6
|
+
const isValidIdentifier = (str)=>{
|
|
7
|
+
return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(str);
|
|
8
|
+
};
|
|
9
|
+
// Helper to create the appropriate property based on type
|
|
10
|
+
const createProperty = (config)=>{
|
|
11
|
+
const { type, singularName } = config;
|
|
12
|
+
const camelCaseName = camelCase(singularName);
|
|
13
|
+
const varName = type === 'content-type' ? `${camelCaseName}Schema` : camelCaseName;
|
|
14
|
+
// Use string literal for key only if singularName is not a valid identifier
|
|
15
|
+
const keyNode = isValidIdentifier(singularName) ? j.identifier(singularName) : j.literal(singularName);
|
|
16
|
+
switch(type){
|
|
17
|
+
case 'content-type':
|
|
18
|
+
return j.objectProperty(keyNode, j.objectExpression([
|
|
19
|
+
j.objectProperty(j.identifier('schema'), j.identifier(varName))
|
|
20
|
+
]));
|
|
21
|
+
case 'index':
|
|
22
|
+
return j.objectProperty(keyNode, j.identifier(varName));
|
|
23
|
+
case 'routes':
|
|
24
|
+
return j.spreadElement(j.memberExpression(j.identifier(varName), j.identifier('routes')));
|
|
25
|
+
default:
|
|
26
|
+
throw new Error(`Unknown append type: ${type}`);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
// Helper to check if property already exists
|
|
30
|
+
const hasExistingProperty = (obj, config)=>{
|
|
31
|
+
const { type, singularName } = config;
|
|
32
|
+
if (!obj?.properties && !j.ArrayExpression.check(obj)) return false;
|
|
33
|
+
const elements = j.ArrayExpression.check(obj) ? obj.elements : obj.properties;
|
|
34
|
+
if (!elements) return false;
|
|
35
|
+
if (type === 'routes') {
|
|
36
|
+
// Check for spread elements ...camelCaseName.routes
|
|
37
|
+
const camelCaseName = camelCase(singularName);
|
|
38
|
+
return elements.some((element)=>j.SpreadElement.check(element) && j.MemberExpression.check(element.argument) && j.Identifier.check(element.argument.object) && element.argument.object.name === camelCaseName && j.Identifier.check(element.argument.property) && element.argument.property.name === 'routes');
|
|
39
|
+
}
|
|
40
|
+
// For content-type and index, check for object property (both identifier and literal keys)
|
|
41
|
+
return elements.some((prop)=>j.ObjectProperty.check(prop) && (j.Identifier.check(prop.key) && prop.key.name === singularName || j.Literal.check(prop.key) && prop.key.value === singularName));
|
|
42
|
+
};
|
|
43
|
+
// Helper to add property to object if it doesn't exist
|
|
44
|
+
const addPropertyToObject = (obj, config)=>{
|
|
45
|
+
if (!obj || hasExistingProperty(obj, config)) return;
|
|
46
|
+
if (config.type === 'routes' && j.ArrayExpression.check(obj)) {
|
|
47
|
+
obj.elements.push(createRoutesElement(config));
|
|
48
|
+
} else if (obj.properties?.length >= 0) {
|
|
49
|
+
obj.properties.push(createProperty(config));
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
// Helper to find and add to routes array
|
|
53
|
+
const handleRoutesArray = (obj, config)=>{
|
|
54
|
+
if (!obj?.properties) return false;
|
|
55
|
+
const routesProp = obj.properties.find((prop)=>j.ObjectProperty.check(prop) && (j.Identifier.check(prop.key) && prop.key.name === 'routes' || j.Literal.check(prop.key) && prop.key.value === 'routes') && j.ArrayExpression.check(prop.value));
|
|
56
|
+
if (routesProp?.value) {
|
|
57
|
+
const routesArray = routesProp.value;
|
|
58
|
+
if (!hasExistingProperty(routesArray, config)) {
|
|
59
|
+
routesArray.elements = routesArray.elements || [];
|
|
60
|
+
routesArray.elements.push(createRoutesElement(config));
|
|
61
|
+
}
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
return false;
|
|
65
|
+
};
|
|
66
|
+
// Helper to create routes array element (always returns SpreadElement for routes)
|
|
67
|
+
const createRoutesElement = (config)=>{
|
|
68
|
+
const { singularName } = config;
|
|
69
|
+
const camelCaseName = camelCase(singularName);
|
|
70
|
+
return j.spreadElement(j.memberExpression(j.identifier(camelCaseName), j.identifier('routes')));
|
|
71
|
+
};
|
|
72
|
+
// Helper to create new export for routes
|
|
73
|
+
const createRoutesExport = (config)=>{
|
|
74
|
+
return j.arrowFunctionExpression([], j.objectExpression([
|
|
75
|
+
j.objectProperty(j.identifier('type'), j.literal('content-api')),
|
|
76
|
+
j.objectProperty(j.identifier('routes'), j.arrayExpression([
|
|
77
|
+
createRoutesElement(config)
|
|
78
|
+
]))
|
|
79
|
+
]));
|
|
80
|
+
};
|
|
81
|
+
// Unified append function for all types
|
|
82
|
+
const appendToFile = (template, config)=>{
|
|
83
|
+
if (!config?.singularName || !config?.type) {
|
|
84
|
+
throw new Error('Invalid config: singularName and type are required');
|
|
85
|
+
}
|
|
86
|
+
const normalizedTemplate = template?.trim() || '';
|
|
87
|
+
const root = normalizedTemplate ? j(normalizedTemplate) : j(j.program([]));
|
|
88
|
+
const { type, singularName } = config;
|
|
89
|
+
const isEsm = detectModuleFormat(normalizedTemplate) === 'esm';
|
|
90
|
+
const camelCaseName = camelCase(singularName);
|
|
91
|
+
const varName = type === 'content-type' ? `${camelCaseName}Schema` : camelCaseName;
|
|
92
|
+
const source = type === 'content-type' ? `./${singularName}/schema.json` : `./${singularName}`;
|
|
93
|
+
addImportIfMissing(root, varName, source, isEsm);
|
|
94
|
+
if (isEsm) {
|
|
95
|
+
handleEsmExport(root, config, type);
|
|
96
|
+
} else {
|
|
97
|
+
handleCjsExport(root, config, type);
|
|
98
|
+
}
|
|
99
|
+
return root.toSource({
|
|
100
|
+
quote: 'single'
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
// Helper to detect module format
|
|
104
|
+
const detectModuleFormat = (template)=>{
|
|
105
|
+
const hasImport = /^import\s/.test(template) || template.includes('import ');
|
|
106
|
+
const hasExportDefault = template.includes('export default');
|
|
107
|
+
const hasRequire = template.includes('require(');
|
|
108
|
+
const hasModuleExports = template.includes('module.exports');
|
|
109
|
+
if (hasImport || hasExportDefault) return 'esm';
|
|
110
|
+
if (hasRequire || hasModuleExports) return 'cjs';
|
|
111
|
+
return 'esm'; // Default to ESM
|
|
112
|
+
};
|
|
113
|
+
// Helper to insert statement at appropriate location
|
|
114
|
+
const insertStatement = (root, statement, preferredLocation)=>{
|
|
115
|
+
if (preferredLocation && preferredLocation.length > 0) {
|
|
116
|
+
preferredLocation.at(-1).insertAfter(statement);
|
|
117
|
+
} else {
|
|
118
|
+
const firstStatement = root.find(j.Statement).at(0);
|
|
119
|
+
if (firstStatement.length > 0) {
|
|
120
|
+
firstStatement.insertBefore(statement);
|
|
121
|
+
} else {
|
|
122
|
+
handleEmptyFile(root, statement);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
// Helper to add import/require if missing
|
|
127
|
+
const addImportIfMissing = (root, varName, source, isEsm)=>{
|
|
128
|
+
if (isEsm) {
|
|
129
|
+
if (root.find(j.ImportDeclaration, {
|
|
130
|
+
source: {
|
|
131
|
+
value: source
|
|
132
|
+
}
|
|
133
|
+
}).length === 0) {
|
|
134
|
+
const importDecl = j.importDeclaration([
|
|
135
|
+
j.importDefaultSpecifier(j.identifier(varName))
|
|
136
|
+
], j.literal(source));
|
|
137
|
+
insertStatement(root, importDecl, root.find(j.ImportDeclaration));
|
|
138
|
+
}
|
|
139
|
+
} else if (root.find(j.VariableDeclarator, {
|
|
140
|
+
id: {
|
|
141
|
+
name: varName
|
|
142
|
+
},
|
|
143
|
+
init: {
|
|
144
|
+
type: 'CallExpression',
|
|
145
|
+
callee: {
|
|
146
|
+
name: 'require'
|
|
147
|
+
},
|
|
148
|
+
arguments: [
|
|
149
|
+
{
|
|
150
|
+
value: source
|
|
151
|
+
}
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
}).length === 0) {
|
|
155
|
+
const requireStmt = j.variableDeclaration('const', [
|
|
156
|
+
j.variableDeclarator(j.identifier(varName), j.callExpression(j.identifier('require'), [
|
|
157
|
+
j.literal(source)
|
|
158
|
+
]))
|
|
159
|
+
]);
|
|
160
|
+
const requires = root.find(j.VariableDeclaration).filter((path)=>path.value.declarations.some((decl)=>j.CallExpression.check(decl.init) && decl.init.callee?.name === 'require'));
|
|
161
|
+
const useStrict = root.find(j.ExpressionStatement).filter((path)=>j.Literal.check(path.value.expression) && /use strict/.test(String(path.value.expression.value)));
|
|
162
|
+
insertStatement(root, requireStmt, requires.length > 0 ? requires : useStrict);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
// Helper to safely handle empty files
|
|
166
|
+
const handleEmptyFile = (root, firstStatement)=>{
|
|
167
|
+
try {
|
|
168
|
+
// Check if we have any paths in the collection
|
|
169
|
+
const paths = root.paths();
|
|
170
|
+
if (paths.length === 0) {
|
|
171
|
+
// Completely empty collection - create new program
|
|
172
|
+
const newProgram = j.program([
|
|
173
|
+
firstStatement
|
|
174
|
+
]);
|
|
175
|
+
// Replace the entire root with new program
|
|
176
|
+
return root.replaceWith(newProgram);
|
|
177
|
+
}
|
|
178
|
+
// Get the first path (should be the program)
|
|
179
|
+
const rootPath = paths[0];
|
|
180
|
+
if (!rootPath || !rootPath.value) {
|
|
181
|
+
// Invalid root path - create new program
|
|
182
|
+
const newProgram = j.program([
|
|
183
|
+
firstStatement
|
|
184
|
+
]);
|
|
185
|
+
return root.replaceWith(newProgram);
|
|
186
|
+
}
|
|
187
|
+
// Check if it's a valid program node
|
|
188
|
+
if (j.Program.check(rootPath.value)) {
|
|
189
|
+
// Ensure body exists and add statement
|
|
190
|
+
if (!rootPath.value.body) {
|
|
191
|
+
rootPath.value.body = [];
|
|
192
|
+
}
|
|
193
|
+
rootPath.value.body.push(firstStatement);
|
|
194
|
+
} else {
|
|
195
|
+
// Not a program node - replace with new program
|
|
196
|
+
const newProgram = j.program([
|
|
197
|
+
firstStatement
|
|
198
|
+
]);
|
|
199
|
+
rootPath.replace(newProgram);
|
|
200
|
+
}
|
|
201
|
+
} catch (error) {
|
|
202
|
+
// Ultimate fallback - create a minimal working file
|
|
203
|
+
console.warn('Failed to handle empty file, creating new program:', error.message);
|
|
204
|
+
const newProgram = j.program([
|
|
205
|
+
firstStatement
|
|
206
|
+
]);
|
|
207
|
+
try {
|
|
208
|
+
root.replaceWith(newProgram);
|
|
209
|
+
} catch (replaceError) {
|
|
210
|
+
// Last resort - throw descriptive error
|
|
211
|
+
throw new Error(`Unable to add statement to empty file: ${error.message}. Root collection may be invalid.`);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
// Helper to find the exported object regardless of export pattern
|
|
216
|
+
const findExportedObject = (root, exportedValue)=>{
|
|
217
|
+
// Case 1: Direct object export
|
|
218
|
+
if (j.ObjectExpression.check(exportedValue)) {
|
|
219
|
+
return exportedValue;
|
|
220
|
+
}
|
|
221
|
+
// Case 2: Function that returns an object
|
|
222
|
+
if (j.FunctionExpression.check(exportedValue) || j.ArrowFunctionExpression.check(exportedValue) || j.FunctionDeclaration.check(exportedValue)) {
|
|
223
|
+
const body = exportedValue.body;
|
|
224
|
+
// Arrow function with object expression body: () => ({...})
|
|
225
|
+
if (j.ObjectExpression.check(body)) {
|
|
226
|
+
return body;
|
|
227
|
+
}
|
|
228
|
+
// Function with return statement in block
|
|
229
|
+
if (j.BlockStatement.check(body)) {
|
|
230
|
+
for (const stmt of body.body){
|
|
231
|
+
if (j.ReturnStatement.check(stmt) && j.ObjectExpression.check(stmt.argument)) {
|
|
232
|
+
return stmt.argument;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
// Case 3: Identifier reference to a variable
|
|
238
|
+
if (j.Identifier.check(exportedValue)) {
|
|
239
|
+
const varName = exportedValue.name;
|
|
240
|
+
// Find the variable declaration
|
|
241
|
+
const varDeclaration = root.find(j.VariableDeclarator, {
|
|
242
|
+
id: {
|
|
243
|
+
name: varName
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
if (varDeclaration.length > 0) {
|
|
247
|
+
const init = varDeclaration.get().value.init;
|
|
248
|
+
// If it's an object, return it
|
|
249
|
+
if (j.ObjectExpression.check(init)) {
|
|
250
|
+
return init;
|
|
251
|
+
}
|
|
252
|
+
// If it's a function, recursively check its return value
|
|
253
|
+
if (j.FunctionExpression.check(init) || j.ArrowFunctionExpression.check(init)) {
|
|
254
|
+
return findExportedObject(root, init);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return null;
|
|
259
|
+
};
|
|
260
|
+
// Helper to handle object export (common logic for ESM and CJS)
|
|
261
|
+
const handleObjectExport = (obj, config, type, setExport)=>{
|
|
262
|
+
if (type === 'routes') {
|
|
263
|
+
if (!handleRoutesArray(obj, config)) {
|
|
264
|
+
setExport(createRoutesExport(config));
|
|
265
|
+
}
|
|
266
|
+
} else {
|
|
267
|
+
addPropertyToObject(obj, config);
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
// Handle ESM export default
|
|
271
|
+
const handleEsmExport = (root, config, type)=>{
|
|
272
|
+
const exports = root.find(j.ExportDefaultDeclaration);
|
|
273
|
+
if (exports.length === 0) {
|
|
274
|
+
const newExport = type === 'routes' ? createRoutesExport(config) : j.objectExpression([
|
|
275
|
+
createProperty(config)
|
|
276
|
+
]);
|
|
277
|
+
insertStatement(root, j.exportDefaultDeclaration(newExport), root.find(j.Statement));
|
|
278
|
+
} else {
|
|
279
|
+
exports.forEach((path)=>{
|
|
280
|
+
const decl = path.value.declaration;
|
|
281
|
+
// Find the actual object being exported
|
|
282
|
+
const exportedObject = findExportedObject(root, decl);
|
|
283
|
+
if (exportedObject) {
|
|
284
|
+
handleObjectExport(exportedObject, config, type, (newExport)=>{
|
|
285
|
+
path.value.declaration = newExport;
|
|
286
|
+
});
|
|
287
|
+
} else {
|
|
288
|
+
// Fallback: replace the entire export
|
|
289
|
+
path.value.declaration = type === 'routes' ? createRoutesExport(config) : j.objectExpression([
|
|
290
|
+
createProperty(config)
|
|
291
|
+
]);
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
// Handle CJS module.exports
|
|
297
|
+
const handleCjsExport = (root, config, type)=>{
|
|
298
|
+
const exports = root.find(j.AssignmentExpression, {
|
|
299
|
+
left: {
|
|
300
|
+
type: 'MemberExpression',
|
|
301
|
+
object: {
|
|
302
|
+
name: 'module'
|
|
303
|
+
},
|
|
304
|
+
property: {
|
|
305
|
+
name: 'exports'
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
if (exports.length === 0) {
|
|
310
|
+
const newExport = type === 'routes' ? createRoutesExport(config) : j.objectExpression([
|
|
311
|
+
createProperty(config)
|
|
312
|
+
]);
|
|
313
|
+
const moduleExportStmt = j.expressionStatement(j.assignmentExpression('=', j.memberExpression(j.identifier('module'), j.identifier('exports')), newExport));
|
|
314
|
+
insertStatement(root, moduleExportStmt, root.find(j.Statement));
|
|
315
|
+
} else {
|
|
316
|
+
exports.forEach((path)=>{
|
|
317
|
+
const right = path.value.right;
|
|
318
|
+
// Find the actual object being exported
|
|
319
|
+
const exportedObject = findExportedObject(root, right);
|
|
320
|
+
if (exportedObject) {
|
|
321
|
+
handleObjectExport(exportedObject, config, type, (newExport)=>{
|
|
322
|
+
path.value.right = newExport;
|
|
323
|
+
});
|
|
324
|
+
} else {
|
|
325
|
+
// Fallback: replace the entire export
|
|
326
|
+
path.value.right = type === 'routes' ? createRoutesExport(config) : j.objectExpression([
|
|
327
|
+
createProperty(config)
|
|
328
|
+
]);
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
export { appendToFile };
|
|
335
|
+
//# sourceMappingURL=extend-plugin-index-files.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extend-plugin-index-files.mjs","sources":["../../../src/plops/utils/extend-plugin-index-files.ts"],"sourcesContent":["import * as jscodeshift from 'jscodeshift';\nimport camelCase from 'lodash/camelCase';\n\nconst j = jscodeshift.withParser('tsx');\n\ntype AppendType = 'content-type' | 'index' | 'routes';\n\ninterface AppendConfig {\n type: AppendType;\n singularName: string;\n}\n\n// Helper to check if a string is a valid JavaScript identifier\nconst isValidIdentifier = (str: string): boolean => {\n return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(str);\n};\n\n// Helper to create the appropriate property based on type\nconst createProperty = (config: AppendConfig) => {\n const { type, singularName } = config;\n const camelCaseName = camelCase(singularName);\n const varName = type === 'content-type' ? `${camelCaseName}Schema` : camelCaseName;\n\n // Use string literal for key only if singularName is not a valid identifier\n const keyNode = isValidIdentifier(singularName)\n ? j.identifier(singularName)\n : j.literal(singularName);\n\n switch (type) {\n case 'content-type':\n return j.objectProperty(\n keyNode,\n j.objectExpression([j.objectProperty(j.identifier('schema'), j.identifier(varName))])\n );\n case 'index':\n return j.objectProperty(keyNode, j.identifier(varName));\n case 'routes':\n return j.spreadElement(j.memberExpression(j.identifier(varName), j.identifier('routes')));\n default:\n throw new Error(`Unknown append type: ${type}`);\n }\n};\n\n// Helper to check if property already exists\nconst hasExistingProperty = (obj: any, config: AppendConfig): boolean => {\n const { type, singularName } = config;\n if (!obj?.properties && !j.ArrayExpression.check(obj)) return false;\n\n const elements = j.ArrayExpression.check(obj) ? obj.elements : obj.properties;\n if (!elements) return false;\n\n if (type === 'routes') {\n // Check for spread elements ...camelCaseName.routes\n const camelCaseName = camelCase(singularName);\n return elements.some(\n (element: any) =>\n j.SpreadElement.check(element) &&\n j.MemberExpression.check(element.argument) &&\n j.Identifier.check(element.argument.object) &&\n element.argument.object.name === camelCaseName &&\n j.Identifier.check(element.argument.property) &&\n element.argument.property.name === 'routes'\n );\n }\n\n // For content-type and index, check for object property (both identifier and literal keys)\n return elements.some(\n (prop: any) =>\n j.ObjectProperty.check(prop) &&\n ((j.Identifier.check(prop.key) && prop.key.name === singularName) ||\n (j.Literal.check(prop.key) && prop.key.value === singularName))\n );\n};\n\n// Helper to add property to object if it doesn't exist\nconst addPropertyToObject = (obj: any, config: AppendConfig) => {\n if (!obj || hasExistingProperty(obj, config)) return;\n\n if (config.type === 'routes' && j.ArrayExpression.check(obj)) {\n obj.elements.push(createRoutesElement(config));\n } else if (obj.properties?.length >= 0) {\n obj.properties.push(createProperty(config));\n }\n};\n\n// Helper to find and add to routes array\nconst handleRoutesArray = (obj: any, config: AppendConfig) => {\n if (!obj?.properties) return false;\n\n const routesProp = obj.properties.find(\n (prop: any) =>\n j.ObjectProperty.check(prop) &&\n ((j.Identifier.check(prop.key) && prop.key.name === 'routes') ||\n (j.Literal.check(prop.key) && prop.key.value === 'routes')) &&\n j.ArrayExpression.check(prop.value)\n );\n\n if (routesProp?.value) {\n const routesArray = routesProp.value;\n if (!hasExistingProperty(routesArray, config)) {\n routesArray.elements = routesArray.elements || [];\n routesArray.elements.push(createRoutesElement(config));\n }\n return true;\n }\n\n return false;\n};\n\n// Helper to create routes array element (always returns SpreadElement for routes)\nconst createRoutesElement = (config: AppendConfig) => {\n const { singularName } = config;\n const camelCaseName = camelCase(singularName);\n return j.spreadElement(j.memberExpression(j.identifier(camelCaseName), j.identifier('routes')));\n};\n\n// Helper to create new export for routes\nconst createRoutesExport = (config: AppendConfig) => {\n return j.arrowFunctionExpression(\n [],\n j.objectExpression([\n j.objectProperty(j.identifier('type'), j.literal('content-api')),\n j.objectProperty(j.identifier('routes'), j.arrayExpression([createRoutesElement(config)])),\n ])\n );\n};\n\n// Unified append function for all types\nexport const appendToFile = (template: string, config: AppendConfig): string => {\n if (!config?.singularName || !config?.type) {\n throw new Error('Invalid config: singularName and type are required');\n }\n\n const normalizedTemplate = template?.trim() || '';\n const root = normalizedTemplate ? j(normalizedTemplate) : j(j.program([]));\n const { type, singularName } = config;\n const isEsm = detectModuleFormat(normalizedTemplate) === 'esm';\n\n const camelCaseName = camelCase(singularName);\n const varName = type === 'content-type' ? `${camelCaseName}Schema` : camelCaseName;\n const source = type === 'content-type' ? `./${singularName}/schema.json` : `./${singularName}`;\n\n addImportIfMissing(root, varName, source, isEsm);\n\n if (isEsm) {\n handleEsmExport(root, config, type);\n } else {\n handleCjsExport(root, config, type);\n }\n\n return root.toSource({ quote: 'single' });\n};\n\n// Helper to detect module format\nconst detectModuleFormat = (template: string): 'esm' | 'cjs' => {\n const hasImport = /^import\\s/.test(template) || template.includes('import ');\n const hasExportDefault = template.includes('export default');\n const hasRequire = template.includes('require(');\n const hasModuleExports = template.includes('module.exports');\n\n if (hasImport || hasExportDefault) return 'esm';\n if (hasRequire || hasModuleExports) return 'cjs';\n return 'esm'; // Default to ESM\n};\n\n// Helper to insert statement at appropriate location\nconst insertStatement = (\n root: jscodeshift.Collection<any>,\n statement: any,\n preferredLocation?: jscodeshift.Collection<any>\n) => {\n if (preferredLocation && preferredLocation.length > 0) {\n preferredLocation.at(-1).insertAfter(statement);\n } else {\n const firstStatement = root.find(j.Statement).at(0);\n if (firstStatement.length > 0) {\n firstStatement.insertBefore(statement);\n } else {\n handleEmptyFile(root, statement);\n }\n }\n};\n\n// Helper to add import/require if missing\nconst addImportIfMissing = (\n root: jscodeshift.Collection<any>,\n varName: string,\n source: string,\n isEsm: boolean\n) => {\n if (isEsm) {\n if (root.find(j.ImportDeclaration, { source: { value: source } }).length === 0) {\n const importDecl = j.importDeclaration(\n [j.importDefaultSpecifier(j.identifier(varName))],\n j.literal(source)\n );\n insertStatement(root, importDecl, root.find(j.ImportDeclaration));\n }\n } else if (\n root.find(j.VariableDeclarator, {\n id: { name: varName },\n init: { type: 'CallExpression', callee: { name: 'require' }, arguments: [{ value: source }] },\n }).length === 0\n ) {\n const requireStmt = j.variableDeclaration('const', [\n j.variableDeclarator(\n j.identifier(varName),\n j.callExpression(j.identifier('require'), [j.literal(source)])\n ),\n ]);\n\n const requires = root\n .find(j.VariableDeclaration)\n .filter((path) =>\n path.value.declarations.some(\n (decl: any) => j.CallExpression.check(decl.init) && decl.init.callee?.name === 'require'\n )\n );\n\n const useStrict = root\n .find(j.ExpressionStatement)\n .filter(\n (path: any) =>\n j.Literal.check(path.value.expression) &&\n /use strict/.test(String(path.value.expression.value))\n );\n\n insertStatement(root, requireStmt, requires.length > 0 ? requires : useStrict);\n }\n};\n\n// Helper to safely handle empty files\nconst handleEmptyFile = (root: jscodeshift.Collection<any>, firstStatement: any) => {\n try {\n // Check if we have any paths in the collection\n const paths = root.paths();\n if (paths.length === 0) {\n // Completely empty collection - create new program\n const newProgram = j.program([firstStatement]);\n // Replace the entire root with new program\n return root.replaceWith(newProgram);\n }\n\n // Get the first path (should be the program)\n const rootPath = paths[0];\n if (!rootPath || !rootPath.value) {\n // Invalid root path - create new program\n const newProgram = j.program([firstStatement]);\n return root.replaceWith(newProgram);\n }\n\n // Check if it's a valid program node\n if (j.Program.check(rootPath.value)) {\n // Ensure body exists and add statement\n if (!rootPath.value.body) {\n rootPath.value.body = [];\n }\n rootPath.value.body.push(firstStatement);\n } else {\n // Not a program node - replace with new program\n const newProgram = j.program([firstStatement]);\n rootPath.replace(newProgram);\n }\n } catch (error: any) {\n // Ultimate fallback - create a minimal working file\n console.warn('Failed to handle empty file, creating new program:', error.message);\n const newProgram = j.program([firstStatement]);\n try {\n root.replaceWith(newProgram);\n } catch (replaceError) {\n // Last resort - throw descriptive error\n throw new Error(\n `Unable to add statement to empty file: ${error.message}. Root collection may be invalid.`\n );\n }\n }\n};\n\n// Helper to find the exported object regardless of export pattern\nconst findExportedObject = (root: jscodeshift.Collection<any>, exportedValue: any): any => {\n // Case 1: Direct object export\n if (j.ObjectExpression.check(exportedValue)) {\n return exportedValue;\n }\n\n // Case 2: Function that returns an object\n if (\n j.FunctionExpression.check(exportedValue) ||\n j.ArrowFunctionExpression.check(exportedValue) ||\n j.FunctionDeclaration.check(exportedValue)\n ) {\n const body = exportedValue.body;\n // Arrow function with object expression body: () => ({...})\n if (j.ObjectExpression.check(body)) {\n return body;\n }\n // Function with return statement in block\n if (j.BlockStatement.check(body)) {\n for (const stmt of body.body) {\n if (j.ReturnStatement.check(stmt) && j.ObjectExpression.check(stmt.argument)) {\n return stmt.argument;\n }\n }\n }\n }\n\n // Case 3: Identifier reference to a variable\n if (j.Identifier.check(exportedValue)) {\n const varName = exportedValue.name;\n\n // Find the variable declaration\n const varDeclaration = root.find(j.VariableDeclarator, {\n id: { name: varName },\n });\n\n if (varDeclaration.length > 0) {\n const init = varDeclaration.get().value.init;\n\n // If it's an object, return it\n if (j.ObjectExpression.check(init)) {\n return init;\n }\n\n // If it's a function, recursively check its return value\n if (j.FunctionExpression.check(init) || j.ArrowFunctionExpression.check(init)) {\n return findExportedObject(root, init);\n }\n }\n }\n\n return null;\n};\n\n// Helper to handle object export (common logic for ESM and CJS)\nconst handleObjectExport = (\n obj: any,\n config: AppendConfig,\n type: AppendType,\n setExport: (newExport: any) => void\n) => {\n if (type === 'routes') {\n if (!handleRoutesArray(obj, config)) {\n setExport(createRoutesExport(config));\n }\n } else {\n addPropertyToObject(obj, config);\n }\n};\n\n// Handle ESM export default\nconst handleEsmExport = (\n root: jscodeshift.Collection<any>,\n config: AppendConfig,\n type: AppendType\n) => {\n const exports = root.find(j.ExportDefaultDeclaration);\n\n if (exports.length === 0) {\n const newExport =\n type === 'routes' ? createRoutesExport(config) : j.objectExpression([createProperty(config)]);\n insertStatement(root, j.exportDefaultDeclaration(newExport), root.find(j.Statement));\n } else {\n exports.forEach((path: any) => {\n const decl = path.value.declaration;\n\n // Find the actual object being exported\n const exportedObject = findExportedObject(root, decl);\n\n if (exportedObject) {\n handleObjectExport(exportedObject, config, type, (newExport) => {\n path.value.declaration = newExport;\n });\n } else {\n // Fallback: replace the entire export\n path.value.declaration =\n type === 'routes'\n ? createRoutesExport(config)\n : j.objectExpression([createProperty(config)]);\n }\n });\n }\n};\n\n// Handle CJS module.exports\nconst handleCjsExport = (\n root: jscodeshift.Collection<any>,\n config: AppendConfig,\n type: AppendType\n) => {\n const exports = root.find(j.AssignmentExpression, {\n left: { type: 'MemberExpression', object: { name: 'module' }, property: { name: 'exports' } },\n });\n\n if (exports.length === 0) {\n const newExport =\n type === 'routes' ? createRoutesExport(config) : j.objectExpression([createProperty(config)]);\n const moduleExportStmt = j.expressionStatement(\n j.assignmentExpression(\n '=',\n j.memberExpression(j.identifier('module'), j.identifier('exports')),\n newExport\n )\n );\n insertStatement(root, moduleExportStmt, root.find(j.Statement));\n } else {\n exports.forEach((path: any) => {\n const right = path.value.right;\n\n // Find the actual object being exported\n const exportedObject = findExportedObject(root, right);\n\n if (exportedObject) {\n handleObjectExport(exportedObject, config, type, (newExport) => {\n path.value.right = newExport;\n });\n } else {\n // Fallback: replace the entire export\n path.value.right =\n type === 'routes'\n ? createRoutesExport(config)\n : j.objectExpression([createProperty(config)]);\n }\n });\n }\n};\n"],"names":["j","jscodeshift","withParser","isValidIdentifier","str","test","createProperty","config","type","singularName","camelCaseName","camelCase","varName","keyNode","identifier","literal","objectProperty","objectExpression","spreadElement","memberExpression","Error","hasExistingProperty","obj","properties","ArrayExpression","check","elements","some","element","SpreadElement","MemberExpression","argument","Identifier","object","name","property","prop","ObjectProperty","key","Literal","value","addPropertyToObject","push","createRoutesElement","length","handleRoutesArray","routesProp","find","routesArray","createRoutesExport","arrowFunctionExpression","arrayExpression","appendToFile","template","normalizedTemplate","trim","root","program","isEsm","detectModuleFormat","source","addImportIfMissing","handleEsmExport","handleCjsExport","toSource","quote","hasImport","includes","hasExportDefault","hasRequire","hasModuleExports","insertStatement","statement","preferredLocation","at","insertAfter","firstStatement","Statement","insertBefore","handleEmptyFile","ImportDeclaration","importDecl","importDeclaration","importDefaultSpecifier","VariableDeclarator","id","init","callee","arguments","requireStmt","variableDeclaration","variableDeclarator","callExpression","requires","VariableDeclaration","filter","path","declarations","decl","CallExpression","useStrict","ExpressionStatement","expression","String","paths","newProgram","replaceWith","rootPath","Program","body","replace","error","console","warn","message","replaceError","findExportedObject","exportedValue","ObjectExpression","FunctionExpression","ArrowFunctionExpression","FunctionDeclaration","BlockStatement","stmt","ReturnStatement","varDeclaration","get","handleObjectExport","setExport","exports","ExportDefaultDeclaration","newExport","exportDefaultDeclaration","forEach","declaration","exportedObject","AssignmentExpression","left","moduleExportStmt","expressionStatement","assignmentExpression","right"],"mappings":";;;AAGA,MAAMA,CAAAA,GAAIC,WAAYC,CAAAA,UAAU,CAAC,KAAA,CAAA;AASjC;AACA,MAAMC,oBAAoB,CAACC,GAAAA,GAAAA;IACzB,OAAO,4BAAA,CAA6BC,IAAI,CAACD,GAAAA,CAAAA;AAC3C,CAAA;AAEA;AACA,MAAME,iBAAiB,CAACC,MAAAA,GAAAA;AACtB,IAAA,MAAM,EAAEC,IAAI,EAAEC,YAAY,EAAE,GAAGF,MAAAA;AAC/B,IAAA,MAAMG,gBAAgBC,SAAUF,CAAAA,YAAAA,CAAAA;AAChC,IAAA,MAAMG,UAAUJ,IAAS,KAAA,cAAA,GAAiB,GAAGE,aAAc,CAAA,MAAM,CAAC,GAAGA,aAAAA;;IAGrE,MAAMG,OAAAA,GAAUV,kBAAkBM,YAC9BT,CAAAA,GAAAA,CAAAA,CAAEc,UAAU,CAACL,YAAAA,CAAAA,GACbT,CAAEe,CAAAA,OAAO,CAACN,YAAAA,CAAAA;IAEd,OAAQD,IAAAA;QACN,KAAK,cAAA;AACH,YAAA,O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qF,EAAAA,KAAAA,CAAAA;AAEhD,YAAA,IAAIN,cAAgB,EAAA;gBAClBR,kBAAmBQ,CAAAA,cAAAA,EAAgBhI,MAAQC,EAAAA,IAAAA,EAAM,CAAC2H,SAAAA,GAAAA;oBAChDnC,IAAKxD,CAAAA,KAAK,CAACqG,KAAK,GAAGV,SAAAA;AACrB,iBAAA,CAAA;aACK,MAAA;;gBAELnC,IAAKxD,CAAAA,KAAK,CAACqG,KAAK,GACdrI,IAAAA,KAAS,WACLyC,kBAAmB1C,CAAAA,MAAAA,CAAAA,GACnBP,CAAEiB,CAAAA,gBAAgB,CAAC;oBAACX,cAAeC,CAAAA,MAAAA;AAAQ,iBAAA,CAAA;AACnD;AACF,SAAA,CAAA;AACF;AACF,CAAA;;;;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const _default: (destination: string) => "
|
|
1
|
+
declare const _default: (destination: string) => "api/{{ api }}" | "plugins/{{ plugin }}/server/src" | "." | "api/{{ id }}";
|
|
2
2
|
export default _default;
|
|
3
3
|
//# sourceMappingURL=get-file-path.d.ts.map
|
|
@@ -5,10 +5,10 @@ var getFilePath = ((destination)=>{
|
|
|
5
5
|
return `api/{{ api }}`;
|
|
6
6
|
}
|
|
7
7
|
if (destination === 'plugin') {
|
|
8
|
-
return `plugins/{{ plugin }}/server`;
|
|
8
|
+
return `plugins/{{ plugin }}/server/src`;
|
|
9
9
|
}
|
|
10
10
|
if (destination === 'root') {
|
|
11
|
-
return '
|
|
11
|
+
return '.';
|
|
12
12
|
}
|
|
13
13
|
return `api/{{ id }}`;
|
|
14
14
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-file-path.js","sources":["../../../src/plops/utils/get-file-path.ts"],"sourcesContent":["export default (destination: string) => {\n if (destination === 'api') {\n return `api/{{ api }}`;\n }\n\n if (destination === 'plugin') {\n return `plugins/{{ plugin }}/server`;\n }\n\n if (destination === 'root') {\n return '
|
|
1
|
+
{"version":3,"file":"get-file-path.js","sources":["../../../src/plops/utils/get-file-path.ts"],"sourcesContent":["export default (destination: string) => {\n if (destination === 'api') {\n return `api/{{ api }}`;\n }\n\n if (destination === 'plugin') {\n return `plugins/{{ plugin }}/server/src`;\n }\n\n if (destination === 'root') {\n return '.';\n }\n\n return `api/{{ id }}`;\n};\n"],"names":["destination"],"mappings":";;AAAA,kBAAe,CAAA,CAACA,WAAAA,GAAAA;AACd,IAAA,IAAIA,gBAAgB,KAAO,EAAA;QACzB,OAAO,CAAC,aAAa,CAAC;AACxB;AAEA,IAAA,IAAIA,gBAAgB,QAAU,EAAA;QAC5B,OAAO,CAAC,+BAA+B,CAAC;AAC1C;AAEA,IAAA,IAAIA,gBAAgB,MAAQ,EAAA;QAC1B,OAAO,GAAA;AACT;IAEA,OAAO,CAAC,YAAY,CAAC;AACvB,CAAA;;;;"}
|
|
@@ -3,10 +3,10 @@ var getFilePath = ((destination)=>{
|
|
|
3
3
|
return `api/{{ api }}`;
|
|
4
4
|
}
|
|
5
5
|
if (destination === 'plugin') {
|
|
6
|
-
return `plugins/{{ plugin }}/server`;
|
|
6
|
+
return `plugins/{{ plugin }}/server/src`;
|
|
7
7
|
}
|
|
8
8
|
if (destination === 'root') {
|
|
9
|
-
return '
|
|
9
|
+
return '.';
|
|
10
10
|
}
|
|
11
11
|
return `api/{{ id }}`;
|
|
12
12
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-file-path.mjs","sources":["../../../src/plops/utils/get-file-path.ts"],"sourcesContent":["export default (destination: string) => {\n if (destination === 'api') {\n return `api/{{ api }}`;\n }\n\n if (destination === 'plugin') {\n return `plugins/{{ plugin }}/server`;\n }\n\n if (destination === 'root') {\n return '
|
|
1
|
+
{"version":3,"file":"get-file-path.mjs","sources":["../../../src/plops/utils/get-file-path.ts"],"sourcesContent":["export default (destination: string) => {\n if (destination === 'api') {\n return `api/{{ api }}`;\n }\n\n if (destination === 'plugin') {\n return `plugins/{{ plugin }}/server/src`;\n }\n\n if (destination === 'root') {\n return '.';\n }\n\n return `api/{{ id }}`;\n};\n"],"names":["destination"],"mappings":"AAAA,kBAAe,CAAA,CAACA,WAAAA,GAAAA;AACd,IAAA,IAAIA,gBAAgB,KAAO,EAAA;QACzB,OAAO,CAAC,aAAa,CAAC;AACxB;AAEA,IAAA,IAAIA,gBAAgB,QAAU,EAAA;QAC5B,OAAO,CAAC,+BAA+B,CAAC;AAC1C;AAEA,IAAA,IAAIA,gBAAgB,MAAQ,EAAA;QAC1B,OAAO,GAAA;AACT;IAEA,OAAO,CAAC,YAAY,CAAC;AACvB,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/generators",
|
|
3
|
-
"version": "5.30.
|
|
3
|
+
"version": "5.30.1",
|
|
4
4
|
"description": "Interactive API generator.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|
|
@@ -49,19 +49,23 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@sindresorhus/slugify": "1.1.0",
|
|
52
|
-
"@strapi/typescript-utils": "5.30.
|
|
53
|
-
"@strapi/utils": "5.30.
|
|
52
|
+
"@strapi/typescript-utils": "5.30.1",
|
|
53
|
+
"@strapi/utils": "5.30.1",
|
|
54
54
|
"chalk": "4.1.2",
|
|
55
55
|
"copyfiles": "2.4.1",
|
|
56
56
|
"fs-extra": "11.2.0",
|
|
57
57
|
"handlebars": "4.7.7",
|
|
58
|
+
"jscodeshift": "17.3.0",
|
|
59
|
+
"lodash": "4.17.21",
|
|
58
60
|
"plop": "4.0.1",
|
|
59
61
|
"pluralize": "8.0.0"
|
|
60
62
|
},
|
|
61
63
|
"devDependencies": {
|
|
62
64
|
"@types/fs-extra": "11.0.4",
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
+
"@types/jscodeshift": "0.12.0",
|
|
66
|
+
"eslint-config-custom": "5.30.1",
|
|
67
|
+
"outdent": "^0.8.0",
|
|
68
|
+
"tsconfig": "5.30.1"
|
|
65
69
|
},
|
|
66
70
|
"engines": {
|
|
67
71
|
"node": ">=18.0.0 <=22.x.x",
|