FuelLabs / fuels-ts

Fuel Network Typescript SDK
https://docs.fuel.network/docs/fuels-ts/
Apache License 2.0
44.4k stars 1.32k forks source link

feat!: separate `onSuccess` events for the Fuels CLI #2616

Closed petertonysmith94 closed 1 week ago

petertonysmith94 commented 1 week ago

Breaking change

createConfig now has individual hooks for all our build steps

// Before
import { createConfig } from 'fuels';

createConfig({
  onSuccess: (event: CommandEvent, config: FuelsConfig) => {
    const { data, type } = event;
    console.log('fuels:onSuccess', { data, type });
  }
});

// After
import { createConfig, DeployedContract } from 'fuels';

createConfig({
  onBuild: (data: unknown, config: FuelsConfig) => {
    console.log('fuels:onBuild', { data });
  },
  onDeploy: (data: DeployedContract[], config: FuelsConfig) => {
    console.log('fuels:onDeploy', { data });
  },
  onDev: (data: unknown, config: FuelsConfig) => {
    console.log('fuels:onDev', { data });
  },
  onNode: (data: unknown, config: FuelsConfig) => {
    console.log('fuels:onNode', { data });
  },
});
github-actions[bot] commented 1 week ago

Coverage Report:

Lines Branches Functions Statements
80.05%(+0.01%) 72.03%(+0%) 76.85%(+0%) 80.1%(+0.01%)
Changed Files: | Ok | File (✨=New File) | Lines | Branches | Functions | Statements | | -- | --------------------------------------------------------------------------------- | -------------- | ------------- | ------------- | ------------------ | | 🔴 | packages/fuels/src/cli/commands/node/index.ts | 88%
(+0.5%) | 100%
(+0%) | 100%
(+0%) | 88.88%
(+0.42%) |
petertonysmith94 commented 1 week ago

Closed in flavour of: