Przeglądaj źródła

Rename validator scripts

Loris Leiva 1 rok temu
rodzic
commit
8ed7263969

+ 5 - 0
.changeset/honest-donuts-obey.md

@@ -0,0 +1,5 @@
+---
+"create-solana-program": patch
+---
+
+Rename validator scripts

+ 4 - 4
template/base/README.md.njk

@@ -80,13 +80,13 @@ The following clients are available for your programs. You may use the following
 The following script is available to start your local validator.
 
 ```sh
-{{ getNpmCommand("validator") }}
+{{ getNpmCommand("validator:start") }}
 ```
 
-By default, if a local validator is already running, the script will be skipped. You may use the `--restart` flag to force the validator to restart.
+By default, if a local validator is already running, the script will be skipped. You may use the `validator:restart` script instead to force the validator to restart.
 
 ```sh
-{{ getNpmCommand("validator", "--restart") }}
+{{ getNpmCommand("validator:restart") }}
 ```
 
 Finally, you may stop the local validator using the following command.
@@ -112,6 +112,6 @@ Next time you build your program and run your validator, these external programs
 
 ```sh
 {{ getNpmCommand("programs:build") }}
-{{ getNpmCommand("validator", "--restart") }}
+{{ getNpmCommand("validator:restart") }}
 ```
 {% endif %}

+ 2 - 1
template/clients/base/package.json

@@ -2,7 +2,8 @@
   "scripts": {
     "generate": "pnpm generate:idls && pnpm generate:clients",
     "generate:clients": "zx ./scripts/generate-clients.mjs",
-    "validator": "zx ./scripts/start-validator.mjs",
+    "validator:start": "zx ./scripts/start-validator.mjs",
+    "validator:restart": "pnpm validator:start --restart",
     "validator:stop": "zx ./scripts/stop-validator.mjs"
   },
   "devDependencies": {

+ 1 - 1
template/clients/js/clients/js/README.md.njk

@@ -19,7 +19,7 @@ Alternatively, you can go into the client directory and run the tests directly.
 ```sh
 # Build your programs and start the validator.
 {{ getNpmCommand("programs:build") }}
-{{ getNpmCommand("validator") }}
+{{ getNpmCommand("validator:restart") }}
 
 # Go into the client directory and run the tests.
 cd clients/js

+ 1 - 1
template/clients/js/scripts/client/test-js.mjs

@@ -3,7 +3,7 @@ import 'zx/globals';
 import { workingDirectory } from '../utils.mjs';
 
 // Start the local validator if it's not already running.
-await $`pnpm validator --restart`;
+await $`pnpm validator:restart`;
 
 // Build the client and run the tests.
 cd(path.join(workingDirectory, 'clients', 'js'));

+ 1 - 1
template/clients/rust/scripts/client/test-rust.mjs

@@ -3,7 +3,7 @@ import 'zx/globals';
 import { workingDirectory } from '../utils.mjs';
 
 // Start the local validator if it's not already running.
-await $`pnpm validator --restart`;
+await $`pnpm validator:restart`;
 
 // Run the tests.
 cd(path.join(workingDirectory, 'clients', 'rust'));