Skip to content

Commit

Permalink
chore(yarn-plugin-tools): sync, command adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelfimov committed Aug 21, 2024
1 parent daba94e commit 8043dd3
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion code/code-commit/src/lint/commitlint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,6 @@ export async function lint(
valid,
errors,
warnings,
input: buildCommitMesage(parsed),
input: buildCommitMessage(parsed),
}
}
24 changes: 12 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1369,15 +1369,15 @@ __metadata:
dependencies:
"@atls/code-runtime": "workspace:*"
"@atls/config-typescript": "workspace:*"
"@types/semver": "npm:^7.5.0"
"@yarnpkg/builder": "npm:^4.1.1"
"@yarnpkg/cli": "npm:^4.2.2"
"@yarnpkg/core": "npm:^4.0.5"
"@yarnpkg/fslib": "npm:^3.1.0"
clipanion: "npm:^4.0.0-rc.3"
deepmerge: "npm:^4.3.1"
husky: "npm:^8.0.3"
semver: "npm:^7.5.3"
"@types/semver": "npm:7.5.8"
"@yarnpkg/builder": "npm:4.1.2"
"@yarnpkg/cli": "npm:4.4.0"
"@yarnpkg/core": "npm:4.1.2"
"@yarnpkg/fslib": "npm:3.1.0"
clipanion: "npm:4.0.0-rc.3"
deepmerge: "npm:4.3.1"
husky: "npm:8.0.3"
semver: "npm:7.6.3"
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -4270,7 +4270,7 @@ __metadata:
languageName: node
linkType: hard

"@types/semver@npm:7.5.8, @types/semver@npm:^7.1.0, @types/semver@npm:^7.5.0":
"@types/semver@npm:7.5.8, @types/semver@npm:^7.1.0":
version: 7.5.8
resolution: "@types/semver@npm:7.5.8"
checksum: 10/3496808818ddb36deabfe4974fd343a78101fa242c4690044ccdc3b95dcf8785b494f5d628f2f47f38a702f8db9c53c67f47d7818f2be1b79f2efb09692e1178
Expand Down Expand Up @@ -6851,7 +6851,7 @@ __metadata:
languageName: node
linkType: hard

"deepmerge@npm:*, deepmerge@npm:4.3.1, deepmerge@npm:^4.2.2, deepmerge@npm:^4.3.1":
"deepmerge@npm:*, deepmerge@npm:4.3.1, deepmerge@npm:^4.2.2":
version: 4.3.1
resolution: "deepmerge@npm:4.3.1"
checksum: 10/058d9e1b0ff1a154468bf3837aea436abcfea1ba1d165ddaaf48ca93765fdd01a30d33c36173da8fbbed951dd0a267602bc782fe288b0fc4b7e1e7091afc4529
Expand Down Expand Up @@ -9080,7 +9080,7 @@ __metadata:
languageName: node
linkType: hard

"husky@npm:^8.0.3":
"husky@npm:8.0.3":
version: 8.0.3
resolution: "husky@npm:8.0.3"
bin:
Expand Down
18 changes: 9 additions & 9 deletions yarn/plugin-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
"dependencies": {
"@atls/code-runtime": "workspace:*",
"@atls/config-typescript": "workspace:*",
"clipanion": "^4.0.0-rc.3",
"deepmerge": "^4.3.1",
"husky": "^8.0.3",
"semver": "^7.5.3"
"clipanion": "4.0.0-rc.3",
"deepmerge": "4.3.1",
"husky": "8.0.3",
"semver": "7.6.3"
},
"devDependencies": {
"@types/semver": "^7.5.0",
"@yarnpkg/builder": "^4.1.1",
"@yarnpkg/cli": "^4.2.2",
"@yarnpkg/core": "^4.0.5",
"@yarnpkg/fslib": "^3.1.0"
"@types/semver": "7.5.8",
"@yarnpkg/builder": "4.1.2",
"@yarnpkg/cli": "4.4.0",
"@yarnpkg/core": "4.1.2",
"@yarnpkg/fslib": "3.1.0"
},
"publishConfig": {
"access": "public",
Expand Down
6 changes: 4 additions & 2 deletions yarn/plugin-tools/src/hooks/after-all-installed.hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ const hook = (command: string): string =>
${command}
`

const git = (args: Array<string>): SpawnSyncReturns<Buffer> =>
spawnSync('git', args, { stdio: 'inherit' })
const git = (args: Array<string>): SpawnSyncReturns<string> =>
spawnSync('git', args, { encoding: 'utf-8' })

const hooksExists = (): boolean => {
const { error, output } = git(['config', 'core.hooksPath'])
Expand All @@ -87,9 +87,11 @@ export const afterAllInstalled = async (project: Project): Promise<void> => {
hook('yarn commit message lint'),
{ mode: 0o755 }
)

await xfs.writeFilePromise(ppath.join(target, 'pre-commit'), hook('yarn commit staged'), {
mode: 0o755,
})

await xfs.writeFilePromise(
ppath.join(target, 'prepare-commit-msg'),
hook('yarn commit message $@'),
Expand Down
2 changes: 1 addition & 1 deletion yarn/plugin-tools/src/hooks/after-yarn-version-set.hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { CommandContext } from '@yarnpkg/core'
import { execUtils } from '@yarnpkg/core'

export const afterYarnVersionSet = async (
configuration: Configuration,
_: Configuration,
context: CommandContext
): Promise<void> => {
await execUtils.pipevp('yarn', ['tools', 'sync'], {
Expand Down

0 comments on commit 8043dd3

Please sign in to comment.