@strapi/generators 0.0.0-next.f45143c5e2a8a9d85691d0abf79a3f42024a0c71 → 0.0.0-next.f5b09a8e61e059f02784478e27c310c6290be088
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/files/js/plugin/.gitattributes +103 -0
- package/{lib → dist}/files/js/plugin/admin/src/index.js +2 -4
- package/{lib → dist}/files/js/plugin/server/register.js +1 -1
- package/dist/files/ts/plugin/.gitattributes +103 -0
- package/{lib → dist}/files/ts/plugin/admin/src/index.tsx +1 -1
- package/{lib → dist}/files/ts/plugin/server/register.ts +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +29 -0
- package/dist/index.mjs.map +1 -0
- package/dist/plopfile.d.ts +4 -0
- package/dist/plopfile.d.ts.map +1 -0
- package/dist/plopfile.js +703 -0
- package/dist/plopfile.js.map +1 -0
- package/dist/plopfile.mjs +679 -0
- package/dist/plopfile.mjs.map +1 -0
- package/dist/plops/api.d.ts +4 -0
- package/dist/plops/api.d.ts.map +1 -0
- package/dist/plops/content-type.d.ts +4 -0
- package/dist/plops/content-type.d.ts.map +1 -0
- package/dist/plops/controller.d.ts +4 -0
- package/dist/plops/controller.d.ts.map +1 -0
- package/dist/plops/middleware.d.ts +4 -0
- package/dist/plops/middleware.d.ts.map +1 -0
- package/dist/plops/migration.d.ts +4 -0
- package/dist/plops/migration.d.ts.map +1 -0
- package/dist/plops/plugin.d.ts +4 -0
- package/dist/plops/plugin.d.ts.map +1 -0
- package/dist/plops/policy.d.ts +4 -0
- package/dist/plops/policy.d.ts.map +1 -0
- package/dist/plops/prompts/bootstrap-api-prompts.d.ts +4 -0
- package/dist/plops/prompts/bootstrap-api-prompts.d.ts.map +1 -0
- package/dist/plops/prompts/ct-names-prompts.d.ts +4 -0
- package/dist/plops/prompts/ct-names-prompts.d.ts.map +1 -0
- package/dist/plops/prompts/draft-and-publish-prompts.d.ts +4 -0
- package/dist/plops/prompts/draft-and-publish-prompts.d.ts.map +1 -0
- package/dist/plops/prompts/get-attributes-prompts.d.ts +4 -0
- package/dist/plops/prompts/get-attributes-prompts.d.ts.map +1 -0
- package/dist/plops/prompts/get-destination-prompts.d.ts +6 -0
- package/dist/plops/prompts/get-destination-prompts.d.ts.map +1 -0
- package/dist/plops/prompts/kind-prompts.d.ts +4 -0
- package/dist/plops/prompts/kind-prompts.d.ts.map +1 -0
- package/dist/plops/service.d.ts +4 -0
- package/dist/plops/service.d.ts.map +1 -0
- package/dist/plops/utils/get-file-path.d.ts +3 -0
- package/dist/plops/utils/get-file-path.d.ts.map +1 -0
- package/dist/plops/utils/get-formatted-date.d.ts +3 -0
- package/dist/plops/utils/get-formatted-date.d.ts.map +1 -0
- package/dist/plops/utils/validate-attribute-input.d.ts +3 -0
- package/dist/plops/utils/validate-attribute-input.d.ts.map +1 -0
- package/dist/plops/utils/validate-file-name-input.d.ts +3 -0
- package/dist/plops/utils/validate-file-name-input.d.ts.map +1 -0
- package/dist/plops/utils/validate-input.d.ts +3 -0
- package/dist/plops/utils/validate-input.d.ts.map +1 -0
- package/{lib → dist}/templates/js/plugin-package.json.hbs +5 -5
- package/{lib → dist}/templates/ts/plugin-package.json.hbs +7 -7
- package/package.json +27 -7
- package/.eslintignore +0 -3
- package/.eslintrc.js +0 -4
- package/lib/index.js +0 -37
- package/lib/plopfile.js +0 -28
- package/lib/plops/__tests__/content-type.test.js +0 -179
- package/lib/plops/api.js +0 -82
- package/lib/plops/content-type.js +0 -148
- package/lib/plops/controller.js +0 -36
- package/lib/plops/middleware.js +0 -36
- package/lib/plops/migration.js +0 -33
- package/lib/plops/plugin.js +0 -91
- package/lib/plops/policy.js +0 -36
- package/lib/plops/prompts/bootstrap-api-prompts.js +0 -10
- package/lib/plops/prompts/ct-names-prompts.js +0 -44
- package/lib/plops/prompts/draft-and-publish-prompts.js +0 -10
- package/lib/plops/prompts/get-attributes-prompts.js +0 -105
- package/lib/plops/prompts/get-destination-prompts.js +0 -79
- package/lib/plops/prompts/kind-prompts.js +0 -17
- package/lib/plops/service.js +0 -34
- package/lib/plops/utils/__tests__/get-file-path.test.js +0 -25
- package/lib/plops/utils/get-file-path.js +0 -17
- package/lib/plops/utils/get-formatted-date.js +0 -8
- package/lib/plops/utils/validate-attribute-input.js +0 -11
- package/lib/plops/utils/validate-file-name-input.js +0 -11
- package/lib/plops/utils/validate-input.js +0 -11
- /package/{lib → dist}/files/js/plugin/admin/src/components/Initializer/index.js +0 -0
- /package/{lib → dist}/files/js/plugin/admin/src/components/PluginIcon/index.js +0 -0
- /package/{lib → dist}/files/js/plugin/admin/src/pages/App/index.js +0 -0
- /package/{lib → dist}/files/js/plugin/admin/src/pages/HomePage/index.js +0 -0
- /package/{lib → dist}/files/js/plugin/admin/src/pluginId.js +0 -0
- /package/{lib → dist}/files/js/plugin/admin/src/translations/en.json +0 -0
- /package/{lib → dist}/files/js/plugin/admin/src/translations/fr.json +0 -0
- /package/{lib → dist}/files/js/plugin/admin/src/utils/getTrad.js +0 -0
- /package/{lib → dist}/files/js/plugin/server/bootstrap.js +0 -0
- /package/{lib → dist}/files/js/plugin/server/config/index.js +0 -0
- /package/{lib → dist}/files/js/plugin/server/content-types/index.js +0 -0
- /package/{lib → dist}/files/js/plugin/server/controllers/index.js +0 -0
- /package/{lib → dist}/files/js/plugin/server/controllers/my-controller.js.hbs +0 -0
- /package/{lib → dist}/files/js/plugin/server/destroy.js +0 -0
- /package/{lib → dist}/files/js/plugin/server/index.js +0 -0
- /package/{lib → dist}/files/js/plugin/server/middlewares/index.js +0 -0
- /package/{lib → dist}/files/js/plugin/server/policies/index.js +0 -0
- /package/{lib → dist}/files/js/plugin/server/routes/index.js +0 -0
- /package/{lib → dist}/files/js/plugin/server/services/index.js +0 -0
- /package/{lib → dist}/files/js/plugin/server/services/my-service.js +0 -0
- /package/{lib → dist}/files/js/plugin/strapi-admin.js +0 -0
- /package/{lib → dist}/files/js/plugin/strapi-server.js +0 -0
- /package/{lib → dist}/files/ts/plugin/admin/src/components/Initializer/index.tsx +0 -0
- /package/{lib → dist}/files/ts/plugin/admin/src/components/PluginIcon/index.tsx +0 -0
- /package/{lib → dist}/files/ts/plugin/admin/src/pages/App/index.tsx +0 -0
- /package/{lib → dist}/files/ts/plugin/admin/src/pages/HomePage/index.tsx +0 -0
- /package/{lib → dist}/files/ts/plugin/admin/src/pluginId.ts +0 -0
- /package/{lib → dist}/files/ts/plugin/admin/src/translations/en.json +0 -0
- /package/{lib → dist}/files/ts/plugin/admin/src/translations/fr.json +0 -0
- /package/{lib → dist}/files/ts/plugin/admin/src/utils/getTrad.ts +0 -0
- /package/{lib → dist}/files/ts/plugin/custom.d.ts +0 -0
- /package/{lib → dist}/files/ts/plugin/server/bootstrap.ts +0 -0
- /package/{lib → dist}/files/ts/plugin/server/config/index.ts +0 -0
- /package/{lib → dist}/files/ts/plugin/server/content-types/index.ts +0 -0
- /package/{lib → dist}/files/ts/plugin/server/controllers/index.ts +0 -0
- /package/{lib → dist}/files/ts/plugin/server/controllers/my-controller.ts.hbs +0 -0
- /package/{lib → dist}/files/ts/plugin/server/destroy.ts +0 -0
- /package/{lib → dist}/files/ts/plugin/server/index.ts +0 -0
- /package/{lib → dist}/files/ts/plugin/server/middlewares/index.ts +0 -0
- /package/{lib → dist}/files/ts/plugin/server/policies/index.ts +0 -0
- /package/{lib → dist}/files/ts/plugin/server/routes/index.ts +0 -0
- /package/{lib → dist}/files/ts/plugin/server/services/index.ts +0 -0
- /package/{lib → dist}/files/ts/plugin/server/services/my-service.ts +0 -0
- /package/{lib → dist}/files/ts/plugin/strapi-admin.js +0 -0
- /package/{lib → dist}/files/ts/plugin/strapi-server.js +0 -0
- /package/{lib → dist}/files/ts/plugin/tsconfig.json +0 -0
- /package/{lib → dist}/files/ts/plugin/tsconfig.server.json +0 -0
- /package/{lib → dist}/templates/js/README.md.hbs +0 -0
- /package/{lib → dist}/templates/js/collection-type-routes.js.hbs +0 -0
- /package/{lib → dist}/templates/js/content-type.schema.json.hbs +0 -0
- /package/{lib → dist}/templates/js/controller.js.hbs +0 -0
- /package/{lib → dist}/templates/js/core-controller.js.hbs +0 -0
- /package/{lib → dist}/templates/js/core-router.js.hbs +0 -0
- /package/{lib → dist}/templates/js/core-service.js.hbs +0 -0
- /package/{lib → dist}/templates/js/middleware.js.hbs +0 -0
- /package/{lib → dist}/templates/js/migration.js.hbs +0 -0
- /package/{lib → dist}/templates/js/policy.js.hbs +0 -0
- /package/{lib → dist}/templates/js/service.js.hbs +0 -0
- /package/{lib → dist}/templates/js/single-route.js.hbs +0 -0
- /package/{lib → dist}/templates/js/single-type-routes.js.hbs +0 -0
- /package/{lib → dist}/templates/ts/README.md.hbs +0 -0
- /package/{lib → dist}/templates/ts/collection-type-routes.ts.hbs +0 -0
- /package/{lib → dist}/templates/ts/content-type.schema.json.hbs +0 -0
- /package/{lib → dist}/templates/ts/controller.ts.hbs +0 -0
- /package/{lib → dist}/templates/ts/core-controller.ts.hbs +0 -0
- /package/{lib → dist}/templates/ts/core-router.ts.hbs +0 -0
- /package/{lib → dist}/templates/ts/core-service.ts.hbs +0 -0
- /package/{lib → dist}/templates/ts/middleware.ts.hbs +0 -0
- /package/{lib → dist}/templates/ts/migration.ts.hbs +0 -0
- /package/{lib → dist}/templates/ts/policy.ts.hbs +0 -0
- /package/{lib → dist}/templates/ts/service.ts.hbs +0 -0
- /package/{lib → dist}/templates/ts/single-route.ts.hbs +0 -0
- /package/{lib → dist}/templates/ts/single-type-routes.ts.hbs +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# From https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes
|
|
2
|
+
|
|
3
|
+
# Handle line endings automatically for files detected as text
|
|
4
|
+
# and leave all files detected as binary untouched.
|
|
5
|
+
* text=auto
|
|
6
|
+
|
|
7
|
+
#
|
|
8
|
+
# The above will handle all files NOT found below
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
#
|
|
12
|
+
## These files are text and should be normalized (Convert crlf => lf)
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
# source code
|
|
16
|
+
*.php text
|
|
17
|
+
*.css text
|
|
18
|
+
*.sass text
|
|
19
|
+
*.scss text
|
|
20
|
+
*.less text
|
|
21
|
+
*.styl text
|
|
22
|
+
*.js text eol=lf
|
|
23
|
+
*.coffee text
|
|
24
|
+
*.json text
|
|
25
|
+
*.htm text
|
|
26
|
+
*.html text
|
|
27
|
+
*.xml text
|
|
28
|
+
*.svg text
|
|
29
|
+
*.txt text
|
|
30
|
+
*.ini text
|
|
31
|
+
*.inc text
|
|
32
|
+
*.pl text
|
|
33
|
+
*.rb text
|
|
34
|
+
*.py text
|
|
35
|
+
*.scm text
|
|
36
|
+
*.sql text
|
|
37
|
+
*.sh text
|
|
38
|
+
*.bat text
|
|
39
|
+
|
|
40
|
+
# templates
|
|
41
|
+
*.ejs text
|
|
42
|
+
*.hbt text
|
|
43
|
+
*.jade text
|
|
44
|
+
*.haml text
|
|
45
|
+
*.hbs text
|
|
46
|
+
*.dot text
|
|
47
|
+
*.tmpl text
|
|
48
|
+
*.phtml text
|
|
49
|
+
|
|
50
|
+
# git config
|
|
51
|
+
.gitattributes text
|
|
52
|
+
.gitignore text
|
|
53
|
+
.gitconfig text
|
|
54
|
+
|
|
55
|
+
# code analysis config
|
|
56
|
+
.jshintrc text
|
|
57
|
+
.jscsrc text
|
|
58
|
+
.jshintignore text
|
|
59
|
+
.csslintrc text
|
|
60
|
+
|
|
61
|
+
# misc config
|
|
62
|
+
*.yaml text
|
|
63
|
+
*.yml text
|
|
64
|
+
.editorconfig text
|
|
65
|
+
|
|
66
|
+
# build config
|
|
67
|
+
*.npmignore text
|
|
68
|
+
*.bowerrc text
|
|
69
|
+
|
|
70
|
+
# Heroku
|
|
71
|
+
Procfile text
|
|
72
|
+
.slugignore text
|
|
73
|
+
|
|
74
|
+
# Documentation
|
|
75
|
+
*.md text
|
|
76
|
+
LICENSE text
|
|
77
|
+
AUTHORS text
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
#
|
|
81
|
+
## These files are binary and should be left untouched
|
|
82
|
+
#
|
|
83
|
+
|
|
84
|
+
# (binary is a macro for -text -diff)
|
|
85
|
+
*.png binary
|
|
86
|
+
*.jpg binary
|
|
87
|
+
*.jpeg binary
|
|
88
|
+
*.gif binary
|
|
89
|
+
*.ico binary
|
|
90
|
+
*.mov binary
|
|
91
|
+
*.mp4 binary
|
|
92
|
+
*.mp3 binary
|
|
93
|
+
*.flv binary
|
|
94
|
+
*.fla binary
|
|
95
|
+
*.swf binary
|
|
96
|
+
*.gz binary
|
|
97
|
+
*.zip binary
|
|
98
|
+
*.7z binary
|
|
99
|
+
*.ttf binary
|
|
100
|
+
*.eot binary
|
|
101
|
+
*.woff binary
|
|
102
|
+
*.pyc binary
|
|
103
|
+
*.pdf binary
|
|
@@ -16,7 +16,7 @@ export default {
|
|
|
16
16
|
defaultMessage: name,
|
|
17
17
|
},
|
|
18
18
|
Component: async () => {
|
|
19
|
-
const component = await import(
|
|
19
|
+
const component = await import('./pages/App');
|
|
20
20
|
|
|
21
21
|
return component;
|
|
22
22
|
},
|
|
@@ -40,9 +40,7 @@ export default {
|
|
|
40
40
|
async registerTrads({ locales }) {
|
|
41
41
|
const importedTrads = await Promise.all(
|
|
42
42
|
locales.map((locale) => {
|
|
43
|
-
return import(
|
|
44
|
-
/* webpackChunkName: "translation-[request]" */ `./translations/${locale}.json`
|
|
45
|
-
)
|
|
43
|
+
return import(`./translations/${locale}.json`)
|
|
46
44
|
.then(({ default: data }) => {
|
|
47
45
|
return {
|
|
48
46
|
data: prefixPluginTranslations(data, pluginId),
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# From https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes
|
|
2
|
+
|
|
3
|
+
# Handle line endings automatically for files detected as text
|
|
4
|
+
# and leave all files detected as binary untouched.
|
|
5
|
+
* text=auto
|
|
6
|
+
|
|
7
|
+
#
|
|
8
|
+
# The above will handle all files NOT found below
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
#
|
|
12
|
+
## These files are text and should be normalized (Convert crlf => lf)
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
# source code
|
|
16
|
+
*.php text
|
|
17
|
+
*.css text
|
|
18
|
+
*.sass text
|
|
19
|
+
*.scss text
|
|
20
|
+
*.less text
|
|
21
|
+
*.styl text
|
|
22
|
+
*.js text eol=lf
|
|
23
|
+
*.coffee text
|
|
24
|
+
*.json text
|
|
25
|
+
*.htm text
|
|
26
|
+
*.html text
|
|
27
|
+
*.xml text
|
|
28
|
+
*.svg text
|
|
29
|
+
*.txt text
|
|
30
|
+
*.ini text
|
|
31
|
+
*.inc text
|
|
32
|
+
*.pl text
|
|
33
|
+
*.rb text
|
|
34
|
+
*.py text
|
|
35
|
+
*.scm text
|
|
36
|
+
*.sql text
|
|
37
|
+
*.sh text
|
|
38
|
+
*.bat text
|
|
39
|
+
|
|
40
|
+
# templates
|
|
41
|
+
*.ejs text
|
|
42
|
+
*.hbt text
|
|
43
|
+
*.jade text
|
|
44
|
+
*.haml text
|
|
45
|
+
*.hbs text
|
|
46
|
+
*.dot text
|
|
47
|
+
*.tmpl text
|
|
48
|
+
*.phtml text
|
|
49
|
+
|
|
50
|
+
# git config
|
|
51
|
+
.gitattributes text
|
|
52
|
+
.gitignore text
|
|
53
|
+
.gitconfig text
|
|
54
|
+
|
|
55
|
+
# code analysis config
|
|
56
|
+
.jshintrc text
|
|
57
|
+
.jscsrc text
|
|
58
|
+
.jshintignore text
|
|
59
|
+
.csslintrc text
|
|
60
|
+
|
|
61
|
+
# misc config
|
|
62
|
+
*.yaml text
|
|
63
|
+
*.yml text
|
|
64
|
+
.editorconfig text
|
|
65
|
+
|
|
66
|
+
# build config
|
|
67
|
+
*.npmignore text
|
|
68
|
+
*.bowerrc text
|
|
69
|
+
|
|
70
|
+
# Heroku
|
|
71
|
+
Procfile text
|
|
72
|
+
.slugignore text
|
|
73
|
+
|
|
74
|
+
# Documentation
|
|
75
|
+
*.md text
|
|
76
|
+
LICENSE text
|
|
77
|
+
AUTHORS text
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
#
|
|
81
|
+
## These files are binary and should be left untouched
|
|
82
|
+
#
|
|
83
|
+
|
|
84
|
+
# (binary is a macro for -text -diff)
|
|
85
|
+
*.png binary
|
|
86
|
+
*.jpg binary
|
|
87
|
+
*.jpeg binary
|
|
88
|
+
*.gif binary
|
|
89
|
+
*.ico binary
|
|
90
|
+
*.mov binary
|
|
91
|
+
*.mp4 binary
|
|
92
|
+
*.mp3 binary
|
|
93
|
+
*.flv binary
|
|
94
|
+
*.fla binary
|
|
95
|
+
*.swf binary
|
|
96
|
+
*.gz binary
|
|
97
|
+
*.zip binary
|
|
98
|
+
*.7z binary
|
|
99
|
+
*.ttf binary
|
|
100
|
+
*.eot binary
|
|
101
|
+
*.woff binary
|
|
102
|
+
*.pyc binary
|
|
103
|
+
*.pdf binary
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,MAAM,YAKlB,CAAC;AAGF,eAAO,MAAM,QAAQ,kBACJ,MAAM,WACZ,OAAO;;;mBAcjB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const node_path = require("node:path");
|
|
4
|
+
const plop = require("plop");
|
|
5
|
+
const nodePlop = require("node-plop");
|
|
6
|
+
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
7
|
+
const nodePlop__default = /* @__PURE__ */ _interopDefault(nodePlop);
|
|
8
|
+
const runCLI = () => {
|
|
9
|
+
plop.Plop.launch({ configPath: node_path.join(__dirname, "plopfile.js") }, (env) => {
|
|
10
|
+
const options = { ...env, dest: node_path.join(process.cwd(), "src") };
|
|
11
|
+
plop.run(options, void 0, true);
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
const generate = async (generatorName, options, { dir = process.cwd(), plopFile = "plopfile.js" } = {}) => {
|
|
15
|
+
const plop2 = nodePlop__default.default(node_path.join(__dirname, plopFile), {
|
|
16
|
+
destBasePath: node_path.join(dir, "src"),
|
|
17
|
+
force: false
|
|
18
|
+
});
|
|
19
|
+
const generator = plop2.getGenerator(generatorName);
|
|
20
|
+
await generator.runActions(options, {
|
|
21
|
+
onSuccess() {
|
|
22
|
+
},
|
|
23
|
+
onFailure() {
|
|
24
|
+
},
|
|
25
|
+
onComment() {
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
exports.generate = generate;
|
|
30
|
+
exports.runCLI = runCLI;
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { Plop, run } from 'plop';\nimport nodePlop from 'node-plop';\n\n// Starts the Plop CLI programmatically\nexport const runCLI = () => {\n Plop.launch({ configPath: join(__dirname, 'plopfile.js') }, (env) => {\n const options = { ...env, dest: join(process.cwd(), 'src') };\n run(options, undefined, true);\n });\n};\n\n// Runs a generator programmatically without prompts\nexport const generate = async (\n generatorName: string,\n options: unknown,\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, {\n onSuccess() {},\n onFailure() {},\n onComment() {},\n });\n};\n"],"names":["Plop","join","run","plop","nodePlop"],"mappings":";;;;;;;AAKO,MAAM,SAAS,MAAM;AACrBA,YAAA,OAAO,EAAE,YAAYC,UAAAA,KAAK,WAAW,aAAa,KAAK,CAAC,QAAQ;AAC7D,UAAA,UAAU,EAAE,GAAG,KAAK,MAAMA,eAAK,QAAQ,IAAA,GAAO,KAAK;AACrDC,SAAAA,IAAA,SAAS,QAAW,IAAI;AAAA,EAAA,CAC7B;AACH;AAGO,MAAM,WAAW,OACtB,eACA,SACA,EAAE,MAAM,QAAQ,OAAO,WAAW,cAAc,IAAI,CAAA,MACjD;AACH,QAAMC,QAAOC,kBAAA,QAASH,UAAK,KAAA,WAAW,QAAQ,GAAG;AAAA,IAC/C,cAAcA,UAAAA,KAAK,KAAK,KAAK;AAAA,IAC7B,OAAO;AAAA,EAAA,CACR;AAEK,QAAA,YAAYE,MAAK,aAAa,aAAa;AAC3C,QAAA,UAAU,WAAW,SAAS;AAAA,IAClC,YAAY;AAAA,IAAC;AAAA,IACb,YAAY;AAAA,IAAC;AAAA,IACb,YAAY;AAAA,IAAC;AAAA,EAAA,CACd;AACH;;;"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { Plop, run } from "plop";
|
|
3
|
+
import nodePlop from "node-plop";
|
|
4
|
+
const runCLI = () => {
|
|
5
|
+
Plop.launch({ configPath: join(__dirname, "plopfile.js") }, (env) => {
|
|
6
|
+
const options = { ...env, dest: join(process.cwd(), "src") };
|
|
7
|
+
run(options, void 0, true);
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
const generate = async (generatorName, options, { dir = process.cwd(), plopFile = "plopfile.js" } = {}) => {
|
|
11
|
+
const plop = nodePlop(join(__dirname, plopFile), {
|
|
12
|
+
destBasePath: join(dir, "src"),
|
|
13
|
+
force: false
|
|
14
|
+
});
|
|
15
|
+
const generator = plop.getGenerator(generatorName);
|
|
16
|
+
await generator.runActions(options, {
|
|
17
|
+
onSuccess() {
|
|
18
|
+
},
|
|
19
|
+
onFailure() {
|
|
20
|
+
},
|
|
21
|
+
onComment() {
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
generate,
|
|
27
|
+
runCLI
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { Plop, run } from 'plop';\nimport nodePlop from 'node-plop';\n\n// Starts the Plop CLI programmatically\nexport const runCLI = () => {\n Plop.launch({ configPath: join(__dirname, 'plopfile.js') }, (env) => {\n const options = { ...env, dest: join(process.cwd(), 'src') };\n run(options, undefined, true);\n });\n};\n\n// Runs a generator programmatically without prompts\nexport const generate = async (\n generatorName: string,\n options: unknown,\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, {\n onSuccess() {},\n onFailure() {},\n onComment() {},\n });\n};\n"],"names":[],"mappings":";;;AAKO,MAAM,SAAS,MAAM;AACrB,OAAA,OAAO,EAAE,YAAY,KAAK,WAAW,aAAa,KAAK,CAAC,QAAQ;AAC7D,UAAA,UAAU,EAAE,GAAG,KAAK,MAAM,KAAK,QAAQ,IAAA,GAAO,KAAK;AACrD,QAAA,SAAS,QAAW,IAAI;AAAA,EAAA,CAC7B;AACH;AAGO,MAAM,WAAW,OACtB,eACA,SACA,EAAE,MAAM,QAAQ,OAAO,WAAW,cAAc,IAAI,CAAA,MACjD;AACH,QAAM,OAAO,SAAS,KAAK,WAAW,QAAQ,GAAG;AAAA,IAC/C,cAAc,KAAK,KAAK,KAAK;AAAA,IAC7B,OAAO;AAAA,EAAA,CACR;AAEK,QAAA,YAAY,KAAK,aAAa,aAAa;AAC3C,QAAA,UAAU,WAAW,SAAS;AAAA,IAClC,YAAY;AAAA,IAAC;AAAA,IACb,YAAY;AAAA,IAAC;AAAA,IACb,YAAY;AAAA,IAAC;AAAA,EAAA,CACd;AACH;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plopfile.d.ts","sourceRoot":"","sources":["../src/plopfile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;+BAWb,WAAW;AAAjC,wBAcE"}
|