@strapi/generators 0.0.0-next.f5b09a8e61e059f02784478e27c310c6290be088 → 0.0.0-next.f5d21551ed005f524bfc4760b274f1be154e26a8
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/LICENSE +18 -3
- package/dist/index.d.ts +9 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +92 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +90 -24
- package/dist/index.mjs.map +1 -1
- package/dist/plopfile.d.ts +1 -1
- package/dist/plopfile.d.ts.map +1 -1
- package/dist/plopfile.js +25 -701
- package/dist/plopfile.js.map +1 -1
- package/dist/plopfile.mjs +24 -678
- package/dist/plopfile.mjs.map +1 -1
- package/dist/plops/api.d.ts +1 -1
- package/dist/plops/api.d.ts.map +1 -1
- package/dist/plops/api.js +81 -0
- package/dist/plops/api.js.map +1 -0
- package/dist/plops/api.mjs +79 -0
- package/dist/plops/api.mjs.map +1 -0
- package/dist/plops/content-type.d.ts +1 -1
- package/dist/plops/content-type.d.ts.map +1 -1
- package/dist/plops/content-type.js +149 -0
- package/dist/plops/content-type.js.map +1 -0
- package/dist/plops/content-type.mjs +147 -0
- package/dist/plops/content-type.mjs.map +1 -0
- package/dist/plops/controller.d.ts +1 -1
- package/dist/plops/controller.d.ts.map +1 -1
- package/dist/plops/controller.js +40 -0
- package/dist/plops/controller.js.map +1 -0
- package/dist/plops/controller.mjs +38 -0
- package/dist/plops/controller.mjs.map +1 -0
- package/dist/plops/middleware.d.ts +1 -1
- package/dist/plops/middleware.d.ts.map +1 -1
- package/dist/plops/middleware.js +42 -0
- package/dist/plops/middleware.js.map +1 -0
- package/dist/plops/middleware.mjs +40 -0
- package/dist/plops/middleware.mjs.map +1 -0
- package/dist/plops/migration.d.ts +1 -1
- package/dist/plops/migration.d.ts.map +1 -1
- package/dist/plops/migration.js +35 -0
- package/dist/plops/migration.js.map +1 -0
- package/dist/plops/migration.mjs +33 -0
- package/dist/plops/migration.mjs.map +1 -0
- package/dist/plops/policy.d.ts +1 -1
- package/dist/plops/policy.d.ts.map +1 -1
- package/dist/plops/policy.js +42 -0
- package/dist/plops/policy.js.map +1 -0
- package/dist/plops/policy.mjs +40 -0
- package/dist/plops/policy.mjs.map +1 -0
- package/dist/plops/prompts/bootstrap-api-prompts.d.ts +6 -2
- package/dist/plops/prompts/bootstrap-api-prompts.d.ts.map +1 -1
- package/dist/plops/prompts/bootstrap-api-prompts.js +13 -0
- package/dist/plops/prompts/bootstrap-api-prompts.js.map +1 -0
- package/dist/plops/prompts/bootstrap-api-prompts.mjs +11 -0
- package/dist/plops/prompts/bootstrap-api-prompts.mjs.map +1 -0
- package/dist/plops/prompts/ct-names-prompts.d.ts +18 -2
- package/dist/plops/prompts/ct-names-prompts.d.ts.map +1 -1
- package/dist/plops/prompts/ct-names-prompts.js +44 -0
- package/dist/plops/prompts/ct-names-prompts.js.map +1 -0
- package/dist/plops/prompts/ct-names-prompts.mjs +42 -0
- package/dist/plops/prompts/ct-names-prompts.mjs.map +1 -0
- package/dist/plops/prompts/get-attributes-prompts.d.ts +8 -2
- package/dist/plops/prompts/get-attributes-prompts.d.ts.map +1 -1
- package/dist/plops/prompts/get-attributes-prompts.js +101 -0
- package/dist/plops/prompts/get-attributes-prompts.js.map +1 -0
- package/dist/plops/prompts/get-attributes-prompts.mjs +99 -0
- package/dist/plops/prompts/get-attributes-prompts.mjs.map +1 -0
- package/dist/plops/prompts/get-destination-prompts.d.ts +24 -2
- package/dist/plops/prompts/get-destination-prompts.d.ts.map +1 -1
- package/dist/plops/prompts/get-destination-prompts.js +78 -0
- package/dist/plops/prompts/get-destination-prompts.js.map +1 -0
- package/dist/plops/prompts/get-destination-prompts.mjs +76 -0
- package/dist/plops/prompts/get-destination-prompts.mjs.map +1 -0
- package/dist/plops/prompts/kind-prompts.d.ts +11 -2
- package/dist/plops/prompts/kind-prompts.d.ts.map +1 -1
- package/dist/plops/prompts/kind-prompts.js +26 -0
- package/dist/plops/prompts/kind-prompts.js.map +1 -0
- package/dist/plops/prompts/kind-prompts.mjs +24 -0
- package/dist/plops/prompts/kind-prompts.mjs.map +1 -0
- package/dist/plops/service.d.ts +1 -1
- package/dist/plops/service.d.ts.map +1 -1
- package/dist/plops/service.js +38 -0
- package/dist/plops/service.js.map +1 -0
- package/dist/plops/service.mjs +36 -0
- package/dist/plops/service.mjs.map +1 -0
- package/dist/plops/utils/get-file-path.d.ts +1 -1
- package/dist/plops/utils/get-file-path.js +17 -0
- package/dist/plops/utils/get-file-path.js.map +1 -0
- package/dist/plops/utils/get-file-path.mjs +15 -0
- package/dist/plops/utils/get-file-path.mjs.map +1 -0
- package/dist/plops/utils/get-formatted-date.js +8 -0
- package/dist/plops/utils/get-formatted-date.js.map +1 -0
- package/dist/plops/utils/get-formatted-date.mjs +6 -0
- package/dist/plops/utils/get-formatted-date.mjs.map +1 -0
- package/dist/plops/utils/validate-attribute-input.js +12 -0
- package/dist/plops/utils/validate-attribute-input.js.map +1 -0
- package/dist/plops/utils/validate-attribute-input.mjs +10 -0
- package/dist/plops/utils/validate-attribute-input.mjs.map +1 -0
- package/dist/plops/utils/validate-file-name-input.js +12 -0
- package/dist/plops/utils/validate-file-name-input.js.map +1 -0
- package/dist/plops/utils/validate-file-name-input.mjs +10 -0
- package/dist/plops/utils/validate-file-name-input.mjs.map +1 -0
- package/dist/plops/utils/validate-input.js +12 -0
- package/dist/plops/utils/validate-input.js.map +1 -0
- package/dist/plops/utils/validate-input.mjs +10 -0
- package/dist/plops/utils/validate-input.mjs.map +1 -0
- package/dist/templates/js/content-type.schema.json.hbs +0 -1
- package/dist/templates/ts/content-type.schema.json.hbs +0 -1
- package/dist/templates/ts/middleware.ts.hbs +2 -2
- package/package.json +17 -16
- package/dist/files/js/plugin/.gitattributes +0 -103
- package/dist/files/js/plugin/admin/src/components/Initializer/index.js +0 -26
- package/dist/files/js/plugin/admin/src/components/PluginIcon/index.js +0 -12
- package/dist/files/js/plugin/admin/src/index.js +0 -61
- package/dist/files/js/plugin/admin/src/pages/App/index.js +0 -25
- package/dist/files/js/plugin/admin/src/pages/HomePage/index.js +0 -20
- package/dist/files/js/plugin/admin/src/pluginId.js +0 -5
- package/dist/files/js/plugin/admin/src/translations/en.json +0 -1
- package/dist/files/js/plugin/admin/src/translations/fr.json +0 -1
- package/dist/files/js/plugin/admin/src/utils/getTrad.js +0 -5
- package/dist/files/js/plugin/server/bootstrap.js +0 -5
- package/dist/files/js/plugin/server/config/index.js +0 -6
- package/dist/files/js/plugin/server/content-types/index.js +0 -3
- package/dist/files/js/plugin/server/controllers/index.js +0 -7
- package/dist/files/js/plugin/server/controllers/my-controller.js.hbs +0 -10
- package/dist/files/js/plugin/server/destroy.js +0 -5
- package/dist/files/js/plugin/server/index.js +0 -25
- package/dist/files/js/plugin/server/middlewares/index.js +0 -3
- package/dist/files/js/plugin/server/policies/index.js +0 -3
- package/dist/files/js/plugin/server/register.js +0 -5
- package/dist/files/js/plugin/server/routes/index.js +0 -10
- package/dist/files/js/plugin/server/services/index.js +0 -7
- package/dist/files/js/plugin/server/services/my-service.js +0 -7
- package/dist/files/js/plugin/strapi-admin.js +0 -3
- package/dist/files/js/plugin/strapi-server.js +0 -3
- package/dist/files/ts/plugin/.gitattributes +0 -103
- package/dist/files/ts/plugin/admin/src/components/Initializer/index.tsx +0 -24
- package/dist/files/ts/plugin/admin/src/components/PluginIcon/index.tsx +0 -12
- package/dist/files/ts/plugin/admin/src/index.tsx +0 -67
- package/dist/files/ts/plugin/admin/src/pages/App/index.tsx +0 -25
- package/dist/files/ts/plugin/admin/src/pages/HomePage/index.tsx +0 -19
- package/dist/files/ts/plugin/admin/src/pluginId.ts +0 -5
- package/dist/files/ts/plugin/admin/src/translations/en.json +0 -1
- package/dist/files/ts/plugin/admin/src/translations/fr.json +0 -1
- package/dist/files/ts/plugin/admin/src/utils/getTrad.ts +0 -5
- package/dist/files/ts/plugin/custom.d.ts +0 -5
- package/dist/files/ts/plugin/server/bootstrap.ts +0 -5
- package/dist/files/ts/plugin/server/config/index.ts +0 -4
- package/dist/files/ts/plugin/server/content-types/index.ts +0 -1
- package/dist/files/ts/plugin/server/controllers/index.ts +0 -5
- package/dist/files/ts/plugin/server/controllers/my-controller.ts.hbs +0 -10
- package/dist/files/ts/plugin/server/destroy.ts +0 -5
- package/dist/files/ts/plugin/server/index.ts +0 -23
- package/dist/files/ts/plugin/server/middlewares/index.ts +0 -1
- package/dist/files/ts/plugin/server/policies/index.ts +0 -1
- package/dist/files/ts/plugin/server/register.ts +0 -5
- package/dist/files/ts/plugin/server/routes/index.ts +0 -10
- package/dist/files/ts/plugin/server/services/index.ts +0 -5
- package/dist/files/ts/plugin/server/services/my-service.ts +0 -7
- package/dist/files/ts/plugin/strapi-admin.js +0 -3
- package/dist/files/ts/plugin/strapi-server.js +0 -3
- package/dist/files/ts/plugin/tsconfig.json +0 -20
- package/dist/files/ts/plugin/tsconfig.server.json +0 -25
- package/dist/plops/plugin.d.ts +0 -4
- package/dist/plops/plugin.d.ts.map +0 -1
- package/dist/plops/prompts/draft-and-publish-prompts.d.ts +0 -4
- package/dist/plops/prompts/draft-and-publish-prompts.d.ts.map +0 -1
- package/dist/templates/js/README.md.hbs +0 -3
- package/dist/templates/js/plugin-package.json.hbs +0 -42
- package/dist/templates/ts/README.md.hbs +0 -3
- package/dist/templates/ts/plugin-package.json.hbs +0 -51
package/LICENSE
CHANGED
|
@@ -2,7 +2,21 @@ Copyright (c) 2015-present Strapi Solutions SAS
|
|
|
2
2
|
|
|
3
3
|
Portions of the Strapi software are licensed as follows:
|
|
4
4
|
|
|
5
|
-
* All software that resides under an "ee/" directory (the “EE Software”), if that directory exists, is licensed under the license defined
|
|
5
|
+
* All software that resides under an "ee/" directory (the “EE Software”), if that directory exists, is licensed under the license defined below.
|
|
6
|
+
|
|
7
|
+
Enterprise License
|
|
8
|
+
|
|
9
|
+
If you or the company you represent has entered into a written agreement referencing the Enterprise Edition of the Strapi source code available at
|
|
10
|
+
https://github.com/strapi/strapi, then such agreement applies to your use of the Enterprise Edition of the Strapi Software. If you or the company you
|
|
11
|
+
represent is using the Enterprise Edition of the Strapi Software in connection with a subscription to our cloud offering, then the agreement you have
|
|
12
|
+
agreed to with respect to our cloud offering and the licenses included in such agreement apply to your use of the Enterprise Edition of the Strapi Software.
|
|
13
|
+
Otherwise, the Strapi Enterprise Software License Agreement (found here https://strapi.io/enterprise-terms) applies to your use of the Enterprise Edition of the Strapi Software.
|
|
14
|
+
|
|
15
|
+
BY ACCESSING OR USING THE ENTERPRISE EDITION OF THE STRAPI SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THE RELEVANT REFERENCED AGREEMENT.
|
|
16
|
+
IF YOU ARE NOT AUTHORIZED TO ACCEPT THESE TERMS ON BEHALF OF THE COMPANY YOU REPRESENT OR IF YOU DO NOT AGREE TO ALL OF THE RELEVANT TERMS AND CONDITIONS REFERENCED AND YOU
|
|
17
|
+
HAVE NOT OTHERWISE EXECUTED A WRITTEN AGREEMENT WITH STRAPI, YOU ARE NOT AUTHORIZED TO ACCESS OR USE OR ALLOW ANY USER TO ACCESS OR USE ANY PART OF
|
|
18
|
+
THE ENTERPRISE EDITION OF THE STRAPI SOFTWARE. YOUR ACCESS RIGHTS ARE CONDITIONAL ON YOUR CONSENT TO THE RELEVANT REFERENCED TERMS TO THE EXCLUSION OF ALL OTHER TERMS;
|
|
19
|
+
IF THE RELEVANT REFERENCED TERMS ARE CONSIDERED AN OFFER BY YOU, ACCEPTANCE IS EXPRESSLY LIMITED TO THE RELEVANT REFERENCED TERMS.
|
|
6
20
|
|
|
7
21
|
* All software outside of the above-mentioned directories or restrictions above is available under the "MIT Expat" license as set forth below.
|
|
8
22
|
|
|
@@ -18,5 +32,6 @@ furnished to do so, subject to the following conditions:
|
|
|
18
32
|
The above copyright notice and this permission notice shall be included in all
|
|
19
33
|
copies or substantial portions of the Software.
|
|
20
34
|
|
|
21
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
-
|
|
35
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
36
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
37
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
export declare const runCLI: () => void
|
|
2
|
-
|
|
3
|
-
dir?: string
|
|
4
|
-
plopFile?: string
|
|
5
|
-
}
|
|
1
|
+
export declare const runCLI: () => Promise<void>;
|
|
2
|
+
type GenerateOptions = {
|
|
3
|
+
dir?: string;
|
|
4
|
+
plopFile?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const generate: <T extends Record<string, any>>(generatorName: string, options: T, { dir, plopFile }?: GenerateOptions) => Promise<{
|
|
7
|
+
success: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
export {};
|
|
6
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":"AAKA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,MAAM,qBAkBlB,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAUF,eAAO,MAAM,QAAQ,iDACJ,MAAM,WACZ,CAAC,sBACyC,eAAe;;EAkDnE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,31 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const runCLI = ()
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var node_path = require('node:path');
|
|
4
|
+
var handlebars = require('handlebars');
|
|
5
|
+
var fs = require('fs-extra');
|
|
6
|
+
|
|
7
|
+
// Starts the Plop CLI programmatically
|
|
8
|
+
const runCLI = async ()=>{
|
|
9
|
+
const { Plop, run } = await import('plop');
|
|
10
|
+
Plop.prepare({
|
|
11
|
+
configPath: node_path.join(__dirname, 'plopfile.js')
|
|
12
|
+
}, (env)=>{
|
|
13
|
+
const argv = process.argv.slice(2); // Extract command-line arguments
|
|
14
|
+
Plop.execute(env, argv, (env, argv)=>{
|
|
15
|
+
const options = {
|
|
16
|
+
...env,
|
|
17
|
+
dest: node_path.join(process.cwd(), 'src')
|
|
18
|
+
};
|
|
19
|
+
return run(options, argv, true); // Pass the third argument 'true' for passArgsBeforeDashes
|
|
20
|
+
});
|
|
21
|
+
});
|
|
13
22
|
};
|
|
14
|
-
const generate = async (generatorName, options, { dir = process.cwd(), plopFile =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
23
|
+
const generate = async (generatorName, options, { dir = process.cwd(), plopFile = 'plopfile.js' } = {})=>{
|
|
24
|
+
// Resolve the absolute path to the plopfile (generator definitions)
|
|
25
|
+
const plopfilePath = node_path.join(__dirname, plopFile);
|
|
26
|
+
// Dynamically require the plopfile module.
|
|
27
|
+
// Note: This allows loading either CommonJS or transpiled ESM plopfiles.
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
29
|
+
const plopModule = require(plopfilePath);
|
|
30
|
+
// Internal objects to store registered generators and helpers.
|
|
31
|
+
// These will be populated by the plopfile when it is executed.
|
|
32
|
+
const generators = {};
|
|
33
|
+
const helpers = {};
|
|
34
|
+
// Minimal mock Plop API implementation, exposing only the methods needed by our plopfile.
|
|
35
|
+
// This allows the plopfile to register generators and helpers as it would in a real Plop environment.
|
|
36
|
+
const plopApi = {
|
|
37
|
+
setGenerator (name, config) {
|
|
38
|
+
generators[name] = config;
|
|
39
|
+
},
|
|
40
|
+
setHelper (name, fn) {
|
|
41
|
+
helpers[name] = fn;
|
|
42
|
+
},
|
|
43
|
+
getDestBasePath () {
|
|
44
|
+
return node_path.join(dir, 'src');
|
|
45
|
+
},
|
|
46
|
+
setWelcomeMessage () {}
|
|
47
|
+
};
|
|
48
|
+
// Execute the plopfile, passing in our API.
|
|
49
|
+
// This will populate the `generators` and `helpers` objects.
|
|
50
|
+
// Support both CommonJS and ESM default exports.
|
|
51
|
+
if (typeof plopModule.default === 'function') {
|
|
52
|
+
plopModule.default(plopApi);
|
|
53
|
+
} else {
|
|
54
|
+
plopModule(plopApi);
|
|
55
|
+
}
|
|
56
|
+
const generator = generators[generatorName];
|
|
57
|
+
if (!generator) {
|
|
58
|
+
throw new Error(`Generator "${generatorName}" not found`);
|
|
59
|
+
}
|
|
60
|
+
registerHandlebarsHelpers(helpers);
|
|
61
|
+
const actions = typeof generator.actions === 'function' ? generator.actions(options) : generator.actions || [];
|
|
62
|
+
await executeActions(actions, options, dir);
|
|
63
|
+
return {
|
|
64
|
+
success: true
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
const registerHandlebarsHelpers = (helpers)=>{
|
|
68
|
+
Object.entries(helpers).forEach(([name, fn])=>handlebars.registerHelper(name, fn));
|
|
69
|
+
};
|
|
70
|
+
// Executes generator actions: add or modify files as specified
|
|
71
|
+
const executeActions = async (actions, options, dir)=>{
|
|
72
|
+
for (const action of actions){
|
|
73
|
+
const outputPath = handlebars.compile(action.path)(options);
|
|
74
|
+
const fullPath = node_path.join(dir, 'src', outputPath);
|
|
75
|
+
if (action.type === 'add' && action.templateFile) {
|
|
76
|
+
const templatePath = node_path.join(__dirname, action.templateFile);
|
|
77
|
+
const templateContent = await fs.readFile(templatePath, 'utf8');
|
|
78
|
+
const compiled = handlebars.compile(templateContent);
|
|
79
|
+
const output = compiled({
|
|
80
|
+
...options,
|
|
81
|
+
...action.data
|
|
82
|
+
});
|
|
83
|
+
await fs.ensureDir(node_path.dirname(fullPath));
|
|
84
|
+
await fs.writeFile(fullPath, output);
|
|
85
|
+
}
|
|
86
|
+
if (action.type === 'modify') {
|
|
87
|
+
if (await fs.pathExists(fullPath)) {
|
|
88
|
+
const content = await fs.readFile(fullPath, 'utf8');
|
|
89
|
+
const modified = action.transform ? action.transform(content) : content;
|
|
90
|
+
await fs.writeFile(fullPath, modified);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
26
93
|
}
|
|
27
|
-
});
|
|
28
94
|
};
|
|
95
|
+
|
|
29
96
|
exports.generate = generate;
|
|
30
97
|
exports.runCLI = runCLI;
|
|
31
98
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { join } from 'node:path';\nimport
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { join, dirname } from 'node:path';\nimport handlebars from 'handlebars';\nimport fs from 'fs-extra';\n\n// Starts the Plop CLI programmatically\nexport const runCLI = async () => {\n const { Plop, run } = await import('plop');\n\n Plop.prepare(\n {\n configPath: join(__dirname, 'plopfile.js'),\n },\n (env) => {\n const argv = process.argv.slice(2); // Extract command-line arguments\n Plop.execute(env, argv, (env, argv) => {\n const options = {\n ...env,\n dest: join(process.cwd(), 'src'), // this will make the destination path to be based on the cwd when calling the wrapper\n };\n return run(options, argv, true); // Pass the third argument 'true' for passArgsBeforeDashes\n });\n }\n );\n};\n\ntype GenerateOptions = {\n dir?: string;\n plopFile?: string;\n};\n\ntype GeneratorAction = {\n type: 'add' | 'modify';\n path: string;\n templateFile?: string;\n data?: Record<string, any>;\n transform?: (content: string) => string;\n};\n\nexport const generate = async <T extends Record<string, any>>(\n generatorName: string,\n options: T,\n { dir = process.cwd(), plopFile = 'plopfile.js' }: GenerateOptions = {}\n) => {\n // Resolve the absolute path to the plopfile (generator definitions)\n const plopfilePath = join(__dirname, plopFile);\n // Dynamically require the plopfile module.\n // Note: This allows loading either CommonJS or transpiled ESM plopfiles.\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const plopModule = require(plopfilePath);\n\n // Internal objects to store registered generators and helpers.\n // These will be populated by the plopfile when it is executed.\n const generators: Record<string, any> = {};\n const helpers: Record<string, any> = {};\n\n // Minimal mock Plop API implementation, exposing only the methods needed by our plopfile.\n // This allows the plopfile to register generators and helpers as it would in a real Plop environment.\n const plopApi = {\n setGenerator(name: string, config: any) {\n generators[name] = config;\n },\n setHelper(name: string, fn: any) {\n helpers[name] = fn;\n },\n getDestBasePath() {\n return join(dir, 'src');\n },\n setWelcomeMessage() {}, // no-op\n };\n\n // Execute the plopfile, passing in our API.\n // This will populate the `generators` and `helpers` objects.\n // Support both CommonJS and ESM default exports.\n if (typeof plopModule.default === 'function') {\n plopModule.default(plopApi);\n } else {\n plopModule(plopApi);\n }\n\n const generator = generators[generatorName];\n if (!generator) {\n throw new Error(`Generator \"${generatorName}\" not found`);\n }\n\n registerHandlebarsHelpers(helpers);\n const actions: GeneratorAction[] =\n typeof generator.actions === 'function' ? generator.actions(options) : generator.actions || [];\n\n await executeActions(actions, options, dir);\n\n return { success: true };\n};\n\nconst registerHandlebarsHelpers = (helpers: Record<string, any>) => {\n Object.entries(helpers).forEach(([name, fn]) => handlebars.registerHelper(name, fn));\n};\n\n// Executes generator actions: add or modify files as specified\nconst executeActions = async (\n actions: GeneratorAction[],\n options: Record<string, any>,\n dir: string\n) => {\n for (const action of actions) {\n const outputPath = handlebars.compile(action.path)(options);\n const fullPath = join(dir, 'src', outputPath);\n\n if (action.type === 'add' && action.templateFile) {\n const templatePath = join(__dirname, action.templateFile);\n const templateContent = await fs.readFile(templatePath, 'utf8');\n const compiled = handlebars.compile(templateContent);\n const output = compiled({ ...options, ...action.data });\n\n await fs.ensureDir(dirname(fullPath));\n await fs.writeFile(fullPath, output);\n }\n\n if (action.type === 'modify') {\n if (await fs.pathExists(fullPath)) {\n const content = await fs.readFile(fullPath, 'utf8');\n const modified = action.transform ? action.transform(content) : content;\n await fs.writeFile(fullPath, modified);\n }\n }\n }\n};\n"],"names":["runCLI","Plop","run","prepare","configPath","join","__dirname","env","argv","process","slice","execute","options","dest","cwd","generate","generatorName","dir","plopFile","plopfilePath","plopModule","require","generators","helpers","plopApi","setGenerator","name","config","setHelper","fn","getDestBasePath","setWelcomeMessage","default","generator","Error","registerHandlebarsHelpers","actions","executeActions","success","Object","entries","forEach","handlebars","registerHelper","action","outputPath","compile","path","fullPath","type","templateFile","templatePath","templateContent","fs","readFile","compiled","output","data","ensureDir","dirname","writeFile","pathExists","content","modified","transform"],"mappings":";;;;;;AAIA;MACaA,MAAS,GAAA,UAAA;IACpB,MAAM,EAAEC,IAAI,EAAEC,GAAG,EAAE,GAAG,MAAM,OAAO,MAAA,CAAA;AAEnCD,IAAAA,IAAAA,CAAKE,OAAO,CACV;AACEC,QAAAA,UAAAA,EAAYC,eAAKC,SAAW,EAAA,aAAA;AAC9B,KAAA,EACA,CAACC,GAAAA,GAAAA;AACC,QAAA,MAAMC,OAAOC,OAAQD,CAAAA,IAAI,CAACE,KAAK,CAAC;AAChCT,QAAAA,IAAAA,CAAKU,OAAO,CAACJ,GAAKC,EAAAA,IAAAA,E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AA,MAAMC,EAAGC,CAAAA,QAAQ,CAACH,YAAc,EAAA,MAAA,CAAA;YACxD,MAAMI,QAAAA,GAAWb,UAAWI,CAAAA,OAAO,CAACM,eAAAA,CAAAA;AACpC,YAAA,MAAMI,SAASD,QAAS,CAAA;AAAE,gBAAA,GAAG3C,OAAO;AAAE,gBAAA,GAAGgC,OAAOa;AAAK,aAAA,CAAA;YAErD,MAAMJ,EAAAA,CAAGK,SAAS,CAACC,iBAAQX,CAAAA,QAAAA,CAAAA,CAAAA;YAC3B,MAAMK,EAAAA,CAAGO,SAAS,CAACZ,QAAUQ,EAAAA,MAAAA,CAAAA;AAC/B;QAEA,IAAIZ,MAAAA,CAAOK,IAAI,KAAK,QAAU,EAAA;AAC5B,YAAA,IAAI,MAAMI,EAAAA,CAAGQ,UAAU,CAACb,QAAW,CAAA,EAAA;AACjC,gBAAA,MAAMc,OAAU,GAAA,MAAMT,EAAGC,CAAAA,QAAQ,CAACN,QAAU,EAAA,MAAA,CAAA;AAC5C,gBAAA,MAAMe,WAAWnB,MAAOoB,CAAAA,SAAS,GAAGpB,MAAOoB,CAAAA,SAAS,CAACF,OAAWA,CAAAA,GAAAA,OAAAA;gBAChE,MAAMT,EAAAA,CAAGO,SAAS,CAACZ,QAAUe,EAAAA,QAAAA,CAAAA;AAC/B;AACF;AACF;AACF,CAAA;;;;;"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,29 +1,95 @@
|
|
|
1
|
-
import { join } from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { join, dirname } from 'node:path';
|
|
2
|
+
import handlebars from 'handlebars';
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
|
|
5
|
+
// Starts the Plop CLI programmatically
|
|
6
|
+
const runCLI = async ()=>{
|
|
7
|
+
const { Plop, run } = await import('plop');
|
|
8
|
+
Plop.prepare({
|
|
9
|
+
configPath: join(__dirname, 'plopfile.js')
|
|
10
|
+
}, (env)=>{
|
|
11
|
+
const argv = process.argv.slice(2); // Extract command-line arguments
|
|
12
|
+
Plop.execute(env, argv, (env, argv)=>{
|
|
13
|
+
const options = {
|
|
14
|
+
...env,
|
|
15
|
+
dest: join(process.cwd(), 'src')
|
|
16
|
+
};
|
|
17
|
+
return run(options, argv, true); // Pass the third argument 'true' for passArgsBeforeDashes
|
|
18
|
+
});
|
|
19
|
+
});
|
|
9
20
|
};
|
|
10
|
-
const generate = async (generatorName, options, { dir = process.cwd(), plopFile =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
21
|
+
const generate = async (generatorName, options, { dir = process.cwd(), plopFile = 'plopfile.js' } = {})=>{
|
|
22
|
+
// Resolve the absolute path to the plopfile (generator definitions)
|
|
23
|
+
const plopfilePath = join(__dirname, plopFile);
|
|
24
|
+
// Dynamically require the plopfile module.
|
|
25
|
+
// Note: This allows loading either CommonJS or transpiled ESM plopfiles.
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
27
|
+
const plopModule = require(plopfilePath);
|
|
28
|
+
// Internal objects to store registered generators and helpers.
|
|
29
|
+
// These will be populated by the plopfile when it is executed.
|
|
30
|
+
const generators = {};
|
|
31
|
+
const helpers = {};
|
|
32
|
+
// Minimal mock Plop API implementation, exposing only the methods needed by our plopfile.
|
|
33
|
+
// This allows the plopfile to register generators and helpers as it would in a real Plop environment.
|
|
34
|
+
const plopApi = {
|
|
35
|
+
setGenerator (name, config) {
|
|
36
|
+
generators[name] = config;
|
|
37
|
+
},
|
|
38
|
+
setHelper (name, fn) {
|
|
39
|
+
helpers[name] = fn;
|
|
40
|
+
},
|
|
41
|
+
getDestBasePath () {
|
|
42
|
+
return join(dir, 'src');
|
|
43
|
+
},
|
|
44
|
+
setWelcomeMessage () {}
|
|
45
|
+
};
|
|
46
|
+
// Execute the plopfile, passing in our API.
|
|
47
|
+
// This will populate the `generators` and `helpers` objects.
|
|
48
|
+
// Support both CommonJS and ESM default exports.
|
|
49
|
+
if (typeof plopModule.default === 'function') {
|
|
50
|
+
plopModule.default(plopApi);
|
|
51
|
+
} else {
|
|
52
|
+
plopModule(plopApi);
|
|
22
53
|
}
|
|
23
|
-
|
|
54
|
+
const generator = generators[generatorName];
|
|
55
|
+
if (!generator) {
|
|
56
|
+
throw new Error(`Generator "${generatorName}" not found`);
|
|
57
|
+
}
|
|
58
|
+
registerHandlebarsHelpers(helpers);
|
|
59
|
+
const actions = typeof generator.actions === 'function' ? generator.actions(options) : generator.actions || [];
|
|
60
|
+
await executeActions(actions, options, dir);
|
|
61
|
+
return {
|
|
62
|
+
success: true
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
const registerHandlebarsHelpers = (helpers)=>{
|
|
66
|
+
Object.entries(helpers).forEach(([name, fn])=>handlebars.registerHelper(name, fn));
|
|
24
67
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
68
|
+
// Executes generator actions: add or modify files as specified
|
|
69
|
+
const executeActions = async (actions, options, dir)=>{
|
|
70
|
+
for (const action of actions){
|
|
71
|
+
const outputPath = handlebars.compile(action.path)(options);
|
|
72
|
+
const fullPath = join(dir, 'src', outputPath);
|
|
73
|
+
if (action.type === 'add' && action.templateFile) {
|
|
74
|
+
const templatePath = join(__dirname, action.templateFile);
|
|
75
|
+
const templateContent = await fs.readFile(templatePath, 'utf8');
|
|
76
|
+
const compiled = handlebars.compile(templateContent);
|
|
77
|
+
const output = compiled({
|
|
78
|
+
...options,
|
|
79
|
+
...action.data
|
|
80
|
+
});
|
|
81
|
+
await fs.ensureDir(dirname(fullPath));
|
|
82
|
+
await fs.writeFile(fullPath, output);
|
|
83
|
+
}
|
|
84
|
+
if (action.type === 'modify') {
|
|
85
|
+
if (await fs.pathExists(fullPath)) {
|
|
86
|
+
const content = await fs.readFile(fullPath, 'utf8');
|
|
87
|
+
const modified = action.transform ? action.transform(content) : content;
|
|
88
|
+
await fs.writeFile(fullPath, modified);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
28
92
|
};
|
|
93
|
+
|
|
94
|
+
export { generate, runCLI };
|
|
29
95
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import { join } from 'node:path';\nimport
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import { join, dirname } from 'node:path';\nimport handlebars from 'handlebars';\nimport fs from 'fs-extra';\n\n// Starts the Plop CLI programmatically\nexport const runCLI = async () => {\n const { Plop, run } = await import('plop');\n\n Plop.prepare(\n {\n configPath: join(__dirname, 'plopfile.js'),\n },\n (env) => {\n const argv = process.argv.slice(2); // Extract command-line arguments\n Plop.execute(env, argv, (env, argv) => {\n const options = {\n ...env,\n dest: join(process.cwd(), 'src'), // this will make the destination path to be based on the cwd when calling the wrapper\n };\n return run(options, argv, true); // Pass the third argument 'true' for passArgsBeforeDashes\n });\n }\n );\n};\n\ntype GenerateOptions = {\n dir?: string;\n plopFile?: string;\n};\n\ntype GeneratorAction = {\n type: 'add' | 'modify';\n path: string;\n templateFile?: string;\n data?: Record<string, any>;\n transform?: (content: string) => string;\n};\n\nexport const generate = async <T extends Record<string, any>>(\n generatorName: string,\n options: T,\n { dir = process.cwd(), plopFile = 'plopfile.js' }: GenerateOptions = {}\n) => {\n // Resolve the absolute path to the plopfile (generator definitions)\n const plopfilePath = join(__dirname, plopFile);\n // Dynamically require the plopfile module.\n // Note: This allows loading either CommonJS or transpiled ESM plopfiles.\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const plopModule = require(plopfilePath);\n\n // Internal objects to store registered generators and helpers.\n // These will be populated by the plopfile when it is executed.\n const generators: Record<string, any> = {};\n const helpers: Record<string, any> = {};\n\n // Minimal mock Plop API implementation, exposing only the methods needed by our plopfile.\n // This allows the plopfile to register generators and helpers as it would in a real Plop environment.\n const plopApi = {\n setGenerator(name: string, config: any) {\n generators[name] = config;\n },\n setHelper(name: string, fn: any) {\n helpers[name] = fn;\n },\n getDestBasePath() {\n return join(dir, 'src');\n },\n setWelcomeMessage() {}, // no-op\n };\n\n // Execute the plopfile, passing in our API.\n // This will populate the `generators` and `helpers` objects.\n // Support both CommonJS and ESM default exports.\n if (typeof plopModule.default === 'function') {\n plopModule.default(plopApi);\n } else {\n plopModule(plopApi);\n }\n\n const generator = generators[generatorName];\n if (!generator) {\n throw new Error(`Generator \"${generatorName}\" not found`);\n }\n\n registerHandlebarsHelpers(helpers);\n const actions: GeneratorAction[] =\n typeof generator.actions === 'function' ? generator.actions(options) : generator.actions || [];\n\n await executeActions(actions, options, dir);\n\n return { success: true };\n};\n\nconst registerHandlebarsHelpers = (helpers: Record<string, any>) => {\n Object.entries(helpers).forEach(([name, fn]) => handlebars.registerHelper(name, fn));\n};\n\n// Executes generator actions: add or modify files as specified\nconst executeActions = async (\n actions: GeneratorAction[],\n options: Record<string, any>,\n dir: string\n) => {\n for (const action of actions) {\n const outputPath = handlebars.compile(action.path)(options);\n const fullPath = join(dir, 'src', outputPath);\n\n if (action.type === 'add' && action.templateFile) {\n const templatePath = join(__dirname, action.templateFile);\n const templateContent = await fs.readFile(templatePath, 'utf8');\n const compiled = handlebars.compile(templateContent);\n const output = compiled({ ...options, ...action.data });\n\n await fs.ensureDir(dirname(fullPath));\n await fs.writeFile(fullPath, output);\n }\n\n if (action.type === 'modify') {\n if (await fs.pathExists(fullPath)) {\n const content = await fs.readFile(fullPath, 'utf8');\n const modified = action.transform ? action.transform(content) : content;\n await fs.writeFile(fullPath, modified);\n }\n }\n }\n};\n"],"names":["runCLI","Plop","run","prepare","configPath","join","__dirname","env","argv","process","slice","execute","options","dest","cwd","generate","generatorName","dir","plopFile","plopfilePath","plopModule","require","generators","helpers","plopApi","setGenerator","name","config","setHelper","fn","getDestBasePath","setWelcomeMessage","default","generator","Error","registerHandlebarsHelpers","actions","executeActions","success","Object","entries","forEach","handlebars","registerHelper","action","outputPath","compile","path","fullPath","type","templateFile","templatePath","templateContent","fs","readFile","compiled","output","data","ensureDir","dirname","writeFile","pathExists","content","modified","transform"],"mappings":";;;;AAIA;MACaA,MAAS,GAAA,UAAA;IACpB,MAAM,EAAEC,IAAI,EAAEC,GAAG,EAAE,GAAG,MAAM,OAAO,MAAA,CAAA;AAEnCD,IAAAA,IAAAA,CAAKE,OAAO,CACV;AACEC,QAAAA,UAAAA,EAAYC,KAAKC,SAAW,EAAA,aAAA;AAC9B,KAAA,EACA,CAACC,GAAAA,GAAAA;AACC,QAAA,MAAMC,OAAOC,OAAQD,CAAAA,IAAI,CAACE,KAAK,CAAC;AAChCT,QAAAA,IAAAA,CAAKU,OAAO,CAACJ,GAAKC,EAAAA,IAAAA,EAAM,CAACD,GAAKC,EAAAA,IAAAA,GAAAA;AAC5B,YAAA,MAAMI,OAAU,GAAA;AACd,gBAAA,GAAGL,GAAG;gBACNM,IAAMR,EAAAA,IAAAA,CAAKI,OAAQK,CAAAA,GAAG,EAAI,EAAA,KAAA;AAC5B,aAAA;AACA,YAAA,OAAOZ,GAAIU,CAAAA,OAAAA,EAASJ,IAAM,EAAA,IAAA,CAAA,CAAA;AAC5B,SAAA,CAAA;AACF,KAAA,CAAA;AAEJ;MAeaO,QAAW,GAAA,OACtBC,aACAJ,EAAAA,OAAAA,EACA,EAAEK,GAAMR,GAAAA,OAAAA,CAAQK,GAAG,EAAE,EAAEI,QAAW,GAAA,aAAa,EAAmB,GAAG,EAAE,GAAA;;IAGvE,MAAMC,YAAAA,GAAed,KAAKC,SAAWY,EAAAA,QAAAA,CAAAA;;;;AAIrC,IAAA,MAAME,aAAaC,OAAQF,CAAAA,YAAAA,CAAAA;;;AAI3B,IAAA,MAAMG,aAAkC,EAAC;AACzC,IAAA,MAAM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e,WAAWnB,MAAOoB,CAAAA,SAAS,GAAGpB,MAAOoB,CAAAA,SAAS,CAACF,OAAWA,CAAAA,GAAAA,OAAAA;gBAChE,MAAMT,EAAAA,CAAGO,SAAS,CAACZ,QAAUe,EAAAA,QAAAA,CAAAA;AAC/B;AACF;AACF;AACF,CAAA;;;;"}
|
package/dist/plopfile.d.ts
CHANGED
package/dist/plopfile.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plopfile.d.ts","sourceRoot":"","sources":["../src/plopfile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;+
|
|
1
|
+
{"version":3,"file":"plopfile.d.ts","sourceRoot":"","sources":["../src/plopfile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;+BAUlB,WAAW;AAAjC,wBAaE"}
|