github.com/replicatedhq/ship@v0.55.0/web/init/README.md (about)

     1  # `@replicatedhq/ship-init`
     2  [![npm version](https://badge.fury.io/js/%40replicatedhq%2Fship-init.svg)](https://badge.fury.io/js/%40replicatedhq%2Fship-init)
     3  
     4  > The `ship init` web application exported as a React component.
     5  
     6  ## Install
     7  
     8  ```bash
     9  yarn add @replicatedhq/ship-init monaco-editor
    10  ```
    11  
    12  ## Usage
    13  
    14  For documentation on props, see [props.md](props.md). Below is a minimal example:
    15  ```tsx
    16  import * as React from 'react'
    17  
    18  import { Ship } from "@replicatedhq/ship-init";
    19  
    20  import "@replicatedhq/ship-init/dist/styles.css";
    21  
    22  class App extends React.Component {
    23    render() {
    24      return (
    25        <Ship apiEndpoint="https://my-awesome-ship-api.com/api/v1" />;
    26      );
    27    }
    28  }
    29  ```
    30  
    31  ## Development
    32  To build in development mode and watch for changes, run the following command:
    33  ```
    34  yarn start
    35  ```
    36  
    37  Dashboard mode mode uses [`webpack-dashboard`](https://github.com/FormidableLabs/webpack-dashboard) for more human-readable output.
    38  To run that mode, run the following command:
    39  ```
    40  yarn dashboard
    41  ```
    42  
    43  ### Developing Ship Init in another project
    44  If you want to make changes to the component from another project, you can use `yarn link` to do this.
    45  ```sh
    46  # from init folder
    47  yarn link
    48  ```
    49  
    50  You will get a message like this:
    51  ```
    52  success Registered "@replicatedhq/ship-init".
    53  info You can now run `yarn link "@replicatedhq/ship-init"` in the projects where you want to use this package and it will be used instead.
    54  ```
    55  
    56  In the project you would like to link, run the command above and run a watching command like `yarn start` for the changes to carry across to the project specified.
    57  
    58  ### Props Documentation
    59  As stated above, you can view the docs for the props on `<Ship />` [here](props.md).
    60  
    61  If you have added new props or updated documentation, run the following command to generate up-to-date markdown docs:
    62  ```sh
    63  yarn gen-prop-docs
    64  ```
    65  
    66  ## Building
    67  To build the project without watching:
    68  - Development build (no minification, warnings off):
    69    ```
    70    yarn build-dev
    71    ```
    72  - Production build (minified/uglified):
    73    ```
    74    yarn build
    75    ```
    76  
    77  ## License
    78  
    79  Apache-2.0 © [Replicated, Inc.](https://github.com/replicatedhq)