@digigov/cli-generate 1.0.5-rc.21 → 2.0.0-834daea4
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/.rush/temp/shrinkwrap-deps.json +2 -4
- package/generators/component-generator.js +14 -10
- package/generators/digigovrc-generator.js +17 -12
- package/generators/faqPage-generator.js +13 -8
- package/generators/questionsPage-generator.js +13 -8
- package/generators/startPage-generator.js +13 -8
- package/index.js +16 -31
- package/package.json +5 -6
- package/plopfile.js +15 -12
- package/.eslintrc.js +0 -1
- package/.prettierrc.js +0 -1
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"../../tooling/cli-generate": "../../tooling/cli-generate:
|
|
3
|
-
"/
|
|
4
|
-
"/plop@2.7.4": "Missing shrinkwrap entry!",
|
|
5
|
-
"/prettier@3.2.5": "Missing shrinkwrap entry!",
|
|
2
|
+
"../../tooling/cli-generate": "../../tooling/cli-generate:Qb97lhbIMs7ZF4vWFWXP85co572DcBODAR+oXAC/iRg=:",
|
|
3
|
+
"/plop@4.0.1": "Missing shrinkwrap entry!",
|
|
6
4
|
"/publint@0.1.8": "Missing shrinkwrap entry!"
|
|
7
5
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { resolveProject } from "@digigov/cli/lib";
|
|
2
|
+
import { join } from "path";
|
|
3
|
+
|
|
2
4
|
const { src, root } = resolveProject();
|
|
3
|
-
const path = require("path");
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @param {import("plop").NodePlopAPI} plop
|
|
8
|
+
*/
|
|
9
|
+
export default function (plop) {
|
|
6
10
|
plop.setGenerator("Component", {
|
|
7
11
|
description: "Generate a React component",
|
|
8
12
|
prompts: [
|
|
@@ -10,8 +14,8 @@ module.exports = function (plop) {
|
|
|
10
14
|
name: "name",
|
|
11
15
|
message: "Enter the file name",
|
|
12
16
|
validate: (input) => {
|
|
13
|
-
return input.length > 0 ? true :
|
|
14
|
-
}
|
|
17
|
+
return input.length > 0 ? true : "The file name could not be empty";
|
|
18
|
+
},
|
|
15
19
|
},
|
|
16
20
|
{
|
|
17
21
|
name: "ext",
|
|
@@ -27,9 +31,9 @@ module.exports = function (plop) {
|
|
|
27
31
|
actions: [
|
|
28
32
|
{
|
|
29
33
|
type: "add",
|
|
30
|
-
path: `${
|
|
31
|
-
templateFile: "plop-templates/component.hbs",
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
+
path: `${join(root, src)}/components/{{name}}.{{ext}}`,
|
|
35
|
+
templateFile: "../plop-templates/component.hbs",
|
|
36
|
+
},
|
|
37
|
+
],
|
|
34
38
|
});
|
|
35
|
-
}
|
|
39
|
+
}
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
import { resolveProject } from "@digigov/cli/lib";
|
|
2
|
+
|
|
2
3
|
const { root } = resolveProject();
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @param {import("plop").NodePlopAPI} plop
|
|
7
|
+
*/
|
|
8
|
+
export default function (plop) {
|
|
5
9
|
plop.setGenerator("Digigovrc", {
|
|
6
10
|
description: "Generate a digigovrc file",
|
|
7
11
|
prompts: [
|
|
8
12
|
{
|
|
9
13
|
name: "directory",
|
|
10
|
-
message:
|
|
11
|
-
|
|
14
|
+
message:
|
|
15
|
+
"Enter the relative path from your home directory where the digigov-sdk repository is placed",
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
actions: [
|
|
19
|
+
{
|
|
20
|
+
type: "add",
|
|
21
|
+
path: `${root}/digigovrc.js`,
|
|
22
|
+
templateFile: "../plop-templates/digigovrc.hbs",
|
|
23
|
+
},
|
|
12
24
|
],
|
|
13
|
-
actions: [
|
|
14
|
-
{
|
|
15
|
-
type: "add",
|
|
16
|
-
path: `${root}/digigovrc.js`,
|
|
17
|
-
templateFile: "plop-templates/digigovrc.hbs",
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
25
|
});
|
|
21
|
-
}
|
|
26
|
+
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { resolveProject } from "@digigov/cli/lib";
|
|
2
|
+
import { join } from "path";
|
|
3
|
+
|
|
2
4
|
const { src, root } = resolveProject();
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @param {import("plop").NodePlopAPI} plop
|
|
8
|
+
*/
|
|
9
|
+
export default function (plop) {
|
|
5
10
|
plop.setGenerator("FAQ page", {
|
|
6
11
|
description: "Generate a FAQ page",
|
|
7
12
|
prompts: [
|
|
@@ -9,8 +14,8 @@ module.exports = function (plop) {
|
|
|
9
14
|
name: "name",
|
|
10
15
|
message: "Enter the file name",
|
|
11
16
|
validate: (input) => {
|
|
12
|
-
return input.length > 0 ? true :
|
|
13
|
-
}
|
|
17
|
+
return input.length > 0 ? true : "The file name could not be empty";
|
|
18
|
+
},
|
|
14
19
|
},
|
|
15
20
|
{
|
|
16
21
|
name: "ext",
|
|
@@ -27,9 +32,9 @@ module.exports = function (plop) {
|
|
|
27
32
|
actions: [
|
|
28
33
|
{
|
|
29
34
|
type: "add",
|
|
30
|
-
path: `${
|
|
31
|
-
templateFile: "plop-templates/faq-page.hbs",
|
|
35
|
+
path: `${join(root, src)}/pages/{{name}}.{{ext}}`,
|
|
36
|
+
templateFile: "../plop-templates/faq-page.hbs",
|
|
32
37
|
},
|
|
33
38
|
],
|
|
34
39
|
});
|
|
35
|
-
}
|
|
40
|
+
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { resolveProject } from "@digigov/cli/lib";
|
|
2
|
+
import { join } from "path";
|
|
3
|
+
|
|
2
4
|
const { src, root } = resolveProject();
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @param {import("plop").NodePlopAPI} plop
|
|
8
|
+
*/
|
|
9
|
+
export default function (plop) {
|
|
5
10
|
plop.setGenerator("Questions Page", {
|
|
6
11
|
description: "Generate a Questions page",
|
|
7
12
|
prompts: [
|
|
@@ -9,8 +14,8 @@ module.exports = function (plop) {
|
|
|
9
14
|
name: "name",
|
|
10
15
|
message: "Enter the file name",
|
|
11
16
|
validate: (input) => {
|
|
12
|
-
return input.length > 0 ? true :
|
|
13
|
-
}
|
|
17
|
+
return input.length > 0 ? true : "The file name could not be empty";
|
|
18
|
+
},
|
|
14
19
|
},
|
|
15
20
|
{
|
|
16
21
|
name: "ext",
|
|
@@ -26,9 +31,9 @@ module.exports = function (plop) {
|
|
|
26
31
|
actions: [
|
|
27
32
|
{
|
|
28
33
|
type: "add",
|
|
29
|
-
path: `${
|
|
30
|
-
templateFile: "plop-templates/questions-page.hbs",
|
|
34
|
+
path: `${join(root, src)}/pages/{{name}}.{{ext}}`,
|
|
35
|
+
templateFile: "../plop-templates/questions-page.hbs",
|
|
31
36
|
},
|
|
32
37
|
],
|
|
33
38
|
});
|
|
34
|
-
}
|
|
39
|
+
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { resolveProject } from "@digigov/cli/lib";
|
|
2
|
+
import { join } from "path";
|
|
3
|
+
|
|
2
4
|
const { src, root } = resolveProject();
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @param {import("plop").NodePlopAPI} plop
|
|
8
|
+
*/
|
|
9
|
+
export default function (plop) {
|
|
5
10
|
plop.setGenerator("Start Page", {
|
|
6
11
|
description: "Generate a start page",
|
|
7
12
|
prompts: [
|
|
@@ -9,8 +14,8 @@ module.exports = function (plop) {
|
|
|
9
14
|
name: "name",
|
|
10
15
|
message: "Enter the file name",
|
|
11
16
|
validate: (input) => {
|
|
12
|
-
return input.length > 0 ? true :
|
|
13
|
-
}
|
|
17
|
+
return input.length > 0 ? true : "The file name could not be empty";
|
|
18
|
+
},
|
|
14
19
|
},
|
|
15
20
|
{
|
|
16
21
|
name: "ext",
|
|
@@ -26,9 +31,9 @@ module.exports = function (plop) {
|
|
|
26
31
|
actions: [
|
|
27
32
|
{
|
|
28
33
|
type: "add",
|
|
29
|
-
path: `${
|
|
30
|
-
templateFile: "plop-templates/start-page.hbs",
|
|
34
|
+
path: `${join(root, src)}/pages/{{name}}.{{ext}}`,
|
|
35
|
+
templateFile: "../plop-templates/start-page.hbs",
|
|
31
36
|
},
|
|
32
37
|
],
|
|
33
38
|
});
|
|
34
|
-
}
|
|
39
|
+
}
|
package/index.js
CHANGED
|
@@ -1,32 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const path = require("path");
|
|
5
|
-
const fs = require("fs");
|
|
1
|
+
import { DigigovCommand } from "@digigov/cli/lib";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
async run() {
|
|
21
|
-
const { argv, flags } = this.parse(Generate);
|
|
22
|
-
try {
|
|
23
|
-
const plopArgs = ["--plopfile", path.join(__dirname, "plopfile.js")];
|
|
24
|
-
const proc = this.exec(this.script, [...plopArgs, ...argv], {
|
|
25
|
-
stdio: "inherit",
|
|
26
|
-
});
|
|
27
|
-
return proc;
|
|
28
|
-
} catch (err) {
|
|
29
|
-
console.log(err);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
5
|
+
const command = new DigigovCommand("generate", import.meta.url);
|
|
6
|
+
|
|
7
|
+
command
|
|
8
|
+
.argument("[args...]", "arguments to pass to test runner")
|
|
9
|
+
.helpOption(false)
|
|
10
|
+
.allowUnknownOption()
|
|
11
|
+
.action(async (args, _, ctx) => {
|
|
12
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const plopArgs = ["--plopfile", path.join(__dirname, "plopfile.js")];
|
|
14
|
+
await ctx.exec("plop", [...plopArgs, ...args], { stdio: "inherit" });
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export default command;
|
package/package.json
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digigov/cli-generate",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-834daea4",
|
|
4
4
|
"description": "Scaffolding files generator for Digigov CLI",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
5
7
|
"author": "GRNET Devs <devs@lists.grnet.gr>",
|
|
6
8
|
"license": "BSD-2-Clause",
|
|
7
9
|
"dependencies": {
|
|
8
|
-
"plop": "
|
|
10
|
+
"plop": "4.0.1",
|
|
9
11
|
"publint": "0.1.8"
|
|
10
12
|
},
|
|
11
13
|
"peerDependencies": {
|
|
12
|
-
"@digigov/cli": "
|
|
14
|
+
"@digigov/cli": "2.0.0-834daea4"
|
|
13
15
|
},
|
|
14
16
|
"devDependencies": {
|
|
15
|
-
"eslint": "8.56.0",
|
|
16
|
-
"prettier": "3.2.5",
|
|
17
|
-
"@digigov/cli-lint": "1.0.5-rc.21",
|
|
18
17
|
"publint": "0.1.8"
|
|
19
18
|
},
|
|
20
19
|
"scripts": {
|
package/plopfile.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import digigovRcGenerator from "./generators/digigovrc-generator.js";
|
|
2
|
+
import startPageGenerator from "./generators/startPage-generator.js";
|
|
3
|
+
import faqPageGenerator from "./generators/faqPage-generator.js";
|
|
4
|
+
import questionsPageGenerator from "./generators/questionsPage-generator.js";
|
|
5
|
+
import componentGenerator from "./generators/component-generator.js";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @param {import('plop').NodePlopAPI} plop
|
|
9
|
+
*/
|
|
10
|
+
export default function (plop) {
|
|
11
|
+
componentGenerator(plop);
|
|
12
|
+
startPageGenerator(plop);
|
|
13
|
+
faqPageGenerator(plop);
|
|
14
|
+
questionsPageGenerator(plop);
|
|
15
|
+
digigovRcGenerator(plop);
|
|
16
|
+
}
|
package/.eslintrc.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('@digigov/cli-lint/eslintrc')();
|
package/.prettierrc.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('@digigov/cli-lint/prettierrc')();
|