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(nx-plugin): add plugin-lint executor #9697

Merged
merged 5 commits into from Jun 3, 2022

Conversation

AgentEnder
Copy link
Member

@AgentEnder AgentEnder commented Apr 5, 2022

Current Behavior

Nothing is provided to validate common json files for Nx plugins, leaving authors to rely on e2e tests to catch errors.

Expected Behavior

Generated nx plugins setup eslint checks to validate common js files. Checks include

  • Migrations.json
    • Implementation exists
    • Version is a valid semver
  • Generators.json / collection.json
    • Implementation exists
    • Schema exists and is valid json
    • Identifier is exported from implementation module if provided (i.e. /src/my-plugin/generators/app/app#compat)
  • Executors.json / builders.json
    • Implementation exists
    • Schema exists and is valid json
    • Identifier is exported from implementation module if provided (i.e. /src/my-plugin/generators/app/app#compat)
  • Package.json
    • packageGroup object version entries are valid semvers

Related Issue(s)

Fixes #

@nx-cloud
Copy link

nx-cloud bot commented Apr 5, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 21bf25a. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 12 targets

Sent with 💌 from NxCloud.

@vercel
Copy link

vercel bot commented Apr 5, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nrwl/nx-dev/GcNyL8LkiNa8EEue9ENFAiBRT5Ef
✅ Preview: https://nx-dev-git-fork-agentender-feat-plugin-lint-nrwl.vercel.app

[Deployment for 553f8e3 canceled]

Copy link
Contributor

@gioragutt gioragutt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome job 👏🏻

@vercel
Copy link

vercel bot commented May 25, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nx-dev ✅ Ready (Inspect) Visit Preview Jun 1, 2022 at 6:32PM (UTC)

packages/devkit/index.ts Outdated Show resolved Hide resolved
packages/eslint-plugin-nx/src/rules/nx-plugin-checks.ts Outdated Show resolved Hide resolved
packages/eslint-plugin-nx/src/rules/nx-plugin-checks.ts Outdated Show resolved Hide resolved
packages/nx-plugin/generators.json Show resolved Hide resolved
function setupVsCodeLintingForJsonFiles(host: Tree) {
let existing: Record<string, unknown> = {};
if (host.exists('.vscode/settings.json')) {
existing = readJson<Record<string, unknown>>(host, '.vscode/settings.json');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use updateJson

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to use updateJson here in case the settings.json file doesn't exist. I updated the method to actually write the file back though, and log out some info explaining the file if it is created.

@FrozenPandaz FrozenPandaz merged commit 10363e3 into nrwl:master Jun 3, 2022
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants