An app is a component that can be served, built and deployed. Naturally, apps have dependencies (components and packages) but no dependents.
For example, the todomvc/app
component is an app. It uses todomvc/header
and todomvc/footer
, two standard Bit components, as a dependencies:
Run the following to list all available apps in your workspace:
The output lists the IDs of the available app components and their corresponding app names:
│ id │ name │
├──────────────────────────┼──────────────┤
│ learnbit-vue.todomvc/app │ todomvc-app │
└──────────────────────────┴──────────────┘
Run the following to run an app locally, independent of Bit's dev server:
The output is similar the following (open the listed path and port in your browser, to explore your app):
Run the following to create an app using your env's component generator:
The output displays the ID of the generated app (component):
org.scope-name/apps/my-app
location: scope-name/apps/my-app
env: org.scope-name/envs/my-vue-env (set by template)
package: @org/scope-name.apps.my-app
You also need to run the install command to install missing dependencies:
The generated app component includes an app-type file, my-app.bit-app.ts
- in this case, it imports and reuses the Vue app-type. If you want to use a different app-type, just simply install and import another one.
This will affect how your app is being served, built and deployed.
To define an existing component as an app, add to its directory an app plugin file.
Note that the specific file extension of a plugin file determines its application type.
For example, the following .bit-app.ts
file extension is loaded by Bit's official Vue application type.
// my-app.bit-app.ts import { VueApp } from '@bitdev/vue.app-types.vue-vite'; export default VueApp.from({ name: "my-app", });
To make this app loadable by your workspace, run the following:
Search bit.cloud for Vue apps. Fork app components to get started quicker, with apps that already have much of the setup you need.
For example, run the following to fork the Hello World app to your workspace:
Run the following to make the forked app loadable by your workspace: