Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(angular): change README and scripts #552

Merged
merged 3 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore(angular): change README and scripts
  • Loading branch information
Wenzhao Hu committed Nov 29, 2022
commit 3f3048edc284f708746b46b7c95aa0a0a7f6e950
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
10 changes: 10 additions & 0 deletions packages/icons-angular/scripts/clean.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const fs = require('fs-extra');
const path = require('path');

function clean() {
const iconDist = path.resolve(__dirname, '../dist/icons');
console.log(iconDist);
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 start` after `npm run generate`.

### Build

Build the library by running the script we provide.

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

### Extension

Expand Down