-
Notifications
You must be signed in to change notification settings - Fork 3
chore(nix): remove redundant tsgolint and add nix-workflow rule #297
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
Merged
+93
−5
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| # Nix Workflow | ||
|
|
||
| This rule provides guidance on Nix usage in the StackOne SDK. | ||
|
|
||
| ## Development Environment | ||
|
|
||
| The project uses `flake.nix` to define the development environment with `nix develop`. | ||
|
|
||
| ### Adding Development Tools | ||
|
|
||
| To add a new tool to the development environment, add it to `buildInputs` in `flake.nix`: | ||
|
|
||
| ```nix | ||
| buildInputs = with pkgs; [ | ||
| # runtime | ||
| nodejs_24 | ||
| pnpm_10 | ||
|
|
||
| # formatting and linting tools | ||
| oxlint # includes tsgolint | ||
| oxfmt | ||
|
|
||
| # your new tool here | ||
| new-tool | ||
| ]; | ||
| ``` | ||
|
|
||
| ## CI Workflow | ||
|
|
||
| CI uses `nix profile install` via the `.github/actions/setup-nix/action.yaml` composite action. | ||
|
|
||
| ### Adding Tools to CI Jobs | ||
|
|
||
| Specify tools in the `tools` input of the setup-nix action: | ||
|
|
||
| ```yaml | ||
| - name: Setup Nix | ||
| uses: ./.github/actions/setup-nix | ||
| with: | ||
| tools: nodejs_24 pnpm_10 oxlint oxfmt | ||
| ``` | ||
|
|
||
| The action installs packages using: | ||
|
|
||
| ```bash | ||
| nix profile install --inputs-from . nixpkgs#tool1 nixpkgs#tool2 | ||
| ``` | ||
|
|
||
| ### CI Tool Configuration | ||
|
|
||
| - **Default tools**: `nodejs_24 pnpm_10` (defined in action.yaml) | ||
| - **Skip pnpm install**: Set `skip-pnpm-install: 'true'` for jobs that don't need node dependencies | ||
|
|
||
| ### Example: Adding a New Tool to Lint Job | ||
|
|
||
| ```yaml | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Nix | ||
| uses: ./.github/actions/setup-nix | ||
| with: | ||
| tools: nodejs_24 pnpm_10 oxlint oxfmt new-tool | ||
| - name: Run Lint | ||
| run: pnpm run lint | ||
| ``` | ||
|
|
||
| ## Build Flags | ||
|
|
||
| Always use these flags when running Nix build commands locally: | ||
|
|
||
| ```bash | ||
| --print-build-logs --show-trace | ||
| ``` | ||
|
|
||
| Example: | ||
|
|
||
| ```bash | ||
| nix build --print-build-logs --show-trace | ||
| nix flake check --print-build-logs --show-trace | ||
| ``` | ||
|
|
||
| ## Notes | ||
|
|
||
| - Some packages bundle multiple tools (e.g., `oxlint` includes `tsgolint`) | ||
| - Check nixpkgs for package contents before adding redundant dependencies | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,6 @@ | |
| # formatting and linting tools | ||
| similarity | ||
| nixfmt | ||
| tsgolint | ||
| oxlint | ||
| oxfmt | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new nix-workflow.md file is missing the YAML frontmatter that other rule files in this directory include. Add frontmatter with 'description' and 'alwaysApply' fields to maintain consistency with other rules like development-workflow.md and pnpm-usage.md.