@next2d/view-generator 0.0.3 → 1.1.1

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.
Files changed (3) hide show
  1. package/README.md +5 -5
  2. package/index.js +8 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
- [![CodeQL](https://github.com/Next2D/next2d-view-generator/actions/workflows/codeql-analysis.yml/badge.svg?branch=main)](https://github.com/Next2D/next2d-view-generator/actions/workflows/codeql-analysis.yml)
2
- [![release](https://img.shields.io/github/v/release/Next2D/next2d-view-generator)](https://github.com/Next2D/next2d-view-generator/releases)
3
- [![license](https://img.shields.io/github/license/Next2D/next2d-view-generator)](https://github.com/Next2D/next2d-view-generator/blob/main/LICENSE)
1
+ [![CodeQL](https://github.com/Next2D/view-generator/actions/workflows/codeql-analysis.yml/badge.svg?branch=main)](https://github.com/Next2D/view-generator/actions/workflows/codeql-analysis.yml)
2
+ [![release](https://img.shields.io/github/v/release/Next2D/view-generator)](https://github.com/Next2D/view-generator/releases)
3
+ [![license](https://img.shields.io/github/license/Next2D/view-generator)](https://github.com/Next2D/view-generator/blob/main/LICENSE)
4
4
 
5
- # next2d-view-generator
5
+ # view-generator
6
6
  Generate the View class required for routing.
7
7
 
8
8
  ## Commands
9
9
 
10
10
  ```sh
11
- npx next2d-view-generator
11
+ npx @next2d/view-generator
12
12
  ```
package/index.js CHANGED
@@ -25,13 +25,15 @@ const createFile = function ()
25
25
  {
26
26
 
27
27
  console.log();
28
- console.log("Begin research.");
28
+ console.log(`${chalk.green("Begin research.")}`);
29
29
  console.log();
30
30
 
31
31
  const cwd = `${process.cwd()}/src/`;
32
32
 
33
33
  const routingPath = path.join(cwd, "config/routing.json");
34
34
  if (!fs.existsSync(routingPath)) {
35
+ console.log(`${chalk.red("Could not find routing.json.")}`);
36
+ console.log();
35
37
  return ;
36
38
  }
37
39
 
@@ -44,6 +46,10 @@ const createFile = function ()
44
46
 
45
47
  const viewDir = path.join(cwd, `view/${names[0]}`);
46
48
  if (!fs.existsSync(viewDir)) {
49
+
50
+ console.log(`${chalk.green(`Create a new Directory ${viewDir}.`)}`);
51
+ console.log();
52
+
47
53
  fs.ensureDirSync(viewDir);
48
54
  }
49
55
 
@@ -62,7 +68,6 @@ const createFile = function ()
62
68
  const viewFile = path.join(viewDir, `${name}View.js`);
63
69
  if (!fs.existsSync(viewFile)) {
64
70
 
65
- console.log();
66
71
  console.log(`Create a new View Class ${viewFile}.`);
67
72
  console.log();
68
73
 
@@ -87,7 +92,6 @@ export class ${name}View extends next2d.fw.View
87
92
  const viewModelFile = path.join(viewDir, `${name}ViewModel.js`);
88
93
  if (!fs.existsSync(viewModelFile)) {
89
94
 
90
- console.log();
91
95
  console.log(`Create a new ViewModel Class ${viewModelFile}.`);
92
96
  console.log();
93
97
 
@@ -120,8 +124,8 @@ export class ${name}ViewModel extends next2d.fw.ViewModel
120
124
  }
121
125
  }
122
126
 
127
+ console.log(`${chalk.green("Finished.")}`);
123
128
  console.log();
124
- console.log(`Finished.`);
125
129
  };
126
130
 
127
131
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next2d/view-generator",
3
- "version": "0.0.3",
3
+ "version": "1.1.1",
4
4
  "description": "Generate the View class required for routing.",
5
5
  "author": "Toshiyuki Ienaga<ienaga@tvon.jp>",
6
6
  "license": "MIT",