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.
Files changed (3) hide show
  1. package/README.md +32 -47
  2. package/package.json +1 -1
  3. 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 based on user prompts.
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 create-app <app-name>
30
+ npx spyne-cli new <app-name>
30
31
  ```
31
32
 
32
- This will generate the necessary project files in the specified `<app-name>` directory.
33
+ This will generate a fully structured SpyneJS SPA in the specified `<app-name>` directory.
33
34
 
34
- ### Generating Components
35
+ ---
35
36
 
36
- You can use `spyne-cli` to generate new `ViewStream`, `Channel`, and `SpyneTrait` components:
37
+ ### Generating Components (Interactive CLI)
37
38
 
38
- - **ViewStream**: To generate a new `ViewStream`, use:
39
+ To generate SpyneJS components, simply run:
39
40
 
40
- ```bash
41
- npx spyne-cli generate viewstream <view-name>
42
- ```
41
+ ```bash
42
+ npx spyne-cli
43
+ ```
43
44
 
44
- - **Channel**: To generate a new `Channel`, use:
45
+ You’ll be presented with an interactive menu where you can select the file type:
45
46
 
46
- ```bash
47
- npx spyne-cli generate channel <channel-name>
48
- ```
47
+ - `ViewStream`
48
+ - `DomElement`
49
+ - `Channel`
50
+ - `SpyneTrait`
49
51
 
50
- - **SpyneTrait**: To generate a new `SpyneTrait`, use:
52
+ Use the arrow keys to make a selection, and follow the prompts to name and configure your file.
51
53
 
52
- ```bash
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
- ### Example
56
+ ---
57
57
 
58
- To create a new application and add a `ViewStream` component:
58
+ ### Example Workflow
59
59
 
60
60
  1. Create a new application:
61
61
 
62
- ```bash
63
- npx spyne-cli create-app my-spyne-app
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
- ## Configuration
66
+ 2. Navigate to the project and start the application:
79
67
 
80
- The `spyne-cli` supports customization via the `spyne.config.js` file located in your project’s root directory. You can modify the config file to control the file structure, template generation, and more.
68
+ ```bash
69
+ cd my-spyne-app && npm start
70
+ ```
81
71
 
82
- ### Example `spyne.config.js`
72
+ 3. Run the interactive generator:
83
73
 
84
- ```javascript
85
- module.exports = {
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
@@ -4,7 +4,7 @@
4
4
  "spyne-cli": "index.js"
5
5
  },
6
6
  "type": "module",
7
- "version": "0.6.5",
7
+ "version": "0.6.8",
8
8
  "description": "Generates spyne objects and saves them to standard spyne.",
9
9
  "main": "index.js",
10
10
  "scripts": {
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.5', {
8
+ const figletTxt = figlet.textSync('spyne-cli 6.8', {
9
9
  horizontalLayout: 'universal smushing'
10
10
  })
11
11
  const chalkOutput = chalk.blue(figletTxt);