Skip to content
This repository was archived by the owner on Mar 16, 2025. It is now read-only.

Commit d74cf40

Browse files
committed
Build with @run-z/project-config
1 parent a14a0c9 commit d74cf40

File tree

14 files changed

+49
-169
lines changed

14 files changed

+49
-169
lines changed

.eslintrc.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
root: true,
3-
ignorePatterns: ['node_modules/', 'dist/', 'target/', 'd.ts/', '*.d.ts'],
3+
ignorePatterns: ['node_modules/', 'dist/', 'target/'],
44
extends: ['@run-z'],
55
overrides: [
66
{
@@ -26,7 +26,7 @@ module.exports = {
2626
extends: ['@run-z/eslint-config/jest'],
2727
parserOptions: {
2828
tsconfigRootDir: __dirname,
29-
project: './tsconfig.spec.json',
29+
project: './tsconfig.json',
3030
},
3131
},
3232
],

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
run: pnpm install
4141

4242
- name: Build the project
43+
env:
44+
RUNZ_TEST_RUNNER: ts-jest
4345
run: pnpm ci:all
4446

4547
- name: Upload coverage report

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Node.js modules
2-
node_modules
2+
node_modules/
33

44
# IntelliJ IDEA files
55
.idea
@@ -23,10 +23,10 @@ pnpm-lock.yaml
2323
*.tgz
2424

2525
# Intermediate files
26-
/target
26+
/target/
2727

2828
# Distribution directory
29-
/dist
29+
/dist/
3030

3131
# Type definitions
3232
*.d.ts

.npmignore

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Node.js modules
2-
node_modules
2+
node_modules/
33

44
# IntelliJ IDEA files
55
.idea
66
*.iml
77

88
# Intermediate files
9-
/target
9+
/target/
1010

1111
# Logs
1212
*.log
@@ -15,7 +15,7 @@ node_modules
1515
*.tgz
1616

1717
# Source files
18-
/src
18+
/src/
1919

2020
# Build scripts
2121
/build
@@ -25,12 +25,15 @@ node_modules
2525
/*.cjs
2626
/*.js
2727
/*.json
28+
/*.mjs
2829

2930
# Package lock
30-
/yarn.lock
31+
yarn.lock
32+
package-lock.json
33+
pnpm-lock.yaml
3134

3235
# Include distribution dir
33-
!/dist
36+
!/dist/
3437

3538
# Include type definitions
3639
!*.d.ts

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020-2022 Ruslan Lopatin <ruslan.lopatin@gmail.com>
3+
Copyright (c) 2020-2023 Ruslan Lopatin <ruslan.lopatin@gmail.com>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

core/package.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

jest.config.js

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,3 @@
1-
export default {
2-
preset: 'ts-jest/presets/default-esm',
3-
collectCoverage: true,
4-
collectCoverageFrom: [
5-
'src/**/*.ts',
6-
'!src/spec/**',
7-
'!src/**/*.spec.ts',
8-
'!src/**/index.ts',
9-
'!src/**/main.ts',
10-
'!**/node_modules/**',
11-
],
12-
coverageDirectory: 'target/coverage',
13-
coverageThreshold: {
14-
global: {
15-
statements: 100,
16-
branches: 100,
17-
functions: 100,
18-
lines: 100,
19-
},
20-
},
21-
extensionsToTreatAsEsm: ['.ts'],
22-
reporters: [
23-
'default',
24-
[
25-
'jest-junit',
26-
{
27-
suiteName: '@hatsy/hatsy',
28-
outputDirectory: './target/test-results',
29-
classNameTemplate: '{classname}: {title}',
30-
titleTemplate: '{classname}: {title}',
31-
ancestorSeparator: ' › ',
32-
usePathForSuiteName: 'true',
33-
},
34-
],
35-
],
36-
testEnvironment: 'node',
37-
transform: {
38-
'^.+\\.tsx?$': [
39-
'ts-jest',
40-
{
41-
tsconfig: 'tsconfig.spec.json',
42-
useESM: true,
43-
},
44-
],
45-
},
46-
};
1+
import { configureJest } from '@run-z/project-config';
2+
3+
export default await configureJest();

