chore: Port FreeSewing.dev to docusaurus
The replaces the NextJS site powering FreeSewing.dev with a Docusaurus setup. It's part of my efforts to simplify FreeSewing's setup so we can focus on our core value proposition.
This commit is contained in:
parent
497633d1d3
commit
ab3204f9f1
692 changed files with 11037 additions and 20674 deletions
|
@ -0,0 +1,174 @@
|
|||
---
|
||||
title: Setting up the FreeSewing development environment
|
||||
order: 40
|
||||
---
|
||||
|
||||
FreeSewing provides a development environment to help you design and develop
|
||||
patterns.
|
||||
|
||||
There are two ways to run this development environment:
|
||||
|
||||
- [**Monorepo development**](#monorepo-development): Use this if you intend to
|
||||
contribute your work to FreeSewing
|
||||
- [**Stand-alone development**](#stand-alone-development): Use this if you want
|
||||
to do your own thing, and not contribute to FreeSewing
|
||||
|
||||
## Monorepo development
|
||||
|
||||
:::note
|
||||
This is the recommended way for (aspiring) FreeSewing contributors
|
||||
:::
|
||||
|
||||
### TL;DR
|
||||
|
||||
```bash
|
||||
git clone https://github.com/freesewing/freesewing
|
||||
cd freesewing
|
||||
yarn kickstart
|
||||
```
|
||||
|
||||
:::tip
|
||||
Even better: [clone your own
|
||||
fork](https://github.com/freesewing/freesewing/fork)
|
||||
|
||||
```bash
|
||||
git clone https://github.com/your-username/freesewing
|
||||
cd freesewing
|
||||
yarn kickstart
|
||||
```
|
||||
:::
|
||||
|
||||
This sets up the monorepo. If you would like to create a new design, run the
|
||||
following command:
|
||||
|
||||
```sh
|
||||
yarn new design
|
||||
```
|
||||
|
||||
If you'd like to create a new plugin, run this variant instead:
|
||||
|
||||
```sh
|
||||
yarn new plugin
|
||||
```
|
||||
|
||||
### Step by step
|
||||
|
||||
:::note
|
||||
These docs assume you have git installed.
|
||||
But if you're running Linux, you have git, right?
|
||||
:::
|
||||
|
||||
#### Install yarn
|
||||
|
||||
Our repository uses yarn workspaces. So you'll need `yarn` to work with it.
|
||||
|
||||
To install it run:
|
||||
|
||||
```bash
|
||||
npm install yarn --global
|
||||
```
|
||||
|
||||
#### Fork our repository
|
||||
|
||||
You'll want to fork our repository. This way you have your own copy where you can make
|
||||
all the changes you want. To do so, visit https://github.com/freesewing/freesewing/fork
|
||||
|
||||
#### Clone the forked repository
|
||||
|
||||
Now that you have your very own fork, it's time to clone it locally.
|
||||
|
||||
```bash
|
||||
git clone <url to your fork>
|
||||
```
|
||||
|
||||
Make sure to use the URL to your own fork, typically `https://github.com/your-username/freesewing` but
|
||||
obviously with your real username rather than `your-username`.
|
||||
|
||||
#### Install dependencies
|
||||
|
||||
Enter the directory that was created, and run the `yarn kickstart` command:
|
||||
|
||||
```bash
|
||||
cd freesewing
|
||||
yarn kickstart
|
||||
```
|
||||
|
||||
Now you're ready to [start the development environment](/tutorials/getting-started-linux/dev-start).
|
||||
|
||||
:::note
|
||||
|
||||
There is another `yarn` command that comes with some Linux distributions,
|
||||
installed as part of the `cmdtest` package and used for command line
|
||||
scenario testing.
|
||||
If you get an `ERROR: There are no scenarios; must have at least one.`
|
||||
message when trying to run the `yarn` command, it may be because the wrong
|
||||
`yarn` is being used.
|
||||
|
||||
Possible workarounds for this include uninstalling the `cmdtest` package
|
||||
or making sure that npm `yarn` is installed and comes first in your `PATH`
|
||||
environment variable.
|
||||
|
||||
:::
|
||||
|
||||
## Creating a new design
|
||||
|
||||
If you would like to create a new design, run the following command:
|
||||
|
||||
```sh
|
||||
yarn new design
|
||||
```
|
||||
|
||||
## Creating a new plugin
|
||||
|
||||
If you'd like to create a new plugin, run the following command:
|
||||
|
||||
```sh
|
||||
yarn new plugin
|
||||
```
|
||||
|
||||
## Stand-alone development
|
||||
|
||||
With Node.js installed, all you need to do to setup the stand-alone development environment is run this command:
|
||||
|
||||
```bash
|
||||
npx @freesewing/new-design
|
||||
```
|
||||
|
||||
After you've answered [some questions](#questions), it will take a while to set
|
||||
everything up. When it's done, you will have a new folder with the development
|
||||
environment inside.
|
||||
|
||||
Now you're ready to [start the development
|
||||
environment](/tutorials/getting-started-linux/dev-start).
|
||||
|
||||
:::tipThe folder will have the name you chose above.:::
|
||||
|
||||
:::note
|
||||
|
||||
### Questions
|
||||
|
||||
#### What template to use
|
||||
|
||||
Use `From scratch` unless you want to start from our of our blocks:
|
||||
|
||||
- Use `Extend Brian` to start from [Brian](https://freesewing.org/designs/brian)
|
||||
- Use `Extend Bent` to start from [Bent](https://freesewing.org/designs/bent)
|
||||
- Use `Extend Bella` to start from [Bella](https://freesewing.org/designs/bella)
|
||||
- Use `Extend Breanna` to start from [Breanna](https://freesewing.org/designs/breanna)
|
||||
- Use `Extend Titan` to start from [Titan](https://freesewing.org/designs/titan)
|
||||
|
||||
#### What name to use
|
||||
|
||||
This will become the name of your design. Stick to \[a-z] here to avoid problems.
|
||||
|
||||
If you're not certain what to pick, just mash some keys, it doesn't matter.
|
||||
|
||||
#### What package manager to use
|
||||
|
||||
You may wish to choose `yarn` since that is the package manager
|
||||
that we use when doing work in the monorepo,
|
||||
and many of our tutorials are written to use `yarn`.
|
||||
However, it doesn't really matter.
|
||||
You can choose either `yarn` or `npm` as you wish.
|
||||
|
||||
:::
|
|
@ -0,0 +1,62 @@
|
|||
---
|
||||
title: Start the development environment
|
||||
order: 50
|
||||
---
|
||||
|
||||
FreeSewing provides a development environment to help you design and develop patterns.
|
||||
|
||||
There are two ways to run this development environment:
|
||||
|
||||
- [**Monorepo development**](#monorepo-development): Use this if you intend to contribute your work to FreeSewing
|
||||
- [**Stand-alone development**](#stand-alone-development): Use this if you want to do your own thing, and not contribute to FreeSewing
|
||||
|
||||
## Monorepo development
|
||||
|
||||
Run `yarn lab` to start the development environment:
|
||||
|
||||
```bash
|
||||
yarn lab
|
||||
```
|
||||
|
||||
Then point your browser to http://localhost:8000
|
||||
|
||||
:::tip
|
||||
### Adding a new design
|
||||
This is all you need to work on existing designs. If you'd like to add a new design, run:
|
||||
|
||||
```bash
|
||||
yarn new design
|
||||
```
|
||||
|
||||
Just make sure to re-start the lab afterwards with `yarn lab`
|
||||
:::
|
||||
|
||||
## Stand-alone development
|
||||
|
||||
You will have a new folder that has the name you picked for your design.
|
||||
If you chose `test`, you will have a folder named `test`.
|
||||
If you chose `banana`, you'll have a folder named `banana`.
|
||||
(Within this new folder, the `design` subfolder holds your design's configuration file and source code.
|
||||
You can ignore all other subfolders and files; they are part of the development environment.)
|
||||
|
||||
To start the development environment, enter the folder that was created
|
||||
and run `yarn dev` (or `npm run dev` if you're using npm as a package manager).
|
||||
|
||||
Then open your browser and go to http://localhost:8000
|
||||
|
||||
:::tip
|
||||
The development environment will watch for any changes you make to
|
||||
the pattern's source code or configuration.
|
||||
When you do, it will update automatically in your browser.
|
||||
:::
|
||||
|
||||
:::note
|
||||
|
||||
##### Yay, you're done!
|
||||
|
||||
All you have to do now is design your pattern.
|
||||
Thankfully, we have a tutorial for that too:
|
||||
|
||||
- [Pattern design tutorial](/tutorials/pattern-design/): A step-by-step guide to designing your first pattern
|
||||
|
||||
:::
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
title: Installing Node.js
|
||||
order: 20
|
||||
---
|
||||
|
||||
Now we will use `nvm` to install Node.js. Run the following command:
|
||||
|
||||
```bash
|
||||
nvm install lts/hydrogen
|
||||
```
|
||||
|
||||
This will install the so-called LTS version of Node.js 18 on your system.
|
||||
|
||||
LTS versions -- short for Long Term Support -- are good Node.js versions
|
||||
to use because they are stable and supported for a long time.
|
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
title: Installing nvm
|
||||
order: 10
|
||||
---
|
||||
|
||||
FreeSewing is built with [Node.js](https://nodejs.org/), a JavaScript runtime.
|
||||
|
||||
You'll need to install Node.js on your system, and to do so, we'll
|
||||
use [`nvm`](https://github.com/nvm-sh/nvm), short for _Node Version Manager_.
|
||||
|
||||
Using `nvm` has a number of benefits in comparison with installing Node.js directly from
|
||||
the Node.js website, or from a package provided by your Linux distribution:
|
||||
|
||||
- You can easily switch between different Node.js versions
|
||||
- Everything gets installed in your home folder, avoiding permission problems
|
||||
|
||||
To setup `nvm`, [follow the install instructions in the nvm
|
||||
README](https://github.com/nvm-sh/nvm#installing-and-updating).
|
||||
|
||||
After installation is completed, try running the following command:
|
||||
|
||||
```bash
|
||||
nvm
|
||||
```
|
||||
|
||||
If all goes well, it should show you the `nvm` help.
|
||||
|
||||
:::tip
|
||||
|
||||
If you get `nvm: command not found` or something similar, close the current terminal
|
||||
window, and open a new one. Now `nvm` should be found.
|
||||
|
||||
:::
|
|
@ -0,0 +1,54 @@
|
|||
---
|
||||
title: Using a different Node.js version
|
||||
order: 30
|
||||
---
|
||||
|
||||
Now that you've got Node.js setup, we can start setting up the FreeSewing
|
||||
development environment.
|
||||
|
||||
But before doing so, let's look at how `nvm` can help you juggle different
|
||||
Node.js versions.
|
||||
|
||||
### nvm ls
|
||||
|
||||
To see the different Node.js versions on your system, run this command:
|
||||
|
||||
```bash
|
||||
nvm ls
|
||||
```
|
||||
|
||||
It will show you a list of local Node.js versions,
|
||||
either the version number or an _alias_ that points to a specific version.
|
||||
You should see the `lts/*` alias in the list which is what we've just installed.
|
||||
|
||||
### nvm ls-remote
|
||||
|
||||
To see all Node.js versions that are available, not just those you have locally,
|
||||
run this command:
|
||||
|
||||
```bash
|
||||
nvm ls-remote
|
||||
```
|
||||
|
||||
It will spit out a long list of Node.js versions that you can install.
|
||||
|
||||
### nvm install
|
||||
|
||||
For any of these versions, either local or remote, you can install them
|
||||
by making a note of the version or alias and running this command:
|
||||
|
||||
```bash
|
||||
nvm install <version-or-alias>
|
||||
```
|
||||
|
||||
### nvm use
|
||||
|
||||
With multiple Node.js versions installed, `nvm` allows you to switch between different
|
||||
versions. Just tell it which version you want to use:
|
||||
|
||||
```bash
|
||||
nvm use lts/hydrogen
|
||||
```
|
||||
|
||||
If you picked a version that is not installed, `nvm` will simply tell you
|
||||
and even suggest the command you should type to install it. Handy!
|
13
sites/dev/docs/tutorials/getting-started-linux/readme.mdx
Normal file
13
sites/dev/docs/tutorials/getting-started-linux/readme.mdx
Normal file
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
title: Getting started on Linux
|
||||
order: 15
|
||||
---
|
||||
|
||||
In this tutorial, we will setup Node.js and initialize the FreeSewing
|
||||
development environment on a Linux system.
|
||||
|
||||
We'll cover the following steps:
|
||||
|
||||
<ReadMore />
|
||||
|
||||
:::tipThese instructions are also valid for BSD or other Unix systems:::
|
Loading…
Add table
Add a link
Reference in a new issue