Skip to content

Commit

Permalink
feat: pob update
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed May 23, 2020
1 parent 93ff9c1 commit 8eb74d9
Show file tree
Hide file tree
Showing 231 changed files with 20,433 additions and 2,942 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
jobs:
test-node10:
docker:
- image: circleci/node:10.17
- image: circleci/node:10.20
steps:
- checkout
- restore_cache:
Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:

test-node12:
docker:
- image: circleci/node:12.13
- image: circleci/node:12.16
steps:
- checkout
- restore_cache:
Expand Down
85 changes: 43 additions & 42 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,48 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x, 13.x]
node-version: [10.x, 12.x, 14.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: dependencies--${{ matrix.node-version }}-${{ runner.OS }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
dependencies--${{ matrix.node-version }}-${{ runner.OS }}-
dependencies--${{ matrix.node-version }}-
- name: Install Dependencies
run: yarn install --prefer-offline --pure-lockfile

- name: Lint
run: yarn run lint
if: startsWith(matrix.node-version, '12.')

- name: Test
run: yarn run test
env:
CI: true

- name: Documentation
run: yarn run generate:docs
if: startsWith(matrix.node-version, '12.')
env:
CI: true
- name: Send results to codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
if: startsWith(matrix.node-version, '12.')

- name: Check nothing was forget before commit
if: startsWith(matrix.node-version, '12.')
run: yarn run repository-check-dirty
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Cache dependencies
uses: actions/cache@v1
with:
path: node_modules
key: v2-dependencies--${{ matrix.node-version }}-${{ runner.OS }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
v2-dependencies--${{ matrix.node-version }}-${{ runner.OS }}-
v2-dependencies--${{ matrix.node-version }}-
- name: Install Dependencies
run: yarn install --prefer-offline --pure-lockfile

- name: Lint
run: yarn run lint
if: startsWith(matrix.node-version, '12.')

- name: Test
run: yarn run test
env:
CI: true

- name: Documentation
run: yarn run generate:docs
if: startsWith(matrix.node-version, '12.')
env:
CI: true

- name: Send results to codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
if: startsWith(matrix.node-version, '12.')

- name: Check nothing was forget before commit
run: yarn run repository-check-dirty
4 changes: 4 additions & 0 deletions .yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
},
"renovate": {
"enable": true
},
"project": {
"type": "lib",
"yarn2": false
}
}
}
22 changes: 11 additions & 11 deletions husky.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/* eslint-disable global-require */

'use strict';

/*
* husky greps this file to check if a hook is defined
* so we need to list them here:
* - commit-msg
* - pre-commit
* - post-checkout
* - post-merge
* - post-rewrite
* - pre-push
*/
const { spawnSync } = require('child_process');

let createHuskyConfig;

const createHuskyConfig = require('@pob/repo-config/createHuskyConfig');
try {
createHuskyConfig = require('@pob/root/createHuskyConfig');
} catch (err) {
spawnSync('yarn', ['install'], { stdio: 'inherit' });
createHuskyConfig = require('@pob/root/createHuskyConfig');
}

module.exports = createHuskyConfig();
9 changes: 8 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
"useWorkspaces": true,
"command": {
"publish": {
"npmClient": "npm"
"npmClient": "npm",
"ignoreChanges": [
"**/.yo-rc.json",
"**/renovate.json",
"**/.eslintrc.json",
"**/tsconfig.json",
"**/tsconfig.build.json"
]
}
}
}
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

const createLintStagedConfig = require('@pob/repo-config/createLintStagedConfig');
const createLintStagedConfig = require('@pob/root/createLintStagedConfig');

module.exports = createLintStagedConfig();
22 changes: 14 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,34 @@
"license": "ISC",
"repository": "https://github.com:christophehurpeau/nightingale.git",
"homepage": "https://github.com/christophehurpeau/nightingale",
"workspaces": ["packages/*"],
"engines": {
"node": ">=10.13.0"
},
"workspaces": [
"packages/*"
],
"scripts": {
"build": "lerna run --stream build",
"build:definitions": "tsc -b tsconfig.build.json",
"generate:docs": "lerna run --parallel --ignore \"*-example\" generate:docs",
"lint": "lerna run --stream lint",
"postbuild": "yarn run build:definitions",
"postbuild": "yarn run build:definitions && yarn run generate:docs",
"preversion": "yarn run lint --since && yarn run build --since -- -- --no-clean && repository-check-dirty",
"release": "cross-env GH_TOKEN=$POB_GITHUB_TOKEN lerna version --conventional-commits --conventional-graduate --create-release=github -m 'chore: release' && lerna publish from-git",
"test": "lerna run --stream test",
"tsc": "tsc -b",
"watch": "lerna run --parallel --ignore \"*-example\" watch"
},
"commitlint": {
"extends": ["@commitlint/config-conventional"]
"extends": [
"@pob/commitlint-config"
]
},
"devDependencies": {
"@pob/repo-config": "1.2.0",
"@pob/version": "5.0.1",
"@pob/commitlint-config": "1.1.2",
"@pob/root": "2.1.0",
"husky": "4.2.5",
"lerna": "3.20.2",
"repository-check-dirty": "1.0.3",
"typescript": "3.7.5"
"lerna": "3.21.0",
"typescript": "3.9.3"
}
}
24 changes: 1 addition & 23 deletions packages/nightingale-ansi-formatter/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"createDefaultProgram": true
},
"plugins": ["@typescript-eslint"],
"extends": ["@pob/eslint-config-typescript", "@pob/eslint-config-babel-node"],
"overrides": [
{
"files": ["src/**/*.test.ts", "src/__tests__/**/*.ts"],
"env": {
"jest": true
},
"rules": {
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true
}
]
}
}
]
"extends": ["@pob/eslint-config", "@pob/eslint-config-node"]
}
6 changes: 2 additions & 4 deletions packages/nightingale-ansi-formatter/.yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
"codecov": true
},
"documentation": false
}
},
"nightingale-ansi-formatter": {
"type": {
},
"project": {
"type": "lib"
}
}
Expand Down
6 changes: 5 additions & 1 deletion packages/nightingale-ansi-formatter/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
/* eslint-disable import/no-dynamic-require, prettier/prettier */

