Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up configurations and the CI workflow #8

Merged
merged 4 commits into from
Sep 21, 2024
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
21 changes: 11 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
DEFAULT_NODE_VERSION: 22.x

jobs:

lint:
Expand All @@ -18,11 +21,11 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.x
node-version: ${{ env.DEFAULT_NODE_VERSION }}
- uses: actions/cache@v4
with:
path: '**/.yarn'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: .yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- run: corepack enable
- run: yarn install --immutable
- run: yarn run lint
Expand All @@ -41,11 +44,10 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: git config --global core.autocrlf input
- uses: actions/cache@v4
with:
path: '**/.yarn'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: .yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- run: corepack enable
- run: yarn install --immutable
- run: yarn run build
Expand All @@ -69,12 +71,11 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.x
- run: git config --global core.autocrlf input
node-version: ${{ env.DEFAULT_NODE_VERSION }}
- uses: actions/cache@v4
with:
path: '**/.yarn'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: .yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
- run: corepack enable
- run: yarn install --immutable
- run: yarn playwright install --with-deps ${{ matrix.browser }}
Expand Down
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.husky/_
.yarn
coverage
test-results
node_modules
lib/*.js
lib/*.js.map
lib/*.d.ts

*.d.ts
*.js
*.js.map
5 changes: 3 additions & 2 deletions eslint.config.js → eslint.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ module.exports = config([
files: [ '**/*.ts' ],
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname,
project: [ 'tsconfig.eslint.json' ],
},
},
},
{
files: [ 'webpack.config.js' ],
files: [
'webpack.config.ts',
],
rules: {
'import/no-nodejs-modules': 'off',
},
Expand Down
9 changes: 0 additions & 9 deletions jest.config.js

This file was deleted.

10 changes: 10 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { Config } from 'jest';

const config: Config = {
collectCoverage: true,
preset: 'ts-jest/presets/default',
testMatch: [ '<rootDir>/test/*-test.ts' ],
testEnvironment: 'node',
};

export default config;
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "readable-from-web",
"type": "commonjs",
"version": "1.0.0",
"packageManager": "yarn@4.4.1",
"packageManager": "yarn@4.5.0",
"description": "Experimental converter from WHATWG ReadableStream to readable-stream Readable",
"license": "MIT",
"homepage": "https://github.com/comunica/readable-from-web.js",
Expand Down Expand Up @@ -40,6 +40,7 @@
"streamify-string": "^1.0.0",
"ts-jest": "^29.0.0",
"ts-loader": "^9.0.0",
"ts-node": "^10.0.0",
"typescript": "^5.0.0",
"webpack": "^5.0.0",
"webpack-cli": "^5.0.0",
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"extends": "./tsconfig.json",
"include": [
"lib/*.ts",
"test/*.ts"
"./*.ts",
"./lib/*.ts",
"./test/*.ts"
]
}
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"sourceMap": true
},
"include": [
"lib/*.ts"
"./lib/*.ts"
],
"exclude": [
"**/*.d.ts"
"./lib/*.d.ts"
]
}
12 changes: 7 additions & 5 deletions webpack.config.js → webpack.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const path = require('node:path');
import { resolve } from 'node:path';
import type { WebpackConfiguration } from 'webpack-dev-server';

/** @type {import('webpack').Configuration} */
module.exports = {
const config: WebpackConfiguration = {
devServer: {
port: 4000,
host: 'localhost',
static: path.resolve(__dirname),
static: resolve(__dirname),
},
entry: {
index: './lib/index.ts',
Expand All @@ -27,6 +27,8 @@ module.exports = {
output: {
library: '[name]',
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
path: resolve(__dirname, 'dist'),
},
};

export default config;
Loading
Loading