Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
name: Build and Test Node SDK

on:
pull_request:
branches:
- main
types: ["opened", "synchronize", "reopened"]
pull_request:
branches:
- main
types: ["opened", "synchronize", "reopened"]

workflow_dispatch:
workflow_dispatch:

push:
branches:
- check-tests
push:
branches:
- check-tests

jobs:
build-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
build-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
- name: Set up Node.js
uses: actions/setup-node@v4

- name: Enable corepack
run: corepack enable pnpm
- name: Enable corepack
run: corepack enable pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run lint
run: pnpm run check:lint
- name: Run lint
run: pnpm run check:lint

- name: Run format
run: pnpm run check:format
- name: Run format
run: pnpm run check:format

- name: Run build
run: pnpm run build
- name: Run build
run: pnpm run build

- name: Run tests
run: pnpm run test:e2e
env:
PLANE_API_KEY: ${{ secrets.PLANE_API_KEY }}
PLANE_BASE_URL: ${{ secrets.PLANE_BASE_URL }}
TEST_WORKSPACE_SLUG: ${{ vars.TEST_WORKSPACE_SLUG }}
- name: Run tests
run: pnpm run test:e2e
env:
PLANE_API_KEY: ${{ secrets.PLANE_API_KEY }}
PLANE_BASE_URL: ${{ secrets.PLANE_BASE_URL }}
TEST_WORKSPACE_SLUG: ${{ vars.TEST_WORKSPACE_SLUG }}
4 changes: 2 additions & 2 deletions .github/workflows/publish-node-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
node-version: "24"
registry-url: "https://registry.npmjs.org"

- name: Enable corepack
run: corepack enable pnpm
Expand Down
8 changes: 8 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 120,
"tabWidth": 2,
"trailingComma": "es5",
"sortPackageJson": false,
"ignorePatterns": ["out/", "dist/", "build/", "node_modules/"]
}
128 changes: 128 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["typescript"],
"categories": {
"correctness": "off"
},
"env": {
"builtin": true
},
"rules": {
"constructor-super": "error",
"for-direction": "error",
"no-async-promise-executor": "error",
"no-case-declarations": "error",
"no-class-assign": "error",
"no-compare-neg-zero": "error",
"no-cond-assign": "error",
"no-const-assign": "error",
"no-constant-binary-expression": "error",
"no-constant-condition": "error",
"no-control-regex": "error",
"no-debugger": "error",
"no-delete-var": "error",
"no-dupe-class-members": "error",
"no-dupe-else-if": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-empty": "error",
"no-empty-character-class": "error",
"no-empty-pattern": "error",
"no-empty-static-block": "error",
"no-ex-assign": "error",
"no-extra-boolean-cast": "error",
"no-fallthrough": "error",
"no-func-assign": "error",
"no-global-assign": "error",
"no-import-assign": "error",
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
"no-loss-of-precision": "error",
"no-misleading-character-class": "error",
"no-new-native-nonconstructor": "error",
"no-nonoctal-decimal-escape": "error",
"no-obj-calls": "error",
"no-prototype-builtins": "error",
"no-redeclare": "error",
"no-regex-spaces": "error",
"no-self-assign": "error",
"no-setter-return": "error",
"no-shadow-restricted-names": "error",
"no-sparse-arrays": "error",
"no-this-before-super": "error",
"no-unexpected-multiline": "error",
"no-unsafe-finally": "error",
"no-unsafe-negation": "error",
"no-unsafe-optional-chaining": "error",
"no-unused-labels": "error",
"no-unused-private-class-members": "error",
"no-useless-backreference": "error",
"no-useless-catch": "error",
"no-useless-escape": "error",
"no-with": "error",
"require-yield": "error",
"use-isnan": "error",
"valid-typeof": "error",
"no-array-constructor": "error",
"no-unused-expressions": "error",
"typescript/no-unused-vars": [
"warn",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
],
"no-console": "warn",
"typescript/ban-ts-comment": "error",
"typescript/no-duplicate-enum-values": "error",
"typescript/no-empty-object-type": "error",
"typescript/no-explicit-any": "warn",
"typescript/no-extra-non-null-assertion": "error",
"typescript/no-misused-new": "error",
"typescript/no-namespace": "error",
"typescript/no-non-null-asserted-optional-chain": "error",
"typescript/no-require-imports": "error",
"typescript/no-this-alias": "error",
"typescript/no-unnecessary-type-constraint": "error",
"typescript/no-unsafe-declaration-merging": "error",
"typescript/no-unsafe-function-type": "error",
"typescript/no-wrapper-object-types": "error",
"typescript/prefer-as-const": "error",
"typescript/prefer-namespace-keyword": "error",
"typescript/triple-slash-reference": "error"
},
"overrides": [
{
"files": ["**/*.ts", "**/*.js"],
"env": {
"node": true
}
},
{
"files": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
"rules": {
"constructor-super": "off",
"no-class-assign": "off",
"no-const-assign": "off",
"no-dupe-class-members": "off",
"no-dupe-keys": "off",
"no-func-assign": "off",
"no-import-assign": "off",
"no-new-native-nonconstructor": "off",
"no-obj-calls": "off",
"no-redeclare": "off",
"no-setter-return": "off",
"no-this-before-super": "off",
"no-unsafe-negation": "off",
"no-var": "error",
"no-with": "off",
"prefer-const": "error",
"prefer-rest-params": "error",
"prefer-spread": "error"
}
}
]
}
4 changes: 0 additions & 4 deletions .prettierignore

