spyne-cli 0.6.5 → 0.6.8
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 +32 -47
- package/package.json +1 -1
- package/src/ui.js +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
|
|
1
2
|
# Spyne CLI
|
|
2
3
|
|
|
3
|
-
`spyne-cli` is a command-line utility designed to streamline the process of generating and managing applications built using the [SpyneJS](https://github.com/spynejs/spynejs) framework. It simplifies the creation of `ViewStream`, `Channel`, and `SpyneTrait` classes, making it easier to build scalable and modular single-page applications.
|
|
4
|
+
`spyne-cli` is a command-line utility designed to streamline the process of generating and managing applications built using the [SpyneJS](https://github.com/spynejs/spynejs) framework. It simplifies the creation of `ViewStream`, `DomElement`, `Channel`, and `SpyneTrait` classes, making it easier to build scalable and modular single-page applications.
|
|
4
5
|
|
|
5
6
|
## Features
|
|
6
7
|
|
|
7
8
|
- Create a new SpyneJS application with a single command.
|
|
8
|
-
- Generate `ViewStream`, `Channel`, and `SpyneTrait` classes
|
|
9
|
+
- Generate `ViewStream`, `DomElement`, `Channel`, and `SpyneTrait` classes via interactive prompts.
|
|
9
10
|
- Easily extend and customize applications.
|
|
10
11
|
- Built-in support for channel-driven development.
|
|
11
12
|
|
|
@@ -26,72 +27,56 @@ To install the `spyne-cli`, you need to have Node.js and npm installed on your s
|
|
|
26
27
|
To create a new SpyneJS application, run:
|
|
27
28
|
|
|
28
29
|
```bash
|
|
29
|
-
npx spyne-cli
|
|
30
|
+
npx spyne-cli new <app-name>
|
|
30
31
|
```
|
|
31
32
|
|
|
32
|
-
This will generate
|
|
33
|
+
This will generate a fully structured SpyneJS SPA in the specified `<app-name>` directory.
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
---
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
### Generating Components (Interactive CLI)
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
To generate SpyneJS components, simply run:
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
```bash
|
|
42
|
+
npx spyne-cli
|
|
43
|
+
```
|
|
43
44
|
|
|
44
|
-
|
|
45
|
+
You’ll be presented with an interactive menu where you can select the file type:
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
- `ViewStream`
|
|
48
|
+
- `DomElement`
|
|
49
|
+
- `Channel`
|
|
50
|
+
- `SpyneTrait`
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
Use the arrow keys to make a selection, and follow the prompts to name and configure your file.
|
|
51
53
|
|
|
52
|
-
|
|
53
|
-
npx spyne-cli generate spynetrait <trait-name>
|
|
54
|
-
```
|
|
54
|
+
This interface is ideal for developers who want fast, zero-config scaffolding during development.
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
---
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
### Example Workflow
|
|
59
59
|
|
|
60
60
|
1. Create a new application:
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
2. Navigate to the application directory:
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
cd my-spyne-app
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
3. Generate a `ViewStream` component:
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
npx spyne-cli generate viewstream MyView
|
|
76
|
-
```
|
|
62
|
+
```bash
|
|
63
|
+
npx spyne-cli new my-spyne-app
|
|
64
|
+
```
|
|
77
65
|
|
|
78
|
-
|
|
66
|
+
2. Navigate to the project and start the application:
|
|
79
67
|
|
|
80
|
-
|
|
68
|
+
```bash
|
|
69
|
+
cd my-spyne-app && npm start
|
|
70
|
+
```
|
|
81
71
|
|
|
82
|
-
|
|
72
|
+
3. Run the interactive generator:
|
|
83
73
|
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
templates: {
|
|
87
|
-
viewstream: './templates/viewstream.hbs',
|
|
88
|
-
channel: './templates/channel.hbs',
|
|
89
|
-
spynetrait: './templates/spynetrait.hbs',
|
|
90
|
-
},
|
|
91
|
-
outputDir: './src/components',
|
|
92
|
-
};
|
|
74
|
+
```bash
|
|
75
|
+
npx spyne-cli
|
|
93
76
|
```
|
|
94
77
|
|
|
78
|
+
4. Select the file type (e.g., `ViewStream`), and follow the prompts to generate a new component.
|
|
79
|
+
|
|
95
80
|
## Contributing
|
|
96
81
|
|
|
97
82
|
Contributions are welcome! Please feel free to submit a Pull Request or open an Issue on the [GitHub repository](https://github.com/spynejs/spyne-cli).
|
package/package.json
CHANGED
package/src/ui.js
CHANGED
|
@@ -5,7 +5,7 @@ export class SpyneCliUI {
|
|
|
5
5
|
|
|
6
6
|
constructor() {}
|
|
7
7
|
static title(){
|
|
8
|
-
const figletTxt = figlet.textSync('spyne-cli 6.
|
|
8
|
+
const figletTxt = figlet.textSync('spyne-cli 6.8', {
|
|
9
9
|
horizontalLayout: 'universal smushing'
|
|
10
10
|
})
|
|
11
11
|
const chalkOutput = chalk.blue(figletTxt);
|