Skip to content

Commit

Permalink
Update build
Browse files Browse the repository at this point in the history
  • Loading branch information
fasttime committed May 18, 2024
1 parent 5da360c commit ec228ec
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ task
{
files: ['**/*.tstest'],
plugins: { tstest: eslintPluginTSTest },
processor: eslintPluginTSTest.processors['.tstest'],
rules:
{
'@stylistic/spaced-comment': 'off',
Expand All @@ -197,6 +198,7 @@ task
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-useless-constructor': 'off',
'constructor-super': 'off',
'no-duplicate-imports': 'off',
},
},
);
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"ansi-colors": "latest",
"c8js": "latest",
"chai": "4",
"eslint-formatter-compact": "latest",
"eslint-plugin-eslint-env": "latest",
"glob": "latest",
"gulp": "latest",
Expand Down
2 changes: 1 addition & 1 deletion src/polytype-esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
13 changes: 7 additions & 6 deletions test/serve.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,38 @@ 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;
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',
() =>
{
const headers = { };
{
const ext = extname(requestPath);
const ext = extname(fullPath);
if (mimeTypes.hasOwnProperty(ext))
headers['Content-Type'] = mimeTypes[ext];
}
Expand Down

0 comments on commit ec228ec

Please sign in to comment.