Elwing is a bootstrapped companion app to the Cloudscape design system. Its opinionated layout accelerates development time by exposing a simple plugin API. Developers can use the plugin API to focus on defining pages and content instead of app structure.
- Install NodeJS 18
- Run
npm i
from the same directory as this readme. - Run
npm start
.
A plugin is a JavaScript Object that contains the following properties:
navigationItem
- A CloudscapeSideNavigationProps
object.component
- The component that displays when choosing the link in the sidebar.
The automated steps overwrite the manifest.ts
file with the latest
plugins from the plugins
directory.
A convenience script is included to support quick plugin creation.
- Run
npm run create-plugin <plugin-name>
. - Find your plugin in the
plugins
directory. - Modify the generated code to match your use case.
You can choose to create a plugin manually instead of using the script.
- Create a new folder in the plugins directory. For example,
my-plugin
. - Add an
index.ts
file to the folder. Refer to the following example to populate the file.
const MyPlugin = {
navigationItem: {
text: "My Plugin",
href: "/my_plugin",
type: "expandable-link-group",
items: [{
type: "link",
text: "Cloudscape Design System",
href: "https://cloudscape.design/",
external: true
}],
} as SideNavigationProps.ExpandableLinkGroup,
component: lazy(() => import("./src/MyPluginComponent")),
};
export { MyPlugin };
- Add a
MyPlugin.tsx
file to the folder and populate it with component code.
const Component = () => <h1>Hello, my-component!</h1>;
export default Component;
- Open
plugins/manifest.ts
and add your plugin to theplugins
array.
import { AppPlugin } from "./AppPlugin";
import { MyPlugin } from "./my-plugin";
const plugins: AppPlugin[] = [MyPlugin];
export default plugins;
- Static files like the README are not updating in the client.
- This is likely a caching problem. Run
rm -rf node_modules/.cache
.
- This is likely a caching problem. Run