Skip to content

Commit

Permalink
#572: last docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
basmasking committed Jan 3, 2025
1 parent 5b58639 commit 699153a
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 22 deletions.
23 changes: 13 additions & 10 deletions documentation/docs/build/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,25 @@ The `jitar.json` file is a JSON file that contains the following properties:
}
```

All properties are optional and have default values. The defaults are based on a JavaScript project, so the `source` and `target` folders are `./src` and `./dist` respectively. For the `segments` and `resources` folders the defaults are `./segments` and `./resources`.
There are four properties in the configuration file:
* `source` - the location of the source files (default `./src`).
* `target` - the location of the target files (default `./dist`).
* `segments` - the location of the segment configuration files (default `./segments`).
* `resources` - the location of the resource files (default `./resources`).

::: tip NOTE
For a TypeScript project, the `source` folder should be the target folder after transpilation, so it should be `./dist` instead of `./src`. The `target` folder can be the same as the `source` folder in this case, but it can also be a different folder.

::: tip
The build process deletes the files in the `target` folder during the build process. Make sure that it doesn't point to the src folder.
:::

## Environment variables
The `jitar.json` file can also contain environment variables. The values of the properties can be environment variables. For example:
::: tip NOTE
The build process deletes the files in the `target` folder during the build process. Make sure that it doesn't point to the `src` folder.
:::

::: tip NOTE
The configuration also supports environment variables. They can be used by wrapping the variable name in `${}`. For example, `${source}`.
```json
{
"source": "${SOURCE}",
"target": "${TARGET}",
"segments": "${SEGMENTS}",
"resources": "${RESOURCES}"
"source": "${source}"
}
```
:::
2 changes: 1 addition & 1 deletion documentation/docs/deploy/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ In Jitar's [segmentation model](/deploy/segmentation), each segment is isolated

### Resource files

Jitar will search for resource definitions files in the project directory. The files are named `*.json`. Each entry defines the entry point of the `module` that should be used as a resource.
Jitar will search for resource definitions files in the `resources` directory. The files are named `*.json`. Each entry defines the entry point of the `module` that should be used as a resource.

The file has the following structure:

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/develop/application-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,4 @@ services
└─ global.json
```

Any resource that needs to be initialized in a startup or stopped in a teardown phase must be defined here.
Any resource that needs to be initialized in a startup or stopped in a teardown phase must be defined here.
6 changes: 3 additions & 3 deletions documentation/docs/develop/data-sharing.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ import { modify } from './modify';
export async function test(): Promise<void>
{
// create new instance
const person: Person = new Person( 'John Doe', 42);
const original = new Person( 'John Doe', 42);

modify(person);
const copy = await modify(original);

console.log(person);
console.log(copy);
}
```

Expand Down
4 changes: 2 additions & 2 deletions documentation/docs/develop/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ prev:
link: /develop/assets

next:
text: Build configuration
link: /build/configuration
text: Build settings
link: /build/settings

---

Expand Down
4 changes: 2 additions & 2 deletions documentation/docs/develop/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ export DatabaseError extends Error
```ts
// src/domain/account/storeAccount.ts
import { Account } from './Account';
import { DatabaseError } from '../DatabaseError';
import { DatabaseError } from '../../DatabaseError';

export async function storeAccount(account: Account): Promise<void>
{
throw new Error('Not implemented');
throw new DatabaseError('Not implemented');
}
```

Expand Down
4 changes: 2 additions & 2 deletions documentation/docs/fundamentals/building-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ More in depth information on writing functions and the rules can be found in the

### Fully qualified name (FQN)

Every function has a unique name used for internal and external identification. This name is called a fully qualified name (FQN) and constructed with the location and the name of the function in the following format.
Every function has a unique name used for internal and external identification. This name is called the fully qualified name (FQN) and constructed with the location and the name of the function in the following format.

```txt
{ location relative to the source folder }/{ function name }
Expand Down Expand Up @@ -133,7 +133,7 @@ For the definition of a segment, JSON files are used and placed in a `segments`
This configuration connects very well with the JavaScript module system. It includes exported functions from one or more module files with four configuration options:

1. Exposed functions per module file
1. Access level per function (public / private, default private)
1. Access level per function (public / protected / private, default private)
1. Version number per function (optional, default 0.0.0)
1. Alternative name (optional, default the name of the function)

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/introduction/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ To tell Jitar if a function runs on the client or the server, the application is
}
```

Segments are named, and their names are stored in the filename. In this case the segment is called ‘default’. The rest of the filename makes it a detectable segment configuration, because Jitar scans the project to find them.
Segments are named, and their names are stored in the filename. In this case the segment is called ‘default’.

Segment configurations work like the JavaScript module system. In this case we export the `sayHello` function from `./domain/sayHello` module file. Additionally we set the access level to public so it can be called from the client. The configuration can be extended by simply adding functions.

Expand Down

0 comments on commit 699153a

Please sign in to comment.