Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make startFuelCore package manager agnostic #1477

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/many-carrots-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fuels": patch
---

fix: make `startFuelCore` package manager agnostic
1 change: 1 addition & 0 deletions packages/fuels/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"handlebars": "^4.7.7",
"joycon": "^3.1.1",
"lodash.camelcase": "^4.3.0",
"npm-which": "^3.0.1",
"portfinder": "^1.0.32",
"rimraf": "^3.0.2",
"toml": "^3.0.0",
Expand Down
8 changes: 5 additions & 3 deletions packages/fuels/src/cli/commands/dev/startFuelCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import { getPortPromise } from 'portfinder';
import treeKill from 'tree-kill';

import type { FuelsConfig } from '../../types';
import { findPackageRoot } from '../../utils/findPackageRoot';
import { getBinarySource } from '../../utils/getBinarySource';
import { error, log, loggingConfig } from '../../utils/logger';

import { defaultChainConfig, defaultConsensusKey } from './defaultChainConfig';

// eslint-disable-next-line @typescript-eslint/no-var-requires
const npmWhich = require('npm-which')(__dirname);

export type FuelCoreNode = {
bindIp: string;
accessIp: string;
Expand Down Expand Up @@ -73,8 +75,8 @@ export const startFuelCore = async (config: FuelsConfig): Promise<FuelCoreNode>
].flat();

return new Promise((resolve, reject) => {
const pkgRootDir = findPackageRoot();
const builtInFuelsCorePath = join(pkgRootDir, 'node_modules', '.bin', 'fuels-core');
// This line finds the path to the built-in fuels-core binary
Dhaiwat10 marked this conversation as resolved.
Show resolved Hide resolved
const builtInFuelsCorePath = npmWhich.sync('fuels-core');

const command = config.useBuiltinFuelCore ? builtInFuelsCorePath : 'fuel-core';
const core = spawn(command, flags, { stdio: 'pipe' });
Expand Down
21 changes: 21 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading