From 90e7217d0d9ed60e7e78b7d7aca28e71d2d3a3bd Mon Sep 17 00:00:00 2001 From: Sean Ryan Date: Fri, 24 May 2024 12:49:07 +0200 Subject: [PATCH] Chore/up node (#304) * Up build system to cover current Node versions * Disable prettier on one line that varies by node version --- .github/workflows/node.js.deploy.yml | 4 ++-- .github/workflows/node.js.yml | 16 ++++++++-------- src/parser/export.ts | 5 ++++- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/node.js.deploy.yml b/.github/workflows/node.js.deploy.yml index 48283ea..804a0ed 100644 --- a/.github/workflows/node.js.deploy.yml +++ b/.github/workflows/node.js.deploy.yml @@ -17,8 +17,8 @@ jobs: strategy: # using matrix here as env variables did not work matrix: - # use node 14 because 16+ uses package-lock.json version 2 - node-version: [14.x] + # use node 20 as is longer term (note: 16+ uses package-lock.json version 2) + node-version: [20.x] # use the usual TypeScript version, slightly older for more compatibility typescript-version: [4.0.5] steps: diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 31349e5..7850fbd 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -21,17 +21,17 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node_version: [10.x, 12.x, 14.x, 16.x, 18.x] - # TODO - add 20.x when it is released + node_version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x, 22.x] typescript_version: [4] # To avoid too many builds, only test for extra TypeScript versions, for a subset of the Node versions: + # use node 20 as is longer term include: - - node_version: 14.x - typescript_version: 3 - # the 'deploy' config, with deliberately older TypeScript version: - - node_version: 14.x + - node_version: 20.x typescript_version: 4.0.5 - - node_version: 16.x + # the 'deploy' config, with deliberately older TypeScript version: + - node_version: 20.x + typescript_version: 3 + - node_version: 22.x typescript_version: 3 steps: - uses: actions/checkout@v3 @@ -45,5 +45,5 @@ jobs: - run: npm install --development typescript@${{ matrix.typescript_version }} - run: npm test # - name: Report Code Coverage - # if: matrix.node_version == '16.x' && matrix.typescript_version == 4 + # if: matrix.node_version == '20.x' && matrix.typescript_version == 4 # run: npm run report-coverage-to-coveralls diff --git a/src/parser/export.ts b/src/parser/export.ts index 963a3f2..badd891 100644 --- a/src/parser/export.ts +++ b/src/parser/export.ts @@ -93,7 +93,10 @@ export const extractExportNames = (path: string, node: ts.Node): string[] => { switch (node.kind) { case ts.SyntaxKind.VariableStatement: return parseExportNames( - (node as ts.VariableStatement).declarationList.declarations[0].name.getText(), + // prettier-ignore + ( + node as ts.VariableStatement + ).declarationList.declarations[0].name.getText(), ); case ts.SyntaxKind.FunctionDeclaration: const { name } = node as ts.FunctionDeclaration;