Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
Build with @run-z/project-config
Browse files Browse the repository at this point in the history
  • Loading branch information
surol committed Jan 27, 2023
1 parent f4032dc commit 472a59c
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 144 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
root: true,
ignorePatterns: ['node_modules/', 'dist/', 'target/', 'd.ts/', '*.d.ts'],
ignorePatterns: ['node_modules/', 'dist/', 'target/'],
extends: ['@run-z'],
overrides: [
{
Expand All @@ -26,7 +26,7 @@ module.exports = {
extends: ['@run-z/eslint-config/jest'],
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.spec.json',
project: './tsconfig.json',
},
},
],
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
run: pnpm install

- name: Build the project
env:
RUNZ_TEST_RUNNER: ts-jest
run: pnpm ci:all

- name: Upload coverage report
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Node.js modules
node_modules
node_modules/

# IntelliJ IDEA files
.idea
Expand All @@ -23,10 +23,10 @@ pnpm-lock.yaml
*.tgz

# Intermediate files
/target
/target/

# Distribution directory
/dist
/dist/

# Type definitions
*.d.ts
Expand Down
17 changes: 11 additions & 6 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
# Node.js modules
node_modules
node_modules/

# IntelliJ IDEA files
.idea
*.iml

# Intermediate files
/target
/target/

# Logs
*.log

# Package archives
*.tgz

# Source files
/src
/src/

# Build scripts
/build
Expand All @@ -25,12 +24,18 @@ node_modules
/*.cjs
/*.js
/*.json
/*.mjs

# Package lock
/yarn.lock
yarn.lock
package-lock.json
pnpm-lock.yaml

# Include distribution dir
!/dist
!/dist/

# Package archive
*.tgz

# Include type definitions
!*.d.ts
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018-2022 Ruslan Lopatin <[email protected]>
Copyright (c) 2018-2023 Ruslan Lopatin <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
49 changes: 4 additions & 45 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,6 @@
export default {
preset: 'ts-jest/presets/default-esm',
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.ts',
'!src/spec/**/*.ts',
'!src/**/*.spec.ts',
'!src/**/index.ts',
'!src/**/main.ts',
'!**/node_modules/**',
],
coverageDirectory: 'target/coverage',
coverageThreshold: {
global: {
statements: 100,
branches: 100,
functions: 100,
lines: 100,
},
},
extensionsToTreatAsEsm: ['.ts'],
reporters: [
'default',
[
'jest-junit',
{
suiteName: '@wesib/css',
outputDirectory: './target/test-results',
classNameTemplate: '{classname}: {title}',
titleTemplate: '{classname}: {title}',
ancestorSeparator: ' › ',
usePathForSuiteName: 'true',
},
],
],
import { configureJest } from '@run-z/project-config';

export default await configureJest({
restoreMocks: true,
testEnvironment: 'jsdom',
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: 'tsconfig.spec.json',
useESM: true,
},
],
},
};
});
30 changes: 16 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
"url": "https://github.com/wesib/css/issues"
},
"type": "module",
"main": "./dist/wesib.css.js",
"types": "./index.d.ts",
"exports": "./dist/wesib.css.js",
"types": "./dist/wesib-css.d.ts",
"exports": {
"types": "./dist/wesib-css.d.ts",
"default": "./dist/wesib-css.js"
},
"peerDependencies": {
"@frontmeans/style-producer": "^7.0.1",
"@proc7ts/fun-events": "^10.5.1",
"@wesib/wesib": "^2.0.1"
"@proc7ts/fun-events": "^10.5.2",
"@wesib/wesib": "^2.0.2"
},
"dependencies": {
"@frontmeans/dom-primitives": "^1.1.0",
Expand All @@ -44,10 +46,13 @@
"@proc7ts/context-builder": "^7.0.1",
"@proc7ts/fun-events": "^10.5.2",
"@run-z/eslint-config": "^3.3.1",
"@run-z/rollup-helpers": "^2.1.0",
"@run-z/prettier-config": "^2.0.0",
"@run-z/project-config": "^0.15.0",
"@swc/core": "^1.3.29",
"@swc/jest": "^0.2.24",
"@typescript-eslint/eslint-plugin": "^5.49.0",
"@typescript-eslint/parser": "^5.49.0",
"@wesib/wesib": "^2.0.1",
"@wesib/wesib": "^2.0.2",
"eslint": "^8.32.0",
"eslint-plugin-jest": "^27.2.1",
"gh-pages": "^5.0.0",
Expand All @@ -58,25 +63,22 @@
"prettier": "^2.8.3",
"prettier-eslint-cli": "^7.1.0",
"rollup": "^3.11.0",
"rollup-plugin-flat-dts": "^2.0.2",
"rollup-plugin-typescript2": "^0.34.1",
"run-z": "^1.11.0",
"shx": "^0.3.4",
"ts-jest": "^29.0.5",
"tslib": "^2.5.0",
"typedoc": "^0.23.24",
"typescript": "~4.9.4"
},
"scripts": {
"all": "run-z build,lint,test",
"build": "run-z +z --then rollup -c",
"build": "run-z +z --then build-z",
"ci:all": "run-z all +test/--ci/--runInBand",
"clean": "run-z +z --then shx rm -rf \"index.d.ts?(.map)\" \"*/index.d.ts?(.map)\" dist target",
"clean": "run-z +z --then clean-z",
"doc": "run-z +z --then typedoc",
"doc:publish": "run-z doc --then gh-pages --dist target/typedoc --dotfiles",
"format": "run-z +z --then prettier-eslint --write --include-dot-files \"src/**/*.*\" \"*.{js,cjs,json,md}\"",
"lint": "run-z +z --then eslint .",
"test": "run-z +z env:NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" --then jest",
"z": "run-z +cmd:rollup,+cmd:typedoc,+cmd:eslint,+cmd:jest"
"test": "run-z +z env:NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" --then test-z",
"z": "run-z +cmd:build-z,+cmd:typedoc,+cmd:eslint,+cmd:test-z"
}
}
41 changes: 0 additions & 41 deletions rollup.config.js

This file was deleted.

20 changes: 5 additions & 15 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
{
"extends": "@run-z/project-config/tsconfig.lib.json",
"compilerOptions": {
"moduleResolution": "Node",
"module": "ES2015",
"target": "ES2019",
"strict": true,
"experimentalDecorators": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"noEmitHelpers": true,
"lib": ["DOM", "ES2019"],
"types": [],
"module": "ES2015",
"moduleResolution": "Node",
"outDir": "target/js",
"sourceMap": true,
"newLine": "LF"
"target": "ES2019",
"types": []
},
"include": ["src/**/*"]
}
5 changes: 0 additions & 5 deletions tsconfig.main.json

This file was deleted.

10 changes: 0 additions & 10 deletions tsconfig.spec.json

This file was deleted.

3 changes: 1 addition & 2 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"entryPoints": ["src/index.ts"],
"name": "Wesib: CSS Producer",
"out": "./target/typedoc",
"tsconfig": "tsconfig.main.json"
"out": "./target/typedoc"
}

0 comments on commit 472a59c

Please sign in to comment.