mirror of
https://github.com/socketio/socket.io.git
synced 2026-01-10 07:28:06 -05:00
ci: create npm workspaces and sort out dependencies
This requires at least npm v7. Reference: https://docs.npmjs.com/cli/v10/using-npm/workspaces Note: @types/node is pinned at `18.15.3` because it's the last version which supports TypeScript v4.2.
This commit is contained in:
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@@ -32,14 +32,16 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
|
# in order to test our compliance with TypeScript v4.2 (older versions are not tested)
|
||||||
- name: Install TypeScript 4.2
|
- name: Install TypeScript 4.2
|
||||||
run: npm i typescript@4.2
|
run: npm i typescript@4.2
|
||||||
if: ${{ matrix.node-version == '16' }}
|
if: ${{ matrix.node-version == '16' }}
|
||||||
|
|
||||||
|
- name: Compile each package
|
||||||
|
run: npm run compile --workspaces
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npm test
|
run: npm test --workspaces
|
||||||
env:
|
|
||||||
CI: true
|
|
||||||
|
|
||||||
build-examples:
|
build-examples:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,3 +12,4 @@ coverage
|
|||||||
.idea
|
.idea
|
||||||
.nyc_output
|
.nyc_output
|
||||||
dist/
|
dist/
|
||||||
|
build/
|
||||||
|
|||||||
14551
package-lock.json
generated
Normal file
14551
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
15
package.json
Normal file
15
package.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"private": true,
|
||||||
|
"workspaces": [
|
||||||
|
"packages/socket.io-parser",
|
||||||
|
"packages/socket.io-client",
|
||||||
|
"packages/socket.io"
|
||||||
|
],
|
||||||
|
"overrides": {
|
||||||
|
"@types/estree": "0.0.52",
|
||||||
|
"@types/lodash": "4.14.189"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "18.15.3"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -404,6 +404,7 @@ export class Manager<
|
|||||||
on(socket, "data", this.ondata.bind(this)),
|
on(socket, "data", this.ondata.bind(this)),
|
||||||
on(socket, "error", this.onerror.bind(this)),
|
on(socket, "error", this.onerror.bind(this)),
|
||||||
on(socket, "close", this.onclose.bind(this)),
|
on(socket, "close", this.onclose.bind(this)),
|
||||||
|
// @ts-ignore
|
||||||
on(this.decoder, "decoded", this.ondecoded.bind(this))
|
on(this.decoder, "decoded", this.ondecoded.bind(this))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,6 @@
|
|||||||
"@rollup/plugin-node-resolve": "^13.0.5",
|
"@rollup/plugin-node-resolve": "^13.0.5",
|
||||||
"@sinonjs/fake-timers": "^7.1.2",
|
"@sinonjs/fake-timers": "^7.1.2",
|
||||||
"@types/mocha": "^9.0.0",
|
"@types/mocha": "^9.0.0",
|
||||||
"@types/node": "^16.7.6",
|
|
||||||
"@types/sinonjs__fake-timers": "^6.0.3",
|
"@types/sinonjs__fake-timers": "^6.0.3",
|
||||||
"@wdio/cli": "^7.26.0",
|
"@wdio/cli": "^7.26.0",
|
||||||
"@wdio/local-runner": "^7.26.0",
|
"@wdio/local-runner": "^7.26.0",
|
||||||
@@ -84,7 +83,7 @@
|
|||||||
"text-blob-builder": "0.0.1",
|
"text-blob-builder": "0.0.1",
|
||||||
"ts-loader": "^8.3.0",
|
"ts-loader": "^8.3.0",
|
||||||
"ts-node": "^10.2.1",
|
"ts-node": "^10.2.1",
|
||||||
"tsd": "^0.17.0",
|
"tsd": "^0.27.0",
|
||||||
"typescript": "^4.4.2"
|
"typescript": "^4.4.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
"@babel/preset-env": "~7.9.6",
|
"@babel/preset-env": "~7.9.6",
|
||||||
"@babel/register": "^7.18.9",
|
"@babel/register": "^7.18.9",
|
||||||
"@types/debug": "^4.1.5",
|
"@types/debug": "^4.1.5",
|
||||||
"@types/node": "^14.11.1",
|
|
||||||
"@wdio/cli": "^7.26.0",
|
"@wdio/cli": "^7.26.0",
|
||||||
"@wdio/local-runner": "^7.26.0",
|
"@wdio/local-runner": "^7.26.0",
|
||||||
"@wdio/mocha-framework": "^7.26.0",
|
"@wdio/mocha-framework": "^7.26.0",
|
||||||
|
|||||||
7650
packages/socket.io/package-lock.json
generated
7650
packages/socket.io/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -413,7 +413,7 @@ describe("server", () => {
|
|||||||
const sansTimeout = sio.in("1");
|
const sansTimeout = sio.in("1");
|
||||||
// Without timeout, `emitWithAck` shouldn't accept any events
|
// Without timeout, `emitWithAck` shouldn't accept any events
|
||||||
expectType<never>(
|
expectType<never>(
|
||||||
undefined as Parameters<typeof sansTimeout["emitWithAck"]>[0]
|
undefined as Parameters<(typeof sansTimeout)["emitWithAck"]>[0]
|
||||||
);
|
);
|
||||||
// @ts-expect-error - "noArgs" doesn't have a callback and is thus excluded
|
// @ts-expect-error - "noArgs" doesn't have a callback and is thus excluded
|
||||||
sio.timeout(0).emitWithAck("noArgs");
|
sio.timeout(0).emitWithAck("noArgs");
|
||||||
|
|||||||
Reference in New Issue
Block a user