diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 74dac688..ca1679e9 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -9,8 +9,9 @@ on: push: branches: [master] -env: - nodeVersion: 12 +concurrency: + group: pr-${{ github.ref }} + cancel-in-progress: true jobs: build: @@ -33,10 +34,10 @@ jobs: - name: Check out code uses: actions/checkout@v3 - - name: Set up Node.js ${{ env.nodeVersion }} + - name: Install Node.js from .nvmrc uses: actions/setup-node@v3 with: - node-version: ${{ env.nodeVersion }} + node-version-file: .nvmrc # Guarantee a predictable version of npm for the first round of tests - name: Install package managers diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f573283..3f8e4e74 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,6 @@ on: env: npmVersion: 8 - nodeVersion: 12 jobs: build: @@ -28,10 +27,10 @@ jobs: # Don't save creds in the git config (so it's easier to override later) persist-credentials: false - - name: Set up Node.js ${{ env.nodeVersion }} + - name: Install Node.js from .nvmrc uses: actions/setup-node@v3 with: - node-version: ${{ env.nodeVersion }} + node-version-file: .nvmrc # Guarantee a predictable version of npm (the PR build tests against both 6 and 8) - name: Install package managers diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..da2d3988 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +14 \ No newline at end of file diff --git a/change/beachball-c7cd357b-0728-4477-91af-0dbc7035011a.json b/change/beachball-c7cd357b-0728-4477-91af-0dbc7035011a.json new file mode 100644 index 00000000..14fef4ff --- /dev/null +++ b/change/beachball-c7cd357b-0728-4477-91af-0dbc7035011a.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "**BREAKING CHANGE**: Require Node 14. This is released as a minor change because Node 12 has been past end of life for a year now.", + "packageName": "beachball", + "email": "elcraig@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/package.json b/package.json index b9da6047..20860ee0 100644 --- a/package.json +++ b/package.json @@ -14,11 +14,12 @@ "beachball": "./bin/beachball.js" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" }, "files": [ "bin", - "lib/!(__*)" + "lib/!(__*)", + "lib/!(__*)/**/*" ], "scripts": { "build": "tsc", @@ -58,7 +59,7 @@ "@types/fs-extra": "^9.0.13", "@types/lodash": "^4.14.191", "@types/minimatch": "^3.0.5", - "@types/node": "^12.20.55", + "@types/node": "^14.0.0", "@types/prompts": "^2.4.2", "@types/semver": "^7.3.13", "@types/tmp": "^0.2.3", diff --git a/src/__fixtures__/mockStdin.ts b/src/__fixtures__/mockStdin.ts index 30efc793..d578d769 100644 --- a/src/__fixtures__/mockStdin.ts +++ b/src/__fixtures__/mockStdin.ts @@ -42,7 +42,7 @@ export class MockStdin extends stream.Readable { * Send text in a way that's presumably intended to simulate real `process.stdin` input * (this approach is copied from `mock-stdin`). */ - send(text: string[] | Buffer | string | null, encoding?: string) { + send(text: string[] | Buffer | string | null, encoding?: BufferEncoding) { if (Array.isArray(text)) { if (encoding) { throw new TypeError('Cannot invoke MockStdin#send(): `encoding` specified while text specified as an array.'); @@ -153,7 +153,7 @@ class MockData { pos = 0; done = false; - constructor(private data: Buffer | string | null, public encoding?: string) {} + constructor(private data: Buffer | string | null, public encoding?: BufferEncoding) {} get length() { if (Buffer.isBuffer(this.data)) { diff --git a/tsconfig.json b/tsconfig.json index 7cf05241..36c04d12 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { "outDir": "./lib", - // compatible with node 12 https://kangax.github.io/compat-table/es2016plus/#node12_11 - "target": "ES2019", + // compatible with node 14 + "target": "ES2020", "module": "commonjs", "moduleResolution": "node", "declaration": true, @@ -15,6 +15,7 @@ "allowJs": true, "checkJs": true, "skipLibCheck": true, + "lib": ["ES2020"], "types": ["node"] }, "include": ["src/**/*"] diff --git a/yarn.lock b/yarn.lock index 84936f5f..f6d0ceca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1459,10 +1459,10 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40" integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== -"@types/node@*", "@types/node@^12.20.55": - version "12.20.55" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" - integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== +"@types/node@*", "@types/node@^14.0.0": + version "14.18.43" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.43.tgz#679e000d9f1d914132ea295b4a1ffdf20370ec49" + integrity sha512-n3eFEaoem0WNwLux+k272P0+aq++5o05bA9CfiwKPdYPB5ZambWKdWoeHy7/OJiizMhzg27NLaZ6uzjLTzXceQ== "@types/parse-json@^4.0.0": version "4.0.0"