├── .eslintignore
├── .eslintrc.json
├── .github
└── workflows
│ ├── ci.yml
│ ├── publish.yml
│ └── release.yml
├── .gitignore
├── .nvmrc
├── .prettierignore
├── .prettierrc
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── banner.jpg
├── jest.config.ts
├── jest.preset.js
├── nx.json
├── package-lock.json
├── package.json
├── plugin
├── .eslintrc.json
├── README.md
├── executors.json
├── generators.json
├── jest.config.ts
├── package.json
├── project.json
├── src
│ ├── executors
│ │ └── lint
│ │ │ ├── executor.ts
│ │ │ ├── schema.d.ts
│ │ │ └── schema.json
│ ├── generators
│ │ ├── configuration
│ │ │ ├── generator.ts
│ │ │ ├── schema.d.ts
│ │ │ └── schema.json
│ │ └── init
│ │ │ ├── generator.ts
│ │ │ ├── schema.d.ts
│ │ │ └── schema.json
│ └── utils
│ │ ├── config-file.ts
│ │ ├── normalized.schema.ts
│ │ └── versions.ts
├── tsconfig.json
├── tsconfig.lib.json
├── tsconfig.linter.json
└── tsconfig.spec.json
└── tsconfig.base.json
/.eslintignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "ignorePatterns": ["**/*"],
4 | "plugins": ["@nx"],
5 | "overrides": [
6 | {
7 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
8 | "rules": {
9 | "@nx/enforce-module-boundaries": [
10 | "error",
11 | {
12 | "enforceBuildableLibDependency": true,
13 | "allow": [],
14 | "depConstraints": [
15 | {
16 | "sourceTag": "*",
17 | "onlyDependOnLibsWithTags": ["*"]
18 | }
19 | ]
20 | }
21 | ]
22 | }
23 | },
24 | {
25 | "files": ["*.ts", "*.tsx"],
26 | "extends": ["plugin:@nx/typescript"],
27 | "rules": {}
28 | },
29 | {
30 | "files": ["*.js", "*.jsx"],
31 | "extends": ["plugin:@nx/javascript"],
32 | "rules": {}
33 | },
34 | {
35 | "files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
36 | "env": {
37 | "jest": true
38 | },
39 | "rules": {}
40 | },
41 | {
42 | "files": "*.json",
43 | "parser": "jsonc-eslint-parser",
44 | "rules": {}
45 | }
46 | ]
47 | }
48 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | pull_request:
8 |
9 | permissions:
10 | actions: read
11 | contents: read
12 |
13 | jobs:
14 | main:
15 | runs-on: ubuntu-latest
16 | steps:
17 | - uses: actions/checkout@v4
18 | with:
19 | fetch-depth: 0
20 |
21 | # Connect your workspace on nx.app and uncomment this to enable task distribution.
22 | # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
23 | # - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
24 |
25 | # Cache node_modules
26 | - uses: actions/setup-node@v4
27 | with:
28 | node-version: 20
29 | cache: 'npm'
30 | - run: npm ci
31 | - uses: nrwl/nx-set-shas@v4
32 |
33 | - run: npx nx-cloud record -- nx format:check
34 | - run: npx nx affected -t lint test build
35 |
--------------------------------------------------------------------------------
/.github/workflows/publish.yml:
--------------------------------------------------------------------------------
1 | name: 🎁 Publish to NPM
2 |
3 | on:
4 | workflow_dispatch:
5 |
6 | jobs:
7 | publish:
8 | name: 📦 Build package and publish
9 | runs-on: ubuntu-latest
10 | permissions:
11 | contents: read
12 | packages: write
13 | steps:
14 | - name: 🛡️ Obtain GitOpsLover Installation Access Token
15 | id: app_auth
16 | run: |
17 | TOKEN="$(npx obtain-github-app-installation-access-token ci ${{ secrets.GITOPSLOVER_APP_TOKEN }})"
18 |
19 | echo "::add-mask::$TOKEN"
20 | echo "::set-output name=token::$TOKEN"
21 |
22 | - name: 📥 Checkout the code
23 | uses: actions/checkout@v4
24 |
25 | - name: 🛠️ Setup Node.js
26 | uses: actions/setup-node@v4
27 | with:
28 | node-version: "20"
29 |
30 | - name: 🧩 Install dependencies
31 | run: npm ci --force
32 |
33 | - name: 📦 Build the package
34 | run: npm run build
35 |
36 | - name: 🎉 Publish to NPM
37 | uses: JS-DevTools/npm-publish@v3.1.1
38 | with:
39 | token: ${{ secrets.NPM_ACCESS_TOKEN }}
40 | registry: "https://registry.npmjs.org"
41 | package: "dist"
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: 🚀 Create Release
2 |
3 | on:
4 | workflow_dispatch:
5 |
6 | jobs:
7 | release-changelog:
8 | name: 📦 Changelog & Release
9 | runs-on: ubuntu-latest
10 | permissions:
11 | contents: write
12 | steps:
13 | - name: 🛡️ Obtain GitOpsLover Installation Access Token
14 | id: app_auth
15 | run: |
16 | TOKEN="$(npx obtain-github-app-installation-access-token ci ${{ secrets.GITOPSLOVER_APP_TOKEN }})"
17 |
18 | echo "::add-mask::$TOKEN"
19 | echo "::set-output name=token::$TOKEN"
20 |
21 | - name: 📥 Checkout the code
22 | uses: actions/checkout@v4
23 |
24 | - name: 📝 Update Changelog
25 | id: changelog
26 | uses: TriPSs/conventional-changelog-action@v5.3.0
27 | with:
28 | github-token: ${{ steps.app_auth.outputs.token }}
29 | version-file: './package.json,./package-lock.json'
30 | git-user-name: 'gitopslover[bot]'
31 | git-user-email: '160535767+gitopslover[bot]@users.noreply.github.com'
32 | skip-on-empty: false
33 |
34 | - name: 🎉 Create release
35 | uses: actions/create-release@v1.1.4
36 | if: ${{ steps.changelog.outputs.skipped == 'false' }}
37 | env:
38 | GITHUB_TOKEN: ${{ steps.app_auth.outputs.token }}
39 | with:
40 | tag_name: ${{ steps.changelog.outputs.tag }}
41 | release_name: ${{ steps.changelog.outputs.tag }}
42 | body: ${{ steps.changelog.outputs.clean_changelog }}
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled output
2 | dist
3 | tmp
4 | out-tsc
5 |
6 | # Dependencies
7 | node_modules
8 |
9 | # IDEs and editors
10 | .idea
11 | .project
12 | .classpath
13 | .c9
14 | *.launch
15 | .settings
16 | *.sublime-workspace
17 | .vscode
18 |
19 | # misc
20 | .sass-cache
21 | connect.lock
22 | coverage
23 | libpeerconnection.log
24 | npm-debug.log
25 | yarn-error.log
26 | testem.log
27 | typings
28 |
29 | # System Files
30 | .DS_Store
31 | Thumbs.db
32 |
33 | # Cache
34 | .nx
35 |
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | v20.12.2
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | # Add files here to ignore them from prettier formatting
2 | /dist
3 | /coverage
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true
3 | }
4 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # [1.5.0](https://github.com/GitOpsLovers/nx-biome/compare/v1.4.0...v1.5.0) (2024-08-08)
2 |
3 |
4 | ### Features
5 |
6 | * add write and unsafe configurations to linter ([2ebc6dc](https://github.com/GitOpsLovers/nx-biome/commit/2ebc6dcb3cc3bbf41c9ab6f0ac1a53d4e28a04b7))
7 |
8 |
9 |
10 | # [1.4.0](https://github.com/GitOpsLovers/nx-biome/compare/v1.3.0...v1.4.0) (2024-08-08)
11 |
12 |
13 | ### Features
14 |
15 | * lint and format all typescript files ([6be16d4](https://github.com/GitOpsLovers/nx-biome/commit/6be16d4632b6acd6bee702f03472d07c82e80a6d))
16 |
17 |
18 |
19 | # [1.3.0](https://github.com/GitOpsLovers/nx-biome/compare/v1.2.5...v1.3.0) (2024-08-08)
20 |
21 |
22 | ### Features
23 |
24 | * update conventional-changelog-action ([f527ca6](https://github.com/GitOpsLovers/nx-biome/commit/f527ca64fe871daa22ae9fc573a8d7cffb5af354))
25 |
26 |
27 |
28 | ## [1.2.5](https://github.com/GitOpsLovers/nx-biome/compare/v1.2.4...v1.2.5) (2024-08-08)
29 |
30 |
31 | ### Bug Fixes
32 |
33 | * change generated biome.json without dot ([c2ae64f](https://github.com/GitOpsLovers/nx-biome/commit/c2ae64ff0b9ca890160d6efd3d1a1fdf52c68c6c))
34 |
35 |
36 |
37 | ## [1.2.4](https://github.com/GitOpsLovers/nx-biome/compare/v1.2.3...v1.2.4) (2024-08-08)
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # 📜 Code of Conduct
2 |
3 | ## 💬 Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to make participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, sex characteristics, gender identity and expression,
9 | level of experience, education, socio-economic status, nationality, personal
10 | appearance, race, religion, or sexual identity and orientation.
11 |
12 | ## 📋 Our Standards
13 |
14 | Examples of behavior that contributes to a positive environment for our
15 | community include:
16 |
17 | * Demonstrating empathy and kindness toward other people
18 | * Being respectful of differing opinions, viewpoints, and experiences
19 | * Giving and gracefully accepting constructive feedback
20 | * Accepting responsibility and apologizing to those affected by our mistakes,
21 | and learning from the experience
22 | * Focusing on what is best not just for us as individuals, but for the
23 | overall community
24 |
25 | Examples of unacceptable behavior include:
26 |
27 | * The use of sexualized language or imagery, and sexual attention or
28 | advances
29 | * Trolling, insulting or derogatory comments, and personal or political attacks
30 | * Public or private harassment
31 | * Publishing others' private information, such as a physical or email
32 | address, without their explicit permission
33 | * Other conduct which could reasonably be considered inappropriate in a
34 | professional setting
35 |
36 | ## 🛡️ Our Responsibilities
37 |
38 | Project maintainers are responsible for clarifying and enforcing our standards of
39 | acceptable behavior and will take appropriate and fair corrective action in
40 | response to any instances of unacceptable behavior.
41 |
42 | Project maintainers have the right and responsibility to remove, edit, or reject
43 | comments, commits, code, wiki edits, issues, and other contributions that are
44 | not aligned to this Code of Conduct, or to ban
45 | temporarily or permanently any contributor for other behaviors that they deem
46 | inappropriate, threatening, offensive, or harmful.
47 |
48 | ## 🔍 Scope
49 |
50 | This Code of Conduct applies within all community spaces, and also applies when
51 | an individual is officially representing the community in public spaces.
52 | Examples of representing our community include using an official e-mail address,
53 | posting via an official social media account, or acting as an appointed
54 | representative at an online or offline event.
55 |
56 | ## ⚖️ Enforcement
57 |
58 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
59 | reported to the community leaders responsible for enforcement at <>.
60 | All complaints will be reviewed and investigated promptly and fairly.
61 |
62 | All community leaders are obligated to respect the privacy and security of the
63 | reporter of any incident.
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 |
2 | # 🚀 Contributing to Nx Sass
3 |
4 | First off, thanks for taking the time to contribute! ❤️
5 |
6 | All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉
7 |
8 | > And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
9 | > - ⭐ Star the project
10 | > - 🐦 Tweet about it
11 | > - 📖 Refer this project in your project's readme
12 | > - 👥 Mention the project at local meetups and tell your friends/colleagues
13 |
14 |
15 | ## 📚 Table of Contents
16 |
17 | - [Code of Conduct](#code-of-conduct)
18 | - [I Have a Question](#i-have-a-question)
19 | - [I Want To Contribute](#i-want-to-contribute)
20 | - [Reporting Bugs](#reporting-bugs)
21 | - [Suggesting Enhancements](#suggesting-enhancements)
22 |
23 |
24 | ## 📜 Code of Conduct
25 |
26 | This project and everyone participating in it is governed by the
27 | [Nx Sass Code of Conduct](https://github.com/GitOpsLovers/nx-sassblob/master/CODE_OF_CONDUCT.md).
28 | By participating, you are expected to uphold this code. Please report unacceptable behavior
29 | to <>.
30 |
31 |
32 | ## 🤔 I Have a Question
33 |
34 | Before you ask a question, it is best to search for existing [Issues](https://github.com/GitOpsLovers/nx-sass/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first.
35 |
36 | If you then still feel the need to ask a question and need clarification, we recommend the following:
37 |
38 | - Open an [Issue](https://github.com/GitOpsLovers/nx-sass/issues/new).
39 | - Provide as much context as you can about what you're running into.
40 | - Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant.
41 |
42 | We will then take care of the issue as soon as possible.
43 |
44 | ## 🌟 I Want To Contribute
45 |
46 | ### 🐛 Reporting Bugs
47 |
48 |
49 | #### Before Submitting a Bug Report
50 |
51 | A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.
52 |
53 | - Make sure that you are using the latest version.
54 | - Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions. If you are looking for support, you might want to check [this section](#i-have-a-question)).
55 | - To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/GitOpsLovers/nx-sassissues?q=label%3Abug).
56 | - Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue.
57 | - Collect information about the bug:
58 | - Stack trace (Traceback)
59 | - OS, Platform and Version (Windows, Linux, macOS, x86, ARM)
60 | - Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant.
61 | - Possibly your input and the output
62 | - Can you reliably reproduce the issue? And can you also reproduce it with older versions?
63 |
64 |
65 | #### How Do I Submit a Good Bug Report?
66 |
67 | We use GitHub issues to track bugs and errors. If you run into an issue with the project:
68 |
69 | - Open an [Issue](https://github.com/GitOpsLovers/nx-sass/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.)
70 | - Explain the behavior you would expect and the actual behavior.
71 | - Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
72 | - Provide the information you collected in the previous section.
73 |
74 | Once it's filed:
75 |
76 | - The project team will label the issue accordingly.
77 | - A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced.
78 | - If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#your-first-code-contribution).
79 |
80 | ### 🚀 Suggesting Enhancements
81 |
82 | This section guides you through submitting an enhancement suggestion for Nx Sass, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions.
83 |
84 |
85 | #### Before Submitting an Enhancement
86 |
87 | - Make sure that you are using the latest version.
88 | - Read the [documentation]() carefully and find out if the functionality is already covered, maybe by an individual configuration.
89 | - Perform a [search](https://github.com/GitOpsLovers/nx-sass/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
90 | - Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library.
91 |
92 |
93 | #### How Do I Submit a Good Enhancement Suggestion?
94 |
95 | Enhancement suggestions are tracked as [GitHub issues](https://github.com/GitOpsLovers/nx-sass/issues).
96 |
97 | - Use a **clear and descriptive title** for the issue to identify the suggestion.
98 | - Provide a **step-by-step description of the suggested enhancement** in as many details as possible.
99 | - **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you.
100 | - You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux.
101 | - **Explain why this enhancement would be useful** to most Nx Sass users. You may also want to point out the other projects that solved it better and which could serve as inspiration.
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 GitOps Lovers
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |

2 |
3 |
4 |
5 | # nx-biome
6 |
7 | **[Nx](https://nx.dev) plugin to use [Biome](https://biomejs.dev/) toolchain in your Nx workspace.**
8 |
9 | [](https://nx.dev)
10 | [](https://stylelint.io)
11 | [](https://github.com/Phillip9587/nx-stylelint/actions/workflows/ci.yml)
12 | [](https://github.com/phillip9587/nx-stylelint/blob/main/LICENSE)
13 | [](https://www.npmjs.com/package/nx-stylelint)
14 | [](https://www.npmjs.com/package/nx-stylelint)
15 |
16 |
17 |
18 |
19 |
20 | # 🚀 Features
21 |
22 | @gitopslovers/nx-biome provides a set of power-ups for [Nx](https://nx.dev) to lint, format and analyze your projects with [Biome](ttps://biomejs.dev/).
23 |
24 | - **Executor**: Provides some executor to lint, format and analyze your files with Biome.
25 | - **Generators**: Helping you to configure your projects.
26 | - **Configuration**: Per Project configuration of Biome extending a workspace configuration.
27 | - **Only Affected**: Uses Nx to support linting formatting and analyzing only affected projects.
28 | - **Cache**: Uses Nx to cache already touched projects.
29 |
30 | # 📦 Installation
31 |
32 | **using [npm](https://npmjs.com)**
33 |
34 | ```shell
35 | npm i -D @gitopslovers/nx-biome
36 | ```
37 |
38 | # 🛠️ Configuring Biome for a project
39 |
40 | To add a Biome configuration to a project you just have to run the `@gitopslovers/nx-biome:configuration` generator.
41 |
42 | ```shell
43 | nx g @gitopslovers/nx-biome:configuration --project
44 | ```
45 |
46 | The generator adds a `biome.json` configuration file at the project root which extends the root `biome.json` and adds a `biome-lint` target to the project.
47 |
48 | At the first run the generator installs all required dependencies and creates a `biome.json` file at the workspace root. It also configures the `namedInputs` for the `biome-lint` targets.
49 |
50 | # Examples
51 |
52 | Run `biome-lint` for a project
53 |
54 | ```shell
55 | nx biome-lint {{projectName}}
56 | ```
57 |
58 | Run `biome-lint` for all projects
59 |
60 | ```shell
61 | nx run-many --target=biome-lint
62 | ```
63 |
64 | Run `biome-lint` for affected projects
65 |
66 | ```shell
67 | nx affected --target=biome-lint
68 | ```
69 |
70 | # 📖 Documentation
71 |
72 | ## `@gitopslovers/nx-biome:configuration` generator
73 |
74 | Add Biome configuration to a project.
75 |
76 | ### Usage
77 |
78 | Add configuration to a project:
79 |
80 | `nx g @gitopslovers/nx-biome:configuration --project projectName`
81 |
82 | ### Options
83 |
84 | | Option | Value | Description |
85 | | ------------ | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
86 | | `project` | `string` | The name of the project. |
87 |
88 | ## `@gitopslovers/nx-biome:biome-lint` executor
89 |
90 | Run Biome linter on a project.
91 |
92 | Target Options can be configured in `project.json` or when the executor is invoked.
93 |
94 | See: https://nx.dev/configuration/projectjson#targets
95 |
96 | ### Options
97 |
98 | | Option | Value | Default | Description |
99 | | ------------------------------- | ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
100 | | `lintFilePatterns` | `string[]` | | One or more files/dirs/globs to pass directly to Biome's lint method. |
101 | | `write` | `boolean` | | Apply the safe fixes when linting the target where Biome is executed. |
102 | | `unsafe` | `boolean` | | Apply the unsafe fixes when linting the target where Biome is executed. |
103 |
--------------------------------------------------------------------------------
/banner.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mcfdez/nx-biome/3fe822c0b1d6e7f38378bb9487540e0498f1fdfc/banner.jpg
--------------------------------------------------------------------------------
/jest.config.ts:
--------------------------------------------------------------------------------
1 | import { getJestProjects } from "@nx/jest";
2 |
3 | export default {
4 | projects: getJestProjects(),
5 | };
6 |
--------------------------------------------------------------------------------
/jest.preset.js:
--------------------------------------------------------------------------------
1 | const nxPreset = require('@nx/jest/preset').default;
2 |
3 | module.exports = { ...nxPreset };
4 |
--------------------------------------------------------------------------------
/nx.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/nx/schemas/nx-schema.json",
3 | "defaultProject": "nx-biome",
4 | "targetDefaults": {
5 | "lint": {
6 | "inputs": [
7 | "default",
8 | "{workspaceRoot}/.eslintrc.json",
9 | "{workspaceRoot}/.eslintignore"
10 | ]
11 | },
12 | "test": {
13 | "inputs": [
14 | "default",
15 | "^default",
16 | "{workspaceRoot}/jest.preset.js"
17 | ]
18 | }
19 | },
20 | "namedInputs": {
21 | "default": [
22 | "{projectRoot}/**/*",
23 | "sharedGlobals"
24 | ],
25 | "sharedGlobals": [],
26 | "production": [
27 | "default",
28 | "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
29 | "!{projectRoot}/tsconfig.spec.json",
30 | "!{projectRoot}/jest.config.[jt]s",
31 | "!{projectRoot}/.eslintrc.json",
32 | "!{projectRoot}/src/test-setup.[jt]s"
33 | ]
34 | },
35 | "generators": {}
36 | }
37 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@gitopslovers/nx-biome",
3 | "description": "NX plugin to integrate the Biome toolchain.",
4 | "version": "1.5.0",
5 | "license": "MIT",
6 | "scripts": {
7 | "build": "npx nx build nx-biome",
8 | "publish": "npx npm-publish dist --token $1"
9 | },
10 | "private": true,
11 | "devDependencies": {
12 | "@jsdevtools/npm-publish": "3.1.1",
13 | "@nx/eslint-plugin": "18.2.4",
14 | "@nx/jest": "18.2.4",
15 | "@nx/linter": "18.2.4",
16 | "@nx/nx-plugin": "16.0.0-beta.1",
17 | "@swc-node/register": "1.9.0",
18 | "@swc/cli": "0.3.12",
19 | "@swc/core": "1.4.13",
20 | "@types/jest": "29.5.12",
21 | "@types/node": "20.12.7",
22 | "@typescript-eslint/eslint-plugin": "7.6.0",
23 | "@typescript-eslint/parser": "7.6.0",
24 | "eslint": "8.56.0",
25 | "eslint-config-airbnb-typescript": "17.1.0",
26 | "eslint-config-prettier": "9.1.0",
27 | "eslint-plugin-import": "2.29.1",
28 | "jest": "29.7.0",
29 | "jest-environment-jsdom": "29.7.0",
30 | "jsonc-eslint-parser": "2.4.0",
31 | "nx": "18.2.4",
32 | "prettier": "3.2.5",
33 | "semantic-release": "23.0.8",
34 | "ts-jest": "29.1.2",
35 | "ts-node": "10.9.2",
36 | "typescript": "5.3.3"
37 | },
38 | "dependencies": {
39 | "@nx/devkit": "18.2.4",
40 | "@swc/helpers": "0.5.8",
41 | "tslib": "2.6.2"
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/plugin/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx", "*.d.ts"],
7 | "extends": [
8 | "airbnb-base",
9 | "airbnb-typescript/base"
10 | ],
11 | "parserOptions": {
12 | "project": ["plugin/tsconfig.linter.json"]
13 | },
14 | "rules": {
15 | "max-len": ["error", 150],
16 | "import/no-extraneous-dependencies": "off",
17 | "import/extensions": ["error", "never", { "json": "never" }],
18 | "@typescript-eslint/indent": ["error", 4]
19 | }
20 | },
21 | {
22 | "files": ["./package.json", "./generators.json", "./executors.json"],
23 | "parser": "jsonc-eslint-parser",
24 | "rules": {
25 | "@nx/nx-plugin-checks": "error"
26 | }
27 | }
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/plugin/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 |
4 |
5 | # nx-biome
6 |
7 | **[Nx](https://nx.dev) plugin to use [Biome](https://biomejs.dev/) toolchain in your Nx workspace.**
8 |
9 | [](https://nx.dev)
10 | [](https://stylelint.io)
11 | [](https://github.com/Phillip9587/nx-stylelint/actions/workflows/ci.yml)
12 | [](https://github.com/phillip9587/nx-stylelint/blob/main/LICENSE)
13 | [](https://www.npmjs.com/package/nx-stylelint)
14 | [](https://www.npmjs.com/package/nx-stylelint)
15 |
16 |
17 |
18 |
19 |
20 | # 🚀 Features
21 |
22 | @gitopslovers/nx-biome provides a set of power-ups for [Nx](https://nx.dev) to lint, format and analyze your projects with [Biome](ttps://biomejs.dev/).
23 |
24 | - **Executor**: Provides some executor to lint, format and analyze your files with Biome.
25 | - **Generators**: Helping you to configure your projects.
26 | - **Configuration**: Per Project configuration of Biome extending a workspace configuration.
27 | - **Only Affected**: Uses Nx to support linting formatting and analyzing only affected projects.
28 | - **Cache**: Uses Nx to cache already touched projects.
29 |
30 | # 📦 Installation
31 |
32 | **using [npm](https://npmjs.com)**
33 |
34 | ```shell
35 | npm i -D @gitopslovers/nx-biome
36 | ```
37 |
38 | # 🛠️ Configuring Biome for a project
39 |
40 | To add a Biome configuration to a project you just have to run the `@gitopslovers/nx-biome:configuration` generator.
41 |
42 | ```shell
43 | nx g @gitopslovers/nx-biome:configuration --project
44 | ```
45 |
46 | The generator adds a `biome.json` configuration file at the project root which extends the root `biome.json` and adds a `biome-lint` target to the project.
47 |
48 | At the first run the generator installs all required dependencies and creates a `biome.json` file at the workspace root. It also configures the `namedInputs` for the `biome-lint` targets.
49 |
50 | # Examples
51 |
52 | Run `biome-lint` for a project
53 |
54 | ```shell
55 | nx biome-lint {{projectName}}
56 | ```
57 |
58 | Run `biome-lint` for all projects
59 |
60 | ```shell
61 | nx run-many --target=biome-lint
62 | ```
63 |
64 | Run `biome-lint` for affected projects
65 |
66 | ```shell
67 | nx affected --target=biome-lint
68 | ```
69 |
70 | # 📖 Documentation
71 |
72 | ## `@gitopslovers/nx-biome:configuration` generator
73 |
74 | Add Biome configuration to a project.
75 |
76 | ### Usage
77 |
78 | Add configuration to a project:
79 |
80 | `nx g @gitopslovers/nx-biome:configuration --project projectName`
81 |
82 | ### Options
83 |
84 | | Option | Value | Description |
85 | | ------------ | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
86 | | `project` | `string` | The name of the project. |
87 |
88 | ## `@gitopslovers/nx-biome:biome-lint` executor
89 |
90 | Run Biome linter on a project.
91 |
92 | Target Options can be configured in `project.json` or when the executor is invoked.
93 |
94 | See: https://nx.dev/configuration/projectjson#targets
95 |
96 | ### Options
97 |
98 | | Option | Value | Default | Description |
99 | | ------------------------------- | ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
100 | | `lintFilePatterns` | `string[]` | | One or more files/dirs/globs to pass directly to Biome's lint() method. |
101 |
--------------------------------------------------------------------------------
/plugin/executors.json:
--------------------------------------------------------------------------------
1 | {
2 | "executors": {
3 | "biome-lint": {
4 | "implementation": "./src/executors/lint/executor",
5 | "schema": "./src/executors/lint/schema.json",
6 | "description": "Lint files using Biome"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/plugin/generators.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Nx Biome",
3 | "version": "1.0",
4 | "extends": ["@nx/workspace"],
5 | "generators": {
6 | "init": {
7 | "factory": "./src/generators/init/generator",
8 | "schema": "./src/generators/init/schema.json",
9 | "description": "Add Biome configuration and dependencies to the workspace.",
10 | "hidden": true
11 | },
12 | "configuration": {
13 | "factory": "./src/generators/configuration/generator",
14 | "schema": "./src/generators/configuration/schema.json",
15 | "description": "Add Biome configuration to a project.",
16 | "aliases": ["config"]
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/plugin/jest.config.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | export default {
3 | displayName: 'nx-sass',
4 | preset: '../jest.preset.js',
5 | transform: {
6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }],
7 | },
8 | moduleFileExtensions: ['ts', 'js', 'html'],
9 | coverageDirectory: '../coverage',
10 | };
11 |
--------------------------------------------------------------------------------
/plugin/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@gitopslovers/nx-biome",
3 | "version": "1.5.0",
4 | "type": "commonjs",
5 | "generators": "./generators.json",
6 | "executors": "./executors.json"
7 | }
8 |
--------------------------------------------------------------------------------
/plugin/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nx-biome",
3 | "$schema": "../node_modules/nx/schemas/project-schema.json",
4 | "sourceRoot": "plugin/src",
5 | "projectType": "library",
6 | "targets": {
7 | "build": {
8 | "executor": "@nx/js:tsc",
9 | "outputs": ["{options.outputPath}"],
10 | "options": {
11 | "outputPath": "dist",
12 | "main": "plugin/src/index.ts",
13 | "tsConfig": "plugin/tsconfig.lib.json",
14 | "assets": [
15 | "plugin/*.md",
16 | {
17 | "input": "./plugin/src",
18 | "glob": "**/!(*.ts)",
19 | "output": "./src"
20 | },
21 | {
22 | "input": "./plugin/src",
23 | "glob": "**/*.d.ts",
24 | "output": "./src"
25 | },
26 | {
27 | "input": "./plugin",
28 | "glob": "generators.json",
29 | "output": "."
30 | },
31 | {
32 | "input": "./plugin",
33 | "glob": "executors.json",
34 | "output": "."
35 | }
36 | ]
37 | }
38 | },
39 | "lint": {},
40 | "test": {}
41 | },
42 | "tags": []
43 | }
44 |
--------------------------------------------------------------------------------
/plugin/src/executors/lint/executor.ts:
--------------------------------------------------------------------------------
1 | import { exec } from 'node:child_process';
2 | import type { LintExecutorSchema } from './schema';
3 |
4 | /**
5 | * Execute a command and return a promise
6 | *
7 | * @param cmd The command to execute
8 | *
9 | * @returns A promise that resolves with the output of the command
10 | */
11 | export function execPromise(cmd: string): Promise {
12 | return new Promise((resolve, reject) => {
13 | const response = exec(cmd, (err, data) => {
14 | response.removeAllListeners();
15 |
16 | if (err) {
17 | reject(err);
18 | return;
19 | }
20 |
21 | resolve(data);
22 | });
23 |
24 | response.stdout.on('data', (data) => {
25 | // eslint-disable-next-line no-console
26 | console.log(data);
27 | });
28 |
29 | response.stderr.on('data', (data) => {
30 | // eslint-disable-next-line no-console
31 | console.error(data);
32 | });
33 | });
34 | }
35 |
36 | /**
37 | * Run the lint executor
38 | *
39 | * @param options The options for the lint executor
40 | *
41 | * @returns A promise that resolves with the result of the lint executor
42 | */
43 | export default async function runExecutor(options: LintExecutorSchema) {
44 | let lintCommand = `biome lint ${options.lintFilePatterns}`;
45 |
46 | if (options.write) {
47 | lintCommand += ' --write';
48 | }
49 |
50 | if (options.unsafe) {
51 | lintCommand += ' --unsafe';
52 | }
53 |
54 | await execPromise(lintCommand);
55 |
56 | return {
57 | success: true,
58 | };
59 | }
60 |
--------------------------------------------------------------------------------
/plugin/src/executors/lint/schema.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Schema for the lint executor options
3 | */
4 | export interface LintExecutorSchema {
5 | lintFilePatterns: string[];
6 | write: boolean;
7 | unsafe: boolean;
8 | }
9 |
--------------------------------------------------------------------------------
/plugin/src/executors/lint/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/schema",
3 | "title": "Schema for Nx Biome linter executor",
4 | "description": "Lint files using BiomeJS",
5 | "type": "object",
6 | "properties": {
7 | "lintFilePatterns": {
8 | "type": "array",
9 | "description": "List of file patterns to lint"
10 | }
11 | },
12 | "required": ["lintFilePatterns"]
13 | }
14 |
--------------------------------------------------------------------------------
/plugin/src/generators/configuration/generator.ts:
--------------------------------------------------------------------------------
1 | import type { GeneratorCallback, Tree } from '@nx/devkit';
2 | import {
3 | joinPathFragments,
4 | logger,
5 | offsetFromRoot,
6 | readProjectConfiguration,
7 | updateProjectConfiguration,
8 | writeJson,
9 | } from '@nx/devkit';
10 | import type { LintExecutorSchema } from '../../executors/lint/schema';
11 | import initGenerator from '../init/generator';
12 | import { NormalizedSchema } from '../../utils/normalized.schema';
13 | import type { ConfigurationGeneratorSchema } from './schema';
14 |
15 | /**
16 | * Normalize the schema options
17 | *
18 | * @param tree The file tree
19 | * @param options The options to normalize
20 | *
21 | * @returns The normalized options
22 | */
23 | function normalizeSchema(tree: Tree, options: ConfigurationGeneratorSchema): NormalizedSchema {
24 | const projectConfig = readProjectConfiguration(tree, options.project);
25 |
26 | return {
27 | ...options,
28 | linter: options.linter ?? true,
29 | projectRoot: projectConfig.root,
30 | biomeTargetExists: !!projectConfig.targets?.biome,
31 | };
32 | }
33 |
34 | /**
35 | * Create a Biome configuration file
36 | *
37 | * @param tree The file tree
38 | * @param options The options for the configuration file creation
39 | */
40 | function createBiomeConfig(tree: Tree, options: NormalizedSchema): void {
41 | const config = {
42 | extends: [joinPathFragments(offsetFromRoot(options.projectRoot), 'biome.json')],
43 | linter: {
44 | enabled: false,
45 | rules: {},
46 | },
47 | };
48 |
49 | if (options.linter) {
50 | config.linter.enabled = true;
51 | config.linter.rules = {
52 | recommended: true,
53 | };
54 | }
55 |
56 | writeJson(tree, joinPathFragments(options.projectRoot, 'biome.json'), config);
57 | }
58 |
59 | /**
60 | * Add a Biome target to a project
61 | *
62 | * @param tree The file tree
63 | * @param options The options for the target addition
64 | */
65 | function addBiomeTarget(tree: Tree, options: NormalizedSchema): void {
66 | const projectConfig = readProjectConfiguration(tree, options.project);
67 |
68 | const targetOptions: Partial = {
69 | lintFilePatterns: [joinPathFragments(options.projectRoot, '**', '*.ts')],
70 | write: false,
71 | unsafe: false,
72 | };
73 |
74 | projectConfig.targets = {
75 | ...projectConfig.targets,
76 | 'biome-lint': {
77 | executor: '@gitopslovers/nx-biome:biome-lint',
78 | outputs: ['{options.outputFile}'],
79 | options: targetOptions,
80 | },
81 | };
82 |
83 | updateProjectConfiguration(tree, options.project, projectConfig);
84 | }
85 |
86 | /**
87 | * Generate a Biome configuration and target for a project
88 | *
89 | * @param host The file tree
90 | * @param options The options for the configuration generator
91 | *
92 | * @returns A promise that resolves with the generator callback
93 | */
94 | async function configurationGenerator(host: Tree, options: ConfigurationGeneratorSchema): Promise {
95 | const init = await initGenerator(host, { linter: options.linter });
96 |
97 | const normalizedOptions = normalizeSchema(host, options);
98 |
99 | if (normalizedOptions.biomeTargetExists) {
100 | logger.error(`Project '${options.project}' already has a Biome target.`);
101 | return;
102 | }
103 |
104 | logger.info(`🛠️ Adding Biome linter configuration and target to '${options.project}'...\n`);
105 |
106 | createBiomeConfig(host, normalizedOptions);
107 | addBiomeTarget(host, normalizedOptions);
108 |
109 | return init;
110 | }
111 |
112 | export default configurationGenerator;
113 |
--------------------------------------------------------------------------------
/plugin/src/generators/configuration/schema.d.ts:
--------------------------------------------------------------------------------
1 | export interface ConfigurationGeneratorSchema {
2 | project: string;
3 | linter?: boolean;
4 | }
5 |
--------------------------------------------------------------------------------
/plugin/src/generators/configuration/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json-schema.org/draft-07/schema",
3 | "$id": "NxBiomeProjectConfiguration",
4 | "title": "Add Biome configuration to a project.",
5 | "type": "object",
6 | "additionalProperties": false,
7 | "properties": {
8 | "project": {
9 | "type": "string",
10 | "description": "The name of the project.",
11 | "x-priority": "important",
12 | "x-prompt": "Which project do you want to add the configuration?",
13 | "x-dropdown": "projects"
14 | },
15 | "linter": {
16 | "description": "Add linting with Biome to the project.",
17 | "type": "boolean",
18 | "default": true,
19 | "x-prompt": {
20 | "message": "Include the Linter functionality in the configuration?",
21 | "type": "boolean"
22 | }
23 | }
24 | },
25 | "required": ["project"]
26 | }
--------------------------------------------------------------------------------
/plugin/src/generators/init/generator.ts:
--------------------------------------------------------------------------------
1 | import {
2 | type GeneratorCallback,
3 | type Tree,
4 | addDependenciesToPackageJson,
5 | joinPathFragments,
6 | logger,
7 | readJson,
8 | readNxJson,
9 | updateNxJson as devkitUpdateNxJson,
10 | stripIndents,
11 | } from '@nx/devkit';
12 | import { biomeConfigFile } from '../../utils/config-file';
13 | import { biomeVersion } from '../../utils/versions';
14 | import type { InitGeneratorSchema } from './schema';
15 |
16 | /**
17 | * Update the package.json file with the required dependencies.
18 | *
19 | * @param tree The current file tree.
20 | *
21 | * @returns The generator callback.
22 | */
23 | function updateDependencies(tree: Tree): GeneratorCallback {
24 | const packageJson = readJson(tree, 'package.json');
25 | const devDependencies: Record = {};
26 |
27 | //
28 | if (!packageJson.dependencies?.stylelint) {
29 | devDependencies['@biomejs/biome'] = biomeVersion;
30 | }
31 |
32 | return addDependenciesToPackageJson(tree, {}, devDependencies);
33 | }
34 |
35 | /**
36 | * Update the nx.json file with the required configuration.
37 | *
38 | * @param tree The current file tree.
39 | */
40 | function updateNxJson(tree: Tree): void {
41 | const nxJson = readNxJson(tree);
42 | if (!nxJson) {
43 | logger.warn(
44 | stripIndents`nx.json not found. Create a nx.json file and rerun the generator with \'nx run nx-biome:init\'`,
45 | );
46 | return;
47 | }
48 |
49 | const biomeProjectConfigFile = `!${joinPathFragments('{projectRoot}', biomeConfigFile)}`;
50 |
51 | // Add Biome configuration file to the namedInputs.production array
52 | if (
53 | nxJson.namedInputs?.production
54 | && !nxJson.namedInputs?.production.includes(biomeProjectConfigFile)
55 | ) {
56 | nxJson.namedInputs?.production.push(biomeProjectConfigFile);
57 | }
58 |
59 | // Set targetDefault for Biome
60 | nxJson.targetDefaults ??= {};
61 | nxJson.targetDefaults['lint-biome'] ??= {};
62 | nxJson.targetDefaults['lint-biome'].inputs ??= ['default'];
63 | nxJson.targetDefaults['lint-biome'].cache = true;
64 |
65 | const rootBiomeConfigurationFile = joinPathFragments(
66 | '{workspaceRoot}',
67 | biomeConfigFile,
68 | );
69 |
70 | if (
71 | !nxJson.targetDefaults['lint-biome'].inputs.includes(
72 | rootBiomeConfigurationFile,
73 | )
74 | ) {
75 | nxJson.targetDefaults['lint-biome'].inputs.push(rootBiomeConfigurationFile);
76 | }
77 |
78 | devkitUpdateNxJson(tree, nxJson);
79 | }
80 |
81 | /**
82 | * Initialize the generator.
83 | *
84 | * @param tree The current file tree.
85 | * @param options The generator options.
86 | *
87 | * @returns The generator callback.
88 | */
89 | async function initGenerator(tree: Tree, options: InitGeneratorSchema): Promise {
90 | const installTask = updateDependencies(tree);
91 |
92 | updateNxJson(tree);
93 |
94 | return installTask;
95 | }
96 |
97 | export default initGenerator;
98 |
--------------------------------------------------------------------------------
/plugin/src/generators/init/schema.d.ts:
--------------------------------------------------------------------------------
1 | export interface InitGeneratorSchema {
2 | linter?: boolean;
3 | }
4 |
--------------------------------------------------------------------------------
/plugin/src/generators/init/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "cli": "nx",
3 | "$id": "NxBiomeInit",
4 | "title": "Initialize Biome Plugin",
5 | "description": "Add Biome configuration and dependencies to the workspace.",
6 | "type": "object",
7 | "additionalProperties": false,
8 | "properties": {
9 | "skipPackageJson": {
10 | "description": "Do not add dependencies to `package.json`.",
11 | "type": "boolean",
12 | "default": false
13 | },
14 | "keepExistingVersions": {
15 | "type": "boolean",
16 | "x-priority": "internal",
17 | "description": "Keep existing dependencies versions",
18 | "default": false
19 | },
20 | "updatePackageScripts": {
21 | "type": "boolean",
22 | "x-priority": "internal",
23 | "description": "Update `package.json` scripts with inferred targets",
24 | "default": false
25 | }
26 | },
27 | "required": []
28 | }
--------------------------------------------------------------------------------
/plugin/src/utils/config-file.ts:
--------------------------------------------------------------------------------
1 | // eslint-disable-next-line import/prefer-default-export
2 | export const biomeConfigFile = 'biome.json';
3 |
--------------------------------------------------------------------------------
/plugin/src/utils/normalized.schema.ts:
--------------------------------------------------------------------------------
1 | import { ConfigurationGeneratorSchema } from '../generators/configuration/schema';
2 |
3 | /**
4 | * The normalized schema for the configuration generator
5 | */
6 | export interface NormalizedSchema extends ConfigurationGeneratorSchema {
7 | projectRoot: string;
8 | biomeTargetExists: boolean;
9 | }
10 |
--------------------------------------------------------------------------------
/plugin/src/utils/versions.ts:
--------------------------------------------------------------------------------
1 | export const biomeVersion = '^1.8.3';
2 |
3 | export default biomeVersion;
4 |
--------------------------------------------------------------------------------
/plugin/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.base.json",
3 | "compilerOptions": {
4 | "module": "commonjs"
5 | },
6 | "files": [],
7 | "include": [],
8 | "references": [
9 | {
10 | "path": "./tsconfig.lib.json"
11 | },
12 | {
13 | "path": "./tsconfig.spec.json"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/plugin/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../dist/out-tsc",
5 | "declaration": true,
6 | "types": ["node"]
7 | },
8 | "include": ["src/**/*.ts"],
9 | "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/plugin/tsconfig.linter.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "declaration": true,
5 | "types": ["node"]
6 | },
7 | "include": ["src/**/*.ts", "tests/**/*.spec.ts",],
8 | "exclude": ["jest.config.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/plugin/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": [
9 | "jest.config.ts",
10 | "tests/**/*.spec.ts",
11 | "tests/**/*.d.ts"
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/tsconfig.base.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "rootDir": ".",
5 | "sourceMap": true,
6 | "declaration": false,
7 | "moduleResolution": "node",
8 | "emitDecoratorMetadata": true,
9 | "experimentalDecorators": true,
10 | "importHelpers": true,
11 | "target": "es2015",
12 | "module": "esnext",
13 | "lib": ["es2017", "dom"],
14 | "skipLibCheck": true,
15 | "skipDefaultLibCheck": true,
16 | "baseUrl": ".",
17 | "paths": {
18 | "@gitopslovers/nx-biome": ["plugin/src/index.ts"]
19 | }
20 | },
21 | "exclude": ["node_modules", "tmp"]
22 | }
--------------------------------------------------------------------------------