tiendu 0.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.
- package/LICENSE +21 -0
- package/README.md +194 -0
- package/bin/tiendu.js +111 -0
- package/bin/tiendu.mjs +111 -0
- package/lib/api.mjs +316 -0
- package/lib/config.mjs +76 -0
- package/lib/dev.mjs +222 -0
- package/lib/init.mjs +92 -0
- package/lib/preview.mjs +295 -0
- package/lib/publish.mjs +34 -0
- package/lib/pull.mjs +41 -0
- package/lib/push.mjs +95 -0
- package/lib/zip.mjs +36 -0
- package/package.json +41 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tiendu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# tiendu
|
|
2
|
+
|
|
3
|
+
Official CLI for [Tiendu](https://tiendu.uy) — develop and publish storefront themes from your local machine.
|
|
4
|
+
|
|
5
|
+
Download your store's theme, edit files locally, preview changes live with a shareable URL, and publish when you're ready — all from the terminal.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Requirements
|
|
10
|
+
|
|
11
|
+
- Node.js 20 or higher
|
|
12
|
+
- A Tiendu store
|
|
13
|
+
- A Tiendu API key (request one at hola@tiendu.uy)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -g tiendu
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Quick start
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# Create a working directory and enter it
|
|
29
|
+
mkdir my-theme && cd my-theme
|
|
30
|
+
|
|
31
|
+
# Connect to your store
|
|
32
|
+
tiendu init
|
|
33
|
+
|
|
34
|
+
# Download the current live theme
|
|
35
|
+
tiendu pull
|
|
36
|
+
|
|
37
|
+
# Start developing with live preview
|
|
38
|
+
tiendu dev
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`tiendu dev` creates a remote preview of your theme, uploads your local files, watches for changes and syncs them automatically, and prints a shareable URL like:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
http://preview-xxxxxxxxxxxx.tiendu.uy/
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The preview renders with the real Tiendu engine — same output as production. Share the URL with your client or team before publishing.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Commands
|
|
52
|
+
|
|
53
|
+
### `tiendu init`
|
|
54
|
+
|
|
55
|
+
Initializes a theme project in the current directory. Prompts for your API key, API base URL (defaults to `https://tiendu.uy`), and store ID. Saves configuration to `.cli/`.
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
tiendu init
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
> Add `.cli/` to your `.gitignore` if you version-control your theme — it contains your API key.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
### `tiendu pull`
|
|
66
|
+
|
|
67
|
+
Downloads the current live theme from your store as local files. Run this once to get started, or to reset your local files to the published version.
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
tiendu pull
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
### `tiendu dev`
|
|
76
|
+
|
|
77
|
+
The main development command. On first run it creates a remote preview, uploads your local files, and starts watching for changes. Every file you save is automatically synced to the preview.
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
tiendu dev
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
- Prints the preview URL on start
|
|
84
|
+
- Syncs file creates, edits and deletes
|
|
85
|
+
- Handles both text and binary files (images, fonts, etc.)
|
|
86
|
+
- Press `Ctrl+C` to stop
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
### `tiendu push`
|
|
91
|
+
|
|
92
|
+
Zips all local files (excluding dotfiles) and uploads them to the active preview, replacing its content entirely. Use this instead of `tiendu dev` if you prefer manual syncs.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
tiendu push
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
### `tiendu publish`
|
|
101
|
+
|
|
102
|
+
Publishes the active preview to the live storefront. Visitors will see the new theme immediately. All previews for the store are removed after publishing.
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
tiendu publish
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
### `tiendu preview create [name]`
|
|
111
|
+
|
|
112
|
+
Creates a new remote preview. Fails with a conflict error if one already exists for your account on this store — delete it first with `tiendu preview delete`.
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
tiendu preview create
|
|
116
|
+
tiendu preview create "Winter campaign"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
### `tiendu preview list`
|
|
122
|
+
|
|
123
|
+
Lists all previews for your store.
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
tiendu preview list
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
### `tiendu preview delete`
|
|
132
|
+
|
|
133
|
+
Deletes the active preview (both remotely and from your local config).
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
tiendu preview delete
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
### `tiendu preview open`
|
|
142
|
+
|
|
143
|
+
Opens the active preview URL in your default browser.
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
tiendu preview open
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Typical workflow
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
tiendu init # one time: connect to your store
|
|
155
|
+
tiendu pull # one time: download the live theme
|
|
156
|
+
|
|
157
|
+
tiendu dev # develop: edit locally, see changes live at the preview URL
|
|
158
|
+
|
|
159
|
+
tiendu publish # when ready: push to the live storefront
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## How previews work
|
|
165
|
+
|
|
166
|
+
A **theme preview** is a remote copy of your theme hosted by Tiendu. It renders with the exact same engine as your live storefront — same Liquid templates, same data, same assets — so what you see in the preview is exactly what production will look like.
|
|
167
|
+
|
|
168
|
+
- One preview per user per store
|
|
169
|
+
- Preview URLs are stable and shareable
|
|
170
|
+
- Previews are excluded from search engines (`noindex`)
|
|
171
|
+
- Analytics are disabled in preview mode so test traffic doesn't pollute your metrics
|
|
172
|
+
- Cart and checkout work normally in previews (orders placed in a preview are real orders)
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Local project structure
|
|
177
|
+
|
|
178
|
+
After `tiendu pull` your directory will look like your store's theme. The `.cli/` folder holds local CLI configuration and is never uploaded to Tiendu.
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
my-theme/
|
|
182
|
+
├── .cli/ # local config (API key, store ID, active preview key)
|
|
183
|
+
├── layout/
|
|
184
|
+
├── templates/
|
|
185
|
+
├── snippets/
|
|
186
|
+
├── assets/
|
|
187
|
+
└── ...
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## License
|
|
193
|
+
|
|
194
|
+
MIT — see [LICENSE](LICENSE).
|
package/bin/tiendu.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { init } from "../lib/init.mjs";
|
|
4
|
+
import { pull } from "../lib/pull.mjs";
|
|
5
|
+
import { push } from "../lib/push.mjs";
|
|
6
|
+
import { dev } from "../lib/dev.mjs";
|
|
7
|
+
import { publish } from "../lib/publish.mjs";
|
|
8
|
+
import {
|
|
9
|
+
previewCreate,
|
|
10
|
+
previewList,
|
|
11
|
+
previewDelete,
|
|
12
|
+
previewOpen,
|
|
13
|
+
} from "../lib/preview.mjs";
|
|
14
|
+
|
|
15
|
+
const HELP = `
|
|
16
|
+
tiendu — CLI para desarrollar temas de Tiendu
|
|
17
|
+
|
|
18
|
+
Uso:
|
|
19
|
+
tiendu init Inicializar un tema en el directorio actual
|
|
20
|
+
tiendu pull Descargar el tema live desde Tiendu
|
|
21
|
+
tiendu push Subir archivos locales al preview activo (ZIP)
|
|
22
|
+
tiendu dev Modo desarrollo: watch + sync automático
|
|
23
|
+
tiendu publish Publicar el preview activo al storefront live
|
|
24
|
+
|
|
25
|
+
tiendu preview create Crear un preview remoto
|
|
26
|
+
tiendu preview list Listar previews de la tienda
|
|
27
|
+
tiendu preview delete Eliminar el preview activo
|
|
28
|
+
tiendu preview open Abrir la URL del preview en el navegador
|
|
29
|
+
|
|
30
|
+
tiendu help Mostrar esta ayuda
|
|
31
|
+
|
|
32
|
+
Opciones:
|
|
33
|
+
--help, -h Mostrar esta ayuda
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
const main = async () => {
|
|
37
|
+
const args = process.argv.slice(2);
|
|
38
|
+
const command = args[0];
|
|
39
|
+
const subcommand = args[1];
|
|
40
|
+
|
|
41
|
+
if (
|
|
42
|
+
!command ||
|
|
43
|
+
command === "help" ||
|
|
44
|
+
command === "--help" ||
|
|
45
|
+
command === "-h"
|
|
46
|
+
) {
|
|
47
|
+
console.log(HELP.trim());
|
|
48
|
+
process.exit(0);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (command === "init") {
|
|
52
|
+
await init();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (command === "pull") {
|
|
57
|
+
await pull();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (command === "push") {
|
|
62
|
+
await push();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (command === "dev") {
|
|
67
|
+
await dev();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (command === "publish") {
|
|
72
|
+
await publish();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (command === "preview") {
|
|
77
|
+
if (subcommand === "create") {
|
|
78
|
+
const name = args[2];
|
|
79
|
+
await previewCreate(name);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (subcommand === "list") {
|
|
84
|
+
await previewList();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (subcommand === "delete") {
|
|
89
|
+
await previewDelete();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (subcommand === "open") {
|
|
94
|
+
await previewOpen();
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
console.error(`Subcomando desconocido: preview ${subcommand ?? "(vacío)"}`);
|
|
99
|
+
console.log(HELP.trim());
|
|
100
|
+
process.exit(1);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
console.error(`Comando desconocido: ${command}`);
|
|
104
|
+
console.log(HELP.trim());
|
|
105
|
+
process.exit(1);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
main().catch((error) => {
|
|
109
|
+
console.error(error.message || error);
|
|
110
|
+
process.exit(1);
|
|
111
|
+
});
|
package/bin/tiendu.mjs
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { init } from "../lib/init.mjs";
|
|
4
|
+
import { pull } from "../lib/pull.mjs";
|
|
5
|
+
import { push } from "../lib/push.mjs";
|
|
6
|
+
import { dev } from "../lib/dev.mjs";
|
|
7
|
+
import { publish } from "../lib/publish.mjs";
|
|
8
|
+
import {
|
|
9
|
+
previewCreate,
|
|
10
|
+
previewList,
|
|
11
|
+
previewDelete,
|
|
12
|
+
previewOpen,
|
|
13
|
+
} from "../lib/preview.mjs";
|
|
14
|
+
|
|
15
|
+
const HELP = `
|
|
16
|
+
tiendu — CLI para desarrollar temas de Tiendu
|
|
17
|
+
|
|
18
|
+
Uso:
|
|
19
|
+
tiendu init Inicializar un tema en el directorio actual
|
|
20
|
+
tiendu pull Descargar el tema live desde Tiendu
|
|
21
|
+
tiendu push Subir archivos locales al preview activo (ZIP)
|
|
22
|
+
tiendu dev Modo desarrollo: watch + sync automático
|
|
23
|
+
tiendu publish Publicar el preview activo al storefront live
|
|
24
|
+
|
|
25
|
+
tiendu preview create Crear un preview remoto
|
|
26
|
+
tiendu preview list Listar previews de la tienda
|
|
27
|
+
tiendu preview delete Eliminar el preview activo
|
|
28
|
+
tiendu preview open Abrir la URL del preview en el navegador
|
|
29
|
+
|
|
30
|
+
tiendu help Mostrar esta ayuda
|
|
31
|
+
|
|
32
|
+
Opciones:
|
|
33
|
+
--help, -h Mostrar esta ayuda
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
const main = async () => {
|
|
37
|
+
const args = process.argv.slice(2);
|
|
38
|
+
const command = args[0];
|
|
39
|
+
const subcommand = args[1];
|
|
40
|
+
|
|
41
|
+
if (
|
|
42
|
+
!command ||
|
|
43
|
+
command === "help" ||
|
|
44
|
+
command === "--help" ||
|
|
45
|
+
command === "-h"
|
|
46
|
+
) {
|
|
47
|
+
console.log(HELP.trim());
|
|
48
|
+
process.exit(0);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (command === "init") {
|
|
52
|
+
await init();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (command === "pull") {
|
|
57
|
+
await pull();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (command === "push") {
|
|
62
|
+
await push();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (command === "dev") {
|
|
67
|
+
await dev();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (command === "publish") {
|
|
72
|
+
await publish();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (command === "preview") {
|
|
77
|
+
if (subcommand === "create") {
|
|
78
|
+
const name = args[2];
|
|
79
|
+
await previewCreate(name);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (subcommand === "list") {
|
|
84
|
+
await previewList();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (subcommand === "delete") {
|
|
89
|
+
await previewDelete();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (subcommand === "open") {
|
|
94
|
+
await previewOpen();
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
console.error(`Subcomando desconocido: preview ${subcommand ?? "(vacío)"}`);
|
|
99
|
+
console.log(HELP.trim());
|
|
100
|
+
process.exit(1);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
console.error(`Comando desconocido: ${command}`);
|
|
104
|
+
console.log(HELP.trim());
|
|
105
|
+
process.exit(1);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
main().catch((error) => {
|
|
109
|
+
console.error(error.message || error);
|
|
110
|
+
process.exit(1);
|
|
111
|
+
});
|