天天看點

SAP Spartacus 更新時關于 schematics 的更新Migration Mechanism一個例子:每個 migration script 都有一系列屬性。

SAP Spartacus 更新時關于 schematics 的更新Migration Mechanism一個例子:每個 migration script 都有一系列屬性。

Migration Mechanism
SAP Spartacus 更新時關于 schematics 的更新Migration Mechanism一個例子:每個 migration script 都有一系列屬性。
SAP Spartacus 更新時關于 schematics 的更新Migration Mechanism一個例子:每個 migration script 都有一系列屬性。
一個例子:
SAP Spartacus 更新時關于 schematics 的更新Migration Mechanism一個例子:每個 migration script 都有一系列屬性。
每個 migration script 都有一系列屬性。

name

格式如下:migration-v--.

version: migration 的目标版本。

migration-feature-name: 描述 Migration 的具體内容。

sequence-number:腳本執行順序。

其中 version 屬性至關重要:version is very important for the Angular update mechanism. It is used to automatically run the required migration scripts for a specific version.

用來自動運作所需的 Migration 腳本。

factory: 指向真正的 Migration 腳本。

SAP Spartacus 更新時關于 schematics 的更新Migration Mechanism一個例子:每個 migration script 都有一系列屬性。
SAP Spartacus 更新時關于 schematics 的更新Migration Mechanism一個例子:每個 migration script 都有一系列屬性。

Check whether any of the changed files are exported in the public API. If no, then no further action is required.

檢查被修改的檔案是否被導出為 public API,如果否,什麼都不用做。

Check whether any of the changes you have made are breaking changes. If not, no further action is required.

如果做的修改不包含 breaking changes,什麼都不用做。

如果是 breaking change,需要将修改記錄到對應的 Migration 檔案裡,比如:docs/migration/3_0.md.

Build automation tasks, as described in the Validations, Constructor Deprecation, and Component Deprecation) sections, above.

建構自動化任務。

Test the added migrations by running tests, trying to migrate an example app, and so on.

可以通過運作測試的方式,測試建立的 Migration.

可以參考這個 pull request:

https://github.com/SAP/spartacus/pull/9946/files

繼續閱讀