Skip to content

Commit

Permalink
fix yfm transform null input problem and repair lint (#41)
Browse files Browse the repository at this point in the history
* fix yfm transform null import problem and repair lint
  • Loading branch information
gorgeousvlad authored and GitHub Enterprise committed Jan 11, 2022
1 parent c17e323 commit bbcb107
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 37 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
/eslint-plugin-local
/build
/storybook-static
/server
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@

# Build
build/
server/
storybook-static/
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,42 @@
# Лог изменений

## 0.1.4

- Глобально определенные стили перенесены в компоненты

## 0.1.1

- Исправлены отступы от картинки в cards-with-image

## 0.1.0

- Добавлен блок с фото cards-with-image

## 0.0.10

- Добавлены фиксы стилей темной темы баннера

## 0.0.8

- Добавлены фиксы стилей yfm и обновления компонентов из cloud-www

## 0.0.5

- Добавлен миксин для задания специфичности стилей. Пофикшены ошибки,
связанные с порядком подключения стилей
связанные с порядком подключения стилей

## 0.0.4

- Поправлены отступы для вложенных сеток

## 0.0.3

- Добавлено свойство колонки сетки, которое позволяет сбросить отступы

## 0.0.2

- Добавлены переменные стилей для шрифтов. Поправлен класс компонента `PageConstructor`

## 0.0.1

- Добавлена первая версия конструктора страниц
25 changes: 10 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
```jsx
import {PageConstructor} from '@yandex-data-ui/page-constructor';

const Page: React.FC<PageProps> = ({content}) => (
<PageConstructor content={content}/>
);
const Page: React.FC<PageProps> = ({content}) => <PageConstructor content={content} />;
```

### Параметры
Expand Down Expand Up @@ -75,6 +73,7 @@ interface Metrika = {
}

```

### Пользователькие блоки

Конструктор страниц поддерживает возможность работы с блоками, определенными пользователем в его приложении. Блоки представляют собой обычные реакт-компоненты.
Expand Down Expand Up @@ -103,8 +102,8 @@ interface Metrika = {

```typescript
export interface LoadableConfigItem {
fetch: FetchLoadableData; // функция загрузки данных
component: React.ComponentType; //блок, в который нужно передать загруженные данные
fetch: FetchLoadableData; // функция загрузки данных
component: React.ComponentType; //блок, в который нужно передать загруженные данные
}

type FetchLoadableData<TData = any> = (blockKey: string) => Promise<TData>;
Expand All @@ -117,19 +116,15 @@ type FetchLoadableData<TData = any> = (blockKey: string) => Promise<TData>;
Пример использования:

```jsx

import {Grid, Row, Col} from '@yandex-data-ui/page-constructor/'
import {Grid, Row, Col} from '@yandex-data-ui/page-constructor/';

const Page: React.FC<PageProps> = ({children}) => (
<Grid>
<Row>
<Col sizes={{lg: 4, sm: 6, all: 12}}>
{children}
</Col>
</Row>
</Grid>
<Grid>
<Row>
<Col sizes={{lg: 4, sm: 6, all: 12}}>{children}</Col>
</Row>
</Grid>
);

```

### Блоки
Expand Down
12 changes: 4 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@
"scripts": {
"deps:install": "npm ci",
"deps:truncate": "npm prune --production",
"lint:js": "eslint .",
"lint:styles": "stylelint ./styles/**/*.scss ./src/**/*.scss",
"lint:prettier": "prettier --check '**/*.{js,jsx,ts,tsx,scss}'",
"lint:fix": "run-s lint:js:fix lint:styles:fix lint:prettier:fix typecheck",
"lint:js": "eslint '**/*.{js,jsx,ts,tsx}' --max-warnings=0",
"lint:js:fix": "eslint '**/*.{js,jsx,ts,tsx}' --max-warnings=0 --quiet --fix",
"lint:styles": "stylelint **/*.scss -s scss",
"lint:styles:fix": "stylelint **/*.scss -s scss --fix",
"lint:prettier": "prettier --check '**/*.{js,jsx,ts,tsx,css,scss,json,yaml,yml,md}'",
"lint:prettier:fix": "prettier --write '**/*.{js,jsx,ts,tsx,css,scss,json,yaml,yml,md}'",
"lint": "npm-run-all --parallel lint:*",
"typecheck": "tsc --noEmit",
"dev": "npm run storybook:start",
Expand Down
4 changes: 2 additions & 2 deletions src/containers/PageConstructor/PageConstructor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ import {
getCustomBlockV2Types,
getCustomComponents,
getCustomHeaderTypes,
block,
block as cnBlock,
} from '../../utils';

import './PageConstructor.scss';
import '../../../styles/yfm.scss';

const b = block('page-constructor');
const b = cnBlock('page-constructor');

export interface PageConstructorProps {
content?: PageContent;
Expand Down
2 changes: 1 addition & 1 deletion src/text-transform/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function typografToText(text: string, lang: Lang) {
}

export const transformMarkdown = (input: string, options: Options) => {
const {result} = transformYFM(input, {
const {result} = transformYFM(input || '', {
...options,
});

Expand Down
4 changes: 1 addition & 3 deletions tsconfig.publish.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
"compilerOptions": {
"paths": {}
},
"exclude": [
"src/stories",
]
"exclude": ["src/stories"]
}
6 changes: 2 additions & 4 deletions tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
"baseUrl": ".",
"paths": {
"*": ["./node_modules/*"]
},
}
},
"include": [
"src/server.ts",
],
"include": ["src/server.ts"]
}

0 comments on commit bbcb107

Please sign in to comment.