@replicatedhq/ship-init
v1.6.24
Published
Shared component that contains the Ship Init app
Downloads
234
Keywords
Readme
@replicatedhq/ship-init
The
ship init
web application exported as a React component.
Install
yarn add @replicatedhq/ship-init monaco-editor
Usage
For documentation on props, see props.md. Below is a minimal example:
import * as React from 'react'
import { Ship } from "@replicatedhq/ship-init";
import "@replicatedhq/ship-init/dist/styles.css";
class App extends React.Component {
render() {
return (
<Ship apiEndpoint="https://my-awesome-ship-api.com/api/v1" />;
);
}
}
Development
To build in development mode and watch for changes, run the following command:
yarn start
Dashboard mode mode uses webpack-dashboard
for more human-readable output.
To run that mode, run the following command:
yarn dashboard
Developing Ship Init in another project
If you want to make changes to the component from another project, you can use yarn link
to do this.
# from init folder
yarn link
You will get a message like this:
success Registered "@replicatedhq/ship-init".
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.
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.
Props Documentation
As stated above, you can view the docs for the props on <Ship />
here.
If you have added new props or updated documentation, run the following command to generate up-to-date markdown docs:
yarn gen-prop-docs
Building
To build the project without watching:
- Development build (no minification, warnings off):
yarn build-dev
- Production build (minified/uglified):
yarn build
License
Apache-2.0 © Replicated, Inc.