-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(schematics): migration rule for imports
- Loading branch information
1 parent
f0f346b
commit 605b6da
Showing
47 changed files
with
1,088 additions
and
580 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
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
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,34 @@ | ||
# Mosaic schematics | ||
|
||
## ng update | ||
|
||
The angular cli provides an interface to run automatic update scripts with | ||
`ng update` for library authors. To achieve this we are using the | ||
`collection.json` file to specify the schematics that need to run for each | ||
version individually. | ||
|
||
### Testing | ||
|
||
There are tests for the update schematics that create a virtual demo app that is | ||
used to check whether the schematic changes the correct things. | ||
|
||
If you want to test the schematic on a real world app you should perform the | ||
following steps: | ||
|
||
- Run `ng build` - this builds the library including the schematics and puts it | ||
into the `dist/mosaic` folder | ||
- Link the npm dependency of the `@ptsecurity/mosaic` to the | ||
`dist/mosaic` folder | ||
- run | ||
`ng update @ptsecurity/mosaic --migrateOnly=true --from="8.0.0" --to="9.0.0"` | ||
with the correct versions respectively | ||
|
||
## ng add | ||
|
||
The ng-add schematics is used to add the **mosaic components** to a new angular | ||
project with all its dependencies | ||
|
||
### Testing | ||
|
||
To run the unit tests with jest you can leverage the angular CLI with: | ||
`ng test schematics` or in the watch mode `ng test schematics --watch` |
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 |
---|---|---|
@@ -1,22 +1,5 @@ | ||
// This is the root config file where the schematics are defined. | ||
{ | ||
"$schema": "./node_modules/@angular-devkit/schematics/collection-schema.json", | ||
"$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json", | ||
"schematics": { | ||
// Adds Mosaic to an application without changing any templates | ||
"ng-add": { | ||
"description": "Adds Mosaic to the application without affecting any templates", | ||
"factory": "./ng-add/index", | ||
"schema": "./ng-add/schema.json", | ||
"aliases": [ | ||
"mosaic-shell", | ||
"install" | ||
] | ||
}, | ||
"ng-add-setup-project": { | ||
"description": "Sets up the specified project after the ng-add dependencies have been installed.", | ||
"private": true, | ||
"factory": "./ng-add/setup-project", | ||
"schema": "./ng-add/schema.json" | ||
} | ||
} | ||
} |
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,10 @@ | ||
{ | ||
"$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json", | ||
"schematics": { | ||
"update-9.0.0": { | ||
"version": "9.0.0", | ||
"description": "Updates Mosaic to 9.0.0", | ||
"factory": "./ng-update/index#updateToV9" | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.