Browse Source

Write generated READMEs

Loris Leiva 1 year ago
parent
commit
c67062badb

+ 5 - 0
.changeset/funny-lamps-relax.md

@@ -0,0 +1,5 @@
+---
+"create-solana-program": patch
+---
+
+Write generated READMEs

File diff suppressed because it is too large
+ 2 - 1
template/base/README.md.njk


+ 0 - 3
template/clients/js/clients/js/README.md

@@ -1,3 +0,0 @@
-# JavaScript client
-
-A generated JavaScript library for the Counter program.

+ 38 - 0
template/clients/js/clients/js/README.md.njk

@@ -0,0 +1,38 @@
+# JavaScript client
+
+A generated JavaScript library for the {{ programName | titleCase }} program.
+
+## Getting started
+
+To build and test your JavaScript client from the root of the repository, you may use the following command.
+
+```sh
+{{ getNpmCommand("clients:js:test") }}
+```
+
+This will start a new local validator, if one is not already running, and run the tests for your JavaScript client.
+
+## Available client scripts.
+
+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") }}
+
+# Go into the client directory and run the tests.
+cd clients/js
+{{ getNpmCommand("install") }}
+{{ getNpmCommand("build") }}
+{{ getNpmCommand("test") }}
+```
+
+You may also use the following scripts to lint and/or format your JavaScript client.
+
+```sh
+{{ getNpmCommand("lint") }}
+{{ getNpmCommand("lint:fix") }}
+{{ getNpmCommand("format") }}
+{{ getNpmCommand("format:fix") }}
+```

+ 0 - 3
template/clients/rust/clients/rust/README.md

@@ -1,3 +0,0 @@
-# Rust client
-
-A generated Rust library for the Counter program.

+ 13 - 0
template/clients/rust/clients/rust/README.md.njk

@@ -0,0 +1,13 @@
+# Rust client
+
+A generated Rust library for the {{ programName | titleCase }} program.
+
+## Getting started
+
+To build and test your Rust client from the root of the repository, you may use the following command.
+
+```sh
+{{ getNpmCommand("clients:js:test") }}
+```
+
+This will start a new local validator, if one is not already running, and run the tests for your Rust client.

+ 0 - 3
template/programs/counter-shank/program/README.md

@@ -1,3 +0,0 @@
-# Counter program
-
-Simple counter program as an example.

+ 3 - 0
template/programs/counter-shank/program/README.md.njk

@@ -0,0 +1,3 @@
+# {{ programName | titleCase }}
+
+Your generated Solana program. Have fun!

Some files were not shown because too many files changed in this diff