Skip to content

Commit

Permalink
Merge branch 'master' into rc/salamander
Browse files Browse the repository at this point in the history
  • Loading branch information
arboleya committed Jan 11, 2024
2 parents 6796ef2 + 9b079ab commit 0668d88
Show file tree
Hide file tree
Showing 69 changed files with 1,414 additions and 1,258 deletions.
3 changes: 2 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"demo-nextjs",
"demo-node-esm",
"demo-typegen",
"@fuel-ts/docs-snippets"
"@fuel-ts/docs-snippets",
"template-nextjs"
]
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ The [documentation](https://docs.fuel.network/docs/fuels-ts/) site is your main
npm install fuels --save
```

> If you are a Windows user, you will need to be running Windows Subsystem for Linux (WSL) to install and use the Fuel toolchain, including the TypeScript SDK. We don't support Windows natively at this time.
# Import

Simple example usages.
Expand Down
3 changes: 2 additions & 1 deletion apps/docs/spell-check-custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,5 @@ Keystore
cryptographically
Config
config
configs
configs
WSL
2 changes: 2 additions & 0 deletions apps/docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ npm install fuels --save

:::

> If you are a Windows user, you will need to be running Windows Subsystem for Linux (WSL) to install and use the Fuel toolchain, including the TypeScript SDK. We don't support Windows natively at this time.
## Import

<!-- TODO: stop using hard-coded snippets -->
Expand Down
2 changes: 2 additions & 0 deletions internal/check-imports/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@
## null

## null

## null
2 changes: 2 additions & 0 deletions packages/abi-coder/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Change Log

## 0.71.1

## 0.71.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/abi-coder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fuel-ts/abi-coder",
"version": "0.71.0",
"version": "0.71.1",
"description": "",
"author": "Fuel Labs <[email protected]> (https://fuel.network/)",
"main": "dist/index.js",
Expand Down
2 changes: 2 additions & 0 deletions packages/abi-typegen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @fuel-ts/abi-typegen

## 0.71.1

## 0.71.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/abi-typegen/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fuel-ts/abi-typegen",
"version": "0.71.0",
"version": "0.71.1",
"description": "Generates Typescript definitions from Sway ABI Json files",
"author": "Fuel Labs <[email protected]> (https://fuel.network/)",
"bin": {
Expand Down
2 changes: 2 additions & 0 deletions packages/address/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Change Log

## 0.71.1

## 0.71.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/address/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fuel-ts/address",
"version": "0.71.0",
"version": "0.71.1",
"description": "Utilities for encoding and decoding addresses",
"author": "Fuel Labs <[email protected]> (https://fuel.network/)",
"main": "dist/index.js",
Expand Down
2 changes: 2 additions & 0 deletions packages/contract/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Change Log

## 0.71.1

## 0.71.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/contract/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fuel-ts/contract",
"version": "0.71.0",
"version": "0.71.1",
"description": "",
"author": "Fuel Labs <[email protected]> (https://fuel.network/)",
"main": "dist/index.js",
Expand Down
6 changes: 6 additions & 0 deletions packages/create-fuels/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# create-fuels

## 0.71.1

### Patch Changes

- 🐞 fix: use functions from `fs` instead of plain UNIX commands in install scripts to ensure Windows support, by [@Dhaiwat10](https://github.com/Dhaiwat10) (See [#1618](https://github.com/FuelLabs/fuels-ts/pull/1618))

## 0.71.0

### Patch Changes
Expand Down
8 changes: 3 additions & 5 deletions packages/create-fuels/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-fuels",
"version": "0.71.0",
"version": "0.71.1",
"description": "",
"author": "Fuel Labs <[email protected]> (https://fuel.network/)",
"bin": {
Expand All @@ -22,12 +22,10 @@
"chalk": "4",
"commander": "^9.4.1",
"fuels": "workspace:*",
"prompts": "^2.4.2",
"tar": "^6.2.0"
"prompts": "^2.4.2"
},
"devDependencies": {
"@fuel-ts/versions": "workspace:*",
"@types/prompts": "^2.4.8",
"@types/tar": "^6.1.8"
"@types/prompts": "^2.4.8"
}
}
2 changes: 2 additions & 0 deletions packages/crypto/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Change Log

## 0.71.1

## 0.71.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/crypto/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fuel-ts/crypto",
"version": "0.71.0",
"version": "0.71.1",
"description": "Utilities for encrypting and decrypting data",
"author": "Fuel Labs <[email protected]> (https://fuel.network/)",
"main": "dist/index.js",
Expand Down
2 changes: 2 additions & 0 deletions packages/errors/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @fuel-ts/errors

## 0.71.1

## 0.71.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/errors/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fuel-ts/errors",
"version": "0.71.0",
"version": "0.71.1",
"description": "Error class and error codes that the fuels-ts library throws",
"author": "Fuel Labs <[email protected]> (https://fuel.network/)",
"main": "dist/index.js",
Expand Down
6 changes: 6 additions & 0 deletions packages/forc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 0.71.1

### Patch Changes

- 🐞 fix: use functions from `fs` instead of plain UNIX commands in install scripts to ensure Windows support, by [@Dhaiwat10](https://github.com/Dhaiwat10) (See [#1618](https://github.com/FuelLabs/fuels-ts/pull/1618))

## 0.71.0

### Minor Changes
Expand Down
8 changes: 6 additions & 2 deletions packages/forc/lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { execSync } from 'child_process';
import { existsSync, rmSync, writeFileSync } from 'fs';
import fetch from 'node-fetch';
import { join } from 'path';
import tar from 'tar';

import {
__dirname,
Expand Down Expand Up @@ -52,9 +53,12 @@ import {
writeFileSync(pkgPath, buf);

// Extract
execSync(`tar xzf "${pkgPath}" -C "${binDir}"`);
await tar.x({
file: pkgPath,
C: binDir,
});

// Cleanup
rmSync(pkgPath);
}
})().catch(process.stderr.write);
})().catch((e) => console.error(e));
31 changes: 18 additions & 13 deletions packages/forc/lib/shared.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { execSync } from 'child_process';
import { cpSync } from 'fs';
import fs from 'fs/promises';
import path, { join, dirname } from 'path';
import { fileURLToPath } from 'url';
Expand All @@ -23,7 +24,11 @@ export default binPath;

export const getPkgPlatform = () => {
if (process.platform !== 'darwin' && process.platform !== 'linux') {
throw new Error(`Unsupported platform ${process.platform}`);
throw new Error(
`Unsupported platform ${process.platform}.${
process.platform === 'win32' ? ' If you are on Windows, please use WSL.' : ''
}}`
);
}
if (process.arch !== 'arm64' && process.arch !== 'x64') {
throw new Error(`Unsupported arch ${process.arch}`);
Expand All @@ -48,18 +53,18 @@ export const isGitBranch = (versionFileContents) => versionFileContents.indexOf(
const swayRepoUrl = 'https://github.com/fuellabs/sway.git';

export const buildFromGitBranch = (branchName) => {
execSync('rm -rf sway-repo');
execSync('rm -rf forc-binaries');
fs.rmSync('sway-repo', { recursive: true, force: true });
fs.rmSync('forc-binaries', { recursive: true, force: true });
execSync(`git clone --branch ${branchName} ${swayRepoUrl} sway-repo`);
execSync(`cd sway-repo && cargo build`);
execSync('mkdir forc-binaries');
execSync('cp sway-repo/target/debug/forc forc-binaries/');
execSync('cp sway-repo/target/debug/forc-deploy forc-binaries/');
execSync('cp sway-repo/target/debug/forc-doc forc-binaries/');
execSync('cp sway-repo/target/debug/forc-fmt forc-binaries/');
execSync('cp sway-repo/target/debug/forc-lsp forc-binaries/');
execSync('cp sway-repo/target/debug/forc-run forc-binaries/');
execSync('cp sway-repo/target/debug/forc-submit forc-binaries/');
execSync('cp sway-repo/target/debug/forc-tx forc-binaries/');
execSync(`rm -rf sway-repo`);
fs.mkdirSync('forc-binaries');
cpSync('sway-repo/target/debug/forc', 'forc-binaries');
cpSync('sway-repo/target/debug/forc-deploy', 'forc-binaries');
cpSync('sway-repo/target/debug/forc-doc', 'forc-binaries');
cpSync('sway-repo/target/debug/forc-fmt', 'forc-binaries');
cpSync('sway-repo/target/debug/forc-lsp', 'forc-binaries');
cpSync('sway-repo/target/debug/forc-run', 'forc-binaries');
cpSync('sway-repo/target/debug/forc-submit', 'forc-binaries');
cpSync('sway-repo/target/debug/forc-tx', 'forc-binaries');
fs.rmSync('sway-repo', { recursive: true, force: true });
};
8 changes: 6 additions & 2 deletions packages/forc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fuel-ts/forc",
"version": "0.71.0",
"version": "0.71.1",
"description": "NPM bin wrapper around Fuel `forc`",
"author": "Fuel Labs <[email protected]> (https://fuel.network/)",
"bin": {
Expand All @@ -17,6 +17,10 @@
},
"license": "Apache-2.0",
"dependencies": {
"node-fetch": "^2.6.7"
"node-fetch": "^2.6.7",
"tar": "^6.2.0"
},
"devDependencies": {
"@types/tar": "^6.1.8"
}
}
6 changes: 6 additions & 0 deletions packages/fuel-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @fuel-ts/fuel-core

## 0.71.1

### Patch Changes

- 🐞 fix: use functions from `fs` instead of plain UNIX commands in install scripts to ensure Windows support, by [@Dhaiwat10](https://github.com/Dhaiwat10) (See [#1618](https://github.com/FuelLabs/fuels-ts/pull/1618))

## 0.71.0

### Minor Changes
Expand Down
18 changes: 14 additions & 4 deletions packages/fuel-core/lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { execSync } from 'child_process';
import { existsSync, rmSync, writeFileSync, mkdirSync, renameSync } from 'fs';
import fetch from 'node-fetch';
import { join } from 'path';
import tar from 'tar';

import {
__dirname,
Expand Down Expand Up @@ -51,7 +52,10 @@ import {
} else {
// Empty the `fuel-core-binaries` directory if it exists
if (existsSync(binDir)) {
execSync(`rm -rf ${binDir}/*`);
rmSync(`${binDir}/*`, {
recursive: true,
force: true,
});
} else {
// Create the `fuel-core-binaries` directory if it doesn't exist
mkdirSync(binDir);
Expand All @@ -62,13 +66,19 @@ import {
writeFileSync(pkgPath, buf);

// Extract
execSync(`tar xzf "${pkgPath}" -C "${rootDir}"`);
await tar.x({
file: pkgPath,
C: rootDir,
});

// Take the contents of the directory containing the extracted binaries and move them to the `fuel-core-binaries` directory
renameSync(`${fileName}`, binDir);

// Cleanup
execSync(`rm -rf ${fileName}`);
rmSync(fileName, {
recursive: true,
force: true,
});
rmSync(pkgPath);
}
})().catch(process.stderr.write);
})().catch((e) => console.error(e));
17 changes: 11 additions & 6 deletions packages/fuel-core/lib/shared.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { execSync } from 'child_process';
import { cpSync, rmSync } from 'fs';
import fs from 'fs/promises';
import { join, dirname } from 'path';
import { fileURLToPath } from 'url';
Expand All @@ -19,7 +20,11 @@ const platforms = {

export const getPkgPlatform = () => {
if (process.platform !== 'darwin' && process.platform !== 'linux') {
throw new Error(`Unsupported platform ${process.platform}`);
throw new Error(
`Unsupported platform ${process.platform}.${
process.platform === 'win32' ? ' If you are on Windows, please use WSL.' : ''
}`
);
}
if (process.arch !== 'arm64' && process.arch !== 'x64') {
throw new Error(`Unsupported arch ${process.arch}`);
Expand All @@ -43,11 +48,11 @@ export const isGitBranch = (versionFileContents) => versionFileContents.indexOf(
const fuelCoreRepoUrl = 'https://github.com/fuellabs/fuel-core.git';

export const buildFromGitBranch = (branchName) => {
execSync('rm -rf fuel-core-repo');
execSync('rm -rf fuel-core-binaries');
rmSync('fuel-core-repo', { recursive: true, force: true });
rmSync('fuel-core-binaries', { recursive: true, force: true });
execSync(`git clone --branch ${branchName} ${fuelCoreRepoUrl} fuel-core-repo`, { silent: true });
execSync(`cd fuel-core-repo && cargo build`, { silent: true });
execSync('mkdir fuel-core-binaries');
execSync('cp fuel-core-repo/target/debug/fuel-core fuel-core-binaries/fuel-core');
execSync(`rm -rf fuel-core-repo`);
fs.mkdirSync('fuel-core-binaries');
cpSync('fuel-core-repo/target/debug/fuel-core', 'fuel-core-binaries/fuel-core');
rmSync('fuel-core-repo', { recursive: true, force: true });
};
8 changes: 6 additions & 2 deletions packages/fuel-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fuel-ts/fuel-core",
"version": "0.71.0",
"version": "0.71.1",
"description": "NPM bin wrapper around `fuel-core`",
"author": "Fuel Labs <[email protected]> (https://fuel.network/)",
"bin": {
Expand All @@ -17,6 +17,10 @@
},
"license": "Apache-2.0",
"dependencies": {
"node-fetch": "^2.7.0"
"node-fetch": "^2.7.0",
"tar": "^6.2.0"
},
"devDependencies": {
"@types/tar": "^6.1.8"
}
}
2 changes: 2 additions & 0 deletions packages/fuels/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Change Log

## 0.71.1

## 0.71.0

### Minor Changes
Expand Down
Loading

0 comments on commit 0668d88

Please sign in to comment.