diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index b6daaff6..c99d021a 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -33,7 +33,7 @@ jobs: id: versions - name: Set up node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: ${{ steps.versions.outputs.node-version }} diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index b9dfd7fa..121b80ae 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -32,7 +32,7 @@ jobs: id: versions - name: Set up node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: ${{ steps.versions.outputs.node-version }} diff --git a/.github/workflows/node-test.yml b/.github/workflows/node-test.yml index dd71ba2d..8fe6b01f 100644 --- a/.github/workflows/node-test.yml +++ b/.github/workflows/node-test.yml @@ -39,7 +39,7 @@ jobs: id: versions - name: Set up node - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: ${{ steps.versions.outputs.node-version }} diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 4ce362f3..c655f9d1 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -33,7 +33,7 @@ jobs: id: versions - name: Set up node - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: ${{ steps.versions.outputs.node-version }} registry-url: https://registry.npmjs.org diff --git a/cypress/tsconfig.json b/cypress/tsconfig.json index 5c2f06be..b5aa4ff8 100644 --- a/cypress/tsconfig.json +++ b/cypress/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "../tsconfig.json", - "include": ["../lib/**/*.ts", "./**/*.ts"], + "include": ["./**/*.ts"], "compilerOptions": { "types": ["cypress", "node"], "lib": ["ES2022", "DOM", "DOM.Iterable"], diff --git a/lib/docker.ts b/lib/docker.ts index 52ee8709..2eeaa89a 100644 --- a/lib/docker.ts +++ b/lib/docker.ts @@ -18,7 +18,7 @@ import { XMLParser } from 'fast-xml-parser' import { User } from './User' const SERVER_IMAGE = 'ghcr.io/nextcloud/continuous-integration-shallow-server' -const VENDOR_APPS = { +const VENDOR_APPS: Record = { text: 'https://github.com/nextcloud/text.git', viewer: 'https://github.com/nextcloud/viewer.git', notifications: 'https://github.com/nextcloud/notifications.git', @@ -204,7 +204,7 @@ export async function startNextcloud(branch = 'master', mountApp: boolean|string const pullImage = function() { // Pulling images console.log('\nPulling images… ⏳') - return new Promise((resolve, reject) => docker.pull(SERVER_IMAGE, (_err, stream: Stream) => { + return new Promise((resolve, reject) => docker.pull(SERVER_IMAGE, (_: unknown, stream: Stream) => { const onFinished = function(err: Error | null) { if (!err) { return resolve(true) @@ -355,7 +355,10 @@ export const getContainerIP = async function( tries++ await container.inspect((_err, data) => { - ip = data?.NetworkSettings?.IPAddress || '' + ip = data?.NetworkSettings?.Networks?.default?.IPAddress + // @ts-expect-error -- fallback to legacy network settings + || data?.NetworkSettings?.IPAddress + || '' }) if (ip !== '') { diff --git a/package-lock.json b/package-lock.json index fc89a7f3..c9e90096 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,6 +22,7 @@ "@playwright/test": "^1.61.1", "@types/cypress": "^1.1.6", "@types/dockerode": "^4.0.1", + "@types/wait-on": "^5.3.4", "cypress": "^15.18.0", "nyc": "^18.0.0", "rollup-plugin-istanbul": "^5.0.0", @@ -5334,6 +5335,16 @@ "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", "dev": true }, + "node_modules/@types/wait-on": { + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/@types/wait-on/-/wait-on-5.3.4.tgz", + "integrity": "sha512-EBsPjFMrFlMbbUFf9D1Fp+PAB2TwmUn7a3YtHyD9RLuTIk1jDd8SxXVAoez2Ciy+8Jsceo2MYEYZzJ/DvorOKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/web-bluetooth": { "version": "0.0.20", "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz", @@ -22129,6 +22140,15 @@ "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", "dev": true }, + "@types/wait-on": { + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/@types/wait-on/-/wait-on-5.3.4.tgz", + "integrity": "sha512-EBsPjFMrFlMbbUFf9D1Fp+PAB2TwmUn7a3YtHyD9RLuTIk1jDd8SxXVAoez2Ciy+8Jsceo2MYEYZzJ/DvorOKw==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/web-bluetooth": { "version": "0.0.20", "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz", diff --git a/package.json b/package.json index 0dfbe24a..1fd686b8 100644 --- a/package.json +++ b/package.json @@ -26,13 +26,13 @@ "exports": { "./commands": { "types": "./dist/commands/index.d.ts", - "import": "./dist/commands/index.cjs", - "require": "./dist/commands/index.cjs" + "import": "./dist/commands.mjs", + "require": "./dist/commands.cjs" }, "./selectors": { "types": "./dist/selectors/index.d.ts", - "import": "./dist/selectors/index.cjs", - "require": "./dist/selectors/index.cjs" + "import": "./dist/selectors.mjs", + "require": "./dist/selectors.cjs" }, "./docker": { "types": "./dist/docker.d.ts", @@ -63,7 +63,7 @@ ], "scripts": { "build": "vite --mode production build", - "build:doc": "typedoc --tsconfig cypress/tsconfig.json --out dist/doc lib/commands lib/selectors lib && touch dist/doc/.nojekyll", + "build:doc": "typedoc --out dist/doc lib/commands lib/selectors/index.ts lib && touch dist/doc/.nojekyll", "build:instrumented": "vite --mode instrumented build", "cypress": "npm run cypress:e2e && npm run cypress:component", "cypress:e2e": "cypress run --e2e", @@ -87,6 +87,7 @@ "@playwright/test": "^1.61.1", "@types/cypress": "^1.1.6", "@types/dockerode": "^4.0.1", + "@types/wait-on": "^5.3.4", "cypress": "^15.18.0", "nyc": "^18.0.0", "rollup-plugin-istanbul": "^5.0.0", diff --git a/tsconfig.json b/tsconfig.json index 716e7836..1894336e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,11 @@ "ES2024", "DOM" ], - "rootDir": ".", + "types": [ + "cypress", + "node" + ], + "rootDir": "lib", "outDir": "./dist", "target": "esnext", "module": "esnext",