mirror of
				https://gitlab.nic.cz/turris/reforis/foris-js.git
				synced 2025-11-03 23:00:31 +01:00 
			
		
		
		
	docs: Refactor development and introduction sections
For clarity and consistency.
This commit is contained in:
		@@ -1,25 +1,27 @@
 | 
				
			|||||||
Sooner or later, you will face with situation when you want/need to make some
 | 
					At some point, you'll likely need to modify the library. When that happens, your
 | 
				
			||||||
changes in the library. Then the most important tool for you it's the
 | 
					best friend will be [`npm link`](https://docs.npmjs.com/cli/link).
 | 
				
			||||||
[`npm link`](https://docs.npmjs.com/cli/link).
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
Please, notice that it will not work if you link the library just from the root
 | 
					**Important Note:** Simply linking from the repo root won't work because the
 | 
				
			||||||
of the repo. It happens due to the location of sources `./src`. You need to pack
 | 
					source files are in `./src`. Instead, you'll need to:
 | 
				
			||||||
the library first, `make pack` and then link it from the `./dist` directory.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
Yeah, it's not such a comfortable solution for development. But it can be fixed
 | 
					1. First package the library using `make pack`
 | 
				
			||||||
by writing a small script similar to making a pack but by linking every file and
 | 
					2. Then link it from the `./dist` directory
 | 
				
			||||||
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.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
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
 | 
					```bash
 | 
				
			||||||
make pack;
 | 
					# Package and link the library
 | 
				
			||||||
cd dist;
 | 
					make pack
 | 
				
			||||||
npm link;
 | 
					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
 | 
					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
 | 
					Foris JS is a library containing reusable components and utilities designed
 | 
				
			||||||
plugins.
 | 
					specifically for the reForis application and its plugins.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Please notice that all of these components or utils are used in reForis and
 | 
					**Note:** All components and utilities in this library are actively used in
 | 
				
			||||||
plugins. If you want to study them by example, I recommend you to full-text
 | 
					reForis and its plugins. To see practical examples of how they're implemented,
 | 
				
			||||||
search those repositories.
 | 
					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
 | 
					Before installing, ensure you have [Node.js](https://nodejs.org/en/) installed
 | 
				
			||||||
system.
 | 
					on your system.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The current Long Term Support (LTS) release is an ideal starting point, see
 | 
					We recommend using the current Long Term Support (LTS) version for optimal
 | 
				
			||||||
[here](https://github.com/nodejs/Release#release-schedule).
 | 
					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
 | 
					npm install foris
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
To install a specific version:
 | 
					Or install a specific version by running:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```plain
 | 
					```bash
 | 
				
			||||||
npm install foris@version
 | 
					npm install foris@version
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user