@oaysus/cli 0.1.1 → 0.1.3
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
CHANGED
|
@@ -1,56 +1,45 @@
|
|
|
1
1
|
# @oaysus/cli
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
|
3
|
+
Official CLI for building and uploading frontend components to Oaysus.
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
## Installation
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
### npm (recommended)
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @oaysus/cli
|
|
11
|
+
```
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
### Homebrew (macOS/Linux)
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
```bash
|
|
16
|
+
brew tap oaysus/tap
|
|
17
|
+
brew install oaysus
|
|
17
18
|
```
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
## Installation
|
|
20
|
+
### Verify installation
|
|
22
21
|
|
|
23
22
|
```bash
|
|
24
|
-
|
|
23
|
+
oaysus --version
|
|
25
24
|
```
|
|
26
25
|
|
|
27
|
-
Requires Node.js 20 or higher.
|
|
28
|
-
|
|
29
26
|
## Quick Start
|
|
30
27
|
|
|
31
28
|
```bash
|
|
32
|
-
#
|
|
29
|
+
# Authenticate with Oaysus
|
|
33
30
|
oaysus login
|
|
34
31
|
|
|
35
|
-
#
|
|
36
|
-
oaysus init my-
|
|
37
|
-
|
|
38
|
-
# 3. Navigate to the project
|
|
39
|
-
cd my-components
|
|
40
|
-
|
|
41
|
-
# 4. Push your components to Oaysus
|
|
42
|
-
oaysus push
|
|
43
|
-
```
|
|
32
|
+
# Create a new theme pack project
|
|
33
|
+
oaysus init my-theme
|
|
44
34
|
|
|
45
|
-
|
|
35
|
+
# Navigate to project
|
|
36
|
+
cd my-theme
|
|
46
37
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
✓ Built and bundled (2.1 KB)
|
|
50
|
-
✓ Uploaded to Oaysus
|
|
51
|
-
✓ Published!
|
|
38
|
+
# Add a component
|
|
39
|
+
oaysus create
|
|
52
40
|
|
|
53
|
-
|
|
41
|
+
# Build and upload
|
|
42
|
+
oaysus push
|
|
54
43
|
```
|
|
55
44
|
|
|
56
45
|
## Commands
|
|
@@ -68,90 +57,109 @@ Install in dashboard: Content → Theme Packs
|
|
|
68
57
|
|
|
69
58
|
## Framework Support
|
|
70
59
|
|
|
71
|
-
|
|
60
|
+
The CLI supports multiple frontend frameworks:
|
|
72
61
|
|
|
73
|
-
- **React**
|
|
74
|
-
- **Vue**
|
|
75
|
-
- **Svelte**
|
|
62
|
+
- **React** - Full support with JSX/TSX components
|
|
63
|
+
- **Vue** - Single File Components (.vue)
|
|
64
|
+
- **Svelte** - Svelte components (.svelte)
|
|
76
65
|
|
|
77
66
|
Framework is automatically detected from your `package.json` dependencies.
|
|
78
67
|
|
|
79
|
-
##
|
|
68
|
+
## Project Structure
|
|
80
69
|
|
|
81
|
-
|
|
70
|
+
### Single Component
|
|
82
71
|
|
|
83
|
-
**Component (React example):**
|
|
84
|
-
```tsx
|
|
85
|
-
export default function AnnouncementBar({ message, backgroundColor }) {
|
|
86
|
-
return (
|
|
87
|
-
<div style={{ backgroundColor }} className="py-3 px-4 text-center text-white">
|
|
88
|
-
{message}
|
|
89
|
-
</div>
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
72
|
```
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"displayName": "Announcement Bar",
|
|
98
|
-
"props": {
|
|
99
|
-
"message": {
|
|
100
|
-
"type": "string",
|
|
101
|
-
"default": "Free shipping on orders over $50"
|
|
102
|
-
},
|
|
103
|
-
"backgroundColor": {
|
|
104
|
-
"type": "color",
|
|
105
|
-
"default": "#2563eb"
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
73
|
+
my-component/
|
|
74
|
+
├── package.json
|
|
75
|
+
├── index.tsx # Main component file
|
|
76
|
+
└── schema.json # Component props schema
|
|
109
77
|
```
|
|
110
78
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
## Project Structure
|
|
79
|
+
### Theme Pack (Multiple Components)
|
|
114
80
|
|
|
115
81
|
```
|
|
116
|
-
my-
|
|
82
|
+
my-theme/
|
|
117
83
|
├── package.json
|
|
118
84
|
└── components/
|
|
119
|
-
├──
|
|
85
|
+
├── Button/
|
|
120
86
|
│ ├── index.tsx
|
|
121
87
|
│ └── schema.json
|
|
122
|
-
├──
|
|
88
|
+
├── Card/
|
|
123
89
|
│ ├── index.tsx
|
|
124
90
|
│ └── schema.json
|
|
125
|
-
└──
|
|
91
|
+
└── Header/
|
|
126
92
|
├── index.tsx
|
|
127
93
|
└── schema.json
|
|
128
94
|
```
|
|
129
95
|
|
|
130
|
-
##
|
|
96
|
+
## Configuration
|
|
131
97
|
|
|
132
|
-
|
|
133
|
-
- **[CLI Reference](https://oaysus.com/docs/cli)** — Complete command documentation
|
|
134
|
-
- **[Component Guide](https://oaysus.com/docs/components)** — Props, schemas, and best practices
|
|
135
|
-
- **[Theme Packs](https://oaysus.com/docs/theme-packs)** — Organize and distribute component collections
|
|
98
|
+
### package.json
|
|
136
99
|
|
|
137
|
-
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"name": "my-theme",
|
|
103
|
+
"version": "1.0.0",
|
|
104
|
+
"dependencies": {
|
|
105
|
+
"react": "^18.0.0"
|
|
106
|
+
},
|
|
107
|
+
"oaysus": {
|
|
108
|
+
"theme": {
|
|
109
|
+
"name": "my-theme",
|
|
110
|
+
"displayName": "My Theme",
|
|
111
|
+
"category": "ui",
|
|
112
|
+
"tags": ["react", "components"]
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
138
117
|
|
|
139
|
-
|
|
140
|
-
|---------------------|-------------|
|
|
141
|
-
| Marketing files a ticket for every page change | Marketing creates pages themselves |
|
|
142
|
-
| Developers build one-off landing pages | Developers build reusable components |
|
|
143
|
-
| Every text change requires a deploy | Changes publish instantly |
|
|
144
|
-
| Locked into proprietary CMS themes | Standard React/Vue/Svelte you own |
|
|
118
|
+
### schema.json
|
|
145
119
|
|
|
146
|
-
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"type": "component",
|
|
123
|
+
"displayName": "My Component",
|
|
124
|
+
"description": "A reusable UI component",
|
|
125
|
+
"props": {
|
|
126
|
+
"title": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"default": "Hello",
|
|
129
|
+
"description": "The title text"
|
|
130
|
+
},
|
|
131
|
+
"variant": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"default": "primary",
|
|
134
|
+
"description": "Button variant"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Requirements
|
|
141
|
+
|
|
142
|
+
- Node.js 20 or higher
|
|
143
|
+
- Oaysus account
|
|
144
|
+
|
|
145
|
+
## Authentication
|
|
146
|
+
|
|
147
|
+
The CLI uses device authorization flow for secure authentication:
|
|
148
|
+
|
|
149
|
+
1. Run `oaysus login`
|
|
150
|
+
2. A browser window opens for authentication
|
|
151
|
+
3. Log in with your Oaysus account
|
|
152
|
+
4. The CLI automatically receives your credentials
|
|
153
|
+
|
|
154
|
+
Credentials are stored securely in `~/.oaysus/credentials.json` with restricted file permissions.
|
|
155
|
+
|
|
156
|
+
## Documentation
|
|
147
157
|
|
|
148
|
-
|
|
149
|
-
2. **Install the CLI** — `npm install -g @oaysus/cli`
|
|
150
|
-
3. **Follow the quick start** — [oaysus.com/docs/quickstart](https://oaysus.com/docs/quickstart)
|
|
158
|
+
For full documentation, visit [docs.oaysus.com](https://docs.oaysus.com)
|
|
151
159
|
|
|
152
160
|
## Contributing
|
|
153
161
|
|
|
154
|
-
|
|
162
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
|
|
155
163
|
|
|
156
164
|
## License
|
|
157
165
|
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Centralized Configuration Module
|
|
3
3
|
*
|
|
4
|
-
* Production defaults are baked in for end users.
|
|
4
|
+
* Production defaults are baked in for end users (NPM and Homebrew).
|
|
5
5
|
* Contributors can override via environment variables or .env file.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Compatible with:
|
|
8
|
+
* - NPM global install: npm install -g @oaysus/cli
|
|
9
|
+
* - Homebrew: brew install oaysus
|
|
10
|
+
* - Local development: bun run dev
|
|
8
11
|
*/
|
|
9
12
|
/**
|
|
10
13
|
* Environment configuration
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/lib/shared/config.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/lib/shared/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAUH;;;GAGG;AACH,eAAO,MAAM,MAAM;;;;;;;;;CAwBT,CAAC;AAGX,eAAO,MACL,YAAY,UACZ,SAAS,UACT,aAAa,UACb,SAAS,UACT,SAAS,sBACT,KAAK,WACL,gBAAgB,UAChB,UAAU,QACF,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;AAEnD,wBAAgB,cAAc,IAAI,WAAW,CAS5C;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAI9C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAInD"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Centralized Configuration Module
|
|
3
3
|
*
|
|
4
|
-
* Production defaults are baked in for end users.
|
|
4
|
+
* Production defaults are baked in for end users (NPM and Homebrew).
|
|
5
5
|
* Contributors can override via environment variables or .env file.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Compatible with:
|
|
8
|
+
* - NPM global install: npm install -g @oaysus/cli
|
|
9
|
+
* - Homebrew: brew install oaysus
|
|
10
|
+
* - Local development: bun run dev
|
|
8
11
|
*/
|
|
9
12
|
import os from 'os';
|
|
10
13
|
import path from 'path';
|
|
@@ -29,7 +32,7 @@ export const config = {
|
|
|
29
32
|
DEVELOPER: process.env.DEVELOPER,
|
|
30
33
|
// Debug mode (console logging, off by default)
|
|
31
34
|
DEBUG: process.env.DEBUG === 'true',
|
|
32
|
-
// Credentials storage path
|
|
35
|
+
// Credentials storage path (works for both NPM and Homebrew)
|
|
33
36
|
CREDENTIALS_PATH: path.join(os.homedir(), '.oaysus', 'credentials.json'),
|
|
34
37
|
// Config directory
|
|
35
38
|
CONFIG_DIR: path.join(os.homedir(), '.oaysus'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib/shared/config.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/lib/shared/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,0CAA0C;AAC1C,MAAM,YAAY,GAAG,yBAAyB,CAAC;AAC/C,MAAM,cAAc,GAAG,0BAA0B,CAAC;AAClD,MAAM,WAAW,GAAG,qDAAqD,CAAC;AAE1E;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,4BAA4B;IAC5B,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,0BAA0B,IAAI,YAAY;IAEpE,iDAAiD;IACjD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