reactNpmProfile top-level constant

ProjectOperationProfile const reactNpmProfile

A Node/npm project.

The check operation is the project's own build script — npm reports a missing script as a failure rather than a silent success. The serve operation is the project's own dev script with an explicit port; the endpoint and the readiness are declared, never inferred from a log line.

Implementation

const ProjectOperationProfile reactNpmProfile = ProjectOperationProfile(
  id: 'react_npm',
  operations: <ProjectOperation>[
    ProjectOperation(
      id: 'check',
      kind: ProjectOperationKind.check,
      command: ProjectCommand(
        executable: 'npm',
        arguments: <String>['run', 'build'],
      ),
    ),
    ProjectOperation(
      id: 'serve',
      kind: ProjectOperationKind.serve,
      command: ProjectCommand(
        executable: 'npm',
        arguments: <String>['run', 'dev', '--', '--port', '5173'],
        timeout: Duration(minutes: 30),
      ),
      endpoint: ProjectEndpoint(host: '127.0.0.1', port: 5173),
      readiness: ProjectReadiness.tcp(host: '127.0.0.1', port: 5173),
    ),
  ],
);