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

Rewrite package on typescript #23

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Rewrite package on typescript #23

wants to merge 4 commits into from

Conversation

OldSkyTree
Copy link
Contributor

No description provided.

lib/lazy.ts Outdated Show resolved Hide resolved
lib/lazy.ts Outdated Show resolved Hide resolved
lib/core.ts Show resolved Hide resolved
@OldSkyTree
Copy link
Contributor Author

Запушил с переименованием файлов, теперь если смотреть по коммитам, то можно смотреть только на изменения, а не на весь файл

@OldSkyTree OldSkyTree force-pushed the FEI-17917 branch 3 times, most recently from 2d637b1 to fda2f4b Compare September 12, 2022 19:28
@@ -8,6 +8,7 @@ Config is described with a combination of a functions:
var parser = root(section({
system: section({
parallelLimit: option({
defaultValue: 0,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 – не самый удачный пример дефолта. Кстати, в гермионе у этой опции дефолт Infinity.

class UnknownKeysError extends Error {
constructor(keys) {
export class UnknownKeysError extends Error {
keys: Array<string>;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А это зачем?


export interface Locator<Options> extends Node<Options> {
nested<Key extends keyof Options>(key: Key): Locator<Options[Key]>;
resetOption(newOption: Options): Locator<Options>;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Как-то не вяжется, что аргумент называется newOption, а тип Options – во множественном числе (как будто это массив).

},
"dependencies": {
"lodash": "^4.17.4"
},
"scripts": {
"build": "tsc --build",
"prepublishOnly": "npm run build",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь тоже вопрос, почему prepublishOnly, а не prepack?

https://github.com/gemini-testing/hermione-storybook/blob/master/package.json#L16

@xrsd
Copy link

xrsd commented Nov 3, 2022

Кстати, еще вопрос: а не надо переименовывать папку lib в src?

Copy link
Member

@DudaGod DudaGod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В PR "Rewrite package on typescript" ожидаешь увидеть полный переезд на TS. Но при этом тесты остались на js. И структура пакета отличается от привычной в TS. Давай это исправим.

extends: 'gemini-testing',
extends: ['gemini-testing', 'plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
root: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Немного странная последовательность опций. Я бы в такой последовательности описывал - https://github.com/gemini-testing/hermione-storybook/blob/master/.eslintrc.js

{
"extends": "@tsconfig/recommended/tsconfig.json",
"include": ["lib"],
"exclude": ["build", "test"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Странный exclude. У тебя же эти папки в include не попадают вообще.

Ну и почему сразу не сделать по нормальному? Т.е. не переименовать lib в src и в этот же src положить тесты?

},
"dependencies": {
"lodash": "^4.17.4"
},
"scripts": {
"build": "tsc --build",
"prepublishOnly": "npm run build",
"pretest": "npm run build",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем на каждый test запускать сборку?

@@ -0,0 +1,15 @@
{
"extends": "@tsconfig/recommended/tsconfig.json",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А что ты используешь из этого конфига то? Кажется, что он вообще не нужен

"compilerOptions": {
"target": "ES2019",
"outDir": "build",
"allowJs": true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ты же пакет переписал на ts. Зачем тут эта опция?

"include": ["lib"],
"exclude": ["build", "test"],
"compilerOptions": {
"target": "ES2019",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А какие ты фичи юзаешь из es2019? Спрашиваю так как обычно используем es2017

@@ -3,4 +3,5 @@ node_js:
- '6'
- '8'
script:
- npm build
- npm test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А здесь у тебя за счет pretest получится двойной запуск build скрипта.

}

/* eslint-disable @typescript-eslint/no-explicit-any */
export interface OptionParserConfig<Value, MappedValue, Result = any> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не понял а для чего ты тут столько any налупил? Давай хотя бы unknown юзать.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants