-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix/schematic #488
base: master
Are you sure you want to change the base?
fix/schematic #488
Conversation
README_RU.md
Outdated
@@ -90,7 +90,7 @@ | |||
|
|||
### Генерация | |||
|
|||
- `yarn generate project` - генерация схематики проекта | |||
- `yarn generate` - генерация схематики проекта |
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.
что-то помимо project
будем генерировать? Если да, то надо оставить как было
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.
там был еще скрипт "library". его не трогал
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.
тогда возвращай
"sort-package-json@2.4.1": "patch:sort-package-json@npm%3A2.4.1#./.yarn/patches/sort-package-json-npm-2.4.1-8ff012947f.patch", | ||
"typescript": "5.5.4" | ||
}, | ||
"dependencies": { | ||
"@atls/schematics": "workspace:*" |
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.
лишнее
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.
- мы на уровне
plugin-schematic
запрашиваем путь до самогоschematic
. нам нужны исходники шаблонов - соответственно собранный бандл цепляет зависимости из корня
- если этой зависимости в корне не будет, то мы не найдет путь до пакета -> ошибка
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.
так. Давай заново.
У тебя корень всего и вся - cli
. В нем ты собираешь бандл и плагины. Плагины у тебя в зависимостях. В плагинах должно быть в зависимостях все то, что им нужно для работы. Они это ниоткуда не должны получать кроме как сами запрашивать.
Поэтому если ты в проекте запрашиваешь в корневом package.json запрашиваешь эту зависимость и бандл "работает", то он работает не благодаря а вопреки.
Возьми любой плагин, тот же image
, format
. Посмотри как они работают с зависимостями.
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.
- например в image вижу зависимости импортируются как обычные
- тоесть в package.json - dependencies
- в src - через обычный импорт
- импортируемые пакеты просто упаковываются в бандл и все
angular/schematics
использует шаблоны с определенным неймингом - https://github.com/atls/raijin/tree/fix/schematic/schematics/schematics/src/schematic/templates- тоесть упаковать в бандл эту историю мы не можем, она должна быть изолированна и неизменна.
- либо конвертировать все шаблоны в строки. при запуске плагина записывать эти строки по файлам и потом уже выполнять миграции. тоесть написать js-прослойку, чтобы шаблоны были в js-формате. далее чистка этих файлов НАПРИМЕР
- если делать так, то нужно перед тем, как запускать сборку бандла - запусть еще и сборку
@atls/schematics
, тоесть связать эти сборки
- у меня вот так сделанно - https://github.com/atls/raijin/blob/fix/schematic/yarn/plugin-schematics/sources/getters/collection-path.getter.ts
- я нашел этот метод в старой версии плагина + ГПТ
- мы запрашиваем путь до
коллекции
(она находится в@atls/schematics
+ собранная в cjs + адаптация к cjs типо замены путей импортов и тд), и по этому пути берем конфиг для миграции - соответственно я не могу включить это в бандл, потомучто это не JS (структура файлов и папок)
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.
angular/schematics
использует шаблоны с определенным неймингом - https://github.com/atls/raijin/tree/fix/schematic/schematics/schematics/src/schematic/templates- тоесть упаковать в бандл эту историю мы не можем, она должна быть изолированна и неизменна.
ты можешь либо насильно их импортировать в ts либо конвертировать в строки
.yarnrc.yml
Outdated
yarnPath: yarn/cli/src/cli.dev.mjs | ||
# yarnPath: .yarn/releases/yarn-4.5.1.cjs | ||
yarnPath: .yarn/releases/yarn.mjs | ||
# yarnPath: yarn/cli/dist/yarn.mjs |
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.
как будто опять дубли
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.
.yarn/releases/yarn.mjs
- смотрит зависимости в корневомpackage.json
yarn/cli/dist/yarn.mjs
- смотрит зависимости вyarn/cli
- ну и дев-вариант
путь до releases
удалить?
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.
у тебя должны быть:
releases
- путь до стокового бандлаcli/src/cli.dev.mjs
- наш дев
Остальное - лишнее
"globby": "13.2.2" | ||
}, | ||
"peerDependencies": { | ||
"@atls/code-runtime": "*" |
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.
что-то странное - выше обычная зависимость, а тут - пир
yarn/cli/package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "@atls/yarn-cli", | |||
"version": "1.1.5", | |||
"version": "1.1.5-atls", |
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.
постфикс делается билдом бандла. В гит не должно попадать
@@ -39,6 +39,7 @@ | |||
"typescript": "5.5.4" | |||
}, | |||
"peerDependencies": { | |||
"@atls/schematics": "*", |
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.
что-то странное - выше обычные зависимости, а тут пир
closes #409