Skip to content

Commit dee6f80

Browse files
authored
chore: update typescript sdk to always download the fresh test-server and update sample's recordings. (#33)
* chore: update typescript sdk sample's recordings. * Update the sample with the typescript sdk 0.2.8
1 parent 168308f commit dee6f80

8 files changed

Lines changed: 568 additions & 1971 deletions

sdks/typescript/postinstall.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,8 @@ function ensureBinaryIsExecutable(binaryPath, platform) {
169169
async function main() {
170170
const binaryPath = getBinaryPath();
171171
if (fs.existsSync(binaryPath)) {
172-
console.log(`${PROJECT_NAME} binary already exists at ${binaryPath}. Skipping download.`);
173-
ensureBinaryIsExecutable(binaryPath, os.platform());
174-
return;
172+
console.log(`${PROJECT_NAME} binary already exists at ${binaryPath}. Removing it for a fresh install.`);
173+
fs.unlinkSync(binaryPath); // This deletes the file
175174
}
176175

177176
if (!fs.existsSync(BIN_DIR)) {

sdks/typescript/sample/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Usage samples for `@google/genai/node`
2+
3+
To run the samples first build the SDKs, from the sdks/typescript/:
4+
5+
```sh
6+
# Build the SDK
7+
npm install
8+
npm run build
9+
```
10+
11+
Then `cd sdks/typescript/samples`, install the newly built test-server typescript sdk:
12+
13+
```sh
14+
# install the test-server typescript sdk
15+
cd samples
16+
rm -Rf node_modules # To clean up the old dependencies
17+
npm install
18+
```
19+
20+
Now from sdks/typescript/samples, you can run
21+
```sh
22+
rm -Rf dist # To clean up the old build
23+
24+
npm run test
25+
#or
26+
npm run test:record
27+
```

0 commit comments

Comments
 (0)