Author SHA1 Message Date
Renovate 7a393df82b chore(deps): update actions/setup-node action to v7
renovate/stability-days Updates have met minimum release age requirement
Lint / pre-commit Linting (push) Successful in 1m2s
Test / Run Tests (push) Successful in 4m33s
2026-07-24 22:43:15 +00:00
13 changed files with 2381 additions and 1506 deletions
+18
View File
@@ -0,0 +1,18 @@
name: Lint
on:
push:
workflow_dispatch:
jobs:
pre-commit-lint:
name: pre-commit Linting
runs-on: pi
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
- run: pip install pre-commit
shell: bash
- name: Pre Commit
run: SKIP=no-commit-to-branch pre-commit run -a
shell: bash
-55
View File
@@ -1,55 +0,0 @@
name: Recompile dist/ on Renovate PR
on:
pull_request:
types: [opened, synchronize]
paths:
- package.json
- pnpm-lock.yaml
- index.js
- monitor.js
permissions:
contents: write
jobs:
recompile:
runs-on: pi
if: |
(github.actor == 'renovate[bot]' || contains(github.head_ref, 'renovate/')) &&
!contains(github.event.head_commit.message, '[skip compile]')
steps:
- name: Checkout PR Branch
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref }}
fetch-depth: 0
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '22'
cache: pnpm
- name: Clean Install
run: pnpm install --frozen-lockfile --ignore-scripts
shell: bash
- name: Build
run: pnpm run build
shell: bash
- name: Commit dist/
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add dist/
if git diff --staged --quiet; then
echo "No changes to dist/"
else
git commit -m "chore: compile action bundle [skip compile]"
git push origin HEAD:${{ github.head_ref }}
fi
shell: bash
+2 -5
View File
@@ -2,7 +2,6 @@ name: Test
on: on:
push: push:
pull_request:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@@ -11,12 +10,10 @@ jobs:
runs-on: pi runs-on: pi
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with: with:
node-version: '24' node-version: '24'
cache: pnpm - run: npm install
- run: pnpm install --frozen-lockfile
shell: bash shell: bash
- run: pnpm test - run: npm test
shell: bash shell: bash
+1 -2
View File
@@ -21,7 +21,6 @@ repos:
hooks: hooks:
- id: pretty-format-yaml - id: pretty-format-yaml
args: [--autofix] args: [--autofix]
exclude: ^pnpm-lock\.yaml$
- repo: https://github.com/pre-commit/mirrors-prettier - repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8 rev: v4.0.0-alpha.8
@@ -30,7 +29,7 @@ repos:
types_or: [css, javascript] types_or: [css, javascript]
- repo: https://github.com/python-jsonschema/check-jsonschema - repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.38.0 rev: 0.37.4
hooks: hooks:
- id: check-renovate - id: check-renovate
- id: check-github-actions - id: check-github-actions
+4 -10
View File
@@ -7,7 +7,6 @@ This repository is maintained by Gemini.
* **Test-Driven Development (TDD):** Wherever possible, Test-Driven Development principles should be followed. Write tests before writing the code they are intended to validate. * **Test-Driven Development (TDD):** Wherever possible, Test-Driven Development principles should be followed. Write tests before writing the code they are intended to validate.
* **Pre-commit Hooks:** Ensure that `pre-commit` hooks are installed and active before making any commits. This can be done by running `pre-commit install` in your local repository. * **Pre-commit Hooks:** Ensure that `pre-commit` hooks are installed and active before making any commits. This can be done by running `pre-commit install` in your local repository.
* **Note for Gemini:** Git commits trigger pre-commit hooks, which can take several seconds (or minutes) to complete. Checking the command status for git commit is only appropriate every 120s. * **Note for Gemini:** Git commits trigger pre-commit hooks, which can take several seconds (or minutes) to complete. Checking the command status for git commit is only appropriate every 120s.
* **Package Manager Preferences:** Always use `pnpm` and `pnpx`. Never use `npm` or `npx` under any circumstances. All package management operations, script runs, and tool invocations must use `pnpm` / `pnpx`.
## Repository Comparison ## Repository Comparison
@@ -20,7 +19,7 @@ This project uses [Vitest](https://vitest.dev/) for testing. The tests are locat
To run the tests locally, use the following command: To run the tests locally, use the following command:
```bash ```bash
pnpm test npm test
``` ```
### Testing Pipeline ### Testing Pipeline
@@ -30,11 +29,6 @@ The tests are automatically run on every push and workflow dispatch using a Gite
The Gitea workflow does the following: The Gitea workflow does the following:
1. Checks out the code. 1. Checks out the code.
2. Sets up Node.js and pnpm. 2. Sets up Node.js.
3. Installs the dependencies using `pnpm install`. 3. Installs the dependencies using `npm install`.
4. Runs the tests using `pnpm test`. 4. Runs the tests using `npm test`.
### Automated Recompilation & Permissions
* The automated recompilation workflow (`.gitea/workflows/recompile-dist.yaml`) recompiles `dist/index.js` on Renovate PRs and requires `contents: write` permissions to push back to the branch.
* Ensure that the Gitea repository workflow settings have write permissions enabled (**Settings** ➔ **Actions****General****Workflow permissions****Read and write permissions**).
+3 -3
View File
@@ -84,7 +84,7 @@ This project includes a build step to prepare the action for use.
### Why a Build Step? ### Why a Build Step?
We use a build step to compile the JavaScript code and its dependencies into a single, self-contained file (`dist/index.js`). This approach is chosen for the following reasons: We use a build step to compile the JavaScript code and its dependencies into a single, self-contained file (`dist/index.js`). This approach is chosen for the following reasons:
1. **Zero-configuration at Runtime:** By bundling everything, the action runner doesn't need to run `pnpm install` or `npm install`, which speeds up the action execution. 1. **Zero-configuration at Runtime:** By bundling everything, the action runner doesn't need to run `npm install`, which speeds up the action execution.
2. **Reliability:** It guarantees that the exact versions of dependencies tested during development are used in the action, avoiding potential issues with version updates or missing packages. 2. **Reliability:** It guarantees that the exact versions of dependencies tested during development are used in the action, avoiding potential issues with version updates or missing packages.
3. **Standard Practice:** This is a recommended practice for JavaScript-based GitHub/Gitea Actions. 3. **Standard Practice:** This is a recommended practice for JavaScript-based GitHub/Gitea Actions.
@@ -100,8 +100,8 @@ We chose [`@vercel/ncc`](https://github.com/vercel/ncc) as the compiler because:
If you modify `index.js` or change dependencies, you must rebuild the project before committing: If you modify `index.js` or change dependencies, you must rebuild the project before committing:
```bash ```bash
pnpm install npm install
pnpm run build npm run build
``` ```
This will update the `dist/index.js` file, which should be committed to the repository. This will update the `dist/index.js` file, which should be committed to the repository.
+1 -1
View File
@@ -1,4 +1,4 @@
import { vi, describe, it, expect, beforeEach, afterEach } from "vitest"; import { vi, describe, it, expect, beforeEach } from "vitest";
// Mock @actions/core for all tests in this file // Mock @actions/core for all tests in this file
vi.mock("@actions/core", () => ({ vi.mock("@actions/core", () => ({
+8 -8
View File
File diff suppressed because one or more lines are too long
+2326
View File
File diff suppressed because it is too large Load Diff
+3 -4
View File
@@ -3,7 +3,6 @@
"version": "0.2.1", "version": "0.2.1",
"description": "Deploys screeps code to the official game or a private server.", "description": "Deploys screeps code to the official game or a private server.",
"type": "module", "type": "module",
"packageManager": "pnpm@11.25.0",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"start": "node index.js", "start": "node index.js",
@@ -17,8 +16,8 @@
"screeps-api": "^1.7.2" "screeps-api": "^1.7.2"
}, },
"devDependencies": { "devDependencies": {
"@vercel/ncc": "^0.44.1", "@vercel/ncc": "^0.38.4",
"@vitest/coverage-v8": "^4.1.11", "@vitest/coverage-v8": "^4.0.16",
"vitest": "^4.1.11" "vitest": "^4.0.16"
} }
} }
-1409
View File
File diff suppressed because it is too large Load Diff
-3
View File
@@ -1,3 +0,0 @@
allowBuilds:
bufferutil: true
utf-8-validate: true
+15 -6
View File
@@ -5,11 +5,20 @@
"config:recommended", "config:recommended",
":automergeLinters" ":automergeLinters"
], ],
"rebaseWhen": "behind-base-branch", "packageRules": [
"branchConcurrentLimit": 2, {
"prConcurrentLimit": 2, "matchManagers": [
"gitIgnoredAuthors": [ "npm"
"github-actions[bot]@users.noreply.github.com", ],
"bot@horstenkamp.eu" "postUpgradeTasks": {
"commands": [
"npm ci",
"npm run build"
],
"fileFilters": [
"dist/index.js"
]
}
}
] ]
} }