Skip to content

Commit e384367

Browse files
Include windows in CICD pipeline. Use @v4 (#249)
* Include windows in CICD pipeline. Use @v4 * Remove strategy * Action name * declare prettierrc path * Correct path to the file * Update prettier and options * Set end of line to auto * Apply default formatting proposed by prettier latest (#252) * Apply default formatting proposed by prettier latest * Force to use prettierrc.json * Print file structure * Escape file name * Auto end of line * Use powershell * Correct YAML * Use win-node-env * Do not require powershell if not needed * Remove changes that dont belong to this pull request * use cross-env for setting NODE_ENV variables * cli: fix test errors on Windows * Apply formatting --------- Co-authored-by: Sebastian Alex <[email protected]> --------- Co-authored-by: Sebastian Alex <[email protected]>
1 parent b26514b commit e384367

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+316
-151
lines changed

.github/workflows/test.yml

+19-5
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ on:
66
pull_request:
77

88
jobs:
9-
build:
9+
test_linux:
1010
runs-on: ubuntu-latest
1111

1212
strategy:
1313
matrix:
1414
node-version: [16.x, 18.x, 20.x]
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
- name: Use Node.js ${{ matrix.node-version }}
19-
uses: actions/setup-node@v3
19+
uses: actions/setup-node@v4
2020
with:
2121
node-version: ${{ matrix.node-version }}
2222
- run: npm ci
@@ -33,9 +33,9 @@ jobs:
3333
node-version: [14.x]
3434

3535
steps:
36-
- uses: actions/checkout@v3
36+
- uses: actions/checkout@v4
3737
- name: Use Node.js ${{ matrix.node-version }}
38-
uses: actions/setup-node@v3
38+
uses: actions/setup-node@v4
3939
with:
4040
node-version: ${{ matrix.node-version }}
4141
- run: npm i -g npm@8
@@ -44,3 +44,17 @@ jobs:
4444
- run: npm run lint
4545
- run: npm run format:check
4646
- run: npm test
47+
48+
test_windows:
49+
runs-on: windows-latest
50+
steps:
51+
- uses: actions/checkout@v4
52+
- name: Use Node.js 18.x
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: 18.x
56+
- run: npm ci
57+
- run: npm run build
58+
- run: npm run lint
59+
- run: npm run format:check
60+
- run: npm test

.prettierrc .prettierrc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"printWidth": 120,
3-
"proseWrap": "always",
43
"singleQuote": true,
54
"trailingComma": "all",
65
"arrowParens": "always",
7-
"tabWidth": 4
6+
"tabWidth": 4,
7+
"endOfLine": "auto"
88
}

examples/sdk/node/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"clean": "rimraf \"lib\"",
1313
"format": "prettier --write '**/*.ts'",
1414
"lint": "eslint . --ext .ts",
15-
"start": "NODE_ENV=production node ./lib/index.js",
15+
"start": "cross-env NODE_ENV=production node ./lib/index.js",
1616
"watch": "tsc -w"
1717
},
1818
"repository": {

package-lock.json

+40-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@
5252
"@types/semver": "^7.5.3",
5353
"@typescript-eslint/eslint-plugin": "^5.59.7",
5454
"@typescript-eslint/parser": "^5.59.7",
55+
"cross-env": "^7.0.3",
5556
"eslint": "^8.41.0",
5657
"eslint-config-prettier": "^8.8.0",
5758
"eslint-plugin-import": "^2.27.5",
5859
"eslint-plugin-local-rules": "^1.3.2",
59-
"prettier": "^2.8.8",
60+
"prettier": "^3.3.2",
6061
"rimraf": "^5.0.1",
6162
"semver": "^7.5.4",
6263
"ts-node": "^10.9.1",

packages/browser/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"clean": "rimraf \"lib\"",
1111
"format": "prettier --write '**/*.ts'",
1212
"lint": "eslint . --ext .ts",
13-
"prepublishOnly": "NODE_ENV=production npm run build",
13+
"prepublishOnly": "cross-env NODE_ENV=production npm run build",
1414
"watch": "webpack -w",
15-
"test": "NODE_ENV=test jest"
15+
"test": "cross-env NODE_ENV=test jest"
1616
},
1717
"repository": {
1818
"type": "git",

packages/electron/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"clean": "rimraf common main renderer",
1010
"format": "prettier --write '**/*.ts'",
1111
"lint": "eslint src --ext .ts",
12-
"prepublishOnly": "NODE_ENV=production npm run build",
12+
"prepublishOnly": "cross-env NODE_ENV=production npm run build",
1313
"watch": "webpack -w",
14-
"test": "NODE_ENV=test jest --passWithNoTests"
14+
"test": "cross-env NODE_ENV=test jest --passWithNoTests"
1515
},
1616
"keywords": [
1717
"Error",

packages/electron/src/main/attributes/WindowAttributeProvider.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ export interface WindowAttributeProviderOptions {
1717
}
1818

1919
export class WindowAttributeProvider implements BacktraceAttributeProvider {
20-
constructor(private readonly _window: BrowserWindow, private readonly _options?: WindowAttributeProviderOptions) {}
20+
constructor(
21+
private readonly _window: BrowserWindow,
22+
private readonly _options?: WindowAttributeProviderOptions,
23+
) {}
2124

2225
public readonly type = 'dynamic';
2326

packages/electron/src/main/ipc/ReadableIpcStream.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ import { ipcHandshake } from '../../common/ipc/ipcHandshake';
77
export class ReadableIpcStream extends Readable {
88
private _isConnected = false;
99

10-
constructor(private readonly _name: string, private readonly _ipc: IpcTransport, opts?: ReadableOptions) {
10+
constructor(
11+
private readonly _name: string,
12+
private readonly _ipc: IpcTransport,
13+
opts?: ReadableOptions,
14+
) {
1115
super(opts);
1216

1317
const close = () => this.destroy();

packages/electron/src/main/modules/BacktraceMainElectronModule.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,11 @@ export class BacktraceMainElectronModule implements BacktraceModule {
121121
}
122122

123123
function toStringDictionary(record: Record<string, unknown>): Record<string, string> {
124-
return Object.keys(record).reduce((obj, key) => {
125-
obj[key] = record[key]?.toString() ?? '';
126-
return obj;
127-
}, {} as Record<string, string>);
124+
return Object.keys(record).reduce(
125+
(obj, key) => {
126+
obj[key] = record[key]?.toString() ?? '';
127+
return obj;
128+
},
129+
{} as Record<string, string>,
130+
);
128131
}

packages/electron/src/main/modules/IpcAttachment.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ import { IpcTransport } from '../../common';
44
import { ReadableIpcStream } from '../ipc/ReadableIpcStream';
55

66
export class IpcAttachment implements BacktraceAttachment {
7-
constructor(public readonly name: string, private readonly _id: string, private readonly _ipc: IpcTransport) {}
7+
constructor(
8+
public readonly name: string,
9+
private readonly _id: string,
10+
private readonly _ipc: IpcTransport,
11+
) {}
812

913
public get(): Readable {
1014
return new ReadableIpcStream(this._id, this._ipc);

packages/electron/src/renderer/ipc/WritableIpcStream.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ export class WritableIpcStream<W> extends WritableStream<W> {
1515
class WritableIpcStreamSink<W> implements UnderlyingSink<W> {
1616
private _isPaused = false;
1717

18-
constructor(private readonly _name: string, private readonly _ipc: IpcTransport) {
18+
constructor(
19+
private readonly _name: string,
20+
private readonly _ipc: IpcTransport,
21+
) {
1922
this._ipc.on(IpcEvents.streamEvent(_name, 'pause'), () => (this._isPaused = true));
2023
this._ipc.on(IpcEvents.streamEvent(_name, 'resume'), () => (this._isPaused = false));
2124
}

packages/electron/src/renderer/modules/IpcReportSubmission.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ import { IpcRpc } from '../../common/ipc/IpcRpc';
1414
import { WritableIpcStream } from '../ipc/WritableIpcStream';
1515

1616
export class IpcReportSubmission implements BacktraceReportSubmission {
17-
constructor(private readonly _ipcRpc: IpcRpc, private readonly _ipcTransport: IpcTransport) {}
17+
constructor(
18+
private readonly _ipcRpc: IpcRpc,
19+
private readonly _ipcTransport: IpcTransport,
20+
) {}
1821

1922
public send(
2023
data: BacktraceData,

packages/electron/src/renderer/modules/IpcSummedMetricsQueue.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ export class IpcSummedMetricsQueue implements MetricsQueue<SummedEvent> {
77
public readonly submissionUrl = '';
88
public readonly maximumEvents = -1;
99

10-
constructor(private readonly _ipcTransport: IpcTransport, private readonly _ipcRpc: IpcRpc) {}
10+
constructor(
11+
private readonly _ipcTransport: IpcTransport,
12+
private readonly _ipcRpc: IpcRpc,
13+
) {}
1114

1215
public add(event: SummedEvent): void {
1316
this._ipcTransport.emit(IpcEvents.addSummedMetric, event);

packages/nestjs/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"clean": "rimraf \"lib\"",
1010
"format": "prettier --write '**/*.ts'",
1111
"lint": "eslint . --ext .ts",
12-
"prepublishOnly": "NODE_ENV=production npm run build",
12+
"prepublishOnly": "cross-env NODE_ENV=production npm run build",
1313
"watch": "webpack -w",
14-
"test": "NODE_ENV=test jest --passWithNoTests"
14+
"test": "cross-env NODE_ENV=test jest --passWithNoTests"
1515
},
1616
"engines": {
1717
"node": ">=14"

packages/node/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"clean": "rimraf \"lib\"",
1010
"format": "prettier --write '**/*.ts'",
1111
"lint": "eslint . --ext .ts",
12-
"prepublishOnly": "NODE_ENV=production npm run build",
12+
"prepublishOnly": "cross-env NODE_ENV=production npm run build",
1313
"watch": "webpack -w",
14-
"test": "NODE_ENV=test jest"
14+
"test": "cross-env NODE_ENV=test jest"
1515
},
1616
"engines": {
1717
"node": ">=14"

packages/node/src/BacktraceNodeRequestHandler.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ export class BacktraceNodeRequestHandler implements BacktraceRequestHandler {
112112
this.reason instanceof Error
113113
? this.reason
114114
: typeof this.reason === 'string'
115-
? new Error(this.reason)
116-
: new Error('Operation cancelled.');
115+
? new Error(this.reason)
116+
: new Error('Operation cancelled.');
117117

118118
request.destroy(reason);
119119
}

packages/node/src/attachment/BacktraceBufferAttachment.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { BacktraceAttachment } from '@backtrace/sdk-core';
22

33
export class BacktraceBufferAttachment implements BacktraceAttachment<Buffer> {
4-
constructor(public readonly name: string, public readonly buffer: Buffer) {}
4+
constructor(
5+
public readonly name: string,
6+
public readonly buffer: Buffer,
7+
) {}
58
public get(): Buffer {
69
return this.buffer;
710
}

packages/node/src/attachment/BacktraceFileAttachment.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import { Readable } from 'stream';
66
export class BacktraceFileAttachment implements CoreBacktraceFileAttachment<Readable> {
77
public readonly name: string;
88

9-
constructor(public readonly filePath: string, name?: string) {
9+
constructor(
10+
public readonly filePath: string,
11+
name?: string,
12+
) {
1013
this.name = name ?? path.basename(this.filePath);
1114
}
1215

packages/node/tests/_mocks/fileSystem.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export function mockStreamFileSystem(files?: Record<string, string>): MockedFile
2727
const str = Buffer.isBuffer(chunk)
2828
? chunk.toString('utf-8')
2929
: typeof chunk === 'string'
30-
? chunk
31-
: String(chunk).toString();
30+
? chunk
31+
: String(chunk).toString();
3232

3333
const fullPath = path.resolve(p);
3434
if (!fs.files[fullPath]) {

packages/react-native/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"clean": "rimraf \"lib\"",
3232
"format:check": "eslint \"**/*.{js,ts,tsx}\"",
3333
"prepublishOnly": "bob build",
34-
"test": "NODE_ENV=test jest"
34+
"test": "cross-env NODE_ENV=test jest"
3535
},
3636
"keywords": [
3737
"Error",

packages/react-native/src/attributes/NativeAttributeProvider.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import { NativeModules } from 'react-native';
33
export class NativeAttributeProvider implements BacktraceAttributeProvider {
44
private readonly _provider: { get(): Record<string, AttributeType> };
55

6-
constructor(private readonly _name: string, public readonly type: 'scoped' | 'dynamic') {
6+
constructor(
7+
private readonly _name: string,
8+
public readonly type: 'scoped' | 'dynamic',
9+
) {
710
this._provider = NativeModules?.[this._name];
811
}
912

packages/react-native/src/handlers/UnhandledExceptionHandler.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ export class UnhandledExceptionHandler implements ExceptionHandler {
9696
message = cachedPrettyFormat
9797
? cachedPrettyFormat(rejection)
9898
: typeof rejection === 'string'
99-
? rejection
100-
: JSON.stringify({ ...rejection });
99+
? rejection
100+
: JSON.stringify({ ...rejection });
101101
}
102102

103103
const warning =
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
export class AndroidUnhandledException extends Error {
2-
constructor(public readonly name: string, public readonly message: string, public readonly stack: string) {
2+
constructor(
3+
public readonly name: string,
4+
public readonly message: string,
5+
public readonly stack: string,
6+
) {
37
super(message);
48
}
59
}

0 commit comments

Comments
 (0)