scripting-cli 1.1.12 → 1.2.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/README.md +41 -30
- package/README_de.md +106 -0
- package/README_fr.md +106 -0
- package/README_it.md +106 -0
- package/README_ja.md +106 -0
- package/README_zh.md +42 -31
- package/dist/const.js +5 -0
- package/dist/controller.js +18 -19
- package/dist/index.js +58 -0
- package/dist/start_server.js +40 -30
- package/dist/util.js +68 -3
- package/package.json +2 -2
- package/src/const.ts +2 -0
- package/src/controller.ts +21 -25
- package/src/index.ts +28 -2
- package/src/start_server.ts +50 -37
- package/src/util.ts +76 -3
package/README.md
CHANGED
|
@@ -1,29 +1,35 @@
|
|
|
1
|
-
# Scripting
|
|
1
|
+
# Scripting App Command-Line Tool
|
|
2
2
|
|
|
3
|
-
Welcome to the `scripting-cli
|
|
3
|
+
Welcome to the `scripting-cli`, the command-line tool designed for integrating with the Scripting app. This tool allows you to synchronize and preview your scripts in real-time as you develop them using your favorite desktop editor, such as VSCode.
|
|
4
4
|
|
|
5
|
-
[
|
|
5
|
+
[中文](./README_zh.md) | [日本語](./README_ja.md) | [Deutsch](./README_de.md) | [Français](./README_fr.md) | [Italiano](./README_it.md)
|
|
6
6
|
|
|
7
7
|
## Prerequisites
|
|
8
8
|
|
|
9
|
-
Before using `scripting-cli`,
|
|
9
|
+
Before using `scripting-cli`, ensure the following requirements are met:
|
|
10
|
+
|
|
11
|
+
1. **Node.js**: Make sure you have a recent version of Node.js installed. To check your current version, run:
|
|
10
12
|
|
|
11
|
-
1. **Node.js**: Ensure you have a recent version of Node.js installed. You can check your Node.js version by running:
|
|
12
13
|
```bash
|
|
13
14
|
node -v
|
|
14
15
|
```
|
|
15
16
|
|
|
16
|
-
2. **Scripting App**: The Scripting app must be installed to connect with the local service
|
|
17
|
+
2. **Scripting App**: The Scripting app must be installed in order to connect with the local service started by `scripting-cli`.
|
|
17
18
|
|
|
18
19
|
## Installation
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
There’s no need to install `scripting-cli` globally. Simply run it using `npx`:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx scripting-cli <command>
|
|
25
|
+
```
|
|
21
26
|
|
|
22
27
|
## Usage
|
|
23
28
|
|
|
24
29
|
### 1. Create a Working Directory
|
|
25
30
|
|
|
26
|
-
|
|
31
|
+
Start by creating a directory where your Scripting app scripts will reside. For example:
|
|
32
|
+
|
|
27
33
|
```bash
|
|
28
34
|
mkdir my-scripting-project
|
|
29
35
|
cd my-scripting-project
|
|
@@ -31,65 +37,70 @@ cd my-scripting-project
|
|
|
31
37
|
|
|
32
38
|
### 2. Start the Local Service
|
|
33
39
|
|
|
34
|
-
In your working directory, run the following command to start the local service:
|
|
40
|
+
In your working directory, run the following command to start the local development service:
|
|
35
41
|
|
|
36
42
|
```bash
|
|
37
43
|
npx scripting-cli start
|
|
38
44
|
```
|
|
39
45
|
|
|
40
|
-
By default, this
|
|
46
|
+
By default, this starts the service on port `3000`. To specify a different port, use the `--port` option:
|
|
41
47
|
|
|
42
48
|
```bash
|
|
43
|
-
npx scripting-cli start --port
|
|
49
|
+
npx scripting-cli start --port=4000
|
|
44
50
|
```
|
|
45
51
|
|
|
46
|
-
|
|
52
|
+
To enable Bonjour support—allowing the Scripting app to automatically detect the local service—add the `--bonjour` flag:
|
|
53
|
+
|
|
47
54
|
```bash
|
|
48
|
-
npx scripting-cli start --
|
|
55
|
+
npx scripting-cli start --bonjour
|
|
49
56
|
```
|
|
50
57
|
|
|
51
58
|
### 3. Connect the Scripting App
|
|
52
59
|
|
|
53
|
-
Once the service is running, open the **Scripting app** and
|
|
60
|
+
Once the service is running, open the **Scripting app** and connect to the local service you just started. This establishes a connection between the app and your working directory.
|
|
54
61
|
|
|
55
|
-
### 4. Debug and Synchronize Code
|
|
62
|
+
### 4. Debug and Synchronize Your Code
|
|
56
63
|
|
|
57
|
-
After connecting,
|
|
64
|
+
After connecting, select the script project you want to debug. The Scripting app will automatically sync the project’s code with your working directory.
|
|
58
65
|
|
|
59
66
|
### 5. Real-Time Code Synchronization
|
|
60
67
|
|
|
61
|
-
As you write and save scripts
|
|
68
|
+
As you write and save scripts using your desktop editor (e.g., VSCode), the changes will automatically sync with the Scripting app and be executed in real-time—making development and debugging much smoother.
|
|
62
69
|
|
|
63
70
|
## Example Workflow
|
|
64
71
|
|
|
65
72
|
1. Start the local service:
|
|
73
|
+
|
|
66
74
|
```bash
|
|
67
75
|
npx scripting-cli start
|
|
68
76
|
```
|
|
69
77
|
|
|
70
|
-
2. Open your
|
|
78
|
+
2. Open your editor and write your script.
|
|
71
79
|
|
|
72
80
|
3. Save the script file.
|
|
73
81
|
|
|
74
|
-
4. The code automatically
|
|
82
|
+
4. The updated code is automatically synchronized with the Scripting app and executed.
|
|
75
83
|
|
|
76
84
|
## Additional Information
|
|
77
85
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
* The default port is `3000`. If it’s already in use, specify a different one with the `--port` option.
|
|
87
|
+
* Use the `--no-auto-open` flag to prevent the tool from opening `index.tsx` or `widget.tsx` automatically:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npx scripting-cli start --no-auto-open
|
|
91
|
+
```
|
|
92
|
+
* To use the Bonjour service, ensure your system supports it. On Windows, you may need to install Bonjour manually. Then, use the `--bonjour` option to enable it.
|
|
93
|
+
* This tool is ideal for users who prefer desktop editors like VSCode and want seamless code synchronization and debugging with the Scripting app.
|
|
84
94
|
|
|
85
95
|
## Troubleshooting
|
|
86
96
|
|
|
87
|
-
If you encounter
|
|
97
|
+
If you encounter issues:
|
|
88
98
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
99
|
+
* Ensure you're using Node.js version 20 or higher.
|
|
100
|
+
* Verify the Scripting app is properly connected to the local service.
|
|
101
|
+
* Make sure no other process is occupying your chosen port.
|
|
102
|
+
* Always run the tool using `npx scripting-cli <command>`, and check that the package is up to date.
|
|
92
103
|
|
|
93
104
|
---
|
|
94
105
|
|
|
95
|
-
Enjoy using `scripting-cli`
|
|
106
|
+
Enjoy using `scripting-cli` in your Scripting app development workflow. Happy coding!
|
package/README_de.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Scripting-App-Befehlszeilentool
|
|
2
|
+
|
|
3
|
+
Willkommen beim `scripting-cli`, dem Befehlszeilentool für die Integration mit der Scripting-App. Dieses Tool ermöglicht es Ihnen, Ihre Skripte in Echtzeit zu synchronisieren und während der Entwicklung mit Ihrem bevorzugten Desktop-Editor, wie z. B. VSCode, anzuzeigen.
|
|
4
|
+
|
|
5
|
+
[English](./README.md) | [中文](./README_zh.md) | [日本語](./README_ja.md) | [Français](./README_fr.md) | [Italiano](./README_it.md)
|
|
6
|
+
|
|
7
|
+
## Voraussetzungen
|
|
8
|
+
|
|
9
|
+
Bevor Sie `scripting-cli` verwenden, stellen Sie sicher, dass die folgenden Anforderungen erfüllt sind:
|
|
10
|
+
|
|
11
|
+
1. **Node.js**: Stellen Sie sicher, dass eine aktuelle Version von Node.js installiert ist. Überprüfen Sie Ihre aktuelle Version mit:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
node -v
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. **Scripting-App**: Die Scripting-App muss installiert sein, um eine Verbindung mit dem lokalen Dienst herzustellen, der von `scripting-cli` gestartet wird.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
Es ist keine globale Installation von `scripting-cli` erforderlich. Führen Sie es einfach mit `npx` aus:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx scripting-cli <command>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Verwendung
|
|
28
|
+
|
|
29
|
+
### 1. Arbeitsverzeichnis erstellen
|
|
30
|
+
|
|
31
|
+
Erstellen Sie ein Verzeichnis, in dem Ihre Scripting-App-Skripte gespeichert werden. Zum Beispiel:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
mkdir my-scripting-project
|
|
35
|
+
cd my-scripting-project
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 2. Lokalen Dienst starten
|
|
39
|
+
|
|
40
|
+
Führen Sie im Arbeitsverzeichnis den folgenden Befehl aus, um den lokalen Entwicklungsdienst zu starten:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npx scripting-cli start
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Standardmäßig wird der Dienst auf Port `3000` gestartet. Um einen anderen Port anzugeben, verwenden Sie die Option `--port`:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npx scripting-cli start --port=4000
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Um Bonjour-Unterstützung zu aktivieren, sodass die Scripting-App den lokalen Dienst automatisch erkennt, fügen Sie das Flag `--bonjour` hinzu:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx scripting-cli start --bonjour
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 3. Scripting-App verbinden
|
|
59
|
+
|
|
60
|
+
Sobald der Dienst läuft, öffnen Sie die **Scripting-App** und verbinden Sie sich mit dem gerade gestarteten lokalen Dienst. Dadurch wird eine Verbindung zwischen der App und Ihrem Arbeitsverzeichnis hergestellt.
|
|
61
|
+
|
|
62
|
+
### 4. Code debuggen und synchronisieren
|
|
63
|
+
|
|
64
|
+
Nach der Verbindung wählen Sie das Skriptprojekt aus, das Sie debuggen möchten. Die Scripting-App synchronisiert den Code dieses Projekts automatisch mit Ihrem Arbeitsverzeichnis.
|
|
65
|
+
|
|
66
|
+
### 5. Echtzeit-Code-Synchronisierung
|
|
67
|
+
|
|
68
|
+
Wenn Sie Skripte in Ihrem Desktop-Editor (z. B. VSCode) schreiben und speichern, werden die Änderungen automatisch mit der Scripting-App synchronisiert und in Echtzeit ausgeführt, was die Entwicklung und das Debugging erheblich erleichtert.
|
|
69
|
+
|
|
70
|
+
## Beispiel-Workflow
|
|
71
|
+
|
|
72
|
+
1. Lokalen Dienst starten:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npx scripting-cli start
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
2. Öffnen Sie Ihren Editor und schreiben Sie Ihr Skript.
|
|
79
|
+
|
|
80
|
+
3. Speichern Sie die Skriptdatei.
|
|
81
|
+
|
|
82
|
+
4. Der aktualisierte Code wird automatisch mit der Scripting-App synchronisiert und ausgeführt.
|
|
83
|
+
|
|
84
|
+
## Zusätzliche Informationen
|
|
85
|
+
|
|
86
|
+
* Der Standardport ist `3000`. Wenn dieser bereits verwendet wird, geben Sie mit der Option `--port` einen anderen an.
|
|
87
|
+
* Verwenden Sie das Flag `--no-auto-open`, um zu verhindern, dass das Tool automatisch `index.tsx` oder `widget.tsx` öffnet:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npx scripting-cli start --no-auto-open
|
|
91
|
+
```
|
|
92
|
+
* Um den Bonjour-Dienst zu nutzen, stellen Sie sicher, dass Ihr System diese Funktion unterstützt. Unter Windows müssen Sie Bonjour möglicherweise manuell installieren. Verwenden Sie dann die Option `--bonjour`, um den Dienst zu aktivieren.
|
|
93
|
+
* Dieses Tool ist ideal für Benutzer, die Desktop-Editoren wie VSCode bevorzugen und eine nahtlose Code-Synchronisierung und Debugging mit der Scripting-App wünschen.
|
|
94
|
+
|
|
95
|
+
## Fehlerbehebung
|
|
96
|
+
|
|
97
|
+
Wenn Sie auf Probleme stoßen, stellen Sie sicher, dass:
|
|
98
|
+
|
|
99
|
+
* Sie Node.js Version 20 oder höher verwenden.
|
|
100
|
+
* Die Scripting-App korrekt mit dem lokalen Dienst verbunden ist.
|
|
101
|
+
* Der von Ihnen gewählte Port nicht von einem anderen Prozess verwendet wird.
|
|
102
|
+
* Sie das Tool immer mit `npx scripting-cli <command>` ausführen und sicherstellen, dass das Paket auf dem neuesten Stand ist.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
Viel Spaß beim Verwenden von `scripting-cli` in Ihrem Scripting-App-Entwicklungsworkflow! Viel Erfolg beim Codieren!
|
package/README_fr.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Outil en ligne de commande pour l'application Scripting
|
|
2
|
+
|
|
3
|
+
Bienvenue dans `scripting-cli`, l'outil en ligne de commande conçu pour l'intégration avec l'application Scripting. Cet outil vous permet de synchroniser et de prévisualiser vos scripts en temps réel pendant que vous les développez à l'aide de votre éditeur de bureau préféré, tel que VSCode.
|
|
4
|
+
|
|
5
|
+
[English](./README.md) | [中文](./README_zh.md) | [日本語](./README_ja.md) | [Deutsch](./README_de.md) | [Italiano](./README_it.md)
|
|
6
|
+
|
|
7
|
+
## Prérequis
|
|
8
|
+
|
|
9
|
+
Avant d'utiliser `scripting-cli`, assurez-vous que les conditions suivantes sont remplies :
|
|
10
|
+
|
|
11
|
+
1. **Node.js** : Assurez-vous qu'une version récente de Node.js est installée. Vérifiez votre version actuelle avec :
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
node -v
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. **Application Scripting** : L'application Scripting doit être installée pour se connecter au service local lancé par `scripting-cli`.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
Il n'est pas nécessaire d'installer `scripting-cli` globalement. Exécutez-le simplement avec `npx` :
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx scripting-cli <command>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Utilisation
|
|
28
|
+
|
|
29
|
+
### 1. Créer un répertoire de travail
|
|
30
|
+
|
|
31
|
+
Créez un répertoire où vos scripts de l'application Scripting seront stockés. Par exemple :
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
mkdir my-scripting-project
|
|
35
|
+
cd my-scripting-project
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 2. Démarrer le service local
|
|
39
|
+
|
|
40
|
+
Dans votre répertoire de travail, exécutez la commande suivante pour démarrer le service de développement local :
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npx scripting-cli start
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Par défaut, ce service démarre sur le port `3000`. Pour spécifier un autre port, utilisez l'option `--port` :
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npx scripting-cli start --port=4000
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Pour activer la prise en charge de Bonjour, permettant à l'application Scripting de détecter automatiquement le service local, ajoutez le drapeau `--bonjour` :
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx scripting-cli start --bonjour
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 3. Connecter l'application Scripting
|
|
59
|
+
|
|
60
|
+
Une fois le service en cours d'exécution, ouvrez l'**application Scripting** et connectez-vous au service local que vous venez de démarrer. Cela établira une connexion entre l'application et votre répertoire de travail.
|
|
61
|
+
|
|
62
|
+
### 4. Déboguer et synchroniser le code
|
|
63
|
+
|
|
64
|
+
Après la connexion, sélectionnez le projet de script que vous souhaitez déboguer. L'application Scripting synchronisera automatiquement le code de ce projet avec votre répertoire de travail.
|
|
65
|
+
|
|
66
|
+
### 5. Synchronisation du code en temps réel
|
|
67
|
+
|
|
68
|
+
Lorsque vous écrivez et enregistrez des scripts dans votre éditeur de bureau (par exemple, VSCode), les modifications seront automatiquement synchronisées avec l'application Scripting et exécutées en temps réel, rendant le développement et le débogage beaucoup plus fluides.
|
|
69
|
+
|
|
70
|
+
## Exemple de flux de travail
|
|
71
|
+
|
|
72
|
+
1. Démarrer le service local :
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npx scripting-cli start
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
2. Ouvrez votre éditeur et écrivez votre script.
|
|
79
|
+
|
|
80
|
+
3. Enregistrez le fichier de script.
|
|
81
|
+
|
|
82
|
+
4. Le code mis à jour est automatiquement synchronisé avec l'application Scripting et exécuté.
|
|
83
|
+
|
|
84
|
+
## Informations supplémentaires
|
|
85
|
+
|
|
86
|
+
* Le port par défaut est `3000`. S'il est déjà utilisé, spécifiez-en un autre avec l'option `--port`.
|
|
87
|
+
* Utilisez le drapeau `--no-auto-open` pour empêcher l'outil d'ouvrir automatiquement `index.tsx` ou `widget.tsx` :
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npx scripting-cli start --no-auto-open
|
|
91
|
+
```
|
|
92
|
+
* Pour utiliser le service Bonjour, assurez-vous que votre système le prend en charge. Sur Windows, vous devrez peut-être installer Bonjour manuellement. Ensuite, utilisez l'option `--bonjour` pour l'activer.
|
|
93
|
+
* Cet outil est idéal pour les utilisateurs qui préfèrent les éditeurs de bureau comme VSCode et souhaitent une synchronisation et un débogage du code sans faille avec l'application Scripting.
|
|
94
|
+
|
|
95
|
+
## Dépannage
|
|
96
|
+
|
|
97
|
+
Si vous rencontrez des problèmes, assurez-vous que :
|
|
98
|
+
|
|
99
|
+
* Vous utilisez Node.js version 20 ou supérieure.
|
|
100
|
+
* L'application Scripting est correctement connectée au service local.
|
|
101
|
+
* Aucun autre processus n'utilise le port que vous souhaitez utiliser.
|
|
102
|
+
* Vous exécutez toujours l'outil avec `npx scripting-cli <command>` et que le package est à jour.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
Profitez de l'utilisation de `scripting-cli` dans votre flux de travail de développement avec l'application Scripting ! Bon codage !
|
package/README_it.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Strumento da linea di comando per l'app Scripting
|
|
2
|
+
|
|
3
|
+
Benvenuto in `scripting-cli`, lo strumento da linea di comando progettato per l'integrazione con l'app Scripting. Questo strumento ti consente di sincronizzare e visualizzare in anteprima i tuoi script in tempo reale mentre li sviluppi utilizzando il tuo editor desktop preferito, come VSCode.
|
|
4
|
+
|
|
5
|
+
[English](./README.md) | [中文](./README_zh.md) | [日本語](./README_ja.md) | [Deutsch](./README_de.md) | [Français](./README_fr.md)
|
|
6
|
+
|
|
7
|
+
## Prerequisiti
|
|
8
|
+
|
|
9
|
+
Prima di utilizzare `scripting-cli`, assicurati di avere quanto segue:
|
|
10
|
+
|
|
11
|
+
1. **Node.js**: Verifica di avere una versione recente di Node.js installata. Puoi controllare la tua versione eseguendo:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
node -v
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. **App Scripting**: L'app Scripting deve essere installata per potersi connettere al servizio locale avviato da `scripting-cli`.
|
|
18
|
+
|
|
19
|
+
## Installazione
|
|
20
|
+
|
|
21
|
+
Non è necessario installare `scripting-cli` globalmente. Puoi utilizzarlo direttamente con `npx`:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx scripting-cli <command>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Utilizzo
|
|
28
|
+
|
|
29
|
+
### 1. Creare una directory di lavoro
|
|
30
|
+
|
|
31
|
+
Crea una directory nel tuo computer dove archiviare gli script dell'app Scripting. Ad esempio:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
mkdir my-scripting-project
|
|
35
|
+
cd my-scripting-project
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 2. Avviare il servizio locale
|
|
39
|
+
|
|
40
|
+
All'interno della directory di lavoro, esegui il comando seguente per avviare il servizio locale:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npx scripting-cli start
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Per impostazione predefinita, il servizio verrà eseguito sulla porta `3000`. Se desideri utilizzare una porta diversa, puoi specificarla con l'opzione `--port`:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npx scripting-cli start --port=4000
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Per attivare il servizio Bonjour (che consente all'app Scripting di rilevare automaticamente il servizio locale), utilizza l'opzione `--bonjour`:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx scripting-cli start --bonjour
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 3. Collegare l'app Scripting
|
|
59
|
+
|
|
60
|
+
Una volta che il servizio è in esecuzione, apri l'**app Scripting** e collegati al servizio locale appena avviato. Questo stabilirà la connessione tra l'app e la tua directory di lavoro.
|
|
61
|
+
|
|
62
|
+
### 4. Debug e sincronizzazione del codice
|
|
63
|
+
|
|
64
|
+
Dopo la connessione, seleziona il progetto di script che desideri eseguire il debug. L'app Scripting sincronizzerà automaticamente il codice del progetto con la tua directory locale.
|
|
65
|
+
|
|
66
|
+
### 5. Sincronizzazione del codice in tempo reale
|
|
67
|
+
|
|
68
|
+
Mentre scrivi e salvi gli script nel tuo editor desktop (ad esempio, VSCode), il codice aggiornato verrà automaticamente sincronizzato con l'app Scripting ed eseguito in tempo reale. Questo rende lo sviluppo e il debug molto più efficienti.
|
|
69
|
+
|
|
70
|
+
## Esempio di flusso di lavoro
|
|
71
|
+
|
|
72
|
+
1. Avvia il servizio locale:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npx scripting-cli start
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
2. Apri il tuo editor e scrivi lo script.
|
|
79
|
+
|
|
80
|
+
3. Salva il file dello script.
|
|
81
|
+
|
|
82
|
+
4. Il codice aggiornato viene sincronizzato automaticamente con l'app Scripting e viene eseguito.
|
|
83
|
+
|
|
84
|
+
## Informazioni aggiuntive
|
|
85
|
+
|
|
86
|
+
* La porta predefinita del servizio è `3000`. Se è già in uso, specificane un'altra con l'opzione `--port`.
|
|
87
|
+
* Utilizza l'opzione `--no-auto-open` per avviare il server di sviluppo senza aprire automaticamente `index.tsx` o `widget.tsx` nell'editor:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npx scripting-cli start --no-auto-open
|
|
91
|
+
```
|
|
92
|
+
* Se desideri utilizzare il servizio Bonjour, assicurati che il tuo computer lo supporti. Su Windows, potrebbe essere necessario installarlo manualmente. Poi utilizza l'opzione `--bonjour` per abilitarlo.
|
|
93
|
+
* Questo strumento è pensato per gli utenti che preferiscono editor desktop come VSCode e desiderano un'integrazione fluida con l'app Scripting per la sincronizzazione e il debug del codice.
|
|
94
|
+
|
|
95
|
+
## Risoluzione dei problemi
|
|
96
|
+
|
|
97
|
+
Se riscontri problemi, verifica che:
|
|
98
|
+
|
|
99
|
+
* Hai installato Node.js versione 20 o superiore.
|
|
100
|
+
* L'app Scripting è correttamente collegata al servizio locale.
|
|
101
|
+
* Nessun altro processo stia utilizzando la porta desiderata.
|
|
102
|
+
* Utilizzi sempre `npx scripting-cli <command>` per avviare il servizio e che il pacchetto sia aggiornato.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
Buon divertimento con `scripting-cli` nel tuo flusso di lavoro di sviluppo per l'app Scripting! Buona programmazione!
|
package/README_ja.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Scripting アプリ コマンドラインツール
|
|
2
|
+
|
|
3
|
+
Scripting アプリとの統合用に設計された `scripting-cli` コマンドラインツールへようこそ。このツールを使用すると、お気に入りのデスクトップエディター(例:VSCode)でスクリプトを開発しながら、リアルタイムで同期およびプレビューできます。
|
|
4
|
+
|
|
5
|
+
[English](./README.md) | [中文](./README_zh.md) | [Deutsch](./README_de.md) | [Français](./README_fr.md) | [Italiano](./README_it.md)
|
|
6
|
+
|
|
7
|
+
## 前提条件
|
|
8
|
+
|
|
9
|
+
`scripting-cli` を使用する前に、以下の要件を満たしていることを確認してください:
|
|
10
|
+
|
|
11
|
+
1. **Node.js**:最新バージョンの Node.js がインストールされていることを確認してください。現在のバージョンを確認するには、次のコマンドを実行します:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
node -v
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. **Scripting アプリ**:`scripting-cli` が起動するローカルサービスに接続するために、Scripting アプリをインストールする必要があります。
|
|
18
|
+
|
|
19
|
+
## インストール
|
|
20
|
+
|
|
21
|
+
`scripting-cli` をグローバルにインストールする必要はありません。`npx` を使用して実行するだけです:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx scripting-cli <command>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 使用方法
|
|
28
|
+
|
|
29
|
+
### 1. 作業ディレクトリの作成
|
|
30
|
+
|
|
31
|
+
まず、Scripting アプリのスクリプトを保存するディレクトリを作成します。例:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
mkdir my-scripting-project
|
|
35
|
+
cd my-scripting-project
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 2. ローカルサービスの起動
|
|
39
|
+
|
|
40
|
+
作業ディレクトリで、次のコマンドを実行してローカル開発サービスを起動します:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npx scripting-cli start
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
デフォルトでは、サービスはポート `3000` で起動します。別のポートを指定するには、`--port` オプションを使用します:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npx scripting-cli start --port=4000
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Bonjour サポートを有効にして、Scripting アプリがローカルサービスを自動的に検出できるようにするには、`--bonjour` フラグを追加します:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx scripting-cli start --bonjour
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 3. Scripting アプリの接続
|
|
59
|
+
|
|
60
|
+
サービスが起動したら、**Scripting アプリ** を開き、先ほど起動したローカルサービスに接続します。これにより、アプリと作業ディレクトリ間の接続が確立されます。
|
|
61
|
+
|
|
62
|
+
### 4. コードのデバッグと同期
|
|
63
|
+
|
|
64
|
+
接続後、デバッグしたいスクリプトプロジェクトを選択します。Scripting アプリは、プロジェクトのコードを自動的に作業ディレクトリと同期します。
|
|
65
|
+
|
|
66
|
+
### 5. リアルタイムコード同期
|
|
67
|
+
|
|
68
|
+
デスクトップエディター(例:VSCode)でスクリプトを作成して保存すると、変更内容が自動的に Scripting アプリと同期され、リアルタイムで実行されます。これにより、開発とデバッグがスムーズになります。
|
|
69
|
+
|
|
70
|
+
## 例:ワークフロー
|
|
71
|
+
|
|
72
|
+
1. ローカルサービスを起動します:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npx scripting-cli start
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
2. エディターを開いてスクリプトを作成します。
|
|
79
|
+
|
|
80
|
+
3. スクリプトファイルを保存します。
|
|
81
|
+
|
|
82
|
+
4. 更新されたコードが自動的に Scripting アプリと同期され、実行されます。
|
|
83
|
+
|
|
84
|
+
## 追加情報
|
|
85
|
+
|
|
86
|
+
* デフォルトのポートは `3000` です。既に使用されている場合は、`--port` オプションで別のポートを指定してください。
|
|
87
|
+
* `--no-auto-open` フラグを使用すると、`index.tsx` または `widget.tsx` ファイルが自動的に開かれるのを防げます:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npx scripting-cli start --no-auto-open
|
|
91
|
+
```
|
|
92
|
+
* Bonjour サービスを使用するには、システムがその機能をサポートしていることを確認してください。Windows では、Bonjour を手動でインストールする必要がある場合があります。その後、`--bonjour` オプションを使用してサービスを有効にします。
|
|
93
|
+
* このツールは、VSCode などのデスクトップエディターを好み、Scripting アプリとのシームレスなコード同期とデバッグを望むユーザーに最適です。
|
|
94
|
+
|
|
95
|
+
## トラブルシューティング
|
|
96
|
+
|
|
97
|
+
問題が発生した場合は、以下を確認してください:
|
|
98
|
+
|
|
99
|
+
* Node.js バージョン 20 以上を使用していること。
|
|
100
|
+
* Scripting アプリがローカルサービスに正しく接続されていること。
|
|
101
|
+
* 選択したポートが他のプロセスによって使用されていないこと。
|
|
102
|
+
* 常に `npx scripting-cli <command>` を使用してツールを実行し、パッケージが最新であることを確認してください。
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
Scripting アプリの開発ワークフローで `scripting-cli` をご活用ください。楽しいコーディングを!
|