diff --git a/README.md b/README.md index 25ea4ae..8eda44a 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ ngx-weui ## Version - WeUI 1.x using `7.0.x` -- WeUI 2.x using `7.1.x` +- WeUI 2.x using `7.1.0-rc.x` (in next version) ## Table of Contents @@ -58,7 +58,9 @@ cd demo 3. add `ngx-weui` ```bash -ng add ngx-weui +ng add ngx-weui@next +# Using WeUI 1.x +# ng add ngx-weui ``` > please refer to more [details](https://github.com/cipchk/ngx-weui/blob/master/docs/how.md). diff --git a/components/ngx-weui.module.ts b/components/ngx-weui.module.ts index a322959..c730349 100644 --- a/components/ngx-weui.module.ts +++ b/components/ngx-weui.module.ts @@ -56,7 +56,8 @@ export * from 'ngx-weui/mask'; export * from 'ngx-weui/rating'; export * from 'ngx-weui/stepper'; export * from 'ngx-weui/pagination'; -export * from 'ngx-weui/version'; + +export * from './version'; @NgModule({ exports: [ diff --git a/components/package.json b/components/package.json index 6d29065..b0b8b1b 100644 --- a/components/package.json +++ b/components/package.json @@ -1,7 +1,7 @@ { "name": "ngx-weui", "version": "0.0.0-PLACEHOLDER", - "description": "weui for angular", + "description": "WeUI for angular", "repository": { "type": "git", "url": "git+https://github.com/cipchk/ngx-weui.git" @@ -18,7 +18,8 @@ "angular weui", "angular2 weui", "angular4 weui", - "weui" + "weui", + "weui 2" ], "author": "cipchk ", "license": "MIT", diff --git a/components/schematics/shell/index.ts b/components/schematics/shell/index.ts index 7186ef5..478a675 100644 --- a/components/schematics/shell/index.ts +++ b/components/schematics/shell/index.ts @@ -13,6 +13,7 @@ export default function(options: Schema): Rule { addThemeToAppStyles(options), addWeUIRootConfig(options), addAnimationRootConfig(options), + updateAppPage(options), ]); } @@ -30,7 +31,7 @@ function addWeUIRootConfig(options: Schema) { const workspace = getWorkspace(host); const project = getProjectFromWorkspace(workspace, options.project); - addModuleImportToRootModule(host, 'WeUiModule.forRoot()', 'ngx-weui', project); + addModuleImportToRootModule(host, 'WeUiModule', 'ngx-weui', project); return host; }; @@ -47,3 +48,34 @@ function addAnimationRootConfig(options: Schema) { return host; }; } + +const appHTML = `
+

+ ngx-weui +

+

+ ngx-weui 是 WeUI 的 Angular 版本, + WeUI + 是一套同微信原生视觉体验一致的基础样式库,由微信官方设计团队为微信内网页和微信小程序量身设计,令用户的使用感知更加统一。 +

+

+

+
+ +
+
+`; + +function updateAppPage(options: Schema) { + return (host: Tree) => { + const workspace = getWorkspace(host); + const project = getProjectFromWorkspace(workspace, options.project) as any; + + const appHTMLFile = `${project.sourceRoot}/app/app.component.html`; + if (host.exists(appHTMLFile)) { + host.overwrite(appHTMLFile, appHTML); + } + + return host; + }; +} diff --git a/components/schematics/shell/theming.ts b/components/schematics/shell/theming.ts index e05b29a..5ca9e48 100644 --- a/components/schematics/shell/theming.ts +++ b/components/schematics/shell/theming.ts @@ -1,7 +1,7 @@ import { SchematicsException, Tree } from '@angular-devkit/schematics'; import { getStylesPath } from '../utils/ast'; import { InsertChange } from '../utils/devkit-utils/change'; -import { getProjectFromWorkspace, getWorkspace, Project, Workspace } from '../utils/devkit-utils/config'; +import { getProjectFromWorkspace, getWorkspace, Project } from '../utils/devkit-utils/config'; import { createCustomTheme } from './custom-theme'; import { Schema } from './schema'; diff --git a/package.json b/package.json index 0344cc5..c13b6f5 100644 --- a/package.json +++ b/package.json @@ -1,20 +1,16 @@ { "name": "ngx-weui", - "version": "7.0.0", - "description": "weui for angular", + "version": "7.1.0-rc.1", + "description": "WeUI for angular", "repository": { "type": "git", "url": "git+https://github.com/cipchk/ngx-weui.git" }, "keywords": [ "ngx-weui", - "ng2-weui", - "ngx weui", - "ng2 weui", "angular weui", - "angular2 weui", - "angular4 weui", - "weui" + "weui", + "weui 2" ], "author": "cipchk ", "license": "MIT", @@ -31,7 +27,8 @@ "site:build:netlify": "npm run site:init && ng build --prod --build-optimizer --base-href /", "site:gh": "npm run site:build && gh-pages -d ./dist", "build": "bash scripts/build/build.sh", - "release": "npm run build && cd publish && npm publish --access public" + "release": "npm run build && cd publish && npm publish --access public", + "release:next": "npm run build && cd publish && npm publish --access public --tag next" }, "dependencies": { "@angular/animations": "~7.2.0",