Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d80cac1
fix: Enable polling, better debouncing
JanCizmar Aug 23, 2025
d4ba456
fix: Add the missing file
JanCizmar Aug 23, 2025
7536ed7
feat: Pull watch
JanCizmar Dec 11, 2025
f0aedc1
fix: don't unsubscribe after subscription, refactoring, add guard whe…
JanCizmar Dec 11, 2025
852308b
feat: handle unsupported server version & refactoring
JanCizmar Dec 12, 2025
b2801eb
chore: Test unsupported backend version error message
JanCizmar Dec 12, 2025
735b9b0
chore: CR fixes & eslint
JanCizmar Dec 12, 2025
2b894f1
chore: CR issues
JanCizmar Dec 12, 2025
61f62a3
chore: eslint
JanCizmar Dec 12, 2025
3f73678
chore: eslint
JanCizmar Dec 12, 2025
3090d2f
feat: use eTag instead of last-modified
JanCizmar Dec 13, 2025
46ba86e
fix: log data on new lines, so TTY consoles work better
JanCizmar Dec 13, 2025
57d87f9
fix: CR issues
JanCizmar Dec 16, 2025
ebc1753
chore: Fix unit tests
JanCizmar Dec 16, 2025
4872470
chore: Reflect CR comments, small refactoring
JanCizmar Dec 16, 2025
08675e0
chore: Upload docker logs as artifact
JanCizmar Dec 17, 2025
f2130f3
chore: fix tests
JanCizmar Dec 17, 2025
a690988
chore: fix tests, add typecheck to pipeline
JanCizmar Dec 17, 2025
a7e8f80
chore: fix types for scripts
JanCizmar Dec 17, 2025
2db567d
chore: Try to fix the watch test issue
JanCizmar Dec 17, 2025
7788fb8
chore: Print more debug info when
JanCizmar Dec 17, 2025
4bff501
chore: Print more debug info when
JanCizmar Dec 17, 2025
d04d13d
chore: Try to add 1s timeout so it connects before fist iteration
JanCizmar Dec 17, 2025
53bd130
fix: Eliminate the gap between watching started and the first pull
JanCizmar Dec 17, 2025
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
34 changes: 33 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,25 @@ jobs:
- name: Run eslint
run: npm run eslint

test-types:
name: Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: cache-node-modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci

- name: Run type check
run: npm run test:types

test-unit:
strategy:
matrix:
Expand Down Expand Up @@ -70,11 +89,24 @@ jobs:
run: npm ci
- name: Build CLI
run: npm run build

- name: Start Tolgee Container
run: npm run tolgee:start
env:
RUNNER_DEBUG: 1
- name: Run Tests
run: npm run test:e2e
- name: Capture Docker Logs
run: |
mkdir -p docker-logs
docker logs tolgee_cli_e2e > docker-logs/tolgee-container.log 2>&1 || echo "Failed to capture Docker logs"
if: always()
- name: Upload Docker Logs
uses: actions/upload-artifact@v4
if: always()
with:
name: docker-logs-node-${{ matrix.node }}
path: docker-logs/
retention-days: 7
- name: Stop Tolgee Container
run: npm run tolgee:stop
if: always()
Expand Down
15 changes: 15 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ E2E test instance:
- `tolgee:start`: Start the E2E testing instance. Will be available on port 22222.
- `tolgee:stop`: Stop the E2E testing instance.

### Using an alternative backend for testing

By default, E2E tests will start a Docker container with Tolgee backend on port 22222. If you want to use an alternative backend (e.g., a development server running elsewhere), you can set the `TOLGEE_TEST_BACKEND_URL` environment variable:

```bash
# Use an alternative backend instead of Docker
export TOLGEE_TEST_BACKEND_URL=http://localhost:8080
npm run test:e2e

# Or run with the environment variable inline
TOLGEE_TEST_BACKEND_URL=http://localhost:8080 npm run test:e2e
```

When this environment variable is set, the Docker backend will not be started, and tests will use the specified URL instead.

## Code & internals overview

### Command parsing
Expand Down
128 changes: 125 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"author": "Jan Cizmar",
"license": "MIT",
"dependencies": {
"@stomp/stompjs": "^7.1.1",
"ajv": "^8.17.1",
"ansi-colors": "^4.1.3",
"base32-decode": "^1.0.0",
Expand All @@ -38,10 +39,12 @@
"json5": "^2.2.3",
"jsonschema": "^1.5.0",
"openapi-fetch": "0.13.1",
"sockjs-client": "^1.6.1",
"tinyglobby": "^0.2.12",
"unescape-js": "^1.1.4",
"vscode-oniguruma": "^2.0.1",
"vscode-textmate": "^9.1.0",
"ws": "^8.18.3",
"yauzl": "^3.2.0"
},
"devDependencies": {
Expand All @@ -53,6 +56,7 @@
"@types/eslint__js": "^8.42.3",
"@types/js-yaml": "^4.0.9",
"@types/node": "^22.10.1",
"@types/sockjs-client": "^1.5.4",
"@types/yauzl": "^2.10.3",
"cross-env": "^7.0.3",
"eslint": "^9.16.0",
Expand Down
12 changes: 10 additions & 2 deletions src/client/ExportClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { ApiClient } from './ApiClient.js';
export type ExportRequest = Omit<
BodyOf<'/v2/projects/{projectId}/export', 'post'>,
'zip'
>;
> & {
ifNoneMatch?: string;
};

type SingleExportRequest = Omit<ExportRequest, 'languages'> & {
languages: [string];
Expand All @@ -18,10 +20,16 @@ type ExportClientProps = {
export const createExportClient = ({ apiClient }: ExportClientProps) => {
return {
async export(req: ExportRequest) {
const body = { ...req, zip: true };
const { ifNoneMatch, ...exportReq } = req;
const body = { ...exportReq, zip: true };
const headers: Record<string, string> = {};
if (ifNoneMatch) {
headers['If-None-Match'] = ifNoneMatch;
}
const loadable = await apiClient.POST('/v2/projects/{projectId}/export', {
params: { path: { projectId: apiClient.getProjectId() } },
body: body,
headers,
parseAs: 'blob',
});
return { ...loadable, data: loadable.data as unknown as Blob };
Expand Down
Loading
Loading