'use strict';

const production = process.env.NODE_ENV === 'production';
module.exports = require('./dist/index-node10' + (production ? '' : '-dev') + '.cjs');
module.exports = require(`./dist/index-node10${production ? '' : '-dev'}.cjs`);
54 changes: 37 additions & 17 deletions packages/nightingale-ansi-formatter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"name": "nightingale-ansi-formatter",
"version": "4.2.2",
"description": "Nightingale ANSI formatter",
"keywords": ["nightingale", "nightingale-formatter"],
"keywords": [
"nightingale",
"nightingale-formatter"
],
"author": "Christophe Hurpeau <christophe@hurpeau.com> (http://christophe.hurpeau.com/)",
"license": "ISC",
"repository": {
Expand All @@ -23,7 +26,7 @@
"build:definitions": "tsc -p tsconfig.build.json",
"clean": "rm -Rf docs dist test/node6 coverage",
"generate:test-coverage": "rm -Rf docs/coverage/ ; NODE_ENV=production BABEL_ENV=test jest --coverage --coverageReporters=pob-lcov-reporter --coverageDirectory=docs/coverage/",
"lint": "eslint --ext .js,.ts --quiet src",
"lint": "eslint --ext .js,.ts --quiet *.js src",
"test": "jest",
"test:watch": "jest",
"watch": "pob-watch"
Expand All @@ -39,8 +42,13 @@
"<rootDir>/src/**/__tests__/**/*.ts",
"<rootDir>/src/**/*.test.ts"
],
"collectCoverageFrom": ["src/**/*.ts"],
"moduleFileExtensions": ["ts", "js"],
"collectCoverageFrom": [
"src/**/*.ts"
],
"moduleFileExtensions": [
"ts",
"js"
],
"transform": {
"^.+\\.ts$": "babel-jest"
},
Expand All @@ -51,10 +59,15 @@
{
"target": "node",
"version": "10",
"formats": ["cjs", "es"]
"formats": [
"cjs",
"es"
]
}
],
"entries": ["index"]
"entries": [
"index"
]
},
"dependencies": {
"@types/ansi-styles": "^3.2.1",
Expand All @@ -63,18 +76,25 @@
"nightingale-types": "^2.2.2"
},
"devDependencies": {
"@babel/core": "7.8.3",
"@pob/eslint-config-babel-node": "34.0.0",
"@pob/eslint-config-typescript": "34.0.0",
"@pob/version": "5.0.1",
"@types/jest": "24.9.1",
"babel-jest": "25.1.0",
"babel-preset-latest-node": "4.0.1",
"@babel/core": "7.9.6",
"@pob/eslint-config": "37.1.0",
"@pob/eslint-config-babel-node": "37.0.2",
"@pob/eslint-config-node": "37.0.2",
"@pob/eslint-config-typescript": "37.1.0",
"@types/jest": "25.2.1",
"@typescript-eslint/eslint-plugin": "2.34.0",
"babel-jest": "26.0.1",
"babel-preset-latest-node": "4.1.0",
"eslint": "6.8.0",
"jest": "25.1.0",
"pob-babel": "24.3.0",
"pob-lcov-reporter": "2.0.0",
"prettier": "1.19.1",
"eslint-import-resolver-node": "0.3.3",
"eslint-plugin-import": "2.20.2",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-prettier": "3.1.3",
"eslint-plugin-unicorn": "18.0.1",
"jest": "26.0.1",
"pob-babel": "24.11.1",
"pob-lcov-reporter": "2.2.2",
"prettier": "2.0.5",
"xunit-file": "1.0.0"
}
}
34 changes: 34 additions & 0 deletions packages/nightingale-ansi-formatter/src/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"createDefaultProgram": true
},
"plugins": [
"@typescript-eslint"
],
"extends": [
"@pob/eslint-config-typescript",
"@pob/eslint-config-babel-node"
],
"overrides": [
{
"files": [
"**/*.test.ts",
"__tests__/**/*.ts"
],
"env": {
"jest": true
},
"rules": {
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true
}
]
}
}
]
}
Loading

0 comments on commit 8eb74d9

Please sign in to comment.