2022-07-02 22:52:31 +02:00
|
|
|
---
|
|
|
|
title: Setting up the FreeSewing development environment
|
|
|
|
order: 40
|
|
|
|
---
|
|
|
|
|
2022-10-12 22:01:24 +02:00
|
|
|
FreeSewing provides a development environment to help you design and develop
|
|
|
|
patterns.
|
2022-07-02 22:52:31 +02:00
|
|
|
|
|
|
|
There are two ways to run this development environment:
|
|
|
|
|
2022-10-12 22:01:24 +02:00
|
|
|
- [**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
|
2022-07-02 22:52:31 +02:00
|
|
|
|
|
|
|
## Monorepo development
|
|
|
|
|
2022-10-12 22:01:24 +02:00
|
|
|
<Note compact>
|
|
|
|
This is the recommended way for (aspiring) FreeSewing contributors
|
|
|
|
</Note>
|
2022-07-02 22:52:31 +02:00
|
|
|
|
|
|
|
### TL;DR
|
|
|
|
|
|
|
|
```bash
|
|
|
|
git clone https://github.com/freesewing/freesewing
|
|
|
|
cd freesewing
|
|
|
|
yarn kickstart
|
|
|
|
```
|
|
|
|
|
|
|
|
<Tip>
|
2022-10-12 22:01:24 +02:00
|
|
|
Even better: [clone your own
|
|
|
|
fork](https://github.com/freesewing/freesewing/fork)
|
2022-07-02 22:52:31 +02:00
|
|
|
|
|
|
|
```bash
|
|
|
|
git clone https://github.com/your-username/freesewing
|
|
|
|
cd freesewing
|
|
|
|
yarn kickstart
|
|
|
|
```
|
|
|
|
</Tip>
|
|
|
|
|
2022-10-12 22:01:24 +02:00
|
|
|
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
|
|
|
|
```
|
|
|
|
|
2022-07-02 22:52:31 +02:00
|
|
|
### Step by step
|
|
|
|
|
|
|
|
<Comment by="joost">
|
2023-05-04 19:16:07 -07:00
|
|
|
These docs assume you have git installed.
|
2022-07-02 22:52:31 +02:00
|
|
|
But if you're running Linux, you have git, right?
|
|
|
|
</Comment>
|
|
|
|
|
|
|
|
#### Install yarn
|
2022-07-31 16:11:50 +02:00
|
|
|
|
2022-12-29 06:25:01 -08:00
|
|
|
Our repository uses yarn workspaces. So you'll need `yarn` to work with it.
|
2022-07-02 22:52:31 +02:00
|
|
|
|
|
|
|
To install it run:
|
|
|
|
|
|
|
|
```bash
|
2022-07-27 14:07:59 -07:00
|
|
|
npm install yarn --global
|
2022-07-02 22:52:31 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
#### 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
|
|
|
|
|
2022-12-29 06:25:01 -08:00
|
|
|
Now that you have your very own fork, it's time to clone it locally.
|
2022-07-02 22:52:31 +02:00
|
|
|
|
|
|
|
```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).
|
|
|
|
|
2022-10-12 22:01:24 +02:00
|
|
|
## 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
|
|
|
|
|
2022-12-29 06:25:01 -08:00
|
|
|
If you'd like to create a new plugin, run the following command:
|
2022-10-12 22:01:24 +02:00
|
|
|
|
|
|
|
```sh
|
|
|
|
yarn new plugin
|
|
|
|
```
|
|
|
|
|
2022-07-02 22:52:31 +02:00
|
|
|
## Stand-alone development
|
|
|
|
|
2022-12-29 06:25:01 -08:00
|
|
|
With Node.js installed, all you need to do to setup the stand-alone development environment is run this command:
|
2022-07-02 22:52:31 +02:00
|
|
|
|
|
|
|
```bash
|
2023-09-30 15:57:51 +02:00
|
|
|
npx @freesewing/new-design
|
2022-07-02 22:52:31 +02:00
|
|
|
```
|
|
|
|
|
2022-10-12 22:01:24 +02:00
|
|
|
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).
|
2022-07-02 22:52:31 +02:00
|
|
|
|
2022-08-07 12:56:35 -07:00
|
|
|
<Tip compact>The folder will have the name you chose above.</Tip>
|
2022-07-02 22:52:31 +02:00
|
|
|
|
|
|
|
<Note>
|
2022-10-12 22:01:24 +02:00
|
|
|
|
2022-07-02 22:52:31 +02:00
|
|
|
### Questions
|
|
|
|
|
|
|
|
#### What template to use
|
2022-07-31 16:11:50 +02:00
|
|
|
|
2022-07-02 22:52:31 +02:00
|
|
|
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
|
2022-07-10 12:29:53 +02:00
|
|
|
|
2022-07-31 16:11:50 +02:00
|
|
|
This will become the name of your design. Stick to \[a-z] here to avoid problems.
|
2022-07-02 22:52:31 +02:00
|
|
|
|
|
|
|
If you're not certain what to pick, just mash some keys, it doesn't matter.
|
|
|
|
|
|
|
|
#### What package manager to use
|
|
|
|
|
2023-05-04 19:16:07 -07:00
|
|
|
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.
|
2022-07-02 22:52:31 +02:00
|
|
|
|
|
|
|
</Note>
|