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
22 changes: 1 addition & 21 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"runtimeExecutable": null,
"program": "${workspaceRoot}/scripts/debugTests.js",
"cwd": "${fileDirname}",
"runtimeArgs": ["--nolazy", "--inspect", "--experimental-vm-modules"],
"args": ["--", "--runInBand", "--watch", "--testTimeout=1000000", "${file}"],
"sourceMaps": true,
"outputCapture": "std",
Expand All @@ -33,27 +34,6 @@
"processId": "${command:PickProcess}",
"sourceMaps": true,
"skipFiles": ["<node_internals>/**"]
},
{
// Debug configuration for Jest extension
"name": "vscode-jest-tests.v2",
"type": "node",
"request": "launch",
"runtimeExecutable": "npm",
"cwd": "${workspaceFolder}",
"runtimeArgs": ["run-script", "test"],
"args": [
"--",
"--runInBand",
"--watch",
"--testTimeout=1000000",
"--no-coverage",
"--testNamePattern",
"${jest.testNamePattern}",
"--runTestsByPath",
"${jest.testFile}"
],
"console": "integratedTerminal"
}
]
}
11 changes: 11 additions & 0 deletions change/change-37a6b8a7-6fa0-4f2a-8ef5-34bca5edf36a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"type": "none",
"comment": "Allow ESM imports in jest",
"packageName": "beachball",
"email": "elcraig@microsoft.com",
"dependentChangeType": "none"
}
]
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
"lodash": "^4.18.1",
"express/qs@6.11.0": "^6.14.2",
"@cypress/request/qs@6.10.4": "^6.14.2",
"@verdaccio/core/minimatch@7.4.6": "^7.4.9",
"verdaccio/minimatch@7.4.6": "^7.4.9",
"verdaccio-memory/minimatch@7.4.6": "^7.4.9",
"@verdaccio/core/ajv@8.17.1": "^8.18.0",
"@verdaccio/core/ajv@8.18.0": "^8.18.0"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/beachball/.depcheckrc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ignore-path: ../../.gitignore

