Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
35 changes: 28 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,43 @@ npm i @evotor-dev/ui-kit

Add ui-kit styles to angular.json

```json
```jsonc
"styles": [
...
//...
"node_modules/@evotor-dev/ui-kit/styles/main.scss",
...
//...
],
```

Add ui-kit assets to angular.json

```json
```jsonc
"assets": [
...
//...
{
"glob": "**/*",
"input": "./node_modules/@evotor-dev/ui-kit/assets/",
"output": "assets/ui-kit/" // if you use a different output path, register it using evoAssetsPathProvider
"output": "/assets/ui-kit/" // if you use a different output path, register it using evoAssetsPathProvider
},
// The ui kit uses icons from https://github.com/evotor/evo-icons, so you need to register the icons in angular.json of your project:
{
"glob": "**/*",
"input": "./node_modules/@evotor-dev/evo-icons/dist/monochrome",
"output": "/assets/ui-kit/icons"
},
{
"glob": "**/*",
"input": "./node_modules/@evotor-dev/evo-icons/dist/color",
"output": "/assets/ui-kit/color-icons"
}
...
//...
]
```

### Icons

The icons live in a separate repository [evo-icons](https://github.com/evotor/evo-icons) and the ui-kit refers to them as peer dependencies, so you need to install the icon library in your project: `npm i @evotor-dev/evo-icons`

### Troubleshooting

If you have password on your ssh key, [add it to ssh-agent](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/#adding-your-ssh-key-to-the-ssh-agent).
Expand All @@ -53,6 +68,8 @@ Host github.com

`npm ci`

**Note**: evo-icons must be devDependency in order not to be included in the build output. Also, do not include them as assets in the angular.json for build.

### Development server

`npm run storybook`
Expand All @@ -76,3 +93,7 @@ Run `npm run build` to build the ui kit. The build artifacts will be stored in t
### Running unit tests

Run `npm run test:local`.

```

```
25 changes: 15 additions & 10 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@
"src/assets",
{
"glob": "**/*",
"input": "projects/evo-ui-kit/icons",
"input": "./node_modules/@evotor-dev/evo-icons/dist/monochrome",
"output": "assets/ui-kit/icons"
},
{
"glob": "**/*",
"input": "./node_modules/@evotor-dev/evo-icons/dist/color",
"output": "assets/ui-kit/color-icons"
}
],
"styles": [
Expand Down Expand Up @@ -122,13 +127,13 @@
"assets": [
{
"glob": "**/*",
"input": "projects/evo-ui-kit/icons",
"input": "./node_modules/@evotor-dev/evo-icons/dist/monochrome",
"output": "assets/ui-kit/icons"
},
{
"glob": "**/*",
"input": "projects/evo-ui-kit/generated/assets",
"output": "assets/ui-kit"
"input": "./node_modules/@evotor-dev/evo-icons/dist/color",
"output": "assets/ui-kit/color-icons"
}
]
}
Expand All @@ -154,13 +159,13 @@
"assets": [
{
"glob": "**/*",
"input": "projects/evo-ui-kit/icons",
"input": "./node_modules/@evotor-dev/evo-icons/dist/monochrome",
"output": "assets/ui-kit/icons"
},
{
"glob": "**/*",
"input": "projects/evo-ui-kit/generated/assets",
"output": "assets/ui-kit"
"input": "./node_modules/@evotor-dev/evo-icons/dist/color",
"output": "assets/ui-kit/color-icons"
}
],
"port": 9001,
Expand All @@ -181,13 +186,13 @@
"assets": [
{
"glob": "**/*",
"input": "projects/evo-ui-kit/icons",
"input": "./node_modules/@evotor-dev/evo-icons/dist/monochrome",
"output": "assets/ui-kit/icons"
},
{
"glob": "**/*",
"input": "projects/evo-ui-kit/generated/assets",
"output": "assets/ui-kit"
"input": "./node_modules/@evotor-dev/evo-icons/dist/color",
"output": "assets/ui-kit/color-icons"
}
],
"compodoc": false
Expand Down
39 changes: 1 addition & 38 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,8 @@ const url = require('postcss-url');
const fs = require('fs');
const path = require('path');
const childProcess = require('child_process');
const {buildColorIcons, buildMonochromeIcons} = require('./scripts/gulp-icons-build');

const {
DIST_PATH,
SRC_PATH,
STORYBOOK_DIST_PATH,
STORYBOOK_SRC_PATH,
GENERATED_DIR,
ICONS_PATH,
} = require('./scripts/gulp-config');
const {DIST_PATH, SRC_PATH} = require('./scripts/gulp-config');

const postcssOptions = {
parser: parser,
Expand All @@ -40,16 +32,6 @@ const buildUIKit = () => {
return childProcess.execSync('ng build evo-ui-kit --configuration production', {stdio: 'inherit'});
};

const copyGeneratedAssets = (cb) => {
gulp.src(path.join(GENERATED_DIR, 'assets/**/*')).pipe(gulp.dest(path.join(DIST_PATH, 'assets')));
return cb();
};

const copyIconsAssets = (cb) => {
gulp.src(path.join(ICONS_PATH, '**/*')).pipe(gulp.dest(path.join(DIST_PATH, 'assets/icons')));
return cb();
};

const copyReadme = (cb) => fs.copyFile(path.join(__dirname, 'README.md'), path.join(DIST_PATH, 'README.md'), cb);

const copyReleaserc = () =>
Expand All @@ -62,28 +44,9 @@ const buildStorybook = (cb) => {

gulp.task('storybook', gulp.series(buildStorybook));

gulp.task('buildMonochromeIcons', (cb) => {
buildMonochromeIcons();
return cb();
});

gulp.task('buildColorIcons', (cb) => {
buildColorIcons();
return cb();
});

gulp.task('copyGeneratedAssets', (cb) => {
copyGeneratedAssets(cb);
return cb();
});

gulp.task('default', (cb) => {
buildMonochromeIcons();
buildColorIcons();
buildUIKit();
inlineURL();
copyReleaserc();
copyReadme(cb);
copyGeneratedAssets(cb);
copyIconsAssets(cb);
});
Loading
Loading