├── .editorconfig ├── .gitignore ├── README.md ├── _config.yml ├── angular.json ├── docs ├── README.md ├── clean-angular.article.md ├── clean-angular.md ├── dev │ └── 01-themes.md ├── how-to-create-a-doc-file.md └── images │ ├── Presentation-Domain-Data-Layering.png │ ├── all_top.png │ ├── android-data-flow.png │ ├── android-mvp-clean.png │ ├── angular-clean-usecase.png │ ├── clean-architecture.jpg │ ├── clean-data-flow.png │ ├── clean-frontend-architecture.jpg │ ├── clean-frontend-components.jpg │ ├── clean-mvp-component-based.jpg │ ├── clean_architecture_layers.png │ ├── clean_architecture_layers_details.png │ ├── event-data-flow.gif │ ├── js-mvp.png │ └── usecase-flow.png ├── e2e ├── protractor.conf.js ├── src │ ├── app.e2e-spec.ts │ └── app.po.ts └── tsconfig.e2e.json ├── package-lock.json ├── package.json ├── schematics ├── .gitignore ├── README.md ├── package.json ├── src │ ├── collection.json │ └── domain │ │ ├── files │ │ └── __path__ │ │ │ └── __name@dasherize@if-flat__ │ │ │ ├── model │ │ │ ├── __name@dasherize__.entity.ts │ │ │ └── __name@dasherize__.model.ts │ │ │ ├── repository │ │ │ ├── __name@dasherize__.repository.ts │ │ │ └── mapper │ │ │ │ └── __name@dasherize__-repository.mapper.ts │ │ │ └── usecases │ │ │ └── __name@dasherize__.usecase.ts │ │ ├── index.ts │ │ ├── index_spec.ts │ │ ├── schema.json │ │ └── schema.ts ├── tsconfig.json └── yarn.lock ├── src ├── app │ ├── app-routing.module.ts │ ├── app.component.html │ ├── app.component.scss │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── core │ │ ├── base │ │ │ ├── mapper.ts │ │ │ └── use-case.ts │ │ ├── core.module.ts │ │ └── services │ │ │ └── auth.service.ts │ ├── domain │ │ └── elephant │ │ │ ├── model │ │ │ ├── elephant.entity.ts │ │ │ └── elephant.model.ts │ │ │ ├── repository │ │ │ ├── elephant-web.repository.ts │ │ │ └── mapper │ │ │ │ └── elephant-web-repository.mapper.ts │ │ │ └── usecases │ │ │ ├── get-all-elephants.usecase.ts │ │ │ └── get-elephant-by-id-usecase.usecase.ts │ ├── features │ │ └── .gitkeep │ ├── pages │ │ └── .gitkeep │ ├── presentation │ │ └── home │ │ │ ├── home.component.html │ │ │ ├── home.component.scss │ │ │ ├── home.component.spec.ts │ │ │ ├── home.component.ts │ │ │ └── home.module.ts │ └── shared │ │ ├── components │ │ └── .gitkeep │ │ ├── directives │ │ └── .gitkeep │ │ ├── interceptors │ │ └── .gitkeep │ │ ├── pipes │ │ └── .gitkeep │ │ └── shared.module.ts ├── assets │ └── .gitkeep ├── browserslist ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── karma.conf.js ├── main.ts ├── polyfills.ts ├── styles.scss ├── test.ts ├── tsconfig.app.json ├── tsconfig.spec.json └── tslint.json ├── tsconfig.json ├── tslint.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | # Only exists if Bazel was run 8 | /bazel-out 9 | 10 | # dependencies 11 | /node_modules 12 | 13 | # profiling files 14 | chrome-profiler-events.json 15 | speed-measure-plugin.json 16 | 17 | # IDEs and editors 18 | /.idea 19 | .project 20 | .classpath 21 | .c9/ 22 | *.launch 23 | .settings/ 24 | *.sublime-workspace 25 | 26 | # IDE - VSCode 27 | .vscode/* 28 | !.vscode/settings.json 29 | !.vscode/tasks.json 30 | !.vscode/launch.json 31 | !.vscode/extensions.json 32 | .history/* 33 | 34 | # misc 35 | /.sass-cache 36 | /connect.lock 37 | /coverage 38 | /libpeerconnection.log 39 | npm-debug.log 40 | yarn-error.log 41 | testem.log 42 | /typings 43 | 44 | # System Files 45 | .DS_Store 46 | Thumbs.db 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Clean Frontend Architecture:整洁前端架构 2 | 3 | **ToC** 4 | 5 | * [Clean Frontend Architecture:整洁前端架构](https://phodal.github.io/clean-frontend/#clean-frontend-architecture%EF%BC%9A%E6%95%B4%E6%B4%81%E5%89%8D%E7%AB%AF%E6%9E%B6%E6%9E%84) 6 | * * [(Clean Architecture + MVP) with BFF](https://phodal.github.io/clean-frontend/#clean-architecture--mvp-with-bff) 7 | * [(Clean Architecture + Component-based + MVP) without BFF](https://phodal.github.io/clean-frontend/#clean-architecture--component-based--mvp-without-bff) 8 | * [前端的恶梦](https://phodal.github.io/clean-frontend/#%E5%89%8D%E7%AB%AF%E7%9A%84%E6%81%B6%E6%A2%A6) 9 | * [AVR is evil](https://phodal.github.io/clean-frontend/#avr-is-evil) 10 | * [组件化及 Presenter 过重](https://phodal.github.io/clean-frontend/#%E7%BB%84%E4%BB%B6%E5%8C%96%E5%8F%8A-presenter-%E8%BF%87%E9%87%8D) 11 | * [整洁的前端架构](https://phodal.github.io/clean-frontend/#%E6%95%B4%E6%B4%81%E7%9A%84%E5%89%8D%E7%AB%AF%E6%9E%B6%E6%9E%84) 12 | * [整洁架构](https://phodal.github.io/clean-frontend/#%E6%95%B4%E6%B4%81%E6%9E%B6%E6%9E%84) 13 | * [Clean Architecture 数据流](https://phodal.github.io/clean-frontend/#clean-architecture-%E6%95%B0%E6%8D%AE%E6%B5%81) 14 | * [优缺点](https://phodal.github.io/clean-frontend/#%E4%BC%98%E7%BC%BA%E7%82%B9) 15 | * [前端 Clean 架构](https://phodal.github.io/clean-frontend/#%E5%89%8D%E7%AB%AF-clean-%E6%9E%B6%E6%9E%84) 16 | * [客户端 Clean 架构 + MVP](https://phodal.github.io/clean-frontend/#%E5%AE%A2%E6%88%B7%E7%AB%AF-clean-%E6%9E%B6%E6%9E%84--mvp) 17 | * [Clean Architecture + MVP + 组件化](https://phodal.github.io/clean-frontend/#clean-architecture--mvp--%E7%BB%84%E4%BB%B6%E5%8C%96) 18 | * [实践](https://phodal.github.io/clean-frontend/#%E5%AE%9E%E8%B7%B5) 19 | * [单体式分层架构](https://phodal.github.io/clean-frontend/#%E5%8D%95%E4%BD%93%E5%BC%8F%E5%88%86%E5%B1%82%E6%9E%B6%E6%9E%84) 20 | * [微服务式分层架构](https://phodal.github.io/clean-frontend/#%E5%BE%AE%E6%9C%8D%E5%8A%A1%E5%BC%8F%E5%88%86%E5%B1%82%E6%9E%B6%E6%9E%84) 21 | * [其它](https://phodal.github.io/clean-frontend/#%E5%85%B6%E5%AE%83) 22 | * [相关](https://phodal.github.io/clean-frontend/#%E7%9B%B8%E5%85%B3) 23 | * [Clean Architecture 实施指南](https://phodal.github.io/clean-frontend/#clean-architecture-%E5%AE%9E%E6%96%BD%E6%8C%87%E5%8D%97) 24 | * [Clean Architecture + MVP + 组件化架构](https://phodal.github.io/clean-frontend/#clean-architecture--mvp--%E7%BB%84%E4%BB%B6%E5%8C%96%E6%9E%B6%E6%9E%84) 25 | * [有利于实施的上下文](https://phodal.github.io/clean-frontend/#%E6%9C%89%E5%88%A9%E4%BA%8E%E5%AE%9E%E6%96%BD%E7%9A%84%E4%B8%8A%E4%B8%8B%E6%96%87) 26 | * [实施 DDD 的微服务后台架构](https://phodal.github.io/clean-frontend/#%E5%AE%9E%E6%96%BD-ddd-%E7%9A%84%E5%BE%AE%E6%9C%8D%E5%8A%A1%E5%90%8E%E5%8F%B0%E6%9E%B6%E6%9E%84) 27 | * [全功能团队](https://phodal.github.io/clean-frontend/#%E5%85%A8%E5%8A%9F%E8%83%BD%E5%9B%A2%E9%98%9F) 28 | * [目录即分层](https://phodal.github.io/clean-frontend/#%E7%9B%AE%E5%BD%95%E5%8D%B3%E5%88%86%E5%B1%82) 29 | * [MVP 分层(目录划分)](https://phodal.github.io/clean-frontend/#mvp-%E5%88%86%E5%B1%82%EF%BC%88%E7%9B%AE%E5%BD%95%E5%88%92%E5%88%86%EF%BC%89) 30 | * [domain + data 层:垂直 + 水平 分层](https://phodal.github.io/clean-frontend/#domain---data-%E5%B1%82%EF%BC%9A%E5%9E%82%E7%9B%B4---%E6%B0%B4%E5%B9%B3-%E5%88%86%E5%B1%82) 31 | * [映射领域服务](https://phodal.github.io/clean-frontend/#%E6%98%A0%E5%B0%84%E9%A2%86%E5%9F%9F%E6%9C%8D%E5%8A%A1) 32 | * [repository 命名:URL 命名](https://phodal.github.io/clean-frontend/#repository-%E5%91%BD%E5%90%8D%EF%BC%9Aurl-%E5%91%BD%E5%90%8D) 33 | * [usecase 命名](https://phodal.github.io/clean-frontend/#usecase-%E5%91%BD%E5%90%8D) 34 | * [Clean Architecture 的 MVP 层实践](https://phodal.github.io/clean-frontend/#clean-architecture-%E7%9A%84-mvp-%E5%B1%82%E5%AE%9E%E8%B7%B5) 35 | * [Clean Architecture 的 Domain + Data 层实践](https://phodal.github.io/clean-frontend/#clean-architecture-%E7%9A%84-domain--data-%E5%B1%82%E5%AE%9E%E8%B7%B5) 36 | * [DDD ApplicationService vs 多个 Usecases](https://phodal.github.io/clean-frontend/#ddd-applicationservice-vs-%E5%A4%9A%E4%B8%AA-usecases) 37 | * [usecases + repository vs services](https://phodal.github.io/clean-frontend/#usecases--repository-vs-services) 38 | * [Usecases 作为逻辑层/防腐层](https://phodal.github.io/clean-frontend/#usecases-%E4%BD%9C%E4%B8%BA%E9%80%BB%E8%BE%91%E5%B1%82%E9%98%B2%E8%85%90%E5%B1%82) 39 | * [模型管理](https://phodal.github.io/clean-frontend/#%E6%A8%A1%E5%9E%8B%E7%AE%A1%E7%90%86) 40 | * [相关问题](https://phodal.github.io/clean-frontend/#%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98) 41 | * [框架依赖的表单验证](https://phodal.github.io/clean-frontend/#%E6%A1%86%E6%9E%B6%E4%BE%9D%E8%B5%96%E7%9A%84%E8%A1%A8%E5%8D%95%E9%AA%8C%E8%AF%81) 42 | * [下一步](https://phodal.github.io/clean-frontend/#%E4%B8%8B%E4%B8%80%E6%AD%A5) 43 | 44 | ### (Clean Architecture + MVP) with BFF 45 | 46 | ![Clean MVP 组件化](docs/images/clean-frontend-components.jpg) 47 | 48 | ### (Clean Architecture + Component-based + MVP) without BFF 49 | 50 | ![Clean MVP Component-based](docs/images/clean-mvp-component-based.jpg) 51 | 52 | ## 前端的恶梦 53 | 54 | 在我最近的一个项目里,我使用了 Angular 和混合应用技术编写了一个实时聊天应用。为了方便这个应用直接修改,无缝地嵌入到其它应用程序中。我尽量减少了 Component 和 Service 的数量——然而,由于交互复杂 Component 的数量也不能减少。随后,当我们完成了这个项目的时候,主的组件的代码差不多有 1000 行。这差不多是一个复杂的应用的代码数。在我试图多次去重构代码时,我发现这并不是一件容易的事:太多的交互。导致了 UI 层的代码,很难被抽取出去。只是呢,我还能做的事情是将一些业务逻辑抽取出来,只是怎么去抽取了——这成了我的一个疑惑。 55 | 56 | MVP 嘛,逻辑不都是放到 Presenter 里,还有其它的招吗? 57 | 58 | ### AVR is evil 59 | 60 | Angular、Vue 和 React 都是一些不错的框架,但是它们都是恶魔——因为我们绑定了框架。尽管我们可以很快地从一个 React 的框架,迁移应用到其它类 React 框架,诸如 Preact;我们可以从一个类似于 Vue 的框架,迁移应用到其它类 Vue 的应用。但是我们很难从 React 迁移到 Angular,又或者是 Vue 迁移到 Angular。万一有一天,某个框架的核心维护人员,健康状况不好,那么我们可能就得重写整个应用。这对于一个技术人员/Tech Lead/项目经验/业务人员来说,这种情况是不可接受的。 61 | 62 | 所以,为了应对这些框架带来的问题,我们选择 Web Components 技术,又或者是微前端技术,从架构上切开我们的业务。但是它们并不是银弹,它们反而是一个累赘,限定了高版本的浏览器,制定了更多的规范。与此同时,不论是微前端技术还是 Web Components,它们都没有解决一个问题:**框架绑定应用**。 63 | 64 | 框架绑定应用,就是一种灾害。没有人希望哪一天因为 Java 需要高额的付费,而导致我们选择重写整个应用。 65 | 66 | ### 组件化及 Presenter 过重 67 | 68 | 应对页面逻辑过于重的问题,我们选择了组件化。将一个页面,拆分成一系列的业务组件,再进一步地对这些业务组件进行地次细分,形成更小的业务组件,最后它们都依赖于组件库。 69 | 70 | 可是呢,细化存在一个问题是:**更难以摆脱的框架绑定**。与此同时,我们大量的业务逻辑仍然放置在 Presenter 里。我们的 Presenter 充满了大量的业务逻辑和非业务逻辑: 71 | 72 | - 页面展示相应的逻辑。诸如点击事件、提交表单等等。 73 | - 状态管理。诸如是否展示,用户登录状态等等。 74 | - 业务逻辑。诸如某个字符串,要用怎样的形式展示。 75 | - 数据持续化。哪些数据需要存储在 LocalStorage,哪些数据存储在 IndexedDB 里? 76 | 77 | 为了应对 Presenter 过重的问题,我们使用了 Service 来处理某一块具体的业务,我们使用了 Utils、Helper 来处理一些公共的逻辑。哪怕是如此,我们使用 A 框架编写的业务逻辑,到了 B 框架中无法复用。 78 | 79 | 直到我最近重新接触了 Clean Architecture,我发现 Presenter 还是可以进一步拆分的。 80 | 81 | ## 整洁的前端架构 82 | 83 | Clean Architecture 是由 Robert C. Martin 在 2012 年提出的(PS:时间真早)。最早,我只看到在 Android 应用上的使用,一来 Android 开发使用的是 Java,二来 Android 应用有很重的 View 层。与此同时,在 7 年的时间里,由于前后端的分离,UI 层已经从后端的部分消失了——当然了,你也可以说 JSON 也是一种 View(至少它是可见的)。尽管,还存在一定数量的后端渲染 Web 应用,但是新的应用几乎不采用这样的模式。 84 | 85 | 但是,在 9012 年的今天,前端应用走向了 MV* 的架构方案,也有了一层很重的 View 层——类似于过去的后端应用,或者后端应用。相似的架构,也可以在前端项目中使用。 86 | 87 | ### 整洁架构 88 | 89 | Robert C. Martin 总结了六边形架构(即端口与适配器架构)、DCI (Data-Context-Interactions,数据-场景-交互)架构、BCI(Boundary Control Entity)架构等多种架构,归纳出了这些架构的基本特点: 90 | 91 | - 框架无关性。系统不依赖于框架中的某个函数,框架只是一个工具,**系统不能适应于框架**。 92 | - 可被测试。业务逻辑脱离于 UI、数据库等外部元素进行测试。 93 | - UI 无关性。不需要修改系统的其它部分,就可以变更 UI,诸如由 Web 界面替换成 CLI。 94 | - 数据库无关性。业务逻辑与数据库之间需要进行解耦,我们可以随意切换 LocalStroage、IndexedDB、Web SQL。 95 | - 外部机构(agency)无关性。系统的业务逻辑,不需要知道其它外部接口,诸如安全、调度、代理等。 96 | 97 | 如你所见,作为一个普通(不分前后端)的开发人员,我们关注于业务逻辑的抽离,让业务逻辑独立于框架。而在前端的实化,则是让前端的业务逻辑,可以独立于框架,只让 UI(即表现层)与框架绑定。一旦,我们更换框架的时候,只需要替换这部分的业务逻辑即可。 98 | 99 | 为此,基于这个概念 Robert C. Martin 绘制出了整洁架构的架构图: 100 | 101 | ![Clean Architecture](docs/images/clean-architecture.jpg) 102 | 103 | 如图所示 Clean Architecture 一共分为四个环,四个层级。环与环之间,存在一个依赖关系原则:**源代码中的依赖关系,必须只指向同心圆的内层,即由低层机制指向高级策略**。其类似于 SOLID 中的依赖倒置原则: 104 | 105 | - 高层模块不应该依赖低层模块,两者都应该依赖其抽象 106 | - 抽象不应该依赖细节,细节应该依赖抽象 107 | 108 | 与此同时,四个环都存在各自核心的概念: 109 | 110 | - 实体 Entities (又称领域对象或业务对象,实体用于封装企业范围的业务规则) 111 | - 用例 Use Cases(交互器,用例是特定于应用的业务逻辑) 112 | - 接口适配器 Interface Adapters (接口适配器层的主要作用是转换数据) 113 | - 框架和驱动(Frameworks and Drivers),最外层由各种框架和工具组成,比如 Web 框架、数据库访问工具等 114 | 115 | 这个介绍可能有些简单,让我复制/粘贴一下更详细的解释: 116 | 117 | **实体(Entities)**,实体用于封装企业范围的业务规则。实体可以是拥有方法的对象,也可以是数据结构和函数的集合。如果没有企业,只是单个应用,那么实体就是应用里的业务对象。这些对象封装了最通用和高层的业务规则,极少会受到外部变化的影响。任何操作层面的改动都不会影响到这一层。 118 | 119 | **用例(Use Cases)**,用例是特定于应用的业务逻辑,一般用来完成用户的某个操作。用例协调数据流向或者流出实体层,并且在此过程中通过执行实体的业务规则来达成用例的目标。用例层的改动不会影响到内部的实体层,同时也不会受外层的改动影响,比如数据库、UI 和框架的变动。只有而且应当应用的操作发生变化的时候,用例层的代码才随之修改。 120 | 121 | **接口适配器(Interface Adapters)**。接口适配器层的主要作用是转换数据,数据从最适合内部用例层和实体层的结构转换成适合外层(比如数据持久化框架)的结构。反之,来自于外部服务的数据也会在这层转换为内层需要的结构。 122 | 123 | **框架和驱动(Frameworks and Drivers)**。最外层由各种框架和工具组成,比如 Web 框架、数据库访问工具等。通常在这层不需要写太多代码,大多是一些用来跟内层通信的胶水代码。这一层包含了所有实现细节,把实现细节锁定在这一层能够减少它们的改动对整个系统造成的伤害。 124 | 125 | Done! 126 | 127 | 概念就这么扯到这里吧,然后看看相应的实现。 128 | 129 | ### Clean Architecture 数据流 130 | 131 | 上图中的右侧部分表示的是相应的数据流,数据从 Controller 流出,经过 Use Case(用例)的输入端口,然后通过 Use Case 本身,最后通过 Use Case 输出端口返回给 Presenter。 132 | 133 | 让我们来看一个较为直观的例子: 134 | 135 | ![Clean Architecture 数据流](docs/images/clean-data-flow.png) 136 | 137 | 上图(来源,见参考文章)是一个 Android 应用的数据流示意图。 138 | 139 | 对于只懂得前端的开发大致说明一下,Android 的 View 和 Presenter 的关系。在前端应用中,我们假设以使用 Component 来表示一个组件,如 Angular 中的 HomepageComponent。而这个 HomepageComponent 中,它必然充满了一些无关于页面显示的逻辑,比如从后端获取显示数据之类的。而 Java 的写法本身是比较臃肿的,所以在 Android 的 Activity 中就会充斥大量的代码。为此,Android 的开发人员们,采用了 MVP 架构,通过 Presenter 来将与显示无关的行为,从 View 中抽离出来。 140 | 141 | ### 优缺点 142 | 143 | 说了,这么多,最后让我们看一下优缺点。优点吧,就这些——笑: 144 | 145 | - 框架无关性。 146 | - 可被测试。 147 | - UI 无关性。 148 | - 数据库无关性。 149 | - 外部机构(agency)无关性。 150 | 151 | 除此,还有: 152 | 153 | - 定义了特定功能的代码放在何处 154 | - 可以在多个项目共享业务逻辑 155 | 156 | 相应的它还有大量的缺点: 157 | 158 | **过于复杂**。数据需要经过多层处理,Repository 转为 Entity,经过 Usecase 转为 Model,再交由 Presenter 处理,最后交由 View 显示。一个示例如下所示(源自[Android-Clean-Boilerplate](https://github.com/dmilicic/Android-Clean-Boilerplate/tree/example)): 159 | 160 | > MainActivity ->MainPresenter -> WelcomingInteractor -> WelcomeMessageRepository -> WelcomingInteractor -> MainPresenter -> MainActivity 161 | 162 | **过度设计**。事到如今,我们做了大量的设计,对于一个简单的工程来说,这样的模式可能是过度式的设计。 163 | 164 | **大量的模板式代码**。Usecase、Model 等一系列重复的模板式代码。 165 | 166 | **陡峭的学习曲线**。不用我多说,看这篇文章的长度。 167 | 168 | 所以,在采用之前,请再次考虑一下,**你的应用是否足够的复杂**——业务上的复杂度,代码上的复杂度等等。 169 | 170 | ## 前端 Clean 架构 171 | 172 | 说了,这么多,让我们来结合一下前端,设计一下新的前端架构。 173 | 174 | ### 客户端 Clean 架构 + MVP 175 | 176 | 与后端架构相比, Android 的 MVP 架构 + Clean 架构更与前端相似,为此我们再说看看它们结合的一个示例: 177 | 178 | ![Android Clean Architecture](docs/images/android-mvp-clean.png) 179 | 180 | 与上一个数据流的相比,这个数据流图更容易落地。其与传统的 MVP(Model-View-Presenter)架构相比: 181 | 182 | ![MVP](docs/images/js-mvp.png) 183 | 184 | 基于 Clean Architecture 方案时,则多了一个领域层(图中的 Domain Layer,即业务层),在这一层领域层里,放置的是系统相关的用例(Usecase),而用例所包含的则是相应的业务逻辑。 185 | 186 | ### Clean Architecture + MVP + 组件化 187 | 188 | 上述的 MVP + Clean Architecture 的架构方式,对于前端应用的架构设计来说,也是相当合适的。稍有不同的是,我们是否有必要将一个组件分为 Presenter + View。以我的角度来说,对于大部分前端应用来说,并没有这么复杂的情况,因为前端有组件化架构。 189 | 190 | 所以,最后对于我们的前端应用而言,架构如下图所示: 191 | 192 | ![Clean MVP 组件化](docs/images/clean-frontend-components.jpg) 193 | 194 | 这里,只是对于 Presenter 进行更细一步的细化,以真实的模式取代了 MVP 中的 Presenter。 195 | 196 | ## 实践 197 | 198 | 值得注意的是,我们在这里违反了依赖倒置原则。原因是,这里的注入带来了一定的前端复杂度,而这个注入并非是必须的——对于大部分的前端应用而言,只会有单一的数据源,那便是后端数据。 199 | 200 | ### 单体式分层架构 201 | 202 | 在我起初设计的版本里,参照的 Clean Angular 工程([Angular Clean Architecture](https://github.com/im-a-giraffe/angular-clean-architecture))里,其采用的是单体式的 Clean Architecture 分层结构: 203 | 204 | ``` 205 | ├── core 206 | │   ├── base // 基础函数,如 mapper 等 207 | │   ├── domain // 业务实体 208 | │   ├── repositories // repositories 模型 209 | │   └── usecases // 业务逻辑 210 | ├── data // 数据层 211 | │   └── repository // 数据源实现 212 | └── presentation // 表现层 213 | ``` 214 | 215 | 这个实现还是相当不错的,就是过于重视理论——抽象相当的繁琐,导致有点不接地气。我的意思说,没有多少前端人员,愿意按照这个模式来写。 216 | 217 | ### 微服务式分层架构 218 | 219 | 考虑到 usecase 的业务相关性,及会存在大师的 usecase,我便将 usecase 移到了 data 目录——也存在一定的不合理性。后来,我的同事泽杭——一个有丰富的 React 经验前端开发,他提出了 Redux 中的相关结构。最后,我们探讨出了最后的目录结构: 220 | 221 | ``` 222 | ├── core // 核心代码,包含基本服务和基础代码 223 | ├── domain // 业务层代码,包含每个业务的单独 Clean 架构内容 224 | │ └── elephant // 某一具体的业务 225 | ├── features // 公共页面组件 226 | ├── presentation // 有权限的页面 227 | ├── pages // 公共页面 228 | └── shared // 共享目录 229 | ``` 230 | 231 | 对应的 elephant 是某一个具体的业务,在该目录下包含了一个完整的 Clean Architecture,相应的目录和文件如下所示: 232 | 233 | ``` 234 | ├── model 235 | │   ├── elephant.entity.ts // 数据实体,简单的数据模型,用来表示核心的业务逻辑 236 | │   └── elephant.model.ts // 核心业务模型 237 | ├── repository 238 | │   ├── elephant.mapper.ts // 映射层,用于核心实体层映射,或映射到核心实体层。 239 | │   └── elephant.repository.ts // Repository,用于读取和存储数据。 240 | └── usecases 241 | └── get-elephant-by-id-usecase.usecase.ts // 用例,构建在核心实体之上,并实现应用程序的整个业务逻辑。 242 | ``` 243 | 244 | 我一直思考这样的模式是否有问题,直到我看到我司大佬 Martin Fowler 写下的一篇文章《[PresentationDomainDataLayering](https://martinfowler.com/bliki/PresentationDomainDataLayering.html)》——终于有人背锅了。文章中提到了这图: 245 | 246 | ![分层](docs/images/all_top.png) 247 | 248 | 这个分层类似于微服务的概念,在我所熟悉的 Django 框架中也是这样的结构。也因此从理论和实践上不看,并不存在任何的问题。 249 | 250 | ## 其它 251 | 252 | > 它不是一颗银弹。使用 MVP 并不妨碍开发人员将 UI 逻辑放在 View 中,使用 Clean Architecture 不会阻止业务逻辑泄漏到表示层。 253 | 254 | 我们仍然在优化相关的架构中,代码见:https://github.com/phodal/clean-angular 255 | 256 | ## 相关 257 | 258 | **相关文章** 259 | 260 | - [Thoughts on Clean Architecture and MVP](http://wahibhaq.com/blog/clean-architecture-mvp-summary/) 261 | - [Approach to Clean Architecture in Angular Applications — Theory](https://medium.com/@thegiraffeclub/angular-clean-architecture-approach-fcfe32e983a5) 262 | - [Approach to Clean Architecture in Angular Applications — Hands-on](https://medium.com/intive-developers/approach-to-clean-architecture-in-angular-applications-hands-on-35145ceadc98) 263 | - [DDD, Hexagonal, Onion, Clean, CQRS, … How I put it all together](https://herbertograca.com/2017/11/16/explicit-architecture-01-ddd-hexagonal-onion-clean-cqrs-how-i-put-it-all-together/) 264 | - [Android Architecture: Part 1 – Every New Beginning is Hard](https://five.agency/android-architecture-part-1-every-new-beginning-is-hard/) 对应的中文翻译版本:[Android架构:第一部分-每个新的开始都很艰难 (译)](https://dimon94.github.io/2018/05/07/Android%E6%9E%B6%E6%9E%84%EF%BC%9A%E7%AC%AC%E4%B8%80%E9%83%A8%E5%88%86%20-%20%E6%AF%8F%E4%B8%AA%E6%96%B0%E7%9A%84%E5%BC%80%E5%A7%8B%E9%83%BD%E5%BE%88%E8%89%B0%E9%9A%BE%20(%E8%AF%91)/) 265 | - [PresentationDomainDataLayering](https://martinfowler.com/bliki/PresentationDomainDataLayering.html) 266 | 267 | **目录结构** 268 | 269 | 来源: [https://stackoverflow.com/questions/42779871/angular-core-feature-shared-modules-what-goes-where](https://stackoverflow.com/questions/42779871/angular-core-feature-shared-modules-what-goes-where) 270 | 271 | - app/**shared** - This is the module where I keep small stuff that every other module will need. I have 3 submodules there `directives`, `components` and `pipes`, just to keep things organized a little better. Examples: `filesize.pipe`, `click-outside.directive`, `offline-status.component`... 272 | - app/**public** - In this module I keep public routes and top-level components. Examples: `about.component`, `contact.component`, `app-toolbar.component` 273 | - app/**core** - Services that app needs (and cannot work without) go here. Examples: `ui.service`, `auth.service`, `auth.guard`, `data.service`, `workers.service`.... 274 | - app/**protected** - Similar to **public**, only for authorized users. This module has protected routes and top-level components. Examples: `user-profile.component`, `dashboard.component`, `dashboard-sidebar.component`... 275 | - app/**features** - This is the module where app functionalities are. They are organized in several submodules. If you app plays music, this is where `player`, `playlist`, `favorites`submodules would go. If you look at the [`@angular/material2`](https://github.com/angular/material2/tree/master/src/lib) this would be an equivalent to their `MaterialModule` and many submodules, like `MdIconModule`, `MdSidenavModule` etc. 276 | - app/**dev** - I use this module when developing, don't ship it in production. 277 | 278 | **相似项目** 279 | 280 | - [Angular Clean Architecture](https://github.com/im-a-giraffe/angular-clean-architecture) 281 | - [React Clean Architecture](https://github.com/eduardomoroni/react-clean-architecture) 282 | - [Google Android MVP Clean](https://github.com/googlesamples/android-architecture/tree/todo-mvp-clean/) 283 | - [Android-CleanArchitecture](https://github.com/android10/Android-CleanArchitecture) 13k stars 284 | 285 | # Clean Architecture 实施指南 286 | 287 | 在之前的那篇《[整洁前端架构](https://phodal.github.io/clean-frontend/)》的文章里, 我们介绍了如何在前端领域里使用 Clean Architecture。在过去的几个月里,我们实践了 Clean Architecture 架构,并且实践证明了 Clean Architecture 也可以在前端工作得非常好。 288 | 289 | ## Clean Architecture + MVP + 组件化架构 290 | 291 | 开始之前,让我们先看一下使用 Clean Architecture 的 Angular 应用的最终架构: 292 | 293 | ![Clean MVP + Componet-based + MVP](docs/images/clean-frontend-components.jpg) 294 | 295 | 图中,我们将架构拆为了这部分来考虑: 296 | 297 | - 数据层。即前端与后端所有交互的处理层,从请求到返回结果,只返回前端**需要的值与字段**。 298 | - MVP 层。MVP 不是本文的重点,不过有意思的是,在 Angular 应用中,module 层可以与后端 service 对应。而 module 层下的 page,也可以按此来拆分。 299 | - MVP 中的组件层。对于组件层的合理规划,会使我们的 componet 层也变得 clean,而不仅仅是 domain 层整洁。组件,难的地方是满足场景,而不是拆分、组合与封装。 300 | 301 | 在这里,我们少了样式层的部分。一来,使用各种 CSS 预处理器来组织代码已经很成熟了;二来,在基础设施完善的今天,CSS 已经没有那么痛了。 302 | 303 | 与我们旧的架构图相比,我们加入了更多的实施细节: 304 | 305 | ![Clean Architecture](docs/images/clean-mvp-component-based.jpg) 306 | 307 | 不过,前者是限定条件的,而后者是通用条件下的架构。 308 | 309 | ## 有利于实施的上下文 310 | 311 | Clean Architecture 并不是银弹,它适合于我们,并不代表它就适合于你们。尤其是如果你习惯自由、自主地项目开发,那么强规范化的 Clean Architecture + Angular 并不一定适合你们。不过,与此同时,如果你的团队规模比较大,并且初级开发者比较多,那么我想规范化能帮助你们减少问题——易于维护。 312 | 313 | 所以,我先大介绍一些有利于我们的上下文环境: 314 | 315 | - 实施 DDD 的微服务后台架构。 316 | - 有志于实现全功能团队的成员。 317 | 318 | 还有其它诸如于初级开发者较多,采用适合于企业(追求规范化)的 Angular 框架——所以规范更多一点,反而更好维护。不过,剩下的这些因素,以于我们的架构来说:有帮助,但并不会太大。 319 | 320 | ### 实施 DDD 的微服务后台架构 321 | 322 | DDD 只是一套软件开发方法,不同的人理解下的 DDD 自有差异。在特定的情形下,使用 DDD 进行微服务拆分时,每个子域都是一个特定的微服务。在这种模式之下,我们需要有一种命名模式来区分每一种服务,而其中的一种体现方式则是 URL。每个服务有自己特有的 URL 前缀/路径,对应的当这些服务暴露出来时,便可以产出对应的前端领域层——哪怕是没有参加过事件风暴,又或者是领域划分。 323 | 324 | 诸如于:``/api/payment/``,``/api/manage/`` 都可以清晰地拆分出前端的 ``domain data`` 层。 325 | 326 | 与此同时,若是后端再根据资源路径命名 Controller,诸如于 ``/api/blog/blog/:id``,``/api/blog/blog/category/:id``,那么前端便可以清晰地把它们划分到同一个 ``repository`` 之中。当然了,一旦后端设计有问题,前端也能明显地察觉出来。 327 | 328 | ### 全功能团队 329 | 330 | 过去,我在 ThoughtWorks 的某个团队里,采用的是全功能团队的模式——团队成员擅长某一领域,但是会其它领域,比如擅长前端,会点后端。它可以在某种程度上,降低沟通成本。而这意味着,我们有大量的 knowledge transfer 的成本。因此,我们采用了结对编程、让新人讲项目相关的 session。 331 | 332 | 所以,当你们决定成为一个全功能团队(前后端 + 业务分析都做),那么你们就会遇到这样的问题: 333 | 334 | - 找到应用的前端代码,怎么快速找? 335 | - 找到对应的后端代码, 336 | - 前后端模型对应 337 | - …… 338 | 339 | 让前后端尽量保持一致,便成为了一种新的挑战。 340 | 341 | ## 目录即分层 342 | 343 | 从某种意义上来说,Clean Architectute 是一种**规范化**和**模板化**的实施方案。与此同时,它在数据层的三层机制,使得它存在两层**防腐层**,usecase 可以作为业务的缓冲层,repository 层可以隔离后端服务与模型。 344 | 345 | 在众多的架构设计之种,分层架构是最容易实施的,因为目录即分层。目录便是一种规范,一看就能看出哪放什么。一旦放错了,也能一眼看出来。 346 | 347 | ### MVP 分层(目录划分) 348 | 349 | 从目录结果上来说,我们的划分方式和一般的 Angular 应用,并不会有太大的区别。 350 | 351 | ```javascript 352 | ├── core // 核心代码,包含基本服务和基础代码 353 | ├── domain // 业务层代码,包含每个业务的单独 Clean 架构内容 354 | │ └── elephant // 某一具体的业务 355 | ├── features // 公共的业务组件 356 | ├── presentation // 业务逻辑页面 357 | ├── pages // 公共页面 358 | └── shared // 共享目录 359 | ``` 360 | 361 | 我们将: 362 | 363 | 1. 业务页面都放到了 ``presentation`` 目录 364 | 2. 公共的页面(如 404)都放到了 ``pages`` 目录 365 | 3. 业务页面共用的业务组件放到了 ``features`` 目录 366 | 4. 剩余的通用部分都放到了 ``shared`` 目录,诸如于 ``pipes``、``utils``、``services``、``components``、``modules`` 367 | 368 | 示例代码见:https://github.com/phodal/clean-frontend 369 | 370 | ### domain + data 层:垂直 + 水平 分层 371 | 372 | 上述的目录中的 domain 层,示例结构如下所示: 373 | 374 | ```javascript 375 | ├── model 376 | │   ├── elephant.entity.ts // 数据实体,简单的数据模型,用来表示核心的业务逻辑 377 | │   └── elephant.model.ts // 核心业务模型 378 | ├── repository 379 | │   ├── elephant.mapper.ts // 映射层,用于核心实体层映射,或映射到核心实体层。即进行模型转换 380 | │   └── elephant.repository.ts // Repository,用于读取和存储数据。 381 | └── usecases 382 | └── get-elephant-by-id-usecase.usecase.ts // 用例,构建在核心实体之上,并实现应用程序的整个业务逻辑。 383 | ``` 384 | 385 | 相关的解释如上,这里就不 Ctrl + V / Ctrl + C 了。 386 | 387 | 值得注意的是,我们采用的是垂直 + 水平双分层的模式,垂直应对的是领域服务。它适用于没有 BFF 的微服务架构,尤其是采用 DDD 的微服务后端应用。 388 | 389 | ## 映射领域服务 390 | 391 | 在上一部分中,前端的 domain + layer 层,实际上已经映射了后端的服务。当前端发起一个请求时,它的流程一般是这样的:Component / Controller(前端) -> Usecase -> Repository -> Controller(后端) 392 | 393 | 对应的返回顺序便是:Controller(后端) -> Repository -> Usecase -> Component / Controller(前端) 394 | 395 | 为此,我们将 Repository 与后端的 Controller 对应。并且由于服务的简单化,我们的大部分 usecase 也与 repository 中的命名对应。 396 | 397 | ### repository 命名:URL 命名 398 | 399 | 为了不看后端的代码就可以命名,我们使用 URL 来命名 repository 和 repository 中的方法。如有一个 400 | 401 | | URL | 解释 | 抽象 | 402 | |------|-----|----------| 403 | | ``/api/blog/blog/:id`` | /API/微服务名/资源名称/资源 ID | HTTP 动词 + 资源 + 行为 | 404 | 405 | 于是乎,对应的 ``repository`` 的名字应该是 ``blog.repository.ts``。对应的 repository 的名字也是 ``get-blog-by-id``。相似的,还有 URL ``/api/blog/blog/:id/comment`` 对应的 repository 便是 ``get-comment-by-blog-id``。 406 | 407 | 嗯,是的,和数据库的存取保持一致。 408 | 409 | ### usecase 命名 410 | 411 | 由于,我们还不涉及复杂的 API,所以常见的行为如下: 412 | 413 | - 常规动词:get / create / update / delete / patch 414 | - 非常规:search, submit 415 | 416 | 哈哈,是不是和 repository 相似了。 417 | 418 | ## Clean Architecture 的 MVP 层实践 419 | 420 | 实际上这里的 MVP 层, 主要内容便是组件化架构。这部分的内容已经在之前的文章(《[【架构拾集】组件设计原则](https://www.phodal.com/blog/architecture-in-realworld-design-component-based-architecture/)》)介绍过了,这里就不详细介绍了。简单的介绍一下就是: 421 | 422 | - 基础组件库,如 Material Design 423 | - 二次封装组件。额外的三方组件库,如 Infinite Scroller,务必在封装后使用。 424 | - 自制基础组件。 425 | - 领域特定组件。 426 | 427 | 上述的四部分,构建了整个系统的通用组件库模块。随后,便是业务相关组件和页面级组件。 428 | 429 | - 业务相关组件。在不同的模块、页面之间,共享逻辑的组件。 430 | - 页面级组件。在不同的模块、路由之间,共享页面。 431 | 432 | 嗯,这部分的东西就这么多了。 433 | 434 | ## Clean Architecture 的 Domain + Data 层实践 435 | 436 | 嗯,其它部分和正常的项目开发,并没有太大的区别。于是,我们便可以把注意力集中在 Domain + Data 层上。 437 | 438 | ### DDD ApplicationService vs 多个 Usecases 439 | 440 | > 在 DDD 实践中,自然应该采用自顶向下的实现方式。ApplicationService 的实现遵循一个很简单的原则,即一个业务用例对应ApplicationService上的一个业务方法。[^ddd_backend] 441 | 442 | [^ddd_backend]: https://insights.thoughtworks.cn/backend-development-ddd/ 443 | 444 | 稍微有点不同的是,我们采用的 Clean Architecture 推荐的方式是:**一个业务用例(usecase)对应于一个业务类**。即,同样的业务场景下,前端是一堆 usecase 文件,而后端是一个applicationService。所以,在这种场景之下,前端有: 445 | 446 | - change-production-count.usecase.ts 447 | - delete-product.usecase.ts 448 | 449 | 后端便是 ``OrderApplicationService.java``,其中有多个方法。 450 | 451 | ### usecases + repository vs services 452 | 453 | 如果我们的 usecases + repository 做的功能,和一个 services 是一样的,那么只使用 serivce 不好吗?只使用 service 会有这样的问题: 454 | 455 | - 存在 API 重复调用的问题 456 | - 调用划分不清晰 457 | 458 | 那么,使用 usecase 呢: 459 | 460 | - 更多的模板化代码 461 | - 更多的分层 462 | 463 | Usecases 的复用率极低,项目会因而急剧的增加类和重复代码。因此,我们试图以更多的代码量,来提升架构的可维护性。PS:更多的代码,还可能降低代码的可维护性,不过在 IDE 智能化的今天,这应该不是问题。 464 | 465 | ### Usecases 作为逻辑层/防腐层 466 | 467 | 不过,Usecases 在带来更多代码的同时,也带来了防腐层。它负责了以下的职责: 468 | 469 | - 业务逻辑处理。在数据传给后端之前,对一些必要的内容进行处理。 470 | - 返回数据管理。从后端返回的数据里,构建出前端所需要的结果。当需要调用多个 API 时,可以在 usecase 里做这样的工作。 471 | - 输入参数管理。 472 | 473 | 也因此,当前端被赋予过重的业务逻辑时,Usecases 层就非常有用。反之,如果逻辑被放置在 BFF 层时,那么 Usecases 层就变得有些鸡肋。但是它仍然是一个非常不错的防腐层。 474 | 475 | ## 模型管理 476 | 477 | 在我们处理 Usecase 的同时,我们就需要解决前端的模型问题。后端,有多个微服务,有多个工程,每个工程有自己的模型。而如果前端只有一个工程,那么前端的模型管理就变成一个痛点。因为在不同的限界上下文里,后端的模型是不一样的。即在不同的 API 里,其模型是不一样的,而这些根据业务定制的模型,最后在前端都聚合到一起。 478 | 479 | 在这个时候,同个资源有可能有多种不同的模型。因此,要么: 480 | 481 | - 前端拥有一一对应的模型。管理起来比较麻烦。 482 | - 使用同一个模型。不能使用类型检查来减少 bug。 483 | 484 | 当前,我也想不到一个更好的解决方法。我们采用的主要是第二种方式,毕竟管理起来方便一些。 485 | 486 | 以下是我们的几种类型的分类和管理方式: 487 | 488 | - **Request Model / Response Model**。即请求参数和返回模型(修改过,适用于前端展示),都放在服务的对应的 .model.ts 目录下。 489 | - **Response Entity**。直接使用后端返回结果时,名字上带 ``entity``,否则就使用 ``model``。 490 | - **View Model / Component Model**。适用于业务组件的封装时,传入参数用 model 传入。 491 | 492 | 你们呢,是否有更好的实践? 493 | 494 | ## 相关问题 495 | 496 | 真的 Clean 吗?还没有 497 | 498 | ### 框架依赖的表单验证 499 | 500 | 由于 Angular 框架本身提供了强大的 Reactive Form 功能,我们在大部分的表单设计时,采用了 Reactive Form,而不是通过 Entity 来验证的方式。这使得我们在这部分的 UI 交互,依赖于 Angular 框架,而非自己实现。 501 | 502 | 如果采用了诸如 DDD 的 Entity 模式,又或者是采用 validator 的方式。随后,我们还需要开发自己的表单验证模式,类似于此: 503 | 504 | ```javascript 505 | { 506 | validator: RegExp, 507 | errorMessage: string 508 | } 509 | ``` 510 | 511 | 512 | 而它意味着大量的开发成本。不过,好在我们可以尽量将它通用化。 513 | 514 | ## 下一步 515 | 516 | - **Clean 表单**。如上所述。 517 | - **代码生成**。尽管,我们已经在项目中,采用了 Angular Schematics 来生成模板代码。但是相信,下一步我们可以使用工具来生成页面。 518 | - **架构守护**。有了分层结构之后, 要判定层级关系变得更加简单。 519 | - **其它框架尝试**。 520 | 521 | 522 | License 523 | --- 524 | 525 | [![Phodal's Idea](http://brand.phodal.com/shields/idea-small.svg)](http://ideas.phodal.com/) 526 | 527 | @ 2019 A [Phodal Huang](https://www.phodal.com)'s [Idea](http://github.com/phodal/ideas). This code is distributed under the MIT license. See `LICENSE` in this directory. 528 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | remote_theme: phodal/mifa-jekyll 2 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "clean-angular": { 7 | "root": "", 8 | "sourceRoot": "src", 9 | "projectType": "application", 10 | "prefix": "app", 11 | "schematics": { 12 | "@schematics/angular:component": { 13 | "style": "scss" 14 | } 15 | }, 16 | "architect": { 17 | "build": { 18 | "builder": "@angular-devkit/build-angular:browser", 19 | "options": { 20 | "outputPath": "dist/clean-angular", 21 | "index": "src/index.html", 22 | "main": "src/main.ts", 23 | "polyfills": "src/polyfills.ts", 24 | "tsConfig": "src/tsconfig.app.json", 25 | "assets": [ 26 | "src/favicon.ico", 27 | "src/assets" 28 | ], 29 | "styles": [ 30 | "src/styles.scss" 31 | ], 32 | "scripts": [], 33 | "es5BrowserSupport": true 34 | }, 35 | "configurations": { 36 | "production": { 37 | "fileReplacements": [ 38 | { 39 | "replace": "src/environments/environment.ts", 40 | "with": "src/environments/environment.prod.ts" 41 | } 42 | ], 43 | "optimization": true, 44 | "outputHashing": "all", 45 | "sourceMap": false, 46 | "extractCss": true, 47 | "namedChunks": false, 48 | "aot": true, 49 | "extractLicenses": true, 50 | "vendorChunk": false, 51 | "buildOptimizer": true, 52 | "budgets": [ 53 | { 54 | "type": "initial", 55 | "maximumWarning": "2mb", 56 | "maximumError": "5mb" 57 | } 58 | ] 59 | } 60 | } 61 | }, 62 | "serve": { 63 | "builder": "@angular-devkit/build-angular:dev-server", 64 | "options": { 65 | "browserTarget": "clean-angular:build" 66 | }, 67 | "configurations": { 68 | "production": { 69 | "browserTarget": "clean-angular:build:production" 70 | } 71 | } 72 | }, 73 | "extract-i18n": { 74 | "builder": "@angular-devkit/build-angular:extract-i18n", 75 | "options": { 76 | "browserTarget": "clean-angular:build" 77 | } 78 | }, 79 | "test": { 80 | "builder": "@angular-devkit/build-angular:karma", 81 | "options": { 82 | "main": "src/test.ts", 83 | "polyfills": "src/polyfills.ts", 84 | "tsConfig": "src/tsconfig.spec.json", 85 | "karmaConfig": "src/karma.conf.js", 86 | "styles": [ 87 | "src/styles.scss" 88 | ], 89 | "scripts": [], 90 | "assets": [ 91 | "src/favicon.ico", 92 | "src/assets" 93 | ] 94 | } 95 | }, 96 | "lint": { 97 | "builder": "@angular-devkit/build-angular:tslint", 98 | "options": { 99 | "tsConfig": [ 100 | "src/tsconfig.app.json", 101 | "src/tsconfig.spec.json" 102 | ], 103 | "exclude": [ 104 | "**/node_modules/**" 105 | ] 106 | } 107 | } 108 | } 109 | }, 110 | "clean-angular-e2e": { 111 | "root": "e2e/", 112 | "projectType": "application", 113 | "prefix": "", 114 | "architect": { 115 | "e2e": { 116 | "builder": "@angular-devkit/build-angular:protractor", 117 | "options": { 118 | "protractorConfig": "e2e/protractor.conf.js", 119 | "devServerTarget": "clean-angular:serve" 120 | }, 121 | "configurations": { 122 | "production": { 123 | "devServerTarget": "clean-angular:serve:production" 124 | } 125 | } 126 | }, 127 | "lint": { 128 | "builder": "@angular-devkit/build-angular:tslint", 129 | "options": { 130 | "tsConfig": "e2e/tsconfig.e2e.json", 131 | "exclude": [ 132 | "**/node_modules/**" 133 | ] 134 | } 135 | } 136 | } 137 | } 138 | }, 139 | "defaultProject": "clean-angular" 140 | } -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Table Of Contents 2 | *(Do NOT edit manually. Generated automatically)* 3 | 4 | ## [Dev](dev/) 5 | - [主题定制](dev/01-themes.md) 6 | 7 | 8 | --- 9 | # 如何创建一个文档 10 | 11 | - 找到新文档文件所属的正确子目录。 12 | - 每个文档文件都应该是 ``markdown``(扩展名为 ``.md``)。 13 | - 每个文档文件的第一行应包含其标题(用于生成目录)。 14 | - 将 ``/images`` 子文件夹中的所有图像存储在引用它们的文档所在的同一目录中。 15 | - 每次提交都会自动生成目录(TOC),所有更改都将相应地进行。 16 | -------------------------------------------------------------------------------- /docs/clean-angular.article.md: -------------------------------------------------------------------------------- 1 | # 整洁前端 2 | 3 | > Clean Frontend 4 | 5 | ## 前端的恶梦 6 | 7 | 在我最近的一个项目里,我使用了 Angular 和混合应用技术编写了一个实时聊天应用。为了方便这个应用直接修改,无缝地嵌入到其它应用程序中。我尽量减少了 Component 和 Service 的数量——然而,由于交互复杂 Component 的数量也不能减少。随后,当我们完成了这个项目的时候,主的组件的代码差不多有 1000 行。这差不多是一个复杂的应用的代码数。在我试图多次去重构代码时,我发现这并不是一件容易的事:太多的交互。导致了 UI 层的代码,很难被抽取出去。只是呢,我还能做的事情是将一些业务逻辑抽取出来,只是怎么去抽取了——这成了我的一个疑惑。 8 | 9 | MVP 嘛,逻辑不都是放到 Presenter 里,还有其它的招吗? 10 | 11 | ### AVR is evil 12 | 13 | Angular、Vue 和 React 都是一些不错的框架,但是它们都是恶魔——因为我们绑定了框架。尽快我们可以很快地从一个 React 的框架,迁移应用到其它类 React 框架,诸如 Preact;我们可以从一个类似于 Vue 的框架,迁移应用到其它类 Vue 的应用。但是我们很难从 React 迁移到 Angular,又或者是 Vue 迁移到 Angular。万一有一天,某个框架的核心维护人员,健康状况不好,那么我们可能就得重写整个应用。这对于一个技术人员/Tech Lead/项目经验/业务人员来说,这种情况是不可接受的。 14 | 15 | 所以,为了应对这些框架带来的问题,我们选择 Web Components 技术,又或者是微前端技术,从架构上切开我们的业务。但是它们并不是银弹,它们反而是一个累赘,限定了高版本的浏览器,制定了更多的规范。与此同时,不论是微前端技术还是 Web Components,它们都没有解决一个问题:**框架绑定应用**。 16 | 17 | 框架绑定应用,就是一种灾害。没有人希望哪一天因为 Java 需要高额的付费,而导致我们选择重写整个应用。 18 | 19 | ### 组件化及 Presenter 过重 20 | 21 | 应对页面逻辑过于重的问题,我们选择了组件化。将一个页面,拆分成一系列的业务组件,再进一步地对这些业务组件进行地次细分,形成更小的业务组件,最后它们都依赖于组件库。 22 | 23 | 可是呢,细化存在一个问题是:**更难以摆脱的框架绑定**。与此同时,我们大量的业务逻辑仍然放置在 Presenter 里。我们的 Presenter 充满了大量的业务逻辑和非业务逻辑: 24 | 25 | - 页面展示相应的逻辑。诸如点击事件、提交表单等等。 26 | - 状态管理。诸如是否展示,用户登录状态等等。 27 | - 业务逻辑。诸如某个字符串,要用怎样的形式展示。 28 | - 数据持续化。哪些数据需要存储在 LocalStorage,哪些数据存储在 IndexedDB 里? 29 | 30 | 为了应对 Presenter 过重的问题,我们使用了 Service 来处理某一块具体的业务,我们使用了 Utils、Helper 来处理一些公共的逻辑。哪怕是如此,我们使用 A 框架编写的业务逻辑,到了 B 框架中无法复用。 31 | 32 | 直到我最近重新接触了 Clean Architectrue,我发现 Presenter 还是可以进一步拆分的。 33 | 34 | ## 整洁的前端架构 35 | 36 | Clean Architecture 是由 Robert C. Martin 在 2012 年提出的(PS:时间真早)。最早,我只看到在 Android 应用上的使用,一来 Android 开发使用的是 Java,二来 Android 应用有很重的 View 层。与此同时,在 7 年的时间里,由于前后端的分离,UI 层已经从后端的部分消失了——当然了,你也可以说 JSON 也是一种 View(至少它是可见的)。尽管,还存在一定数量的后端渲染 Web 应用,但是新的应用几乎不采用这样的模式。 37 | 38 | 但是,在 9012 年的今天,前端应用走向了 MV* 的架构方案,也有了一层很重的 View 层——类似于过去的后端应用,或者后端应用。相似的架构,也可以在前端项目中使用。 39 | 40 | ### 整洁架构 41 | 42 | Robert C. Martin 总结了六边形架构(即端口与适配器架构)、DCI (Data-Context-Interactions,数据-场景-交互)架构、BCI(Boundary Control Entity,Boundary Control Entity)架构等多种架构,归纳出了这些架构的基本特点: 43 | 44 | - 框架无关性。系统不依赖于框架中的某个函数,框架只是一个工具,**系统不能适应于框架**。 45 | - 可被测试。业务逻辑脱离于 UI、数据库等外部元素进行测试。 46 | - UI 无关性。不需要修改系统的其它部分,就可以变更 UI,诸如由 Web 界面替换成 CLI。 47 | - 数据库无关性。业务逻辑与数据库之间需要进行解耦,我们可以随意切换 LocalStroage、IndexedDB、Web SQL。 48 | - 外部机构(agency)无关性。系统的业务逻辑,不需要知道其它外部接口,诸如安全、调度、代理等。 49 | 50 | 如你所见,作为一个普通(不分前后端)的开发人员,我们关注于业务逻辑的抽离,让业务逻辑独立于框架。而在前端的实化,则是让前端的业务逻辑,可以独立于框架,只让 UI(即表现层)与框架绑定。一旦,我们更换框架的时候,只需要替换这部分的业务逻辑即可。 51 | 52 | 为此,基于这个概念 Robert C. Martin 绘制出了整洁架构的架构图: 53 | 54 | ![Clean Architecture](images/clean-architecture.jpg) 55 | 56 | 如图所示 Clean Architecture 一共分为四个环,四个层级。环与环之间,存在一个依赖关系原则:**源代码中的依赖关系,必须只指向同心圆的内层,即由低层机制指向高级策略**。其类似于 SOLID 中的依赖倒置原则: 57 | 58 | - 高层模块不应该依赖低层模块,两者都应该依赖其抽象 59 | - 抽象不应该依赖细节,细节应该依赖抽象 60 | 61 | 与此同时,四个环都存在各自核心的概念: 62 | 63 | - 实体 Entities (又称领域对象或业务对象,实体用于封装企业范围的业务规则) 64 | - 用例 Use Cases(交互器,用例是特定于应用的业务逻辑) 65 | - 接口适配器 Interface Adapters (接口适配器层的主要作用是转换数据) 66 | - 框架和驱动(Frameworks and Drivers),最外层由各种框架和工具组成,比如 Web 框架、数据库访问工具等 67 | 68 | 这个介绍可能有些简单,让我复制/粘贴一下更详细的解释: 69 | 70 | **实体(Entities)**,实体用于封装企业范围的业务规则。实体可以是拥有方法的对象,也可以是数据结构和函数的集合。如果没有企业,只是单个应用,那么实体就是应用里的业务对象。这些对象封装了最通用和高层的业务规则,极少会受到外部变化的影响。任何操作层面的改动都不会影响到这一层。 71 | 72 | **用例(Use Cases)**,用例是特定于应用的业务逻辑,一般用来完成用户的某个操作。用例协调数据流向或者流出实体层,并且在此过程中通过执行实体的业务规则来达成用例的目标。用例层的改动不会影响到内部的实体层,同时也不会受外层的改动影响,比如数据库、UI 和框架的变动。只有而且应当应用的操作发生变化的时候,用例层的代码才随之修改。 73 | 74 | **接口适配器(Interface Adapters)**。接口适配器层的主要作用是转换数据,数据从最适合内部用例层和实体层的结构转换成适合外层(比如数据持久化框架)的结构。反之,来自于外部服务的数据也会在这层转换为内层需要的结构。 75 | 76 | **框架和驱动(Frameworks and Drivers)**。最外层由各种框架和工具组成,比如 Web 框架、数据库访问工具等。通常在这层不需要写太多代码,大多是一些用来跟内层通信的胶水代码。这一层包含了所有实现细节,把实现细节锁定在这一层能够减少它们的改动对整个系统造成的伤害。 77 | 78 | Done! 79 | 80 | 概念就这么扯到这里吧,然后看看相应的实现。 81 | 82 | ### Clean Architecture 数据流 83 | 84 | 上图中的右侧部分表示的是相应的数据流,数据从 Controller 流出,经过 Use Case(用例)的输入端口,然后通过 Use Case 本身,最后通过 Use Case 输出端口返回给 Presenter。 85 | 86 | 让我们来看一个较为直观的例子: 87 | 88 | ![Clean Architecture 数据流](images/clean-data-flow.png) 89 | 90 | 上图(来源,见参考文章)是一个 Android 应用的数据流示意图。 91 | 92 | 对于只懂得前端的开发大致说明一下,Android 的 View 和 Presenter 的关系。在前端应用中,我们假设以使用 Component 来表示一个组件,如 Angular 中的 HomepageComponent。而这个 HomepageComponent 中,它必然充满了一些无关于页面显示的逻辑,比如从后端获取显示数据之类的。而 Java 的写法本身是比较臃肿的,所以在 Android 的 Activity 中就会充斥大量的代码。为此,Android 的开发人员们,采用了 MVP 架构,通过 Presenter 来将与显示无关的行为,从 View 中抽离出来。 93 | 94 | ### 优缺点 95 | 96 | 说了,这么多,最后让我们看一下优缺点。优点吧,就这些——笑: 97 | 98 | - 框架无关性。 99 | - 可被测试。 100 | - UI 无关性。 101 | - 数据库无关性。 102 | - 外部机构(agency)无关性。 103 | 104 | 除此,还有: 105 | 106 | - 定义了特定功能的代码放在何处 107 | - 可以在多个项目共享业务逻辑 108 | 109 | 相应的它还有大量的缺点: 110 | 111 | **过于复杂**。数据需要经过多层处理,Repository 转为 Entity,经过 Usecase 转为 Model,再交由 Presenter 处理,最后交由 View 显示。一个示例如下所示(源自[Android-Clean-Boilerplate](https://github.com/dmilicic/Android-Clean-Boilerplate/tree/example)): 112 | 113 | > MainActivity ->MainPresenter -> WelcomingInteractor -> WelcomeMessageRepository -> WelcomingInteractor -> MainPresenter -> MainActivity 114 | 115 | **过度设计**。事到如今,我们做了大量的设计,对于一个简单的工程来说,这样的模式可能是过度式的设计。 116 | 117 | **大量的模板式代码**。Usecase、Model 等一系列重复的模板式代码。 118 | 119 | **陡峭的学习曲线**。不用我多说,看这篇文章的长度。 120 | 121 | 所以,在采用之前,请再次考虑一下,**你的应用是否足够的复杂**——业务上的复杂度,代码上的复杂度等等。 122 | 123 | ## 前端 Clean 架构 124 | 125 | 说了,这么多,让我们来结合一下前端,设计一下新的前端架构。 126 | 127 | ### 客户端 Clean 架构 + MVP 128 | 129 | 与后端架构相比, Android 的 MVP 架构 + Clean 架构更与前端相似,为此我们再说看看它们结合的一个示例: 130 | 131 | ![Android Clean Architecture](images/android-mvp-clean.png) 132 | 133 | 与上一个数据流的相比,这个数据流图更容易落地。其与传统的 MVP(Model-View-Presenter)架构相比: 134 | 135 | ![MVP](images/js-mvp.png) 136 | 137 | 基于 Clean Architecture 方案时,则多了一个领域层(图中的 Domain Layer,即业务层),在这一层领域层里,放置的是系统相关的用例(Usecase),而用例所包含的则是相应的业务逻辑。 138 | 139 | ### Clean Architecture + MVP + 组件化 140 | 141 | 上述的 MVP + Clean Architecture 的架构方式,对于前端应用的架构设计来说,也是相当合适的。稍有不同的是,我们是否有必要将一个组件分为 Presenter + View。以我的角度来说,对于大部分前端应用来说,并没有这么复杂的情况,因为前端有组件化架构。 142 | 143 | 所以,最后对于我们的前端应用而言,架构如下图所示: 144 | 145 | ![Clean MVP 组件化](images/clean-frontend-architecture.jpg) 146 | 147 | 这里,只是对于 Presenter 进行更细一步的细化,以真实的模式取代了 MVP 中的 Presenter。 148 | 149 | ## 实践 150 | 151 | 值得注意的是,我们在这里违反了依赖倒置原则。原因是,这里的注入带来了一定的前端复杂度,而这个注入并非是必须的——对于大部分的前端应用而言,只会有单一的数据源,那便是后端数据。 152 | 153 | ### 单体式分层架构 154 | 155 | 在我起初设计的版本里,参照的 Clean Angular 工程([Angular Clean Architecture](https://github.com/im-a-giraffe/angular-clean-architecture))里,其采用的是单体式的 Clean Architecture 分层结构: 156 | 157 | ``` 158 | ├── core 159 | │   ├── base // 基础函数,如 mapper 等 160 | │   ├── domain // 业务实体 161 | │   ├── repositories // repositories 模型 162 | │   └── usecases // 业务逻辑 163 | ├── data // 数据层 164 | │   └── repository // 数据源实现 165 | └── presentation // 表现层 166 | ``` 167 | 168 | 这个实现还是相当不错的,就是过于重视理论——抽象相当的繁琐,导致有点不接地气。我的意思说,没有多少前端人员,愿意按照这个模式来写。 169 | 170 | ### 微服务式分层架构 171 | 172 | 考虑到 usecase 的业务相关性,及会存在大师的 usecase,我便将 usecase 移到了 data 目录——也存在一定的不合理性。后来,我的同事泽杭——一个有丰富的 React 经验前端开发,他提出了 Redux 中的相关结构。最后,我们探讨出了最后的目录结构: 173 | 174 | ``` 175 | ├── core // 核心代码,包含基本服务和基础代码 176 | ├── domain // 业务层代码,包含每个业务的单独 Clean 架构内容 177 | │   └── elephant // 某一具体的业务 178 | ├── features // 公共页面组件 179 | ├── protected // 有权限的页面 180 | ├── public // 公共页面 181 | └── shared // 共享目录 182 | ``` 183 | 184 | 对应的 elephant 是某一个具体的业务,在该目录下包含了一个完整的 Clean Architecture,相应的目录和文件如下所示: 185 | 186 | ``` 187 | ├── model 188 | │   └── elephant.model.ts // 核心业务模型 189 | ├── repository 190 | │   ├── elephant-web-entity.ts // 数据实体,简单的数据模型,用来表示核心的业务逻辑 191 | │   ├── elephant-web-repository-mapper.ts // 映射层,用于核心实体层映射,或映射到核心实体层。 192 | │   └── elephant-web.repository.ts // Repository,用于读取和存储数据。 193 | └── usecases 194 | └── get-elephant-by-id-usecase.usecase.ts // 用例,构建在核心实体之上,并实现应用程序的整个业务逻辑。 195 | ``` 196 | 197 | 我一直思考这样的模式是否有问题,直到我看到我司大佬 Martin Folwer 写下的一篇文章《[PresentationDomainDataLayering](https://martinfowler.com/bliki/PresentationDomainDataLayering.html)》——终于有人背锅了。文章中提到了这图: 198 | 199 | ![分层](images/all_top.png) 200 | 201 | 这个分层类似于微服务的概念,在我所熟悉的 Django 框架中也是这样的结构。也因此从理论和实践上不看,并不存在任何的问题。 202 | 203 | ## 相关资料 204 | 205 | 推荐书目:《整洁架构之道》 206 | 207 | 相关文章: 208 | 209 | - [Android Architecture: Part 1 – Every New Beginning is Hard](https://five.agency/android-architecture-part-1-every-new-beginning-is-hard/) 对应的中文翻译版本:[Android架构:第一部分-每个新的开始都很艰难 (译)](https://dimon94.github.io/2018/05/07/Android%E6%9E%B6%E6%9E%84%EF%BC%9A%E7%AC%AC%E4%B8%80%E9%83%A8%E5%88%86%20-%20%E6%AF%8F%E4%B8%AA%E6%96%B0%E7%9A%84%E5%BC%80%E5%A7%8B%E9%83%BD%E5%BE%88%E8%89%B0%E9%9A%BE%20(%E8%AF%91)/) 210 | - [Thoughts on Clean Architecture and MVP](http://wahibhaq.com/blog/clean-architecture-mvp-summary/) 211 | - [Approach to Clean Architecture in Angular Applications — Theory](https://medium.com/@thegiraffeclub/angular-clean-architecture-approach-fcfe32e983a5) 212 | - [DDD, Hexagonal, Onion, Clean, CQRS, … How I put it all together](https://herbertograca.com/2017/11/16/explicit-architecture-01-ddd-hexagonal-onion-clean-cqrs-how-i-put-it-all-together/) 213 | - [PresentationDomainDataLayering](https://martinfowler.com/bliki/PresentationDomainDataLayering.html) 214 | 215 | ## 其它 216 | 217 | > 它不是一颗银弹。使用 MVP 并不妨碍开发人员将 UI 逻辑放在 View 中,使用 Clean Architecture 不会阻止业务逻辑泄漏到表示层。 218 | 219 | 我们仍然在优化相关的架构中,代码见:https://github.com/phodal/clean-angular 220 | -------------------------------------------------------------------------------- /docs/clean-angular.md: -------------------------------------------------------------------------------- 1 | Clean Angular in Angular 2 | === 3 | 4 | Phodal 5 | 6 | AVR is evil 7 | === 8 | 9 | Angular is not Clean 10 | 11 | ![Angular Code Demo](images/angular-demo-code.png) 12 | 13 | React is not Clean 14 | 15 | ![React Code Demo](images/react-demo-code.png) 16 | 17 | Vue is not Clean 18 | 19 | ![Vue Code Demo](images/vue-demo-code.png) 20 | 21 | 框架 x 独立 22 | === 23 | 24 | 25 | Angular 组件 26 | === 27 | 28 | | Component | 说明 | 29 | |-------------------|----------------------| 30 | | Container
Component | Integrates with other application layers | 31 | | Presentational
Component | Pure presentational, interactive view, Thin component model | 32 | | Presenter | Complex presentational Logic | 33 | 34 | 数据流 35 | === 36 | 37 | ![Data Flow](images/event-data-flow.gif) 38 | 39 | Presenter 40 | === 41 | 42 | - 展示(presentation) 43 | - 状态管理(state management) 44 | - 业务逻辑(business logic) 45 | - 持久化(persistence) 46 | 47 | Clean Architecture 48 | === 49 | 50 | - 框架无关性 51 | - 可测试 52 | - UI 无关性 53 | - 数据库无关性 54 | - 外部代理无关性(安全、调度、代理) 55 | 56 | OO 设计:SOLID 57 | === 58 | 59 | - S - 单一责任原则(Single Responsibility Principle) 60 | - O - 开放封闭原则(Open/Closed Principle) 61 | - L - 里氏替换原则(Liskov Substitution Principle) 62 | - I - 接口分离原则(Interface Segregation Principle) 63 | - D - 依赖倒置原则(Dependency Inversion Principle) 64 | 65 | 依赖倒置原则 66 | === 67 | 68 | - 高层模块不应该依赖低层模块,两者都应该依赖其抽象 69 | - 抽象不应该依赖细节,细节应该依赖抽象 70 | 71 | Clean Architecture 72 | === 73 | 74 | ![Clean Architecture](images/clean-architecture.jpg) 75 | 76 | 核心概念 77 | === 78 | 79 | - 实体 Entities (又称领域对象或业务对象,实体用于封装企业范围的业务规则) 80 | - 用例 Use Cases(交互器,用例是特定于应用的业务逻辑) 81 | - 接口适配器 Interface Adapters (接口适配器层的主要作用是转换数据) 82 | - 框架和驱动(Frameworks and Drivers),最外层由各种框架和工具组成,比如 Web 框架、数据库访问工具等 83 | 84 | Use case(交互器) 85 | === 86 | 87 | ![Use Case](images/angular-clean-usecase.png) 88 | 89 | Clean Architecture 架构 90 | === 91 | 92 | ![Clean Architecture 实现](images/android-mvp-clean.png) 93 | 94 | 95 | Clean Architecture 流控制 96 | === 97 | 98 | ![流](images/usecase-flow.png) 99 | 100 | 数据流 101 | === 102 | 103 | ![数据流](images/clean_architecture_layers_details.png) 104 | 105 | 优点 106 | === 107 | 108 | - 可重用的 Usecases 109 | - 定义了特定功能的代码放在何处 110 | - 可以在多个项目共享业务逻辑 111 | 112 | 缺点 113 | === 114 | 115 | - 过度设计 116 | - 大量的模板式代码 117 | - 重复的数据模型 118 | - 陡峭的学习曲线 119 | 120 | Presentation-Domain-Data-Layering 121 | === 122 | 123 | [PresentationDomainDataLayering](https://martinfowler.com/bliki/PresentationDomainDataLayering.html) 124 | 125 | ![Presentation-Domain-Data-Layering](images/Presentation-Domain-Data-Layering.png) 126 | 127 | 纵向分层 128 | === 129 | 130 | 分层是一种反模式 131 | 132 | ![All Top](images/all_top.png) 133 | 134 | Angular 135 | === 136 | 137 | ``` 138 | ├── model 139 | │   └── elephant.model.ts // 核心业务模型 140 | ├── repository 141 | │   ├── elephant-web-entity.ts // 数据实体,简单的数据模型,用来表示核心的业务逻辑 142 | │   ├── elephant-web-repository-mapper.ts // 映射层,用于核心实体层映射,或映射到核心实体层。 143 | │   └── elephant-web.repository.ts // Repository,用于读取和存储数据。 144 | └── usecases 145 | └── get-elephant-by-id-usecase.usecase.ts // 用例,构建在核心实体之上,并实现应用程序的整个业务逻辑。 146 | ``` 147 | 148 | TBC 149 | === 150 | -------------------------------------------------------------------------------- /docs/dev/01-themes.md: -------------------------------------------------------------------------------- 1 | # 主题定制 2 | 3 | ## 原理 4 | 5 | 由于主题定制的需要,我们需要在每个使用到的部分定制主题。现在设计的结构如下所示: 6 | 7 | 由 ``_app-themes.scss`` 统一管理,引入其它的主题文件,诸如:Page Header 的 ``_app-theme.scss``。再由各个模块的 ``*theme.scss`` 文件,定制各个组件的主题。 8 | 9 | ## 如何构建? 10 | 11 | 1. 在 APP 运行、构建时,会执行 ``scripts/tools/build-themes.sh`` 脚本。 12 | 2. 该脚本会在 ``src/assets/custom-themes`` 目录下找到对应的 ``.scss`` 文件,编译为 ``.css``。 13 | -------------------------------------------------------------------------------- /docs/how-to-create-a-doc-file.md: -------------------------------------------------------------------------------- 1 | # 如何创建一个文档 2 | 3 | - 找到新文档文件所属的正确子目录。 4 | - 每个文档文件都应该是 ``markdown``(扩展名为 ``.md``)。 5 | - 每个文档文件的第一行应包含其标题(用于生成目录)。 6 | - 将 ``/images`` 子文件夹中的所有图像存储在引用它们的文档所在的同一目录中。 7 | - 每次提交都会自动生成目录(TOC),所有更改都将相应地进行。 8 | -------------------------------------------------------------------------------- /docs/images/Presentation-Domain-Data-Layering.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/docs/images/Presentation-Domain-Data-Layering.png -------------------------------------------------------------------------------- /docs/images/all_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/docs/images/all_top.png -------------------------------------------------------------------------------- /docs/images/android-data-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/docs/images/android-data-flow.png -------------------------------------------------------------------------------- /docs/images/android-mvp-clean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/docs/images/android-mvp-clean.png -------------------------------------------------------------------------------- /docs/images/angular-clean-usecase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/docs/images/angular-clean-usecase.png -------------------------------------------------------------------------------- /docs/images/clean-architecture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/docs/images/clean-architecture.jpg -------------------------------------------------------------------------------- /docs/images/clean-data-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/docs/images/clean-data-flow.png -------------------------------------------------------------------------------- /docs/images/clean-frontend-architecture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/docs/images/clean-frontend-architecture.jpg -------------------------------------------------------------------------------- /docs/images/clean-frontend-components.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/docs/images/clean-frontend-components.jpg -------------------------------------------------------------------------------- /docs/images/clean-mvp-component-based.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/docs/images/clean-mvp-component-based.jpg -------------------------------------------------------------------------------- /docs/images/clean_architecture_layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/docs/images/clean_architecture_layers.png -------------------------------------------------------------------------------- /docs/images/clean_architecture_layers_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/docs/images/clean_architecture_layers_details.png -------------------------------------------------------------------------------- /docs/images/event-data-flow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/docs/images/event-data-flow.gif -------------------------------------------------------------------------------- /docs/images/js-mvp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/docs/images/js-mvp.png -------------------------------------------------------------------------------- /docs/images/usecase-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/docs/images/usecase-flow.png -------------------------------------------------------------------------------- /e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual('Welcome to clean-angular!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root h1')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "clean-angular", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "~7.2.0", 15 | "@angular/common": "~7.2.0", 16 | "@angular/compiler": "~7.2.0", 17 | "@angular/core": "~7.2.0", 18 | "@angular/forms": "~7.2.0", 19 | "@angular/platform-browser": "~7.2.0", 20 | "@angular/platform-browser-dynamic": "~7.2.0", 21 | "@angular/router": "~7.2.0", 22 | "core-js": "^2.5.4", 23 | "rxjs": "~6.3.3", 24 | "tslib": "^1.9.0", 25 | "zone.js": "~0.8.26" 26 | }, 27 | "devDependencies": { 28 | "@angular-devkit/build-angular": "~0.13.0", 29 | "@angular/cli": "~7.3.6", 30 | "@angular/compiler-cli": "~7.2.0", 31 | "@angular/language-service": "~7.2.0", 32 | "@types/jasmine": "~2.8.8", 33 | "@types/jasminewd2": "~2.0.3", 34 | "@types/node": "~8.9.4", 35 | "codelyzer": "~4.5.0", 36 | "husky": "^1.3.1", 37 | "jasmine-core": "~2.99.1", 38 | "jasmine-spec-reporter": "~4.2.1", 39 | "karma": "~4.0.0", 40 | "karma-chrome-launcher": "~2.2.0", 41 | "karma-coverage-istanbul-reporter": "~2.0.1", 42 | "karma-jasmine": "~1.1.2", 43 | "karma-jasmine-html-reporter": "^0.2.2", 44 | "lint-staged": "^8.1.5", 45 | "prettier": "^1.16.4", 46 | "protractor": "~5.4.0", 47 | "stylelint": "^9.10.1", 48 | "ts-node": "~7.0.0", 49 | "tslint": "~5.11.0", 50 | "typescript": "~3.2.2" 51 | }, 52 | "husky": { 53 | "hooks": { 54 | "pre-commit": "ng lint", 55 | "pre-push": "ng test && ng build --prod --aot" 56 | } 57 | }, 58 | "lint-staged": { 59 | "src/app/*.{css,scss}": [ 60 | "stylelint --syntax=scss", 61 | "prettier --parser --write", 62 | "git add" 63 | ], 64 | "{src,test}/**/*.ts": [ 65 | "prettier --write --single-quote", 66 | "git add" 67 | ] 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /schematics/.gitignore: -------------------------------------------------------------------------------- 1 | # Outputs 2 | src/**/*.js 3 | src/**/*.js.map 4 | src/**/*.d.ts 5 | 6 | # IDEs 7 | .idea/ 8 | jsconfig.json 9 | .vscode/ 10 | 11 | # Misc 12 | node_modules/ 13 | npm-debug.log* 14 | yarn-error.log* 15 | 16 | # Mac OSX Finder files. 17 | **/.DS_Store 18 | .DS_Store 19 | -------------------------------------------------------------------------------- /schematics/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started With Schematics 2 | 3 | This repository is a basic Schematic implementation that serves as a starting point to create and publish Schematics to NPM. 4 | 5 | ### Testing 6 | 7 | To test locally, install `@angular-devkit/schematics-cli` globally and use the `schematics` command line tool. That tool acts the same as the `generate` command of the Angular CLI, but also has a debug mode. 8 | 9 | Check the documentation with 10 | ```bash 11 | schematics --help 12 | ``` 13 | 14 | ### Unit Testing 15 | 16 | `npm run test` will run the unit tests, using Jasmine as a runner and test framework. 17 | 18 | ### Publishing 19 | 20 | To publish, simply do: 21 | 22 | ```bash 23 | npm run build 24 | npm publish 25 | ``` 26 | 27 | That's it! 28 | -------------------------------------------------------------------------------- /schematics/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "schematics", 3 | "version": "0.0.0", 4 | "description": "A schematics", 5 | "scripts": { 6 | "build": "tsc -p tsconfig.json", 7 | "watch": "tsc -w", 8 | "test": "npm run build && jasmine src/**/*_spec.js" 9 | }, 10 | "keywords": [ 11 | "schematics" 12 | ], 13 | "author": "", 14 | "license": "MIT", 15 | "schematics": "./src/collection.json", 16 | "dependencies": { 17 | "@angular-devkit/core": "^7.3.7", 18 | "@angular-devkit/schematics": "^7.3.7", 19 | "@angular/cdk": "^7.3.6", 20 | "@types/jasmine": "^3.0.0", 21 | "@types/node": "^8.0.31", 22 | "chalk": "latest", 23 | "jasmine": "^3.0.0", 24 | "typescript": "~3.2.2" 25 | }, 26 | "devDependencies": { 27 | "@schematics/angular": "^7.3.7" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /schematics/src/collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular-devkit/schematics/collection-schema.json", 3 | "schematics": { 4 | "domain": { 5 | "description": "Create Clean Domain", 6 | "factory": "./domain/index#DomainSchematic", 7 | "schema": "./domain/schema.json", 8 | "aliases": ["d"] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /schematics/src/domain/files/__path__/__name@dasherize@if-flat__/model/__name@dasherize__.entity.ts: -------------------------------------------------------------------------------- 1 | export interface <%= classify(name) %>Entity { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /schematics/src/domain/files/__path__/__name@dasherize@if-flat__/model/__name@dasherize__.model.ts: -------------------------------------------------------------------------------- 1 | export interface <%= classify(name) %>Model { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /schematics/src/domain/files/__path__/__name@dasherize@if-flat__/repository/__name@dasherize__.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Observable } from 'rxjs'; 3 | import { HttpClient } from '@angular/common/http'; 4 | import { map } from 'rxjs/operators'; 5 | 6 | import { <%= classify(name) %>Model } from '../model/<%= name %>.model'; 7 | import { <%= classify(name) %>RepositoryMapper } from './<%= name %>-repository-mapper'; 8 | import { <%= classify(name) %>Entity } from './<%= classify(name) %>-entity'; 9 | 10 | @Injectable({ 11 | providedIn: 'root' 12 | }) 13 | export class <%= classify(name) %>Repository { 14 | mapper = new <%= classify(name) %>RepositoryMapper(); 15 | constructor( 16 | private http: HttpClient 17 | ) { 18 | 19 | } 20 | 21 | get<%= classify(name) %>(): Observable<<%= classify(name) %>Model> { 22 | return this.http 23 | .get<<%= classify(name) %>Entity>(<%= url %>) 24 | .pipe(map(this.mapper.mapFrom)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /schematics/src/domain/files/__path__/__name@dasherize@if-flat__/repository/mapper/__name@dasherize__-repository.mapper.ts: -------------------------------------------------------------------------------- 1 | import { <%= classify(name) %>Entity } from './<%= classify(name) %>-entity'; 2 | import { <%= classify(name) %>Model } from '../model/<%= name %>.model'; 3 | import { Mapper } from '../../../core/base/mapper'; 4 | 5 | export class <%= classify(name) %>RepositoryMapper extends Mapper <<%= classify(name) %>Entity, <%= classify(name) %>Model> { 6 | mapFrom(param: <%= classify(name) %>Entity): <%= classify(name) %>Model { 7 | return { 8 | 9 | }; 10 | } 11 | 12 | mapTo(param: <%= classify(name) %>Model): <%= classify(name) %>Entity { 13 | return { 14 | 15 | }; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /schematics/src/domain/files/__path__/__name@dasherize@if-flat__/usecases/__name@dasherize__.usecase.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Observable } from 'rxjs'; 3 | import { UseCase } from '../../../core/base/use-case'; 4 | import { <%= classify(name) %>Model } from '../model/<%= name %>.model'; 5 | import { <%= classify(name) %>Repository } from '../repository/<%= name %>.repository'; 6 | 7 | @Injectable({ 8 | providedIn: 'root' 9 | }) 10 | export class Get<%= classify(name) %>Usecase implements UseCaseModel> { 11 | 12 | constructor(private repository: <%= classify(name) %>Repository) { 13 | } 14 | 15 | execute(params: void): Observable<<%= classify(name) %>Model> { 16 | return this.repository.get<%= classify(name) %>(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /schematics/src/domain/index.ts: -------------------------------------------------------------------------------- 1 | import { Rule, chain } from '@angular-devkit/schematics'; 2 | import { Schema } from './schema'; 3 | import { buildComponent } from '@angular/cdk/schematics'; 4 | 5 | export function DomainSchematic(options: Schema): Rule { 6 | return chain([ 7 | buildComponent({...options}, {}) 8 | ]); 9 | } 10 | -------------------------------------------------------------------------------- /schematics/src/domain/index_spec.ts: -------------------------------------------------------------------------------- 1 | import { Tree } from '@angular-devkit/schematics'; 2 | import { SchematicTestRunner } from '@angular-devkit/schematics/testing'; 3 | import * as path from 'path'; 4 | 5 | 6 | const collectionPath = path.join(__dirname, '../collection.json'); 7 | 8 | 9 | describe('my-schematic', () => { 10 | it('works', () => { 11 | const runner = new SchematicTestRunner('schematics', collectionPath); 12 | const tree = runner.runSchematic('my-schematic', {}, Tree.empty()); 13 | 14 | expect(tree.files).toEqual(['/hello']); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /schematics/src/domain/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "id": "EventSource", 4 | "title": "Event Source Options Schema", 5 | "type": "object", 6 | "properties": { 7 | "path": { 8 | "type": "string", 9 | "format": "path", 10 | "default": "src/app/domain", 11 | "description": "The path to create the component.", 12 | "visible": false 13 | }, 14 | "name": { 15 | "type": "string", 16 | "description": "The name of the service.", 17 | "$default": { 18 | "$source": "argv", 19 | "index": 0 20 | } 21 | }, 22 | "spec": { 23 | "type": "boolean", 24 | "description": "Specifies if a spec file is generated.", 25 | "default": true 26 | }, 27 | "module": { 28 | "type": "string", 29 | "description": "Allows specification of the declaring module.", 30 | "alias": "m" 31 | }, 32 | "provider": { 33 | "type": "boolean", 34 | "default": false, 35 | "description": "Specifies if declaring module exports the component." 36 | }, 37 | "url": { 38 | "type": "string", 39 | "default": "''", 40 | "description": "Data Repository URL" 41 | }, 42 | "skipImport": { 43 | "type": "boolean", 44 | "default": true, 45 | "description": "Skip import" 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /schematics/src/domain/schema.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright Google LLC All Rights Reserved. 4 | * 5 | * Use of this source code is governed by an MIT-style license that can be 6 | * found in the LICENSE file at https://angular.io/license 7 | */ 8 | 9 | import { Schema as ComponentSchema } from '@schematics/angular/component/schema'; 10 | 11 | export interface Schema extends ComponentSchema {} 12 | -------------------------------------------------------------------------------- /schematics/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "tsconfig", 4 | "lib": [ 5 | "es2018", 6 | "dom" 7 | ], 8 | "module": "commonjs", 9 | "moduleResolution": "node", 10 | "noEmitOnError": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "noImplicitAny": true, 13 | "noImplicitThis": true, 14 | "noUnusedParameters": false, 15 | "noUnusedLocals": false, 16 | "rootDir": "src/", 17 | "skipDefaultLibCheck": true, 18 | "skipLibCheck": true, 19 | "sourceMap": true, 20 | "strictNullChecks": true, 21 | "target": "es6", 22 | "types": [ 23 | "jasmine", 24 | "node" 25 | ] 26 | }, 27 | "include": [ 28 | "src/**/*" 29 | ], 30 | "exclude": [ 31 | "src/**/files/**/*" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /schematics/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@angular-devkit/core@7.3.8", "@angular-devkit/core@^7.3.7": 6 | version "7.3.8" 7 | resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-7.3.8.tgz#702b0944a69c71cce3a1492e0d62de18df22a993" 8 | integrity sha512-3X9uzaZXFpm5o2TSzhD6wEOtVU32CgeytKjD1Scxj+uMMVo48SWLlKiFh312T+smI9ko7tOT8VqxglwYkWosgg== 9 | dependencies: 10 | ajv "6.9.1" 11 | chokidar "2.0.4" 12 | fast-json-stable-stringify "2.0.0" 13 | rxjs "6.3.3" 14 | source-map "0.7.3" 15 | 16 | "@angular-devkit/schematics@7.3.8", "@angular-devkit/schematics@^7.3.7": 17 | version "7.3.8" 18 | resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-7.3.8.tgz#70bfc7876f7924ff53ab9310a00b62f20acf2f5c" 19 | integrity sha512-mvaKoORZIaW/h0VNZ3IQWP0qThRCZRX6869FNlzV0jlW0mhn07XbiIGHCGGSCDRxS7qJ0VbuIVnKXntF+iDeWw== 20 | dependencies: 21 | "@angular-devkit/core" "7.3.8" 22 | rxjs "6.3.3" 23 | 24 | "@angular/cdk@^7.3.6": 25 | version "7.3.6" 26 | resolved "https://registry.yarnpkg.com/@angular/cdk/-/cdk-7.3.6.tgz#4c330cacd11df4adade6c1cd3ed587745f9912fd" 27 | integrity sha512-ZuOz8nQk0bdo8YyNFcwnmSl4MPaQDAFTbLK29w4Vd/LfPnhBI3pAr0wVuPFb0fl3eSvvUrfTb/+kPbQcE07A0A== 28 | dependencies: 29 | tslib "^1.7.1" 30 | optionalDependencies: 31 | parse5 "^5.0.0" 32 | 33 | "@schematics/angular@^7.3.7": 34 | version "7.3.8" 35 | resolved "https://registry.yarnpkg.com/@schematics/angular/-/angular-7.3.8.tgz#9cded496b79830164acbc2fc382b66e5b5f7cf02" 36 | integrity sha512-7o90bnIxXNpJhWPDY/zCedcG6KMIihz7a4UQe6UdlhEX21MNZLYFiDiR5Vmsx39wjm2EfPh3JTuBIHGmMCXkQQ== 37 | dependencies: 38 | "@angular-devkit/core" "7.3.8" 39 | "@angular-devkit/schematics" "7.3.8" 40 | typescript "3.2.4" 41 | 42 | "@types/jasmine@^3.0.0": 43 | version "3.3.12" 44 | resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-3.3.12.tgz#bf282cb540e9ad7a0a04b742082c073b655eab39" 45 | integrity sha512-lXvr2xFQEVQLkIhuGaR3GC1L9lMU1IxeWnAF/wNY5ZWpC4p9dgxkKkzMp7pntpAdv9pZSnYqgsBkCg32MXSZMg== 46 | 47 | "@types/node@^8.0.31": 48 | version "8.10.38" 49 | resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.38.tgz#e05c201a668492e534b48102aca0294898f449f6" 50 | integrity sha512-EibsnbJerd0hBFaDjJStFrVbVBAtOy4dgL8zZFw0uOvPqzBAX59Ci8cgjg3+RgJIWhsB5A4c+pi+D4P9tQQh/A== 51 | 52 | abbrev@1: 53 | version "1.1.1" 54 | resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" 55 | integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== 56 | 57 | ajv@6.9.1: 58 | version "6.9.1" 59 | resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.9.1.tgz#a4d3683d74abc5670e75f0b16520f70a20ea8dc1" 60 | integrity sha512-XDN92U311aINL77ieWHmqCcNlwjoP5cHXDxIxbf2MaPYuCXOHS7gHH8jktxeK5omgd52XbSTX6a4Piwd1pQmzA== 61 | dependencies: 62 | fast-deep-equal "^2.0.1" 63 | fast-json-stable-stringify "^2.0.0" 64 | json-schema-traverse "^0.4.1" 65 | uri-js "^4.2.2" 66 | 67 | ansi-regex@^2.0.0: 68 | version "2.1.1" 69 | resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" 70 | integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= 71 | 72 | ansi-regex@^3.0.0: 73 | version "3.0.0" 74 | resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" 75 | integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= 76 | 77 | ansi-styles@^3.2.1: 78 | version "3.2.1" 79 | resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" 80 | integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== 81 | dependencies: 82 | color-convert "^1.9.0" 83 | 84 | anymatch@^2.0.0: 85 | version "2.0.0" 86 | resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" 87 | integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== 88 | dependencies: 89 | micromatch "^3.1.4" 90 | normalize-path "^2.1.1" 91 | 92 | aproba@^1.0.3: 93 | version "1.2.0" 94 | resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" 95 | integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== 96 | 97 | are-we-there-yet@~1.1.2: 98 | version "1.1.5" 99 | resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" 100 | integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== 101 | dependencies: 102 | delegates "^1.0.0" 103 | readable-stream "^2.0.6" 104 | 105 | arr-diff@^4.0.0: 106 | version "4.0.0" 107 | resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" 108 | integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= 109 | 110 | arr-flatten@^1.1.0: 111 | version "1.1.0" 112 | resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" 113 | integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== 114 | 115 | arr-union@^3.1.0: 116 | version "3.1.0" 117 | resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" 118 | integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= 119 | 120 | array-unique@^0.3.2: 121 | version "0.3.2" 122 | resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" 123 | integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= 124 | 125 | assign-symbols@^1.0.0: 126 | version "1.0.0" 127 | resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" 128 | integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= 129 | 130 | async-each@^1.0.0: 131 | version "1.0.1" 132 | resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" 133 | integrity sha1-GdOGodntxufByF04iu28xW0zYC0= 134 | 135 | atob@^2.1.1: 136 | version "2.1.2" 137 | resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" 138 | integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== 139 | 140 | balanced-match@^1.0.0: 141 | version "1.0.0" 142 | resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" 143 | integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= 144 | 145 | base@^0.11.1: 146 | version "0.11.2" 147 | resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" 148 | integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== 149 | dependencies: 150 | cache-base "^1.0.1" 151 | class-utils "^0.3.5" 152 | component-emitter "^1.2.1" 153 | define-property "^1.0.0" 154 | isobject "^3.0.1" 155 | mixin-deep "^1.2.0" 156 | pascalcase "^0.1.1" 157 | 158 | binary-extensions@^1.0.0: 159 | version "1.12.0" 160 | resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" 161 | integrity sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg== 162 | 163 | brace-expansion@^1.1.7: 164 | version "1.1.11" 165 | resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" 166 | integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== 167 | dependencies: 168 | balanced-match "^1.0.0" 169 | concat-map "0.0.1" 170 | 171 | braces@^2.3.0, braces@^2.3.1: 172 | version "2.3.2" 173 | resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" 174 | integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== 175 | dependencies: 176 | arr-flatten "^1.1.0" 177 | array-unique "^0.3.2" 178 | extend-shallow "^2.0.1" 179 | fill-range "^4.0.0" 180 | isobject "^3.0.1" 181 | repeat-element "^1.1.2" 182 | snapdragon "^0.8.1" 183 | snapdragon-node "^2.0.1" 184 | split-string "^3.0.2" 185 | to-regex "^3.0.1" 186 | 187 | cache-base@^1.0.1: 188 | version "1.0.1" 189 | resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" 190 | integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== 191 | dependencies: 192 | collection-visit "^1.0.0" 193 | component-emitter "^1.2.1" 194 | get-value "^2.0.6" 195 | has-value "^1.0.0" 196 | isobject "^3.0.1" 197 | set-value "^2.0.0" 198 | to-object-path "^0.3.0" 199 | union-value "^1.0.0" 200 | unset-value "^1.0.0" 201 | 202 | chalk@latest: 203 | version "2.4.2" 204 | resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" 205 | integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== 206 | dependencies: 207 | ansi-styles "^3.2.1" 208 | escape-string-regexp "^1.0.5" 209 | supports-color "^5.3.0" 210 | 211 | chokidar@2.0.4: 212 | version "2.0.4" 213 | resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" 214 | integrity sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ== 215 | dependencies: 216 | anymatch "^2.0.0" 217 | async-each "^1.0.0" 218 | braces "^2.3.0" 219 | glob-parent "^3.1.0" 220 | inherits "^2.0.1" 221 | is-binary-path "^1.0.0" 222 | is-glob "^4.0.0" 223 | lodash.debounce "^4.0.8" 224 | normalize-path "^2.1.1" 225 | path-is-absolute "^1.0.0" 226 | readdirp "^2.0.0" 227 | upath "^1.0.5" 228 | optionalDependencies: 229 | fsevents "^1.2.2" 230 | 231 | chownr@^1.1.1: 232 | version "1.1.1" 233 | resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" 234 | integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== 235 | 236 | class-utils@^0.3.5: 237 | version "0.3.6" 238 | resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" 239 | integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== 240 | dependencies: 241 | arr-union "^3.1.0" 242 | define-property "^0.2.5" 243 | isobject "^3.0.0" 244 | static-extend "^0.1.1" 245 | 246 | code-point-at@^1.0.0: 247 | version "1.1.0" 248 | resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" 249 | integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= 250 | 251 | collection-visit@^1.0.0: 252 | version "1.0.0" 253 | resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" 254 | integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= 255 | dependencies: 256 | map-visit "^1.0.0" 257 | object-visit "^1.0.0" 258 | 259 | color-convert@^1.9.0: 260 | version "1.9.3" 261 | resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" 262 | integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== 263 | dependencies: 264 | color-name "1.1.3" 265 | 266 | color-name@1.1.3: 267 | version "1.1.3" 268 | resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" 269 | integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= 270 | 271 | component-emitter@^1.2.1: 272 | version "1.2.1" 273 | resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" 274 | integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= 275 | 276 | concat-map@0.0.1: 277 | version "0.0.1" 278 | resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" 279 | integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= 280 | 281 | console-control-strings@^1.0.0, console-control-strings@~1.1.0: 282 | version "1.1.0" 283 | resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" 284 | integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= 285 | 286 | copy-descriptor@^0.1.0: 287 | version "0.1.1" 288 | resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" 289 | integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= 290 | 291 | core-util-is@~1.0.0: 292 | version "1.0.2" 293 | resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" 294 | integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= 295 | 296 | debug@^2.1.2, debug@^2.2.0, debug@^2.3.3: 297 | version "2.6.9" 298 | resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" 299 | integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== 300 | dependencies: 301 | ms "2.0.0" 302 | 303 | decode-uri-component@^0.2.0: 304 | version "0.2.0" 305 | resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" 306 | integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= 307 | 308 | deep-extend@^0.6.0: 309 | version "0.6.0" 310 | resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" 311 | integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== 312 | 313 | define-property@^0.2.5: 314 | version "0.2.5" 315 | resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" 316 | integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= 317 | dependencies: 318 | is-descriptor "^0.1.0" 319 | 320 | define-property@^1.0.0: 321 | version "1.0.0" 322 | resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" 323 | integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= 324 | dependencies: 325 | is-descriptor "^1.0.0" 326 | 327 | define-property@^2.0.2: 328 | version "2.0.2" 329 | resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" 330 | integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== 331 | dependencies: 332 | is-descriptor "^1.0.2" 333 | isobject "^3.0.1" 334 | 335 | delegates@^1.0.0: 336 | version "1.0.0" 337 | resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" 338 | integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= 339 | 340 | detect-libc@^1.0.2: 341 | version "1.0.3" 342 | resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" 343 | integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= 344 | 345 | escape-string-regexp@^1.0.5: 346 | version "1.0.5" 347 | resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" 348 | integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= 349 | 350 | expand-brackets@^2.1.4: 351 | version "2.1.4" 352 | resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" 353 | integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= 354 | dependencies: 355 | debug "^2.3.3" 356 | define-property "^0.2.5" 357 | extend-shallow "^2.0.1" 358 | posix-character-classes "^0.1.0" 359 | regex-not "^1.0.0" 360 | snapdragon "^0.8.1" 361 | to-regex "^3.0.1" 362 | 363 | extend-shallow@^2.0.1: 364 | version "2.0.1" 365 | resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" 366 | integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= 367 | dependencies: 368 | is-extendable "^0.1.0" 369 | 370 | extend-shallow@^3.0.0, extend-shallow@^3.0.2: 371 | version "3.0.2" 372 | resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" 373 | integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= 374 | dependencies: 375 | assign-symbols "^1.0.0" 376 | is-extendable "^1.0.1" 377 | 378 | extglob@^2.0.4: 379 | version "2.0.4" 380 | resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" 381 | integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== 382 | dependencies: 383 | array-unique "^0.3.2" 384 | define-property "^1.0.0" 385 | expand-brackets "^2.1.4" 386 | extend-shallow "^2.0.1" 387 | fragment-cache "^0.2.1" 388 | regex-not "^1.0.0" 389 | snapdragon "^0.8.1" 390 | to-regex "^3.0.1" 391 | 392 | fast-deep-equal@^2.0.1: 393 | version "2.0.1" 394 | resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" 395 | integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= 396 | 397 | fast-json-stable-stringify@2.0.0, fast-json-stable-stringify@^2.0.0: 398 | version "2.0.0" 399 | resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" 400 | integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= 401 | 402 | fill-range@^4.0.0: 403 | version "4.0.0" 404 | resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" 405 | integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= 406 | dependencies: 407 | extend-shallow "^2.0.1" 408 | is-number "^3.0.0" 409 | repeat-string "^1.6.1" 410 | to-regex-range "^2.1.0" 411 | 412 | for-in@^1.0.2: 413 | version "1.0.2" 414 | resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" 415 | integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= 416 | 417 | fragment-cache@^0.2.1: 418 | version "0.2.1" 419 | resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" 420 | integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= 421 | dependencies: 422 | map-cache "^0.2.2" 423 | 424 | fs-minipass@^1.2.5: 425 | version "1.2.5" 426 | resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" 427 | integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== 428 | dependencies: 429 | minipass "^2.2.1" 430 | 431 | fs.realpath@^1.0.0: 432 | version "1.0.0" 433 | resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" 434 | integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= 435 | 436 | fsevents@^1.2.2: 437 | version "1.2.4" 438 | resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" 439 | integrity sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg== 440 | dependencies: 441 | nan "^2.9.2" 442 | node-pre-gyp "^0.10.0" 443 | 444 | gauge@~2.7.3: 445 | version "2.7.4" 446 | resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" 447 | integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= 448 | dependencies: 449 | aproba "^1.0.3" 450 | console-control-strings "^1.0.0" 451 | has-unicode "^2.0.0" 452 | object-assign "^4.1.0" 453 | signal-exit "^3.0.0" 454 | string-width "^1.0.1" 455 | strip-ansi "^3.0.1" 456 | wide-align "^1.1.0" 457 | 458 | get-value@^2.0.3, get-value@^2.0.6: 459 | version "2.0.6" 460 | resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" 461 | integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= 462 | 463 | glob-parent@^3.1.0: 464 | version "3.1.0" 465 | resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" 466 | integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= 467 | dependencies: 468 | is-glob "^3.1.0" 469 | path-dirname "^1.0.0" 470 | 471 | glob@^7.0.5, glob@^7.1.3: 472 | version "7.1.3" 473 | resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" 474 | integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== 475 | dependencies: 476 | fs.realpath "^1.0.0" 477 | inflight "^1.0.4" 478 | inherits "2" 479 | minimatch "^3.0.4" 480 | once "^1.3.0" 481 | path-is-absolute "^1.0.0" 482 | 483 | graceful-fs@^4.1.11: 484 | version "4.1.15" 485 | resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" 486 | integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== 487 | 488 | has-flag@^3.0.0: 489 | version "3.0.0" 490 | resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" 491 | integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= 492 | 493 | has-unicode@^2.0.0: 494 | version "2.0.1" 495 | resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" 496 | integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= 497 | 498 | has-value@^0.3.1: 499 | version "0.3.1" 500 | resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" 501 | integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= 502 | dependencies: 503 | get-value "^2.0.3" 504 | has-values "^0.1.4" 505 | isobject "^2.0.0" 506 | 507 | has-value@^1.0.0: 508 | version "1.0.0" 509 | resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" 510 | integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= 511 | dependencies: 512 | get-value "^2.0.6" 513 | has-values "^1.0.0" 514 | isobject "^3.0.0" 515 | 516 | has-values@^0.1.4: 517 | version "0.1.4" 518 | resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" 519 | integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= 520 | 521 | has-values@^1.0.0: 522 | version "1.0.0" 523 | resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" 524 | integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= 525 | dependencies: 526 | is-number "^3.0.0" 527 | kind-of "^4.0.0" 528 | 529 | iconv-lite@^0.4.4: 530 | version "0.4.24" 531 | resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" 532 | integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== 533 | dependencies: 534 | safer-buffer ">= 2.1.2 < 3" 535 | 536 | ignore-walk@^3.0.1: 537 | version "3.0.1" 538 | resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" 539 | integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== 540 | dependencies: 541 | minimatch "^3.0.4" 542 | 543 | inflight@^1.0.4: 544 | version "1.0.6" 545 | resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" 546 | integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= 547 | dependencies: 548 | once "^1.3.0" 549 | wrappy "1" 550 | 551 | inherits@2, inherits@^2.0.1, inherits@~2.0.3: 552 | version "2.0.3" 553 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" 554 | integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= 555 | 556 | ini@~1.3.0: 557 | version "1.3.5" 558 | resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" 559 | integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== 560 | 561 | is-accessor-descriptor@^0.1.6: 562 | version "0.1.6" 563 | resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" 564 | integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= 565 | dependencies: 566 | kind-of "^3.0.2" 567 | 568 | is-accessor-descriptor@^1.0.0: 569 | version "1.0.0" 570 | resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" 571 | integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== 572 | dependencies: 573 | kind-of "^6.0.0" 574 | 575 | is-binary-path@^1.0.0: 576 | version "1.0.1" 577 | resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" 578 | integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= 579 | dependencies: 580 | binary-extensions "^1.0.0" 581 | 582 | is-buffer@^1.1.5: 583 | version "1.1.6" 584 | resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" 585 | integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== 586 | 587 | is-data-descriptor@^0.1.4: 588 | version "0.1.4" 589 | resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" 590 | integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= 591 | dependencies: 592 | kind-of "^3.0.2" 593 | 594 | is-data-descriptor@^1.0.0: 595 | version "1.0.0" 596 | resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" 597 | integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== 598 | dependencies: 599 | kind-of "^6.0.0" 600 | 601 | is-descriptor@^0.1.0: 602 | version "0.1.6" 603 | resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" 604 | integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== 605 | dependencies: 606 | is-accessor-descriptor "^0.1.6" 607 | is-data-descriptor "^0.1.4" 608 | kind-of "^5.0.0" 609 | 610 | is-descriptor@^1.0.0, is-descriptor@^1.0.2: 611 | version "1.0.2" 612 | resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" 613 | integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== 614 | dependencies: 615 | is-accessor-descriptor "^1.0.0" 616 | is-data-descriptor "^1.0.0" 617 | kind-of "^6.0.2" 618 | 619 | is-extendable@^0.1.0, is-extendable@^0.1.1: 620 | version "0.1.1" 621 | resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" 622 | integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= 623 | 624 | is-extendable@^1.0.1: 625 | version "1.0.1" 626 | resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" 627 | integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== 628 | dependencies: 629 | is-plain-object "^2.0.4" 630 | 631 | is-extglob@^2.1.0, is-extglob@^2.1.1: 632 | version "2.1.1" 633 | resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" 634 | integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= 635 | 636 | is-fullwidth-code-point@^1.0.0: 637 | version "1.0.0" 638 | resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" 639 | integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= 640 | dependencies: 641 | number-is-nan "^1.0.0" 642 | 643 | is-fullwidth-code-point@^2.0.0: 644 | version "2.0.0" 645 | resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" 646 | integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= 647 | 648 | is-glob@^3.1.0: 649 | version "3.1.0" 650 | resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" 651 | integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= 652 | dependencies: 653 | is-extglob "^2.1.0" 654 | 655 | is-glob@^4.0.0: 656 | version "4.0.0" 657 | resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" 658 | integrity sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A= 659 | dependencies: 660 | is-extglob "^2.1.1" 661 | 662 | is-number@^3.0.0: 663 | version "3.0.0" 664 | resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" 665 | integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= 666 | dependencies: 667 | kind-of "^3.0.2" 668 | 669 | is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: 670 | version "2.0.4" 671 | resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" 672 | integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== 673 | dependencies: 674 | isobject "^3.0.1" 675 | 676 | is-windows@^1.0.2: 677 | version "1.0.2" 678 | resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" 679 | integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== 680 | 681 | isarray@1.0.0, isarray@~1.0.0: 682 | version "1.0.0" 683 | resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" 684 | integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= 685 | 686 | isobject@^2.0.0: 687 | version "2.1.0" 688 | resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" 689 | integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= 690 | dependencies: 691 | isarray "1.0.0" 692 | 693 | isobject@^3.0.0, isobject@^3.0.1: 694 | version "3.0.1" 695 | resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" 696 | integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= 697 | 698 | jasmine-core@~3.4.0: 699 | version "3.4.0" 700 | resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-3.4.0.tgz#2a74618e966026530c3518f03e9f845d26473ce3" 701 | integrity sha512-HU/YxV4i6GcmiH4duATwAbJQMlE0MsDIR5XmSVxURxKHn3aGAdbY1/ZJFmVRbKtnLwIxxMJD7gYaPsypcbYimg== 702 | 703 | jasmine@^3.0.0: 704 | version "3.4.0" 705 | resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-3.4.0.tgz#0fa68903ff0c9697459cd044b44f4dcef5ec8bdc" 706 | integrity sha512-sR9b4n+fnBFDEd7VS2el2DeHgKcPiMVn44rtKFumq9q7P/t8WrxsVIZPob4UDdgcDNCwyDqwxCt4k9TDRmjPoQ== 707 | dependencies: 708 | glob "^7.1.3" 709 | jasmine-core "~3.4.0" 710 | 711 | json-schema-traverse@^0.4.1: 712 | version "0.4.1" 713 | resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" 714 | integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== 715 | 716 | kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: 717 | version "3.2.2" 718 | resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" 719 | integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= 720 | dependencies: 721 | is-buffer "^1.1.5" 722 | 723 | kind-of@^4.0.0: 724 | version "4.0.0" 725 | resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" 726 | integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= 727 | dependencies: 728 | is-buffer "^1.1.5" 729 | 730 | kind-of@^5.0.0: 731 | version "5.1.0" 732 | resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" 733 | integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== 734 | 735 | kind-of@^6.0.0, kind-of@^6.0.2: 736 | version "6.0.2" 737 | resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" 738 | integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== 739 | 740 | lodash.debounce@^4.0.8: 741 | version "4.0.8" 742 | resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" 743 | integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= 744 | 745 | map-cache@^0.2.2: 746 | version "0.2.2" 747 | resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" 748 | integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= 749 | 750 | map-visit@^1.0.0: 751 | version "1.0.0" 752 | resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" 753 | integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= 754 | dependencies: 755 | object-visit "^1.0.0" 756 | 757 | micromatch@^3.1.10, micromatch@^3.1.4: 758 | version "3.1.10" 759 | resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" 760 | integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== 761 | dependencies: 762 | arr-diff "^4.0.0" 763 | array-unique "^0.3.2" 764 | braces "^2.3.1" 765 | define-property "^2.0.2" 766 | extend-shallow "^3.0.2" 767 | extglob "^2.0.4" 768 | fragment-cache "^0.2.1" 769 | kind-of "^6.0.2" 770 | nanomatch "^1.2.9" 771 | object.pick "^1.3.0" 772 | regex-not "^1.0.0" 773 | snapdragon "^0.8.1" 774 | to-regex "^3.0.2" 775 | 776 | minimatch@^3.0.4: 777 | version "3.0.4" 778 | resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" 779 | integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== 780 | dependencies: 781 | brace-expansion "^1.1.7" 782 | 783 | minimist@0.0.8: 784 | version "0.0.8" 785 | resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" 786 | integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= 787 | 788 | minimist@^1.2.0: 789 | version "1.2.0" 790 | resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" 791 | integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= 792 | 793 | minipass@^2.2.1, minipass@^2.3.4: 794 | version "2.3.5" 795 | resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" 796 | integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== 797 | dependencies: 798 | safe-buffer "^5.1.2" 799 | yallist "^3.0.0" 800 | 801 | minizlib@^1.1.1: 802 | version "1.1.1" 803 | resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.1.tgz#6734acc045a46e61d596a43bb9d9cd326e19cc42" 804 | integrity sha512-TrfjCjk4jLhcJyGMYymBH6oTXcWjYbUAXTHDbtnWHjZC25h0cdajHuPE1zxb4DVmu8crfh+HwH/WMuyLG0nHBg== 805 | dependencies: 806 | minipass "^2.2.1" 807 | 808 | mixin-deep@^1.2.0: 809 | version "1.3.1" 810 | resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" 811 | integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== 812 | dependencies: 813 | for-in "^1.0.2" 814 | is-extendable "^1.0.1" 815 | 816 | mkdirp@^0.5.0, mkdirp@^0.5.1: 817 | version "0.5.1" 818 | resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" 819 | integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= 820 | dependencies: 821 | minimist "0.0.8" 822 | 823 | ms@2.0.0: 824 | version "2.0.0" 825 | resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" 826 | integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= 827 | 828 | nan@^2.9.2: 829 | version "2.11.1" 830 | resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.1.tgz#90e22bccb8ca57ea4cd37cc83d3819b52eea6766" 831 | integrity sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA== 832 | 833 | nanomatch@^1.2.9: 834 | version "1.2.13" 835 | resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" 836 | integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== 837 | dependencies: 838 | arr-diff "^4.0.0" 839 | array-unique "^0.3.2" 840 | define-property "^2.0.2" 841 | extend-shallow "^3.0.2" 842 | fragment-cache "^0.2.1" 843 | is-windows "^1.0.2" 844 | kind-of "^6.0.2" 845 | object.pick "^1.3.0" 846 | regex-not "^1.0.0" 847 | snapdragon "^0.8.1" 848 | to-regex "^3.0.1" 849 | 850 | needle@^2.2.1: 851 | version "2.2.4" 852 | resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" 853 | integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== 854 | dependencies: 855 | debug "^2.1.2" 856 | iconv-lite "^0.4.4" 857 | sax "^1.2.4" 858 | 859 | node-pre-gyp@^0.10.0: 860 | version "0.10.3" 861 | resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" 862 | integrity sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A== 863 | dependencies: 864 | detect-libc "^1.0.2" 865 | mkdirp "^0.5.1" 866 | needle "^2.2.1" 867 | nopt "^4.0.1" 868 | npm-packlist "^1.1.6" 869 | npmlog "^4.0.2" 870 | rc "^1.2.7" 871 | rimraf "^2.6.1" 872 | semver "^5.3.0" 873 | tar "^4" 874 | 875 | nopt@^4.0.1: 876 | version "4.0.1" 877 | resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" 878 | integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= 879 | dependencies: 880 | abbrev "1" 881 | osenv "^0.1.4" 882 | 883 | normalize-path@^2.1.1: 884 | version "2.1.1" 885 | resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" 886 | integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= 887 | dependencies: 888 | remove-trailing-separator "^1.0.1" 889 | 890 | npm-bundled@^1.0.1: 891 | version "1.0.5" 892 | resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" 893 | integrity sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g== 894 | 895 | npm-packlist@^1.1.6: 896 | version "1.1.12" 897 | resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.12.tgz#22bde2ebc12e72ca482abd67afc51eb49377243a" 898 | integrity sha512-WJKFOVMeAlsU/pjXuqVdzU0WfgtIBCupkEVwn+1Y0ERAbUfWw8R4GjgVbaKnUjRoD2FoQbHOCbOyT5Mbs9Lw4g== 899 | dependencies: 900 | ignore-walk "^3.0.1" 901 | npm-bundled "^1.0.1" 902 | 903 | npmlog@^4.0.2: 904 | version "4.1.2" 905 | resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" 906 | integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== 907 | dependencies: 908 | are-we-there-yet "~1.1.2" 909 | console-control-strings "~1.1.0" 910 | gauge "~2.7.3" 911 | set-blocking "~2.0.0" 912 | 913 | number-is-nan@^1.0.0: 914 | version "1.0.1" 915 | resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" 916 | integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= 917 | 918 | object-assign@^4.1.0: 919 | version "4.1.1" 920 | resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" 921 | integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= 922 | 923 | object-copy@^0.1.0: 924 | version "0.1.0" 925 | resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" 926 | integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= 927 | dependencies: 928 | copy-descriptor "^0.1.0" 929 | define-property "^0.2.5" 930 | kind-of "^3.0.3" 931 | 932 | object-visit@^1.0.0: 933 | version "1.0.1" 934 | resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" 935 | integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= 936 | dependencies: 937 | isobject "^3.0.0" 938 | 939 | object.pick@^1.3.0: 940 | version "1.3.0" 941 | resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" 942 | integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= 943 | dependencies: 944 | isobject "^3.0.1" 945 | 946 | once@^1.3.0: 947 | version "1.4.0" 948 | resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" 949 | integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= 950 | dependencies: 951 | wrappy "1" 952 | 953 | os-homedir@^1.0.0: 954 | version "1.0.2" 955 | resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" 956 | integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= 957 | 958 | os-tmpdir@^1.0.0: 959 | version "1.0.2" 960 | resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" 961 | integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= 962 | 963 | osenv@^0.1.4: 964 | version "0.1.5" 965 | resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" 966 | integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== 967 | dependencies: 968 | os-homedir "^1.0.0" 969 | os-tmpdir "^1.0.0" 970 | 971 | parse5@^5.0.0: 972 | version "5.1.0" 973 | resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.0.tgz#c59341c9723f414c452975564c7c00a68d58acd2" 974 | integrity sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ== 975 | 976 | pascalcase@^0.1.1: 977 | version "0.1.1" 978 | resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" 979 | integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= 980 | 981 | path-dirname@^1.0.0: 982 | version "1.0.2" 983 | resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" 984 | integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= 985 | 986 | path-is-absolute@^1.0.0: 987 | version "1.0.1" 988 | resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" 989 | integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= 990 | 991 | posix-character-classes@^0.1.0: 992 | version "0.1.1" 993 | resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" 994 | integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= 995 | 996 | process-nextick-args@~2.0.0: 997 | version "2.0.0" 998 | resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" 999 | integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== 1000 | 1001 | punycode@^2.1.0: 1002 | version "2.1.1" 1003 | resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" 1004 | integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== 1005 | 1006 | rc@^1.2.7: 1007 | version "1.2.8" 1008 | resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" 1009 | integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== 1010 | dependencies: 1011 | deep-extend "^0.6.0" 1012 | ini "~1.3.0" 1013 | minimist "^1.2.0" 1014 | strip-json-comments "~2.0.1" 1015 | 1016 | readable-stream@^2.0.2, readable-stream@^2.0.6: 1017 | version "2.3.6" 1018 | resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" 1019 | integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== 1020 | dependencies: 1021 | core-util-is "~1.0.0" 1022 | inherits "~2.0.3" 1023 | isarray "~1.0.0" 1024 | process-nextick-args "~2.0.0" 1025 | safe-buffer "~5.1.1" 1026 | string_decoder "~1.1.1" 1027 | util-deprecate "~1.0.1" 1028 | 1029 | readdirp@^2.0.0: 1030 | version "2.2.1" 1031 | resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" 1032 | integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== 1033 | dependencies: 1034 | graceful-fs "^4.1.11" 1035 | micromatch "^3.1.10" 1036 | readable-stream "^2.0.2" 1037 | 1038 | regex-not@^1.0.0, regex-not@^1.0.2: 1039 | version "1.0.2" 1040 | resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" 1041 | integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== 1042 | dependencies: 1043 | extend-shallow "^3.0.2" 1044 | safe-regex "^1.1.0" 1045 | 1046 | remove-trailing-separator@^1.0.1: 1047 | version "1.1.0" 1048 | resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" 1049 | integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= 1050 | 1051 | repeat-element@^1.1.2: 1052 | version "1.1.3" 1053 | resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" 1054 | integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== 1055 | 1056 | repeat-string@^1.6.1: 1057 | version "1.6.1" 1058 | resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" 1059 | integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= 1060 | 1061 | resolve-url@^0.2.1: 1062 | version "0.2.1" 1063 | resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" 1064 | integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= 1065 | 1066 | ret@~0.1.10: 1067 | version "0.1.15" 1068 | resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" 1069 | integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== 1070 | 1071 | rimraf@^2.6.1: 1072 | version "2.6.2" 1073 | resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" 1074 | integrity sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w== 1075 | dependencies: 1076 | glob "^7.0.5" 1077 | 1078 | rxjs@6.3.3: 1079 | version "6.3.3" 1080 | resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz#3c6a7fa420e844a81390fb1158a9ec614f4bad55" 1081 | integrity sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw== 1082 | dependencies: 1083 | tslib "^1.9.0" 1084 | 1085 | safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: 1086 | version "5.1.2" 1087 | resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" 1088 | integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== 1089 | 1090 | safe-regex@^1.1.0: 1091 | version "1.1.0" 1092 | resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" 1093 | integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= 1094 | dependencies: 1095 | ret "~0.1.10" 1096 | 1097 | "safer-buffer@>= 2.1.2 < 3": 1098 | version "2.1.2" 1099 | resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" 1100 | integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== 1101 | 1102 | sax@^1.2.4: 1103 | version "1.2.4" 1104 | resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" 1105 | integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== 1106 | 1107 | semver@^5.3.0: 1108 | version "5.6.0" 1109 | resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" 1110 | integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== 1111 | 1112 | set-blocking@~2.0.0: 1113 | version "2.0.0" 1114 | resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" 1115 | integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= 1116 | 1117 | set-value@^0.4.3: 1118 | version "0.4.3" 1119 | resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" 1120 | integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= 1121 | dependencies: 1122 | extend-shallow "^2.0.1" 1123 | is-extendable "^0.1.1" 1124 | is-plain-object "^2.0.1" 1125 | to-object-path "^0.3.0" 1126 | 1127 | set-value@^2.0.0: 1128 | version "2.0.0" 1129 | resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" 1130 | integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== 1131 | dependencies: 1132 | extend-shallow "^2.0.1" 1133 | is-extendable "^0.1.1" 1134 | is-plain-object "^2.0.3" 1135 | split-string "^3.0.1" 1136 | 1137 | signal-exit@^3.0.0: 1138 | version "3.0.2" 1139 | resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" 1140 | integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= 1141 | 1142 | snapdragon-node@^2.0.1: 1143 | version "2.1.1" 1144 | resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" 1145 | integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== 1146 | dependencies: 1147 | define-property "^1.0.0" 1148 | isobject "^3.0.0" 1149 | snapdragon-util "^3.0.1" 1150 | 1151 | snapdragon-util@^3.0.1: 1152 | version "3.0.1" 1153 | resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" 1154 | integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== 1155 | dependencies: 1156 | kind-of "^3.2.0" 1157 | 1158 | snapdragon@^0.8.1: 1159 | version "0.8.2" 1160 | resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" 1161 | integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== 1162 | dependencies: 1163 | base "^0.11.1" 1164 | debug "^2.2.0" 1165 | define-property "^0.2.5" 1166 | extend-shallow "^2.0.1" 1167 | map-cache "^0.2.2" 1168 | source-map "^0.5.6" 1169 | source-map-resolve "^0.5.0" 1170 | use "^3.1.0" 1171 | 1172 | source-map-resolve@^0.5.0: 1173 | version "0.5.2" 1174 | resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" 1175 | integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== 1176 | dependencies: 1177 | atob "^2.1.1" 1178 | decode-uri-component "^0.2.0" 1179 | resolve-url "^0.2.1" 1180 | source-map-url "^0.4.0" 1181 | urix "^0.1.0" 1182 | 1183 | source-map-url@^0.4.0: 1184 | version "0.4.0" 1185 | resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" 1186 | integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= 1187 | 1188 | source-map@0.7.3: 1189 | version "0.7.3" 1190 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" 1191 | integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== 1192 | 1193 | source-map@^0.5.6: 1194 | version "0.5.7" 1195 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" 1196 | integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= 1197 | 1198 | split-string@^3.0.1, split-string@^3.0.2: 1199 | version "3.1.0" 1200 | resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" 1201 | integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== 1202 | dependencies: 1203 | extend-shallow "^3.0.0" 1204 | 1205 | static-extend@^0.1.1: 1206 | version "0.1.2" 1207 | resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" 1208 | integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= 1209 | dependencies: 1210 | define-property "^0.2.5" 1211 | object-copy "^0.1.0" 1212 | 1213 | string-width@^1.0.1: 1214 | version "1.0.2" 1215 | resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" 1216 | integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= 1217 | dependencies: 1218 | code-point-at "^1.0.0" 1219 | is-fullwidth-code-point "^1.0.0" 1220 | strip-ansi "^3.0.0" 1221 | 1222 | "string-width@^1.0.2 || 2": 1223 | version "2.1.1" 1224 | resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" 1225 | integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== 1226 | dependencies: 1227 | is-fullwidth-code-point "^2.0.0" 1228 | strip-ansi "^4.0.0" 1229 | 1230 | string_decoder@~1.1.1: 1231 | version "1.1.1" 1232 | resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" 1233 | integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== 1234 | dependencies: 1235 | safe-buffer "~5.1.0" 1236 | 1237 | strip-ansi@^3.0.0, strip-ansi@^3.0.1: 1238 | version "3.0.1" 1239 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" 1240 | integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= 1241 | dependencies: 1242 | ansi-regex "^2.0.0" 1243 | 1244 | strip-ansi@^4.0.0: 1245 | version "4.0.0" 1246 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" 1247 | integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= 1248 | dependencies: 1249 | ansi-regex "^3.0.0" 1250 | 1251 | strip-json-comments@~2.0.1: 1252 | version "2.0.1" 1253 | resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" 1254 | integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= 1255 | 1256 | supports-color@^5.3.0: 1257 | version "5.5.0" 1258 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" 1259 | integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== 1260 | dependencies: 1261 | has-flag "^3.0.0" 1262 | 1263 | tar@^4: 1264 | version "4.4.8" 1265 | resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" 1266 | integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== 1267 | dependencies: 1268 | chownr "^1.1.1" 1269 | fs-minipass "^1.2.5" 1270 | minipass "^2.3.4" 1271 | minizlib "^1.1.1" 1272 | mkdirp "^0.5.0" 1273 | safe-buffer "^5.1.2" 1274 | yallist "^3.0.2" 1275 | 1276 | to-object-path@^0.3.0: 1277 | version "0.3.0" 1278 | resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" 1279 | integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= 1280 | dependencies: 1281 | kind-of "^3.0.2" 1282 | 1283 | to-regex-range@^2.1.0: 1284 | version "2.1.1" 1285 | resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" 1286 | integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= 1287 | dependencies: 1288 | is-number "^3.0.0" 1289 | repeat-string "^1.6.1" 1290 | 1291 | to-regex@^3.0.1, to-regex@^3.0.2: 1292 | version "3.0.2" 1293 | resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" 1294 | integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== 1295 | dependencies: 1296 | define-property "^2.0.2" 1297 | extend-shallow "^3.0.2" 1298 | regex-not "^1.0.2" 1299 | safe-regex "^1.1.0" 1300 | 1301 | tslib@^1.7.1, tslib@^1.9.0: 1302 | version "1.9.3" 1303 | resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" 1304 | integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== 1305 | 1306 | typescript@3.2.4, typescript@~3.2.2: 1307 | version "3.2.4" 1308 | resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.4.tgz#c585cb952912263d915b462726ce244ba510ef3d" 1309 | integrity sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg== 1310 | 1311 | union-value@^1.0.0: 1312 | version "1.0.0" 1313 | resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" 1314 | integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= 1315 | dependencies: 1316 | arr-union "^3.1.0" 1317 | get-value "^2.0.6" 1318 | is-extendable "^0.1.1" 1319 | set-value "^0.4.3" 1320 | 1321 | unset-value@^1.0.0: 1322 | version "1.0.0" 1323 | resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" 1324 | integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= 1325 | dependencies: 1326 | has-value "^0.3.1" 1327 | isobject "^3.0.0" 1328 | 1329 | upath@^1.0.5: 1330 | version "1.1.0" 1331 | resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" 1332 | integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw== 1333 | 1334 | uri-js@^4.2.2: 1335 | version "4.2.2" 1336 | resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" 1337 | integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== 1338 | dependencies: 1339 | punycode "^2.1.0" 1340 | 1341 | urix@^0.1.0: 1342 | version "0.1.0" 1343 | resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" 1344 | integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= 1345 | 1346 | use@^3.1.0: 1347 | version "3.1.1" 1348 | resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" 1349 | integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== 1350 | 1351 | util-deprecate@~1.0.1: 1352 | version "1.0.2" 1353 | resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" 1354 | integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= 1355 | 1356 | wide-align@^1.1.0: 1357 | version "1.1.3" 1358 | resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" 1359 | integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== 1360 | dependencies: 1361 | string-width "^1.0.2 || 2" 1362 | 1363 | wrappy@1: 1364 | version "1.0.2" 1365 | resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" 1366 | integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= 1367 | 1368 | yallist@^3.0.0, yallist@^3.0.2: 1369 | version "3.0.3" 1370 | resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" 1371 | integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== 1372 | -------------------------------------------------------------------------------- /src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import {NgModule} from '@angular/core'; 2 | import {Routes, RouterModule} from '@angular/router'; 3 | 4 | const routes: Routes = [ 5 | {path: '', pathMatch: 'full', redirectTo: '/home'}, 6 | { 7 | path: 'home', 8 | loadChildren: './public/home/home.module#HomeModule' 9 | } 10 | ]; 11 | 12 | @NgModule({ 13 | imports: [RouterModule.forRoot(routes)], 14 | exports: [RouterModule] 15 | }) 16 | export class AppRoutingModule { 17 | } 18 | -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/src/app/app.component.scss -------------------------------------------------------------------------------- /src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async(() => { 7 | TestBed.configureTestingModule({ 8 | imports: [ 9 | RouterTestingModule 10 | ], 11 | declarations: [ 12 | AppComponent 13 | ], 14 | }).compileComponents(); 15 | })); 16 | 17 | it('should create the app', () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.debugElement.componentInstance; 20 | expect(app).toBeTruthy(); 21 | }); 22 | 23 | it(`should have as title 'clean-angular'`, () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | const app = fixture.debugElement.componentInstance; 26 | expect(app.title).toEqual('clean-angular'); 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | title = 'clean-angular'; 10 | } 11 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppRoutingModule } from './app-routing.module'; 5 | import { AppComponent } from './app.component'; 6 | import { SharedModule } from './shared/shared.module'; 7 | 8 | @NgModule({ 9 | declarations: [ 10 | AppComponent 11 | ], 12 | imports: [ 13 | SharedModule, 14 | BrowserModule, 15 | AppRoutingModule 16 | ], 17 | providers: [], 18 | bootstrap: [AppComponent] 19 | }) 20 | export class AppModule { } 21 | -------------------------------------------------------------------------------- /src/app/core/base/mapper.ts: -------------------------------------------------------------------------------- 1 | export abstract class Mapper { 2 | abstract mapFrom(param: I): O; 3 | 4 | abstract mapTo(param: O): I; 5 | } 6 | 7 | -------------------------------------------------------------------------------- /src/app/core/base/use-case.ts: -------------------------------------------------------------------------------- 1 | import { Observable } from 'rxjs'; 2 | 3 | export interface UseCase { 4 | execute(params: S): Observable; 5 | } 6 | -------------------------------------------------------------------------------- /src/app/core/core.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { AuthService } from './services/auth.service'; 3 | 4 | @NgModule({ 5 | providers: [ 6 | AuthService 7 | ] 8 | }) 9 | export class CoreModule { 10 | } 11 | -------------------------------------------------------------------------------- /src/app/core/services/auth.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable() 4 | export class AuthService { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/app/domain/elephant/model/elephant.entity.ts: -------------------------------------------------------------------------------- 1 | import { ElephantModel } from './elephant.model'; 2 | import { Observable } from 'rxjs'; 3 | 4 | export abstract class ElephantRepository { 5 | abstract getElephantById(id: number): Observable; 6 | 7 | abstract getAllElephants(): Observable; 8 | } 9 | 10 | export interface ElephantEntity { 11 | id: number; 12 | name: string; 13 | family: string; 14 | birthday: number; 15 | } 16 | -------------------------------------------------------------------------------- /src/app/domain/elephant/model/elephant.model.ts: -------------------------------------------------------------------------------- 1 | export interface ElephantModel { 2 | name: string; 3 | family: string; 4 | birthday: Date; 5 | } 6 | -------------------------------------------------------------------------------- /src/app/domain/elephant/repository/elephant-web.repository.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { ElephantModel } from '../model/elephant.model'; 3 | import { Observable } from 'rxjs'; 4 | import { ElephantWebRepositoryMapper } from './mapper/elephant-web-repository.mapper'; 5 | import { HttpClient } from '@angular/common/http'; 6 | import {ElephantRepository, ElephantEntity} from '../model/elephant.entity'; 7 | import { flatMap, map } from 'rxjs/operators'; 8 | 9 | @Injectable({ 10 | providedIn: 'root' 11 | }) 12 | export class ElephantWebRepository extends ElephantRepository { 13 | 14 | mapper = new ElephantWebRepositoryMapper(); 15 | 16 | constructor( 17 | private http: HttpClient 18 | ) { 19 | super(); 20 | } 21 | 22 | getElephantById(id: number): Observable { 23 | return this.http 24 | .get('http://5b8d40db7366ab0014a29bfa.mockapi.io/api/v1/elephants/${id}') 25 | .pipe(map(this.mapper.mapFrom)); 26 | } 27 | 28 | getAllElephants(): Observable { 29 | return this.http 30 | .get('http://5b8d40db7366ab0014a29bfa.mockapi.io/api/v1/elephants') 31 | .pipe(flatMap((item) => item)) 32 | .pipe(map(this.mapper.mapFrom)); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/app/domain/elephant/repository/mapper/elephant-web-repository.mapper.ts: -------------------------------------------------------------------------------- 1 | import { ElephantEntity } from '../../model/elephant.entity'; 2 | import { ElephantModel } from '../../model/elephant.model'; 3 | import { Mapper } from '../../../../core/base/mapper'; 4 | 5 | export class ElephantWebRepositoryMapper extends Mapper { 6 | mapFrom(param: ElephantEntity): ElephantModel { 7 | return { 8 | name: param.name, 9 | family: param.family, 10 | birthday: new Date(param.birthday) 11 | }; 12 | } 13 | 14 | mapTo(param: ElephantModel): ElephantEntity { 15 | return { 16 | id: 0, 17 | name: param.name, 18 | family: param.family, 19 | birthday: param.birthday.getTime() 20 | }; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/app/domain/elephant/usecases/get-all-elephants.usecase.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Observable } from 'rxjs'; 3 | import { UseCase } from '../../../core/base/use-case'; 4 | import { ElephantModel } from '../model/elephant.model'; 5 | import { ElephantWebRepository } from '../repository/elephant-web.repository'; 6 | 7 | @Injectable({ 8 | providedIn: 'root' 9 | }) 10 | export class GetAllElephantsUsecase implements UseCase { 11 | 12 | constructor(private elephantRepository: ElephantWebRepository) { 13 | } 14 | 15 | execute(params: void): Observable { 16 | return this.elephantRepository.getAllElephants(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/app/domain/elephant/usecases/get-elephant-by-id-usecase.usecase.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Observable } from 'rxjs'; 3 | import { ElephantRepository } from '../model/elephant.entity'; 4 | import { UseCase } from '../../../core/base/use-case'; 5 | import { ElephantModel } from '../model/elephant.model'; 6 | 7 | @Injectable() 8 | export class GetElephantByIdUsecase implements UseCase { 9 | 10 | constructor(private elephantRepository: ElephantRepository) { 11 | } 12 | 13 | execute(params: number): Observable { 14 | return this.elephantRepository.getElephantById(params); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/app/features/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/src/app/features/.gitkeep -------------------------------------------------------------------------------- /src/app/pages/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/src/app/pages/.gitkeep -------------------------------------------------------------------------------- /src/app/presentation/home/home.component.html: -------------------------------------------------------------------------------- 1 |
    2 |
  • {{elephant.family}} - {{elephant.name}}
  • 3 |
4 | -------------------------------------------------------------------------------- /src/app/presentation/home/home.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/src/app/presentation/home/home.component.scss -------------------------------------------------------------------------------- /src/app/presentation/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HomeComponent } from './home.component'; 4 | import { SharedModule } from '../../shared/shared.module'; 5 | import { RouterTestingModule } from '@angular/router/testing'; 6 | import { HttpClientModule } from '@angular/common/http'; 7 | 8 | describe('HomeComponent', () => { 9 | let component: HomeComponent; 10 | let fixture: ComponentFixture; 11 | 12 | beforeEach(async(() => { 13 | TestBed.configureTestingModule({ 14 | imports: [SharedModule, RouterTestingModule, HttpClientModule], 15 | declarations: [ HomeComponent ] 16 | }) 17 | .compileComponents(); 18 | })); 19 | 20 | beforeEach(() => { 21 | fixture = TestBed.createComponent(HomeComponent); 22 | component = fixture.componentInstance; 23 | fixture.detectChanges(); 24 | }); 25 | 26 | it('should create', () => { 27 | expect(component).toBeTruthy(); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /src/app/presentation/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { GetAllElephantsUsecase } from '../../domain/elephant/usecases/get-all-elephants.usecase'; 3 | import { ElephantModel } from '../../domain/elephant/model/elephant.model'; 4 | 5 | @Component({ 6 | selector: 'app-home', 7 | templateUrl: './home.component.html', 8 | styleUrls: ['./home.component.scss'] 9 | }) 10 | export class HomeComponent implements OnInit { 11 | elephants: any[]; 12 | 13 | constructor(private getAllElephants: GetAllElephantsUsecase) { 14 | } 15 | 16 | ngOnInit() { 17 | this.elephants = []; 18 | this.getAllElephants.execute(null).subscribe((value: ElephantModel) => { 19 | this.elephants.push(value); 20 | }); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/app/presentation/home/home.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { HomeComponent } from './home.component'; 3 | import { RouterModule, Routes } from '@angular/router'; 4 | import { SharedModule } from '../../shared/shared.module'; 5 | 6 | const HOME_ROUTER_CONFIG: Routes = [ 7 | { path: '', component: HomeComponent } 8 | ]; 9 | 10 | @NgModule({ 11 | imports: [SharedModule, RouterModule.forChild(HOME_ROUTER_CONFIG)], 12 | declarations: [HomeComponent], 13 | }) 14 | export class HomeModule { 15 | } 16 | -------------------------------------------------------------------------------- /src/app/shared/components/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/src/app/shared/components/.gitkeep -------------------------------------------------------------------------------- /src/app/shared/directives/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/src/app/shared/directives/.gitkeep -------------------------------------------------------------------------------- /src/app/shared/interceptors/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/src/app/shared/interceptors/.gitkeep -------------------------------------------------------------------------------- /src/app/shared/pipes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/src/app/shared/pipes/.gitkeep -------------------------------------------------------------------------------- /src/app/shared/shared.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 4 | import { RouterModule } from '@angular/router'; 5 | import { HttpClientModule } from '@angular/common/http'; 6 | 7 | @NgModule({ 8 | imports: [ 9 | CommonModule, 10 | RouterModule, 11 | FormsModule, 12 | HttpClientModule, 13 | ReactiveFormsModule, 14 | ], 15 | declarations: [], 16 | providers: [ 17 | ], 18 | exports: [ 19 | CommonModule, 20 | FormsModule, 21 | ReactiveFormsModule 22 | ], 23 | entryComponents: [] 24 | }) 25 | export class SharedModule { 26 | } 27 | -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phodal/clean-frontend/fc8519f3020897b098ab924fd8a6c8c057458ac4/src/favicon.ico -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CleanAngular 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function(config) { 5 | config.set({ 6 | basePath: "", 7 | frameworks: ["jasmine", "@angular-devkit/build-angular"], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage/clean-angular'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: true, 30 | restartOnFileChange: true 31 | }); 32 | }; 33 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 22 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 23 | 24 | /** 25 | * Web Animations `@angular/platform-browser/animations` 26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 28 | */ 29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 30 | 31 | /** 32 | * By default, zone.js will patch all possible macroTask and DomEvents 33 | * user can disable parts of macroTask/DomEvents patch by setting following flags 34 | * because those flags need to be set before `zone.js` being loaded, and webpack 35 | * will put import in the top of bundle, so user need to create a separate file 36 | * in this directory (for example: zone-flags.ts), and put the following flags 37 | * into that file, and then add the following code before importing zone.js. 38 | * import './zone-flags.ts'; 39 | * 40 | * The flags allowed in zone-flags.ts are listed here. 41 | * 42 | * The following flags will work for all browsers. 43 | * 44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 46 | * (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 47 | * 48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 50 | * 51 | * (window as any).__Zone_enable_cross_context_check = true; 52 | * 53 | */ 54 | 55 | /*************************************************************************************************** 56 | * Zone JS is required by default for Angular itself. 57 | */ 58 | import 'zone.js/dist/zone'; // Included with Angular CLI. 59 | 60 | 61 | /*************************************************************************************************** 62 | * APPLICATION IMPORTS 63 | */ 64 | -------------------------------------------------------------------------------- /src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "module": "es2015", 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "importHelpers": true, 13 | "target": "es5", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2018", 19 | "dom" 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "tslint:recommended", 3 | "rulesDirectory": [ 4 | "codelyzer" 5 | ], 6 | "rules": { 7 | "array-type": false, 8 | "arrow-parens": false, 9 | "deprecation": { 10 | "severity": "warn" 11 | }, 12 | "import-blacklist": [ 13 | true, 14 | "rxjs/Rx" 15 | ], 16 | "interface-name": false, 17 | "max-classes-per-file": false, 18 | "max-line-length": [ 19 | true, 20 | 140 21 | ], 22 | "member-access": false, 23 | "member-ordering": [ 24 | true, 25 | { 26 | "order": [ 27 | "static-field", 28 | "instance-field", 29 | "static-method", 30 | "instance-method" 31 | ] 32 | } 33 | ], 34 | "no-consecutive-blank-lines": false, 35 | "no-console": [ 36 | true, 37 | "debug", 38 | "info", 39 | "time", 40 | "timeEnd", 41 | "trace" 42 | ], 43 | "no-empty": false, 44 | "no-inferrable-types": [ 45 | true, 46 | "ignore-params" 47 | ], 48 | "no-non-null-assertion": true, 49 | "no-redundant-jsdoc": true, 50 | "no-switch-case-fall-through": true, 51 | "no-use-before-declare": true, 52 | "no-var-requires": false, 53 | "object-literal-key-quotes": [ 54 | true, 55 | "as-needed" 56 | ], 57 | "object-literal-sort-keys": false, 58 | "ordered-imports": false, 59 | "quotemark": [ 60 | true, 61 | "single" 62 | ], 63 | "trailing-comma": false, 64 | "no-output-on-prefix": true, 65 | "use-input-property-decorator": true, 66 | "use-output-property-decorator": true, 67 | "use-host-property-decorator": true, 68 | "no-input-rename": true, 69 | "no-output-rename": true, 70 | "use-life-cycle-interface": true, 71 | "use-pipe-transform-interface": true, 72 | "component-class-suffix": true, 73 | "directive-class-suffix": true 74 | } 75 | } 76 | --------------------------------------------------------------------------------