-
Notifications
You must be signed in to change notification settings - Fork 62
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
feat: get rid of typings re-write main parts of the package in typescript #766
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env node | ||
'use strict'; | ||
|
||
var cli = require('../build/cli').run(); | ||
var cli = require('../build/src/cli').run(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. А для чего у нас внутри There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. А что в этом плохого? Рома тоже спрашивал этот момент. Такие поинты:
Поэтому оставил так. Однако я всегда открыт для предложений и готов поменять этот момент. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Да, src там появилась потому что появился импорт, который идет вне src. Разницы никакой нет, поэтому предлагаю не заморачиваться |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,13 @@ | |
"name": "hermione", | ||
"version": "7.1.0", | ||
"description": "Tests framework based on mocha and wdio", | ||
"main": "build/hermione.js", | ||
"main": "build/src/index.js", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Тут тоже странно, что There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ответил выше |
||
"files": [ | ||
"build", | ||
"typings" | ||
"build" | ||
], | ||
"types": "./typings/index.d.ts", | ||
"scripts": { | ||
"build": "tsc && copyfiles --up 1 'src/browser/client-scripts/*' build", | ||
"build": "tsc && npm run copy-static", | ||
"copy-static": "copyfiles 'src/browser/client-scripts/*' 'typings/*' build", | ||
"check-types": "tsc --project tsconfig.spec.json", | ||
"clean": "rimraf build/ *.tsbuildinfo", | ||
"coverage": "nyc --reporter=text npm run test-unit", | ||
|
@@ -23,7 +22,8 @@ | |
"prepack": "npm run clean && npm run build", | ||
"preversion": "npm run lint && npm test", | ||
"commitmsg": "commitlint -e", | ||
"release": "standard-version" | ||
"release": "standard-version", | ||
"watch": "npm run copy-static && tsc --watch" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
|
@@ -65,7 +65,7 @@ | |
"looks-same": "^8.1.0", | ||
"micromatch": "^4.0.5", | ||
"mocha": "^10.2.0", | ||
"plugins-loader": "^1.1.0", | ||
"plugins-loader": "^1.2.0", | ||
"png-validator": "1.1.0", | ||
"sharp": "~0.30.7", | ||
"sizzle": "^2.3.6", | ||
|
@@ -81,6 +81,7 @@ | |
"@commitlint/cli": "^17.1.2", | ||
"@commitlint/config-conventional": "^17.1.0", | ||
"@swc/core": "^1.3.40", | ||
"@types/bluebird": "^3.5.38", | ||
"@types/chai": "^4.3.4", | ||
"@types/chai-as-promised": "^7.1.5", | ||
"@types/lodash": "^4.14.191", | ||
|
@@ -111,6 +112,7 @@ | |
"sinon-chai": "^2.12.0", | ||
"standard-version": "^9.5.0", | ||
"ts-node": "^10.9.1", | ||
"type-fest": "^3.10.0", | ||
"typescript": "^4.9.5" | ||
}, | ||
"peerDependencies": { | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А зачем хочешь обязательно тип указывать? TS ведь может самостоятельно корректно определить return type в большинстве кейсов.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Мне кажется явное задание возвращаемого типа в функциях — хорошая практика, такой код очень удобно и приятно читать, даже если это происходит в github или виме не надо анализировать, что тут вернется. Ну и кажется раньше в монорепе был такой конфиг у нас.
Могу убрать, конечно, но я считаю, что это очень полезное правило
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я тоже скорее склоняюсь к explicit аннотациям, именно по причине таких юз кейсов типа ревью, гит истории и тп