mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2025-04-25 08:46:39 +02:00
docs: Refactor development and introduction sections
For clarity and consistency.
This commit is contained in:
parent
69b1b38202
commit
835a6e6d2b
@ -1,25 +1,27 @@
|
||||
Sooner or later, you will face with situation when you want/need to make some
|
||||
changes in the library. Then the most important tool for you it's the
|
||||
[`npm link`](https://docs.npmjs.com/cli/link).
|
||||
At some point, you'll likely need to modify the library. When that happens, your
|
||||
best friend will be [`npm link`](https://docs.npmjs.com/cli/link).
|
||||
|
||||
Please, notice that it will not work if you link the library just from the root
|
||||
of the repo. It happens due to the location of sources `./src`. You need to pack
|
||||
the library first, `make pack` and then link it from the `./dist` directory.
|
||||
**Important Note:** Simply linking from the repo root won't work because the
|
||||
source files are in `./src`. Instead, you'll need to:
|
||||
|
||||
Yeah, it's not such a comfortable solution for development. But it can be fixed
|
||||
by writing a small script similar to making a pack but by linking every file and
|
||||
directory from `./src` to the same directory and linking then from it. Notice
|
||||
that you need to link a `package.json` and a `package-lock.json` as well.
|
||||
1. First package the library using `make pack`
|
||||
2. Then link it from the `./dist` directory
|
||||
|
||||
So step by step:
|
||||
While this isn't the most developer-friendly workflow, you can improve it by
|
||||
creating a script that:
|
||||
|
||||
- Symlinks all files/directories from `./src` to another location
|
||||
- Also links `package.json` and `package-lock.json`
|
||||
|
||||
## Quick Start Guide
|
||||
|
||||
```bash
|
||||
make pack;
|
||||
cd dist;
|
||||
npm link;
|
||||
# Package and link the library
|
||||
make pack
|
||||
cd dist
|
||||
npm link
|
||||
|
||||
cd $project_dir/js # Navigate to JS directory of the project where you want to link the library
|
||||
# Link to your project
|
||||
cd /path/to/your/project/js # Navigate to your project's JS directory
|
||||
npm link foris
|
||||
```
|
||||
|
||||
And that's it ;)
|
||||
|
@ -1,35 +1,37 @@
|
||||
Welcome! This is the official documentation for Foris JS.
|
||||
Welcome to the official Foris JS documentation!
|
||||
|
||||
## What Foris JS is
|
||||
## About Foris JS
|
||||
|
||||
Foris JS library is a set of components and utils for reForis application and
|
||||
plugins.
|
||||
Foris JS is a library containing reusable components and utilities designed
|
||||
specifically for the reForis application and its plugins.
|
||||
|
||||
Please notice that all of these components or utils are used in reForis and
|
||||
plugins. If you want to study them by example, I recommend you to full-text
|
||||
search those repositories.
|
||||
**Note:** All components and utilities in this library are actively used in
|
||||
reForis and its plugins. To see practical examples of how they're implemented,
|
||||
we recommend searching through those repositories.
|
||||
|
||||
# Installation
|
||||
## Getting Started
|
||||
|
||||
## Prerequisites
|
||||
### Prerequisites
|
||||
|
||||
Please make sure that [Node.js](https://nodejs.org/en/) is installed on your
|
||||
system.
|
||||
Before installing, ensure you have [Node.js](https://nodejs.org/en/) installed
|
||||
on your system.
|
||||
|
||||
The current Long Term Support (LTS) release is an ideal starting point, see
|
||||
[here](https://github.com/nodejs/Release#release-schedule).
|
||||
We recommend using the current Long Term Support (LTS) version for optimal
|
||||
compatibility. Check the
|
||||
[release schedule](https://github.com/nodejs/Release#release-schedule) for
|
||||
details.
|
||||
|
||||
## Installation
|
||||
### Installation
|
||||
|
||||
To install the latest release:
|
||||
Install the latest version with:
|
||||
|
||||
```plain
|
||||
```bash
|
||||
npm install foris
|
||||
```
|
||||
|
||||
To install a specific version:
|
||||
Or install a specific version by running:
|
||||
|
||||
```plain
|
||||
```bash
|
||||
npm install foris@version
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user