From ec228ecf165500b3cdb7b3c66371bb86b605942d Mon Sep 17 00:00:00 2001 From: Francesco Trotta Date: Sat, 18 May 2024 22:50:14 +0200 Subject: [PATCH] Update build --- .github/workflows/ci.yml | 6 +++--- gulpfile.js | 2 ++ package.json | 1 + src/polytype-esm.js | 2 +- test/serve.mjs | 13 +++++++------ 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e91c7c..94a49f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,13 +8,13 @@ jobs: name: Build - runs-on: ubuntu-latest + runs-on: macos-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: ^20.8 + node-version: '22' - run: | npm install gulp make-ts-defs @@ -35,7 +35,7 @@ jobs: strategy: matrix: - node-version: ['16.0.0', '16', '18', '20', '21'] + node-version: ['16.0.0', '16', '18', '20', '22'] steps: - uses: actions/checkout@v4 diff --git a/gulpfile.js b/gulpfile.js index f318fb5..186046a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -189,6 +189,7 @@ task { files: ['**/*.tstest'], plugins: { tstest: eslintPluginTSTest }, + processor: eslintPluginTSTest.processors['.tstest'], rules: { '@stylistic/spaced-comment': 'off', @@ -197,6 +198,7 @@ task '@typescript-eslint/no-unused-vars': 'off', '@typescript-eslint/no-useless-constructor': 'off', 'constructor-super': 'off', + 'no-duplicate-imports': 'off', }, }, ); diff --git a/package.json b/package.json index d164032..f643450 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "ansi-colors": "latest", "c8js": "latest", "chai": "4", + "eslint-formatter-compact": "latest", "eslint-plugin-eslint-env": "latest", "glob": "latest", "gulp": "latest", diff --git a/src/polytype-esm.js b/src/polytype-esm.js index c65693c..161ba10 100644 --- a/src/polytype-esm.js +++ b/src/polytype-esm.js @@ -115,7 +115,7 @@ const _Function_prototype_hasInstance_call = bindCall(_Function_prototype[_Symb const _Function_prototype_toString_call = bindCall(_Function_prototype.toString); const _Object_prototype_valueOf_call = bindCall(_Object.prototype.valueOf); -bindCall = null; +bindCall = null; // eslint-disable-line no-useless-assignment _Function_prototype_call = null; const checkDuplicateSuperType = diff --git a/test/serve.mjs b/test/serve.mjs index 74a6e62..1ee3951 100755 --- a/test/serve.mjs +++ b/test/serve.mjs @@ -9,12 +9,13 @@ import { extname, join } from 'node:path'; import { fileURLToPath } from 'node:url'; import ansiColors from 'ansi-colors'; -const pathDir = fileURLToPath(new URL('..', import.meta.url)); +const baseDir = fileURLToPath(new URL('..', import.meta.url)); const mimeTypes = { '.css': 'text/css', '.html': 'text/html', '.js': 'application/javascript', + '.json': 'application/json', '.mjs': 'application/javascript', }; const port = 8080; @@ -22,16 +23,16 @@ createServer ( ({ url }, response) => { - const requestPath = fileURLToPath(new URL(url, 'file:')); - if (requestPath === '/favicon.ico') + const { pathname } = new URL(url, 'file:'); + if (pathname === '/favicon.ico') { const headers = { 'Content-Type': 'image/x-icon' }; response.writeHead(204, headers); response.end(); return; } - const pathname = join(pathDir, requestPath); - const stream = createReadStream(pathname); + const fullPath = join(baseDir, pathname); + const stream = createReadStream(fullPath); stream.on ( 'open', @@ -39,7 +40,7 @@ createServer { const headers = { }; { - const ext = extname(requestPath); + const ext = extname(fullPath); if (mimeTypes.hasOwnProperty(ext)) headers['Content-Type'] = mimeTypes[ext]; }