Skip to content

Commit

Permalink
ci(npm): update production package and CI/CD scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
simeonoff committed Apr 27, 2023
1 parent b1db257 commit 6a194d3
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3

- name: Install packages
run: npm ci
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
node-version: 18
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

Expand All @@ -31,10 +31,10 @@ jobs:
- name: Create package version
run: npm version ${VERSION} --no-git-tag-version --save --allow-same-version
working-directory: ./
working-directory: dist

- name: Publish material-icons-extended
run: npm publish --tag ${NPM_TAG}
working-directory: ./
working-directory: dist
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ To use the CSS classes, import the main the CSS sprite file in your app (verify

```html
<link
href="../node_modules/@igniteui/material-icons-extended/dist/styles/sprite.css"
href="../node_modules/@igniteui/material-icons-extended/styles/sprite.css"
rel="stylesheet"
/>
```
Expand All @@ -122,7 +122,7 @@ To take advantage of the included mixins, import the corresponding sprite.(scss|
With Sass, in your main Sass file import:

```scss
@use '@igniteui/material-icons-extended/dist/styles/sprite.scss' as *;
@use '@igniteui/material-icons-extended/styles/sprite.scss' as *;

.github-icon {
@include imx-icon('github');
Expand All @@ -132,7 +132,7 @@ With Sass, in your main Sass file import:
With Less:

```less
@import '@igniteui/material-icons-extended/dist/styles/sprite.less';
@import '@igniteui/material-icons-extended/styles/sprite.less';

.github-icon {
.imx-icon('github');
Expand All @@ -142,7 +142,7 @@ With Less:
With Stylus:

```stylus
@import '@igniteui/material-icons-extended/dist/styles/sprite.styl'
@import '@igniteui/material-icons-extended/styles/sprite.styl'
.github-icon
imx-icon('github')
Expand All @@ -156,7 +156,7 @@ Then in an HTML file:

#### Symbols

The package also includes an SVG sprite with all icons listed as `<symbol>` elements. This sprite can be imported from `@igniteui/material-icons-extended/dist/assets/sprite.symbol.svg`;
The package also includes an SVG sprite with all icons listed as `<symbol>` elements. This sprite can be imported from `@igniteui/material-icons-extended/assets/sprite.symbol.svg`;
Once you add the image to your application, you can use the encapsulated symbols like this:

In your HTML:
Expand All @@ -177,7 +177,7 @@ In your CSS:

#### Standalone SVG images:

All SVG icons can be found in `@igniteui/material-icons-extended/dist/assets/svgs`;
All SVG icons can be found in `@igniteui/material-icons-extended/assets/svgs`;

### Requests

Expand All @@ -186,4 +186,4 @@ Feel free to use the issue tracker to request new icons.
### Where is the web font?

After some internal discussions and research, we've decided not to include a web font.
There are various reasons for this decision, the main one being accesibility. SVG should be well supported across all modern browsers.
There are various reasons for this decision, the main one being accessibility. SVG should be well supported across all modern browsers.
39 changes: 39 additions & 0 deletions _package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "@igniteui/material-icons-extended",
"description": "A subset of Material Icons that extend the official Material Design Icons by Google.",
"author": "Infragistics",
"license": "MIT",
"version": "3.0.0",
"type": "module",
"main": "index.js",
"exports": {
".": "./index.js",
"./migrations/*": {
"default": "./migrations/*"
},
"./package.json": {
"default": "./package.json"
}
},
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/IgniteUI/material-icons-extended.git"
},
"publishConfig": {
"access": "public"
},
"keywords": [
"icons",
"material",
"infragistics",
"igniteui"
],
"bugs": {
"url": "https://github.com/IgniteUI/material-icons-extended/issues"
},
"homepage": "https://github.com/IgniteUI/material-icons-extended#readme",
"ng-update": {
"migrations": "./migrations/migration.json"
}
}
3 changes: 1 addition & 2 deletions migrations/migration.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
"schematics": {
"migration-01": {
"version": "2.0.0-beta",
"version": "3.0.0",
"description": "Updates IgniteUI Material Icons Extended to the latest version.",
"factory": "./base-migration"
}
Expand Down
2 changes: 1 addition & 1 deletion migrations/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"module": "CommonJS",
"sourceMap": false,
"declaration": true,
"outDir": "../build/migrations/base-migration/"
"outDir": "../dist/migrations/base-migration/"
}
}
38 changes: 9 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,30 @@
{
"name": "@igniteui/material-icons-extended",
"version": "3.0.0",
"description": "A subset of Material Icons that extend the official Material Design Icons by Google.",
"author": "Infragistics",
"license": "MIT",
"version": "3.0.0",
"type": "module",
"scripts": {
"build": "npm run build:a11y && vite build",
"build:a11y": "npm run clean:tmp && node scripts/a11y.mjs",
"build:migrations": "gulp copyMigrations && tsc --listEmittedFiles --project ./migrations/tsconfig.json",
"build": "npm run clean && npm run build:a11y && vite build && npm run build:migrations",
"build:a11y": "node scripts/a11y.mjs",
"build:migrations": "tsc --listEmittedFiles --project ./migrations/tsconfig.json",
"clean": "npm run clean:dist && npm run clean:tmp",
"clean:dist": "rimraf ./dist",
"clean:tmp": "rimraf ./.tmp"
},
"workspaces": [
"./vite-plugins/*"
],
"main": "dist/index.js",
"files": [
"dist"
],
"exports": {
".": "./dist/index.js",
"./build/migrations/*": {
"default": "./dist/migrations/*"
},
"./package.json": {
"default": "./package.json"
}
},
"typesVersion": {
"*": {
"*": [
"dist/*"
]
}
},
"types": "dist/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/IgniteUI/material-icons-extended.git"
},
"publishConfig": {
"access": "public"
},
"keywords": [
"icons",
"material"
],
"author": "Infragistics",
"license": "MIT",
"bugs": {
"url": "https://github.com/IgniteUI/material-icons-extended/issues"
},
Expand Down
19 changes: 18 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,24 @@ export default defineConfig({
viteStaticCopy({
targets: [
{
src: 'migrations',
src: 'migrations/migration.json',
dest: 'migrations',
},
{
src: 'migrations/package.json',
dest: 'migrations',
},
{
src: 'README.md',
dest: './',
},
{
src: 'LICENSE',
dest: './',
},
{
src: '_package.json',
rename: 'package.json',
dest: './',
},
],
Expand Down

0 comments on commit 6a194d3

Please sign in to comment.