-
Notifications
You must be signed in to change notification settings - Fork 30
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
chore: node.js 18, storybook 7 and other dev dependencies upgrade #665
Merged
Conversation
This file contains 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
NaMax66
reviewed
Aug 3, 2023
NaMax66
approved these changes
Aug 7, 2023
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
asvishnyakov
changed the title
chore: dev dependencies upgrade
chore: node.js 18, storybook 7 and other dev dependencies upgrade
Aug 9, 2023
asvishnyakov
added a commit
that referenced
this pull request
Feb 21, 2024
## Description Re-enables (enabled by default) `yarn.lock` immutability during CI builds. Looks like [bug](yarnpkg/berry#2948) was fixed in Yarn 4 (see #665) ## References ### Jira-link: <!-- Put link to your task in Jira here --> ### Artifact URL: https://vc3prerelease.blob.core.windows.net/packages/vc-theme-b2b-vue-1.52.0-pr-963-2139-213962dc.zip https://vc3prerelease.blob.core.windows.net/packages/vc-theme-b2b-vue-1.51.0-pr-963-faa0-faa0b3e1.zip
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.
Description:
Task
https://virtocommerce.atlassian.net/browse/ST-4720
Summary
node.js
was upgraded tonode.js 18 LTS
storybook
was upgraded tostorybook 7
(using automatic migration) asstorybook 6
isn't compatible withnode.js 18
yarn
was upgraded to support automatic upgrade ofstorybook
devDependencies
was upgraded to latest versions or versions corresponding to create-vue if necessarydependencies
was upgradedtsconfig.json
was upgraded to correspond the one from create-vueGraphQL
generation command had issues with local deploy ofvc-storefront
so was updated tooeslint
andprerrier
Line endings
To eliminate a lot of warnings about line ending fixing by
eslint/prettier
on Windows, the following changes was made:.gitattributes:
* text=auto
is default strategy in VirtoCommerce and means:git
):git
will automatically convert tolf
crlf
in Windows,lf
in Linux & MacOS).editorconfig: removed
end_of_line = lf
.prettierrc.json:
This means line endings will automatically converted to
lf
when uploading to GitHub and to your system specific when checking out.node.js 18
node.js
is upgraded tonode.js
18 LTS:.github/workflows/main.yml
.npmrc:
engine-strict=true
package.json
yarn berry (yarn > 2.0)
To have ability automatically upgrade storybook in this PR and in feature, yarn was upgraded to latest version. The following important changes are related:
.github/workflows/main.yml
Because of bug (it closed by bot, not resolved yet).
.gitignore:
Configuration above is specific for avoiding zero-installs.
.yarnrc
nodeLinker
is specified to avoid zero-installs..yarn/releases/yarn-3.6.1.cjs
As per documentation:
package.json:
Specified automatically.
Packages
The following packages wasn't used and was removed:
The following packages referenced by other packages and shouldn't be referenced directly:
The following packages wasn't compatible with upgraded typescript and was upgraded too:
The following packages required by new
tsconfig.json
The following packages required by upgraded
eslint
configs:The following packages required by
storybook 7
:Typescript
Typescript was upgraded to the version used by create-vue
tsconfig.json
tsconfig.json
settings replaced withtsconfig.node.json
andtsconfig.app.json
, both referenced in first one. They inherit settings from packages @tsconfig/node18 and @vue/tsconfig. This is default approach used by create-vue. Removed all settings which duplicated settings from these packages or default settings, all necessary settings moved to corresponding files,so
resolvePackageJsonExports
set tofalse
temporarily until upgrade tovue-i18n 9.3
.Eslint
Eslint and related configs was upgraded to the version used by create-vue
@rushstack/eslint-patch/modern-module-resolution package is required now for correct work of vue eslint rules and used by create-vue
.eslintrc.js
ST-4765
.eslintrc.js
The changes above was made to fix issue when @typescript-eslint/parser doesn't understand paths from references in
tsconfig.json
, i.e. doesn't resolveimport "@/**"
GraphQL schema and types generation
Previous configuration had two issues:
.env.local
file, so you was need to changeAPP_BACKEND_URL
environment variable tohttps://vcst-dev-storefront.paas.govirto.com/
orhttps://localhost:port
and back every time.env.local
is reading byvite
, butgraphql-codegen
is running outside of it (and can't be run inside) and to fix that-r dotenv/config
was used, but it take into account only.env
filevc-storefront
on local machineCorresponding changes was introduced in package.json and scripts/codegen.js.
graphql-codegen
and related dependencies wasn't upgraded because they sharegraphql
package withapollo=client
and it's better to avoidresolution
inyarn
and keep them in sync.Storybook
Storybook generation and preview was significantly remade. The following changes was made because of that:
.storybook/main.ts
*.graphql
files by @rollup/plugin-graphql fails. Because they are unnecessary for storybook, plugin was removed.reactDocgen
is now supported only forReact
projects, so corresponding configuration was removed.viteFinal
was updated to correspond settings invite.config.ts
autodocs: true
: docs are not generates by default instorybook 7
, but they was configured to automatically generation by automatic migration in order to follow previous behavior..storybook/preview.ts
previewTabs
andviewMode
no more supported, so was simply removed. Doesn't seems to affect anything.app
provided and should be configured within syncsetup
function, so plugins and component registration was moved to it and all async code (theme settings and i18n loading) was moved outside.setup(async () => {})
or plugins and component registration in async functions doesn't work.json
directly topreview.ts
due to limitations of storybook build, so now they are loaded asynchronouslyen
locale andUSD
currency.legacy
mode for i18n, code was clean up.QA-test:
Demo-test:
Download artifact URL: https://vc3prerelease.blob.core.windows.net/packages/vc-theme-b2b-vue-1.36.0-pr-665-5a1d-5a1dd0f0.zip