@next2d/view-generator 0.0.4 → 1.1.2
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/README.md +11 -6
- package/index.js +7 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
[](https://github.com/Next2D/view-generator/actions/workflows/codeql-analysis.yml)
|
|
4
|
+
[](https://github.com/Next2D/view-generator/actions/workflows/lint.yml)
|
|
5
|
+
[](https://github.com/Next2D/view-generator/releases)
|
|
6
|
+
[](https://github.com/Next2D/view-generator/blob/main/LICENSE)
|
|
4
7
|
|
|
5
|
-
# next2d-view-generator
|
|
6
8
|
Generate the View class required for routing.
|
|
7
9
|
|
|
8
10
|
## Commands
|
|
9
11
|
|
|
10
12
|
```sh
|
|
11
|
-
npx next2d
|
|
12
|
-
```
|
|
13
|
+
npx @next2d/view-generator
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## License
|
|
17
|
+
This project is licensed under the [MIT License](https://opensource.org/licenses/MIT) - see the [LICENSE](LICENSE) file for details.
|
package/index.js
CHANGED
|
@@ -33,6 +33,7 @@ const createFile = function ()
|
|
|
33
33
|
const routingPath = path.join(cwd, "config/routing.json");
|
|
34
34
|
if (!fs.existsSync(routingPath)) {
|
|
35
35
|
console.log(`${chalk.red("Could not find routing.json.")}`);
|
|
36
|
+
console.log();
|
|
36
37
|
return ;
|
|
37
38
|
}
|
|
38
39
|
|
|
@@ -45,6 +46,10 @@ const createFile = function ()
|
|
|
45
46
|
|
|
46
47
|
const viewDir = path.join(cwd, `view/${names[0]}`);
|
|
47
48
|
if (!fs.existsSync(viewDir)) {
|
|
49
|
+
|
|
50
|
+
console.log(`${chalk.green(`Create a new Directory ${viewDir}.`)}`);
|
|
51
|
+
console.log();
|
|
52
|
+
|
|
48
53
|
fs.ensureDirSync(viewDir);
|
|
49
54
|
}
|
|
50
55
|
|
|
@@ -63,7 +68,6 @@ const createFile = function ()
|
|
|
63
68
|
const viewFile = path.join(viewDir, `${name}View.js`);
|
|
64
69
|
if (!fs.existsSync(viewFile)) {
|
|
65
70
|
|
|
66
|
-
console.log();
|
|
67
71
|
console.log(`Create a new View Class ${viewFile}.`);
|
|
68
72
|
console.log();
|
|
69
73
|
|
|
@@ -88,7 +92,6 @@ export class ${name}View extends next2d.fw.View
|
|
|
88
92
|
const viewModelFile = path.join(viewDir, `${name}ViewModel.js`);
|
|
89
93
|
if (!fs.existsSync(viewModelFile)) {
|
|
90
94
|
|
|
91
|
-
console.log();
|
|
92
95
|
console.log(`Create a new ViewModel Class ${viewModelFile}.`);
|
|
93
96
|
console.log();
|
|
94
97
|
|
|
@@ -110,8 +113,8 @@ export class ${name}ViewModel extends next2d.fw.ViewModel
|
|
|
110
113
|
|
|
111
114
|
/**
|
|
112
115
|
* @param {next2d.fw.View} view
|
|
113
|
-
* @return {void}
|
|
114
|
-
* @
|
|
116
|
+
* @return {Promise|void}
|
|
117
|
+
* @public
|
|
115
118
|
*/
|
|
116
119
|
bind (view)
|
|
117
120
|
{
|
|
@@ -121,7 +124,6 @@ export class ${name}ViewModel extends next2d.fw.ViewModel
|
|
|
121
124
|
}
|
|
122
125
|
}
|
|
123
126
|
|
|
124
|
-
console.log();
|
|
125
127
|
console.log(`${chalk.green("Finished.")}`);
|
|
126
128
|
console.log();
|
|
127
129
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next2d/view-generator",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Generate the View class required for routing.",
|
|
5
5
|
"author": "Toshiyuki Ienaga<ienaga@tvon.jp>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
"fs-extra": "9.0.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"eslint": "^8.
|
|
29
|
+
"eslint": "^8.1.0"
|
|
30
30
|
}
|
|
31
31
|
}
|