Skip to content
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

feat(yarn-sdks): Add hook to generate Yarn SDKs #311

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,18 @@
https://yarnpkg.com/cli/npm/audit for more details.
args: [--all, --recursive]

- id: yarn-sdks
name: Generate Yarn SDKs
entry: src/yarn-sdks.sh
language: script
files: \.yarn/sdks/|yarn(-(\d+\.){2}\d+\.cjs|\.lock)
pass_filenames: false
description: >
Generate SDKs and settings for editors specified in
`.yarn/sdks/integrations.yml`. Format VSCode settings with Prettier to
prevent formatting conflicts with MegaLinter. See
https://yarnpkg.com/sdks/cli/default for more details.

- id: yarn-build
name: Build the app
entry: yarn run build
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Hooks for Use With the [pre-commit](https://pre-commit.com) Framework
- [`yarn-install`](#yarn-install)
- [`yarn-dedupe`](#yarn-dedupe)
- [`yarn-audit`](#yarn-audit)
- [`yarn-sdks`](#yarn-sdks)
- [`yarn-build`](#yarn-build)
- [`yarn-test`](#yarn-test)
- [`megalinter-incremental`](#megalinter-incremental)
Expand Down Expand Up @@ -100,6 +101,14 @@ Deduplicate Yarn dependencies by running
Perform security audit of Yarn dependencies by running
[`yarn npm audit --all --recursive`](https://yarnpkg.com/cli/npm/audit).

### `yarn-sdks`

Generate SDKs and settings for editors specified in
`.yarn/sdks/integrations.yml` by running
[`yarn run sdks && yarn run prettier --write .vscode/settings.json`](https://yarnpkg.com/sdks/cli/default).
Format VSCode settings with Prettier to prevent formatting conflicts with
MegaLinter.

### `yarn-build`

Run the `"build"` script in `package.json` via
Expand Down
6 changes: 6 additions & 0 deletions src/yarn-sdks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -o errexit -o noglob -o pipefail -o nounset

yarn run sdks
yarn run prettier --write .vscode/settings.json