This file was deleted.

5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

5 changes: 3 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ pnpm test:unit # Unit tests only
pnpm test:e2e # E2E tests only
pnpm test -- --testPathPattern=tests/unit/project # Run a single test file
pnpm test:coverage # Run with coverage report
pnpm check:lint # Lint check (ESLint)
pnpm check:lint # Lint check (oxlint)
pnpm fix:lint # Auto-fix lint issues
pnpm check:format # Format check (Prettier, 120 char width)
pnpm check:format # Format check (oxfmt, 120 char width)
pnpm fix:format # Auto-format
```

Expand All @@ -34,6 +34,7 @@ Tests live in `tests/unit/` and `tests/e2e/`. Tests require a `.env.test` file (
**BaseResource pattern** (`src/api/BaseResource.ts`): Abstract base class providing HTTP methods (get, post, patch, put, httpDelete) via axios. All API resource classes extend it. Handles both `apiKey` (X-Api-Key header) and `accessToken` (Bearer token) auth. Includes optional request/response logging with sensitive data sanitization.

**API resources** (`src/api/`): Each resource class extends BaseResource. Some have sub-resources as separate classes composed by the parent:

- `WorkItems/` → Comments, Attachments, Activities, Relations, WorkLogs
- `Customers/` → Properties, Requests
- `Teamspaces/` → Members, Projects
Expand Down
45 changes: 0 additions & 45 deletions eslint.config.mjs

This file was deleted.

5 changes: 4 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ This directory contains examples demonstrating how to use the Plane Node SDK.
## Setup

1. Install dependencies:

```bash
npm install
```

2. Set up environment variables:

```bash
export PLANE_API_KEY="your-api-key"
```
Expand All @@ -32,6 +34,7 @@ const client = new PlaneClient({
```

When enabled, you'll see detailed logs for:

- 🚀 Request details (method, URL, headers, data)
- ✅ Response details (status, data, headers)
- ❌ Error details (status, error message, response data)
Expand All @@ -52,9 +55,9 @@ When adding new examples:
4. Add documentation comments
5. Update this README with a description


## Environment Variables

Required environment variables:

- `PLANE_API_KEY` - Your Plane API key
- `PLANE_BASE_URL` - (Optional) Custom Plane instance URL
32 changes: 14 additions & 18 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/tests'],
testMatch: [
'**/__tests__/**/*.ts',
'**/?(*.)+(spec|test).ts'
],
preset: "ts-jest",
testEnvironment: "node",
roots: ["<rootDir>/tests"],
testMatch: ["**/__tests__/**/*.ts", "**/?(*.)+(spec|test).ts"],
transform: {
'^.+\\.ts$': ['ts-jest', {
tsconfig: 'tsconfig.jest.json'
}],
"^.+\\.ts$": [
"ts-jest",
{
tsconfig: "tsconfig.jest.json",
},
],
},
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/**/*.spec.ts'
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov', 'html'],
collectCoverageFrom: ["src/**/*.ts", "!src/**/*.d.ts", "!src/**/*.spec.ts"],
coverageDirectory: "coverage",
coverageReporters: ["text", "lcov", "html"],
testTimeout: 60000, // 60 seconds timeout for API tests
verbose: true,
// Allow tests to run in parallel but with some control
maxWorkers: 1, // Run tests sequentially to avoid API rate limits
};
};
Loading
Loading