Skip to content

Docusaurus #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
node_modules
package-lock.json
.DS_Store
lib/core/metadata.js
lib/core/MetadataBlog.js
website/translated_docs
website/build/
website/yarn.lock
website/node_modules
website/node_modules/

website/i18n/*
!website/i18n/en.json
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,40 @@
# [boltpkg/website](http://boltpkg.com/)
# [boltpkg/website](http://new.boltpkg.com/)

> 🏗 The website is under construction

Old website: [http://boltpkg.com/](http://boltpkg.com/)

New website: [http://new.boltpkg.com/](http://new.boltpkg.com/)

## Introduction

This is boltpkg [website](http://boltpkg.com/). This is build using [docusaurus](https://docusaurus.io/).
This will be website for [bolt](https://github.com/boltpkg/bolt).

We are using [Docusaurus](https://github.com/facebook/Docusaurus) to build it.

## Setup
## Setup

```sh
$ git clone [email protected]:boltpkg/website.git
$ cd website
$ git checkout docusaurus
$ yarn
$ yarn start
```

## Want to contribute? 🎉

Help us with documentation, styling, review PR's. Feel free to suggest/ implement a new feature.

If there are any queries please ask them in [website](https://boltpkg.slack.com/messages/) channel on slack.

## Tips

- All the docs reside in *docs* folder

- Bolt logo is in *website/static/img/logo.svg*

- Please see *website/_data/users.json* to add/ edit a user of BoltPkg
- Please see *website/_data/users.json* to add/ edit a user of BoltPkg.

## Looking for Support?

Expand Down
4 changes: 3 additions & 1 deletion docs/add.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ title: bolt add

## Add dependencies

Uses [yarn add](https://yarnpkg.com/en/docs/cli/add) to add dependencies. Then runs a custom logic to create a dependency graph. This command will re-establish symlinks between dependency of project and workspaces. This will generate a new ***lock*** file and update the ***package.json*** of the project.
Bolt uses [yarn add](https://yarnpkg.com/en/docs/cli/add) under the hood to add dependencies. Then it runs a custom logic to create a dependency graph. This command will re-establish symlinks between dependency of project and workspaces.

> This will generate a new ***lock*** file and update the ***package.json*** of the project.

## Commands

Expand Down
22 changes: 22 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
id: config
title: bolt config
---

---

### **`bolt config delete <key>`**

Removes the given `key` from the config.

### **`bolt config list`**

Displays the current configuration.

### **`bolt config get <key>`**

Prints the value for a given `key`.

### **`bolt config set <key> <value> [-g|--global]`**

Sets the config `key` to the given `value`.
20 changes: 20 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
id: getting-started
title: Getting Started
---

---

To understand how Bolt works we need to understand what is a mono-repo (or multi-package repo).

## Mono-repo

A lot projects split there codebase into independently versioned packages with each package focused on specific functionality. However, this split of codebase in multiple packages has few drawbacks. One of the drawbacks being that instead of cloning one repository now you need to clone multiple repositories, which becomes messy and hard to maintain with time.

To overcome these issue we can create a single repository (project) and keep all there packages(workspaces) in this repository. These multi-package repositories are known as mono-repo.

Mono-repos are great. Though, we still have issue with sharing source across different repository. Imagine a scenario where you are working on a project and you need working on package which depends on different package of the same project.

## Why do we need Bolt

To resolve this bolt sym-links the source of that packages which enable you to work on multiple packages at once without any manually linking them.
14 changes: 14 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
id: installation
title: Installation
---

---

It is preffered to install bolt globally,

First be sure that you have Node/npm and Yarn. Then run the following command:

```sh
yarn global add bolt
```
10 changes: 5 additions & 5 deletions docs/publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ title: bolt publish

---

Publish new version(s) of your package(s) to npm
Publish new version of your package(s) on npm

### `publish-lock`
*Once a package is published, you can never modify that specific version, so take care before publishing.*

Lock your package(s) on the npm registry
## Commands

### `publish-unlock`
### **`bolt publish`**

Unlock your package(s) on the npm registry
This will visit every workspace in the repository and try to publish workspace which has version greater than already published version.
36 changes: 35 additions & 1 deletion docs/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,38 @@ title: bolt run

---

`bolt run [script]` Run a script in a package
Runs a defined package script.

You may define [scripts](https://yarnpkg.com/en/docs/package-json#toc-scripts) in your repository's [package.json](https://yarnpkg.com/en/docs/package-json) file.

```
{
"name": "my-package",
"scripts": {
"build": "babel src -d lib",
"test": "jest"
}
}
```

## Commands

### **bolt run \<script\> [arguments]**

This will run the script defined in your package json. All the arguments are passed down to the script. For example:

```
bolt run test
```

You can pass arguments to the script by keeping them after the command. For example, to run *jest* in watch mode:

```
bolt run test --watch
```

## Related commands

[`bolt workspace run`](/docs/workspace-run.html)

[`bolt workspaces run`](/docs/workspaces-run.html)
44 changes: 44 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
id: usage
title: Usage
---

---

## Prerequisite

- Make sure you have bolt installed

- Basic understanding on terminal

## Creating a project

Go to your workspace in terminal. Create an new prjoct.

```sh
$ mkdir bolt-project
```

```sh
$ cd bolt-project
```

Initialize the project (this will create a simple node project):

```sh
$ bolt init
```

This creates a package json with your preference.

Copy the below bolt config in package.json of the project.

```js
"bolt": {
"workspaces": [
"packages/*"
]
}
```

This config tells bolt to treat all the projects/ packages in *packages* folder as independent projects. Next, go ahead and create new packages in *packages* folder.
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
"private": true,
"version": "1.0.0",
"scripts": {
"preinstall": "cd website && yarn",
"start": "cd website && yarn start",
"build": "cd website && yarn build"
},
"devDependencies": {
"docusaurus": "^1.0.5"
}
}

6 changes: 3 additions & 3 deletions website/_data/users.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[
{
"caption": "Bolt",
"infoLink": "#",
"image": "img/logo.svg",
"name": "Atlassian",
"url": "https://www.atlassian.com/",
"logo": "atlassian.svg",
"pinned": "true"
}
]
12 changes: 8 additions & 4 deletions website/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@
"bolt": "bolt",
"build": "bolt build",
"check": "bolt check",
"config": "bolt config",
"doc": "bolt doc",
"format": "bolt format",
"getting-started": "Getting Started",
"init": "bolt init",
"install": "bolt install",
"installation": "Installation",
"introduction": "Introduction",
"lint": "bolt lint",
"publish": "bolt publish",
"run": "bolt run",
"test": "bolt test",
"upgrade": "bolt upgrade",
"usage": "Usage",
"version": "bolt version",
"workspace-add": "bolt workspace add",
"workspace-exec": "bolt workspace exec",
Expand All @@ -29,11 +33,11 @@
"workspaces-remove": "bolt workspaces remove",
"workspaces-run": "bolt workspaces run",
"workspaces-upgrade": "bolt workspaces upgrade",
"workspaces": "workspaces",
"workspaces": "Workspaces",
"Getting Started": "Getting Started",
"Docs": "Docs",
"About": "About",
"Commands": "Commands",
"Blog": "Blog",
"workspace": "workspace"
"Commands": "Commands"
},
"pages-strings": {
"Help Translate|recruit community translators for your project": "Help Translate",
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"rename-version": "docusaurus-rename-version"
},
"devDependencies": {
"docusaurus": "^1.0.5"
"docusaurus": "^1.3.2"
}
}
Loading