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

feat(core): migrate everything to ESM-only (japa version) #747

Merged
merged 20 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
8 changes: 8 additions & 0 deletions .c8rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"src": "./src",
"all": true,
"reporter": [
"text",
"lcovonly"
]
}
19 changes: 0 additions & 19 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,3 @@ updates:
schedule:
interval: monthly
open-pull-requests-limit: 5
ignore:
# Ignore ESM-only package versions.
# This can be fully removed once everything is ESM-native without all the weird issues.
- dependency-name: hook-std
versions:
- '3.x'
- dependency-name: node-fetch
versions:
- '3.x'
- dependency-name: to-readable-stream
versions:
- '3.x'
- '4.x'
- dependency-name: '@semantic-release/release-notes-generator'
versions:
- '11.x'
- dependency-name: '@types/node'
versions:
- '20.x'
14 changes: 4 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ jobs:

- name: setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9

- name: setup node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: 'pnpm'

- name: install dependencies
Expand Down Expand Up @@ -66,13 +64,11 @@ jobs:

- name: setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9

- name: setup node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: 'pnpm'

- name: install dependencies
Expand All @@ -92,13 +88,11 @@ jobs:

- name: setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9

- name: setup node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: 'pnpm'

- name: install dependencies
Expand All @@ -114,4 +108,4 @@ jobs:
with:
debug: true
coverageLocations: |
${{github.workspace}}/.tap/report/lcov.info:lcov
${{github.workspace}}/coverage/lcov.info:lcov
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
lib/
node_modules/
coverage/
.nyc_output/
test.sh
test.sh.sha256
.tap/
.tsimp/
**/*.js

19 changes: 19 additions & 0 deletions bin/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { assert } from '@japa/assert';
import { configure, processCLIArgs, run } from '@japa/runner';

processCLIArgs(process.argv.splice(2));
configure({
suites: [
{
name: 'unit',
files: ['test/unit/**/*.test.ts'],
},
{
name: 'integration',
files: ['test/integration/**/*.test.ts'],
},
],
plugins: [assert()],
});

await run();
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.1/schema.json",
"files": {
"include": ["./src/**/*.ts", "./test/**/*.ts"],
"include": ["./src/**/*.ts", "bin/test.ts", "./test/**/*.ts"],
"ignore": ["./test/fixtures/**/*"]
},
"organizeImports": {
Expand Down
116 changes: 60 additions & 56 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,62 @@
{
"name": "codeclimate-action",
"version": "6.0.0",
"private": true,
"description": "Publish code coverage to Code Climate",
"main": "lib/main.js",
"packageManager": "pnpm@9.0.6",
"scripts": {
"build": "tsc",
"test": "cross-env NODE_OPTIONS=\"--no-warnings\" tap run --disable-coverage",
"test:only": "pnpm run test --only",
"coverage": "pnpm run test --no-disable-coverage --allow-incomplete-coverage --coverage-report=lcovonly",
"coverage:html": "pnpm run coverage --coverage-report=html",
"biome:ci": "biome ci ./",
"format:check": "biome format ./",
"format": "biome format --write ./",
"lint:check": "biome lint ./",
"lint": "biome lint --apply ./",
"lint:unsafe": "biome lint --apply-unsafe ./"
},
"repository": {
"type": "git",
"url": "https://github.com/paambaati/codeclimate-action.git"
},
"keywords": [
"actions",
"codeclimate",
"quality",
"coverage"
],
"author": "GP <me@httgp.com>",
"license": "MIT",
"dependencies": {
"@actions/core": "1.10.1",
"@actions/exec": "1.1.1",
"@actions/github": "6.0.0",
"@actions/glob": "0.4.0",
"hook-std": "2.0.0",
"node-fetch": "2.7.0",
"openpgp": "5.11.1"
},
"devDependencies": {
"@biomejs/biome": "1.7.1",
"@openpgp/web-stream-tools": "0.1.1",
"@tapjs/test": "1.4.2",
"@types/node": "20.12.7",
"@types/node-fetch": "2.6.11",
"@types/sinon": "17.0.3",
"@types/which": "3.0.3",
"cross-env": "7.0.3",
"nock": "13.5.4",
"sinon": "17.0.1",
"tap": "18.7.2",
"to-readable-stream": "2.1.0",
"typescript": "5.4.5",
"which": "4.0.0"
}
"name": "codeclimate-action",
"version": "6.0.0",
"private": true,
"description": "Publish code coverage to Code Climate",
"type": "module",
"main": "lib/main.js",
"packageManager": "pnpm@9.1.4",
"scripts": {
"build": "tsc -p tsconfig.build.json",
"test": "node --import=tsimp/import --enable-source-maps bin/test.ts",
"coverage": "c8 pnpm run test",
"coverage:html": "c8 --reporter=html pnpm run test",
"biome:ci": "biome ci",
"format:check": "biome format",
"format": "biome format --fix",
"lint:check": "biome lint",
"lint": "biome lint --fix",
"lint:unsafe": "biome lint --fix --unsafe ./"
},
"repository": {
"type": "git",
"url": "https://github.com/paambaati/codeclimate-action.git"
},
"keywords": [
"actions",
"codeclimate",
"quality",
"coverage"
],
"author": "GP <me@httgp.com>",
"license": "MIT",
"dependencies": {
"@actions/core": "1.10.1",
"@actions/exec": "1.1.1",
"@actions/github": "6.0.0",
"@actions/glob": "0.4.0",
"hook-std": "3.0.0",
"node-fetch": "3.3.2",
"openpgp": "5.11.1"
},
"devDependencies": {
"@biomejs/biome": "1.8.0",
"@japa/assert": "3.0.0",
"@japa/runner": "3.1.4",
"@openpgp/web-stream-tools": "0.1.1",
"@tsconfig/node20": "20.1.4",
"@tsconfig/strictest": "2.0.5",
"@types/node": "20.14.1",
"@types/node-fetch": "2.6.11",
"@types/sinon": "17.0.3",
"@types/which": "3.0.4",
"c8": "9.1.0",
"cross-env": "7.0.3",
"into-stream": "8.0.1",
"nock": "13.5.4",
"sinon": "18.0.0",
"tsimp": "2.0.11",
"typescript": "5.4.5",
"which": "4.0.0"
}
}
Loading
Loading