@next2d/view-generator 1.1.3 → 1.2.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/index.js +9 -18
- package/package.json +7 -7
package/index.js
CHANGED
|
@@ -13,10 +13,10 @@ if (10 > version.split(".")[0]) {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
const chalk = require("chalk");
|
|
16
|
-
const
|
|
16
|
+
const { Command } = require("commander");
|
|
17
17
|
const packageJson = require("./package.json");
|
|
18
18
|
const path = require("path");
|
|
19
|
-
const fs
|
|
19
|
+
const fs = require("fs-extra");
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* @return {void}
|
|
@@ -44,6 +44,10 @@ const createFile = function ()
|
|
|
44
44
|
|
|
45
45
|
const names = keys[idx].split(/[-_/]/);
|
|
46
46
|
|
|
47
|
+
if (names[0].charAt(0) === "@") {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
|
|
47
51
|
const viewDir = path.join(cwd, `view/${names[0]}`);
|
|
48
52
|
if (!fs.existsSync(viewDir)) {
|
|
49
53
|
|
|
@@ -133,23 +137,10 @@ export class ${name}ViewModel extends next2d.fw.ViewModel
|
|
|
133
137
|
*/
|
|
134
138
|
const exec = function ()
|
|
135
139
|
{
|
|
136
|
-
new
|
|
140
|
+
new Command()
|
|
141
|
+
.name(packageJson.name)
|
|
142
|
+
.description("Generate the View, ViewModel class required for routing.")
|
|
137
143
|
.version(packageJson.version)
|
|
138
|
-
.arguments("<project-directory>")
|
|
139
|
-
.usage(`${chalk.green("<project-directory>")} [options]`)
|
|
140
|
-
.on("--help", () =>
|
|
141
|
-
{
|
|
142
|
-
console.log();
|
|
143
|
-
console.log(
|
|
144
|
-
" If you have any problems, do not hesitate to file an issue:"
|
|
145
|
-
);
|
|
146
|
-
console.log(
|
|
147
|
-
` ${chalk.cyan(
|
|
148
|
-
"https://github.com/Next2D/next2d-view-generator/issues/new"
|
|
149
|
-
)}`
|
|
150
|
-
);
|
|
151
|
-
console.log();
|
|
152
|
-
})
|
|
153
144
|
.parse(process.argv);
|
|
154
145
|
|
|
155
146
|
createFile();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next2d/view-generator",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Generate the View class required for routing.",
|
|
5
5
|
"author": "Toshiyuki Ienaga<ienaga@tvon.jp>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"bin": {
|
|
21
21
|
"@next2d/view-generator": "index.js"
|
|
22
22
|
},
|
|
23
|
-
"dependencies": {
|
|
24
|
-
"chalk": "4.1.0",
|
|
25
|
-
"commander": "4.1.1",
|
|
26
|
-
"fs-extra": "9.0.1"
|
|
27
|
-
},
|
|
28
23
|
"devDependencies": {
|
|
29
|
-
"eslint": "^8.
|
|
24
|
+
"eslint": "^8.22.0"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"chalk": "4.1.2",
|
|
28
|
+
"commander": "^9.4.0",
|
|
29
|
+
"fs-extra": "^10.1.0"
|
|
30
30
|
}
|
|
31
31
|
}
|