tsoft-cli 3.12.4 → 3.13.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/CHANGELOG.md +29 -0
- package/README.md +184 -31
- package/locales/en.json +46 -8
- package/locales/tr.json +46 -8
- package/package.json +12 -7
- package/src/cli-settings.js +47 -0
- package/src/commands/config.js +38 -0
- package/src/commands/docs.js +23 -0
- package/src/commands/store.js +10 -3
- package/src/commands/theme-dev.js +9 -2
- package/src/commands/theme-init.js +3 -1
- package/src/commands/theme-section.js +21 -22
- package/src/commands/theme.js +25 -6
- package/src/commands/upgrade.js +116 -0
- package/src/index.js +180 -6
- package/src/ui/command-suggestion.js +78 -0
- package/src/ui/completion.js +189 -0
- package/src/ui/help-renderer.js +9 -0
- package/src/ui/table.js +122 -0
- package/src/ui/workspace-hint.js +82 -0
- package/src/upgrade-plan.js +43 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,35 @@ All notable changes to T-Soft CLI will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.13.1] - 2026-09-10
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- The directory warning added in 3.13.0 no longer fires inside the theme directory it is pointing at. Some commands record the active theme by its folder id and others by its name, while the directory on disk is always named after the theme — so for a theme recorded by id the two never matched, the warning appeared even in the right place, and the `cd` it offered named an id that no directory has. An id cannot be turned back into a directory name without asking the store, which this check deliberately avoids so it stays fast and works offline, so the warning is now skipped in that case. Themes recorded by name are unaffected and still get the warning outside their directory.
|
|
12
|
+
|
|
13
|
+
## [3.13.0] - 2026-09-10
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- Commands that work on theme files now say so when you are not standing in the theme directory. They quietly fell back to the saved theme, so a command run from the wrong place worked on a theme you were not looking at and gave no sign of it. The theme that will be used is now named, along with the directory to change into. Commands that create or fetch a theme are unaffected, and `--json` output is unchanged.
|
|
17
|
+
- `tsoft docs` opens the developer documentation. The address only lived in the README, so there was no way to reach the docs from the tool itself. It is printed as well as opened, and printed on its own when no browser can be opened, so it still helps over SSH or in a container.
|
|
18
|
+
- `tsoft completion bash|zsh|fish` prints a shell completion script built from the command tree, so `tsoft th` completes to `theme` and `tsoft theme d` to `dev`. Deprecated commands are left out. The README documents installing it for each shell.
|
|
19
|
+
- `tsoft upgrade` updates the CLI and works out how it was installed first: npm for a global install, volta under Volta. Running through `npx` fetches the latest version every time, so there is nothing to upgrade and the command says that instead of suggesting something that would not help. `tsoft update` does the same thing.
|
|
20
|
+
- The CLI checks once a day whether a newer version has been published and prints a line when there is one. A failed check is ignored, so being offline neither delays nor breaks whatever you were running. `tsoft config autoupgrade on|off|status` turns the check off; the setting lives in `~/.tsoft-cli/settings.json`.
|
|
21
|
+
- `theme create`, `theme fork` and `theme pull` print the `cd` step before `tsoft theme dev`. The first two skipped it and `pull` printed no follow-up at all, so the README described a step the tool never mentioned.
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
- `theme list`, `store list` and `theme section list` print as aligned tables. Each record used to spread over several lines, which made them hard to compare. Columns are trimmed to fit the terminal, so a narrow window no longer wraps a row, and `--json` output is unchanged.
|
|
25
|
+
- A mistyped command now exits non-zero. `tsoft themme push` printed the help screen and exited zero, so it looked like it had succeeded; scripts checking the exit code saw nothing wrong. This is a behaviour change for anything relying on that zero.
|
|
26
|
+
- The README now documents the whole CLI. Roughly half the command surface was missing from it — `theme init`/`fork`, `store list`, `store use`, `org switch`, `theme section create`, `theme section fork` and the global `--json`, `--verbose` and `--store` flags were all undocumented, so anyone reading the README had no way to discover them. It also now explains the per-store directory layout that decides which store and theme a command targets, and how to drive the CLI from CI with `--json`.
|
|
27
|
+
- The package carries a fuller set of npm keywords, so searching npm or Google for the T-Soft CLI finds this package rather than the retired `@tsoft-cli/theme`.
|
|
28
|
+
- `CONTRIBUTING.md` lists the two source files and the `scripts/` directory it had been missing, and documents the `check-locales` and `check-engine-floor` validation scripts.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
- A mistyped command now reports the mistake and offers the closest match instead of printing the help screen. The root command has an action attached, which meant the unknown-command branch was never reached and the suggestion machinery never ran. The same applied under `theme section`, where a typo opened the interactive menu. Both now tell apart no arguments, which still shows the menu or help, from an argument that matches nothing. A close match can be accepted to run the intended command.
|
|
32
|
+
- "Theme directory not found" no longer tells everyone to run `theme pull`. That is the wrong advice when the theme is already on disk and you are simply standing somewhere else, which was the more common case of the two. The two situations are now separate messages.
|
|
33
|
+
|
|
34
|
+
### Removed
|
|
35
|
+
- `cli-progress`, `cli-spinners` and `strip-ansi` are no longer direct dependencies. They were declared but imported nowhere; `strip-ansi` still arrives through `string-width` for the packages that need it.
|
|
36
|
+
|
|
8
37
|
## [3.12.4] - 2026-08-11
|
|
9
38
|
|
|
10
39
|
### Fixed
|
package/README.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# tsoft-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The official command-line tool for [tsoft360](https://tsoft360.com) theme development.
|
|
4
|
+
|
|
5
|
+
Build, preview and ship storefront themes from your terminal, with live reload during development and OAuth2 authentication against your store.
|
|
6
|
+
|
|
7
|
+
> **Looking for `@tsoft-cli/theme`?** That package is deprecated and no longer maintained. `tsoft-cli` is the official CLI — install it as shown below.
|
|
4
8
|
|
|
5
9
|
## Installation
|
|
6
10
|
|
|
@@ -8,6 +12,12 @@ Command-line tool for [tsoft360](https://tsoft360.com) theme development and man
|
|
|
8
12
|
npm install -g tsoft-cli
|
|
9
13
|
```
|
|
10
14
|
|
|
15
|
+
Verify the installation:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
tsoft --version
|
|
19
|
+
```
|
|
20
|
+
|
|
11
21
|
## Requirements
|
|
12
22
|
|
|
13
23
|
- Node.js >= 20.19.0
|
|
@@ -15,77 +25,220 @@ npm install -g tsoft-cli
|
|
|
15
25
|
## Quick Start
|
|
16
26
|
|
|
17
27
|
```bash
|
|
18
|
-
# Sign in
|
|
28
|
+
# 1. Sign in to your store
|
|
19
29
|
tsoft login
|
|
20
30
|
|
|
21
|
-
#
|
|
31
|
+
# 2. See which themes you have
|
|
22
32
|
tsoft theme list
|
|
23
33
|
|
|
24
|
-
#
|
|
34
|
+
# 3. Download one to work on
|
|
25
35
|
tsoft theme pull
|
|
26
36
|
|
|
27
|
-
# Start
|
|
37
|
+
# 4. Start developing with live reload
|
|
28
38
|
tsoft theme dev
|
|
39
|
+
|
|
40
|
+
# 5. Ship your changes
|
|
41
|
+
tsoft theme push
|
|
29
42
|
```
|
|
30
43
|
|
|
44
|
+
## Workspace Layout
|
|
45
|
+
|
|
46
|
+
The CLI organizes themes per store, one directory per store domain:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
my-projects/
|
|
50
|
+
└── example.com/ # store directory (named after your store domain)
|
|
51
|
+
├── my-theme/ # a theme
|
|
52
|
+
└── another-theme/
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Commands detect the store and theme from your current directory. Running `tsoft theme push` from inside `example.com/my-theme/` targets that store and theme without any flags. This also means new themes are created next to their siblings rather than nested inside the theme you happen to be in.
|
|
56
|
+
|
|
57
|
+
Use `--store <domain>` to override the detected store for a single command.
|
|
58
|
+
|
|
31
59
|
## Commands
|
|
32
60
|
|
|
61
|
+
### Global Flags
|
|
62
|
+
|
|
63
|
+
Available on every command:
|
|
64
|
+
|
|
65
|
+
| Flag | Description |
|
|
66
|
+
| ----------------- | ---------------------------------------- |
|
|
67
|
+
| `--json` | Machine-readable JSON output for CI/CD |
|
|
68
|
+
| `--verbose` | Verbose debug output |
|
|
69
|
+
| `--store <domain>` | Run against a specific store |
|
|
70
|
+
| `--version` | Print the installed version |
|
|
71
|
+
| `--help` | Show help |
|
|
72
|
+
|
|
33
73
|
### Authentication
|
|
34
74
|
|
|
35
75
|
| Command | Description |
|
|
36
|
-
|
|
37
|
-
| `tsoft login` |
|
|
38
|
-
| `tsoft logout` | Sign out and clear
|
|
39
|
-
| `tsoft whoami` | Show the signed-in user and active
|
|
40
|
-
|
|
41
|
-
###
|
|
42
|
-
|
|
43
|
-
| Command
|
|
44
|
-
|
|
|
45
|
-
| `tsoft
|
|
46
|
-
| `tsoft
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
|
51
|
-
|
|
|
52
|
-
| `tsoft
|
|
53
|
-
|
|
54
|
-
|
|
76
|
+
| -------------- | --------------------------------------- |
|
|
77
|
+
| `tsoft login` | Authenticate via OAuth2 |
|
|
78
|
+
| `tsoft logout` | Sign out and clear local credentials |
|
|
79
|
+
| `tsoft whoami` | Show the signed-in user and active store |
|
|
80
|
+
|
|
81
|
+
### Stores
|
|
82
|
+
|
|
83
|
+
| Command | Description |
|
|
84
|
+
| --------------------------- | ------------------------------------ |
|
|
85
|
+
| `tsoft store list` | List the stores you are signed in to |
|
|
86
|
+
| `tsoft store use [domain]` | Set the active store |
|
|
87
|
+
|
|
88
|
+
### Organizations
|
|
89
|
+
|
|
90
|
+
| Command | Description |
|
|
91
|
+
| ------------------- | ----------------------------- |
|
|
92
|
+
| `tsoft org switch` | Switch the active organization |
|
|
93
|
+
|
|
94
|
+
### Themes
|
|
95
|
+
|
|
96
|
+
| Command | Description |
|
|
97
|
+
| ---------------------------- | --------------------------------------- |
|
|
98
|
+
| `tsoft theme list` | List all themes in your store |
|
|
99
|
+
| `tsoft theme create [name]` | Create a new theme |
|
|
100
|
+
| `tsoft theme init` | Fork an existing theme into a new one |
|
|
101
|
+
| `tsoft theme pull` | Download an existing theme |
|
|
102
|
+
| `tsoft theme use [name]` | Set the active theme |
|
|
103
|
+
| `tsoft theme dev [name]` | Start the dev server with live reload |
|
|
104
|
+
| `tsoft theme push [name]` | Push theme files to your store |
|
|
105
|
+
|
|
106
|
+
`tsoft theme init` accepts `--from <slug>` to pick the source theme non-interactively, and is also available as `tsoft theme fork`.
|
|
107
|
+
|
|
108
|
+
### Sections
|
|
109
|
+
|
|
110
|
+
| Command | Description |
|
|
111
|
+
| ----------------------------- | -------------------------------------------- |
|
|
112
|
+
| `tsoft theme section` | Open the interactive section menu |
|
|
113
|
+
| `tsoft theme section list` | List all sections in the active theme |
|
|
114
|
+
| `tsoft theme section add` | Add a new section to the active theme |
|
|
115
|
+
| `tsoft theme section create` | Create an empty section in the active theme |
|
|
116
|
+
| `tsoft theme section fork` | Fork an existing section into the active theme |
|
|
117
|
+
|
|
118
|
+
## Developing a Theme
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
tsoft theme dev
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
This starts a local development server and watches your theme files. Edits are pushed to your store as you save, so you can preview changes without a manual push.
|
|
125
|
+
|
|
126
|
+
### Help
|
|
127
|
+
|
|
128
|
+
| Command | Description |
|
|
129
|
+
| ---------------------------------- | ---------------------------------------- |
|
|
130
|
+
| `tsoft docs` | Open the developer documentation |
|
|
131
|
+
| `tsoft completion <shell>` | Print a shell completion script |
|
|
132
|
+
| `tsoft upgrade` | Update the CLI (`tsoft update` also works) |
|
|
133
|
+
| `tsoft config autoupgrade <state>` | Turn the version check `on`, `off`, or show `status` |
|
|
134
|
+
|
|
135
|
+
## Staying Up To Date
|
|
136
|
+
|
|
137
|
+
`tsoft upgrade` reads the published version, works out how the CLI was installed
|
|
138
|
+
and runs the right command for it — `npm install -g` for a global install,
|
|
139
|
+
`volta install` under Volta. Running through `npx` always fetches the latest
|
|
140
|
+
version, so there is nothing to upgrade and the command says so.
|
|
141
|
+
|
|
142
|
+
Once a day the CLI also checks quietly and prints a line when a newer version
|
|
143
|
+
exists. The check is skipped when you are offline and never delays a command.
|
|
144
|
+
Turn it off with:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
tsoft config autoupgrade off
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
The setting is stored in `~/.tsoft-cli/settings.json`.
|
|
151
|
+
|
|
152
|
+
## Tab Completion
|
|
153
|
+
|
|
154
|
+
`tsoft completion` writes a completion script to stdout for `bash`, `zsh` or `fish`.
|
|
155
|
+
Once installed, `tsoft th<Tab>` completes to `theme` and `tsoft theme d<Tab>` to `dev`.
|
|
156
|
+
|
|
157
|
+
**bash**
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
tsoft completion bash > /usr/local/etc/bash_completion.d/tsoft
|
|
161
|
+
# or, without root:
|
|
162
|
+
echo 'source <(tsoft completion bash)' >> ~/.bashrc
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**zsh**
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
tsoft completion zsh > "${fpath[1]}/_tsoft"
|
|
169
|
+
# or:
|
|
170
|
+
echo 'source <(tsoft completion zsh)' >> ~/.zshrc
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**fish**
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
tsoft completion fish > ~/.config/fish/completions/tsoft.fish
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Open a new shell afterwards, or re-source the file you edited.
|
|
55
180
|
|
|
56
181
|
## Pushing a Theme
|
|
57
182
|
|
|
58
183
|
```bash
|
|
59
|
-
#
|
|
184
|
+
# Push the active theme
|
|
60
185
|
tsoft theme push
|
|
61
186
|
|
|
62
|
-
#
|
|
187
|
+
# Push a specific theme
|
|
63
188
|
tsoft theme push my-theme
|
|
64
189
|
|
|
65
|
-
#
|
|
190
|
+
# Show full error detail if a push fails
|
|
66
191
|
tsoft theme push --verbose
|
|
67
192
|
```
|
|
68
193
|
|
|
69
|
-
On the first push you enter
|
|
194
|
+
On the first push you enter an initial version number. Later pushes prompt for a semantic-versioning bump type (patch / minor / major).
|
|
195
|
+
|
|
196
|
+
## CI/CD Usage
|
|
197
|
+
|
|
198
|
+
Every command accepts `--json`, which disables colors and interactive prompts and emits structured output:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
tsoft theme list --json
|
|
202
|
+
tsoft whoami --json
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Combine with `--store` to target a specific store from a pipeline:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
tsoft theme push my-theme --store example.com --json
|
|
209
|
+
```
|
|
70
210
|
|
|
71
211
|
## Security
|
|
72
212
|
|
|
73
|
-
- **OAuth2 PKCE**:
|
|
74
|
-
- **State parameter**: CSRF protection
|
|
213
|
+
- **OAuth2 PKCE**: Authorization as a public client, no client secret on disk
|
|
214
|
+
- **State parameter**: CSRF protection during the authorization exchange
|
|
75
215
|
- **Secure storage**: Tokens are readable only by the owner (`chmod 600`)
|
|
76
216
|
- **Auto-refresh**: Access tokens are refreshed automatically when they expire
|
|
77
217
|
|
|
78
218
|
## Troubleshooting
|
|
79
219
|
|
|
80
220
|
```bash
|
|
81
|
-
#
|
|
221
|
+
# Who am I, and which store am I pointed at?
|
|
82
222
|
tsoft whoami
|
|
83
223
|
|
|
84
224
|
# Re-authenticate from scratch
|
|
85
225
|
tsoft logout
|
|
86
226
|
tsoft login
|
|
227
|
+
|
|
228
|
+
# Get full error detail on a failing command
|
|
229
|
+
tsoft theme push --verbose
|
|
87
230
|
```
|
|
88
231
|
|
|
232
|
+
If a command targets the wrong store, check the directory you are running it from — see [Workspace Layout](#workspace-layout) — or pass `--store <domain>` explicitly.
|
|
233
|
+
|
|
234
|
+
## Deprecated Commands
|
|
235
|
+
|
|
236
|
+
`tsoft theme publish` and `tsoft theme submit` are hidden aliases kept for backwards compatibility. `publish` forwards to `push`; theme submission is now done from the partner panel.
|
|
237
|
+
|
|
238
|
+
## Contributing
|
|
239
|
+
|
|
240
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
241
|
+
|
|
89
242
|
## License
|
|
90
243
|
|
|
91
244
|
[MIT](LICENSE)
|
package/locales/en.json
CHANGED
|
@@ -169,7 +169,6 @@
|
|
|
169
169
|
"dev.fork_source": "Source: {{source}} v{{version}}",
|
|
170
170
|
"dev.dir_exists_title": "Directory Exists",
|
|
171
171
|
"dev.dir_exists_prompt": "Directory already exists!\n\nLocation: {{path}}\n\nOverwrite?",
|
|
172
|
-
"dev.theme_not_found": "Theme directory not found!\n\nExpected: {{path}}\n\nSolution: tsoft theme pull",
|
|
173
172
|
"dev.checking_lock": "🔒 Checking lock status...",
|
|
174
173
|
"dev.not_locked": "✓ Theme is not locked",
|
|
175
174
|
"dev.acquiring_lock": "🔐 Acquiring lock...",
|
|
@@ -214,7 +213,7 @@
|
|
|
214
213
|
"init.theme_label": "Theme:",
|
|
215
214
|
"init.source_label": "Source:",
|
|
216
215
|
"init.location_label": "Location:",
|
|
217
|
-
"init.dev_tip": "To start development:
|
|
216
|
+
"init.dev_tip": "To start development:",
|
|
218
217
|
"init.json_error.message": "--from parameter required (interactive selection not supported in JSON mode)",
|
|
219
218
|
"init.json_error.hint": "Usage: tsoft --json theme fork --from <slug>",
|
|
220
219
|
"init.theme_not_found": "Theme not found: {{slug}}",
|
|
@@ -223,11 +222,6 @@
|
|
|
223
222
|
"section.list.active_theme": "Active Theme: {{theme}}",
|
|
224
223
|
"section.list.no_blocks": "▲ No blocks found yet.",
|
|
225
224
|
"section.list.count": "Total {{count}} blocks found:",
|
|
226
|
-
"section.list.id_label": "ID:",
|
|
227
|
-
"section.list.folder_label": "Folder:",
|
|
228
|
-
"section.list.sections_label": "Available sections ({{count}}):",
|
|
229
|
-
"section.list.tags_label": "Tags:",
|
|
230
|
-
"section.list.file_label": "File:",
|
|
231
225
|
"section.list.no_sections": "▲ No sections found for this block",
|
|
232
226
|
"section.add.no_active_theme": "No active theme found. Please run \"tsoft theme use <theme-name>\" first.",
|
|
233
227
|
"section.add.starting": "🔧 Starting section add operation...",
|
|
@@ -310,6 +304,8 @@
|
|
|
310
304
|
"help.group.development": "Development",
|
|
311
305
|
"help.group.theme_management": "Theme Management",
|
|
312
306
|
"help.group.account": "Account",
|
|
307
|
+
"help.group.help": "Help",
|
|
308
|
+
"help.cmd.docs": "Open the developer documentation in your browser",
|
|
313
309
|
"help.cmd.theme_dev": "Start theme development server with live reload",
|
|
314
310
|
"help.cmd.theme_push": "Push theme files to your store",
|
|
315
311
|
"help.cmd.theme_section_list": "List all sections in the active theme",
|
|
@@ -357,5 +353,47 @@
|
|
|
357
353
|
"store.search_prompt": "Search or pick a store",
|
|
358
354
|
"theme.use.on_store": "Store: {{store}}",
|
|
359
355
|
"theme.use.search_prompt": "Search or pick a theme",
|
|
360
|
-
"context.workspace": "From this directory: {{store}} · {{theme}}"
|
|
356
|
+
"context.workspace": "From this directory: {{store}} · {{theme}}",
|
|
357
|
+
"docs.opening": "Opening the developer documentation in your browser...",
|
|
358
|
+
"docs.open_failed": "Could not open a browser. You can reach the documentation at:",
|
|
359
|
+
"context.outside_theme": "You are outside the theme directory. This command will use your saved theme: {{store}} · {{theme}}",
|
|
360
|
+
"context.cd_hint": "To work inside that theme, change into its directory:",
|
|
361
|
+
"dev.theme_not_downloaded": "Theme directory not found!\n\nExpected: {{path}}\n\nThe theme has not been downloaded yet. To download it: tsoft theme pull",
|
|
362
|
+
"dev.theme_wrong_directory": "Theme directory not found!\n\nExpected: {{path}}\n\nYou may be in the wrong directory. Change into the theme directory:\n cd {{cd}}",
|
|
363
|
+
"error.unknown_command": "Unknown command: {{command}}",
|
|
364
|
+
"error.unknown_subcommand": "Unknown command: {{parent}} {{command}}",
|
|
365
|
+
"error.did_you_mean": "Did you mean: {{suggestion}}",
|
|
366
|
+
"error.see_help": "To see the available commands: tsoft --help",
|
|
367
|
+
"error.run_suggestion": "Run {{command}} instead?",
|
|
368
|
+
"help.cmd.completion": "Generate a shell completion script",
|
|
369
|
+
"completion.unsupported_shell": "Unsupported shell: {{shell}}\n\nSupported: {{supported}}",
|
|
370
|
+
"table.head.theme": "THEME",
|
|
371
|
+
"table.head.version": "VERSION",
|
|
372
|
+
"table.head.folder": "FOLDER",
|
|
373
|
+
"table.head.status": "STATUS",
|
|
374
|
+
"table.head.store": "STORE",
|
|
375
|
+
"table.head.session": "SESSION",
|
|
376
|
+
"table.head.block": "BLOCK",
|
|
377
|
+
"table.head.section": "SECTION",
|
|
378
|
+
"table.head.id": "ID",
|
|
379
|
+
"table.head.file": "FILE",
|
|
380
|
+
"table.head.description": "DESCRIPTION",
|
|
381
|
+
"help.cmd.upgrade": "Update the CLI to the latest version",
|
|
382
|
+
"help.cmd.config": "Show and change CLI settings",
|
|
383
|
+
"upgrade.checking": "Checking for the latest version...",
|
|
384
|
+
"upgrade.current": "You are already on the latest version: v{{version}}",
|
|
385
|
+
"upgrade.available": "A new version is available: v{{current}} → v{{latest}}",
|
|
386
|
+
"upgrade.running": "Running: {{command}}",
|
|
387
|
+
"upgrade.success": "Updated the CLI to v{{version}}.",
|
|
388
|
+
"upgrade.failed": "Update failed: {{error}}",
|
|
389
|
+
"upgrade.check_failed": "Could not read the published version. You may be offline.",
|
|
390
|
+
"upgrade.npx_notice": "You are running through npx, which downloads the latest version every time.\n\nTo install it permanently: npm install -g tsoft-cli",
|
|
391
|
+
"upgrade.unknown_install": "Could not work out how the CLI was installed.\n\nTo update it by hand: npm install -g tsoft-cli@latest",
|
|
392
|
+
"upgrade.notice": "A new version is available: v{{current}} → v{{latest}} ({{command}})",
|
|
393
|
+
"upgrade.notice_disable": "To silence this: tsoft config autoupgrade off",
|
|
394
|
+
"config.autoupgrade.on": "Version checking is on.",
|
|
395
|
+
"config.autoupgrade.off": "Version checking is off.",
|
|
396
|
+
"config.autoupgrade.status_on": "Version checking: on",
|
|
397
|
+
"config.autoupgrade.status_off": "Version checking: off",
|
|
398
|
+
"config.autoupgrade.usage": "Usage: tsoft config autoupgrade on | off | status"
|
|
361
399
|
}
|
package/locales/tr.json
CHANGED
|
@@ -169,7 +169,6 @@
|
|
|
169
169
|
"dev.fork_source": "Kaynak: {{source}} v{{version}}",
|
|
170
170
|
"dev.dir_exists_title": "Dizin Mevcut",
|
|
171
171
|
"dev.dir_exists_prompt": "Dizin zaten mevcut!\n\nKonum: {{path}}\n\nUzerine yazilsin mi?",
|
|
172
|
-
"dev.theme_not_found": "Tema dizini bulunamadı!\n\nBeklenen: {{path}}\n\nÇözüm: tsoft theme pull",
|
|
173
172
|
"dev.checking_lock": "🔒 Lock durumu kontrol ediliyor...",
|
|
174
173
|
"dev.not_locked": "✓ Tema kilitli değil",
|
|
175
174
|
"dev.acquiring_lock": "🔐 Kilit alınıyor...",
|
|
@@ -214,7 +213,7 @@
|
|
|
214
213
|
"init.theme_label": "Tema:",
|
|
215
214
|
"init.source_label": "Kaynak:",
|
|
216
215
|
"init.location_label": "Konum:",
|
|
217
|
-
"init.dev_tip": "Geliştirmeye başlamak için:
|
|
216
|
+
"init.dev_tip": "Geliştirmeye başlamak için:",
|
|
218
217
|
"init.json_error.message": "--from parametresi gerekli (JSON modda interaktif seçim desteklenmez)",
|
|
219
218
|
"init.json_error.hint": "Kullanim: tsoft --json theme fork --from <slug>",
|
|
220
219
|
"init.theme_not_found": "Tema bulunamadı: {{slug}}",
|
|
@@ -223,11 +222,6 @@
|
|
|
223
222
|
"section.list.active_theme": "Aktif Tema: {{theme}}",
|
|
224
223
|
"section.list.no_blocks": "▲ Henüz block bulunmuyor.",
|
|
225
224
|
"section.list.count": "Toplam {{count}} block bulundu:",
|
|
226
|
-
"section.list.id_label": "ID:",
|
|
227
|
-
"section.list.folder_label": "Klasör:",
|
|
228
|
-
"section.list.sections_label": "Mevcut section'lar ({{count}}):",
|
|
229
|
-
"section.list.tags_label": "Etiketler:",
|
|
230
|
-
"section.list.file_label": "Dosya:",
|
|
231
225
|
"section.list.no_sections": "▲ Bu block için section bulunmuyor",
|
|
232
226
|
"section.add.no_active_theme": "Aktif tema bulunamadı. Lütfen önce \"tsoft theme use <tema-adı>\" komutunu çalıştırın.",
|
|
233
227
|
"section.add.starting": "🔧 Section ekleme işlemi başlatılıyor...",
|
|
@@ -310,6 +304,8 @@
|
|
|
310
304
|
"help.group.development": "Geliştirme",
|
|
311
305
|
"help.group.theme_management": "Tema Yönetimi",
|
|
312
306
|
"help.group.account": "Hesap",
|
|
307
|
+
"help.group.help": "Yardım",
|
|
308
|
+
"help.cmd.docs": "Geliştirici dokümanını tarayıcıda açın",
|
|
313
309
|
"help.cmd.theme_dev": "Canlı yenileme ile tema geliştirme sunucusunu başlat",
|
|
314
310
|
"help.cmd.theme_push": "Tema dosyalarını mağazanıza gönderin",
|
|
315
311
|
"help.cmd.theme_section_list": "Aktif temadaki tüm section'ları listeleyin",
|
|
@@ -357,5 +353,47 @@
|
|
|
357
353
|
"store.search_prompt": "Mağaza arayın veya seçin",
|
|
358
354
|
"theme.use.on_store": "Mağaza: {{store}}",
|
|
359
355
|
"theme.use.search_prompt": "Tema arayın veya seçin",
|
|
360
|
-
"context.workspace": "Bulunduğunuz dizin: {{store}} · {{theme}}"
|
|
356
|
+
"context.workspace": "Bulunduğunuz dizin: {{store}} · {{theme}}",
|
|
357
|
+
"docs.opening": "Geliştirici dokümanı tarayıcıda açılıyor...",
|
|
358
|
+
"docs.open_failed": "Tarayıcı açılamadı. Dokümana şu adresten ulaşabilirsiniz:",
|
|
359
|
+
"context.outside_theme": "Tema dizininin dışındasınız. Komut kayıtlı temanız üzerinde çalışacak: {{store}} · {{theme}}",
|
|
360
|
+
"context.cd_hint": "Bu temanın dizinine geçmek için:",
|
|
361
|
+
"dev.theme_not_downloaded": "Tema dizini bulunamadı!\n\nBeklenen: {{path}}\n\nTema henüz indirilmemiş. İndirmek için: tsoft theme pull",
|
|
362
|
+
"dev.theme_wrong_directory": "Tema dizini bulunamadı!\n\nBeklenen: {{path}}\n\nYanlış dizinde olabilirsiniz. Tema dizinine geçin:\n cd {{cd}}",
|
|
363
|
+
"error.unknown_command": "Bilinmeyen komut: {{command}}",
|
|
364
|
+
"error.unknown_subcommand": "Bilinmeyen komut: {{parent}} {{command}}",
|
|
365
|
+
"error.did_you_mean": "Bunu mu demek istediniz: {{suggestion}}",
|
|
366
|
+
"error.see_help": "Komut listesi için: tsoft --help",
|
|
367
|
+
"error.run_suggestion": "{{command}} komutunu çalıştıralım mı?",
|
|
368
|
+
"help.cmd.completion": "Kabuk tamamlama betiği üretin",
|
|
369
|
+
"completion.unsupported_shell": "Desteklenmeyen kabuk: {{shell}}\n\nDesteklenenler: {{supported}}",
|
|
370
|
+
"table.head.theme": "TEMA",
|
|
371
|
+
"table.head.version": "SÜRÜM",
|
|
372
|
+
"table.head.folder": "KLASÖR",
|
|
373
|
+
"table.head.status": "DURUM",
|
|
374
|
+
"table.head.store": "MAĞAZA",
|
|
375
|
+
"table.head.session": "OTURUM",
|
|
376
|
+
"table.head.block": "BLOK",
|
|
377
|
+
"table.head.section": "SECTION",
|
|
378
|
+
"table.head.id": "ID",
|
|
379
|
+
"table.head.file": "DOSYA",
|
|
380
|
+
"table.head.description": "AÇIKLAMA",
|
|
381
|
+
"help.cmd.upgrade": "CLI'ı en son sürüme güncelleyin",
|
|
382
|
+
"help.cmd.config": "CLI ayarlarını görüntüleyin ve değiştirin",
|
|
383
|
+
"upgrade.checking": "En son sürüm kontrol ediliyor...",
|
|
384
|
+
"upgrade.current": "Zaten en son sürümü kullanıyorsunuz: v{{version}}",
|
|
385
|
+
"upgrade.available": "Yeni sürüm mevcut: v{{current}} → v{{latest}}",
|
|
386
|
+
"upgrade.running": "Çalıştırılıyor: {{command}}",
|
|
387
|
+
"upgrade.success": "CLI v{{version}} sürümüne güncellendi.",
|
|
388
|
+
"upgrade.failed": "Güncelleme başarısız: {{error}}",
|
|
389
|
+
"upgrade.check_failed": "Sürüm bilgisi alınamadı. Çevrimdışı olabilirsiniz.",
|
|
390
|
+
"upgrade.npx_notice": "npx ile çalıştırıyorsunuz; her çalıştırmada en son sürüm indirilir.\n\nKalıcı kurulum için: npm install -g tsoft-cli",
|
|
391
|
+
"upgrade.unknown_install": "Kurulum yöntemi belirlenemedi.\n\nEl ile güncellemek için: npm install -g tsoft-cli@latest",
|
|
392
|
+
"upgrade.notice": "Yeni sürüm mevcut: v{{current}} → v{{latest}} ({{command}})",
|
|
393
|
+
"upgrade.notice_disable": "Bu uyarıyı kapatmak için: tsoft config autoupgrade off",
|
|
394
|
+
"config.autoupgrade.on": "Sürüm kontrolü açıldı.",
|
|
395
|
+
"config.autoupgrade.off": "Sürüm kontrolü kapatıldı.",
|
|
396
|
+
"config.autoupgrade.status_on": "Sürüm kontrolü: açık",
|
|
397
|
+
"config.autoupgrade.status_off": "Sürüm kontrolü: kapalı",
|
|
398
|
+
"config.autoupgrade.usage": "Kullanım: tsoft config autoupgrade on | off | status"
|
|
361
399
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsoft-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.1",
|
|
4
4
|
"description": "Command-line tool for tsoft360 theme development and management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -20,10 +20,18 @@
|
|
|
20
20
|
},
|
|
21
21
|
"keywords": [
|
|
22
22
|
"tsoft",
|
|
23
|
+
"tsoft-cli",
|
|
24
|
+
"tsoft cli",
|
|
23
25
|
"tsoft360",
|
|
26
|
+
"tsoft theme",
|
|
27
|
+
"tsoft os2",
|
|
24
28
|
"cli",
|
|
25
29
|
"theme",
|
|
26
|
-
"development"
|
|
30
|
+
"theme development",
|
|
31
|
+
"twig",
|
|
32
|
+
"ecommerce",
|
|
33
|
+
"e-commerce",
|
|
34
|
+
"storefront"
|
|
27
35
|
],
|
|
28
36
|
"author": "T-Soft",
|
|
29
37
|
"license": "MIT",
|
|
@@ -41,14 +49,12 @@
|
|
|
41
49
|
"boxen": "^8.0.1",
|
|
42
50
|
"chalk": "^5.3.0",
|
|
43
51
|
"chokidar": "^5.0.0",
|
|
44
|
-
"cli-progress": "^3.12.0",
|
|
45
|
-
"cli-spinners": "^3.3.0",
|
|
46
52
|
"commander": "^12.1.0",
|
|
47
53
|
"gradient-string": "^3.0.0",
|
|
48
54
|
"open": "^10.1.0",
|
|
49
55
|
"ora": "^9.3.0",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
56
|
+
"semver": "^7.8.5",
|
|
57
|
+
"string-width": "^7.2.0"
|
|
52
58
|
},
|
|
53
59
|
"homepage": "https://github.com/tekrom/tsoft-cli",
|
|
54
60
|
"repository": {
|
|
@@ -56,7 +62,6 @@
|
|
|
56
62
|
"url": "git+https://github.com/tekrom/tsoft-cli.git"
|
|
57
63
|
},
|
|
58
64
|
"devDependencies": {
|
|
59
|
-
"semver": "^7.8.5",
|
|
60
65
|
"vitest": "^4.1.5"
|
|
61
66
|
}
|
|
62
67
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import fs from 'fs/promises';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
|
|
5
|
+
const SETTINGS_FILE = 'settings.json';
|
|
6
|
+
|
|
7
|
+
function settingsPath() {
|
|
8
|
+
return path.join(os.homedir(), '.tsoft-cli', SETTINGS_FILE);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async function readSettings() {
|
|
12
|
+
try {
|
|
13
|
+
return JSON.parse(await fs.readFile(settingsPath(), 'utf-8'));
|
|
14
|
+
} catch {
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async function writeSetting(key, value) {
|
|
20
|
+
const file = settingsPath();
|
|
21
|
+
const settings = await readSettings();
|
|
22
|
+
|
|
23
|
+
settings[key] = value;
|
|
24
|
+
|
|
25
|
+
await fs.mkdir(path.dirname(file), { recursive: true });
|
|
26
|
+
await fs.writeFile(file, JSON.stringify(settings, null, 2) + '\n');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function getAutoupgrade() {
|
|
30
|
+
const { autoupgrade } = await readSettings();
|
|
31
|
+
|
|
32
|
+
return autoupgrade !== false;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export async function setAutoupgrade(enabled) {
|
|
36
|
+
await writeSetting('autoupgrade', Boolean(enabled));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export async function getLastCheck() {
|
|
40
|
+
const { lastUpdateCheck } = await readSettings();
|
|
41
|
+
|
|
42
|
+
return Number.isFinite(lastUpdateCheck) ? lastUpdateCheck : 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export async function setLastCheck(timestamp) {
|
|
46
|
+
await writeSetting('lastUpdateCheck', timestamp);
|
|
47
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { isJsonMode, jsonOut } from '../output-mode.js';
|
|
2
|
+
import { showError, showInfo, showSuccess } from '../ui/prompt-wrapper.js';
|
|
3
|
+
import { getAutoupgrade, setAutoupgrade } from '../cli-settings.js';
|
|
4
|
+
import { t } from '../i18n.js';
|
|
5
|
+
|
|
6
|
+
export async function configAutoupgradeCommand(action = 'status') {
|
|
7
|
+
if (!['on', 'off', 'status'].includes(action)) {
|
|
8
|
+
if (isJsonMode()) {
|
|
9
|
+
jsonOut({ status: 'error', command: 'config autoupgrade', error: { message: t('config.autoupgrade.usage'), hint: null } });
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
showError(t('config.autoupgrade.usage'));
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (action === 'status') {
|
|
17
|
+
const enabled = await getAutoupgrade();
|
|
18
|
+
|
|
19
|
+
if (isJsonMode()) {
|
|
20
|
+
jsonOut({ status: 'ok', command: 'config autoupgrade', autoupgrade: enabled });
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
showInfo(enabled ? t('config.autoupgrade.status_on') : t('config.autoupgrade.status_off'));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const enabled = action === 'on';
|
|
29
|
+
|
|
30
|
+
await setAutoupgrade(enabled);
|
|
31
|
+
|
|
32
|
+
if (isJsonMode()) {
|
|
33
|
+
jsonOut({ status: 'ok', command: 'config autoupgrade', autoupgrade: enabled });
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
showSuccess(enabled ? t('config.autoupgrade.on') : t('config.autoupgrade.off'));
|
|
38
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import open from 'open';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { isJsonMode, jsonOut } from '../output-mode.js';
|
|
4
|
+
import { t } from '../i18n.js';
|
|
5
|
+
|
|
6
|
+
export const DOCS_URL = 'https://developer.tsoft.com.tr/';
|
|
7
|
+
|
|
8
|
+
export async function docsCommand() {
|
|
9
|
+
if (isJsonMode()) {
|
|
10
|
+
jsonOut({ url: DOCS_URL });
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
await open(DOCS_URL);
|
|
16
|
+
console.log(chalk.cyan(t('docs.opening')));
|
|
17
|
+
} catch {
|
|
18
|
+
console.log(chalk.yellow(t('docs.open_failed')));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
console.log(chalk.gray(` ${DOCS_URL}`));
|
|
22
|
+
console.log();
|
|
23
|
+
}
|