Skip to content

Commit

Permalink
chore(angular): change README and scripts (#552)
Browse files Browse the repository at this point in the history
  • Loading branch information
hullis authored Nov 29, 2022
1 parent 947c72e commit dba0635
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 135 deletions.
119 changes: 0 additions & 119 deletions packages/icons-angular/README.md

This file was deleted.

1 change: 1 addition & 0 deletions packages/icons-angular/README.md
Binary file removed packages/icons-angular/demo.png
Binary file not shown.
3 changes: 2 additions & 1 deletion packages/icons-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"lint": "ng lint",
"test": "ng test --no-watch --no-progress --browsers=ChromeHeadlessCI --code-coverage",
"build": "ng build examples --configuration production",
"build:lib": "npm run generate && ng build ant-design-icons-angular --configuration production && npm run copy:assets",
"build:lib": "npm run clean && npm run generate && ng build ant-design-icons-angular --configuration production && npm run copy:assets",
"clean": "cross-env TS_NODE_PROJECT=scripts/tsconfig.json node --require ts-node/register scripts/clean.ts",
"generate": "cross-env TS_NODE_PROJECT=scripts/tsconfig.json node --require ts-node/register scripts/generate.ts",
"copy:assets": "cross-env node --require ts-node/register scripts/copy.ts",
"ci": "npm run build:lib"
Expand Down
9 changes: 9 additions & 0 deletions packages/icons-angular/scripts/clean.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const fs = require('fs-extra');
const path = require('path');

function clean() {
const iconDist = path.resolve(__dirname, '../dist/icons');
fs.removeSync(iconDist);
}

clean();
4 changes: 2 additions & 2 deletions packages/icons-angular/scripts/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const fs = require('fs-extra');
const path = require('path');

function copyAssets() {
const from = path.resolve(__dirname, '../src');
const to = path.resolve(__dirname, '../dist/icons/src');
const from = path.resolve(__dirname, '../src/inline-svg');
const to = path.resolve(__dirname, '../dist/icons/src/inline-svg');
fs.copy(from, to);
}

Expand Down
17 changes: 4 additions & 13 deletions packages/icons-angular/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Ant Design Icons for Angular

</div>

> With a better taste.
![](./demo.png)

## Installation

Expand Down Expand Up @@ -83,28 +83,19 @@ Please checkout the demo for more details.

## Development

This package, unlike `@ant-design/icons-react`, does not list `@ant-design/icons` as a dependency. It has its own build up tooling chain which brings benefits like:

* **Tree shake**.
* Providing dynamic and static loading.
* Reduced bundle size (500KB less if you only use dynamic loading).
* Better performance because of no `svg => abstract node => svg` process.
You can find the source code [here](https://github.com/ant-design/ant-design-icons).

### Setup

Install dependencies of `@ant-design/icons-angular`, and run `npm run generate`.

### Demo

Run `ng serve` after `npm run generate`.
Run `npm run generate` and then `npm run start`.

### Build

Build the library by running the script we provide.

```bash
$ ./build.sh
```
Run `npm run build:lib`.

### Extension

Expand Down

0 comments on commit dba0635

Please sign in to comment.