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

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

Closed

Conversation

petertonysmith94
Copy link
Contributor

@petertonysmith94 petertonysmith94 commented Jun 24, 2024


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 });
  },
});

@petertonysmith94 petertonysmith94 added the feat Issue is a feature label Jun 24, 2024
@petertonysmith94 petertonysmith94 added this to the 0.x mainnet milestone Jun 24, 2024
@petertonysmith94 petertonysmith94 self-assigned this Jun 24, 2024
@petertonysmith94 petertonysmith94 changed the title feat: fuels dev build deploy emit event feat!: separate onSuccess events for the Fuels CLI Jun 24, 2024
Copy link
Contributor

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
Copy link
Contributor Author

Closed in flavour of:

@petertonysmith94 petertonysmith94 deleted the ps/feat/fuels-dev-build-deploy-emit-event branch July 26, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Issue is a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fire the build and deploy events during fuels dev
2 participants