Skip to content

Commit 4ca30a6

Browse files
Agents markdown and dependencies (#411)
* chore: add AGENTS guide and update npm dependencies Co-authored-by: Jeremy Ward <basicBrogrammer@users.noreply.github.com> * chore: modernize toolchain config after dependency upgrades Co-authored-by: Jeremy Ward <basicBrogrammer@users.noreply.github.com> * chore: remove unused lint plugin and upgrade eslint Co-authored-by: Jeremy Ward <basicBrogrammer@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent 5f3dc0c commit 4ca30a6

18 files changed

Lines changed: 64620 additions & 31023 deletions

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 52 deletions
This file was deleted.

AGENTS.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# AGENTS.md
2+
3+
Guidance for coding agents working in this repository.
4+
5+
## Project summary
6+
7+
- **Name:** Crosspost Markdown
8+
- **Type:** GitHub Action written in TypeScript
9+
- **Entry point:** `src/main.ts`
10+
- **Published artifact:** `dist/index.js` (bundled with `@vercel/ncc`)
11+
12+
## Local setup
13+
14+
1. Install dependencies:
15+
- `npm install`
16+
2. Run checks:
17+
- `npm run build`
18+
- `npm run lint`
19+
- `npm test`
20+
21+
## Common commands
22+
23+
- `npm run build` — compile TypeScript
24+
- `npm run lint` — run ESLint on `src/**/*.ts`
25+
- `npm run test` — run Jest test suite
26+
- `npm run package` — bundle action into `dist/index.js`
27+
- `npm run all` — run build, format, lint, package, and tests
28+
29+
## Repository layout
30+
31+
- `src/` — action implementation
32+
- `publish/` — publisher integrations (dev.to, medium)
33+
- `__tests__/` — shared/fixture-driven tests
34+
- `action.yml` — action metadata and inputs
35+
- `dist/` — generated bundle committed for GitHub Actions runtime
36+
37+
## Dependency updates
38+
39+
- Use npm for dependency management.
40+
- Update direct dependencies in `package.json`, then regenerate lockfile with `npm install`.
41+
- After dependency changes, run `npm run build && npm run lint && npm test`.
42+
- If runtime code changes are introduced, regenerate `dist/` with `npm run package`.
43+
44+
## Safety notes
45+
46+
- Do not commit secrets or API tokens.
47+
- Treat `dist/` as generated output; keep it in sync with runtime changes.

__mocks__/@actions/core.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export const getInput = (key: string) => {
33
switch (key) {
44
case 'dev-to-token':
55
return 'dev-to-token-testing';
6+
case 'medium-token':
7+
return '';
68
case 'github-token':
79
return 'gh-token-mock';
810
case 'content-dir':
@@ -17,3 +19,4 @@ export const getInput = (key: string) => {
1719
};
1820

1921
export const info = jest.fn();
22+
export const setFailed = jest.fn();

__mocks__/@actions/github.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ export const context = {
2626

2727
export const getOctokit = (token: string): any => {
2828
return {
29-
repos: {
30-
getCommit: () => new Commit(),
29+
rest: {
30+
repos: {
31+
getCommit: () => new Commit(),
32+
},
3133
},
3234
};
3335
};

0 commit comments

Comments
 (0)