package.json

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,34 @@
1919
"url": "https://github.com/hatsyjs/hatsy/issues"
2020
},
2121
"type": "module",
22-
"main": "./dist/hatsy.js",
23-
"types": "./index.d.ts",
22+
"types": "./dist/hatsy.d.ts",
23+
"typesVersions": {
24+
"*": {
25+
"core": [
26+
"./dist/hatsy.core.d.ts"
27+
],
28+
"testing": [
29+
"./dist/hatsy.testing.d.ts"
30+
]
31+
}
32+
},
2433
"exports": {
2534
".": {
26-
"types": "./index.d.ts",
35+
"types": "./dist/hatsy.d.ts",
2736
"default": "./dist/hatsy.js"
2837
},
2938
"./core": {
30-
"types": "./core/index.d.ts",
39+
"types": "./dist/hatsy.core.d.ts",
3140
"default": "./dist/hatsy.core.js"
3241
},
3342
"./package.json": "./package.json",
3443
"./testing": {
35-
"types": "./testing/index.d.ts",
44+
"types": "./dist/hatsy.testing.d.ts",
3645
"default": "./dist/hatsy.testing.js"
3746
}
3847
},
3948
"dependencies": {
40-
"@frontmeans/httongue": "^2.3.0",
49+
"@frontmeans/httongue": "^2.4.0",
4150
"@hatsy/http-header-value": "^3.7.0",
4251
"@proc7ts/logger": "^1.3.2",
4352
"@proc7ts/primitives": "^3.0.2"
@@ -48,7 +57,10 @@
4857
"devDependencies": {
4958
"@jest/globals": "^29.4.1",
5059
"@run-z/eslint-config": "^3.3.1",
51-
"@run-z/rollup-helpers": "^2.1.0",
60+
"@run-z/prettier-config": "^2.0.0",
61+
"@run-z/project-config": "^0.15.0",
62+
"@swc/core": "^1.3.29",
63+
"@swc/jest": "^0.2.24",
5264
"@types/node": "^18.11.18",
5365
"@typescript-eslint/eslint-plugin": "^5.49.0",
5466
"@typescript-eslint/parser": "^5.49.0",
@@ -61,25 +73,22 @@
6173
"prettier": "^2.8.3",
6274
"prettier-eslint-cli": "^7.1.0",
6375
"rollup": "^3.11.0",
64-
"rollup-plugin-flat-dts": "^2.0.2",
65-
"rollup-plugin-typescript2": "^0.34.1",
6676
"run-z": "^1.11.0",
67-
"shx": "^0.3.4",
6877
"ts-jest": "^29.0.5",
6978
"tslib": "^2.5.0",
7079
"typedoc": "^0.23.24",
7180
"typescript": "~4.9.4"
7281
},
7382
"scripts": {
7483
"all": "run-z build,lint,test",
75-
"build": "run-z +z --then rollup -c",
84+
"build": "run-z +z --then build-z",
7685
"ci:all": "run-z all +test/--ci/--runInBand",
77-
"clean": "run-z +z --then shx rm -rf \"index.d.ts?(.map)\" \"*/index.d.ts?(.map)\" dist target",
86+
"clean": "run-z +z --then clean-z",
7887
"doc": "run-z +z --then typedoc",
7988
"doc:publish": "run-z doc --then gh-pages --dist target/typedoc --dotfiles",
8089
"format": "run-z +z --then prettier-eslint --write --include-dot-files \"src/**/*.*\" \"*.{js,cjs,json,md}\"",
8190
"lint": "run-z +z --then eslint .",
82-
"test": "run-z +z env:NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" --then jest",
83-
"z": "run-z +cmd:rollup,+cmd:typedoc,+cmd:eslint,+cmd:jest"
91+
"test": "run-z +z env:NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" --then test-z",
92+
"z": "run-z +cmd:build-z,+cmd:typedoc,+cmd:eslint,+cmd:test-z"
8493
}
8594
}

rollup.config.js

Lines changed: 0 additions & 60 deletions
This file was deleted.

testing/package.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)