Skip to content

Commit

Permalink
patch: pr5717 (и pr5756) (#5765)
Browse files Browse the repository at this point in the history
* build(deps): Bump @babel/core from 7.22.11 to 7.22.15 (#5756)

Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.22.11 to 7.22.15.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.22.15/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>


-----


* tech: Use yarn v3 (#5717)

Specify npmPublish* settings

Remove vkui yarn.lock
As it breaks workspace run command

Use npm version to bump version in package.json
Use npm version when publish pre-release
Use npm version to publish token translator

Run size-limit-action more carefully without fake yarn.lock in packages/vkui
We cannot keep using fake yarn.lock because Yarn v3 cannot install
all dependencies properly by having more than one yarn.lock, even
though the second one is fake and empty.

Remove yarn-deduplicate package
Because modern yarn v3 can do it out of the box

Use prepack script during yarn npm publish
Because prepublishOnly is no longer supported by Yarn v3.

Add yarn binary
Because we still have no easy way to use yarn v3 on CI
See conversation about it in icons repo: VKCOM/icons#588 (comment)

Add yarn plugin to run command for each workspace
Currently yarn workspaces foreach is not built into the yarn v3,
but will be in yarn v4.

No way to avoid .yarn/plugins folder as it is the way yarn plugins designed.
See: yarnpkg/berry#4464

Remove install step of condesandbox
Turned out yarn v3 cannot run package.json scripts
without firstly install all packages with yarn install.
On codesandbox thought the `installCommand` command runs
package.json script which doesn't work with yarn v3 without `yarn
install`.
Remove the special install script run, so codesandbox can just run
`yarn install` without trying to run package.json script to resolve
error:
  yarn run PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 yarn install (in /tmp/4e439e86)
  Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)

Use yarn run --top-level|-T to search for jest binary and other binaries
those exists in the monorepo top workspace but are missing in the vkui
workspace

Specify tag without package name like `v${version}` for vkui package
This is almost the only one package we publish
so, there is no need in such a prefix.
Plus it might break the milestone automation from
#5447

Add .yarn/* to prettier ignore
To avoid fighting with yarn auto format
when we udpate something in configuration file
automatically

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
mendrew and dependabot[bot] authored Sep 8, 2023
1 parent 2582c91 commit ea63d80
Show file tree
Hide file tree
Showing 27 changed files with 20,763 additions and 13,753 deletions.
1 change: 0 additions & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"node": "18",
"installCommand": "codesandbox:install",
"buildCommand": "build:vkui",
"packages": ["packages/vkui"],
"sandboxes": ["vkui-typescript-uwozmt"]
Expand Down
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
**/src/**/__image_snapshots__/*.png filter=lfs diff=lfs merge=lfs -text

# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
/.yarn/releases/** binary
/.yarn/plugins/** binary
36 changes: 28 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,36 @@ jobs:
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts
run: YARN_ENABLE_SCRIPTS=false yarn install --immutable

- name: Set Git credentials
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Saving current version to env
id: prev_version
run: |
echo "version=$(yarn workspace @vkontakte/vkui node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Bump by version type
if: ${{ !github.event.inputs.custom_version }}
run: yarn workspace @vkontakte/vkui version --${{ github.event.inputs.type }} --no-commit-hooks
run: yarn workspace @vkontakte/vkui run g:npm:version ${{ github.event.inputs.type }}

- name: Bump by custom version
if: ${{ github.event.inputs.custom_version }}
run: yarn workspace @vkontakte/vkui version --new-version ${{ github.event.inputs.custom_version }} --no-commit-hooks
run: yarn workspace @vkontakte/vkui run g:npm:version ${{ github.event.inputs.custom_version }}

- name: Saving updated version to env
id: updated_version
run: |
echo "version=$(yarn workspace @vkontakte/vkui node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Adding commit and tag with updated version number
run: |
git add -A
git commit -m 'bump(@vkontakte/vkui): from ${{ steps.prev_version.outputs.version }} to ${{ steps.updated_version.outputs.version }}'
git tag v${{ steps.updated_version.outputs.version }}
- name: Run linters
run: yarn run lint
Expand All @@ -65,21 +81,25 @@ jobs:
with:
github_token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: true

- name: Create stable branch
uses: VKCOM/gh-actions/VKUI/stable-branch@main
with:
token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}
directory: packages/vkui/

- name: Publishing release
run: yarn workspace @vkontakte/vkui publish --non-interactive
- name: Setup NPM Auth Token to .yarnrc.yml
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}
shell: bash
run: |
yarn config set npmAlwaysAuth true
yarn config set npmAuthToken $NODE_AUTH_TOKEN
- name: Save updated package version to env
id: updated_version
run: echo "version=$(yarn workspace @vkontakte/vkui --silent run --silent package:version)" >> $GITHUB_OUTPUT
- name: Publishing release
run: |
yarn workspace @vkontakte/vkui npm publish
- name: Creating doc for stable release
run: |
Expand Down
36 changes: 28 additions & 8 deletions .github/workflows/publish_prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts
run: YARN_ENABLE_SCRIPTS=false yarn install --immutable

- name: Run linters
run: yarn run lint
Expand All @@ -61,28 +61,48 @@ jobs:
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Saving current version to env
id: prev_version
run: |
echo "version=$(yarn workspace @vkontakte/vkui node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Bump by version type
if: ${{ !github.event.inputs.custom_version }}
run: yarn workspace @vkontakte/vkui version --${{ github.event.inputs.type }} --preid ${{ github.event.inputs.tag }} --no-commit-hooks
run: yarn workspace @vkontakte/vkui run g:npm:version ${{ github.event.inputs.type }} --preid ${{ github.event.inputs.tag }}

- name: Bump by custom version
if: ${{ github.event.inputs.custom_version }}
run: yarn workspace @vkontakte/vkui version --new-version ${{ github.event.inputs.custom_version }} --no-commit-hooks
run: yarn workspace @vkontakte/vkui run g:npm:version ${{ github.event.inputs.custom_version }} --preid ${{ github.event.inputs.tag }}

- name: Saving updated version to env
id: updated_version
run: |
echo "version=$(yarn workspace @vkontakte/vkui node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Adding commit and tag with updated version number
run: |
git add -A
git commit -m 'bump(@vkontakte/vkui): from ${{ steps.prev_version.outputs.version }} to ${{ steps.updated_version.outputs.version }}'
git tag v${{ steps.updated_version.outputs.version }}
- name: Pushing changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: true

- name: Publishing prerelase
run: yarn workspace @vkontakte/vkui publish --non-interactive --tag ${{ github.event.inputs.tag }}
- name: Setup NPM Auth Token to .yarnrc.yml
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}
shell: bash
run: |
yarn config set npmAlwaysAuth true
yarn config set npmAuthToken $NODE_AUTH_TOKEN
- name: Save updated package version to env
id: updated_version
run: echo "version=$(yarn workspace @vkontakte/vkui --silent run --silent package:version)" >> $GITHUB_OUTPUT
- name: Publishing release
run: |
yarn workspace @vkontakte/vkui npm publish --tag ${{ github.event.inputs.tag }}
- name: Build styleguide
run: yarn run docs:styleguide:build --dist dist/${{ steps.updated_version.outputs.version }}
Expand Down
33 changes: 27 additions & 6 deletions .github/workflows/publish_token_translator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: yarn install --frozen-lockfile
run: YARN_ENABLE_SCRIPTS=false yarn install --immutable

- name: Run tests
run: yarn run test
Expand All @@ -44,19 +44,40 @@ jobs:
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Saving current version to env
id: prev_version
run: |
echo "version=$(yarn node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Bump version
run: yarn version --new-version ${{ github.event.inputs.version }} --no-commit-hooks --no-git-tag-version
run: yarn run g:npm:version ${{ github.event.inputs.version }}

- name: Commit bumped version
run: git add -A && git commit -m '[token-translator] v${{ github.event.inputs.version }}'
- name: Saving updated version to env
id: updated_version
run: |
echo "version=$(yarn node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Adding commit and tag with updated version number
run: |
git add -A
git commit -m 'bump(@vkontakte/vkui-token-translator): from ${{ steps.prev_version.outputs.version }} to ${{ steps.updated_version.outputs.version }}'
git tag @vkontakte/vkui-token-translator@${{ steps.updated_version.outputs.version }}
- name: Pushing changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: true

- name: Publishing release
run: yarn publish --non-interactive --access public
- name: Setup NPM Auth Token to .yarnrc.yml
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}
shell: bash
run: |
yarn config set npmAlwaysAuth true
yarn config set npmAuthToken $NODE_AUTH_TOKEN
- name: Publishing release
run: |
yarn npm publish
2 changes: 1 addition & 1 deletion .github/workflows/pull_request_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts
run: YARN_ENABLE_SCRIPTS=false yarn install --immutable

- name: Run Prettier
run: yarn run lint:prettier
12 changes: 6 additions & 6 deletions .github/workflows/pull_request_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts
run: YARN_ENABLE_SCRIPTS=false yarn install --immutable

- name: Run Stylelint
run: yarn run lint:style
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts
run: YARN_ENABLE_SCRIPTS=false yarn install --immutable

- name: Download Playwright blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -147,17 +147,17 @@ jobs:
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts
run: YARN_ENABLE_SCRIPTS=false yarn install --immutable

- uses: andresz1/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# only affects current branch
skip_step: install
directory: packages/vkui/
# В 1.7.0 пока нет этого свойства. См. packages/vkui/yarn.lock
# package_manager: yarn
build_script: 'size:ci'
script: /bin/bash -c "cd packages/vkui && npx size-limit --json"

docs_styleguide_upload:
if: ${{ needs.changed_files.outputs.docs_styleguide == 'true' }}
Expand All @@ -175,7 +175,7 @@ jobs:
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts
run: YARN_ENABLE_SCRIPTS=false yarn install --immutable

- name: Build
run: yarn run docs:styleguide:build
Expand All @@ -202,7 +202,7 @@ jobs:
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts
run: YARN_ENABLE_SCRIPTS=false yarn install --immutable

- name: Build
run: yarn docs:storybook:build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable_workflow_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
with:
node-version: 18
cache: 'yarn'
- run: yarn install --frozen-lockfile --ignore-scripts
- run: YARN_ENABLE_SCRIPTS=false yarn install --immutable

- name: Run tests for all workspaces
if: ${{ !inputs.workspace }}
run: yarn workspaces run test:ci
run: yarn run test:ci

- name: Run tests for the specified workspace
if: ${{ inputs.workspace }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_workflow_test_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts
run: YARN_ENABLE_SCRIPTS=false yarn install --immutable

- name: Run e2e tests for @vkontakte/vkui workspace
# Почему HOME=/root см. https://github.com/microsoft/playwright/issues/6500
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_screens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts
run: YARN_ENABLE_SCRIPTS=false yarn install --immutable

- name: Update screenshots
# Почему HOME=/root см. https://github.com/microsoft/playwright/issues/6500
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,13 @@ __diff_output__

# OS
.DS_Store

# yarn specific
# see https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ storybook-static/
playwright-report/
blob-report/
all-blob-reports/

# Yarn
.yarn/*
Loading

0 comments on commit ea63d80

Please sign in to comment.