@o3r/schematics 8.1.0-alpha.62 → 8.1.0-alpha.64
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +203 -8
- package/package.json +4 -4
package/README.md
CHANGED
@@ -1,17 +1,212 @@
|
|
1
|
-
|
1
|
+
<h1 align="center">Otter Framework</h1>
|
2
|
+
<p align="center">
|
3
|
+
<img src="./.attachments/logo.png" alt="Super cute Otter!"/>
|
4
|
+
</p>
|
2
5
|
|
3
|
-
|
6
|
+
<br />
|
7
|
+
<br />
|
4
8
|
|
5
|
-
|
9
|
+
## Description
|
10
|
+
The **Otter** project is a highly modular framework whose goal is to provide a common platform to accelerate and facilitate the development on Angular web applications.
|
11
|
+
It is split into several units to cover different aspects of these applications (localization, testing, customization, etc.).
|
12
|
+
Also, to customize an application, metadata can be extracted from the application source code and injected into a CMS to manage dynamic configuration.
|
13
|
+
|
14
|
+
> **Note**: The full documentation is available [here](./docs/README.md).
|
15
|
+
|
16
|
+
## Built With
|
17
|
+
|
18
|
+
* [Angular](https://angular.io/)
|
19
|
+
* [Typescript](https://www.typescriptlang.org/)
|
20
|
+
* [RxJs](http://reactivex.io/rxjs/)
|
21
|
+
* [Redux](http://redux.js.org/)
|
22
|
+
* [Sass](http://sass-lang.com/)
|
23
|
+
* [Nx](https://nx.dev/)
|
24
|
+
|
25
|
+
## Get Started
|
6
26
|
|
7
|
-
|
27
|
+
A new application can be set up with these simple commands:
|
8
28
|
|
9
29
|
```shell
|
10
|
-
|
30
|
+
# Starting a new angular application
|
31
|
+
npm install -g @angular/cli
|
32
|
+
ng new my-app
|
33
|
+
|
34
|
+
# Add Otter framework
|
35
|
+
ng add @o3r/core
|
11
36
|
```
|
12
37
|
|
13
|
-
> **
|
38
|
+
> **Note**: Please refer to [Otter Get Started](./docs/core/START_NEW_APPLICATION.md) and [Angular Get Started](https://angular.io/guide/setup-local#install-the-angular-cli) for complete documentation.
|
14
39
|
|
15
|
-
##
|
40
|
+
## Contributing
|
41
|
+
|
42
|
+
Please read the [Contributing](./CONTRIBUTING.md) file for details on our code of conduct and the process to submit pull requests.
|
43
|
+
|
44
|
+
## Versioning
|
45
|
+
|
46
|
+
Please refer to [Security file](./SECURITY.md).
|
47
|
+
|
48
|
+
## License
|
49
|
+
|
50
|
+
Please refer to the [License file](./LICENSE).
|
51
|
+
|
52
|
+
## Acknowledgments
|
53
|
+
|
54
|
+
The Otter Team, @AmadeusITGroup/otter_admins, is responsible for the review of the code of this repository.
|
55
|
+
Any bug of feature request can be addressed via [issue](https://github.com/AmadeusITGroup/otter/issues/new) report.
|
56
|
+
|
57
|
+
## Developer
|
58
|
+
|
59
|
+
### Building and Testing library
|
60
|
+
|
61
|
+
These documents describe how to set up your development environment to build and test the framework.
|
62
|
+
It also explains the basic mechanics of using `git`, `node`, and `npm`.
|
63
|
+
|
64
|
+
- [Description](#description)
|
65
|
+
- [Built With](#built-with)
|
66
|
+
- [Get Started](#get-started)
|
67
|
+
- [Contributing](#contributing)
|
68
|
+
- [Versioning](#versioning)
|
69
|
+
- [License](#license)
|
70
|
+
- [Acknowledgments](#acknowledgments)
|
71
|
+
- [Developer](#developer)
|
72
|
+
- [Building and Testing library](#building-and-testing-library)
|
73
|
+
- [Prerequisite Software](#prerequisite-software)
|
74
|
+
- [Getting the Sources](#getting-the-sources)
|
75
|
+
- [Installing NPM Modules](#installing-npm-modules)
|
76
|
+
- [Build command](#build-command)
|
77
|
+
- [Running tests locally](#running-tests-locally)
|
78
|
+
- [Manage task cache](#manage-task-cache)
|
79
|
+
- [Debugging with Visual Studio Code](#debugging-with-visual-studio-code)
|
80
|
+
- [Link local packages](#link-local-packages)
|
81
|
+
|
82
|
+
Refer to the [contribution guidelines](./CONTRIBUTING.md)
|
83
|
+
if you'd like to contribute to the framework.
|
84
|
+
|
85
|
+
#### Prerequisite Software
|
86
|
+
|
87
|
+
Before you can build and test Otter modules, you must install and configure the
|
88
|
+
following products on your development machine:
|
89
|
+
|
90
|
+
* [Git](http://git-scm.com) and/or the **GitHub app** (for [Mac](http://mac.github.com) or
|
91
|
+
[Windows](http://windows.github.com))
|
92
|
+
* [GitHub's Guide to Installing
|
93
|
+
Git](https://help.github.com/articles/set-up-git) is a good source of information.
|
94
|
+
|
95
|
+
* [Node.js](http://nodejs.org), (version `>=10.0.0`)
|
96
|
+
* This is used to run tests and generate distributable files. We also use Node's Package Manager, `npm`
|
97
|
+
(version `>3.8.x`), which comes with Node. Depending on your system, you can install Node either from
|
98
|
+
source or as a pre-packaged bundle.
|
99
|
+
|
100
|
+
* [Yarn](https://yarnpkg.com/lang/en/docs/install/), a Node's Package Manager
|
101
|
+
* You can install yarn using NPM manager (coming with Node.js).
|
102
|
+
The version of Yarn currently used is embedded in the repository. In case you need to link this library with your project, you can check the section "Link local packages".
|
103
|
+
|
104
|
+
* [Chrome](https://www.google.com/chrome/browser/desktop/index.html)
|
105
|
+
* We use Chrome to run our tests.
|
106
|
+
|
107
|
+
#### Getting the sources
|
108
|
+
|
109
|
+
Clone the Otter repository using the button `Code` or using the following git command:
|
110
|
+
|
111
|
+
```shell
|
112
|
+
git clone https://github.com/AmadeusITGroup/otter.git
|
113
|
+
```
|
114
|
+
|
115
|
+
#### Installing NPM modules
|
116
|
+
|
117
|
+
Next, install the JavaScript modules needed to build:
|
118
|
+
|
119
|
+
```shell
|
120
|
+
# Install library project dependencies (package.json)
|
121
|
+
yarn install
|
122
|
+
```
|
123
|
+
|
124
|
+
#### Build command
|
125
|
+
|
126
|
+
To build the modules, run:
|
127
|
+
|
128
|
+
```shell
|
129
|
+
yarn run build
|
130
|
+
```
|
131
|
+
|
132
|
+
Each module can be built independently thanks to [Nx](https://nx.dev/packages/nx/documents/run) commands:
|
133
|
+
|
134
|
+
```shell
|
135
|
+
# ex: Build Core package only
|
136
|
+
yarn nx build core
|
137
|
+
```
|
138
|
+
|
139
|
+
> **Note**: Results are put in the `dist` of each module (`packages/@<scope>/<module>/dist`).
|
140
|
+
|
141
|
+
#### Running tests locally
|
142
|
+
|
143
|
+
Check the formatting:
|
144
|
+
|
145
|
+
```shell
|
146
|
+
yarn run lint
|
147
|
+
```
|
148
|
+
|
149
|
+
Check Unit Tests:
|
150
|
+
|
151
|
+
```shell
|
152
|
+
yarn run test
|
153
|
+
```
|
154
|
+
|
155
|
+
Each module can be test independently thanks to [Nx](https://nx.dev/packages/nx/documents/run) commands:
|
156
|
+
|
157
|
+
```shell
|
158
|
+
# ex: Test Core package only
|
159
|
+
yarn nx test core
|
160
|
+
|
161
|
+
# ex: Lint Core package only
|
162
|
+
yarn nx lint core
|
163
|
+
```
|
164
|
+
|
165
|
+
#### Manage task cache
|
166
|
+
|
167
|
+
When running the Build, Lint, or Test commands, **Nx** can use its [cache mechanism](https://nx.dev/concepts/how-caching-works).
|
168
|
+
In some cases, it may be useful to clear the cache to investigate an issue. This can be done with the following command:
|
169
|
+
|
170
|
+
```shell
|
171
|
+
yarn nx reset
|
172
|
+
```
|
173
|
+
|
174
|
+
#### Debugging with Visual Studio Code
|
175
|
+
|
176
|
+
The repository contains the mandatory configuration and the recommended VSCode plugins to ensure optimal comfort and productivity while developing on the Otter Framework.
|
177
|
+
|
178
|
+
The default configuration of the repository provides a way to run Unit Tests one by one and to define, within VSCode, break points using the `vscode-jest-tests` debugger task.
|
179
|
+
|
180
|
+
#### Link local packages
|
16
181
|
|
17
|
-
|
182
|
+
For Yarn v1, add the `resolutions` property in the main package.json. It should be filled with the relative path to the `dist` of the local packages you want to link. The protocol `link:` can be used.
|
183
|
+
|
184
|
+
NOTE: It will not import the transitive dependencies of the linked packages.
|
185
|
+
|
186
|
+
Example:
|
187
|
+
|
188
|
+
```json
|
189
|
+
{
|
190
|
+
"resolutions": {
|
191
|
+
"@o3r/localization": "./relative/path/to/otter/packages/@o3r/localization/dist",
|
192
|
+
"@o3r/core": "link:./relative/path/to/otter/packages/@o3r/core/dist",
|
193
|
+
}
|
194
|
+
}
|
195
|
+
```
|
196
|
+
|
197
|
+
For Yarn v2+, the protocol `portal:` can also be used.
|
198
|
+
|
199
|
+
NOTE: The portal protocol will also import all the transitive dependencies of the linked packages.
|
200
|
+
Please keep in mind that mismatched versions of these dependencies may cause some issues.
|
201
|
+
|
202
|
+
Example:
|
203
|
+
|
204
|
+
```json
|
205
|
+
{
|
206
|
+
"resolutions": {
|
207
|
+
"@o3r/localization": "./relative/path/to/otter/library/@o3r/localization/dist",
|
208
|
+
"@o3r/core": "link:./relative/path/to/otter/library/@o3r/core/dist",
|
209
|
+
"@o3r/rules-engine": "portal:./relative/path/to/otter/library/@o3r/rules-engine/dist",
|
210
|
+
}
|
211
|
+
}
|
212
|
+
```
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@o3r/schematics",
|
3
|
-
"version": "8.1.0-alpha.
|
3
|
+
"version": "8.1.0-alpha.64",
|
4
4
|
"description": "Schematics module of the Otter framework",
|
5
5
|
"main": "./src/index.js",
|
6
6
|
"keywords": [
|
@@ -28,7 +28,7 @@
|
|
28
28
|
}
|
29
29
|
},
|
30
30
|
"dependencies": {
|
31
|
-
"@o3r/dev-tools": "^8.1.0-alpha.
|
31
|
+
"@o3r/dev-tools": "^8.1.0-alpha.64",
|
32
32
|
"comment-json": "^4.1.0",
|
33
33
|
"globby": "^11.1.0",
|
34
34
|
"minimatch": "^6.1.6",
|
@@ -51,8 +51,8 @@
|
|
51
51
|
"@nrwl/jest": "~15.8.0",
|
52
52
|
"@nrwl/js": "^15.6.3",
|
53
53
|
"@nrwl/linter": "~15.8.0",
|
54
|
-
"@o3r/build-helpers": "^8.1.0-alpha.
|
55
|
-
"@o3r/eslint-plugin": "^8.1.0-alpha.
|
54
|
+
"@o3r/build-helpers": "^8.1.0-alpha.64",
|
55
|
+
"@o3r/eslint-plugin": "^8.1.0-alpha.64",
|
56
56
|
"@schematics/angular": "~15.2.0",
|
57
57
|
"@types/jest": "~28.1.2",
|
58
58
|
"@types/node": "^17.0.45",
|