add(40-define-functions): уроки про модули и пакеты по аналогии с Python#831
Merged
Conversation
Добавляет два урока в конец модуля 40-define-functions, повторяя структуру exercises-python (350-modules, 400-packages): - 460-modules: import/export, именованный импорт, export default, переименование через as, стандартные модули - 470-packages: npm-пакеты, импорт по имени, subpath-модули одного пакета, package.json/exports, node_modules Упражнения используют существующий внутренний пакет hexlet-basics (string/math) — без изменений в src/hexlet и package.json. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
7e84d7e to
859a2b4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Что
Добавляет два урока в конец модуля
40-define-functions, повторяя структуруexercises-python(350-modules,400-packages):import/export, именованный импорт,export default, переименование черезas, краткое про стандартные модули (Math,node:*).hexlet-basics/stringvshexlet-basics/mathкак аналог Pythonpayments.stripe),package.json/exports,node_modulesи реестр npm.Почему
В JS-курсе студенты уже встречали
import { length } from 'hexlet-basics/string'«как есть» (модуль35-calling-functions), но нигде не объяснялось, что это значит. Эти уроки дают объяснение и закрывают паритет с Python.Детали реализации
Math.ceilглобален,node:*в курсе не используются. Поэтому упражнения опираются на уже существующий внутренний пакетhexlet-basics(string/math).src/hexlet/иpackage.json.mirror(text)→ импортreverse,toUpperCaseизhexlet-basics/string.formatPrice(amount)→ импортroundизhexlet-basics/math.ru/en/es(README/EXERCISE/data.yml) +description.es.yml.Проверки (в Docker)
vitest related— оба теста зелёныеmake schema-validate— exit 0make description-lint(yamllint) — exit 0biome check— без предупреждений🤖 Generated with Claude Code