Skip to content
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
5 changes: 3 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ jobs:

strategy:
matrix:
node: [10.x, 11.x, 12.x, 14.x, 15.x]
# Test with Node.js v12 (LTS), v14 (LTS), and v16 (latest)
node: [12.x, 14.x, 15.x, 16.x]

steps:
- uses: actions/checkout@v1
Expand Down Expand Up @@ -38,7 +39,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'

- name: install dependencies
Expand Down
9 changes: 5 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const {jest: jestConfig} = require('./src/config')
const {jest} = require('./src/config')

module.exports = Object.assign(jestConfig, {
module.exports = {
...jest,
coverageThreshold: null,
testPathIgnorePatterns: [
...jestConfig.testPathIgnorePatterns,
...jest.testPathIgnorePatterns,
'./src/scripts/test.js',
],
})
}
1 change: 1 addition & 0 deletions jest.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// eslint-ignore-next-line import/extensions
module.exports = require('./dist/config/jest.config')
51 changes: 27 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0-semantically-released",
"description": "CLI for common scripts for my projects",
"engines": {
"node": ">=12",
"node": ">=12.13.0",
"npm": ">=6",
"yarn": ">=1"
},
Expand Down Expand Up @@ -35,58 +35,59 @@
"author": "Chris O'Donnell <[email protected]> (http://codfish.io/)",
"license": "MIT",
"dependencies": {
"@babel/cli": "^7.13.16",
"@babel/core": "^7.13.16",
"@babel/cli": "^7.14.3",
"@babel/core": "^7.14.3",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-transform-modules-commonjs": "^7.13.0",
"@babel/plugin-transform-runtime": "^7.13.15",
"@babel/preset-env": "^7.13.15",
"@babel/plugin-transform-modules-commonjs": "^7.14.0",
"@babel/plugin-transform-runtime": "^7.14.3",
"@babel/preset-env": "^7.14.4",
"@babel/preset-react": "^7.13.13",
"@babel/preset-typescript": "^7.13.0",
"@babel/runtime": "^7.13.17",
"@commitlint/cli": "^12.1.1",
"@commitlint/config-conventional": "^12.1.1",
"@babel/runtime": "^7.14.0",
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^18.0.0",
"@rollup/plugin-commonjs": "^19.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.2.1",
"@rollup/plugin-node-resolve": "^13.0.0",
"@rollup/plugin-replace": "^2.4.2",
"@types/jest": "^26.0.22",
"@types/jest": "^26.0.23",
"arrify": "^2.0.1",
"babel-jest": "^26.6.3",
"babel-plugin-macros": "^3.0.0",
"babel-jest": "^27.0.1",
"babel-plugin-macros": "^3.1.0",
"babel-plugin-minify-dead-code-elimination": "^0.5.1",
"babel-plugin-module-resolver": "^4.0.0",
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"browserslist": "^4.16.5",
"browserslist": "^4.16.6",
"builtin-modules": "^3.2.0",
"chalk": "^4.1.1",
"concurrently": "^6.0.2",
"concurrently": "^6.2.0",
"cosmiconfig": "^7.0.0",
"cpy": "^8.1.2",
"cross-env": "^7.0.3",
"cross-spawn": "^7.0.3",
"doctoc": "^2.0.0",
"eslint": "^7.25.0",
"eslint": "^7.27.0",
"eslint-config-codfish": "^10.0.0",
"glob": "^7.1.5",
"glob": "^7.1.7",
"husky": "^6.0.0",
"is-ci": "^3.0.0",
"jest": "^26.6.1",
"jest": "^27.0.1",
"jest-serializer-path": "^0.1.15",
"jest-watch-typeahead": "^0.6.3",
"lint-staged": "^10.5.4",
"jest-snapshot-serializer-raw": "^1.2.0",
"jest-watch-typeahead": "^0.6.4",
"lint-staged": "^11.0.0",
"lodash.camelcase": "^4.3.0",
"lodash.has": "^4.5.2",
"lodash.omit": "^4.5.0",
"mkdirp": "^1.0.4",
"prettier": "2.2.1",
"prettier": "^2.3.0",
"react-app-polyfill": "^2.0.0",
"read-pkg-up": "^7.0.1",
"resolve": "^1.20.0",
"rimraf": "^3.0.2",
"rollup": "^2.45.2",
"rollup": "^2.50.5",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-size-snapshot": "^0.12.0",
Expand All @@ -100,7 +101,6 @@
"./src/config/eslintrc.js"
],
"rules": {
"no-console": "off",
"semi": "off",
"@babel/semi": "off",
"object-curly-spacing": "off",
Expand All @@ -110,7 +110,10 @@
"no-prototype-builtins": "off",
"no-useless-catch": "off",
"import/no-dynamic-require": "off",
"import/no-import-module-exports": "off",
"import/no-unassigned-import": "off",
"import/extensions": "off",
"no-console": "off",
"no-nested-ternary": "off",
"no-use-before-define": "off",
"no-restricted-syntax": "off",
Expand Down
42 changes: 21 additions & 21 deletions src/__tests__/__snapshots__/utils.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@

exports[`getConcurrentlyArgs gives good args to pass to concurrently 1`] = `
Array [
"--kill-others-on-fail",
"--prefix",
"[{name}]",
"--names",
"build,lint,test,validate,a,b,c,d,e,f,g,h,i,j",
"--prefix-colors",
"bgBlue.bold.white,bgGreen.bold.white,bgMagenta.bold.white,bgCyan.bold.white,bgWhite.bold.white,bgRed.bold.white,bgBlack.bold.white,bgYellow.bold.white,bgBlue.bold.white,bgGreen.bold.white,bgMagenta.bold.white,bgCyan.bold.white,bgWhite.bold.white,bgRed.bold.white",
"\\"echo build\\"",
"\\"echo lint\\"",
"\\"echo test\\"",
"\\"echo validate\\"",
"\\"echo a\\"",
"\\"echo b\\"",
"\\"echo c\\"",
"\\"echo d\\"",
"\\"echo e\\"",
"\\"echo f\\"",
"\\"echo g\\"",
"\\"echo h\\"",
"\\"echo i\\"",
"\\"echo j\\"",
--kill-others-on-fail,
--prefix,
[{name}],
--names,
build,lint,test,validate,a,b,c,d,e,f,g,h,i,j,
--prefix-colors,
bgBlue.bold.white,bgGreen.bold.white,bgMagenta.bold.white,bgCyan.bold.white,bgWhite.bold.white,bgRed.bold.white,bgBlack.bold.white,bgYellow.bold.white,bgBlue.bold.white,bgGreen.bold.white,bgMagenta.bold.white,bgCyan.bold.white,bgWhite.bold.white,bgRed.bold.white,
"echo build",
"echo lint",
"echo test",
"echo validate",
"echo a",
"echo b",
"echo c",
"echo d",
"echo e",
"echo f",
"echo g",
"echo h",
"echo i",
"echo j",
]
`;
2 changes: 0 additions & 2 deletions src/__tests__/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import path from 'path'
import slash from 'slash'
import cases from 'jest-in-case'
import {unquoteSerializer} from '../scripts/__tests__/helpers/serializers'

const projectRoot = path.join(__dirname, '../../')

expect.addSnapshotSerializer(unquoteSerializer)
expect.addSnapshotSerializer({
print: val => slash(val.replace(projectRoot, '<PROJECT_ROOT>/')),
test: val => typeof val === 'string' && val.includes(projectRoot),
Expand Down
2 changes: 1 addition & 1 deletion src/config/babel-transform.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const babelJest = require('babel-jest')
const babelJest = require('babel-jest').default

module.exports = babelJest.createTransformer({
presets: [require.resolve('./babelrc')],
Expand Down
3 changes: 1 addition & 2 deletions src/config/babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ function getNodeVersion({engines: {node: nodeVersion = '10.13'} = {}}) {
* @see https://github.com/browserslist/browserslist/blob/master/node.js#L139
*/
const browsersConfig = browserslist.loadConfig({path: appDirectory}) || [
'ie 10',
'ios 7',
'defaults',
]

const envTargets = isTest
Expand Down
4 changes: 4 additions & 0 deletions src/config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ const jestConfig = {
require.resolve('jest-watch-typeahead/filename'),
require.resolve('jest-watch-typeahead/testname'),
],
snapshotSerializers: [
require.resolve('jest-serializer-path'),
require.resolve('jest-snapshot-serializer-raw/always'),
],
}

const setupFilesAfterEnv = [
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/__tests__/format.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import cases from 'jest-in-case'
import {unquoteSerializer, winPathSerializer} from './helpers/serializers'

expect.addSnapshotSerializer(unquoteSerializer)
import {winPathSerializer} from './helpers/serializers'

expect.addSnapshotSerializer(winPathSerializer)

cases(
Expand Down
6 changes: 0 additions & 6 deletions src/scripts/__tests__/helpers/serializers.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import slash from 'slash'

// this removes the quotes around strings...
export const unquoteSerializer = {
print: val => val,
test: val => typeof val === 'string',
}

// this converts windows style file paths to unix...
export const winPathSerializer = {
print: val => slash(val),
Expand Down
8 changes: 2 additions & 6 deletions src/scripts/__tests__/lint.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import cases from 'jest-in-case'
import {
unquoteSerializer,
winPathSerializer,
relativePathSerializer,
} from './helpers/serializers'

expect.addSnapshotSerializer(unquoteSerializer)
import {winPathSerializer, relativePathSerializer} from './helpers/serializers'

expect.addSnapshotSerializer(winPathSerializer)
expect.addSnapshotSerializer(relativePathSerializer)

Expand Down
4 changes: 2 additions & 2 deletions src/scripts/__tests__/pre-commit.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import cases from 'jest-in-case'
import {unquoteSerializer, winPathSerializer} from './helpers/serializers'

expect.addSnapshotSerializer(unquoteSerializer)
import {winPathSerializer} from './helpers/serializers'

expect.addSnapshotSerializer(winPathSerializer)

cases(
Expand Down
3 changes: 0 additions & 3 deletions src/scripts/__tests__/test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import cases from 'jest-in-case'
import {unquoteSerializer} from './helpers/serializers'

jest.mock('jest', () => ({run: jest.fn()}))
jest.mock('../../config/jest.config', () => ({builtInConfig: true}))
let mockIsCI = false
jest.mock('is-ci', () => mockIsCI)

expect.addSnapshotSerializer(unquoteSerializer)

cases(
'test',
({
Expand Down
3 changes: 0 additions & 3 deletions src/scripts/__tests__/validate.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import cases from 'jest-in-case'
import {unquoteSerializer} from './helpers/serializers'

expect.addSnapshotSerializer(unquoteSerializer)

function setupWithScripts(scripts = ['test', 'lint', 'build', 'typecheck']) {
return function setup() {
Expand Down