-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2075b38
commit 5f2a0fa
Showing
15 changed files
with
86 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Check Markdown links | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- 'release/*' | ||
|
||
jobs: | ||
markdown-link-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: gaurav-nelson/github-action-markdown-link-check@v1 | ||
with: | ||
config-file: '.github/workflows/markdown.links.config.json' | ||
check-modified-files-only: 'no' # TODO: set to 'yes' before merging | ||
use-verbose-mode: 'yes' | ||
use-quiet-mode: 'no' | ||
folder-path: 'packages/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"replacementPatterns": [ | ||
{ | ||
"pattern": "/%40", | ||
"replacement": "/@" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,15 @@ | |
|
||
## Where to define the ng-update migrations? | ||
|
||
To be recognized by the __ng-cli as update schematics__, we have to define our migrations schematics in | ||
To be recognized by the __ng-cli as update schematics__, we have to define our migrations schematics in | ||
__package.json__, _ng-update_ section of the package which contains the updates, in our case __@o3r/core__ | ||
```json | ||
"ng-update": { | ||
"migrations": "./migration.json" | ||
} | ||
``` | ||
|
||
The content of migration.json is as follows: | ||
The content of migration.json is as follows: | ||
ex: | ||
```json | ||
{ | ||
|
@@ -25,32 +25,32 @@ ex: | |
"migration-v3_2": { | ||
"version": "3.2.0-alpha.0", // version to update to | ||
"description": "Updates of the Otter Library v3.2.x", | ||
"factory": "./schematics/ng-update/index#updateV3_2" // relative path to the schematics factory function to execute | ||
"factory": "./schematics/ng-update/index#updateV3_2" // relative path to the schematics factory function to execute | ||
} | ||
} | ||
} | ||
``` | ||
``` | ||
|
||
When we run the update on _@o3r/core_ (```yarn ng update @o3r/core```) in our app, ng-cli will install the latest version of @o3r/core and | ||
it will check the ng-update section in the package.json of the new installed version, to see if there are updates to execute. | ||
Based on the starting version of @o3r/core and the new installed one, the cli will run the schematics which are between these 2 versions from migration.json | ||
Here are 2 scenarios: | ||
When we run the update on _@o3r/core_ (```yarn ng update @o3r/core```) in our app, ng-cli will install the latest version of @o3r/core and | ||
it will check the ng-update section in the package.json of the new installed version, to see if there are updates to execute. | ||
Based on the starting version of @o3r/core and the new installed one, the cli will run the schematics which are between these 2 versions from migration.json | ||
Here are 2 scenarios: | ||
### Scenario 1 | ||
- Application in otter 3.0, latest stable version of otter is 3.2 | ||
- Application in otter 3.0, latest stable version of otter is 3.2 | ||
|
||
Based on the above _migration.json_ the cli will run __migration-v3__ and __migration-v3_2__ because the versions '3.1.0-alpha.0' and '3.2.0-alpha.0' defined in migration.json are between 3.0 (old version) and 3.2 (latest stable) | ||
|
||
### Scenario 2 | ||
- Application in otter 3.1, latest stable version of otter is 3.2 | ||
- Application in otter 3.1, latest stable version of otter is 3.2 | ||
|
||
Based on the above _migration.json_ the cli will run __migration-v3_2__ because the version '3.2.0-alpha.0' defined in migration.json is the only one between 3.0 (old version) and 3.2 (latest stable) | ||
|
||
## Development time | ||
|
||
To be easier to test in local, when we need to create/update schematics, we can use the schematics cli. | ||
1. install @angular-devkit\schematics-cli on the app, if needed (no need to commit the change) | ||
2. link (yarn link or cpx) @o3r/core in the app | ||
3. run: | ||
2. link (yarn link or cpx) @o3r/core in the app | ||
3. run: | ||
```node ./node_modules/@angular-devkit/schematics-cli/bin/schematics.js ./node_modules/@o3r/core/collection.json:update-otter --dry-run=false --force``` | ||
|
||
One mention for step 3 is that you have to add a new entry in _@o3r/core/collection.json_ to point to the update schematic | ||
|
@@ -62,15 +62,6 @@ One mention for step 3 is that you have to add a new entry in _@o3r/core/collect | |
``` | ||
No need to commit this change. | ||
|
||
## Testing your schematic with the PR version number | ||
|
||
When you have done the development on the schematic, next steps are required to test that your schematic is working with the normal way of running it (not the way used in dev chapter) | ||
Steps: | ||
- all steps are executed at app level; | ||
1. modify _.npmrc_ of the app to target the _otter-pr_ versions | ||
@o3r:registry=https://pkgs.dev.azure.com/AmadeusDigitalAirline/Otter/_packaging/otter-pr/npm/registry/ (don't forget auth tokens) | ||
|
||
2. run: yarn ng update @o3r/core@prVersion --force | ||
ex: ``` yarn ng update @o3r/[email protected] --force``` | ||
## Testing your schematic with the PR version number | ||
|
||
The command above will run all schematics update for all packages defined in "ng-update" -> "packageGroup" section in `package.json` file of _@o3r/core_ | ||
Please refer to the [Verdaccio](../../.verdaccio/README.md) setup. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.