{"id":409769,"date":"2024-06-29T20:59:31","date_gmt":"2024-06-29T20:59:31","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=409769"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=409769","title":{"rendered":"<span>\u041a\u0430\u043a \u043c\u0443\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0432 Angular-\u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0430\u0445 \u0438 \u043d\u0435 \u043f\u043e\u0441\u0435\u0434\u0435\u0442\u044c<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6bf\/125\/0de\/6bf1250de170cea1f21c38b92701d723.png\" width=\"1561\" height=\"881\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6bf\/125\/0de\/6bf1250de170cea1f21c38b92701d723.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Angular CLI \u043d\u0430 \u043f\u043e\u043b\u043d\u0443\u044e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u043c\u0430\u043d\u0434\u044b ng add, ng update \u0438 ng generate \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u043c\u0443\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u0430\u043a, \u043a\u0430\u043a \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e. \u00ab\u041d\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u0443\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434, \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 AST, \u0430 \u044d\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u00bb, \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u043a\u0430\u0436\u0435\u0442\u0435 \u0432\u044b, \u0438 \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u0440\u0430\u0432\u044b!<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043c\u044b \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 AST \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u043e\u0432 \u043e\u0431\u044b\u0434\u0435\u043d\u043d\u044b\u043c. \u0410 \u0435\u0449\u0435 \u043f\u043e\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 AST \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 Angular-\u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432 \u043b\u044e\u0431\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0430 JavaScript\/TypeScript. <\/p>\n<hr\/>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a<\/h2>\n<p>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a \u2014 \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u0432\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0432\u0445\u043e\u0434: \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 \u0434\u043b\u044f \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u043e\u043f\u0446\u0438\u0438 \u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043d\u0435\u0441\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u0440\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u0438\u043f <code>Rule<\/code>. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0435\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435:<\/p>\n<pre><code class=\"javascript\">type Rule = (tree: Tree, context: SchematicContext) => Tree | Observable&lt;Tree> | Rule | Promise&lt;void | Rule> | void;<\/code><\/pre>\n<p>\u0418\u0437 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e <code>Rule<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u0430\u043a \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c, \u0442\u0430\u043a \u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c. \u0418, \u043a\u0430\u043a \u0431\u043e\u043d\u0443\u0441, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0435\u0440\u043d\u0443\u0442\u044c <code>Observable<\/code>. \u0418\u0437 \u0442\u0438\u043f\u0430 <code>Rule<\/code> \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u2014 <code>Tree<\/code>. <code>Tree<\/code> \u2014 \u044d\u0442\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443.<\/p>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <code>ng<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438, \u0438\u043c\u0435\u0435\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043d\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0432\u0441\u0435 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043a \u0432\u044b\u0437\u043e\u0432\u0443 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<h2>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a<\/h2>\n<p>\u041c\u044b \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u043f\u043e \u0446\u0435\u043b\u043e\u043c\u0443 \u0440\u044f\u0434\u0443 \u043f\u0440\u0438\u0447\u0438\u043d.<\/p>\n<p><strong>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439 \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a<\/strong>. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043c\u0430\u0436\u043e\u0440\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0421\u0430\u043c Angular \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0435\u0437\u0434\u0430 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438. \u041c\u044b \u0434\u0430\u0436\u0435<a href=\"https:\/\/github.com\/renovatebot\/renovate\/pull\/7632\"> <u>\u043a\u043e\u043d\u0442\u0440\u0438\u0431\u044c\u044e\u0442\u0438\u043b\u0438 \u0432 RenovateBot<\/u><\/a>, \u0447\u0442\u043e\u0431\u044b \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0431\u044b\u043b\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p><strong>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043f\u0440\u0438 \u0438\u0445 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442.<\/strong> \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e: \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442 \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u0437\u0430\u0438\u043d\u0436\u0435\u043a\u0442\u0438\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0438\u043b\u0438 \u0432\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<p><strong>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f.<\/strong> \u0411\u044b\u0441\u0442\u0440\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043a\u0435\u043b\u0435\u0442\u043e\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432, etc. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432 \u043e\u0434\u043d\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043b\u0435\u0439\u0437\u0438 \u0440\u043e\u0443\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u043c\u0438. \u041c\u044b \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u043d\u043e\u0432\u044b\u0445 \u0444\u0438\u0447\u0435\u0439, \u043d\u043e \u0438 \u0434\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b. \u041a\u0430\u0436\u0434\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u0435\u0439\u0441\u043e\u0432, \u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u044d\u0442\u043e \u043d\u0430 \u043e\u0442\u043a\u0443\u043f \u0432\u0430\u0448\u0435\u0439 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0438 \u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c.<\/p>\n<p>\u041f\u043e \u0438\u0442\u043e\u0433\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u043e\u0432 \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041d\u043e\u2026<\/p>\n<h2>\u0415\u0441\u0442\u044c \u043f\u043e\u0434\u0432\u043e\u0445<\/h2>\n<p>\u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u044b \u043e\u0441\u043e\u0437\u043d\u0430\u043b\u0438, \u0447\u0442\u043e \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0447\u0435\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0438. \u0425\u043e\u0442\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0431\u044b\u043b\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 AST \u0434\u043b\u044f \u043c\u0443\u0442\u0430\u0446\u0438\u0439. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438 Angular \u0438 \u0432\u0435\u0440\u0441\u0442\u043a\u043e\u0439.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u043c\u0430\u043d\u0434\u0430 Angular \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 typescript API \u0432 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f\u0445. \u041d\u043e \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u0432\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u0430 typescript? \u041a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u0432\u044b \u043e\u043f\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0435 \u043d\u043e\u0434\u0430\u043c\u0438 \u0438\u0437 TS-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0443 \u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u043f\u0435\u0440\u0442\u0438 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u043b\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432?<\/p>\n<p>\u041d\u0438\u0436\u0435 \u2014 \u043f\u0440\u0438\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u044f (<a href=\"https:\/\/github.com\/angular\/components\/blob\/f4a54d64cc6bbb8557e72fc5f2ec7e9a88714ce2\/src\/cdk\/schematics\/utils\/vendored-ast-utils\/index.ts#L336\"><u>\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b<\/u><\/a>). <em>\u041e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e: \u043a\u043e\u0434 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043d\u0435 \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u0442\u044c\u0441\u044f \u0438 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0432 \u043d\u0435\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442!<\/em><\/p>\n<pre><code class=\"javascript\">export function addSymbolToNgModuleMetadata(   source: ts.SourceFile,   ngModulePath: string,   metadataField: string,   symbolName: string,   importPath: string | null = null, ): Change[] {   const nodes = getDecoratorMetadata(source, 'NgModule', '@angular\/core');   let node: any = nodes[0];  \/\/ tslint:disable-line:no-any    \/\/ Find the decorator declaration.   if (!node) {     return [];   }    \/\/ Get all the children property assignment of object literals.   const matchingProperties = getMetadataField(     node as ts.ObjectLiteralExpression,     metadataField,   );    \/\/ Get the last node of the array literal.   if (!matchingProperties) {     return [];   }   if (matchingProperties.length == 0) {     \/\/ We haven't found the field in the metadata declaration. Insert a new field.     const expr = node as ts.ObjectLiteralExpression;     let position: number;     let toInsert: string;     if (expr.properties.length == 0) {       position = expr.getEnd() - 1;       toInsert = `  ${metadataField}: [${symbolName}]\\\\\\\\n`;     } else {       node = expr.properties[expr.properties.length - 1];       position = node.getEnd();       \/\/ Get the indentation of the last element, if any.       const text = node.getFullText(source);       const matches = text.match(\/^\\\\\\\\r?\\\\\\\\n\\\\\\\\s*\/);       if (matches &amp;&amp; matches.length > 0) {         toInsert = `,${matches[0]}${metadataField}: [${symbolName}]`;       } else {         toInsert = `, ${metadataField}: [${symbolName}]`;       }     }     if (importPath !== null) {       return [         new InsertChange(ngModulePath, position, toInsert),         insertImport(source, ngModulePath, symbolName.replace(\/\\\\\\\\..*$\/, ''), importPath),       ];     } else {       return [new InsertChange(ngModulePath, position, toInsert)];     }   }   const assignment = matchingProperties[0] as ts.PropertyAssignment;    \/\/ If it's not an array, nothing we can do really.   if (assignment.initializer.kind !== ts.SyntaxKind.ArrayLiteralExpression) {     return [];   }    const arrLiteral = assignment.initializer as ts.ArrayLiteralExpression;   if (arrLiteral.elements.length == 0) {     \/\/ Forward the property.     node = arrLiteral;   } else {     node = arrLiteral.elements;   }    if (!node) {     \/\/ tslint:disable-next-line: no-console     console.error('No app module found. Please add your new class to your component.');      return [];   }    if (Array.isArray(node)) {     const nodeArray = node as {} as Array&lt;ts.Node>;     const symbolsArray = nodeArray.map(node => node.getText());     if (symbolsArray.includes(symbolName)) {       return [];     }      node = node[node.length - 1];   }    let toInsert: string;   let position = node.getEnd();   if (node.kind == ts.SyntaxKind.ObjectLiteralExpression) {     \/\/ We haven't found the field in the metadata declaration. Insert a new     \/\/ field.     const expr = node as ts.ObjectLiteralExpression;     if (expr.properties.length == 0) {       position = expr.getEnd() - 1;       toInsert = `  ${symbolName}\\\\\\\\n`;     } else {       \/\/ Get the indentation of the last element, if any.       const text = node.getFullText(source);       if (text.match(\/^\\\\\\\\r?\\\\\\\\r?\\\\\\\\n\/)) {         toInsert = `,${text.match(\/^\\\\\\\\r?\\\\\\\\n\\\\\\\\s*\/)[0]}${symbolName}`;       } else {         toInsert = `, ${symbolName}`;       }     }   } else if (node.kind == ts.SyntaxKind.ArrayLiteralExpression) {     \/\/ We found the field but it's empty. Insert it just before the `]`.     position--;     toInsert = `${symbolName}`;   } else {     \/\/ Get the indentation of the last element, if any.     const text = node.getFullText(source);     if (text.match(\/^\\\\\\\\r?\\\\\\\\n\/)) {       toInsert = `,${text.match(\/^\\\\\\\\r?\\\\\\\\n(\\\\\\\\r?)\\\\\\\\s*\/)[0]}${symbolName}`;     } else {       toInsert = `, ${symbolName}`;     }   }   if (importPath !== null) {     return [       new InsertChange(ngModulePath, position, toInsert),       insertImport(source, ngModulePath, symbolName.replace(\/\\\\\\\\..*$\/, ''), importPath),     ];   }    return [new InsertChange(ngModulePath, position, toInsert)]; }<\/code><\/pre>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435 \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u044f\u044e\u0449\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0435\u0440\u0445\u043d\u0435\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435.<\/p>\n<h2>ng-morph<\/h2>\n<p>\u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043b\u0435\u0436\u0438\u0442<a href=\"https:\/\/github.com\/dsherret\/ts-morph\"><u> ts-morph.<\/u><\/a> \u041f\u043e \u0441\u0443\u0442\u0438, ts-morph \u2014 \u044d\u0442\u043e \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c typescript, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 AST.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e <code>ng-morph<\/code>. \u042d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0443\u0442\u0438\u043b\u0438\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u0430\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435 \u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043b\u043e\u0432\u043d\u044b\u043c, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u0440\u0430\u0437\u0443 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0441 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c.<\/p>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430 \u2116 1. <\/strong>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442 \u043c\u043e\u0434\u0443\u043b\u044f <code>SomeModule<\/code> \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>\u0420\u0435\u0448\u0435\u043d\u0438\u0435.<\/strong><\/p>\n<pre><code class=\"javascript\">const rule: Rule = (tree: Tree, context: SchematicContext): void => {   setActiveProject(createProject(tree));    const appModule = getMainModule('src\/main.ts');    addImportToNgModule(appModule, 'SomeModule');    addImports(appModule.getFilePath(), {moduleSpecifier: '@some\/package', namedExports: ['SomeModule']})    saveActiveProject(); } <\/code><\/pre>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e:<\/p>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 <code>ng-morph<\/code> \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0441\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u0440\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041f\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0430\u0435\u0442 API \u043a \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u0438 \u0442. \u0434.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e \u0442\u043e\u0447\u043a\u0435 \u0432\u0445\u043e\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u043d\u043e\u0432\u044b\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442 \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0444\u0430\u0439\u043b, \u0433\u0434\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435 \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0432\u044b\u0448\u0435 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 Angular. \u0415\u0441\u043b\u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>ng-morph<\/code>, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435.<\/p>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430 \u2116 2. <\/strong>\u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0438\u043b\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438\u043c\u0435\u043d\u0438 \u0434\u043b\u044f enum \u043d\u0430 uppercase.<\/p>\n<p><strong>\u0420\u0435\u0448\u0435\u043d\u0438\u0435. <\/strong>\u041b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b: \u043f\u0440\u0438 \u0447\u0435\u043c \u0437\u0434\u0435\u0441\u044c <code>ng-morph<\/code>? \u0412\u0435\u0434\u044c \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438, \u043d\u0435\u0443\u0436\u0435\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u044d\u043d\u0430\u043c\u044b?<\/p>\n<p>\u0412\u0441\u0435 \u0432\u0435\u0440\u043d\u043e. \u0421\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u043d\u0430\u043c\u043e\u0432. \u041d\u043e \u0432\u0441\u0435 \u0436\u0435 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c <code>ng-morph<\/code>:<\/p>\n<pre><code class=\"javascript\">setActiveProject(createProject(new NgMorphTree('\/')));  const enums = getEnums('\/**\/*.ts');  editEnums(enums, ({name}) => ({name: name.toUpperCase()}))<\/code><\/pre>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442. \u0422\u0443\u0442 \u0435\u0441\u0442\u044c \u0432\u0430\u0436\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435: \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u043d\u0443\u0442 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 tree \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430 NgMorphHost.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0449\u0435\u043c \u0432\u0441\u0435 enum \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 enum.<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e <code>ng-morph<\/code> \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0432\u043d\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u043e\u0432! \u0414\u0430, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>ng-morph<\/code> \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0430\u0445 \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 Angular-\u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.\u00a0<\/p>\n<h2>\u0427\u0442\u043e \u0435\u0449\u0435 \u0443\u043c\u0435\u0435\u0442 ng-moprh?<\/h2>\n<p><strong>\u0421\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c<\/strong><\/p>\n<pre><code class=\"javascript\">createImports('\/src\/some.ts', [   {     namedImports: ['CoreModule'],     moduleSpecifier: '@org\/core',     isTypeOnly: true,   } ]); <\/code><\/pre>\n<p><strong>\u0418\u0441\u043a\u0430\u0442\u044c<\/strong><\/p>\n<pre><code class=\"javascript\">const imports = getImports('src\/**\/*.ts', {   moduleSpecifier: '@org\/*', });<\/code><\/pre>\n<p><strong>\u0418\u0437\u043c\u0435\u043d\u044f\u0442\u044c<\/strong><\/p>\n<pre><code class=\"javascript\">editImports(imports, ({moduleSpecifier}) => ({   moduleSpecifier: moduleSpecifier.replace('@org', '@new-org') })<\/code><\/pre>\n<p><strong>\u0423\u0434\u0430\u043b\u044f\u0442\u044c<\/strong><\/p>\n<pre><code class=\"javascript\">removeImports(imports)<\/code><\/pre>\n<p>\u041f\u043e\u0447\u0442\u0438 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0432 TS \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0439: <code>get*<\/code>, <code>edit*<\/code>, <code>add*<\/code>, <code>remove*<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>getClass<\/code>, <code>removeConstrucor<\/code>, <code>addDecorator<\/code>. \u041d\u0430\u0447\u0430\u043b\u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u0440\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u043c\u0438 \u0434\u043b\u044f Angular \u043a\u0435\u0439\u0441\u0430\u043c\u0438:<\/p>\n<ol>\n<li>\n<p><code>getBootstrapFn<\/code> \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0430\u044f <code>CallExpression<\/code>.<\/p>\n<\/li>\n<li>\n<p><code>getMainModule<\/code> \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044e \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<\/li>\n<li>\n<p>\u041a\u0443\u0447\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u0440\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 Angular: <code>addDeclarationToNgModule<\/code>, <code>addProviderToDirective<\/code> \u0438 \u0442. \u0434.<\/p>\n<\/li>\n<\/ol>\n<p><code>ng-morph<\/code> \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <code>json<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0432 <code>package.json<\/code>:<\/p>\n<pre><code class=\"javascript\">addPackageJsonDependency(tree, {   name: '@package\/name',   version: '~2.0.0',   type: NodeDependencyType.Dev });<\/code><\/pre>\n<p>\u041d\u043e \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u044b, \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 ts-morph API, \u0430 \u0438\u0437 \u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0442\u044c\u0441\u044f \u0435\u0449\u0435 \u043d\u0438\u0436\u0435 \u2014 \u0432 API \u0441\u0430\u043c\u043e\u0433\u043e typescript.<\/p>\n<h3>\u0412\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/h3>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 roadmap \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u041c\u044b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u043e, \u0447\u0435\u0433\u043e \u043d\u0430\u043c \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e, \u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0443. \u0418, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0438\u0447 \u043f\u0435\u0440\u0432\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u0441\u0435 \u0436\u0435 \u0435\u0441\u0442\u044c:<\/p>\n<ol>\n<li>\n<p>\u0412\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0441\u0442\u0438\u043b\u044f\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0440\u0430\u0449\u0438\u0432\u0430\u043d\u0438\u0435 \u0442\u0443\u043b\u0438\u043d\u0433\u0430 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438 Angular.<\/p>\n<\/li>\n<\/ol>\n<p>\u0418 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0434\u044b, \u0435\u0441\u043b\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e Angular \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c!<\/p>\n<h3>\u0421\u0441\u044b\u043b\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0442\u0430\u043a \u0436\u0434\u0430\u043b\u0438<\/h3>\n<p>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u043a\u043e\u0434\u043e\u043c:<\/p>\n<div class=\"embed_link\">\n<div class=\"embed__thumb\" style=\"background-image: url(&quot;https:\/\/opengraph.githubassets.com\/04bc1c3bda29147f12447825788abe12e74113532dfa4d3782d894191aade9ae\/TinkoffCreditSystems\/ng-morph&quot;);\"><\/div>\n<div class=\"embed__caption\">\n<div class=\"embed__caption-title\"><span>GitHub &#8212; TinkoffCreditSystems\/ng-morph: Code mutations in schematics were never easier than now.<\/span><\/div>\n<p><a href=\"https:\/\/github.com\/TinkoffCreditSystems\/ng-morph\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"embed__caption-link\">github.com<\/a><\/div>\n<\/div>\n<p>\u0421\u0430\u0439\u0442 \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438:<\/p>\n<div class=\"embed_link\">\n<div class=\"embed__thumb\" style=\"background-image: url(&quot;undefined&quot;);\"><\/div>\n<div class=\"embed__caption\">\n<div class=\"embed__caption-title\"><span>ng-morph<\/span><\/div>\n<p><a href=\"https:\/\/tinkoffcreditsystems.github.io\/ng-morph\/\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"embed__caption-link\">tinkoffcreditsystems.github.io<\/a><\/div>\n<\/div>\n<h3>\u0423\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 ng-morph<\/h3>\n<p>\u0418\u0437 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043c\u043d\u0435 \u2014 \u043d\u0430\u0448\u0430 \u0434\u0440\u0443\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0438 \u043b\u0443\u0447\u0448\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f Angular:<\/p>\n<div class=\"embed_link\">\n<div class=\"embed__thumb\" style=\"background-image: url(&quot;https:\/\/repository-images.githubusercontent.com\/298620687\/b5fd7180-46db-11eb-9c69-822a8e279ce8&quot;);\"><\/div>\n<div class=\"embed__caption\">\n<div class=\"embed__caption-title\"><span>GitHub &#8212; TinkoffCreditSystems\/taiga-ui: Angular UI Kit and components library for awesome people<\/span><\/div>\n<p><a href=\"https:\/\/github.com\/TinkoffCreditSystems\/taiga-ui\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" class=\"embed__caption-link\">github.com<\/a><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/582120\/\"> https:\/\/habr.com\/ru\/articles\/582120\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Angular CLI \u043d\u0430 \u043f\u043e\u043b\u043d\u0443\u044e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u043c\u0430\u043d\u0434\u044b ng add, ng update \u0438 ng generate \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u043c\u0443\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u0430\u043a, \u043a\u0430\u043a \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e. \u00ab\u041d\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u0443\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434, \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 AST, \u0430 \u044d\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u00bb, \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u043a\u0430\u0436\u0435\u0442\u0435 \u0432\u044b, \u0438 \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u0440\u0430\u0432\u044b!<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043c\u044b \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 AST \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u043e\u0432 \u043e\u0431\u044b\u0434\u0435\u043d\u043d\u044b\u043c. \u0410 \u0435\u0449\u0435 \u043f\u043e\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 AST \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 Angular-\u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432 \u043b\u044e\u0431\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0430 JavaScript\/TypeScript. <\/p>\n<hr\/>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a<\/h2>\n<p>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a \u2014 \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u0432\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0432\u0445\u043e\u0434: \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 \u0434\u043b\u044f \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u043e\u043f\u0446\u0438\u0438 \u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043d\u0435\u0441\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u0440\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u0438\u043f <code>Rule<\/code>. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0435\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435:<\/p>\n<pre><code class=\"javascript\">type Rule = (tree: Tree, context: SchematicContext) => Tree | Observable&lt;Tree> | Rule | Promise&lt;void | Rule> | void;<\/code><\/pre>\n<p>\u0418\u0437 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e <code>Rule<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u0430\u043a \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c, \u0442\u0430\u043a \u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c. \u0418, \u043a\u0430\u043a \u0431\u043e\u043d\u0443\u0441, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0435\u0440\u043d\u0443\u0442\u044c <code>Observable<\/code>. \u0418\u0437 \u0442\u0438\u043f\u0430 <code>Rule<\/code> \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u2014 <code>Tree<\/code>. <code>Tree<\/code> \u2014 \u044d\u0442\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443.<\/p>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <code>ng<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438, \u0438\u043c\u0435\u0435\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043d\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0432\u0441\u0435 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043a \u0432\u044b\u0437\u043e\u0432\u0443 \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<h2>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a<\/h2>\n<p>\u041c\u044b \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u043f\u043e \u0446\u0435\u043b\u043e\u043c\u0443 \u0440\u044f\u0434\u0443 \u043f\u0440\u0438\u0447\u0438\u043d.<\/p>\n<p><strong>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439 \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a<\/strong>. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043c\u0430\u0436\u043e\u0440\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0421\u0430\u043c Angular \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0435\u0437\u0434\u0430 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438. \u041c\u044b \u0434\u0430\u0436\u0435<a href=\"https:\/\/github.com\/renovatebot\/renovate\/pull\/7632\"> <u>\u043a\u043e\u043d\u0442\u0440\u0438\u0431\u044c\u044e\u0442\u0438\u043b\u0438 \u0432 RenovateBot<\/u><\/a>, \u0447\u0442\u043e\u0431\u044b \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0431\u044b\u043b\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p><strong>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043f\u0440\u0438 \u0438\u0445 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442.<\/strong> \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e: \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442 \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u0437\u0430\u0438\u043d\u0436\u0435\u043a\u0442\u0438\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0438\u043b\u0438 \u0432\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<p><strong>\u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f.<\/strong> \u0411\u044b\u0441\u0442\u0440\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043a\u0435\u043b\u0435\u0442\u043e\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432, etc. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432 \u043e\u0434\u043d\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043b\u0435\u0439\u0437\u0438 \u0440\u043e\u0443\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u043c\u0438. \u041c\u044b \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u043d\u043e\u0432\u044b\u0445 \u0444\u0438\u0447\u0435\u0439, \u043d\u043e \u0438 \u0434\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b. \u041a\u0430\u0436\u0434\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u0435\u0439\u0441\u043e\u0432, \u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u044d\u0442\u043e \u043d\u0430 \u043e\u0442\u043a\u0443\u043f \u0432\u0430\u0448\u0435\u0439 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0438 \u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c.<\/p>\n<p>\u041f\u043e \u0438\u0442\u043e\u0433\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u043e\u0432 \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041d\u043e\u2026<\/p>\n<h2>\u0415\u0441\u0442\u044c \u043f\u043e\u0434\u0432\u043e\u0445<\/h2>\n<p>\u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u044b \u043e\u0441\u043e\u0437\u043d\u0430\u043b\u0438, \u0447\u0442\u043e \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0447\u0435\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0438. \u0425\u043e\u0442\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0431\u044b\u043b\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 AST \u0434\u043b\u044f \u043c\u0443\u0442\u0430\u0446\u0438\u0439. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438 Angular \u0438 \u0432\u0435\u0440\u0441\u0442\u043a\u043e\u0439.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u043c\u0430\u043d\u0434\u0430 Angular \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 typescript API \u0432 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f\u0445. \u041d\u043e \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u0432\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u0430 typescript? \u041a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u0432\u044b \u043e\u043f\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0435 \u043d\u043e\u0434\u0430\u043c\u0438 \u0438\u0437 TS-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0443 \u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u043f\u0435\u0440\u0442\u0438 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u043b\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432?<\/p>\n<p>\u041d\u0438\u0436\u0435 \u2014 \u043f\u0440\u0438\u043c\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u044f (<a href=\"https:\/\/github.com\/angular\/components\/blob\/f4a54d64cc6bbb8557e72fc5f2ec7e9a88714ce2\/src\/cdk\/schematics\/utils\/vendored-ast-utils\/index.ts#L336\"><u>\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b<\/u><\/a>). <em>\u041e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e: \u043a\u043e\u0434 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043d\u0435 \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u0442\u044c\u0441\u044f \u0438 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0432 \u043d\u0435\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442!<\/em><\/p>\n<pre><code class=\"javascript\">export function addSymbolToNgModuleMetadata(   source: ts.SourceFile,   ngModulePath: string,   metadataField: string,   symbolName: string,   importPath: string | null = null, ): Change[] {   const nodes = getDecoratorMetadata(source, 'NgModule', '@angular\/core');   let node: any = nodes[0];  \/\/ tslint:disable-line:no-any    \/\/ Find the decorator declaration.   if (!node) {     return [];   }    \/\/ Get all the children property assignment of object literals.   const matchingProperties = getMetadataField(     node as ts.ObjectLiteralExpression,     metadataField,   );    \/\/ Get the last node of the array literal.   if (!matchingProperties) {     return [];   }   if (matchingProperties.length == 0) {     \/\/ We haven't found the field in the metadata declaration. Insert a new field.     const expr = node as ts.ObjectLiteralExpression;     let position: number;     let toInsert: string;     if (expr.properties.length == 0) {       position = expr.getEnd() - 1;       toInsert = `  ${metadataField}: [${symbolName}]\\\\\\\\n`;     } else {       node = expr.properties[expr.properties.length - 1];       position = node.getEnd();       \/\/ Get the indentation of the last element, if any.       const text = node.getFullText(source);       const matches = text.match(\/^\\\\\\\\r?\\\\\\\\n\\\\\\\\s*\/);       if (matches &amp;&amp; matches.length > 0) {         toInsert = `,${matches[0]}${metadataField}: [${symbolName}]`;       } else {         toInsert = `, ${metadataField}: [${symbolName}]`;       }     }     if (importPath !== null) {       return [         new InsertChange(ngModulePath, position, toInsert),         insertImport(source, ngModulePath, symbolName.replace(\/\\\\\\\\..*$\/, ''), importPath),       ];     } else {       return [new InsertChange(ngModulePath, position, toInsert)];     }   }   const assignment = matchingProperties[0] as ts.PropertyAssignment;    \/\/ If it's not an array, nothing we can do really.   if (assignment.initializer.kind !== ts.SyntaxKind.ArrayLiteralExpression) {     return [];   }    const arrLiteral = assignment.initializer as ts.ArrayLiteralExpression;   if (arrLiteral.elements.length == 0) {     \/\/ Forward the property.     node = arrLiteral;   } else {     node = arrLiteral.elements;   }    if (!node) {     \/\/ tslint:disable-next-line: no-console     console.error('No app module found. Please add your new class to your component.');      return [];   }    if (Array.isArray(node)) {     const nodeArray = node as {} as Array&lt;ts.Node>;     const symbolsArray = nodeArray.map(node => node.getText());     if (symbolsArray.includes(symbolName)) {       return [];     }      node = node[node.length - 1];   }    let toInsert: string;   let position = node.getEnd();   if (node.kind == ts.SyntaxKind.ObjectLiteralExpression) {     \/\/ We haven't found the field in the metadata declaration. Insert a new     \/\/ field.     const expr = node as ts.ObjectLiteralExpression;     if (expr.properties.length == 0) {       position = expr.getEnd() - 1;       toInsert = `  ${symbolName}\\\\\\\\n`;     } else {       \/\/ Get the indentation of the last element, if any.       const text = node.getFullText(source);       if (text.match(\/^\\\\\\\\r?\\\\\\\\r?\\\\\\\\n\/)) {         toInsert = `,${text.match(\/^\\\\\\\\r?\\\\\\\\n\\\\\\\\s*\/)[0]}${symbolName}`;       } else {         toInsert = `, ${symbolName}`;       }     }   } else if (node.kind == ts.SyntaxKind.ArrayLiteralExpression) {     \/\/ We found the field but it's empty. Insert it just before the `]`.     position--;     toInsert = `${symbolName}`;   } else {     \/\/ Get the indentation of the last element, if any.     const text = node.getFullText(source);     if (text.match(\/^\\\\\\\\r?\\\\\\\\n\/)) {       toInsert = `,${text.match(\/^\\\\\\\\r?\\\\\\\\n(\\\\\\\\r?)\\\\\\\\s*\/)[0]}${symbolName}`;     } else {       toInsert = `, ${symbolName}`;     }   }   if (importPath !== null) {     return [       new InsertChange(ngModulePath, position, toInsert),       insertImport(source, ngModulePath, symbolName.replace(\/\\\\\\\\..*$\/, ''), importPath),     ];   }    return [new InsertChange(ngModulePath, position, toInsert)]; }<\/code><\/pre>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435 \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u044f\u044e\u0449\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0435\u0440\u0445\u043d\u0435\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435.<\/p>\n<h2>ng-morph<\/h2>\n<p>\u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043b\u0435\u0436\u0438\u0442<a href=\"https:\/\/github.com\/dsherret\/ts-morph\"><u> ts-morph.<\/u><\/a> \u041f\u043e \u0441\u0443\u0442\u0438, ts-morph \u2014 \u044d\u0442\u043e \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c typescript, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 AST.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e <code>ng-morph<\/code>. \u042d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0443\u0442\u0438\u043b\u0438\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u0430\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435 \u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043b\u043e\u0432\u043d\u044b\u043c, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u0440\u0430\u0437\u0443 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0441 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c.<\/p>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430 \u2116 1. <\/strong>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043c\u043f\u043e\u0440\u0442 \u043c\u043e\u0434\u0443\u043b\u044f <code>SomeModule<\/code> \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>\u0420\u0435\u0448\u0435\u043d\u0438\u0435.<\/strong><\/p>\n<pre><code class=\"javascript\">const rule: Rule = (tree: Tree, context: SchematicContext): void => {   setActiveProject(createProject(tree));    const appModule = getMainModule('src\/main.ts');    addImportToNgModule(appModule, 'SomeModule');    addImports(appModule.getFilePath(), {moduleSpecifier: '@some\/package', namedExports: ['SomeModule']})    saveActiveProject(); } <\/code><\/pre>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e:<\/p>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 <code>ng-morph<\/code> \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0441\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u0440\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041f\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0430\u0435\u0442 API \u043a \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u0438 \u0442. \u0434.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e \u0442\u043e\u0447\u043a\u0435 \u0432\u0445\u043e\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u043d\u043e\u0432\u044b\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442 \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0444\u0430\u0439\u043b, \u0433\u0434\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435 \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0432\u044b\u0448\u0435 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 Angular. \u0415\u0441\u043b\u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>ng-morph<\/code>, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435.<\/p>\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430 \u2116 2. <\/strong>\u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0438\u043b\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438\u043c\u0435\u043d\u0438 \u0434\u043b\u044f enum \u043d\u0430 uppercase.<\/p>\n<p><strong>\u0420\u0435\u0448\u0435\u043d\u0438\u0435. <\/strong>\u041b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b: \u043f\u0440\u0438 \u0447\u0435\u043c \u0437\u0434\u0435\u0441\u044c <code>ng-morph<\/code>? \u0412\u0435\u0434\u044c \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u0440\u043e \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438, \u043d\u0435\u0443\u0436\u0435\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u044d\u043d\u0430\u043c\u044b?<\/p>\n<p>\u0412\u0441\u0435 \u0432\u0435\u0440\u043d\u043e. \u0421\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u043d\u0430\u043c\u043e\u0432. \u041d\u043e \u0432\u0441\u0435 \u0436\u0435 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c <code>ng-morph<\/code>:<\/p>\n<pre><code class=\"javascript\">setActiveProject(createProject(new NgMorphTree('\/')));  const enums = getEnums('\/**\/*.ts');  editEnums(enums, ({name}) => ({name: name.toUpperCase()}))<\/code><\/pre>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442. \u0422\u0443\u0442 \u0435\u0441\u0442\u044c \u0432\u0430\u0436\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435: \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u043d\u0443\u0442 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 tree \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430 NgMorphHost.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0449\u0435\u043c \u0432\u0441\u0435 enum \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 enum.<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e <code>ng-morph<\/code> \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0432\u043d\u0435 <\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-409769","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/409769","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=409769"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/409769\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=409769"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=409769"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=409769"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}