Skip to content

Commit

Permalink
Merge pull request #80 from sima-land/79-new-icons
Browse files Browse the repository at this point in the history
Шаг 1 #79 Добавить новые иконки в библиотеку
  • Loading branch information
krutoo authored Jun 28, 2024
2 parents a4a48de + 45e496f commit ed040eb
Show file tree
Hide file tree
Showing 24 changed files with 3,095 additions and 1,519 deletions.
15 changes: 8 additions & 7 deletions .build/utils.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import path from 'node:path';
import glob from 'fast-glob';
import { readFile, outputFile } from 'fs-extra';
import fs from 'fs-extra';
import { transform } from '@svgr/core';
import { camelCase, upperFirst } from 'lodash';
import lodash from 'lodash';
import { optimize, Config as SVGOConfig } from 'svgo';
import { svgoConfig, svgoConfigColorful, svgrConfig } from './configs';
import { svgoConfig, svgoConfigColorful, svgrConfig } from './configs.js';

const { camelCase, upperFirst } = lodash;

export interface IconDefined {
svgSourcePath: string;
Expand Down Expand Up @@ -121,7 +122,7 @@ export function defineExportsItem(ctx: OutputDefined): ExportItemDefined {
async function readSVG(ctx: OutputDefined): Promise<SVGRead> {
return {
...ctx,
svgSourceRaw: await readFile(ctx.svgSourcePath, 'utf-8'),
svgSourceRaw: await fs.readFile(ctx.svgSourcePath, 'utf-8'),
};
}

Expand Down Expand Up @@ -153,8 +154,8 @@ async function generateTSX(ctx: SVGOptimized): Promise<TSXGenerated> {

async function outputSvgAndTsx(ctx: TSXGenerated): Promise<TSXGenerated> {
await Promise.all([
outputFile(ctx.svgOutputPath, ctx.svgSourceOptimized),
outputFile(ctx.tsxOutputPath, ctx.tsxSource),
fs.outputFile(ctx.svgOutputPath, ctx.svgSourceOptimized),
fs.outputFile(ctx.tsxOutputPath, ctx.tsxSource),
]);

return { ...ctx };
Expand Down
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ module.exports = {
'require-jsdoc': 'off',
'jsdoc/require-jsdoc': 'off',
'no-console': 'off',
'lodash/import-scope': 'off',
},
};
6 changes: 3 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Install and Build
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
registry-url: https://registry.npmjs.org/

- uses: ./.github/actions/publish-notify
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/s3-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
publish-s3:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Build
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
registry-url: https://registry.npmjs.org/

- name: Install dependencies
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ node_modules
dist
temp
.vscode
.tsimp

# npm pack default output
sima-land-ui-quarks-0.0.0.tgz
1 change: 0 additions & 1 deletion .prettierrc.js

This file was deleted.

1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@sima-land/linters/prettier"
8 changes: 5 additions & 3 deletions docs/.build/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import path from 'node:path';
import { camelCase, upperFirst } from 'lodash';
import { readFile } from 'fs-extra';
import lodash from 'lodash';
import fs from 'fs-extra';

const { camelCase, upperFirst } = lodash;

interface IconInfo {
identifier: string;
Expand All @@ -10,7 +12,7 @@ interface IconInfo {
}

export async function defineIcons() {
const { exports } = JSON.parse(await readFile('../package.json', 'utf-8'));
const { exports } = JSON.parse(await fs.readFile('../package.json', 'utf-8'));

const result: IconInfo[] = [];

Expand Down
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
generated
.tsimp
node_modules
Loading

0 comments on commit ed040eb

Please sign in to comment.