@strapi/generators 5.8.1 → 5.10.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.js +33 -60
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -38
- package/dist/index.mjs.map +1 -1
- package/dist/plopfile.js +622 -551
- package/dist/plopfile.js.map +1 -1
- package/dist/plopfile.mjs +621 -548
- package/dist/plopfile.mjs.map +1 -1
- package/package.json +9 -8
package/dist/index.js
CHANGED
|
@@ -1,65 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var node_path = require('node:path');
|
|
4
|
+
var nodePlop = require('node-plop');
|
|
5
|
+
|
|
6
|
+
// Starts the Plop CLI programmatically
|
|
7
|
+
const runCLI = async ()=>{
|
|
8
|
+
const { Plop, run } = await import('plop');
|
|
9
|
+
Plop.prepare({
|
|
10
|
+
configPath: node_path.join(__dirname, 'plopfile.js')
|
|
11
|
+
}, (env)=>{
|
|
12
|
+
const argv = process.argv.slice(2); // Extract command-line arguments
|
|
13
|
+
Plop.execute(env, argv, (env, argv)=>{
|
|
14
|
+
const options = {
|
|
15
|
+
...env,
|
|
16
|
+
dest: node_path.join(process.cwd(), 'src')
|
|
17
|
+
};
|
|
18
|
+
return run(options, argv, true); // Pass the third argument 'true' for passArgsBeforeDashes
|
|
19
|
+
});
|
|
20
|
+
});
|
|
15
21
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const nodePlop__default = /* @__PURE__ */ _interopDefault(nodePlop);
|
|
29
|
-
const runCLI = async () => {
|
|
30
|
-
const { Plop, run } = await import("plop");
|
|
31
|
-
Plop.prepare(
|
|
32
|
-
{
|
|
33
|
-
configPath: node_path.join(__dirname, "plopfile.js")
|
|
34
|
-
},
|
|
35
|
-
(env) => {
|
|
36
|
-
const argv = process.argv.slice(2);
|
|
37
|
-
Plop.execute(env, argv, (env2, argv2) => {
|
|
38
|
-
const options = {
|
|
39
|
-
...env2,
|
|
40
|
-
dest: node_path.join(process.cwd(), "src")
|
|
41
|
-
// this will make the destination path to be based on the cwd when calling the wrapper
|
|
42
|
-
};
|
|
43
|
-
return run(options, argv2, true);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
};
|
|
48
|
-
const generate = async (generatorName, options, { dir = process.cwd(), plopFile = "plopfile.js" } = {}) => {
|
|
49
|
-
const plop = nodePlop__default.default(node_path.join(__dirname, plopFile), {
|
|
50
|
-
destBasePath: node_path.join(dir, "src"),
|
|
51
|
-
force: false
|
|
52
|
-
});
|
|
53
|
-
const generator = plop.getGenerator(generatorName);
|
|
54
|
-
await generator.runActions(options, {
|
|
55
|
-
onSuccess() {
|
|
56
|
-
},
|
|
57
|
-
onFailure() {
|
|
58
|
-
},
|
|
59
|
-
onComment() {
|
|
60
|
-
}
|
|
61
|
-
});
|
|
22
|
+
// Runs a generator programmatically without prompts
|
|
23
|
+
const generate = async (generatorName, options, { dir = process.cwd(), plopFile = 'plopfile.js' } = {})=>{
|
|
24
|
+
const plop = nodePlop(node_path.join(__dirname, plopFile), {
|
|
25
|
+
destBasePath: node_path.join(dir, 'src'),
|
|
26
|
+
force: false
|
|
27
|
+
});
|
|
28
|
+
const generator = plop.getGenerator(generatorName);
|
|
29
|
+
await generator.runActions(options, {
|
|
30
|
+
onSuccess () {},
|
|
31
|
+
onFailure () {},
|
|
32
|
+
onComment () {}
|
|
33
|
+
});
|
|
62
34
|
};
|
|
35
|
+
|
|
63
36
|
exports.generate = generate;
|
|
64
37
|
exports.runCLI = runCLI;
|
|
65
38
|
//# 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 nodePlop from 'node-plop';\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\n// Runs a generator programmatically without prompts\nexport const generate = async <T extends Record<string, any>>(\n generatorName: string,\n options: T,\n { dir = process.cwd(), plopFile = 'plopfile.js' } = {}\n) => {\n const plop = nodePlop(join(__dirname, plopFile), {\n destBasePath: join(dir, 'src'),\n force: false,\n });\n\n const generator = plop.getGenerator(generatorName);\n await generator.runActions(options satisfies T, {\n onSuccess() {},\n onFailure() {},\n onComment() {},\n });\n};\n"],"names":["join","env","argv","nodePlop"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { join } from 'node:path';\nimport nodePlop from 'node-plop';\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\n// Runs a generator programmatically without prompts\nexport const generate = async <T extends Record<string, any>>(\n generatorName: string,\n options: T,\n { dir = process.cwd(), plopFile = 'plopfile.js' } = {}\n) => {\n const plop = nodePlop(join(__dirname, plopFile), {\n destBasePath: join(dir, 'src'),\n force: false,\n });\n\n const generator = plop.getGenerator(generatorName);\n await generator.runActions(options satisfies T, {\n onSuccess() {},\n onFailure() {},\n onComment() {},\n });\n};\n"],"names":["runCLI","Plop","run","prepare","configPath","join","__dirname","env","argv","process","slice","execute","options","dest","cwd","generate","generatorName","dir","plopFile","plop","nodePlop","destBasePath","force","generator","getGenerator","runActions","onSuccess","onFailure","onComment"],"mappings":";;;;;AAGA;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,EAAM,CAACD,GAAKC,EAAAA,IAAAA,GAAAA;AAC5B,YAAA,MAAMI,OAAU,GAAA;AACd,gBAAA,GAAGL,GAAG;gBACNM,IAAMR,EAAAA,cAAAA,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;AAEA;MACaO,QAAW,GAAA,OACtBC,aACAJ,EAAAA,OAAAA,EACA,EAAEK,GAAMR,GAAAA,OAAAA,CAAQK,GAAG,EAAE,EAAEI,QAAW,GAAA,aAAa,EAAE,GAAG,EAAE,GAAA;AAEtD,IAAA,MAAMC,IAAOC,GAAAA,QAAAA,CAASf,cAAKC,CAAAA,SAAAA,EAAWY,QAAW,CAAA,EAAA;AAC/CG,QAAAA,YAAAA,EAAchB,eAAKY,GAAK,EAAA,KAAA,CAAA;QACxBK,KAAO,EAAA;AACT,KAAA,CAAA;IAEA,MAAMC,SAAAA,GAAYJ,IAAKK,CAAAA,YAAY,CAACR,aAAAA,CAAAA;IACpC,MAAMO,SAAAA,CAAUE,UAAU,CAACb,OAAqB,EAAA;QAC9Cc,SAAa,CAAA,GAAA,EAAA;QACbC,SAAa,CAAA,GAAA,EAAA;QACbC,SAAa,CAAA,GAAA;AACf,KAAA,CAAA;AACF;;;;;"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,41 +1,35 @@
|
|
|
1
|
-
import { join } from
|
|
2
|
-
import nodePlop from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
(env)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
);
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import nodePlop from 'node-plop';
|
|
3
|
+
|
|
4
|
+
// Starts the Plop CLI programmatically
|
|
5
|
+
const runCLI = async ()=>{
|
|
6
|
+
const { Plop, run } = await import('plop');
|
|
7
|
+
Plop.prepare({
|
|
8
|
+
configPath: join(__dirname, 'plopfile.js')
|
|
9
|
+
}, (env)=>{
|
|
10
|
+
const argv = process.argv.slice(2); // Extract command-line arguments
|
|
11
|
+
Plop.execute(env, argv, (env, argv)=>{
|
|
12
|
+
const options = {
|
|
13
|
+
...env,
|
|
14
|
+
dest: join(process.cwd(), 'src')
|
|
15
|
+
};
|
|
16
|
+
return run(options, argv, true); // Pass the third argument 'true' for passArgsBeforeDashes
|
|
17
|
+
});
|
|
18
|
+
});
|
|
21
19
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
export {
|
|
38
|
-
generate,
|
|
39
|
-
runCLI
|
|
20
|
+
// Runs a generator programmatically without prompts
|
|
21
|
+
const generate = async (generatorName, options, { dir = process.cwd(), plopFile = 'plopfile.js' } = {})=>{
|
|
22
|
+
const plop = nodePlop(join(__dirname, plopFile), {
|
|
23
|
+
destBasePath: join(dir, 'src'),
|
|
24
|
+
force: false
|
|
25
|
+
});
|
|
26
|
+
const generator = plop.getGenerator(generatorName);
|
|
27
|
+
await generator.runActions(options, {
|
|
28
|
+
onSuccess () {},
|
|
29
|
+
onFailure () {},
|
|
30
|
+
onComment () {}
|
|
31
|
+
});
|
|
40
32
|
};
|
|
33
|
+
|
|
34
|
+
export { generate, runCLI };
|
|
41
35
|
//# 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 nodePlop from 'node-plop';\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\n// Runs a generator programmatically without prompts\nexport const generate = async <T extends Record<string, any>>(\n generatorName: string,\n options: T,\n { dir = process.cwd(), plopFile = 'plopfile.js' } = {}\n) => {\n const plop = nodePlop(join(__dirname, plopFile), {\n destBasePath: join(dir, 'src'),\n force: false,\n });\n\n const generator = plop.getGenerator(generatorName);\n await generator.runActions(options satisfies T, {\n onSuccess() {},\n onFailure() {},\n onComment() {},\n });\n};\n"],"names":["env","argv"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import { join } from 'node:path';\nimport nodePlop from 'node-plop';\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\n// Runs a generator programmatically without prompts\nexport const generate = async <T extends Record<string, any>>(\n generatorName: string,\n options: T,\n { dir = process.cwd(), plopFile = 'plopfile.js' } = {}\n) => {\n const plop = nodePlop(join(__dirname, plopFile), {\n destBasePath: join(dir, 'src'),\n force: false,\n });\n\n const generator = plop.getGenerator(generatorName);\n await generator.runActions(options satisfies T, {\n onSuccess() {},\n onFailure() {},\n onComment() {},\n });\n};\n"],"names":["runCLI","Plop","run","prepare","configPath","join","__dirname","env","argv","process","slice","execute","options","dest","cwd","generate","generatorName","dir","plopFile","plop","nodePlop","destBasePath","force","generator","getGenerator","runActions","onSuccess","onFailure","onComment"],"mappings":";;;AAGA;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,OAAQ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