ignores:
# used in scripts
- cross-env
# used in __fixtures__/registry.ts by partial name
- verdaccio-auth-memory
- verdaccio-memory
Expand Down
13 changes: 7 additions & 6 deletions packages/beachball/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
"depcheck": "yarn run -T depcheck .",
"lint": "yarn run -T eslint --color --max-warnings=0 src",
"start": "yarn run -T tsc -w --preserveWatchOutput",
"test": "yarn run -T jest",
"test": "cross-env NODE_OPTIONS='--experimental-vm-modules' yarn run -T jest",
"test:all": "yarn test:unit && yarn test:func && yarn test:e2e",
"test:e2e": "yarn run -T jest --selectProjects e2e",
"test:func": "yarn run -T jest --selectProjects functional",
"test:unit": "yarn run -T jest --selectProjects unit",
"test:watch": "yarn run -T jest --watch",
"test:e2e": "yarn test --selectProjects e2e",
"test:func": "yarn test --selectProjects functional",
"test:unit": "yarn test --selectProjects unit",
"test:watch": "yarn test --watch",
"update-snapshots": "yarn test:unit -u && yarn test:func -u && yarn test:e2e -u"
},
"dependencies": {
Expand All @@ -55,7 +55,8 @@
"@types/tmp": "^0.2.3",
"@types/yargs-parser": "^21.0.0",
"@verdaccio/types": "^13.0.0",
"get-port": "^5.0.0",
"cross-env": "^10.1.0",
"get-port": "^7.0.0",
"normalized-tmpdir": "1.0.1",
"strip-ansi": "^6.0.1",
"tmp": "^0.2.1",
Expand Down
10 changes: 8 additions & 2 deletions packages/beachball/src/__fixtures__/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ConfigBuilder } from '@verdaccio/config';
import { fork, type ChildProcess } from 'child_process';
import execa from 'execa';
import fs from 'fs';
import getPort from 'get-port';
import os from 'os';
import path from 'path';
import { removeTempDir, tmpdir } from './tmpdir';
Expand Down Expand Up @@ -58,7 +57,14 @@ export class Registry {
// If this is consistently having problems, probably it's best to increase portRange.
const maxPort = this.startPort + portRange;
console.log(`Looking for free ports in range ${this.startPort} to ${maxPort}`);
const tryPort = await getPort({ port: getPort.makeRange(this.startPort, maxPort) });

const port: number[] = [];
for (let i = this.startPort; i <= maxPort; i++) {
port.push(i);
}

const getPort = await import('get-port');
const tryPort = await getPort.default({ port });

// Try to start the server. If it fails, it's likely a config error or something where a retry
// won't be helpful, so just let it throw.
Expand Down
44 changes: 28 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,13 @@ __metadata:
languageName: node
linkType: hard

"@epic-web/invariant@npm:^1.0.0":
version: 1.0.0
resolution: "@epic-web/invariant@npm:1.0.0"
checksum: 10c0/72dbeb026e4e4eb3bc9c65739b91408ca77ab7d603a2494fa2eff3790ec22892c4caba751cffdf30f5ccf0e7ba79c1e9c96cf0a357404b9432bf1365baac23ca
languageName: node
linkType: hard

"@eslint-community/eslint-utils@npm:^4.8.0, @eslint-community/eslint-utils@npm:^4.9.1":
version: 4.9.1
resolution: "@eslint-community/eslint-utils@npm:4.9.1"
Expand Down Expand Up @@ -2354,8 +2361,9 @@ __metadata:
"@vercel/detect-agent": "npm:^1.2.1"
"@verdaccio/types": "npm:^13.0.0"
cosmiconfig: "npm:^9.0.1"
cross-env: "npm:^10.1.0"
execa: "npm:^5.1.1"
get-port: "npm:^5.0.0"
get-port: "npm:^7.0.0"
minimatch: "npm:^3.1.5"
normalized-tmpdir: "npm:1.0.1"
p-graph: "npm:^1.3.0"
Expand Down Expand Up @@ -2404,7 +2412,7 @@ __metadata:
languageName: node
linkType: hard

"brace-expansion@npm:^2.0.1, brace-expansion@npm:^2.0.2":
"brace-expansion@npm:^2.0.2":
version: 2.0.3
resolution: "brace-expansion@npm:2.0.3"
dependencies:
Expand Down Expand Up @@ -2855,6 +2863,19 @@ __metadata:
languageName: node
linkType: hard

"cross-env@npm:^10.1.0":
version: 10.1.0
resolution: "cross-env@npm:10.1.0"
dependencies:
"@epic-web/invariant": "npm:^1.0.0"
cross-spawn: "npm:^7.0.6"
bin:
cross-env: dist/bin/cross-env.js
cross-env-shell: dist/bin/cross-env-shell.js
checksum: 10c0/834a862db456ba1fedf6c6da43436b123ae38f514fa286d6f0937c14fa83f13469f77f70f2812db041ae2d84f82bac627040b8686030aca27fbdf113dfa38b63
languageName: node
linkType: hard

"cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.6":
version: 7.0.6
resolution: "cross-spawn@npm:7.0.6"
Expand Down Expand Up @@ -3854,10 +3875,10 @@ __metadata:
languageName: node
linkType: hard

"get-port@npm:^5.0.0":
version: 5.1.1
resolution: "get-port@npm:5.1.1"
checksum: 10c0/2873877a469b24e6d5e0be490724a17edb39fafc795d1d662e7bea951ca649713b4a50117a473f9d162312cb0e946597bd0e049ed2f866e79e576e8e213d3d1c
"get-port@npm:^7.0.0":
version: 7.1.0
resolution: "get-port@npm:7.1.0"
checksum: 10c0/896051fea0fd3df58c050566754ab91f46406e898ce0c708414739d908a5ac03ffef3eca7a494ea9cc1914439e8caccd2218010d1eeabdde914b9ff920fa28fc
languageName: node
linkType: hard

Expand Down Expand Up @@ -5555,16 +5576,7 @@ __metadata:
languageName: node
linkType: hard

"minimatch@npm:7.4.6":
version: 7.4.6
resolution: "minimatch@npm:7.4.6"
dependencies:
brace-expansion: "npm:^2.0.1"
checksum: 10c0/e587bf3d90542555a3d58aca94c549b72d58b0a66545dd00eef808d0d66e5d9a163d3084da7f874e83ca8cc47e91c670e6c6f6593a3e7bb27fcc0e6512e87c67
languageName: node
linkType: hard

"minimatch@npm:7.4.9, minimatch@npm:^7.4.6":
"minimatch@npm:7.4.9, minimatch@npm:^7.4.6, minimatch@npm:^7.4.9":
version: 7.4.9
resolution: "minimatch@npm:7.4.9"
dependencies:
Expand Down
Loading