@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","sources":["../../src/plops/service.ts"],"sourcesContent":["import type { NodePlopAPI } from 'plop';\nimport tsUtils from '@strapi/typescript-utils';\n\nimport getDestinationPrompts from './prompts/get-destination-prompts';\nimport getFilePath from './utils/get-file-path';\n\nexport default (plop: NodePlopAPI) => {\n // Service generator\n plop.setGenerator('service', {\n description: 'Generate a service for an API',\n prompts: [\n {\n type: 'input',\n name: 'id',\n message: 'Service name',\n },\n ...getDestinationPrompts('service', plop.getDestBasePath()),\n ],\n actions(answers) {\n if (!answers) {\n return [];\n }\n\n const filePath = getFilePath(answers?.destination);\n const currentDir = process.cwd();\n const language = tsUtils.isUsingTypeScriptSync(currentDir) ? 'ts' : 'js';\n\n return [\n {\n type: 'add',\n path: `${filePath}/services/{{ id }}.${language}`,\n templateFile: `templates/${language}/service.${language}.hbs`,\n },\n ];\n },\n });\n};\n"],"names":["plop","setGenerator","description","prompts","type","name","message","getDestinationPrompts","getDestBasePath","actions","answers","filePath","getFilePath","destination","currentDir","process","cwd","language","tsUtils","isUsingTypeScriptSync","path","templateFile"],"mappings":";;;;;;AAMA,sBAAe,CAAA,CAACA,IAAAA,GAAAA;;IAEdA,IAAKC,CAAAA,YAAY,CAAC,SAAW,EAAA;QAC3BC,WAAa,EAAA,+BAAA;QACbC,OAAS,EAAA;AACP,YAAA;gBACEC,IAAM,EAAA,OAAA;gBACNC,IAAM,EAAA,IAAA;gBACNC,OAAS,EAAA;AACX,aAAA;eACGC,qBAAsB,CAAA,SAAA,EAAWP,KAAKQ,eAAe,EAAA;AACzD,SAAA;AACDC,QAAAA,OAAAA,CAAAA,CAAQC,OAAO,EAAA;AACb,YAAA,IAAI,CAACA,OAAS,EAAA;AACZ,gBAAA,OAAO,EAAE;AACX;YAEA,MAAMC,QAAAA,GAAWC,YAAYF,OAASG,EAAAA,WAAAA,CAAAA;YACtC,MAAMC,UAAAA,GAAaC,QAAQC,GAAG,EAAA;AAC9B,YAAA,MAAMC,QAAWC,GAAAA,OAAAA,CAAQC,qBAAqB,CAACL,cAAc,IAAO,GAAA,IAAA;YAEpE,OAAO;AACL,gBAAA;oBACEV,IAAM,EAAA,KAAA;AACNgB,oBAAAA,IAAAA,EAAM,CAAC,EAAET,QAAAA,CAAS,mBAAmB,EAAEM,SAAS,CAAC;oBACjDI,YAAc,EAAA,CAAC,UAAU,EAAEJ,QAAAA,CAAS,SAAS,EAAEA,QAAAA,CAAS,IAAI;AAC9D;AACD,aAAA;AACH;AACF,KAAA,CAAA;AACF,CAAA;;;;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import tsUtils from '@strapi/typescript-utils';
|
|
2
|
+
import getDestinationPrompts from './prompts/get-destination-prompts.mjs';
|
|
3
|
+
import getFilePath from './utils/get-file-path.mjs';
|
|
4
|
+
|
|
5
|
+
var generateService = ((plop)=>{
|
|
6
|
+
// Service generator
|
|
7
|
+
plop.setGenerator('service', {
|
|
8
|
+
description: 'Generate a service for an API',
|
|
9
|
+
prompts: [
|
|
10
|
+
{
|
|
11
|
+
type: 'input',
|
|
12
|
+
name: 'id',
|
|
13
|
+
message: 'Service name'
|
|
14
|
+
},
|
|
15
|
+
...getDestinationPrompts('service', plop.getDestBasePath())
|
|
16
|
+
],
|
|
17
|
+
actions (answers) {
|
|
18
|
+
if (!answers) {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
const filePath = getFilePath(answers?.destination);
|
|
22
|
+
const currentDir = process.cwd();
|
|
23
|
+
const language = tsUtils.isUsingTypeScriptSync(currentDir) ? 'ts' : 'js';
|
|
24
|
+
return [
|
|
25
|
+
{
|
|
26
|
+
type: 'add',
|
|
27
|
+
path: `${filePath}/services/{{ id }}.${language}`,
|
|
28
|
+
templateFile: `templates/${language}/service.${language}.hbs`
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export { generateService as default };
|
|
36
|
+
//# sourceMappingURL=service.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.mjs","sources":["../../src/plops/service.ts"],"sourcesContent":["import type { NodePlopAPI } from 'plop';\nimport tsUtils from '@strapi/typescript-utils';\n\nimport getDestinationPrompts from './prompts/get-destination-prompts';\nimport getFilePath from './utils/get-file-path';\n\nexport default (plop: NodePlopAPI) => {\n // Service generator\n plop.setGenerator('service', {\n description: 'Generate a service for an API',\n prompts: [\n {\n type: 'input',\n name: 'id',\n message: 'Service name',\n },\n ...getDestinationPrompts('service', plop.getDestBasePath()),\n ],\n actions(answers) {\n if (!answers) {\n return [];\n }\n\n const filePath = getFilePath(answers?.destination);\n const currentDir = process.cwd();\n const language = tsUtils.isUsingTypeScriptSync(currentDir) ? 'ts' : 'js';\n\n return [\n {\n type: 'add',\n path: `${filePath}/services/{{ id }}.${language}`,\n templateFile: `templates/${language}/service.${language}.hbs`,\n },\n ];\n },\n });\n};\n"],"names":["plop","setGenerator","description","prompts","type","name","message","getDestinationPrompts","getDestBasePath","actions","answers","filePath","getFilePath","destination","currentDir","process","cwd","language","tsUtils","isUsingTypeScriptSync","path","templateFile"],"mappings":";;;;AAMA,sBAAe,CAAA,CAACA,IAAAA,GAAAA;;IAEdA,IAAKC,CAAAA,YAAY,CAAC,SAAW,EAAA;QAC3BC,WAAa,EAAA,+BAAA;QACbC,OAAS,EAAA;AACP,YAAA;gBACEC,IAAM,EAAA,OAAA;gBACNC,IAAM,EAAA,IAAA;gBACNC,OAAS,EAAA;AACX,aAAA;eACGC,qBAAsB,CAAA,SAAA,EAAWP,KAAKQ,eAAe,EAAA;AACzD,SAAA;AACDC,QAAAA,OAAAA,CAAAA,CAAQC,OAAO,EAAA;AACb,YAAA,IAAI,CAACA,OAAS,EAAA;AACZ,gBAAA,OAAO,EAAE;AACX;YAEA,MAAMC,QAAAA,GAAWC,YAAYF,OAASG,EAAAA,WAAAA,CAAAA;YACtC,MAAMC,UAAAA,GAAaC,QAAQC,GAAG,EAAA;AAC9B,YAAA,MAAMC,QAAWC,GAAAA,OAAAA,CAAQC,qBAAqB,CAACL,cAAc,IAAO,GAAA,IAAA;YAEpE,OAAO;AACL,gBAAA;oBACEV,IAAM,EAAA,KAAA;AACNgB,oBAAAA,IAAAA,EAAM,CAAC,EAAET,QAAAA,CAAS,mBAAmB,EAAEM,SAAS,CAAC;oBACjDI,YAAc,EAAA,CAAC,UAAU,EAAEJ,QAAAA,CAAS,SAAS,EAAEA,QAAAA,CAAS,IAAI;AAC9D;AACD,aAAA;AACH;AACF,KAAA,CAAA;AACF,CAAA;;;;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const _default: (destination: string) => "
|
|
1
|
+
declare const _default: (destination: string) => "plugins/{{ plugin }}/server" | "api/{{ id }}" | "api/{{ api }}" | "./";
|
|
2
2
|
export default _default;
|
|
3
3
|
//# sourceMappingURL=get-file-path.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var getFilePath = ((destination)=>{
|
|
4
|
+
if (destination === 'api') {
|
|
5
|
+
return `api/{{ api }}`;
|
|
6
|
+
}
|
|
7
|
+
if (destination === 'plugin') {
|
|
8
|
+
return `plugins/{{ plugin }}/server`;
|
|
9
|
+
}
|
|
10
|
+
if (destination === 'root') {
|
|
11
|
+
return './';
|
|
12
|
+
}
|
|
13
|
+
return `api/{{ id }}`;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
module.exports = getFilePath;
|
|
17
|
+
//# sourceMappingURL=get-file-path.js.map
|
|
@@ -0,0 +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 './';\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,2BAA2B,CAAC;AACtC;AAEA,IAAA,IAAIA,gBAAgB,MAAQ,EAAA;QAC1B,OAAO,IAAA;AACT;IAEA,OAAO,CAAC,YAAY,CAAC;AACvB,CAAA;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var getFilePath = ((destination)=>{
|
|
2
|
+
if (destination === 'api') {
|
|
3
|
+
return `api/{{ api }}`;
|
|
4
|
+
}
|
|
5
|
+
if (destination === 'plugin') {
|
|
6
|
+
return `plugins/{{ plugin }}/server`;
|
|
7
|
+
}
|
|
8
|
+
if (destination === 'root') {
|
|
9
|
+
return './';
|
|
10
|
+
}
|
|
11
|
+
return `api/{{ id }}`;
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { getFilePath as default };
|
|
15
|
+
//# sourceMappingURL=get-file-path.mjs.map
|
|
@@ -0,0 +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 './';\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,2BAA2B,CAAC;AACtC;AAEA,IAAA,IAAIA,gBAAgB,MAAQ,EAAA;QAC1B,OAAO,IAAA;AACT;IAEA,OAAO,CAAC,YAAY,CAAC;AACvB,CAAA;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var getFormattedDate = ((date = new Date())=>{
|
|
4
|
+
return new Date(date.getTime() - date.getTimezoneOffset() * 60000).toJSON().replace(/[-:]/g, '.').replace(/\....Z/, '');
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
module.exports = getFormattedDate;
|
|
8
|
+
//# sourceMappingURL=get-formatted-date.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-formatted-date.js","sources":["../../../src/plops/utils/get-formatted-date.ts"],"sourcesContent":["export default (date: Date = new Date()) => {\n return new Date(date.getTime() - date.getTimezoneOffset() * 60000)\n .toJSON()\n .replace(/[-:]/g, '.')\n .replace(/\\....Z/, '');\n};\n"],"names":["date","Date","getTime","getTimezoneOffset","toJSON","replace"],"mappings":";;AAAA,uBAAe,CAAA,CAACA,IAAa,GAAA,IAAIC,IAAM,EAAA,GAAA;AACrC,IAAA,OAAO,IAAIA,IAAKD,CAAAA,IAAAA,CAAKE,OAAO,EAAA,GAAKF,KAAKG,iBAAiB,EAAA,GAAK,KACzDC,CAAAA,CAAAA,MAAM,GACNC,OAAO,CAAC,SAAS,GACjBA,CAAAA,CAAAA,OAAO,CAAC,QAAU,EAAA,EAAA,CAAA;AACvB,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-formatted-date.mjs","sources":["../../../src/plops/utils/get-formatted-date.ts"],"sourcesContent":["export default (date: Date = new Date()) => {\n return new Date(date.getTime() - date.getTimezoneOffset() * 60000)\n .toJSON()\n .replace(/[-:]/g, '.')\n .replace(/\\....Z/, '');\n};\n"],"names":["date","Date","getTime","getTimezoneOffset","toJSON","replace"],"mappings":"AAAA,uBAAe,CAAA,CAACA,IAAa,GAAA,IAAIC,IAAM,EAAA,GAAA;AACrC,IAAA,OAAO,IAAIA,IAAKD,CAAAA,IAAAA,CAAKE,OAAO,EAAA,GAAKF,KAAKG,iBAAiB,EAAA,GAAK,KACzDC,CAAAA,CAAAA,MAAM,GACNC,OAAO,CAAC,SAAS,GACjBA,CAAAA,CAAAA,OAAO,CAAC,QAAU,EAAA,EAAA,CAAA;AACvB,CAAA;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var validateAttributeInput = ((input)=>{
|
|
4
|
+
const regex = /^[A-Za-z-|_]+$/g;
|
|
5
|
+
if (!input) {
|
|
6
|
+
return 'You must provide an input';
|
|
7
|
+
}
|
|
8
|
+
return regex.test(input) || "Please use only letters, '-', '_', and no spaces";
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = validateAttributeInput;
|
|
12
|
+
//# sourceMappingURL=validate-attribute-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-attribute-input.js","sources":["../../../src/plops/utils/validate-attribute-input.ts"],"sourcesContent":["export default (input: string) => {\n const regex = /^[A-Za-z-|_]+$/g;\n\n if (!input) {\n return 'You must provide an input';\n }\n\n return regex.test(input) || \"Please use only letters, '-', '_', and no spaces\";\n};\n"],"names":["input","regex","test"],"mappings":";;AAAA,6BAAe,CAAA,CAACA,KAAAA,GAAAA;AACd,IAAA,MAAMC,KAAQ,GAAA,iBAAA;AAEd,IAAA,IAAI,CAACD,KAAO,EAAA;QACV,OAAO,2BAAA;AACT;IAEA,OAAOC,KAAAA,CAAMC,IAAI,CAACF,KAAU,CAAA,IAAA,mDAAA;AAC9B,CAAA;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var validateAttributeInput = ((input)=>{
|
|
2
|
+
const regex = /^[A-Za-z-|_]+$/g;
|
|
3
|
+
if (!input) {
|
|
4
|
+
return 'You must provide an input';
|
|
5
|
+
}
|
|
6
|
+
return regex.test(input) || "Please use only letters, '-', '_', and no spaces";
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export { validateAttributeInput as default };
|
|
10
|
+
//# sourceMappingURL=validate-attribute-input.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-attribute-input.mjs","sources":["../../../src/plops/utils/validate-attribute-input.ts"],"sourcesContent":["export default (input: string) => {\n const regex = /^[A-Za-z-|_]+$/g;\n\n if (!input) {\n return 'You must provide an input';\n }\n\n return regex.test(input) || \"Please use only letters, '-', '_', and no spaces\";\n};\n"],"names":["input","regex","test"],"mappings":"AAAA,6BAAe,CAAA,CAACA,KAAAA,GAAAA;AACd,IAAA,MAAMC,KAAQ,GAAA,iBAAA;AAEd,IAAA,IAAI,CAACD,KAAO,EAAA;QACV,OAAO,2BAAA;AACT;IAEA,OAAOC,KAAAA,CAAMC,IAAI,CAACF,KAAU,CAAA,IAAA,mDAAA;AAC9B,CAAA;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var validateFileNameInput = ((input)=>{
|
|
4
|
+
const regex = /^[A-Za-z-_0-9]+$/g;
|
|
5
|
+
if (!input) {
|
|
6
|
+
return 'You must provide an input';
|
|
7
|
+
}
|
|
8
|
+
return regex.test(input) || "Please use only letters and number, '-' or '_' and no spaces";
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = validateFileNameInput;
|
|
12
|
+
//# sourceMappingURL=validate-file-name-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-file-name-input.js","sources":["../../../src/plops/utils/validate-file-name-input.ts"],"sourcesContent":["export default (input: string) => {\n const regex = /^[A-Za-z-_0-9]+$/g;\n\n if (!input) {\n return 'You must provide an input';\n }\n\n return regex.test(input) || \"Please use only letters and number, '-' or '_' and no spaces\";\n};\n"],"names":["input","regex","test"],"mappings":";;AAAA,4BAAe,CAAA,CAACA,KAAAA,GAAAA;AACd,IAAA,MAAMC,KAAQ,GAAA,mBAAA;AAEd,IAAA,IAAI,CAACD,KAAO,EAAA;QACV,OAAO,2BAAA;AACT;IAEA,OAAOC,KAAAA,CAAMC,IAAI,CAACF,KAAU,CAAA,IAAA,8DAAA;AAC9B,CAAA;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var validateFileNameInput = ((input)=>{
|
|
2
|
+
const regex = /^[A-Za-z-_0-9]+$/g;
|
|
3
|
+
if (!input) {
|
|
4
|
+
return 'You must provide an input';
|
|
5
|
+
}
|
|
6
|
+
return regex.test(input) || "Please use only letters and number, '-' or '_' and no spaces";
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export { validateFileNameInput as default };
|
|
10
|
+
//# sourceMappingURL=validate-file-name-input.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-file-name-input.mjs","sources":["../../../src/plops/utils/validate-file-name-input.ts"],"sourcesContent":["export default (input: string) => {\n const regex = /^[A-Za-z-_0-9]+$/g;\n\n if (!input) {\n return 'You must provide an input';\n }\n\n return regex.test(input) || \"Please use only letters and number, '-' or '_' and no spaces\";\n};\n"],"names":["input","regex","test"],"mappings":"AAAA,4BAAe,CAAA,CAACA,KAAAA,GAAAA;AACd,IAAA,MAAMC,KAAQ,GAAA,mBAAA;AAEd,IAAA,IAAI,CAACD,KAAO,EAAA;QACV,OAAO,2BAAA;AACT;IAEA,OAAOC,KAAAA,CAAMC,IAAI,CAACF,KAAU,CAAA,IAAA,8DAAA;AAC9B,CAAA;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var validateInput = ((input)=>{
|
|
4
|
+
const regex = /^[A-Za-z-]+$/g;
|
|
5
|
+
if (!input) {
|
|
6
|
+
return 'You must provide an input';
|
|
7
|
+
}
|
|
8
|
+
return regex.test(input) || "Please use only letters, '-' and no spaces";
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = validateInput;
|
|
12
|
+
//# sourceMappingURL=validate-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-input.js","sources":["../../../src/plops/utils/validate-input.ts"],"sourcesContent":["export default (input: string) => {\n const regex = /^[A-Za-z-]+$/g;\n\n if (!input) {\n return 'You must provide an input';\n }\n\n return regex.test(input) || \"Please use only letters, '-' and no spaces\";\n};\n"],"names":["input","regex","test"],"mappings":";;AAAA,oBAAe,CAAA,CAACA,KAAAA,GAAAA;AACd,IAAA,MAAMC,KAAQ,GAAA,eAAA;AAEd,IAAA,IAAI,CAACD,KAAO,EAAA;QACV,OAAO,2BAAA;AACT;IAEA,OAAOC,KAAAA,CAAMC,IAAI,CAACF,KAAU,CAAA,IAAA,4CAAA;AAC9B,CAAA;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var validateInput = ((input)=>{
|
|
2
|
+
const regex = /^[A-Za-z-]+$/g;
|
|
3
|
+
if (!input) {
|
|
4
|
+
return 'You must provide an input';
|
|
5
|
+
}
|
|
6
|
+
return regex.test(input) || "Please use only letters, '-' and no spaces";
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export { validateInput as default };
|
|
10
|
+
//# sourceMappingURL=validate-input.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-input.mjs","sources":["../../../src/plops/utils/validate-input.ts"],"sourcesContent":["export default (input: string) => {\n const regex = /^[A-Za-z-]+$/g;\n\n if (!input) {\n return 'You must provide an input';\n }\n\n return regex.test(input) || \"Please use only letters, '-' and no spaces\";\n};\n"],"names":["input","regex","test"],"mappings":"AAAA,oBAAe,CAAA,CAACA,KAAAA,GAAAA;AACd,IAAA,MAAMC,KAAQ,GAAA,eAAA;AAEd,IAAA,IAAI,CAACD,KAAO,EAAA;QACV,OAAO,2BAAA;AACT;IAEA,OAAOC,KAAAA,CAAMC,IAAI,CAACF,KAAU,CAAA,IAAA,4CAAA;AAC9B,CAAA;;;;"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* `{{ name }}` middleware
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import type { Core } from '@strapi/strapi';
|
|
6
6
|
|
|
7
|
-
export default (config, { strapi }: { strapi: Strapi }) => {
|
|
7
|
+
export default (config, { strapi }: { strapi: Core.Strapi }) => {
|
|
8
8
|
// Add your own logic here.
|
|
9
9
|
return async (ctx, next) => {
|
|
10
10
|
strapi.log.info('In {{ name }} middleware.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/generators",
|
|
3
|
-
"version": "0.0.0-next.
|
|
3
|
+
"version": "0.0.0-next.f5d21551ed005f524bfc4760b274f1be154e26a8",
|
|
4
4
|
"description": "Interactive API generator.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|
|
@@ -32,38 +32,39 @@
|
|
|
32
32
|
"source": "./src/index.ts",
|
|
33
33
|
"types": "./dist/index.d.ts",
|
|
34
34
|
"files": [
|
|
35
|
-
"
|
|
35
|
+
"dist/"
|
|
36
36
|
],
|
|
37
37
|
"scripts": {
|
|
38
|
-
"build": "
|
|
38
|
+
"build": "run -T npm-run-all clean --parallel build:code build:types",
|
|
39
|
+
"build:code": "run -T run-p build:code:rollup copy-files",
|
|
40
|
+
"build:code:rollup": "run -T rollup -c",
|
|
41
|
+
"build:types": "run -T tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
39
42
|
"clean": "run -T rimraf ./dist",
|
|
40
43
|
"copy-files": "copyfiles -u 1 -a 'src/templates/**/*' 'src/files/**/*' dist",
|
|
41
44
|
"lint": "run -T eslint .",
|
|
42
|
-
"prepublishOnly": "yarn clean && yarn build",
|
|
43
45
|
"test:ts": "run -T tsc --noEmit",
|
|
44
46
|
"test:unit": "run -T jest",
|
|
45
47
|
"test:unit:watch": "run -T jest --watch",
|
|
46
|
-
"watch": "
|
|
48
|
+
"watch": "run -T rollup -c -w"
|
|
47
49
|
},
|
|
48
50
|
"dependencies": {
|
|
49
51
|
"@sindresorhus/slugify": "1.1.0",
|
|
50
|
-
"@strapi/typescript-utils": "0.0.0-next.
|
|
51
|
-
"@strapi/utils": "0.0.0-next.
|
|
52
|
+
"@strapi/typescript-utils": "0.0.0-next.f5d21551ed005f524bfc4760b274f1be154e26a8",
|
|
53
|
+
"@strapi/utils": "0.0.0-next.f5d21551ed005f524bfc4760b274f1be154e26a8",
|
|
52
54
|
"chalk": "4.1.2",
|
|
53
55
|
"copyfiles": "2.4.1",
|
|
54
|
-
"fs-extra": "
|
|
55
|
-
"
|
|
56
|
-
"plop": "
|
|
56
|
+
"fs-extra": "11.2.0",
|
|
57
|
+
"handlebars": "4.7.7",
|
|
58
|
+
"plop": "4.0.1",
|
|
57
59
|
"pluralize": "8.0.0"
|
|
58
60
|
},
|
|
59
61
|
"devDependencies": {
|
|
60
|
-
"@
|
|
61
|
-
"eslint-config-custom": "0.0.0-next.
|
|
62
|
-
"tsconfig": "0.0.0-next.
|
|
62
|
+
"@types/fs-extra": "11.0.4",
|
|
63
|
+
"eslint-config-custom": "0.0.0-next.f5d21551ed005f524bfc4760b274f1be154e26a8",
|
|
64
|
+
"tsconfig": "0.0.0-next.f5d21551ed005f524bfc4760b274f1be154e26a8"
|
|
63
65
|
},
|
|
64
66
|
"engines": {
|
|
65
|
-
"node": ">=18.0.0 <=
|
|
67
|
+
"node": ">=18.0.0 <=22.x.x",
|
|
66
68
|
"npm": ">=6.0.0"
|
|
67
|
-
}
|
|
68
|
-
"gitHead": "f5b09a8e61e059f02784478e27c310c6290be088"
|
|
69
|
+
}
|
|
69
70
|
}
|
|
@@ -1,103 +0,0 @@
|
|
|
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
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Initializer
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { useEffect, useRef } from 'react';
|
|
8
|
-
import PropTypes from 'prop-types';
|
|
9
|
-
import pluginId from '../../pluginId';
|
|
10
|
-
|
|
11
|
-
const Initializer = ({ setPlugin }) => {
|
|
12
|
-
const ref = useRef();
|
|
13
|
-
ref.current = setPlugin;
|
|
14
|
-
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
ref.current(pluginId);
|
|
17
|
-
}, []);
|
|
18
|
-
|
|
19
|
-
return null;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
Initializer.propTypes = {
|
|
23
|
-
setPlugin: PropTypes.func.isRequired,
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default Initializer;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { prefixPluginTranslations } from '@strapi/helper-plugin';
|
|
2
|
-
import pluginPkg from '../../package.json';
|
|
3
|
-
import pluginId from './pluginId';
|
|
4
|
-
import Initializer from './components/Initializer';
|
|
5
|
-
import PluginIcon from './components/PluginIcon';
|
|
6
|
-
|
|
7
|
-
const name = pluginPkg.strapi.name;
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
register(app) {
|
|
11
|
-
app.addMenuLink({
|
|
12
|
-
to: `/plugins/${pluginId}`,
|
|
13
|
-
icon: PluginIcon,
|
|
14
|
-
intlLabel: {
|
|
15
|
-
id: `${pluginId}.plugin.name`,
|
|
16
|
-
defaultMessage: name,
|
|
17
|
-
},
|
|
18
|
-
Component: async () => {
|
|
19
|
-
const component = await import('./pages/App');
|
|
20
|
-
|
|
21
|
-
return component;
|
|
22
|
-
},
|
|
23
|
-
permissions: [
|
|
24
|
-
// Uncomment to set the permissions of the plugin here
|
|
25
|
-
// {
|
|
26
|
-
// action: '', // the action name should be plugin::plugin-name.actionType
|
|
27
|
-
// subject: null,
|
|
28
|
-
// },
|
|
29
|
-
],
|
|
30
|
-
});
|
|
31
|
-
app.registerPlugin({
|
|
32
|
-
id: pluginId,
|
|
33
|
-
initializer: Initializer,
|
|
34
|
-
isReady: false,
|
|
35
|
-
name,
|
|
36
|
-
});
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
bootstrap(app) {},
|
|
40
|
-
async registerTrads({ locales }) {
|
|
41
|
-
const importedTrads = await Promise.all(
|
|
42
|
-
locales.map((locale) => {
|
|
43
|
-
return import(`./translations/${locale}.json`)
|
|
44
|
-
.then(({ default: data }) => {
|
|
45
|
-
return {
|
|
46
|
-
data: prefixPluginTranslations(data, pluginId),
|
|
47
|
-
locale,
|
|
48
|
-
};
|
|
49
|
-
})
|
|
50
|
-
.catch(() => {
|
|
51
|
-
return {
|
|
52
|
-
data: {},
|
|
53
|
-
locale,
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
})
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
return Promise.resolve(importedTrads);
|
|
60
|
-
},
|
|
61
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* This component is the skeleton around the actual pages, and should only
|
|
4
|
-
* contain code that should be seen on all pages. (e.g. navigation bar)
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import React from 'react';
|
|
9
|
-
import { Switch, Route } from 'react-router-dom';
|
|
10
|
-
import { AnErrorOccurred } from '@strapi/helper-plugin';
|
|
11
|
-
import pluginId from '../../pluginId';
|
|
12
|
-
import HomePage from '../HomePage';
|
|
13
|
-
|
|
14
|
-
const App = () => {
|
|
15
|
-
return (
|
|
16
|
-
<div>
|
|
17
|
-
<Switch>
|
|
18
|
-
<Route path={`/plugins/${pluginId}`} component={HomePage} exact />
|
|
19
|
-
<Route component={AnErrorOccurred} />
|
|
20
|
-
</Switch>
|
|
21
|
-
</div>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default App;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
*
|
|
3
|
-
* HomePage
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from 'react';
|
|
8
|
-
// import PropTypes from 'prop-types';
|
|
9
|
-
import pluginId from '../../pluginId';
|
|
10
|
-
|
|
11
|
-
const HomePage = () => {
|
|
12
|
-
return (
|
|
13
|
-
<div>
|
|
14
|
-
<h1>{pluginId}'s HomePage</h1>
|
|
15
|
-
<p>Happy coding</p>
|
|
16
|
-
</div>
|
|
17
|
-
);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export default HomePage;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|